oak-domain 5.1.15 → 5.1.17

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 (99) hide show
  1. package/lib/base-app-domain/ActionAuth/Schema.d.ts +19 -171
  2. package/lib/base-app-domain/ActionAuth/Schema.js +2 -0
  3. package/lib/base-app-domain/ActionAuth/_baseSchema.d.ts +44 -0
  4. package/lib/base-app-domain/ActionAuth/_baseSchema.js +2 -0
  5. package/lib/base-app-domain/EntityDict.d.ts +695 -14
  6. package/lib/base-app-domain/I18n/Schema.d.ts +19 -129
  7. package/lib/base-app-domain/I18n/Schema.js +2 -0
  8. package/lib/base-app-domain/I18n/_baseSchema.d.ts +51 -0
  9. package/lib/base-app-domain/I18n/_baseSchema.js +2 -0
  10. package/lib/base-app-domain/Log/Schema.d.ts +19 -141
  11. package/lib/base-app-domain/Log/Schema.js +2 -0
  12. package/lib/base-app-domain/Log/Style.d.ts +2 -2
  13. package/lib/base-app-domain/Log/_baseSchema.d.ts +44 -0
  14. package/lib/base-app-domain/Log/_baseSchema.js +2 -0
  15. package/lib/base-app-domain/Modi/Schema.d.ts +19 -130
  16. package/lib/base-app-domain/Modi/Schema.js +2 -0
  17. package/lib/base-app-domain/Modi/Style.d.ts +2 -2
  18. package/lib/base-app-domain/Modi/_baseSchema.d.ts +61 -0
  19. package/lib/base-app-domain/Modi/_baseSchema.js +2 -0
  20. package/lib/base-app-domain/ModiEntity/Schema.d.ts +19 -367
  21. package/lib/base-app-domain/ModiEntity/Schema.js +2 -0
  22. package/lib/base-app-domain/ModiEntity/Storage.js +1 -2
  23. package/lib/base-app-domain/ModiEntity/_baseSchema.d.ts +44 -0
  24. package/lib/base-app-domain/ModiEntity/_baseSchema.js +2 -0
  25. package/lib/base-app-domain/Oper/Schema.d.ts +19 -201
  26. package/lib/base-app-domain/Oper/Schema.js +2 -0
  27. package/lib/base-app-domain/Oper/Style.d.ts +2 -2
  28. package/lib/base-app-domain/Oper/_baseSchema.d.ts +67 -0
  29. package/lib/base-app-domain/Oper/_baseSchema.js +2 -0
  30. package/lib/base-app-domain/OperEntity/Schema.d.ts +19 -367
  31. package/lib/base-app-domain/OperEntity/Schema.js +2 -0
  32. package/lib/base-app-domain/OperEntity/Storage.js +1 -2
  33. package/lib/base-app-domain/OperEntity/_baseSchema.d.ts +44 -0
  34. package/lib/base-app-domain/OperEntity/_baseSchema.js +2 -0
  35. package/lib/base-app-domain/Path/Schema.d.ts +19 -157
  36. package/lib/base-app-domain/Path/Schema.js +2 -0
  37. package/lib/base-app-domain/Path/_baseSchema.d.ts +52 -0
  38. package/lib/base-app-domain/Path/_baseSchema.js +2 -0
  39. package/lib/base-app-domain/Relation/Schema.d.ts +19 -198
  40. package/lib/base-app-domain/Relation/Schema.js +2 -0
  41. package/lib/base-app-domain/Relation/_baseSchema.d.ts +48 -0
  42. package/lib/base-app-domain/Relation/_baseSchema.js +2 -0
  43. package/lib/base-app-domain/RelationAuth/Schema.d.ts +19 -199
  44. package/lib/base-app-domain/RelationAuth/Schema.js +2 -0
  45. package/lib/base-app-domain/RelationAuth/_baseSchema.d.ts +41 -0
  46. package/lib/base-app-domain/RelationAuth/_baseSchema.js +2 -0
  47. package/lib/base-app-domain/User/Schema.d.ts +19 -222
  48. package/lib/base-app-domain/User/Schema.js +2 -0
  49. package/lib/base-app-domain/User/Style.d.ts +2 -2
  50. package/lib/base-app-domain/User/_baseSchema.d.ts +53 -0
  51. package/lib/base-app-domain/User/_baseSchema.js +2 -0
  52. package/lib/base-app-domain/UserEntityClaim/Schema.d.ts +19 -264
  53. package/lib/base-app-domain/UserEntityClaim/Schema.js +2 -0
  54. package/lib/base-app-domain/UserEntityClaim/_baseSchema.d.ts +49 -0
  55. package/lib/base-app-domain/UserEntityClaim/_baseSchema.js +2 -0
  56. package/lib/base-app-domain/UserEntityGrant/Schema.d.ts +19 -136
  57. package/lib/base-app-domain/UserEntityGrant/Schema.js +2 -0
  58. package/lib/base-app-domain/UserEntityGrant/_baseSchema.d.ts +46 -0
  59. package/lib/base-app-domain/UserEntityGrant/_baseSchema.js +2 -0
  60. package/lib/base-app-domain/UserRelation/Schema.d.ts +19 -212
  61. package/lib/base-app-domain/UserRelation/Schema.js +2 -0
  62. package/lib/base-app-domain/UserRelation/_baseSchema.d.ts +47 -0
  63. package/lib/base-app-domain/UserRelation/_baseSchema.js +2 -0
  64. package/lib/compiler/localeBuilder.d.ts +1 -0
  65. package/lib/compiler/localeBuilder.js +9 -2
  66. package/lib/compiler/schemalBuilder.d.ts +1 -0
  67. package/lib/compiler/schemalBuilder.js +1368 -186
  68. package/lib/data/i18n.d.ts +3 -0
  69. package/lib/data/i18n.js +32 -0
  70. package/lib/store/CascadeStore.d.ts +3 -3
  71. package/lib/store/CascadeStore.js +60 -54
  72. package/lib/store/RelationAuth.d.ts +1 -1
  73. package/lib/store/RelationAuth.js +6 -6
  74. package/lib/store/TriggerExecutor.js +11 -5
  75. package/lib/store/checker.js +4 -4
  76. package/lib/store/filter.d.ts +11 -11
  77. package/lib/store/filter.js +14 -8
  78. package/lib/store/modi.d.ts +2 -2
  79. package/lib/store/modi.js +72 -70
  80. package/lib/store/triggers.js +14 -14
  81. package/lib/timers/vaccum.d.ts +1 -1
  82. package/lib/types/Auth.d.ts +6 -5
  83. package/lib/types/Cluster.d.ts +1 -0
  84. package/lib/types/Configuration.d.ts +9 -0
  85. package/lib/types/Entity.d.ts +5 -1
  86. package/lib/types/EntityDesc.d.ts +1 -1
  87. package/lib/types/Exception.d.ts +26 -21
  88. package/lib/types/Exception.js +81 -71
  89. package/lib/types/Expression.d.ts +4 -1
  90. package/lib/types/Port.d.ts +1 -1
  91. package/lib/types/Trigger.d.ts +1 -1
  92. package/lib/types/Watcher.d.ts +3 -3
  93. package/lib/utils/projection.d.ts +2 -2
  94. package/lib/utils/relationPath.d.ts +4 -4
  95. package/lib/utils/relationPath.js +1 -1
  96. package/lib/utils/row.d.ts +8 -0
  97. package/lib/utils/row.js +8 -0
  98. package/lib/utils/validator.d.ts +2 -2
  99. package/package.json +2 -2
