oak-domain 3.0.2 → 3.0.4
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 +8 -8
- package/lib/actions/action.js +2 -2
- package/lib/actions/relation.d.ts +1 -1
- package/lib/actions/relation.js +9 -22
- package/lib/base-app-domain/ActionAuth/Schema.d.ts +68 -42
- package/lib/base-app-domain/ActionAuth/Storage.js +12 -15
- package/lib/base-app-domain/ActionDefDict.d.ts +2 -3
- package/lib/base-app-domain/ActionDefDict.js +3 -5
- package/lib/base-app-domain/EntityDict.d.ts +5 -1
- package/lib/base-app-domain/I18n/Schema.d.ts +24 -24
- package/lib/base-app-domain/I18n/Storage.js +5 -5
- package/lib/base-app-domain/Modi/Action.d.ts +4 -4
- package/lib/base-app-domain/Modi/Action.js +3 -3
- package/lib/base-app-domain/Modi/Schema.d.ts +24 -24
- package/lib/base-app-domain/Modi/Storage.js +3 -3
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +128 -55
- package/lib/base-app-domain/ModiEntity/Storage.js +2 -2
- package/lib/base-app-domain/Oper/Schema.d.ts +30 -29
- package/lib/base-app-domain/Oper/Storage.js +1 -1
- package/lib/base-app-domain/OperEntity/Schema.d.ts +126 -53
- package/lib/base-app-domain/OperEntity/Storage.js +2 -2
- package/lib/base-app-domain/Path/Schema.d.ts +149 -0
- package/lib/base-app-domain/Path/Schema.js +2 -0
- package/lib/base-app-domain/Path/Storage.d.ts +3 -0
- package/lib/base-app-domain/Path/Storage.js +54 -0
- package/lib/base-app-domain/Relation/Schema.d.ts +34 -34
- package/lib/base-app-domain/Relation/Storage.js +6 -6
- package/lib/base-app-domain/Relation.d.ts +0 -8
- package/lib/base-app-domain/Relation.js +1 -7
- package/lib/base-app-domain/RelationAuth/Schema.d.ts +74 -40
- package/lib/base-app-domain/RelationAuth/Storage.js +9 -11
- package/lib/base-app-domain/Storage.js +20 -16
- package/lib/base-app-domain/User/Action.d.ts +4 -4
- package/lib/base-app-domain/User/Action.js +3 -3
- package/lib/base-app-domain/User/Schema.d.ts +40 -27
- package/lib/base-app-domain/User/Storage.js +1 -1
- package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +264 -0
- package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -0
- package/lib/base-app-domain/UserEntityClaim/Storage.d.ts +3 -0
- package/lib/base-app-domain/UserEntityClaim/Storage.js +37 -0
- package/lib/base-app-domain/UserEntityGrant/Action.d.ts +2 -2
- package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +55 -81
- package/lib/base-app-domain/UserEntityGrant/Storage.js +7 -11
- package/lib/base-app-domain/UserRelation/Schema.d.ts +50 -36
- package/lib/base-app-domain/UserRelation/Storage.js +7 -7
- package/lib/base-app-domain/_SubQuery.d.ts +45 -15
- package/lib/base-app-domain/index.js +1 -1
- package/lib/checkers/index.js +6 -7
- package/lib/compiler/env.js +16 -18
- package/lib/compiler/localeBuilder.js +83 -79
- package/lib/compiler/schemalBuilder.d.ts +16 -0
- package/lib/compiler/schemalBuilder.js +1160 -1378
- package/lib/entities/ActionAuth.d.ts +3 -5
- package/lib/entities/ActionAuth.js +9 -7
- package/lib/entities/I18n.js +1 -1
- package/lib/entities/Modi.js +2 -2
- package/lib/entities/ModiEntity.js +1 -1
- package/lib/entities/Oper.js +1 -1
- package/lib/entities/OperEntity.js +1 -1
- package/lib/entities/Path.d.ts +8 -0
- package/lib/entities/Path.js +35 -0
- package/lib/entities/Relation.js +1 -1
- package/lib/entities/RelationAuth.d.ts +2 -2
- package/lib/entities/RelationAuth.js +1 -1
- package/lib/entities/User.js +2 -2
- package/lib/entities/UserEntityClaim.d.ts +13 -0
- package/lib/entities/UserEntityClaim.js +17 -0
- package/lib/entities/UserEntityGrant.d.ts +5 -4
- package/lib/entities/UserEntityGrant.js +4 -7
- package/lib/entities/UserRelation.js +1 -1
- package/lib/index.d.ts +23 -0
- package/lib/index.js +37 -0
- package/lib/store/AsyncRowStore.d.ts +2 -1
- package/lib/store/AsyncRowStore.js +75 -149
- package/lib/store/CascadeStore.js +968 -1341
- package/lib/store/RelationAuth.d.ts +9 -16
- package/lib/store/RelationAuth.js +752 -910
- package/lib/store/SyncRowStore.d.ts +1 -1
- package/lib/store/SyncRowStore.js +27 -26
- package/lib/store/TriggerExecutor.d.ts +17 -10
- package/lib/store/TriggerExecutor.js +350 -423
- package/lib/store/actionAuth.js +13 -28
- package/lib/store/actionDef.js +142 -215
- package/lib/store/checker.js +225 -361
- package/lib/store/filter.d.ts +2 -3
- package/lib/store/filter.js +451 -589
- package/lib/store/modi.js +116 -177
- package/lib/store/relation.js +17 -17
- package/lib/timers/oper.d.ts +1 -1
- package/lib/timers/oper.js +44 -47
- package/lib/timers/vaccum.d.ts +2 -2
- package/lib/timers/vaccum.js +100 -165
- package/lib/triggers/index.js +1 -1
- package/lib/types/Action.d.ts +7 -7
- package/lib/types/AppLoader.d.ts +8 -2
- package/lib/types/AppLoader.js +4 -4
- package/lib/types/Auth.d.ts +15 -19
- package/lib/types/Connector.d.ts +19 -14
- package/lib/types/Connector.js +0 -7
- package/lib/types/DataType.d.ts +19 -18
- package/lib/types/DataType.js +1 -1
- package/lib/types/Demand.d.ts +25 -25
- package/lib/types/Endpoint.d.ts +1 -1
- package/lib/types/Entity.d.ts +62 -53
- package/lib/types/Entity.js +4 -3
- package/lib/types/EntityDesc.d.ts +2 -1
- package/lib/types/Environment.d.ts +4 -4
- package/lib/types/Exception.d.ts +34 -2
- package/lib/types/Exception.js +214 -197
- package/lib/types/Expression.d.ts +14 -14
- package/lib/types/Expression.js +54 -87
- package/lib/types/Geo.d.ts +6 -6
- package/lib/types/Locale.d.ts +5 -5
- package/lib/types/Polyfill.d.ts +9 -9
- package/lib/types/Port.d.ts +4 -4
- package/lib/types/RowStore.d.ts +3 -3
- package/lib/types/RowStore.js +18 -19
- package/lib/types/Storage.d.ts +5 -4
- package/lib/types/Style.d.ts +2 -2
- package/lib/types/Timer.d.ts +3 -3
- package/lib/types/Trigger.d.ts +30 -14
- package/lib/types/Trigger.js +6 -2
- package/lib/types/Watcher.d.ts +2 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -1
- package/lib/types/schema/DataTypes.d.ts +7 -7
- package/lib/utils/SimpleConnector.d.ts +26 -10
- package/lib/utils/SimpleConnector.js +167 -141
- package/lib/utils/assert.js +2 -2
- package/lib/utils/concurrent.d.ts +1 -1
- package/lib/utils/concurrent.js +31 -57
- package/lib/utils/date.js +2 -2
- package/lib/utils/geo.js +8 -8
- package/lib/utils/lodash.d.ts +3 -1
- package/lib/utils/lodash.js +21 -34
- package/lib/utils/mask.js +12 -13
- package/lib/utils/money.d.ts +1 -1
- package/lib/utils/money.js +22 -11
- package/lib/utils/projection.d.ts +4 -0
- package/lib/utils/projection.js +15 -0
- package/lib/utils/random/random.js +11 -16
- package/lib/utils/random/random.mp.js +7 -18
- package/lib/utils/random/random.web.js +6 -12
- package/lib/utils/string.d.ts +4 -4
- package/lib/utils/string.js +19 -32
- package/lib/utils/url.js +5 -4
- package/lib/utils/uuid.d.ts +1 -1
- package/lib/utils/uuid.js +46 -85
- package/lib/utils/validator.d.ts +4 -3
- package/lib/utils/validator.js +35 -32
- package/lib/utils/version.js +6 -6
- package/package.json +7 -7
- package/src/entities/ActionAuth.ts +10 -10
- package/src/entities/Path.ts +43 -0
- package/src/entities/RelationAuth.ts +2 -1
- package/src/entities/UserEntityClaim.ts +30 -0
- package/src/entities/UserEntityGrant.ts +9 -12
|
@@ -8,51 +8,57 @@ import { EntityShape } from "../../types/Entity";
|
|
|
8
8
|
import * as Oper from "../Oper/Schema";
|
|
9
9
|
import * as ActionAuth from "../ActionAuth/Schema";
|
|
10
10
|
import * as I18n from "../I18n/Schema";
|
|
11
|
+
import * as Path from "../Path/Schema";
|
|
11
12
|
import * as Relation from "../Relation/Schema";
|
|
12
13
|
import * as RelationAuth from "../RelationAuth/Schema";
|
|
13
14
|
import * as User from "../User/Schema";
|
|
15
|
+
import * as UserEntityClaim from "../UserEntityClaim/Schema";
|
|
14
16
|
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
|
15
17
|
import * as UserRelation from "../UserRelation/Schema";
|
|
16
|
-
export
|
|
18
|
+
export type OpSchema = EntityShape & {
|
|
17
19
|
operId: ForeignKey<"oper">;
|
|
18
|
-
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
20
|
+
entity: "actionAuth" | "i18n" | "path" | "relation" | "relationAuth" | "user" | "userEntityClaim" | "userEntityGrant" | "userRelation" | string;
|
|
19
21
|
entityId: String<64>;
|
|
20
22
|
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
+
export type OpAttr = keyof OpSchema;
|
|
24
|
+
export type Schema = EntityShape & {
|
|
23
25
|
operId: ForeignKey<"oper">;
|
|
24
|
-
entity: "actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string;
|
|
26
|
+
entity: "actionAuth" | "i18n" | "path" | "relation" | "relationAuth" | "user" | "userEntityClaim" | "userEntityGrant" | "userRelation" | string;
|
|
25
27
|
entityId: String<64>;
|
|
26
28
|
oper: Oper.Schema;
|
|
27
29
|
actionAuth?: ActionAuth.Schema;
|
|
28
30
|
i18n?: I18n.Schema;
|
|
31
|
+
path?: Path.Schema;
|
|
29
32
|
relation?: Relation.Schema;
|
|
30
33
|
relationAuth?: RelationAuth.Schema;
|
|
31
34
|
user?: User.Schema;
|
|
35
|
+
userEntityClaim?: UserEntityClaim.Schema;
|
|
32
36
|
userEntityGrant?: UserEntityGrant.Schema;
|
|
33
37
|
userRelation?: UserRelation.Schema;
|
|
34
38
|
} & {
|
|
35
39
|
[A in ExpressionKey]?: any;
|
|
36
40
|
};
|
|
37
|
-
|
|
41
|
+
type AttrFilter = {
|
|
38
42
|
id: Q_StringValue;
|
|
39
43
|
$$createAt$$: Q_DateValue;
|
|
40
44
|
$$seq$$: Q_StringValue;
|
|
41
45
|
$$updateAt$$: Q_DateValue;
|
|
42
46
|
operId: Q_StringValue;
|
|
43
47
|
oper: Oper.Filter;
|
|
44
|
-
entity: Q_EnumValue<"actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string>;
|
|
48
|
+
entity: Q_EnumValue<"actionAuth" | "i18n" | "path" | "relation" | "relationAuth" | "user" | "userEntityClaim" | "userEntityGrant" | "userRelation" | string>;
|
|
45
49
|
entityId: Q_StringValue;
|
|
46
50
|
actionAuth: ActionAuth.Filter;
|
|
47
51
|
i18n: I18n.Filter;
|
|
52
|
+
path: Path.Filter;
|
|
48
53
|
relation: Relation.Filter;
|
|
49
54
|
relationAuth: RelationAuth.Filter;
|
|
50
55
|
user: User.Filter;
|
|
56
|
+
userEntityClaim: UserEntityClaim.Filter;
|
|
51
57
|
userEntityGrant: UserEntityGrant.Filter;
|
|
52
58
|
userRelation: UserRelation.Filter;
|
|
53
59
|
};
|
|
54
|
-
export
|
|
55
|
-
export
|
|
60
|
+
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
61
|
+
export type Projection = {
|
|
56
62
|
"#id"?: NodeId;
|
|
57
63
|
[k: string]: any;
|
|
58
64
|
id?: number;
|
|
@@ -65,40 +71,48 @@ export declare type Projection = {
|
|
|
65
71
|
entityId?: number;
|
|
66
72
|
actionAuth?: ActionAuth.Projection;
|
|
67
73
|
i18n?: I18n.Projection;
|
|
74
|
+
path?: Path.Projection;
|
|
68
75
|
relation?: Relation.Projection;
|
|
69
76
|
relationAuth?: RelationAuth.Projection;
|
|
70
77
|
user?: User.Projection;
|
|
78
|
+
userEntityClaim?: UserEntityClaim.Projection;
|
|
71
79
|
userEntityGrant?: UserEntityGrant.Projection;
|
|
72
80
|
userRelation?: UserRelation.Projection;
|
|
73
81
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
74
|
-
|
|
82
|
+
type OperEntityIdProjection = OneOf<{
|
|
75
83
|
id: number;
|
|
76
84
|
}>;
|
|
77
|
-
|
|
85
|
+
type OperIdProjection = OneOf<{
|
|
78
86
|
operId: number;
|
|
79
87
|
}>;
|
|
80
|
-
|
|
88
|
+
type ActionAuthIdProjection = OneOf<{
|
|
81
89
|
entityId: number;
|
|
82
90
|
}>;
|
|
83
|
-
|
|
91
|
+
type I18nIdProjection = OneOf<{
|
|
84
92
|
entityId: number;
|
|
85
93
|
}>;
|
|
86
|
-
|
|
94
|
+
type PathIdProjection = OneOf<{
|
|
87
95
|
entityId: number;
|
|
88
96
|
}>;
|
|
89
|
-
|
|
97
|
+
type RelationIdProjection = OneOf<{
|
|
90
98
|
entityId: number;
|
|
91
99
|
}>;
|
|
92
|
-
|
|
100
|
+
type RelationAuthIdProjection = OneOf<{
|
|
93
101
|
entityId: number;
|
|
94
102
|
}>;
|
|
95
|
-
|
|
103
|
+
type UserIdProjection = OneOf<{
|
|
96
104
|
entityId: number;
|
|
97
105
|
}>;
|
|
98
|
-
|
|
106
|
+
type UserEntityClaimIdProjection = OneOf<{
|
|
99
107
|
entityId: number;
|
|
100
108
|
}>;
|
|
101
|
-
|
|
109
|
+
type UserEntityGrantIdProjection = OneOf<{
|
|
110
|
+
entityId: number;
|
|
111
|
+
}>;
|
|
112
|
+
type UserRelationIdProjection = OneOf<{
|
|
113
|
+
entityId: number;
|
|
114
|
+
}>;
|
|
115
|
+
export type SortAttr = {
|
|
102
116
|
id: number;
|
|
103
117
|
} | {
|
|
104
118
|
$$createAt$$: number;
|
|
@@ -118,12 +132,16 @@ export declare type SortAttr = {
|
|
|
118
132
|
actionAuth: ActionAuth.SortAttr;
|
|
119
133
|
} | {
|
|
120
134
|
i18n: I18n.SortAttr;
|
|
135
|
+
} | {
|
|
136
|
+
path: Path.SortAttr;
|
|
121
137
|
} | {
|
|
122
138
|
relation: Relation.SortAttr;
|
|
123
139
|
} | {
|
|
124
140
|
relationAuth: RelationAuth.SortAttr;
|
|
125
141
|
} | {
|
|
126
142
|
user: User.SortAttr;
|
|
143
|
+
} | {
|
|
144
|
+
userEntityClaim: UserEntityClaim.SortAttr;
|
|
127
145
|
} | {
|
|
128
146
|
userEntityGrant: UserEntityGrant.SortAttr;
|
|
129
147
|
} | {
|
|
@@ -131,18 +149,19 @@ export declare type SortAttr = {
|
|
|
131
149
|
} | {
|
|
132
150
|
[k: string]: any;
|
|
133
151
|
} | OneOf<ExprOp<OpAttr | string>>;
|
|
134
|
-
export
|
|
152
|
+
export type SortNode = {
|
|
135
153
|
$attr: SortAttr;
|
|
136
154
|
$direction?: "asc" | "desc";
|
|
137
155
|
};
|
|
138
|
-
export
|
|
139
|
-
export
|
|
140
|
-
export
|
|
141
|
-
export
|
|
142
|
-
export
|
|
156
|
+
export type Sorter = SortNode[];
|
|
157
|
+
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
158
|
+
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
159
|
+
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
160
|
+
export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
|
|
143
161
|
operId?: never;
|
|
144
162
|
oper: Oper.CreateSingleOperation;
|
|
145
163
|
} | {
|
|
164
|
+
oper?: never;
|
|
146
165
|
operId: ForeignKey<"oper">;
|
|
147
166
|
})) & ({
|
|
148
167
|
entity?: never;
|
|
@@ -151,13 +170,27 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
151
170
|
} | {
|
|
152
171
|
entity: "actionAuth";
|
|
153
172
|
entityId: ForeignKey<"ActionAuth">;
|
|
154
|
-
actionAuth
|
|
173
|
+
actionAuth?: ActionAuth.UpdateOperation;
|
|
155
174
|
} | {
|
|
156
175
|
entity: "actionAuth";
|
|
157
176
|
entityId: ForeignKey<"ActionAuth">;
|
|
177
|
+
actionAuth?: never;
|
|
158
178
|
} | {
|
|
159
179
|
entity: "i18n";
|
|
160
180
|
entityId: ForeignKey<"I18n">;
|
|
181
|
+
i18n?: never;
|
|
182
|
+
} | {
|
|
183
|
+
entity?: never;
|
|
184
|
+
entityId?: never;
|
|
185
|
+
path: Path.CreateSingleOperation;
|
|
186
|
+
} | {
|
|
187
|
+
entity: "path";
|
|
188
|
+
entityId: ForeignKey<"Path">;
|
|
189
|
+
path?: Path.UpdateOperation;
|
|
190
|
+
} | {
|
|
191
|
+
entity: "path";
|
|
192
|
+
entityId: ForeignKey<"Path">;
|
|
193
|
+
path?: never;
|
|
161
194
|
} | {
|
|
162
195
|
entity?: never;
|
|
163
196
|
entityId?: never;
|
|
@@ -165,10 +198,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
165
198
|
} | {
|
|
166
199
|
entity: "relation";
|
|
167
200
|
entityId: ForeignKey<"Relation">;
|
|
168
|
-
relation
|
|
201
|
+
relation?: Relation.UpdateOperation;
|
|
169
202
|
} | {
|
|
170
203
|
entity: "relation";
|
|
171
204
|
entityId: ForeignKey<"Relation">;
|
|
205
|
+
relation?: never;
|
|
172
206
|
} | {
|
|
173
207
|
entity?: never;
|
|
174
208
|
entityId?: never;
|
|
@@ -176,10 +210,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
176
210
|
} | {
|
|
177
211
|
entity: "relationAuth";
|
|
178
212
|
entityId: ForeignKey<"RelationAuth">;
|
|
179
|
-
relationAuth
|
|
213
|
+
relationAuth?: RelationAuth.UpdateOperation;
|
|
180
214
|
} | {
|
|
181
215
|
entity: "relationAuth";
|
|
182
216
|
entityId: ForeignKey<"RelationAuth">;
|
|
217
|
+
relationAuth?: never;
|
|
183
218
|
} | {
|
|
184
219
|
entity?: never;
|
|
185
220
|
entityId?: never;
|
|
@@ -187,10 +222,23 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
187
222
|
} | {
|
|
188
223
|
entity: "user";
|
|
189
224
|
entityId: ForeignKey<"User">;
|
|
190
|
-
user
|
|
225
|
+
user?: User.UpdateOperation;
|
|
191
226
|
} | {
|
|
192
227
|
entity: "user";
|
|
193
228
|
entityId: ForeignKey<"User">;
|
|
229
|
+
user?: never;
|
|
230
|
+
} | {
|
|
231
|
+
entity?: never;
|
|
232
|
+
entityId?: never;
|
|
233
|
+
userEntityClaim: UserEntityClaim.CreateSingleOperation;
|
|
234
|
+
} | {
|
|
235
|
+
entity: "userEntityClaim";
|
|
236
|
+
entityId: ForeignKey<"UserEntityClaim">;
|
|
237
|
+
userEntityClaim?: UserEntityClaim.UpdateOperation;
|
|
238
|
+
} | {
|
|
239
|
+
entity: "userEntityClaim";
|
|
240
|
+
entityId: ForeignKey<"UserEntityClaim">;
|
|
241
|
+
userEntityClaim?: never;
|
|
194
242
|
} | {
|
|
195
243
|
entity?: never;
|
|
196
244
|
entityId?: never;
|
|
@@ -198,10 +246,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
198
246
|
} | {
|
|
199
247
|
entity: "userEntityGrant";
|
|
200
248
|
entityId: ForeignKey<"UserEntityGrant">;
|
|
201
|
-
userEntityGrant
|
|
249
|
+
userEntityGrant?: UserEntityGrant.UpdateOperation;
|
|
202
250
|
} | {
|
|
203
251
|
entity: "userEntityGrant";
|
|
204
252
|
entityId: ForeignKey<"UserEntityGrant">;
|
|
253
|
+
userEntityGrant?: never;
|
|
205
254
|
} | {
|
|
206
255
|
entity?: never;
|
|
207
256
|
entityId?: never;
|
|
@@ -209,28 +258,33 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|
|
209
258
|
} | {
|
|
210
259
|
entity: "userRelation";
|
|
211
260
|
entityId: ForeignKey<"UserRelation">;
|
|
212
|
-
userRelation
|
|
261
|
+
userRelation?: UserRelation.UpdateOperation;
|
|
213
262
|
} | {
|
|
214
263
|
entity: "userRelation";
|
|
215
264
|
entityId: ForeignKey<"UserRelation">;
|
|
265
|
+
userRelation?: never;
|
|
216
266
|
} | {
|
|
217
267
|
entity?: string;
|
|
218
268
|
entityId?: string;
|
|
219
269
|
[K: string]: any;
|
|
220
270
|
});
|
|
221
|
-
export
|
|
222
|
-
export
|
|
223
|
-
export
|
|
224
|
-
export
|
|
225
|
-
oper
|
|
271
|
+
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
272
|
+
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
273
|
+
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
274
|
+
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
|
|
275
|
+
oper?: Oper.CreateSingleOperation;
|
|
226
276
|
operId?: never;
|
|
227
277
|
} | {
|
|
228
278
|
oper?: never;
|
|
229
|
-
operId?: ForeignKey<"oper"
|
|
279
|
+
operId?: ForeignKey<"oper">;
|
|
230
280
|
})) & ({
|
|
231
281
|
actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
|
232
282
|
entityId?: never;
|
|
233
283
|
entity?: never;
|
|
284
|
+
} | {
|
|
285
|
+
path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
|
|
286
|
+
entityId?: never;
|
|
287
|
+
entity?: never;
|
|
234
288
|
} | {
|
|
235
289
|
relation?: Relation.CreateSingleOperation | Relation.UpdateOperation | Relation.RemoveOperation;
|
|
236
290
|
entityId?: never;
|
|
@@ -243,6 +297,10 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
243
297
|
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
|
244
298
|
entityId?: never;
|
|
245
299
|
entity?: never;
|
|
300
|
+
} | {
|
|
301
|
+
userEntityClaim?: UserEntityClaim.CreateSingleOperation | UserEntityClaim.UpdateOperation | UserEntityClaim.RemoveOperation;
|
|
302
|
+
entityId?: never;
|
|
303
|
+
entity?: never;
|
|
246
304
|
} | {
|
|
247
305
|
userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
|
248
306
|
entityId?: never;
|
|
@@ -252,20 +310,33 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|
|
252
310
|
entityId?: never;
|
|
253
311
|
entity?: never;
|
|
254
312
|
} | {
|
|
255
|
-
entity?: ("actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
|
|
256
|
-
entityId?: ForeignKey<"ActionAuth" | "I18n" | "Relation" | "RelationAuth" | "User" | "UserEntityGrant" | "UserRelation"> | null;
|
|
313
|
+
entity?: ("actionAuth" | "i18n" | "path" | "relation" | "relationAuth" | "user" | "userEntityClaim" | "userEntityGrant" | "userRelation" | string) | null;
|
|
314
|
+
entityId?: ForeignKey<"ActionAuth" | "I18n" | "Path" | "Relation" | "RelationAuth" | "User" | "UserEntityClaim" | "UserEntityGrant" | "UserRelation"> | null;
|
|
315
|
+
actionAuth?: never;
|
|
316
|
+
i18n?: never;
|
|
317
|
+
path?: never;
|
|
318
|
+
relation?: never;
|
|
319
|
+
relationAuth?: never;
|
|
320
|
+
user?: never;
|
|
321
|
+
userEntityClaim?: never;
|
|
322
|
+
userEntityGrant?: never;
|
|
323
|
+
userRelation?: never;
|
|
257
324
|
}) & {
|
|
258
325
|
[k: string]: any;
|
|
259
326
|
};
|
|
260
|
-
export
|
|
261
|
-
export
|
|
327
|
+
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
|
328
|
+
export type RemoveOperationData = {} & ({
|
|
262
329
|
actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
|
|
330
|
+
} | {
|
|
331
|
+
path?: Path.UpdateOperation | Path.RemoveOperation;
|
|
263
332
|
} | {
|
|
264
333
|
relation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
|
265
334
|
} | {
|
|
266
335
|
relationAuth?: RelationAuth.UpdateOperation | RelationAuth.RemoveOperation;
|
|
267
336
|
} | {
|
|
268
337
|
user?: User.UpdateOperation | User.RemoveOperation;
|
|
338
|
+
} | {
|
|
339
|
+
userEntityClaim?: UserEntityClaim.UpdateOperation | UserEntityClaim.RemoveOperation;
|
|
269
340
|
} | {
|
|
270
341
|
userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
|
|
271
342
|
} | {
|
|
@@ -273,18 +344,20 @@ export declare type RemoveOperationData = {} & ({
|
|
|
273
344
|
} | {
|
|
274
345
|
[k: string]: any;
|
|
275
346
|
});
|
|
276
|
-
export
|
|
277
|
-
export
|
|
278
|
-
export
|
|
279
|
-
export
|
|
280
|
-
export
|
|
281
|
-
export
|
|
282
|
-
export
|
|
283
|
-
export
|
|
284
|
-
export
|
|
285
|
-
export
|
|
286
|
-
export
|
|
287
|
-
export
|
|
347
|
+
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
348
|
+
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
349
|
+
export type OperIdSubQuery = Selection<OperIdProjection>;
|
|
350
|
+
export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
|
|
351
|
+
export type I18nIdSubQuery = Selection<I18nIdProjection>;
|
|
352
|
+
export type PathIdSubQuery = Selection<PathIdProjection>;
|
|
353
|
+
export type RelationIdSubQuery = Selection<RelationIdProjection>;
|
|
354
|
+
export type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
|
|
355
|
+
export type UserIdSubQuery = Selection<UserIdProjection>;
|
|
356
|
+
export type UserEntityClaimIdSubQuery = Selection<UserEntityClaimIdProjection>;
|
|
357
|
+
export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
|
|
358
|
+
export type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
|
|
359
|
+
export type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
|
|
360
|
+
export type EntityDef = {
|
|
288
361
|
Schema: Schema;
|
|
289
362
|
OpSchema: OpSchema;
|
|
290
363
|
Action: OakMakeAction<AppendOnlyAction> | string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.desc = void 0;
|
|
4
|
-
|
|
4
|
+
const action_1 = require("../../actions/action");
|
|
5
5
|
exports.desc = {
|
|
6
6
|
attributes: {
|
|
7
7
|
operId: {
|
|
@@ -15,7 +15,7 @@ exports.desc = {
|
|
|
15
15
|
params: {
|
|
16
16
|
length: 32
|
|
17
17
|
},
|
|
18
|
-
ref: ["actionAuth", "i18n", "relation", "relationAuth", "user", "userEntityGrant", "userRelation"]
|
|
18
|
+
ref: ["actionAuth", "i18n", "path", "relation", "relationAuth", "user", "userEntityClaim", "userEntityGrant", "userRelation"]
|
|
19
19
|
},
|
|
20
20
|
entityId: {
|
|
21
21
|
notNull: true,
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Q_DateValue, Q_BooleanValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
|
|
2
|
+
import { OneOf } from "../../types/Polyfill";
|
|
3
|
+
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
|
|
4
|
+
import { GenericAction } from "../../actions/action";
|
|
5
|
+
import { String, Boolean } from "../../types/DataType";
|
|
6
|
+
import { EntityShape } from "../../types/Entity";
|
|
7
|
+
import * as ActionAuth from "../ActionAuth/Schema";
|
|
8
|
+
import * as RelationAuth from "../RelationAuth/Schema";
|
|
9
|
+
import * as ModiEntity from "../ModiEntity/Schema";
|
|
10
|
+
import * as OperEntity from "../OperEntity/Schema";
|
|
11
|
+
export type OpSchema = EntityShape & {
|
|
12
|
+
destEntity: String<32>;
|
|
13
|
+
value: String<256>;
|
|
14
|
+
recursive: Boolean;
|
|
15
|
+
sourceEntity: String<32>;
|
|
16
|
+
};
|
|
17
|
+
export type OpAttr = keyof OpSchema;
|
|
18
|
+
export type Schema = EntityShape & {
|
|
19
|
+
destEntity: String<32>;
|
|
20
|
+
value: String<256>;
|
|
21
|
+
recursive: Boolean;
|
|
22
|
+
sourceEntity: String<32>;
|
|
23
|
+
actionAuth$path?: Array<ActionAuth.Schema>;
|
|
24
|
+
actionAuth$path$$aggr?: AggregationResult<ActionAuth.Schema>;
|
|
25
|
+
relationAuth$path?: Array<RelationAuth.Schema>;
|
|
26
|
+
relationAuth$path$$aggr?: AggregationResult<RelationAuth.Schema>;
|
|
27
|
+
modiEntity$entity?: Array<ModiEntity.Schema>;
|
|
28
|
+
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
|
29
|
+
operEntity$entity?: Array<OperEntity.Schema>;
|
|
30
|
+
operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
|
|
31
|
+
} & {
|
|
32
|
+
[A in ExpressionKey]?: any;
|
|
33
|
+
};
|
|
34
|
+
type AttrFilter = {
|
|
35
|
+
id: Q_StringValue;
|
|
36
|
+
$$createAt$$: Q_DateValue;
|
|
37
|
+
$$seq$$: Q_StringValue;
|
|
38
|
+
$$updateAt$$: Q_DateValue;
|
|
39
|
+
destEntity: Q_StringValue;
|
|
40
|
+
value: Q_StringValue;
|
|
41
|
+
recursive: Q_BooleanValue;
|
|
42
|
+
sourceEntity: Q_StringValue;
|
|
43
|
+
actionAuth$path: ActionAuth.Filter & SubQueryPredicateMetadata;
|
|
44
|
+
relationAuth$path: RelationAuth.Filter & SubQueryPredicateMetadata;
|
|
45
|
+
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
|
46
|
+
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
|
47
|
+
};
|
|
48
|
+
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
|
49
|
+
export type Projection = {
|
|
50
|
+
"#id"?: NodeId;
|
|
51
|
+
[k: string]: any;
|
|
52
|
+
id?: number;
|
|
53
|
+
$$createAt$$?: number;
|
|
54
|
+
$$updateAt$$?: number;
|
|
55
|
+
$$seq$$?: number;
|
|
56
|
+
destEntity?: number;
|
|
57
|
+
value?: number;
|
|
58
|
+
recursive?: number;
|
|
59
|
+
sourceEntity?: number;
|
|
60
|
+
actionAuth$path?: ActionAuth.Selection & {
|
|
61
|
+
$entity: "actionAuth";
|
|
62
|
+
};
|
|
63
|
+
actionAuth$path$$aggr?: ActionAuth.Aggregation & {
|
|
64
|
+
$entity: "actionAuth";
|
|
65
|
+
};
|
|
66
|
+
relationAuth$path?: RelationAuth.Selection & {
|
|
67
|
+
$entity: "relationAuth";
|
|
68
|
+
};
|
|
69
|
+
relationAuth$path$$aggr?: RelationAuth.Aggregation & {
|
|
70
|
+
$entity: "relationAuth";
|
|
71
|
+
};
|
|
72
|
+
modiEntity$entity?: ModiEntity.Selection & {
|
|
73
|
+
$entity: "modiEntity";
|
|
74
|
+
};
|
|
75
|
+
modiEntity$entity$$aggr?: ModiEntity.Aggregation & {
|
|
76
|
+
$entity: "modiEntity";
|
|
77
|
+
};
|
|
78
|
+
operEntity$entity?: OperEntity.Selection & {
|
|
79
|
+
$entity: "operEntity";
|
|
80
|
+
};
|
|
81
|
+
operEntity$entity$$aggr?: OperEntity.Aggregation & {
|
|
82
|
+
$entity: "operEntity";
|
|
83
|
+
};
|
|
84
|
+
} & Partial<ExprOp<OpAttr | string>>;
|
|
85
|
+
type PathIdProjection = OneOf<{
|
|
86
|
+
id: number;
|
|
87
|
+
}>;
|
|
88
|
+
export type SortAttr = {
|
|
89
|
+
id: number;
|
|
90
|
+
} | {
|
|
91
|
+
$$createAt$$: number;
|
|
92
|
+
} | {
|
|
93
|
+
$$seq$$: number;
|
|
94
|
+
} | {
|
|
95
|
+
$$updateAt$$: number;
|
|
96
|
+
} | {
|
|
97
|
+
destEntity: number;
|
|
98
|
+
} | {
|
|
99
|
+
value: number;
|
|
100
|
+
} | {
|
|
101
|
+
recursive: number;
|
|
102
|
+
} | {
|
|
103
|
+
sourceEntity: number;
|
|
104
|
+
} | {
|
|
105
|
+
[k: string]: any;
|
|
106
|
+
} | OneOf<ExprOp<OpAttr | string>>;
|
|
107
|
+
export type SortNode = {
|
|
108
|
+
$attr: SortAttr;
|
|
109
|
+
$direction?: "asc" | "desc";
|
|
110
|
+
};
|
|
111
|
+
export type Sorter = SortNode[];
|
|
112
|
+
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
|
113
|
+
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
|
114
|
+
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
|
115
|
+
export type CreateOperationData = FormCreateData<OpSchema> & {
|
|
116
|
+
actionAuth$path?: OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">> | OakOperation<"create", Omit<ActionAuth.CreateOperationData, "path" | "pathId">[]> | Array<OakOperation<"create", Omit<ActionAuth.CreateOperationData, "path" | "pathId">> | OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">>>;
|
|
117
|
+
relationAuth$path?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "path" | "pathId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "path" | "pathId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">>>;
|
|
118
|
+
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
119
|
+
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
120
|
+
};
|
|
121
|
+
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
|
122
|
+
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
|
123
|
+
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
|
124
|
+
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
|
125
|
+
[k: string]: any;
|
|
126
|
+
actionAuth$path?: OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">> | OakOperation<"create", Omit<ActionAuth.CreateOperationData, "path" | "pathId">[]> | Array<OakOperation<"create", Omit<ActionAuth.CreateOperationData, "path" | "pathId">> | OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "path" | "pathId">, Omit<ActionAuth.Filter, "path" | "pathId">>>;
|
|
127
|
+
relationAuth$path?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "path" | "pathId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "path" | "pathId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "path" | "pathId">, Omit<RelationAuth.Filter, "path" | "pathId">>>;
|
|
128
|
+
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
129
|
+
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
|
130
|
+
};
|
|
131
|
+
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
|
132
|
+
export type RemoveOperationData = {};
|
|
133
|
+
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
|
134
|
+
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
|
135
|
+
export type PathIdSubQuery = Selection<PathIdProjection>;
|
|
136
|
+
export type EntityDef = {
|
|
137
|
+
Schema: Schema;
|
|
138
|
+
OpSchema: OpSchema;
|
|
139
|
+
Action: OakMakeAction<GenericAction> | string;
|
|
140
|
+
Selection: Selection;
|
|
141
|
+
Aggregation: Aggregation;
|
|
142
|
+
Operation: Operation;
|
|
143
|
+
Create: CreateOperation;
|
|
144
|
+
Update: UpdateOperation;
|
|
145
|
+
Remove: RemoveOperation;
|
|
146
|
+
CreateSingle: CreateSingleOperation;
|
|
147
|
+
CreateMulti: CreateMultipleOperation;
|
|
148
|
+
};
|
|
149
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.desc = void 0;
|
|
4
|
+
const action_1 = require("../../actions/action");
|
|
5
|
+
exports.desc = {
|
|
6
|
+
attributes: {
|
|
7
|
+
destEntity: {
|
|
8
|
+
notNull: true,
|
|
9
|
+
type: "varchar",
|
|
10
|
+
params: {
|
|
11
|
+
length: 32
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
value: {
|
|
15
|
+
notNull: true,
|
|
16
|
+
type: "varchar",
|
|
17
|
+
params: {
|
|
18
|
+
length: 256
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
recursive: {
|
|
22
|
+
notNull: true,
|
|
23
|
+
type: "boolean"
|
|
24
|
+
},
|
|
25
|
+
sourceEntity: {
|
|
26
|
+
notNull: true,
|
|
27
|
+
type: "varchar",
|
|
28
|
+
params: {
|
|
29
|
+
length: 32
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
actionType: "crud",
|
|
34
|
+
actions: action_1.genericActions,
|
|
35
|
+
indexes: [
|
|
36
|
+
{
|
|
37
|
+
name: 'index_source_dest_path',
|
|
38
|
+
attributes: [
|
|
39
|
+
{
|
|
40
|
+
name: 'sourceEntity',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'value',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'destEntity',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
config: {
|
|
50
|
+
unique: true,
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
};
|