27 lines
944 B
TypeScript
27 lines
944 B
TypeScript
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
import { String, Text, Boolean, Datetime } from 'oak-domain/lib/types/DataType';
|
|
import { ActionDef } from 'oak-domain/lib/types';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
import { Schema as Application } from './Application';
|
|
export interface Schema extends EntityShape {
|
|
origin: 'mobile' | 'email';
|
|
content: String<32>;
|
|
code: String<8>;
|
|
visitorId: Text;
|
|
reason?: Text;
|
|
env: Object;
|
|
expired: Boolean;
|
|
expiresAt: Datetime;
|
|
type: 'login' | 'changePassword' | 'confirm';
|
|
application?: Application;
|
|
}
|
|
export type IState = 'unsent' | 'sending' | 'sent' | 'failure';
|
|
export type IAction = 'send' | 'success' | 'fail';
|
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
type Action = IAction;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
iState: IState;
|
|
type: Schema['type'];
|
|
}>;
|
|
export {};
|