package/lib/store/modi.js CHANGED
@@ -73,42 +73,79 @@ function createModiRelatedCheckers(schema) {
73
73
  continue;
74
74
  }
75
75
  const restActions = (0, lodash_1.difference)(actions, action_1.appendOnlyActions);
76
- checkers.push({
77
- entity,
78
- action: restActions,
79
- type: 'row',
80
- filter: (operation, context, option) => {
81
- /**
82
- * 只有一种情况可以通过,即当前是在更新和active的modi所指向同一个父更新对象。
83
- * 比如:先申请了一个公司(company),再申请修改公司(companyApplyment),这时所有的active modi都指向此条companyApplyment
84
- * 这时:
85
- * 1)再申请一条新的修改公司(create companyApplyment),应被拒绝
86
- * 2)申请修改原来的companyApplyment(update companyApplyment),可以通过
87
- * 3)在其它路径上对此company对象进行直接的更新,应被拒绝
88
- */
89
- if (option.modiParentEntity) {
90
- const { modiParentEntity, modiParentId } = option;
91
- (0, assert_1.default)(modiParentEntity);
92
- (0, assert_1.default)(modiParentId);
76
+ if (!process.env.OAK_DISABLE_MODI_LOCK) {
77
+ checkers.push({
78
+ entity,
79
+ action: restActions,
80
+ type: 'row',
81
+ filter: (operation, context, option) => {
82
+ /**
83
+ * 只有一种情况可以通过,即当前是在更新和activemodi所指向同一个父更新对象。
84
+ * 比如:先申请了一个公司(company),再申请修改公司(companyApplyment),这时所有的active modi都指向此条companyApplyment
85
+ * 这时:
86
+ * 1)再申请一条新的修改公司(create companyApplyment),应被拒绝
87
+ * 2)申请修改原来的companyApplyment(update companyApplyment),可以通过
88
+ * 3)在其它路径上对此company对象进行直接的更新,应被拒绝
89
+ */
90
+ if (option.modiParentEntity) {
91
+ const { modiParentEntity, modiParentId } = option;
92
+ (0, assert_1.default)(modiParentEntity);
93
+ (0, assert_1.default)(modiParentId);
94
+ return {
95
+ modiEntity$entity: {
96
+ '#sqp': 'not in',
97
+ entity,
98
+ modi: {
99
+ iState: 'active',
100
+ $or: [
101
+ {
102
+ entity: {
103
+ $ne: modiParentEntity,
104
+ },
105
+ },
106
+ {
107
+ entityId: {
108
+ $ne: modiParentId,
109
+ },
110
+ }
111
+ ],
112
+ },
113
+ },
114
+ /* id: {
115
+ $nin: {
116
+ entity: 'modiEntity',
117
+ data: {
118
+ entityId: 1,
119
+ },
120
+ filter: {
121
+ entity,
122
+ modi: {
123
+ iState: 'active',
124
+ $or: [
125
+ {
126
+ entity: {
127
+ $ne: modiParentEntity,
128
+ },
129
+ },
130
+ {
131
+ entityId: {
132
+ $ne: modiParentId,
133
+ },
134
+ }
135
+ ],
136
+ },
137
+ },
138
+ },
139
+ } */
140
+ };
141
+ }
93
142
  return {
94
143
  modiEntity$entity: {
95
144
  '#sqp': 'not in',
96
145
  entity,
97
146
  modi: {
98
147
  iState: 'active',
99
- $or: [
100
- {
101
- entity: {
102
- $ne: modiParentEntity,
103
- },
104
- },
105
- {
106
- entityId: {
107
- $ne: modiParentId,
108
- },
109
- }
110
- ],
111
- },
148
+ }
112
149
  },
113
150
  /* id: {
114
151
  $nin: {
@@ -120,50 +157,15 @@ function createModiRelatedCheckers(schema) {
120
157
  entity,
121
158
  modi: {
122
159
  iState: 'active',
123
- $or: [
124
- {
125
- entity: {
126
- $ne: modiParentEntity,
127
- },
128
- },
129
- {
130
- entityId: {
131
- $ne: modiParentId,
132
- },
133
- }
134
- ],
135
- },
160
+ }
136
161
  },
137
162
  },
138
163
  } */
139
164
  };
140
- }
141
- return {
142
- modiEntity$entity: {
143
- '#sqp': 'not in',
144
- entity,
145
- modi: {
146
- iState: 'active',
147
- }
148
- },
149
- /* id: {
150
- $nin: {
151
- entity: 'modiEntity',
152
- data: {
153
- entityId: 1,
154
- },
155
- filter: {
156
- entity,
157
- modi: {
158
- iState: 'active',
159
- }
160
- },
161
- },
162
- } */
163
- };
164
- },
165
- errMsg: '您请求的更新对象上还有正在申请的更新,请等该更新结束后再试',
166
- });
165
+ },
166
+ errMsg: '您请求的更新对象上还有正在申请的更新,请等该更新结束后再试',
167
+ });
168
+ }
167
169
  }
