oak-domain 5.1.2 → 5.1.3

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.
@@ -79,7 +79,7 @@ function createUniqueCheckers(schema) {
79
79
  entity,
80
80
  action: 'create',
81
81
  type: 'logicalData',
82
- priority: types_1.CHECKER_MAX_PRIORITY,
82
+ priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
83
83
  checker: (operation, context) => {
84
84
  const { data } = operation;
85
85
  if (data instanceof Array) {
@@ -95,9 +95,9 @@ function createUniqueCheckers(schema) {
95
95
  }
96
96
  }, {
97
97
  entity,
98
- action: 'update',
98
+ action: 'update', // 只检查update,其它状态转换的action应该不会涉及unique约束的属性
99
99
  type: 'logicalData',
100
- priority: types_1.CHECKER_MAX_PRIORITY,
100
+ priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
101
101
  checker: (operation, context) => {
102
102
  const { data, filter: operationFilter } = operation;
103
103
  if (data) {
@@ -227,7 +227,7 @@ function createActionTransformerCheckers(actionDefDict) {
227
227
  action: 'create',
228
228
  type: 'logical',
229
229
  entity,
230
- priority: 10,
230
+ priority: 10, // 优先级要高,先于真正的data检查进行
231
231
  checker: (operation) => {
232
232
  const { data } = operation;
233
233
  if (data instanceof Array) {
@@ -64,6 +64,8 @@ export interface SyncRemoteConfig<ED extends EntityDict & BaseEntityDict, Cxt ex
64
64
  * 同步失败回调
65
65
  */
66
66
  onFailed?: (result: {
67
+ remoteEntity: keyof ED;
68
+ remoteEntityId: string;
67
69
  data: {
68
70
  entity: keyof ED;
69
71
  action: ED[keyof ED]['Action'];
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  * 防止assert打包体积过大,从这里引用
3
4
  */
@@ -60,7 +60,7 @@ function destructRelationPath(schema, entity, path, relationFilter, recursive) {
60
60
  },
61
61
  filter: relationFilter,
62
62
  } // as ED['userRelation']['Selection']
63
- },
63
+ }, // as ED[keyof ED]['Selection']['data'],
64
64
  getData: (d) => {
65
65
  return d.userRelation$entity;
66
66
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-domain",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "author": {
5
5
  "name": "XuChang"
6
6
  },