diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
commit | 74889a71fe687dda74f2a687653122327807af36 (patch) | |
tree | e938e8b6401b74fbec80513a877d9967f2c0dbcd /server/models/oauth-token-interface.ts | |
parent | 15a302943d84bc0978b84fe33110c4daa451d311 (diff) | |
download | PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.gz PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.zst PeerTube-74889a71fe687dda74f2a687653122327807af36.zip |
Reorganize model files
Diffstat (limited to 'server/models/oauth-token-interface.ts')
-rw-r--r-- | server/models/oauth-token-interface.ts | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/server/models/oauth-token-interface.ts b/server/models/oauth-token-interface.ts deleted file mode 100644 index 88526697e..000000000 --- a/server/models/oauth-token-interface.ts +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | import * as Bluebird from 'bluebird' | ||
3 | |||
4 | import { UserModel } from './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) => Bluebird<OAuthTokenInfo> | ||
19 | export type GetByTokenAndPopulateUser = (bearerToken: string) => Bluebird<OAuthTokenInstance> | ||
20 | export type GetByRefreshTokenAndPopulateUser = (refreshToken: string) => Bluebird<OAuthTokenInstance> | ||
21 | |||
22 | export type RemoveByUserIdCallback = (err: Error) => void | ||
23 | export type RemoveByUserId = (userId, callback) => void | ||
24 | } | ||
25 | |||
26 | export interface OAuthTokenClass { | ||
27 | getByRefreshTokenAndPopulateClient: OAuthTokenMethods.GetByRefreshTokenAndPopulateClient | ||
28 | getByTokenAndPopulateUser: OAuthTokenMethods.GetByTokenAndPopulateUser | ||
29 | getByRefreshTokenAndPopulateUser: OAuthTokenMethods.GetByRefreshTokenAndPopulateUser | ||
30 | removeByUserId: OAuthTokenMethods.RemoveByUserId | ||
31 | } | ||
32 | |||
33 | export interface OAuthTokenAttributes { | ||
34 | accessToken: string | ||
35 | accessTokenExpiresAt: Date | ||
36 | refreshToken: string | ||
37 | refreshTokenExpiresAt: Date | ||
38 | |||
39 | User?: UserModel | ||
40 | } | ||
41 | |||
42 | export interface OAuthTokenInstance extends OAuthTokenClass, OAuthTokenAttributes, Sequelize.Instance<OAuthTokenAttributes> { | ||
43 | id: number | ||
44 | createdAt: Date | ||
45 | updatedAt: Date | ||
46 | } | ||
47 | |||
48 | export interface OAuthTokenModel extends OAuthTokenClass, Sequelize.Model<OAuthTokenInstance, OAuthTokenAttributes> {} | ||