]>
Commit | Line | Data |
---|---|---|
e02643f3 | 1 | import * as Sequelize from 'sequelize' |
6fcd19ba | 2 | import * as Promise from 'bluebird' |
e02643f3 C |
3 | |
4 | export namespace OAuthClientMethods { | |
6fcd19ba | 5 | export type CountTotal = () => Promise<number> |
69818c93 | 6 | |
6fcd19ba | 7 | export type LoadFirstClient = () => Promise<OAuthClientInstance> |
69818c93 | 8 | |
6fcd19ba | 9 | export type GetByIdAndSecret = (clientId: string, clientSecret: string) => Promise<OAuthClientInstance> |
e02643f3 C |
10 | } |
11 | ||
12 | export interface OAuthClientClass { | |
13 | countTotal: OAuthClientMethods.CountTotal | |
14 | loadFirstClient: OAuthClientMethods.LoadFirstClient | |
15 | getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret | |
16 | } | |
17 | ||
18 | export interface OAuthClientAttributes { | |
19 | clientId: string | |
20 | clientSecret: string | |
21 | grants: string[] | |
22 | redirectUris: string[] | |
23 | } | |
24 | ||
25 | export interface OAuthClientInstance extends OAuthClientClass, OAuthClientAttributes, Sequelize.Instance<OAuthClientAttributes> { | |
26 | id: number | |
27 | createdAt: Date | |
28 | updatedAt: Date | |
29 | } | |
30 | ||
31 | export interface OAuthClientModel extends OAuthClientClass, Sequelize.Model<OAuthClientInstance, OAuthClientAttributes> {} |