oak-domain 2.4.1 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/lib/actions/action.d.ts +8 -8
  2. package/lib/actions/action.js +1 -1
  3. package/lib/actions/relation.d.ts +1 -1
  4. package/lib/base-app-domain/EntityDict.d.ts +1 -1
  5. package/lib/base-app-domain/Modi/Action.d.ts +4 -4
  6. package/lib/base-app-domain/Modi/Action.js +1 -1
  7. package/lib/base-app-domain/Modi/Schema.d.ts +27 -27
  8. package/lib/base-app-domain/ModiEntity/Schema.d.ts +29 -29
  9. package/lib/base-app-domain/Oper/Schema.d.ts +28 -28
  10. package/lib/base-app-domain/OperEntity/Schema.d.ts +31 -31
  11. package/lib/base-app-domain/User/Schema.d.ts +28 -28
  12. package/lib/base-app-domain/_SubQuery.d.ts +5 -5
  13. package/lib/compiler/schemalBuilder.js +29 -27
  14. package/lib/store/CascadeStore.js +20 -24
  15. package/lib/store/TriggerExecutor.d.ts +1 -1
  16. package/lib/store/actionDef.js +223 -25
  17. package/lib/store/checker.js +26 -26
  18. package/lib/store/selection.js +3 -0
  19. package/lib/types/Action.d.ts +5 -5
  20. package/lib/types/Auth.d.ts +9 -9
  21. package/lib/types/DataType.d.ts +14 -14
  22. package/lib/types/Demand.d.ts +23 -23
  23. package/lib/types/Endpoint.d.ts +1 -1
  24. package/lib/types/Entity.d.ts +54 -47
  25. package/lib/types/Exception.d.ts +10 -0
  26. package/lib/types/Exception.js +17 -1
  27. package/lib/types/Expression.d.ts +14 -14
  28. package/lib/types/Geo.d.ts +6 -6
  29. package/lib/types/Locale.d.ts +5 -5
  30. package/lib/types/Polyfill.d.ts +8 -8
  31. package/lib/types/Port.d.ts +2 -2
  32. package/lib/types/RowStore.d.ts +1 -1
  33. package/lib/types/Storage.d.ts +4 -4
  34. package/lib/types/Timer.d.ts +3 -3
  35. package/lib/types/Trigger.d.ts +5 -5
  36. package/lib/types/Watcher.d.ts +2 -2
  37. package/lib/types/schema/DataTypes.d.ts +7 -7
  38. package/lib/utils/concurrent.d.ts +1 -1
  39. package/lib/utils/uuid.d.ts +1 -1
  40. package/lib/utils/uuid.js +1 -1
  41. package/lib/utils/validator.d.ts +2 -2
  42. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
1
  import { ActionDef } from '../types/Action';
2
- export type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download';
3
- export type AppendOnlyAction = ReadOnlyAction | 'create';
4
- export type ExcludeUpdateAction = AppendOnlyAction | 'remove';
5
- export type ExcludeRemoveAction = AppendOnlyAction | 'update';
6
- export type GenericAction = 'update' | ExcludeUpdateAction;
7
- export type RelationAction = 'grant' | 'revoke';
2
+ export declare type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download' | 'aggregate';
3
+ export declare type AppendOnlyAction = ReadOnlyAction | 'create';
4
+ export declare type ExcludeUpdateAction = AppendOnlyAction | 'remove';
5
+ export declare type ExcludeRemoveAction = AppendOnlyAction | 'update';
6
+ export declare type GenericAction = 'update' | ExcludeUpdateAction;
7
+ export declare type RelationAction = 'grant' | 'revoke';
8
8
  export declare const readOnlyActions: string[];
9
9
  export declare const appendOnlyActions: string[];
10
10
  export declare const excludeUpdateActions: string[];
11
11
  export declare const exludeRemoveActions: string[];
12
12
  export declare const genericActions: string[];
13
13
  export declare const relationActions: string[];
14
- export type AbleAction = 'enable' | 'disable';
15
- export type AbleState = 'enabled' | 'disabled';
14
+ export declare type AbleAction = 'enable' | 'disable';
15
+ export declare type AbleState = 'enabled' | 'disabled';
16
16
  export declare const makeAbleActionDef: (initialState?: AbleState) => ActionDef<AbleAction, AbleState>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeAbleActionDef = exports.relationActions = exports.genericActions = exports.exludeRemoveActions = exports.excludeUpdateActions = exports.appendOnlyActions = exports.readOnlyActions = void 0;
