summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-17 15:06:52 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-17 15:06:52 +0900
commitbde22208fed6602da3825d13840c585d522d9f89 (patch)
tree4381d2a089bfa19e62f478dcf6cd0a32d9b5f16e /packages/backend/src
parentfix(client): MkHeader及びデッキのカラムでチャンネル一覧を... (diff)
downloadsharkey-bde22208fed6602da3825d13840c585d522d9f89.tar.gz
sharkey-bde22208fed6602da3825d13840c585d522d9f89.tar.bz2
sharkey-bde22208fed6602da3825d13840c585d522d9f89.zip
refactor: fix types
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/misc/schema.ts2
-rw-r--r--packages/backend/src/models/schema/flash.ts51
2 files changed, 53 insertions, 0 deletions
diff --git a/packages/backend/src/misc/schema.ts b/packages/backend/src/misc/schema.ts
index 37b0d713e2..6bd714b0f9 100644
--- a/packages/backend/src/misc/schema.ts
+++ b/packages/backend/src/misc/schema.ts
@@ -27,6 +27,7 @@ import { packedFederationInstanceSchema } from '@/models/schema/federation-insta
import { packedQueueCountSchema } from '@/models/schema/queue.js';
import { packedGalleryPostSchema } from '@/models/schema/gallery-post.js';
import { packedEmojiSchema } from '@/models/schema/emoji.js';
+import { packedFlashSchema } from '@/models/schema/flash.js';
export const refs = {
UserLite: packedUserLiteSchema,
@@ -57,6 +58,7 @@ export const refs = {
FederationInstance: packedFederationInstanceSchema,
GalleryPost: packedGalleryPostSchema,
Emoji: packedEmojiSchema,
+ Flash: packedFlashSchema,
};
export type Packed<x extends keyof typeof refs> = SchemaType<typeof refs[x]>;
diff --git a/packages/backend/src/models/schema/flash.ts b/packages/backend/src/models/schema/flash.ts
new file mode 100644
index 0000000000..8471a138ec
--- /dev/null
+++ b/packages/backend/src/models/schema/flash.ts
@@ -0,0 +1,51 @@
+export const packedFlashSchema = {
+ type: 'object',
+ properties: {
+ id: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ example: 'xxxxxxxxxx',
+ },
+ 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,
+ },
+ summary: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ script: {
+ type: 'string',
+ optional: false, nullable: false,
+ },
+ userId: {
+ type: 'string',
+ optional: false, nullable: false,
+ format: 'id',
+ },
+ user: {
+ type: 'object',
+ ref: 'UserLite',
+ optional: false, nullable: false,
+ },
+ likedCount: {
+ type: 'number',
+ optional: false, nullable: true,
+ },
+ isLiked: {
+ type: 'boolean',
+ optional: true, nullable: false,
+ },
+ },
+} as const;