import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, 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 { Action, ParticularAction } from "./Action"; import { AbleState } from "oak-domain/lib/actions/action"; import { String, Datetime } from "oak-domain/lib/types/DataType"; import { Environment } from "oak-domain/lib/types/Environment"; export type OpSchema = EntityShape & { applicationId?: ForeignKey<"application"> | null; entity: "email" | "loginName" | "mobile" | "parasite" | "wechatLogin" | "wechatUser" | string; entityId: String<64>; userId?: ForeignKey<"user"> | null; playerId?: ForeignKey<"user"> | null; disablesAt?: Datetime | null; env: Environment; refreshedAt: Datetime; value: String<64>; oldValue?: String<64> | null; ableState?: AbleState | 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; applicationId: Q_StringValue; entity: Q_EnumValue<"email" | "loginName" | "mobile" | "parasite" | "wechatLogin" | "wechatUser" | string>; entityId: Q_StringValue; userId: Q_StringValue; playerId: Q_StringValue; disablesAt: Q_DateValue; env: JsonFilter; refreshedAt: Q_DateValue; value: Q_StringValue; oldValue: Q_StringValue; ableState: Q_EnumValue; } & ExprOp; export type OpProjection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; applicationId?: number; entity?: number; entityId?: number; userId?: number; playerId?: number; disablesAt?: number; env?: number | JsonProjection; refreshedAt?: number; value?: number; oldValue?: number; ableState?: number; } & Partial>; export type OpSortAttr = Partial<{ id: number; $$createAt$$: number; $$seq$$: number; $$updateAt$$: number; entity: number; entityId: number; disablesAt: number; env: number; refreshedAt: number; value: number; oldValue: number; ableState: number; [k: string]: any; } | ExprOp>; export type OpAction = OakMakeAction; export type OpUpdateAction = "update" | ParticularAction | string;