diff options
Diffstat (limited to 'server/models/oauth/oauth-token-interface.ts')
-rw-r--r-- | server/models/oauth/oauth-token-interface.ts | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/server/models/oauth/oauth-token-interface.ts b/server/models/oauth/oauth-token-interface.ts deleted file mode 100644 index 47d95d5fc..000000000 --- a/server/models/oauth/oauth-token-interface.ts +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | import * as Promise from 'bluebird' | ||
2 | import * as Sequelize from 'sequelize' | ||
3 | |||
4 | import { UserModel } from '../account/user-interface' | ||
5 | |||
6 | export type OAuthTokenInfo = { | ||
7 | refreshToken: string | ||
8 | refreshTokenExpiresAt: Date, | ||
9 | client: { | ||
10 | id: number | ||
11 | }, | ||
12 | user: { | ||
13 | id: number | ||
14 | } | ||
15 | } | ||
16 | |||
17 | export namespace OAuthTokenMethods { | ||
18 | export type GetByRefreshTokenAndPopulateClient = (refreshToken: string) => Promise<OAuthTokenInfo> | ||
19 | export type GetByTokenAndPopulateUser = (bearerToken: string) => Promise<OAuthTokenInstance> | ||
20 | export type GetByRefreshTokenAndPopulateUser = (refreshToken: string) => Promise<OAuthTokenInstance> | ||
21 | } | ||
22 | |||
23 | export interface OAuthTokenClass { | ||
24 | getByRefreshTokenAndPopulateClient: OAuthTokenMethods.GetByRefreshTokenAndPopulateClient | ||
25 | getByTokenAndPopulateUser: OAuthTokenMethods.GetByTokenAndPopulateUser | ||
26 | getByRefreshTokenAndPopulateUser: OAuthTokenMethods.GetByRefreshTokenAndPopulateUser | ||
27 | } | ||
28 | |||
29 | export interface OAuthTokenAttributes { | ||
30 | accessToken: string | ||
31 | accessTokenExpiresAt: Date | ||
32 | refreshToken: string | ||
33 | refreshTokenExpiresAt: Date | ||
34 | |||
35 | userId?: number | ||
36 | oAuthClientId?: number | ||
37 | User?: UserModel | ||
38 | } | ||
39 | |||
40 | export interface OAuthTokenInstance extends OAuthTokenClass, OAuthTokenAttributes, Sequelize.Instance<OAuthTokenAttributes> { | ||
41 | id: number | ||
42 | createdAt: Date | ||
43 | updatedAt: Date | ||
44 | } | ||
45 | |||
46 | export interface OAuthTokenModel extends OAuthTokenClass, Sequelize.Model<OAuthTokenInstance, OAuthTokenAttributes> {} | ||