summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/drive/files
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-06-27 18:04:09 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-06-27 18:04:09 +0900
commit952789cc1eb77e2f2d54b489c016b56bac812ab7 (patch)
tree47aae1704f1617f9ae081291547085ba04677a2e /src/server/api/endpoints/drive/files
parent11.23.1 (diff)
downloadsharkey-952789cc1eb77e2f2d54b489c016b56bac812ab7.tar.gz
sharkey-952789cc1eb77e2f2d54b489c016b56bac812ab7.tar.bz2
sharkey-952789cc1eb77e2f2d54b489c016b56bac812ab7.zip
Use as const
#5089
Diffstat (limited to 'src/server/api/endpoints/drive/files')
-rw-r--r--src/server/api/endpoints/drive/files/attached-notes.ts9
-rw-r--r--src/server/api/endpoints/drive/files/check-existence.ts5
-rw-r--r--src/server/api/endpoints/drive/files/create.ts5
-rw-r--r--src/server/api/endpoints/drive/files/find-by-hash.ts9
-rw-r--r--src/server/api/endpoints/drive/files/find.ts9
-rw-r--r--src/server/api/endpoints/drive/files/show.ts5
6 files changed, 18 insertions, 24 deletions
diff --git a/src/server/api/endpoints/drive/files/attached-notes.ts b/src/server/api/endpoints/drive/files/attached-notes.ts
index f770bc7136..2b84e114b3 100644
--- a/src/server/api/endpoints/drive/files/attached-notes.ts
+++ b/src/server/api/endpoints/drive/files/attached-notes.ts
@@ -3,7 +3,6 @@ import { ID } from '../../../../../misc/cafy-id';
import define from '../../../define';
import { ApiError } from '../../../error';
import { DriveFiles, Notes } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
stability: 'stable',
@@ -30,11 +29,11 @@ export const meta = {
},
res: {
- type: types.array,
- optional: bool.false, nullable: bool.false,
+ type: 'array' as const,
+ optional: false as const, nullable: false as const,
items: {
- type: types.object,
- optional: bool.false, nullable: bool.false,
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
ref: 'Note',
}
},
diff --git a/src/server/api/endpoints/drive/files/check-existence.ts b/src/server/api/endpoints/drive/files/check-existence.ts
index ab19566f1c..a6cd14caf2 100644
--- a/src/server/api/endpoints/drive/files/check-existence.ts
+++ b/src/server/api/endpoints/drive/files/check-existence.ts
@@ -1,7 +1,6 @@
import $ from 'cafy';
import define from '../../../define';
import { DriveFiles } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -25,8 +24,8 @@ export const meta = {
},
res: {
- type: types.boolean,
- optional: bool.false, nullable: bool.false,
+ type: 'boolean' as const,
+ optional: false as const, nullable: false as const,
},
};
diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts
index 0f81a1da99..664a2b87b2 100644
--- a/src/server/api/endpoints/drive/files/create.ts
+++ b/src/server/api/endpoints/drive/files/create.ts
@@ -6,7 +6,6 @@ import define from '../../../define';
import { apiLogger } from '../../../logger';
import { ApiError } from '../../../error';
import { DriveFiles } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -57,8 +56,8 @@ export const meta = {
},
res: {
- type: types.object,
- optional: bool.false, nullable: bool.false,
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
ref: 'DriveFile',
},
diff --git a/src/server/api/endpoints/drive/files/find-by-hash.ts b/src/server/api/endpoints/drive/files/find-by-hash.ts
index d56e63bc59..84cc4f92b1 100644
--- a/src/server/api/endpoints/drive/files/find-by-hash.ts
+++ b/src/server/api/endpoints/drive/files/find-by-hash.ts
@@ -1,7 +1,6 @@
import $ from 'cafy';
import define from '../../../define';
import { DriveFiles } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -24,11 +23,11 @@ export const meta = {
},
res: {
- type: types.array,
- optional: bool.false, nullable: bool.false,
+ type: 'array' as const,
+ optional: false as const, nullable: false as const,
items: {
- type: types.object,
- optional: bool.false, nullable: bool.false,
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
ref: 'DriveFile',
}
},
diff --git a/src/server/api/endpoints/drive/files/find.ts b/src/server/api/endpoints/drive/files/find.ts
index 82b9a97b6d..732596a33f 100644
--- a/src/server/api/endpoints/drive/files/find.ts
+++ b/src/server/api/endpoints/drive/files/find.ts
@@ -2,7 +2,6 @@ import $ from 'cafy';
import { ID } from '../../../../../misc/cafy-id';
import define from '../../../define';
import { DriveFiles } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
requireCredential: true,
@@ -26,11 +25,11 @@ export const meta = {
},
res: {
- type: types.array,
- optional: bool.false, nullable: bool.false,
+ type: 'array' as const,
+ optional: false as const, nullable: false as const,
items: {
- type: types.object,
- optional: bool.false, nullable: bool.false,
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
ref: 'DriveFile',
}
},
diff --git a/src/server/api/endpoints/drive/files/show.ts b/src/server/api/endpoints/drive/files/show.ts
index 8e74361f9c..4384b2114d 100644
--- a/src/server/api/endpoints/drive/files/show.ts
+++ b/src/server/api/endpoints/drive/files/show.ts
@@ -4,7 +4,6 @@ import define from '../../../define';
import { ApiError } from '../../../error';
import { DriveFile } from '../../../../../models/entities/drive-file';
import { DriveFiles } from '../../../../../models';
-import { types, bool } from '../../../../../misc/schema';
export const meta = {
stability: 'stable',
@@ -39,8 +38,8 @@ export const meta = {
},
res: {
- type: types.object,
- optional: bool.false, nullable: bool.false,
+ type: 'object' as const,
+ optional: false as const, nullable: false as const,
ref: 'DriveFile',
},