remult 3.3.18 → 3.3.19-next.2
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/esm/index.js +7 -6
- package/esm/remult-d1.js +1 -0
- package/esm/remult-knex/index.js +112 -2
- package/esm/remult-mongo.js +17 -8
- package/esm/remult-sqlite-core.js +1 -0
- package/esm/src/data-interfaces.js +4 -4
- package/esm/src/data-providers/array-entity-data-provider.js +14 -2
- package/esm/src/data-providers/indexed-db-data-provider.js +811 -0
- package/esm/src/data-providers/json-data-provider.js +2 -2
- package/esm/src/data-providers/rest-data-provider.js +11 -12
- package/esm/src/data-providers/sql-database.js +110 -43
- package/esm/src/remult3/RepositoryImplementation.js +90 -60
- package/index.d.ts +31 -17
- package/index.js +5 -2
- package/package.json +1 -1
- package/remult-d1.d.ts +1 -0
- package/remult-d1.js +1 -0
- package/remult-knex/index.d.ts +2 -2
- package/remult-knex/index.js +329 -44
- package/remult-mongo.js +80 -36
- package/remult-sqlite-core.d.ts +1 -0
- package/remult-sqlite-core.js +1 -0
- package/src/column-interfaces.d.ts +4 -0
- package/src/data-interfaces.d.ts +2 -3
- package/src/data-interfaces.js +4 -4
- package/src/data-providers/array-entity-data-provider.d.ts +2 -2
- package/src/data-providers/array-entity-data-provider.js +92 -14
- package/src/data-providers/indexed-db-data-provider.d.ts +39 -0
- package/src/data-providers/indexed-db-data-provider.js +1387 -0
- package/src/data-providers/json-data-provider.js +2 -2
- package/src/data-providers/rest-data-provider.d.ts +2 -3
- package/src/data-providers/rest-data-provider.js +18 -17
- package/src/data-providers/sql-database.js +254 -105
- package/src/remult3/RepositoryImplementation.d.ts +1 -1
- package/src/remult3/RepositoryImplementation.js +384 -270
- package/src/remult3/remult3.d.ts +2 -2
- package/src/sql-command.d.ts +2 -0
- package/src/standard-schema/index.d.ts +1 -1
|
@@ -399,7 +399,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
399
399
|
return [2 /*return*/, ref.delete()];
|
|
400
400
|
if (!(typeof item === 'string' || typeof item === 'number')) return [3 /*break*/, 4];
|
|
401
401
|
if (!this._dataProvider.isProxy) return [3 /*break*/, 1];
|
|
402
|
-
return [2 /*return*/, this._edp.delete(item)];
|
|
402
|
+
return [2 /*return*/, this._edp.delete([item])];
|
|
403
403
|
case 1: return [4 /*yield*/, this.findId(item)];
|
|
404
404
|
case 2:
|
|
405
405
|
ref2_1 = _a.sent();
|
|
@@ -459,117 +459,82 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
459
459
|
};
|
|
460
460
|
RepositoryImplementation.prototype.insert = function (entity, options) {
|
|
461
461
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
462
|
-
var refs_1, raw, entity_1, entity_1_1, item, ref, _a, _b, e_6_1, inserted,
|
|
463
|
-
var e_6,
|
|
464
|
-
return tslib_1.__generator(this, function (
|
|
465
|
-
switch (
|
|
462
|
+
var refs_1, raw, entity_1, entity_1_1, item, ref, _a, _b, e_6_1, inserted, result, ref, result;
|
|
463
|
+
var e_6, _c;
|
|
464
|
+
return tslib_1.__generator(this, function (_d) {
|
|
465
|
+
switch (_d.label) {
|
|
466
466
|
case 0:
|
|
467
|
-
if (!Array.isArray(entity)) return [3 /*break*/,
|
|
468
|
-
if (!this._dataProvider.isProxy) return [3 /*break*/, 13];
|
|
467
|
+
if (!Array.isArray(entity)) return [3 /*break*/, 11];
|
|
469
468
|
refs_1 = [];
|
|
470
469
|
raw = [];
|
|
471
|
-
|
|
470
|
+
_d.label = 1;
|
|
472
471
|
case 1:
|
|
473
|
-
|
|
472
|
+
_d.trys.push([1, 6, 7, 8]);
|
|
474
473
|
entity_1 = tslib_1.__values(entity), entity_1_1 = entity_1.next();
|
|
475
|
-
|
|
474
|
+
_d.label = 2;
|
|
476
475
|
case 2:
|
|
477
|
-
if (!!entity_1_1.done) return [3 /*break*/,
|
|
476
|
+
if (!!entity_1_1.done) return [3 /*break*/, 5];
|
|
478
477
|
item = entity_1_1.value;
|
|
479
478
|
this.__cleanupPartialObject(item);
|
|
480
|
-
ref = (0, getEntityRef_js_1.getEntityRef)(
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
_g.label = 5;
|
|
489
|
-
case 5:
|
|
479
|
+
ref = (0, getEntityRef_js_1.getEntityRef)(item, false);
|
|
480
|
+
if (ref) {
|
|
481
|
+
if (!ref.isNew())
|
|
482
|
+
throw 'Item is not new';
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
ref = this.getEntityRef(this.create(item));
|
|
486
|
+
}
|
|
490
487
|
refs_1.push(ref);
|
|
491
488
|
_b = (_a = raw).push;
|
|
492
489
|
return [4 /*yield*/, ref.buildDtoForInsert()];
|
|
493
|
-
case
|
|
494
|
-
_b.apply(_a, [
|
|
495
|
-
|
|
496
|
-
case
|
|
490
|
+
case 3:
|
|
491
|
+
_b.apply(_a, [_d.sent()]);
|
|
492
|
+
_d.label = 4;
|
|
493
|
+
case 4:
|
|
497
494
|
entity_1_1 = entity_1.next();
|
|
498
495
|
return [3 /*break*/, 2];
|
|
499
|
-
case
|
|
500
|
-
case
|
|
501
|
-
e_6_1 =
|
|
496
|
+
case 5: return [3 /*break*/, 8];
|
|
497
|
+
case 6:
|
|
498
|
+
e_6_1 = _d.sent();
|
|
502
499
|
e_6 = { error: e_6_1 };
|
|
503
|
-
return [3 /*break*/,
|
|
504
|
-
case
|
|
500
|
+
return [3 /*break*/, 8];
|
|
501
|
+
case 7:
|
|
505
502
|
try {
|
|
506
|
-
if (entity_1_1 && !entity_1_1.done && (
|
|
503
|
+
if (entity_1_1 && !entity_1_1.done && (_c = entity_1.return)) _c.call(entity_1);
|
|
507
504
|
}
|
|
508
505
|
finally { if (e_6) throw e_6.error; }
|
|
509
506
|
return [7 /*endfinally*/];
|
|
510
|
-
case
|
|
511
|
-
case
|
|
512
|
-
inserted =
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
return [2 /*return*/, promiseAll(inserted, function (item, i) {
|
|
516
|
-
return refs_1[i].processInsertResponseDto(item);
|
|
507
|
+
case 8: return [4 /*yield*/, this._edp.insert(raw, options)];
|
|
508
|
+
case 9:
|
|
509
|
+
inserted = _d.sent();
|
|
510
|
+
return [4 /*yield*/, promiseAll(inserted, function (row, i) {
|
|
511
|
+
return refs_1[i].processInsertResponseDto(row);
|
|
517
512
|
})];
|
|
518
|
-
case
|
|
519
|
-
|
|
520
|
-
_g.label = 14;
|
|
521
|
-
case 14:
|
|
522
|
-
_g.trys.push([14, 19, 20, 21]);
|
|
523
|
-
entity_2 = tslib_1.__values(entity), entity_2_1 = entity_2.next();
|
|
524
|
-
_g.label = 15;
|
|
525
|
-
case 15:
|
|
526
|
-
if (!!entity_2_1.done) return [3 /*break*/, 18];
|
|
527
|
-
item = entity_2_1.value;
|
|
528
|
-
_d = (_c = r).push;
|
|
529
|
-
return [4 /*yield*/, this.insert(item, options)];
|
|
530
|
-
case 16:
|
|
531
|
-
_d.apply(_c, [_g.sent()]);
|
|
532
|
-
_g.label = 17;
|
|
533
|
-
case 17:
|
|
534
|
-
entity_2_1 = entity_2.next();
|
|
535
|
-
return [3 /*break*/, 15];
|
|
536
|
-
case 18: return [3 /*break*/, 21];
|
|
537
|
-
case 19:
|
|
538
|
-
e_7_1 = _g.sent();
|
|
539
|
-
e_7 = { error: e_7_1 };
|
|
540
|
-
return [3 /*break*/, 21];
|
|
541
|
-
case 20:
|
|
542
|
-
try {
|
|
543
|
-
if (entity_2_1 && !entity_2_1.done && (_f = entity_2.return)) _f.call(entity_2);
|
|
544
|
-
}
|
|
545
|
-
finally { if (e_7) throw e_7.error; }
|
|
546
|
-
return [7 /*endfinally*/];
|
|
547
|
-
case 21:
|
|
513
|
+
case 10:
|
|
514
|
+
result = _d.sent();
|
|
548
515
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
549
516
|
return [2 /*return*/, undefined];
|
|
550
|
-
return [2 /*return*/,
|
|
551
|
-
case
|
|
552
|
-
case 23:
|
|
517
|
+
return [2 /*return*/, result];
|
|
518
|
+
case 11:
|
|
553
519
|
ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
554
520
|
result = undefined;
|
|
555
|
-
if (!ref) return [3 /*break*/,
|
|
521
|
+
if (!ref) return [3 /*break*/, 13];
|
|
556
522
|
if (!ref.isNew())
|
|
557
523
|
throw 'Item is not new';
|
|
558
524
|
return [4 /*yield*/, ref.save(options)];
|
|
559
|
-
case
|
|
560
|
-
result =
|
|
561
|
-
return [3 /*break*/,
|
|
562
|
-
case
|
|
525
|
+
case 12:
|
|
526
|
+
result = _d.sent();
|
|
527
|
+
return [3 /*break*/, 15];
|
|
528
|
+
case 13:
|
|
563
529
|
this.__cleanupPartialObject(entity);
|
|
564
530
|
return [4 /*yield*/, this.getEntityRef(this.create(entity)).save(options)];
|
|
565
|
-
case
|
|
566
|
-
result =
|
|
567
|
-
|
|
568
|
-
case
|
|
531
|
+
case 14:
|
|
532
|
+
result = _d.sent();
|
|
533
|
+
_d.label = 15;
|
|
534
|
+
case 15:
|
|
569
535
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
570
536
|
return [2 /*return*/, undefined];
|
|
571
537
|
return [2 /*return*/, result];
|
|
572
|
-
case 28: return [2 /*return*/];
|
|
573
538
|
}
|
|
574
539
|
});
|
|
575
540
|
});
|
|
@@ -587,8 +552,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
587
552
|
fields[_i - 1] = arguments[_i];
|
|
588
553
|
}
|
|
589
554
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
590
|
-
var ref, hasError, fields_1, fields_1_1, f,
|
|
591
|
-
var
|
|
555
|
+
var ref, hasError, fields_1, fields_1_1, f, e_7_1;
|
|
556
|
+
var e_7, _a;
|
|
592
557
|
return tslib_1.__generator(this, function (_b) {
|
|
593
558
|
switch (_b.label) {
|
|
594
559
|
case 0:
|
|
@@ -619,14 +584,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
619
584
|
return [3 /*break*/, 4];
|
|
620
585
|
case 7: return [3 /*break*/, 10];
|
|
621
586
|
case 8:
|
|
622
|
-
|
|
623
|
-
|
|
587
|
+
e_7_1 = _b.sent();
|
|
588
|
+
e_7 = { error: e_7_1 };
|
|
624
589
|
return [3 /*break*/, 10];
|
|
625
590
|
case 9:
|
|
626
591
|
try {
|
|
627
592
|
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
628
593
|
}
|
|
629
|
-
finally { if (
|
|
594
|
+
finally { if (e_7) throw e_7.error; }
|
|
630
595
|
return [7 /*endfinally*/];
|
|
631
596
|
case 10:
|
|
632
597
|
if (!hasError)
|
|
@@ -637,7 +602,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
637
602
|
});
|
|
638
603
|
};
|
|
639
604
|
RepositoryImplementation.prototype.__createDto = function (basedOn) {
|
|
640
|
-
var
|
|
605
|
+
var e_8, _a;
|
|
641
606
|
this.__cleanupPartialObject(basedOn);
|
|
642
607
|
var ref = this.getEntityRef(tslib_1.__assign({}, basedOn));
|
|
643
608
|
var r = ref.copyDataToObject(false);
|
|
@@ -649,19 +614,19 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
649
614
|
delete r[element.key];
|
|
650
615
|
}
|
|
651
616
|
}
|
|
652
|
-
catch (
|
|
617
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
653
618
|
finally {
|
|
654
619
|
try {
|
|
655
620
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
656
621
|
}
|
|
657
|
-
finally { if (
|
|
622
|
+
finally { if (e_8) throw e_8.error; }
|
|
658
623
|
}
|
|
659
624
|
return r;
|
|
660
625
|
};
|
|
661
626
|
RepositoryImplementation.prototype.updateMany = function (_a) {
|
|
662
627
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
663
|
-
var _c, _d, _e, updated, _f, _g, _h, item,
|
|
664
|
-
var _j,
|
|
628
|
+
var _c, _d, _e, updated, _f, _g, _h, item, e_9_1;
|
|
629
|
+
var _j, e_9, _k, _l;
|
|
665
630
|
var where = _b.where, set = _b.set;
|
|
666
631
|
return tslib_1.__generator(this, function (_m) {
|
|
667
632
|
switch (_m.label) {
|
|
@@ -704,8 +669,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
704
669
|
return [3 /*break*/, 6];
|
|
705
670
|
case 10: return [3 /*break*/, 17];
|
|
706
671
|
case 11:
|
|
707
|
-
|
|
708
|
-
|
|
672
|
+
e_9_1 = _m.sent();
|
|
673
|
+
e_9 = { error: e_9_1 };
|
|
709
674
|
return [3 /*break*/, 17];
|
|
710
675
|
case 12:
|
|
711
676
|
_m.trys.push([12, , 15, 16]);
|
|
@@ -716,7 +681,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
716
681
|
_m.label = 14;
|
|
717
682
|
case 14: return [3 /*break*/, 16];
|
|
718
683
|
case 15:
|
|
719
|
-
if (
|
|
684
|
+
if (e_9) throw e_9.error;
|
|
720
685
|
return [7 /*endfinally*/];
|
|
721
686
|
case 16: return [7 /*endfinally*/];
|
|
722
687
|
case 17: return [2 /*return*/, updated];
|
|
@@ -843,7 +808,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
843
808
|
});
|
|
844
809
|
};
|
|
845
810
|
RepositoryImplementation.prototype._getRefForExistingRow = function (entity, id) {
|
|
846
|
-
var
|
|
811
|
+
var e_10, _a;
|
|
847
812
|
var ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
848
813
|
if (!ref) {
|
|
849
814
|
var instance = new this._entity(this._remult);
|
|
@@ -854,12 +819,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
854
819
|
instance[key] = entity[key];
|
|
855
820
|
}
|
|
856
821
|
}
|
|
857
|
-
catch (
|
|
822
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
858
823
|
finally {
|
|
859
824
|
try {
|
|
860
825
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
861
826
|
}
|
|
862
|
-
finally { if (
|
|
827
|
+
finally { if (e_10) throw e_10.error; }
|
|
863
828
|
}
|
|
864
829
|
this._fixTypes(instance);
|
|
865
830
|
var row_1 = new rowHelperImplementation(this._info, instance, this, this._edp, this._remult, false);
|
|
@@ -1032,7 +997,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1032
997
|
case 0:
|
|
1033
998
|
loader = new relation_loader_js_1.RelationLoader();
|
|
1034
999
|
return [4 /*yield*/, this._loadManyToOneForManyRows(jsonItems.map(function (row) {
|
|
1035
|
-
var
|
|
1000
|
+
var e_11, _a;
|
|
1036
1001
|
var result = {};
|
|
1037
1002
|
try {
|
|
1038
1003
|
for (var _b = tslib_1.__values(_this.metadata.fields.toArray()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1040,12 +1005,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1040
1005
|
result[col.key] = col.valueConverter.fromJson(row[col.key]);
|
|
1041
1006
|
}
|
|
1042
1007
|
}
|
|
1043
|
-
catch (
|
|
1008
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1044
1009
|
finally {
|
|
1045
1010
|
try {
|
|
1046
1011
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1047
1012
|
}
|
|
1048
|
-
finally { if (
|
|
1013
|
+
finally { if (e_11) throw e_11.error; }
|
|
1049
1014
|
}
|
|
1050
1015
|
return result;
|
|
1051
1016
|
}), loadOptions, loader)];
|
|
@@ -1064,7 +1029,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1064
1029
|
function loadManyToOne(repo, toLoad) {
|
|
1065
1030
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1066
1031
|
var rows, rows_1, rows_1_1, r;
|
|
1067
|
-
var _a,
|
|
1032
|
+
var _a, e_14, _b;
|
|
1068
1033
|
return tslib_1.__generator(this, function (_c) {
|
|
1069
1034
|
switch (_c.label) {
|
|
1070
1035
|
case 0: return [4 /*yield*/, repo.find({ where: (_a = repo.metadata.idMetadata).getIdFilter.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(toLoad), false)) }, true)];
|
|
@@ -1076,20 +1041,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1076
1041
|
repo._addToCache(r);
|
|
1077
1042
|
}
|
|
1078
1043
|
}
|
|
1079
|
-
catch (
|
|
1044
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1080
1045
|
finally {
|
|
1081
1046
|
try {
|
|
1082
1047
|
if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
|
|
1083
1048
|
}
|
|
1084
|
-
finally { if (
|
|
1049
|
+
finally { if (e_14) throw e_14.error; }
|
|
1085
1050
|
}
|
|
1086
1051
|
return [2 /*return*/];
|
|
1087
1052
|
}
|
|
1088
1053
|
});
|
|
1089
1054
|
});
|
|
1090
1055
|
}
|
|
1091
|
-
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val,
|
|
1092
|
-
var
|
|
1056
|
+
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_12_1, excludeRelationMembers, result, fields;
|
|
1057
|
+
var e_12, _c, e_13, _d;
|
|
1093
1058
|
var _this = this;
|
|
1094
1059
|
return tslib_1.__generator(this, function (_e) {
|
|
1095
1060
|
switch (_e.label) {
|
|
@@ -1116,7 +1081,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1116
1081
|
repo = this._remult.repo(col.valueType);
|
|
1117
1082
|
toLoad = [];
|
|
1118
1083
|
try {
|
|
1119
|
-
for (rawRows_1 = (
|
|
1084
|
+
for (rawRows_1 = (e_13 = void 0, tslib_1.__values(rawRows)), rawRows_1_1 = rawRows_1.next(); !rawRows_1_1.done; rawRows_1_1 = rawRows_1.next()) {
|
|
1120
1085
|
r = rawRows_1_1.value;
|
|
1121
1086
|
val = r[col.key];
|
|
1122
1087
|
if (val !== undefined &&
|
|
@@ -1127,12 +1092,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1127
1092
|
}
|
|
1128
1093
|
}
|
|
1129
1094
|
}
|
|
1130
|
-
catch (
|
|
1095
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1131
1096
|
finally {
|
|
1132
1097
|
try {
|
|
1133
1098
|
if (rawRows_1_1 && !rawRows_1_1.done && (_d = rawRows_1.return)) _d.call(rawRows_1);
|
|
1134
1099
|
}
|
|
1135
|
-
finally { if (
|
|
1100
|
+
finally { if (e_13) throw e_13.error; }
|
|
1136
1101
|
}
|
|
1137
1102
|
if (!(toLoad.length > 0)) return [3 /*break*/, 4];
|
|
1138
1103
|
return [4 /*yield*/, loadManyToOne(repo, toLoad)];
|
|
@@ -1144,14 +1109,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1144
1109
|
return [3 /*break*/, 2];
|
|
1145
1110
|
case 5: return [3 /*break*/, 8];
|
|
1146
1111
|
case 6:
|
|
1147
|
-
|
|
1148
|
-
|
|
1112
|
+
e_12_1 = _e.sent();
|
|
1113
|
+
e_12 = { error: e_12_1 };
|
|
1149
1114
|
return [3 /*break*/, 8];
|
|
1150
1115
|
case 7:
|
|
1151
1116
|
try {
|
|
1152
1117
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1153
1118
|
}
|
|
1154
|
-
finally { if (
|
|
1119
|
+
finally { if (e_12) throw e_12.error; }
|
|
1155
1120
|
return [7 /*endfinally*/];
|
|
1156
1121
|
case 8:
|
|
1157
1122
|
excludeRelationMembers = new Set(this.fields
|
|
@@ -1179,9 +1144,9 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1179
1144
|
});
|
|
1180
1145
|
};
|
|
1181
1146
|
RepositoryImplementation.prototype._populateRelationsForFields = function (fields, loadOptions, result, loader) {
|
|
1182
|
-
var
|
|
1147
|
+
var e_15, _a;
|
|
1183
1148
|
var _loop_1 = function (col) {
|
|
1184
|
-
var
|
|
1149
|
+
var e_16, _b, e_17, _c;
|
|
1185
1150
|
var _d = this_1.__getRelationAndInclude(col, loadOptions), rel = _d.rel, incl = _d.incl;
|
|
1186
1151
|
if (rel)
|
|
1187
1152
|
if (incl) {
|
|
@@ -1219,32 +1184,32 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1219
1184
|
}
|
|
1220
1185
|
};
|
|
1221
1186
|
try {
|
|
1222
|
-
for (var result_1 = (
|
|
1187
|
+
for (var result_1 = (e_16 = void 0, tslib_1.__values(result)), result_1_1 = result_1.next(); !result_1_1.done; result_1_1 = result_1.next()) {
|
|
1223
1188
|
var row = result_1_1.value;
|
|
1224
1189
|
_loop_2(row);
|
|
1225
1190
|
}
|
|
1226
1191
|
}
|
|
1227
|
-
catch (
|
|
1192
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1228
1193
|
finally {
|
|
1229
1194
|
try {
|
|
1230
1195
|
if (result_1_1 && !result_1_1.done && (_b = result_1.return)) _b.call(result_1);
|
|
1231
1196
|
}
|
|
1232
|
-
finally { if (
|
|
1197
|
+
finally { if (e_16) throw e_16.error; }
|
|
1233
1198
|
}
|
|
1234
1199
|
}
|
|
1235
1200
|
else {
|
|
1236
1201
|
try {
|
|
1237
|
-
for (var result_2 = (
|
|
1202
|
+
for (var result_2 = (e_17 = void 0, tslib_1.__values(result)), result_2_1 = result_2.next(); !result_2_1.done; result_2_1 = result_2.next()) {
|
|
1238
1203
|
var row = result_2_1.value;
|
|
1239
1204
|
Reflect.deleteProperty(row, col.key);
|
|
1240
1205
|
}
|
|
1241
1206
|
}
|
|
1242
|
-
catch (
|
|
1207
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1243
1208
|
finally {
|
|
1244
1209
|
try {
|
|
1245
1210
|
if (result_2_1 && !result_2_1.done && (_c = result_2.return)) _c.call(result_2);
|
|
1246
1211
|
}
|
|
1247
|
-
finally { if (
|
|
1212
|
+
finally { if (e_17) throw e_17.error; }
|
|
1248
1213
|
}
|
|
1249
1214
|
}
|
|
1250
1215
|
};
|
|
@@ -1255,12 +1220,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1255
1220
|
_loop_1(col);
|
|
1256
1221
|
}
|
|
1257
1222
|
}
|
|
1258
|
-
catch (
|
|
1223
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1259
1224
|
finally {
|
|
1260
1225
|
try {
|
|
1261
1226
|
if (fields_2_1 && !fields_2_1.done && (_a = fields_2.return)) _a.call(fields_2);
|
|
1262
1227
|
}
|
|
1263
|
-
finally { if (
|
|
1228
|
+
finally { if (e_15) throw e_15.error; }
|
|
1264
1229
|
}
|
|
1265
1230
|
};
|
|
1266
1231
|
RepositoryImplementation.prototype.__getRelationAndInclude = function (col, loadOptions) {
|
|
@@ -1276,7 +1241,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1276
1241
|
};
|
|
1277
1242
|
/*@internal */
|
|
1278
1243
|
RepositoryImplementation.prototype._findOptionsBasedOnRelation = function (rel, field, moreFindOptions, row, otherRepo) {
|
|
1279
|
-
var
|
|
1244
|
+
var e_18, _a, e_19, _b, _c, _d;
|
|
1280
1245
|
var returnNull = false;
|
|
1281
1246
|
var returnUndefined = false;
|
|
1282
1247
|
var where = [];
|
|
@@ -1296,7 +1261,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1296
1261
|
if (source.where)
|
|
1297
1262
|
where.push(source.where);
|
|
1298
1263
|
try {
|
|
1299
|
-
for (var _e = (
|
|
1264
|
+
for (var _e = (e_19 = void 0, tslib_1.__values([
|
|
1300
1265
|
'limit',
|
|
1301
1266
|
'include',
|
|
1302
1267
|
'orderBy',
|
|
@@ -1308,21 +1273,21 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1308
1273
|
findOptions[key] = source[key];
|
|
1309
1274
|
}
|
|
1310
1275
|
}
|
|
1311
|
-
catch (
|
|
1276
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1312
1277
|
finally {
|
|
1313
1278
|
try {
|
|
1314
1279
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1315
1280
|
}
|
|
1316
|
-
finally { if (
|
|
1281
|
+
finally { if (e_19) throw e_19.error; }
|
|
1317
1282
|
}
|
|
1318
1283
|
}
|
|
1319
1284
|
}
|
|
1320
|
-
catch (
|
|
1285
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1321
1286
|
finally {
|
|
1322
1287
|
try {
|
|
1323
1288
|
if (findOptionsSources_1_1 && !findOptionsSources_1_1.done && (_a = findOptionsSources_1.return)) _a.call(findOptionsSources_1);
|
|
1324
1289
|
}
|
|
1325
|
-
finally { if (
|
|
1290
|
+
finally { if (e_18) throw e_18.error; }
|
|
1326
1291
|
}
|
|
1327
1292
|
var relFields = rel.getFields();
|
|
1328
1293
|
var getFieldValue = function (key) {
|
|
@@ -1399,7 +1364,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1399
1364
|
return this.getEntityRef(item).toApiJson(true);
|
|
1400
1365
|
};
|
|
1401
1366
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
1402
|
-
var
|
|
1367
|
+
var e_20, _a;
|
|
1403
1368
|
var _this = this;
|
|
1404
1369
|
if (json === null || json === undefined)
|
|
1405
1370
|
return json;
|
|
@@ -1425,12 +1390,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1425
1390
|
}
|
|
1426
1391
|
}
|
|
1427
1392
|
}
|
|
1428
|
-
catch (
|
|
1393
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1429
1394
|
finally {
|
|
1430
1395
|
try {
|
|
1431
1396
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1432
1397
|
}
|
|
1433
|
-
finally { if (
|
|
1398
|
+
finally { if (e_20) throw e_20.error; }
|
|
1434
1399
|
}
|
|
1435
1400
|
this._fixTypes(result);
|
|
1436
1401
|
if (newRow) {
|
|
@@ -1463,11 +1428,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1463
1428
|
};
|
|
1464
1429
|
RepositoryImplementation.prototype.deleteMany = function (_a) {
|
|
1465
1430
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
1466
|
-
var _c, _d, _e,
|
|
1467
|
-
var
|
|
1431
|
+
var _c, _d, _e, prepared, _f, _g, _h, item, ref, _j, _k, _l, e_21_1, ids, prepared_1, prepared_1_1, x, e_22_1;
|
|
1432
|
+
var e_22, _m;
|
|
1433
|
+
var _o, e_21, _p, _q;
|
|
1468
1434
|
var where = _b.where;
|
|
1469
|
-
return tslib_1.__generator(this, function (
|
|
1470
|
-
switch (
|
|
1435
|
+
return tslib_1.__generator(this, function (_r) {
|
|
1436
|
+
switch (_r.label) {
|
|
1471
1437
|
case 0:
|
|
1472
1438
|
filter_interfaces_js_1.Filter.throwErrorIfFilterIsEmpty(where, 'deleteMany');
|
|
1473
1439
|
if (!this._dataProvider.isProxy) return [3 /*break*/, 4];
|
|
@@ -1477,50 +1443,84 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1477
1443
|
return [3 /*break*/, 3];
|
|
1478
1444
|
case 1: return [4 /*yield*/, this._translateWhereToFilter(where)];
|
|
1479
1445
|
case 2:
|
|
1480
|
-
_e =
|
|
1481
|
-
|
|
1446
|
+
_e = _r.sent();
|
|
1447
|
+
_r.label = 3;
|
|
1482
1448
|
case 3: return [2 /*return*/, _d.apply(_c, [_e])];
|
|
1483
1449
|
case 4:
|
|
1484
|
-
deleted = 0;
|
|
1485
1450
|
if (where === 'all')
|
|
1486
1451
|
where = undefined;
|
|
1487
|
-
|
|
1452
|
+
prepared = [];
|
|
1453
|
+
_r.label = 5;
|
|
1488
1454
|
case 5:
|
|
1489
|
-
|
|
1455
|
+
_r.trys.push([5, 11, 12, 17]);
|
|
1490
1456
|
_f = true, _g = tslib_1.__asyncValues(this.query({ where: where, aggregate: undefined }));
|
|
1491
|
-
|
|
1457
|
+
_r.label = 6;
|
|
1492
1458
|
case 6: return [4 /*yield*/, _g.next()];
|
|
1493
1459
|
case 7:
|
|
1494
|
-
if (!(_h =
|
|
1495
|
-
|
|
1460
|
+
if (!(_h = _r.sent(), _o = _h.done, !_o)) return [3 /*break*/, 10];
|
|
1461
|
+
_q = _h.value;
|
|
1496
1462
|
_f = false;
|
|
1497
|
-
item =
|
|
1498
|
-
|
|
1463
|
+
item = _q;
|
|
1464
|
+
ref = (0, getEntityRef_js_1.getEntityRef)(item);
|
|
1465
|
+
_k = (_j = prepared).push;
|
|
1466
|
+
_l = [{ ref: ref }];
|
|
1467
|
+
return [4 /*yield*/, ref.__prepareDelete()];
|
|
1499
1468
|
case 8:
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
_m.label = 9;
|
|
1469
|
+
_k.apply(_j, [tslib_1.__assign.apply(void 0, _l.concat([(_r.sent())]))]);
|
|
1470
|
+
_r.label = 9;
|
|
1503
1471
|
case 9:
|
|
1504
1472
|
_f = true;
|
|
1505
1473
|
return [3 /*break*/, 6];
|
|
1506
1474
|
case 10: return [3 /*break*/, 17];
|
|
1507
1475
|
case 11:
|
|
1508
|
-
|
|
1509
|
-
|
|
1476
|
+
e_21_1 = _r.sent();
|
|
1477
|
+
e_21 = { error: e_21_1 };
|
|
1510
1478
|
return [3 /*break*/, 17];
|
|
1511
1479
|
case 12:
|
|
1512
|
-
|
|
1513
|
-
if (!(!_f && !
|
|
1514
|
-
return [4 /*yield*/,
|
|
1480
|
+
_r.trys.push([12, , 15, 16]);
|
|
1481
|
+
if (!(!_f && !_o && (_p = _g.return))) return [3 /*break*/, 14];
|
|
1482
|
+
return [4 /*yield*/, _p.call(_g)];
|
|
1515
1483
|
case 13:
|
|
1516
|
-
|
|
1517
|
-
|
|
1484
|
+
_r.sent();
|
|
1485
|
+
_r.label = 14;
|
|
1518
1486
|
case 14: return [3 /*break*/, 16];
|
|
1519
1487
|
case 15:
|
|
1520
|
-
if (
|
|
1488
|
+
if (e_21) throw e_21.error;
|
|
1521
1489
|
return [7 /*endfinally*/];
|
|
1522
1490
|
case 16: return [7 /*endfinally*/];
|
|
1523
|
-
case 17:
|
|
1491
|
+
case 17:
|
|
1492
|
+
ids = prepared.filter(function (x) { return x.doDelete; }).map(function (x) { return x.ref.id; });
|
|
1493
|
+
if (!ids.length) return [3 /*break*/, 19];
|
|
1494
|
+
return [4 /*yield*/, this._edp.delete(ids)];
|
|
1495
|
+
case 18:
|
|
1496
|
+
_r.sent();
|
|
1497
|
+
_r.label = 19;
|
|
1498
|
+
case 19:
|
|
1499
|
+
_r.trys.push([19, 24, 25, 26]);
|
|
1500
|
+
prepared_1 = tslib_1.__values(prepared), prepared_1_1 = prepared_1.next();
|
|
1501
|
+
_r.label = 20;
|
|
1502
|
+
case 20:
|
|
1503
|
+
if (!!prepared_1_1.done) return [3 /*break*/, 23];
|
|
1504
|
+
x = prepared_1_1.value;
|
|
1505
|
+
return [4 /*yield*/, x.ref.__finishDelete(x.event)];
|
|
1506
|
+
case 21:
|
|
1507
|
+
_r.sent();
|
|
1508
|
+
_r.label = 22;
|
|
1509
|
+
case 22:
|
|
1510
|
+
prepared_1_1 = prepared_1.next();
|
|
1511
|
+
return [3 /*break*/, 20];
|
|
1512
|
+
case 23: return [3 /*break*/, 26];
|
|
1513
|
+
case 24:
|
|
1514
|
+
e_22_1 = _r.sent();
|
|
1515
|
+
e_22 = { error: e_22_1 };
|
|
1516
|
+
return [3 /*break*/, 26];
|
|
1517
|
+
case 25:
|
|
1518
|
+
try {
|
|
1519
|
+
if (prepared_1_1 && !prepared_1_1.done && (_m = prepared_1.return)) _m.call(prepared_1);
|
|
1520
|
+
}
|
|
1521
|
+
finally { if (e_22) throw e_22.error; }
|
|
1522
|
+
return [7 /*endfinally*/];
|
|
1523
|
+
case 26: return [2 /*return*/, prepared.length];
|
|
1524
1524
|
}
|
|
1525
1525
|
});
|
|
1526
1526
|
});
|
|
@@ -2574,9 +2574,9 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2574
2574
|
case 15:
|
|
2575
2575
|
updatedRow = (updatedRow = _t.sent())[0];
|
|
2576
2576
|
return [3 /*break*/, 18];
|
|
2577
|
-
case 16: return [4 /*yield*/, this.edp.insert(d, options)];
|
|
2577
|
+
case 16: return [4 /*yield*/, this.edp.insert([d], options)];
|
|
2578
2578
|
case 17:
|
|
2579
|
-
updatedRow = _t.sent();
|
|
2579
|
+
updatedRow = (_t.sent())[0];
|
|
2580
2580
|
_t.label = 18;
|
|
2581
2581
|
case 18: return [3 /*break*/, 25];
|
|
2582
2582
|
case 19:
|
|
@@ -2676,32 +2676,119 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2676
2676
|
};
|
|
2677
2677
|
rowHelperImplementation.prototype.processInsertResponseDto = function (updatedRow) {
|
|
2678
2678
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2679
|
+
var e, _a, _b, listener, e_39_1, err_2;
|
|
2680
|
+
var e_39, _c;
|
|
2681
|
+
var _d;
|
|
2682
|
+
return tslib_1.__generator(this, function (_e) {
|
|
2683
|
+
switch (_e.label) {
|
|
2684
|
+
case 0:
|
|
2685
|
+
_e.trys.push([0, 13, , 15]);
|
|
2686
|
+
if (!updatedRow) return [3 /*break*/, 2];
|
|
2687
|
+
return [4 /*yield*/, this.loadDataFrom(updatedRow)];
|
|
2682
2688
|
case 1:
|
|
2683
|
-
|
|
2689
|
+
_e.sent();
|
|
2690
|
+
_e.label = 2;
|
|
2691
|
+
case 2:
|
|
2692
|
+
e = this.buildLifeCycleEvent();
|
|
2693
|
+
e.id = this.getId();
|
|
2694
|
+
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 12];
|
|
2695
|
+
if (!this.info.entityInfo.saved) return [3 /*break*/, 4];
|
|
2696
|
+
return [4 /*yield*/, this.info.entityInfo.saved(this.instance, e)];
|
|
2697
|
+
case 3:
|
|
2698
|
+
_e.sent();
|
|
2699
|
+
_e.label = 4;
|
|
2700
|
+
case 4:
|
|
2701
|
+
if (!this.repo.listeners) return [3 /*break*/, 12];
|
|
2702
|
+
_e.label = 5;
|
|
2703
|
+
case 5:
|
|
2704
|
+
_e.trys.push([5, 10, 11, 12]);
|
|
2705
|
+
_a = tslib_1.__values(this.repo.listeners), _b = _a.next();
|
|
2706
|
+
_e.label = 6;
|
|
2707
|
+
case 6:
|
|
2708
|
+
if (!!_b.done) return [3 /*break*/, 9];
|
|
2709
|
+
listener = _b.value;
|
|
2710
|
+
return [4 /*yield*/, ((_d = listener.saved) === null || _d === void 0 ? void 0 : _d.call(listener, this.instance, true))];
|
|
2711
|
+
case 7:
|
|
2712
|
+
_e.sent();
|
|
2713
|
+
_e.label = 8;
|
|
2714
|
+
case 8:
|
|
2715
|
+
_b = _a.next();
|
|
2716
|
+
return [3 /*break*/, 6];
|
|
2717
|
+
case 9: return [3 /*break*/, 12];
|
|
2718
|
+
case 10:
|
|
2719
|
+
e_39_1 = _e.sent();
|
|
2720
|
+
e_39 = { error: e_39_1 };
|
|
2721
|
+
return [3 /*break*/, 12];
|
|
2722
|
+
case 11:
|
|
2723
|
+
try {
|
|
2724
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2725
|
+
}
|
|
2726
|
+
finally { if (e_39) throw e_39.error; }
|
|
2727
|
+
return [7 /*endfinally*/];
|
|
2728
|
+
case 12:
|
|
2729
|
+
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
2684
2730
|
this.saveOriginalData();
|
|
2685
2731
|
this._isNew = false;
|
|
2686
2732
|
return [2 /*return*/, this.instance];
|
|
2733
|
+
case 13:
|
|
2734
|
+
err_2 = _e.sent();
|
|
2735
|
+
return [4 /*yield*/, this.catchSaveErrors(err_2)];
|
|
2736
|
+
case 14: throw _e.sent();
|
|
2737
|
+
case 15: return [2 /*return*/];
|
|
2687
2738
|
}
|
|
2688
2739
|
});
|
|
2689
2740
|
});
|
|
2690
2741
|
};
|
|
2691
2742
|
rowHelperImplementation.prototype.buildDtoForInsert = function () {
|
|
2692
2743
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2693
|
-
var
|
|
2694
|
-
var
|
|
2695
|
-
return tslib_1.__generator(this, function (
|
|
2696
|
-
switch (
|
|
2744
|
+
var e, _a, _b, col, e_40_1, d, _c, _d, field, f;
|
|
2745
|
+
var e_40, _e, e_41, _f;
|
|
2746
|
+
return tslib_1.__generator(this, function (_g) {
|
|
2747
|
+
switch (_g.label) {
|
|
2697
2748
|
case 0: return [4 /*yield*/, this.__validateEntity()];
|
|
2698
2749
|
case 1:
|
|
2699
|
-
|
|
2750
|
+
_g.sent();
|
|
2751
|
+
e = this.buildLifeCycleEvent();
|
|
2752
|
+
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 11];
|
|
2753
|
+
_g.label = 2;
|
|
2754
|
+
case 2:
|
|
2755
|
+
_g.trys.push([2, 7, 8, 9]);
|
|
2756
|
+
_a = tslib_1.__values(this.fields), _b = _a.next();
|
|
2757
|
+
_g.label = 3;
|
|
2758
|
+
case 3:
|
|
2759
|
+
if (!!_b.done) return [3 /*break*/, 6];
|
|
2760
|
+
col = _b.value;
|
|
2761
|
+
if (!col.metadata.options.saving) return [3 /*break*/, 5];
|
|
2762
|
+
return [4 /*yield*/, col.metadata.options.saving(this.instance, col, e)];
|
|
2763
|
+
case 4:
|
|
2764
|
+
_g.sent();
|
|
2765
|
+
_g.label = 5;
|
|
2766
|
+
case 5:
|
|
2767
|
+
_b = _a.next();
|
|
2768
|
+
return [3 /*break*/, 3];
|
|
2769
|
+
case 6: return [3 /*break*/, 9];
|
|
2770
|
+
case 7:
|
|
2771
|
+
e_40_1 = _g.sent();
|
|
2772
|
+
e_40 = { error: e_40_1 };
|
|
2773
|
+
return [3 /*break*/, 9];
|
|
2774
|
+
case 8:
|
|
2775
|
+
try {
|
|
2776
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2777
|
+
}
|
|
2778
|
+
finally { if (e_40) throw e_40.error; }
|
|
2779
|
+
return [7 /*endfinally*/];
|
|
2780
|
+
case 9:
|
|
2781
|
+
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
2782
|
+
return [4 /*yield*/, this.info.entityInfo.saving(this.instance, e)];
|
|
2783
|
+
case 10:
|
|
2784
|
+
_g.sent();
|
|
2785
|
+
_g.label = 11;
|
|
2786
|
+
case 11:
|
|
2700
2787
|
this.__assertValidity();
|
|
2701
2788
|
d = this.copyDataToObject(this.isNew());
|
|
2702
2789
|
try {
|
|
2703
|
-
for (
|
|
2704
|
-
field =
|
|
2790
|
+
for (_c = tslib_1.__values(this.metadata.fields), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2791
|
+
field = _d.value;
|
|
2705
2792
|
if (field.dbReadOnly) {
|
|
2706
2793
|
d[field.key] = undefined;
|
|
2707
2794
|
f = this.fields.find(field);
|
|
@@ -2709,12 +2796,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2709
2796
|
}
|
|
2710
2797
|
}
|
|
2711
2798
|
}
|
|
2712
|
-
catch (
|
|
2799
|
+
catch (e_41_1) { e_41 = { error: e_41_1 }; }
|
|
2713
2800
|
finally {
|
|
2714
2801
|
try {
|
|
2715
|
-
if (
|
|
2802
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
2716
2803
|
}
|
|
2717
|
-
finally { if (
|
|
2804
|
+
finally { if (e_41) throw e_41.error; }
|
|
2718
2805
|
}
|
|
2719
2806
|
return [2 /*return*/, d];
|
|
2720
2807
|
}
|
|
@@ -2747,87 +2834,114 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2747
2834
|
};
|
|
2748
2835
|
rowHelperImplementation.prototype.delete = function () {
|
|
2749
2836
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2750
|
-
var
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2837
|
+
var _a, doDelete, event_1, err_3;
|
|
2838
|
+
return tslib_1.__generator(this, function (_b) {
|
|
2839
|
+
switch (_b.label) {
|
|
2840
|
+
case 0:
|
|
2841
|
+
_b.trys.push([0, 5, , 7]);
|
|
2842
|
+
return [4 /*yield*/, this.__prepareDelete()];
|
|
2843
|
+
case 1:
|
|
2844
|
+
_a = _b.sent(), doDelete = _a.doDelete, event_1 = _a.event;
|
|
2845
|
+
if (!doDelete) return [3 /*break*/, 3];
|
|
2846
|
+
return [4 /*yield*/, this.edp.delete([this.id])];
|
|
2847
|
+
case 2:
|
|
2848
|
+
_b.sent();
|
|
2849
|
+
_b.label = 3;
|
|
2850
|
+
case 3: return [4 /*yield*/, this.__finishDelete(event_1)];
|
|
2851
|
+
case 4:
|
|
2852
|
+
_b.sent();
|
|
2853
|
+
return [3 /*break*/, 7];
|
|
2854
|
+
case 5:
|
|
2855
|
+
err_3 = _b.sent();
|
|
2856
|
+
return [4 /*yield*/, this.catchSaveErrors(err_3)];
|
|
2857
|
+
case 6: throw _b.sent();
|
|
2858
|
+
case 7: return [2 /*return*/];
|
|
2859
|
+
}
|
|
2860
|
+
});
|
|
2861
|
+
});
|
|
2862
|
+
};
|
|
2863
|
+
//@internal
|
|
2864
|
+
rowHelperImplementation.prototype.__prepareDelete = function () {
|
|
2865
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2866
|
+
var doDelete, event;
|
|
2867
|
+
return tslib_1.__generator(this, function (_a) {
|
|
2868
|
+
switch (_a.label) {
|
|
2755
2869
|
case 0:
|
|
2756
2870
|
this.__clearErrorsAndReportChanged();
|
|
2757
2871
|
doDelete = true;
|
|
2758
|
-
|
|
2872
|
+
event = this.buildLifeCycleEvent(function () { return (doDelete = false); });
|
|
2759
2873
|
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 2];
|
|
2760
2874
|
if (!this.info.entityInfo.deleting) return [3 /*break*/, 2];
|
|
2761
|
-
return [4 /*yield*/, this.info.entityInfo.deleting(this.instance,
|
|
2875
|
+
return [4 /*yield*/, this.info.entityInfo.deleting(this.instance, event)];
|
|
2762
2876
|
case 1:
|
|
2763
|
-
|
|
2764
|
-
|
|
2877
|
+
_a.sent();
|
|
2878
|
+
_a.label = 2;
|
|
2765
2879
|
case 2:
|
|
2766
2880
|
this.__assertValidity();
|
|
2767
|
-
|
|
2768
|
-
case 3:
|
|
2769
|
-
_e.trys.push([3, 16, , 18]);
|
|
2770
|
-
if (!doDelete) return [3 /*break*/, 5];
|
|
2771
|
-
if (this.id === undefined)
|
|
2881
|
+
if (doDelete && this.id === undefined)
|
|
2772
2882
|
throw new Error('Invalid operation, id is undefined');
|
|
2773
|
-
return [
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2883
|
+
return [2 /*return*/, { doDelete: doDelete, event: event }];
|
|
2884
|
+
}
|
|
2885
|
+
});
|
|
2886
|
+
});
|
|
2887
|
+
};
|
|
2888
|
+
//@internal
|
|
2889
|
+
rowHelperImplementation.prototype.__finishDelete = function (e) {
|
|
2890
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2891
|
+
var _a, _b, listener, e_42_1;
|
|
2892
|
+
var e_42, _c;
|
|
2893
|
+
var _d;
|
|
2894
|
+
return tslib_1.__generator(this, function (_e) {
|
|
2895
|
+
switch (_e.label) {
|
|
2896
|
+
case 0:
|
|
2897
|
+
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 2];
|
|
2898
|
+
if (!this.info.entityInfo.deleted) return [3 /*break*/, 2];
|
|
2780
2899
|
return [4 /*yield*/, this.info.entityInfo.deleted(this.instance, e)];
|
|
2781
|
-
case
|
|
2900
|
+
case 1:
|
|
2782
2901
|
_e.sent();
|
|
2783
|
-
_e.label =
|
|
2784
|
-
case
|
|
2785
|
-
if (!this.repo.listeners) return [3 /*break*/,
|
|
2786
|
-
_e.label =
|
|
2787
|
-
case
|
|
2788
|
-
_e.trys.push([
|
|
2902
|
+
_e.label = 2;
|
|
2903
|
+
case 2:
|
|
2904
|
+
if (!this.repo.listeners) return [3 /*break*/, 10];
|
|
2905
|
+
_e.label = 3;
|
|
2906
|
+
case 3:
|
|
2907
|
+
_e.trys.push([3, 8, 9, 10]);
|
|
2789
2908
|
_a = tslib_1.__values(this.repo.listeners), _b = _a.next();
|
|
2790
|
-
_e.label =
|
|
2791
|
-
case
|
|
2792
|
-
if (!!_b.done) return [3 /*break*/,
|
|
2909
|
+
_e.label = 4;
|
|
2910
|
+
case 4:
|
|
2911
|
+
if (!!_b.done) return [3 /*break*/, 7];
|
|
2793
2912
|
listener = _b.value;
|
|
2794
2913
|
return [4 /*yield*/, ((_d = listener.deleted) === null || _d === void 0 ? void 0 : _d.call(listener, this.instance))];
|
|
2795
|
-
case
|
|
2914
|
+
case 5:
|
|
2796
2915
|
_e.sent();
|
|
2797
|
-
_e.label =
|
|
2798
|
-
case
|
|
2916
|
+
_e.label = 6;
|
|
2917
|
+
case 6:
|
|
2799
2918
|
_b = _a.next();
|
|
2800
|
-
return [3 /*break*/,
|
|
2801
|
-
case
|
|
2802
|
-
case
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
return [3 /*break*/,
|
|
2806
|
-
case
|
|
2919
|
+
return [3 /*break*/, 4];
|
|
2920
|
+
case 7: return [3 /*break*/, 10];
|
|
2921
|
+
case 8:
|
|
2922
|
+
e_42_1 = _e.sent();
|
|
2923
|
+
e_42 = { error: e_42_1 };
|
|
2924
|
+
return [3 /*break*/, 10];
|
|
2925
|
+
case 9:
|
|
2807
2926
|
try {
|
|
2808
2927
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2809
2928
|
}
|
|
2810
|
-
finally { if (
|
|
2929
|
+
finally { if (e_42) throw e_42.error; }
|
|
2811
2930
|
return [7 /*endfinally*/];
|
|
2812
|
-
case
|
|
2931
|
+
case 10:
|
|
2813
2932
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [
|
|
2814
2933
|
{ id: this.getId(), oldId: this.getOriginalId(), deleted: true },
|
|
2815
2934
|
]);
|
|
2816
2935
|
this._wasDeleted = true;
|
|
2817
|
-
return [
|
|
2818
|
-
case 16:
|
|
2819
|
-
err_2 = _e.sent();
|
|
2820
|
-
return [4 /*yield*/, this.catchSaveErrors(err_2)];
|
|
2821
|
-
case 17: throw _e.sent();
|
|
2822
|
-
case 18: return [2 /*return*/];
|
|
2936
|
+
return [2 /*return*/];
|
|
2823
2937
|
}
|
|
2824
2938
|
});
|
|
2825
2939
|
});
|
|
2826
2940
|
};
|
|
2827
2941
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
2828
2942
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2829
|
-
var _a, _b, col, lu,
|
|
2830
|
-
var
|
|
2943
|
+
var _a, _b, col, lu, e_43_1;
|
|
2944
|
+
var e_43, _c;
|
|
2831
2945
|
return tslib_1.__generator(this, function (_d) {
|
|
2832
2946
|
switch (_d.label) {
|
|
2833
2947
|
case 0:
|
|
@@ -2868,14 +2982,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2868
2982
|
return [3 /*break*/, 1];
|
|
2869
2983
|
case 9: return [3 /*break*/, 12];
|
|
2870
2984
|
case 10:
|
|
2871
|
-
|
|
2872
|
-
|
|
2985
|
+
e_43_1 = _d.sent();
|
|
2986
|
+
e_43 = { error: e_43_1 };
|
|
2873
2987
|
return [3 /*break*/, 12];
|
|
2874
2988
|
case 11:
|
|
2875
2989
|
try {
|
|
2876
2990
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2877
2991
|
}
|
|
2878
|
-
finally { if (
|
|
2992
|
+
finally { if (e_43) throw e_43.error; }
|
|
2879
2993
|
return [7 /*endfinally*/];
|
|
2880
2994
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
2881
2995
|
case 13:
|
|
@@ -2891,8 +3005,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2891
3005
|
};
|
|
2892
3006
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
2893
3007
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2894
|
-
var _a, _b, col, result,
|
|
2895
|
-
var
|
|
3008
|
+
var _a, _b, col, result, e_44_1;
|
|
3009
|
+
var e_44, _c;
|
|
2896
3010
|
return tslib_1.__generator(this, function (_d) {
|
|
2897
3011
|
switch (_d.label) {
|
|
2898
3012
|
case 0:
|
|
@@ -2917,14 +3031,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2917
3031
|
return [3 /*break*/, 2];
|
|
2918
3032
|
case 5: return [3 /*break*/, 8];
|
|
2919
3033
|
case 6:
|
|
2920
|
-
|
|
2921
|
-
|
|
3034
|
+
e_44_1 = _d.sent();
|
|
3035
|
+
e_44 = { error: e_44_1 };
|
|
2922
3036
|
return [3 /*break*/, 8];
|
|
2923
3037
|
case 7:
|
|
2924
3038
|
try {
|
|
2925
3039
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2926
3040
|
}
|
|
2927
|
-
finally { if (
|
|
3041
|
+
finally { if (e_44) throw e_44.error; }
|
|
2928
3042
|
return [7 /*endfinally*/];
|
|
2929
3043
|
case 8: return [2 /*return*/];
|
|
2930
3044
|
}
|
|
@@ -2937,7 +3051,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2937
3051
|
return this._isNew;
|
|
2938
3052
|
};
|
|
2939
3053
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
2940
|
-
var
|
|
3054
|
+
var e_45, _a;
|
|
2941
3055
|
var _b;
|
|
2942
3056
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
2943
3057
|
try {
|
|
@@ -2949,19 +3063,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2949
3063
|
return true;
|
|
2950
3064
|
}
|
|
2951
3065
|
}
|
|
2952
|
-
catch (
|
|
3066
|
+
catch (e_45_1) { e_45 = { error: e_45_1 }; }
|
|
2953
3067
|
finally {
|
|
2954
3068
|
try {
|
|
2955
3069
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2956
3070
|
}
|
|
2957
|
-
finally { if (
|
|
3071
|
+
finally { if (e_45) throw e_45.error; }
|
|
2958
3072
|
}
|
|
2959
3073
|
return false;
|
|
2960
3074
|
};
|
|
2961
3075
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
2962
3076
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2963
|
-
var _a, _b, c, col,
|
|
2964
|
-
var
|
|
3077
|
+
var _a, _b, c, col, e_46_1, e, _c, _d, listener, e_47_1;
|
|
3078
|
+
var e_46, _e, e_47, _f;
|
|
2965
3079
|
var _g;
|
|
2966
3080
|
return tslib_1.__generator(this, function (_h) {
|
|
2967
3081
|
switch (_h.label) {
|
|
@@ -2983,14 +3097,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2983
3097
|
return [3 /*break*/, 1];
|
|
2984
3098
|
case 4: return [3 /*break*/, 7];
|
|
2985
3099
|
case 5:
|
|
2986
|
-
|
|
2987
|
-
|
|
3100
|
+
e_46_1 = _h.sent();
|
|
3101
|
+
e_46 = { error: e_46_1 };
|
|
2988
3102
|
return [3 /*break*/, 7];
|
|
2989
3103
|
case 6:
|
|
2990
3104
|
try {
|
|
2991
3105
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2992
3106
|
}
|
|
2993
|
-
finally { if (
|
|
3107
|
+
finally { if (e_46) throw e_46.error; }
|
|
2994
3108
|
return [7 /*endfinally*/];
|
|
2995
3109
|
case 7:
|
|
2996
3110
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -3018,14 +3132,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3018
3132
|
return [3 /*break*/, 11];
|
|
3019
3133
|
case 14: return [3 /*break*/, 17];
|
|
3020
3134
|
case 15:
|
|
3021
|
-
|
|
3022
|
-
|
|
3135
|
+
e_47_1 = _h.sent();
|
|
3136
|
+
e_47 = { error: e_47_1 };
|
|
3023
3137
|
return [3 /*break*/, 17];
|
|
3024
3138
|
case 16:
|
|
3025
3139
|
try {
|
|
3026
3140
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
3027
3141
|
}
|
|
3028
|
-
finally { if (
|
|
3142
|
+
finally { if (e_47) throw e_47.error; }
|
|
3029
3143
|
return [7 /*endfinally*/];
|
|
3030
3144
|
case 17: return [2 /*return*/];
|
|
3031
3145
|
}
|
|
@@ -3072,7 +3186,7 @@ function getControllerRef(container, remultArg) {
|
|
|
3072
3186
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
3073
3187
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
3074
3188
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
3075
|
-
var _a,
|
|
3189
|
+
var _a, e_48, _b;
|
|
3076
3190
|
var _this = _super.call(this, columnsInfo, instance, remult, false) || this;
|
|
3077
3191
|
var _items = [];
|
|
3078
3192
|
var r = (_a = {
|
|
@@ -3089,20 +3203,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3089
3203
|
_items.push((r[col.key] = new FieldRefImplementation(col.options, col, instance, undefined, _this)));
|
|
3090
3204
|
}
|
|
3091
3205
|
}
|
|
3092
|
-
catch (
|
|
3206
|
+
catch (e_48_1) { e_48 = { error: e_48_1 }; }
|
|
3093
3207
|
finally {
|
|
3094
3208
|
try {
|
|
3095
3209
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_b = columnsInfo_1.return)) _b.call(columnsInfo_1);
|
|
3096
3210
|
}
|
|
3097
|
-
finally { if (
|
|
3211
|
+
finally { if (e_48) throw e_48.error; }
|
|
3098
3212
|
}
|
|
3099
3213
|
_this.fields = r;
|
|
3100
3214
|
return _this;
|
|
3101
3215
|
}
|
|
3102
3216
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
3103
3217
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3104
|
-
var _a, _b, col,
|
|
3105
|
-
var
|
|
3218
|
+
var _a, _b, col, e_49_1;
|
|
3219
|
+
var e_49, _c;
|
|
3106
3220
|
return tslib_1.__generator(this, function (_d) {
|
|
3107
3221
|
switch (_d.label) {
|
|
3108
3222
|
case 0:
|
|
@@ -3122,14 +3236,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3122
3236
|
return [3 /*break*/, 1];
|
|
3123
3237
|
case 4: return [3 /*break*/, 7];
|
|
3124
3238
|
case 5:
|
|
3125
|
-
|
|
3126
|
-
|
|
3239
|
+
e_49_1 = _d.sent();
|
|
3240
|
+
e_49 = { error: e_49_1 };
|
|
3127
3241
|
return [3 /*break*/, 7];
|
|
3128
3242
|
case 6:
|
|
3129
3243
|
try {
|
|
3130
3244
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3131
3245
|
}
|
|
3132
|
-
finally { if (
|
|
3246
|
+
finally { if (e_49) throw e_49.error; }
|
|
3133
3247
|
return [7 /*endfinally*/];
|
|
3134
3248
|
case 7: return [2 /*return*/];
|
|
3135
3249
|
}
|
|
@@ -3326,8 +3440,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3326
3440
|
};
|
|
3327
3441
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
3328
3442
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3329
|
-
var processValidation, self_1,
|
|
3330
|
-
var
|
|
3443
|
+
var processValidation, self_1, event_2, _a, _b, v, _c, e_50_1, _d, error_1;
|
|
3444
|
+
var e_50, _e;
|
|
3331
3445
|
var _this = this;
|
|
3332
3446
|
var _f, _g;
|
|
3333
3447
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -3344,7 +3458,7 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3344
3458
|
};
|
|
3345
3459
|
if (!this.settings.validate) return [3 /*break*/, 11];
|
|
3346
3460
|
self_1 = this;
|
|
3347
|
-
|
|
3461
|
+
event_2 = {
|
|
3348
3462
|
entityRef: this.entityRef,
|
|
3349
3463
|
get error() {
|
|
3350
3464
|
return self_1.error;
|
|
@@ -3372,7 +3486,7 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3372
3486
|
if (!!_b.done) return [3 /*break*/, 5];
|
|
3373
3487
|
v = _b.value;
|
|
3374
3488
|
_c = processValidation;
|
|
3375
|
-
return [4 /*yield*/, v(this.container,
|
|
3489
|
+
return [4 /*yield*/, v(this.container, event_2)];
|
|
3376
3490
|
case 3:
|
|
3377
3491
|
_c.apply(void 0, [_h.sent()]);
|
|
3378
3492
|
_h.label = 4;
|
|
@@ -3381,20 +3495,20 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3381
3495
|
return [3 /*break*/, 2];
|
|
3382
3496
|
case 5: return [3 /*break*/, 8];
|
|
3383
3497
|
case 6:
|
|
3384
|
-
|
|
3385
|
-
|
|
3498
|
+
e_50_1 = _h.sent();
|
|
3499
|
+
e_50 = { error: e_50_1 };
|
|
3386
3500
|
return [3 /*break*/, 8];
|
|
3387
3501
|
case 7:
|
|
3388
3502
|
try {
|
|
3389
3503
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3390
3504
|
}
|
|
3391
|
-
finally { if (
|
|
3505
|
+
finally { if (e_50) throw e_50.error; }
|
|
3392
3506
|
return [7 /*endfinally*/];
|
|
3393
3507
|
case 8: return [3 /*break*/, 11];
|
|
3394
3508
|
case 9:
|
|
3395
3509
|
if (!(typeof this.settings.validate === 'function')) return [3 /*break*/, 11];
|
|
3396
3510
|
_d = processValidation;
|
|
3397
|
-
return [4 /*yield*/, this.settings.validate(this.container,
|
|
3511
|
+
return [4 /*yield*/, this.settings.validate(this.container, event_2)];
|
|
3398
3512
|
case 10:
|
|
3399
3513
|
_d.apply(void 0, [_h.sent()]);
|
|
3400
3514
|
_h.label = 11;
|
|
@@ -3553,7 +3667,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3553
3667
|
exports.columnDefsImpl = columnDefsImpl;
|
|
3554
3668
|
var EntityFullInfo = /** @class */ (function () {
|
|
3555
3669
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
3556
|
-
var _a,
|
|
3670
|
+
var _a, e_51, _b;
|
|
3557
3671
|
var _this = this;
|
|
3558
3672
|
var _c;
|
|
3559
3673
|
this.entityInfo = entityInfo;
|
|
@@ -3658,12 +3772,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3658
3772
|
this.fieldsMetadata.push((r[x.key] = new columnDefsImpl(x, this, remult)));
|
|
3659
3773
|
}
|
|
3660
3774
|
}
|
|
3661
|
-
catch (
|
|
3775
|
+
catch (e_51_1) { e_51 = { error: e_51_1 }; }
|
|
3662
3776
|
finally {
|
|
3663
3777
|
try {
|
|
3664
3778
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
3665
3779
|
}
|
|
3666
|
-
finally { if (
|
|
3780
|
+
finally { if (e_51) throw e_51.error; }
|
|
3667
3781
|
}
|
|
3668
3782
|
this.fields = r;
|
|
3669
3783
|
this.label = buildLabel((_c = entityInfo.label) !== null && _c !== void 0 ? _c : entityInfo.caption, this.key, remult, this);
|
|
@@ -3780,7 +3894,7 @@ function ValueListFieldType() {
|
|
|
3780
3894
|
}
|
|
3781
3895
|
var ValueListInfo = /** @class */ (function () {
|
|
3782
3896
|
function ValueListInfo(valueListType) {
|
|
3783
|
-
var
|
|
3897
|
+
var e_52, _a, _b;
|
|
3784
3898
|
var _this = this;
|
|
3785
3899
|
this.valueListType = valueListType;
|
|
3786
3900
|
this.byIdMap = new Map();
|
|
@@ -3816,12 +3930,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
3816
3930
|
}
|
|
3817
3931
|
}
|
|
3818
3932
|
}
|
|
3819
|
-
catch (
|
|
3933
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
3820
3934
|
finally {
|
|
3821
3935
|
try {
|
|
3822
3936
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
3823
3937
|
}
|
|
3824
|
-
finally { if (
|
|
3938
|
+
finally { if (e_52) throw e_52.error; }
|
|
3825
3939
|
}
|
|
3826
3940
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
3827
3941
|
throw new Error("ValueType ".concat(this.valueListType, " has values without an id"));
|
|
@@ -3903,7 +4017,7 @@ function getValueList(type) {
|
|
|
3903
4017
|
exports.storableMember = Symbol.for('storableMember');
|
|
3904
4018
|
exports.fieldOptionalValuesFunctionKey = Symbol.for('fieldOptionalValues');
|
|
3905
4019
|
function buildOptions(options, remult) {
|
|
3906
|
-
var
|
|
4020
|
+
var e_53, _a;
|
|
3907
4021
|
var _b;
|
|
3908
4022
|
var r = {};
|
|
3909
4023
|
try {
|
|
@@ -3920,12 +4034,12 @@ function buildOptions(options, remult) {
|
|
|
3920
4034
|
}
|
|
3921
4035
|
}
|
|
3922
4036
|
}
|
|
3923
|
-
catch (
|
|
4037
|
+
catch (e_53_1) { e_53 = { error: e_53_1 }; }
|
|
3924
4038
|
finally {
|
|
3925
4039
|
try {
|
|
3926
4040
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
3927
4041
|
}
|
|
3928
|
-
finally { if (
|
|
4042
|
+
finally { if (e_53) throw e_53.error; }
|
|
3929
4043
|
}
|
|
3930
4044
|
(_b = exports.fieldOptionsEnricher.enrichFieldOptions) === null || _b === void 0 ? void 0 : _b.call(exports.fieldOptionsEnricher, r);
|
|
3931
4045
|
return r;
|
|
@@ -3968,7 +4082,7 @@ function decorateColumnSettings(settings, remult) {
|
|
|
3968
4082
|
};
|
|
3969
4083
|
settings.valueConverter = new Proxy(settings.valueConverter, {
|
|
3970
4084
|
get: function (target, property) {
|
|
3971
|
-
var
|
|
4085
|
+
var e_54, _a;
|
|
3972
4086
|
if (target[property] === undefined) {
|
|
3973
4087
|
if (isIdNumeric_1 === undefined) {
|
|
3974
4088
|
if (property === 'inputType')
|
|
@@ -3991,12 +4105,12 @@ function decorateColumnSettings(settings, remult) {
|
|
|
3991
4105
|
: valueConverters_js_1.ValueConverters.String[key];
|
|
3992
4106
|
}
|
|
3993
4107
|
}
|
|
3994
|
-
catch (
|
|
4108
|
+
catch (e_54_1) { e_54 = { error: e_54_1 }; }
|
|
3995
4109
|
finally {
|
|
3996
4110
|
try {
|
|
3997
4111
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3998
4112
|
}
|
|
3999
|
-
finally { if (
|
|
4113
|
+
finally { if (e_54) throw e_54.error; }
|
|
4000
4114
|
}
|
|
4001
4115
|
}
|
|
4002
4116
|
}
|