From 69ba41bd8da19bd23a5842848542ec1583fcdc61 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 15 May 2023 17:59:30 +0900 Subject: [PATCH] wip --- packages/misskey-js/src/endpoints.ts | 39 +++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/packages/misskey-js/src/endpoints.ts b/packages/misskey-js/src/endpoints.ts index 5895d50ad..4d27b3051 100644 --- a/packages/misskey-js/src/endpoints.ts +++ b/packages/misskey-js/src/endpoints.ts @@ -133,13 +133,17 @@ export const endpoints = { required: ['username', 'password'], }, res: { - $ref: 'https://misskey-hub.net/api/schemas/User', - properties: { - token: { - type: 'string', - }, - }, - required: ['token'], + allOf: [{ + $ref: 'https://misskey-hub.net/api/schemas/MeDetailed', + }, { + type: 'object', + properties: { + token: { + type: 'string', + }, + }, + required: ['token'], + }], }, }], }, @@ -265,4 +269,25 @@ export const endpoints = { res: undefined, }], }, + "admin/announcements/create": { + tags: ['admin'], + + requireCredential: true, + requireModerator: true, + + defines: [{ + req: { + type: 'object', + properties: { + title: { type: 'string', minLength: 1 }, + text: { type: 'string', minLength: 1 }, + imageUrl: { type: 'string', nullable: true, minLength: 1 }, + }, + required: ['title', 'text', 'imageUrl'], + }, + res: { + $ref: 'https://misskey-hub.net/api/schemas/Announcement', + } + }], + }, } as const satisfies { [x: string]: IEndpointMeta; };