diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/models/oauth-token-interface.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
Diffstat (limited to 'server/models/oauth-token-interface.ts')
-rw-r--r-- | server/models/oauth-token-interface.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/server/models/oauth-token-interface.ts b/server/models/oauth-token-interface.ts index a0cd1ffe7..88526697e 100644 --- a/server/models/oauth-token-interface.ts +++ b/server/models/oauth-token-interface.ts | |||
@@ -1,11 +1,25 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Bluebird from 'bluebird' | ||
2 | 3 | ||
3 | import { UserModel } from './user-interface' | 4 | import { UserModel } from './user-interface' |
4 | 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 | |||
5 | export namespace OAuthTokenMethods { | 17 | export namespace OAuthTokenMethods { |
6 | export type GetByRefreshTokenAndPopulateClient = (refreshToken) => void | 18 | export type GetByRefreshTokenAndPopulateClient = (refreshToken: string) => Bluebird<OAuthTokenInfo> |
7 | export type GetByTokenAndPopulateUser = (bearerToken) => void | 19 | export type GetByTokenAndPopulateUser = (bearerToken: string) => Bluebird<OAuthTokenInstance> |
8 | export type GetByRefreshTokenAndPopulateUser = (refreshToken) => any | 20 | export type GetByRefreshTokenAndPopulateUser = (refreshToken: string) => Bluebird<OAuthTokenInstance> |
21 | |||
22 | export type RemoveByUserIdCallback = (err: Error) => void | ||
9 | export type RemoveByUserId = (userId, callback) => void | 23 | export type RemoveByUserId = (userId, callback) => void |
10 | } | 24 | } |
11 | 25 | ||