oak-domain 3.0.3 → 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 (158) 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 +917 -1291
  76. package/lib/store/RelationAuth.d.ts +9 -16
  77. package/lib/store/RelationAuth.js +750 -908
  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 +118 -193
  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/Aspect.d.ts +1 -3
  98. package/lib/types/Auth.d.ts +15 -19
  99. package/lib/types/Connector.d.ts +19 -15
  100. package/lib/types/Connector.js +0 -7
  101. package/lib/types/DataType.d.ts +19 -18
  102. package/lib/types/DataType.js +1 -1
  103. package/lib/types/Demand.d.ts +25 -25
  104. package/lib/types/Endpoint.d.ts +1 -1
  105. package/lib/types/Entity.d.ts +57 -53
  106. package/lib/types/Entity.js +3 -3
  107. package/lib/types/EntityDesc.d.ts +2 -1
  108. package/lib/types/Environment.d.ts +4 -4
  109. package/lib/types/Exception.d.ts +29 -2
  110. package/lib/types/Exception.js +205 -205
  111. package/lib/types/Expression.d.ts +14 -14
  112. package/lib/types/Expression.js +54 -87
  113. package/lib/types/Geo.d.ts +6 -6
  114. package/lib/types/Locale.d.ts +5 -5
  115. package/lib/types/Polyfill.d.ts +9 -9
  116. package/lib/types/Port.d.ts +4 -4
  117. package/lib/types/RowStore.d.ts +3 -3
  118. package/lib/types/RowStore.js +18 -19
  119. package/lib/types/Storage.d.ts +5 -4
  120. package/lib/types/Style.d.ts +2 -2
  121. package/lib/types/Timer.d.ts +3 -3
  122. package/lib/types/Trigger.d.ts +30 -14
  123. package/lib/types/Trigger.js +6 -2
  124. package/lib/types/Watcher.d.ts +2 -2
  125. package/lib/types/index.d.ts +1 -0
  126. package/lib/types/index.js +2 -1
  127. package/lib/types/schema/DataTypes.d.ts +7 -7
  128. package/lib/utils/SimpleConnector.d.ts +24 -10
  129. package/lib/utils/SimpleConnector.js +166 -144
  130. package/lib/utils/assert.js +2 -2
  131. package/lib/utils/concurrent.d.ts +1 -1
  132. package/lib/utils/concurrent.js +31 -57
  133. package/lib/utils/date.js +2 -2
  134. package/lib/utils/geo.js +8 -8
  135. package/lib/utils/lodash.d.ts +3 -1
  136. package/lib/utils/lodash.js +21 -34
  137. package/lib/utils/mask.js +12 -13
  138. package/lib/utils/money.d.ts +1 -1
  139. package/lib/utils/money.js +22 -11
  140. package/lib/utils/projection.d.ts +4 -0
  141. package/lib/utils/projection.js +15 -0
  142. package/lib/utils/random/random.js +11 -16
  143. package/lib/utils/random/random.mp.js +7 -18
  144. package/lib/utils/random/random.web.js +6 -12
  145. package/lib/utils/string.d.ts +4 -4
  146. package/lib/utils/string.js +19 -32
  147. package/lib/utils/url.js +5 -4
  148. package/lib/utils/uuid.d.ts +1 -1
  149. package/lib/utils/uuid.js +46 -85
  150. package/lib/utils/validator.d.ts +4 -3
  151. package/lib/utils/validator.js +35 -32
  152. package/lib/utils/version.js +6 -6
  153. package/package.json +7 -7
  154. package/src/entities/ActionAuth.ts +10 -10
  155. package/src/entities/Path.ts +43 -0
  156. package/src/entities/RelationAuth.ts +2 -1
  157. package/src/entities/UserEntityClaim.ts +30 -0
  158. package/src/entities/UserEntityGrant.ts +9 -12
@@ -5,7 +5,7 @@ import { Action, ParticularAction, IState } from "./Action";
5
5
  import { String } from "../../types/DataType";
6
6
  import { EntityShape } from "../../types/Entity";
