oak-domain 2.6.10 → 3.0.1
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/actions/action.d.ts +1 -1
- package/lib/actions/action.js +2 -2
- package/lib/base-app-domain/ActionAuth/Schema.d.ts +25 -21
- package/lib/base-app-domain/ActionAuth/Storage.js +6 -13
- package/lib/base-app-domain/ActionDefDict.d.ts +1 -0
- package/lib/base-app-domain/ActionDefDict.js +3 -1
- package/lib/base-app-domain/EntityDict.d.ts +2 -0
- package/lib/base-app-domain/I18n/Schema.d.ts +129 -0
- package/lib/base-app-domain/I18n/Schema.js +2 -0
- package/lib/base-app-domain/I18n/Storage.d.ts +3 -0
- package/lib/base-app-domain/I18n/Storage.js +59 -0
- package/lib/base-app-domain/Modi/Action.d.ts +1 -1
- package/lib/base-app-domain/Modi/Schema.d.ts +10 -9
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +42 -28
- package/lib/base-app-domain/ModiEntity/Storage.js +1 -1
- package/lib/base-app-domain/Oper/Schema.d.ts +15 -13
- package/lib/base-app-domain/OperEntity/Schema.d.ts +41 -27
- package/lib/base-app-domain/OperEntity/Storage.js +1 -1
- package/lib/base-app-domain/Relation/Schema.d.ts +50 -22
- package/lib/base-app-domain/Relation/Storage.js +1 -4
- package/lib/base-app-domain/Relation.d.ts +10 -0
- package/lib/base-app-domain/Relation.js +10 -0
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +67 -43
- package/lib/base-app-domain/RelationAuth/Storage.js +9 -12
- package/lib/base-app-domain/Storage.js +20 -18
- package/lib/base-app-domain/User/Action.d.ts +1 -1
- package/lib/base-app-domain/User/Schema.d.ts +20 -14
- package/lib/base-app-domain/User/Storage.js +1 -2
- package/lib/base-app-domain/UserEntityGrant/Action.d.ts +5 -0
- package/lib/base-app-domain/UserEntityGrant/Action.js +5 -0
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +53 -17
- package/lib/base-app-domain/UserEntityGrant/Storage.js +5 -7
- package/lib/base-app-domain/UserRelation/Schema.d.ts +35 -16
- package/lib/base-app-domain/UserRelation/Storage.js +21 -1
- package/lib/base-app-domain/_SubQuery.d.ts +40 -4
- package/lib/base-app-domain/index.d.ts +1 -0
- package/lib/base-app-domain/index.js +1 -0
- package/lib/checkers/index.d.ts +2 -2
- package/lib/checkers/index.js +2 -5
- package/lib/compiler/env.d.ts +3 -1
- package/lib/compiler/env.js +12 -2
- package/lib/compiler/localeBuilder.d.ts +22 -0
- package/lib/compiler/localeBuilder.js +169 -0
- package/lib/compiler/schemalBuilder.d.ts +9 -0
- package/lib/compiler/schemalBuilder.js +774 -362
- package/lib/entities/ActionAuth.d.ts +3 -2
- package/lib/entities/ActionAuth.js +21 -22
- package/lib/entities/I18n.d.ts +9 -0
- package/lib/entities/I18n.js +37 -0
- package/lib/entities/Modi.js +35 -33
- package/lib/entities/ModiEntity.js +12 -10
- package/lib/entities/Oper.js +15 -13
- package/lib/entities/OperEntity.js +12 -10
- package/lib/entities/Relation.d.ts +3 -3
- package/lib/entities/Relation.js +27 -25
- package/lib/entities/RelationAuth.d.ts +2 -5
- package/lib/entities/RelationAuth.js +27 -23
- package/lib/entities/User.js +20 -18
- package/lib/entities/UserEntityGrant.d.ts +2 -1
- package/lib/entities/UserEntityGrant.js +12 -7
- package/lib/entities/UserRelation.d.ts +3 -0
- package/lib/entities/UserRelation.js +30 -20
- package/lib/store/AsyncRowStore.d.ts +3 -0
- package/lib/store/AsyncRowStore.js +3 -0
- package/lib/store/CascadeStore.d.ts +9 -3
- package/lib/store/CascadeStore.js +268 -130
- package/lib/store/RelationAuth.d.ts +103 -0
- package/lib/store/RelationAuth.js +1492 -0
- package/lib/store/TriggerExecutor.d.ts +1 -2
- package/lib/store/TriggerExecutor.js +22 -22
- package/lib/store/actionAuth.d.ts +4 -0
- package/lib/store/actionAuth.js +40 -0
- package/lib/store/actionDef.d.ts +4 -3
- package/lib/store/actionDef.js +14 -10
- package/lib/store/checker.d.ts +2 -9
- package/lib/store/checker.js +39 -815
- package/lib/store/filter.d.ts +31 -18
- package/lib/store/filter.js +1278 -422
- package/lib/store/modi.d.ts +1 -1
- package/lib/store/modi.js +108 -9
- package/lib/store/relation.d.ts +3 -4
- package/lib/timers/oper.js +1 -1
- package/lib/timers/vaccum.js +2 -2
- package/lib/triggers/index.d.ts +2 -3
- package/lib/triggers/index.js +2 -5
- package/lib/types/Auth.d.ts +5 -0
- package/lib/types/DataType.d.ts +3 -0
- package/lib/types/Demand.d.ts +11 -0
- package/lib/types/Demand.js +2 -1
- package/lib/types/Entity.d.ts +11 -3
- package/lib/types/EntityDesc.d.ts +8 -0
- package/lib/types/EntityDesc.js +2 -0
- package/lib/types/Environment.d.ts +57 -0
- package/lib/types/Environment.js +2 -0
- package/lib/types/Exception.d.ts +6 -0
- package/lib/types/Exception.js +25 -1
- package/lib/types/Logger.d.ts +1 -0
- package/lib/types/RowStore.d.ts +6 -4
- package/lib/types/Style.d.ts +1 -1
- package/lib/types/Trigger.d.ts +4 -5
- package/lib/types/Trigger.js +11 -6
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/utils/SimpleConnector.js +1 -1
- package/lib/utils/string.d.ts +6 -0
- package/lib/utils/string.js +13 -1
- package/lib/utils/uuid.d.ts +5 -0
- package/lib/utils/uuid.js +64 -1
- package/package.json +3 -3
- package/src/entities/ActionAuth.ts +25 -33
- package/src/entities/I18n.ts +46 -0
- package/src/entities/Modi.ts +36 -36
- package/src/entities/ModiEntity.ts +14 -13
- package/src/entities/Oper.ts +17 -16
- package/src/entities/OperEntity.ts +13 -11
- package/src/entities/Relation.ts +31 -37
- package/src/entities/RelationAuth.ts +31 -37
- package/src/entities/User.ts +24 -21
- package/src/entities/UserEntityGrant.ts +16 -14
- package/src/entities/UserRelation.ts +33 -27
- package/lib/triggers/modi.d.ts +0 -5
- package/lib/triggers/modi.js +0 -72
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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
|
-
import
|
|
5
|
-
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
|
|
4
|
+
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction } from "../../types/Entity";
|
|
6
5
|
import { AppendOnlyAction } from "../../actions/action";
|
|
6
|
+
import { String } from "../../types/DataType";
|
|
7
|
+
import { EntityShape } from "../../types/Entity";
|
|
7
8
|
import * as Modi from "../Modi/Schema";
|
|
8
9
|
import * as ActionAuth from "../ActionAuth/Schema";
|
|
10
|
+
import * as I18n from "../I18n/Schema";
|
|
9
11
|
import * as Relation from "../Relation/Schema";
|
|
10
12
|
import * as RelationAuth from "../RelationAuth/Schema";
|
|
11
13
|
import * as User from "../User/Schema";
|
|
@@ -13,16 +15,17 @@ import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
|
|
13
15
|
import * as UserRelation from "../UserRelation/Schema";
|
|
14
16
|
export declare type OpSchema = EntityShape & {
|
|
15
17
|
modiId: ForeignKey<"modi">;
|
|
16
|
-
entity: "actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
18
|
+
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
17
19
|
entityId: String<64>;
|
|
18
20
|
};
|
|
19
21
|
export declare type OpAttr = keyof OpSchema;
|
|
20
22
|
export declare type Schema = EntityShape & {
|
|
21
23
|
modiId: ForeignKey<"modi">;
|
|
22
|
-
entity: "actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
24
|
+
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
23
25
|
entityId: String<64>;
|
|
24
26
|
modi: Modi.Schema;
|
|
25
27
|
actionAuth?: ActionAuth.Schema;
|
|
28
|
+
i18n?: I18n.Schema;
|
|
26
29
|
relation?: Relation.Schema;
|
|
27
30
|
relationAuth?: RelationAuth.Schema;
|
|
28
31
|
user?: User.Schema;
|
|
@@ -31,23 +34,24 @@ export declare type Schema = EntityShape & {
|
|
|
31
34
|
} & {
|
|
32
35
|
[A in ExpressionKey]?: any;
|
|
33
36
|
};
|
|
34
|
-
declare type AttrFilter
|
|
35
|
-
id: Q_StringValue
|
|
37
|
+
declare type AttrFilter = {
|
|
38
|
+
id: Q_StringValue;
|
|
36
39
|
$$createAt$$: Q_DateValue;
|
|
37
40
|
$$seq$$: Q_StringValue;
|
|
38
41
|
$$updateAt$$: Q_DateValue;
|
|
39
|
-
modiId: Q_StringValue
|
|
42
|
+
modiId: Q_StringValue;
|
|
40
43
|
modi: Modi.Filter;
|
|
41
|
-
entity:
|
|
44
|
+
entity: Q_EnumValue<"actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string>;
|
|
42
45
|
entityId: Q_StringValue;
|
|
43
46
|
actionAuth: ActionAuth.Filter;
|
|
47
|
+
i18n: I18n.Filter;
|
|
44
48
|
relation: Relation.Filter;
|
|
45
49
|
relationAuth: RelationAuth.Filter;
|
|
46
50
|
user: User.Filter;
|
|
47
51
|
userEntityGrant: UserEntityGrant.Filter;
|
|
48
52
|
userRelation: UserRelation.Filter;
|
|
49
53
|
};
|
|
50
|
-
export declare type Filter
|
|
54
|
+
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
51
55
|
export declare type Projection = {
|
|
52
56
|
"#id"?: NodeId;
|
|
53
57
|
[k: string]: any;
|
|
@@ -60,6 +64,7 @@ export declare type Projection = {
|
|
|
60
64
|
entity?: number;
|
|
61
65
|
entityId?: number;
|
|
62
66
|
actionAuth?: ActionAuth.Projection;
|
|
67
|
+
i18n?: I18n.Projection;
|
|
63
68
|
relation?: Relation.Projection;
|
|
64
69
|
relationAuth?: RelationAuth.Projection;
|
|
65
70
|
user?: User.Projection;
|
|
@@ -75,6 +80,9 @@ declare type ModiIdProjection = OneOf<{
|
|
|
75
80
|
declare type ActionAuthIdProjection = OneOf<{
|
|
76
81
|
entityId: number;
|
|
77
82
|
}>;
|
|
83
|
+
declare type I18nIdProjection = OneOf<{
|
|
84
|
+
entityId: number;
|
|
85
|
+
}>;
|
|
78
86
|
declare type RelationIdProjection = OneOf<{
|
|
79
87
|
entityId: number;
|
|
80
88
|
}>;
|
|
@@ -108,6 +116,8 @@ export declare type SortAttr = {
|
|
|
108
116
|
entityId: number;
|
|
109
117
|
} | {
|
|
110
118
|
actionAuth: ActionAuth.SortAttr;
|
|
119
|
+
} | {
|
|
120
|
+
i18n: I18n.SortAttr;
|
|
111
121
|
} | {
|
|
112
122
|
relation: Relation.SortAttr;
|
|
113
123
|
} | {
|
|
@@ -127,82 +137,85 @@ export declare type SortNode = {
|
|
|
127
137
|
};
|
|
128
138
|
export declare type Sorter = SortNode[];
|
|
129
139
|
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
130
|
-
export declare type Selection<P extends Object = Projection> =
|
|
140
|
+
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
131
141
|
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
132
142
|
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
|
|
133
143
|
modiId?: never;
|
|
134
144
|
modi: Modi.CreateSingleOperation;
|
|
135
145
|
} | {
|
|
136
|
-
modiId:
|
|
146
|
+
modiId: ForeignKey<"modi">;
|
|
137
147
|
modi?: Modi.UpdateOperation;
|
|
138
148
|
} | {
|
|
139
|
-
modiId:
|
|
149
|
+
modiId: ForeignKey<"modi">;
|
|
140
150
|
})) & ({
|
|
141
151
|
entity?: never;
|
|
142
152
|
entityId?: never;
|
|
143
153
|
actionAuth: ActionAuth.CreateSingleOperation;
|
|
144
154
|
} | {
|
|
145
155
|
entity: "actionAuth";
|
|
146
|
-
entityId:
|
|
156
|
+
entityId: ForeignKey<"ActionAuth">;
|
|
147
157
|
actionAuth: ActionAuth.UpdateOperation;
|
|
148
158
|
} | {
|
|
149
159
|
entity: "actionAuth";
|
|
150
|
-
entityId:
|
|
160
|
+
entityId: ForeignKey<"ActionAuth">;
|
|
161
|
+
} | {
|
|
162
|
+
entity: "i18n";
|
|
163
|
+
entityId: ForeignKey<"I18n">;
|
|
151
164
|
} | {
|
|
152
165
|
entity?: never;
|
|
153
166
|
entityId?: never;
|
|
154
167
|
relation: Relation.CreateSingleOperation;
|
|
155
168
|
} | {
|
|
156
169
|
entity: "relation";
|
|
157
|
-
entityId:
|
|
170
|
+
entityId: ForeignKey<"Relation">;
|
|
158
171
|
relation: Relation.UpdateOperation;
|
|
159
172
|
} | {
|
|
160
173
|
entity: "relation";
|
|
161
|
-
entityId:
|
|
174
|
+
entityId: ForeignKey<"Relation">;
|
|
162
175
|
} | {
|
|
163
176
|
entity?: never;
|
|
164
177
|
entityId?: never;
|
|
165
178
|
relationAuth: RelationAuth.CreateSingleOperation;
|
|
166
179
|
} | {
|
|
167
180
|
entity: "relationAuth";
|
|
168
|
-
entityId:
|
|
181
|
+
entityId: ForeignKey<"RelationAuth">;
|
|
169
182
|
relationAuth: RelationAuth.UpdateOperation;
|
|
170
183
|
} | {
|
|
171
184
|
entity: "relationAuth";
|
|
172
|
-
entityId:
|
|
185
|
+
entityId: ForeignKey<"RelationAuth">;
|
|
173
186
|
} | {
|
|
174
187
|
entity?: never;
|
|
175
188
|
entityId?: never;
|
|
176
189
|
user: User.CreateSingleOperation;
|
|
177
190
|
} | {
|
|
178
191
|
entity: "user";
|
|
179
|
-
entityId:
|
|
192
|
+
entityId: ForeignKey<"User">;
|
|
180
193
|
user: User.UpdateOperation;
|
|
181
194
|
} | {
|
|
182
195
|
entity: "user";
|
|
183
|
-
entityId:
|
|
196
|
+
entityId: ForeignKey<"User">;
|
|
184
197
|
} | {
|
|
185
198
|
entity?: never;
|
|
186
199
|
entityId?: never;
|
|
187
200
|
userEntityGrant: UserEntityGrant.CreateSingleOperation;
|
|
188
201
|
} | {
|
|
189
202
|
entity: "userEntityGrant";
|
|
190
|
-
entityId:
|
|
203
|
+
entityId: ForeignKey<"UserEntityGrant">;
|
|
191
204
|
userEntityGrant: UserEntityGrant.UpdateOperation;
|
|
192
205
|
} | {
|
|
193
206
|
entity: "userEntityGrant";
|
|
194
|
-
entityId:
|
|
207
|
+
entityId: ForeignKey<"UserEntityGrant">;
|
|
195
208
|
} | {
|
|
196
209
|
entity?: never;
|
|
197
210
|
entityId?: never;
|
|
198
211
|
userRelation: UserRelation.CreateSingleOperation;
|
|
199
212
|
} | {
|
|
200
213
|
entity: "userRelation";
|
|
201
|
-
entityId:
|
|
214
|
+
entityId: ForeignKey<"UserRelation">;
|
|
202
215
|
userRelation: UserRelation.UpdateOperation;
|
|
203
216
|
} | {
|
|
204
217
|
entity: "userRelation";
|
|
205
|
-
entityId:
|
|
218
|
+
entityId: ForeignKey<"UserRelation">;
|
|
206
219
|
} | {
|
|
207
220
|
entity?: string;
|
|
208
221
|
entityId?: string;
|
|
@@ -222,7 +235,7 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
222
235
|
modiId?: never;
|
|
223
236
|
} | {
|
|
224
237
|
modi?: never;
|
|
225
|
-
modiId?:
|
|
238
|
+
modiId?: ForeignKey<"modi"> | null;
|
|
226
239
|
})) & ({
|
|
227
240
|
actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
|
228
241
|
entityId?: never;
|
|
@@ -248,8 +261,8 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
248
261
|
entityId?: never;
|
|
249
262
|
entity?: never;
|
|
250
263
|
} | {
|
|
251
|
-
entity?: ("actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
|
|
252
|
-
entityId?:
|
|
264
|
+
entity?: ("actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
|
|
265
|
+
entityId?: ForeignKey<"ActionAuth" | "I18n" | "Relation" | "RelationAuth" | "User" | "UserEntityGrant" | "UserRelation"> | null;
|
|
253
266
|
}) & {
|
|
254
267
|
[k: string]: any;
|
|
255
268
|
};
|
|
@@ -275,6 +288,7 @@ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData
|
|
|
275
288
|
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
276
289
|
export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
|
|
277
290
|
export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
|
291
|
+
export declare type I18nIdSubQuery = Selection<I18nIdProjection>;
|
|
278
292
|
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
|
279
293
|
export declare type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
|
|
280
294
|
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
|
@@ -15,7 +15,7 @@ exports.desc = {
|
|
|
15
15
|
params: {
|
|
16
16
|
length: 32
|
|
17
17
|
},
|
|
18
|
-
ref: ["actionAuth", "relation", "relationAuth", "user", "userEntityGrant", "userRelation"]
|
|
18
|
+
ref: ["actionAuth", "i18n", "relation", "relationAuth", "user", "userEntityGrant", "userRelation"]
|
|
19
19
|
},
|
|
20
20
|
entityId: {
|
|
21
21
|
notNull: true,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "../../types/Demand";
|
|
1
|
+
import { ForeignKey } from "../../types/DataType";
|
|
2
|
+
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
|
|
3
3
|
import { OneOf } from "../../types/Polyfill";
|
|
4
|
-
import
|
|
5
|
-
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "../../types/Entity";
|
|
4
|
+
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
|
|
6
5
|
import { AppendOnlyAction } from "../../actions/action";
|
|
6
|
+
import { String } from "../../types/DataType";
|
|
7
|
+
import { EntityShape } from "../../types/Entity";
|
|
7
8
|
import * as User from "../User/Schema";
|
|
8
9
|
import * as OperEntity from "../OperEntity/Schema";
|
|
9
10
|
export declare type OpSchema = EntityShape & {
|
|
@@ -29,7 +30,7 @@ export declare type Schema = EntityShape & {
|
|
|
29
30
|
[A in ExpressionKey]?: any;
|
|
30
31
|
};
|
|
31
32
|
declare type AttrFilter = {
|
|
32
|
-
id: Q_StringValue
|
|
33
|
+
id: Q_StringValue;
|
|
33
34
|
$$createAt$$: Q_DateValue;
|
|
34
35
|
$$seq$$: Q_StringValue;
|
|
35
36
|
$$updateAt$$: Q_DateValue;
|
|
@@ -37,9 +38,10 @@ declare type AttrFilter = {
|
|
|
37
38
|
data: Object;
|
|
38
39
|
filter: Object;
|
|
39
40
|
extra: Object;
|
|
40
|
-
operatorId: Q_StringValue
|
|
41
|
+
operatorId: Q_StringValue;
|
|
41
42
|
operator: User.Filter;
|
|
42
43
|
targetEntity: Q_StringValue;
|
|
44
|
+
operEntity$oper: OperEntity.Filter & SubQueryPredicateMetadata;
|
|
43
45
|
};
|
|
44
46
|
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
45
47
|
export declare type Projection = {
|
|
@@ -50,9 +52,9 @@ export declare type Projection = {
|
|
|
50
52
|
$$updateAt$$?: number;
|
|
51
53
|
$$seq$$?: number;
|
|
52
54
|
action?: number;
|
|
53
|
-
data?: number;
|
|
54
|
-
filter?: number;
|
|
55
|
-
extra?: number;
|
|
55
|
+
data?: number | Object;
|
|
56
|
+
filter?: number | Object;
|
|
57
|
+
extra?: number | Object;
|
|
56
58
|
operatorId?: number;
|
|
57
59
|
operator?: User.Projection;
|
|
58
60
|
targetEntity?: number;
|
|
@@ -94,16 +96,16 @@ export declare type SortNode = {
|
|
|
94
96
|
};
|
|
95
97
|
export declare type Sorter = SortNode[];
|
|
96
98
|
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
97
|
-
export declare type Selection<P extends Object = Projection> =
|
|
99
|
+
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
98
100
|
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
99
101
|
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
|
|
100
102
|
operatorId?: never;
|
|
101
103
|
operator?: User.CreateSingleOperation;
|
|
102
104
|
} | {
|
|
103
|
-
operatorId:
|
|
105
|
+
operatorId: ForeignKey<"operator">;
|
|
104
106
|
operator?: User.UpdateOperation;
|
|
105
107
|
} | {
|
|
106
|
-
operatorId?:
|
|
108
|
+
operatorId?: ForeignKey<"operator">;
|
|
107
109
|
})) & {
|
|
108
110
|
operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
|
|
109
111
|
};
|
|
@@ -121,7 +123,7 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operato
|
|
|
121
123
|
operatorId?: never;
|
|
122
124
|
} | {
|
|
123
125
|
operator?: never;
|
|
124
|
-
operatorId?:
|
|
126
|
+
operatorId?: ForeignKey<"operator"> | null;
|
|
125
127
|
})) & {
|
|
126
128
|
[k: string]: any;
|
|
127
129
|
operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { 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
|
-
import
|
|
5
|
-
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "../../types/Entity";
|
|
4
|
+
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction } from "../../types/Entity";
|
|
6
5
|
import { AppendOnlyAction } from "../../actions/action";
|
|
6
|
+
import { String } from "../../types/DataType";
|
|
7
|
+
import { EntityShape } from "../../types/Entity";
|
|
7
8
|
import * as Oper from "../Oper/Schema";
|
|
8
9
|
import * as ActionAuth from "../ActionAuth/Schema";
|
|
10
|
+
import * as I18n from "../I18n/Schema";
|
|
9
11
|
import * as Relation from "../Relation/Schema";
|
|
10
12
|
import * as RelationAuth from "../RelationAuth/Schema";
|
|
11
13
|
import * as User from "../User/Schema";
|
|
@@ -13,16 +15,17 @@ import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
|
|
13
15
|
import * as UserRelation from "../UserRelation/Schema";
|
|
14
16
|
export declare type OpSchema = EntityShape & {
|
|
15
17
|
operId: ForeignKey<"oper">;
|
|
16
|
-
entity: "actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
18
|
+
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
17
19
|
entityId: String<64>;
|
|
18
20
|
};
|
|
19
21
|
export declare type OpAttr = keyof OpSchema;
|
|
20
22
|
export declare type Schema = EntityShape & {
|
|
21
23
|
operId: ForeignKey<"oper">;
|
|
22
|
-
entity: "actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
24
|
+
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
23
25
|
entityId: String<64>;
|
|
24
26
|
oper: Oper.Schema;
|
|
25
27
|
actionAuth?: ActionAuth.Schema;
|
|
28
|
+
i18n?: I18n.Schema;
|
|
26
29
|
relation?: Relation.Schema;
|
|
27
30
|
relationAuth?: RelationAuth.Schema;
|
|
28
31
|
user?: User.Schema;
|
|
@@ -31,23 +34,24 @@ export declare type Schema = EntityShape & {
|
|
|
31
34
|
} & {
|
|
32
35
|
[A in ExpressionKey]?: any;
|
|
33
36
|
};
|
|
34
|
-
declare type AttrFilter
|
|
35
|
-
id: Q_StringValue
|
|
37
|
+
declare type AttrFilter = {
|
|
38
|
+
id: Q_StringValue;
|
|
36
39
|
$$createAt$$: Q_DateValue;
|
|
37
40
|
$$seq$$: Q_StringValue;
|
|
38
41
|
$$updateAt$$: Q_DateValue;
|
|
39
|
-
operId: Q_StringValue
|
|
42
|
+
operId: Q_StringValue;
|
|
40
43
|
oper: Oper.Filter;
|
|
41
|
-
entity:
|
|
44
|
+
entity: Q_EnumValue<"actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string>;
|
|
42
45
|
entityId: Q_StringValue;
|
|
43
46
|
actionAuth: ActionAuth.Filter;
|
|
47
|
+
i18n: I18n.Filter;
|
|
44
48
|
relation: Relation.Filter;
|
|
45
49
|
relationAuth: RelationAuth.Filter;
|
|
46
50
|
user: User.Filter;
|
|
47
51
|
userEntityGrant: UserEntityGrant.Filter;
|
|
48
52
|
userRelation: UserRelation.Filter;
|
|
49
53
|
};
|
|
50
|
-
export declare type Filter
|
|
54
|
+
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
51
55
|
export declare type Projection = {
|
|
52
56
|
"#id"?: NodeId;
|
|
53
57
|
[k: string]: any;
|
|
@@ -60,6 +64,7 @@ export declare type Projection = {
|
|
|
60
64
|
entity?: number;
|
|
61
65
|
entityId?: number;
|
|
62
66
|
actionAuth?: ActionAuth.Projection;
|
|
67
|
+
i18n?: I18n.Projection;
|
|
63
68
|
relation?: Relation.Projection;
|
|
64
69
|
relationAuth?: RelationAuth.Projection;
|
|
65
70
|
user?: User.Projection;
|
|
@@ -75,6 +80,9 @@ declare type OperIdProjection = OneOf<{
|
|
|
75
80
|
declare type ActionAuthIdProjection = OneOf<{
|
|
76
81
|
entityId: number;
|
|
77
82
|
}>;
|
|
83
|
+
declare type I18nIdProjection = OneOf<{
|
|
84
|
+
entityId: number;
|
|
85
|
+
}>;
|
|
78
86
|
declare type RelationIdProjection = OneOf<{
|
|
79
87
|
entityId: number;
|
|
80
88
|
}>;
|
|
@@ -108,6 +116,8 @@ export declare type SortAttr = {
|
|
|
108
116
|
entityId: number;
|
|
109
117
|
} | {
|
|
110
118
|
actionAuth: ActionAuth.SortAttr;
|
|
119
|
+
} | {
|
|
120
|
+
i18n: I18n.SortAttr;
|
|
111
121
|
} | {
|
|
112
122
|
relation: Relation.SortAttr;
|
|
113
123
|
} | {
|
|
@@ -127,79 +137,82 @@ export declare type SortNode = {
|
|
|
127
137
|
};
|
|
128
138
|
export declare type Sorter = SortNode[];
|
|
129
139
|
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
130
|
-
export declare type Selection<P extends Object = Projection> =
|
|
140
|
+
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
131
141
|
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
132
142
|
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
|
|
133
143
|
operId?: never;
|
|
134
144
|
oper: Oper.CreateSingleOperation;
|
|
135
145
|
} | {
|
|
136
|
-
operId:
|
|
146
|
+
operId: ForeignKey<"oper">;
|
|
137
147
|
})) & ({
|
|
138
148
|
entity?: never;
|
|
139
149
|
entityId?: never;
|
|
140
150
|
actionAuth: ActionAuth.CreateSingleOperation;
|
|
141
151
|
} | {
|
|
142
152
|
entity: "actionAuth";
|
|
143
|
-
entityId:
|
|
153
|
+
entityId: ForeignKey<"ActionAuth">;
|
|
144
154
|
actionAuth: ActionAuth.UpdateOperation;
|
|
145
155
|
} | {
|
|
146
156
|
entity: "actionAuth";
|
|
147
|
-
entityId:
|
|
157
|
+
entityId: ForeignKey<"ActionAuth">;
|
|
158
|
+
} | {
|
|
159
|
+
entity: "i18n";
|
|
160
|
+
entityId: ForeignKey<"I18n">;
|
|
148
161
|
} | {
|
|
149
162
|
entity?: never;
|
|
150
163
|
entityId?: never;
|
|
151
164
|
relation: Relation.CreateSingleOperation;
|
|
152
165
|
} | {
|
|
153
166
|
entity: "relation";
|
|
154
|
-
entityId:
|
|
167
|
+
entityId: ForeignKey<"Relation">;
|
|
155
168
|
relation: Relation.UpdateOperation;
|
|
156
169
|
} | {
|
|
157
170
|
entity: "relation";
|
|
158
|
-
entityId:
|
|
171
|
+
entityId: ForeignKey<"Relation">;
|
|
159
172
|
} | {
|
|
160
173
|
entity?: never;
|
|
161
174
|
entityId?: never;
|
|
162
175
|
relationAuth: RelationAuth.CreateSingleOperation;
|
|
163
176
|
} | {
|
|
164
177
|
entity: "relationAuth";
|
|
165
|
-
entityId:
|
|
178
|
+
entityId: ForeignKey<"RelationAuth">;
|
|
166
179
|
relationAuth: RelationAuth.UpdateOperation;
|
|
167
180
|
} | {
|
|
168
181
|
entity: "relationAuth";
|
|
169
|
-
entityId:
|
|
182
|
+
entityId: ForeignKey<"RelationAuth">;
|
|
170
183
|
} | {
|
|
171
184
|
entity?: never;
|
|
172
185
|
entityId?: never;
|
|
173
186
|
user: User.CreateSingleOperation;
|
|
174
187
|
} | {
|
|
175
188
|
entity: "user";
|
|
176
|
-
entityId:
|
|
189
|
+
entityId: ForeignKey<"User">;
|
|
177
190
|
user: User.UpdateOperation;
|
|
178
191
|
} | {
|
|
179
192
|
entity: "user";
|
|
180
|
-
entityId:
|
|
193
|
+
entityId: ForeignKey<"User">;
|
|
181
194
|
} | {
|
|
182
195
|
entity?: never;
|
|
183
196
|
entityId?: never;
|
|
184
197
|
userEntityGrant: UserEntityGrant.CreateSingleOperation;
|
|
185
198
|
} | {
|
|
186
199
|
entity: "userEntityGrant";
|
|
187
|
-
entityId:
|
|
200
|
+
entityId: ForeignKey<"UserEntityGrant">;
|
|
188
201
|
userEntityGrant: UserEntityGrant.UpdateOperation;
|
|
189
202
|
} | {
|
|
190
203
|
entity: "userEntityGrant";
|
|
191
|
-
entityId:
|
|
204
|
+
entityId: ForeignKey<"UserEntityGrant">;
|
|
192
205
|
} | {
|
|
193
206
|
entity?: never;
|
|
194
207
|
entityId?: never;
|
|
195
208
|
userRelation: UserRelation.CreateSingleOperation;
|
|
196
209
|
} | {
|
|
197
210
|
entity: "userRelation";
|
|
198
|
-
entityId:
|
|
211
|
+
entityId: ForeignKey<"UserRelation">;
|
|
199
212
|
userRelation: UserRelation.UpdateOperation;
|
|
200
213
|
} | {
|
|
201
214
|
entity: "userRelation";
|
|
202
|
-
entityId:
|
|
215
|
+
entityId: ForeignKey<"UserRelation">;
|
|
203
216
|
} | {
|
|
204
217
|
entity?: string;
|
|
205
218
|
entityId?: string;
|
|
@@ -213,7 +226,7 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
213
226
|
operId?: never;
|
|
214
227
|
} | {
|
|
215
228
|
oper?: never;
|
|
216
|
-
operId?:
|
|
229
|
+
operId?: ForeignKey<"oper"> | null;
|
|
217
230
|
})) & ({
|
|
218
231
|
actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
|
219
232
|
entityId?: never;
|
|
@@ -239,8 +252,8 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
239
252
|
entityId?: never;
|
|
240
253
|
entity?: never;
|
|
241
254
|
} | {
|
|
242
|
-
entity?: ("actionAuth" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
|
|
243
|
-
entityId?:
|
|
255
|
+
entity?: ("actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
|
|
256
|
+
entityId?: ForeignKey<"ActionAuth" | "I18n" | "Relation" | "RelationAuth" | "User" | "UserEntityGrant" | "UserRelation"> | null;
|
|
244
257
|
}) & {
|
|
245
258
|
[k: string]: any;
|
|
246
259
|
};
|
|
@@ -264,6 +277,7 @@ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData
|
|
|
264
277
|
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
265
278
|
export declare type OperIdSubQuery = Selection<OperIdProjection>;
|
|
266
279
|
export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
|
280
|
+
export declare type I18nIdSubQuery = Selection<I18nIdProjection>;
|
|
267
281
|
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
|
268
282
|
export declare type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
|
|
269
283
|
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
|
@@ -15,7 +15,7 @@ exports.desc = {
|
|
|
15
15
|
params: {
|
|
16
16
|
length: 32
|
|
17
17
|
},
|
|
18
|
-
ref: ["actionAuth", "relation", "relationAuth", "user", "userEntityGrant", "userRelation"]
|
|
18
|
+
ref: ["actionAuth", "i18n", "relation", "relationAuth", "user", "userEntityGrant", "userRelation"]
|
|
19
19
|
},
|
|
20
20
|
entityId: {
|
|
21
21
|
notNull: true,
|