oak-domain 4.0.2 → 4.1.0

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 (38) hide show
  1. package/lib/base-app-domain/ActionAuth/Schema.d.ts +185 -186
  2. package/lib/base-app-domain/I18n/Schema.d.ts +128 -129
  3. package/lib/base-app-domain/Modi/Schema.d.ts +135 -136
  4. package/lib/base-app-domain/ModiEntity/Schema.d.ts +383 -384
  5. package/lib/base-app-domain/Oper/Schema.d.ts +152 -153
  6. package/lib/base-app-domain/OperEntity/Schema.d.ts +372 -373
  7. package/lib/base-app-domain/Path/Schema.d.ts +148 -149
  8. package/lib/base-app-domain/Relation/Schema.d.ts +187 -188
  9. package/lib/base-app-domain/RelationAuth/Schema.d.ts +213 -214
  10. package/lib/base-app-domain/User/Schema.d.ts +209 -210
  11. package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +263 -264
  12. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +130 -131
  13. package/lib/base-app-domain/UserRelation/Schema.d.ts +207 -208
  14. package/lib/compiler/localeBuilder.d.ts +27 -27
  15. package/lib/compiler/localeBuilder.js +12 -10
  16. package/lib/compiler/routerBuilder.d.ts +1 -1
  17. package/lib/compiler/routerBuilder.js +7 -1
  18. package/lib/compiler/schemalBuilder.js +4156 -3565
  19. package/lib/store/AsyncRowStore.d.ts +65 -65
  20. package/lib/store/AsyncRowStore.js +180 -176
  21. package/lib/store/CascadeStore.d.ts +109 -109
  22. package/lib/store/CascadeStore.js +1748 -1748
  23. package/lib/store/RelationAuth.d.ts +103 -96
  24. package/lib/store/RelationAuth.js +1343 -1336
  25. package/lib/store/SyncRowStore.d.ts +29 -29
  26. package/lib/store/TriggerExecutor.js +1 -1
  27. package/lib/store/actionDef.js +4 -4
  28. package/lib/store/checker.js +487 -487
  29. package/lib/types/Aspect.d.ts +13 -13
  30. package/lib/types/Connector.d.ts +38 -38
  31. package/lib/types/Context.d.ts +7 -7
  32. package/lib/types/Environment.d.ts +93 -90
  33. package/lib/types/Exception.d.ts +155 -147
  34. package/lib/types/Exception.js +436 -406
  35. package/lib/utils/SimpleConnector.d.ts +64 -64
  36. package/lib/utils/SimpleConnector.js +1 -1
  37. package/lib/utils/assert.d.ts +0 -1
  38. package/package.json +1 -1
