54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, 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 { GenericAction } from "oak-domain/lib/actions/action";
|
|
import { String, Datetime } from "oak-domain/lib/types/DataType";
|
|
export type OpSchema = EntityShape & {
|
|
state: String<32>;
|
|
type: "login" | "bind";
|
|
providerId: ForeignKey<"oauthProvider">;
|
|
userId?: ForeignKey<"user"> | null;
|
|
usedAt?: Datetime | 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;
|
|
state: Q_StringValue;
|
|
type: Q_EnumValue<"login" | "bind">;
|
|
providerId: Q_StringValue;
|
|
userId: Q_StringValue;
|
|
usedAt: Q_DateValue;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
state?: number;
|
|
type?: number;
|
|
providerId?: number;
|
|
userId?: number;
|
|
usedAt?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
state: number;
|
|
type: number;
|
|
providerId: number;
|
|
userId: number;
|
|
usedAt: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<GenericAction | string>;
|
|
export type OpUpdateAction = "update" | string;
|