From 16c016e8b1d5ca46343d3363f9a49e24c5d7c944 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 May 2021 14:09:04 +0200 Subject: Stricter models typing --- server/models/oauth/oauth-client.ts | 3 ++- server/models/oauth/oauth-token.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'server/models/oauth') diff --git a/server/models/oauth/oauth-client.ts b/server/models/oauth/oauth-client.ts index 8dbc1c2f5..890954bdb 100644 --- a/server/models/oauth/oauth-client.ts +++ b/server/models/oauth/oauth-client.ts @@ -1,4 +1,5 @@ import { AllowNull, Column, CreatedAt, DataType, HasMany, Model, Table, UpdatedAt } from 'sequelize-typescript' +import { AttributesOnly } from '@shared/core-utils' import { OAuthTokenModel } from './oauth-token' @Table({ @@ -14,7 +15,7 @@ import { OAuthTokenModel } from './oauth-token' } ] }) -export class OAuthClientModel extends Model { +export class OAuthClientModel extends Model>> { @AllowNull(false) @Column diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index aa512a985..af4b0ec42 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -15,6 +15,7 @@ import { import { TokensCache } from '@server/lib/auth/tokens-cache' import { MUserAccountId } from '@server/types/models' import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' +import { AttributesOnly } from '@shared/core-utils' import { logger } from '../../helpers/logger' import { AccountModel } from '../account/account' import { ActorModel } from '../actor/actor' @@ -78,7 +79,7 @@ enum ScopeNames { } ] }) -export class OAuthTokenModel extends Model { +export class OAuthTokenModel extends Model>> { @AllowNull(false) @Column -- cgit v1.2.3