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.
Files changed (157) hide show
  1. package/lib/actions/action.d.ts +8 -8
  2. package/lib/actions/action.js +2 -2
  3. package/lib/actions/relation.d.ts +1 -1
  4. package/lib/actions/relation.js +9 -22
  5. package/lib/base-app-domain/ActionAuth/Schema.d.ts +68 -42
  6. package/lib/base-app-domain/ActionAuth/Storage.js +12 -15
  7. package/lib/base-app-domain/ActionDefDict.d.ts +2 -3
  8. package/lib/base-app-domain/ActionDefDict.js +3 -5
  9. package/lib/base-app-domain/EntityDict.d.ts +5 -1
  10. package/lib/base-app-domain/I18n/Schema.d.ts +24 -24
  11. package/lib/base-app-domain/I18n/Storage.js +5 -5
  12. package/lib/base-app-domain/Modi/Action.d.ts +4 -4
  13. package/lib/base-app-domain/Modi/Action.js +3 -3
  14. package/lib/base-app-domain/Modi/Schema.d.ts +24 -24
  15. package/lib/base-app-domain/Modi/Storage.js +3 -3
  16. package/lib/base-app-domain/ModiEntity/Schema.d.ts +128 -55
  17. package/lib/base-app-domain/ModiEntity/Storage.js +2 -2
  18. package/lib/base-app-domain/Oper/Schema.d.ts +30 -29
  19. package/lib/base-app-domain/Oper/Storage.js +1 -1
  20. package/lib/base-app-domain/OperEntity/Schema.d.ts +126 -53
  21. package/lib/base-app-domain/OperEntity/Storage.js +2 -2
  22. package/lib/base-app-domain/Path/Schema.d.ts +149 -0
  23. package/lib/base-app-domain/Path/Schema.js +2 -0
  24. package/lib/base-app-domain/Path/Storage.d.ts +3 -0
  25. package/lib/base-app-domain/Path/Storage.js +54 -0
  26. package/lib/base-app-domain/Relation/Schema.d.ts +34 -34
  27. package/lib/base-app-domain/Relation/Storage.js +6 -6
  28. package/lib/base-app-domain/Relation.d.ts +0 -8
  29. package/lib/base-app-domain/Relation.js +1 -7
  30. package/lib/base-app-domain/RelationAuth/Schema.d.ts +74 -40
  31. package/lib/base-app-domain/RelationAuth/Storage.js +9 -11
  32. package/lib/base-app-domain/Storage.js +20 -16
  33. package/lib/base-app-domain/User/Action.d.ts +4 -4
  34. package/lib/base-app-domain/User/Action.js +3 -3
  35. package/lib/base-app-domain/User/Schema.d.ts +40 -27
  36. package/lib/base-app-domain/User/Storage.js +1 -1
  37. package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +264 -0
  38. package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -0
  39. package/lib/base-app-domain/UserEntityClaim/Storage.d.ts +3 -0
  40. package/lib/base-app-domain/UserEntityClaim/Storage.js +37 -0
  41. package/lib/base-app-domain/UserEntityGrant/Action.d.ts +2 -2
  42. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +55 -81
  43. package/lib/base-app-domain/UserEntityGrant/Storage.js +7 -11
  44. package/lib/base-app-domain/UserRelation/Schema.d.ts +50 -36
  45. package/lib/base-app-domain/UserRelation/Storage.js +7 -7
  46. package/lib/base-app-domain/_SubQuery.d.ts +45 -15
  47. package/lib/base-app-domain/index.js +1 -1
  48. package/lib/checkers/index.js +6 -7
  49. package/lib/compiler/env.js +16 -18
  50. package/lib/compiler/localeBuilder.js +83 -79
  51. package/lib/compiler/schemalBuilder.d.ts +16 -0
  52. package/lib/compiler/schemalBuilder.js +1160 -1378
  53. package/lib/entities/ActionAuth.d.ts +3 -5
  54. package/lib/entities/ActionAuth.js +9 -7
  55. package/lib/entities/I18n.js +1 -1
  56. package/lib/entities/Modi.js +2 -2
  57. package/lib/entities/ModiEntity.js +1 -1
  58. package/lib/entities/Oper.js +1 -1
  59. package/lib/entities/OperEntity.js +1 -1
  60. package/lib/entities/Path.d.ts +8 -0
  61. package/lib/entities/Path.js +35 -0
  62. package/lib/entities/Relation.js +1 -1
  63. package/lib/entities/RelationAuth.d.ts +2 -2
  64. package/lib/entities/RelationAuth.js +1 -1
  65. package/lib/entities/User.js +2 -2
  66. package/lib/entities/UserEntityClaim.d.ts +13 -0
  67. package/lib/entities/UserEntityClaim.js +17 -0
  68. package/lib/entities/UserEntityGrant.d.ts +5 -4
  69. package/lib/entities/UserEntityGrant.js +4 -7
  70. package/lib/entities/UserRelation.js +1 -1
  71. package/lib/index.d.ts +23 -0
  72. package/lib/index.js +37 -0
  73. package/lib/store/AsyncRowStore.d.ts +2 -1
  74. package/lib/store/AsyncRowStore.js +75 -149
  75. package/lib/store/CascadeStore.js +968 -1341
  76. package/lib/store/RelationAuth.d.ts +9 -16
  77. package/lib/store/RelationAuth.js +752 -910
  78. package/lib/store/SyncRowStore.d.ts +1 -1
  79. package/lib/store/SyncRowStore.js +27 -26
  80. package/lib/store/TriggerExecutor.d.ts +17 -10
  81. package/lib/store/TriggerExecutor.js +350 -423
  82. package/lib/store/actionAuth.js +13 -28
  83. package/lib/store/actionDef.js +142 -215
  84. package/lib/store/checker.js +225 -361
  85. package/lib/store/filter.d.ts +2 -3
  86. package/lib/store/filter.js +451 -589
  87. package/lib/store/modi.js +116 -177
  88. package/lib/store/relation.js +17 -17
  89. package/lib/timers/oper.d.ts +1 -1
  90. package/lib/timers/oper.js +44 -47
  91. package/lib/timers/vaccum.d.ts +2 -2
  92. package/lib/timers/vaccum.js +100 -165
  93. package/lib/triggers/index.js +1 -1
  94. package/lib/types/Action.d.ts +7 -7
  95. package/lib/types/AppLoader.d.ts +8 -2
  96. package/lib/types/AppLoader.js +4 -4
  97. package/lib/types/Auth.d.ts +15 -19
  98. package/lib/types/Connector.d.ts +19 -14
  99. package/lib/types/Connector.js +0 -7
  100. package/lib/types/DataType.d.ts +19 -18
  101. package/lib/types/DataType.js +1 -1
  102. package/lib/types/Demand.d.ts +25 -25
  103. package/lib/types/Endpoint.d.ts +1 -1
  104. package/lib/types/Entity.d.ts +62 -53
  105. package/lib/types/Entity.js +4 -3
  106. package/lib/types/EntityDesc.d.ts +2 -1
  107. package/lib/types/Environment.d.ts +4 -4
  108. package/lib/types/Exception.d.ts +34 -2
  109. package/lib/types/Exception.js +214 -197
  110. package/lib/types/Expression.d.ts +14 -14
  111. package/lib/types/Expression.js +54 -87
  112. package/lib/types/Geo.d.ts +6 -6
  113. package/lib/types/Locale.d.ts +5 -5
  114. package/lib/types/Polyfill.d.ts +9 -9
  115. package/lib/types/Port.d.ts +4 -4
  116. package/lib/types/RowStore.d.ts +3 -3
  117. package/lib/types/RowStore.js +18 -19
  118. package/lib/types/Storage.d.ts +5 -4
  119. package/lib/types/Style.d.ts +2 -2
  120. package/lib/types/Timer.d.ts +3 -3
  121. package/lib/types/Trigger.d.ts +30 -14
  122. package/lib/types/Trigger.js +6 -2
  123. package/lib/types/Watcher.d.ts +2 -2
  124. package/lib/types/index.d.ts +1 -0
  125. package/lib/types/index.js +2 -1
  126. package/lib/types/schema/DataTypes.d.ts +7 -7
  127. package/lib/utils/SimpleConnector.d.ts +26 -10
  128. package/lib/utils/SimpleConnector.js +167 -141
  129. package/lib/utils/assert.js +2 -2
  130. package/lib/utils/concurrent.d.ts +1 -1
  131. package/lib/utils/concurrent.js +31 -57
  132. package/lib/utils/date.js +2 -2
  133. package/lib/utils/geo.js +8 -8
  134. package/lib/utils/lodash.d.ts +3 -1
  135. package/lib/utils/lodash.js +21 -34
  136. package/lib/utils/mask.js +12 -13
  137. package/lib/utils/money.d.ts +1 -1
  138. package/lib/utils/money.js +22 -11
  139. package/lib/utils/projection.d.ts +4 -0
  140. package/lib/utils/projection.js +15 -0
  141. package/lib/utils/random/random.js +11 -16
  142. package/lib/utils/random/random.mp.js +7 -18
  143. package/lib/utils/random/random.web.js +6 -12
  144. package/lib/utils/string.d.ts +4 -4
  145. package/lib/utils/string.js +19 -32
  146. package/lib/utils/url.js +5 -4
  147. package/lib/utils/uuid.d.ts +1 -1
  148. package/lib/utils/uuid.js +46 -85
  149. package/lib/utils/validator.d.ts +4 -3
  150. package/lib/utils/validator.js +35 -32
  151. package/lib/utils/version.js +6 -6
  152. package/package.json +7 -7
  153. package/src/entities/ActionAuth.ts +10 -10
  154. package/src/entities/Path.ts +43 -0
  155. package/src/entities/RelationAuth.ts +2 -1
  156. package/src/entities/UserEntityClaim.ts +30 -0
  157. package/src/entities/UserEntityGrant.ts +9 -12
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.desc = void 0;
4
- var action_1 = require("../../actions/action");
4
+ const action_1 = require("../../actions/action");
5
5
  exports.desc = {
6
6
  attributes: {
7
7
  action: {
@@ -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 declare type OpSchema = EntityShape & {
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 declare type OpAttr = keyof OpSchema;
22
- export declare type Schema = EntityShape & {
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
- declare type AttrFilter = {
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 declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
55
- export declare type Projection = {
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
- declare type OperEntityIdProjection = OneOf<{
82
+ type OperEntityIdProjection = OneOf<{
75
83
  id: number;
76
84
  }>;
77
- declare type OperIdProjection = OneOf<{
85
+ type OperIdProjection = OneOf<{
78
86
  operId: number;
79
87
  }>;
80
- declare type ActionAuthIdProjection = OneOf<{
88
+ type ActionAuthIdProjection = OneOf<{
81
89
  entityId: number;
82
90
  }>;
83
- declare type I18nIdProjection = OneOf<{
91
+ type I18nIdProjection = OneOf<{
84
92
  entityId: number;
85
93
  }>;
86
- declare type RelationIdProjection = OneOf<{
94
+ type PathIdProjection = OneOf<{
87
95
  entityId: number;
88
96
  }>;
89
- declare type RelationAuthIdProjection = OneOf<{
97
+ type RelationIdProjection = OneOf<{
90
98
  entityId: number;
91
99
  }>;
92
- declare type UserIdProjection = OneOf<{
100
+ type RelationAuthIdProjection = OneOf<{
93
101
  entityId: number;
94
102
  }>;
95
- declare type UserEntityGrantIdProjection = OneOf<{
103
+ type UserIdProjection = OneOf<{
96
104
  entityId: number;
97
105
  }>;
98
- declare type UserRelationIdProjection = OneOf<{
106
+ type UserEntityClaimIdProjection = OneOf<{
99
107
  entityId: number;
100
108
  }>;
101
- export declare type SortAttr = {
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 declare type SortNode = {
152
+ export type SortNode = {
135
153
  $attr: SortAttr;
136
154
  $direction?: "asc" | "desc";
137
155
  };
138
- export declare type Sorter = SortNode[];
139
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
140
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
141
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
142
- export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
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: ActionAuth.UpdateOperation;
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: Relation.UpdateOperation;
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: RelationAuth.UpdateOperation;
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: User.UpdateOperation;
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: UserEntityGrant.UpdateOperation;
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: UserRelation.UpdateOperation;
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 declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
222
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
223
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
224
- export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "operId">> & (({
225
- oper: Oper.CreateSingleOperation;
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"> | null;
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 declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
261
- export declare type RemoveOperationData = {} & ({
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 declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
277
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
278
- export declare type OperIdSubQuery = Selection<OperIdProjection>;
279
- export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
280
- export declare type I18nIdSubQuery = Selection<I18nIdProjection>;
281
- export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
282
- export declare type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
283
- export declare type UserIdSubQuery = Selection<UserIdProjection>;
284
- export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
285
- export declare type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
286
- export declare type OperEntityIdSubQuery = Selection<OperEntityIdProjection>;
287
- export declare type EntityDef = {
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
- var action_1 = require("../../actions/action");
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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { StorageDesc } from "../../types/Storage";
2
+ import { OpSchema } from "./Schema";
3
+ export declare const desc: StorageDesc<OpSchema>;
@@ -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
+ };