enhance(misskey-js) misskey-jsのストリーミングAPI定義をバックエンドに追従 (#12552)

* (enhance) misskey-jsのストリーミングAPI定義をバックエンドに追従

* fix ci

* fix ci
This commit is contained in:
おさむのひと
2023-12-03 12:45:18 +09:00
committed by GitHub
parent b4a83a22a1
commit e17d741f4b
10 changed files with 414 additions and 56 deletions

View File

@@ -36,6 +36,7 @@ import { packedGalleryPostSchema } from '@/models/json-schema/gallery-post.js';
import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/json-schema/emoji.js';
import { packedFlashSchema } from '@/models/json-schema/flash.js';
import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js';
import { packedSigninSchema } from '@/models/json-schema/signin.js';
export const refs = {
UserLite: packedUserLiteSchema,
@@ -71,6 +72,7 @@ export const refs = {
EmojiSimple: packedEmojiSimpleSchema,
EmojiDetailed: packedEmojiDetailedSchema,
Flash: packedFlashSchema,
Signin: packedSigninSchema,
};
export type Packed<x extends keyof typeof refs> = SchemaType<typeof refs[x]>;

View File

@@ -0,0 +1,26 @@
export const packedSigninSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
ip: {
type: 'string',
optional: false, nullable: false,
},
headers: {
type: 'object',
optional: false, nullable: false,
},
success: {
type: 'boolean',
optional: false, nullable: false,
},
},
} as const;

View File

@@ -12,8 +12,17 @@ import { DI } from '@/di-symbols.js';
export const meta = {
requireCredential: true,
secure: true,
res: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'object',
optional: false, nullable: false,
ref: 'Signin',
},
},
} as const;
export const paramDef = {