7
7
  import * as ModiEntity from "../ModiEntity/Schema";
8
- export declare type OpSchema = EntityShape & {
8
+ export type OpSchema = EntityShape & {
9
9
  targetEntity: String<32>;
10
10
  entity: String<32>;
11
11
  entityId: String<64>;
@@ -15,8 +15,8 @@ export declare type OpSchema = EntityShape & {
15
15
  extra?: Object | null;
16
16
  iState?: IState | null;
17
17
  };
18
- export declare type OpAttr = keyof OpSchema;
19
- export declare type Schema = EntityShape & {
18
+ export type OpAttr = keyof OpSchema;
19
+ export type Schema = EntityShape & {
20
20
  targetEntity: String<32>;
21
21
  entity: String<32>;
22
22
  entityId: String<64>;
@@ -30,7 +30,7 @@ export declare type Schema = EntityShape & {
30
30
  } & {
31
31
  [A in ExpressionKey]?: any;
32
32
  };
33
- declare type AttrFilter = {
33
+ type AttrFilter = {
34
34
  id: Q_StringValue;
35
35
  $$createAt$$: Q_DateValue;
36
36
  $$seq$$: Q_StringValue;
@@ -45,8 +45,8 @@ declare type AttrFilter = {
45
45
  iState: Q_EnumValue<IState>;
46
46
  modiEntity$modi: ModiEntity.Filter & SubQueryPredicateMetadata;
47
47
  };
48
- export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
49
- export declare type Projection = {
48
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
49
+ export type Projection = {
50
50
  "#id"?: NodeId;
51
51
  [k: string]: any;
52
52
  id?: number;
@@ -68,10 +68,10 @@ export declare type Projection = {
68
68
  $entity: "modiEntity";
69
69
  };
70
70
  } & Partial<ExprOp<OpAttr | string>>;
71
- declare type ModiIdProjection = OneOf<{
71
+ type ModiIdProjection = OneOf<{
72
72
  id: number;
73
73
  }>;
74
- export declare type SortAttr = {
74
+ export type SortAttr = {
75
75
  id: number;
76
76
  } | {
77
77
  $$createAt$$: number;
@@ -92,34 +92,34 @@ export declare type SortAttr = {
92
92
  } | {
93
93
  [k: string]: any;
94
94
  } | OneOf<ExprOp<OpAttr | string>>;
95
- export declare type SortNode = {
95
+ export type SortNode = {
96
96
  $attr: SortAttr;
97
97
  $direction?: "asc" | "desc";
98
98
  };
99
- export declare type Sorter = SortNode[];
100
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
101
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
102
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
103
- export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
99
+ export type Sorter = SortNode[];
100
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
101
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
102
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
103
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
104
104
  entity?: string;
105
105
  entityId?: string;
106
106
  [K: string]: any;
107
107
  }) & {
108
108
  modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
109
109
  };
110
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
111
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
112
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
113
- export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
110
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
111
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
112
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
113
+ export type UpdateOperationData = FormUpdateData<OpSchema> & {
114
114
  [k: string]: any;
115
115
  modiEntity$modi?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "modi" | "modiId">>>;
116
116
  };
117
- export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
118
- export declare type RemoveOperationData = {};
119
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
120
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
121
- export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
122
- export declare type EntityDef = {
117
+ export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
118
+ export type RemoveOperationData = {};
119
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
120
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
121
+ export type ModiIdSubQuery = Selection<ModiIdProjection>;
122
+ export type EntityDef = {
123
123
  Schema: Schema;
124
124
  OpSchema: OpSchema;
125
125
  Action: OakMakeAction<Action> | 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
  targetEntity: {
@@ -55,9 +55,9 @@ exports.desc = {
55
55
  attributes: [
56
56
  {
57
57
  name: 'iState',
58
- direction: 'ASC'
58
+ direction: 'ASC',
59
59
  }
60
- ]
60
+ ],
61
61
  }
62
62
  ]
63
63
  };
@@ -8,51 +8,57 @@ import { EntityShape } from "../../types/Entity";
8
8
  import * as Modi from "../Modi/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
  modiId: ForeignKey<"modi">;
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
  modiId: ForeignKey<"modi">;
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
  modi: Modi.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
  modiId: Q_StringValue;
43
47
  modi: Modi.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 ModiEntityIdProjection = OneOf<{
82
+ type ModiEntityIdProjection = OneOf<{
75
83
  id: number;
76
84
  }>;
77
- declare type ModiIdProjection = OneOf<{
85
+ type ModiIdProjection = OneOf<{
78
86
  modiId: 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,21 +149,22 @@ 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" | "modiId">> & (({
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" | "modiId">> & (({
143
161
  modiId?: never;
144
162
  modi: Modi.CreateSingleOperation;
145
163
  } | {
146
164
  modiId: ForeignKey<"modi">;
147
165
  modi?: Modi.UpdateOperation;
148
166
  } | {
167
+ modi?: never;
149
168
  modiId: ForeignKey<"modi">;
150
169
  })) & ({
151
170
  entity?: never;
@@ -154,13 +173,27 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
154
173
  } | {
155
174
  entity: "actionAuth";
156
175
  entityId: ForeignKey<"ActionAuth">;
157
- actionAuth: ActionAuth.UpdateOperation;
176
+ actionAuth?: ActionAuth.UpdateOperation;
158
177
  } | {
159
178
  entity: "actionAuth";
160
179
  entityId: ForeignKey<"ActionAuth">;
180
+ actionAuth?: never;
161
181
  } | {
162
182
  entity: "i18n";
163
183
  entityId: ForeignKey<"I18n">;
184
+ i18n?: never;
185
+ } | {
186
+ entity?: never;
187
+ entityId?: never;
188
+ path: Path.CreateSingleOperation;
189
+ } | {
190
+ entity: "path";
191
+ entityId: ForeignKey<"Path">;
192
+ path?: Path.UpdateOperation;
193
+ } | {
194
+ entity: "path";
195
+ entityId: ForeignKey<"Path">;
196
+ path?: never;
164
197
  } | {
165
198
  entity?: never;
166
199
  entityId?: never;
@@ -168,10 +201,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
168
201
  } | {
169
202
  entity: "relation";
170
203
  entityId: ForeignKey<"Relation">;
171
- relation: Relation.UpdateOperation;
204
+ relation?: Relation.UpdateOperation;
172
205
  } | {
173
206
  entity: "relation";
174
207
  entityId: ForeignKey<"Relation">;
208
+ relation?: never;
175
209
  } | {
176
210
  entity?: never;
177
211
  entityId?: never;
@@ -179,10 +213,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
179
213
  } | {
180
214
  entity: "relationAuth";
181
215
  entityId: ForeignKey<"RelationAuth">;
182
- relationAuth: RelationAuth.UpdateOperation;
216
+ relationAuth?: RelationAuth.UpdateOperation;
183
217
  } | {
184
218
  entity: "relationAuth";
185
219
  entityId: ForeignKey<"RelationAuth">;
220
+ relationAuth?: never;
186
221
  } | {
187
222
  entity?: never;
188
223
  entityId?: never;
@@ -190,10 +225,23 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
190
225
  } | {
191
226
  entity: "user";
192
227
  entityId: ForeignKey<"User">;
193
- user: User.UpdateOperation;
228
+ user?: User.UpdateOperation;
194
229
  } | {
195
230
  entity: "user";
196
231
  entityId: ForeignKey<"User">;
232
+ user?: never;
233
+ } | {
234
+ entity?: never;
235
+ entityId?: never;
236
+ userEntityClaim: UserEntityClaim.CreateSingleOperation;
237
+ } | {
238
+ entity: "userEntityClaim";
239
+ entityId: ForeignKey<"UserEntityClaim">;
240
+ userEntityClaim?: UserEntityClaim.UpdateOperation;
241
+ } | {
242
+ entity: "userEntityClaim";
243
+ entityId: ForeignKey<"UserEntityClaim">;
244
+ userEntityClaim?: never;
197
245
  } | {
198
246
  entity?: never;
199
247
  entityId?: never;
@@ -201,10 +249,11 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
201
249
  } | {
202
250
  entity: "userEntityGrant";
203
251
  entityId: ForeignKey<"UserEntityGrant">;
204
- userEntityGrant: UserEntityGrant.UpdateOperation;
252
+ userEntityGrant?: UserEntityGrant.UpdateOperation;
205
253
  } | {
206
254
  entity: "userEntityGrant";
207
255
  entityId: ForeignKey<"UserEntityGrant">;
256
+ userEntityGrant?: never;
208
257
  } | {
209
258
  entity?: never;
210
259
  entityId?: never;
@@ -212,34 +261,39 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
212
261
  } | {
213
262
  entity: "userRelation";
214
263
  entityId: ForeignKey<"UserRelation">;
215
- userRelation: UserRelation.UpdateOperation;
264
+ userRelation?: UserRelation.UpdateOperation;
216
265
  } | {
217
266
  entity: "userRelation";
218
267
  entityId: ForeignKey<"UserRelation">;
268
+ userRelation?: never;
219
269
  } | {
220
270
  entity?: string;
221
271
  entityId?: string;
222
272
  [K: string]: any;
223
273
  });
224
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
225
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
226
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
227
- export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
228
- modi: Modi.CreateSingleOperation;
274
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
275
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
276
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
277
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "modiId">> & (({
278
+ modi?: Modi.CreateSingleOperation;
229
279
  modiId?: never;
230
280
  } | {
231
- modi: Modi.UpdateOperation;
281
+ modi?: Modi.UpdateOperation;
232
282
  modiId?: never;
233
283
  } | {
234
- modi: Modi.RemoveOperation;
284
+ modi?: Modi.RemoveOperation;
235
285
  modiId?: never;
236
286
  } | {
237
287
  modi?: never;
238
- modiId?: ForeignKey<"modi"> | null;
288
+ modiId?: ForeignKey<"modi">;
239
289
  })) & ({
240
290
  actionAuth?: ActionAuth.CreateSingleOperation | ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
241
291
  entityId?: never;
242
292
  entity?: never;
293
+ } | {
294
+ path?: Path.CreateSingleOperation | Path.UpdateOperation | Path.RemoveOperation;
295
+ entityId?: never;
296
+ entity?: never;
243
297
  } | {
244
298
  relation?: Relation.CreateSingleOperation | Relation.UpdateOperation | Relation.RemoveOperation;
245
299
  entityId?: never;
@@ -252,6 +306,10 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
252
306
  user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
253
307
  entityId?: never;
254
308
  entity?: never;
309
+ } | {
310
+ userEntityClaim?: UserEntityClaim.CreateSingleOperation | UserEntityClaim.UpdateOperation | UserEntityClaim.RemoveOperation;
311
+ entityId?: never;
312
+ entity?: never;
255
313
  } | {
256
314
  userEntityGrant?: UserEntityGrant.CreateSingleOperation | UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
257
315
  entityId?: never;
@@ -261,22 +319,35 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
261
319
  entityId?: never;
262
320
  entity?: never;
263
321
  } | {
264
- entity?: ("actionAuth" | "i18n" | "relation" | "relationAuth" | "user" | "userEntityGrant" | "userRelation" | string) | null;
265
- entityId?: ForeignKey<"ActionAuth" | "I18n" | "Relation" | "RelationAuth" | "User" | "UserEntityGrant" | "UserRelation"> | null;
322
+ entity?: ("actionAuth" | "i18n" | "path" | "relation" | "relationAuth" | "user" | "userEntityClaim" | "userEntityGrant" | "userRelation" | string) | null;
323
+ entityId?: ForeignKey<"ActionAuth" | "I18n" | "Path" | "Relation" | "RelationAuth" | "User" | "UserEntityClaim" | "UserEntityGrant" | "UserRelation"> | null;
324
+ actionAuth?: never;
325
+ i18n?: never;
326
+ path?: never;
327
+ relation?: never;
328
+ relationAuth?: never;
329
+ user?: never;
330
+ userEntityClaim?: never;
331
+ userEntityGrant?: never;
332
+ userRelation?: never;
266
333
  }) & {
267
334
  [k: string]: any;
268
335
  };
269
- export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
270
- export declare type RemoveOperationData = {} & (({
336
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
337
+ export type RemoveOperationData = {} & (({
271
338
  modi?: Modi.UpdateOperation | Modi.RemoveOperation;
272
339
  })) & ({
273
340
  actionAuth?: ActionAuth.UpdateOperation | ActionAuth.RemoveOperation;
341
+ } | {
342
+ path?: Path.UpdateOperation | Path.RemoveOperation;
274
343
  } | {
275
344
  relation?: Relation.UpdateOperation | Relation.RemoveOperation;
276
345
  } | {
277
346
  relationAuth?: RelationAuth.UpdateOperation | RelationAuth.RemoveOperation;
278
347
  } | {
279
348
  user?: User.UpdateOperation | User.RemoveOperation;
349
+ } | {
350
+ userEntityClaim?: UserEntityClaim.UpdateOperation | UserEntityClaim.RemoveOperation;
280
351
  } | {
281
352
  userEntityGrant?: UserEntityGrant.UpdateOperation | UserEntityGrant.RemoveOperation;
282
353
  } | {
@@ -284,18 +355,20 @@ export declare type RemoveOperationData = {} & (({
284
355
  } | {
285
356
  [k: string]: any;
286
357
  });
287
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
288
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
289
- export declare type ModiIdSubQuery = Selection<ModiIdProjection>;
290
- export declare type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
291
- export declare type I18nIdSubQuery = Selection<I18nIdProjection>;
292
- export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
293
- export declare type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
294
- export declare type UserIdSubQuery = Selection<UserIdProjection>;
295
- export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
296
- export declare type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
297
- export declare type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
298
- export declare type EntityDef = {
358
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
359
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
360
+ export type ModiIdSubQuery = Selection<ModiIdProjection>;
361
+ export type ActionAuthIdSubQuery = Selection<ActionAuthIdProjection>;
362
+ export type I18nIdSubQuery = Selection<I18nIdProjection>;
363
+ export type PathIdSubQuery = Selection<PathIdProjection>;
364
+ export type RelationIdSubQuery = Selection<RelationIdProjection>;
365
+ export type RelationAuthIdSubQuery = Selection<RelationAuthIdProjection>;
366
+ export type UserIdSubQuery = Selection<UserIdProjection>;
367
+ export type UserEntityClaimIdSubQuery = Selection<UserEntityClaimIdProjection>;
368
+ export type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
369
+ export type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
370
+ export type ModiEntityIdSubQuery = Selection<ModiEntityIdProjection>;
371
+ export type EntityDef = {
299
372
  Schema: Schema;
300
373
  OpSchema: OpSchema;
301
374
  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
  modiId: {
@@ -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,
@@ -7,7 +7,7 @@ import { String } from "../../types/DataType";
7
7
  import { EntityShape } from "../../types/Entity";
8
8
  import * as User from "../User/Schema";
9
9
  import * as OperEntity from "../OperEntity/Schema";
10
- export declare type OpSchema = EntityShape & {
10
+ export type OpSchema = EntityShape & {
11
11
  action: String<16>;
12
12
  data: Object;
13
13
  filter?: Object | null;
@@ -15,8 +15,8 @@ export declare type OpSchema = EntityShape & {
15
15
  operatorId?: ForeignKey<"user"> | null;
16
16
  targetEntity: String<32>;
17
17
  };
18
- export declare type OpAttr = keyof OpSchema;
19
- export declare type Schema = EntityShape & {
18
+ export type OpAttr = keyof OpSchema;
19
+ export type Schema = EntityShape & {
20
20
  action: String<16>;
21
21
  data: Object;
22
22
  filter?: Object | null;
@@ -29,7 +29,7 @@ export declare type Schema = EntityShape & {
29
29
  } & {
30
30
  [A in ExpressionKey]?: any;
31
31
  };
32
- declare type AttrFilter = {
32
+ type AttrFilter = {
33
33
  id: Q_StringValue;
34
34
  $$createAt$$: Q_DateValue;
35
35
  $$seq$$: Q_StringValue;
@@ -43,8 +43,8 @@ declare type AttrFilter = {
43
43
  targetEntity: Q_StringValue;
44
44
  operEntity$oper: OperEntity.Filter & SubQueryPredicateMetadata;
45
45
  };
46
- export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
47
- export declare type Projection = {
46
+ export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
47
+ export type Projection = {
48
48
  "#id"?: NodeId;
49
49
  [k: string]: any;
50
50
  id?: number;
@@ -65,13 +65,13 @@ export declare type Projection = {
65
65
  $entity: "operEntity";
66
66
  };
67
67
  } & Partial<ExprOp<OpAttr | string>>;
68
- declare type OperIdProjection = OneOf<{
68
+ type OperIdProjection = OneOf<{
69
69
  id: number;
70
70
  }>;
71
- declare type UserIdProjection = OneOf<{
71
+ type UserIdProjection = OneOf<{
72
72
  operatorId: number;
73
73
  }>;
74
- export declare type SortAttr = {
74
+ export type SortAttr = {
75
75
  id: number;
76
76
  } | {
77
77
  $$createAt$$: number;
@@ -90,36 +90,37 @@ export declare type SortAttr = {
90
90
  } | {
91
91
  [k: string]: any;
92
92
  } | OneOf<ExprOp<OpAttr | string>>;
93
- export declare type SortNode = {
93
+ export type SortNode = {
94
94
  $attr: SortAttr;
95
95
  $direction?: "asc" | "desc";
96
96
  };
97
- export declare type Sorter = SortNode[];
98
- export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
99
- export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
100
- export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
101
- export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
97
+ export type Sorter = SortNode[];
98
+ export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
99
+ export type Selection<P extends Object = Projection> = SelectOperation<P>;
100
+ export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
101
+ export type CreateOperationData = FormCreateData<Omit<OpSchema, "operatorId">> & (({
102
102
  operatorId?: never;
103
103
  operator?: User.CreateSingleOperation;
104
104
  } | {
105
105
  operatorId: ForeignKey<"operator">;
106
106
  operator?: User.UpdateOperation;
107
107
  } | {
108
+ operator?: never;
108
109
  operatorId?: ForeignKey<"operator">;
109
110
  })) & {
110
111
  operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
111
112
  };
112
- export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
113
- export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
114
- export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
115
- export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
116
- operator: User.CreateSingleOperation;
113
+ export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
114
+ export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
115
+ export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
116
+ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operatorId">> & (({
117
+ operator?: User.CreateSingleOperation;
117
118
  operatorId?: never;
118
119
  } | {
119
- operator: User.UpdateOperation;
120
+ operator?: User.UpdateOperation;
120
121
  operatorId?: never;
121
122
  } | {
122
- operator: User.RemoveOperation;
123
+ operator?: User.RemoveOperation;
123
124
  operatorId?: never;
124
125
  } | {
125
126
  operator?: never;
@@ -128,15 +129,15 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "operato
128
129
  [k: string]: any;
129
130
  operEntity$oper?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "oper" | "operId">>>;
130
131
  };
131
- export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
132
- export declare type RemoveOperationData = {} & (({
132
+ export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
133
+ export type RemoveOperationData = {} & (({
133
134
  operator?: User.UpdateOperation | User.RemoveOperation;
134
135
  }));
135
- export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
136
- export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
137
- export declare type UserIdSubQuery = Selection<UserIdProjection>;
138
- export declare type OperIdSubQuery = Selection<OperIdProjection>;
139
- export declare type EntityDef = {
136
+ export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
137
+ export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
138
+ export type UserIdSubQuery = Selection<UserIdProjection>;
139
+ export type OperIdSubQuery = Selection<OperIdProjection>;
140
+ export type EntityDef = {
140
141
  Schema: Schema;
141
142
  OpSchema: OpSchema;
142
143
  Action: OakMakeAction<AppendOnlyAction> | string;