diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/models/oauth-client-interface.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
Diffstat (limited to 'server/models/oauth-client-interface.ts')
-rw-r--r-- | server/models/oauth-client-interface.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/server/models/oauth-client-interface.ts b/server/models/oauth-client-interface.ts new file mode 100644 index 000000000..4efd6212a --- /dev/null +++ b/server/models/oauth-client-interface.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | export namespace OAuthClientMethods { | ||
4 | export type CountTotal = (callback) => void | ||
5 | export type LoadFirstClient = (callback) => void | ||
6 | export type GetByIdAndSecret = (clientId, clientSecret) => void | ||
7 | } | ||
8 | |||
9 | export interface OAuthClientClass { | ||
10 | countTotal: OAuthClientMethods.CountTotal | ||
11 | loadFirstClient: OAuthClientMethods.LoadFirstClient | ||
12 | getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret | ||
13 | } | ||
14 | |||
15 | export interface OAuthClientAttributes { | ||
16 | clientId: string | ||
17 | clientSecret: string | ||
18 | grants: string[] | ||
19 | redirectUris: string[] | ||
20 | } | ||
21 | |||
22 | export interface OAuthClientInstance extends OAuthClientClass, OAuthClientAttributes, Sequelize.Instance<OAuthClientAttributes> { | ||
23 | id: number | ||
24 | createdAt: Date | ||
25 | updatedAt: Date | ||
26 | } | ||
27 | |||
28 | export interface OAuthClientModel extends OAuthClientClass, Sequelize.Model<OAuthClientInstance, OAuthClientAttributes> {} | ||