@@ -1,186 +1,185 @@
1
- import { ForeignKey, JsonProjection } from "../../types/DataType";
2
- import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "../../types/Demand";
3
- import { OneOf } from "../../types/Polyfill";
4
- import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
5
- import { GenericAction } from "../../actions/action";
6
- import { EntityShape } from "../../types/Entity";
7
- import * as Relation from "../Relation/Schema";
8
- import * as Path from "../Path/Schema";
9
- import * as ModiEntity from "../ModiEntity/Schema";
10
- import * as OperEntity from "../OperEntity/Schema";
11
- type Actions = string[];
12
- export type OpSchema = EntityShape & {
13
- relationId?: ForeignKey<"relation"> | null;
14
- pathId: ForeignKey<"path">;
15
- deActions: Actions;
16
- };
17
- export type OpAttr = keyof OpSchema;
18
- export type Schema = EntityShape & {
19
- relationId?: ForeignKey<"relation"> | null;
20
- pathId: ForeignKey<"path">;
21
- deActions: Actions;
22
- relation?: Relation.Schema | null;
23
- path: Path.Schema;
24
- modiEntity$entity?: Array<ModiEntity.Schema>;
25
- modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
26
- operEntity$entity?: Array<OperEntity.Schema>;
27
- operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
28
- } & {
29
- [A in ExpressionKey]?: any;
30
- };
31
- type AttrFilter = {
32
- id: Q_StringValue;
33
- $$createAt$$: Q_DateValue;
34
- $$seq$$: Q_NumberValue;
35
- $$updateAt$$: Q_DateValue;
36
- relationId: Q_StringValue;
37
- relation: Relation.Filter;
38
- pathId: Q_StringValue;
39
- path: Path.Filter;
40
- deActions: JsonFilter<Actions>;
41
- modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
42
- operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
43
- };
44
- export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
45
- export type Projection = {
46
- "#id"?: NodeId;
47
- [k: string]: any;
48
- id?: number;
49
- $$createAt$$?: number;
50
- $$updateAt$$?: number;
51
- $$seq$$?: number;
52
- relationId?: number;
53
- relation?: Relation.Projection;
54
- pathId?: number;
55
- path?: Path.Projection;
56
- deActions?: number | JsonProjection<Actions>;
57
- modiEntity$entity?: ModiEntity.Selection & {
58
- $entity: "modiEntity";
59
- };
60
- modiEntity$entity$$aggr?: ModiEntity.Aggregation & {
61
- $entity: "modiEntity";
62
- };
63
- operEntity$entity?: OperEntity.Selection & {
64
- $entity: "operEntity";
65
- };
66
- operEntity$entity$$aggr?: OperEntity.Aggregation & {
67
- $entity: "operEntity";
68
- };
69
- } & Partial<ExprOp<OpAttr | string>>;
70
- type ActionAuthIdProjection = OneOf<{
71
- id: number;
72
- }>;
73
- type RelationIdProjection = OneOf<{
74
- relationId: number;
75
- }>;
76
- type PathIdProjection = OneOf<{
77
- pathId: number;
78
- }>;
79
- export type SortAttr = {
80
- id: number;
81
- } | {
82
- $$createAt$$: number;
83
- } | {
84
- $$seq$$: number;
85
- } | {
86
- $$updateAt$$: number;
87
- } | {
88
- relationId: number;
89
- } | {
90
- relation: Relation.SortAttr;
91
- } | {
92
- pathId: number;
93
- } | {
94
- path: Path.SortAttr;
95
- } | {
96
- deActions: number;
97
- } | {
98
- [k: string]: any;
99
- } | OneOf<ExprOp<OpAttr | string>>;
100
- export type SortNode = {
101
- $attr: SortAttr;
102
- $direction?: "asc" | "desc";
103
- };
104
- export type Sorter = SortNode[];
105
- export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
106
- export type Selection<P extends Object = Projection> = SelectOperation<P>;
107
- export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
108
- export type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId" | "pathId">> & (({
109
- relationId?: never;
110
- relation?: Relation.CreateSingleOperation;
111
- } | {
112
- relationId: ForeignKey<"relation">;
113
- relation?: Relation.UpdateOperation;
114
- } | {
115
- relation?: never;
116
- relationId?: ForeignKey<"relation">;
117
- }) & ({
118
- pathId?: never;
119
- path: Path.CreateSingleOperation;
120
- } | {
121
- pathId: ForeignKey<"path">;
122
- path?: Path.UpdateOperation;
123
- } | {
124
- path?: never;
125
- pathId: ForeignKey<"path">;
126
- })) & {
127
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
128
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
129
- };
130
- export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
131
- export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
132
- export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
133
- export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId" | "pathId">> & (({
134
- relation?: Relation.CreateSingleOperation;
135
- relationId?: never;
136
- } | {
137
- relation?: Relation.UpdateOperation;
138
- relationId?: never;
139
- } | {
140
- relation?: Relation.RemoveOperation;
141
- relationId?: never;
142
- } | {
143
- relation?: never;
144
- relationId?: ForeignKey<"relation"> | null;
145
- }) & ({
146
- path?: Path.CreateSingleOperation;
147
- pathId?: never;
148
- } | {
149
- path?: Path.UpdateOperation;
150
- pathId?: never;
151
- } | {
152
- path?: Path.RemoveOperation;
153
- pathId?: never;
154
- } | {
155
- path?: never;
156
- pathId?: ForeignKey<"path">;
157
- })) & {
158
- [k: string]: any;
159
- modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
160
- operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
161
- };
162
- export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
163
- export type RemoveOperationData = {} & (({
164
- relation?: Relation.UpdateOperation | Relation.RemoveOperation;
165
- }) & ({
166
- path?: Path.UpdateOperation | Path.RemoveOperation;
167
- }));
168
- export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
169
- export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
170
- export type RelationIdSubQuery = Selection<RelationIdProjection>;
171
- export type PathIdSubQuery = Selection<PathIdProjection>;
172
- export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
173
- export type EntityDef = {
174
- Schema: Schema;
175
- OpSchema: OpSchema;
176
- Action: OakMakeAction<GenericAction> | string;
177
- Selection: Selection;
178
- Aggregation: Aggregation;
179
- Operation: Operation;
180
- Create: CreateOperation;
181
- Update: UpdateOperation;
182
- Remove: RemoveOperation;
183
- CreateSingle: CreateSingleOperation;
184
- CreateMulti: CreateMultipleOperation;
185
- };
186
- export {};
1
+ import { ForeignKey, JsonProjection } from "../../types/DataType";
2
+ import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter, SubQueryPredicateMetadata } from "../../types/Demand";
3
+ import { OneOf } from "../../types/Polyfill";
4
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "../../types/Entity";
5
+ import { GenericAction } from "../../actions/action";
6
+ import * as Relation from "../Relation/Schema";
7
+ import * as Path from "../Path/Schema";
8
+ import * as ModiEntity from "../ModiEntity/Schema";
9
+ import * as OperEntity from "../OperEntity/Schema";
10
+ type Actions = string[];
11
+ export type OpSchema = EntityShape & {
12
+ relationId?: ForeignKey<"relation"> | null;
13
+ pathId: ForeignKey<"path">;
14
+ deActions: Actions;
15
+ };
16
+ export type OpAttr = keyof OpSchema;
17
+ export type Schema = EntityShape & {
18
+ relationId?: ForeignKey<"relation"> | null;
19
+ pathId: ForeignKey<"path">;
20
+ deActions: Actions;
21
+ relation?: Relation.Schema | null;
22
+ path: Path.Schema;
23
+ modiEntity$entity?: Array<ModiEntity.Schema>;
24
+ modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
25
+ operEntity$entity?: Array<OperEntity.Schema>;
26
+ operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
27
+ } & {
28
+ [A in ExpressionKey]?: any;
29
+ };
30
+ type AttrFilter = {
31
+ id: Q_StringValue;
32
+ $$createAt$$: Q_DateValue;
33
+ $$seq$$: Q_NumberValue;
34
+ $$updateAt$$: Q_DateValue;
35
+ relationId: Q_StringValue;
36
+ relation: Relation.Filter;
37
+ pathId: Q_StringValue;
38
+ path: Path.Filter;
39
+ deActions: JsonFilter<Actions>;
40
+ modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
41
+ operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
42
+ };
43
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
44
+ export type Projection = {
45
+ "#id"?: NodeId;
46
+ [k: string]: any;
47
+ id?: number;
48
+ $$createAt$$?: number;
49
+ $$updateAt$$?: number;
50
+ $$seq$$?: number;
51
+ relationId?: number;
52
+ relation?: Relation.Projection;
53
+ pathId?: number;
54
+ path?: Path.Projection;
55
+ deActions?: number | JsonProjection<Actions>;
56
+ modiEntity$entity?: ModiEntity.Selection & {
57
+ $entity: "modiEntity";
58
+ };
59
+ modiEntity$entity$$aggr?: ModiEntity.Aggregation & {
60
+ $entity: "modiEntity";
61
+ };
62
+ operEntity$entity?: OperEntity.Selection & {
63
+ $entity: "operEntity";
64
+ };
65
+ operEntity$entity$$aggr?: OperEntity.Aggregation & {
66
+ $entity: "operEntity";
67
+ };
68
+ } & Partial<ExprOp<OpAttr | string>>;
69
+ type ActionAuthIdProjection = OneOf<{
70
+ id: number;
71
+ }>;
72
+ type RelationIdProjection = OneOf<{
73
+ relationId: number;
74
+ }>;
75
+ type PathIdProjection = OneOf<{
76
+ pathId: number;
77
+ }>;
78
+ export type SortAttr = {
79
+ id: number;
80
+ } | {
81
+ $$createAt$$: number;
82
+ } | {
83
+ $$seq$$: number;
84
+ } | {
85
+ $$updateAt$$: number;
86
+ } | {
87
+ relationId: number;
88
+ } | {
89
+ relation: Relation.SortAttr;
90
+ } | {
91
+ pathId: number;
92
+ } | {
93
+ path: Path.SortAttr;
94
+ } | {
95
+ deActions: number;
96
+ } | {
97
+ [k: string]: any;
98
+ } | OneOf<ExprOp<OpAttr | string>>;
99
+ export type SortNode = {
100
+ $attr: SortAttr;
101
+ $direction?: "asc" | "desc";
102
+ };
103
+ export type Sorter = SortNode[];
104
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
105
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
106
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
107
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId" | "pathId">> & (({
108
+ relationId?: never;
109
+ relation?: Relation.CreateSingleOperation;
110
+ } | {
111
+ relationId: ForeignKey<"relation">;
112
+ relation?: Relation.UpdateOperation;
113
+ } | {
114
+ relation?: never;
115
+ relationId?: ForeignKey<"relation">;
116
+ }) & ({
117
+ pathId?: never;
118
+ path: Path.CreateSingleOperation;
119
+ } | {
120
+ pathId: ForeignKey<"path">;
121
+ path?: Path.UpdateOperation;
122
+ } | {
123
+ path?: never;
124
+ pathId: ForeignKey<"path">;
125
+ })) & {
126
+ modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
127
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
128
+ };
129
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
130
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
131
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
132
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId" | "pathId">> & (({
133
+ relation?: Relation.CreateSingleOperation;
134
+ relationId?: never;
135
+ } | {
136
+ relation?: Relation.UpdateOperation;
137
+ relationId?: never;
138
+ } | {
139
+ relation?: Relation.RemoveOperation;
140
+ relationId?: never;
141
+ } | {
142
+ relation?: never;
143
+ relationId?: ForeignKey<"relation"> | null;
144
+ }) & ({
145
+ path?: Path.CreateSingleOperation;
146
+ pathId?: never;
147
+ } | {
148
+ path?: Path.UpdateOperation;
149
+ pathId?: never;
150
+ } | {
151
+ path?: Path.RemoveOperation;
152
+ pathId?: never;
153
+ } | {
154
+ path?: never;
155
+ pathId?: ForeignKey<"path">;
156
+ })) & {
157
+ [k: string]: any;
158
+ modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
159
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
160
+ };
161
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
162
+ export type RemoveOperationData = {} & (({
163
+ relation?: Relation.UpdateOperation | Relation.RemoveOperation;
164
+ }) & ({
165
+ path?: Path.UpdateOperation | Path.RemoveOperation;
166
+ }));
167
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
168
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
169
+ export type RelationIdSubQuery = Selection<RelationIdProjection>;
170
+ export type PathIdSubQuery = Selection<PathIdProjection>;
171
+ export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
172
+ export type EntityDef = {
173
+ Schema: Schema;
174
+ OpSchema: OpSchema;
175
+ Action: OakMakeAction<GenericAction> | string;
176
+ Selection: Selection;
177
+ Aggregation: Aggregation;
178
+ Operation: Operation;
179
+ Create: CreateOperation;
180
+ Update: UpdateOperation;
181
+ Remove: RemoveOperation;
182
+ CreateSingle: CreateSingleOperation;
183
+ CreateMulti: CreateMultipleOperation;
184
+ };
185
+ export {};