import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand"; import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity"; import { GenericAction } from "oak-domain/lib/actions/action"; import { Boolean } from "oak-domain/lib/types/DataType"; 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 type OpSchema = EntityShape & { systemId: ForeignKey<"system">; type: Type; config?: (SmsConfig | EmailConfig | PfwConfig | MfwConfig | PwdConfig | NameConfig | OAuthConfig) | null; enabled: Boolean; } & { [A in ExpressionKey]?: any; }; export type OpAttr = keyof OpSchema; export type OpFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; systemId: Q_StringValue; type: Q_EnumValue; config: JsonFilter; enabled: Q_BooleanValue; } & ExprOp; export type OpProjection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; systemId?: number; type?: number; config?: number | JsonProjection; enabled?: number; } & Partial>; export type OpSortAttr = Partial<{ id: number; $$createAt$$: number; $$seq$$: number; $$updateAt$$: number; systemId: number; type: number; enabled: number; [k: string]: any; } | ExprOp>; export type OpAction = OakMakeAction; export type OpUpdateAction = "update" | string;