58 lines
1.9 KiB
TypeScript
58 lines
1.9 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 { Action, ParticularAction, UsageState } from "./Action";
|
|
import { Datetime } from "oak-domain/lib/types/DataType";
|
|
export type OpSchema = EntityShape & {
|
|
userId: ForeignKey<"user">;
|
|
applicationId: ForeignKey<"oauthApplication">;
|
|
authorizedAt: Datetime;
|
|
codeId?: ForeignKey<"oauthAuthorizationCode"> | null;
|
|
tokenId?: ForeignKey<"oauthToken"> | null;
|
|
usageState?: UsageState | 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;
|
|
userId: Q_StringValue;
|
|
applicationId: Q_StringValue;
|
|
authorizedAt: Q_DateValue;
|
|
codeId: Q_StringValue;
|
|
tokenId: Q_StringValue;
|
|
usageState: Q_EnumValue<UsageState>;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
userId?: number;
|
|
applicationId?: number;
|
|
authorizedAt?: number;
|
|
codeId?: number;
|
|
tokenId?: number;
|
|
usageState?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
userId: number;
|
|
applicationId: number;
|
|
authorizedAt: number;
|
|
codeId: number;
|
|
tokenId: number;
|
|
usageState: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<Action | string>;
|
|
export type OpUpdateAction = "update" | ParticularAction | string;
|