From 82a17ea42744862cd9d646c002c3f101fb22bc2e Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 26 May 2023 07:44:47 +0000 Subject: [PATCH] wip --- .../endpoints/admin/queue/inbox-delayed.ts | 41 ++----------------- packages/misskey-js/src/endpoints.ts | 30 ++++++++++++++ 2 files changed, 33 insertions(+), 38 deletions(-) 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 55a3410d49..e74bf3111d 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 @@ -3,49 +3,14 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { InboxQueue } from '@/core/QueueModule.js'; -export const meta = { - tags: ['admin'], - - requireCredential: true, - requireModerator: true, - - res: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'array', - optional: false, nullable: false, - items: { - anyOf: [ - { - type: 'string', - }, - { - type: 'number', - }, - ], - }, - }, - example: [[ - 'example.com', - 12, - ]], - }, -} as const; - -export const paramDef = { - type: 'object', - properties: {}, - required: [], -} as const; - // eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint<'admin/queue/inboc-delayed'> { + name = 'admin/queue/inboc-delayed' as const; constructor( @Inject('queue:inbox') public inboxQueue: InboxQueue, ) { - super(meta, paramDef, async (ps, me) => { + super(async (ps, me) => { const jobs = await this.inboxQueue.getJobs(['delayed']); const res = [] as [string, number][]; diff --git a/packages/misskey-js/src/endpoints.ts b/packages/misskey-js/src/endpoints.ts index 8fb5273dea..8f8553a1b6 100644 --- a/packages/misskey-js/src/endpoints.ts +++ b/packages/misskey-js/src/endpoints.ts @@ -906,6 +906,36 @@ export const endpoints = { requireCredential: true, requireModerator: true, + defines: [{ + req: undefined, + res: { + type: 'array', + items: { + type: 'array', + items: { + anyOf: [ + { + type: 'string', + }, + { + type: 'number', + }, + ], + }, + }, + examples: [[ + 'example.com', + 12, + ]], + }, + }], + }, + 'admin/queue/inboc-delayed': { + tags: ['admin'], + + requireCredential: true, + requireModerator: true, + defines: [{ req: undefined, res: {