merge: upstream

This commit is contained in:
Mar0xy 2023-09-26 02:26:30 +02:00
commit 8595a325ce
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
145 changed files with 3208 additions and 1285 deletions

View file

@ -34,12 +34,15 @@ export function createAiScriptEnv(opts) {
return confirm.canceled ? values.FALSE : values.TRUE;
}),
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
utils.assertString(ep);
if (ep.value.includes('://')) throw new Error('invalid endpoint');
if (token) {
utils.assertString(token);
// バグがあればundefinedもあり得るため念のため
if (typeof token.value !== 'string') throw new Error('invalid token');
}
return os.api(ep.value, utils.valToJs(param), token ? token.value : (opts.token ?? null)).then(res => {
const actualToken: string|null = token?.value ?? opts.token ?? null;
return os.api(ep.value, utils.valToJs(param), actualToken).then(res => {
return utils.jsToVal(res);
}, err => {
return values.ERROR('request_failed', utils.jsToVal(err));

View file

@ -383,8 +383,8 @@ export function getNoteMenu(props: {
.filter(x => x !== undefined);
} else {
menu = [{
icon: 'ti ti-external-link',
text: i18n.ts.detailed,
icon: 'ti ti-info-circle',
text: i18n.ts.details,
action: openDetail,
}, {
icon: 'ti ti-copy',