import { String, ForeignKey } from "../../types/DataType"; import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand"; import { OneOf } from "../../types/Polyfill"; import * as SubQuery from "../_SubQuery"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity"; import { AppendOnlyAction } from "../../actions/action"; import * as Modi from "../Modi/Schema"; import * as User from "../User/Schema"; import * as UserEntityGrant from "../UserEntityGrant/Schema"; export declare type OpSchema = EntityShape & { modiId: ForeignKey<"modi">; entity: "user" | "userEntityGrant" | string; entityId: String<64>; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { modiId: ForeignKey<"modi">; entity: "user" | "userEntityGrant" | string; entityId: String<64>; modi: Modi.Schema; user?: User.Schema; userEntityGrant?: UserEntityGrant.Schema; } & { [A in ExpressionKey]?: any; }; declare type AttrFilter = { id: Q_StringValue | SubQuery.ModiEntityIdSubQuery; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; modiId: Q_StringValue | SubQuery.ModiIdSubQuery; modi: Modi.Filter; entity: E; entityId: Q_StringValue; user: User.Filter; userEntityGrant: UserEntityGrant.Filter; }; export declare type Filter> = MakeFilter & ExprOp>; export declare type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; modiId?: number; modi?: Modi.Projection; entity?: number; entityId?: number; user?: User.Projection; userEntityGrant?: UserEntityGrant.Projection; } & Partial>; declare type ModiEntityIdProjection = OneOf<{ id: number; }>; declare type ModiIdProjection = OneOf<{ modiId: number; }>; declare type UserIdProjection = OneOf<{ entityId: number; }>; declare type UserEntityGrantIdProjection = OneOf<{ entityId: number; }>; export declare type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { modiId: number; } | { modi: Modi.SortAttr; } | { entity: number; } | { entityId: number; } | { user: User.SortAttr; } | { userEntityGrant: UserEntityGrant.SortAttr; } | { [k: string]: any; } | OneOf>; export declare type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export declare type Sorter = SortNode[]; export declare type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export declare type Selection

= Omit, "action">; export declare type Aggregation = DeduceAggregation; export declare type CreateOperationData = FormCreateData> & (({ modiId?: never; modi: Modi.CreateSingleOperation; } | { modiId: String<64>; modi?: Modi.UpdateOperation; } | { modiId: 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?: string; entityId?: string; [K: string]: any; }); export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export declare type CreateMultipleOperation = OakOperation<"create", Array>; export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export declare type UpdateOperationData = FormUpdateData> & (({ modi: Modi.CreateSingleOperation; modiId?: never; } | { modi: Modi.UpdateOperation; modiId?: never; } | { modi: Modi.RemoveOperation; modiId?: never; } | { modi?: never; modiId?: 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; } | { entity?: ("user" | "userEntityGrant" | string) | null; entityId?: String<64> | null; }) & { [k: string]: any; }; export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export declare type RemoveOperationData = {} & (({ modi?: Modi.UpdateOperation | Modi.RemoveOperation; })) & ({ user?: User.UpdateOperation | User.RemoveOperation; } | { userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation; } | { [k: string]: any; }); export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation; export declare type ModiIdSubQuery = Selection; export declare type UserIdSubQuery = Selection; export declare type UserEntityGrantIdSubQuery = Selection; export declare type ModiEntityIdSubQuery = Selection; export declare type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Aggregation: Aggregation; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; }; export {};