remult 3.3.19-next.2 → 3.3.19-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/src/data-providers/in-memory-database.js +12 -1
- package/esm/src/data-providers/indexed-db-data-provider.js +34 -1
- package/esm/src/remult3/RepositoryImplementation.js +8 -0
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/data-interfaces.d.ts +7 -0
- package/src/data-providers/in-memory-database.d.ts +5 -2
- package/src/data-providers/in-memory-database.js +22 -1
- package/src/data-providers/indexed-db-data-provider.d.ts +24 -2
- package/src/data-providers/indexed-db-data-provider.js +72 -0
- package/src/remult3/RepositoryImplementation.d.ts +2 -2
- package/src/remult3/RepositoryImplementation.js +245 -211
- package/src/remult3/remult3.d.ts +15 -2
|
@@ -459,79 +459,113 @@ 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,
|
|
463
|
-
var e_6,
|
|
464
|
-
return tslib_1.__generator(this, function (
|
|
465
|
-
switch (
|
|
462
|
+
var r, entity_1, entity_1_1, item, _a, _b, e_6_1, refs_1, raw, entity_2, entity_2_1, item, ref, _c, _d, e_7_1, inserted, result, ref, result;
|
|
463
|
+
var e_6, _e, e_7, _f;
|
|
464
|
+
return tslib_1.__generator(this, function (_g) {
|
|
465
|
+
switch (_g.label) {
|
|
466
466
|
case 0:
|
|
467
|
-
if (!Array.isArray(entity)) return [3 /*break*/,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
467
|
+
if (!Array.isArray(entity)) return [3 /*break*/, 20];
|
|
468
|
+
if (!!(options === null || options === void 0 ? void 0 : options.bulk)) return [3 /*break*/, 9];
|
|
469
|
+
r = [];
|
|
470
|
+
_g.label = 1;
|
|
471
471
|
case 1:
|
|
472
|
-
|
|
472
|
+
_g.trys.push([1, 6, 7, 8]);
|
|
473
473
|
entity_1 = tslib_1.__values(entity), entity_1_1 = entity_1.next();
|
|
474
|
-
|
|
474
|
+
_g.label = 2;
|
|
475
475
|
case 2:
|
|
476
476
|
if (!!entity_1_1.done) return [3 /*break*/, 5];
|
|
477
477
|
item = entity_1_1.value;
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
if (ref) {
|
|
481
|
-
if (!ref.isNew())
|
|
482
|
-
throw 'Item is not new';
|
|
483
|
-
}
|
|
484
|
-
else {
|
|
485
|
-
ref = this.getEntityRef(this.create(item));
|
|
486
|
-
}
|
|
487
|
-
refs_1.push(ref);
|
|
488
|
-
_b = (_a = raw).push;
|
|
489
|
-
return [4 /*yield*/, ref.buildDtoForInsert()];
|
|
478
|
+
_b = (_a = r).push;
|
|
479
|
+
return [4 /*yield*/, this.insert(item, options)];
|
|
490
480
|
case 3:
|
|
491
|
-
_b.apply(_a, [
|
|
492
|
-
|
|
481
|
+
_b.apply(_a, [_g.sent()]);
|
|
482
|
+
_g.label = 4;
|
|
493
483
|
case 4:
|
|
494
484
|
entity_1_1 = entity_1.next();
|
|
495
485
|
return [3 /*break*/, 2];
|
|
496
486
|
case 5: return [3 /*break*/, 8];
|
|
497
487
|
case 6:
|
|
498
|
-
e_6_1 =
|
|
488
|
+
e_6_1 = _g.sent();
|
|
499
489
|
e_6 = { error: e_6_1 };
|
|
500
490
|
return [3 /*break*/, 8];
|
|
501
491
|
case 7:
|
|
502
492
|
try {
|
|
503
|
-
if (entity_1_1 && !entity_1_1.done && (
|
|
493
|
+
if (entity_1_1 && !entity_1_1.done && (_e = entity_1.return)) _e.call(entity_1);
|
|
504
494
|
}
|
|
505
495
|
finally { if (e_6) throw e_6.error; }
|
|
506
496
|
return [7 /*endfinally*/];
|
|
507
|
-
case 8:
|
|
497
|
+
case 8:
|
|
498
|
+
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
499
|
+
return [2 /*return*/, undefined];
|
|
500
|
+
return [2 /*return*/, r];
|
|
508
501
|
case 9:
|
|
509
|
-
|
|
502
|
+
refs_1 = [];
|
|
503
|
+
raw = [];
|
|
504
|
+
_g.label = 10;
|
|
505
|
+
case 10:
|
|
506
|
+
_g.trys.push([10, 15, 16, 17]);
|
|
507
|
+
entity_2 = tslib_1.__values(entity), entity_2_1 = entity_2.next();
|
|
508
|
+
_g.label = 11;
|
|
509
|
+
case 11:
|
|
510
|
+
if (!!entity_2_1.done) return [3 /*break*/, 14];
|
|
511
|
+
item = entity_2_1.value;
|
|
512
|
+
this.__cleanupPartialObject(item);
|
|
513
|
+
ref = (0, getEntityRef_js_1.getEntityRef)(item, false);
|
|
514
|
+
if (ref) {
|
|
515
|
+
if (!ref.isNew())
|
|
516
|
+
throw 'Item is not new';
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
ref = this.getEntityRef(this.create(item));
|
|
520
|
+
}
|
|
521
|
+
refs_1.push(ref);
|
|
522
|
+
_d = (_c = raw).push;
|
|
523
|
+
return [4 /*yield*/, ref.buildDtoForInsert()];
|
|
524
|
+
case 12:
|
|
525
|
+
_d.apply(_c, [_g.sent()]);
|
|
526
|
+
_g.label = 13;
|
|
527
|
+
case 13:
|
|
528
|
+
entity_2_1 = entity_2.next();
|
|
529
|
+
return [3 /*break*/, 11];
|
|
530
|
+
case 14: return [3 /*break*/, 17];
|
|
531
|
+
case 15:
|
|
532
|
+
e_7_1 = _g.sent();
|
|
533
|
+
e_7 = { error: e_7_1 };
|
|
534
|
+
return [3 /*break*/, 17];
|
|
535
|
+
case 16:
|
|
536
|
+
try {
|
|
537
|
+
if (entity_2_1 && !entity_2_1.done && (_f = entity_2.return)) _f.call(entity_2);
|
|
538
|
+
}
|
|
539
|
+
finally { if (e_7) throw e_7.error; }
|
|
540
|
+
return [7 /*endfinally*/];
|
|
541
|
+
case 17: return [4 /*yield*/, this._edp.insert(raw, options)];
|
|
542
|
+
case 18:
|
|
543
|
+
inserted = _g.sent();
|
|
510
544
|
return [4 /*yield*/, promiseAll(inserted, function (row, i) {
|
|
511
545
|
return refs_1[i].processInsertResponseDto(row);
|
|
512
546
|
})];
|
|
513
|
-
case
|
|
514
|
-
result =
|
|
547
|
+
case 19:
|
|
548
|
+
result = _g.sent();
|
|
515
549
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
516
550
|
return [2 /*return*/, undefined];
|
|
517
551
|
return [2 /*return*/, result];
|
|
518
|
-
case
|
|
552
|
+
case 20:
|
|
519
553
|
ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
520
554
|
result = undefined;
|
|
521
|
-
if (!ref) return [3 /*break*/,
|
|
555
|
+
if (!ref) return [3 /*break*/, 22];
|
|
522
556
|
if (!ref.isNew())
|
|
523
557
|
throw 'Item is not new';
|
|
524
558
|
return [4 /*yield*/, ref.save(options)];
|
|
525
|
-
case
|
|
526
|
-
result =
|
|
527
|
-
return [3 /*break*/,
|
|
528
|
-
case
|
|
559
|
+
case 21:
|
|
560
|
+
result = _g.sent();
|
|
561
|
+
return [3 /*break*/, 24];
|
|
562
|
+
case 22:
|
|
529
563
|
this.__cleanupPartialObject(entity);
|
|
530
564
|
return [4 /*yield*/, this.getEntityRef(this.create(entity)).save(options)];
|
|
531
|
-
case
|
|
532
|
-
result =
|
|
533
|
-
|
|
534
|
-
case
|
|
565
|
+
case 23:
|
|
566
|
+
result = _g.sent();
|
|
567
|
+
_g.label = 24;
|
|
568
|
+
case 24:
|
|
535
569
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
536
570
|
return [2 /*return*/, undefined];
|
|
537
571
|
return [2 /*return*/, result];
|
|
@@ -552,8 +586,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
552
586
|
fields[_i - 1] = arguments[_i];
|
|
553
587
|
}
|
|
554
588
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
555
|
-
var ref, hasError, fields_1, fields_1_1, f,
|
|
556
|
-
var
|
|
589
|
+
var ref, hasError, fields_1, fields_1_1, f, e_8_1;
|
|
590
|
+
var e_8, _a;
|
|
557
591
|
return tslib_1.__generator(this, function (_b) {
|
|
558
592
|
switch (_b.label) {
|
|
559
593
|
case 0:
|
|
@@ -584,14 +618,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
584
618
|
return [3 /*break*/, 4];
|
|
585
619
|
case 7: return [3 /*break*/, 10];
|
|
586
620
|
case 8:
|
|
587
|
-
|
|
588
|
-
|
|
621
|
+
e_8_1 = _b.sent();
|
|
622
|
+
e_8 = { error: e_8_1 };
|
|
589
623
|
return [3 /*break*/, 10];
|
|
590
624
|
case 9:
|
|
591
625
|
try {
|
|
592
626
|
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
593
627
|
}
|
|
594
|
-
finally { if (
|
|
628
|
+
finally { if (e_8) throw e_8.error; }
|
|
595
629
|
return [7 /*endfinally*/];
|
|
596
630
|
case 10:
|
|
597
631
|
if (!hasError)
|
|
@@ -602,7 +636,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
602
636
|
});
|
|
603
637
|
};
|
|
604
638
|
RepositoryImplementation.prototype.__createDto = function (basedOn) {
|
|
605
|
-
var
|
|
639
|
+
var e_9, _a;
|
|
606
640
|
this.__cleanupPartialObject(basedOn);
|
|
607
641
|
var ref = this.getEntityRef(tslib_1.__assign({}, basedOn));
|
|
608
642
|
var r = ref.copyDataToObject(false);
|
|
@@ -614,19 +648,19 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
614
648
|
delete r[element.key];
|
|
615
649
|
}
|
|
616
650
|
}
|
|
617
|
-
catch (
|
|
651
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
618
652
|
finally {
|
|
619
653
|
try {
|
|
620
654
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
621
655
|
}
|
|
622
|
-
finally { if (
|
|
656
|
+
finally { if (e_9) throw e_9.error; }
|
|
623
657
|
}
|
|
624
658
|
return r;
|
|
625
659
|
};
|
|
626
660
|
RepositoryImplementation.prototype.updateMany = function (_a) {
|
|
627
661
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
628
|
-
var _c, _d, _e, updated, _f, _g, _h, item,
|
|
629
|
-
var _j,
|
|
662
|
+
var _c, _d, _e, updated, _f, _g, _h, item, e_10_1;
|
|
663
|
+
var _j, e_10, _k, _l;
|
|
630
664
|
var where = _b.where, set = _b.set;
|
|
631
665
|
return tslib_1.__generator(this, function (_m) {
|
|
632
666
|
switch (_m.label) {
|
|
@@ -669,8 +703,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
669
703
|
return [3 /*break*/, 6];
|
|
670
704
|
case 10: return [3 /*break*/, 17];
|
|
671
705
|
case 11:
|
|
672
|
-
|
|
673
|
-
|
|
706
|
+
e_10_1 = _m.sent();
|
|
707
|
+
e_10 = { error: e_10_1 };
|
|
674
708
|
return [3 /*break*/, 17];
|
|
675
709
|
case 12:
|
|
676
710
|
_m.trys.push([12, , 15, 16]);
|
|
@@ -681,7 +715,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
681
715
|
_m.label = 14;
|
|
682
716
|
case 14: return [3 /*break*/, 16];
|
|
683
717
|
case 15:
|
|
684
|
-
if (
|
|
718
|
+
if (e_10) throw e_10.error;
|
|
685
719
|
return [7 /*endfinally*/];
|
|
686
720
|
case 16: return [7 /*endfinally*/];
|
|
687
721
|
case 17: return [2 /*return*/, updated];
|
|
@@ -808,7 +842,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
808
842
|
});
|
|
809
843
|
};
|
|
810
844
|
RepositoryImplementation.prototype._getRefForExistingRow = function (entity, id) {
|
|
811
|
-
var
|
|
845
|
+
var e_11, _a;
|
|
812
846
|
var ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
813
847
|
if (!ref) {
|
|
814
848
|
var instance = new this._entity(this._remult);
|
|
@@ -819,12 +853,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
819
853
|
instance[key] = entity[key];
|
|
820
854
|
}
|
|
821
855
|
}
|
|
822
|
-
catch (
|
|
856
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
823
857
|
finally {
|
|
824
858
|
try {
|
|
825
859
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
826
860
|
}
|
|
827
|
-
finally { if (
|
|
861
|
+
finally { if (e_11) throw e_11.error; }
|
|
828
862
|
}
|
|
829
863
|
this._fixTypes(instance);
|
|
830
864
|
var row_1 = new rowHelperImplementation(this._info, instance, this, this._edp, this._remult, false);
|
|
@@ -997,7 +1031,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
997
1031
|
case 0:
|
|
998
1032
|
loader = new relation_loader_js_1.RelationLoader();
|
|
999
1033
|
return [4 /*yield*/, this._loadManyToOneForManyRows(jsonItems.map(function (row) {
|
|
1000
|
-
var
|
|
1034
|
+
var e_12, _a;
|
|
1001
1035
|
var result = {};
|
|
1002
1036
|
try {
|
|
1003
1037
|
for (var _b = tslib_1.__values(_this.metadata.fields.toArray()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1005,12 +1039,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1005
1039
|
result[col.key] = col.valueConverter.fromJson(row[col.key]);
|
|
1006
1040
|
}
|
|
1007
1041
|
}
|
|
1008
|
-
catch (
|
|
1042
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1009
1043
|
finally {
|
|
1010
1044
|
try {
|
|
1011
1045
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1012
1046
|
}
|
|
1013
|
-
finally { if (
|
|
1047
|
+
finally { if (e_12) throw e_12.error; }
|
|
1014
1048
|
}
|
|
1015
1049
|
return result;
|
|
1016
1050
|
}), loadOptions, loader)];
|
|
@@ -1029,7 +1063,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1029
1063
|
function loadManyToOne(repo, toLoad) {
|
|
1030
1064
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1031
1065
|
var rows, rows_1, rows_1_1, r;
|
|
1032
|
-
var _a,
|
|
1066
|
+
var _a, e_15, _b;
|
|
1033
1067
|
return tslib_1.__generator(this, function (_c) {
|
|
1034
1068
|
switch (_c.label) {
|
|
1035
1069
|
case 0: return [4 /*yield*/, repo.find({ where: (_a = repo.metadata.idMetadata).getIdFilter.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(toLoad), false)) }, true)];
|
|
@@ -1041,20 +1075,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1041
1075
|
repo._addToCache(r);
|
|
1042
1076
|
}
|
|
1043
1077
|
}
|
|
1044
|
-
catch (
|
|
1078
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1045
1079
|
finally {
|
|
1046
1080
|
try {
|
|
1047
1081
|
if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
|
|
1048
1082
|
}
|
|
1049
|
-
finally { if (
|
|
1083
|
+
finally { if (e_15) throw e_15.error; }
|
|
1050
1084
|
}
|
|
1051
1085
|
return [2 /*return*/];
|
|
1052
1086
|
}
|
|
1053
1087
|
});
|
|
1054
1088
|
});
|
|
1055
1089
|
}
|
|
1056
|
-
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val,
|
|
1057
|
-
var
|
|
1090
|
+
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_13_1, excludeRelationMembers, result, fields;
|
|
1091
|
+
var e_13, _c, e_14, _d;
|
|
1058
1092
|
var _this = this;
|
|
1059
1093
|
return tslib_1.__generator(this, function (_e) {
|
|
1060
1094
|
switch (_e.label) {
|
|
@@ -1081,7 +1115,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1081
1115
|
repo = this._remult.repo(col.valueType);
|
|
1082
1116
|
toLoad = [];
|
|
1083
1117
|
try {
|
|
1084
|
-
for (rawRows_1 = (
|
|
1118
|
+
for (rawRows_1 = (e_14 = void 0, tslib_1.__values(rawRows)), rawRows_1_1 = rawRows_1.next(); !rawRows_1_1.done; rawRows_1_1 = rawRows_1.next()) {
|
|
1085
1119
|
r = rawRows_1_1.value;
|
|
1086
1120
|
val = r[col.key];
|
|
1087
1121
|
if (val !== undefined &&
|
|
@@ -1092,12 +1126,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1092
1126
|
}
|
|
1093
1127
|
}
|
|
1094
1128
|
}
|
|
1095
|
-
catch (
|
|
1129
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1096
1130
|
finally {
|
|
1097
1131
|
try {
|
|
1098
1132
|
if (rawRows_1_1 && !rawRows_1_1.done && (_d = rawRows_1.return)) _d.call(rawRows_1);
|
|
1099
1133
|
}
|
|
1100
|
-
finally { if (
|
|
1134
|
+
finally { if (e_14) throw e_14.error; }
|
|
1101
1135
|
}
|
|
1102
1136
|
if (!(toLoad.length > 0)) return [3 /*break*/, 4];
|
|
1103
1137
|
return [4 /*yield*/, loadManyToOne(repo, toLoad)];
|
|
@@ -1109,14 +1143,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1109
1143
|
return [3 /*break*/, 2];
|
|
1110
1144
|
case 5: return [3 /*break*/, 8];
|
|
1111
1145
|
case 6:
|
|
1112
|
-
|
|
1113
|
-
|
|
1146
|
+
e_13_1 = _e.sent();
|
|
1147
|
+
e_13 = { error: e_13_1 };
|
|
1114
1148
|
return [3 /*break*/, 8];
|
|
1115
1149
|
case 7:
|
|
1116
1150
|
try {
|
|
1117
1151
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1118
1152
|
}
|
|
1119
|
-
finally { if (
|
|
1153
|
+
finally { if (e_13) throw e_13.error; }
|
|
1120
1154
|
return [7 /*endfinally*/];
|
|
1121
1155
|
case 8:
|
|
1122
1156
|
excludeRelationMembers = new Set(this.fields
|
|
@@ -1144,9 +1178,9 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1144
1178
|
});
|
|
1145
1179
|
};
|
|
1146
1180
|
RepositoryImplementation.prototype._populateRelationsForFields = function (fields, loadOptions, result, loader) {
|
|
1147
|
-
var
|
|
1181
|
+
var e_16, _a;
|
|
1148
1182
|
var _loop_1 = function (col) {
|
|
1149
|
-
var
|
|
1183
|
+
var e_17, _b, e_18, _c;
|
|
1150
1184
|
var _d = this_1.__getRelationAndInclude(col, loadOptions), rel = _d.rel, incl = _d.incl;
|
|
1151
1185
|
if (rel)
|
|
1152
1186
|
if (incl) {
|
|
@@ -1184,32 +1218,32 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1184
1218
|
}
|
|
1185
1219
|
};
|
|
1186
1220
|
try {
|
|
1187
|
-
for (var result_1 = (
|
|
1221
|
+
for (var result_1 = (e_17 = void 0, tslib_1.__values(result)), result_1_1 = result_1.next(); !result_1_1.done; result_1_1 = result_1.next()) {
|
|
1188
1222
|
var row = result_1_1.value;
|
|
1189
1223
|
_loop_2(row);
|
|
1190
1224
|
}
|
|
1191
1225
|
}
|
|
1192
|
-
catch (
|
|
1226
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1193
1227
|
finally {
|
|
1194
1228
|
try {
|
|
1195
1229
|
if (result_1_1 && !result_1_1.done && (_b = result_1.return)) _b.call(result_1);
|
|
1196
1230
|
}
|
|
1197
|
-
finally { if (
|
|
1231
|
+
finally { if (e_17) throw e_17.error; }
|
|
1198
1232
|
}
|
|
1199
1233
|
}
|
|
1200
1234
|
else {
|
|
1201
1235
|
try {
|
|
1202
|
-
for (var result_2 = (
|
|
1236
|
+
for (var result_2 = (e_18 = void 0, tslib_1.__values(result)), result_2_1 = result_2.next(); !result_2_1.done; result_2_1 = result_2.next()) {
|
|
1203
1237
|
var row = result_2_1.value;
|
|
1204
1238
|
Reflect.deleteProperty(row, col.key);
|
|
1205
1239
|
}
|
|
1206
1240
|
}
|
|
1207
|
-
catch (
|
|
1241
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1208
1242
|
finally {
|
|
1209
1243
|
try {
|
|
1210
1244
|
if (result_2_1 && !result_2_1.done && (_c = result_2.return)) _c.call(result_2);
|
|
1211
1245
|
}
|
|
1212
|
-
finally { if (
|
|
1246
|
+
finally { if (e_18) throw e_18.error; }
|
|
1213
1247
|
}
|
|
1214
1248
|
}
|
|
1215
1249
|
};
|
|
@@ -1220,12 +1254,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1220
1254
|
_loop_1(col);
|
|
1221
1255
|
}
|
|
1222
1256
|
}
|
|
1223
|
-
catch (
|
|
1257
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1224
1258
|
finally {
|
|
1225
1259
|
try {
|
|
1226
1260
|
if (fields_2_1 && !fields_2_1.done && (_a = fields_2.return)) _a.call(fields_2);
|
|
1227
1261
|
}
|
|
1228
|
-
finally { if (
|
|
1262
|
+
finally { if (e_16) throw e_16.error; }
|
|
1229
1263
|
}
|
|
1230
1264
|
};
|
|
1231
1265
|
RepositoryImplementation.prototype.__getRelationAndInclude = function (col, loadOptions) {
|
|
@@ -1241,7 +1275,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1241
1275
|
};
|
|
1242
1276
|
/*@internal */
|
|
1243
1277
|
RepositoryImplementation.prototype._findOptionsBasedOnRelation = function (rel, field, moreFindOptions, row, otherRepo) {
|
|
1244
|
-
var
|
|
1278
|
+
var e_19, _a, e_20, _b, _c, _d;
|
|
1245
1279
|
var returnNull = false;
|
|
1246
1280
|
var returnUndefined = false;
|
|
1247
1281
|
var where = [];
|
|
@@ -1261,7 +1295,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1261
1295
|
if (source.where)
|
|
1262
1296
|
where.push(source.where);
|
|
1263
1297
|
try {
|
|
1264
|
-
for (var _e = (
|
|
1298
|
+
for (var _e = (e_20 = void 0, tslib_1.__values([
|
|
1265
1299
|
'limit',
|
|
1266
1300
|
'include',
|
|
1267
1301
|
'orderBy',
|
|
@@ -1273,21 +1307,21 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1273
1307
|
findOptions[key] = source[key];
|
|
1274
1308
|
}
|
|
1275
1309
|
}
|
|
1276
|
-
catch (
|
|
1310
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1277
1311
|
finally {
|
|
1278
1312
|
try {
|
|
1279
1313
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1280
1314
|
}
|
|
1281
|
-
finally { if (
|
|
1315
|
+
finally { if (e_20) throw e_20.error; }
|
|
1282
1316
|
}
|
|
1283
1317
|
}
|
|
1284
1318
|
}
|
|
1285
|
-
catch (
|
|
1319
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1286
1320
|
finally {
|
|
1287
1321
|
try {
|
|
1288
1322
|
if (findOptionsSources_1_1 && !findOptionsSources_1_1.done && (_a = findOptionsSources_1.return)) _a.call(findOptionsSources_1);
|
|
1289
1323
|
}
|
|
1290
|
-
finally { if (
|
|
1324
|
+
finally { if (e_19) throw e_19.error; }
|
|
1291
1325
|
}
|
|
1292
1326
|
var relFields = rel.getFields();
|
|
1293
1327
|
var getFieldValue = function (key) {
|
|
@@ -1364,7 +1398,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1364
1398
|
return this.getEntityRef(item).toApiJson(true);
|
|
1365
1399
|
};
|
|
1366
1400
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
1367
|
-
var
|
|
1401
|
+
var e_21, _a;
|
|
1368
1402
|
var _this = this;
|
|
1369
1403
|
if (json === null || json === undefined)
|
|
1370
1404
|
return json;
|
|
@@ -1390,12 +1424,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1390
1424
|
}
|
|
1391
1425
|
}
|
|
1392
1426
|
}
|
|
1393
|
-
catch (
|
|
1427
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1394
1428
|
finally {
|
|
1395
1429
|
try {
|
|
1396
1430
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1397
1431
|
}
|
|
1398
|
-
finally { if (
|
|
1432
|
+
finally { if (e_21) throw e_21.error; }
|
|
1399
1433
|
}
|
|
1400
1434
|
this._fixTypes(result);
|
|
1401
1435
|
if (newRow) {
|
|
@@ -1428,9 +1462,9 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1428
1462
|
};
|
|
1429
1463
|
RepositoryImplementation.prototype.deleteMany = function (_a) {
|
|
1430
1464
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
1431
|
-
var _c, _d, _e, prepared, _f, _g, _h, item, ref, _j, _k, _l,
|
|
1432
|
-
var
|
|
1433
|
-
var _o,
|
|
1465
|
+
var _c, _d, _e, prepared, _f, _g, _h, item, ref, _j, _k, _l, e_22_1, ids, prepared_1, prepared_1_1, x, e_23_1;
|
|
1466
|
+
var e_23, _m;
|
|
1467
|
+
var _o, e_22, _p, _q;
|
|
1434
1468
|
var where = _b.where;
|
|
1435
1469
|
return tslib_1.__generator(this, function (_r) {
|
|
1436
1470
|
switch (_r.label) {
|
|
@@ -1473,8 +1507,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1473
1507
|
return [3 /*break*/, 6];
|
|
1474
1508
|
case 10: return [3 /*break*/, 17];
|
|
1475
1509
|
case 11:
|
|
1476
|
-
|
|
1477
|
-
|
|
1510
|
+
e_22_1 = _r.sent();
|
|
1511
|
+
e_22 = { error: e_22_1 };
|
|
1478
1512
|
return [3 /*break*/, 17];
|
|
1479
1513
|
case 12:
|
|
1480
1514
|
_r.trys.push([12, , 15, 16]);
|
|
@@ -1485,7 +1519,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1485
1519
|
_r.label = 14;
|
|
1486
1520
|
case 14: return [3 /*break*/, 16];
|
|
1487
1521
|
case 15:
|
|
1488
|
-
if (
|
|
1522
|
+
if (e_22) throw e_22.error;
|
|
1489
1523
|
return [7 /*endfinally*/];
|
|
1490
1524
|
case 16: return [7 /*endfinally*/];
|
|
1491
1525
|
case 17:
|
|
@@ -1511,14 +1545,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1511
1545
|
return [3 /*break*/, 20];
|
|
1512
1546
|
case 23: return [3 /*break*/, 26];
|
|
1513
1547
|
case 24:
|
|
1514
|
-
|
|
1515
|
-
|
|
1548
|
+
e_23_1 = _r.sent();
|
|
1549
|
+
e_23 = { error: e_23_1 };
|
|
1516
1550
|
return [3 /*break*/, 26];
|
|
1517
1551
|
case 25:
|
|
1518
1552
|
try {
|
|
1519
1553
|
if (prepared_1_1 && !prepared_1_1.done && (_m = prepared_1.return)) _m.call(prepared_1);
|
|
1520
1554
|
}
|
|
1521
|
-
finally { if (
|
|
1555
|
+
finally { if (e_23) throw e_23.error; }
|
|
1522
1556
|
return [7 /*endfinally*/];
|
|
1523
1557
|
case 26: return [2 /*return*/, prepared.length];
|
|
1524
1558
|
}
|
|
@@ -1608,7 +1642,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1608
1642
|
return this.metadata.fields.toArray().filter(function (x) { return keys.includes(x.key); });
|
|
1609
1643
|
};
|
|
1610
1644
|
RepositoryImplementation.prototype.create = function (item) {
|
|
1611
|
-
var
|
|
1645
|
+
var e_24, _a;
|
|
1612
1646
|
var _b;
|
|
1613
1647
|
var r = new this._entity(this._remult);
|
|
1614
1648
|
if (item) {
|
|
@@ -1619,12 +1653,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1619
1653
|
r[key] = item[key];
|
|
1620
1654
|
}
|
|
1621
1655
|
}
|
|
1622
|
-
catch (
|
|
1656
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1623
1657
|
finally {
|
|
1624
1658
|
try {
|
|
1625
1659
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1626
1660
|
}
|
|
1627
|
-
finally { if (
|
|
1661
|
+
finally { if (e_24) throw e_24.error; }
|
|
1628
1662
|
}
|
|
1629
1663
|
this._fixTypes(r);
|
|
1630
1664
|
}
|
|
@@ -1638,7 +1672,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1638
1672
|
RepositoryImplementation.prototype._fixTypes = function (item) {
|
|
1639
1673
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1640
1674
|
var _a, _b, field, val, _c, _d, _e, type, typeName;
|
|
1641
|
-
var
|
|
1675
|
+
var e_25, _f, e_26, _g;
|
|
1642
1676
|
return tslib_1.__generator(this, function (_h) {
|
|
1643
1677
|
try {
|
|
1644
1678
|
for (_a = tslib_1.__values(this._fieldsOf(item)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
@@ -1649,7 +1683,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1649
1683
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1650
1684
|
else
|
|
1651
1685
|
try {
|
|
1652
|
-
for (_c = (
|
|
1686
|
+
for (_c = (e_26 = void 0, tslib_1.__values([
|
|
1653
1687
|
[String, 'string'],
|
|
1654
1688
|
[Number, 'number'],
|
|
1655
1689
|
[Boolean, 'boolean'],
|
|
@@ -1659,22 +1693,22 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1659
1693
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1660
1694
|
}
|
|
1661
1695
|
}
|
|
1662
|
-
catch (
|
|
1696
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
1663
1697
|
finally {
|
|
1664
1698
|
try {
|
|
1665
1699
|
if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
|
|
1666
1700
|
}
|
|
1667
|
-
finally { if (
|
|
1701
|
+
finally { if (e_26) throw e_26.error; }
|
|
1668
1702
|
}
|
|
1669
1703
|
}
|
|
1670
1704
|
}
|
|
1671
1705
|
}
|
|
1672
|
-
catch (
|
|
1706
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1673
1707
|
finally {
|
|
1674
1708
|
try {
|
|
1675
1709
|
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
1676
1710
|
}
|
|
1677
|
-
finally { if (
|
|
1711
|
+
finally { if (e_25) throw e_25.error; }
|
|
1678
1712
|
}
|
|
1679
1713
|
return [2 /*return*/, item];
|
|
1680
1714
|
});
|
|
@@ -1751,7 +1785,7 @@ function createOldEntity(entity, remult) {
|
|
|
1751
1785
|
var key = (0, getEntityRef_js_1.getEntityKey)(entity);
|
|
1752
1786
|
var base = Object.getPrototypeOf(entity);
|
|
1753
1787
|
var _loop_3 = function () {
|
|
1754
|
-
var
|
|
1788
|
+
var e_27, _a;
|
|
1755
1789
|
var baseCols = remult_static_js_1.remultStatic.columnsOfType.get(base);
|
|
1756
1790
|
if (baseCols) {
|
|
1757
1791
|
r.unshift.apply(r, tslib_1.__spreadArray([], tslib_1.__read(baseCols.filter(function (x) { return !r.find(function (y) { return y.key == x.key; }); })), false));
|
|
@@ -1794,17 +1828,17 @@ function createOldEntity(entity, remult) {
|
|
|
1794
1828
|
}
|
|
1795
1829
|
};
|
|
1796
1830
|
try {
|
|
1797
|
-
for (var functions_1 = (
|
|
1831
|
+
for (var functions_1 = (e_27 = void 0, tslib_1.__values(functions)), functions_1_1 = functions_1.next(); !functions_1_1.done; functions_1_1 = functions_1.next()) {
|
|
1798
1832
|
var key_1 = functions_1_1.value;
|
|
1799
1833
|
_loop_4(key_1);
|
|
1800
1834
|
}
|
|
1801
1835
|
}
|
|
1802
|
-
catch (
|
|
1836
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
1803
1837
|
finally {
|
|
1804
1838
|
try {
|
|
1805
1839
|
if (functions_1_1 && !functions_1_1.done && (_a = functions_1.return)) _a.call(functions_1);
|
|
1806
1840
|
}
|
|
1807
|
-
finally { if (
|
|
1841
|
+
finally { if (e_27) throw e_27.error; }
|
|
1808
1842
|
}
|
|
1809
1843
|
}
|
|
1810
1844
|
base = Object.getPrototypeOf(base);
|
|
@@ -1816,7 +1850,7 @@ function createOldEntity(entity, remult) {
|
|
|
1816
1850
|
}
|
|
1817
1851
|
var rowHelperBase = /** @class */ (function () {
|
|
1818
1852
|
function rowHelperBase(fieldsMetadata, instance, remult, isNewRow, excludeRelationMembers) {
|
|
1819
|
-
var
|
|
1853
|
+
var e_28, _a;
|
|
1820
1854
|
var _this = this;
|
|
1821
1855
|
this.fieldsMetadata = fieldsMetadata;
|
|
1822
1856
|
this.instance = instance;
|
|
@@ -1912,12 +1946,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1912
1946
|
_loop_5(col);
|
|
1913
1947
|
}
|
|
1914
1948
|
}
|
|
1915
|
-
catch (
|
|
1949
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
1916
1950
|
finally {
|
|
1917
1951
|
try {
|
|
1918
1952
|
if (fieldsMetadata_1_1 && !fieldsMetadata_1_1.done && (_a = fieldsMetadata_1.return)) _a.call(fieldsMetadata_1);
|
|
1919
1953
|
}
|
|
1920
|
-
finally { if (
|
|
1954
|
+
finally { if (e_28) throw e_28.error; }
|
|
1921
1955
|
}
|
|
1922
1956
|
}
|
|
1923
1957
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -1939,7 +1973,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1939
1973
|
return this._subscribers.subscribe(listener);
|
|
1940
1974
|
};
|
|
1941
1975
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
1942
|
-
var
|
|
1976
|
+
var e_29, _a;
|
|
1943
1977
|
if (!this._subscribers) {
|
|
1944
1978
|
this._subscribers = new SubscribableImp_js_1.SubscribableImp();
|
|
1945
1979
|
var safeSubscribers_1 = this._subscribers;
|
|
@@ -1973,12 +2007,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1973
2007
|
_loop_6(col);
|
|
1974
2008
|
}
|
|
1975
2009
|
}
|
|
1976
|
-
catch (
|
|
2010
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
1977
2011
|
finally {
|
|
1978
2012
|
try {
|
|
1979
2013
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1980
2014
|
}
|
|
1981
|
-
finally { if (
|
|
2015
|
+
finally { if (e_29) throw e_29.error; }
|
|
1982
2016
|
}
|
|
1983
2017
|
}
|
|
1984
2018
|
};
|
|
@@ -2013,7 +2047,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2013
2047
|
throw this.buildErrorInfoObject();
|
|
2014
2048
|
};
|
|
2015
2049
|
rowHelperBase.prototype.buildErrorInfoObject = function () {
|
|
2016
|
-
var
|
|
2050
|
+
var e_30, _a;
|
|
2017
2051
|
var _b;
|
|
2018
2052
|
var error = {
|
|
2019
2053
|
modelState: Object.assign({}, this.errors),
|
|
@@ -2033,12 +2067,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2033
2067
|
}
|
|
2034
2068
|
}
|
|
2035
2069
|
}
|
|
2036
|
-
catch (
|
|
2070
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
2037
2071
|
finally {
|
|
2038
2072
|
try {
|
|
2039
2073
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2040
2074
|
}
|
|
2041
|
-
finally { if (
|
|
2075
|
+
finally { if (e_30) throw e_30.error; }
|
|
2042
2076
|
}
|
|
2043
2077
|
}
|
|
2044
2078
|
return new data_interfaces_js_1.EntityError(error);
|
|
@@ -2072,7 +2106,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2072
2106
|
this._reportChangedToEntityAndFields();
|
|
2073
2107
|
};
|
|
2074
2108
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
2075
|
-
var
|
|
2109
|
+
var e_31, _a;
|
|
2076
2110
|
if (this._subscribers) {
|
|
2077
2111
|
this._subscribers.reportChanged();
|
|
2078
2112
|
try {
|
|
@@ -2082,12 +2116,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2082
2116
|
ref._subscribers.reportChanged();
|
|
2083
2117
|
}
|
|
2084
2118
|
}
|
|
2085
|
-
catch (
|
|
2119
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2086
2120
|
finally {
|
|
2087
2121
|
try {
|
|
2088
2122
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2089
2123
|
}
|
|
2090
|
-
finally { if (
|
|
2124
|
+
finally { if (e_31) throw e_31.error; }
|
|
2091
2125
|
}
|
|
2092
2126
|
}
|
|
2093
2127
|
};
|
|
@@ -2097,7 +2131,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2097
2131
|
return !!!this.error && this.errors == undefined;
|
|
2098
2132
|
};
|
|
2099
2133
|
rowHelperBase.prototype.copyDataToObject = function (isNew) {
|
|
2100
|
-
var
|
|
2134
|
+
var e_32, _a;
|
|
2101
2135
|
if (isNew === void 0) { isNew = false; }
|
|
2102
2136
|
var d = {};
|
|
2103
2137
|
try {
|
|
@@ -2129,12 +2163,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2129
2163
|
}
|
|
2130
2164
|
}
|
|
2131
2165
|
}
|
|
2132
|
-
catch (
|
|
2166
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2133
2167
|
finally {
|
|
2134
2168
|
try {
|
|
2135
2169
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2136
2170
|
}
|
|
2137
|
-
finally { if (
|
|
2171
|
+
finally { if (e_32) throw e_32.error; }
|
|
2138
2172
|
}
|
|
2139
2173
|
return d;
|
|
2140
2174
|
};
|
|
@@ -2194,7 +2228,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2194
2228
|
}); });
|
|
2195
2229
|
};
|
|
2196
2230
|
rowHelperBase.prototype.toApiJson = function (includeRelatedEntities, notJustApi) {
|
|
2197
|
-
var
|
|
2231
|
+
var e_33, _a;
|
|
2198
2232
|
if (includeRelatedEntities === void 0) { includeRelatedEntities = false; }
|
|
2199
2233
|
if (notJustApi === void 0) { notJustApi = false; }
|
|
2200
2234
|
var result = {};
|
|
@@ -2234,19 +2268,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2234
2268
|
}
|
|
2235
2269
|
}
|
|
2236
2270
|
}
|
|
2237
|
-
catch (
|
|
2271
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2238
2272
|
finally {
|
|
2239
2273
|
try {
|
|
2240
2274
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2241
2275
|
}
|
|
2242
|
-
finally { if (
|
|
2276
|
+
finally { if (e_33) throw e_33.error; }
|
|
2243
2277
|
}
|
|
2244
2278
|
return result;
|
|
2245
2279
|
};
|
|
2246
2280
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body_1) {
|
|
2247
2281
|
return tslib_1.__awaiter(this, arguments, void 0, function (body, ignoreApiAllowed) {
|
|
2248
2282
|
var keys, _a, _b, col, lu;
|
|
2249
|
-
var
|
|
2283
|
+
var e_34, _c;
|
|
2250
2284
|
if (ignoreApiAllowed === void 0) { ignoreApiAllowed = false; }
|
|
2251
2285
|
return tslib_1.__generator(this, function (_d) {
|
|
2252
2286
|
switch (_d.label) {
|
|
@@ -2269,12 +2303,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2269
2303
|
}
|
|
2270
2304
|
}
|
|
2271
2305
|
}
|
|
2272
|
-
catch (
|
|
2306
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2273
2307
|
finally {
|
|
2274
2308
|
try {
|
|
2275
2309
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2276
2310
|
}
|
|
2277
|
-
finally { if (
|
|
2311
|
+
finally { if (e_34) throw e_34.error; }
|
|
2278
2312
|
}
|
|
2279
2313
|
return [4 /*yield*/, promiseAll(tslib_1.__spreadArray([], tslib_1.__read(this.fields), false).filter(function (f) { return !(0, relationInfoMember_js_1.getRelationFieldInfo)(f.metadata); }), function (x) { return x.load(); })];
|
|
2280
2314
|
case 1:
|
|
@@ -2289,7 +2323,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2289
2323
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
2290
2324
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
2291
2325
|
function rowHelperImplementation(info, instance, repo, edp, remult, _isNew, excludeRelationMembers) {
|
|
2292
|
-
var
|
|
2326
|
+
var e_35, _a;
|
|
2293
2327
|
var _this = _super.call(this, info.fieldsMetadata, instance, remult, _isNew, excludeRelationMembers) || this;
|
|
2294
2328
|
_this.info = info;
|
|
2295
2329
|
_this.repo = repo;
|
|
@@ -2313,12 +2347,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2313
2347
|
}
|
|
2314
2348
|
}
|
|
2315
2349
|
}
|
|
2316
|
-
catch (
|
|
2350
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
2317
2351
|
finally {
|
|
2318
2352
|
try {
|
|
2319
2353
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2320
2354
|
}
|
|
2321
|
-
finally { if (
|
|
2355
|
+
finally { if (e_35) throw e_35.error; }
|
|
2322
2356
|
}
|
|
2323
2357
|
}
|
|
2324
2358
|
if (_this.info.entityInfo.entityRefInit)
|
|
@@ -2438,7 +2472,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2438
2472
|
};
|
|
2439
2473
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
2440
2474
|
get: function () {
|
|
2441
|
-
var _a,
|
|
2475
|
+
var _a, e_36, _b;
|
|
2442
2476
|
if (!this._columns) {
|
|
2443
2477
|
var _items_1 = [];
|
|
2444
2478
|
var r_1 = (_a = {
|
|
@@ -2459,12 +2493,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2459
2493
|
(r_1[c.key] = new FieldRefImplementation(c.options, c, this.instance, this, this)));
|
|
2460
2494
|
}
|
|
2461
2495
|
}
|
|
2462
|
-
catch (
|
|
2496
|
+
catch (e_36_1) { e_36 = { error: e_36_1 }; }
|
|
2463
2497
|
finally {
|
|
2464
2498
|
try {
|
|
2465
2499
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
2466
2500
|
}
|
|
2467
|
-
finally { if (
|
|
2501
|
+
finally { if (e_36) throw e_36.error; }
|
|
2468
2502
|
}
|
|
2469
2503
|
this._columns = r_1;
|
|
2470
2504
|
}
|
|
@@ -2475,8 +2509,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2475
2509
|
});
|
|
2476
2510
|
rowHelperImplementation.prototype.save = function (options, onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject) {
|
|
2477
2511
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2478
|
-
var doNotSave_1, e, _a, _b, col,
|
|
2479
|
-
var
|
|
2512
|
+
var doNotSave_1, e, _a, _b, col, e_37_1, d, ignoreKeys, _c, _d, field, f, updatedRow, isNew, _e, _f, changesOnly, wasChanged, key, element, _g, _h, _j, _k, listener, e_38_1, err_1;
|
|
2513
|
+
var e_37, _l, e_39, _m, _o, _p, e_38, _q;
|
|
2480
2514
|
var _r, _s;
|
|
2481
2515
|
return tslib_1.__generator(this, function (_t) {
|
|
2482
2516
|
switch (_t.label) {
|
|
@@ -2518,14 +2552,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2518
2552
|
return [3 /*break*/, 4];
|
|
2519
2553
|
case 7: return [3 /*break*/, 10];
|
|
2520
2554
|
case 8:
|
|
2521
|
-
|
|
2522
|
-
|
|
2555
|
+
e_37_1 = _t.sent();
|
|
2556
|
+
e_37 = { error: e_37_1 };
|
|
2523
2557
|
return [3 /*break*/, 10];
|
|
2524
2558
|
case 9:
|
|
2525
2559
|
try {
|
|
2526
2560
|
if (_b && !_b.done && (_l = _a.return)) _l.call(_a);
|
|
2527
2561
|
}
|
|
2528
|
-
finally { if (
|
|
2562
|
+
finally { if (e_37) throw e_37.error; }
|
|
2529
2563
|
return [7 /*endfinally*/];
|
|
2530
2564
|
case 10:
|
|
2531
2565
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 12];
|
|
@@ -2551,12 +2585,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2551
2585
|
}
|
|
2552
2586
|
}
|
|
2553
2587
|
}
|
|
2554
|
-
catch (
|
|
2588
|
+
catch (e_39_1) { e_39 = { error: e_39_1 }; }
|
|
2555
2589
|
finally {
|
|
2556
2590
|
try {
|
|
2557
2591
|
if (_d && !_d.done && (_m = _c.return)) _m.call(_c);
|
|
2558
2592
|
}
|
|
2559
|
-
finally { if (
|
|
2593
|
+
finally { if (e_39) throw e_39.error; }
|
|
2560
2594
|
}
|
|
2561
2595
|
updatedRow = void 0;
|
|
2562
2596
|
isNew = this.isNew();
|
|
@@ -2645,14 +2679,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2645
2679
|
return [3 /*break*/, 31];
|
|
2646
2680
|
case 34: return [3 /*break*/, 37];
|
|
2647
2681
|
case 35:
|
|
2648
|
-
|
|
2649
|
-
|
|
2682
|
+
e_38_1 = _t.sent();
|
|
2683
|
+
e_38 = { error: e_38_1 };
|
|
2650
2684
|
return [3 /*break*/, 37];
|
|
2651
2685
|
case 36:
|
|
2652
2686
|
try {
|
|
2653
2687
|
if (_k && !_k.done && (_q = _j.return)) _q.call(_j);
|
|
2654
2688
|
}
|
|
2655
|
-
finally { if (
|
|
2689
|
+
finally { if (e_38) throw e_38.error; }
|
|
2656
2690
|
return [7 /*endfinally*/];
|
|
2657
2691
|
case 37:
|
|
2658
2692
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2676,8 +2710,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2676
2710
|
};
|
|
2677
2711
|
rowHelperImplementation.prototype.processInsertResponseDto = function (updatedRow) {
|
|
2678
2712
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2679
|
-
var e, _a, _b, listener,
|
|
2680
|
-
var
|
|
2713
|
+
var e, _a, _b, listener, e_40_1, err_2;
|
|
2714
|
+
var e_40, _c;
|
|
2681
2715
|
var _d;
|
|
2682
2716
|
return tslib_1.__generator(this, function (_e) {
|
|
2683
2717
|
switch (_e.label) {
|
|
@@ -2716,14 +2750,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2716
2750
|
return [3 /*break*/, 6];
|
|
2717
2751
|
case 9: return [3 /*break*/, 12];
|
|
2718
2752
|
case 10:
|
|
2719
|
-
|
|
2720
|
-
|
|
2753
|
+
e_40_1 = _e.sent();
|
|
2754
|
+
e_40 = { error: e_40_1 };
|
|
2721
2755
|
return [3 /*break*/, 12];
|
|
2722
2756
|
case 11:
|
|
2723
2757
|
try {
|
|
2724
2758
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2725
2759
|
}
|
|
2726
|
-
finally { if (
|
|
2760
|
+
finally { if (e_40) throw e_40.error; }
|
|
2727
2761
|
return [7 /*endfinally*/];
|
|
2728
2762
|
case 12:
|
|
2729
2763
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2741,8 +2775,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2741
2775
|
};
|
|
2742
2776
|
rowHelperImplementation.prototype.buildDtoForInsert = function () {
|
|
2743
2777
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2744
|
-
var e, _a, _b, col,
|
|
2745
|
-
var
|
|
2778
|
+
var e, _a, _b, col, e_41_1, d, _c, _d, field, f;
|
|
2779
|
+
var e_41, _e, e_42, _f;
|
|
2746
2780
|
return tslib_1.__generator(this, function (_g) {
|
|
2747
2781
|
switch (_g.label) {
|
|
2748
2782
|
case 0: return [4 /*yield*/, this.__validateEntity()];
|
|
@@ -2768,14 +2802,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2768
2802
|
return [3 /*break*/, 3];
|
|
2769
2803
|
case 6: return [3 /*break*/, 9];
|
|
2770
2804
|
case 7:
|
|
2771
|
-
|
|
2772
|
-
|
|
2805
|
+
e_41_1 = _g.sent();
|
|
2806
|
+
e_41 = { error: e_41_1 };
|
|
2773
2807
|
return [3 /*break*/, 9];
|
|
2774
2808
|
case 8:
|
|
2775
2809
|
try {
|
|
2776
2810
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2777
2811
|
}
|
|
2778
|
-
finally { if (
|
|
2812
|
+
finally { if (e_41) throw e_41.error; }
|
|
2779
2813
|
return [7 /*endfinally*/];
|
|
2780
2814
|
case 9:
|
|
2781
2815
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
@@ -2796,12 +2830,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2796
2830
|
}
|
|
2797
2831
|
}
|
|
2798
2832
|
}
|
|
2799
|
-
catch (
|
|
2833
|
+
catch (e_42_1) { e_42 = { error: e_42_1 }; }
|
|
2800
2834
|
finally {
|
|
2801
2835
|
try {
|
|
2802
2836
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
2803
2837
|
}
|
|
2804
|
-
finally { if (
|
|
2838
|
+
finally { if (e_42) throw e_42.error; }
|
|
2805
2839
|
}
|
|
2806
2840
|
return [2 /*return*/, d];
|
|
2807
2841
|
}
|
|
@@ -2888,8 +2922,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2888
2922
|
//@internal
|
|
2889
2923
|
rowHelperImplementation.prototype.__finishDelete = function (e) {
|
|
2890
2924
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2891
|
-
var _a, _b, listener,
|
|
2892
|
-
var
|
|
2925
|
+
var _a, _b, listener, e_43_1;
|
|
2926
|
+
var e_43, _c;
|
|
2893
2927
|
var _d;
|
|
2894
2928
|
return tslib_1.__generator(this, function (_e) {
|
|
2895
2929
|
switch (_e.label) {
|
|
@@ -2919,14 +2953,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2919
2953
|
return [3 /*break*/, 4];
|
|
2920
2954
|
case 7: return [3 /*break*/, 10];
|
|
2921
2955
|
case 8:
|
|
2922
|
-
|
|
2923
|
-
|
|
2956
|
+
e_43_1 = _e.sent();
|
|
2957
|
+
e_43 = { error: e_43_1 };
|
|
2924
2958
|
return [3 /*break*/, 10];
|
|
2925
2959
|
case 9:
|
|
2926
2960
|
try {
|
|
2927
2961
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2928
2962
|
}
|
|
2929
|
-
finally { if (
|
|
2963
|
+
finally { if (e_43) throw e_43.error; }
|
|
2930
2964
|
return [7 /*endfinally*/];
|
|
2931
2965
|
case 10:
|
|
2932
2966
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [
|
|
@@ -2940,8 +2974,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2940
2974
|
};
|
|
2941
2975
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
2942
2976
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2943
|
-
var _a, _b, col, lu,
|
|
2944
|
-
var
|
|
2977
|
+
var _a, _b, col, lu, e_44_1;
|
|
2978
|
+
var e_44, _c;
|
|
2945
2979
|
return tslib_1.__generator(this, function (_d) {
|
|
2946
2980
|
switch (_d.label) {
|
|
2947
2981
|
case 0:
|
|
@@ -2982,14 +3016,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2982
3016
|
return [3 /*break*/, 1];
|
|
2983
3017
|
case 9: return [3 /*break*/, 12];
|
|
2984
3018
|
case 10:
|
|
2985
|
-
|
|
2986
|
-
|
|
3019
|
+
e_44_1 = _d.sent();
|
|
3020
|
+
e_44 = { error: e_44_1 };
|
|
2987
3021
|
return [3 /*break*/, 12];
|
|
2988
3022
|
case 11:
|
|
2989
3023
|
try {
|
|
2990
3024
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2991
3025
|
}
|
|
2992
|
-
finally { if (
|
|
3026
|
+
finally { if (e_44) throw e_44.error; }
|
|
2993
3027
|
return [7 /*endfinally*/];
|
|
2994
3028
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
2995
3029
|
case 13:
|
|
@@ -3005,8 +3039,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3005
3039
|
};
|
|
3006
3040
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
3007
3041
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3008
|
-
var _a, _b, col, result,
|
|
3009
|
-
var
|
|
3042
|
+
var _a, _b, col, result, e_45_1;
|
|
3043
|
+
var e_45, _c;
|
|
3010
3044
|
return tslib_1.__generator(this, function (_d) {
|
|
3011
3045
|
switch (_d.label) {
|
|
3012
3046
|
case 0:
|
|
@@ -3031,14 +3065,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3031
3065
|
return [3 /*break*/, 2];
|
|
3032
3066
|
case 5: return [3 /*break*/, 8];
|
|
3033
3067
|
case 6:
|
|
3034
|
-
|
|
3035
|
-
|
|
3068
|
+
e_45_1 = _d.sent();
|
|
3069
|
+
e_45 = { error: e_45_1 };
|
|
3036
3070
|
return [3 /*break*/, 8];
|
|
3037
3071
|
case 7:
|
|
3038
3072
|
try {
|
|
3039
3073
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3040
3074
|
}
|
|
3041
|
-
finally { if (
|
|
3075
|
+
finally { if (e_45) throw e_45.error; }
|
|
3042
3076
|
return [7 /*endfinally*/];
|
|
3043
3077
|
case 8: return [2 /*return*/];
|
|
3044
3078
|
}
|
|
@@ -3051,7 +3085,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3051
3085
|
return this._isNew;
|
|
3052
3086
|
};
|
|
3053
3087
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
3054
|
-
var
|
|
3088
|
+
var e_46, _a;
|
|
3055
3089
|
var _b;
|
|
3056
3090
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
3057
3091
|
try {
|
|
@@ -3063,19 +3097,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3063
3097
|
return true;
|
|
3064
3098
|
}
|
|
3065
3099
|
}
|
|
3066
|
-
catch (
|
|
3100
|
+
catch (e_46_1) { e_46 = { error: e_46_1 }; }
|
|
3067
3101
|
finally {
|
|
3068
3102
|
try {
|
|
3069
3103
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3070
3104
|
}
|
|
3071
|
-
finally { if (
|
|
3105
|
+
finally { if (e_46) throw e_46.error; }
|
|
3072
3106
|
}
|
|
3073
3107
|
return false;
|
|
3074
3108
|
};
|
|
3075
3109
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
3076
3110
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3077
|
-
var _a, _b, c, col,
|
|
3078
|
-
var
|
|
3111
|
+
var _a, _b, c, col, e_47_1, e, _c, _d, listener, e_48_1;
|
|
3112
|
+
var e_47, _e, e_48, _f;
|
|
3079
3113
|
var _g;
|
|
3080
3114
|
return tslib_1.__generator(this, function (_h) {
|
|
3081
3115
|
switch (_h.label) {
|
|
@@ -3097,14 +3131,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3097
3131
|
return [3 /*break*/, 1];
|
|
3098
3132
|
case 4: return [3 /*break*/, 7];
|
|
3099
3133
|
case 5:
|
|
3100
|
-
|
|
3101
|
-
|
|
3134
|
+
e_47_1 = _h.sent();
|
|
3135
|
+
e_47 = { error: e_47_1 };
|
|
3102
3136
|
return [3 /*break*/, 7];
|
|
3103
3137
|
case 6:
|
|
3104
3138
|
try {
|
|
3105
3139
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3106
3140
|
}
|
|
3107
|
-
finally { if (
|
|
3141
|
+
finally { if (e_47) throw e_47.error; }
|
|
3108
3142
|
return [7 /*endfinally*/];
|
|
3109
3143
|
case 7:
|
|
3110
3144
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -3132,14 +3166,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3132
3166
|
return [3 /*break*/, 11];
|
|
3133
3167
|
case 14: return [3 /*break*/, 17];
|
|
3134
3168
|
case 15:
|
|
3135
|
-
|
|
3136
|
-
|
|
3169
|
+
e_48_1 = _h.sent();
|
|
3170
|
+
e_48 = { error: e_48_1 };
|
|
3137
3171
|
return [3 /*break*/, 17];
|
|
3138
3172
|
case 16:
|
|
3139
3173
|
try {
|
|
3140
3174
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
3141
3175
|
}
|
|
3142
|
-
finally { if (
|
|
3176
|
+
finally { if (e_48) throw e_48.error; }
|
|
3143
3177
|
return [7 /*endfinally*/];
|
|
3144
3178
|
case 17: return [2 /*return*/];
|
|
3145
3179
|
}
|
|
@@ -3186,7 +3220,7 @@ function getControllerRef(container, remultArg) {
|
|
|
3186
3220
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
3187
3221
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
3188
3222
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
3189
|
-
var _a,
|
|
3223
|
+
var _a, e_49, _b;
|
|
3190
3224
|
var _this = _super.call(this, columnsInfo, instance, remult, false) || this;
|
|
3191
3225
|
var _items = [];
|
|
3192
3226
|
var r = (_a = {
|
|
@@ -3203,20 +3237,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3203
3237
|
_items.push((r[col.key] = new FieldRefImplementation(col.options, col, instance, undefined, _this)));
|
|
3204
3238
|
}
|
|
3205
3239
|
}
|
|
3206
|
-
catch (
|
|
3240
|
+
catch (e_49_1) { e_49 = { error: e_49_1 }; }
|
|
3207
3241
|
finally {
|
|
3208
3242
|
try {
|
|
3209
3243
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_b = columnsInfo_1.return)) _b.call(columnsInfo_1);
|
|
3210
3244
|
}
|
|
3211
|
-
finally { if (
|
|
3245
|
+
finally { if (e_49) throw e_49.error; }
|
|
3212
3246
|
}
|
|
3213
3247
|
_this.fields = r;
|
|
3214
3248
|
return _this;
|
|
3215
3249
|
}
|
|
3216
3250
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
3217
3251
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3218
|
-
var _a, _b, col,
|
|
3219
|
-
var
|
|
3252
|
+
var _a, _b, col, e_50_1;
|
|
3253
|
+
var e_50, _c;
|
|
3220
3254
|
return tslib_1.__generator(this, function (_d) {
|
|
3221
3255
|
switch (_d.label) {
|
|
3222
3256
|
case 0:
|
|
@@ -3236,14 +3270,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3236
3270
|
return [3 /*break*/, 1];
|
|
3237
3271
|
case 4: return [3 /*break*/, 7];
|
|
3238
3272
|
case 5:
|
|
3239
|
-
|
|
3240
|
-
|
|
3273
|
+
e_50_1 = _d.sent();
|
|
3274
|
+
e_50 = { error: e_50_1 };
|
|
3241
3275
|
return [3 /*break*/, 7];
|
|
3242
3276
|
case 6:
|
|
3243
3277
|
try {
|
|
3244
3278
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3245
3279
|
}
|
|
3246
|
-
finally { if (
|
|
3280
|
+
finally { if (e_50) throw e_50.error; }
|
|
3247
3281
|
return [7 /*endfinally*/];
|
|
3248
3282
|
case 7: return [2 /*return*/];
|
|
3249
3283
|
}
|
|
@@ -3440,8 +3474,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3440
3474
|
};
|
|
3441
3475
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
3442
3476
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3443
|
-
var processValidation, self_1, event_2, _a, _b, v, _c,
|
|
3444
|
-
var
|
|
3477
|
+
var processValidation, self_1, event_2, _a, _b, v, _c, e_51_1, _d, error_1;
|
|
3478
|
+
var e_51, _e;
|
|
3445
3479
|
var _this = this;
|
|
3446
3480
|
var _f, _g;
|
|
3447
3481
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -3495,14 +3529,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3495
3529
|
return [3 /*break*/, 2];
|
|
3496
3530
|
case 5: return [3 /*break*/, 8];
|
|
3497
3531
|
case 6:
|
|
3498
|
-
|
|
3499
|
-
|
|
3532
|
+
e_51_1 = _h.sent();
|
|
3533
|
+
e_51 = { error: e_51_1 };
|
|
3500
3534
|
return [3 /*break*/, 8];
|
|
3501
3535
|
case 7:
|
|
3502
3536
|
try {
|
|
3503
3537
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3504
3538
|
}
|
|
3505
|
-
finally { if (
|
|
3539
|
+
finally { if (e_51) throw e_51.error; }
|
|
3506
3540
|
return [7 /*endfinally*/];
|
|
3507
3541
|
case 8: return [3 /*break*/, 11];
|
|
3508
3542
|
case 9:
|
|
@@ -3667,7 +3701,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3667
3701
|
exports.columnDefsImpl = columnDefsImpl;
|
|
3668
3702
|
var EntityFullInfo = /** @class */ (function () {
|
|
3669
3703
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
3670
|
-
var _a,
|
|
3704
|
+
var _a, e_52, _b;
|
|
3671
3705
|
var _this = this;
|
|
3672
3706
|
var _c;
|
|
3673
3707
|
this.entityInfo = entityInfo;
|
|
@@ -3772,12 +3806,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3772
3806
|
this.fieldsMetadata.push((r[x.key] = new columnDefsImpl(x, this, remult)));
|
|
3773
3807
|
}
|
|
3774
3808
|
}
|
|
3775
|
-
catch (
|
|
3809
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
3776
3810
|
finally {
|
|
3777
3811
|
try {
|
|
3778
3812
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
3779
3813
|
}
|
|
3780
|
-
finally { if (
|
|
3814
|
+
finally { if (e_52) throw e_52.error; }
|
|
3781
3815
|
}
|
|
3782
3816
|
this.fields = r;
|
|
3783
3817
|
this.label = buildLabel((_c = entityInfo.label) !== null && _c !== void 0 ? _c : entityInfo.caption, this.key, remult, this);
|
|
@@ -3894,7 +3928,7 @@ function ValueListFieldType() {
|
|
|
3894
3928
|
}
|
|
3895
3929
|
var ValueListInfo = /** @class */ (function () {
|
|
3896
3930
|
function ValueListInfo(valueListType) {
|
|
3897
|
-
var
|
|
3931
|
+
var e_53, _a, _b;
|
|
3898
3932
|
var _this = this;
|
|
3899
3933
|
this.valueListType = valueListType;
|
|
3900
3934
|
this.byIdMap = new Map();
|
|
@@ -3930,12 +3964,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
3930
3964
|
}
|
|
3931
3965
|
}
|
|
3932
3966
|
}
|
|
3933
|
-
catch (
|
|
3967
|
+
catch (e_53_1) { e_53 = { error: e_53_1 }; }
|
|
3934
3968
|
finally {
|
|
3935
3969
|
try {
|
|
3936
3970
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
3937
3971
|
}
|
|
3938
|
-
finally { if (
|
|
3972
|
+
finally { if (e_53) throw e_53.error; }
|
|
3939
3973
|
}
|
|
3940
3974
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
3941
3975
|
throw new Error("ValueType ".concat(this.valueListType, " has values without an id"));
|
|
@@ -4017,7 +4051,7 @@ function getValueList(type) {
|
|
|
4017
4051
|
exports.storableMember = Symbol.for('storableMember');
|
|
4018
4052
|
exports.fieldOptionalValuesFunctionKey = Symbol.for('fieldOptionalValues');
|
|
4019
4053
|
function buildOptions(options, remult) {
|
|
4020
|
-
var
|
|
4054
|
+
var e_54, _a;
|
|
4021
4055
|
var _b;
|
|
4022
4056
|
var r = {};
|
|
4023
4057
|
try {
|
|
@@ -4034,12 +4068,12 @@ function buildOptions(options, remult) {
|
|
|
4034
4068
|
}
|
|
4035
4069
|
}
|
|
4036
4070
|
}
|
|
4037
|
-
catch (
|
|
4071
|
+
catch (e_54_1) { e_54 = { error: e_54_1 }; }
|
|
4038
4072
|
finally {
|
|
4039
4073
|
try {
|
|
4040
4074
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
4041
4075
|
}
|
|
4042
|
-
finally { if (
|
|
4076
|
+
finally { if (e_54) throw e_54.error; }
|
|
4043
4077
|
}
|
|
4044
4078
|
(_b = exports.fieldOptionsEnricher.enrichFieldOptions) === null || _b === void 0 ? void 0 : _b.call(exports.fieldOptionsEnricher, r);
|
|
4045
4079
|
return r;
|
|
@@ -4082,7 +4116,7 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4082
4116
|
};
|
|
4083
4117
|
settings.valueConverter = new Proxy(settings.valueConverter, {
|
|
4084
4118
|
get: function (target, property) {
|
|
4085
|
-
var
|
|
4119
|
+
var e_55, _a;
|
|
4086
4120
|
if (target[property] === undefined) {
|
|
4087
4121
|
if (isIdNumeric_1 === undefined) {
|
|
4088
4122
|
if (property === 'inputType')
|
|
@@ -4105,12 +4139,12 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4105
4139
|
: valueConverters_js_1.ValueConverters.String[key];
|
|
4106
4140
|
}
|
|
4107
4141
|
}
|
|
4108
|
-
catch (
|
|
4142
|
+
catch (e_55_1) { e_55 = { error: e_55_1 }; }
|
|
4109
4143
|
finally {
|
|
4110
4144
|
try {
|
|
4111
4145
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4112
4146
|
}
|
|
4113
|
-
finally { if (
|
|
4147
|
+
finally { if (e_55) throw e_55.error; }
|
|
4114
4148
|
}
|
|
4115
4149
|
}
|
|
4116
4150
|
}
|