import { String, Datetime, PrimaryKey, ForeignKey } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import * as SubQuery from "../_SubQuery"; import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction } from "oak-domain/lib/types/Entity"; import { AppendOnlyAction } from "oak-domain/lib/actions/action"; import * as User from "../User/Schema"; import * as OperEntity from "../OperEntity/Schema"; export declare type OpSchema = { id: PrimaryKey; $$createAt$$: Datetime; $$updateAt$$: Datetime; $$deleteAt$$?: Datetime | null; action: String<16>; data: Object; filter?: Object | null; extra?: Object | null; operatorId?: ForeignKey<"user"> | null; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = { id: PrimaryKey; $$createAt$$: Datetime; $$updateAt$$: Datetime; $$deleteAt$$?: Datetime | null; action: String<16>; data: Object; filter?: Object | null; extra?: Object | null; operatorId?: ForeignKey<"user"> | null; operator?: User.Schema | null; operEntity$oper?: Array; } & { [A in ExpressionKey]?: any; }; declare type AttrFilter = { id: Q_StringValue | SubQuery.OperIdSubQuery; $$createAt$$: Q_DateValue; $$updateAt$$: Q_DateValue; action: Q_StringValue; operatorId: Q_StringValue | SubQuery.UserIdSubQuery; operator: User.Filter; }; export declare type Filter = MakeFilter>; export declare type Projection = { "#id"?: NodeId; [k: string]: any; id: 1; $$createAt$$?: 1; $$updateAt$$?: 1; action?: 1; data?: 1; filter?: 1; extra?: 1; operatorId?: 1; operator?: User.Projection; operEntity$oper?: OperEntity.Selection & { $entity: "operEntity"; }; } & Partial>; export declare type ExportProjection = { "#id"?: NodeId; [k: string]: any; id?: string; $$createAt$$?: string; $$updateAt$$?: string; action?: string; data?: string; filter?: string; extra?: string; operatorId?: string; operator?: User.ExportProjection; operEntity$oper?: OperEntity.Exportation & { $entity: "operEntity"; }; } & Partial>; declare type OperIdProjection = OneOf<{ id: 1; }>; declare type UserIdProjection = OneOf<{ operatorId: 1; }>; export declare type SortAttr = { id: 1; } | { $$createAt$$: 1; } | { $$updateAt$$: 1; } | { action: 1; } | { operatorId: 1; } | { operator: User.SortAttr; } | { [k: string]: any; } | OneOf>; export declare type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export declare type Sorter = SortNode[]; export declare type SelectOperation

= Omit, "id">; export declare type Selection

= Omit, "action">; export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; export declare type CreateOperationData = FormCreateData> & (({ operatorId?: never; operator?: User.CreateSingleOperation; } | { operatorId: String<64>; operator?: User.UpdateOperation; } | { operatorId?: String<64>; })) & { operEntity$oper?: OakOperation<"create", Omit[]> | Array>>; }; 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> & (({ operator: User.CreateSingleOperation; operatorId?: never; } | { operator: User.UpdateOperation; operatorId?: never; } | { operator: User.RemoveOperation; operatorId?: never; } | { operator?: never; operatorId?: String<64> | null; })) & { [k: string]: any; operEntitys$oper?: OakOperation<"create", Omit[]> | Array>>; }; export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export declare type RemoveOperationData = {} & (({ operator?: User.UpdateOperation | User.RemoveOperation; })); export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; export declare type UserIdSubQuery = Selection; export declare type OperIdSubQuery = Selection; export declare type NativeAttr = OpAttr | `operator.${User.NativeAttr}`; export declare type FullAttr = NativeAttr | `operEntitys$${number}.${OperEntity.NativeAttr}`; export declare type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; }; export {};