From a07d753da84191bc8c185a7bcd6d73fab9529b5d Mon Sep 17 00:00:00 2001 From: YuzuRyo61 Date: Sat, 6 Mar 2021 22:34:11 +0900 Subject: [PATCH] =?UTF-8?q?API=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E6=94=B9=E5=96=84=20(#6757)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update api document in admin/announcements * Update api document in announcements * Update api document in i/read-announcements * Update api document in username/available * Update api document & Fix typo in API 403 error * Update api document * Update api document * Update api document * Fix API permission definition * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Update api document * Fix bug in users (api) * Apply reviews #6757 * Apply reviews #6757 Co-authored-by: syuilo --- src/models/repositories/antenna.ts | 72 +++- src/models/repositories/app.ts | 30 +- src/models/repositories/drive-file.ts | 62 ++- .../repositories/federation-instance.ts | 106 +++++ src/models/repositories/queue.ts | 30 ++ src/models/repositories/user.ts | 285 ++++++++++--- .../api/endpoints/admin/abuse-user-reports.ts | 73 ++++ .../api/endpoints/admin/accounts/create.ts | 18 + .../endpoints/admin/announcements/create.ts | 46 +++ .../endpoints/admin/announcements/delete.ts | 5 + .../api/endpoints/admin/announcements/list.ts | 55 +++ .../endpoints/admin/announcements/update.ts | 5 + .../admin/delete-all-files-of-a-user.ts | 5 + src/server/api/endpoints/admin/delete-logs.ts | 5 + .../admin/drive/clean-remote-files.ts | 5 + .../api/endpoints/admin/drive/cleanup.ts | 5 + src/server/api/endpoints/admin/drive/files.ts | 15 + .../api/endpoints/admin/drive/show-file.ts | 148 +++++++ src/server/api/endpoints/admin/emoji/copy.ts | 18 + .../api/endpoints/admin/emoji/list-remote.ts | 49 ++- src/server/api/endpoints/admin/emoji/list.ts | 49 ++- .../admin/federation/delete-all-files.ts | 5 + .../admin/federation/remove-all-following.ts | 5 + .../admin/federation/update-instance.ts | 5 + .../api/endpoints/admin/get-table-stats.ts | 12 + src/server/api/endpoints/admin/invite.ts | 20 +- src/server/api/endpoints/admin/logs.ts | 59 +++ .../api/endpoints/admin/promo/create.ts | 5 + src/server/api/endpoints/admin/queue/clear.ts | 5 + .../endpoints/admin/queue/deliver-delayed.ts | 30 ++ .../endpoints/admin/queue/inbox-delayed.ts | 30 ++ src/server/api/endpoints/admin/queue/jobs.ts | 37 ++ src/server/api/endpoints/admin/queue/stats.ts | 26 +- src/server/api/endpoints/admin/relays/add.ts | 30 +- src/server/api/endpoints/admin/relays/list.ts | 34 +- .../api/endpoints/admin/relays/remove.ts | 3 +- .../api/endpoints/admin/reset-password.ts | 14 + .../admin/resolve-abuse-user-report.ts | 5 + .../api/endpoints/admin/resync-chart.ts | 5 + src/server/api/endpoints/admin/send-email.ts | 5 + src/server/api/endpoints/admin/server-info.ts | 88 ++++ .../endpoints/admin/show-moderation-logs.ts | 44 ++ src/server/api/endpoints/admin/show-user.ts | 146 ++++++- src/server/api/endpoints/admin/show-users.ts | 15 + src/server/api/endpoints/admin/vacuum.ts | 5 + src/server/api/endpoints/announcements.ts | 55 +++ src/server/api/endpoints/antennas/create.ts | 11 + src/server/api/endpoints/antennas/delete.ts | 5 + src/server/api/endpoints/antennas/list.ts | 15 + src/server/api/endpoints/antennas/notes.ts | 15 + src/server/api/endpoints/antennas/show.ts | 11 + src/server/api/endpoints/antennas/update.ts | 11 + src/server/api/endpoints/ap/show.ts | 19 +- src/server/api/endpoints/app/show.ts | 6 + src/server/api/endpoints/auth/session/show.ts | 21 + src/server/api/endpoints/blocking/create.ts | 6 + src/server/api/endpoints/blocking/delete.ts | 70 ++++ src/server/api/endpoints/clips/create.ts | 6 + src/server/api/endpoints/clips/list.ts | 10 + src/server/api/endpoints/clips/notes.ts | 10 + src/server/api/endpoints/clips/show.ts | 6 + src/server/api/endpoints/clips/update.ts | 6 + .../api/endpoints/drive/files/update.ts | 6 + .../api/endpoints/drive/folders/create.ts | 6 + .../api/endpoints/drive/folders/update.ts | 6 + src/server/api/endpoints/endpoints.ts | 20 + .../api/endpoints/federation/instances.ts | 11 + .../api/endpoints/federation/show-instance.ts | 7 + src/server/api/endpoints/following/create.ts | 6 + src/server/api/endpoints/following/delete.ts | 6 + .../endpoints/following/requests/cancel.ts | 6 + .../api/endpoints/following/requests/list.ts | 28 +- .../api/endpoints/games/reversi/games.ts | 107 +++++ .../api/endpoints/games/reversi/games/show.ts | 119 ++++++ .../endpoints/games/reversi/invitations.ts | 43 +- .../endpoints/i/get-word-muted-notes-count.ts | 11 + src/server/api/endpoints/i/page-likes.ts | 17 + src/server/api/endpoints/i/pages.ts | 10 + src/server/api/endpoints/i/pin.ts | 6 + .../api/endpoints/i/read-announcement.ts | 5 + src/server/api/endpoints/i/unpin.ts | 6 + src/server/api/endpoints/i/update.ts | 6 + .../api/endpoints/i/user-group-invites.ts | 21 + src/server/api/endpoints/meta.ts | 380 +++++++++++++++++- src/server/api/endpoints/miauth/gen-token.ts | 11 + src/server/api/endpoints/my/apps.ts | 49 +++ .../endpoints/notes/polls/recommendation.ts | 10 + src/server/api/endpoints/notes/state.ts | 15 + .../api/endpoints/notifications/create.ts | 4 + src/server/api/endpoints/promo/read.ts | 5 + src/server/api/endpoints/room/show.ts | 79 +++- src/server/api/endpoints/room/update.ts | 1 + src/server/api/endpoints/stats.ts | 9 + src/server/api/endpoints/sw/register.ts | 16 + .../api/endpoints/username/available.ts | 17 + src/server/api/endpoints/users.ts | 5 + .../api/endpoints/users/lists/update.ts | 6 + src/server/api/endpoints/users/relation.ts | 87 ++++ src/server/api/openapi/gen-spec.ts | 2 +- src/server/api/openapi/schemas.ts | 8 + 100 files changed, 3050 insertions(+), 109 deletions(-) create mode 100644 src/models/repositories/federation-instance.ts create mode 100644 src/models/repositories/queue.ts diff --git a/src/models/repositories/antenna.ts b/src/models/repositories/antenna.ts index b20da26c5..0f0a5c017 100644 --- a/src/models/repositories/antenna.ts +++ b/src/models/repositories/antenna.ts @@ -41,20 +41,78 @@ export const packedAntennaSchema = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id', - description: 'The unique identifier for this Antenna.', - example: 'xxxxxxxxxx', + format: 'id' }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time', - description: 'The date that the Antenna was created.' + format: 'date-time' }, name: { type: 'string' as const, - optional: false as const, nullable: false as const, - description: 'The name of the Antenna.' + optional: false as const, nullable: false as const }, + keywords: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + execludeKeywords: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + src: { + type: 'string' as const, + optional: false as const, nullable: false as const, + enum: ['home', 'all', 'users', 'list', 'group'] + }, + userListId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + userGroupId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + users: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + caseSensitive: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + notify: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + withReplies: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + withFile: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hasUnreadNote: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + } }, }; diff --git a/src/models/repositories/app.ts b/src/models/repositories/app.ts index f5cc10787..33e0f4115 100644 --- a/src/models/repositories/app.ts +++ b/src/models/repositories/app.ts @@ -46,33 +46,35 @@ export const packedAppSchema = { properties: { id: { type: 'string' as const, - optional: false as const, nullable: false as const, - format: 'id', - description: 'The unique identifier for this Note.', - example: 'xxxxxxxxxx', + optional: false as const, nullable: false as const }, name: { type: 'string' as const, - optional: false as const, nullable: false as const, - description: 'アプリケーションの名前' + optional: false as const, nullable: false as const }, - callbackUrl: { + createdAt: { type: 'string' as const, - optional: false as const, nullable: true as const, - description: 'コールバックするURL' + optional: false as const, nullable: false as const + }, + lastUsedAt: { + type: 'string' as const, + optional: false as const, nullable: false as const }, permission: { type: 'array' as const, - optional: true as const, nullable: false as const, + optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const, + optional: false as const, nullable: false as const } }, secret: { type: 'string' as const, - optional: true as const, nullable: false as const, - description: 'アプリケーションのシークレットキー' + optional: true as const, nullable: false as const + }, + isAuthorized: { + type: 'boolean' as const, + optional: true as const, nullable: false as const } - }, + } }; diff --git a/src/models/repositories/drive-file.ts b/src/models/repositories/drive-file.ts index 3d013b8bb..5085c76e9 100644 --- a/src/models/repositories/drive-file.ts +++ b/src/models/repositories/drive-file.ts @@ -182,12 +182,52 @@ export const packedDriveFileSchema = { description: 'The size of this Drive file. (bytes)', example: 51469 }, + isSensitive: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + description: 'Whether this Drive file is sensitive.', + }, + blurhash: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + properties: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + width: { + type: 'number' as const, + optional: false as const, nullable: false as const, + example: 1280 + }, + height: { + type: 'number' as const, + optional: false as const, nullable: false as const, + example: 720 + }, + avgColor: { + type: 'string' as const, + optional: true as const, nullable: false as const, + example: 'rgb(40,65,87)' + } + } + }, url: { type: 'string' as const, optional: false as const, nullable: true as const, format: 'url', description: 'The URL of this Drive file.', }, + thumbnailUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'url', + description: 'The thumbnail URL of this Drive file.', + }, + comment: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, folderId: { type: 'string' as const, optional: false as const, nullable: true as const, @@ -195,10 +235,24 @@ export const packedDriveFileSchema = { description: 'The parent folder ID of this Drive file.', example: 'xxxxxxxxxx', }, - isSensitive: { - type: 'boolean' as const, - optional: false as const, nullable: false as const, - description: 'Whether this Drive file is sensitive.', + folder: { + type: 'object' as const, + optional: true as const, nullable: true as const, + description: 'The parent folder of this Drive file.', + ref: 'DriveFolder' }, + userId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id', + description: 'Owner ID of this Drive file.', + example: 'xxxxxxxxxx', + }, + user: { + type: 'object' as const, + optional: true as const, nullable: true as const, + description: 'Owner of this Drive file.', + ref: 'User' + } }, }; diff --git a/src/models/repositories/federation-instance.ts b/src/models/repositories/federation-instance.ts new file mode 100644 index 000000000..c6b08dc10 --- /dev/null +++ b/src/models/repositories/federation-instance.ts @@ -0,0 +1,106 @@ +import config from '../../config'; + +export const packedFederationInstanceSchema = { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + caughtAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + host: { + type: 'string' as const, + optional: false as const, nullable: false as const, + example: 'misskey.example.com' + }, + usersCount: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + notesCount: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + followingCount: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + followersCount: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + driveUsage: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + driveFiles: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + latestRequestSentAt: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'date-time' + }, + lastCommunicatedAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + isNotResponding: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isSuspended: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + softwareName: { + type: 'string' as const, + optional: false as const, nullable: true as const, + example: 'misskey' + }, + softwareVersion: { + type: 'string' as const, + optional: false as const, nullable: true as const, + example: config.version + }, + openRegistrations: { + type: 'boolean' as const, + optional: false as const, nullable: true as const, + example: true + }, + name: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + description: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + maintainerName: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + maintainerEmail: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + iconUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'url' + }, + infoUpdatedAt: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'date-time' + } + } +}; diff --git a/src/models/repositories/queue.ts b/src/models/repositories/queue.ts new file mode 100644 index 000000000..161751ddc --- /dev/null +++ b/src/models/repositories/queue.ts @@ -0,0 +1,30 @@ +export const packedQueueCountSchema = { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + waiting: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + active: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + completed: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + failed: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + delayed: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + paused: { + type: 'number' as const, + optional: false as const, nullable: false as const + } + } +}; diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts index 7502e7a08..3a6ab48c5 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -330,22 +330,22 @@ export const packedUserSchema = { description: 'The unique identifier for this User.', example: 'xxxxxxxxxx', }, - username: { - type: 'string' as const, - nullable: false as const, optional: false as const, - description: 'The screen name, handle, or alias that this user identifies themselves with.', - example: 'ai' - }, name: { type: 'string' as const, nullable: true as const, optional: false as const, description: 'The name of the user, as they’ve defined it.', example: '藍' }, - url: { + username: { type: 'string' as const, - format: 'url', - nullable: true as const, optional: true as const, + nullable: false as const, optional: false as const, + description: 'The screen name, handle, or alias that this user identifies themselves with.', + example: 'ai' + }, + host: { + type: 'string' as const, + nullable: true as const, optional: false as const, + example: 'misskey.example.com' }, avatarUrl: { type: 'string' as const, @@ -356,35 +356,69 @@ export const packedUserSchema = { type: 'any' as const, nullable: true as const, optional: false as const, }, - bannerUrl: { + avatarColor: { + type: 'any' as const, + nullable: true as const, optional: false as const, + default: null + }, + isAdmin: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + description: 'Whether this account is the admin.', + default: false + }, + isModerator: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + description: 'Whether this account is a moderator.', + default: false + }, + isBot: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + description: 'Whether this account is a bot.' + }, + isCat: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + description: 'Whether this account is a cat.' + }, + emojis: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + host: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + url: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'url' + }, + aliases: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + } + } + } + }, + url: { type: 'string' as const, format: 'url', nullable: true as const, optional: true as const, }, - bannerBlurhash: { - type: 'any' as const, - nullable: true as const, optional: true as const, - }, - emojis: { - type: 'any' as const, - nullable: true as const, optional: false as const, - }, - host: { - type: 'string' as const, - nullable: true as const, optional: false as const, - example: 'misskey.example.com' - }, - description: { - type: 'string' as const, - nullable: true as const, optional: true as const, - description: 'The user-defined UTF-8 string describing their account.', - example: 'Hi masters, I am Ai!' - }, - birthday: { - type: 'string' as const, - nullable: true as const, optional: true as const, - example: '2018-03-12' - }, createdAt: { type: 'string' as const, nullable: false as const, optional: true as const, @@ -396,10 +430,63 @@ export const packedUserSchema = { nullable: true as const, optional: true as const, format: 'date-time', }, + bannerUrl: { + type: 'string' as const, + format: 'url', + nullable: true as const, optional: true as const, + }, + bannerBlurhash: { + type: 'any' as const, + nullable: true as const, optional: true as const, + }, + bannerColor: { + type: 'any' as const, + nullable: true as const, optional: true as const, + default: null + }, + isLocked: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + isSuspended: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + example: false + }, + description: { + type: 'string' as const, + nullable: true as const, optional: true as const, + description: 'The user-defined UTF-8 string describing their account.', + example: 'Hi masters, I am Ai!' + }, location: { type: 'string' as const, nullable: true as const, optional: true as const, }, + birthday: { + type: 'string' as const, + nullable: true as const, optional: true as const, + example: '2018-03-12' + }, + fields: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + value: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + }, + maxLength: 4 + } + }, followersCount: { type: 'number' as const, nullable: false as const, optional: true as const, @@ -415,11 +502,6 @@ export const packedUserSchema = { nullable: false as const, optional: true as const, description: 'The number of Notes (including renotes) issued by the user.' }, - isBot: { - type: 'boolean' as const, - nullable: false as const, optional: true as const, - description: 'Whether this account is a bot.' - }, pinnedNoteIds: { type: 'array' as const, nullable: false as const, optional: true as const, @@ -438,24 +520,59 @@ export const packedUserSchema = { ref: 'Note' } }, - isCat: { - type: 'boolean' as const, - nullable: false as const, optional: true as const, - description: 'Whether this account is a cat.' + pinnedPageId: { + type: 'string' as const, + nullable: true as const, optional: false as const }, - isAdmin: { - type: 'boolean' as const, - nullable: false as const, optional: true as const, - description: 'Whether this account is the admin.' + pinnedPage: { + type: 'object' as const, + nullable: true as const, optional: false as const, + ref: 'Page' }, - isModerator: { + twoFactorEnabled: { type: 'boolean' as const, - nullable: false as const, optional: true as const, - description: 'Whether this account is a moderator.' + nullable: false as const, optional: false as const, + default: false }, - isLocked: { + usePasswordLessLogin: { type: 'boolean' as const, - nullable: false as const, optional: true as const, + nullable: false as const, optional: false as const, + default: false + }, + securityKeys: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + default: false + }, + avatarId: { + type: 'string' as const, + nullable: true as const, optional: true as const, + format: 'id' + }, + bannerId: { + type: 'string' as const, + nullable: true as const, optional: true as const, + format: 'id' + }, + autoWatch: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + injectFeaturedNote: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + alwaysMarkNsfw: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + carefulBot: { + type: 'boolean' as const, + nullable: false as const, optional: true as const + }, + autoAcceptFollowed: { + type: 'boolean' as const, + nullable: false as const, optional: true as const }, hasUnreadSpecifiedNotes: { type: 'boolean' as const, @@ -465,5 +582,69 @@ export const packedUserSchema = { type: 'boolean' as const, nullable: false as const, optional: true as const, }, + hasUnreadAnnouncement: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasUnreadAntenna: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasUnreadChannel: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasUnreadMessagingMessage: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasUnreadNotification: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + hasPendingReceivedFollowRequest: { + type: 'boolean' as const, + nullable: false as const, optional: true as const, + }, + integrations: { + type: 'object' as const, + nullable: false as const, optional: true as const + }, + mutedWords: { + type: 'array' as const, + nullable: false as const, optional: true as const + }, + mutingNotificationTypes: { + type: 'array' as const, + nullable: false as const, optional: true as const + }, + isFollowing: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + hasPendingFollowRequestFromYou: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + hasPendingFollowRequestToYou: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isFollowed: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isBlocking: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isBlocked: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + isMuted: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + } }, }; diff --git a/src/server/api/endpoints/admin/abuse-user-reports.ts b/src/server/api/endpoints/admin/abuse-user-reports.ts index 6a7f380e1..d63997d20 100644 --- a/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -5,6 +5,11 @@ import { AbuseUserReports } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { + desc: { + 'ja-JP': '通報一覧を表示します。', + 'en-US': 'Show list of abuse user reports.' + }, + tags: ['admin'], requireCredential: true as const, @@ -46,6 +51,74 @@ export const meta = { ]), default: 'combined' }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'id', + description: 'The unique identifier for this User.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'date-time', + description: 'The date that the abuse user report was created on Misskey.' + }, + comment: { + type: 'string' as const, + nullable: false as const, optional: false as const, + description: 'The content of the report.', + }, + resolved: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + description: 'Returns whether this report has been resolved', + example: false + }, + reporterId: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'id', + description: 'Reporter\'s user ID.' + }, + targetUserId: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'id', + description: 'User ID of the person to be reported.' + }, + assigneeId: { + type: 'string' as const, + nullable: true as const, optional: false as const, + format: 'id', + description: 'User ID of the person who responded to the report.' + }, + reporter: { + type: 'object' as const, + nullable: false as const, optional: false as const, + ref: 'User' + }, + targetUser: { + type: 'object' as const, + nullable: false as const, optional: false as const, + ref: 'User' + }, + assignee: { + type: 'object' as const, + nullable: true as const, optional: true as const, + ref: 'User' + } + } + } } }; diff --git a/src/server/api/endpoints/admin/accounts/create.ts b/src/server/api/endpoints/admin/accounts/create.ts index 98e5642be..27ceca158 100644 --- a/src/server/api/endpoints/admin/accounts/create.ts +++ b/src/server/api/endpoints/admin/accounts/create.ts @@ -3,6 +3,11 @@ import { Users } from '../../../../../models'; import { signup } from '../../../common/signup'; export const meta = { + desc: { + 'ja-JP': 'アカウントを作成します。', + 'en-US': 'Create a account.' + }, + tags: ['admin'], params: { @@ -13,6 +18,19 @@ export const meta = { password: { validator: Users.validatePassword, } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User', + properties: { + token: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Token to access this user.' + } + } } }; diff --git a/src/server/api/endpoints/admin/announcements/create.ts b/src/server/api/endpoints/admin/announcements/create.ts index f9fb30f49..dc01621c7 100644 --- a/src/server/api/endpoints/admin/announcements/create.ts +++ b/src/server/api/endpoints/admin/announcements/create.ts @@ -4,6 +4,11 @@ import { Announcements } from '../../../../../models'; import { genId } from '../../../../../misc/gen-id'; export const meta = { + desc: { + 'ja-JP': 'アナウンスを作成します。', + 'en-US': 'Create a announcement.' + }, + tags: ['admin'], requireCredential: true as const, @@ -19,6 +24,47 @@ export const meta = { imageUrl: { validator: $.nullable.str.min(1) } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Announcement.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time', + description: 'The date that the Announcement was created.' + }, + updatedAt: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'date-time', + description: 'The date that the Announcement was updated.' + }, + title: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement title.' + }, + text: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement text.' + }, + imageUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'Announcement image.' + } + } } }; diff --git a/src/server/api/endpoints/admin/announcements/delete.ts b/src/server/api/endpoints/admin/announcements/delete.ts index 1b7a0bf92..6c9c06575 100644 --- a/src/server/api/endpoints/admin/announcements/delete.ts +++ b/src/server/api/endpoints/admin/announcements/delete.ts @@ -10,6 +10,11 @@ export const meta = { requireCredential: true as const, requireModerator: true, + desc: { + 'ja-JP': 'アナウンスを削除します。', + 'en-US': 'Delete a announcement.' + }, + params: { id: { validator: $.type(ID) diff --git a/src/server/api/endpoints/admin/announcements/list.ts b/src/server/api/endpoints/admin/announcements/list.ts index 4c3af5a31..5489b0d2c 100644 --- a/src/server/api/endpoints/admin/announcements/list.ts +++ b/src/server/api/endpoints/admin/announcements/list.ts @@ -5,6 +5,11 @@ import { Announcements, AnnouncementReads } from '../../../../../models'; import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { + desc: { + 'ja-JP': 'アナウンスのリストを表示します。', + 'en-US': 'List announcements.' + }, + tags: ['admin'], requireCredential: true as const, @@ -23,6 +28,56 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Announcement.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time', + description: 'The date that the Announcement was created.' + }, + updatedAt: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'date-time', + description: 'The date that the Announcement was updated.' + }, + text: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement text.' + }, + title: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement title.' + }, + imageUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'Announcement image.' + }, + reads: { + type: 'number' as const, + optional: false as const, nullable: false as const, + description: 'Number of people who read this announcement.' + } + } + } } }; diff --git a/src/server/api/endpoints/admin/announcements/update.ts b/src/server/api/endpoints/admin/announcements/update.ts index fd24f8cc8..9c4165eae 100644 --- a/src/server/api/endpoints/admin/announcements/update.ts +++ b/src/server/api/endpoints/admin/announcements/update.ts @@ -5,6 +5,11 @@ import { Announcements } from '../../../../../models'; import { ApiError } from '../../../error'; export const meta = { + desc: { + 'ja-JP': 'アナウンスの内容を変更します。', + 'en-US': 'Update a annoucement.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 83397f107..9da3b632a 100644 --- a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -5,6 +5,11 @@ import { DriveFiles } from '../../../../models'; import { ID } from '../../../../misc/cafy-id'; export const meta = { + desc: { + 'ja-JP': '対象のユーザーのファイルを全て削除します。', + 'en-US': 'Delete all files to specified user.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/delete-logs.ts b/src/server/api/endpoints/admin/delete-logs.ts index 9cb9f809d..371938731 100644 --- a/src/server/api/endpoints/admin/delete-logs.ts +++ b/src/server/api/endpoints/admin/delete-logs.ts @@ -2,6 +2,11 @@ import define from '../../define'; import { Logs } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': 'ログを全て削除します。', + 'en-US': 'Delete all logs.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/src/server/api/endpoints/admin/drive/clean-remote-files.ts index 5a5adb8a8..20856da1c 100644 --- a/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -2,6 +2,11 @@ import define from '../../../define'; import { createCleanRemoteFilesJob } from '../../../../../queue'; export const meta = { + desc: { + 'ja-JP': 'キャッシュされたリモートファイルをすべて削除します。', + 'en-US': 'Deletes all cached remote files.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/drive/cleanup.ts b/src/server/api/endpoints/admin/drive/cleanup.ts index b76236a7f..f4867597f 100644 --- a/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/src/server/api/endpoints/admin/drive/cleanup.ts @@ -4,6 +4,11 @@ import { deleteFile } from '../../../../../services/drive/delete-file'; import { DriveFiles } from '../../../../../models'; export const meta = { + desc: { + 'ja-JP': '使用されていないユーザーのファイルを削除します。', + 'en-US': 'Delete the unused user\'s files.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/drive/files.ts b/src/server/api/endpoints/admin/drive/files.ts index f6296b894..496050d2d 100644 --- a/src/server/api/endpoints/admin/drive/files.ts +++ b/src/server/api/endpoints/admin/drive/files.ts @@ -5,6 +5,11 @@ import { makePaginationQuery } from '../../../common/make-pagination-query'; import { ID } from '../../../../../misc/cafy-id'; export const meta = { + desc: { + 'ja-JP': '管理用のドライブの一覧を表示します。', + 'en-US': 'Displays a list of management drives.' + }, + tags: ['admin'], requireCredential: false as const, @@ -41,6 +46,16 @@ export const meta = { validator: $.optional.nullable.str, default: null }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'DriveFile' + } } }; diff --git a/src/server/api/endpoints/admin/drive/show-file.ts b/src/server/api/endpoints/admin/drive/show-file.ts index 36403bb1c..96478a1c7 100644 --- a/src/server/api/endpoints/admin/drive/show-file.ts +++ b/src/server/api/endpoints/admin/drive/show-file.ts @@ -26,6 +26,154 @@ export const meta = { code: 'NO_SUCH_FILE', id: 'caf3ca38-c6e5-472e-a30c-b05377dcc240' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Drive file.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time', + description: 'The date that the Drive file was created on Misskey.' + }, + userId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id', + description: 'Owner ID of this Drive file.', + example: 'xxxxxxxxxx', + }, + userHost: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + md5: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'md5', + description: 'The MD5 hash of this Drive file.', + example: '15eca7fba0480996e2245f5185bf39f2' + }, + name: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The file name with extension.', + example: 'lenna.jpg' + }, + type: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The MIME type of this Drive file.', + example: 'image/jpeg' + }, + size: { + type: 'number' as const, + optional: false as const, nullable: false as const, + description: 'The size of this Drive file. (bytes)', + example: 51469 + }, + comment: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + blurhash: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + properties: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + width: { + type: 'number' as const, + optional: false as const, nullable: false as const, + example: 1280 + }, + height: { + type: 'number' as const, + optional: false as const, nullable: false as const, + example: 720 + }, + avgColor: { + type: 'string' as const, + optional: true as const, nullable: false as const, + example: 'rgb(40,65,87)' + } + } + }, + storedInternal: { + type: 'boolean' as const, + optional: false as const, nullable: true as const, + description: 'Indicates whether this file is stored in the same location as Misskey itself', + example: true + }, + url: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'url', + description: 'The URL of this Drive file.', + }, + thumbnailUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'url', + description: 'The thumbnail URL of this Drive file.', + }, + webpublicUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'url', + description: 'The public URL of this Drive file.', + }, + accessKey: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Access key to access this file' + }, + thumbnailAccessKey: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Access key to access this file for thumbnail' + }, + webpublicAccessKey: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Access key to access this file for webpublic' + }, + uri: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + src: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + folderId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id', + description: 'The parent folder ID of this Drive file.', + example: 'xxxxxxxxxx', + }, + isSensitive: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + description: 'Whether this Drive file is sensitive.', + }, + isLink: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/admin/emoji/copy.ts b/src/server/api/endpoints/admin/emoji/copy.ts index 5d4e57a28..5c3c4f6fc 100644 --- a/src/server/api/endpoints/admin/emoji/copy.ts +++ b/src/server/api/endpoints/admin/emoji/copy.ts @@ -9,6 +9,11 @@ import { ID } from '../../../../../misc/cafy-id'; import uploadFromUrl from '../../../../../services/drive/upload-from-url'; export const meta = { + desc: { + 'ja-JP': '選択したカスタム絵文字をコピーします。', + 'en-US': 'Copies the selected custom emoji.' + }, + tags: ['admin'], requireCredential: true as const, @@ -26,6 +31,19 @@ export const meta = { code: 'NO_SUCH_EMOJI', id: 'e2785b66-dca3-4087-9cac-b93c541cc425' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'New copied emoji ID' + } + } } }; diff --git a/src/server/api/endpoints/admin/emoji/list-remote.ts b/src/server/api/endpoints/admin/emoji/list-remote.ts index cbdcaa681..81029fbbb 100644 --- a/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -7,7 +7,8 @@ import { ID } from '../../../../../misc/cafy-id'; export const meta = { desc: { - 'ja-JP': 'カスタム絵文字を取得します。' + 'ja-JP': 'リモートのカスタム絵文字一覧を取得します。', + 'en-US': 'Gets a list of remote custom emojis.' }, tags: ['admin'], @@ -38,6 +39,52 @@ export const meta = { untilId: { validator: $.optional.type(ID), } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Emoji.' + }, + aliases: { + type: 'array' as const, + optional: false as const, nullable: false as const, + description: 'List to make it easier to be displayed as a candidate when entering emoji.', + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + name: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Official name of custom emoji.' + }, + category: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'Names categorized in the emoji list.' + }, + host: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'If it is another server, the FQDN will be returned here.' + }, + url: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Image URL of emoji.' + } + } + } } }; diff --git a/src/server/api/endpoints/admin/emoji/list.ts b/src/server/api/endpoints/admin/emoji/list.ts index bd3e29485..6d042b0af 100644 --- a/src/server/api/endpoints/admin/emoji/list.ts +++ b/src/server/api/endpoints/admin/emoji/list.ts @@ -7,7 +7,8 @@ import { Emoji } from '../../../../../models/entities/emoji'; export const meta = { desc: { - 'ja-JP': 'カスタム絵文字を取得します。' + 'ja-JP': 'カスタム絵文字一覧を取得します。', + 'en-US': 'List custom emojis.' }, tags: ['admin'], @@ -33,6 +34,52 @@ export const meta = { untilId: { validator: $.optional.type(ID), } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Emoji.' + }, + aliases: { + type: 'array' as const, + optional: false as const, nullable: false as const, + description: 'List to make it easier to be displayed as a candidate when entering emoji.', + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + name: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Official name of custom emoji.' + }, + category: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'Names categorized in the emoji list.' + }, + host: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'If it is another server, the FQDN will be returned here.' + }, + url: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Image URL of emoji.' + } + } + } } }; diff --git a/src/server/api/endpoints/admin/federation/delete-all-files.ts b/src/server/api/endpoints/admin/federation/delete-all-files.ts index eef53cd92..c0a8c94f4 100644 --- a/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -4,6 +4,11 @@ import { deleteFile } from '../../../../../services/drive/delete-file'; import { DriveFiles } from '../../../../../models'; export const meta = { + desc: { + 'ja-JP': '指定したドメインのファイルを全て削除します。', + 'en-US': 'Deletes all files in the specified domain.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/federation/remove-all-following.ts b/src/server/api/endpoints/admin/federation/remove-all-following.ts index e59319355..4a6f6e626 100644 --- a/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -4,6 +4,11 @@ import deleteFollowing from '../../../../../services/following/delete'; import { Followings, Users } from '../../../../../models'; export const meta = { + desc: { + 'ja-JP': '指定したドメインの全ユーザーのフォローを全て解除します。', + 'en-US': 'Unfollow all users in the specified domain.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/federation/update-instance.ts b/src/server/api/endpoints/admin/federation/update-instance.ts index 8f8b3334b..7206e4fb2 100644 --- a/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/src/server/api/endpoints/admin/federation/update-instance.ts @@ -4,6 +4,11 @@ import { Instances } from '../../../../../models'; import { toPuny } from '../../../../../misc/convert-host'; export const meta = { + desc: { + 'ja-JP': '指定したドメインのアクティビティの配信を停止するかを選択します。', + 'en-US': 'Select whether to undeliver the activity for the specified domain.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/get-table-stats.ts b/src/server/api/endpoints/admin/get-table-stats.ts index eb9f26fc0..351c23003 100644 --- a/src/server/api/endpoints/admin/get-table-stats.ts +++ b/src/server/api/endpoints/admin/get-table-stats.ts @@ -6,6 +6,7 @@ export const meta = { requireModerator: true, desc: { + 'ja-JP': 'テーブル情報を取得します。', 'en-US': 'Get table stats' }, @@ -13,6 +14,17 @@ export const meta = { params: { }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + example: { + migrations: { + count: 66, + size: 32768 + }, + } + } }; export default define(meta, async () => { diff --git a/src/server/api/endpoints/admin/invite.ts b/src/server/api/endpoints/admin/invite.ts index 52e3da8f8..4529d16ad 100644 --- a/src/server/api/endpoints/admin/invite.ts +++ b/src/server/api/endpoints/admin/invite.ts @@ -5,7 +5,8 @@ import { genId } from '../../../../misc/gen-id'; export const meta = { desc: { - 'ja-JP': '招待コードを発行します。' + 'ja-JP': '招待コードを発行します。', + 'en-US': 'Issue an invitation code.' }, tags: ['admin'], @@ -13,7 +14,22 @@ export const meta = { requireCredential: true as const, requireModerator: true, - params: {} + params: {}, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + code: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Give this code to the applicant for registration.', + example: '2ERUA5VR', + maxLength: 8, + minLength: 8 + } + } + } }; export default define(meta, async () => { diff --git a/src/server/api/endpoints/admin/logs.ts b/src/server/api/endpoints/admin/logs.ts index fef2eab80..5e19b1a6f 100644 --- a/src/server/api/endpoints/admin/logs.ts +++ b/src/server/api/endpoints/admin/logs.ts @@ -4,6 +4,11 @@ import { Logs } from '../../../../models'; import { Brackets } from 'typeorm'; export const meta = { + desc: { + 'ja-JP': 'ログを表示します。', + 'en-US': 'Show logs.' + }, + tags: ['admin'], requireCredential: true as const, @@ -24,6 +29,60 @@ export const meta = { validator: $.optional.nullable.str, default: null as any } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this log.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time', + description: 'The date that the Drive file was created on Misskey.' + }, + domain: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: true as const, nullable: false as const + } + }, + level: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + worker: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + machine: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The name of the running machine.' + }, + message: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Log body.' + }, + data: { + type: 'object' as const, + optional: false as const, nullable: false as const + } + } + } } }; diff --git a/src/server/api/endpoints/admin/promo/create.ts b/src/server/api/endpoints/admin/promo/create.ts index e3c03d2f4..8b96d563c 100644 --- a/src/server/api/endpoints/admin/promo/create.ts +++ b/src/server/api/endpoints/admin/promo/create.ts @@ -6,6 +6,11 @@ import { getNote } from '../../../common/getters'; import { PromoNotes } from '../../../../../models'; export const meta = { + desc: { + 'ja-JP': 'プロモーションを作成します。', + 'en-US': 'Create a promotion.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/queue/clear.ts b/src/server/api/endpoints/admin/queue/clear.ts index 0375f55f0..bc55a02ec 100644 --- a/src/server/api/endpoints/admin/queue/clear.ts +++ b/src/server/api/endpoints/admin/queue/clear.ts @@ -3,6 +3,11 @@ import { destroy } from '../../../../../queue'; import { insertModerationLog } from '../../../../../services/insert-moderation-log'; export const meta = { + desc: { + 'ja-JP': 'ジョブキューを全て削除します。', + 'en-US': 'Delete all job queues.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/src/server/api/endpoints/admin/queue/deliver-delayed.ts index 6bfb5b50f..221aa35e4 100644 --- a/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -2,12 +2,42 @@ import define from '../../../define'; import { deliverQueue } from '../../../../../queue'; export const meta = { + desc: { + 'ja-JP': '他サーバーへ送るキューの遅延一覧を返します。', + 'en-US': 'Returns a list of delays in queues sent to other servers.' + }, + tags: ['admin'], requireCredential: true as const, requireModerator: true, params: { + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + anyOf: [ + { + type: 'string' as const, + description: 'FQDN to fediverse server' + }, + { + type: 'number' as const, + description: 'Delayed queue counts' + } + ] + } + }, + example: [[ + 'example.com', + 12 + ]] } }; diff --git a/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 4627cefdd..52f67cb51 100644 --- a/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -2,12 +2,42 @@ import define from '../../../define'; import { inboxQueue } from '../../../../../queue'; export const meta = { + desc: { + 'ja-JP': 'このサーバーへのキューの遅延一覧を返します。', + 'en-US': 'Returns a list of queue delays to this server.' + }, + tags: ['admin'], requireCredential: true as const, requireModerator: true, params: { + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + anyOf: [ + { + type: 'string' as const, + description: 'FQDN to fediverse server' + }, + { + type: 'number' as const, + description: 'Delayed queue counts' + } + ] + } + }, + example: [[ + 'example.com', + 12 + ]] } }; diff --git a/src/server/api/endpoints/admin/queue/jobs.ts b/src/server/api/endpoints/admin/queue/jobs.ts index 0cd3f40d4..5ab78e3c4 100644 --- a/src/server/api/endpoints/admin/queue/jobs.ts +++ b/src/server/api/endpoints/admin/queue/jobs.ts @@ -3,6 +3,11 @@ import define from '../../../define'; import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../../../../../queue'; export const meta = { + desc: { + 'ja-JP': 'ジョブ一覧を表示します。', + 'en-US': 'Display the job list.' + }, + tags: ['admin'], requireCredential: true as const, @@ -21,6 +26,38 @@ export const meta = { validator: $.optional.num, default: 50 }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + data: { + type: 'object' as const, + optional: false as const, nullable: false as const + }, + attempts: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + maxAttempts: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + timestamp: { + type: 'number' as const, + optional: false as const, nullable: false as const + } + } + } } }; diff --git a/src/server/api/endpoints/admin/queue/stats.ts b/src/server/api/endpoints/admin/queue/stats.ts index da29c5285..bd64d2ac0 100644 --- a/src/server/api/endpoints/admin/queue/stats.ts +++ b/src/server/api/endpoints/admin/queue/stats.ts @@ -2,12 +2,36 @@ import define from '../../../define'; import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../../../../../queue'; export const meta = { + desc: { + 'ja-JP': 'キューの状態を返します。', + 'en-US': 'Returns the status of the queue.' + }, + tags: ['admin'], requireCredential: true as const, requireModerator: true, - params: {} + params: {}, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + deliver: { + ref: 'QueueCount' + }, + inbox: { + ref: 'QueueCount' + }, + db: { + ref: 'QueueCount' + }, + objectStorage: { + ref: 'QueueCount' + } + } + } }; export default define(meta, async (ps) => { diff --git a/src/server/api/endpoints/admin/relays/add.ts b/src/server/api/endpoints/admin/relays/add.ts index bcda1050e..831e05c83 100644 --- a/src/server/api/endpoints/admin/relays/add.ts +++ b/src/server/api/endpoints/admin/relays/add.ts @@ -5,7 +5,8 @@ import { ApiError } from '../../../error'; export const meta = { desc: { - 'ja-JP': 'Add relay' + 'ja-JP': 'リレーを追加します。', + 'en-US': 'Add relay' }, tags: ['admin'], @@ -25,6 +26,33 @@ export const meta = { code: 'INVALID_URL', id: 'fb8c92d3-d4e5-44e7-b3d4-800d5cef8b2c' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + inbox: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'url' + }, + status: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: 'requesting', + enum: [ + 'requesting', + 'accepted', + 'rejected' + ] + } + } } }; diff --git a/src/server/api/endpoints/admin/relays/list.ts b/src/server/api/endpoints/admin/relays/list.ts index 3b132f73b..da05ac0a2 100644 --- a/src/server/api/endpoints/admin/relays/list.ts +++ b/src/server/api/endpoints/admin/relays/list.ts @@ -3,7 +3,8 @@ import { listRelay } from '../../../../../services/relay'; export const meta = { desc: { - 'ja-JP': 'List relay' + 'ja-JP': 'リレー一覧を表示します。', + 'en-US': 'List relay' }, tags: ['admin'], @@ -13,6 +14,37 @@ export const meta = { params: { }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + inbox: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'url' + }, + status: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: 'requesting', + enum: [ + 'requesting', + 'accepted', + 'rejected' + ] + } + } + } + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/admin/relays/remove.ts b/src/server/api/endpoints/admin/relays/remove.ts index df95e0329..572d51cfc 100644 --- a/src/server/api/endpoints/admin/relays/remove.ts +++ b/src/server/api/endpoints/admin/relays/remove.ts @@ -4,7 +4,8 @@ import { removeRelay } from '../../../../../services/relay'; export const meta = { desc: { - 'ja-JP': 'Remove relay' + 'ja-JP': 'リレーを削除します。', + 'en-US': 'Remove relay' }, tags: ['admin'], diff --git a/src/server/api/endpoints/admin/reset-password.ts b/src/server/api/endpoints/admin/reset-password.ts index 1b8a5ee65..2f55cf23a 100644 --- a/src/server/api/endpoints/admin/reset-password.ts +++ b/src/server/api/endpoints/admin/reset-password.ts @@ -8,6 +8,7 @@ import { Users, UserProfiles } from '../../../../models'; export const meta = { desc: { 'ja-JP': '指定したユーザーのパスワードをリセットします。', + 'en-US': 'Reset password to specified user.' }, tags: ['admin'], @@ -23,6 +24,19 @@ export const meta = { 'en-US': 'The user ID which you want to suspend' } }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + password: { + type: 'string' as const, + optional: false as const, nullable: false as const, + minLength: 8, + maxLength: 8 + } + } } }; diff --git a/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 0a62b5f36..f8cd8def5 100644 --- a/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -4,6 +4,11 @@ import define from '../../define'; import { AbuseUserReports } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': '指定した通報を解決済みにします。', + 'en-US': 'Marks the specified report as resolved.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/resync-chart.ts b/src/server/api/endpoints/admin/resync-chart.ts index 84e19d37e..13254a3ca 100644 --- a/src/server/api/endpoints/admin/resync-chart.ts +++ b/src/server/api/endpoints/admin/resync-chart.ts @@ -3,6 +3,11 @@ import { driveChart, notesChart, usersChart, instanceChart } from '../../../../s import { insertModerationLog } from '../../../../services/insert-moderation-log'; export const meta = { + desc: { + 'ja-JP': 'チャートを再同期します。', + 'en-US': 'Resync the chart.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/send-email.ts b/src/server/api/endpoints/admin/send-email.ts index c0e77e162..51f92230a 100644 --- a/src/server/api/endpoints/admin/send-email.ts +++ b/src/server/api/endpoints/admin/send-email.ts @@ -3,6 +3,11 @@ import define from '../../define'; import { sendEmail } from '../../../../services/send-email'; export const meta = { + desc: { + 'ja-JP': 'メールを送信します。', + 'en-US': 'Send a mail.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/admin/server-info.ts b/src/server/api/endpoints/admin/server-info.ts index de4e93347..3b48a811e 100644 --- a/src/server/api/endpoints/admin/server-info.ts +++ b/src/server/api/endpoints/admin/server-info.ts @@ -9,12 +9,100 @@ export const meta = { requireModerator: true, desc: { + 'ja-JP': 'サーバー情報を表示します。', + 'en-US': 'Show server information.' }, tags: ['admin', 'meta'], params: { }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + machine: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The name of the running server' + }, + os: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'OS used by the server', + example: 'linux' + }, + node: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Version of Node.js' + }, + psql: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Version of Postgresql' + }, + cpu: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + model: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The name of the CPU you are using' + }, + cores: { + type: 'number' as const, + optional: false as const, nullable: false as const, + description: 'Number of CPU cores used (number of logical processors)' + } + } + }, + mem: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + total: { + type: 'number' as const, + optional: false as const, nullable: false as const, + format: 'bytes', + description: 'RAM capacity.' + } + } + }, + fs: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + total: { + type: 'number' as const, + optional: false as const, nullable: false as const, + format: 'bytes', + description: 'Total storage capacity.' + }, + used: { + type: 'number' as const, + optional: false as const, nullable: false as const, + format: 'bytes', + description: 'Amount of storage used' + } + } + }, + net: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + interface: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'The interface name of your network.', + example: 'eth0' + } + } + } + } + } }; export default define(meta, async () => { diff --git a/src/server/api/endpoints/admin/show-moderation-logs.ts b/src/server/api/endpoints/admin/show-moderation-logs.ts index acdfda51a..f41d91647 100644 --- a/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -5,6 +5,11 @@ import { ModerationLogs } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { + desc: { + 'ja-JP': 'モデレーションログ一覧を表示します。', + 'en-US': 'Display the moderation log list.' + }, + tags: ['admin'], requireCredential: true as const, @@ -23,6 +28,45 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + type: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + info: { + type: 'object' as const, + optional: false as const, nullable: false as const + }, + userId: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + user: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + } + } + } } }; diff --git a/src/server/api/endpoints/admin/show-user.ts b/src/server/api/endpoints/admin/show-user.ts index ea4df141f..63889a9e6 100644 --- a/src/server/api/endpoints/admin/show-user.ts +++ b/src/server/api/endpoints/admin/show-user.ts @@ -5,7 +5,8 @@ import { Users } from '../../../../models'; export const meta = { desc: { - 'ja-JP': '指定したユーザーの情報を取得します。', + 'ja-JP': '指定したユーザーの情報を取得します(管理者向け)。', + 'en-US': 'Gets the information of the specified user (for administrators).' }, tags: ['admin'], @@ -21,6 +22,149 @@ export const meta = { 'en-US': 'The user ID which you want to suspend' } }, + }, + + res: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + id: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'id' + }, + createdAt: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'date-time' + }, + updatedAt: { + type: 'string' as const, + nullable: true as const, optional: false as const, + format: 'date-time' + }, + lastFetchedAt: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + username: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + folowersCount: { + type: 'number' as const, + nullable: false as const, optional: false as const + }, + followingCount: { + type: 'number' as const, + nullable: false as const, optional: false as const + }, + notesCount: { + type: 'number' as const, + nullable: false as const, optional: false as const + }, + avatarId: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + bannerId: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + tags: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + }, + avatarUrl: { + type: 'string' as const, + nullable: true as const, optional: false as const, + format: 'url' + }, + bannerUrl: { + type: 'string' as const, + nullable: true as const, optional: false as const, + format: 'url' + }, + avatarBlurhash: { + type: 'any' as const, + nullable: true as const, optional: false as const, + default: null + }, + bannerBlurhash: { + type: 'any' as const, + nullable: true as const, optional: false as const, + default: null + }, + isSuspended: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + isSilenced: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + isLocked: { + type: 'boolean' as const, + nullable: false as const, optional: false as const, + }, + isBot: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + isCat: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + isAdmin: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + isModerator: { + type: 'boolean' as const, + nullable: false as const, optional: false as const + }, + emojis: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + }, + host: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + inbox: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + sharedInbox: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + featured: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + uri: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + token: { + type: 'string' as const, + nullable: false as const, optional: false as const, + default: '' + } + } } }; diff --git a/src/server/api/endpoints/admin/show-users.ts b/src/server/api/endpoints/admin/show-users.ts index 03abe7a57..a85380520 100644 --- a/src/server/api/endpoints/admin/show-users.ts +++ b/src/server/api/endpoints/admin/show-users.ts @@ -3,6 +3,11 @@ import define from '../../define'; import { Users } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': '管理者用のユーザー一覧を表示します。', + 'en-US': 'Displays a list of users for administrators.' + }, + tags: ['admin'], requireCredential: true as const, @@ -61,6 +66,16 @@ export const meta = { validator: $.optional.str, default: null } + }, + + res: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + ref: 'User' + } } }; diff --git a/src/server/api/endpoints/admin/vacuum.ts b/src/server/api/endpoints/admin/vacuum.ts index e041e6543..14136c751 100644 --- a/src/server/api/endpoints/admin/vacuum.ts +++ b/src/server/api/endpoints/admin/vacuum.ts @@ -4,6 +4,11 @@ import { getConnection } from 'typeorm'; import { insertModerationLog } from '../../../../services/insert-moderation-log'; export const meta = { + desc: { + 'ja-JP': 'データベースのメンテナンスを行います。', + 'en-US': 'Perform database maintenance.' + }, + tags: ['admin'], requireCredential: true as const, diff --git a/src/server/api/endpoints/announcements.ts b/src/server/api/endpoints/announcements.ts index ca46192de..5d0fd9bdf 100644 --- a/src/server/api/endpoints/announcements.ts +++ b/src/server/api/endpoints/announcements.ts @@ -5,6 +5,11 @@ import { Announcements, AnnouncementReads } from '../../../models'; import { makePaginationQuery } from '../common/make-pagination-query'; export const meta = { + desc: { + 'ja-JP': 'アナウンスを表示します。', + 'en-US': 'Show announcements.' + }, + tags: ['meta'], requireCredential: false as const, @@ -27,6 +32,56 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this Announcement.', + example: 'xxxxxxxxxx', + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time', + description: 'The date that the Announcement was created.' + }, + updatedAt: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'date-time', + description: 'The date that the Announcement was updated.' + }, + text: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement text.' + }, + title: { + type: 'string' as const, + optional: false as const, nullable: false as const, + description: 'Announcement title.' + }, + imageUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const, + description: 'Announcement image.' + }, + isRead: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + description: 'Indicates that you have read this announcement' + } + } + } } }; diff --git a/src/server/api/endpoints/antennas/create.ts b/src/server/api/endpoints/antennas/create.ts index bc7938526..b5f0eead2 100644 --- a/src/server/api/endpoints/antennas/create.ts +++ b/src/server/api/endpoints/antennas/create.ts @@ -6,6 +6,11 @@ import { ID } from '../../../../misc/cafy-id'; import { ApiError } from '../../error'; export const meta = { + desc: { + 'ja-JP': 'アンテナを作成します。', + 'en-US': 'Create a antenna.' + }, + tags: ['antennas'], requireCredential: true as const, @@ -70,6 +75,12 @@ export const meta = { code: 'NO_SUCH_USER_GROUP', id: 'aa3c0b9a-8cae-47c0-92ac-202ce5906682' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Antenna' } }; diff --git a/src/server/api/endpoints/antennas/delete.ts b/src/server/api/endpoints/antennas/delete.ts index 087834a7b..9008c37c8 100644 --- a/src/server/api/endpoints/antennas/delete.ts +++ b/src/server/api/endpoints/antennas/delete.ts @@ -5,6 +5,11 @@ import { ApiError } from '../../error'; import { Antennas } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': 'アンテナを削除します。', + 'en-US': 'Delete a antenna.' + }, + tags: ['antennas'], requireCredential: true as const, diff --git a/src/server/api/endpoints/antennas/list.ts b/src/server/api/endpoints/antennas/list.ts index cbc4e827b..bc9685887 100644 --- a/src/server/api/endpoints/antennas/list.ts +++ b/src/server/api/endpoints/antennas/list.ts @@ -2,11 +2,26 @@ import define from '../../define'; import { Antennas } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': 'アンテナの一覧を取得します。', + 'en-US': 'Get a list of antennas.' + }, + tags: ['antennas', 'account'], requireCredential: true as const, kind: 'read:account', + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Antenna' + } + } }; export default define(meta, async (ps, me) => { diff --git a/src/server/api/endpoints/antennas/notes.ts b/src/server/api/endpoints/antennas/notes.ts index 402a2758b..750fc080c 100644 --- a/src/server/api/endpoints/antennas/notes.ts +++ b/src/server/api/endpoints/antennas/notes.ts @@ -8,6 +8,11 @@ import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; import { ApiError } from '../../error'; export const meta = { + desc: { + 'ja-JP': '指定したアンテナのノート一覧を表示します。', + 'en-US': 'Displays a list of notes for the specified antenna.' + }, + tags: ['antennas', 'account', 'notes'], requireCredential: true as const, @@ -39,6 +44,16 @@ export const meta = { code: 'NO_SUCH_ANTENNA', id: '850926e0-fd3b-49b6-b69a-b28a5dbd82fe' } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Note' + } } }; diff --git a/src/server/api/endpoints/antennas/show.ts b/src/server/api/endpoints/antennas/show.ts index bc2093ba6..ed400f830 100644 --- a/src/server/api/endpoints/antennas/show.ts +++ b/src/server/api/endpoints/antennas/show.ts @@ -5,6 +5,11 @@ import { ApiError } from '../../error'; import { Antennas } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': '指定したアンテナの情報を取得します。', + 'en-US': 'Acquires the information of the specified antenna.' + }, + tags: ['antennas', 'account'], requireCredential: true as const, @@ -23,6 +28,12 @@ export const meta = { code: 'NO_SUCH_ANTENNA', id: 'c06569fb-b025-4f23-b22d-1fcd20d2816b' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Antenna' } }; diff --git a/src/server/api/endpoints/antennas/update.ts b/src/server/api/endpoints/antennas/update.ts index b329e86ad..58f4e68c8 100644 --- a/src/server/api/endpoints/antennas/update.ts +++ b/src/server/api/endpoints/antennas/update.ts @@ -5,6 +5,11 @@ import { ApiError } from '../../error'; import { Antennas, UserLists, UserGroupJoinings } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': 'アンテナの情報を更新します。', + 'en-US': 'Updates the information of the specified antenna.' + }, + tags: ['antennas'], requireCredential: true as const, @@ -79,6 +84,12 @@ export const meta = { code: 'NO_SUCH_USER_GROUP', id: '109ed789-b6eb-456e-b8a9-6059d567d385' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Antenna' } }; diff --git a/src/server/api/endpoints/ap/show.ts b/src/server/api/endpoints/ap/show.ts index 214116c8c..e8297db47 100644 --- a/src/server/api/endpoints/ap/show.ts +++ b/src/server/api/endpoints/ap/show.ts @@ -16,7 +16,8 @@ export const meta = { tags: ['federation'], desc: { - 'ja-JP': 'URIを指定してActivityPubオブジェクトを参照します。' + 'ja-JP': 'URIを指定してActivityPubオブジェクトを参照します。', + 'en-US': 'Browse to the ActivityPub object by specifying the URI.' }, requireCredential: false as const, @@ -36,6 +37,22 @@ export const meta = { code: 'NO_SUCH_OBJECT', id: 'dc94d745-1262-4e63-a17d-fecaa57efc82' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + type: { + type: 'string' as const, + optional: false as const, nullable: false as const, + enum: ['User', 'Note'] + }, + object: { + type: 'object' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/app/show.ts b/src/server/api/endpoints/app/show.ts index ca4f3549f..254ae3088 100644 --- a/src/server/api/endpoints/app/show.ts +++ b/src/server/api/endpoints/app/show.ts @@ -25,6 +25,12 @@ export const meta = { code: 'NO_SUCH_APP', id: 'dce83913-2dc6-4093-8a7b-71dbb11718a3' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'App' } }; diff --git a/src/server/api/endpoints/auth/session/show.ts b/src/server/api/endpoints/auth/session/show.ts index fe92ff362..9e0d6d90a 100644 --- a/src/server/api/endpoints/auth/session/show.ts +++ b/src/server/api/endpoints/auth/session/show.ts @@ -24,6 +24,27 @@ export const meta = { code: 'NO_SUCH_SESSION', id: 'bd72c97d-eba7-4adb-a467-f171b8847250' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + app: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'App' + }, + token: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts index bdaccc79e..dfab338a8 100644 --- a/src/server/api/endpoints/blocking/create.ts +++ b/src/server/api/endpoints/blocking/create.ts @@ -52,6 +52,12 @@ export const meta = { code: 'ALREADY_BLOCKING', id: '787fed64-acb9-464a-82eb-afbd745b9614' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/blocking/delete.ts b/src/server/api/endpoints/blocking/delete.ts index 451da1c91..22d2df597 100644 --- a/src/server/api/endpoints/blocking/delete.ts +++ b/src/server/api/endpoints/blocking/delete.ts @@ -52,6 +52,76 @@ export const meta = { code: 'NOT_BLOCKING', id: '291b2efa-60c6-45c0-9f6a-045c8f9b02cd' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id', + description: 'The unique identifier for this blocking.', + example: 'xxxxxxxxxx', + }, + name: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + username: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + host: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + avatarUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'url' + }, + avatarBlurhash: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + avatarColor: { + type: 'any' as const, + optional: false as const, nullable: true as const + }, + emojis: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + nullable: false as const, optional: false as const, + properties: { + name: { + type: 'string' as const, + nullable: false as const, optional: false as const + }, + host: { + type: 'string' as const, + nullable: true as const, optional: false as const + }, + url: { + type: 'string' as const, + nullable: false as const, optional: false as const, + format: 'url' + }, + aliases: { + type: 'array' as const, + nullable: false as const, optional: false as const, + items: { + type: 'string' as const, + nullable: false as const, optional: false as const + } + } + } + } + } + } } }; diff --git a/src/server/api/endpoints/clips/create.ts b/src/server/api/endpoints/clips/create.ts index 0d122dbb9..b26c42c56 100644 --- a/src/server/api/endpoints/clips/create.ts +++ b/src/server/api/endpoints/clips/create.ts @@ -23,6 +23,12 @@ export const meta = { validator: $.optional.nullable.str.range(1, 2048) } }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/clips/list.ts b/src/server/api/endpoints/clips/list.ts index 6ede8ea0f..6b90b114d 100644 --- a/src/server/api/endpoints/clips/list.ts +++ b/src/server/api/endpoints/clips/list.ts @@ -7,6 +7,16 @@ export const meta = { requireCredential: true as const, kind: 'read:account', + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' + } + } }; export default define(meta, async (ps, me) => { diff --git a/src/server/api/endpoints/clips/notes.ts b/src/server/api/endpoints/clips/notes.ts index 13983d99f..6a507e203 100644 --- a/src/server/api/endpoints/clips/notes.ts +++ b/src/server/api/endpoints/clips/notes.ts @@ -39,6 +39,16 @@ export const meta = { code: 'NO_SUCH_CLIP', id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00' } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Note' + } } }; diff --git a/src/server/api/endpoints/clips/show.ts b/src/server/api/endpoints/clips/show.ts index dc730d64a..8c285d88b 100644 --- a/src/server/api/endpoints/clips/show.ts +++ b/src/server/api/endpoints/clips/show.ts @@ -23,6 +23,12 @@ export const meta = { code: 'NO_SUCH_CLIP', id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' } }; diff --git a/src/server/api/endpoints/clips/update.ts b/src/server/api/endpoints/clips/update.ts index 4a1a31eb9..041691da2 100644 --- a/src/server/api/endpoints/clips/update.ts +++ b/src/server/api/endpoints/clips/update.ts @@ -35,6 +35,12 @@ export const meta = { code: 'NO_SUCH_CLIP', id: 'b4d92d70-b216-46fa-9a3f-a8c811699257' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Clip' } }; diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index f57166a2f..7e43765c0 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -70,6 +70,12 @@ export const meta = { code: 'NO_SUCH_FOLDER', id: 'ea8fb7a5-af77-4a08-b608-c0218176cd73' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'DriveFile' } }; diff --git a/src/server/api/endpoints/drive/folders/create.ts b/src/server/api/endpoints/drive/folders/create.ts index d88bfcc3d..edaa74532 100644 --- a/src/server/api/endpoints/drive/folders/create.ts +++ b/src/server/api/endpoints/drive/folders/create.ts @@ -43,6 +43,12 @@ export const meta = { code: 'NO_SUCH_FOLDER', id: '53326628-a00d-40a6-a3cd-8975105c0f95' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'DriveFolder' } }; diff --git a/src/server/api/endpoints/drive/folders/update.ts b/src/server/api/endpoints/drive/folders/update.ts index e23a824d1..c2a272c24 100644 --- a/src/server/api/endpoints/drive/folders/update.ts +++ b/src/server/api/endpoints/drive/folders/update.ts @@ -61,6 +61,12 @@ export const meta = { code: 'NO_SUCH_PARENT_FOLDER', id: 'ce104e3a-faaf-49d5-b459-10ff0cbbcaa1' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'DriveFolder' } }; diff --git a/src/server/api/endpoints/endpoints.ts b/src/server/api/endpoints/endpoints.ts index 3ab14389a..84ab107c6 100644 --- a/src/server/api/endpoints/endpoints.ts +++ b/src/server/api/endpoints/endpoints.ts @@ -2,12 +2,32 @@ import define from '../define'; import endpoints from '../endpoints'; export const meta = { + desc: { + 'ja-JP': '使用できるAPI一覧を返します。', + 'en-US': 'Returns a list of available APIs.' + }, + requireCredential: false as const, tags: ['meta'], params: { }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + example: [ + 'admin/abuse-user-reports', + 'admin/accounts/create', + 'admin/announcements/create', + '...' + ] + } }; export default define(meta, async () => { diff --git a/src/server/api/endpoints/federation/instances.ts b/src/server/api/endpoints/federation/instances.ts index 6b6fe42a4..239756af5 100644 --- a/src/server/api/endpoints/federation/instances.ts +++ b/src/server/api/endpoints/federation/instances.ts @@ -1,4 +1,5 @@ import $ from 'cafy'; +import config from '../../../../config'; import define from '../../define'; import { Instances } from '../../../../models'; import { fetchMeta } from '../../../../misc/fetch-meta'; @@ -50,6 +51,16 @@ export const meta = { sort: { validator: $.optional.str, } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'FederationInstance' + } } }; diff --git a/src/server/api/endpoints/federation/show-instance.ts b/src/server/api/endpoints/federation/show-instance.ts index 8c3b46997..1a0bcdb23 100644 --- a/src/server/api/endpoints/federation/show-instance.ts +++ b/src/server/api/endpoints/federation/show-instance.ts @@ -2,6 +2,7 @@ import $ from 'cafy'; import define from '../../define'; import { Instances } from '../../../../models'; import { toPuny } from '../../../../misc/convert-host'; +import config from '../../../../config'; export const meta = { tags: ['federation'], @@ -12,6 +13,12 @@ export const meta = { host: { validator: $.str } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'FederationInstance' } }; diff --git a/src/server/api/endpoints/following/create.ts b/src/server/api/endpoints/following/create.ts index d5ade3073..ca46d59c7 100644 --- a/src/server/api/endpoints/following/create.ts +++ b/src/server/api/endpoints/following/create.ts @@ -64,6 +64,12 @@ export const meta = { code: 'BLOCKED', id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/following/delete.ts b/src/server/api/endpoints/following/delete.ts index 692ac9214..d3abda926 100644 --- a/src/server/api/endpoints/following/delete.ts +++ b/src/server/api/endpoints/following/delete.ts @@ -52,6 +52,12 @@ export const meta = { code: 'NOT_FOLLOWING', id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/following/requests/cancel.ts b/src/server/api/endpoints/following/requests/cancel.ts index a12e1f76b..ef21ee4f2 100644 --- a/src/server/api/endpoints/following/requests/cancel.ts +++ b/src/server/api/endpoints/following/requests/cancel.ts @@ -40,6 +40,12 @@ export const meta = { code: 'FOLLOW_REQUEST_NOT_FOUND', id: '089b125b-d338-482a-9a09-e2622ac9f8d4' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/following/requests/list.ts b/src/server/api/endpoints/following/requests/list.ts index 78f937bb0..4afd44851 100644 --- a/src/server/api/endpoints/following/requests/list.ts +++ b/src/server/api/endpoints/following/requests/list.ts @@ -11,7 +11,33 @@ export const meta = { requireCredential: true as const, - kind: 'read:following' + kind: 'read:following', + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + follower: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + followee: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + } + } + } + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/games/reversi/games.ts b/src/server/api/endpoints/games/reversi/games.ts index 7267157e0..fa8bf2035 100644 --- a/src/server/api/endpoints/games/reversi/games.ts +++ b/src/server/api/endpoints/games/reversi/games.ts @@ -26,6 +26,113 @@ export const meta = { validator: $.optional.bool, default: false } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + startedAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + isStarted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isEnded: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + form1: { + type: 'any' as const, + optional: false as const, nullable: true as const + }, + form2: { + type: 'any' as const, + optional: false as const, nullable: true as const + }, + user1Accepted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + user2Accepted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + user1Id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + user2Id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + user1: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + user2: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + winnerId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + winner: { + type: 'object' as const, + optional: false as const, nullable: true as const, + ref: 'User' + }, + surrendered: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + black: { + type: 'number' as const, + optional: false as const, nullable: true as const + }, + bw: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + isLlotheo: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + }, + canPutEverywhere: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + loopedBoard: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + } + } + } } }; diff --git a/src/server/api/endpoints/games/reversi/games/show.ts b/src/server/api/endpoints/games/reversi/games/show.ts index ea2776b16..75599885c 100644 --- a/src/server/api/endpoints/games/reversi/games/show.ts +++ b/src/server/api/endpoints/games/reversi/games/show.ts @@ -20,6 +20,125 @@ export const meta = { code: 'NO_SUCH_GAME', id: 'f13a03db-fae1-46c9-87f3-43c8165419e1' }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + startedAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + isStarted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isEnded: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + form1: { + type: 'any' as const, + optional: false as const, nullable: true as const + }, + form2: { + type: 'any' as const, + optional: false as const, nullable: true as const + }, + user1Accepted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + user2Accepted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false + }, + user1Id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + user2Id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + user1: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + user2: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + winnerId: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + winner: { + type: 'object' as const, + optional: false as const, nullable: true as const, + ref: 'User' + }, + surrendered: { + type: 'string' as const, + optional: false as const, nullable: true as const, + format: 'id' + }, + black: { + type: 'number' as const, + optional: false as const, nullable: true as const + }, + bw: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + isLlotheo: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + }, + canPutEverywhere: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + loopedBoard: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + board: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'any' as const, + optional: false as const, nullable: false as const + } + }, + turn: { + type: 'any' as const, + optional: false as const, nullable: false as const + } + } + } } }; diff --git a/src/server/api/endpoints/games/reversi/invitations.ts b/src/server/api/endpoints/games/reversi/invitations.ts index 93ea1bd58..6a73bdf0c 100644 --- a/src/server/api/endpoints/games/reversi/invitations.ts +++ b/src/server/api/endpoints/games/reversi/invitations.ts @@ -4,7 +4,48 @@ import { ReversiMatchings } from '../../../../../models'; export const meta = { tags: ['games'], - requireCredential: true as const + requireCredential: true as const, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + createdAt: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'date-time' + }, + parentId: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + parent: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + }, + childId: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + child: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' + } + } + } + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/src/server/api/endpoints/i/get-word-muted-notes-count.ts index e88d697bf..a69ebc286 100644 --- a/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -9,6 +9,17 @@ export const meta = { kind: 'read:account', params: { + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + count: { + type: 'number' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/i/page-likes.ts b/src/server/api/endpoints/i/page-likes.ts index 7f44df85d..9a83cc1d4 100644 --- a/src/server/api/endpoints/i/page-likes.ts +++ b/src/server/api/endpoints/i/page-likes.ts @@ -29,6 +29,23 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + page: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Page' + } + } } }; diff --git a/src/server/api/endpoints/i/pages.ts b/src/server/api/endpoints/i/pages.ts index f55f228d8..3fc00e370 100644 --- a/src/server/api/endpoints/i/pages.ts +++ b/src/server/api/endpoints/i/pages.ts @@ -29,6 +29,16 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Page' + } } }; diff --git a/src/server/api/endpoints/i/pin.ts b/src/server/api/endpoints/i/pin.ts index 59b2f23e3..e13873f60 100644 --- a/src/server/api/endpoints/i/pin.ts +++ b/src/server/api/endpoints/i/pin.ts @@ -44,6 +44,12 @@ export const meta = { code: 'ALREADY_PINNED', id: '8b18c2b7-68fe-4edb-9892-c0cbaeb6c913' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/i/read-announcement.ts b/src/server/api/endpoints/i/read-announcement.ts index 070e49eed..4a4a021af 100644 --- a/src/server/api/endpoints/i/read-announcement.ts +++ b/src/server/api/endpoints/i/read-announcement.ts @@ -7,6 +7,11 @@ import { AnnouncementReads, Announcements, Users } from '../../../../models'; import { publishMainStream } from '../../../../services/stream'; export const meta = { + desc: { + 'ja-JP': '指定したアナウンスを既読にします。', + 'en-US': 'Marks the specified announcement as read.' + }, + tags: ['account'], requireCredential: true as const, diff --git a/src/server/api/endpoints/i/unpin.ts b/src/server/api/endpoints/i/unpin.ts index e1ea3a629..6f06e3859 100644 --- a/src/server/api/endpoints/i/unpin.ts +++ b/src/server/api/endpoints/i/unpin.ts @@ -32,6 +32,12 @@ export const meta = { code: 'NO_SUCH_NOTE', id: '454170ce-9d63-4a43-9da1-ea10afe81e21' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index 3d7f1fa76..a1faf8f1c 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -196,6 +196,12 @@ export const meta = { code: 'NO_SUCH_PAGE', id: '8e01b590-7eb9-431b-a239-860e086c408e' }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'User' } }; diff --git a/src/server/api/endpoints/i/user-group-invites.ts b/src/server/api/endpoints/i/user-group-invites.ts index 9885082a4..4c5105fa7 100644 --- a/src/server/api/endpoints/i/user-group-invites.ts +++ b/src/server/api/endpoints/i/user-group-invites.ts @@ -29,6 +29,27 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + group: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'UserGroup' + } + } + } } }; diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 3b647e21c..c2f4190e1 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -26,6 +26,14 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, properties: { + maintainerName: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + maintainerEmail: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, version: { type: 'string' as const, optional: false as const, nullable: false as const, @@ -37,31 +45,43 @@ export const meta = { optional: false as const, nullable: false as const, description: 'The name of this instance.', }, - description: { + uri: { type: 'string' as const, optional: false as const, nullable: false as const, + format: 'url', + example: 'https://misskey.example.com' + }, + description: { + type: 'string' as const, + optional: false as const, nullable: true as const, description: 'The description of this instance.', }, - announcements: { + langs: { type: 'array' as const, optional: false as const, nullable: false as const, items: { - type: 'object' as const, - optional: false as const, nullable: false as const, - properties: { - title: { - type: 'string' as const, - optional: false as const, nullable: false as const, - description: 'The title of the announcement.', - }, - text: { - type: 'string' as const, - optional: false as const, nullable: false as const, - description: 'The text of the announcement. (can be HTML)', - }, - } - }, - description: 'The announcements of this instance.', + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + tosUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + repositoryUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: 'https://github.com/syuilo/misskey' + }, + feedbackUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: 'https://github.com/syuilo/misskey/issues/new' + }, + secure: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + default: false }, disableRegistration: { type: 'boolean' as const, @@ -78,6 +98,330 @@ export const meta = { optional: false as const, nullable: false as const, description: 'Whether disabled GTL.', }, + driveCapacityPerLocalUserMb: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + driveCapacityPerRemoteUserMb: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + cacheRemoteFiles: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + proxyRemoteFiles: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + enableHcaptcha: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hcaptchaSiteKey: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + enableRecaptcha: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + recaptchaSiteKey: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + swPublickey: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + mascotImageUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: '/assets/ai.png' + }, + bannerUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + errorImageUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const, + default: 'https://xn--931a.moe/aiart/yubitun.png' + }, + iconUrl: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + maxNoteTextLength: { + type: 'number' as const, + optional: false as const, nullable: false as const, + default: 500 + }, + emojis: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + aliases: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + category: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + host: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + url: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'url' + } + } + } + }, + requireSetup: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + example: false + }, + enableEmail: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + enableTwitterIntegration: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + enableGithubIntegration: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + enableDiscordIntegration: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + enableServiceWorker: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + proxyAccountName: { + type: 'string' as const, + optional: false as const, nullable: true as const + }, + features: { + type: 'object' as const, + optional: true as const, nullable: false as const, + properties: { + registration: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + localTimeLine: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + globalTimeLine: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + elasticsearch: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hcaptcha: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + recaptcha: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + objectStorage: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + twitter: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + github: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + discord: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + serviceWorker: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + miauth: { + type: 'boolean' as const, + optional: true as const, nullable: false as const, + default: true + }, + } + }, + userStarForReactionFallback: { + type: 'boolean' as const, + optional: true as const, nullable: false as const, + }, + pinnedUsers: { + type: 'array' as const, + optional: true as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + hiddenTags: { + type: 'array' as const, + optional: true as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + blockedHosts: { + type: 'array' as const, + optional: true as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + hcaptchaSecretKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + recaptchaSecretKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + proxyAccountId: { + type: 'string' as const, + optional: true as const, nullable: true as const, + format: 'id' + }, + twitterConsumerKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + twitterConsumerSecret: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + githubClientId: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + githubClientSecret: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + discordClientId: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + discordClientSecret: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + summaryProxy: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + email: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + smtpSecure: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + smtpHost: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + smtpPort: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + smtpUser: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + smtpPass: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + swPrivateKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + useObjectStorage: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + objectStorageBaseUrl: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStorageBucket: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStoragePrefix: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStorageEndpoint: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStorageRegion: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStoragePort: { + type: 'number' as const, + optional: true as const, nullable: true as const + }, + objectStorageAccessKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStorageSecretKey: { + type: 'string' as const, + optional: true as const, nullable: true as const + }, + objectStorageUseSSL: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + objectStorageUseProxy: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + }, + objectStorageSetPublicRead: { + type: 'boolean' as const, + optional: true as const, nullable: false as const + } } } }; diff --git a/src/server/api/endpoints/miauth/gen-token.ts b/src/server/api/endpoints/miauth/gen-token.ts index a5fa19400..0634debb1 100644 --- a/src/server/api/endpoints/miauth/gen-token.ts +++ b/src/server/api/endpoints/miauth/gen-token.ts @@ -32,6 +32,17 @@ export const meta = { validator: $.arr($.str).unique(), }, }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + token: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + } + } }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/my/apps.ts b/src/server/api/endpoints/my/apps.ts index 348cbfc9f..2ca882fd6 100644 --- a/src/server/api/endpoints/my/apps.ts +++ b/src/server/api/endpoints/my/apps.ts @@ -22,6 +22,55 @@ export const meta = { validator: $.optional.num.min(0), default: 0 } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + name: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + callbackUrl: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + permission: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + }, + secret: { + type: 'string' as const, + optional: true as const, nullable: false as const + }, + isAuthorized: { + type: 'object' as const, + optional: true as const, nullable: false as const, + properties: { + appId: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + userId: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + } + } + } + } } }; diff --git a/src/server/api/endpoints/notes/polls/recommendation.ts b/src/server/api/endpoints/notes/polls/recommendation.ts index a915c95a3..93c9ff08c 100644 --- a/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/src/server/api/endpoints/notes/polls/recommendation.ts @@ -23,6 +23,16 @@ export const meta = { validator: $.optional.num.min(0), default: 0 } + }, + + res: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'Note' + } } }; diff --git a/src/server/api/endpoints/notes/state.ts b/src/server/api/endpoints/notes/state.ts index b41b56162..b8b17820e 100644 --- a/src/server/api/endpoints/notes/state.ts +++ b/src/server/api/endpoints/notes/state.ts @@ -21,6 +21,21 @@ export const meta = { 'en-US': 'Target note ID.' } } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + isFavorited: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isWatching: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/notifications/create.ts b/src/server/api/endpoints/notifications/create.ts index 6267699e9..e447a32e0 100644 --- a/src/server/api/endpoints/notifications/create.ts +++ b/src/server/api/endpoints/notifications/create.ts @@ -3,6 +3,10 @@ import define from '../../define'; import { createNotification } from '../../../../services/create-notification'; export const meta = { + desc: { + 'ja-JP': '通知を作成します。' + }, + tags: ['notifications'], requireCredential: true as const, diff --git a/src/server/api/endpoints/promo/read.ts b/src/server/api/endpoints/promo/read.ts index 9ce253374..57eb0681e 100644 --- a/src/server/api/endpoints/promo/read.ts +++ b/src/server/api/endpoints/promo/read.ts @@ -7,6 +7,11 @@ import { PromoReads } from '../../../../models'; import { genId } from '../../../../misc/gen-id'; export const meta = { + desc: { + 'ja-JP': '指定したノートのプロモーションを既読にします。', + 'en-US': 'Marks the promotion for the specified note as read.' + }, + tags: ['notes'], requireCredential: true as const, diff --git a/src/server/api/endpoints/room/show.ts b/src/server/api/endpoints/room/show.ts index e8af68956..a12d9b8f2 100644 --- a/src/server/api/endpoints/room/show.ts +++ b/src/server/api/endpoints/room/show.ts @@ -7,7 +7,7 @@ import { toPunyNullable } from '../../../../misc/convert-host'; export const meta = { desc: { - 'ja-JP': '指定した部屋の情報を取得します。', + 'ja-JP': '指定したユーザーの部屋の情報を取得します。', }, tags: ['room'], @@ -38,6 +38,83 @@ export const meta = { code: 'NO_SUCH_USER', id: '7ad3fa3e-5e12-42f0-b23a-f3d13f10ee4b' } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + roomType: { + type: 'string' as const, + optional: false as const, nullable: false as const, + enum: ['default', 'washitsu'] + }, + furnitures: { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + type: { + type: 'string' as const, + optional: false as const, nullable: false as const + }, + props: { + type: 'object' as const, + optional: true as const, nullable: false as const, + description: 'Properties vary depending on the furniture' + }, + position: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + x: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + y: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + z: { + type: 'number' as const, + optional: false as const, nullable: false as const + } + } + }, + rotation: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + x: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + y: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + z: { + type: 'number' as const, + optional: false as const, nullable: false as const + } + } + } + } + } + }, + carpetColor: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'hex', + example: '#85CAF0' + } + } } }; diff --git a/src/server/api/endpoints/room/update.ts b/src/server/api/endpoints/room/update.ts index 3022b96b1..af8b80be9 100644 --- a/src/server/api/endpoints/room/update.ts +++ b/src/server/api/endpoints/room/update.ts @@ -46,5 +46,6 @@ export default define(meta, async (ps, user) => { // Publish meUpdated event publishMainStream(user.id, 'meUpdated', iObj); + // TODO: レスポンスがおかしいと思う by YuzuRyo61 return iObj; }); diff --git a/src/server/api/endpoints/stats.ts b/src/server/api/endpoints/stats.ts index 955a79194..33d6af515 100644 --- a/src/server/api/endpoints/stats.ts +++ b/src/server/api/endpoints/stats.ts @@ -6,6 +6,7 @@ export const meta = { requireCredential: false as const, desc: { + 'ja-JP': 'インスタンスの統計を取得します。', 'en-US': 'Get the instance\'s statistics' }, @@ -43,6 +44,14 @@ export const meta = { optional: false as const, nullable: false as const, description: 'The count of federated instances.', }, + driveUsageLocal: { + type: 'number' as const, + optional: false as const, nullable: false as const + }, + driveUsageRemote: { + type: 'number' as const, + optional: false as const, nullable: false as const + } } } }; diff --git a/src/server/api/endpoints/sw/register.ts b/src/server/api/endpoints/sw/register.ts index 4253c9557..ceb70a927 100644 --- a/src/server/api/endpoints/sw/register.ts +++ b/src/server/api/endpoints/sw/register.ts @@ -21,6 +21,22 @@ export const meta = { publickey: { validator: $.str } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + state: { + type: 'string' as const, + optional: false as const, nullable: false as const, + enum: ['already-subscribed', 'subscribed'] + }, + key: { + type: 'string' as const, + optional: false as const, nullable: false as const + } + } } }; diff --git a/src/server/api/endpoints/username/available.ts b/src/server/api/endpoints/username/available.ts index 89f14d3dc..6a5146e43 100644 --- a/src/server/api/endpoints/username/available.ts +++ b/src/server/api/endpoints/username/available.ts @@ -3,6 +3,11 @@ import define from '../../define'; import { Users, UsedUsernames } from '../../../../models'; export const meta = { + desc: { + 'ja-JP': 'ユーザーネームが使用されていないかをチェックします。', + 'en-US': 'Check if the username is being used.' + }, + tags: ['users'], requireCredential: false as const, @@ -11,6 +16,18 @@ export const meta = { username: { validator: $.use(Users.validateLocalUsername) } + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + available: { + type: 'boolean' as const, + optional: false as const, nullable: false as const, + description: 'Returns true if the username is not used.' + } + } } }; diff --git a/src/server/api/endpoints/users.ts b/src/server/api/endpoints/users.ts index 1c1647257..3fe2fcea4 100644 --- a/src/server/api/endpoints/users.ts +++ b/src/server/api/endpoints/users.ts @@ -4,6 +4,11 @@ import { Users } from '../../../models'; import { generateMutedUserQueryForUsers } from '../common/generate-muted-user-query'; export const meta = { + desc: { + 'ja-JP': 'ユーザー一覧を表示します。', + 'en-US': 'Display the user list.' + }, + tags: ['users'], requireCredential: false as const, diff --git a/src/server/api/endpoints/users/lists/update.ts b/src/server/api/endpoints/users/lists/update.ts index 600d834f9..3ced871ae 100644 --- a/src/server/api/endpoints/users/lists/update.ts +++ b/src/server/api/endpoints/users/lists/update.ts @@ -34,6 +34,12 @@ export const meta = { } }, + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'UserList', + }, + errors: { noSuchList: { message: 'No such list.', diff --git a/src/server/api/endpoints/users/relation.ts b/src/server/api/endpoints/users/relation.ts index 086e9bd1e..1beb92539 100644 --- a/src/server/api/endpoints/users/relation.ts +++ b/src/server/api/endpoints/users/relation.ts @@ -19,6 +19,93 @@ export const meta = { 'ja-JP': 'ユーザーID (配列でも可)' } } + }, + + res: { + oneOf: [ + { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + isFollowing: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hasPendingFollowRequestFromYou: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hasPendingFollowRequestToYou: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isFollowed: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isBlocking: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isBlocked: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isMuted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + } + } + }, + { + type: 'array' as const, + optional: false as const, nullable: false as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + format: 'id' + }, + isFollowing: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hasPendingFollowRequestFromYou: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + hasPendingFollowRequestToYou: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isFollowed: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isBlocking: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isBlocked: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + }, + isMuted: { + type: 'boolean' as const, + optional: false as const, nullable: false as const + } + } + } + } + ] } }; diff --git a/src/server/api/openapi/gen-spec.ts b/src/server/api/openapi/gen-spec.ts index 8fc634d69..518569667 100644 --- a/src/server/api/openapi/gen-spec.ts +++ b/src/server/api/openapi/gen-spec.ts @@ -180,7 +180,7 @@ export function genOpenapiSpec(lang = 'ja-JP') { } }, '403': { - description: 'Forbiddon error', + description: 'Forbidden error', content: { 'application/json': { schema: { diff --git a/src/server/api/openapi/schemas.ts b/src/server/api/openapi/schemas.ts index b96d1f457..99107c986 100644 --- a/src/server/api/openapi/schemas.ts +++ b/src/server/api/openapi/schemas.ts @@ -16,6 +16,10 @@ import { packedPageSchema } from '../../../models/repositories/page'; import { packedUserGroupSchema } from '../../../models/repositories/user-group'; import { packedNoteFavoriteSchema } from '../../../models/repositories/note-favorite'; import { packedChannelSchema } from '../../../models/repositories/channel'; +import { packedAntennaSchema } from '../../../models/repositories/antenna'; +import { packedClipSchema } from '../../../models/repositories/clip'; +import { packedFederationInstanceSchema } from '../../../models/repositories/federation-instance'; +import { packedQueueCountSchema } from '../../../models/repositories/queue'; export function convertSchemaToOpenApiSchema(schema: Schema) { const res: any = schema; @@ -84,4 +88,8 @@ export const schemas = { Hashtag: convertSchemaToOpenApiSchema(packedHashtagSchema), Page: convertSchemaToOpenApiSchema(packedPageSchema), Channel: convertSchemaToOpenApiSchema(packedChannelSchema), + QueueCount: convertSchemaToOpenApiSchema(packedQueueCountSchema), + Antenna: convertSchemaToOpenApiSchema(packedAntennaSchema), + Clip: convertSchemaToOpenApiSchema(packedClipSchema), + FederationInstance: convertSchemaToOpenApiSchema(packedFederationInstanceSchema), };