oak-domain 4.0.3 → 4.2.0

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 (73) hide show
  1. package/lib/base-app-domain/ActionAuth/Schema.d.ts +1 -2
  2. package/lib/base-app-domain/ActionDefDict.d.ts +2 -2
  3. package/lib/base-app-domain/I18n/Schema.d.ts +1 -2
  4. package/lib/base-app-domain/Modi/Schema.d.ts +1 -2
  5. package/lib/base-app-domain/ModiEntity/Schema.d.ts +1 -2
  6. package/lib/base-app-domain/Oper/Schema.d.ts +8 -3
  7. package/lib/base-app-domain/Oper/Storage.js +19 -1
  8. package/lib/base-app-domain/OperEntity/Schema.d.ts +1 -2
  9. package/lib/base-app-domain/Path/Schema.d.ts +1 -2
  10. package/lib/base-app-domain/Relation/Schema.d.ts +1 -2
  11. package/lib/base-app-domain/RelationAuth/Schema.d.ts +1 -2
  12. package/lib/base-app-domain/User/Action.d.ts +1 -0
  13. package/lib/base-app-domain/User/Action.js +3 -3
  14. package/lib/base-app-domain/User/Schema.d.ts +1 -2
  15. package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +1 -2
  16. package/lib/base-app-domain/UserEntityGrant/Action.d.ts +5 -5
  17. package/lib/base-app-domain/UserEntityGrant/Action.js +5 -5
  18. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +1 -2
  19. package/lib/base-app-domain/UserRelation/Schema.d.ts +1 -2
  20. package/lib/compiler/localeBuilder.d.ts +27 -27
  21. package/lib/compiler/localeBuilder.js +215 -215
  22. package/lib/compiler/routerBuilder.js +263 -263
  23. package/lib/compiler/schemalBuilder.js +1058 -460
  24. package/lib/entities/Oper.d.ts +2 -1
  25. package/lib/entities/Oper.js +16 -1
  26. package/lib/entities/User.d.ts +10 -0
  27. package/lib/entities/User.js +3 -2
  28. package/lib/index.d.ts +0 -22
  29. package/lib/index.js +1 -35
  30. package/lib/store/AsyncRowStore.d.ts +2 -1
  31. package/lib/store/AsyncRowStore.js +180 -180
  32. package/lib/store/CascadeStore.js +7 -31
  33. package/lib/store/RelationAuth.d.ts +103 -103
  34. package/lib/store/RelationAuth.js +1209 -1343
  35. package/lib/store/SyncRowStore.d.ts +1 -1
  36. package/lib/store/TriggerExecutor.js +1 -1
  37. package/lib/store/actionDef.js +4 -4
  38. package/lib/store/checker.js +487 -487
  39. package/lib/triggers/index.d.ts +2 -2
  40. package/lib/triggers/index.js +21 -1
  41. package/lib/types/Aspect.d.ts +1 -1
  42. package/lib/types/Configuration.d.ts +42 -0
  43. package/lib/types/Configuration.js +3 -0
  44. package/lib/types/Connector.d.ts +1 -1
  45. package/lib/types/Context.d.ts +1 -1
  46. package/lib/types/Entity.d.ts +4 -4
  47. package/lib/types/Environment.d.ts +3 -0
  48. package/lib/types/Exception.d.ts +155 -155
  49. package/lib/types/Exception.js +436 -436
  50. package/lib/types/Sync.d.ts +48 -0
  51. package/lib/types/Sync.js +8 -0
  52. package/lib/types/index.d.ts +1 -0
  53. package/lib/types/index.js +1 -0
  54. package/lib/utils/SimpleConnector.d.ts +1 -1
  55. package/lib/utils/SimpleConnector.js +1 -1
  56. package/lib/utils/assert.d.ts +0 -1
  57. package/lib/utils/projection.d.ts +1 -1
  58. package/lib/utils/relationPath.d.ts +31 -0
  59. package/lib/utils/relationPath.js +202 -0
  60. package/package.json +51 -51
  61. package/src/entities/ActionAuth.ts +41 -41
  62. package/src/entities/I18n.ts +45 -45
  63. package/src/entities/Modi.ts +69 -69
  64. package/src/entities/ModiEntity.ts +26 -26
  65. package/src/entities/Oper.ts +48 -32
  66. package/src/entities/OperEntity.ts +27 -27
  67. package/src/entities/Path.ts +43 -43
  68. package/src/entities/Relation.ts +43 -43
  69. package/src/entities/RelationAuth.ts +44 -44
  70. package/src/entities/User.ts +48 -48
  71. package/src/entities/UserEntityClaim.ts +29 -29
  72. package/src/entities/UserEntityGrant.ts +24 -24
  73. package/src/entities/UserRelation.ts +50 -50
@@ -5,7 +5,7 @@ export declare abstract class SyncContext<ED extends EntityDict> implements Cont
5
5
  constructor(rowStore: SyncRowStore<ED, SyncContext<ED>>);
6
6
  abstract getCurrentUserId(allowUnloggedIn?: boolean): string | undefined;
7
7
  abstract isRoot(): boolean;
8
- abstract toString(): string;
8
+ abstract toString(): Promise<string>;
9
9
  begin(option?: TxnOption): void;
10
10
  commit(): void;
11
11
  rollback(): void;
@@ -232,7 +232,7 @@ class TriggerExecutor {
232
232
  const { f } = record;
233
233
  ids = f.id.$in;
234
234
  }
235
- const cxtStr = context.toString();
235
+ const cxtStr = await context.toString();
236
236
  this.onVolatileTrigger(entity, trigger, ids, cxtStr, option);
237
237
  });
238
238
  }
@@ -146,7 +146,7 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
146
146
  action: 'create',
147
147
  type: 'data',
148
148
  entity,
149
- priority: 10, // 优先级要高,先于真正的data检查进行
149
+ priority: 10,
150
150
  checker: (data) => {
151
151
  if (data instanceof Array) {
152
152
  data.forEach(ele => {
@@ -181,7 +181,7 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
181
181
  entity,
182
182
  action: 'create',
183
183
  type: 'logicalData',
184
- priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
184
+ priority: types_1.CHECKER_MAX_PRIORITY,
185
185
  checker: (operation, context) => {
186
186
  const { data } = operation;
187
187
  if (data instanceof Array) {
@@ -197,9 +197,9 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
197
197
  }
198
198
  }, {
199
199
  entity,
200
- action: 'update', // 只检查update,其它状态转换的action应该不会涉及unique约束的属性
200
+ action: 'update',
201
201
  type: 'logicalData',
202
- priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
202
+ priority: types_1.CHECKER_MAX_PRIORITY,
203
203
  checker: (operation, context) => {
204
204
  const { data, filter: operationFilter } = operation;
205
205
  if (data) {