diff options
Diffstat (limited to 'server/models/oauth/oauth-client-interface.ts')
-rw-r--r-- | server/models/oauth/oauth-client-interface.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/server/models/oauth/oauth-client-interface.ts b/server/models/oauth/oauth-client-interface.ts new file mode 100644 index 000000000..3b4325740 --- /dev/null +++ b/server/models/oauth/oauth-client-interface.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | export namespace OAuthClientMethods { | ||
4 | export type CountTotalCallback = (err: Error, total: number) => void | ||
5 | export type CountTotal = (callback: CountTotalCallback) => void | ||
6 | |||
7 | export type LoadFirstClientCallback = (err: Error, client: OAuthClientInstance) => void | ||
8 | export type LoadFirstClient = (callback: LoadFirstClientCallback) => void | ||
9 | |||
10 | export type GetByIdAndSecret = (clientId, clientSecret) => void | ||
11 | } | ||
12 | |||
13 | export interface OAuthClientClass { | ||
14 | countTotal: OAuthClientMethods.CountTotal | ||
15 | loadFirstClient: OAuthClientMethods.LoadFirstClient | ||
16 | getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret | ||
17 | } | ||
18 | |||
19 | export interface OAuthClientAttributes { | ||
20 | clientId: string | ||
21 | clientSecret: string | ||
22 | grants: string[] | ||
23 | redirectUris: string[] | ||
24 | } | ||
25 | |||
26 | export interface OAuthClientInstance extends OAuthClientClass, OAuthClientAttributes, Sequelize.Instance<OAuthClientAttributes> { | ||
27 | id: number | ||
28 | createdAt: Date | ||
29 | updatedAt: Date | ||
30 | } | ||
31 | |||
32 | export interface OAuthClientModel extends OAuthClientClass, Sequelize.Model<OAuthClientInstance, OAuthClientAttributes> {} | ||