diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index e74bf3111..a602e1072 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -5,8 +5,8 @@ import type { InboxQueue } from '@/core/QueueModule.js'; // eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint<'admin/queue/inboc-delayed'> { - name = 'admin/queue/inboc-delayed' as const; +export default class extends Endpoint<'admin/queue/inbox-delayed'> { + name = 'admin/queue/inbox-delayed' as const; constructor( @Inject('queue:inbox') public inboxQueue: InboxQueue, ) { diff --git a/packages/misskey-js/src/endpoints.ts b/packages/misskey-js/src/endpoints.ts index 8f8553a1b..43475d870 100644 --- a/packages/misskey-js/src/endpoints.ts +++ b/packages/misskey-js/src/endpoints.ts @@ -930,7 +930,7 @@ export const endpoints = { }, }], }, - 'admin/queue/inboc-delayed': { + 'admin/queue/inbox-delayed': { tags: ['admin'], requireCredential: true, diff --git a/packages/misskey-js/src/endpoints.types.ts b/packages/misskey-js/src/endpoints.types.ts index 4120e6840..38ecdd2e7 100644 --- a/packages/misskey-js/src/endpoints.types.ts +++ b/packages/misskey-js/src/endpoints.types.ts @@ -24,10 +24,31 @@ export type RolePolicies = { }; export type EndpointDefines = ReadonlyArray<{ + /** + * 要求のJSON Schema + * 何もないときはundefined + * $refは使えない(ajv由来) + */ req: DeepOmit | undefined; + + /** + * 応答のJSON Schema + * 何もないときはundefined + */ res: JSONSchema7 | undefined; }>; +/** + * JSON Schemaのとき型に変換し、undefinedのときvoid | Recordを返す + */ +export type SchemaOrUndefined = T extends JSONSchema7 ? SchemaType : (void | Record); + +/** + * reqからresを推論する + */ +export type ResponseOf = + P extends SchemaOrUndefined ? SchemaOrUndefined : never; + export interface IEndpointMeta { readonly stability?: 'deprecated' | 'experimental' | 'stable'; @@ -127,9 +148,4 @@ export interface IEndpointMeta { readonly cacheSec?: number; } -export type SchemaOrUndefined = T extends JSONSchema7 ? SchemaType : (void | Record); - -export type ResponseOf = - P extends SchemaOrUndefined ? SchemaOrUndefined : never; - export type Endpoints = typeof endpoints;