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
@@ -7,18 +7,19 @@ import { RelationAction } from "../../actions/action";
7
7
  import { String, Text } from "../../types/DataType";
8
8
  import { EntityShape } from "../../types/Entity";
9
9
  import * as Oper from "../Oper/Schema";
10
+ import * as UserEntityClaim from "../UserEntityClaim/Schema";
10
11
  import * as UserRelation from "../UserRelation/Schema";
11
12
  import * as ModiEntity from "../ModiEntity/Schema";
12
13
  import * as OperEntity from "../OperEntity/Schema";
13
- export declare type OpSchema = EntityShape & {
14
+ export type OpSchema = EntityShape & {
14
15
  name?: String<16> | null;
15
16
  nickname?: String<64> | null;
16
17
  password?: Text | null;
17
18
  refId?: ForeignKey<"user"> | null;
18
19
  userState?: UserState | null;
19
20
  };
20
- export declare type OpAttr = keyof OpSchema;
21
- export declare type Schema = EntityShape & {
21
+ export type OpAttr = keyof OpSchema;
22
+ export type Schema = EntityShape & {
22
23
  name?: String<16> | null;
23
24
  nickname?: String<64> | null;
24
25
  password?: Text | null;
@@ -29,6 +30,8 @@ export declare type Schema = EntityShape & {
29
30
  oper$operator$$aggr?: AggregationResult<Oper.Schema>;
30
31
  user$ref?: Array<Schema>;
31
32
  user$ref$$aggr?: AggregationResult<Schema>;
33
+ userEntityClaim$user?: Array<UserEntityClaim.Schema>;
34
+ userEntityClaim$user$$aggr?: AggregationResult<UserEntityClaim.Schema>;
32
35
  userRelation$user?: Array<UserRelation.Schema>;
33
36
  userRelation$user$$aggr?: AggregationResult<UserRelation.Schema>;
34
37
  modiEntity$entity?: Array<ModiEntity.Schema>;
@@ -38,7 +41,7 @@ export declare type Schema = EntityShape & {
38
41
  } & {
39
42
  [A in ExpressionKey]?: any;
40
43
  };
41
- declare type AttrFilter = {
44
+ type AttrFilter = {
42
45
  id: Q_StringValue;
43
46
  $$createAt$$: Q_DateValue;
44
47
  $$seq$$: Q_StringValue;
@@ -51,12 +54,13 @@ declare type AttrFilter = {
51
54
  userState: Q_EnumValue<UserState>;
52
55
  oper$operator: Oper.Filter & SubQueryPredicateMetadata;
53
56
  user$ref: Filter & SubQueryPredicateMetadata;
57
+ userEntityClaim$user: UserEntityClaim.Filter & SubQueryPredicateMetadata;
54
58
  userRelation$user: UserRelation.Filter & SubQueryPredicateMetadata;
55
59
  modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
56
60
  operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
57
61
  };
58
- export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
59
- export declare type Projection = {
62
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
63
+ export type Projection = {
60
64
  "#id"?: NodeId;
61
65
  [k: string]: any;
62
66
  id?: number;
@@ -81,6 +85,12 @@ export declare type Projection = {
81
85
  user$ref$$aggr?: Aggregation & {
82
86
  $entity: "user";
83
87
  };
88
+ userEntityClaim$user?: UserEntityClaim.Selection & {
89
+ $entity: "userEntityClaim";
90
+ };
91
+ userEntityClaim$user$$aggr?: UserEntityClaim.Aggregation & {
92
+ $entity: "userEntityClaim";
93
+ };
84
94
  userRelation$user?: UserRelation.Selection & {
85
95
  $entity: "userRelation";
86
96
  };
@@ -100,11 +110,11 @@ export declare type Projection = {
100
110
  $entity: "operEntity";
101
111
  };
102
112
  } & Partial<ExprOp<OpAttr | string>>;
103
- declare type UserIdProjection = OneOf<{
113
+ type UserIdProjection = OneOf<{
104
114
  id: number;
105
115
  refId: number;
106
116
  }>;
107
- export declare type SortAttr = {
117
+ export type SortAttr = {
108
118
  id: number;
109
119
  } | {
110
120
  $$createAt$$: number;
@@ -127,40 +137,42 @@ export declare type SortAttr = {
127
137
  } | {
128
138
  [k: string]: any;
129
139
  } | OneOf<ExprOp<OpAttr | string>>;
130
- export declare type SortNode = {
140
+ export type SortNode = {
131
141
  $attr: SortAttr;
132
142
  $direction?: "asc" | "desc";
133
143
  };
134
- export declare type Sorter = SortNode[];
135
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
136
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
137
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
138
- export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "refId">> & (({
144
+ export type Sorter = SortNode[];
145
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
146
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
147
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
148
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "refId">> & (({
139
149
  refId?: never;
140
150
  ref?: CreateSingleOperation;
141
151
  } | {
142
152
  refId: ForeignKey<"ref">;
143
153
  ref?: UpdateOperation;
144
154
  } | {
155
+ ref?: never;
145
156
  refId?: ForeignKey<"ref">;
146
157
  })) & {
147
158
  oper$operator?: OakOperation<"create", Omit<Oper.CreateOperationData, "operator" | "operatorId">[]> | Array<OakOperation<"create", Omit<Oper.CreateOperationData, "operator" | "operatorId">>>;
148
159
  user$ref?: OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">> | OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">> | OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">>>;
160
+ userEntityClaim$user?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "user" | "userId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">>>;
149
161
  userRelation$user?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "user" | "userId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">>>;
150
162
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
151
163
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
152
164
  };
153
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
154
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
155
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
156
- export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId">> & (({
157
- ref: CreateSingleOperation;
165
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
166
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
167
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
168
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId">> & (({
169
+ ref?: CreateSingleOperation;
158
170
  refId?: never;
159
171
  } | {
160
- ref: UpdateOperation;
172
+ ref?: UpdateOperation;
161
173
  refId?: never;
162
174
  } | {
163
- ref: RemoveOperation;
175
+ ref?: RemoveOperation;
164
176
  refId?: never;
165
177
  } | {
166
178
  ref?: never;
@@ -169,18 +181,19 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId">
169
181
  [k: string]: any;
170
182
  oper$operator?: OakOperation<"create", Omit<Oper.CreateOperationData, "operator" | "operatorId">[]> | Array<OakOperation<"create", Omit<Oper.CreateOperationData, "operator" | "operatorId">>>;
171
183
  user$ref?: OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">> | OakOperation<RemoveOperation["action"], Omit<RemoveOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">> | OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">[]> | Array<OakOperation<"create", Omit<CreateOperationData, "ref" | "refId">> | OakOperation<UpdateOperation["action"], Omit<UpdateOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">> | OakOperation<RemoveOperation["action"], Omit<RemoveOperationData, "ref" | "refId">, Omit<Filter, "ref" | "refId">>>;
184
+ userEntityClaim$user?: OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">> | OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserEntityClaim.CreateOperationData, "user" | "userId">> | OakOperation<UserEntityClaim.UpdateOperation["action"], Omit<UserEntityClaim.UpdateOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">> | OakOperation<UserEntityClaim.RemoveOperation["action"], Omit<UserEntityClaim.RemoveOperationData, "user" | "userId">, Omit<UserEntityClaim.Filter, "user" | "userId">>>;
172
185
  userRelation$user?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "user" | "userId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "user" | "userId">, Omit<UserRelation.Filter, "user" | "userId">>>;
173
186
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
174
187
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
175
188
  };
176
- export declare type UpdateOperation = OakOperation<"update" | ParticularAction | RelationAction | string, UpdateOperationData, Filter, Sorter>;
177
- export declare type RemoveOperationData = {} & (({
189
+ export type UpdateOperation = OakOperation<"update" | ParticularAction | RelationAction | string, UpdateOperationData, Filter, Sorter>;
190
+ export type RemoveOperationData = {} & (({
178
191
  ref?: UpdateOperation | RemoveOperation;
179
192
  }));
180
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
181
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
182
- export declare type UserIdSubQuery = Selection<UserIdProjection>;
183
- export declare type EntityDef = {
193
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
194
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
195
+ export type UserIdSubQuery = Selection<UserIdProjection>;
196
+ export type EntityDef = {
184
197
  Schema: Schema;
185
198
  OpSchema: OpSchema;
186
199
  Action: OakMakeAction<Action | RelationAction> | 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("./Action");
4
+ const Action_1 = require("./Action");
5
5
  exports.desc = {
6
6
  attributes: {
7
7
  name: {
@@ -0,0 +1,264 @@
1
+ import { ForeignKey } from "../../types/DataType";
2
+ import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "../../types/Demand";
3
+ import { OneOf } from "../../types/Polyfill";
4
+ import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
5
+ import { GenericAction } from "../../actions/action";
6
+ import { String } from "../../types/DataType";
7
+ import { EntityShape } from "../../types/Entity";
8
+ import * as UserEntityGrant from "../UserEntityGrant/Schema";
9
+ import * as User from "../User/Schema";
10
+ import * as Relation from "../Relation/Schema";
11
+ import * as UserRelation from "../UserRelation/Schema";
12
+ import * as ModiEntity from "../ModiEntity/Schema";
13
+ import * as OperEntity from "../OperEntity/Schema";
14
+ export type OpSchema = EntityShape & {
15
+ uegId: ForeignKey<"userEntityGrant">;
16
+ userId: ForeignKey<"user">;
17
+ relationId: ForeignKey<"relation">;
18
+ claimEntityId: String<64>;
19
+ userRelationId: ForeignKey<"userRelation">;
20
+ };
21
+ export type OpAttr = keyof OpSchema;
22
+ export type Schema = EntityShape & {
23
+ uegId: ForeignKey<"userEntityGrant">;
24
+ userId: ForeignKey<"user">;
25
+ relationId: ForeignKey<"relation">;
26
+ claimEntityId: String<64>;
27
+ userRelationId: ForeignKey<"userRelation">;
28
+ ueg: UserEntityGrant.Schema;
29
+ user: User.Schema;
30
+ relation: Relation.Schema;
31
+ userRelation: UserRelation.Schema;
32
+ modiEntity$entity?: Array<ModiEntity.Schema>;
33
+ modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
34
+ operEntity$entity?: Array<OperEntity.Schema>;
35
+ operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
36
+ } & {
37
+ [A in ExpressionKey]?: any;
38
+ };
39
+ type AttrFilter = {
40
+ id: Q_StringValue;
41
+ $$createAt$$: Q_DateValue;
42
+ $$seq$$: Q_StringValue;
43
+ $$updateAt$$: Q_DateValue;
44
+ uegId: Q_StringValue;
45
+ ueg: UserEntityGrant.Filter;
46
+ userId: Q_StringValue;
47
+ user: User.Filter;
48
+ relationId: Q_StringValue;
49
+ relation: Relation.Filter;
50
+ claimEntityId: Q_StringValue;
51
+ userRelationId: Q_StringValue;
52
+ userRelation: UserRelation.Filter;
53
+ modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
54
+ operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
55
+ };
56
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
57
+ export type Projection = {
58
+ "#id"?: NodeId;
59
+ [k: string]: any;
60
+ id?: number;
61
+ $$createAt$$?: number;
62
+ $$updateAt$$?: number;
63
+ $$seq$$?: number;
64
+ uegId?: number;
65
+ ueg?: UserEntityGrant.Projection;
66
+ userId?: number;
67
+ user?: User.Projection;
68
+ relationId?: number;
69
+ relation?: Relation.Projection;
70
+ claimEntityId?: number;
71
+ userRelationId?: number;
72
+ userRelation?: UserRelation.Projection;
73
+ modiEntity$entity?: ModiEntity.Selection & {
74
+ $entity: "modiEntity";
75
+ };
76
+ modiEntity$entity$$aggr?: ModiEntity.Aggregation & {
77
+ $entity: "modiEntity";
78
+ };
79
+ operEntity$entity?: OperEntity.Selection & {
80
+ $entity: "operEntity";
81
+ };
82
+ operEntity$entity$$aggr?: OperEntity.Aggregation & {
83
+ $entity: "operEntity";
84
+ };
85
+ } & Partial<ExprOp<OpAttr | string>>;
86
+ type UserEntityClaimIdProjection = OneOf<{
87
+ id: number;
88
+ }>;
89
+ type UserEntityGrantIdProjection = OneOf<{
90
+ uegId: number;
91
+ }>;
92
+ type UserIdProjection = OneOf<{
93
+ userId: number;
94
+ }>;
95
+ type RelationIdProjection = OneOf<{
96
+ relationId: number;
97
+ }>;
98
+ type UserRelationIdProjection = OneOf<{
99
+ userRelationId: number;
100
+ }>;
101
+ export type SortAttr = {
102
+ id: number;
103
+ } | {
104
+ $$createAt$$: number;
105
+ } | {
106
+ $$seq$$: number;
107
+ } | {
108
+ $$updateAt$$: number;
109
+ } | {
110
+ uegId: number;
111
+ } | {
112
+ ueg: UserEntityGrant.SortAttr;
113
+ } | {
114
+ userId: number;
115
+ } | {
116
+ user: User.SortAttr;
117
+ } | {
118
+ relationId: number;
119
+ } | {
120
+ relation: Relation.SortAttr;
121
+ } | {
122
+ claimEntityId: number;
123
+ } | {
124
+ userRelationId: number;
125
+ } | {
126
+ userRelation: UserRelation.SortAttr;
127
+ } | {
128
+ [k: string]: any;
129
+ } | OneOf<ExprOp<OpAttr | string>>;
130
+ export type SortNode = {
131
+ $attr: SortAttr;
132
+ $direction?: "asc" | "desc";
133
+ };
134
+ export type Sorter = SortNode[];
135
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
136
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
137
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
138
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "uegId" | "userId" | "relationId" | "userRelationId">> & (({
139
+ uegId?: never;
140
+ ueg: UserEntityGrant.CreateSingleOperation;
141
+ } | {
142
+ uegId: ForeignKey<"ueg">;
143
+ ueg?: UserEntityGrant.UpdateOperation;
144
+ } | {
145
+ ueg?: never;
146
+ uegId: ForeignKey<"ueg">;
147
+ }) & ({
148
+ userId?: never;
149
+ user: User.CreateSingleOperation;
150
+ } | {
151
+ userId: ForeignKey<"user">;
152
+ user?: User.UpdateOperation;
153
+ } | {
154
+ user?: never;
155
+ userId: ForeignKey<"user">;
156
+ }) & ({
157
+ relationId?: never;
158
+ relation: Relation.CreateSingleOperation;
159
+ } | {
160
+ relationId: ForeignKey<"relation">;
161
+ relation?: Relation.UpdateOperation;
162
+ } | {
163
+ relation?: never;
164
+ relationId: ForeignKey<"relation">;
165
+ }) & ({
166
+ userRelationId?: never;
167
+ userRelation: UserRelation.CreateSingleOperation;
168
+ } | {
169
+ userRelationId: ForeignKey<"userRelation">;
170
+ userRelation?: UserRelation.UpdateOperation;
171
+ } | {
172
+ userRelation?: never;
173
+ userRelationId: ForeignKey<"userRelation">;
174
+ })) & {
175
+ modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
176
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
177
+ };
178
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
179
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
180
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
181
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "uegId" | "userId" | "relationId" | "userRelationId">> & (({
182
+ ueg?: UserEntityGrant.CreateSingleOperation;
183
+ uegId?: never;
184
+ } | {
185
+ ueg?: UserEntityGrant.UpdateOperation;
186
+ uegId?: never;
187
+ } | {
188
+ ueg?: UserEntityGrant.RemoveOperation;
189
+ uegId?: never;
190
+ } | {
191
+ ueg?: never;
192
+ uegId?: ForeignKey<"ueg">;
193
+ }) & ({
194
+ user?: User.CreateSingleOperation;
195
+ userId?: never;
196
+ } | {
197
+ user?: User.UpdateOperation;
198
+ userId?: never;
199
+ } | {
200
+ user?: User.RemoveOperation;
201
+ userId?: never;
202
+ } | {
203
+ user?: never;
204
+ userId?: ForeignKey<"user">;
205
+ }) & ({
206
+ relation?: Relation.CreateSingleOperation;
207
+ relationId?: never;
208
+ } | {
209
+ relation?: Relation.UpdateOperation;
210
+ relationId?: never;
211
+ } | {
212
+ relation?: Relation.RemoveOperation;
213
+ relationId?: never;
214
+ } | {
215
+ relation?: never;
216
+ relationId?: ForeignKey<"relation">;
217
+ }) & ({
218
+ userRelation?: UserRelation.CreateSingleOperation;
219
+ userRelationId?: never;
220
+ } | {
221
+ userRelation?: UserRelation.UpdateOperation;
222
+ userRelationId?: never;
223
+ } | {
224
+ userRelation?: UserRelation.RemoveOperation;
225
+ userRelationId?: never;
226
+ } | {
227
+ userRelation?: never;
228
+ userRelationId?: ForeignKey<"userRelation">;
229
+ })) & {
230
+ [k: string]: any;
231
+ modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
232
+ operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
233
+ };
234
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
235
+ export type RemoveOperationData = {} & (({
236
+ ueg?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
237
+ }) & ({
238
+ user?: User.UpdateOperation | User.RemoveOperation;
239
+ }) & ({
240
+ relation?: Relation.UpdateOperation | Relation.RemoveOperation;
241
+ }) & ({
242
+ userRelation?: UserRelation.UpdateOperation | UserRelation.RemoveOperation;
243
+ }));
244
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
245
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
246
+ export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
247
+ export type UserIdSubQuery = Selection<UserIdProjection>;
248
+ export type RelationIdSubQuery = Selection<RelationIdProjection>;
249
+ export type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
250
+ export type UserEntityClaimIdSubQuery = Selection<UserEntityClaimIdProjection>;
251
+ export type EntityDef = {
252
+ Schema: Schema;
253
+ OpSchema: OpSchema;
254
+ Action: OakMakeAction<GenericAction> | string;
255
+ Selection: Selection;
256
+ Aggregation: Aggregation;
257
+ Operation: Operation;
258
+ Create: CreateOperation;
259
+ Update: UpdateOperation;
260
+ Remove: RemoveOperation;
261
+ CreateSingle: CreateSingleOperation;
262
+ CreateMulti: CreateMultipleOperation;
263
+ };
264
+ 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,37 @@
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
+ uegId: {
8
+ notNull: true,
9
+ type: "ref",
10
+ ref: "userEntityGrant"
11
+ },
12
+ userId: {
13
+ notNull: true,
14
+ type: "ref",
15
+ ref: "user"
16
+ },
17
+ relationId: {
18
+ notNull: true,
19
+ type: "ref",
20
+ ref: "relation"
21
+ },
22
+ claimEntityId: {
23
+ notNull: true,
24
+ type: "varchar",
25
+ params: {
26
+ length: 64
27
+ }
28
+ },
29
+ userRelationId: {
30
+ notNull: true,
31
+ type: "ref",
32
+ ref: "userRelation"
33
+ }
34
+ },
35
+ actionType: "crud",
36
+ actions: action_1.genericActions
37
+ };
@@ -1,5 +1,5 @@
1
1
  import { GenericAction } from "../../actions/action";
2
- export declare type ParticularAction = 'confirm';
2
+ export type ParticularAction = 'confirm';
3
3
  export declare const actions: string[];
4
- export declare type Action = GenericAction | ParticularAction | string;
4
+ export type Action = GenericAction | ParticularAction | string;
5
5
  export declare const ActionDefDict: {};