Ensure enum schema and Make "as const" put once

This commit is contained in:
tamaina
2022-01-14 19:55:09 +09:00
parent 59a5d00d6b
commit 37bae7b929
25 changed files with 716 additions and 713 deletions

View File

@@ -1,108 +1,108 @@
export const packedDriveFileSchema = {
type: 'object' as const,
optional: false as const, nullable: false as const,
type: 'object',
optional: false, nullable: false,
properties: {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
type: 'string',
optional: false, nullable: false,
example: 'lenna.jpg',
},
type: {
type: 'string' as const,
optional: false as const, nullable: false as const,
type: 'string',
optional: false, nullable: false,
example: 'image/jpeg',
},
md5: {
type: 'string' as const,
optional: false as const, nullable: false as const,
type: 'string',
optional: false, nullable: false,
format: 'md5',
example: '15eca7fba0480996e2245f5185bf39f2',
},
size: {
type: 'number' as const,
optional: false as const, nullable: false as const,
type: 'number',
optional: false, nullable: false,
example: 51469,
},
isSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
type: 'boolean',
optional: false, nullable: false,
},
blurhash: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
},
properties: {
type: 'object' as const,
optional: false as const, nullable: false as const,
type: 'object',
optional: false, nullable: false,
properties: {
width: {
type: 'number' as const,
optional: true as const, nullable: false as const,
type: 'number',
optional: true, nullable: false,
example: 1280,
},
height: {
type: 'number' as const,
optional: true as const, nullable: false as const,
type: 'number',
optional: true, nullable: false,
example: 720,
},
orientation: {
type: 'number' as const,
optional: true as const, nullable: false as const,
type: 'number',
optional: true, nullable: false,
example: 8,
},
avgColor: {
type: 'string' as const,
optional: true as const, nullable: false as const,
type: 'string',
optional: true, nullable: false,
example: 'rgb(40,65,87)',
},
},
},
url: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
format: 'url',
},
thumbnailUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
format: 'url',
},
comment: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
},
folderId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
format: 'id',
example: 'xxxxxxxxxx',
},
folder: {
type: 'object' as const,
optional: true as const, nullable: true as const,
ref: 'DriveFolder' as const,
type: 'object',
optional: true, nullable: true,
ref: 'DriveFolder',
},
userId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
type: 'string',
optional: false, nullable: true,
format: 'id',
example: 'xxxxxxxxxx',
},
user: {
type: 'object' as const,
optional: true as const, nullable: true as const,
ref: 'User' as const,
type: 'object',
optional: true, nullable: true,
ref: 'User',
},
},
};
} as const;