Merge branch 'develop' of misskey-dev into merge-upstream
This commit is contained in:
@@ -29,7 +29,7 @@ import { ref, computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { version } from '@/config.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -46,7 +46,7 @@ const loaded = ref(false);
|
||||
const serverIsDead = ref(false);
|
||||
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
||||
|
||||
os.api('meta', {
|
||||
misskeyApi('meta', {
|
||||
detail: false,
|
||||
}).then(res => {
|
||||
loaded.value = true;
|
||||
|
||||
@@ -114,7 +114,7 @@ import FormSplit from '@/components/form/split.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import MkInstanceStats from '@/components/MkInstanceStats.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import number from '@/filters/number.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -136,7 +136,7 @@ watch(tab, () => {
|
||||
}
|
||||
});
|
||||
|
||||
const initStats = () => os.api('stats', {
|
||||
const initStats = () => misskeyApi('stats', {
|
||||
}).then((res) => {
|
||||
stats.value = res;
|
||||
});
|
||||
|
||||
@@ -79,6 +79,7 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { iAmAdmin, iAmModerator } from '@/account.js';
|
||||
@@ -93,8 +94,8 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
async function fetch() {
|
||||
file.value = await os.api('drive/files/show', { fileId: props.fileId });
|
||||
info.value = await os.api('admin/drive/show-file', { fileId: props.fileId });
|
||||
file.value = await misskeyApi('drive/files/show', { fileId: props.fileId });
|
||||
info.value = await misskeyApi('admin/drive/show-file', { fileId: props.fileId });
|
||||
isSensitive.value = file.value.isSensitive;
|
||||
}
|
||||
|
||||
@@ -113,7 +114,7 @@ async function del() {
|
||||
}
|
||||
|
||||
async function toggleIsSensitive(v) {
|
||||
await os.api('drive/files/update', { fileId: props.fileId, isSensitive: v });
|
||||
await misskeyApi('drive/files/update', { fileId: props.fileId, isSensitive: v });
|
||||
isSensitive.value = v;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,6 +220,7 @@ import FormSuspense from '@/components/form/suspense.vue';
|
||||
import MkFileListForAdmin from '@/components/MkFileListForAdmin.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { url } from '@/config.js';
|
||||
import { acct } from '@/filters/user.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -266,11 +267,11 @@ const announcementsPagination = {
|
||||
const expandedRoles = ref([]);
|
||||
|
||||
function createFetcher() {
|
||||
return () => Promise.all([os.api('users/show', {
|
||||
return () => Promise.all([misskeyApi('users/show', {
|
||||
userId: props.userId,
|
||||
}), os.api('admin/show-user', {
|
||||
}), misskeyApi('admin/show-user', {
|
||||
userId: props.userId,
|
||||
}), iAmAdmin ? os.api('admin/get-user-ips', {
|
||||
}), iAmAdmin ? misskeyApi('admin/get-user-ips', {
|
||||
userId: props.userId,
|
||||
}) : Promise.resolve(null)]).then(([_user, _info, _ips]) => {
|
||||
user.value = _user;
|
||||
@@ -283,7 +284,7 @@ function createFetcher() {
|
||||
moderationNote.value = info.value.moderationNote;
|
||||
|
||||
watch(moderationNote, async () => {
|
||||
await os.api('admin/update-user-note', { userId: user.value.id, text: moderationNote.value });
|
||||
await misskeyApi('admin/update-user-note', { userId: user.value.id, text: moderationNote.value });
|
||||
await refreshUser();
|
||||
});
|
||||
});
|
||||
@@ -306,7 +307,7 @@ async function resetPassword() {
|
||||
if (confirm.canceled) {
|
||||
return;
|
||||
} else {
|
||||
const { password } = await os.api('admin/reset-password', {
|
||||
const { password } = await misskeyApi('admin/reset-password', {
|
||||
userId: user.value.id,
|
||||
});
|
||||
os.alert({
|
||||
@@ -324,7 +325,7 @@ async function toggleSuspend(v) {
|
||||
if (confirm.canceled) {
|
||||
suspended.value = !v;
|
||||
} else {
|
||||
await os.api(v ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: user.value.id });
|
||||
await misskeyApi(v ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: user.value.id });
|
||||
await refreshUser();
|
||||
}
|
||||
}
|
||||
@@ -336,7 +337,7 @@ async function unsetUserAvatar() {
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
const process = async () => {
|
||||
await os.api('admin/unset-user-avatar', { userId: user.value.id });
|
||||
await misskeyApi('admin/unset-user-avatar', { userId: user.value.id });
|
||||
os.success();
|
||||
};
|
||||
await process().catch(err => {
|
||||
@@ -355,7 +356,7 @@ async function unsetUserBanner() {
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
const process = async () => {
|
||||
await os.api('admin/unset-user-banner', { userId: user.value.id });
|
||||
await misskeyApi('admin/unset-user-banner', { userId: user.value.id });
|
||||
os.success();
|
||||
};
|
||||
await process().catch(err => {
|
||||
@@ -374,7 +375,7 @@ async function deleteAllFiles() {
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
const process = async () => {
|
||||
await os.api('admin/delete-all-files-of-a-user', { userId: user.value.id });
|
||||
await misskeyApi('admin/delete-all-files-of-a-user', { userId: user.value.id });
|
||||
os.success();
|
||||
};
|
||||
await process().catch(err => {
|
||||
@@ -411,7 +412,7 @@ async function deleteAccount() {
|
||||
}
|
||||
|
||||
async function assignRole() {
|
||||
const roles = await os.api('admin/roles/list');
|
||||
const roles = await misskeyApi('admin/roles/list');
|
||||
|
||||
const { canceled, result: roleId } = await os.select({
|
||||
title: i18n.ts._role.chooseRoleToAssign,
|
||||
@@ -495,7 +496,7 @@ watch(() => props.userId, () => {
|
||||
});
|
||||
|
||||
watch(user, () => {
|
||||
os.api('ap/get', {
|
||||
misskeyApi('ap/get', {
|
||||
uri: user.value.uri ?? `${url}/users/${user.value.id}`,
|
||||
}).then(res => {
|
||||
ap.value = res;
|
||||
|
||||
@@ -97,6 +97,7 @@ import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
@@ -109,7 +110,7 @@ const daysOfWeek: string[] = [i18n.ts._weekday.sunday, i18n.ts._weekday.monday,
|
||||
const filterType = ref('all');
|
||||
let publishing: boolean | null = null;
|
||||
|
||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||
misskeyApi('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||
if (adsResponse != null) {
|
||||
ads.value = adsResponse.map(r => {
|
||||
const exdate = new Date(r.expiresAt);
|
||||
@@ -175,7 +176,7 @@ function remove(ad) {
|
||||
|
||||
function save(ad) {
|
||||
if (ad.id == null) {
|
||||
os.api('admin/ad/create', {
|
||||
misskeyApi('admin/ad/create', {
|
||||
...ad,
|
||||
expiresAt: new Date(ad.expiresAt).getTime(),
|
||||
startsAt: new Date(ad.startsAt).getTime(),
|
||||
@@ -192,7 +193,7 @@ function save(ad) {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
os.api('admin/ad/update', {
|
||||
misskeyApi('admin/ad/update', {
|
||||
...ad,
|
||||
expiresAt: new Date(ad.expiresAt).getTime(),
|
||||
startsAt: new Date(ad.startsAt).getTime(),
|
||||
@@ -211,7 +212,7 @@ function save(ad) {
|
||||
}
|
||||
|
||||
function more() {
|
||||
os.api('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
||||
misskeyApi('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
||||
if (adsResponse == null) return;
|
||||
ads.value = ads.value.concat(adsResponse.map(r => {
|
||||
const exdate = new Date(r.expiresAt);
|
||||
@@ -228,7 +229,7 @@ function more() {
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||
misskeyApi('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||
if (adsResponse == null) return;
|
||||
ads.value = adsResponse.map(r => {
|
||||
const exdate = new Date(r.expiresAt);
|
||||
|
||||
@@ -104,6 +104,7 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
@@ -162,7 +163,7 @@ function del(announcement) {
|
||||
}).then(({ canceled }) => {
|
||||
if (canceled) return;
|
||||
announcements.value = announcements.value.filter(x => x !== announcement);
|
||||
os.api('admin/announcements/delete', announcement);
|
||||
misskeyApi('admin/announcements/delete', announcement);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -189,7 +190,7 @@ function fetch(resetOffset = false): void {
|
||||
offset.value = 0;
|
||||
}
|
||||
|
||||
os.api('admin/announcements/list', {
|
||||
misskeyApi('admin/announcements/list', {
|
||||
offsetMode: true,
|
||||
offset: offset.value,
|
||||
limit: 10,
|
||||
|
||||
@@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkRadios v-model="provider">
|
||||
<option :value="null">{{ i18n.ts.none }} ({{ i18n.ts.notRecommended }})</option>
|
||||
<option value="hcaptcha">hCaptcha</option>
|
||||
<option value="mcaptcha">mCaptcha</option>
|
||||
<option value="recaptcha">reCAPTCHA</option>
|
||||
<option value="turnstile">Turnstile</option>
|
||||
</MkRadios>
|
||||
@@ -28,6 +29,24 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkCaptcha provider="hcaptcha" :sitekey="hcaptchaSiteKey || '10000000-ffff-ffff-ffff-000000000001'"/>
|
||||
</FormSlot>
|
||||
</template>
|
||||
<template v-else-if="provider === 'mcaptcha'">
|
||||
<MkInput v-model="mcaptchaSiteKey">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>{{ i18n.ts.mcaptchaSiteKey }}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="mcaptchaSecretKey">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>{{ i18n.ts.mcaptchaSecretKey }}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="mcaptchaInstanceUrl">
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #label>{{ i18n.ts.mcaptchaInstanceUrl }}</template>
|
||||
</MkInput>
|
||||
<FormSlot v-if="mcaptchaSiteKey && mcaptchaInstanceUrl">
|
||||
<template #label>{{ i18n.ts.preview }}</template>
|
||||
<MkCaptcha provider="mcaptcha" :sitekey="mcaptchaSiteKey" :instanceUrl="mcaptchaInstanceUrl"/>
|
||||
</FormSlot>
|
||||
</template>
|
||||
<template v-else-if="provider === 'recaptcha'">
|
||||
<MkInput v-model="recaptchaSiteKey">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
@@ -72,6 +91,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import FormSlot from '@/components/form/slot.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
@@ -80,21 +100,30 @@ const MkCaptcha = defineAsyncComponent(() => import('@/components/MkCaptcha.vue'
|
||||
const provider = ref<CaptchaProvider | null>(null);
|
||||
const hcaptchaSiteKey = ref<string | null>(null);
|
||||
const hcaptchaSecretKey = ref<string | null>(null);
|
||||
const mcaptchaSiteKey = ref<string | null>(null);
|
||||
const mcaptchaSecretKey = ref<string | null>(null);
|
||||
const mcaptchaInstanceUrl = ref<string | null>(null);
|
||||
const recaptchaSiteKey = ref<string | null>(null);
|
||||
const recaptchaSecretKey = ref<string | null>(null);
|
||||
const turnstileSiteKey = ref<string | null>(null);
|
||||
const turnstileSecretKey = ref<string | null>(null);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
hcaptchaSiteKey.value = meta.hcaptchaSiteKey;
|
||||
hcaptchaSecretKey.value = meta.hcaptchaSecretKey;
|
||||
mcaptchaSiteKey.value = meta.mcaptchaSiteKey;
|
||||
mcaptchaSecretKey.value = meta.mcaptchaSecretKey;
|
||||
mcaptchaInstanceUrl.value = meta.mcaptchaInstanceUrl;
|
||||
recaptchaSiteKey.value = meta.recaptchaSiteKey;
|
||||
recaptchaSecretKey.value = meta.recaptchaSecretKey;
|
||||
turnstileSiteKey.value = meta.turnstileSiteKey;
|
||||
turnstileSecretKey.value = meta.turnstileSecretKey;
|
||||
|
||||
provider.value = meta.enableHcaptcha ? 'hcaptcha' : meta.enableRecaptcha ? 'recaptcha' : meta.enableTurnstile ? 'turnstile' : null;
|
||||
provider.value = meta.enableHcaptcha ? 'hcaptcha' :
|
||||
meta.enableRecaptcha ? 'recaptcha' :
|
||||
meta.enableTurnstile ? 'turnstile' :
|
||||
meta.enableMcaptcha ? 'mcaptcha' : null;
|
||||
}
|
||||
|
||||
function save() {
|
||||
@@ -102,6 +131,10 @@ function save() {
|
||||
enableHcaptcha: provider.value === 'hcaptcha',
|
||||
hcaptchaSiteKey: hcaptchaSiteKey.value,
|
||||
hcaptchaSecretKey: hcaptchaSecretKey.value,
|
||||
enableMcaptcha: provider.value === 'mcaptcha',
|
||||
mcaptchaSiteKey: mcaptchaSiteKey.value,
|
||||
mcaptchaSecretKey: mcaptchaSecretKey.value,
|
||||
mcaptchaInstanceUrl: mcaptchaInstanceUrl.value,
|
||||
enableRecaptcha: provider.value === 'recaptcha',
|
||||
recaptchaSiteKey: recaptchaSiteKey.value,
|
||||
recaptchaSecretKey: recaptchaSecretKey.value,
|
||||
|
||||
@@ -101,6 +101,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { instance, fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -122,7 +123,7 @@ const notFoundImageUrl = ref<string | null>(null);
|
||||
const manifestJsonOverride = ref<string>('{}');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
iconUrl.value = meta.iconUrl;
|
||||
app192IconUrl.value = meta.app192IconUrl;
|
||||
app512IconUrl.value = meta.app512IconUrl;
|
||||
|
||||
@@ -21,13 +21,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { computed } from 'vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import number from '@/filters/number.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const databasePromiseFactory = () => os.api('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
||||
const databasePromiseFactory = () => misskeyApi('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ import FormSuspense from '@/components/form/suspense.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance, instance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -87,7 +88,7 @@ const smtpUser = ref<string>('');
|
||||
const smtpPass = ref<string>('');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
enableEmail.value = meta.enableEmail;
|
||||
email.value = meta.email;
|
||||
smtpSecure.value = meta.smtpSecure;
|
||||
|
||||
@@ -42,6 +42,7 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -50,7 +51,7 @@ const deeplAuthKey = ref<string>('');
|
||||
const deeplIsPro = ref<boolean>(false);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
deeplAuthKey.value = meta.deeplAuthKey;
|
||||
deeplIsPro.value = meta.deeplIsPro;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkFileListForAdmin from '@/components/MkFileListForAdmin.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
@@ -83,7 +84,7 @@ async function find() {
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
os.api('admin/drive/show-file', q.startsWith('http://') || q.startsWith('https://') ? { url: q.trim() } : { fileId: q.trim() }).then(file => {
|
||||
misskeyApi('admin/drive/show-file', q.startsWith('http://') || q.startsWith('https://') ? { url: q.trim() } : { fileId: q.trim() }).then(file => {
|
||||
show(file);
|
||||
}).catch(err => {
|
||||
if (err.code === 'NO_SUCH_FILE') {
|
||||
|
||||
@@ -34,9 +34,10 @@ import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import { instance } from '@/instance.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { lookupUser, lookupUserByEmail } from '@/scripts/lookup-user.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { PageMetadata, definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const isEmpty = (x: string | null) => x == null || x === '';
|
||||
|
||||
@@ -62,7 +63,7 @@ let noEmailServer = !instance.enableEmail;
|
||||
const thereIsUnresolvedAbuseReport = ref(false);
|
||||
const currentPage = computed(() => router.currentRef.value.child);
|
||||
|
||||
os.api('admin/abuse-user-reports', {
|
||||
misskeyApi('admin/abuse-user-reports', {
|
||||
state: 'unresolved',
|
||||
limit: 1,
|
||||
}).then(reports => {
|
||||
@@ -266,7 +267,7 @@ provideMetadataReceiver((info) => {
|
||||
});
|
||||
|
||||
function invite() {
|
||||
os.api('admin/invite/create').then(x => {
|
||||
misskeyApi('admin/invite/create').then(x => {
|
||||
os.alert({
|
||||
type: 'info',
|
||||
text: x[0].code,
|
||||
|
||||
@@ -33,6 +33,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -43,7 +44,7 @@ const sensitiveMediaHosts = ref<string>('');
|
||||
const tab = ref('block');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
blockedHosts.value = meta.blockedHosts.join('\n');
|
||||
silencedHosts.value = meta.silencedHosts.join('\n');
|
||||
sensitiveMediaHosts.value = meta.sensitiveMediaHosts.join('\n');
|
||||
|
||||
@@ -59,6 +59,7 @@ import { computed, ref, shallowRef } from 'vue';
|
||||
import XHeader from './_header_.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
@@ -93,14 +94,14 @@ async function createWithOptions() {
|
||||
count: createCount.value,
|
||||
};
|
||||
|
||||
const tickets = await os.api('admin/invite/create', options);
|
||||
const tickets = await misskeyApi('admin/invite/create', options);
|
||||
os.alert({
|
||||
type: 'success',
|
||||
title: i18n.ts.inviteCodeCreated,
|
||||
text: tickets?.map(x => x.code).join('\n'),
|
||||
text: tickets.map(x => x.code).join('\n'),
|
||||
});
|
||||
|
||||
tickets?.forEach(ticket => pagingComponent.value?.prepend(ticket));
|
||||
tickets.forEach(ticket => pagingComponent.value?.prepend(ticket));
|
||||
}
|
||||
|
||||
function deleted(id: string) {
|
||||
|
||||
@@ -71,6 +71,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -87,7 +88,7 @@ const privacyPolicyUrl = ref<string | null>(null);
|
||||
const urlPreviewDenyList = ref<string | undefined>('');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
enableRegistration.value = !meta.disableRegistration;
|
||||
emailRequiredForSignup.value = meta.emailRequiredForSignup;
|
||||
sensitiveWords.value = meta.sensitiveWords.join('\n');
|
||||
|
||||
@@ -90,6 +90,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -110,7 +111,7 @@ const objectStorageSetPublicRead = ref<boolean>(false);
|
||||
const objectStorageS3ForcePathStyle = ref<boolean>(true);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
useObjectStorage.value = meta.useObjectStorage;
|
||||
objectStorageBaseUrl.value = meta.objectStorageBaseUrl;
|
||||
objectStorageBucket.value = meta.objectStorageBucket;
|
||||
|
||||
@@ -47,6 +47,7 @@ import { ref, computed } from 'vue';
|
||||
import XHeader from './_header_.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -58,7 +59,7 @@ const enableChartsForRemoteUser = ref<boolean>(false);
|
||||
const enableChartsForFederatedInstances = ref<boolean>(false);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
enableServerMachineStats.value = meta.enableServerMachineStats;
|
||||
enableIdenticonGeneration.value = meta.enableIdenticonGeneration;
|
||||
enableChartsForRemoteUser.value = meta.enableChartsForRemoteUser;
|
||||
|
||||
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { onMounted, shallowRef, ref } from 'vue';
|
||||
import { Chart } from 'chart.js';
|
||||
import gradient from 'chartjs-plugin-gradient';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||
@@ -52,7 +52,7 @@ async function renderChart() {
|
||||
}));
|
||||
};
|
||||
|
||||
const raw = await os.api('charts/active-users', { limit: chartLimit, span: 'day' });
|
||||
const raw = await misskeyApi('charts/active-users', { limit: chartLimit, span: 'day' });
|
||||
|
||||
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { onMounted, shallowRef, ref } from 'vue';
|
||||
import { Chart } from 'chart.js';
|
||||
import gradient from 'chartjs-plugin-gradient';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
@@ -65,7 +65,7 @@ onMounted(async () => {
|
||||
}));
|
||||
};
|
||||
|
||||
const raw = await os.api('charts/ap-request', { limit: chartLimit, span: 'day' });
|
||||
const raw = await misskeyApi('charts/ap-request', { limit: chartLimit, span: 'day' });
|
||||
|
||||
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
||||
const succColor = '#87e000';
|
||||
|
||||
@@ -49,6 +49,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { onMounted, ref } from 'vue';
|
||||
import XPie, { type InstanceForPie } from './overview.pie.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import number from '@/filters/number.js';
|
||||
import MkNumberDiff from '@/components/MkNumberDiff.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -65,13 +66,13 @@ const fetching = ref(true);
|
||||
const { handler: externalTooltipHandler } = useChartTooltip();
|
||||
|
||||
onMounted(async () => {
|
||||
const chart = await os.apiGet('charts/federation', { limit: 2, span: 'day' });
|
||||
const chart = await misskeyApiGet('charts/federation', { limit: 2, span: 'day' });
|
||||
federationPubActive.value = chart.pubActive[0];
|
||||
federationPubActiveDiff.value = chart.pubActive[0] - chart.pubActive[1];
|
||||
federationSubActive.value = chart.subActive[0];
|
||||
federationSubActiveDiff.value = chart.subActive[0] - chart.subActive[1];
|
||||
|
||||
os.apiGet('federation/stats', { limit: 10 }).then(res => {
|
||||
misskeyApiGet('federation/stats', { limit: 10 }).then(res => {
|
||||
topSubInstancesForPie.value = [
|
||||
...res.topSubInstances.map(x => ({
|
||||
name: x.host,
|
||||
|
||||
@@ -18,8 +18,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { useInterval } from '@/scripts/use-interval.js';
|
||||
import MkInstanceCardMini from '@/components/MkInstanceCardMini.vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
@@ -28,7 +28,7 @@ const instances = ref<Misskey.entities.FederationInstance[]>([]);
|
||||
const fetching = ref(true);
|
||||
|
||||
const fetch = async () => {
|
||||
const fetchedInstances = await os.api('federation/instances', {
|
||||
const fetchedInstances = await misskeyApi('federation/instances', {
|
||||
sort: '+latestRequestReceivedAt',
|
||||
limit: 6,
|
||||
});
|
||||
|
||||
@@ -18,15 +18,15 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const moderators = ref<Misskey.entities.UserDetailed[] | null>(null);
|
||||
const fetching = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
moderators.value = await os.api('admin/show-users', {
|
||||
moderators.value = await misskeyApi('admin/show-users', {
|
||||
sort: '+lastActiveDate',
|
||||
state: 'adminOrModerator',
|
||||
limit: 30,
|
||||
|
||||
@@ -63,7 +63,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import MkNumberDiff from '@/components/MkNumberDiff.vue';
|
||||
import MkNumber from '@/components/MkNumber.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -78,17 +78,17 @@ const fetching = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
const [_stats, _onlineUsersCount] = await Promise.all([
|
||||
os.api('stats', {}),
|
||||
os.apiGet('get-online-users-count').then(res => res.count),
|
||||
misskeyApi('stats', {}),
|
||||
misskeyApiGet('get-online-users-count').then(res => res.count),
|
||||
]);
|
||||
stats.value = _stats;
|
||||
onlineUsersCount.value = _onlineUsersCount;
|
||||
|
||||
os.apiGet('charts/users', { limit: 2, span: 'day' }).then(chart => {
|
||||
misskeyApiGet('charts/users', { limit: 2, span: 'day' }).then(chart => {
|
||||
usersComparedToThePrevDay.value = stats.value.originalUsersCount - chart.local.total[1];
|
||||
});
|
||||
|
||||
os.apiGet('charts/notes', { limit: 2, span: 'day' }).then(chart => {
|
||||
misskeyApiGet('charts/notes', { limit: 2, span: 'day' }).then(chart => {
|
||||
notesComparedToThePrevDay.value = stats.value.originalNotesCount - chart.local.total[1];
|
||||
});
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { useInterval } from '@/scripts/use-interval.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
@@ -28,7 +28,7 @@ const newUsers = ref<Misskey.entities.UserDetailed[] | null>(null);
|
||||
const fetching = ref(true);
|
||||
|
||||
const fetch = async () => {
|
||||
const _newUsers = await os.api('admin/show-users', {
|
||||
const _newUsers = await misskeyApi('admin/show-users', {
|
||||
limit: 5,
|
||||
sort: '+createdAt',
|
||||
origin: 'local',
|
||||
|
||||
@@ -79,6 +79,7 @@ import XModerators from './overview.moderators.vue';
|
||||
import XHeatmap from './overview.heatmap.vue';
|
||||
import type { InstanceForPie } from './overview.pie.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import { useStream } from '@/stream.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -117,14 +118,14 @@ onMounted(async () => {
|
||||
magicGrid.listen();
|
||||
*/
|
||||
|
||||
os.apiGet('charts/federation', { limit: 2, span: 'day' }).then(chart => {
|
||||
misskeyApiGet('charts/federation', { limit: 2, span: 'day' }).then(chart => {
|
||||
federationPubActive.value = chart.pubActive[0];
|
||||
federationPubActiveDiff.value = chart.pubActive[0] - chart.pubActive[1];
|
||||
federationSubActive.value = chart.subActive[0];
|
||||
federationSubActiveDiff.value = chart.subActive[0] - chart.subActive[1];
|
||||
});
|
||||
|
||||
os.apiGet('federation/stats', { limit: 10 }).then(res => {
|
||||
misskeyApiGet('federation/stats', { limit: 10 }).then(res => {
|
||||
topSubInstancesForPie.value = [
|
||||
...res.topSubInstances.map(x => ({
|
||||
name: x.host,
|
||||
@@ -149,18 +150,18 @@ onMounted(async () => {
|
||||
];
|
||||
});
|
||||
|
||||
os.api('admin/server-info').then(serverInfoResponse => {
|
||||
misskeyApi('admin/server-info').then(serverInfoResponse => {
|
||||
serverInfo.value = serverInfoResponse;
|
||||
});
|
||||
|
||||
os.api('admin/show-users', {
|
||||
misskeyApi('admin/show-users', {
|
||||
limit: 5,
|
||||
sort: '+createdAt',
|
||||
}).then(res => {
|
||||
newUsers.value = res;
|
||||
});
|
||||
|
||||
os.api('federation/instances', {
|
||||
misskeyApi('federation/instances', {
|
||||
sort: '+latestRequestReceivedAt',
|
||||
limit: 25,
|
||||
}).then(res => {
|
||||
|
||||
@@ -28,6 +28,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -36,10 +37,10 @@ const proxyAccount = ref<Misskey.entities.UserDetailed | null>(null);
|
||||
const proxyAccountId = ref<string | null>(null);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
proxyAccountId.value = meta.proxyAccountId;
|
||||
if (proxyAccountId.value) {
|
||||
proxyAccount.value = await os.api('users/show', { userId: proxyAccountId.value });
|
||||
proxyAccount.value = await misskeyApi('users/show', { userId: proxyAccountId.value });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { markRaw, onMounted, onUnmounted, ref, shallowRef } from 'vue';
|
||||
import XChart from './queue.chart.chart.vue';
|
||||
import number from '@/filters/number.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { useStream } from '@/stream.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
@@ -105,7 +105,7 @@ const onStatsLog = (statsLog) => {
|
||||
|
||||
onMounted(() => {
|
||||
if (props.domain === 'inbox' || props.domain === 'deliver') {
|
||||
os.api(`admin/queue/${props.domain}-delayed`).then(result => {
|
||||
misskeyApi(`admin/queue/${props.domain}-delayed`).then(result => {
|
||||
jobs.value = result;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import * as Misskey from 'misskey-js';
|
||||
import XHeader from './_header_.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
@@ -41,7 +42,7 @@ async function addRelay() {
|
||||
placeholder: i18n.ts.inboxUrl,
|
||||
});
|
||||
if (canceled) return;
|
||||
os.api('admin/relays/add', {
|
||||
misskeyApi('admin/relays/add', {
|
||||
inbox,
|
||||
}).then((relay: any) => {
|
||||
refresh();
|
||||
@@ -54,7 +55,7 @@ async function addRelay() {
|
||||
}
|
||||
|
||||
function remove(inbox: string) {
|
||||
os.api('admin/relays/remove', {
|
||||
misskeyApi('admin/relays/remove', {
|
||||
inbox,
|
||||
}).then(() => {
|
||||
refresh();
|
||||
@@ -67,7 +68,7 @@ function remove(inbox: string) {
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
os.api('admin/relays/list').then(relayList => {
|
||||
misskeyApi('admin/relays/list').then(relayList => {
|
||||
relays.value = relayList;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,11 +28,12 @@ import { v4 as uuid } from 'uuid';
|
||||
import XHeader from './_header_.vue';
|
||||
import XEditor from './roles.editor.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { rolesCache } from '@/cache.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -44,7 +45,7 @@ const role = ref<Misskey.entities.Role | null>(null);
|
||||
const data = ref<any>(null);
|
||||
|
||||
if (props.id) {
|
||||
role.value = await os.api('admin/roles/show', {
|
||||
role.value = await misskeyApi('admin/roles/show', {
|
||||
roleId: props.id,
|
||||
});
|
||||
|
||||
|
||||
@@ -67,14 +67,15 @@ import XHeader from './_header_.vue';
|
||||
import XEditor from './roles.editor.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -92,7 +93,7 @@ const usersPagination = {
|
||||
|
||||
const expandedItems = ref([]);
|
||||
|
||||
const role = reactive(await os.api('admin/roles/show', {
|
||||
const role = reactive(await misskeyApi('admin/roles/show', {
|
||||
roleId: props.id,
|
||||
}));
|
||||
|
||||
|
||||
@@ -265,17 +265,18 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkRange from '@/components/MkRange.vue';
|
||||
import MkRolePreview from '@/components/MkRolePreview.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import { ROLE_POLICIES } from '@/const.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
const baseRoleQ = ref('');
|
||||
|
||||
const roles = await os.api('admin/roles/list');
|
||||
const roles = await misskeyApi('admin/roles/list');
|
||||
|
||||
const policies = reactive<Record<typeof ROLE_POLICIES[number], any>>({});
|
||||
for (const ROLE_POLICY of ROLE_POLICIES) {
|
||||
|
||||
@@ -13,6 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #icon><i class="ti ti-shield"></i></template>
|
||||
<template #label>{{ i18n.ts.botProtection }}</template>
|
||||
<template v-if="enableHcaptcha" #suffix>hCaptcha</template>
|
||||
<template v-else-if="enableMcaptcha" #suffix>mCaptcha</template>
|
||||
<template v-else-if="enableRecaptcha" #suffix>reCAPTCHA</template>
|
||||
<template v-else-if="enableTurnstile" #suffix>Turnstile</template>
|
||||
<template v-else #suffix>{{ i18n.ts.none }} ({{ i18n.ts.notRecommended }})</template>
|
||||
@@ -80,6 +81,17 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Verifymail.io API Auth Key</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="enableTruemailApi" @update:modelValue="save">
|
||||
<template #label>Use TrueMail API</template>
|
||||
</MkSwitch>
|
||||
<MkInput v-model="truemailInstance" @update:modelValue="save">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>TrueMail API Instance</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="truemailAuthKey" @update:modelValue="save">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>TrueMail API Auth Key</template>
|
||||
</MkInput>
|
||||
</div>
|
||||
</MkFolder>
|
||||
|
||||
@@ -137,12 +149,14 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const summalyProxy = ref<string>('');
|
||||
const enableHcaptcha = ref<boolean>(false);
|
||||
const enableMcaptcha = ref<boolean>(false);
|
||||
const enableRecaptcha = ref<boolean>(false);
|
||||
const enableTurnstile = ref<boolean>(false);
|
||||
const sensitiveMediaDetection = ref<string>('none');
|
||||
@@ -153,12 +167,16 @@ const enableIpLogging = ref<boolean>(false);
|
||||
const enableActiveEmailValidation = ref<boolean>(false);
|
||||
const enableVerifymailApi = ref<boolean>(false);
|
||||
const verifymailAuthKey = ref<string | null>(null);
|
||||
const enableTruemailApi = ref<boolean>(false);
|
||||
const truemailInstance = ref<string | null>(null);
|
||||
const truemailAuthKey = ref<string | null>(null);
|
||||
const bannedEmailDomains = ref<string>('');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
summalyProxy.value = meta.summalyProxy;
|
||||
enableHcaptcha.value = meta.enableHcaptcha;
|
||||
enableMcaptcha.value = meta.enableMcaptcha;
|
||||
enableRecaptcha.value = meta.enableRecaptcha;
|
||||
enableTurnstile.value = meta.enableTurnstile;
|
||||
sensitiveMediaDetection.value = meta.sensitiveMediaDetection;
|
||||
@@ -194,6 +212,9 @@ function save() {
|
||||
enableActiveEmailValidation: enableActiveEmailValidation.value,
|
||||
enableVerifymailApi: enableVerifymailApi.value,
|
||||
verifymailAuthKey: verifymailAuthKey.value,
|
||||
enableTruemailApi: enableTruemailApi.value,
|
||||
truemailInstance: truemailInstance.value,
|
||||
truemailAuthKey: truemailAuthKey.value,
|
||||
bannedEmailDomains: bannedEmailDomains.value.split('\n'),
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
|
||||
@@ -158,6 +158,7 @@ import FormSection from '@/components/form/section.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -184,7 +185,7 @@ const perUserListTimelineCacheMax = ref<number>(0);
|
||||
const notesPerOneAd = ref<number>(0);
|
||||
|
||||
async function init(): Promise<void> {
|
||||
const meta = await os.api('admin/meta');
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
name.value = meta.name;
|
||||
shortName.value = meta.shortName;
|
||||
description.value = meta.description;
|
||||
|
||||
@@ -45,6 +45,7 @@ import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i, updateAccount } from '@/account.js';
|
||||
@@ -86,7 +87,7 @@ async function read(announcement): Promise<void> {
|
||||
a.isRead = true;
|
||||
return a;
|
||||
});
|
||||
await os.api('i/read-announcement', { announcementId: announcement.id });
|
||||
await misskeyApi('i/read-announcement', { announcementId: announcement.id });
|
||||
if ($i) {
|
||||
updateAccount({
|
||||
unreadAnnouncements: $i.unreadAnnouncements.filter((a: { id: string; }) => a.id !== announcement.id),
|
||||
|
||||
@@ -29,9 +29,10 @@ import * as Misskey from 'misskey-js';
|
||||
import MkTimeline from '@/components/MkTimeline.vue';
|
||||
import { scroll } from '@/scripts/scroll.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -73,7 +74,7 @@ function focus() {
|
||||
}
|
||||
|
||||
watch(() => props.antennaId, async () => {
|
||||
antenna.value = await os.api('antennas/show', {
|
||||
antenna.value = await misskeyApi('antennas/show', {
|
||||
antennaId: props.antennaId,
|
||||
});
|
||||
}, { immediate: true });
|
||||
|
||||
@@ -41,7 +41,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const body = ref('{}');
|
||||
@@ -51,14 +51,14 @@ const sending = ref(false);
|
||||
const res = ref('');
|
||||
const withCredential = ref(true);
|
||||
|
||||
os.api('endpoints').then(endpointResponse => {
|
||||
misskeyApi('endpoints').then(endpointResponse => {
|
||||
endpoints.value = endpointResponse;
|
||||
});
|
||||
|
||||
function send() {
|
||||
sending.value = true;
|
||||
const requestBody = JSON5.parse(body.value);
|
||||
os.api(endpoint.value as keyof Endpoints, requestBody, requestBody.i || (withCredential.value ? undefined : null)).then(resp => {
|
||||
misskeyApi(endpoint.value as keyof Endpoints, requestBody, requestBody.i || (withCredential.value ? undefined : null)).then(resp => {
|
||||
sending.value = false;
|
||||
res.value = JSON5.stringify(resp, null, 2);
|
||||
}, err => {
|
||||
@@ -68,7 +68,7 @@ function send() {
|
||||
}
|
||||
|
||||
function onEndpointChange() {
|
||||
os.api('endpoint', { endpoint: endpoint.value }, withCredential.value ? undefined : null).then(resp => {
|
||||
misskeyApi('endpoint', { endpoint: endpoint.value }, withCredential.value ? undefined : null).then(resp => {
|
||||
const endpointBody = {};
|
||||
for (const p of resp.params) {
|
||||
endpointBody[p.name] =
|
||||
|
||||
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -44,7 +44,7 @@ const name = computed(() => {
|
||||
});
|
||||
|
||||
function cancel() {
|
||||
os.api('auth/deny', {
|
||||
misskeyApi('auth/deny', {
|
||||
token: props.session.token,
|
||||
}).then(() => {
|
||||
emit('denied');
|
||||
@@ -52,7 +52,7 @@ function cancel() {
|
||||
}
|
||||
|
||||
function accept() {
|
||||
os.api('auth/accept', {
|
||||
misskeyApi('auth/accept', {
|
||||
token: props.session.token,
|
||||
}).then(() => {
|
||||
emit('accepted');
|
||||
|
||||
@@ -46,7 +46,7 @@ import { onMounted, ref, computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XForm from './auth.form.vue';
|
||||
import MkSignin from '@/components/MkSignin.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { $i, login } from '@/account.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -75,13 +75,13 @@ onMounted(async () => {
|
||||
if (!$i) return;
|
||||
|
||||
try {
|
||||
session.value = await os.api('auth/session/show', {
|
||||
session.value = await misskeyApi('auth/session/show', {
|
||||
token: props.token,
|
||||
});
|
||||
|
||||
// 既に連携していた場合
|
||||
if (session.value.app.isAuthorized) {
|
||||
await os.api('auth/accept', {
|
||||
await misskeyApi('auth/accept', {
|
||||
token: session.value.token,
|
||||
});
|
||||
accepted();
|
||||
|
||||
@@ -40,6 +40,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
@@ -63,7 +64,7 @@ function del(avatarDecoration) {
|
||||
}).then(({ canceled }) => {
|
||||
if (canceled) return;
|
||||
avatarDecorations.value = avatarDecorations.value.filter(x => x !== avatarDecoration);
|
||||
os.api('admin/avatar-decorations/delete', avatarDecoration);
|
||||
misskeyApi('admin/avatar-decorations/delete', avatarDecoration);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ async function save(avatarDecoration) {
|
||||
}
|
||||
|
||||
function load() {
|
||||
os.api('admin/avatar-decorations/list').then(_avatarDecorations => {
|
||||
misskeyApi('admin/avatar-decorations/list').then(_avatarDecorations => {
|
||||
avatarDecorations.value = _avatarDecorations;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,12 +76,13 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkColorInput from '@/components/MkColorInput.vue';
|
||||
import { selectFile } from '@/scripts/select-file.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
||||
|
||||
@@ -105,7 +106,7 @@ watch(() => bannerId.value, async () => {
|
||||
if (bannerId.value == null) {
|
||||
bannerUrl.value = null;
|
||||
} else {
|
||||
bannerUrl.value = (await os.api('drive/files/show', {
|
||||
bannerUrl.value = (await misskeyApi('drive/files/show', {
|
||||
fileId: bannerId.value,
|
||||
})).url;
|
||||
}
|
||||
@@ -114,7 +115,7 @@ watch(() => bannerId.value, async () => {
|
||||
async function fetchChannel() {
|
||||
if (props.channelId == null) return;
|
||||
|
||||
channel.value = await os.api('channels/show', {
|
||||
channel.value = await misskeyApi('channels/show', {
|
||||
channelId: props.channelId,
|
||||
});
|
||||
|
||||
@@ -179,7 +180,7 @@ async function archive() {
|
||||
|
||||
if (canceled) return;
|
||||
|
||||
os.api('channels/update', {
|
||||
misskeyApi('channels/update', {
|
||||
channelId: props.channelId,
|
||||
isArchived: true,
|
||||
}).then(() => {
|
||||
|
||||
@@ -74,7 +74,7 @@ import MkPostForm from '@/components/MkPostForm.vue';
|
||||
import MkTimeline from '@/components/MkTimeline.vue';
|
||||
import XChannelFollowButton from '@/components/MkChannelFollowButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { $i, iAmModerator } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -91,6 +91,7 @@ import { PageHeaderItem } from '@/types/page-header.js';
|
||||
import { isSupportShare } from '@/scripts/navigator.js';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -113,7 +114,7 @@ const featuredPagination = computed(() => ({
|
||||
}));
|
||||
|
||||
watch(() => props.channelId, async () => {
|
||||
channel.value = await os.api('channels/show', {
|
||||
channel.value = await misskeyApi('channels/show', {
|
||||
channelId: props.channelId,
|
||||
});
|
||||
favorited.value = channel.value.isFavorited ?? false;
|
||||
|
||||
@@ -58,9 +58,9 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import MkNotes from '@/components/MkNotes.vue';
|
||||
import { $i } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { url } from '@/config.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
@@ -56,7 +57,7 @@ const pagination = {
|
||||
const isOwned = computed<boolean | null>(() => $i && clip.value && ($i.id === clip.value.userId));
|
||||
|
||||
watch(() => props.clipId, async () => {
|
||||
clip.value = await os.api('clips/show', {
|
||||
clip.value = await misskeyApi('clips/show', {
|
||||
clipId: props.clipId,
|
||||
});
|
||||
favorited.value = clip.value.isFavorited;
|
||||
|
||||
@@ -82,6 +82,7 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import { selectFile } from '@/scripts/select-file.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
@@ -177,7 +178,7 @@ const menu = (ev: MouseEvent) => {
|
||||
icon: 'ti ti-download',
|
||||
text: i18n.ts.export,
|
||||
action: async () => {
|
||||
os.api('export-custom-emojis', {
|
||||
misskeyApi('export-custom-emojis', {
|
||||
})
|
||||
.then(() => {
|
||||
os.alert({
|
||||
@@ -196,7 +197,7 @@ const menu = (ev: MouseEvent) => {
|
||||
text: i18n.ts.import,
|
||||
action: async () => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('admin/emoji/import-zip', {
|
||||
misskeyApi('admin/emoji/import-zip', {
|
||||
fileId: file.id,
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -79,7 +79,8 @@ import bytes from '@/filters/bytes.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -94,7 +95,7 @@ const isImage = computed(() => file.value?.type.startsWith('image/'));
|
||||
async function fetch() {
|
||||
fetching.value = true;
|
||||
|
||||
file.value = await os.api('drive/files/show', {
|
||||
file.value = await misskeyApi('drive/files/show', {
|
||||
fileId: props.fileId,
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</MkInput>
|
||||
<MkInput v-model="aliases" autocapitalize="off">
|
||||
<template #label>{{ i18n.ts.tags }}</template>
|
||||
<template #caption>{{ i18n.ts.setMultipleBySeparatingWithSpace }}</template>
|
||||
<template #caption>
|
||||
{{ i18n.ts.theKeywordWhenSearchingForCustomEmoji }}<br/>
|
||||
{{ i18n.ts.setMultipleBySeparatingWithSpace }}
|
||||
</template>
|
||||
</MkInput>
|
||||
<MkTextarea v-model="license">
|
||||
<template #label>{{ i18n.ts.license }}</template>
|
||||
@@ -100,6 +103,7 @@ import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { customEmojiCategories } from '@/custom-emojis.js';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
@@ -124,11 +128,11 @@ const rolesThatCanNotBeUsedThisEmojiAsReaction = ref<Misskey.entities.Role[]>([]
|
||||
const file = ref<Misskey.entities.DriveFile>();
|
||||
|
||||
watch(roleIdsThatCanBeUsedThisEmojiAsReaction, async () => {
|
||||
rolesThatCanBeUsedThisEmojiAsReaction.value = (await Promise.all(roleIdsThatCanBeUsedThisEmojiAsReaction.value.map((id) => os.api('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
||||
rolesThatCanBeUsedThisEmojiAsReaction.value = (await Promise.all(roleIdsThatCanBeUsedThisEmojiAsReaction.value.map((id) => misskeyApi('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
||||
}, { immediate: true });
|
||||
|
||||
watch(roleIdsThatCanNotBeUsedThisEmojiAsReaction, async () => {
|
||||
rolesThatCanNotBeUsedThisEmojiAsReaction.value = (await Promise.all(roleIdsThatCanNotBeUsedThisEmojiAsReaction.value.map((id) => os.api('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
||||
rolesThatCanNotBeUsedThisEmojiAsReaction.value = (await Promise.all(roleIdsThatCanNotBeUsedThisEmojiAsReaction.value.map((id) => misskeyApi('admin/roles/show', { roleId: id }).catch(() => null)))).filter(x => x != null);
|
||||
}, { immediate: true });
|
||||
|
||||
const imgUrl = computed(() => file.value ? file.value.url : props.emoji ? `/emoji/${props.emoji.name}.webp` : null);
|
||||
@@ -147,7 +151,7 @@ async function changeImage(ev) {
|
||||
}
|
||||
|
||||
async function addRole(type: boolean) {
|
||||
const roles = await os.api('admin/roles/list');
|
||||
const roles = await misskeyApi('admin/roles/list');
|
||||
const currentRoleIds = type ? rolesThatCanBeUsedThisEmojiAsReaction.value.map(x => x.id) : rolesThatCanNotBeUsedThisEmojiAsReaction.value.map(x => x.id);
|
||||
|
||||
const { canceled, result: role } = await os.select({
|
||||
@@ -212,7 +216,7 @@ async function del() {
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
os.api('admin/emoji/delete', {
|
||||
misskeyApi('admin/emoji/delete', {
|
||||
id: props.emoji.id,
|
||||
}).then(() => {
|
||||
emit('done', {
|
||||
|
||||
@@ -16,6 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
@@ -43,7 +44,7 @@ function menu(ev) {
|
||||
text: i18n.ts.info,
|
||||
icon: 'ti ti-info-circle',
|
||||
action: () => {
|
||||
os.apiGet('emoji', { name: props.emoji.name }).then(res => {
|
||||
misskeyApiGet('emoji', { name: props.emoji.name }).then(res => {
|
||||
os.alert({
|
||||
type: 'info',
|
||||
text: `Name: ${res.name}\nAliases: ${res.aliases.join(' ')}\nCategory: ${res.category}\nisSensitive: ${res.isSensitive}\nlocalOnly: ${res.localOnly}\nLicense: ${res.license}\nURL: ${res.url}`,
|
||||
|
||||
@@ -15,11 +15,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkRolePreview from '@/components/MkRolePreview.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
|
||||
const roles = ref<Misskey.entities.Role[] | null>(null);
|
||||
|
||||
os.api('roles/list').then(res => {
|
||||
misskeyApi('roles/list').then(res => {
|
||||
roles.value = res.filter(x => x.target === 'manual').sort((a, b) => b.displayOrder - a.displayOrder);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -68,7 +68,7 @@ import * as Misskey from 'misskey-js';
|
||||
import MkUserList from '@/components/MkUserList.vue';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import MkTab from '@/components/MkTab.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -123,14 +123,14 @@ const recentlyRegisteredUsersF = { endpoint: 'users', limit: 10, noPaging: true,
|
||||
sort: '+createdAt',
|
||||
} };
|
||||
|
||||
os.api('hashtags/list', {
|
||||
misskeyApi('hashtags/list', {
|
||||
sort: '+attachedLocalUsers',
|
||||
attachedToLocalUserOnly: true,
|
||||
limit: 30,
|
||||
}).then(tags => {
|
||||
tagsLocal.value = tags;
|
||||
});
|
||||
os.api('hashtags/list', {
|
||||
misskeyApi('hashtags/list', {
|
||||
sort: '+attachedRemoteUsers',
|
||||
attachedToRemoteUserOnly: true,
|
||||
limit: 30,
|
||||
|
||||
@@ -38,13 +38,14 @@ import { computed, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkCodeEditor from '@/components/MkCodeEditor.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const PRESET_DEFAULT = `/// @ 0.16.0
|
||||
|
||||
@@ -369,7 +370,7 @@ const flash = ref<Misskey.entities.Flash | null>(null);
|
||||
const visibility = ref<Misskey.entities.FlashUpdateRequest['visibility']>('public');
|
||||
|
||||
if (props.id) {
|
||||
flash.value = await os.api('flash/show', {
|
||||
flash.value = await misskeyApi('flash/show', {
|
||||
flashId: props.id,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ import { computed, ref } from 'vue';
|
||||
import MkFlashPreview from '@/components/MkFlashPreview.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -62,12 +62,13 @@ import * as Misskey from 'misskey-js';
|
||||
import { Interpreter, Parser, values } from '@syuilo/aiscript';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { url } from '@/config.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkAsUi from '@/components/MkAsUi.vue';
|
||||
import { AsUiComponent, AsUiRoot, registerAsUiLib } from '@/scripts/aiscript/ui.js';
|
||||
import { createAiScriptEnv } from '@/scripts/aiscript/api.js';
|
||||
import { aiScriptReadline, createAiScriptEnv } from '@/scripts/aiscript/api.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkCode from '@/components/MkCode.vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
@@ -84,7 +85,7 @@ const error = ref<any>(null);
|
||||
|
||||
function fetchFlash() {
|
||||
flash.value = null;
|
||||
os.api('flash/show', {
|
||||
misskeyApi('flash/show', {
|
||||
flashId: props.id,
|
||||
}).then(_flash => {
|
||||
flash.value = _flash;
|
||||
@@ -162,15 +163,7 @@ async function run() {
|
||||
THIS_ID: values.STR(flash.value.id),
|
||||
THIS_URL: values.STR(`${url}/play/${flash.value.id}`),
|
||||
}, {
|
||||
in: (q) => {
|
||||
return new Promise(ok => {
|
||||
os.inputText({
|
||||
title: q,
|
||||
}).then(({ result: a }) => {
|
||||
ok(a ?? '');
|
||||
});
|
||||
});
|
||||
},
|
||||
in: aiScriptReadline,
|
||||
out: (value) => {
|
||||
// nop
|
||||
},
|
||||
|
||||
@@ -41,7 +41,7 @@ import { shallowRef, computed } from 'vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { userPage, acct } from '@/filters/user.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
@@ -54,13 +54,13 @@ const pagination = {
|
||||
};
|
||||
|
||||
function accept(user) {
|
||||
os.api('following/requests/accept', { userId: user.id }).then(() => {
|
||||
misskeyApi('following/requests/accept', { userId: user.id }).then(() => {
|
||||
paginationComponent.value.reload();
|
||||
});
|
||||
}
|
||||
|
||||
function reject(user) {
|
||||
os.api('following/requests/reject', { userId: user.id }).then(() => {
|
||||
misskeyApi('following/requests/reject', { userId: user.id }).then(() => {
|
||||
paginationComponent.value.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,9 +12,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { mainRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { defaultStore } from "@/store.js";
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { mainRouter } from '@/global/router/main.js';
|
||||
|
||||
async function follow(user): Promise<void> {
|
||||
const { canceled } = await os.confirm({
|
||||
@@ -42,7 +43,7 @@ if (acct == null) {
|
||||
let promise;
|
||||
|
||||
if (acct.startsWith('https://')) {
|
||||
promise = os.api('ap/show', {
|
||||
promise = misskeyApi('ap/show', {
|
||||
uri: acct,
|
||||
});
|
||||
promise.then(res => {
|
||||
@@ -60,7 +61,7 @@ if (acct.startsWith('https://')) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
promise = os.api('users/show', Misskey.acct.parse(acct));
|
||||
promise = misskeyApi('users/show', Misskey.acct.parse(acct));
|
||||
promise.then(user => {
|
||||
follow(user);
|
||||
});
|
||||
|
||||
@@ -47,9 +47,10 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import { selectFiles } from '@/scripts/select-file.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -107,7 +108,7 @@ async function del() {
|
||||
}
|
||||
|
||||
watch(() => props.postId, () => {
|
||||
init.value = () => props.postId ? os.api('gallery/posts/show', {
|
||||
init.value = () => props.postId ? misskeyApi('gallery/posts/show', {
|
||||
postId: props.postId,
|
||||
}).then(post => {
|
||||
files.value = post.files ?? [];
|
||||
|
||||
@@ -53,7 +53,7 @@ import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkGalleryPostPreview from '@/components/MkGalleryPostPreview.vue';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -66,18 +66,19 @@ import { computed, watch, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkContainer from '@/components/MkContainer.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkGalleryPostPreview from '@/components/MkGalleryPostPreview.vue';
|
||||
import MkFollowButton from '@/components/MkFollowButton.vue';
|
||||
import { url } from '@/config.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { isSupportShare } from '@/scripts/navigator.js';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -97,7 +98,7 @@ const otherPostsPagination = {
|
||||
|
||||
function fetchPost() {
|
||||
post.value = null;
|
||||
os.api('gallery/posts/show', {
|
||||
misskeyApi('gallery/posts/show', {
|
||||
postId: props.postId,
|
||||
}).then(_post => {
|
||||
post.value = _post;
|
||||
|
||||
@@ -105,6 +105,7 @@ import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { AiScriptPluginMeta, parsePluginMeta, installPlugin } from '@/scripts/install-plugin.js';
|
||||
import { parseThemeCode, installTheme } from '@/scripts/install-theme.js';
|
||||
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||
@@ -159,7 +160,7 @@ async function fetch() {
|
||||
uiPhase.value = 'error';
|
||||
return;
|
||||
}
|
||||
const res = await os.api('fetch-external-resources', {
|
||||
const res = await misskeyApi('fetch-external-resources', {
|
||||
url: url.value,
|
||||
hash: hash.value,
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -130,6 +130,7 @@ import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import number from '@/filters/number.js';
|
||||
import { iAmModerator, iAmAdmin } from '@/account.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -166,9 +167,9 @@ const usersPagination = {
|
||||
|
||||
async function fetch(): Promise<void> {
|
||||
if (iAmAdmin) {
|
||||
meta.value = await os.api('admin/meta');
|
||||
meta.value = await misskeyApi('admin/meta');
|
||||
}
|
||||
instance.value = await os.api('federation/show-instance', {
|
||||
instance.value = await misskeyApi('federation/show-instance', {
|
||||
host: props.host,
|
||||
});
|
||||
suspended.value = instance.value?.isSuspended ?? false;
|
||||
@@ -182,7 +183,7 @@ async function toggleBlock(): Promise<void> {
|
||||
if (!meta.value) throw new Error('No meta?');
|
||||
if (!instance.value) throw new Error('No instance?');
|
||||
const { host } = instance.value;
|
||||
await os.api('admin/update-meta', {
|
||||
await misskeyApi('admin/update-meta', {
|
||||
blockedHosts: isBlocked.value ? meta.value.blockedHosts.concat([host]) : meta.value.blockedHosts.filter(x => x !== host),
|
||||
});
|
||||
}
|
||||
@@ -192,7 +193,7 @@ async function toggleSilenced(): Promise<void> {
|
||||
if (!instance.value) throw new Error('No instance?');
|
||||
const { host } = instance.value;
|
||||
const silencedHosts = meta.value.silencedHosts ?? [];
|
||||
await os.api('admin/update-meta', {
|
||||
await misskeyApi('admin/update-meta', {
|
||||
silencedHosts: isSilenced.value ? silencedHosts.concat([host]) : silencedHosts.filter(x => x !== host),
|
||||
});
|
||||
}
|
||||
@@ -202,14 +203,14 @@ async function toggleSensitiveMedia(): Promise<void> {
|
||||
if (!instance.value) throw new Error('No instance?');
|
||||
const { host } = instance.value;
|
||||
const sensitiveMediaHosts = meta.value.sensitiveMediaHosts ?? [];
|
||||
await os.api('admin/update-meta', {
|
||||
await misskeyApi('admin/update-meta', {
|
||||
sensitiveMediaHosts: isSensitiveMedia.value ? sensitiveMediaHosts.concat([host]) : sensitiveMediaHosts.filter(x => x !== host),
|
||||
});
|
||||
}
|
||||
|
||||
async function toggleSuspend(): Promise<void> {
|
||||
if (!instance.value) throw new Error('No instance?');
|
||||
await os.api('admin/federation/update-instance', {
|
||||
await misskeyApi('admin/federation/update-instance', {
|
||||
host: instance.value.host,
|
||||
isSuspended: suspended.value,
|
||||
});
|
||||
@@ -217,7 +218,7 @@ async function toggleSuspend(): Promise<void> {
|
||||
|
||||
function refreshMetadata(): void {
|
||||
if (!instance.value) throw new Error('No instance?');
|
||||
os.api('admin/federation/refresh-remote-instance-metadata', {
|
||||
misskeyApi('admin/federation/refresh-remote-instance-metadata', {
|
||||
host: instance.value.host,
|
||||
});
|
||||
os.alert({
|
||||
|
||||
@@ -40,6 +40,7 @@ import { computed, ref, shallowRef } from 'vue';
|
||||
import type * as Misskey from 'misskey-js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||
import MkInviteCode from '@/components/MkInviteCode.vue';
|
||||
@@ -68,7 +69,7 @@ const resetCycle = computed<null | string>(() => {
|
||||
});
|
||||
|
||||
async function create() {
|
||||
const ticket = await os.api('invite/create');
|
||||
const ticket = await misskeyApi('invite/create');
|
||||
os.alert({
|
||||
type: 'success',
|
||||
title: i18n.ts.inviteCodeCreated,
|
||||
@@ -87,7 +88,7 @@ function deleted(id: string) {
|
||||
}
|
||||
|
||||
async function update() {
|
||||
currentInviteLimit.value = (await os.api('invite/limit')).remaining;
|
||||
currentInviteLimit.value = (await misskeyApi('invite/limit')).remaining;
|
||||
}
|
||||
|
||||
update();
|
||||
|
||||
@@ -37,6 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { watch, computed, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { userPage } from '@/filters/user.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
@@ -53,12 +54,12 @@ const error = ref();
|
||||
const users = ref<Misskey.entities.UserDetailed[]>([]);
|
||||
|
||||
function fetchList(): void {
|
||||
os.api('users/lists/show', {
|
||||
misskeyApi('users/lists/show', {
|
||||
listId: props.listId,
|
||||
forPublic: true,
|
||||
}).then(_list => {
|
||||
list.value = _list;
|
||||
os.api('users/show', {
|
||||
misskeyApi('users/show', {
|
||||
userIds: list.value.userIds,
|
||||
}).then(_users => {
|
||||
users.value = _users;
|
||||
|
||||
@@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { ref, computed } from 'vue';
|
||||
import MkSignin from '@/components/MkSignin.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { $i, login } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -65,7 +65,7 @@ const state = ref<string | null>(null);
|
||||
|
||||
async function accept(): Promise<void> {
|
||||
state.value = 'waiting';
|
||||
await os.api('miauth/gen-token', {
|
||||
await misskeyApi('miauth/gen-token', {
|
||||
session: props.session,
|
||||
name: props.name,
|
||||
iconUrl: props.icon,
|
||||
|
||||
@@ -14,8 +14,8 @@ import { ref } from 'vue';
|
||||
import XAntenna from './editor.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { antennasCache } from '@/cache.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XAntenna from './editor.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { antennasCache } from '@/cache.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -32,7 +32,7 @@ function onAntennaUpdated() {
|
||||
router.push('/my/antennas');
|
||||
}
|
||||
|
||||
os.api('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) => {
|
||||
misskeyApi('antennas/show', { antennaId: props.antennaId }).then((antennaResponse) => {
|
||||
antenna.value = antennaResponse;
|
||||
});
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -84,7 +85,7 @@ const userLists = ref<Misskey.entities.UserList[] | null>(null);
|
||||
|
||||
watch(() => src.value, async () => {
|
||||
if (src.value === 'list' && userLists.value === null) {
|
||||
userLists.value = await os.api('users/lists/list');
|
||||
userLists.value = await misskeyApi('users/lists/list');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -119,7 +120,7 @@ async function deleteAntenna() {
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
await os.api('antennas/delete', {
|
||||
await misskeyApi('antennas/delete', {
|
||||
antennaId: props.antenna.id,
|
||||
});
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkClipPreview from '@/components/MkClipPreview.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { clipsCache } from '@/cache.js';
|
||||
@@ -48,7 +49,7 @@ const favorites = ref<Misskey.entities.Clip[] | null>(null);
|
||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
|
||||
|
||||
watch(tab, async () => {
|
||||
favorites.value = await os.api('clips/my-favorites');
|
||||
favorites.value = await misskeyApi('clips/my-favorites');
|
||||
});
|
||||
|
||||
async function create() {
|
||||
|
||||
@@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<div v-if="items.length > 0" class="_gaps">
|
||||
<MkA v-for="list in items" :key="list.id" class="_panel" :class="$style.list" :to="`/my/lists/${ list.id }`">
|
||||
<div style="margin-bottom: 4px;">{{ list.name }} <span :class="$style.nUsers">({{ i18n.t('nUsers', { n: `${list.userIds.length}/${$i?.policies['userEachUserListsLimit']}` }) }})</span></div>
|
||||
<div style="margin-bottom: 4px;">{{ list.name }} <span :class="$style.nUsers">({{ i18n.t('nUsers', { n: `${list.userIds.length}/${$i.policies['userEachUserListsLimit']}` }) }})</span></div>
|
||||
<MkAvatars :userIds="list.userIds" :limit="10"/>
|
||||
</MkA>
|
||||
</div>
|
||||
@@ -37,7 +37,9 @@ import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { userListsCache } from '@/cache.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const items = computed(() => userListsCache.value.value ?? []);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<MkFolder defaultOpen>
|
||||
<template #label>{{ i18n.ts.members }}</template>
|
||||
<template #caption>{{ i18n.t('nUsers', { n: `${list.userIds.length}/${$i?.policies['userEachUserListsLimit']}` }) }}</template>
|
||||
<template #caption>{{ i18n.t('nUsers', { n: `${list.userIds.length}/${$i.policies['userEachUserListsLimit']}` }) }}</template>
|
||||
|
||||
<div class="_gaps_s">
|
||||
<MkButton rounded primary style="margin: 0 auto;" @click="addUser()">{{ i18n.ts.addUser }}</MkButton>
|
||||
@@ -57,7 +57,7 @@ import { computed, ref, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { mainRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { userPage } from '@/filters/user.js';
|
||||
@@ -66,9 +66,12 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import { userListsCache } from '@/cache.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import { mainRouter } from '@/global/router/main.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const {
|
||||
enableInfiniteScroll,
|
||||
@@ -91,7 +94,7 @@ const membershipsPagination = {
|
||||
};
|
||||
|
||||
function fetchList() {
|
||||
os.api('users/lists/show', {
|
||||
misskeyApi('users/lists/show', {
|
||||
listId: props.listId,
|
||||
}).then(_list => {
|
||||
list.value = _list;
|
||||
@@ -119,7 +122,7 @@ async function removeUser(item, ev) {
|
||||
danger: true,
|
||||
action: async () => {
|
||||
if (!list.value) return;
|
||||
os.api('users/lists/pull', {
|
||||
misskeyApi('users/lists/pull', {
|
||||
listId: list.value.id,
|
||||
userId: item.userId,
|
||||
}).then(() => {
|
||||
@@ -134,7 +137,7 @@ async function showMembershipMenu(item, ev) {
|
||||
text: item.withReplies ? i18n.ts.hideRepliesToOthersInTimeline : i18n.ts.showRepliesToOthersInTimeline,
|
||||
icon: item.withReplies ? 'ti ti-messages-off' : 'ti ti-messages',
|
||||
action: async () => {
|
||||
os.api('users/lists/update-membership', {
|
||||
misskeyApi('users/lists/update-membership', {
|
||||
listId: list.value.id,
|
||||
userId: item.userId,
|
||||
withReplies: !item.withReplies,
|
||||
|
||||
@@ -50,7 +50,7 @@ import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||
import MkNotes from '@/components/MkNotes.vue';
|
||||
import MkRemoteCaution from '@/components/MkRemoteCaution.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { dateString } from '@/filters/date.js';
|
||||
@@ -90,13 +90,13 @@ function fetchNote() {
|
||||
showPrev.value = false;
|
||||
showNext.value = false;
|
||||
note.value = null;
|
||||
os.api('notes/show', {
|
||||
misskeyApi('notes/show', {
|
||||
noteId: props.noteId,
|
||||
}).then(res => {
|
||||
note.value = res;
|
||||
// 古いノートは被クリップ数をカウントしていないので、2023-10-01以前のものは強制的にnotes/clipsを叩く
|
||||
if (note.value.clippedCount > 0 || new Date(note.value.createdAt).getTime() < new Date('2023-10-01').getTime()) {
|
||||
os.api('notes/clips', {
|
||||
misskeyApi('notes/clips', {
|
||||
noteId: note.value.id,
|
||||
}).then((_clips) => {
|
||||
clips.value = _clips;
|
||||
|
||||
@@ -26,6 +26,7 @@ import * as Misskey from 'misskey-js';
|
||||
import XContainer from '../page-editor.container.vue';
|
||||
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -52,7 +53,7 @@ onMounted(async () => {
|
||||
if (props.modelValue.fileId == null) {
|
||||
await choose();
|
||||
} else {
|
||||
os.api('drive/files/show', {
|
||||
misskeyApi('drive/files/show', {
|
||||
fileId: props.modelValue.fileId,
|
||||
}).then(fileResponse => {
|
||||
file.value = fileResponse;
|
||||
|
||||
@@ -30,7 +30,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkNote from '@/components/MkNote.vue';
|
||||
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -53,7 +53,7 @@ watch(id, async () => {
|
||||
...props.modelValue,
|
||||
note: id.value,
|
||||
});
|
||||
note.value = await os.api('notes/show', { noteId: id.value });
|
||||
note.value = await misskeyApi('notes/show', { noteId: id.value });
|
||||
}, {
|
||||
immediate: true,
|
||||
});
|
||||
|
||||
@@ -71,11 +71,12 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import { url } from '@/config.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { selectFile } from '@/scripts/select-file.js';
|
||||
import { mainRouter } from '@/router.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { mainRouter } from '@/global/router/main.js';
|
||||
|
||||
const props = defineProps<{
|
||||
initPageId?: string;
|
||||
@@ -106,7 +107,7 @@ watch(eyeCatchingImageId, async () => {
|
||||
if (eyeCatchingImageId.value == null) {
|
||||
eyeCatchingImage.value = null;
|
||||
} else {
|
||||
eyeCatchingImage.value = await os.api('drive/files/show', {
|
||||
eyeCatchingImage.value = await misskeyApi('drive/files/show', {
|
||||
fileId: eyeCatchingImageId.value,
|
||||
});
|
||||
}
|
||||
@@ -149,7 +150,7 @@ function save() {
|
||||
|
||||
if (pageId.value) {
|
||||
options.pageId = pageId.value;
|
||||
os.api('pages/update', options)
|
||||
misskeyApi('pages/update', options)
|
||||
.then(page => {
|
||||
currentName.value = name.value.trim();
|
||||
os.alert({
|
||||
@@ -158,7 +159,7 @@ function save() {
|
||||
});
|
||||
}).catch(onError);
|
||||
} else {
|
||||
os.api('pages/create', options)
|
||||
misskeyApi('pages/create', options)
|
||||
.then(created => {
|
||||
pageId.value = created.id;
|
||||
currentName.value = name.value.trim();
|
||||
@@ -177,7 +178,7 @@ function del() {
|
||||
text: i18n.t('removeAreYouSure', { x: title.value.trim() }),
|
||||
}).then(({ canceled }) => {
|
||||
if (canceled) return;
|
||||
os.api('pages/delete', {
|
||||
misskeyApi('pages/delete', {
|
||||
pageId: pageId.value,
|
||||
}).then(() => {
|
||||
os.alert({
|
||||
@@ -192,7 +193,7 @@ function del() {
|
||||
function duplicate() {
|
||||
title.value = title.value + ' - copy';
|
||||
name.value = name.value + '-copy';
|
||||
os.api('pages/create', getSaveOptions()).then(created => {
|
||||
misskeyApi('pages/create', getSaveOptions()).then(created => {
|
||||
pageId.value = created.id;
|
||||
currentName.value = name.value.trim();
|
||||
os.alert({
|
||||
@@ -236,11 +237,11 @@ function removeEyeCatchingImage() {
|
||||
|
||||
async function init() {
|
||||
if (props.initPageId) {
|
||||
page.value = await os.api('pages/show', {
|
||||
page.value = await misskeyApi('pages/show', {
|
||||
pageId: props.initPageId,
|
||||
});
|
||||
} else if (props.initPageName && props.initUser) {
|
||||
page.value = await os.api('pages/show', {
|
||||
page.value = await misskeyApi('pages/show', {
|
||||
name: props.initPageName,
|
||||
username: props.initUser,
|
||||
});
|
||||
|
||||
@@ -81,6 +81,7 @@ import * as Misskey from 'misskey-js';
|
||||
import XPage from '@/components/page/page.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { url } from '@/config.js';
|
||||
import MkMediaImage from '@/components/MkMediaImage.vue';
|
||||
import MkFollowButton from '@/components/MkFollowButton.vue';
|
||||
@@ -113,7 +114,7 @@ const path = computed(() => props.username + '/' + props.pageName);
|
||||
|
||||
function fetchPage() {
|
||||
page.value = null;
|
||||
os.api('pages/show', {
|
||||
misskeyApi('pages/show', {
|
||||
name: props.pageName,
|
||||
username: props.username,
|
||||
}).then(async _page => {
|
||||
|
||||
@@ -40,9 +40,9 @@ import { computed, ref } from 'vue';
|
||||
import MkPagePreview from '@/components/MkPagePreview.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { watch, computed, ref } from 'vue';
|
||||
import JSON5 from 'json5';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import FormLink from '@/components/form/link.vue';
|
||||
@@ -54,7 +55,7 @@ const scope = computed(() => props.path ? props.path.split('/') : []);
|
||||
const keys = ref<any>(null);
|
||||
|
||||
function fetchKeys() {
|
||||
os.api('i/registry/keys-with-type', {
|
||||
misskeyApi('i/registry/keys-with-type', {
|
||||
scope: scope.value,
|
||||
domain: props.domain === '@' ? null : props.domain,
|
||||
}).then(res => {
|
||||
|
||||
@@ -48,6 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { watch, computed, ref } from 'vue';
|
||||
import JSON5 from 'json5';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
@@ -68,7 +69,7 @@ const value = ref<any>(null);
|
||||
const valueForEditor = ref<string | null>(null);
|
||||
|
||||
function fetchValue() {
|
||||
os.api('i/registry/get-detail', {
|
||||
misskeyApi('i/registry/get-detail', {
|
||||
scope: scope.value,
|
||||
key: key.value,
|
||||
domain: props.domain === '@' ? null : props.domain,
|
||||
|
||||
@@ -26,6 +26,7 @@ import { ref, computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import JSON5 from 'json5';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import FormLink from '@/components/form/link.vue';
|
||||
@@ -35,7 +36,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||
const scopesWithDomain = ref<Misskey.entities.IRegistryScopesWithDomainResponse | null>(null);
|
||||
|
||||
function fetchScopes() {
|
||||
os.api('i/registry/scopes-with-domain').then(res => {
|
||||
misskeyApi('i/registry/scopes-with-domain').then(res => {
|
||||
scopesWithDomain.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { mainRouter } from '@/router.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { mainRouter } from '@/global/router/main.js';
|
||||
|
||||
const props = defineProps<{
|
||||
token?: string;
|
||||
|
||||
@@ -38,7 +38,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { computed, watch, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkUserList from '@/components/MkUserList.vue';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -59,7 +59,7 @@ const error = ref();
|
||||
const visible = ref(false);
|
||||
|
||||
watch(() => props.role, () => {
|
||||
os.api('roles/show', {
|
||||
misskeyApi('roles/show', {
|
||||
roleId: props.role,
|
||||
}).then(res => {
|
||||
role.value = res;
|
||||
|
||||
@@ -44,7 +44,7 @@ import { Interpreter, Parser, utils } from '@syuilo/aiscript';
|
||||
import MkContainer from '@/components/MkContainer.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkCodeEditor from '@/components/MkCodeEditor.vue';
|
||||
import { createAiScriptEnv } from '@/scripts/aiscript/api.js';
|
||||
import { aiScriptReadline, createAiScriptEnv } from '@/scripts/aiscript/api.js';
|
||||
import * as os from '@/os.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -86,19 +86,7 @@ async function run() {
|
||||
root.value = _root.value;
|
||||
}),
|
||||
}), {
|
||||
in: (q) => {
|
||||
return new Promise(ok => {
|
||||
os.inputText({
|
||||
title: q,
|
||||
}).then(({ canceled, result: a }) => {
|
||||
if (canceled) {
|
||||
ok('');
|
||||
} else {
|
||||
ok(a);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
in: aiScriptReadline,
|
||||
out: (value) => {
|
||||
if (value.type === 'str' && value.value.toLowerCase().replace(',', '').includes('hello world')) {
|
||||
claimAchievement('outputHelloWorldOnScratchpad');
|
||||
|
||||
@@ -49,9 +49,10 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -74,7 +75,7 @@ async function search() {
|
||||
if (query == null || query === '') return;
|
||||
|
||||
if (query.startsWith('https://')) {
|
||||
const promise = os.api('ap/show', {
|
||||
const promise = misskeyApi('ap/show', {
|
||||
uri: query,
|
||||
});
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -48,7 +49,7 @@ async function search() {
|
||||
if (query == null || query === '') return;
|
||||
|
||||
if (query.startsWith('https://')) {
|
||||
const promise = os.api('ap/show', {
|
||||
const promise = misskeyApi('ap/show', {
|
||||
uri: query,
|
||||
});
|
||||
|
||||
|
||||
@@ -110,7 +110,9 @@ import * as os from '@/os.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import { confetti } from '@/scripts/confetti.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
defineProps<{
|
||||
twoFactorData: {
|
||||
@@ -151,7 +153,7 @@ function downloadBackupCodes() {
|
||||
const txtBlob = new Blob([backupCodes.value.join('\n')], { type: 'text/plain' });
|
||||
const dummya = document.createElement('a');
|
||||
dummya.href = URL.createObjectURL(txtBlob);
|
||||
dummya.download = `${$i?.username}-2fa-backup-codes.txt`;
|
||||
dummya.download = `${$i.username}-2fa-backup-codes.txt`;
|
||||
dummya.click();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,9 +80,11 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
// メモ: 各エンドポイントはmeUpdatedを発行するため、refreshAccountは不要
|
||||
|
||||
withDefaults(defineProps<{
|
||||
@@ -91,7 +93,7 @@ withDefaults(defineProps<{
|
||||
first: false,
|
||||
});
|
||||
|
||||
const usePasswordLessLogin = computed(() => $i?.usePasswordLessLogin ?? false);
|
||||
const usePasswordLessLogin = computed(() => $i.usePasswordLessLogin ?? false);
|
||||
|
||||
async function registerTOTP(): Promise<void> {
|
||||
const auth = await os.authenticateDialog();
|
||||
|
||||
@@ -129,11 +129,12 @@ import bytes from '@/filters/bytes.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
|
||||
const stats = ref<any>({});
|
||||
|
||||
onMounted(() => {
|
||||
os.api('users/stats', {
|
||||
misskeyApi('users/stats', {
|
||||
userId: $i!.id,
|
||||
}).then(response => {
|
||||
stats.value = response;
|
||||
|
||||
@@ -24,6 +24,7 @@ import type * as Misskey from 'misskey-js';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { getAccounts, addAccount as addAccounts, removeAccount as _removeAccount, login, $i } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -36,7 +37,7 @@ const init = async () => {
|
||||
getAccounts().then(accounts => {
|
||||
storedAccounts.value = accounts.filter(x => x.id !== $i!.id);
|
||||
|
||||
return os.api('users/show', {
|
||||
return misskeyApi('users/show', {
|
||||
userIds: storedAccounts.value.map(x => x.id),
|
||||
});
|
||||
}).then(response => {
|
||||
|
||||
@@ -16,6 +16,7 @@ import { defineAsyncComponent, ref, computed } from 'vue';
|
||||
import FormLink from '@/components/form/link.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
@@ -25,7 +26,7 @@ function generateToken() {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkTokenGenerateWindow.vue')), {}, {
|
||||
done: async result => {
|
||||
const { name, permissions } = result;
|
||||
const { token } = await os.api('miauth/gen-token', {
|
||||
const { token } = await misskeyApi('miauth/gen-token', {
|
||||
session: null,
|
||||
name: name,
|
||||
permission: permissions,
|
||||
|
||||
@@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import FormPagination from '@/components/MkPagination.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
@@ -66,7 +66,7 @@ const pagination = {
|
||||
};
|
||||
|
||||
function revoke(token) {
|
||||
os.api('i/revoke-token', { tokenId: token.id }).then(() => {
|
||||
misskeyApi('i/revoke-token', { tokenId: token.id }).then(() => {
|
||||
list.value.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,7 +16,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const props = defineProps<{
|
||||
active?: boolean;
|
||||
|
||||
@@ -51,7 +51,9 @@ import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkRange from '@/components/MkRange.vue';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const props = defineProps<{
|
||||
usingIndex: number | null;
|
||||
|
||||
@@ -50,15 +50,18 @@ import * as Misskey from 'misskey-js';
|
||||
import XDecoration from './avatar-decoration.decoration.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const loading = ref(true);
|
||||
const avatarDecorations = ref<Misskey.entities.GetAvatarDecorationsResponse>([]);
|
||||
|
||||
os.api('get-avatar-decorations').then(_avatarDecorations => {
|
||||
misskeyApi('get-avatar-decorations').then(_avatarDecorations => {
|
||||
avatarDecorations.value = _avatarDecorations;
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
@@ -51,6 +51,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
@@ -94,7 +95,7 @@ watch(sortModeSelect, () => {
|
||||
|
||||
function fetchDriveInfo(): void {
|
||||
fetching.value = true;
|
||||
os.api('drive').then(info => {
|
||||
misskeyApi('drive').then(info => {
|
||||
capacity.value = info.capacity;
|
||||
usage.value = info.usage;
|
||||
fetching.value = false;
|
||||
|
||||
@@ -66,12 +66,15 @@ import FormSection from '@/components/form/section.vue';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import MkChart from '@/components/MkChart.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const fetching = ref(true);
|
||||
const usage = ref<number | null>(null);
|
||||
@@ -81,6 +84,7 @@ const alwaysMarkNsfw = ref($i.alwaysMarkNsfw);
|
||||
const autoSensitive = ref($i.autoSensitive);
|
||||
|
||||
const meterStyle = computed(() => {
|
||||
if (!capacity.value || !usage.value) return {};
|
||||
return {
|
||||
width: `${usage.value / capacity.value * 100}%`,
|
||||
background: tinycolor({
|
||||
@@ -93,14 +97,14 @@ const meterStyle = computed(() => {
|
||||
|
||||
const keepOriginalUploading = computed(defaultStore.makeGetterSetter('keepOriginalUploading'));
|
||||
|
||||
os.api('drive').then(info => {
|
||||
misskeyApi('drive').then(info => {
|
||||
capacity.value = info.capacity;
|
||||
usage.value = info.usage;
|
||||
fetching.value = false;
|
||||
});
|
||||
|
||||
if (defaultStore.state.uploadFolder) {
|
||||
os.api('drive/folders/show', {
|
||||
misskeyApi('drive/folders/show', {
|
||||
folderId: defaultStore.state.uploadFolder,
|
||||
}).then(response => {
|
||||
uploadFolder.value = response;
|
||||
@@ -112,7 +116,7 @@ function chooseUploadFolder() {
|
||||
defaultStore.set('uploadFolder', folder ? folder.id : null);
|
||||
os.success();
|
||||
if (defaultStore.state.uploadFolder) {
|
||||
uploadFolder.value = await os.api('drive/folders/show', {
|
||||
uploadFolder.value = await misskeyApi('drive/folders/show', {
|
||||
folderId: defaultStore.state.uploadFolder,
|
||||
});
|
||||
} else {
|
||||
@@ -122,7 +126,7 @@ function chooseUploadFolder() {
|
||||
}
|
||||
|
||||
function saveProfile() {
|
||||
os.api('i/update', {
|
||||
misskeyApi('i/update', {
|
||||
alwaysMarkNsfw: !!alwaysMarkNsfw.value,
|
||||
autoSensitive: !!autoSensitive.value,
|
||||
}).catch(err => {
|
||||
|
||||
@@ -54,15 +54,18 @@ import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { instance } from '@/instance.js';
|
||||
|
||||
const emailAddress = ref($i!.email);
|
||||
const $i = signinRequired();
|
||||
|
||||
const emailAddress = ref($i.email);
|
||||
|
||||
const onChangeReceiveAnnouncementEmail = (v) => {
|
||||
os.api('i/update', {
|
||||
misskeyApi('i/update', {
|
||||
receiveAnnouncementEmail: v,
|
||||
});
|
||||
};
|
||||
@@ -78,14 +81,14 @@ async function saveEmailAddress() {
|
||||
});
|
||||
}
|
||||
|
||||
const emailNotification_mention = ref($i!.emailNotificationTypes.includes('mention'));
|
||||
const emailNotification_reply = ref($i!.emailNotificationTypes.includes('reply'));
|
||||
const emailNotification_quote = ref($i!.emailNotificationTypes.includes('quote'));
|
||||
const emailNotification_follow = ref($i!.emailNotificationTypes.includes('follow'));
|
||||
const emailNotification_receiveFollowRequest = ref($i!.emailNotificationTypes.includes('receiveFollowRequest'));
|
||||
const emailNotification_mention = ref($i.emailNotificationTypes.includes('mention'));
|
||||
const emailNotification_reply = ref($i.emailNotificationTypes.includes('reply'));
|
||||
const emailNotification_quote = ref($i.emailNotificationTypes.includes('quote'));
|
||||
const emailNotification_follow = ref($i.emailNotificationTypes.includes('follow'));
|
||||
const emailNotification_receiveFollowRequest = ref($i.emailNotificationTypes.includes('receiveFollowRequest'));
|
||||
|
||||
const saveNotificationSettings = () => {
|
||||
os.api('i/update', {
|
||||
misskeyApi('i/update', {
|
||||
emailNotificationTypes: [
|
||||
...[emailNotification_mention.value ? 'mention' : null],
|
||||
...[emailNotification_reply.value ? 'reply' : null],
|
||||
|
||||
@@ -235,6 +235,7 @@ import MkInfo from '@/components/MkInfo.vue';
|
||||
import { langs } from '@/config.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
@@ -371,7 +372,7 @@ function removeEmojiIndex(lang: string) {
|
||||
}
|
||||
|
||||
async function setPinnedList() {
|
||||
const lists = await os.api('users/lists/list');
|
||||
const lists = await misskeyApi('users/lists/list');
|
||||
const { canceled, result: list } = await os.select({
|
||||
title: i18n.ts.selectList,
|
||||
items: lists.map(x => ({
|
||||
|
||||
@@ -21,6 +21,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkButton primary :class="$style.button" inline @click="exportFavorites()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</MkFolder>
|
||||
</FormSection>
|
||||
<FormSection>
|
||||
<template #label><i class="ti ti-star"></i> {{ i18n.ts._exportOrImport.clips }}</template>
|
||||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.export }}</template>
|
||||
<template #icon><i class="ti ti-download"></i></template>
|
||||
<MkButton primary :class="$style.button" inline @click="exportClips()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
|
||||
</MkFolder>
|
||||
</FormSection>
|
||||
<FormSection>
|
||||
<template #label><i class="ti ti-users"></i> {{ i18n.ts._exportOrImport.followingList }}</template>
|
||||
<div class="_gaps_s">
|
||||
@@ -117,11 +125,12 @@ import FormSection from '@/components/form/section.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { selectFile } from '@/scripts/select-file.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { defaultStore } from "@/store.js";
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const excludeMutingUsers = ref(false);
|
||||
const excludeInactiveUsers = ref(false);
|
||||
@@ -149,15 +158,19 @@ const onError = (ev) => {
|
||||
};
|
||||
|
||||
const exportNotes = () => {
|
||||
os.api('i/export-notes', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-notes', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportFavorites = () => {
|
||||
os.api('i/export-favorites', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-favorites', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportClips = () => {
|
||||
misskeyApi('i/export-clips', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportFollowing = () => {
|
||||
os.api('i/export-following', {
|
||||
misskeyApi('i/export-following', {
|
||||
excludeMuting: excludeMutingUsers.value,
|
||||
excludeInactive: excludeInactiveUsers.value,
|
||||
})
|
||||
@@ -165,24 +178,24 @@ const exportFollowing = () => {
|
||||
};
|
||||
|
||||
const exportBlocking = () => {
|
||||
os.api('i/export-blocking', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-blocking', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportUserLists = () => {
|
||||
os.api('i/export-user-lists', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-user-lists', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportMuting = () => {
|
||||
os.api('i/export-mute', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-mute', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const exportAntennas = () => {
|
||||
os.api('i/export-antennas', {}).then(onExportSuccess).catch(onError);
|
||||
misskeyApi('i/export-antennas', {}).then(onExportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const importFollowing = async (ev) => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('i/import-following', {
|
||||
misskeyApi('i/import-following', {
|
||||
fileId: file.id,
|
||||
withReplies: withReplies.value,
|
||||
}).then(onImportSuccess).catch(onError);
|
||||
@@ -190,22 +203,22 @@ const importFollowing = async (ev) => {
|
||||
|
||||
const importUserLists = async (ev) => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('i/import-user-lists', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
misskeyApi('i/import-user-lists', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const importMuting = async (ev) => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('i/import-muting', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
misskeyApi('i/import-muting', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const importBlocking = async (ev) => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
misskeyApi('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const importAntennas = async (ev) => {
|
||||
const file = await selectFile(ev.currentTarget ?? ev.target);
|
||||
os.api('i/import-antennas', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
misskeyApi('i/import-antennas', { fileId: file.id }).then(onImportSuccess).catch(onError);
|
||||
};
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
@@ -35,9 +35,9 @@ import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||
import { signout, $i } from '@/account.js';
|
||||
import { clearCache } from '@/scripts/clear-cache.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { PageMetadata, definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/global/router/supplier.js';
|
||||
|
||||
const indexInfo = {
|
||||
title: i18n.ts.settings,
|
||||
|
||||
@@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</div>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder :defaultOpen="!!$i?.movedTo">
|
||||
<MkFolder :defaultOpen="!!$i.movedTo">
|
||||
<template #icon><i class="ti ti-plane-departure"></i></template>
|
||||
<template #label>{{ i18n.ts._accountMigration.moveTo }}</template>
|
||||
|
||||
@@ -66,24 +66,27 @@ import MkButton from '@/components/MkButton.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkUserInfo from '@/components/MkUserInfo.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
const moveToAccount = ref('');
|
||||
const movedTo = ref<Misskey.entities.UserDetailed>();
|
||||
const accountAliases = ref(['']);
|
||||
|
||||
async function init() {
|
||||
if ($i?.movedTo) {
|
||||
movedTo.value = await os.api('users/show', { userId: $i.movedTo });
|
||||
if ($i.movedTo) {
|
||||
movedTo.value = await misskeyApi('users/show', { userId: $i.movedTo });
|
||||
} else {
|
||||
moveToAccount.value = '';
|
||||
}
|
||||
|
||||
if ($i?.alsoKnownAs && $i.alsoKnownAs.length > 0) {
|
||||
const alsoKnownAs = await os.api('users/show', { userIds: $i.alsoKnownAs });
|
||||
if ($i.alsoKnownAs && $i.alsoKnownAs.length > 0) {
|
||||
const alsoKnownAs = await misskeyApi('users/show', { userIds: $i.alsoKnownAs });
|
||||
accountAliases.value = (alsoKnownAs && alsoKnownAs.length > 0) ? alsoKnownAs.map(user => `@${Misskey.acct.toString(user)}`) : [''];
|
||||
} else {
|
||||
accountAliases.value = [''];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user