4
- exports.readOnlyActions = ['count', 'stat', 'download', 'select'];
4
+ exports.readOnlyActions = ['count', 'stat', 'download', 'select', 'aggregate'];
5
5
  exports.appendOnlyActions = exports.readOnlyActions.concat('create');
6
6
  exports.excludeUpdateActions = exports.appendOnlyActions.concat('remove');
7
7
  exports.exludeRemoveActions = exports.appendOnlyActions.concat('update');
@@ -1,5 +1,5 @@
1
1
  import { CascadeRelationItem, RelationHierarchy } from "../types/Entity";
2
- export type GenericRelation = 'owner';
2
+ export declare type GenericRelation = 'owner';
3
3
  export declare function convertHierarchyToAuth<R extends string>(hierarchy: RelationHierarchy<R>): {
4
4
  [K in R]?: CascadeRelationItem;
5
5
  };
@@ -3,7 +3,7 @@ import { EntityDef as ModiEntity } from "./ModiEntity/Schema";
3
3
  import { EntityDef as Oper } from "./Oper/Schema";
4
4
  import { EntityDef as OperEntity } from "./OperEntity/Schema";
5
5
  import { EntityDef as User } from "./User/Schema";
6
- export type EntityDict = {
6
+ export declare type EntityDict = {
7
7
  modi: Modi;
8
8
  modiEntity: ModiEntity;
9
9
  oper: Oper;
@@ -1,9 +1,9 @@
1
1
  import { ActionDef } from "../../types/Action";
2
2
  import { GenericAction } from "../../actions/action";
3
- export type IState = 'active' | 'applied' | 'abandoned';
4
- export type IAction = 'apply' | 'abandon';
5
- export type ParticularAction = IAction;
6
- export type Action = GenericAction | ParticularAction;
3
+ export declare type IState = 'active' | 'applied' | 'abandoned';
4
+ export declare type IAction = 'apply' | 'abandon';
5
+ export declare type ParticularAction = IAction;
6
+ export declare type Action = GenericAction | ParticularAction;
7
7
  export declare const actions: string[];
8
8
  export declare const ActionDefDict: {
9
9
  iState: ActionDef<IAction, IState>;
@@ -8,7 +8,7 @@ var IActionDef = {
8
8
  },
9
9
  is: 'active'
10
10
  };
11
- exports.actions = ["count", "stat", "download", "select", "create", "remove", "update", "apply", "abandon"];
11
+ exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
12
12
  exports.ActionDefDict = {
13
13
  iState: IActionDef
14
14
  };
@@ -2,11 +2,11 @@ import { String } from "../../types/DataType";
2
2
  import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
3
  import { OneOf } from "../../types/Polyfill";
4
4
  import * as SubQuery from "../_SubQuery";
5
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "../../types/Entity";
5
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "../../types/Entity";
6
6
  import { Action, ParticularAction, IState } from "./Action";
7
7
  import * as ModiEntity from "../ModiEntity/Schema";
8
8
  import * as OperEntity from "../OperEntity/Schema";
9
- export type OpSchema = EntityShape & {
9
+ export declare type OpSchema = EntityShape & {
10
10
  targetEntity: String<32>;
11
11
  entity: String<32>;
12
12
  entityId: String<64>;
@@ -16,8 +16,8 @@ export type OpSchema = EntityShape & {
16
16
  extra?: Object | null;
17
17
  iState?: IState | null;
18
18
  };
19
- export type OpAttr = keyof OpSchema;
20
- export type Schema = EntityShape & {
19
+ export declare type OpAttr = keyof OpSchema;
20
+ export declare type Schema = EntityShape & {
21
21
  targetEntity: String<32>;
22
22
  entity: String<32>;
23
23
  entityId: String<64>;
@@ -33,7 +33,7 @@ export type Schema = EntityShape & {
33
33
  } & {
34
34
  [A in ExpressionKey]?: any;
35
35
  };
36
- type AttrFilter = {
36
+ declare type AttrFilter = {
37
37
  id: Q_StringValue | SubQuery.ModiIdSubQuery;
38
38
  $$createAt$$: Q_DateValue;
39
39
  $$seq$$: Q_StringValue;
@@ -47,8 +47,8 @@ type AttrFilter = {
47
47
  extra: Object;
48
48
  iState: Q_EnumValue<IState>;
49
49
  };
50
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
51
- export type Projection = {
50
+ export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
51
+ export declare type Projection = {
52
52
  "#id"?: NodeId;
53
53
  [k: string]: any;
54
54
  id?: number;
@@ -76,10 +76,10 @@ export type Projection = {
76
76
  $entity: "operEntity";
77
77
  };
78
78
  } & Partial<ExprOp<OpAttr | string>>;
79
- type ModiIdProjection = OneOf<{
79
+ declare type ModiIdProjection = OneOf<{
80
80
  id: number;
81
81
  }>;
82
- export type SortAttr = {
82
+ export declare type SortAttr = {
83
83
  id: number;
84
84
  } | {
85
85
  $$createAt$$: number;
@@ -100,15 +100,15 @@ export type SortAttr = {
100
100
  } | {
101
101
  [k: string]: any;
102
102
  } | OneOf<ExprOp<OpAttr | string>>;
103
- export type SortNode = {
103
+ export declare type SortNode = {
104
104
  $attr: SortAttr;
105
105
  $direction?: "asc" | "desc";
106
106
  };
107
- export type Sorter = SortNode[];
108
- export type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
109
- export type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
110
- export type Aggregation = Omit<DeduceAggregation<Projection, Filter, Sorter>, "id">;
111
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
107
+ export declare type Sorter = SortNode[];
108
+ export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
109
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
110
+ export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
111
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
112
112
  entity?: string;
113
113
  entityId?: string;
114
114
  [K: string]: any;
@@ -116,20 +116,20 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
116
116
  modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
117
117
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
118
118
  };
119
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
120
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
121
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
122
- export type UpdateOperationData = FormUpdateData<OpSchema> & {
119
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
120
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
121
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
122
+ export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
123
123
  [k: string]: any;
124
- modiEntitys$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
125
- operEntitys$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
124
+ modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
125
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
126
126
  };
127
- export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
128
- export type RemoveOperationData = {};
129
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
130
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
131
- export type ModiIdSubQuery = Selection<ModiIdProjection>;
132
- export type EntityDef = {
127
+ export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
128
+ export declare type RemoveOperationData = {};
129
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
130
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
131
+ export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
132
+ export declare type EntityDef = {
133
133
  Schema: Schema;
134
134
  OpSchema: OpSchema;
135
135
  Action: OakMakeAction<Action> | string;
@@ -2,17 +2,17 @@ import { String, ForeignKey } from "../../types/DataType";
2
2
  import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
3
  import { OneOf } from "../../types/Polyfill";
4
4
  import * as SubQuery from "../_SubQuery";
5
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
5
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
6
6
  import { AppendOnlyAction } from "../../actions/action";
7
7
  import * as Modi from "../Modi/Schema";
8
8
  import * as User from "../User/Schema";
9
- export type OpSchema = EntityShape & {
9
+ export declare type OpSchema = EntityShape & {
10
10
  modiId: ForeignKey<"modi">;
11
11
  entity: "user" | string;
12
12
  entityId: String<64>;
13
13
  };
14
- export type OpAttr = keyof OpSchema;
15
- export type Schema = EntityShape & {
14
+ export declare type OpAttr = keyof OpSchema;
15
+ export declare type Schema = EntityShape & {
16
16
  modiId: ForeignKey<"modi">;
17
17
  entity: "user" | string;
18
18
  entityId: String<64>;
@@ -21,7 +21,7 @@ export type Schema = EntityShape & {
21
21
  } & {
22
22
  [A in ExpressionKey]?: any;
23
23
  };
24
- type AttrFilter<E> = {
24
+ declare type AttrFilter<E> = {
25
25
  id: Q_StringValue | SubQuery.ModiEntityIdSubQuery;
26
26
  $$createAt$$: Q_DateValue;
27
27
  $$seq$$: Q_StringValue;
@@ -32,8 +32,8 @@ type AttrFilter<E> = {
32
32
  entityId: Q_StringValue;
33
33
  user: User.Filter;
34
34
  };
35
- export type Filter<E = Q_EnumValue<"user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr | string>>;
36
- export type Projection = {
35
+ export declare type Filter<E = Q_EnumValue<"user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr | string>>;
36
+ export declare type Projection = {
37
37
  "#id"?: NodeId;
38
38
  [k: string]: any;
39
39
  id?: number;
@@ -46,16 +46,16 @@ export type Projection = {
46
46
  entityId?: number;
47
47
  user?: User.Projection;
48
48
  } & Partial<ExprOp<OpAttr | string>>;
49
- type ModiEntityIdProjection = OneOf<{
49
+ declare type ModiEntityIdProjection = OneOf<{
50
50
  id: number;
51
51
  }>;
52
- type ModiIdProjection = OneOf<{
52
+ declare type ModiIdProjection = OneOf<{
53
53
  modiId: number;
54
54
  }>;
55
- type UserIdProjection = OneOf<{
55
+ declare type UserIdProjection = OneOf<{
56
56
  entityId: number;
57
57
  }>;
58
- export type SortAttr = {
58
+ export declare type SortAttr = {
59
59
  id: number;
60
60
  } | {
61
61
  $$createAt$$: number;
@@ -76,15 +76,15 @@ export type SortAttr = {
76
76
  } | {
77
77
  [k: string]: any;
78
78
  } | OneOf<ExprOp<OpAttr | string>>;
79
- export type SortNode = {
79
+ export declare type SortNode = {
80
80
  $attr: SortAttr;
81
81
  $direction?: "asc" | "desc";
82
82
  };
83
- export type Sorter = SortNode[];
84
- export type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
85
- export type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
86
- export type Aggregation = Omit<DeduceAggregation<Projection, Filter, Sorter>, "id">;
87
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
83
+ export declare type Sorter = SortNode[];
84
+ export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
85
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
86
+ export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
87
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
88
88
  modiId?: never;
89
89
  modi: Modi.CreateSingleOperation;
90
90
  } | {
@@ -108,10 +108,10 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
108
108
  entityId?: string;
109
109
  [K: string]: any;
110
110
  });
111
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
112
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
113
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
114
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
111
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
112
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
113
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
114
+ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
115
115
  modi: Modi.CreateSingleOperation;
116
116
  modiId?: never;
117
117
  } | {
@@ -133,20 +133,20 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
133
133
  }) & {
134
134
  [k: string]: any;
135
135
  };
136
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
137
- export type RemoveOperationData = {} & (({
136
+ export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
137
+ export declare type RemoveOperationData = {} & (({
138
138
  modi?: Modi.UpdateOperation | Modi.RemoveOperation;
139
139
  })) & ({
140
140
  user?: User.UpdateOperation | User.RemoveOperation;
141
141
  } | {
142
142
  [k: string]: any;
143
143
  });
144
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
145
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
146
- export type ModiIdSubQuery = Selection<ModiIdProjection>;
147
- export type UserIdSubQuery = Selection<UserIdProjection>;
148
- export type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
149
- export type EntityDef = {
144
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
145
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
146
+ export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
147
+ export declare type UserIdSubQuery = Selection<UserIdProjection>;
148
+ export declare type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
149
+ export declare type EntityDef = {
150
150
  Schema: Schema;
151
151
  OpSchema: OpSchema;
152
152
  Action: OakMakeAction<AppendOnlyAction> | string;
@@ -2,19 +2,19 @@ import { String, ForeignKey } from "../../types/DataType";
2
2
  import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
3
  import { OneOf } from "../../types/Polyfill";
4
4
  import * as SubQuery from "../_SubQuery";
5
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "../../types/Entity";
5
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "../../types/Entity";
6
6
  import { AppendOnlyAction } from "../../actions/action";
7
7
  import * as User from "../User/Schema";
8
8
  import * as OperEntity from "../OperEntity/Schema";
9
- export type OpSchema = EntityShape & {
9
+ export declare type OpSchema = EntityShape & {
10
10
  action: String<16>;
11
11
  data: Object;
12
12
  filter?: Object | null;
13
13
  extra?: Object | null;
14
14
  operatorId?: ForeignKey<"user"> | null;
15
15
  };
16
- export type OpAttr = keyof OpSchema;
17
- export type Schema = EntityShape & {
16
+ export declare type OpAttr = keyof OpSchema;
17
+ export declare type Schema = EntityShape & {
18
18
  action: String<16>;
19
19
  data: Object;
20
20
  filter?: Object | null;
@@ -26,7 +26,7 @@ export type Schema = EntityShape & {
26
26
  } & {
27
27
  [A in ExpressionKey]?: any;
28
28
  };
29
- type AttrFilter = {
29
+ declare type AttrFilter = {
30
30
  id: Q_StringValue | SubQuery.OperIdSubQuery;
31
31
  $$createAt$$: Q_DateValue;
32
32
  $$seq$$: Q_StringValue;
@@ -38,8 +38,8 @@ type AttrFilter = {
38
38
  operatorId: Q_StringValue | SubQuery.UserIdSubQuery;
39
39
  operator: User.Filter;
40
40
  };
41
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
42
- export type Projection = {
41
+ export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
42
+ export declare type Projection = {
43
43
  "#id"?: NodeId;
44
44
  [k: string]: any;
45
45
  id?: number;
@@ -59,13 +59,13 @@ export type Projection = {
59
59
  $entity: "operEntity";
60
60
  };
61
61
  } & Partial<ExprOp<OpAttr | string>>;
62
- type OperIdProjection = OneOf<{
62
+ declare type OperIdProjection = OneOf<{
63
63
  id: number;
64
64
  }>;
65
- type UserIdProjection = OneOf<{
65
+ declare type UserIdProjection = OneOf<{
66
66
  operatorId: number;
67
67
  }>;
68
- export type SortAttr = {
68
+ export declare type SortAttr = {
69
69
  id: number;
70
70
  } | {
71
71
  $$createAt$$: number;
@@ -82,15 +82,15 @@ export type SortAttr = {
82
82
  } | {
83
83
  [k: string]: any;
84
84
  } | OneOf<ExprOp<OpAttr | string>>;
85
- export type SortNode = {
85
+ export declare type SortNode = {
86
86
  $attr: SortAttr;
87
87
  $direction?: "asc" | "desc";
88
88
  };
89
- export type Sorter = SortNode[];
90
- export type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
91
- export type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
92
- export type Aggregation = Omit<DeduceAggregation<Projection, Filter, Sorter>, "id">;
93
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
89
+ export declare type Sorter = SortNode[];
90
+ export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
91
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
92
+ export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
93
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
94
94
  operatorId?: never;
95
95
  operator?: User.CreateSingleOperation;
96
96
  } | {
@@ -101,10 +101,10 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> &
101
101
  })) & {
102
102
  operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
103
103
  };
104
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
105
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
106
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
107
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
104
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
105
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
106
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
107
+ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
108
108
  operator: User.CreateSingleOperation;
109
109
  operatorId?: never;
110
110
  } | {
@@ -118,17 +118,17 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> &
118
118
  operatorId?: String<64> | null;
119
119
  })) & {
120
120
  [k: string]: any;
121
- operEntitys$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
121
+ operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
122
122
  };
123
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
124
- export type RemoveOperationData = {} & (({
123
+ export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
124
+ export declare type RemoveOperationData = {} & (({
125
125
  operator?: User.UpdateOperation | User.RemoveOperation;
126
126
  }));
127
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
128
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
129
- export type UserIdSubQuery = Selection<UserIdProjection>;
130
- export type OperIdSubQuery = Selection<OperIdProjection>;
131
- export type EntityDef = {
127
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
128
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
129
+ export declare type UserIdSubQuery = Selection<UserIdProjection>;
130
+ export declare type OperIdSubQuery = Selection<OperIdProjection>;
131
+ export declare type EntityDef = {
132
132
  Schema: Schema;
133
133
  OpSchema: OpSchema;
134
134
  Action: OakMakeAction<AppendOnlyAction> | string;
@@ -2,18 +2,18 @@ import { String, ForeignKey } from "../../types/DataType";
2
2
  import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
3
3
  import { OneOf } from "../../types/Polyfill";
4
4
  import * as SubQuery from "../_SubQuery";
5
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
5
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
6
6
  import { AppendOnlyAction } from "../../actions/action";
7
7
  import * as Oper from "../Oper/Schema";
8
8
  import * as Modi from "../Modi/Schema";
9
9
  import * as User from "../User/Schema";
10
- export type OpSchema = EntityShape & {
10
+ export declare type OpSchema = EntityShape & {
11
11
  operId: ForeignKey<"oper">;
12
12
  entity: "modi" | "user" | string;
13
13
  entityId: String<64>;
14
14
  };
15
- export type OpAttr = keyof OpSchema;
16
- export type Schema = EntityShape & {
15
+ export declare type OpAttr = keyof OpSchema;
16
+ export declare type Schema = EntityShape & {
17
17
  operId: ForeignKey<"oper">;
18
18
  entity: "modi" | "user" | string;
19
19
  entityId: String<64>;
@@ -23,7 +23,7 @@ export type Schema = EntityShape & {
23
23
  } & {
24
24
  [A in ExpressionKey]?: any;
25
25
  };
26
- type AttrFilter<E> = {
26
+ declare type AttrFilter<E> = {
27
27
  id: Q_StringValue | SubQuery.OperEntityIdSubQuery;
28
28
  $$createAt$$: Q_DateValue;
29
29
  $$seq$$: Q_StringValue;
@@ -35,8 +35,8 @@ type AttrFilter<E> = {
35
35
  modi: Modi.Filter;
36
36
  user: User.Filter;
37
37
  };
38
- export type Filter<E = Q_EnumValue<"modi" | "user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr | string>>;
39
- export type Projection = {
38
+ export declare type Filter<E = Q_EnumValue<"modi" | "user" | string>> = MakeFilter<AttrFilter<E> & ExprOp<OpAttr | string>>;
39
+ export declare type Projection = {
40
40
  "#id"?: NodeId;
41
41
  [k: string]: any;
42
42
  id?: number;
@@ -50,19 +50,19 @@ export type Projection = {
50
50
  modi?: Modi.Projection;
51
51
  user?: User.Projection;
52
52
  } & Partial<ExprOp<OpAttr | string>>;
53
- type OperEntityIdProjection = OneOf<{
53
+ declare type OperEntityIdProjection = OneOf<{
54
54
  id: number;
55
55
  }>;
56
- type OperIdProjection = OneOf<{
56
+ declare type OperIdProjection = OneOf<{
57
57
  operId: number;
58
58
  }>;
59
- type ModiIdProjection = OneOf<{
59
+ declare type ModiIdProjection = OneOf<{
60
60
  entityId: number;
61
61
  }>;
62
- type UserIdProjection = OneOf<{
62
+ declare type UserIdProjection = OneOf<{
63
63
  entityId: number;
64
64
  }>;
65
- export type SortAttr = {
65
+ export declare type SortAttr = {
66
66
  id: number;
67
67
  } | {
68
68
  $$createAt$$: number;
@@ -85,15 +85,15 @@ export type SortAttr = {
85
85
  } | {
86
86
  [k: string]: any;
87
87
  } | OneOf<ExprOp<OpAttr | string>>;
88
- export type SortNode = {
88
+ export declare type SortNode = {
89
89
  $attr: SortAttr;
90
90
  $direction?: "asc" | "desc";
91
91
  };
92
- export type Sorter = SortNode[];
93
- export type SelectOperation<P extends Object = Projection> = Omit<OakOperation<"select", P, Filter, Sorter>, "id">;
94
- export type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
95
- export type Aggregation = Omit<DeduceAggregation<Projection, Filter, Sorter>, "id">;
96
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
92
+ export declare type Sorter = SortNode[];
93
+ export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
94
+ export declare type Selection<P extends Object = Projection> = Omit<SelectOperation<P>, "action">;
95
+ export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
96
+ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
97
97
  operId?: never;
98
98
  oper: Oper.CreateSingleOperation;
99
99
  } | {
@@ -125,10 +125,10 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
125
125
  entityId?: string;
126
126
  [K: string]: any;
127
127
  });
128
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
129
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
130
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
131
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
128
+ export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
129
+ export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
130
+ export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
131
+ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
132
132
  oper: Oper.CreateSingleOperation;
133
133
  operId?: never;
134
134
  } | {
@@ -148,21 +148,21 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
148
148
  }) & {
149
149
  [k: string]: any;
150
150
  };
151
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
152
- export type RemoveOperationData = {} & ({
151
+ export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
152
+ export declare type RemoveOperationData = {} & ({
153
153
  modi?: Modi.UpdateOperation | Modi.RemoveOperation;
154
154
  } | {
155
155
  user?: User.UpdateOperation | User.RemoveOperation;
156
156
  } | {
157
157
  [k: string]: any;
158
158
  });
159
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
160
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
161
- export type OperIdSubQuery = Selection<OperIdProjection>;
162
- export type ModiIdSubQuery = Selection<ModiIdProjection>;
163
- export type UserIdSubQuery = Selection<UserIdProjection>;
164
- export type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
165
- export type EntityDef = {
159
+ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
160
+ export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
161
+ export declare type OperIdSubQuery = Selection<OperIdProjection>;
162
+ export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
163
+ export declare type UserIdSubQuery = Selection<UserIdProjection>;
164
+ export declare type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
165
+ export declare type EntityDef = {
166
166
  Schema: Schema;
167
167
  OpSchema: OpSchema;
168
168
  Action: OakMakeAction<AppendOnlyAction> | string;