2017-05-22 20:58:25 +02:00
|
|
|
import * as Sequelize from 'sequelize'
|
2017-07-05 13:26:25 +02:00
|
|
|
import * as Promise from 'bluebird'
|
2017-05-22 20:58:25 +02:00
|
|
|
|
|
|
|
export namespace OAuthClientMethods {
|
2017-07-05 13:26:25 +02:00
|
|
|
export type CountTotal = () => Promise<number>
|
2017-06-10 22:15:25 +02:00
|
|
|
|
2017-07-05 13:26:25 +02:00
|
|
|
export type LoadFirstClient = () => Promise<OAuthClientInstance>
|
2017-06-10 22:15:25 +02:00
|
|
|
|
2017-07-05 13:26:25 +02:00
|
|
|
export type GetByIdAndSecret = (clientId: string, clientSecret: string) => Promise<OAuthClientInstance>
|
2017-05-22 20:58:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface OAuthClientClass {
|
|
|
|
countTotal: OAuthClientMethods.CountTotal
|
|
|
|
loadFirstClient: OAuthClientMethods.LoadFirstClient
|
|
|
|
getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OAuthClientAttributes {
|
|
|
|
clientId: string
|
|
|
|
clientSecret: string
|
|
|
|
grants: string[]
|
|
|
|
redirectUris: string[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OAuthClientInstance extends OAuthClientClass, OAuthClientAttributes, Sequelize.Instance<OAuthClientAttributes> {
|
|
|
|
id: number
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface OAuthClientModel extends OAuthClientClass, Sequelize.Model<OAuthClientInstance, OAuthClientAttributes> {}
|