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