From 60df819c60824611cff24db1428d9b46a56e6b92 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 17 Feb 2023 15:36:36 +0900 Subject: refactor: fix types --- packages/backend/src/models/schema/emoji.ts | 36 +++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'packages/backend/src/models') diff --git a/packages/backend/src/models/schema/emoji.ts b/packages/backend/src/models/schema/emoji.ts index 143f25373c..c00c3dac1d 100644 --- a/packages/backend/src/models/schema/emoji.ts +++ b/packages/backend/src/models/schema/emoji.ts @@ -1,11 +1,37 @@ -export const packedEmojiSchema = { +export const packedEmojiSimpleSchema = { + type: 'object', + properties: { + aliases: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + category: { + type: 'string', + optional: false, nullable: true, + }, + url: { + type: 'string', + optional: false, nullable: false, + }, + }, +} as const; + +export const packedEmojiDetailedSchema = { type: 'object', properties: { id: { type: 'string', - optional: true, nullable: false, + optional: false, nullable: false, format: 'id', - example: 'xxxxxxxxxx', }, aliases: { type: 'array', @@ -26,12 +52,12 @@ export const packedEmojiSchema = { }, host: { type: 'string', - optional: true, nullable: true, + optional: false, nullable: true, description: 'The local host is represented with `null`.', }, url: { type: 'string', - optional: true, nullable: false, + optional: false, nullable: false, }, }, } as const; -- cgit v1.2.3-freya