import { String, 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 { 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 * as User from "../User/Schema"; import * as System from "../System/Schema"; import * as ModiEntity from "../ModiEntity/Schema"; import * as OperEntity from "../OperEntity/Schema"; export declare type OpSchema = EntityShape & { userId: ForeignKey<"user">; systemId: ForeignKey<"system">; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { userId: ForeignKey<"user">; systemId: ForeignKey<"system">; user: User.Schema; system: System.Schema; modiEntity$entity?: Array; modiEntity$entity$$aggr?: AggregationResult; operEntity$entity?: Array; operEntity$entity$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; declare type AttrFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; userId: Q_StringValue; user: User.Filter; systemId: Q_StringValue; system: System.Filter; modiEntity$entity: ModiEntity.Filter; operEntity$entity: OperEntity.Filter; }; export declare type Filter = MakeFilter>; export declare type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; userId?: number; user?: User.Projection; systemId?: number; system?: System.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>; declare type UserSystemIdProjection = OneOf<{ id: number; }>; declare type UserIdProjection = OneOf<{ userId: number; }>; declare type SystemIdProjection = OneOf<{ systemId: number; }>; export declare type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { userId: number; } | { user: User.SortAttr; } | { systemId: number; } | { system: System.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

= SelectOperation

; export declare type Aggregation = DeduceAggregation; export declare type CreateOperationData = FormCreateData> & (({ userId?: never; user: User.CreateSingleOperation; } | { userId: String<64>; user?: User.UpdateOperation; } | { userId: String<64>; }) & ({ systemId?: never; system: System.CreateSingleOperation; } | { systemId: String<64>; system?: System.UpdateOperation; } | { systemId: String<64>; })) & { modiEntity$entity?: OakOperation<"create", Omit[]> | Array>>; operEntity$entity?: 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> & (({ user: User.CreateSingleOperation; userId?: never; } | { user: User.UpdateOperation; userId?: never; } | { user: User.RemoveOperation; userId?: never; } | { user?: never; userId?: String<64> | null; }) & ({ system: System.CreateSingleOperation; systemId?: never; } | { system: System.UpdateOperation; systemId?: never; } | { system: System.RemoveOperation; systemId?: never; } | { system?: never; systemId?: String<64> | null; })) & { [k: string]: any; modiEntity$entity?: OakOperation<"create", Omit[]> | Array>>; operEntity$entity?: OakOperation<"create", Omit[]> | Array>>; }; export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export declare type RemoveOperationData = {} & (({ user?: User.UpdateOperation | User.RemoveOperation; }) & ({ system?: System.UpdateOperation | System.RemoveOperation; })); export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation; export declare type UserIdSubQuery = Selection; export declare type SystemIdSubQuery = Selection; export declare type UserSystemIdSubQuery = 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 {};