Use as const

#5089
This commit is contained in:
syuilo
2019-06-27 18:04:09 +09:00
parent 6b897e562a
commit 952789cc1e
102 changed files with 853 additions and 966 deletions

View File

@@ -5,7 +5,6 @@ import { ApiError } from '../../error';
import { Users, Followings } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
import { toPunyNullable } from '../../../../misc/convert-host';
import { types, bool } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -49,11 +48,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: 'Following',
}
},

View File

@@ -5,7 +5,6 @@ import { ApiError } from '../../error';
import { Users, Followings } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
import { toPunyNullable } from '../../../../misc/convert-host';
import { types, bool } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -49,11 +48,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: 'Following',
}
},

View File

@@ -6,7 +6,6 @@ import { ApiError } from '../../error';
import { getUser } from '../../common/getters';
import { Not, In, IsNull } from 'typeorm';
import { Notes, Users } from '../../../../models';
import { types, bool } from '../../../../misc/schema';
export const meta = {
tags: ['users'],
@@ -29,11 +28,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: 'User',
}
},

View File

@@ -3,7 +3,6 @@ import define from '../../../define';
import { UserGroups, UserGroupJoinings } from '../../../../../models';
import { genId } from '../../../../../misc/gen-id';
import { UserGroup } from '../../../../../models/entities/user-group';
import { types, bool } from '../../../../../misc/schema';
import { UserGroupJoining } from '../../../../../models/entities/user-group-joining';
export const meta = {
@@ -25,8 +24,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: 'UserGroup',
},
};

View File

@@ -1,6 +1,5 @@
import define from '../../../define';
import { UserGroups, UserGroupJoinings } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
import { Not, In } from 'typeorm';
export const meta = {
@@ -15,11 +14,11 @@ export const meta = {
kind: 'read:user-groups',
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: 'UserGroup',
}
},

View File

@@ -1,6 +1,5 @@
import define from '../../../define';
import { UserGroups } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -14,11 +13,11 @@ export const meta = {
kind: 'read:user-groups',
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: 'UserGroup',
}
},

View File

@@ -3,7 +3,6 @@ import { ID } from '../../../../../misc/cafy-id';
import define from '../../../define';
import { ApiError } from '../../../error';
import { UserGroups, UserGroupJoinings } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -24,8 +23,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: 'UserGroup',
},

View File

@@ -4,7 +4,6 @@ import define from '../../../define';
import { ApiError } from '../../../error';
import { getUser } from '../../../common/getters';
import { UserGroups, UserGroupJoinings } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -33,8 +32,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: 'UserGroup',
},

View File

@@ -3,7 +3,6 @@ import { ID } from '../../../../../misc/cafy-id';
import define from '../../../define';
import { ApiError } from '../../../error';
import { UserGroups } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -36,8 +35,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: 'UserGroup',
},

View File

@@ -3,7 +3,6 @@ import define from '../../../define';
import { UserLists } from '../../../../../models';
import { genId } from '../../../../../misc/gen-id';
import { UserList } from '../../../../../models/entities/user-list';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -24,8 +23,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: 'UserList',
},
};

View File

@@ -1,6 +1,5 @@
import define from '../../../define';
import { UserLists } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -14,11 +13,11 @@ export const meta = {
kind: 'read:account',
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: 'UserList',
}
},

View File

@@ -3,7 +3,6 @@ import { ID } from '../../../../../misc/cafy-id';
import define from '../../../define';
import { ApiError } from '../../../error';
import { UserLists } from '../../../../../models';
import { types, bool } from '../../../../../misc/schema';
export const meta = {
desc: {
@@ -24,8 +23,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: 'UserList',
},

View File

@@ -8,7 +8,6 @@ import { generateVisibilityQuery } from '../../common/generate-visibility-query'
import { Notes } from '../../../../models';
import { generateMuteQuery } from '../../common/generate-mute-query';
import { Brackets } from 'typeorm';
import { types, bool } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -120,11 +119,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',
}
},

View File

@@ -3,7 +3,6 @@ import $ from 'cafy';
import define from '../../define';
import { Users, Followings } from '../../../../models';
import { generateMuteQueryForUsers } from '../../common/generate-mute-query';
import { types, bool } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -29,11 +28,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: 'User',
}
},

View File

@@ -2,7 +2,6 @@ import $ from 'cafy';
import define from '../../define';
import { Users } from '../../../../models';
import { User } from '../../../../models/entities/user';
import { bool, types } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -55,11 +54,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: 'User',
}
},

View File

@@ -6,7 +6,6 @@ import { ApiError } from '../../error';
import { ID } from '../../../../misc/cafy-id';
import { Users } from '../../../../models';
import { In } from 'typeorm';
import { bool, types } from '../../../../misc/schema';
export const meta = {
desc: {
@@ -43,8 +42,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: 'User',
},