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,16 +1,16 @@
1
1
  import { ActionDef } from '../types/Action';
2
- export declare type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download' | 'aggregate';
3
- export declare type AppendOnlyAction = ReadOnlyAction | 'create';
4
- export declare type ExcludeUpdateAction = AppendOnlyAction | 'remove';
5
- export declare type ExcludeRemoveAction = AppendOnlyAction | 'update';
6
- export declare type GenericAction = 'update' | ExcludeUpdateAction;
7
- export declare type RelationAction = 'grant' | 'revoke';
2
+ export type ReadOnlyAction = 'select' | 'count' | 'stat' | 'download' | 'aggregate';
3
+ export type AppendOnlyAction = ReadOnlyAction | 'create';
4
+ export type ExcludeUpdateAction = AppendOnlyAction | 'remove';
5
+ export type ExcludeRemoveAction = AppendOnlyAction | 'update';
6
+ export type GenericAction = 'update' | ExcludeUpdateAction;
7
+ export type RelationAction = 'grant' | 'revoke';
8
8
  export declare const readOnlyActions: string[];
9
9
  export declare const appendOnlyActions: string[];
10
10
  export declare const excludeUpdateActions: string[];
11
11
  export declare const excludeRemoveActions: string[];
12
12
  export declare const genericActions: string[];
13
13
  export declare const relationActions: string[];
14
- export declare type AbleAction = 'enable' | 'disable';
15
- export declare type AbleState = 'enabled' | 'disabled';
14
+ export type AbleAction = 'enable' | 'disable';
15
+ export type AbleState = 'enabled' | 'disabled';
16
16
  export declare const makeAbleActionDef: (initialState?: AbleState) => ActionDef<AbleAction, AbleState>;
@@ -7,11 +7,11 @@ exports.excludeUpdateActions = exports.appendOnlyActions.concat('remove');
7
7
  exports.excludeRemoveActions = exports.appendOnlyActions.concat('update');
8
8
  exports.genericActions = exports.excludeUpdateActions.concat('update');
9
9
  exports.relationActions = ['grant', 'revoke'];
10
- var makeAbleActionDef = function (initialState) { return ({
10
+ const makeAbleActionDef = (initialState) => ({
11
11
  stm: {
12
12
  enable: ['disabled', 'enabled'],
13
13
  disable: ['enabled', 'disabled'],
14
14
  },
15
15
  is: initialState,
16
- }); };
16
+ });
17
17
  exports.makeAbleActionDef = makeAbleActionDef;
@@ -1,5 +1,5 @@
1
1
  import { CascadeRelationItem, RelationHierarchy, EntityDict } from "../types/Entity";
2
- export declare type GenericRelation = 'owner';
2
+ export type GenericRelation = 'owner';
3
3
  export declare function convertHierarchyToAuth<ED extends EntityDict, T extends keyof ED>(entity: T, hierarchy: RelationHierarchy<NonNullable<ED[T]['Relation']>>): {
4
4
  [K in NonNullable<ED[T]['Relation']>]?: CascadeRelationItem;
5
5
  };
