314 lines
11 KiB
TypeScript
314 lines
11 KiB
TypeScript
import { String, Boolean, Text, Datetime, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand";
|
|
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
|
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity";
|
|
import { GenericAction } from "oak-domain/lib/actions/action";
|
|
import { QrCodeType } from "../../types/Config";
|
|
import * as Application from "../Application/Schema";
|
|
import * as User from "../User/Schema";
|
|
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
|
import * as WechatLogin from "../WechatLogin/Schema";
|
|
import * as ModiEntity from "../ModiEntity/Schema";
|
|
import * as OperEntity from "../OperEntity/Schema";
|
|
export declare type WechatQrCodeProps = {
|
|
pathname: string;
|
|
props?: Record<string, any>;
|
|
state?: Record<string, any>;
|
|
isTabBar?: boolean;
|
|
};
|
|
export declare type OpSchema = EntityShape & {
|
|
entity: "user" | "userEntityGrant" | "wechatLogin" | string;
|
|
entityId: String<64>;
|
|
type: QrCodeType;
|
|
allowShare: Boolean;
|
|
tag?: String<32> | null;
|
|
tag2?: String<64> | null;
|
|
expiresAt?: Datetime | null;
|
|
expired?: Boolean | null;
|
|
ticket?: Text | null;
|
|
url?: String<256> | null;
|
|
permanent?: Boolean | null;
|
|
buffer?: Text | null;
|
|
applicationId: ForeignKey<"application">;
|
|
props: WechatQrCodeProps;
|
|
};
|
|
export declare type OpAttr = keyof OpSchema;
|
|
export declare type Schema = EntityShape & {
|
|
entity: "user" | "userEntityGrant" | "wechatLogin" | string;
|
|
entityId: String<64>;
|
|
type: QrCodeType;
|
|
allowShare: Boolean;
|
|
tag?: String<32> | null;
|
|
tag2?: String<64> | null;
|
|
expiresAt?: Datetime | null;
|
|
expired?: Boolean | null;
|
|
ticket?: Text | null;
|
|
url?: String<256> | null;
|
|
permanent?: Boolean | null;
|
|
buffer?: Text | null;
|
|
applicationId: ForeignKey<"application">;
|
|
props: WechatQrCodeProps;
|
|
application: Application.Schema;
|
|
user?: User.Schema;
|
|
userEntityGrant?: UserEntityGrant.Schema;
|
|
wechatLogin?: WechatLogin.Schema;
|
|
modiEntity$entity?: Array<ModiEntity.Schema>;
|
|
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
|
operEntity$entity?: Array<OperEntity.Schema>;
|
|
operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
|
|
} & {
|
|
[A in ExpressionKey]?: any;
|
|
};
|
|
declare type AttrFilter = {
|
|
id: Q_StringValue;
|
|
$$createAt$$: Q_DateValue;
|
|
$$seq$$: Q_StringValue;
|
|
$$updateAt$$: Q_DateValue;
|
|
entity: Q_EnumValue<"user" | "userEntityGrant" | "wechatLogin" | string>;
|
|
entityId: Q_StringValue;
|
|
type: Q_EnumValue<QrCodeType>;
|
|
allowShare: Q_BooleanValue;
|
|
tag: Q_StringValue;
|
|
tag2: Q_StringValue;
|
|
expiresAt: Q_DateValue;
|
|
expired: Q_BooleanValue;
|
|
ticket: Q_StringValue;
|
|
url: Q_StringValue;
|
|
permanent: Q_BooleanValue;
|
|
buffer: Q_StringValue;
|
|
applicationId: Q_StringValue;
|
|
application: Application.Filter;
|
|
props: JsonFilter<WechatQrCodeProps>;
|
|
user: User.Filter;
|
|
userEntityGrant: UserEntityGrant.Filter;
|
|
wechatLogin: WechatLogin.Filter;
|
|
modiEntity$entity: ModiEntity.Filter;
|
|
operEntity$entity: OperEntity.Filter;
|
|
};
|
|
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
export declare type Projection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
entity?: number;
|
|
entityId?: number;
|
|
type?: number;
|
|
allowShare?: number;
|
|
tag?: number;
|
|
tag2?: number;
|
|
expiresAt?: number;
|
|
expired?: number;
|
|
ticket?: number;
|
|
url?: number;
|
|
permanent?: number;
|
|
buffer?: number;
|
|
applicationId?: number;
|
|
application?: Application.Projection;
|
|
props?: number | JsonProjection<WechatQrCodeProps>;
|
|
user?: User.Projection;
|
|
userEntityGrant?: UserEntityGrant.Projection;
|
|
wechatLogin?: WechatLogin.Projection;
|
|
modiEntity$entity?: ModiEntity.Selection & {
|
|
$entity: "modiEntity";
|
|
};
|
|
modiEntity$entity$$aggr?: ModiEntity.Aggregation & {
|
|
$entity: "modiEntity";
|
|
};
|
|
operEntity$entity?: OperEntity.Selection & {
|
|
$entity: "operEntity";
|
|
};
|
|
operEntity$entity$$aggr?: OperEntity.Aggregation & {
|
|
$entity: "operEntity";
|
|
};
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
declare type WechatQrCodeIdProjection = OneOf<{
|
|
id: number;
|
|
}>;
|
|
declare type ApplicationIdProjection = OneOf<{
|
|
applicationId: number;
|
|
}>;
|
|
declare type UserIdProjection = OneOf<{
|
|
entityId: number;
|
|
}>;
|
|
declare type UserEntityGrantIdProjection = OneOf<{
|
|
entityId: number;
|
|
}>;
|
|
declare type WechatLoginIdProjection = OneOf<{
|
|
entityId: number;
|
|
}>;
|
|
export declare type SortAttr = {
|
|
id: number;
|
|
} | {
|
|
$$createAt$$: number;
|
|
} | {
|
|
$$seq$$: number;
|
|
} | {
|
|
$$updateAt$$: number;
|
|
} | {
|
|
entity: number;
|
|
} | {
|
|
entityId: number;
|
|
} | {
|
|
type: number;
|
|
} | {
|
|
allowShare: number;
|
|
} | {
|
|
tag: number;
|
|
} | {
|
|
tag2: number;
|
|
} | {
|
|
expiresAt: number;
|
|
} | {
|
|
expired: number;
|
|
} | {
|
|
ticket: number;
|
|
} | {
|
|
url: number;
|
|
} | {
|
|
permanent: number;
|
|
} | {
|
|
buffer: number;
|
|
} | {
|
|
applicationId: number;
|
|
} | {
|
|
application: Application.SortAttr;
|
|
} | {
|
|
props: number;
|
|
} | {
|
|
user: User.SortAttr;
|
|
} | {
|
|
userEntityGrant: UserEntityGrant.SortAttr;
|
|
} | {
|
|
wechatLogin: WechatLogin.SortAttr;
|
|
} | {
|
|
[k: string]: any;
|
|
} | OneOf<ExprOp<OpAttr | string>>;
|
|
export declare type SortNode = {
|
|
$attr: SortAttr;
|
|
$direction?: "asc" | "desc";
|
|
};
|
|
export declare type Sorter = SortNode[];
|
|
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "applicationId">> & (({
|
|
applicationId?: never;
|
|
application: Application.CreateSingleOperation;
|
|
} | {
|
|
applicationId: String<64>;
|
|
application?: Application.UpdateOperation;
|
|
} | {
|
|
applicationId: String<64>;
|
|
})) & ({
|
|
entity?: never;
|
|
entityId?: never;
|
|
user: User.CreateSingleOperation;
|
|
} | {
|
|
entity: "user";
|
|
entityId: String<64>;
|
|
user: User.UpdateOperation;
|
|
} | {
|
|
entity: "user";
|
|
entityId: String<64>;
|
|
} | {
|
|
entity?: never;
|
|
entityId?: never;
|
|
userEntityGrant: UserEntityGrant.CreateSingleOperation;
|
|
} | {
|
|
entity: "userEntityGrant";
|
|
entityId: String<64>;
|
|
userEntityGrant: UserEntityGrant.UpdateOperation;
|
|
} | {
|
|
entity: "userEntityGrant";
|
|
entityId: String<64>;
|
|
} | {
|
|
entity?: never;
|
|
entityId?: never;
|
|
wechatLogin: WechatLogin.CreateSingleOperation;
|
|
} | {
|
|
entity: "wechatLogin";
|
|
entityId: String<64>;
|
|
wechatLogin: WechatLogin.UpdateOperation;
|
|
} | {
|
|
entity: "wechatLogin";
|
|
entityId: String<64>;
|
|
} | {
|
|
entity?: string;
|
|
entityId?: string;
|
|
[K: string]: any;
|
|
}) & {
|
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
};
|
|
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "applicationId">> & (({
|
|
application: Application.CreateSingleOperation;
|
|
applicationId?: never;
|
|
} | {
|
|
application: Application.UpdateOperation;
|
|
applicationId?: never;
|
|
} | {
|
|
application: Application.RemoveOperation;
|
|
applicationId?: never;
|
|
} | {
|
|
application?: never;
|
|
applicationId?: String<64> | null;
|
|
})) & ({
|
|
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
|
entityId?: never;
|
|
entity?: never;
|
|
} | {
|
|
userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
|
entityId?: never;
|
|
entity?: never;
|
|
} | {
|
|
wechatLogin?: WechatLogin.CreateSingleOperation | WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
|
entityId?: never;
|
|
entity?: never;
|
|
} | {
|
|
entity?: ("user" | "userEntityGrant" | "wechatLogin" | string) | null;
|
|
entityId?: String<64> | null;
|
|
}) & {
|
|
[k: string]: any;
|
|
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
};
|
|
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
|
export declare type RemoveOperationData = {} & (({
|
|
application?: Application.UpdateOperation | Application.RemoveOperation;
|
|
})) & ({
|
|
user?: User.UpdateOperation | User.RemoveOperation;
|
|
} | {
|
|
userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
|
} | {
|
|
wechatLogin?: WechatLogin.UpdateOperation | WechatLogin.RemoveOperation;
|
|
} | {
|
|
[k: string]: any;
|
|
});
|
|
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
|
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
|
export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
|
|
export declare type WechatLoginIdSubQuery = Selection<WechatLoginIdProjection>;
|
|
export declare type WechatQrCodeIdSubQuery = Selection<WechatQrCodeIdProjection>;
|
|
export declare type EntityDef = {
|
|
Schema: Schema;
|
|
OpSchema: OpSchema;
|
|
Action: OakMakeAction<GenericAction> | string;
|
|
Selection: Selection;
|
|
Aggregation: Aggregation;
|
|
Operation: Operation;
|
|
Create: CreateOperation;
|
|
Update: UpdateOperation;
|
|
Remove: RemoveOperation;
|
|
CreateSingle: CreateSingleOperation;
|
|
CreateMulti: CreateMultipleOperation;
|
|
};
|
|
export {};
|