69 lines
2.2 KiB
TypeScript
69 lines
2.2 KiB
TypeScript
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_NumberValue, Q_StringValue, 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 & {
|
|
userId?: ForeignKey<"user"> | null;
|
|
applicationId: ForeignKey<"application">;
|
|
providerConfigId: ForeignKey<"oauthProviderConfig">;
|
|
providerUserId: String<128>;
|
|
rawUserInfo: Object;
|
|
accessToken: String<256>;
|
|
refreshToken?: String<256> | null;
|
|
accessExpiresAt: Datetime;
|
|
refreshExpiresAt?: 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;
|
|
userId: Q_StringValue;
|
|
applicationId: Q_StringValue;
|
|
providerConfigId: Q_StringValue;
|
|
providerUserId: Q_StringValue;
|
|
rawUserInfo: Object;
|
|
accessToken: Q_StringValue;
|
|
refreshToken: Q_StringValue;
|
|
accessExpiresAt: Q_DateValue;
|
|
refreshExpiresAt: Q_DateValue;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
userId?: number;
|
|
applicationId?: number;
|
|
providerConfigId?: number;
|
|
providerUserId?: number;
|
|
rawUserInfo?: number | Object;
|
|
accessToken?: number;
|
|
refreshToken?: number;
|
|
accessExpiresAt?: number;
|
|
refreshExpiresAt?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
userId: number;
|
|
applicationId: number;
|
|
providerConfigId: number;
|
|
providerUserId: number;
|
|
accessToken: number;
|
|
refreshToken: number;
|
|
accessExpiresAt: number;
|
|
refreshExpiresAt: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<GenericAction | string>;
|
|
export type OpUpdateAction = "update" | string;
|