@@ -1,33 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertHierarchyToAuth = void 0;
4
- var tslib_1 = require("tslib");
5
4
  function convertHierarchyToAuth(entity, hierarchy) {
6
- var e_1, _a;
7
- var _b;
8
- var reverseHierarchy = {};
9
- for (var r in hierarchy) {
10
- try {
11
- for (var _c = (e_1 = void 0, tslib_1.__values(hierarchy[r])), _d = _c.next(); !_d.done; _d = _c.next()) {
12
- var r2 = _d.value;
13
- if (reverseHierarchy[r2]) {
14
- (_b = reverseHierarchy[r2]) === null || _b === void 0 ? void 0 : _b.push(r);
15
- }
16
- else {
17
- reverseHierarchy[r2] = [r];
18
- }
5
+ const reverseHierarchy = {};
6
+ for (const r in hierarchy) {
7
+ for (const r2 of hierarchy[r]) {
8
+ if (reverseHierarchy[r2]) {
9
+ reverseHierarchy[r2]?.push(r);
19
10
  }
20
- }
21
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
22
- finally {
23
- try {
24
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
11
+ else {
12
+ reverseHierarchy[r2] = [r];
25
13
  }
26
- finally { if (e_1) throw e_1.error; }
27
14
  }
28
15
  }
29
- var result = {};
30
- for (var r in reverseHierarchy) {
16
+ const result = {};
17
+ for (const r in reverseHierarchy) {
31
18
  result[r] = {
32
19
  cascadePath: '',
33
20
  relations: reverseHierarchy[r],
@@ -3,26 +3,24 @@ import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey,
3
3
  import { OneOf } from "../../types/Polyfill";
4
4
  import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "../../types/Entity";
5
5
  import { GenericAction } from "../../actions/action";
6
- import { String } from "../../types/DataType";
7
6
  import { EntityShape } from "../../types/Entity";
8
7
  import * as Relation from "../Relation/Schema";
8
+ import * as Path from "../Path/Schema";
9
9
  import * as ModiEntity from "../ModiEntity/Schema";
10
10
  import * as OperEntity from "../OperEntity/Schema";
11
- declare type Actions = string[];
12
- declare type Paths = string[];
13
- export declare type OpSchema = EntityShape & {
11
+ type Actions = string[];
12
+ export type OpSchema = EntityShape & {
14
13
  relationId?: ForeignKey<"relation"> | null;
15
- paths: Paths;
16
- destEntity: String<32>;
14
+ pathId: ForeignKey<"path">;
17
15
  deActions: Actions;
18
16
  };
19
- export declare type OpAttr = keyof OpSchema;
20
- export declare type Schema = EntityShape & {
17
+ export type OpAttr = keyof OpSchema;
18
+ export type Schema = EntityShape & {
21
19
  relationId?: ForeignKey<"relation"> | null;
22
- paths: Paths;
23
- destEntity: String<32>;
20
+ pathId: ForeignKey<"path">;
24
21
  deActions: Actions;
25
22
  relation?: Relation.Schema | null;
23
+ path: Path.Schema;
26
24
  modiEntity$entity?: Array<ModiEntity.Schema>;
27
25
  modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
28
26
  operEntity$entity?: Array<OperEntity.Schema>;
@@ -30,21 +28,21 @@ export declare type Schema = EntityShape & {
30
28
  } & {
31
29
  [A in ExpressionKey]?: any;
32
30
  };
33
- declare type AttrFilter = {
31
+ type AttrFilter = {
34
32
  id: Q_StringValue;
35
33
  $$createAt$$: Q_DateValue;
36
34
  $$seq$$: Q_StringValue;
37
35
  $$updateAt$$: Q_DateValue;
38
36
  relationId: Q_StringValue;
39
37
  relation: Relation.Filter;
40
- paths: JsonFilter<Paths>;
41
- destEntity: Q_StringValue;
38
+ pathId: Q_StringValue;
39
+ path: Path.Filter;
42
40
  deActions: JsonFilter<Actions>;
43
41
  modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
44
42
  operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
45
43
  };
46
- export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
47
- export declare type Projection = {
44
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
45
+ export type Projection = {
48
46
  "#id"?: NodeId;
49
47
  [k: string]: any;
50
48
  id?: number;
@@ -53,8 +51,8 @@ export declare type Projection = {
53
51
  $$seq$$?: number;
54
52
  relationId?: number;
55
53
  relation?: Relation.Projection;
56
- paths?: number | JsonProjection<Paths>;
57
- destEntity?: number;
54
+ pathId?: number;
55
+ path?: Path.Projection;
58
56
  deActions?: number | JsonProjection<Actions>;
59
57
  modiEntity$entity?: ModiEntity.Selection & {
60
58
  $entity: "modiEntity";
@@ -69,13 +67,16 @@ export declare type Projection = {
69
67
  $entity: "operEntity";
70
68
  };
71
69
  } & Partial<ExprOp<OpAttr | string>>;
72
- declare type ActionAuthIdProjection = OneOf<{
70
+ type ActionAuthIdProjection = OneOf<{
73
71
  id: number;
74
72
  }>;
75
- declare type RelationIdProjection = OneOf<{
73
+ type RelationIdProjection = OneOf<{
76
74
  relationId: number;
77
75
  }>;
78
- export declare type SortAttr = {
76
+ type PathIdProjection = OneOf<{
77
+ pathId: number;
78
+ }>;
79
+ export type SortAttr = {
79
80
  id: number;
80
81
  } | {
81
82
  $$createAt$$: number;
@@ -88,63 +89,88 @@ export declare type SortAttr = {
88
89
  } | {
89
90
  relation: Relation.SortAttr;
90
91
  } | {
91
- paths: number;
92
+ pathId: number;
92
93
  } | {
93
- destEntity: number;
94
+ path: Path.SortAttr;
94
95
  } | {
95
96
  deActions: number;
96
97
  } | {
97
98
  [k: string]: any;
98
99
  } | OneOf<ExprOp<OpAttr | string>>;
99
- export declare type SortNode = {
100
+ export type SortNode = {
100
101
  $attr: SortAttr;
101
102
  $direction?: "asc" | "desc";
102
103
  };
103
- export declare type Sorter = SortNode[];
104
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
105
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
106
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
107
- export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId">> & (({
104
+ export type Sorter = SortNode[];
105
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
106
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
107
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
108
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "relationId" | "pathId">> & (({
108
109
  relationId?: never;
109
110
  relation?: Relation.CreateSingleOperation;
110
111
  } | {
111
112
  relationId: ForeignKey<"relation">;
112
113
  relation?: Relation.UpdateOperation;
113
114
  } | {
115
+ relation?: never;
114
116
  relationId?: ForeignKey<"relation">;
117
+ }) & ({
118
+ pathId?: never;
119
+ path: Path.CreateSingleOperation;
120
+ } | {
121
+ pathId: ForeignKey<"path">;
122
+ path?: Path.UpdateOperation;
123
+ } | {
124
+ path?: never;
125
+ pathId: ForeignKey<"path">;
115
126
  })) & {
116
127
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
117
128
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
118
129
  };
119
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
120
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
121
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
122
- export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId">> & (({
123
- relation: Relation.CreateSingleOperation;
130
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
131
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
132
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
133
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId" | "pathId">> & (({
134
+ relation?: Relation.CreateSingleOperation;
124
135
  relationId?: never;
125
136
  } | {
126
- relation: Relation.UpdateOperation;
137
+ relation?: Relation.UpdateOperation;
127
138
  relationId?: never;
128
139
  } | {
129
- relation: Relation.RemoveOperation;
140
+ relation?: Relation.RemoveOperation;
130
141
  relationId?: never;
131
142
  } | {
132
143
  relation?: never;
133
144
  relationId?: ForeignKey<"relation"> | null;
145
+ }) & ({
146
+ path?: Path.CreateSingleOperation;
147
+ pathId?: never;
148
+ } | {
149
+ path?: Path.UpdateOperation;
150
+ pathId?: never;
151
+ } | {
152
+ path?: Path.RemoveOperation;
153
+ pathId?: never;
154
+ } | {
155
+ path?: never;
156
+ pathId?: ForeignKey<"path">;
134
157
  })) & {
135
158
  [k: string]: any;
136
159
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
137
160
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
138
161
  };
139
- export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
140
- export declare type RemoveOperationData = {} & (({
162
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
163
+ export type RemoveOperationData = {} & (({
141
164
  relation?: Relation.UpdateOperation | Relation.RemoveOperation;
165
+ }) & ({
166
+ path?: Path.UpdateOperation | Path.RemoveOperation;
142
167
  }));
143
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
144
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
145
- export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
146
- export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
147
- export declare type EntityDef = {
168
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
169
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
170
+ export type RelationIdSubQuery = Selection<RelationIdProjection>;
171
+ export type PathIdSubQuery = Selection<PathIdProjection>;
172
+ export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
173
+ export type EntityDef = {
148
174
  Schema: Schema;
149
175
  OpSchema: OpSchema;
150
176
  Action: OakMakeAction<GenericAction> | string;
@@ -1,23 +1,17 @@
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
  relationId: {
8
8
  type: "ref",
9
9
  ref: "relation"
10
10
  },
11
- paths: {
11
+ pathId: {
12
12
  notNull: true,
13
- type: "object"
14
- },
15
- destEntity: {
16
- notNull: true,
17
- type: "varchar",
18
- params: {
19
- length: 32
20
- }
13
+ type: "ref",
14
+ ref: "path"
21
15
  },
22
16
  deActions: {
23
17
  notNull: true,
@@ -28,15 +22,18 @@ exports.desc = {
28
22
  actions: action_1.genericActions,
29
23
  indexes: [
30
24
  {
31
- name: 'index_entity_relation',
25
+ name: 'index_relation_path',
32
26
  attributes: [
33
27
  {
34
- name: 'destEntity'
28
+ name: "relationId",
35
29
  },
36
30
  {
37
- name: "relationId"
38
- },
39
- ]
31
+ name: "pathId",
32
+ }
33
+ ],
34
+ config: {
35
+ unique: true,
36
+ },
40
37
  }
41
38
  ]
42
39
  };
@@ -1,9 +1,8 @@
1
1
  export declare const ActionDefDict: {
2
2
  modi: {
3
- iState: import("../types").ActionDef<string, string>;
3
+ iState: import("..").ActionDef<string, string>;
4
4
  };
5
5
  user: {
6
- userState: import("../types").ActionDef<string, string>;
6
+ userState: import("..").ActionDef<string, string>;
7
7
  };
8
- userEntityGrant: {};
9
8
  };
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionDefDict = void 0;
4
- var Action_1 = require("./Modi/Action");
5
- var Action_2 = require("./User/Action");
6
- var Action_3 = require("./UserEntityGrant/Action");
4
+ const Action_1 = require("./Modi/Action");
5
+ const Action_2 = require("./User/Action");
7
6
  exports.ActionDefDict = {
8
7
  modi: Action_1.ActionDefDict,
9
- user: Action_2.ActionDefDict,
10
- userEntityGrant: Action_3.ActionDefDict
8
+ user: Action_2.ActionDefDict
11
9
  };
@@ -4,21 +4,25 @@ import { EntityDef as Modi } from "./Modi/Schema";
4
4
  import { EntityDef as ModiEntity } from "./ModiEntity/Schema";
5
5
  import { EntityDef as Oper } from "./Oper/Schema";
6
6
  import { EntityDef as OperEntity } from "./OperEntity/Schema";
7
+ import { EntityDef as Path } from "./Path/Schema";
7
8
  import { EntityDef as Relation } from "./Relation/Schema";
8
9
  import { EntityDef as RelationAuth } from "./RelationAuth/Schema";
9
10
  import { EntityDef as User } from "./User/Schema";
11
+ import { EntityDef as UserEntityClaim } from "./UserEntityClaim/Schema";
10
12
  import { EntityDef as UserEntityGrant } from "./UserEntityGrant/Schema";
11
13
  import { EntityDef as UserRelation } from "./UserRelation/Schema";
12
- export declare type EntityDict = {
14
+ export type EntityDict = {
13
15
  actionAuth: ActionAuth;
14
16
  i18n: I18n;
15
17
  modi: Modi;
16
18
  modiEntity: ModiEntity;
17
19
  oper: Oper;
18
20
  operEntity: OperEntity;
21
+ path: Path;
19
22
  relation: Relation;
20
23
  relationAuth: RelationAuth;
21
24
  user: User;
25
+ userEntityClaim: UserEntityClaim;
22
26
  userEntityGrant: UserEntityGrant;
23
27
  userRelation: UserRelation;
24
28
  };
@@ -6,15 +6,15 @@ import { String } from "../../types/DataType";
6
6
  import { EntityShape } from "../../types/Entity";
7
7
  import * as ModiEntity from "../ModiEntity/Schema";
8
8
  import * as OperEntity from "../OperEntity/Schema";
9
- export declare type OpSchema = EntityShape & {
9
+ export type OpSchema = EntityShape & {
10
10
  module: String<64>;
11
11
  position: String<188>;
12
12
  namespace: String<256>;
13
13
  language: String<32>;
14
14
  data: Object;
15
15
  };
16
- export declare type OpAttr = keyof OpSchema;
17
- export declare type Schema = EntityShape & {
16
+ export type OpAttr = keyof OpSchema;
17
+ export type Schema = EntityShape & {
18
18
  module: String<64>;
19
19
  position: String<188>;
20
20
  namespace: String<256>;
@@ -27,7 +27,7 @@ export declare type Schema = EntityShape & {
27
27
  } & {
28
28
  [A in ExpressionKey]?: any;
29
29
  };
30
- declare type AttrFilter = {
30
+ type AttrFilter = {
31
31
  id: Q_StringValue;
32
32
  $$createAt$$: Q_DateValue;
33
33
  $$seq$$: Q_StringValue;
@@ -40,8 +40,8 @@ declare type AttrFilter = {
40
40
  modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
41
41
  operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
42
42
  };
43
- export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
44
- export declare type Projection = {
43
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
44
+ export type Projection = {
45
45
  "#id"?: NodeId;
46
46
  [k: string]: any;
47
47
  id?: number;
@@ -66,10 +66,10 @@ export declare type Projection = {
66
66
  $entity: "operEntity";
67
67
  };
68
68
  } & Partial<ExprOp<OpAttr | string>>;
69
- declare type I18nIdProjection = OneOf<{
69
+ type I18nIdProjection = OneOf<{
70
70
  id: number;
71
71
  }>;
72
- export declare type SortAttr = {
72
+ export type SortAttr = {
73
73
  id: number;
74
74
  } | {
75
75
  $$createAt$$: number;
@@ -88,32 +88,32 @@ export declare type SortAttr = {
88
88
  } | {
89
89
  [k: string]: any;
90
90
  } | OneOf<ExprOp<OpAttr | string>>;
91
- export declare type SortNode = {
91
+ export type SortNode = {
92
92
  $attr: SortAttr;
93
93
  $direction?: "asc" | "desc";
94
94
  };
95
- export declare type Sorter = SortNode[];
96
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
97
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
98
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
99
- export declare type CreateOperationData = FormCreateData<OpSchema> & {
95
+ export type Sorter = SortNode[];
96
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
97
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
98
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
99
+ export type CreateOperationData = FormCreateData<OpSchema> & {
100
100
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
101
101
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
102
102
  };
103
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
104
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
105
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
106
- export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
103
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
104
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
105
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
106
+ export type UpdateOperationData = FormUpdateData<OpSchema> & {
107
107
  [k: string]: any;
108
108
  modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
109
109
  operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
110
110
  };
111
- export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
112
- export declare type RemoveOperationData = {};
113
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
114
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
115
- export declare type I18nIdSubQuery = Selection<I18nIdProjection>;
116
- export declare type EntityDef = {
111
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
112
+ export type RemoveOperationData = {};
113
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
114
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
115
+ export type I18nIdSubQuery = Selection<I18nIdProjection>;
116
+ export type EntityDef = {
117
117
  Schema: Schema;
118
118
  OpSchema: OpSchema;
119
119
  Action: OakMakeAction<ReadOnlyAction> | 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
  module: {
@@ -45,15 +45,15 @@ exports.desc = {
45
45
  name: 'namespace_language',
46
46
  attributes: [
47
47
  {
48
- name: 'namespace'
48
+ name: 'namespace',
49
49
  },
50
50
  {
51
- name: 'language'
51
+ name: 'language',
52
52
  }
53
53
  ],
54
54
  config: {
55
- unique: true
56
- }
55
+ unique: true,
56
+ },
57
57
  }
58
58
  ]
59
59
  };
@@ -1,10 +1,10 @@
1
1
  import { ActionDef } from "../../types/Action";
2
2
  import { GenericAction } from "../../actions/action";
3
- export declare type IState = 'active' | 'applied' | 'abandoned' | string;
4
- export declare type IAction = 'apply' | 'abandon' | string;
5
- export declare type ParticularAction = IAction;
3
+ export type IState = 'active' | 'applied' | 'abandoned' | string;
4
+ export type IAction = 'apply' | 'abandon' | string;
5
+ export type ParticularAction = IAction;
6
6
  export declare const actions: string[];
7
- export declare type Action = GenericAction | ParticularAction | string;
7
+ export type Action = GenericAction | ParticularAction | string;
8
8
  export declare const ActionDefDict: {
9
9
  iState: ActionDef<string, string>;
10
10
  };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionDefDict = exports.actions = void 0;
4
- var IActionDef = {
4
+ const IActionDef = {
5
5
  stm: {
6
6
  apply: ['active', 'applied'],
7
- abandon: ['active', 'abandoned']
7
+ abandon: ['active', 'abandoned'],
8
8
  },
9
- is: 'active'
9
+ is: 'active',
10
10
  };
11
11
  exports.actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "apply", "abandon"];
12
12
  exports.ActionDefDict = {