168
170
  return checkers;
169
171
  }
@@ -91,13 +91,13 @@ async function undoLog(log, context) {
91
91
  action: 'undo',
92
92
  data: {
93
93
  iState: 'rollbacked',
94
- oper$log: {
95
- id: 'dummy',
96
- action: 'undo',
97
- data: {
98
- iState: 'rollbacked',
99
- },
100
- },
94
+ oper$log: [{
95
+ id: 'dummy',
96
+ action: 'undo',
97
+ data: {
98
+ iState: 'rollbacked',
99
+ },
100
+ }],
101
101
  },
102
102
  filter: {
103
103
  id: log.id,
@@ -160,13 +160,13 @@ async function redoLog(log, context) {
160
160
  action: 'redo',
161
161
  data: {
162
162
  iState: 'normal',
163
- oper$log: {
164
- id: 'dummy',
165
- action: 'redo',
166
- data: {
167
- iState: 'normal',
168
- },
169
- },
163
+ oper$log: [{
164
+ id: 'dummy',
165
+ action: 'redo',
166
+ data: {
167
+ iState: 'normal',
168
+ },
169
+ }],
170
170
  },
171
171
  filter: {
172
172
  id: log.id,
@@ -3,7 +3,7 @@ import { EntityDict as BaseEntityDict } from '../base-app-domain';
3
3
  import { AsyncContext } from '../store/AsyncRowStore';
4
4
  type VaccumOptionEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED> = {
5
5
  entity: T;
6
- filter?: ED[T]['Selection']['filter'];
6
+ filter?: ED[T]['Filter'];
7
7
  aliveLine: number;
8
8
  };
9
9
  type VaccumOption<ED extends EntityDict & BaseEntityDict> = {
@@ -1,4 +1,4 @@
1
- import { CascadeActionAuth, CascadeRelationAuth, ActionOnRemove, SyncOrAsync } from ".";
1
+ import { CascadeActionAuth, CascadeRelationAuth, ActionOnRemove, SyncOrAsync, OakException } from ".";
2
2
  import { AsyncContext } from "../store/AsyncRowStore";
3
3
  import { SyncContext } from "../store/SyncRowStore";
4
4
  import { EntityDict, OperateOption, SelectOption } from "../types/Entity";
@@ -23,13 +23,14 @@ export type RowChecker<ED extends EntityDict & BaseEntityDict, T extends keyof E
23
23
  entity: T;
24
24
  mt?: ModiTurn;
25
25
  action: ED[T]['Action'] | Array<ED[T]['Action']>;
26
- filter: ED[T]['Selection']['filter'] | ((operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => SyncOrAsync<ED[T]['Selection']['filter']>);
26
+ filter: ED[T]['Filter'] | ((operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => SyncOrAsync<ED[T]['Filter'] | undefined>);
27
27
  errMsg?: string;
28
+ err?: new (msg?: string) => OakException<ED>;
28
29
  inconsistentRows?: {
29
30
  entity: keyof ED;
30
- selection: (filter?: ED[T]['Selection']['filter']) => ED[keyof ED]['Selection'];
31
+ selection: (filter?: ED[T]['Filter']) => ED[keyof ED]['Selection'];
31
32
  };
32
- conditionalFilter?: ED[T]['Update']['filter'] | ((operation: ED[T]['Operation'], context: Cxt, option: OperateOption) => SyncOrAsync<ED[T]['Update']['filter']>);
33
+ conditionalFilter?: ED[T]['Filter'] | ((operation: ED[T]['Operation'], context: Cxt, option: OperateOption) => SyncOrAsync<ED[T]['Filter']>);
33
34
  };
34
35
  export type LogicalChecker<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = {
35
36
  priority?: number;
@@ -38,7 +39,7 @@ export type LogicalChecker<ED extends EntityDict & BaseEntityDict, T extends key
38
39
  entity: T;
39
40
  action: ED[T]['Action'] | Array<ED[T]['Action']>;
40
41
  checker: (operation: ED[T]['Operation'] | ED[T]['Selection'], context: Cxt, option: OperateOption | SelectOption) => SyncOrAsync<any>;
41
- conditionalFilter?: ED[T]['Update']['filter'] | ((operation: ED[T]['Operation'], context: Cxt, option: OperateOption) => SyncOrAsync<ED[T]['Update']['filter']>);
42
+ conditionalFilter?: ED[T]['Filter'] | ((operation: ED[T]['Operation'], context: Cxt, option: OperateOption) => SyncOrAsync<ED[T]['Filter']>);
42
43
  };
43
44
  export type Checker<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Cxt extends AsyncContext<ED> | SyncContext<ED>> = DataChecker<ED, T, Cxt> | RowChecker<ED, T, Cxt> | LogicalChecker<ED, T, Cxt>;
44
45
  export type AuthDef<ED extends EntityDict & BaseEntityDict, T extends keyof ED> = {
@@ -2,4 +2,5 @@ export type ClusterInfo = {
2
2
  usingCluster: boolean;
3
3
  instanceId?: number;
4
4
  instanceCount?: number;
5
+ enableRedis?: boolean;
5
6
  };
@@ -3,6 +3,14 @@ import { EntityDict as BaseEntityDict } from "../base-app-domain";
3
3
  import { AttrUpdateMatrix } from './EntityDesc';
4
4
  import { ActionDefDict } from './Action';
5
5
  import { StyleDict } from './Style';
6
+ /**
7
+ * redis连接信息,如果是Redis集群,可以配置多个
8
+ */
9
+ export type RedisConfiguration = {
10
+ host: string;
11
+ port: number;
12
+ password?: string;
13
+ };
6
14
  /**
7
15
  * 后台配置
8
16
  */
@@ -17,6 +25,7 @@ export type ServerConfiguration = {
17
25
  connectionLimit: number;
18
26
  charset: "utf8mb4_general_ci";
19
27
  };
28
+ redis?: RedisConfiguration | RedisConfiguration[];
20
29
  workDir: {
21
30
  path: string;
22
31
  };
@@ -85,12 +85,16 @@ export interface EntityDef {
85
85
  Selection: Selection<'select', Projection, Filter, Sorter>;
86
86
  Aggregation: DeduceAggregation<Projection, Filter, Sorter>;
87
87
  Operation: CUDOperation;
88
+ CreateOperationData: CreateOperationData;
88
89
  Create: CreateOperation;
89
90
  CreateSingle: CreateSingleOperation;
90
91
  CreateMulti: CreateMultipleOperation;
91
92
  Update: UpdateOperation;
92
93
  Remove: RemoveOperation;
93
94
  Relation?: string;
95
+ Filter: Filter;
96
+ Projection: Projection;
97
+ Sorter: Sorter;
94
98
  }
95
99
  export interface EntityDict {
96
100
  [E: string]: EntityDef;
@@ -207,6 +211,6 @@ export type OtmKey<K extends string> = K | `${K}$${number}`;
207
211
  export interface SubDataDef<ED extends EntityDict, T extends keyof ED> {
208
212
  id: string;
209
213
  entity: T;
210
- filter: ED[T]['Selection']['filter'];
214
+ filter: ED[T]['Filter'];
211
215
  }
212
216
  export {};
@@ -18,7 +18,7 @@ export type AttrUpdateMatrix<ED extends EntityDict> = {
18
18
  [T in keyof ED]?: {
19
19
  [A in keyof ED[T]['Update']['data']]?: {
20
20
  actions?: ED[T]['Action'][];
21
- filter?: (NonNullable<ED[T]['Selection']['filter']>) | ((action: ED[T]['Action']) => NonNullable<ED[T]['Selection']['filter']>);
21
+ filter?: (NonNullable<ED[T]['Filter']>) | ((action: ED[T]['Action']) => NonNullable<ED[T]['Filter']>);
22
22
  };
23
23
  };
24
24
  };
@@ -3,12 +3,15 @@ import { EntityDict, OpRecord } from "./Entity";
3
3
  import { EntityDict as BaseEntityDict } from '../base-app-domain';
4
4
  export declare class OakException<ED extends EntityDict & BaseEntityDict> extends Error {
5
5
  opRecords: OpRecord<ED>[];
6
- constructor(message?: string);
6
+ module?: string;
7
+ params?: Record<string, any>;
8
+ constructor(message?: string, module?: string, params?: Record<string, any>);
7
9
  addData<T extends keyof ED>(entity: T, rows: Partial<ED[T]['Schema']>[], schema: StorageSchema<ED>): void;
8
10
  setOpRecords(opRecords: OpRecord<ED>[]): void;
9
11
  getSerialData(): {
10
12
  name: string;
11
13
  message: string;
14
+ module: string | undefined;
12
15
  opRecords: OpRecord<ED>[];
13
16
  tag1: string | undefined;
14
17
  tag2: boolean | undefined;
@@ -20,7 +23,7 @@ export declare class OakException<ED extends EntityDict & BaseEntityDict> extend
20
23
  tag3?: any;
21
24
  }
22
25
  export declare class OakRequestTimeoutException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
23
- constructor(message?: string);
26
+ constructor(message?: string, ns?: string, params?: Record<string, any>);
24
27
  }
25
28
  export declare class OakMakeSureByMySelfException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
26
29
  }
@@ -31,7 +34,7 @@ export declare class OakDataException<ED extends EntityDict & BaseEntityDict> ex
31
34
  export declare class OakNoRelationDefException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakDataException<ED> {
32
35
  entity: T;
33
36
  actions: ED[T]['Action'][];
34
- constructor(entity: T, actions: ED[T]['Action'][], msg?: string);
37
+ constructor(entity: T, actions: ED[T]['Action'][], msg?: string, module?: string, params?: Record<string, any>);
35
38
  toString(): string;
36
39
  }
37
40
  export declare class OakOperExistedException<ED extends EntityDict & BaseEntityDict> extends OakDataException<ED> {
@@ -41,7 +44,7 @@ export declare class OakRowUnexistedException<ED extends EntityDict & BaseEntity
41
44
  constructor(rows: Array<{
42
45
  entity: any;
43
46
  selection: any;
44
- }>);
47
+ }>, msg?: string, module?: string, params?: Record<string, any>);
45
48
  toString(): string;
46
49
  getRows(): {
47
50
  entity: any;
@@ -61,12 +64,12 @@ export declare class OakUniqueViolationException<ED extends EntityDict & BaseEnt
61
64
  constructor(rows: Array<{
62
65
  id?: string;
63
66
  attrs: string[];
64
- }>, message?: string);
67
+ }>, message?: string, module?: string, params?: Record<string, any>);
65
68
  }
66
69
  export declare class OakImportDataParseException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
67
70
  line: number;
68
71
  header?: string;
69
- constructor(message: string, line: number, header?: string);
72
+ constructor(message: string, line: number, header?: string, module?: string, params?: Record<string, any>);
70
73
  }
71
74
  /**
72
75
  * 网络中断异常
@@ -78,7 +81,7 @@ export declare class OakServerProxyException<ED extends EntityDict & BaseEntityD
78
81
  export declare class OakClockDriftException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
79
82
  }
80
83
  export declare class OakSignatureVerificationException<ED extends EntityDict & BaseEntityDict> extends OakException<ED> {
81
- constructor(message?: string);
84
+ constructor(message?: string, module?: string, params?: Record<string, any>);
82
85
  }
83
86
  /**
84
87
  * 数据不一致异常,系统认为现有的数据不允许相应的动作时抛此异常
@@ -93,7 +96,7 @@ export declare class OakRowInconsistencyException<ED extends EntityDict & BaseEn
93
96
  export declare class OakInputIllegalException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
94
97
  private attributes;
95
98
  private entity;
96
- constructor(entity: keyof ED, attributes: string[], message?: string);
99
+ constructor(entity: keyof ED, attributes: string[], message?: string, module?: string, params?: Record<string, any>);
97
100
  getEntity(): keyof ED;
98
101
  getAttributes(): string[];
99
102
  addAttributesPrefix(prefix: string): void;
@@ -103,43 +106,43 @@ export declare class OakInputIllegalException<ED extends EntityDict & BaseEntity
103
106
  * 属性为空时抛的异常
104
107
  */
105
108
  export declare class OakAttrNotNullException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
106
- constructor(entity: keyof ED, attributes: string[], message?: string);
109
+ constructor(entity: keyof ED, attributes: string[], message?: string, module?: string, params?: Record<string, any>);
107
110
  }
108
111
  /**
109
112
  * 属性不允许更新抛的异常,前端可以用这个异常来处理update时对应属性的露出
110
113
  */
111
114
  export declare class OakAttrCantUpdateException<ED extends EntityDict & BaseEntityDict> extends OakInputIllegalException<ED> {
112
- constructor(entity: keyof ED, attributes: string[], message?: string);
115
+ constructor(entity: keyof ED, attributes: string[], message?: string, module?: string, params?: Record<string, any>);
113
116
  }
114
117
  /**
115
118
  * 用户权限不够时抛的异常
116
119
  */
117
- export declare class OakUserUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
120
+ export declare class OakOperationUnpermittedException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
118
121
  private entity;
119
122
  private operation;
120
- constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string);
123
+ constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, module?: string, params?: Record<string, any>);
121
124
  toString(): string;
