77 lines
2.3 KiB
TypeScript
77 lines
2.3 KiB
TypeScript
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
|
import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
|
import { Action, ParticularAction, IState } from "./Action";
|
|
import { String, Text, Boolean, Datetime } from "oak-domain/lib/types/DataType";
|
|
export type OpSchema = EntityShape & {
|
|
origin: "mobile" | "email";
|
|
content: String<32>;
|
|
code: String<8>;
|
|
visitorId: Text;
|
|
reason?: Text | null;
|
|
env: Object;
|
|
expired: Boolean;
|
|
expiresAt: Datetime;
|
|
type: "login" | "changePassword" | "confirm";
|
|
applicationId?: ForeignKey<"application"> | null;
|
|
iState?: IState | null;
|
|
} & {
|
|
[A in ExpressionKey]?: any;
|
|
};
|
|
export type OpAttr = keyof OpSchema;
|
|
export type OpFilter = {
|
|
id: Q_StringValue;
|
|
$$createAt$$: Q_DateValue;
|
|
$$seq$$: Q_NumberValue;
|
|
$$updateAt$$: Q_DateValue;
|
|
origin: Q_EnumValue<"mobile" | "email">;
|
|
content: Q_StringValue;
|
|
code: Q_StringValue;
|
|
visitorId: Q_StringValue;
|
|
reason: Q_StringValue;
|
|
env: Object;
|
|
expired: Q_BooleanValue;
|
|
expiresAt: Q_DateValue;
|
|
type: Q_EnumValue<"login" | "changePassword" | "confirm">;
|
|
applicationId: Q_StringValue;
|
|
iState: Q_EnumValue<IState>;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
origin?: number;
|
|
content?: number;
|
|
code?: number;
|
|
visitorId?: number;
|
|
reason?: number;
|
|
env?: number | Object;
|
|
expired?: number;
|
|
expiresAt?: number;
|
|
type?: number;
|
|
applicationId?: number;
|
|
iState?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
origin: number;
|
|
content: number;
|
|
code: number;
|
|
visitorId: number;
|
|
reason: number;
|
|
expired: number;
|
|
expiresAt: number;
|
|
type: number;
|
|
applicationId: number;
|
|
iState: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<Action | string>;
|
|
export type OpUpdateAction = "update" | ParticularAction | string;
|