From 7d9ba5c08999c6482f0bc5e0c09c6f55b7724090 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 May 2021 11:15:29 +0200 Subject: Cleanup models directory organization --- server/models/oauth/oauth-token.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/oauth') diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index 27e643aa7..aa512a985 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -17,8 +17,8 @@ import { MUserAccountId } from '@server/types/models' import { MOAuthTokenUser } from '@server/types/models/oauth/oauth-token' import { logger } from '../../helpers/logger' import { AccountModel } from '../account/account' -import { UserModel } from '../account/user' -import { ActorModel } from '../activitypub/actor' +import { ActorModel } from '../actor/actor' +import { UserModel } from '../user/user' import { OAuthClientModel } from './oauth-client' export type OAuthTokenInfo = { -- cgit v1.2.3 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