remult 0.13.12 → 0.13.15
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/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { Repository } from '../src/remult3';
|
|
|
4
4
|
import { queuedJobInfoResponse } from '../src/server-action';
|
|
5
5
|
import { DataApi, DataApiRequest, DataApiResponse } from '../src/data-api';
|
|
6
6
|
import { AllowedForInstance } from '../src/context';
|
|
7
|
+
import { ClassType } from '../classType';
|
|
7
8
|
export declare function remultExpress(options?: {
|
|
8
9
|
/** Determines the Data Provider
|
|
9
10
|
|
|
@@ -17,6 +18,8 @@ export declare function remultExpress(options?: {
|
|
|
17
18
|
initApi?: (remult: Remult) => void | Promise<void>;
|
|
18
19
|
logApiEndPoints?: boolean;
|
|
19
20
|
defaultGetLimit?: number;
|
|
21
|
+
entities?: ClassType<any>[];
|
|
22
|
+
controllers?: [];
|
|
20
23
|
}): RemultExpressBridge;
|
|
21
24
|
export interface RemultExpressBridge extends express.RequestHandler {
|
|
22
25
|
getRemult(req: express.Request): Promise<Remult>;
|
package/src/context.js
CHANGED
|
@@ -94,14 +94,14 @@ function toPromise(p) {
|
|
|
94
94
|
}
|
|
95
95
|
exports.toPromise = toPromise;
|
|
96
96
|
function processHttpException(ex) {
|
|
97
|
-
var _a, _b;
|
|
97
|
+
var _a, _b, _c;
|
|
98
98
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
99
|
-
var z, error, result;
|
|
100
|
-
return tslib_1.__generator(this, function (
|
|
101
|
-
switch (
|
|
99
|
+
var z, error, httpStatusCode, result;
|
|
100
|
+
return tslib_1.__generator(this, function (_d) {
|
|
101
|
+
switch (_d.label) {
|
|
102
102
|
case 0: return [4 /*yield*/, ex];
|
|
103
103
|
case 1:
|
|
104
|
-
z =
|
|
104
|
+
z = _d.sent();
|
|
105
105
|
if (z.error)
|
|
106
106
|
error = z.error;
|
|
107
107
|
else if (z.isAxiosError) {
|
|
@@ -116,9 +116,15 @@ function processHttpException(ex) {
|
|
|
116
116
|
error = "Network Error";
|
|
117
117
|
if (typeof error === 'string') {
|
|
118
118
|
error = {
|
|
119
|
-
message: error
|
|
119
|
+
message: error,
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
+
httpStatusCode = z.status;
|
|
123
|
+
if (httpStatusCode === undefined)
|
|
124
|
+
httpStatusCode = (_c = z.response) === null || _c === void 0 ? void 0 : _c.status;
|
|
125
|
+
if (httpStatusCode !== undefined && httpStatusCode !== null) {
|
|
126
|
+
error.httpStatusCode = httpStatusCode;
|
|
127
|
+
}
|
|
122
128
|
result = Object.assign(error, {
|
|
123
129
|
// exception: ex disabled for now because JSON.stringify crashed with this
|
|
124
130
|
});
|
package/src/data-interfaces.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare class RepositoryImplementation<entityType> implements Repository<
|
|
|
38
38
|
} ? number : entityType extends {
|
|
39
39
|
id: string;
|
|
40
40
|
} ? string : (string | number)), entity: Partial<OmitEB<entityType>>): Promise<entityType>;
|
|
41
|
+
private getRefForExistingRow;
|
|
41
42
|
save(item: Partial<OmitEB<entityType>>[]): Promise<entityType[]>;
|
|
42
43
|
save(item: Partial<OmitEB<entityType>>): Promise<entityType>;
|
|
43
44
|
find(options: FindOptions<entityType>): Promise<entityType[]>;
|
|
@@ -114,7 +115,7 @@ export declare class rowHelperImplementation<T> extends rowHelperBase<T> impleme
|
|
|
114
115
|
private getIdFilter;
|
|
115
116
|
delete(): Promise<void>;
|
|
116
117
|
loadDataFrom(data: any, loadItems?: FieldMetadata[]): Promise<void>;
|
|
117
|
-
|
|
118
|
+
id: any;
|
|
118
119
|
getOriginalId(): any;
|
|
119
120
|
private calcServerExpression;
|
|
120
121
|
isNew(): boolean;
|
|
@@ -206,9 +207,6 @@ declare class EntityFullInfo<T> implements EntityMetadata<T> {
|
|
|
206
207
|
caption: string;
|
|
207
208
|
}
|
|
208
209
|
export declare function FieldType<valueType = any>(...options: (FieldOptions<any, valueType> | ((options: FieldOptions<any, valueType>, remult: Remult) => void))[]): (target: any) => any;
|
|
209
|
-
export declare const Fields1: {
|
|
210
|
-
String: () => (a: any) => void;
|
|
211
|
-
};
|
|
212
210
|
export declare class Fields {
|
|
213
211
|
static object<entityType = any, valueType = any>(...options: (FieldOptions<entityType, valueType> | ((options: FieldOptions<entityType, valueType>, remult: Remult) => void))[]): (target: any, key: any, c?: any) => void;
|
|
214
212
|
static dateOnly<entityType = any>(...options: (FieldOptions<entityType, Date> | ((options: FieldOptions<entityType, Date>, remult: Remult) => void))[]): (target: any, key: any, c?: any) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControllerBase = exports.EntityBase = exports.Entity = exports.BuildEntity = exports.decorateColumnSettings = exports.storableMember = exports.Field = exports.getValueList = exports.ValueListInfo = exports.ValueListFieldType = exports.isAutoIncrement = exports.Fields = exports.
|
|
3
|
+
exports.ControllerBase = exports.EntityBase = exports.Entity = exports.BuildEntity = exports.decorateColumnSettings = exports.storableMember = exports.Field = exports.getValueList = exports.ValueListInfo = exports.ValueListFieldType = exports.isAutoIncrement = exports.Fields = exports.FieldType = exports.columnDefsImpl = exports.buildCaption = exports.CaptionTransformer = exports.getEntityRef = exports.FieldRefImplementation = exports.controllerRefImpl = exports.getControllerRef = exports.getFields = exports.rowHelperImplementation = exports.createOldEntity = exports.columnsOfType = exports.getEntityKey = exports.getEntitySettings = exports.entityInfo_key = exports.entityInfo = exports.__updateEntityBasedOnWhere = exports.RepositoryImplementation = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var column_1 = require("../column");
|
|
6
6
|
var context_1 = require("../context");
|
|
@@ -189,16 +189,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
189
189
|
RepositoryImplementation.prototype.delete = function (item) {
|
|
190
190
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
191
191
|
return tslib_1.__generator(this, function (_a) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
case 1: return [4 /*yield*/, this.getEntityRef(item).delete()];
|
|
197
|
-
case 2:
|
|
198
|
-
_a.sent();
|
|
199
|
-
_a.label = 3;
|
|
200
|
-
case 3: return [2 /*return*/];
|
|
192
|
+
if (typeof item === "string" || typeof item === "number")
|
|
193
|
+
return [2 /*return*/, this.edp.delete(item)];
|
|
194
|
+
else {
|
|
195
|
+
return [2 /*return*/, this.getRefForExistingRow(item, undefined).delete()];
|
|
201
196
|
}
|
|
197
|
+
return [2 /*return*/];
|
|
202
198
|
});
|
|
203
199
|
});
|
|
204
200
|
};
|
|
@@ -226,25 +222,47 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
226
222
|
};
|
|
227
223
|
RepositoryImplementation.prototype.update = function (id, entity) {
|
|
228
224
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
229
|
-
var
|
|
225
|
+
var ref;
|
|
230
226
|
return tslib_1.__generator(this, function (_a) {
|
|
231
227
|
switch (_a.label) {
|
|
232
228
|
case 0:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (Object.prototype.hasOwnProperty.call(entity, key)) {
|
|
237
|
-
entity[key] = obj[key];
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return [4 /*yield*/, this.edp.update(id, entity)];
|
|
241
|
-
case 1:
|
|
242
|
-
updatedRow = _a.sent();
|
|
243
|
-
return [2 /*return*/, this.mapRawDataToResult(updatedRow, undefined)];
|
|
229
|
+
ref = this.getRefForExistingRow(entity, id);
|
|
230
|
+
return [4 /*yield*/, ref.save()];
|
|
231
|
+
case 1: return [2 /*return*/, (_a.sent())];
|
|
244
232
|
}
|
|
245
233
|
});
|
|
246
234
|
});
|
|
247
235
|
};
|
|
236
|
+
RepositoryImplementation.prototype.getRefForExistingRow = function (entity, id) {
|
|
237
|
+
var e_4, _a;
|
|
238
|
+
var ref = getEntityRef(entity, false);
|
|
239
|
+
if (!ref) {
|
|
240
|
+
var instance = new this.entity(this.remult);
|
|
241
|
+
try {
|
|
242
|
+
for (var _b = tslib_1.__values(this.metadata.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
243
|
+
var field = _c.value;
|
|
244
|
+
instance[field.key] = entity[field.key];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
248
|
+
finally {
|
|
249
|
+
try {
|
|
250
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
251
|
+
}
|
|
252
|
+
finally { if (e_4) throw e_4.error; }
|
|
253
|
+
}
|
|
254
|
+
var row_1 = new rowHelperImplementation(this._info, instance, this, this.edp, this.remult, false);
|
|
255
|
+
if (id)
|
|
256
|
+
row_1.id = id;
|
|
257
|
+
else
|
|
258
|
+
row_1.id = row_1.getId();
|
|
259
|
+
ref = row_1;
|
|
260
|
+
Object.defineProperty(instance, entityMember, {
|
|
261
|
+
get: function () { return row_1; }
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return ref;
|
|
265
|
+
};
|
|
248
266
|
RepositoryImplementation.prototype.save = function (entity) {
|
|
249
267
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
250
268
|
var ref, id;
|
|
@@ -277,7 +295,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
277
295
|
function loadManyToOne(repo, toLoad) {
|
|
278
296
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
279
297
|
var rows, rows_1, rows_1_1, r;
|
|
280
|
-
var _a,
|
|
298
|
+
var _a, e_7, _b;
|
|
281
299
|
return tslib_1.__generator(this, function (_c) {
|
|
282
300
|
switch (_c.label) {
|
|
283
301
|
case 0: return [4 /*yield*/, repo.find({ where: (_a = repo.metadata.idMetadata).getIdFilter.apply(_a, tslib_1.__spread(toLoad)) })];
|
|
@@ -289,20 +307,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
289
307
|
repo.addToCache(r);
|
|
290
308
|
}
|
|
291
309
|
}
|
|
292
|
-
catch (
|
|
310
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
293
311
|
finally {
|
|
294
312
|
try {
|
|
295
313
|
if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
|
|
296
314
|
}
|
|
297
|
-
finally { if (
|
|
315
|
+
finally { if (e_7) throw e_7.error; }
|
|
298
316
|
}
|
|
299
317
|
return [2 /*return*/];
|
|
300
318
|
}
|
|
301
319
|
});
|
|
302
320
|
});
|
|
303
321
|
}
|
|
304
|
-
var opt, _a, rawRows, loadFields, _b, _c, col, ei, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val,
|
|
305
|
-
var
|
|
322
|
+
var opt, _a, rawRows, loadFields, _b, _c, col, ei, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_5_1, result;
|
|
323
|
+
var e_5, _d, e_6, _e;
|
|
306
324
|
var _this = this;
|
|
307
325
|
return tslib_1.__generator(this, function (_f) {
|
|
308
326
|
switch (_f.label) {
|
|
@@ -346,7 +364,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
346
364
|
repo = this.remult.repo(col.valueType);
|
|
347
365
|
toLoad = [];
|
|
348
366
|
try {
|
|
349
|
-
for (rawRows_1 = (
|
|
367
|
+
for (rawRows_1 = (e_6 = void 0, tslib_1.__values(rawRows)), rawRows_1_1 = rawRows_1.next(); !rawRows_1_1.done; rawRows_1_1 = rawRows_1.next()) {
|
|
350
368
|
r = rawRows_1_1.value;
|
|
351
369
|
val = r[col.key];
|
|
352
370
|
if (val !== undefined && val !== null && !toLoad.includes(val) && !repo.idCache.has(val)) {
|
|
@@ -354,12 +372,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
354
372
|
}
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
|
-
catch (
|
|
375
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
358
376
|
finally {
|
|
359
377
|
try {
|
|
360
378
|
if (rawRows_1_1 && !rawRows_1_1.done && (_e = rawRows_1.return)) _e.call(rawRows_1);
|
|
361
379
|
}
|
|
362
|
-
finally { if (
|
|
380
|
+
finally { if (e_6) throw e_6.error; }
|
|
363
381
|
}
|
|
364
382
|
if (!(toLoad.length > 0)) return [3 /*break*/, 6];
|
|
365
383
|
return [4 /*yield*/, loadManyToOne(repo, toLoad)];
|
|
@@ -371,14 +389,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
371
389
|
return [3 /*break*/, 4];
|
|
372
390
|
case 7: return [3 /*break*/, 10];
|
|
373
391
|
case 8:
|
|
374
|
-
|
|
375
|
-
|
|
392
|
+
e_5_1 = _f.sent();
|
|
393
|
+
e_5 = { error: e_5_1 };
|
|
376
394
|
return [3 /*break*/, 10];
|
|
377
395
|
case 9:
|
|
378
396
|
try {
|
|
379
397
|
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
|
|
380
398
|
}
|
|
381
|
-
finally { if (
|
|
399
|
+
finally { if (e_5) throw e_5.error; }
|
|
382
400
|
return [7 /*endfinally*/];
|
|
383
401
|
case 10: return [4 /*yield*/, Promise.all(rawRows.map(function (r) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
384
402
|
switch (_a.label) {
|
|
@@ -504,16 +522,29 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
504
522
|
});
|
|
505
523
|
};
|
|
506
524
|
RepositoryImplementation.prototype.create = function (item) {
|
|
525
|
+
var e_8, _a;
|
|
507
526
|
var r = new this.entity(this.remult);
|
|
508
527
|
var z = this.getEntityRef(r);
|
|
509
528
|
if (item)
|
|
510
|
-
|
|
529
|
+
try {
|
|
530
|
+
for (var _b = tslib_1.__values(this.metadata.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
531
|
+
var field = _c.value;
|
|
532
|
+
r[field.key] = item[field.key];
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
536
|
+
finally {
|
|
537
|
+
try {
|
|
538
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
539
|
+
}
|
|
540
|
+
finally { if (e_8) throw e_8.error; }
|
|
541
|
+
}
|
|
511
542
|
return r;
|
|
512
543
|
};
|
|
513
544
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
514
545
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
515
546
|
var obj, _a, _b, col, r, helper;
|
|
516
|
-
var
|
|
547
|
+
var e_9, _c;
|
|
517
548
|
return tslib_1.__generator(this, function (_d) {
|
|
518
549
|
switch (_d.label) {
|
|
519
550
|
case 0:
|
|
@@ -526,12 +557,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
526
557
|
}
|
|
527
558
|
}
|
|
528
559
|
}
|
|
529
|
-
catch (
|
|
560
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
530
561
|
finally {
|
|
531
562
|
try {
|
|
532
563
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
533
564
|
}
|
|
534
|
-
finally { if (
|
|
565
|
+
finally { if (e_9) throw e_9.error; }
|
|
535
566
|
}
|
|
536
567
|
if (!newRow) return [3 /*break*/, 2];
|
|
537
568
|
r = this.create();
|
|
@@ -640,7 +671,7 @@ function createOldEntity(entity, remult) {
|
|
|
640
671
|
var key = getEntityKey(entity);
|
|
641
672
|
var base = Object.getPrototypeOf(entity);
|
|
642
673
|
var _loop_1 = function () {
|
|
643
|
-
var
|
|
674
|
+
var e_10, _a;
|
|
644
675
|
var baseCols = exports.columnsOfType.get(base);
|
|
645
676
|
if (baseCols) {
|
|
646
677
|
r.unshift.apply(r, tslib_1.__spread(baseCols.filter(function (x) { return !r.find(function (y) { return y.key == x.key; }); })));
|
|
@@ -669,17 +700,17 @@ function createOldEntity(entity, remult) {
|
|
|
669
700
|
}
|
|
670
701
|
};
|
|
671
702
|
try {
|
|
672
|
-
for (var _b = (
|
|
703
|
+
for (var _b = (e_10 = void 0, tslib_1.__values(functions)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
673
704
|
var key_1 = _c.value;
|
|
674
705
|
_loop_2(key_1);
|
|
675
706
|
}
|
|
676
707
|
}
|
|
677
|
-
catch (
|
|
708
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
678
709
|
finally {
|
|
679
710
|
try {
|
|
680
711
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
681
712
|
}
|
|
682
|
-
finally { if (
|
|
713
|
+
finally { if (e_10) throw e_10.error; }
|
|
683
714
|
}
|
|
684
715
|
}
|
|
685
716
|
base = Object.getPrototypeOf(base);
|
|
@@ -692,7 +723,7 @@ function createOldEntity(entity, remult) {
|
|
|
692
723
|
exports.createOldEntity = createOldEntity;
|
|
693
724
|
var rowHelperBase = /** @class */ (function () {
|
|
694
725
|
function rowHelperBase(columnsInfo, instance, remult) {
|
|
695
|
-
var
|
|
726
|
+
var e_11, _a;
|
|
696
727
|
var _this = this;
|
|
697
728
|
this.columnsInfo = columnsInfo;
|
|
698
729
|
this.instance = instance;
|
|
@@ -747,12 +778,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
747
778
|
_loop_3(col);
|
|
748
779
|
}
|
|
749
780
|
}
|
|
750
|
-
catch (
|
|
781
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
751
782
|
finally {
|
|
752
783
|
try {
|
|
753
784
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_a = columnsInfo_1.return)) _a.call(columnsInfo_1);
|
|
754
785
|
}
|
|
755
|
-
finally { if (
|
|
786
|
+
finally { if (e_11) throw e_11.error; }
|
|
756
787
|
}
|
|
757
788
|
}
|
|
758
789
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -774,7 +805,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
774
805
|
return this._subscribers.subscribe(listener);
|
|
775
806
|
};
|
|
776
807
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
777
|
-
var
|
|
808
|
+
var e_12, _a;
|
|
778
809
|
var _this = this;
|
|
779
810
|
if (!this._subscribers) {
|
|
780
811
|
this._subscribers = new SubscribableImp();
|
|
@@ -809,12 +840,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
809
840
|
_loop_4(col);
|
|
810
841
|
}
|
|
811
842
|
}
|
|
812
|
-
catch (
|
|
843
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
813
844
|
finally {
|
|
814
845
|
try {
|
|
815
846
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
816
847
|
}
|
|
817
|
-
finally { if (
|
|
848
|
+
finally { if (e_12) throw e_12.error; }
|
|
818
849
|
}
|
|
819
850
|
}
|
|
820
851
|
};
|
|
@@ -845,7 +876,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
845
876
|
});
|
|
846
877
|
};
|
|
847
878
|
rowHelperBase.prototype.__assertValidity = function () {
|
|
848
|
-
var
|
|
879
|
+
var e_13, _a;
|
|
849
880
|
if (!this.hasErrors()) {
|
|
850
881
|
var error = {
|
|
851
882
|
modelState: Object.assign({}, this.errors),
|
|
@@ -862,12 +893,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
862
893
|
}
|
|
863
894
|
}
|
|
864
895
|
}
|
|
865
|
-
catch (
|
|
896
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
866
897
|
finally {
|
|
867
898
|
try {
|
|
868
899
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
869
900
|
}
|
|
870
|
-
finally { if (
|
|
901
|
+
finally { if (e_13) throw e_13.error; }
|
|
871
902
|
}
|
|
872
903
|
}
|
|
873
904
|
throw error;
|
|
@@ -902,7 +933,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
902
933
|
this._reportChangedToEntityAndFields();
|
|
903
934
|
};
|
|
904
935
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
905
|
-
var
|
|
936
|
+
var e_14, _a;
|
|
906
937
|
if (this._subscribers) {
|
|
907
938
|
this._subscribers.reportChanged();
|
|
908
939
|
try {
|
|
@@ -912,12 +943,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
912
943
|
ref._subscribers.reportChanged();
|
|
913
944
|
}
|
|
914
945
|
}
|
|
915
|
-
catch (
|
|
946
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
916
947
|
finally {
|
|
917
948
|
try {
|
|
918
949
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
919
950
|
}
|
|
920
|
-
finally { if (
|
|
951
|
+
finally { if (e_14) throw e_14.error; }
|
|
921
952
|
}
|
|
922
953
|
}
|
|
923
954
|
};
|
|
@@ -927,7 +958,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
927
958
|
return !!!this.error && this.errors == undefined;
|
|
928
959
|
};
|
|
929
960
|
rowHelperBase.prototype.copyDataToObject = function () {
|
|
930
|
-
var
|
|
961
|
+
var e_15, _a;
|
|
931
962
|
var d = {};
|
|
932
963
|
try {
|
|
933
964
|
for (var _b = tslib_1.__values(this.columnsInfo), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -946,12 +977,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
946
977
|
d[col.key] = val;
|
|
947
978
|
}
|
|
948
979
|
}
|
|
949
|
-
catch (
|
|
980
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
950
981
|
finally {
|
|
951
982
|
try {
|
|
952
983
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
953
984
|
}
|
|
954
|
-
finally { if (
|
|
985
|
+
finally { if (e_15) throw e_15.error; }
|
|
955
986
|
}
|
|
956
987
|
return d;
|
|
957
988
|
};
|
|
@@ -1007,7 +1038,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1007
1038
|
});
|
|
1008
1039
|
};
|
|
1009
1040
|
rowHelperBase.prototype.toApiJson = function () {
|
|
1010
|
-
var
|
|
1041
|
+
var e_16, _a;
|
|
1011
1042
|
var result = {};
|
|
1012
1043
|
try {
|
|
1013
1044
|
for (var _b = tslib_1.__values(this.columnsInfo), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1032,19 +1063,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1032
1063
|
}
|
|
1033
1064
|
}
|
|
1034
1065
|
}
|
|
1035
|
-
catch (
|
|
1066
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1036
1067
|
finally {
|
|
1037
1068
|
try {
|
|
1038
1069
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1039
1070
|
}
|
|
1040
|
-
finally { if (
|
|
1071
|
+
finally { if (e_16) throw e_16.error; }
|
|
1041
1072
|
}
|
|
1042
1073
|
return result;
|
|
1043
1074
|
};
|
|
1044
1075
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body) {
|
|
1045
1076
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1046
1077
|
var keys, _a, _b, col, lu;
|
|
1047
|
-
var
|
|
1078
|
+
var e_17, _c;
|
|
1048
1079
|
return tslib_1.__generator(this, function (_d) {
|
|
1049
1080
|
switch (_d.label) {
|
|
1050
1081
|
case 0:
|
|
@@ -1064,12 +1095,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1064
1095
|
}
|
|
1065
1096
|
}
|
|
1066
1097
|
}
|
|
1067
|
-
catch (
|
|
1098
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1068
1099
|
finally {
|
|
1069
1100
|
try {
|
|
1070
1101
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1071
1102
|
}
|
|
1072
|
-
finally { if (
|
|
1103
|
+
finally { if (e_17) throw e_17.error; }
|
|
1073
1104
|
}
|
|
1074
1105
|
return [4 /*yield*/, Promise.all(tslib_1.__spread(this.fields).map(function (x) { return x.load(); }))];
|
|
1075
1106
|
case 1:
|
|
@@ -1084,7 +1115,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1084
1115
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
1085
1116
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
1086
1117
|
function rowHelperImplementation(info, instance, repository, edp, remult, _isNew) {
|
|
1087
|
-
var
|
|
1118
|
+
var e_18, _a;
|
|
1088
1119
|
var _this = _super.call(this, info.columnsInfo, instance, remult) || this;
|
|
1089
1120
|
_this.info = info;
|
|
1090
1121
|
_this.repository = repository;
|
|
@@ -1106,12 +1137,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1106
1137
|
}
|
|
1107
1138
|
}
|
|
1108
1139
|
}
|
|
1109
|
-
catch (
|
|
1140
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1110
1141
|
finally {
|
|
1111
1142
|
try {
|
|
1112
1143
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1113
1144
|
}
|
|
1114
|
-
finally { if (
|
|
1145
|
+
finally { if (e_18) throw e_18.error; }
|
|
1115
1146
|
}
|
|
1116
1147
|
}
|
|
1117
1148
|
if (_this.info.options.entityRefInit)
|
|
@@ -1176,7 +1207,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1176
1207
|
};
|
|
1177
1208
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
1178
1209
|
get: function () {
|
|
1179
|
-
var _a,
|
|
1210
|
+
var _a, e_19, _b;
|
|
1180
1211
|
if (!this._columns) {
|
|
1181
1212
|
var _items_1 = [];
|
|
1182
1213
|
var r_1 = (_a = {
|
|
@@ -1191,12 +1222,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1191
1222
|
_items_1.push(r_1[c.key] = new FieldRefImplementation(c, this.info.fields[c.key], this.instance, this, this));
|
|
1192
1223
|
}
|
|
1193
1224
|
}
|
|
1194
|
-
catch (
|
|
1225
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1195
1226
|
finally {
|
|
1196
1227
|
try {
|
|
1197
1228
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
1198
1229
|
}
|
|
1199
|
-
finally { if (
|
|
1230
|
+
finally { if (e_19) throw e_19.error; }
|
|
1200
1231
|
}
|
|
1201
1232
|
this._columns = r_1;
|
|
1202
1233
|
}
|
|
@@ -1208,8 +1239,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1208
1239
|
rowHelperImplementation.prototype.save = function () {
|
|
1209
1240
|
var _a;
|
|
1210
1241
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1211
|
-
var doNotSave_1, _b, _c, col,
|
|
1212
|
-
var
|
|
1242
|
+
var doNotSave_1, _b, _c, col, e_20_1, d, ignoreKeys, _d, _e, field, f, updatedRow, changesOnly, wasChanged, key, element, err_1;
|
|
1243
|
+
var e_20, _f, e_21, _g;
|
|
1213
1244
|
return tslib_1.__generator(this, function (_h) {
|
|
1214
1245
|
switch (_h.label) {
|
|
1215
1246
|
case 0:
|
|
@@ -1242,14 +1273,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1242
1273
|
return [3 /*break*/, 3];
|
|
1243
1274
|
case 6: return [3 /*break*/, 9];
|
|
1244
1275
|
case 7:
|
|
1245
|
-
|
|
1246
|
-
|
|
1276
|
+
e_20_1 = _h.sent();
|
|
1277
|
+
e_20 = { error: e_20_1 };
|
|
1247
1278
|
return [3 /*break*/, 9];
|
|
1248
1279
|
case 8:
|
|
1249
1280
|
try {
|
|
1250
1281
|
if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
|
|
1251
1282
|
}
|
|
1252
|
-
finally { if (
|
|
1283
|
+
finally { if (e_20) throw e_20.error; }
|
|
1253
1284
|
return [7 /*endfinally*/];
|
|
1254
1285
|
case 9:
|
|
1255
1286
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
@@ -1272,12 +1303,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1272
1303
|
}
|
|
1273
1304
|
}
|
|
1274
1305
|
}
|
|
1275
|
-
catch (
|
|
1306
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1276
1307
|
finally {
|
|
1277
1308
|
try {
|
|
1278
1309
|
if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
|
|
1279
1310
|
}
|
|
1280
|
-
finally { if (
|
|
1311
|
+
finally { if (e_21) throw e_21.error; }
|
|
1281
1312
|
}
|
|
1282
1313
|
if (this.info.idMetadata.field instanceof column_1.CompoundIdField)
|
|
1283
1314
|
delete (d.id);
|
|
@@ -1348,8 +1379,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1348
1379
|
};
|
|
1349
1380
|
rowHelperImplementation.prototype.delete = function () {
|
|
1350
1381
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1351
|
-
var _a, _b, listener,
|
|
1352
|
-
var
|
|
1382
|
+
var _a, _b, listener, e_22_1, err_2;
|
|
1383
|
+
var e_22, _c;
|
|
1353
1384
|
return tslib_1.__generator(this, function (_d) {
|
|
1354
1385
|
switch (_d.label) {
|
|
1355
1386
|
case 0:
|
|
@@ -1391,14 +1422,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1391
1422
|
return [3 /*break*/, 8];
|
|
1392
1423
|
case 11: return [3 /*break*/, 14];
|
|
1393
1424
|
case 12:
|
|
1394
|
-
|
|
1395
|
-
|
|
1425
|
+
e_22_1 = _d.sent();
|
|
1426
|
+
e_22 = { error: e_22_1 };
|
|
1396
1427
|
return [3 /*break*/, 14];
|
|
1397
1428
|
case 13:
|
|
1398
1429
|
try {
|
|
1399
1430
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1400
1431
|
}
|
|
1401
|
-
finally { if (
|
|
1432
|
+
finally { if (e_22) throw e_22.error; }
|
|
1402
1433
|
return [7 /*endfinally*/];
|
|
1403
1434
|
case 14:
|
|
1404
1435
|
this._wasDeleted = true;
|
|
@@ -1416,8 +1447,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1416
1447
|
};
|
|
1417
1448
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
1418
1449
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1419
|
-
var _a, _b, col, lu,
|
|
1420
|
-
var
|
|
1450
|
+
var _a, _b, col, lu, e_23_1;
|
|
1451
|
+
var e_23, _c;
|
|
1421
1452
|
return tslib_1.__generator(this, function (_d) {
|
|
1422
1453
|
switch (_d.label) {
|
|
1423
1454
|
case 0:
|
|
@@ -1452,14 +1483,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1452
1483
|
return [3 /*break*/, 1];
|
|
1453
1484
|
case 9: return [3 /*break*/, 12];
|
|
1454
1485
|
case 10:
|
|
1455
|
-
|
|
1456
|
-
|
|
1486
|
+
e_23_1 = _d.sent();
|
|
1487
|
+
e_23 = { error: e_23_1 };
|
|
1457
1488
|
return [3 /*break*/, 12];
|
|
1458
1489
|
case 11:
|
|
1459
1490
|
try {
|
|
1460
1491
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1461
1492
|
}
|
|
1462
|
-
finally { if (
|
|
1493
|
+
finally { if (e_23) throw e_23.error; }
|
|
1463
1494
|
return [7 /*endfinally*/];
|
|
1464
1495
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
1465
1496
|
case 13:
|
|
@@ -1479,8 +1510,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1479
1510
|
};
|
|
1480
1511
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
1481
1512
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1482
|
-
var _a, _b, col, _c, _d,
|
|
1483
|
-
var
|
|
1513
|
+
var _a, _b, col, _c, _d, e_24_1;
|
|
1514
|
+
var e_24, _e;
|
|
1484
1515
|
return tslib_1.__generator(this, function (_f) {
|
|
1485
1516
|
switch (_f.label) {
|
|
1486
1517
|
case 0:
|
|
@@ -1505,14 +1536,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1505
1536
|
return [3 /*break*/, 2];
|
|
1506
1537
|
case 5: return [3 /*break*/, 8];
|
|
1507
1538
|
case 6:
|
|
1508
|
-
|
|
1509
|
-
|
|
1539
|
+
e_24_1 = _f.sent();
|
|
1540
|
+
e_24 = { error: e_24_1 };
|
|
1510
1541
|
return [3 /*break*/, 8];
|
|
1511
1542
|
case 7:
|
|
1512
1543
|
try {
|
|
1513
1544
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1514
1545
|
}
|
|
1515
|
-
finally { if (
|
|
1546
|
+
finally { if (e_24) throw e_24.error; }
|
|
1516
1547
|
return [7 /*endfinally*/];
|
|
1517
1548
|
case 8: return [2 /*return*/];
|
|
1518
1549
|
}
|
|
@@ -1525,7 +1556,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1525
1556
|
return this._isNew;
|
|
1526
1557
|
};
|
|
1527
1558
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
1528
|
-
var
|
|
1559
|
+
var e_25, _a;
|
|
1529
1560
|
var _b;
|
|
1530
1561
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
1531
1562
|
try {
|
|
@@ -1535,19 +1566,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1535
1566
|
return true;
|
|
1536
1567
|
}
|
|
1537
1568
|
}
|
|
1538
|
-
catch (
|
|
1569
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1539
1570
|
finally {
|
|
1540
1571
|
try {
|
|
1541
1572
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1542
1573
|
}
|
|
1543
|
-
finally { if (
|
|
1574
|
+
finally { if (e_25) throw e_25.error; }
|
|
1544
1575
|
}
|
|
1545
1576
|
return false;
|
|
1546
1577
|
};
|
|
1547
1578
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
1548
1579
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1549
|
-
var _a, _b, c, col,
|
|
1550
|
-
var
|
|
1580
|
+
var _a, _b, c, col, e_26_1, _c, _d, listener, e_27_1;
|
|
1581
|
+
var e_26, _e, e_27, _f;
|
|
1551
1582
|
return tslib_1.__generator(this, function (_g) {
|
|
1552
1583
|
switch (_g.label) {
|
|
1553
1584
|
case 0:
|
|
@@ -1568,14 +1599,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1568
1599
|
return [3 /*break*/, 1];
|
|
1569
1600
|
case 4: return [3 /*break*/, 7];
|
|
1570
1601
|
case 5:
|
|
1571
|
-
|
|
1572
|
-
|
|
1602
|
+
e_26_1 = _g.sent();
|
|
1603
|
+
e_26 = { error: e_26_1 };
|
|
1573
1604
|
return [3 /*break*/, 7];
|
|
1574
1605
|
case 6:
|
|
1575
1606
|
try {
|
|
1576
1607
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1577
1608
|
}
|
|
1578
|
-
finally { if (
|
|
1609
|
+
finally { if (e_26) throw e_26.error; }
|
|
1579
1610
|
return [7 /*endfinally*/];
|
|
1580
1611
|
case 7:
|
|
1581
1612
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -1602,14 +1633,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1602
1633
|
return [3 /*break*/, 11];
|
|
1603
1634
|
case 14: return [3 /*break*/, 17];
|
|
1604
1635
|
case 15:
|
|
1605
|
-
|
|
1606
|
-
|
|
1636
|
+
e_27_1 = _g.sent();
|
|
1637
|
+
e_27 = { error: e_27_1 };
|
|
1607
1638
|
return [3 /*break*/, 17];
|
|
1608
1639
|
case 16:
|
|
1609
1640
|
try {
|
|
1610
1641
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
1611
1642
|
}
|
|
1612
|
-
finally { if (
|
|
1643
|
+
finally { if (e_27) throw e_27.error; }
|
|
1613
1644
|
return [7 /*endfinally*/];
|
|
1614
1645
|
case 17: return [2 /*return*/];
|
|
1615
1646
|
}
|
|
@@ -1651,7 +1682,7 @@ exports.getControllerRef = getControllerRef;
|
|
|
1651
1682
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
1652
1683
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
1653
1684
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
1654
|
-
var _a,
|
|
1685
|
+
var _a, e_28, _b;
|
|
1655
1686
|
var _this = _super.call(this, columnsInfo, instance, remult) || this;
|
|
1656
1687
|
var _items = [];
|
|
1657
1688
|
var r = (_a = {
|
|
@@ -1666,20 +1697,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1666
1697
|
_items.push(r[col.key] = new FieldRefImplementation(col, new columnDefsImpl(col, undefined, remult), instance, undefined, _this));
|
|
1667
1698
|
}
|
|
1668
1699
|
}
|
|
1669
|
-
catch (
|
|
1700
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
1670
1701
|
finally {
|
|
1671
1702
|
try {
|
|
1672
1703
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
1673
1704
|
}
|
|
1674
|
-
finally { if (
|
|
1705
|
+
finally { if (e_28) throw e_28.error; }
|
|
1675
1706
|
}
|
|
1676
1707
|
_this.fields = r;
|
|
1677
1708
|
return _this;
|
|
1678
1709
|
}
|
|
1679
1710
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
1680
1711
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1681
|
-
var _a, _b, col,
|
|
1682
|
-
var
|
|
1712
|
+
var _a, _b, col, e_29_1;
|
|
1713
|
+
var e_29, _c;
|
|
1683
1714
|
return tslib_1.__generator(this, function (_d) {
|
|
1684
1715
|
switch (_d.label) {
|
|
1685
1716
|
case 0:
|
|
@@ -1699,14 +1730,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1699
1730
|
return [3 /*break*/, 1];
|
|
1700
1731
|
case 4: return [3 /*break*/, 7];
|
|
1701
1732
|
case 5:
|
|
1702
|
-
|
|
1703
|
-
|
|
1733
|
+
e_29_1 = _d.sent();
|
|
1734
|
+
e_29 = { error: e_29_1 };
|
|
1704
1735
|
return [3 /*break*/, 7];
|
|
1705
1736
|
case 6:
|
|
1706
1737
|
try {
|
|
1707
1738
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1708
1739
|
}
|
|
1709
|
-
finally { if (
|
|
1740
|
+
finally { if (e_29) throw e_29.error; }
|
|
1710
1741
|
return [7 /*endfinally*/];
|
|
1711
1742
|
case 7: return [2 /*return*/];
|
|
1712
1743
|
}
|
|
@@ -1865,8 +1896,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
1865
1896
|
};
|
|
1866
1897
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
1867
1898
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1868
|
-
var x, _a, _b, v,
|
|
1869
|
-
var
|
|
1899
|
+
var x, _a, _b, v, e_30_1;
|
|
1900
|
+
var e_30, _c;
|
|
1870
1901
|
return tslib_1.__generator(this, function (_d) {
|
|
1871
1902
|
switch (_d.label) {
|
|
1872
1903
|
case 0:
|
|
@@ -1889,14 +1920,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
1889
1920
|
return [3 /*break*/, 2];
|
|
1890
1921
|
case 5: return [3 /*break*/, 8];
|
|
1891
1922
|
case 6:
|
|
1892
|
-
|
|
1893
|
-
|
|
1923
|
+
e_30_1 = _d.sent();
|
|
1924
|
+
e_30 = { error: e_30_1 };
|
|
1894
1925
|
return [3 /*break*/, 8];
|
|
1895
1926
|
case 7:
|
|
1896
1927
|
try {
|
|
1897
1928
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1898
1929
|
}
|
|
1899
|
-
finally { if (
|
|
1930
|
+
finally { if (e_30) throw e_30.error; }
|
|
1900
1931
|
return [7 /*endfinally*/];
|
|
1901
1932
|
case 8: return [3 /*break*/, 11];
|
|
1902
1933
|
case 9:
|
|
@@ -2023,7 +2054,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
2023
2054
|
exports.columnDefsImpl = columnDefsImpl;
|
|
2024
2055
|
var EntityFullInfo = /** @class */ (function () {
|
|
2025
2056
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
2026
|
-
var _a,
|
|
2057
|
+
var _a, e_31, _b;
|
|
2027
2058
|
var _this = this;
|
|
2028
2059
|
this.columnsInfo = columnsInfo;
|
|
2029
2060
|
this.entityInfo = entityInfo;
|
|
@@ -2093,12 +2124,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
2093
2124
|
_items.push(r[x.key] = new columnDefsImpl(x, this, remult));
|
|
2094
2125
|
}
|
|
2095
2126
|
}
|
|
2096
|
-
catch (
|
|
2127
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2097
2128
|
finally {
|
|
2098
2129
|
try {
|
|
2099
2130
|
if (columnsInfo_3_1 && !columnsInfo_3_1.done && (_b = columnsInfo_3.return)) _b.call(columnsInfo_3);
|
|
2100
2131
|
}
|
|
2101
|
-
finally { if (
|
|
2132
|
+
finally { if (e_31) throw e_31.error; }
|
|
2102
2133
|
}
|
|
2103
2134
|
this.fields = r;
|
|
2104
2135
|
this.caption = buildCaption(entityInfo.caption, this.key, remult);
|
|
@@ -2172,12 +2203,6 @@ function FieldType() {
|
|
|
2172
2203
|
};
|
|
2173
2204
|
}
|
|
2174
2205
|
exports.FieldType = FieldType;
|
|
2175
|
-
exports.Fields1 = {
|
|
2176
|
-
String: function () {
|
|
2177
|
-
return function (a) {
|
|
2178
|
-
};
|
|
2179
|
-
}
|
|
2180
|
-
};
|
|
2181
2206
|
var Fields = /** @class */ (function () {
|
|
2182
2207
|
function Fields() {
|
|
2183
2208
|
}
|
|
@@ -2278,7 +2303,7 @@ function ValueListFieldType() {
|
|
|
2278
2303
|
exports.ValueListFieldType = ValueListFieldType;
|
|
2279
2304
|
var ValueListInfo = /** @class */ (function () {
|
|
2280
2305
|
function ValueListInfo(valueListType) {
|
|
2281
|
-
var
|
|
2306
|
+
var e_32, _a, _b;
|
|
2282
2307
|
var _this = this;
|
|
2283
2308
|
this.valueListType = valueListType;
|
|
2284
2309
|
this.byIdMap = new Map();
|
|
@@ -2316,12 +2341,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
2316
2341
|
}
|
|
2317
2342
|
}
|
|
2318
2343
|
}
|
|
2319
|
-
catch (
|
|
2344
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2320
2345
|
finally {
|
|
2321
2346
|
try {
|
|
2322
2347
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
2323
2348
|
}
|
|
2324
|
-
finally { if (
|
|
2349
|
+
finally { if (e_32) throw e_32.error; }
|
|
2325
2350
|
}
|
|
2326
2351
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
2327
2352
|
throw new Error("ValueType " + this.valueListType + " has values without an id");
|
|
@@ -2438,7 +2463,7 @@ function Field(valueType) {
|
|
|
2438
2463
|
exports.Field = Field;
|
|
2439
2464
|
exports.storableMember = Symbol("storableMember");
|
|
2440
2465
|
function buildOptions(options, remult) {
|
|
2441
|
-
var
|
|
2466
|
+
var e_33, _a;
|
|
2442
2467
|
var r = {};
|
|
2443
2468
|
try {
|
|
2444
2469
|
for (var options_2 = tslib_1.__values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) {
|
|
@@ -2451,12 +2476,12 @@ function buildOptions(options, remult) {
|
|
|
2451
2476
|
}
|
|
2452
2477
|
}
|
|
2453
2478
|
}
|
|
2454
|
-
catch (
|
|
2479
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2455
2480
|
finally {
|
|
2456
2481
|
try {
|
|
2457
2482
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
2458
2483
|
}
|
|
2459
|
-
finally { if (
|
|
2484
|
+
finally { if (e_33) throw e_33.error; }
|
|
2460
2485
|
}
|
|
2461
2486
|
return r;
|
|
2462
2487
|
}
|
|
@@ -2554,7 +2579,7 @@ function Entity(key) {
|
|
|
2554
2579
|
}
|
|
2555
2580
|
}
|
|
2556
2581
|
var factory = function (remult) {
|
|
2557
|
-
var
|
|
2582
|
+
var e_34, _a;
|
|
2558
2583
|
var r = {};
|
|
2559
2584
|
try {
|
|
2560
2585
|
for (var options_3 = tslib_1.__values(options), options_3_1 = options_3.next(); !options_3_1.done; options_3_1 = options_3.next()) {
|
|
@@ -2567,12 +2592,12 @@ function Entity(key) {
|
|
|
2567
2592
|
}
|
|
2568
2593
|
}
|
|
2569
2594
|
}
|
|
2570
|
-
catch (
|
|
2595
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2571
2596
|
finally {
|
|
2572
2597
|
try {
|
|
2573
2598
|
if (options_3_1 && !options_3_1.done && (_a = options_3.return)) _a.call(options_3);
|
|
2574
2599
|
}
|
|
2575
|
-
finally { if (
|
|
2600
|
+
finally { if (e_34) throw e_34.error; }
|
|
2576
2601
|
}
|
|
2577
2602
|
var base = Object.getPrototypeOf(target);
|
|
2578
2603
|
if (base) {
|
|
@@ -2678,9 +2703,9 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2678
2703
|
});
|
|
2679
2704
|
};
|
|
2680
2705
|
QueryResultImpl.prototype.forEach = function (what) {
|
|
2681
|
-
var
|
|
2706
|
+
var e_35, _a;
|
|
2682
2707
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2683
|
-
var i, _b, _c, x,
|
|
2708
|
+
var i, _b, _c, x, e_35_1;
|
|
2684
2709
|
return tslib_1.__generator(this, function (_d) {
|
|
2685
2710
|
switch (_d.label) {
|
|
2686
2711
|
case 0:
|
|
@@ -2702,8 +2727,8 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2702
2727
|
case 5: return [3 /*break*/, 2];
|
|
2703
2728
|
case 6: return [3 /*break*/, 13];
|
|
2704
2729
|
case 7:
|
|
2705
|
-
|
|
2706
|
-
|
|
2730
|
+
e_35_1 = _d.sent();
|
|
2731
|
+
e_35 = { error: e_35_1 };
|
|
2707
2732
|
return [3 /*break*/, 13];
|
|
2708
2733
|
case 8:
|
|
2709
2734
|
_d.trys.push([8, , 11, 12]);
|
|
@@ -2714,7 +2739,7 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2714
2739
|
_d.label = 10;
|
|
2715
2740
|
case 10: return [3 /*break*/, 12];
|
|
2716
2741
|
case 11:
|
|
2717
|
-
if (
|
|
2742
|
+
if (e_35) throw e_35.error;
|
|
2718
2743
|
return [7 /*endfinally*/];
|
|
2719
2744
|
case 12: return [7 /*endfinally*/];
|
|
2720
2745
|
case 13: return [2 /*return*/, i];
|