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