oak-general-business/lib/oak-app-domain/Passport/_baseSchema.d.ts

73 lines
2.3 KiB
TypeScript

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";
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 OpSchema = EntityShape & {
systemId: ForeignKey<"system">;
type: Type;
config?: (SmsConfig | EmailConfig | PfwConfig | MfwConfig) | 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<Type>;
config: JsonFilter<SmsConfig | EmailConfig | PfwConfig | MfwConfig>;
enabled: Q_BooleanValue;
} & ExprOp<OpAttr | string>;
export type OpProjection = {
"#id"?: NodeId;
[k: string]: any;
id?: number;
$$createAt$$?: number;
$$updateAt$$?: number;
$$seq$$?: number;
systemId?: number;
type?: number;
config?: number | JsonProjection<SmsConfig | EmailConfig | PfwConfig | MfwConfig>;
enabled?: number;
} & Partial<ExprOp<OpAttr | string>>;
export type OpSortAttr = Partial<{
id: number;
$$createAt$$: number;
$$seq$$: number;
$$updateAt$$: number;
systemId: number;
type: number;
enabled: number;
[k: string]: any;
} | ExprOp<OpAttr | string>>;
export type OpAction = OakMakeAction<GenericAction | string>;
export type OpUpdateAction = "update" | string;