import { JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } 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, AggregationResult } from "oak-domain/lib/types/Entity"; import { Action, ParticularAction, IState } from "./Action"; import { RelationAction } from "oak-domain/lib/actions/action"; import { String, Text } from "oak-domain/lib/types/DataType"; import { EntityShape } from "oak-domain/lib/types/Entity"; import * as UserEntityGrant from "../UserEntityGrant/Schema"; import * as Relation from "../Relation/Schema"; import * as UserRelation from "../UserRelation/Schema"; export type RedirectToProps = { pathname: string; props?: Record; state?: Record; }; export type OpSchema = EntityShape & { title: Text; description?: Text | null; targetEntity: String<32>; action: String<32>; redirectTo: RedirectToProps; iState?: IState | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { title: Text; description?: Text | null; targetEntity: String<32>; action: String<32>; redirectTo: RedirectToProps; iState?: IState | null; userEntityGrant$entity?: Array; userEntityGrant$entity$$aggr?: AggregationResult; relation$entity?: Array; relation$entity$$aggr?: AggregationResult; userRelation$entity?: Array; userRelation$entity$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; type AttrFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; title: Q_StringValue; description: Q_StringValue; targetEntity: Q_StringValue; action: Q_StringValue; redirectTo: JsonFilter; iState: Q_EnumValue; userEntityGrant$entity: UserEntityGrant.Filter & SubQueryPredicateMetadata; relation$entity: Relation.Filter & SubQueryPredicateMetadata; userRelation$entity: UserRelation.Filter & SubQueryPredicateMetadata; }; export type Filter = MakeFilter>; export type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; title?: number; description?: number; targetEntity?: number; action?: number; redirectTo?: number | JsonProjection; iState?: number; userEntityGrant$entity?: UserEntityGrant.Selection & { $entity: "userEntityGrant"; }; userEntityGrant$entity$$aggr?: UserEntityGrant.Aggregation & { $entity: "userEntityGrant"; }; relation$entity?: Relation.Selection & { $entity: "relation"; }; relation$entity$$aggr?: Relation.Aggregation & { $entity: "relation"; }; userRelation$entity?: UserRelation.Selection & { $entity: "userRelation"; }; userRelation$entity$$aggr?: UserRelation.Aggregation & { $entity: "userRelation"; }; } & Partial>; type ToDoIdProjection = OneOf<{ id: number; }>; export type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { title: number; } | { description: number; } | { targetEntity: number; } | { action: number; } | { redirectTo: number; } | { iState: number; } | { [k: string]: any; } | OneOf>; export type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export type Sorter = SortNode[]; export type SelectOperation

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

= SelectOperation

; export type Aggregation = DeduceAggregation; export type CreateOperationData = FormCreateData & { userEntityGrant$entity?: OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit>>; relation$entity?: OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit>>; userRelation$entity?: OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit>>; }; export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export type CreateMultipleOperation = OakOperation<"create", Array>; export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export type UpdateOperationData = FormUpdateData & { [k: string]: any; userEntityGrant$entity?: OakOperation, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; relation$entity?: OakOperation, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; userRelation$entity?: OakOperation, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; }; export type UpdateOperation = OakOperation<"update" | ParticularAction | RelationAction | string, UpdateOperationData, Filter, Sorter>; export type RemoveOperationData = {}; export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export type Operation = CreateOperation | UpdateOperation | RemoveOperation; export type ToDoIdSubQuery = Selection; export 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; ParticularAction: ParticularAction; }; export {};