46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import { Boolean } from 'oak-domain/lib/types/DataType';
|
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
import { Schema as System } from './System';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
export type Type = 'password' | 'sms' | 'email' | 'wechatWeb' | 'wechatMp' | 'wechatPublic' | 'wechatPublicForWeb' | 'wechatMpForWeb' | 'wechatNative';
|
|
export type SmsConfig = {
|
|
mockSend?: boolean;
|
|
defaultOrigin?: 'ali' | 'tencent' | 'ctyun';
|
|
templateName?: string;
|
|
codeDuration?: number;
|
|
digit?: number;
|
|
};
|
|
export type EmailConfig = {
|
|
mockSend?: boolean;
|
|
account: string;
|
|
subject: string;
|
|
text?: string;
|
|
html?: string;
|
|
codeDuration?: number;
|
|
digit?: number;
|
|
emailSuffixes?: string[];
|
|
};
|
|
export type PfwConfig = {
|
|
appId: string;
|
|
};
|
|
export type MfwConfig = {
|
|
appId: string;
|
|
};
|
|
export type PwdConfig = {
|
|
mode: 'all' | 'plain' | 'sha1';
|
|
min: number;
|
|
max: number;
|
|
verify?: boolean;
|
|
regexs?: string[];
|
|
tip?: string;
|
|
};
|
|
export interface Schema extends EntityShape {
|
|
system: System;
|
|
type: Type;
|
|
config?: SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig;
|
|
enabled: Boolean;
|
|
}
|
|
export declare const entityDesc: EntityDesc<Schema, '', '', {
|
|
type: Schema['type'];
|
|
}>;
|