From a7f5ad78b47faaafdd634c450161f6821201f03d Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 12 Sep 2021 00:46:38 +0900 Subject: [PATCH] =?UTF-8?q?user=20pack=E3=81=A8note=20pack=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E4=B8=8D=E6=95=B4=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/repositories/note.ts | 23 ++++++++++++++++++----- src/models/repositories/user.ts | 30 +++++++++--------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/models/repositories/note.ts b/src/models/repositories/note.ts index 77fedd791f..376a09d0c6 100644 --- a/src/models/repositories/note.ts +++ b/src/models/repositories/note.ts @@ -447,11 +447,24 @@ export const packedNoteSchema = { channel: { type: 'object' as const, optional: true as const, nullable: true as const, - ref: 'Channel' as const, + items: { + type: 'object' as const, + optional: false as const, nullable: false as const, + properties: { + id: { + type: 'string' as const, + optional: false as const, nullable: false as const, + }, + name: { + type: 'string' as const, + optional: false as const, nullable: true as const, + }, + }, + }, }, localOnly: { type: 'boolean' as const, - optional: false as const, nullable: true as const, + optional: true as const, nullable: false as const, }, emojis: { type: 'array' as const, @@ -466,7 +479,7 @@ export const packedNoteSchema = { }, url: { type: 'string' as const, - optional: false as const, nullable: false as const, + optional: false as const, nullable: true as const, }, }, }, @@ -485,11 +498,11 @@ export const packedNoteSchema = { }, uri: { type: 'string' as const, - optional: false as const, nullable: true as const, + optional: true as const, nullable: false as const, }, url: { type: 'string' as const, - optional: false as const, nullable: true as const, + optional: true as const, nullable: false as const, }, myReaction: { diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts index 4a6534b557..39c90cf5ed 100644 --- a/src/models/repositories/user.ts +++ b/src/models/repositories/user.ts @@ -375,12 +375,12 @@ export const packedUserSchema = { }, isAdmin: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, default: false }, isModerator: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, default: false }, isBot: { @@ -402,23 +402,11 @@ export const packedUserSchema = { type: 'string' as const, nullable: false as const, optional: false as const }, - host: { - type: 'string' as const, - nullable: true as const, optional: false as const - }, url: { type: 'string' as const, nullable: false as const, optional: false as const, format: 'url' }, - aliases: { - type: 'array' as const, - nullable: false as const, optional: false as const, - items: { - type: 'string' as const, - nullable: false as const, optional: false as const - } - } } } }, @@ -457,7 +445,7 @@ export const packedUserSchema = { }, isSuspended: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, example: false }, description: { @@ -476,7 +464,7 @@ export const packedUserSchema = { }, fields: { type: 'array' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, items: { type: 'object' as const, nullable: false as const, optional: false as const, @@ -525,26 +513,26 @@ export const packedUserSchema = { }, pinnedPageId: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: true as const }, pinnedPage: { type: 'object' as const, - nullable: true as const, optional: false as const, + nullable: true as const, optional: true as const, ref: 'Page' as const, }, twoFactorEnabled: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, default: false }, usePasswordLessLogin: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, default: false }, securityKeys: { type: 'boolean' as const, - nullable: false as const, optional: false as const, + nullable: false as const, optional: true as const, default: false }, avatarId: {