32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { String, Datetime } from 'oak-domain/lib/types/DataType';
|
|
import { Schema as User } from './User';
|
|
import { Schema as Token } from './Token';
|
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
import { ActionDef } from 'oak-domain/lib/types';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
import { Schema as OauthProvider } from './OauthProvider';
|
|
import { Schema as Application } from './Application';
|
|
import { Schema as OauthState } from './OauthState';
|
|
export interface Schema extends EntityShape {
|
|
user?: User;
|
|
application: Application;
|
|
providerConfig: OauthProvider;
|
|
providerUserId: String<256>;
|
|
rawUserInfo: Object;
|
|
accessToken: String<1024>;
|
|
refreshToken?: String<1024>;
|
|
accessExpiresAt: Datetime;
|
|
refreshExpiresAt?: Datetime;
|
|
tokens: Token[];
|
|
state: OauthState;
|
|
}
|
|
export type LoadState = 'unload' | 'loaded';
|
|
export type LoadAction = 'loadUserInfo';
|
|
export type TokenAction = 'refreshTokens';
|
|
export type Action = LoadAction | TokenAction;
|
|
export type State = LoadState;
|
|
export declare const LoadActionDef: ActionDef<LoadAction, LoadState>;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
loadState: LoadState;
|
|
}>;
|