122
125
  }
123
126
  /**
124
127
  * 用户查询权限不够抛出异常
125
128
  */
126
- export declare class OakUserInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
129
+ export declare class OakDataInvisibleException<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
127
130
  private entity;
128
131
  private operation;
129
- constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string);
132
+ constructor(entity: T, operation: ED[T]['Selection'] | ED[T]['Operation'], message?: string, module?: string, params?: Record<string, any>);
130
133
  toString(): string;
131
134
  }
132
135
  /**
133
136
  * 用户未登录抛的异常
134
137
  */
135
138
  export declare class OakUnloggedInException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
136
- constructor(message?: string);
139
+ constructor(message?: string, module?: string, params?: Record<string, any>);
137
140
  }
138
141
  /**
139
142
  * 行数据被锁抛的异常
140
143
  */
141
144
  export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
142
- constructor(message?: string);
145
+ constructor(message?: string, module?: string, params?: Record<string, any>);
143
146
  }
144
147
  /**
145
148
  * 要插入行时,发现已经有相同的行数据
@@ -147,7 +150,7 @@ export declare class OakRowLockedException<ED extends EntityDict & BaseEntityDic
147
150
  export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDict, T extends keyof ED> extends OakUserException<ED> {
148
151
  private data;
149
152
  private entity;
150
- constructor(entity: T, data: ED[T]['OpSchema'], message?: string);
153
+ constructor(entity: T, data: ED[T]['OpSchema'], message?: string, module?: string, params?: Record<string, any>);
151
154
  getData(): ED[T]["OpSchema"];
152
155
  getEntity(): T;
153
156
  toString(): string;
@@ -156,7 +159,7 @@ export declare class OakCongruentRowExists<ED extends EntityDict & BaseEntityDic
156
159
  * 死锁抛的异常
157
160
  */
