Use as const

#5089
This commit is contained in:
syuilo 2019-06-27 18:04:09 +09:00
parent 6b897e562a
commit 952789cc1e
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
102 changed files with 853 additions and 966 deletions

View file

@ -2,7 +2,7 @@ import { EntityRepository, Repository } from 'typeorm';
import { App } from '../entities/app';
import { AccessTokens } from '..';
import { ensure } from '../../prelude/ensure';
import { types, bool, SchemaType } from '../../misc/schema';
import { SchemaType } from '../../misc/schema';
export type PackedApp = SchemaType<typeof packedAppSchema>;
@ -42,37 +42,37 @@ export class AppRepository extends Repository<App> {
}
export const packedAppSchema = {
type: types.object,
optional: bool.false, nullable: bool.false,
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
id: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Note.',
example: 'xxxxxxxxxx',
},
name: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'アプリケーションの名前'
},
callbackUrl: {
type: types.string,
optional: bool.false, nullable: bool.true,
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'コールバックするURL'
},
permission: {
type: types.array,
optional: bool.true, nullable: bool.false,
type: 'array' as const,
optional: true as const, nullable: false as const,
items: {
type: types.string,
optional: bool.false, nullable: bool.false,
type: 'string' as const,
optional: false as const, nullable: false as const,
}
},
secret: {
type: types.string,
optional: bool.true, nullable: bool.false,
type: 'string' as const,
optional: true as const, nullable: false as const,
description: 'アプリケーションのシークレットキー'
}
},