From 0e08c56bc78e55ee1137c4946cf738ed1e9fb697 Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 10 May 2023 15:58:46 +0000 Subject: [PATCH] wip --- packages/misskey-js/src/schemas/page.ts | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/misskey-js/src/schemas/page.ts b/packages/misskey-js/src/schemas/page.ts index 55ba3ce7f7..cf0bd8614e 100644 --- a/packages/misskey-js/src/schemas/page.ts +++ b/packages/misskey-js/src/schemas/page.ts @@ -1,51 +1,51 @@ +import type { JSONSchema7Definition } from 'schema-type'; + export const packedPageSchema = { + $id: 'https://misskey-hub.net/api/schemas/Page', + type: 'object', properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, + id: { $ref: 'https://misskey-hub.net/api/schemas/Id' }, createdAt: { type: 'string', - optional: false, nullable: false, format: 'date-time', }, updatedAt: { type: 'string', - optional: false, nullable: false, format: 'date-time', }, title: { type: 'string', - optional: false, nullable: false, }, name: { type: 'string', - optional: false, nullable: false, }, summary: { - type: 'string', - optional: false, nullable: true, + type: ['string', 'null'], }, content: { type: 'array', - optional: false, nullable: false, }, variables: { type: 'array', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, + items: { + type: 'object', + additionalProperties: true, + }, }, + userId: { $ref: 'https://misskey-hub.net/api/schemas/Id' }, + user: { $ref: 'https://misskey-hub.net/api/schemas/UserLite' }, }, -} as const; + required: [ + 'id', + 'createdAt', + 'updatedAt', + 'title', + 'name', + 'summary', + 'content', + 'variables', + 'userId', + 'user', + ], +} as const satisfies JSONSchema7Definition;