158
161
  export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
159
- constructor(message?: string | undefined);
162
+ constructor(message?: string, module?: string, params?: Record<string, any>);
160
163
  }
161
164
  /**
162
165
  * 前置条件不满足抛的异常
@@ -164,7 +167,7 @@ export declare class OakDeadlock<ED extends EntityDict & BaseEntityDict> extends
164
167
  export declare class OakPreConditionUnsetException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
165
168
  entity?: keyof ED;
166
169
  code?: string;
167
- constructor(message?: string | undefined, entity?: keyof ED | undefined, code?: string | undefined);
170
+ constructor(message?: string, entity?: keyof ED, code?: string, module?: string, params?: Record<string, any>);
168
171
  toString(): string;
169
172
  }
170
173
  /**
@@ -174,18 +177,20 @@ export declare class OakExternalException<ED extends EntityDict & BaseEntityDict
174
177
  code?: string;
175
178
  source: string;
176
179
  data?: any;
177
- constructor(source: string, code?: string, message?: string, data?: any);
180
+ constructor(source: string, code?: string, message?: string, data?: any, module?: string, params?: Record<string, any>);
178
181
  toString(): string;
179
182
  }
180
183
  /**
181
184
  * socket连接异常
182
185
  */
183
186
  export declare class OakSocketConnectException<ED extends EntityDict & BaseEntityDict> extends OakUserException<ED> {
184
- constructor(message?: string);
187
+ constructor(message?: string, module?: string, params?: Record<string, any>);
185
188
  }
186
189
  export declare function makeException<ED extends EntityDict & BaseEntityDict>(data: {
187
190
  name: string;
188
191
  message?: string;
192
+ module?: string;
193
+ params?: Record<string, any>;
189
194
  opRecords: OpRecord<ED>[];
190
195
  [A: string]: any;
191
196
  }): OakException<ED> | undefined;