refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694)

* refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる

* fix

* fix

* renate to "misskeyApi"

* rename file
This commit is contained in:
おさむのひと 2024-01-04 18:32:46 +09:00 committed by GitHub
parent ea41cc6ec0
commit fa9c4a19b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
191 changed files with 581 additions and 468 deletions

View file

@ -37,6 +37,7 @@ import * as Misskey from 'misskey-js';
import MkButton from '@/components/MkButton.vue';
import MkPostForm from '@/components/MkPostForm.vue';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { postMessageToParentWindow } from '@/scripts/post-message.js';
import { i18n } from '@/i18n.js';
@ -76,7 +77,7 @@ async function init() {
]
// TypeScript
.map(q => 'username' in q ? { username: q.username, host: q.host === null ? undefined : q.host } : q)
.map(q => os.api('users/show', q)
.map(q => misskeyApi('users/show', q)
.then(user => {
visibleUsers.value.push(user);
}, () => {
@ -91,11 +92,11 @@ async function init() {
const replyId = urlParams.get('replyId');
const replyUri = urlParams.get('replyUri');
if (replyId) {
reply.value = await os.api('notes/show', {
reply.value = await misskeyApi('notes/show', {
noteId: replyId,
});
} else if (replyUri) {
const obj = await os.api('ap/show', {
const obj = await misskeyApi('ap/show', {
uri: replyUri,
});
if (obj.type === 'Note') {
@ -108,11 +109,11 @@ async function init() {
const renoteId = urlParams.get('renoteId');
const renoteUri = urlParams.get('renoteUri');
if (renoteId) {
renote.value = await os.api('notes/show', {
renote.value = await misskeyApi('notes/show', {
noteId: renoteId,
});
} else if (renoteUri) {
const obj = await os.api('ap/show', {
const obj = await misskeyApi('ap/show', {
uri: renoteUri,
});
if (obj.type === 'Note') {
@ -126,7 +127,7 @@ async function init() {
if (fileIds) {
await Promise.all(
fileIds.split(',')
.map(fileId => os.api('drive/files/show', { fileId })
.map(fileId => misskeyApi('drive/files/show', { fileId })
.then(file => {
files.value.push(file);
}, () => {