From 8bb311df512b2997e494755f12cce1f1a1e3922a Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 3 Apr 2020 22:42:29 +0900 Subject: [PATCH] =?UTF-8?q?API=E3=83=AA=E3=83=95=E3=82=A1=E3=83=AC?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=81=AE=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#6218)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * APIリファレンスのカテゴリ処理の修正 * tune --- src/server/api/endpoints/admin/get-table-stats.ts | 2 +- src/server/api/endpoints/admin/promo/create.ts | 2 ++ src/server/api/endpoints/admin/server-info.ts | 2 +- src/server/api/endpoints/announcements.ts | 2 ++ src/server/api/endpoints/antennas/notes.ts | 2 +- src/server/api/endpoints/blocking/create.ts | 2 +- src/server/api/endpoints/blocking/delete.ts | 2 +- src/server/api/endpoints/blocking/list.ts | 2 +- src/server/api/endpoints/federation/followers.ts | 2 +- src/server/api/endpoints/federation/following.ts | 2 +- src/server/api/endpoints/federation/users.ts | 2 +- src/server/api/endpoints/mute/create.ts | 2 +- src/server/api/endpoints/mute/delete.ts | 2 +- src/server/api/endpoints/mute/list.ts | 2 +- src/server/api/endpoints/room/update.ts | 2 ++ src/server/api/openapi/gen-spec.ts | 2 +- 16 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/server/api/endpoints/admin/get-table-stats.ts b/src/server/api/endpoints/admin/get-table-stats.ts index 5717110b2..f850d1838 100644 --- a/src/server/api/endpoints/admin/get-table-stats.ts +++ b/src/server/api/endpoints/admin/get-table-stats.ts @@ -9,7 +9,7 @@ export const meta = { 'en-US': 'Get table stats' }, - tags: ['meta'], + tags: ['admin'], params: { }, diff --git a/src/server/api/endpoints/admin/promo/create.ts b/src/server/api/endpoints/admin/promo/create.ts index 953a18af0..e3c03d2f4 100644 --- a/src/server/api/endpoints/admin/promo/create.ts +++ b/src/server/api/endpoints/admin/promo/create.ts @@ -6,6 +6,8 @@ import { getNote } from '../../../common/getters'; import { PromoNotes } from '../../../../../models'; export const meta = { + tags: ['admin'], + requireCredential: true as const, requireModerator: true, diff --git a/src/server/api/endpoints/admin/server-info.ts b/src/server/api/endpoints/admin/server-info.ts index 1804b9ac7..abed71cc1 100644 --- a/src/server/api/endpoints/admin/server-info.ts +++ b/src/server/api/endpoints/admin/server-info.ts @@ -11,7 +11,7 @@ export const meta = { desc: { }, - tags: ['meta'], + tags: ['admin', 'meta'], params: { }, diff --git a/src/server/api/endpoints/announcements.ts b/src/server/api/endpoints/announcements.ts index 35c70a754..ca46192de 100644 --- a/src/server/api/endpoints/announcements.ts +++ b/src/server/api/endpoints/announcements.ts @@ -5,6 +5,8 @@ import { Announcements, AnnouncementReads } from '../../../models'; import { makePaginationQuery } from '../common/make-pagination-query'; export const meta = { + tags: ['meta'], + requireCredential: false as const, params: { diff --git a/src/server/api/endpoints/antennas/notes.ts b/src/server/api/endpoints/antennas/notes.ts index b8428f86a..54af6c7d3 100644 --- a/src/server/api/endpoints/antennas/notes.ts +++ b/src/server/api/endpoints/antennas/notes.ts @@ -8,7 +8,7 @@ import { generateMuteQuery } from '../../common/generate-mute-query'; import { ApiError } from '../../error'; export const meta = { - tags: ['account', 'notes', 'antennas'], + tags: ['antennas', 'account', 'notes'], requireCredential: true as const, diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts index 8d1cc9f3b..f5b50dd5a 100644 --- a/src/server/api/endpoints/blocking/create.ts +++ b/src/server/api/endpoints/blocking/create.ts @@ -13,7 +13,7 @@ export const meta = { 'en-US': 'Block a user.' }, - tags: ['blocking', 'users'], + tags: ['account'], limit: { duration: ms('1hour'), diff --git a/src/server/api/endpoints/blocking/delete.ts b/src/server/api/endpoints/blocking/delete.ts index 007f40bc5..895fe5d50 100644 --- a/src/server/api/endpoints/blocking/delete.ts +++ b/src/server/api/endpoints/blocking/delete.ts @@ -13,7 +13,7 @@ export const meta = { 'en-US': 'Unblock a user.' }, - tags: ['blocking', 'users'], + tags: ['account'], limit: { duration: ms('1hour'), diff --git a/src/server/api/endpoints/blocking/list.ts b/src/server/api/endpoints/blocking/list.ts index 5342e1108..a9bb1c5f9 100644 --- a/src/server/api/endpoints/blocking/list.ts +++ b/src/server/api/endpoints/blocking/list.ts @@ -10,7 +10,7 @@ export const meta = { 'en-US': 'Get blocking users.' }, - tags: ['blocking', 'account'], + tags: ['account'], requireCredential: true as const, diff --git a/src/server/api/endpoints/federation/followers.ts b/src/server/api/endpoints/federation/followers.ts index c3ab8c29a..a5c564b0a 100644 --- a/src/server/api/endpoints/federation/followers.ts +++ b/src/server/api/endpoints/federation/followers.ts @@ -5,7 +5,7 @@ import { Followings } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { - tags: ['users'], + tags: ['federation'], requireCredential: false as const, diff --git a/src/server/api/endpoints/federation/following.ts b/src/server/api/endpoints/federation/following.ts index dea5c8327..80820f5a2 100644 --- a/src/server/api/endpoints/federation/following.ts +++ b/src/server/api/endpoints/federation/following.ts @@ -5,7 +5,7 @@ import { Followings } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { - tags: ['users'], + tags: ['federation'], requireCredential: false as const, diff --git a/src/server/api/endpoints/federation/users.ts b/src/server/api/endpoints/federation/users.ts index 82db4f9f8..1bd053ae8 100644 --- a/src/server/api/endpoints/federation/users.ts +++ b/src/server/api/endpoints/federation/users.ts @@ -5,7 +5,7 @@ import { Users } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { - tags: ['users'], + tags: ['federation'], requireCredential: false as const, diff --git a/src/server/api/endpoints/mute/create.ts b/src/server/api/endpoints/mute/create.ts index 6ad82420e..437ad9610 100644 --- a/src/server/api/endpoints/mute/create.ts +++ b/src/server/api/endpoints/mute/create.ts @@ -13,7 +13,7 @@ export const meta = { 'en-US': 'Mute a user' }, - tags: ['mute', 'users'], + tags: ['account'], requireCredential: true as const, diff --git a/src/server/api/endpoints/mute/delete.ts b/src/server/api/endpoints/mute/delete.ts index 059b7989f..217352acb 100644 --- a/src/server/api/endpoints/mute/delete.ts +++ b/src/server/api/endpoints/mute/delete.ts @@ -11,7 +11,7 @@ export const meta = { 'en-US': 'Unmute a user' }, - tags: ['mute', 'users'], + tags: ['account'], requireCredential: true as const, diff --git a/src/server/api/endpoints/mute/list.ts b/src/server/api/endpoints/mute/list.ts index 25bf96aa2..1a8fc9215 100644 --- a/src/server/api/endpoints/mute/list.ts +++ b/src/server/api/endpoints/mute/list.ts @@ -10,7 +10,7 @@ export const meta = { 'en-US': 'Get muted users.' }, - tags: ['mute', 'account'], + tags: ['account'], requireCredential: true as const, diff --git a/src/server/api/endpoints/room/update.ts b/src/server/api/endpoints/room/update.ts index c2955f625..3022b96b1 100644 --- a/src/server/api/endpoints/room/update.ts +++ b/src/server/api/endpoints/room/update.ts @@ -4,6 +4,8 @@ import define from '../../define'; import { Users, UserProfiles } from '../../../../models'; export const meta = { + tags: ['room'], + requireCredential: true as const, params: { diff --git a/src/server/api/openapi/gen-spec.ts b/src/server/api/openapi/gen-spec.ts index de26b970e..78e481037 100644 --- a/src/server/api/openapi/gen-spec.ts +++ b/src/server/api/openapi/gen-spec.ts @@ -123,7 +123,7 @@ export function genOpenapiSpec(lang = 'ja-JP') { url: `https://github.com/syuilo/misskey/blob/develop/src/server/api/endpoints/${endpoint.name}.ts` }, ...(endpoint.meta.tags ? { - tags: endpoint.meta.tags + tags: [endpoint.meta.tags[0]] } : {}), ...(endpoint.meta.requireCredential ? { security: [{