remult 3.4.2 → 3.5.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/esm/internals.js +1 -0
- package/esm/postgres/postgres-data-provider.js +4 -5
- package/esm/remult-duckdb.js +4 -0
- package/esm/remult-knex/index.js +69 -14
- package/esm/remult-mongo.js +25 -7
- package/esm/remult-sqlite-core.js +4 -1
- package/esm/server/remult-api-server.js +14 -6
- package/esm/src/buildRestDataProvider.js +8 -6
- package/esm/src/context.js +1 -1
- package/esm/src/data-api.js +2 -2
- package/esm/src/data-interfaces.js +2 -1
- package/esm/src/data-providers/array-entity-data-provider.js +9 -4
- package/esm/src/data-providers/rest-data-provider-using-fetch.js +13 -6
- package/esm/src/data-providers/retry.js +11 -6
- package/esm/src/data-providers/sql-database.js +40 -30
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +35 -4
- package/esm/src/filter/filter-interfaces.js +18 -4
- package/esm/src/live-query/SubscriptionChannel.js +13 -8
- package/esm/src/remult-proxy.js +12 -0
- package/esm/src/remult-static.js +2 -0
- package/esm/src/remult3/Fields.js +14 -14
- package/esm/src/remult3/RepositoryImplementation.js +69 -32
- package/esm/src/remult3/remult3.js +2 -0
- package/esm/src/server-action.js +43 -14
- package/esm/src/sort.js +18 -0
- package/index.d.ts +4 -3
- package/internals.d.ts +1 -0
- package/internals.js +3 -1
- package/package.json +41 -1
- package/postgres/postgres-data-provider.d.ts +2 -3
- package/postgres/postgres-data-provider.js +4 -4
- package/remult-duckdb.d.ts +2 -0
- package/remult-duckdb.js +4 -0
- package/remult-knex/index.d.ts +2 -0
- package/remult-knex/index.js +153 -83
- package/remult-mongo.js +28 -7
- package/remult-sqlite-core.d.ts +2 -1
- package/remult-sqlite-core.js +4 -0
- package/server/remult-api-server.d.ts +28 -1
- package/server/remult-api-server.js +19 -12
- package/src/buildRestDataProvider.d.ts +1 -1
- package/src/buildRestDataProvider.js +8 -6
- package/src/column-interfaces.d.ts +5 -1
- package/src/context.js +1 -1
- package/src/data-api.js +2 -2
- package/src/data-interfaces.d.ts +0 -1
- package/src/data-interfaces.js +3 -0
- package/src/data-providers/array-entity-data-provider.js +9 -4
- package/src/data-providers/rest-data-provider-using-fetch.d.ts +1 -1
- package/src/data-providers/rest-data-provider-using-fetch.js +11 -4
- package/src/data-providers/retry.d.ts +4 -1
- package/src/data-providers/retry.js +26 -16
- package/src/data-providers/sql-database.d.ts +7 -3
- package/src/data-providers/sql-database.js +99 -81
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +8 -0
- package/src/filter/filter-consumer-bridge-to-sql-request.js +58 -19
- package/src/filter/filter-interfaces.js +19 -2
- package/src/live-query/SubscriptionChannel.js +16 -10
- package/src/remult-proxy.js +28 -0
- package/src/remult-static.d.ts +4 -0
- package/src/remult-static.js +2 -0
- package/src/remult3/Fields.d.ts +5 -3
- package/src/remult3/Fields.js +24 -13
- package/src/remult3/RepositoryImplementation.d.ts +7 -0
- package/src/remult3/RepositoryImplementation.js +325 -264
- package/src/remult3/remult3.d.ts +68 -5
- package/src/remult3/remult3.js +2 -0
- package/src/server-action.d.ts +34 -2
- package/src/server-action.js +195 -115
- package/src/sort.d.ts +19 -0
- package/src/sort.js +20 -1
- package/src/sql-command.d.ts +2 -1
|
@@ -73,75 +73,59 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
73
73
|
httpStatusCode: 404,
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
+
RepositoryImplementation.prototype._noMatchError = function () {
|
|
77
|
+
return {
|
|
78
|
+
message: "no row matches the filter in entity ".concat(this.metadata.key),
|
|
79
|
+
httpStatusCode: 404,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
76
82
|
RepositoryImplementation.prototype[repository_internals_js_1.getInternalKey] = function () {
|
|
77
83
|
return this;
|
|
78
84
|
};
|
|
79
85
|
RepositoryImplementation.prototype._createAfterFilter = function (orderBy, lastRow) {
|
|
80
86
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
81
|
-
var
|
|
82
|
-
var e_1,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
var ref, filter, or, equal, _loop_1, _a, _b, _c, field, isDescending;
|
|
88
|
+
var e_1, _d;
|
|
89
|
+
var _e;
|
|
90
|
+
return tslib_1.__generator(this, function (_f) {
|
|
91
|
+
ref = this.getEntityRef(lastRow);
|
|
92
|
+
filter = { $or: [] };
|
|
93
|
+
or = filter.$or;
|
|
94
|
+
equal = {};
|
|
95
|
+
_loop_1 = function (field, isDescending) {
|
|
96
|
+
// A string key cannot name an entity member for TypeScript.
|
|
97
|
+
var keyIs = function (condition) {
|
|
98
|
+
var _a;
|
|
99
|
+
return (_a = {}, _a[field.key] = condition, _a);
|
|
100
|
+
};
|
|
101
|
+
// An unloaded relation reads `undefined`, its id is there.
|
|
102
|
+
var value = (_e = ref.fields.find(field.key).getId()) !== null && _e !== void 0 ? _e : null;
|
|
103
|
+
var nullFirst = (0, sort_js_1.isNullFirstSort)(isDescending);
|
|
104
|
+
if (value === null) {
|
|
105
|
+
if (nullFirst)
|
|
106
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), { $not: keyIs(null) }));
|
|
99
107
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
108
|
+
else {
|
|
109
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(isDescending ? { $lt: value } : { $gt: value })));
|
|
110
|
+
if (field.allowNull && !nullFirst)
|
|
111
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(null)));
|
|
105
112
|
}
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
r = { $or: [] };
|
|
109
|
-
equalToColumn = [];
|
|
113
|
+
equal = tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(value));
|
|
114
|
+
};
|
|
110
115
|
try {
|
|
111
|
-
for (
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
f = {};
|
|
115
|
-
try {
|
|
116
|
-
for (equalToColumn_1 = (e_3 = void 0, tslib_1.__values(equalToColumn)), equalToColumn_1_1 = equalToColumn_1.next(); !equalToColumn_1_1.done; equalToColumn_1_1 = equalToColumn_1.next()) {
|
|
117
|
-
c = equalToColumn_1_1.value;
|
|
118
|
-
f[c.key] = values.get(c.key);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
122
|
-
finally {
|
|
123
|
-
try {
|
|
124
|
-
if (equalToColumn_1_1 && !equalToColumn_1_1.done && (_g = equalToColumn_1.return)) _g.call(equalToColumn_1);
|
|
125
|
-
}
|
|
126
|
-
finally { if (e_3) throw e_3.error; }
|
|
127
|
-
}
|
|
128
|
-
equalToColumn.push(s.field);
|
|
129
|
-
if (s.isDescending) {
|
|
130
|
-
f[s.field.key] = { $lt: values.get(s.field.key) };
|
|
131
|
-
}
|
|
132
|
-
else
|
|
133
|
-
f[s.field.key] = { $gt: values.get(s.field.key) };
|
|
134
|
-
r.$or.push(f);
|
|
116
|
+
for (_a = tslib_1.__values(sort_js_1.Sort.translateOrderByToSort(this.metadata, orderBy).Segments), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
117
|
+
_c = _b.value, field = _c.field, isDescending = _c.isDescending;
|
|
118
|
+
_loop_1(field, isDescending);
|
|
135
119
|
}
|
|
136
120
|
}
|
|
137
|
-
catch (
|
|
121
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
138
122
|
finally {
|
|
139
123
|
try {
|
|
140
|
-
if (
|
|
124
|
+
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
141
125
|
}
|
|
142
|
-
finally { if (
|
|
126
|
+
finally { if (e_1) throw e_1.error; }
|
|
143
127
|
}
|
|
144
|
-
return [2 /*return*/,
|
|
128
|
+
return [2 /*return*/, filter];
|
|
145
129
|
});
|
|
146
130
|
});
|
|
147
131
|
};
|
|
@@ -198,7 +182,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
198
182
|
RepositoryImplementation.prototype.groupBy = function (options) {
|
|
199
183
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
200
184
|
var dpOptions, result, loaderOptions, _a, _b, key, loader;
|
|
201
|
-
var
|
|
185
|
+
var e_2, _c;
|
|
202
186
|
return tslib_1.__generator(this, function (_d) {
|
|
203
187
|
switch (_d.label) {
|
|
204
188
|
case 0: return [4 /*yield*/, this.__buildGroupByOptions(options)];
|
|
@@ -219,12 +203,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
219
203
|
loaderOptions.include[key] = true;
|
|
220
204
|
}
|
|
221
205
|
}
|
|
222
|
-
catch (
|
|
206
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
223
207
|
finally {
|
|
224
208
|
try {
|
|
225
209
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
226
210
|
}
|
|
227
|
-
finally { if (
|
|
211
|
+
finally { if (e_2) throw e_2.error; }
|
|
228
212
|
}
|
|
229
213
|
loader = new relation_loader_js_1.RelationLoader();
|
|
230
214
|
return [4 /*yield*/, this._populateRelationsForFields(dpOptions.group, loaderOptions, result, loader)];
|
|
@@ -420,7 +404,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
420
404
|
});
|
|
421
405
|
};
|
|
422
406
|
RepositoryImplementation.prototype.__cleanupPartialObject = function (item) {
|
|
423
|
-
var
|
|
407
|
+
var e_3, _a;
|
|
424
408
|
var keys = Object.keys(item);
|
|
425
409
|
for (var index = 0; index < keys.length; index++) {
|
|
426
410
|
var key = keys[index];
|
|
@@ -449,18 +433,18 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
449
433
|
var field = _c.value;
|
|
450
434
|
}
|
|
451
435
|
}
|
|
452
|
-
catch (
|
|
436
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
453
437
|
finally {
|
|
454
438
|
try {
|
|
455
439
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
456
440
|
}
|
|
457
|
-
finally { if (
|
|
441
|
+
finally { if (e_3) throw e_3.error; }
|
|
458
442
|
}
|
|
459
443
|
};
|
|
460
444
|
RepositoryImplementation.prototype.insert = function (entity, options) {
|
|
461
445
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
462
|
-
var useBulk, r, entity_1, entity_1_1, item, _a, _b,
|
|
463
|
-
var
|
|
446
|
+
var useBulk, r, entity_1, entity_1_1, item, _a, _b, e_4_1, slots, raw, entity_2, entity_2_1, item, ref, dto, e_5_1, inserted, i, slots_1, slots_1_1, slot, result, ref, result;
|
|
447
|
+
var e_4, _c, e_5, _d, e_6, _e;
|
|
464
448
|
return tslib_1.__generator(this, function (_f) {
|
|
465
449
|
switch (_f.label) {
|
|
466
450
|
case 0:
|
|
@@ -486,14 +470,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
486
470
|
return [3 /*break*/, 2];
|
|
487
471
|
case 5: return [3 /*break*/, 8];
|
|
488
472
|
case 6:
|
|
489
|
-
|
|
490
|
-
|
|
473
|
+
e_4_1 = _f.sent();
|
|
474
|
+
e_4 = { error: e_4_1 };
|
|
491
475
|
return [3 /*break*/, 8];
|
|
492
476
|
case 7:
|
|
493
477
|
try {
|
|
494
478
|
if (entity_1_1 && !entity_1_1.done && (_c = entity_1.return)) _c.call(entity_1);
|
|
495
479
|
}
|
|
496
|
-
finally { if (
|
|
480
|
+
finally { if (e_4) throw e_4.error; }
|
|
497
481
|
return [7 /*endfinally*/];
|
|
498
482
|
case 8:
|
|
499
483
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
@@ -535,14 +519,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
535
519
|
return [3 /*break*/, 11];
|
|
536
520
|
case 14: return [3 /*break*/, 17];
|
|
537
521
|
case 15:
|
|
538
|
-
|
|
539
|
-
|
|
522
|
+
e_5_1 = _f.sent();
|
|
523
|
+
e_5 = { error: e_5_1 };
|
|
540
524
|
return [3 /*break*/, 17];
|
|
541
525
|
case 16:
|
|
542
526
|
try {
|
|
543
527
|
if (entity_2_1 && !entity_2_1.done && (_d = entity_2.return)) _d.call(entity_2);
|
|
544
528
|
}
|
|
545
|
-
finally { if (
|
|
529
|
+
finally { if (e_5) throw e_5.error; }
|
|
546
530
|
return [7 /*endfinally*/];
|
|
547
531
|
case 17:
|
|
548
532
|
if (!raw.length) return [3 /*break*/, 19];
|
|
@@ -557,12 +541,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
557
541
|
slot.row = inserted[i++];
|
|
558
542
|
}
|
|
559
543
|
}
|
|
560
|
-
catch (
|
|
544
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
561
545
|
finally {
|
|
562
546
|
try {
|
|
563
547
|
if (slots_1_1 && !slots_1_1.done && (_e = slots_1.return)) _e.call(slots_1);
|
|
564
548
|
}
|
|
565
|
-
finally { if (
|
|
549
|
+
finally { if (e_6) throw e_6.error; }
|
|
566
550
|
}
|
|
567
551
|
_f.label = 19;
|
|
568
552
|
case 19: return [4 /*yield*/, promiseAll(slots, function (slot) {
|
|
@@ -610,8 +594,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
610
594
|
fields[_i - 1] = arguments[_i];
|
|
611
595
|
}
|
|
612
596
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
613
|
-
var ref, hasError, fields_1, fields_1_1, f,
|
|
614
|
-
var
|
|
597
|
+
var ref, hasError, fields_1, fields_1_1, f, e_7_1;
|
|
598
|
+
var e_7, _a;
|
|
615
599
|
return tslib_1.__generator(this, function (_b) {
|
|
616
600
|
switch (_b.label) {
|
|
617
601
|
case 0:
|
|
@@ -642,14 +626,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
642
626
|
return [3 /*break*/, 4];
|
|
643
627
|
case 7: return [3 /*break*/, 10];
|
|
644
628
|
case 8:
|
|
645
|
-
|
|
646
|
-
|
|
629
|
+
e_7_1 = _b.sent();
|
|
630
|
+
e_7 = { error: e_7_1 };
|
|
647
631
|
return [3 /*break*/, 10];
|
|
648
632
|
case 9:
|
|
649
633
|
try {
|
|
650
634
|
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
651
635
|
}
|
|
652
|
-
finally { if (
|
|
636
|
+
finally { if (e_7) throw e_7.error; }
|
|
653
637
|
return [7 /*endfinally*/];
|
|
654
638
|
case 10:
|
|
655
639
|
if (!hasError)
|
|
@@ -660,7 +644,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
660
644
|
});
|
|
661
645
|
};
|
|
662
646
|
RepositoryImplementation.prototype.__createDto = function (basedOn) {
|
|
663
|
-
var
|
|
647
|
+
var e_8, _a;
|
|
664
648
|
this.__cleanupPartialObject(basedOn);
|
|
665
649
|
var ref = this.getEntityRef(tslib_1.__assign({}, basedOn));
|
|
666
650
|
var r = ref.copyDataToObject(false);
|
|
@@ -672,19 +656,19 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
672
656
|
delete r[element.key];
|
|
673
657
|
}
|
|
674
658
|
}
|
|
675
|
-
catch (
|
|
659
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
676
660
|
finally {
|
|
677
661
|
try {
|
|
678
662
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
679
663
|
}
|
|
680
|
-
finally { if (
|
|
664
|
+
finally { if (e_8) throw e_8.error; }
|
|
681
665
|
}
|
|
682
666
|
return r;
|
|
683
667
|
};
|
|
684
668
|
RepositoryImplementation.prototype.updateMany = function (_a) {
|
|
685
669
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
686
|
-
var _c, _d, _e, updated, _f, _g, _h, item,
|
|
687
|
-
var _j,
|
|
670
|
+
var _c, _d, _e, updated, _f, _g, _h, item, e_9_1;
|
|
671
|
+
var _j, e_9, _k, _l;
|
|
688
672
|
var where = _b.where, set = _b.set;
|
|
689
673
|
return tslib_1.__generator(this, function (_m) {
|
|
690
674
|
switch (_m.label) {
|
|
@@ -727,8 +711,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
727
711
|
return [3 /*break*/, 6];
|
|
728
712
|
case 10: return [3 /*break*/, 17];
|
|
729
713
|
case 11:
|
|
730
|
-
|
|
731
|
-
|
|
714
|
+
e_9_1 = _m.sent();
|
|
715
|
+
e_9 = { error: e_9_1 };
|
|
732
716
|
return [3 /*break*/, 17];
|
|
733
717
|
case 12:
|
|
734
718
|
_m.trys.push([12, , 15, 16]);
|
|
@@ -739,7 +723,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
739
723
|
_m.label = 14;
|
|
740
724
|
case 14: return [3 /*break*/, 16];
|
|
741
725
|
case 15:
|
|
742
|
-
if (
|
|
726
|
+
if (e_9) throw e_9.error;
|
|
743
727
|
return [7 /*endfinally*/];
|
|
744
728
|
case 16: return [7 /*endfinally*/];
|
|
745
729
|
case 17: return [2 /*return*/, updated];
|
|
@@ -868,7 +852,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
868
852
|
});
|
|
869
853
|
};
|
|
870
854
|
RepositoryImplementation.prototype._getRefForExistingRow = function (entity, id) {
|
|
871
|
-
var
|
|
855
|
+
var e_10, _a;
|
|
872
856
|
var ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
873
857
|
if (!ref) {
|
|
874
858
|
var instance = new this._entity(this._remult);
|
|
@@ -879,12 +863,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
879
863
|
instance[key] = entity[key];
|
|
880
864
|
}
|
|
881
865
|
}
|
|
882
|
-
catch (
|
|
866
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
883
867
|
finally {
|
|
884
868
|
try {
|
|
885
869
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
886
870
|
}
|
|
887
|
-
finally { if (
|
|
871
|
+
finally { if (e_10) throw e_10.error; }
|
|
888
872
|
}
|
|
889
873
|
this._fixTypes(instance);
|
|
890
874
|
var row_1 = new rowHelperImplementation(this._info, instance, this, this._edp, this._remult, false);
|
|
@@ -1059,7 +1043,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1059
1043
|
case 0:
|
|
1060
1044
|
loader = new relation_loader_js_1.RelationLoader();
|
|
1061
1045
|
return [4 /*yield*/, this._loadManyToOneForManyRows(jsonItems.map(function (row) {
|
|
1062
|
-
var
|
|
1046
|
+
var e_11, _a;
|
|
1063
1047
|
var result = {};
|
|
1064
1048
|
try {
|
|
1065
1049
|
for (var _b = tslib_1.__values(_this.metadata.fields.toArray()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1067,12 +1051,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1067
1051
|
result[col.key] = col.valueConverter.fromJson(row[col.key]);
|
|
1068
1052
|
}
|
|
1069
1053
|
}
|
|
1070
|
-
catch (
|
|
1054
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1071
1055
|
finally {
|
|
1072
1056
|
try {
|
|
1073
1057
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1074
1058
|
}
|
|
1075
|
-
finally { if (
|
|
1059
|
+
finally { if (e_11) throw e_11.error; }
|
|
1076
1060
|
}
|
|
1077
1061
|
return result;
|
|
1078
1062
|
}), loadOptions, loader)];
|
|
@@ -1091,7 +1075,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1091
1075
|
function loadManyToOne(repo, toLoad) {
|
|
1092
1076
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1093
1077
|
var rows, rows_1, rows_1_1, r;
|
|
1094
|
-
var _a,
|
|
1078
|
+
var _a, e_14, _b;
|
|
1095
1079
|
return tslib_1.__generator(this, function (_c) {
|
|
1096
1080
|
switch (_c.label) {
|
|
1097
1081
|
case 0: return [4 /*yield*/, repo.find({ where: (_a = repo.metadata.idMetadata).getIdFilter.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(toLoad), false)) }, true)];
|
|
@@ -1103,20 +1087,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1103
1087
|
repo._addToCache(r);
|
|
1104
1088
|
}
|
|
1105
1089
|
}
|
|
1106
|
-
catch (
|
|
1090
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1107
1091
|
finally {
|
|
1108
1092
|
try {
|
|
1109
1093
|
if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
|
|
1110
1094
|
}
|
|
1111
|
-
finally { if (
|
|
1095
|
+
finally { if (e_14) throw e_14.error; }
|
|
1112
1096
|
}
|
|
1113
1097
|
return [2 /*return*/];
|
|
1114
1098
|
}
|
|
1115
1099
|
});
|
|
1116
1100
|
});
|
|
1117
1101
|
}
|
|
1118
|
-
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val,
|
|
1119
|
-
var
|
|
1102
|
+
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_12_1, excludeRelationMembers, select, fieldsExcludedBySelect, selected_1, result, fields;
|
|
1103
|
+
var e_12, _c, e_13, _d;
|
|
1120
1104
|
var _this = this;
|
|
1121
1105
|
return tslib_1.__generator(this, function (_e) {
|
|
1122
1106
|
switch (_e.label) {
|
|
@@ -1143,7 +1127,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1143
1127
|
repo = this._remult.repo(col.valueType);
|
|
1144
1128
|
toLoad = [];
|
|
1145
1129
|
try {
|
|
1146
|
-
for (rawRows_1 = (
|
|
1130
|
+
for (rawRows_1 = (e_13 = void 0, tslib_1.__values(rawRows)), rawRows_1_1 = rawRows_1.next(); !rawRows_1_1.done; rawRows_1_1 = rawRows_1.next()) {
|
|
1147
1131
|
r = rawRows_1_1.value;
|
|
1148
1132
|
val = r[col.key];
|
|
1149
1133
|
if (val !== undefined &&
|
|
@@ -1154,12 +1138,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1154
1138
|
}
|
|
1155
1139
|
}
|
|
1156
1140
|
}
|
|
1157
|
-
catch (
|
|
1141
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1158
1142
|
finally {
|
|
1159
1143
|
try {
|
|
1160
1144
|
if (rawRows_1_1 && !rawRows_1_1.done && (_d = rawRows_1.return)) _d.call(rawRows_1);
|
|
1161
1145
|
}
|
|
1162
|
-
finally { if (
|
|
1146
|
+
finally { if (e_13) throw e_13.error; }
|
|
1163
1147
|
}
|
|
1164
1148
|
if (!(toLoad.length > 0)) return [3 /*break*/, 4];
|
|
1165
1149
|
return [4 /*yield*/, loadManyToOne(repo, toLoad)];
|
|
@@ -1171,14 +1155,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1171
1155
|
return [3 /*break*/, 2];
|
|
1172
1156
|
case 5: return [3 /*break*/, 8];
|
|
1173
1157
|
case 6:
|
|
1174
|
-
|
|
1175
|
-
|
|
1158
|
+
e_12_1 = _e.sent();
|
|
1159
|
+
e_12 = { error: e_12_1 };
|
|
1176
1160
|
return [3 /*break*/, 8];
|
|
1177
1161
|
case 7:
|
|
1178
1162
|
try {
|
|
1179
1163
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1180
1164
|
}
|
|
1181
|
-
finally { if (
|
|
1165
|
+
finally { if (e_12) throw e_12.error; }
|
|
1182
1166
|
return [7 /*endfinally*/];
|
|
1183
1167
|
case 8:
|
|
1184
1168
|
excludeRelationMembers = new Set(this.fields
|
|
@@ -1217,15 +1201,16 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1217
1201
|
});
|
|
1218
1202
|
};
|
|
1219
1203
|
RepositoryImplementation.prototype._populateRelationsForFields = function (fields, loadOptions, result, loader) {
|
|
1220
|
-
var
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1223
|
-
var
|
|
1204
|
+
var e_15, _a;
|
|
1205
|
+
var _b;
|
|
1206
|
+
var _loop_2 = function (col) {
|
|
1207
|
+
var e_16, _c, e_17, _d;
|
|
1208
|
+
var _e = this_1.__getRelationAndInclude(col, loadOptions), rel = _e.rel, incl = _e.incl;
|
|
1224
1209
|
if (rel)
|
|
1225
1210
|
if (incl) {
|
|
1226
1211
|
var otherRepo = rel.toRepo;
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1212
|
+
var _loop_3 = function (row) {
|
|
1213
|
+
var _f = this_1._findOptionsBasedOnRelation(rel, col, incl, row, otherRepo), findOptions = _f.findOptions, returnNull = _f.returnNull, returnUndefined = _f.returnUndefined;
|
|
1229
1214
|
var colKey = col.key;
|
|
1230
1215
|
if (returnNull)
|
|
1231
1216
|
row[colKey] = null;
|
|
@@ -1257,32 +1242,34 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1257
1242
|
}
|
|
1258
1243
|
};
|
|
1259
1244
|
try {
|
|
1260
|
-
for (var result_1 = (
|
|
1245
|
+
for (var result_1 = (e_16 = void 0, tslib_1.__values(result)), result_1_1 = result_1.next(); !result_1_1.done; result_1_1 = result_1.next()) {
|
|
1261
1246
|
var row = result_1_1.value;
|
|
1262
|
-
|
|
1247
|
+
_loop_3(row);
|
|
1263
1248
|
}
|
|
1264
1249
|
}
|
|
1265
|
-
catch (
|
|
1250
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1266
1251
|
finally {
|
|
1267
1252
|
try {
|
|
1268
|
-
if (result_1_1 && !result_1_1.done && (
|
|
1253
|
+
if (result_1_1 && !result_1_1.done && (_c = result_1.return)) _c.call(result_1);
|
|
1269
1254
|
}
|
|
1270
|
-
finally { if (
|
|
1255
|
+
finally { if (e_16) throw e_16.error; }
|
|
1271
1256
|
}
|
|
1272
1257
|
}
|
|
1273
1258
|
else {
|
|
1274
1259
|
try {
|
|
1275
|
-
for (var result_2 = (
|
|
1260
|
+
for (var result_2 = (e_17 = void 0, tslib_1.__values(result)), result_2_1 = result_2.next(); !result_2_1.done; result_2_1 = result_2.next()) {
|
|
1276
1261
|
var row = result_2_1.value;
|
|
1277
|
-
|
|
1262
|
+
// Deleting the relation's accessor would drop its change tracking, so only a plain value goes.
|
|
1263
|
+
if (!((_b = Object.getOwnPropertyDescriptor(row, col.key)) === null || _b === void 0 ? void 0 : _b.get))
|
|
1264
|
+
Reflect.deleteProperty(row, col.key);
|
|
1278
1265
|
}
|
|
1279
1266
|
}
|
|
1280
|
-
catch (
|
|
1267
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1281
1268
|
finally {
|
|
1282
1269
|
try {
|
|
1283
|
-
if (result_2_1 && !result_2_1.done && (
|
|
1270
|
+
if (result_2_1 && !result_2_1.done && (_d = result_2.return)) _d.call(result_2);
|
|
1284
1271
|
}
|
|
1285
|
-
finally { if (
|
|
1272
|
+
finally { if (e_17) throw e_17.error; }
|
|
1286
1273
|
}
|
|
1287
1274
|
}
|
|
1288
1275
|
};
|
|
@@ -1290,15 +1277,15 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1290
1277
|
try {
|
|
1291
1278
|
for (var fields_2 = tslib_1.__values(fields), fields_2_1 = fields_2.next(); !fields_2_1.done; fields_2_1 = fields_2.next()) {
|
|
1292
1279
|
var col = fields_2_1.value;
|
|
1293
|
-
|
|
1280
|
+
_loop_2(col);
|
|
1294
1281
|
}
|
|
1295
1282
|
}
|
|
1296
|
-
catch (
|
|
1283
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1297
1284
|
finally {
|
|
1298
1285
|
try {
|
|
1299
1286
|
if (fields_2_1 && !fields_2_1.done && (_a = fields_2.return)) _a.call(fields_2);
|
|
1300
1287
|
}
|
|
1301
|
-
finally { if (
|
|
1288
|
+
finally { if (e_15) throw e_15.error; }
|
|
1302
1289
|
}
|
|
1303
1290
|
};
|
|
1304
1291
|
RepositoryImplementation.prototype.__getRelationAndInclude = function (col, loadOptions) {
|
|
@@ -1314,7 +1301,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1314
1301
|
};
|
|
1315
1302
|
/*@internal */
|
|
1316
1303
|
RepositoryImplementation.prototype._findOptionsBasedOnRelation = function (rel, field, moreFindOptions, row, otherRepo) {
|
|
1317
|
-
var
|
|
1304
|
+
var e_18, _a, e_19, _b, _c, _d;
|
|
1318
1305
|
var returnNull = false;
|
|
1319
1306
|
var returnUndefined = false;
|
|
1320
1307
|
var where = [];
|
|
@@ -1334,7 +1321,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1334
1321
|
if (source.where)
|
|
1335
1322
|
where.push(source.where);
|
|
1336
1323
|
try {
|
|
1337
|
-
for (var _e = (
|
|
1324
|
+
for (var _e = (e_19 = void 0, tslib_1.__values([
|
|
1338
1325
|
'limit',
|
|
1339
1326
|
'include',
|
|
1340
1327
|
'orderBy',
|
|
@@ -1346,21 +1333,21 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1346
1333
|
findOptions[key] = source[key];
|
|
1347
1334
|
}
|
|
1348
1335
|
}
|
|
1349
|
-
catch (
|
|
1336
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1350
1337
|
finally {
|
|
1351
1338
|
try {
|
|
1352
1339
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1353
1340
|
}
|
|
1354
|
-
finally { if (
|
|
1341
|
+
finally { if (e_19) throw e_19.error; }
|
|
1355
1342
|
}
|
|
1356
1343
|
}
|
|
1357
1344
|
}
|
|
1358
|
-
catch (
|
|
1345
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1359
1346
|
finally {
|
|
1360
1347
|
try {
|
|
1361
1348
|
if (findOptionsSources_1_1 && !findOptionsSources_1_1.done && (_a = findOptionsSources_1.return)) _a.call(findOptionsSources_1);
|
|
1362
1349
|
}
|
|
1363
|
-
finally { if (
|
|
1350
|
+
finally { if (e_18) throw e_18.error; }
|
|
1364
1351
|
}
|
|
1365
1352
|
var relFields = rel.getFields();
|
|
1366
1353
|
var getFieldValue = function (key) {
|
|
@@ -1438,7 +1425,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1438
1425
|
return this.getEntityRef(item).toApiJson(true);
|
|
1439
1426
|
};
|
|
1440
1427
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
1441
|
-
var
|
|
1428
|
+
var e_20, _a;
|
|
1442
1429
|
var _this = this;
|
|
1443
1430
|
if (json === null || json === undefined)
|
|
1444
1431
|
return json;
|
|
@@ -1464,12 +1451,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1464
1451
|
}
|
|
1465
1452
|
}
|
|
1466
1453
|
}
|
|
1467
|
-
catch (
|
|
1454
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1468
1455
|
finally {
|
|
1469
1456
|
try {
|
|
1470
1457
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1471
1458
|
}
|
|
1472
|
-
finally { if (
|
|
1459
|
+
finally { if (e_20) throw e_20.error; }
|
|
1473
1460
|
}
|
|
1474
1461
|
this._fixTypes(result);
|
|
1475
1462
|
if (newRow) {
|
|
@@ -1502,9 +1489,9 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1502
1489
|
};
|
|
1503
1490
|
RepositoryImplementation.prototype.deleteMany = function (_a) {
|
|
1504
1491
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
1505
|
-
var _c, _d, _e, prepared, _f, _g, _h, item, ref, _j, _k, _l,
|
|
1506
|
-
var
|
|
1507
|
-
var _o,
|
|
1492
|
+
var _c, _d, _e, prepared, _f, _g, _h, item, ref, _j, _k, _l, e_21_1, ids, prepared_1, prepared_1_1, x, e_22_1;
|
|
1493
|
+
var e_22, _m;
|
|
1494
|
+
var _o, e_21, _p, _q;
|
|
1508
1495
|
var where = _b.where;
|
|
1509
1496
|
return tslib_1.__generator(this, function (_r) {
|
|
1510
1497
|
switch (_r.label) {
|
|
@@ -1547,8 +1534,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1547
1534
|
return [3 /*break*/, 6];
|
|
1548
1535
|
case 10: return [3 /*break*/, 17];
|
|
1549
1536
|
case 11:
|
|
1550
|
-
|
|
1551
|
-
|
|
1537
|
+
e_21_1 = _r.sent();
|
|
1538
|
+
e_21 = { error: e_21_1 };
|
|
1552
1539
|
return [3 /*break*/, 17];
|
|
1553
1540
|
case 12:
|
|
1554
1541
|
_r.trys.push([12, , 15, 16]);
|
|
@@ -1559,7 +1546,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1559
1546
|
_r.label = 14;
|
|
1560
1547
|
case 14: return [3 /*break*/, 16];
|
|
1561
1548
|
case 15:
|
|
1562
|
-
if (
|
|
1549
|
+
if (e_21) throw e_21.error;
|
|
1563
1550
|
return [7 /*endfinally*/];
|
|
1564
1551
|
case 16: return [7 /*endfinally*/];
|
|
1565
1552
|
case 17:
|
|
@@ -1585,14 +1572,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1585
1572
|
return [3 /*break*/, 20];
|
|
1586
1573
|
case 23: return [3 /*break*/, 26];
|
|
1587
1574
|
case 24:
|
|
1588
|
-
|
|
1589
|
-
|
|
1575
|
+
e_22_1 = _r.sent();
|
|
1576
|
+
e_22 = { error: e_22_1 };
|
|
1590
1577
|
return [3 /*break*/, 26];
|
|
1591
1578
|
case 25:
|
|
1592
1579
|
try {
|
|
1593
1580
|
if (prepared_1_1 && !prepared_1_1.done && (_m = prepared_1.return)) _m.call(prepared_1);
|
|
1594
1581
|
}
|
|
1595
|
-
finally { if (
|
|
1582
|
+
finally { if (e_22) throw e_22.error; }
|
|
1596
1583
|
return [7 /*endfinally*/];
|
|
1597
1584
|
case 26: return [2 /*return*/, prepared.length];
|
|
1598
1585
|
}
|
|
@@ -1682,7 +1669,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1682
1669
|
return this.metadata.fields.toArray().filter(function (x) { return keys.includes(x.key); });
|
|
1683
1670
|
};
|
|
1684
1671
|
RepositoryImplementation.prototype.create = function (item) {
|
|
1685
|
-
var
|
|
1672
|
+
var e_23, _a;
|
|
1686
1673
|
var _b;
|
|
1687
1674
|
var r = new this._entity(this._remult);
|
|
1688
1675
|
if (item) {
|
|
@@ -1693,12 +1680,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1693
1680
|
r[key] = item[key];
|
|
1694
1681
|
}
|
|
1695
1682
|
}
|
|
1696
|
-
catch (
|
|
1683
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
1697
1684
|
finally {
|
|
1698
1685
|
try {
|
|
1699
1686
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1700
1687
|
}
|
|
1701
|
-
finally { if (
|
|
1688
|
+
finally { if (e_23) throw e_23.error; }
|
|
1702
1689
|
}
|
|
1703
1690
|
this._fixTypes(r);
|
|
1704
1691
|
}
|
|
@@ -1712,7 +1699,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1712
1699
|
RepositoryImplementation.prototype._fixTypes = function (item) {
|
|
1713
1700
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1714
1701
|
var _a, _b, field, val, _c, _d, _e, type, typeName;
|
|
1715
|
-
var
|
|
1702
|
+
var e_24, _f, e_25, _g;
|
|
1716
1703
|
return tslib_1.__generator(this, function (_h) {
|
|
1717
1704
|
try {
|
|
1718
1705
|
for (_a = tslib_1.__values(this._fieldsOf(item)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
@@ -1723,7 +1710,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1723
1710
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1724
1711
|
else
|
|
1725
1712
|
try {
|
|
1726
|
-
for (_c = (
|
|
1713
|
+
for (_c = (e_25 = void 0, tslib_1.__values([
|
|
1727
1714
|
[String, 'string'],
|
|
1728
1715
|
[Number, 'number'],
|
|
1729
1716
|
[Boolean, 'boolean'],
|
|
@@ -1733,22 +1720,22 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1733
1720
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1734
1721
|
}
|
|
1735
1722
|
}
|
|
1736
|
-
catch (
|
|
1723
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1737
1724
|
finally {
|
|
1738
1725
|
try {
|
|
1739
1726
|
if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
|
|
1740
1727
|
}
|
|
1741
|
-
finally { if (
|
|
1728
|
+
finally { if (e_25) throw e_25.error; }
|
|
1742
1729
|
}
|
|
1743
1730
|
}
|
|
1744
1731
|
}
|
|
1745
1732
|
}
|
|
1746
|
-
catch (
|
|
1733
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1747
1734
|
finally {
|
|
1748
1735
|
try {
|
|
1749
1736
|
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
1750
1737
|
}
|
|
1751
|
-
finally { if (
|
|
1738
|
+
finally { if (e_24) throw e_24.error; }
|
|
1752
1739
|
}
|
|
1753
1740
|
return [2 /*return*/, item];
|
|
1754
1741
|
});
|
|
@@ -1761,6 +1748,51 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1761
1748
|
throw new Error('id can be either number or string, but got: ' + typeof id);
|
|
1762
1749
|
return this.findFirst({}, tslib_1.__assign(tslib_1.__assign({}, options), { where: this.metadata.idMetadata.getIdFilter(id) }), true);
|
|
1763
1750
|
};
|
|
1751
|
+
RepositoryImplementation.prototype.findIdOrThrow = function (id, options) {
|
|
1752
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1753
|
+
var row;
|
|
1754
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1755
|
+
switch (_a.label) {
|
|
1756
|
+
case 0: return [4 /*yield*/, this.findId(id, options)];
|
|
1757
|
+
case 1:
|
|
1758
|
+
row = _a.sent();
|
|
1759
|
+
if (!row)
|
|
1760
|
+
throw new data_interfaces_js_1.EntityError(this._notFoundError(id));
|
|
1761
|
+
return [2 /*return*/, row];
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
});
|
|
1765
|
+
};
|
|
1766
|
+
RepositoryImplementation.prototype.findFirstOrThrow = function (where, options) {
|
|
1767
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1768
|
+
var row;
|
|
1769
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1770
|
+
switch (_a.label) {
|
|
1771
|
+
case 0: return [4 /*yield*/, this.findFirst(where, options)];
|
|
1772
|
+
case 1:
|
|
1773
|
+
row = _a.sent();
|
|
1774
|
+
if (!row)
|
|
1775
|
+
throw new data_interfaces_js_1.EntityError(this._noMatchError());
|
|
1776
|
+
return [2 /*return*/, row];
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
});
|
|
1780
|
+
};
|
|
1781
|
+
RepositoryImplementation.prototype.findOneOrThrow = function (options) {
|
|
1782
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1783
|
+
var row;
|
|
1784
|
+
return tslib_1.__generator(this, function (_a) {
|
|
1785
|
+
switch (_a.label) {
|
|
1786
|
+
case 0: return [4 /*yield*/, this.findOne(options)];
|
|
1787
|
+
case 1:
|
|
1788
|
+
row = _a.sent();
|
|
1789
|
+
if (!row)
|
|
1790
|
+
throw new data_interfaces_js_1.EntityError(this._noMatchError());
|
|
1791
|
+
return [2 /*return*/, row];
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
});
|
|
1795
|
+
};
|
|
1764
1796
|
RepositoryImplementation.prototype._translateWhereToFilter = function (where) {
|
|
1765
1797
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1766
1798
|
var safeWhere, z, z, _a, r;
|
|
@@ -1824,8 +1856,8 @@ function createOldEntity(entity, remult) {
|
|
|
1824
1856
|
var info = (0, getEntityRef_js_1.getEntitySettings)(entity)(remult);
|
|
1825
1857
|
var key = (0, getEntityRef_js_1.getEntityKey)(entity);
|
|
1826
1858
|
var base = Object.getPrototypeOf(entity);
|
|
1827
|
-
var
|
|
1828
|
-
var
|
|
1859
|
+
var _loop_4 = function () {
|
|
1860
|
+
var e_26, _a;
|
|
1829
1861
|
var baseCols = remult_static_js_1.remultStatic.columnsOfType.get(base);
|
|
1830
1862
|
if (baseCols) {
|
|
1831
1863
|
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));
|
|
@@ -1841,7 +1873,7 @@ function createOldEntity(entity, remult) {
|
|
|
1841
1873
|
'deleted',
|
|
1842
1874
|
'validation',
|
|
1843
1875
|
];
|
|
1844
|
-
var
|
|
1876
|
+
var _loop_5 = function (key_1) {
|
|
1845
1877
|
if (baseSettings_1[key_1] && baseSettings_1[key_1] !== info[key_1]) {
|
|
1846
1878
|
var x_1 = info[key_1];
|
|
1847
1879
|
//@ts-ignore
|
|
@@ -1868,29 +1900,29 @@ function createOldEntity(entity, remult) {
|
|
|
1868
1900
|
}
|
|
1869
1901
|
};
|
|
1870
1902
|
try {
|
|
1871
|
-
for (var functions_1 = (
|
|
1903
|
+
for (var functions_1 = (e_26 = void 0, tslib_1.__values(functions)), functions_1_1 = functions_1.next(); !functions_1_1.done; functions_1_1 = functions_1.next()) {
|
|
1872
1904
|
var key_1 = functions_1_1.value;
|
|
1873
|
-
|
|
1905
|
+
_loop_5(key_1);
|
|
1874
1906
|
}
|
|
1875
1907
|
}
|
|
1876
|
-
catch (
|
|
1908
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
1877
1909
|
finally {
|
|
1878
1910
|
try {
|
|
1879
1911
|
if (functions_1_1 && !functions_1_1.done && (_a = functions_1.return)) _a.call(functions_1);
|
|
1880
1912
|
}
|
|
1881
|
-
finally { if (
|
|
1913
|
+
finally { if (e_26) throw e_26.error; }
|
|
1882
1914
|
}
|
|
1883
1915
|
}
|
|
1884
1916
|
base = Object.getPrototypeOf(base);
|
|
1885
1917
|
};
|
|
1886
1918
|
while (base != null) {
|
|
1887
|
-
|
|
1919
|
+
_loop_4();
|
|
1888
1920
|
}
|
|
1889
1921
|
return new EntityFullInfo(prepareColumnInfo(r, remult), info, remult, entity, key);
|
|
1890
1922
|
}
|
|
1891
1923
|
var rowHelperBase = /** @class */ (function () {
|
|
1892
1924
|
function rowHelperBase(fieldsMetadata, instance, remult, isNewRow, excludeRelationMembers) {
|
|
1893
|
-
var
|
|
1925
|
+
var e_27, _a;
|
|
1894
1926
|
var _this = this;
|
|
1895
1927
|
this.fieldsMetadata = fieldsMetadata;
|
|
1896
1928
|
this.instance = instance;
|
|
@@ -1905,7 +1937,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1905
1937
|
remult = remult_static_js_1.remultStatic.remultFactory();
|
|
1906
1938
|
}
|
|
1907
1939
|
}
|
|
1908
|
-
var
|
|
1940
|
+
var _loop_6 = function (col) {
|
|
1909
1941
|
var ei = (0, getEntityRef_js_1.getEntitySettings)(col.valueType, false);
|
|
1910
1942
|
if (ei && remult) {
|
|
1911
1943
|
var lookup_1 = new column_js_1.LookupColumn(remult.repo(col.valueType), Boolean((0, relationInfoMember_js_1.getRelationFieldInfo)(col)), col.allowNull);
|
|
@@ -1983,15 +2015,15 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1983
2015
|
try {
|
|
1984
2016
|
for (var fieldsMetadata_1 = tslib_1.__values(fieldsMetadata), fieldsMetadata_1_1 = fieldsMetadata_1.next(); !fieldsMetadata_1_1.done; fieldsMetadata_1_1 = fieldsMetadata_1.next()) {
|
|
1985
2017
|
var col = fieldsMetadata_1_1.value;
|
|
1986
|
-
|
|
2018
|
+
_loop_6(col);
|
|
1987
2019
|
}
|
|
1988
2020
|
}
|
|
1989
|
-
catch (
|
|
2021
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
1990
2022
|
finally {
|
|
1991
2023
|
try {
|
|
1992
2024
|
if (fieldsMetadata_1_1 && !fieldsMetadata_1_1.done && (_a = fieldsMetadata_1.return)) _a.call(fieldsMetadata_1);
|
|
1993
2025
|
}
|
|
1994
|
-
finally { if (
|
|
2026
|
+
finally { if (e_27) throw e_27.error; }
|
|
1995
2027
|
}
|
|
1996
2028
|
}
|
|
1997
2029
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -2013,11 +2045,11 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2013
2045
|
return this._subscribers.subscribe(listener);
|
|
2014
2046
|
};
|
|
2015
2047
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
2016
|
-
var
|
|
2048
|
+
var e_28, _a;
|
|
2017
2049
|
if (!this._subscribers) {
|
|
2018
2050
|
this._subscribers = new SubscribableImp_js_1.SubscribableImp();
|
|
2019
2051
|
var safeSubscribers_1 = this._subscribers;
|
|
2020
|
-
var
|
|
2052
|
+
var _loop_7 = function (col) {
|
|
2021
2053
|
var ei = (0, getEntityRef_js_1.getEntitySettings)(col.valueType, false);
|
|
2022
2054
|
var refImpl = this_3.fields.find(col.key);
|
|
2023
2055
|
refImpl._subscribers = new SubscribableImp_js_1.SubscribableImp();
|
|
@@ -2044,15 +2076,15 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2044
2076
|
try {
|
|
2045
2077
|
for (var _b = tslib_1.__values(this.fieldsMetadata), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2046
2078
|
var col = _c.value;
|
|
2047
|
-
|
|
2079
|
+
_loop_7(col);
|
|
2048
2080
|
}
|
|
2049
2081
|
}
|
|
2050
|
-
catch (
|
|
2082
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
2051
2083
|
finally {
|
|
2052
2084
|
try {
|
|
2053
2085
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2054
2086
|
}
|
|
2055
|
-
finally { if (
|
|
2087
|
+
finally { if (e_28) throw e_28.error; }
|
|
2056
2088
|
}
|
|
2057
2089
|
}
|
|
2058
2090
|
};
|
|
@@ -2087,7 +2119,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2087
2119
|
throw this.buildErrorInfoObject();
|
|
2088
2120
|
};
|
|
2089
2121
|
rowHelperBase.prototype.buildErrorInfoObject = function () {
|
|
2090
|
-
var
|
|
2122
|
+
var e_29, _a;
|
|
2091
2123
|
var _b;
|
|
2092
2124
|
var error = {
|
|
2093
2125
|
modelState: Object.assign({}, this.errors),
|
|
@@ -2107,12 +2139,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2107
2139
|
}
|
|
2108
2140
|
}
|
|
2109
2141
|
}
|
|
2110
|
-
catch (
|
|
2142
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
2111
2143
|
finally {
|
|
2112
2144
|
try {
|
|
2113
2145
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2114
2146
|
}
|
|
2115
|
-
finally { if (
|
|
2147
|
+
finally { if (e_29) throw e_29.error; }
|
|
2116
2148
|
}
|
|
2117
2149
|
}
|
|
2118
2150
|
return new data_interfaces_js_1.EntityError(error);
|
|
@@ -2146,7 +2178,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2146
2178
|
this._reportChangedToEntityAndFields();
|
|
2147
2179
|
};
|
|
2148
2180
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
2149
|
-
var
|
|
2181
|
+
var e_30, _a;
|
|
2150
2182
|
if (this._subscribers) {
|
|
2151
2183
|
this._subscribers.reportChanged();
|
|
2152
2184
|
try {
|
|
@@ -2156,12 +2188,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2156
2188
|
ref._subscribers.reportChanged();
|
|
2157
2189
|
}
|
|
2158
2190
|
}
|
|
2159
|
-
catch (
|
|
2191
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
2160
2192
|
finally {
|
|
2161
2193
|
try {
|
|
2162
2194
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2163
2195
|
}
|
|
2164
|
-
finally { if (
|
|
2196
|
+
finally { if (e_30) throw e_30.error; }
|
|
2165
2197
|
}
|
|
2166
2198
|
}
|
|
2167
2199
|
};
|
|
@@ -2171,7 +2203,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2171
2203
|
return !!!this.error && this.errors == undefined;
|
|
2172
2204
|
};
|
|
2173
2205
|
rowHelperBase.prototype.copyDataToObject = function (isNew) {
|
|
2174
|
-
var
|
|
2206
|
+
var e_31, _a;
|
|
2175
2207
|
if (isNew === void 0) { isNew = false; }
|
|
2176
2208
|
var d = {};
|
|
2177
2209
|
try {
|
|
@@ -2203,12 +2235,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2203
2235
|
}
|
|
2204
2236
|
}
|
|
2205
2237
|
}
|
|
2206
|
-
catch (
|
|
2238
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2207
2239
|
finally {
|
|
2208
2240
|
try {
|
|
2209
2241
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2210
2242
|
}
|
|
2211
|
-
finally { if (
|
|
2243
|
+
finally { if (e_31) throw e_31.error; }
|
|
2212
2244
|
}
|
|
2213
2245
|
return d;
|
|
2214
2246
|
};
|
|
@@ -2268,7 +2300,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2268
2300
|
}); });
|
|
2269
2301
|
};
|
|
2270
2302
|
rowHelperBase.prototype.toApiJson = function (includeRelatedEntities, notJustApi) {
|
|
2271
|
-
var
|
|
2303
|
+
var e_32, _a;
|
|
2272
2304
|
var _b;
|
|
2273
2305
|
if (includeRelatedEntities === void 0) { includeRelatedEntities = false; }
|
|
2274
2306
|
if (notJustApi === void 0) { notJustApi = false; }
|
|
@@ -2314,19 +2346,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2314
2346
|
}
|
|
2315
2347
|
}
|
|
2316
2348
|
}
|
|
2317
|
-
catch (
|
|
2349
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2318
2350
|
finally {
|
|
2319
2351
|
try {
|
|
2320
2352
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2321
2353
|
}
|
|
2322
|
-
finally { if (
|
|
2354
|
+
finally { if (e_32) throw e_32.error; }
|
|
2323
2355
|
}
|
|
2324
2356
|
return result;
|
|
2325
2357
|
};
|
|
2326
2358
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body_1) {
|
|
2327
2359
|
return tslib_1.__awaiter(this, arguments, void 0, function (body, ignoreApiAllowed) {
|
|
2328
2360
|
var keys, _a, _b, col, lu;
|
|
2329
|
-
var
|
|
2361
|
+
var e_33, _c;
|
|
2330
2362
|
if (ignoreApiAllowed === void 0) { ignoreApiAllowed = false; }
|
|
2331
2363
|
return tslib_1.__generator(this, function (_d) {
|
|
2332
2364
|
switch (_d.label) {
|
|
@@ -2349,12 +2381,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2349
2381
|
}
|
|
2350
2382
|
}
|
|
2351
2383
|
}
|
|
2352
|
-
catch (
|
|
2384
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2353
2385
|
finally {
|
|
2354
2386
|
try {
|
|
2355
2387
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2356
2388
|
}
|
|
2357
|
-
finally { if (
|
|
2389
|
+
finally { if (e_33) throw e_33.error; }
|
|
2358
2390
|
}
|
|
2359
2391
|
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(); })];
|
|
2360
2392
|
case 1:
|
|
@@ -2369,7 +2401,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2369
2401
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
2370
2402
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
2371
2403
|
function rowHelperImplementation(info, instance, repo, edp, remult, _isNew, excludeRelationMembers) {
|
|
2372
|
-
var
|
|
2404
|
+
var e_34, _a;
|
|
2373
2405
|
var _this = _super.call(this, info.fieldsMetadata, instance, remult, _isNew, excludeRelationMembers) || this;
|
|
2374
2406
|
_this.info = info;
|
|
2375
2407
|
_this.repo = repo;
|
|
@@ -2393,12 +2425,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2393
2425
|
}
|
|
2394
2426
|
}
|
|
2395
2427
|
}
|
|
2396
|
-
catch (
|
|
2428
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2397
2429
|
finally {
|
|
2398
2430
|
try {
|
|
2399
2431
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2400
2432
|
}
|
|
2401
|
-
finally { if (
|
|
2433
|
+
finally { if (e_34) throw e_34.error; }
|
|
2402
2434
|
}
|
|
2403
2435
|
}
|
|
2404
2436
|
if (_this.info.entityInfo.entityRefInit)
|
|
@@ -2518,7 +2550,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2518
2550
|
};
|
|
2519
2551
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
2520
2552
|
get: function () {
|
|
2521
|
-
var _a,
|
|
2553
|
+
var _a, e_35, _b;
|
|
2522
2554
|
if (!this._columns) {
|
|
2523
2555
|
var _items_1 = [];
|
|
2524
2556
|
var r_1 = (_a = {
|
|
@@ -2539,12 +2571,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2539
2571
|
(r_1[c.key] = new FieldRefImplementation(c.options, c, this.instance, this, this)));
|
|
2540
2572
|
}
|
|
2541
2573
|
}
|
|
2542
|
-
catch (
|
|
2574
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
2543
2575
|
finally {
|
|
2544
2576
|
try {
|
|
2545
2577
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
2546
2578
|
}
|
|
2547
|
-
finally { if (
|
|
2579
|
+
finally { if (e_35) throw e_35.error; }
|
|
2548
2580
|
}
|
|
2549
2581
|
this._columns = r_1;
|
|
2550
2582
|
}
|
|
@@ -2555,8 +2587,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2555
2587
|
});
|
|
2556
2588
|
rowHelperImplementation.prototype.save = function (options, onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject) {
|
|
2557
2589
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2558
|
-
var doNotSave_1, e, _a, _b, col,
|
|
2559
|
-
var
|
|
2590
|
+
var doNotSave_1, e, _a, _b, col, e_36_1, d, ignoreKeys, _c, _d, field, f, updatedRow, isNew, _e, _f, changesOnly, wasChanged, key, element, _g, _h, _j, _k, listener, e_37_1, err_1;
|
|
2591
|
+
var e_36, _l, e_38, _m, _o, _p, e_37, _q;
|
|
2560
2592
|
var _r, _s;
|
|
2561
2593
|
return tslib_1.__generator(this, function (_t) {
|
|
2562
2594
|
switch (_t.label) {
|
|
@@ -2598,14 +2630,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2598
2630
|
return [3 /*break*/, 4];
|
|
2599
2631
|
case 7: return [3 /*break*/, 10];
|
|
2600
2632
|
case 8:
|
|
2601
|
-
|
|
2602
|
-
|
|
2633
|
+
e_36_1 = _t.sent();
|
|
2634
|
+
e_36 = { error: e_36_1 };
|
|
2603
2635
|
return [3 /*break*/, 10];
|
|
2604
2636
|
case 9:
|
|
2605
2637
|
try {
|
|
2606
2638
|
if (_b && !_b.done && (_l = _a.return)) _l.call(_a);
|
|
2607
2639
|
}
|
|
2608
|
-
finally { if (
|
|
2640
|
+
finally { if (e_36) throw e_36.error; }
|
|
2609
2641
|
return [7 /*endfinally*/];
|
|
2610
2642
|
case 10:
|
|
2611
2643
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 12];
|
|
@@ -2631,12 +2663,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2631
2663
|
}
|
|
2632
2664
|
}
|
|
2633
2665
|
}
|
|
2634
|
-
catch (
|
|
2666
|
+
catch (e_38_1) { e_38 = { error: e_38_1 }; }
|
|
2635
2667
|
finally {
|
|
2636
2668
|
try {
|
|
2637
2669
|
if (_d && !_d.done && (_m = _c.return)) _m.call(_c);
|
|
2638
2670
|
}
|
|
2639
|
-
finally { if (
|
|
2671
|
+
finally { if (e_38) throw e_38.error; }
|
|
2640
2672
|
}
|
|
2641
2673
|
updatedRow = void 0;
|
|
2642
2674
|
isNew = this.isNew();
|
|
@@ -2725,14 +2757,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2725
2757
|
return [3 /*break*/, 31];
|
|
2726
2758
|
case 34: return [3 /*break*/, 37];
|
|
2727
2759
|
case 35:
|
|
2728
|
-
|
|
2729
|
-
|
|
2760
|
+
e_37_1 = _t.sent();
|
|
2761
|
+
e_37 = { error: e_37_1 };
|
|
2730
2762
|
return [3 /*break*/, 37];
|
|
2731
2763
|
case 36:
|
|
2732
2764
|
try {
|
|
2733
2765
|
if (_k && !_k.done && (_q = _j.return)) _q.call(_j);
|
|
2734
2766
|
}
|
|
2735
|
-
finally { if (
|
|
2767
|
+
finally { if (e_37) throw e_37.error; }
|
|
2736
2768
|
return [7 /*endfinally*/];
|
|
2737
2769
|
case 37:
|
|
2738
2770
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2756,8 +2788,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2756
2788
|
};
|
|
2757
2789
|
rowHelperImplementation.prototype.processInsertResponseDto = function (updatedRow) {
|
|
2758
2790
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2759
|
-
var e, _a, _b, listener,
|
|
2760
|
-
var
|
|
2791
|
+
var e, _a, _b, listener, e_39_1, err_2;
|
|
2792
|
+
var e_39, _c;
|
|
2761
2793
|
var _d;
|
|
2762
2794
|
return tslib_1.__generator(this, function (_e) {
|
|
2763
2795
|
switch (_e.label) {
|
|
@@ -2796,14 +2828,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2796
2828
|
return [3 /*break*/, 6];
|
|
2797
2829
|
case 9: return [3 /*break*/, 12];
|
|
2798
2830
|
case 10:
|
|
2799
|
-
|
|
2800
|
-
|
|
2831
|
+
e_39_1 = _e.sent();
|
|
2832
|
+
e_39 = { error: e_39_1 };
|
|
2801
2833
|
return [3 /*break*/, 12];
|
|
2802
2834
|
case 11:
|
|
2803
2835
|
try {
|
|
2804
2836
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2805
2837
|
}
|
|
2806
|
-
finally { if (
|
|
2838
|
+
finally { if (e_39) throw e_39.error; }
|
|
2807
2839
|
return [7 /*endfinally*/];
|
|
2808
2840
|
case 12:
|
|
2809
2841
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2821,8 +2853,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2821
2853
|
};
|
|
2822
2854
|
rowHelperImplementation.prototype.buildDtoForInsert = function () {
|
|
2823
2855
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2824
|
-
var skip, e, _a, _b, col,
|
|
2825
|
-
var
|
|
2856
|
+
var skip, e, _a, _b, col, e_40_1, d, _c, _d, field, f;
|
|
2857
|
+
var e_40, _e, e_41, _f;
|
|
2826
2858
|
return tslib_1.__generator(this, function (_g) {
|
|
2827
2859
|
switch (_g.label) {
|
|
2828
2860
|
case 0: return [4 /*yield*/, this.__validateEntity()];
|
|
@@ -2851,14 +2883,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2851
2883
|
return [3 /*break*/, 3];
|
|
2852
2884
|
case 6: return [3 /*break*/, 9];
|
|
2853
2885
|
case 7:
|
|
2854
|
-
|
|
2855
|
-
|
|
2886
|
+
e_40_1 = _g.sent();
|
|
2887
|
+
e_40 = { error: e_40_1 };
|
|
2856
2888
|
return [3 /*break*/, 9];
|
|
2857
2889
|
case 8:
|
|
2858
2890
|
try {
|
|
2859
2891
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2860
2892
|
}
|
|
2861
|
-
finally { if (
|
|
2893
|
+
finally { if (e_40) throw e_40.error; }
|
|
2862
2894
|
return [7 /*endfinally*/];
|
|
2863
2895
|
case 9:
|
|
2864
2896
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
@@ -2879,12 +2911,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2879
2911
|
}
|
|
2880
2912
|
}
|
|
2881
2913
|
}
|
|
2882
|
-
catch (
|
|
2914
|
+
catch (e_41_1) { e_41 = { error: e_41_1 }; }
|
|
2883
2915
|
finally {
|
|
2884
2916
|
try {
|
|
2885
2917
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
2886
2918
|
}
|
|
2887
|
-
finally { if (
|
|
2919
|
+
finally { if (e_41) throw e_41.error; }
|
|
2888
2920
|
}
|
|
2889
2921
|
if (skip)
|
|
2890
2922
|
return [2 /*return*/, null];
|
|
@@ -2973,8 +3005,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2973
3005
|
//@internal
|
|
2974
3006
|
rowHelperImplementation.prototype.__finishDelete = function (e) {
|
|
2975
3007
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2976
|
-
var _a, _b, listener,
|
|
2977
|
-
var
|
|
3008
|
+
var _a, _b, listener, e_42_1;
|
|
3009
|
+
var e_42, _c;
|
|
2978
3010
|
var _d;
|
|
2979
3011
|
return tslib_1.__generator(this, function (_e) {
|
|
2980
3012
|
switch (_e.label) {
|
|
@@ -3004,14 +3036,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3004
3036
|
return [3 /*break*/, 4];
|
|
3005
3037
|
case 7: return [3 /*break*/, 10];
|
|
3006
3038
|
case 8:
|
|
3007
|
-
|
|
3008
|
-
|
|
3039
|
+
e_42_1 = _e.sent();
|
|
3040
|
+
e_42 = { error: e_42_1 };
|
|
3009
3041
|
return [3 /*break*/, 10];
|
|
3010
3042
|
case 9:
|
|
3011
3043
|
try {
|
|
3012
3044
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3013
3045
|
}
|
|
3014
|
-
finally { if (
|
|
3046
|
+
finally { if (e_42) throw e_42.error; }
|
|
3015
3047
|
return [7 /*endfinally*/];
|
|
3016
3048
|
case 10:
|
|
3017
3049
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [
|
|
@@ -3025,8 +3057,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3025
3057
|
};
|
|
3026
3058
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
3027
3059
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3028
|
-
var _a, _b, col, lu,
|
|
3029
|
-
var
|
|
3060
|
+
var _a, _b, col, lu, e_43_1;
|
|
3061
|
+
var e_43, _c;
|
|
3030
3062
|
return tslib_1.__generator(this, function (_d) {
|
|
3031
3063
|
switch (_d.label) {
|
|
3032
3064
|
case 0:
|
|
@@ -3067,14 +3099,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3067
3099
|
return [3 /*break*/, 1];
|
|
3068
3100
|
case 9: return [3 /*break*/, 12];
|
|
3069
3101
|
case 10:
|
|
3070
|
-
|
|
3071
|
-
|
|
3102
|
+
e_43_1 = _d.sent();
|
|
3103
|
+
e_43 = { error: e_43_1 };
|
|
3072
3104
|
return [3 /*break*/, 12];
|
|
3073
3105
|
case 11:
|
|
3074
3106
|
try {
|
|
3075
3107
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3076
3108
|
}
|
|
3077
|
-
finally { if (
|
|
3109
|
+
finally { if (e_43) throw e_43.error; }
|
|
3078
3110
|
return [7 /*endfinally*/];
|
|
3079
3111
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
3080
3112
|
case 13:
|
|
@@ -3090,8 +3122,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3090
3122
|
};
|
|
3091
3123
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
3092
3124
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3093
|
-
var _a, _b, col, result,
|
|
3094
|
-
var
|
|
3125
|
+
var _a, _b, col, result, e_44_1;
|
|
3126
|
+
var e_44, _c;
|
|
3095
3127
|
var _d;
|
|
3096
3128
|
return tslib_1.__generator(this, function (_e) {
|
|
3097
3129
|
switch (_e.label) {
|
|
@@ -3118,14 +3150,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3118
3150
|
return [3 /*break*/, 2];
|
|
3119
3151
|
case 5: return [3 /*break*/, 8];
|
|
3120
3152
|
case 6:
|
|
3121
|
-
|
|
3122
|
-
|
|
3153
|
+
e_44_1 = _e.sent();
|
|
3154
|
+
e_44 = { error: e_44_1 };
|
|
3123
3155
|
return [3 /*break*/, 8];
|
|
3124
3156
|
case 7:
|
|
3125
3157
|
try {
|
|
3126
3158
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3127
3159
|
}
|
|
3128
|
-
finally { if (
|
|
3160
|
+
finally { if (e_44) throw e_44.error; }
|
|
3129
3161
|
return [7 /*endfinally*/];
|
|
3130
3162
|
case 8: return [2 /*return*/];
|
|
3131
3163
|
}
|
|
@@ -3138,7 +3170,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3138
3170
|
return this._isNew;
|
|
3139
3171
|
};
|
|
3140
3172
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
3141
|
-
var
|
|
3173
|
+
var e_45, _a;
|
|
3142
3174
|
var _b;
|
|
3143
3175
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
3144
3176
|
try {
|
|
@@ -3150,19 +3182,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3150
3182
|
return true;
|
|
3151
3183
|
}
|
|
3152
3184
|
}
|
|
3153
|
-
catch (
|
|
3185
|
+
catch (e_45_1) { e_45 = { error: e_45_1 }; }
|
|
3154
3186
|
finally {
|
|
3155
3187
|
try {
|
|
3156
3188
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3157
3189
|
}
|
|
3158
|
-
finally { if (
|
|
3190
|
+
finally { if (e_45) throw e_45.error; }
|
|
3159
3191
|
}
|
|
3160
3192
|
return false;
|
|
3161
3193
|
};
|
|
3162
3194
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
3163
3195
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3164
|
-
var _a, _b, c, col,
|
|
3165
|
-
var
|
|
3196
|
+
var _a, _b, c, col, e_46_1, e, _c, _d, listener, e_47_1;
|
|
3197
|
+
var e_46, _e, e_47, _f;
|
|
3166
3198
|
var _g;
|
|
3167
3199
|
return tslib_1.__generator(this, function (_h) {
|
|
3168
3200
|
switch (_h.label) {
|
|
@@ -3184,14 +3216,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3184
3216
|
return [3 /*break*/, 1];
|
|
3185
3217
|
case 4: return [3 /*break*/, 7];
|
|
3186
3218
|
case 5:
|
|
3187
|
-
|
|
3188
|
-
|
|
3219
|
+
e_46_1 = _h.sent();
|
|
3220
|
+
e_46 = { error: e_46_1 };
|
|
3189
3221
|
return [3 /*break*/, 7];
|
|
3190
3222
|
case 6:
|
|
3191
3223
|
try {
|
|
3192
3224
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3193
3225
|
}
|
|
3194
|
-
finally { if (
|
|
3226
|
+
finally { if (e_46) throw e_46.error; }
|
|
3195
3227
|
return [7 /*endfinally*/];
|
|
3196
3228
|
case 7:
|
|
3197
3229
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -3219,14 +3251,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3219
3251
|
return [3 /*break*/, 11];
|
|
3220
3252
|
case 14: return [3 /*break*/, 17];
|
|
3221
3253
|
case 15:
|
|
3222
|
-
|
|
3223
|
-
|
|
3254
|
+
e_47_1 = _h.sent();
|
|
3255
|
+
e_47 = { error: e_47_1 };
|
|
3224
3256
|
return [3 /*break*/, 17];
|
|
3225
3257
|
case 16:
|
|
3226
3258
|
try {
|
|
3227
3259
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
3228
3260
|
}
|
|
3229
|
-
finally { if (
|
|
3261
|
+
finally { if (e_47) throw e_47.error; }
|
|
3230
3262
|
return [7 /*endfinally*/];
|
|
3231
3263
|
case 17: return [2 /*return*/];
|
|
3232
3264
|
}
|
|
@@ -3273,7 +3305,7 @@ function getControllerRef(container, remultArg) {
|
|
|
3273
3305
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
3274
3306
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
3275
3307
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
3276
|
-
var _a,
|
|
3308
|
+
var _a, e_48, _b;
|
|
3277
3309
|
var _this = _super.call(this, columnsInfo, instance, remult, false) || this;
|
|
3278
3310
|
var _items = [];
|
|
3279
3311
|
var r = (_a = {
|
|
@@ -3290,20 +3322,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3290
3322
|
_items.push((r[col.key] = new FieldRefImplementation(col.options, col, instance, undefined, _this)));
|
|
3291
3323
|
}
|
|
3292
3324
|
}
|
|
3293
|
-
catch (
|
|
3325
|
+
catch (e_48_1) { e_48 = { error: e_48_1 }; }
|
|
3294
3326
|
finally {
|
|
3295
3327
|
try {
|
|
3296
3328
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_b = columnsInfo_1.return)) _b.call(columnsInfo_1);
|
|
3297
3329
|
}
|
|
3298
|
-
finally { if (
|
|
3330
|
+
finally { if (e_48) throw e_48.error; }
|
|
3299
3331
|
}
|
|
3300
3332
|
_this.fields = r;
|
|
3301
3333
|
return _this;
|
|
3302
3334
|
}
|
|
3303
3335
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
3304
3336
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3305
|
-
var _a, _b, col,
|
|
3306
|
-
var
|
|
3337
|
+
var _a, _b, col, e_49_1;
|
|
3338
|
+
var e_49, _c;
|
|
3307
3339
|
return tslib_1.__generator(this, function (_d) {
|
|
3308
3340
|
switch (_d.label) {
|
|
3309
3341
|
case 0:
|
|
@@ -3323,14 +3355,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3323
3355
|
return [3 /*break*/, 1];
|
|
3324
3356
|
case 4: return [3 /*break*/, 7];
|
|
3325
3357
|
case 5:
|
|
3326
|
-
|
|
3327
|
-
|
|
3358
|
+
e_49_1 = _d.sent();
|
|
3359
|
+
e_49 = { error: e_49_1 };
|
|
3328
3360
|
return [3 /*break*/, 7];
|
|
3329
3361
|
case 6:
|
|
3330
3362
|
try {
|
|
3331
3363
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3332
3364
|
}
|
|
3333
|
-
finally { if (
|
|
3365
|
+
finally { if (e_49) throw e_49.error; }
|
|
3334
3366
|
return [7 /*endfinally*/];
|
|
3335
3367
|
case 7: return [2 /*return*/];
|
|
3336
3368
|
}
|
|
@@ -3527,8 +3559,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3527
3559
|
};
|
|
3528
3560
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
3529
3561
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3530
|
-
var processValidation, self_1, event_2, _a, _b, v, _c,
|
|
3531
|
-
var
|
|
3562
|
+
var processValidation, self_1, event_2, _a, _b, v, _c, e_50_1, _d, error_1;
|
|
3563
|
+
var e_50, _e;
|
|
3532
3564
|
var _this = this;
|
|
3533
3565
|
var _f, _g;
|
|
3534
3566
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -3582,14 +3614,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3582
3614
|
return [3 /*break*/, 2];
|
|
3583
3615
|
case 5: return [3 /*break*/, 8];
|
|
3584
3616
|
case 6:
|
|
3585
|
-
|
|
3586
|
-
|
|
3617
|
+
e_50_1 = _h.sent();
|
|
3618
|
+
e_50 = { error: e_50_1 };
|
|
3587
3619
|
return [3 /*break*/, 8];
|
|
3588
3620
|
case 7:
|
|
3589
3621
|
try {
|
|
3590
3622
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3591
3623
|
}
|
|
3592
|
-
finally { if (
|
|
3624
|
+
finally { if (e_50) throw e_50.error; }
|
|
3593
3625
|
return [7 /*endfinally*/];
|
|
3594
3626
|
case 8: return [3 /*break*/, 11];
|
|
3595
3627
|
case 9:
|
|
@@ -3653,10 +3685,24 @@ function buildLabel(label, key, remult, metaData) {
|
|
|
3653
3685
|
return (0, column_js_1.makeTitle)(key);
|
|
3654
3686
|
return '';
|
|
3655
3687
|
}
|
|
3688
|
+
/** Migrations give the column a default value (`''`, `0`, `false`), so it is `not null`. */
|
|
3689
|
+
function hasColumnDefault(_a) {
|
|
3690
|
+
var valueType = _a.valueType, valueConverter = _a.valueConverter;
|
|
3691
|
+
if (valueType === Number || valueType === Boolean)
|
|
3692
|
+
return true;
|
|
3693
|
+
if (valueType === Date)
|
|
3694
|
+
return false;
|
|
3695
|
+
// A relation id is an integer or a string, and its fieldTypeInDb would load the related entity.
|
|
3696
|
+
if ((0, getEntityRef_js_1.getEntitySettings)(valueType, false))
|
|
3697
|
+
return true;
|
|
3698
|
+
var type = valueConverter === null || valueConverter === void 0 ? void 0 : valueConverter.fieldTypeInDb;
|
|
3699
|
+
// None is a string column, default ''. `dbid` is a Mongo ObjectId marker, not a column type.
|
|
3700
|
+
return !type || type === 'dbid' || type === 'integer';
|
|
3701
|
+
}
|
|
3656
3702
|
var columnDefsImpl = /** @class */ (function () {
|
|
3657
3703
|
function columnDefsImpl(settings, entityDefs, remult) {
|
|
3658
3704
|
var _this = this;
|
|
3659
|
-
var _a, _b;
|
|
3705
|
+
var _a, _b, _c;
|
|
3660
3706
|
this.settings = settings;
|
|
3661
3707
|
this.entityDefs = entityDefs;
|
|
3662
3708
|
this.remult = remult;
|
|
@@ -3691,7 +3737,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3691
3737
|
return result;
|
|
3692
3738
|
},
|
|
3693
3739
|
});
|
|
3694
|
-
this.allowNull =
|
|
3740
|
+
this.allowNull = (_b = this.settings.allowNull) !== null && _b !== void 0 ? _b : !hasColumnDefault(settings);
|
|
3695
3741
|
this.valueType = this.settings.valueType;
|
|
3696
3742
|
this.key = this.settings.key;
|
|
3697
3743
|
this.inputType = this.settings.inputType;
|
|
@@ -3704,7 +3750,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3704
3750
|
this.dbName = settings.dbName;
|
|
3705
3751
|
if (this.dbName == undefined)
|
|
3706
3752
|
this.dbName = settings.key;
|
|
3707
|
-
this.label = buildLabel((
|
|
3753
|
+
this.label = buildLabel((_c = settings.label) !== null && _c !== void 0 ? _c : settings.caption, settings.key, remult, entityDefs);
|
|
3708
3754
|
}
|
|
3709
3755
|
columnDefsImpl.prototype.apiUpdateAllowed = function (item) {
|
|
3710
3756
|
if (this.options.allowApiUpdate === undefined)
|
|
@@ -3754,9 +3800,9 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3754
3800
|
exports.columnDefsImpl = columnDefsImpl;
|
|
3755
3801
|
var EntityFullInfo = /** @class */ (function () {
|
|
3756
3802
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
3757
|
-
var _a,
|
|
3803
|
+
var _a, e_51, _b, e_52, _c;
|
|
3758
3804
|
var _this = this;
|
|
3759
|
-
var
|
|
3805
|
+
var _d, _e;
|
|
3760
3806
|
this.entityInfo = entityInfo;
|
|
3761
3807
|
this.remult = remult;
|
|
3762
3808
|
this.entityType = entityType;
|
|
@@ -3859,15 +3905,15 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3859
3905
|
this.fieldsMetadata.push((r[x.key] = new columnDefsImpl(x, this, remult)));
|
|
3860
3906
|
}
|
|
3861
3907
|
}
|
|
3862
|
-
catch (
|
|
3908
|
+
catch (e_51_1) { e_51 = { error: e_51_1 }; }
|
|
3863
3909
|
finally {
|
|
3864
3910
|
try {
|
|
3865
3911
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
3866
3912
|
}
|
|
3867
|
-
finally { if (
|
|
3913
|
+
finally { if (e_51) throw e_51.error; }
|
|
3868
3914
|
}
|
|
3869
3915
|
this.fields = r;
|
|
3870
|
-
this.label = buildLabel((
|
|
3916
|
+
this.label = buildLabel((_d = entityInfo.label) !== null && _d !== void 0 ? _d : entityInfo.caption, this.key, remult, this);
|
|
3871
3917
|
if (entityInfo.id) {
|
|
3872
3918
|
var r_2 = typeof entityInfo.id === 'string'
|
|
3873
3919
|
? this.fields.find(entityInfo.id)
|
|
@@ -3892,6 +3938,21 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3892
3938
|
else
|
|
3893
3939
|
this.idMetadata.field = tslib_1.__spreadArray([], tslib_1.__read(this.fields), false)[0];
|
|
3894
3940
|
}
|
|
3941
|
+
try {
|
|
3942
|
+
// The database rejects NULL in a primary key.
|
|
3943
|
+
for (var _f = tslib_1.__values(this.idMetadata.fields), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
3944
|
+
var f = _g.value;
|
|
3945
|
+
if (f)
|
|
3946
|
+
f.allowNull = (_e = f.options.allowNull) !== null && _e !== void 0 ? _e : false;
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
3950
|
+
finally {
|
|
3951
|
+
try {
|
|
3952
|
+
if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
|
|
3953
|
+
}
|
|
3954
|
+
finally { if (e_52) throw e_52.error; }
|
|
3955
|
+
}
|
|
3895
3956
|
}
|
|
3896
3957
|
EntityFullInfo.prototype.apiUpdateAllowed = function (item) {
|
|
3897
3958
|
if (this.options.allowApiUpdate === undefined)
|
|
@@ -3984,7 +4045,7 @@ function ValueListFieldType() {
|
|
|
3984
4045
|
}
|
|
3985
4046
|
var ValueListInfo = /** @class */ (function () {
|
|
3986
4047
|
function ValueListInfo(valueListType) {
|
|
3987
|
-
var
|
|
4048
|
+
var e_53, _a, _b;
|
|
3988
4049
|
var _this = this;
|
|
3989
4050
|
this.valueListType = valueListType;
|
|
3990
4051
|
this.byIdMap = new Map();
|
|
@@ -4024,12 +4085,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
4024
4085
|
this.unknownIdValue = op.unknownIdValue;
|
|
4025
4086
|
}
|
|
4026
4087
|
}
|
|
4027
|
-
catch (
|
|
4088
|
+
catch (e_53_1) { e_53 = { error: e_53_1 }; }
|
|
4028
4089
|
finally {
|
|
4029
4090
|
try {
|
|
4030
4091
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
4031
4092
|
}
|
|
4032
|
-
finally { if (
|
|
4093
|
+
finally { if (e_53) throw e_53.error; }
|
|
4033
4094
|
}
|
|
4034
4095
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
4035
4096
|
throw new Error("ValueType ".concat(this.valueListType, " has values without an id"));
|
|
@@ -4120,7 +4181,7 @@ function getValueList(type) {
|
|
|
4120
4181
|
exports.storableMember = Symbol.for('storableMember');
|
|
4121
4182
|
exports.fieldOptionalValuesFunctionKey = Symbol.for('fieldOptionalValues');
|
|
4122
4183
|
function buildOptions(options, remult) {
|
|
4123
|
-
var
|
|
4184
|
+
var e_54, _a;
|
|
4124
4185
|
var _b;
|
|
4125
4186
|
var r = {};
|
|
4126
4187
|
try {
|
|
@@ -4137,12 +4198,12 @@ function buildOptions(options, remult) {
|
|
|
4137
4198
|
}
|
|
4138
4199
|
}
|
|
4139
4200
|
}
|
|
4140
|
-
catch (
|
|
4201
|
+
catch (e_54_1) { e_54 = { error: e_54_1 }; }
|
|
4141
4202
|
finally {
|
|
4142
4203
|
try {
|
|
4143
4204
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
4144
4205
|
}
|
|
4145
|
-
finally { if (
|
|
4206
|
+
finally { if (e_54) throw e_54.error; }
|
|
4146
4207
|
}
|
|
4147
4208
|
(_b = exports.fieldOptionsEnricher.enrichFieldOptions) === null || _b === void 0 ? void 0 : _b.call(exports.fieldOptionsEnricher, r);
|
|
4148
4209
|
return r;
|
|
@@ -4185,7 +4246,7 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4185
4246
|
};
|
|
4186
4247
|
settings.valueConverter = new Proxy(settings.valueConverter, {
|
|
4187
4248
|
get: function (target, property) {
|
|
4188
|
-
var
|
|
4249
|
+
var e_55, _a;
|
|
4189
4250
|
if (target[property] === undefined) {
|
|
4190
4251
|
if (isIdNumeric_1 === undefined) {
|
|
4191
4252
|
if (property === 'inputType')
|
|
@@ -4208,12 +4269,12 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4208
4269
|
: valueConverters_js_1.ValueConverters.String[key];
|
|
4209
4270
|
}
|
|
4210
4271
|
}
|
|
4211
|
-
catch (
|
|
4272
|
+
catch (e_55_1) { e_55 = { error: e_55_1 }; }
|
|
4212
4273
|
finally {
|
|
4213
4274
|
try {
|
|
4214
4275
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4215
4276
|
}
|
|
4216
|
-
finally { if (
|
|
4277
|
+
finally { if (e_55) throw e_55.error; }
|
|
4217
4278
|
}
|
|
4218
4279
|
}
|
|
4219
4280
|
}
|