oak-general-business/lib/entities/Passport.d.ts

57 lines
1.5 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' | 'loginName' | 'oauth';
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 type NameConfig = {
min?: number;
max?: number;
verify?: boolean;
regexs?: string[];
register?: boolean;
tip?: string;
};
export type OAuthConfig = {
oauthIds: string[];
};
export interface Schema extends EntityShape {
system: System;
type: Type;
config?: SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig | NameConfig | OAuthConfig;
enabled: Boolean;
}
export declare const entityDesc: EntityDesc<Schema, '', '', {
type: Schema['type'];
}>;