This commit is contained in:
syuilo 2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View file

@ -24,8 +24,8 @@ export const meta = {
noSuchFile: {
message: 'No such file.',
code: 'NO_SUCH_FILE',
id: 'caf3ca38-c6e5-472e-a30c-b05377dcc240'
}
id: 'caf3ca38-c6e5-472e-a30c-b05377dcc240',
},
},
res: {
@ -51,36 +51,36 @@ export const meta = {
},
userHost: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
md5: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'md5',
example: '15eca7fba0480996e2245f5185bf39f2'
example: '15eca7fba0480996e2245f5185bf39f2',
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'lenna.jpg'
example: 'lenna.jpg',
},
type: {
type: 'string' as const,
optional: false as const, nullable: false as const,
example: 'image/jpeg'
example: 'image/jpeg',
},
size: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 51469
example: 51469,
},
comment: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
blurhash: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
properties: {
type: 'object' as const,
@ -89,24 +89,24 @@ export const meta = {
width: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 1280
example: 1280,
},
height: {
type: 'number' as const,
optional: false as const, nullable: false as const,
example: 720
example: 720,
},
avgColor: {
type: 'string' as const,
optional: true as const, nullable: false as const,
example: 'rgb(40,65,87)'
}
}
example: 'rgb(40,65,87)',
},
},
},
storedInternal: {
type: 'boolean' as const,
optional: false as const, nullable: true as const,
example: true
example: true,
},
url: {
type: 'string' as const,
@ -137,11 +137,11 @@ export const meta = {
},
uri: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
src: {
type: 'string' as const,
optional: false as const, nullable: true as const
optional: false as const, nullable: true as const,
},
folderId: {
type: 'string' as const,
@ -155,21 +155,21 @@ export const meta = {
},
isLink: {
type: 'boolean' as const,
optional: false as const, nullable: false as const
}
}
}
optional: false as const, nullable: false as const,
},
},
},
};
export default define(meta, async (ps, me) => {
const file = ps.fileId ? await DriveFiles.findOne(ps.fileId) : await DriveFiles.findOne({
where: [{
url: ps.url
url: ps.url,
}, {
thumbnailUrl: ps.url
thumbnailUrl: ps.url,
}, {
webpublicUrl: ps.url
}]
webpublicUrl: ps.url,
}],
});
if (file == null) {