oak-domain 2.3.2 → 2.4.1
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.
- package/lib/actions/action.d.ts +16 -16
- package/lib/actions/action.js +17 -17
- package/lib/actions/relation.d.ts +5 -1
- package/lib/actions/relation.js +38 -2
- package/lib/base-app-domain/ActionDefDict.d.ts +5 -5
- package/lib/base-app-domain/ActionDefDict.js +7 -7
- package/lib/base-app-domain/EntityDict.d.ts +12 -12
- package/lib/base-app-domain/EntityDict.js +2 -2
- package/lib/base-app-domain/Modi/Action.d.ts +10 -10
- package/lib/base-app-domain/Modi/Action.js +14 -14
- package/lib/base-app-domain/Modi/Schema.d.ts +146 -148
- package/lib/base-app-domain/Modi/Schema.js +2 -2
- package/lib/base-app-domain/Modi/Storage.d.ts +3 -3
- package/lib/base-app-domain/Modi/Storage.js +60 -60
- package/lib/base-app-domain/ModiEntity/Schema.d.ts +162 -164
- package/lib/base-app-domain/ModiEntity/Schema.js +2 -2
- package/lib/base-app-domain/ModiEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/ModiEntity/Storage.js +26 -26
- package/lib/base-app-domain/Oper/Schema.d.ts +144 -146
- package/lib/base-app-domain/Oper/Schema.js +2 -2
- package/lib/base-app-domain/Oper/Storage.d.ts +3 -3
- package/lib/base-app-domain/Oper/Storage.js +29 -29
- package/lib/base-app-domain/OperEntity/Schema.d.ts +178 -180
- package/lib/base-app-domain/OperEntity/Schema.js +2 -2
- package/lib/base-app-domain/OperEntity/Storage.d.ts +3 -3
- package/lib/base-app-domain/OperEntity/Storage.js +26 -26
- package/lib/base-app-domain/Storage.d.ts +3 -3
- package/lib/base-app-domain/Storage.js +15 -15
- package/lib/base-app-domain/User/Schema.d.ts +128 -130
- package/lib/base-app-domain/User/Schema.js +2 -2
- package/lib/base-app-domain/User/Storage.d.ts +3 -3
- package/lib/base-app-domain/User/Storage.js +25 -25
- package/lib/base-app-domain/_SubQuery.d.ts +36 -36
- package/lib/base-app-domain/_SubQuery.js +2 -2
- package/lib/base-app-domain/index.d.ts +3 -3
- package/lib/base-app-domain/index.js +6 -6
- package/lib/checkers/index.d.ts +5 -5
- package/lib/checkers/index.js +15 -13
- package/lib/compiler/env.d.ts +11 -11
- package/lib/compiler/env.js +39 -39
- package/lib/compiler/schemalBuilder.d.ts +2 -2
- package/lib/compiler/schemalBuilder.js +3301 -3245
- package/lib/compiler/uiBuilder.d.ts +1 -1
- package/lib/compiler/uiBuilder.js +3 -3
- package/lib/entities/Modi.d.ts +11 -11
- package/lib/entities/Modi.js +46 -46
- package/lib/entities/ModiEntity.d.ts +8 -8
- package/lib/entities/ModiEntity.js +15 -15
- package/lib/entities/Oper.d.ts +10 -10
- package/lib/entities/Oper.js +17 -17
- package/lib/entities/OperEntity.d.ts +8 -8
- package/lib/entities/OperEntity.js +15 -15
- package/lib/entities/User.d.ts +7 -7
- package/lib/entities/User.js +12 -12
- package/lib/store/AsyncRowStore.d.ts +48 -48
- package/lib/store/AsyncRowStore.js +183 -183
- package/lib/store/CascadeStore.d.ts +91 -91
- package/lib/store/CascadeStore.js +1594 -1594
- package/lib/store/SyncRowStore.d.ts +29 -29
- package/lib/store/SyncRowStore.js +48 -48
- package/lib/store/TriggerExecutor.d.ts +32 -32
- package/lib/store/TriggerExecutor.js +527 -508
- package/lib/store/actionDef.d.ts +9 -9
- package/lib/store/actionDef.js +135 -135
- package/lib/store/checker.d.ts +13 -7
- package/lib/store/checker.js +498 -391
- package/lib/store/filter.d.ts +109 -100
- package/lib/store/filter.js +893 -878
- package/lib/store/modi.d.ts +13 -13
- package/lib/store/modi.js +198 -206
- package/lib/store/relation.d.ts +13 -13
- package/lib/store/relation.js +66 -66
- package/lib/store/selection.d.ts +7 -7
- package/lib/store/selection.js +235 -235
- package/lib/triggers/index.d.ts +6 -6
- package/lib/triggers/index.js +11 -11
- package/lib/triggers/modi.d.ts +5 -5
- package/lib/triggers/modi.js +72 -72
- package/lib/types/Action.d.ts +18 -14
- package/lib/types/Action.js +2 -2
- package/lib/types/AppLoader.d.ts +11 -11
- package/lib/types/AppLoader.js +10 -10
- package/lib/types/Aspect.d.ts +12 -12
- package/lib/types/Aspect.js +4 -4
- package/lib/types/Auth.d.ts +66 -66
- package/lib/types/Auth.js +2 -2
- package/lib/types/Connector.d.ts +26 -26
- package/lib/types/Connector.js +9 -9
- package/lib/types/Context.d.ts +7 -7
- package/lib/types/Context.js +3 -3
- package/lib/types/DataType.d.ts +18 -18
- package/lib/types/DataType.js +5 -5
- package/lib/types/Demand.d.ts +77 -77
- package/lib/types/Demand.js +9 -9
- package/lib/types/Endpoint.d.ts +11 -0
- package/lib/types/Endpoint.js +3 -0
- package/lib/types/Entity.d.ts +176 -190
- package/lib/types/Entity.js +14 -15
- package/lib/types/Exception.d.ts +88 -83
- package/lib/types/Exception.js +267 -252
- package/lib/types/Expression.d.ts +163 -141
- package/lib/types/Expression.js +427 -402
- package/lib/types/Geo.d.ts +18 -18
- package/lib/types/Geo.js +2 -2
- package/lib/types/Locale.d.ts +24 -24
- package/lib/types/Locale.js +2 -2
- package/lib/types/Logger.d.ts +5 -5
- package/lib/types/Logger.js +3 -3
- package/lib/types/Polyfill.d.ts +23 -23
- package/lib/types/Polyfill.js +2 -2
- package/lib/types/Port.d.ts +17 -0
- package/lib/types/Port.js +2 -0
- package/lib/types/RowStore.d.ts +12 -12
- package/lib/types/RowStore.js +34 -34
- package/lib/types/Storage.d.ts +56 -56
- package/lib/types/Storage.js +2 -2
- package/lib/types/Timer.d.ts +13 -13
- package/lib/types/Timer.js +2 -2
- package/lib/types/Trigger.d.ts +100 -100
- package/lib/types/Trigger.js +39 -39
- package/lib/types/Txn.d.ts +2 -2
- package/lib/types/Txn.js +3 -3
- package/lib/types/Watcher.d.ts +19 -19
- package/lib/types/Watcher.js +4 -4
- package/lib/types/index.d.ts +21 -19
- package/lib/types/index.js +24 -22
- package/lib/types/schema/DataTypes.d.ts +32 -32
- package/lib/types/schema/DataTypes.js +3 -3
- package/lib/utils/SimpleConnector.d.ts +30 -30
- package/lib/utils/SimpleConnector.js +117 -117
- package/lib/utils/assert.d.ts +5 -5
- package/lib/utils/assert.js +9 -9
- package/lib/utils/concurrent.d.ts +15 -15
- package/lib/utils/concurrent.js +89 -89
- package/lib/utils/cron.d.ts +1 -1
- package/lib/utils/cron.js +18 -18
- package/lib/utils/date.d.ts +1 -0
- package/lib/utils/date.js +18 -0
- package/lib/utils/geo.d.ts +4 -4
- package/lib/utils/geo.js +24 -24
- package/lib/utils/lodash.d.ts +20 -20
- package/lib/utils/lodash.js +55 -55
- package/lib/utils/random/random.d.ts +1 -1
- package/lib/utils/random/random.js +24 -24
- package/lib/utils/random/random.mp.d.ts +1 -1
- package/lib/utils/random/random.mp.js +25 -25
- package/lib/utils/random/random.web.d.ts +1 -1
- package/lib/utils/random/random.web.js +17 -17
- package/lib/utils/string.d.ts +22 -22
- package/lib/utils/string.js +70 -70
- package/lib/utils/uuid.d.ts +12 -12
- package/lib/utils/uuid.js +194 -194
- package/lib/utils/validator.d.ts +23 -23
- package/lib/utils/validator.js +123 -123
- package/package.json +48 -48
- package/src/entities/Modi.ts +68 -68
- package/src/entities/ModiEntity.ts +24 -24
- package/src/entities/Oper.ts +28 -28
- package/src/entities/OperEntity.ts +24 -24
- package/src/entities/User.ts +19 -19
package/lib/types/Exception.js
CHANGED
|
@@ -1,252 +1,267 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeException = exports.OakDeadlock = exports.OakCongruentRowExists = exports.OakRowLockedException = exports.OakUnloggedInException = exports.OakUserUnpermittedException = exports.OakInputIllegalException = exports.OakRowInconsistencyException = exports.OakUserException = exports.OakExternalException = exports.OakRowUnexistedException = exports.OakOperExistedException = exports.OakDataException = exports.OakException = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var OakException = /** @class */ (function (_super) {
|
|
6
|
-
tslib_1.__extends(OakException, _super);
|
|
7
|
-
function OakException(message) {
|
|
8
|
-
var _newTarget = this.constructor;
|
|
9
|
-
var _this = _super.call(this, message) || this;
|
|
10
|
-
_this.name = _newTarget.name;
|
|
11
|
-
if (typeof Error.captureStackTrace === 'function') {
|
|
12
|
-
Error.captureStackTrace(_this, _newTarget);
|
|
13
|
-
}
|
|
14
|
-
if (typeof Object.setPrototypeOf === 'function') {
|
|
15
|
-
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
_this.__proto__ = _newTarget.prototype;
|
|
19
|
-
}
|
|
20
|
-
return _this;
|
|
21
|
-
}
|
|
22
|
-
OakException.prototype.toString = function () {
|
|
23
|
-
return JSON.stringify({
|
|
24
|
-
name: this.constructor.name,
|
|
25
|
-
message: this.message,
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
return OakException;
|
|
29
|
-
}(Error));
|
|
30
|
-
exports.OakException = OakException;
|
|
31
|
-
var OakDataException = /** @class */ (function (_super) {
|
|
32
|
-
tslib_1.__extends(OakDataException, _super);
|
|
33
|
-
function OakDataException() {
|
|
34
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
-
}
|
|
36
|
-
return OakDataException;
|
|
37
|
-
}(OakException));
|
|
38
|
-
exports.OakDataException = OakDataException;
|
|
39
|
-
var
|
|
40
|
-
tslib_1.__extends(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
OakInputIllegalException
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
return
|
|
148
|
-
}(OakUserException));
|
|
149
|
-
exports.
|
|
150
|
-
;
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
*/
|
|
154
|
-
var
|
|
155
|
-
tslib_1.__extends(
|
|
156
|
-
function
|
|
157
|
-
return _super.
|
|
158
|
-
}
|
|
159
|
-
return
|
|
160
|
-
}(OakUserException));
|
|
161
|
-
exports.
|
|
162
|
-
;
|
|
163
|
-
/**
|
|
164
|
-
* 用户未登录抛的异常
|
|
165
|
-
*/
|
|
166
|
-
var
|
|
167
|
-
tslib_1.__extends(
|
|
168
|
-
function
|
|
169
|
-
return _super.call(this, message || '
|
|
170
|
-
}
|
|
171
|
-
return
|
|
172
|
-
}(OakUserException));
|
|
173
|
-
exports.
|
|
174
|
-
;
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
*/
|
|
178
|
-
var
|
|
179
|
-
tslib_1.__extends(
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
OakCongruentRowExists
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
case '
|
|
228
|
-
return new
|
|
229
|
-
}
|
|
230
|
-
case '
|
|
231
|
-
return new
|
|
232
|
-
}
|
|
233
|
-
case '
|
|
234
|
-
return new
|
|
235
|
-
}
|
|
236
|
-
case '
|
|
237
|
-
return new
|
|
238
|
-
}
|
|
239
|
-
case '
|
|
240
|
-
return new
|
|
241
|
-
}
|
|
242
|
-
case '
|
|
243
|
-
return new
|
|
244
|
-
}
|
|
245
|
-
case '
|
|
246
|
-
return new
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeException = exports.OakDeadlock = exports.OakCongruentRowExists = exports.OakRowLockedException = exports.OakUnloggedInException = exports.OakUserUnpermittedException = exports.OakInputIllegalException = exports.OakRowInconsistencyException = exports.OakUserException = exports.OakExternalException = exports.OakRowUnexistedException = exports.OakOperExistedException = exports.OakImportDataParseException = exports.OakDataException = exports.OakException = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var OakException = /** @class */ (function (_super) {
|
|
6
|
+
tslib_1.__extends(OakException, _super);
|
|
7
|
+
function OakException(message) {
|
|
8
|
+
var _newTarget = this.constructor;
|
|
9
|
+
var _this = _super.call(this, message) || this;
|
|
10
|
+
_this.name = _newTarget.name;
|
|
11
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
12
|
+
Error.captureStackTrace(_this, _newTarget);
|
|
13
|
+
}
|
|
14
|
+
if (typeof Object.setPrototypeOf === 'function') {
|
|
15
|
+
Object.setPrototypeOf(_this, _newTarget.prototype);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
_this.__proto__ = _newTarget.prototype;
|
|
19
|
+
}
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
OakException.prototype.toString = function () {
|
|
23
|
+
return JSON.stringify({
|
|
24
|
+
name: this.constructor.name,
|
|
25
|
+
message: this.message,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return OakException;
|
|
29
|
+
}(Error));
|
|
30
|
+
exports.OakException = OakException;
|
|
31
|
+
var OakDataException = /** @class */ (function (_super) {
|
|
32
|
+
tslib_1.__extends(OakDataException, _super);
|
|
33
|
+
function OakDataException() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
}
|
|
36
|
+
return OakDataException;
|
|
37
|
+
}(OakException));
|
|
38
|
+
exports.OakDataException = OakDataException;
|
|
39
|
+
var OakImportDataParseException = /** @class */ (function (_super) {
|
|
40
|
+
tslib_1.__extends(OakImportDataParseException, _super);
|
|
41
|
+
// message必传,描述具体错误的数据内容
|
|
42
|
+
function OakImportDataParseException(message, line, header) {
|
|
43
|
+
var _this = _super.call(this, message) || this;
|
|
44
|
+
_this.line = line;
|
|
45
|
+
_this.header = header;
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
return OakImportDataParseException;
|
|
49
|
+
}(OakException));
|
|
50
|
+
exports.OakImportDataParseException = OakImportDataParseException;
|
|
51
|
+
var OakOperExistedException = /** @class */ (function (_super) {
|
|
52
|
+
tslib_1.__extends(OakOperExistedException, _super);
|
|
53
|
+
function OakOperExistedException() {
|
|
54
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
55
|
+
}
|
|
56
|
+
return OakOperExistedException;
|
|
57
|
+
}(OakDataException));
|
|
58
|
+
exports.OakOperExistedException = OakOperExistedException;
|
|
59
|
+
var OakRowUnexistedException = /** @class */ (function (_super) {
|
|
60
|
+
tslib_1.__extends(OakRowUnexistedException, _super);
|
|
61
|
+
// 指定主键查询时却发现行不存在,一般发生在缓存中
|
|
62
|
+
function OakRowUnexistedException(rows) {
|
|
63
|
+
var _this = _super.call(this, "\u67E5\u8BE2".concat(rows.map(function (ele) { return ele.entity; }).join(','), "\u5BF9\u8C61\u65F6\u53D1\u73B0\u4E86\u7A7A\u6307\u9488\uFF0C\u8BF7\u68C0\u67E5\u6570\u636E\u4E00\u81F4\u6027")) || this;
|
|
64
|
+
_this.rows = rows;
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
OakRowUnexistedException.prototype.toString = function () {
|
|
68
|
+
return JSON.stringify({ rows: this.rows });
|
|
69
|
+
};
|
|
70
|
+
OakRowUnexistedException.prototype.getRows = function () {
|
|
71
|
+
return this.rows;
|
|
72
|
+
};
|
|
73
|
+
return OakRowUnexistedException;
|
|
74
|
+
}(OakDataException));
|
|
75
|
+
exports.OakRowUnexistedException = OakRowUnexistedException;
|
|
76
|
+
var OakExternalException = /** @class */ (function (_super) {
|
|
77
|
+
tslib_1.__extends(OakExternalException, _super);
|
|
78
|
+
function OakExternalException() {
|
|
79
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
80
|
+
}
|
|
81
|
+
return OakExternalException;
|
|
82
|
+
}(Error));
|
|
83
|
+
exports.OakExternalException = OakExternalException;
|
|
84
|
+
var OakUserException = /** @class */ (function (_super) {
|
|
85
|
+
tslib_1.__extends(OakUserException, _super);
|
|
86
|
+
function OakUserException() {
|
|
87
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
88
|
+
}
|
|
89
|
+
return OakUserException;
|
|
90
|
+
}(OakException));
|
|
91
|
+
exports.OakUserException = OakUserException;
|
|
92
|
+
;
|
|
93
|
+
// 在系统更新数据时,以下三个异常应按规范依次抛出。
|
|
94
|
+
/**
|
|
95
|
+
* 数据不一致异常,系统认为现有的数据不允许相应的动作时抛此异常
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
98
|
+
var OakRowInconsistencyException = /** @class */ (function (_super) {
|
|
99
|
+
tslib_1.__extends(OakRowInconsistencyException, _super);
|
|
100
|
+
function OakRowInconsistencyException(data, message) {
|
|
101
|
+
var _this = _super.call(this, message) || this;
|
|
102
|
+
_this.data = data;
|
|
103
|
+
return _this;
|
|
104
|
+
}
|
|
105
|
+
OakRowInconsistencyException.prototype.getData = function () {
|
|
106
|
+
return this.data;
|
|
107
|
+
};
|
|
108
|
+
OakRowInconsistencyException.prototype.toString = function () {
|
|
109
|
+
return JSON.stringify({
|
|
110
|
+
name: this.constructor.name,
|
|
111
|
+
message: this.message,
|
|
112
|
+
data: this.data,
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
return OakRowInconsistencyException;
|
|
116
|
+
}(OakUserException));
|
|
117
|
+
exports.OakRowInconsistencyException = OakRowInconsistencyException;
|
|
118
|
+
;
|
|
119
|
+
/**
|
|
120
|
+
* 当输入的数据非法时抛此异常,attributes表示非法的属性
|
|
121
|
+
*/
|
|
122
|
+
var OakInputIllegalException = /** @class */ (function (_super) {
|
|
123
|
+
tslib_1.__extends(OakInputIllegalException, _super);
|
|
124
|
+
function OakInputIllegalException(entity, attributes, message) {
|
|
125
|
+
var _this = _super.call(this, message) || this;
|
|
126
|
+
_this.entity = entity;
|
|
127
|
+
_this.attributes = attributes;
|
|
128
|
+
return _this;
|
|
129
|
+
}
|
|
130
|
+
OakInputIllegalException.prototype.getEntity = function () {
|
|
131
|
+
return this.entity;
|
|
132
|
+
};
|
|
133
|
+
OakInputIllegalException.prototype.getAttributes = function () {
|
|
134
|
+
return this.attributes;
|
|
135
|
+
};
|
|
136
|
+
OakInputIllegalException.prototype.addAttributesPrefix = function (prefix) {
|
|
137
|
+
this.attributes = this.attributes.map(function (ele) { return "".concat(prefix, ".").concat(ele); });
|
|
138
|
+
};
|
|
139
|
+
OakInputIllegalException.prototype.toString = function () {
|
|
140
|
+
return JSON.stringify({
|
|
141
|
+
entity: this.entity,
|
|
142
|
+
name: this.constructor.name,
|
|
143
|
+
message: this.message,
|
|
144
|
+
attributes: this.attributes,
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return OakInputIllegalException;
|
|
148
|
+
}(OakUserException));
|
|
149
|
+
exports.OakInputIllegalException = OakInputIllegalException;
|
|
150
|
+
;
|
|
151
|
+
/**
|
|
152
|
+
* 用户权限不够时抛的异常
|
|
153
|
+
*/
|
|
154
|
+
var OakUserUnpermittedException = /** @class */ (function (_super) {
|
|
155
|
+
tslib_1.__extends(OakUserUnpermittedException, _super);
|
|
156
|
+
function OakUserUnpermittedException() {
|
|
157
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
158
|
+
}
|
|
159
|
+
return OakUserUnpermittedException;
|
|
160
|
+
}(OakUserException));
|
|
161
|
+
exports.OakUserUnpermittedException = OakUserUnpermittedException;
|
|
162
|
+
;
|
|
163
|
+
/**
|
|
164
|
+
* 用户未登录抛的异常
|
|
165
|
+
*/
|
|
166
|
+
var OakUnloggedInException = /** @class */ (function (_super) {
|
|
167
|
+
tslib_1.__extends(OakUnloggedInException, _super);
|
|
168
|
+
function OakUnloggedInException(message) {
|
|
169
|
+
return _super.call(this, message || '您尚未登录') || this;
|
|
170
|
+
}
|
|
171
|
+
return OakUnloggedInException;
|
|
172
|
+
}(OakUserException));
|
|
173
|
+
exports.OakUnloggedInException = OakUnloggedInException;
|
|
174
|
+
;
|
|
175
|
+
/**
|
|
176
|
+
* 用户未登录抛的异常
|
|
177
|
+
*/
|
|
178
|
+
var OakRowLockedException = /** @class */ (function (_super) {
|
|
179
|
+
tslib_1.__extends(OakRowLockedException, _super);
|
|
180
|
+
function OakRowLockedException(message) {
|
|
181
|
+
return _super.call(this, message || '该行数据正在被更新中,请稍后再试') || this;
|
|
182
|
+
}
|
|
183
|
+
return OakRowLockedException;
|
|
184
|
+
}(OakUserException));
|
|
185
|
+
exports.OakRowLockedException = OakRowLockedException;
|
|
186
|
+
;
|
|
187
|
+
/**
|
|
188
|
+
* 要插入行时,发现已经有相同的行数据
|
|
189
|
+
*/
|
|
190
|
+
var OakCongruentRowExists = /** @class */ (function (_super) {
|
|
191
|
+
tslib_1.__extends(OakCongruentRowExists, _super);
|
|
192
|
+
function OakCongruentRowExists(entity, data, message) {
|
|
193
|
+
var _this = _super.call(this, message) || this;
|
|
194
|
+
_this.data = data;
|
|
195
|
+
_this.entity = entity;
|
|
196
|
+
return _this;
|
|
197
|
+
}
|
|
198
|
+
OakCongruentRowExists.prototype.getData = function () {
|
|
199
|
+
return this.data;
|
|
200
|
+
};
|
|
201
|
+
OakCongruentRowExists.prototype.getEntity = function () {
|
|
202
|
+
return this.entity;
|
|
203
|
+
};
|
|
204
|
+
OakCongruentRowExists.prototype.toString = function () {
|
|
205
|
+
return JSON.stringify({
|
|
206
|
+
name: this.constructor.name,
|
|
207
|
+
message: this.message,
|
|
208
|
+
data: this.data,
|
|
209
|
+
entity: this.entity,
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
return OakCongruentRowExists;
|
|
213
|
+
}(OakUserException));
|
|
214
|
+
exports.OakCongruentRowExists = OakCongruentRowExists;
|
|
215
|
+
var OakDeadlock = /** @class */ (function (_super) {
|
|
216
|
+
tslib_1.__extends(OakDeadlock, _super);
|
|
217
|
+
function OakDeadlock(message) {
|
|
218
|
+
return _super.call(this, message || '发现死锁') || this;
|
|
219
|
+
}
|
|
220
|
+
return OakDeadlock;
|
|
221
|
+
}(OakUserException));
|
|
222
|
+
exports.OakDeadlock = OakDeadlock;
|
|
223
|
+
;
|
|
224
|
+
function makeException(data) {
|
|
225
|
+
var name = data.name;
|
|
226
|
+
switch (name) {
|
|
227
|
+
case 'OakException': {
|
|
228
|
+
return new OakException(data.message);
|
|
229
|
+
}
|
|
230
|
+
case 'OakUserException': {
|
|
231
|
+
return new OakUserException(data.message);
|
|
232
|
+
}
|
|
233
|
+
case 'OakExternalException': {
|
|
234
|
+
return new OakExternalException(data.message);
|
|
235
|
+
}
|
|
236
|
+
case 'OakRowInconsistencyException': {
|
|
237
|
+
return new OakRowInconsistencyException(data.data, data.message);
|
|
238
|
+
}
|
|
239
|
+
case 'OakInputIllegalException': {
|
|
240
|
+
return new OakInputIllegalException(data.entity, data.attributes, data.message);
|
|
241
|
+
}
|
|
242
|
+
case 'OakUserUnpermittedException': {
|
|
243
|
+
return new OakUserUnpermittedException(data.message);
|
|
244
|
+
}
|
|
245
|
+
case 'OakUnloggedInException': {
|
|
246
|
+
return new OakUnloggedInException(data.message);
|
|
247
|
+
}
|
|
248
|
+
case 'OakCongruentRowExists': {
|
|
249
|
+
return new OakCongruentRowExists(data.entity, data.data, data.message);
|
|
250
|
+
}
|
|
251
|
+
case 'OakRowLockedException': {
|
|
252
|
+
return new OakRowLockedException(data.message);
|
|
253
|
+
}
|
|
254
|
+
case 'OakRowUnexistedException': {
|
|
255
|
+
return new OakRowUnexistedException(data.rows);
|
|
256
|
+
}
|
|
257
|
+
case 'OakDeadlock': {
|
|
258
|
+
return new OakDeadlock(data.message);
|
|
259
|
+
}
|
|
260
|
+
case 'OakImportDataParseException': {
|
|
261
|
+
return new OakImportDataParseException(data.message, data.line, data.header);
|
|
262
|
+
}
|
|
263
|
+
default:
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.makeException = makeException;
|