remult 3.4.1 → 3.5.0-next.1
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 +41 -9
- package/esm/remult-mongo.js +27 -9
- package/esm/remult-sqlite-core.js +4 -1
- package/esm/server/remult-api-server.js +1 -1
- package/esm/src/buildRestDataProvider.js +4 -2
- 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 +5 -0
- package/esm/src/data-providers/rest-data-provider-using-fetch.js +2 -2
- package/esm/src/data-providers/retry.js +11 -6
- package/esm/src/data-providers/sql-database.js +41 -31
- package/esm/src/filter/entityDbName.js +6 -10
- package/esm/src/filter/fieldDbName.js +8 -14
- package/esm/src/filter/filter-consumer-bridge-to-sql-request.js +4 -4
- package/esm/src/filter/sqlExpressionInProgress.js +14 -0
- package/esm/src/live-query/SubscriptionChannel.js +13 -8
- package/esm/src/remult-static.js +1 -0
- package/esm/src/remult3/Fields.js +14 -14
- package/esm/src/remult3/QueryResultImpl.js +2 -0
- package/esm/src/remult3/RepositoryImplementation.js +47 -33
- package/esm/src/sort.js +18 -0
- package/index.d.ts +1 -1
- 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 +127 -80
- package/remult-mongo.js +29 -8
- package/remult-sqlite-core.d.ts +2 -1
- package/remult-sqlite-core.js +4 -0
- package/server/remult-api-server.d.ts +12 -1
- package/server/remult-api-server.js +1 -1
- package/src/buildRestDataProvider.js +3 -1
- package/src/column-interfaces.d.ts +5 -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 +5 -0
- package/src/data-providers/rest-data-provider-using-fetch.js +1 -1
- 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 +100 -84
- package/src/filter/entityDbName.d.ts +1 -1
- package/src/filter/entityDbName.js +14 -16
- package/src/filter/fieldDbName.js +19 -25
- package/src/filter/filter-consumer-bridge-to-sql-request.d.ts +1 -1
- package/src/filter/filter-consumer-bridge-to-sql-request.js +7 -5
- package/src/filter/sqlExpressionInProgress.d.ts +2 -0
- package/src/filter/sqlExpressionInProgress.js +27 -0
- package/src/live-query/SubscriptionChannel.js +16 -10
- package/src/remult-static.d.ts +2 -0
- package/src/remult-static.js +1 -0
- package/src/remult3/Fields.d.ts +5 -3
- package/src/remult3/Fields.js +24 -13
- package/src/remult3/QueryResultImpl.js +2 -0
- package/src/remult3/RepositoryImplementation.js +284 -272
- package/src/remult3/remult3.d.ts +6 -1
- package/src/sort.d.ts +19 -0
- package/src/sort.js +20 -1
- package/src/sql-command.d.ts +2 -1
|
@@ -78,70 +78,48 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
78
78
|
};
|
|
79
79
|
RepositoryImplementation.prototype._createAfterFilter = function (orderBy, lastRow) {
|
|
80
80
|
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
|
-
|
|
81
|
+
var ref, filter, or, equal, _loop_1, _a, _b, _c, field, isDescending;
|
|
82
|
+
var e_1, _d;
|
|
83
|
+
var _e;
|
|
84
|
+
return tslib_1.__generator(this, function (_f) {
|
|
85
|
+
ref = this.getEntityRef(lastRow);
|
|
86
|
+
filter = { $or: [] };
|
|
87
|
+
or = filter.$or;
|
|
88
|
+
equal = {};
|
|
89
|
+
_loop_1 = function (field, isDescending) {
|
|
90
|
+
// A string key cannot name an entity member for TypeScript.
|
|
91
|
+
var keyIs = function (condition) {
|
|
92
|
+
var _a;
|
|
93
|
+
return (_a = {}, _a[field.key] = condition, _a);
|
|
94
|
+
};
|
|
95
|
+
// An unloaded relation reads `undefined`, its id is there.
|
|
96
|
+
var value = (_e = ref.fields.find(field.key).getId()) !== null && _e !== void 0 ? _e : null;
|
|
97
|
+
var nullFirst = (0, sort_js_1.isNullFirstSort)(isDescending);
|
|
98
|
+
if (value === null) {
|
|
99
|
+
if (nullFirst)
|
|
100
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), { $not: keyIs(null) }));
|
|
99
101
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
102
|
+
else {
|
|
103
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(isDescending ? { $lt: value } : { $gt: value })));
|
|
104
|
+
if (field.allowNull && !nullFirst)
|
|
105
|
+
or.push(tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(null)));
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
r = { $or: [] };
|
|
109
|
-
equalToColumn = [];
|
|
107
|
+
equal = tslib_1.__assign(tslib_1.__assign({}, equal), keyIs(value));
|
|
108
|
+
};
|
|
110
109
|
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);
|
|
110
|
+
for (_a = tslib_1.__values(sort_js_1.Sort.translateOrderByToSort(this.metadata, orderBy).Segments), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
111
|
+
_c = _b.value, field = _c.field, isDescending = _c.isDescending;
|
|
112
|
+
_loop_1(field, isDescending);
|
|
135
113
|
}
|
|
136
114
|
}
|
|
137
|
-
catch (
|
|
115
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
138
116
|
finally {
|
|
139
117
|
try {
|
|
140
|
-
if (
|
|
118
|
+
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
141
119
|
}
|
|
142
|
-
finally { if (
|
|
120
|
+
finally { if (e_1) throw e_1.error; }
|
|
143
121
|
}
|
|
144
|
-
return [2 /*return*/,
|
|
122
|
+
return [2 /*return*/, filter];
|
|
145
123
|
});
|
|
146
124
|
});
|
|
147
125
|
};
|
|
@@ -198,7 +176,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
198
176
|
RepositoryImplementation.prototype.groupBy = function (options) {
|
|
199
177
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
200
178
|
var dpOptions, result, loaderOptions, _a, _b, key, loader;
|
|
201
|
-
var
|
|
179
|
+
var e_2, _c;
|
|
202
180
|
return tslib_1.__generator(this, function (_d) {
|
|
203
181
|
switch (_d.label) {
|
|
204
182
|
case 0: return [4 /*yield*/, this.__buildGroupByOptions(options)];
|
|
@@ -219,12 +197,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
219
197
|
loaderOptions.include[key] = true;
|
|
220
198
|
}
|
|
221
199
|
}
|
|
222
|
-
catch (
|
|
200
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
223
201
|
finally {
|
|
224
202
|
try {
|
|
225
203
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
226
204
|
}
|
|
227
|
-
finally { if (
|
|
205
|
+
finally { if (e_2) throw e_2.error; }
|
|
228
206
|
}
|
|
229
207
|
loader = new relation_loader_js_1.RelationLoader();
|
|
230
208
|
return [4 /*yield*/, this._populateRelationsForFields(dpOptions.group, loaderOptions, result, loader)];
|
|
@@ -420,7 +398,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
420
398
|
});
|
|
421
399
|
};
|
|
422
400
|
RepositoryImplementation.prototype.__cleanupPartialObject = function (item) {
|
|
423
|
-
var
|
|
401
|
+
var e_3, _a;
|
|
424
402
|
var keys = Object.keys(item);
|
|
425
403
|
for (var index = 0; index < keys.length; index++) {
|
|
426
404
|
var key = keys[index];
|
|
@@ -449,18 +427,18 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
449
427
|
var field = _c.value;
|
|
450
428
|
}
|
|
451
429
|
}
|
|
452
|
-
catch (
|
|
430
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
453
431
|
finally {
|
|
454
432
|
try {
|
|
455
433
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
456
434
|
}
|
|
457
|
-
finally { if (
|
|
435
|
+
finally { if (e_3) throw e_3.error; }
|
|
458
436
|
}
|
|
459
437
|
};
|
|
460
438
|
RepositoryImplementation.prototype.insert = function (entity, options) {
|
|
461
439
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
462
|
-
var useBulk, r, entity_1, entity_1_1, item, _a, _b,
|
|
463
|
-
var
|
|
440
|
+
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;
|
|
441
|
+
var e_4, _c, e_5, _d, e_6, _e;
|
|
464
442
|
return tslib_1.__generator(this, function (_f) {
|
|
465
443
|
switch (_f.label) {
|
|
466
444
|
case 0:
|
|
@@ -486,14 +464,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
486
464
|
return [3 /*break*/, 2];
|
|
487
465
|
case 5: return [3 /*break*/, 8];
|
|
488
466
|
case 6:
|
|
489
|
-
|
|
490
|
-
|
|
467
|
+
e_4_1 = _f.sent();
|
|
468
|
+
e_4 = { error: e_4_1 };
|
|
491
469
|
return [3 /*break*/, 8];
|
|
492
470
|
case 7:
|
|
493
471
|
try {
|
|
494
472
|
if (entity_1_1 && !entity_1_1.done && (_c = entity_1.return)) _c.call(entity_1);
|
|
495
473
|
}
|
|
496
|
-
finally { if (
|
|
474
|
+
finally { if (e_4) throw e_4.error; }
|
|
497
475
|
return [7 /*endfinally*/];
|
|
498
476
|
case 8:
|
|
499
477
|
if ((options === null || options === void 0 ? void 0 : options.select) === 'none')
|
|
@@ -535,14 +513,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
535
513
|
return [3 /*break*/, 11];
|
|
536
514
|
case 14: return [3 /*break*/, 17];
|
|
537
515
|
case 15:
|
|
538
|
-
|
|
539
|
-
|
|
516
|
+
e_5_1 = _f.sent();
|
|
517
|
+
e_5 = { error: e_5_1 };
|
|
540
518
|
return [3 /*break*/, 17];
|
|
541
519
|
case 16:
|
|
542
520
|
try {
|
|
543
521
|
if (entity_2_1 && !entity_2_1.done && (_d = entity_2.return)) _d.call(entity_2);
|
|
544
522
|
}
|
|
545
|
-
finally { if (
|
|
523
|
+
finally { if (e_5) throw e_5.error; }
|
|
546
524
|
return [7 /*endfinally*/];
|
|
547
525
|
case 17:
|
|
548
526
|
if (!raw.length) return [3 /*break*/, 19];
|
|
@@ -557,12 +535,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
557
535
|
slot.row = inserted[i++];
|
|
558
536
|
}
|
|
559
537
|
}
|
|
560
|
-
catch (
|
|
538
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
561
539
|
finally {
|
|
562
540
|
try {
|
|
563
541
|
if (slots_1_1 && !slots_1_1.done && (_e = slots_1.return)) _e.call(slots_1);
|
|
564
542
|
}
|
|
565
|
-
finally { if (
|
|
543
|
+
finally { if (e_6) throw e_6.error; }
|
|
566
544
|
}
|
|
567
545
|
_f.label = 19;
|
|
568
546
|
case 19: return [4 /*yield*/, promiseAll(slots, function (slot) {
|
|
@@ -610,8 +588,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
610
588
|
fields[_i - 1] = arguments[_i];
|
|
611
589
|
}
|
|
612
590
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
613
|
-
var ref, hasError, fields_1, fields_1_1, f,
|
|
614
|
-
var
|
|
591
|
+
var ref, hasError, fields_1, fields_1_1, f, e_7_1;
|
|
592
|
+
var e_7, _a;
|
|
615
593
|
return tslib_1.__generator(this, function (_b) {
|
|
616
594
|
switch (_b.label) {
|
|
617
595
|
case 0:
|
|
@@ -642,14 +620,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
642
620
|
return [3 /*break*/, 4];
|
|
643
621
|
case 7: return [3 /*break*/, 10];
|
|
644
622
|
case 8:
|
|
645
|
-
|
|
646
|
-
|
|
623
|
+
e_7_1 = _b.sent();
|
|
624
|
+
e_7 = { error: e_7_1 };
|
|
647
625
|
return [3 /*break*/, 10];
|
|
648
626
|
case 9:
|
|
649
627
|
try {
|
|
650
628
|
if (fields_1_1 && !fields_1_1.done && (_a = fields_1.return)) _a.call(fields_1);
|
|
651
629
|
}
|
|
652
|
-
finally { if (
|
|
630
|
+
finally { if (e_7) throw e_7.error; }
|
|
653
631
|
return [7 /*endfinally*/];
|
|
654
632
|
case 10:
|
|
655
633
|
if (!hasError)
|
|
@@ -660,7 +638,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
660
638
|
});
|
|
661
639
|
};
|
|
662
640
|
RepositoryImplementation.prototype.__createDto = function (basedOn) {
|
|
663
|
-
var
|
|
641
|
+
var e_8, _a;
|
|
664
642
|
this.__cleanupPartialObject(basedOn);
|
|
665
643
|
var ref = this.getEntityRef(tslib_1.__assign({}, basedOn));
|
|
666
644
|
var r = ref.copyDataToObject(false);
|
|
@@ -672,19 +650,19 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
672
650
|
delete r[element.key];
|
|
673
651
|
}
|
|
674
652
|
}
|
|
675
|
-
catch (
|
|
653
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
676
654
|
finally {
|
|
677
655
|
try {
|
|
678
656
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
679
657
|
}
|
|
680
|
-
finally { if (
|
|
658
|
+
finally { if (e_8) throw e_8.error; }
|
|
681
659
|
}
|
|
682
660
|
return r;
|
|
683
661
|
};
|
|
684
662
|
RepositoryImplementation.prototype.updateMany = function (_a) {
|
|
685
663
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
686
|
-
var _c, _d, _e, updated, _f, _g, _h, item,
|
|
687
|
-
var _j,
|
|
664
|
+
var _c, _d, _e, updated, _f, _g, _h, item, e_9_1;
|
|
665
|
+
var _j, e_9, _k, _l;
|
|
688
666
|
var where = _b.where, set = _b.set;
|
|
689
667
|
return tslib_1.__generator(this, function (_m) {
|
|
690
668
|
switch (_m.label) {
|
|
@@ -727,8 +705,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
727
705
|
return [3 /*break*/, 6];
|
|
728
706
|
case 10: return [3 /*break*/, 17];
|
|
729
707
|
case 11:
|
|
730
|
-
|
|
731
|
-
|
|
708
|
+
e_9_1 = _m.sent();
|
|
709
|
+
e_9 = { error: e_9_1 };
|
|
732
710
|
return [3 /*break*/, 17];
|
|
733
711
|
case 12:
|
|
734
712
|
_m.trys.push([12, , 15, 16]);
|
|
@@ -739,7 +717,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
739
717
|
_m.label = 14;
|
|
740
718
|
case 14: return [3 /*break*/, 16];
|
|
741
719
|
case 15:
|
|
742
|
-
if (
|
|
720
|
+
if (e_9) throw e_9.error;
|
|
743
721
|
return [7 /*endfinally*/];
|
|
744
722
|
case 16: return [7 /*endfinally*/];
|
|
745
723
|
case 17: return [2 /*return*/, updated];
|
|
@@ -868,7 +846,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
868
846
|
});
|
|
869
847
|
};
|
|
870
848
|
RepositoryImplementation.prototype._getRefForExistingRow = function (entity, id) {
|
|
871
|
-
var
|
|
849
|
+
var e_10, _a;
|
|
872
850
|
var ref = (0, getEntityRef_js_1.getEntityRef)(entity, false);
|
|
873
851
|
if (!ref) {
|
|
874
852
|
var instance = new this._entity(this._remult);
|
|
@@ -879,12 +857,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
879
857
|
instance[key] = entity[key];
|
|
880
858
|
}
|
|
881
859
|
}
|
|
882
|
-
catch (
|
|
860
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
883
861
|
finally {
|
|
884
862
|
try {
|
|
885
863
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
886
864
|
}
|
|
887
|
-
finally { if (
|
|
865
|
+
finally { if (e_10) throw e_10.error; }
|
|
888
866
|
}
|
|
889
867
|
this._fixTypes(instance);
|
|
890
868
|
var row_1 = new rowHelperImplementation(this._info, instance, this, this._edp, this._remult, false);
|
|
@@ -1059,7 +1037,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1059
1037
|
case 0:
|
|
1060
1038
|
loader = new relation_loader_js_1.RelationLoader();
|
|
1061
1039
|
return [4 /*yield*/, this._loadManyToOneForManyRows(jsonItems.map(function (row) {
|
|
1062
|
-
var
|
|
1040
|
+
var e_11, _a;
|
|
1063
1041
|
var result = {};
|
|
1064
1042
|
try {
|
|
1065
1043
|
for (var _b = tslib_1.__values(_this.metadata.fields.toArray()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1067,12 +1045,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1067
1045
|
result[col.key] = col.valueConverter.fromJson(row[col.key]);
|
|
1068
1046
|
}
|
|
1069
1047
|
}
|
|
1070
|
-
catch (
|
|
1048
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1071
1049
|
finally {
|
|
1072
1050
|
try {
|
|
1073
1051
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1074
1052
|
}
|
|
1075
|
-
finally { if (
|
|
1053
|
+
finally { if (e_11) throw e_11.error; }
|
|
1076
1054
|
}
|
|
1077
1055
|
return result;
|
|
1078
1056
|
}), loadOptions, loader)];
|
|
@@ -1091,7 +1069,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1091
1069
|
function loadManyToOne(repo, toLoad) {
|
|
1092
1070
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1093
1071
|
var rows, rows_1, rows_1_1, r;
|
|
1094
|
-
var _a,
|
|
1072
|
+
var _a, e_14, _b;
|
|
1095
1073
|
return tslib_1.__generator(this, function (_c) {
|
|
1096
1074
|
switch (_c.label) {
|
|
1097
1075
|
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 +1081,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1103
1081
|
repo._addToCache(r);
|
|
1104
1082
|
}
|
|
1105
1083
|
}
|
|
1106
|
-
catch (
|
|
1084
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1107
1085
|
finally {
|
|
1108
1086
|
try {
|
|
1109
1087
|
if (rows_1_1 && !rows_1_1.done && (_b = rows_1.return)) _b.call(rows_1);
|
|
1110
1088
|
}
|
|
1111
|
-
finally { if (
|
|
1089
|
+
finally { if (e_14) throw e_14.error; }
|
|
1112
1090
|
}
|
|
1113
1091
|
return [2 /*return*/];
|
|
1114
1092
|
}
|
|
1115
1093
|
});
|
|
1116
1094
|
});
|
|
1117
1095
|
}
|
|
1118
|
-
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val,
|
|
1119
|
-
var
|
|
1096
|
+
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;
|
|
1097
|
+
var e_12, _c, e_13, _d;
|
|
1120
1098
|
var _this = this;
|
|
1121
1099
|
return tslib_1.__generator(this, function (_e) {
|
|
1122
1100
|
switch (_e.label) {
|
|
@@ -1143,7 +1121,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1143
1121
|
repo = this._remult.repo(col.valueType);
|
|
1144
1122
|
toLoad = [];
|
|
1145
1123
|
try {
|
|
1146
|
-
for (rawRows_1 = (
|
|
1124
|
+
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
1125
|
r = rawRows_1_1.value;
|
|
1148
1126
|
val = r[col.key];
|
|
1149
1127
|
if (val !== undefined &&
|
|
@@ -1154,12 +1132,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1154
1132
|
}
|
|
1155
1133
|
}
|
|
1156
1134
|
}
|
|
1157
|
-
catch (
|
|
1135
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1158
1136
|
finally {
|
|
1159
1137
|
try {
|
|
1160
1138
|
if (rawRows_1_1 && !rawRows_1_1.done && (_d = rawRows_1.return)) _d.call(rawRows_1);
|
|
1161
1139
|
}
|
|
1162
|
-
finally { if (
|
|
1140
|
+
finally { if (e_13) throw e_13.error; }
|
|
1163
1141
|
}
|
|
1164
1142
|
if (!(toLoad.length > 0)) return [3 /*break*/, 4];
|
|
1165
1143
|
return [4 /*yield*/, loadManyToOne(repo, toLoad)];
|
|
@@ -1171,14 +1149,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1171
1149
|
return [3 /*break*/, 2];
|
|
1172
1150
|
case 5: return [3 /*break*/, 8];
|
|
1173
1151
|
case 6:
|
|
1174
|
-
|
|
1175
|
-
|
|
1152
|
+
e_12_1 = _e.sent();
|
|
1153
|
+
e_12 = { error: e_12_1 };
|
|
1176
1154
|
return [3 /*break*/, 8];
|
|
1177
1155
|
case 7:
|
|
1178
1156
|
try {
|
|
1179
1157
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1180
1158
|
}
|
|
1181
|
-
finally { if (
|
|
1159
|
+
finally { if (e_12) throw e_12.error; }
|
|
1182
1160
|
return [7 /*endfinally*/];
|
|
1183
1161
|
case 8:
|
|
1184
1162
|
excludeRelationMembers = new Set(this.fields
|
|
@@ -1217,15 +1195,16 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1217
1195
|
});
|
|
1218
1196
|
};
|
|
1219
1197
|
RepositoryImplementation.prototype._populateRelationsForFields = function (fields, loadOptions, result, loader) {
|
|
1220
|
-
var
|
|
1221
|
-
var
|
|
1222
|
-
|
|
1223
|
-
var
|
|
1198
|
+
var e_15, _a;
|
|
1199
|
+
var _b;
|
|
1200
|
+
var _loop_2 = function (col) {
|
|
1201
|
+
var e_16, _c, e_17, _d;
|
|
1202
|
+
var _e = this_1.__getRelationAndInclude(col, loadOptions), rel = _e.rel, incl = _e.incl;
|
|
1224
1203
|
if (rel)
|
|
1225
1204
|
if (incl) {
|
|
1226
1205
|
var otherRepo = rel.toRepo;
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1206
|
+
var _loop_3 = function (row) {
|
|
1207
|
+
var _f = this_1._findOptionsBasedOnRelation(rel, col, incl, row, otherRepo), findOptions = _f.findOptions, returnNull = _f.returnNull, returnUndefined = _f.returnUndefined;
|
|
1229
1208
|
var colKey = col.key;
|
|
1230
1209
|
if (returnNull)
|
|
1231
1210
|
row[colKey] = null;
|
|
@@ -1257,32 +1236,34 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1257
1236
|
}
|
|
1258
1237
|
};
|
|
1259
1238
|
try {
|
|
1260
|
-
for (var result_1 = (
|
|
1239
|
+
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
1240
|
var row = result_1_1.value;
|
|
1262
|
-
|
|
1241
|
+
_loop_3(row);
|
|
1263
1242
|
}
|
|
1264
1243
|
}
|
|
1265
|
-
catch (
|
|
1244
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1266
1245
|
finally {
|
|
1267
1246
|
try {
|
|
1268
|
-
if (result_1_1 && !result_1_1.done && (
|
|
1247
|
+
if (result_1_1 && !result_1_1.done && (_c = result_1.return)) _c.call(result_1);
|
|
1269
1248
|
}
|
|
1270
|
-
finally { if (
|
|
1249
|
+
finally { if (e_16) throw e_16.error; }
|
|
1271
1250
|
}
|
|
1272
1251
|
}
|
|
1273
1252
|
else {
|
|
1274
1253
|
try {
|
|
1275
|
-
for (var result_2 = (
|
|
1254
|
+
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
1255
|
var row = result_2_1.value;
|
|
1277
|
-
|
|
1256
|
+
// Deleting the relation's accessor would drop its change tracking, so only a plain value goes.
|
|
1257
|
+
if (!((_b = Object.getOwnPropertyDescriptor(row, col.key)) === null || _b === void 0 ? void 0 : _b.get))
|
|
1258
|
+
Reflect.deleteProperty(row, col.key);
|
|
1278
1259
|
}
|
|
1279
1260
|
}
|
|
1280
|
-
catch (
|
|
1261
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1281
1262
|
finally {
|
|
1282
1263
|
try {
|
|
1283
|
-
if (result_2_1 && !result_2_1.done && (
|
|
1264
|
+
if (result_2_1 && !result_2_1.done && (_d = result_2.return)) _d.call(result_2);
|
|
1284
1265
|
}
|
|
1285
|
-
finally { if (
|
|
1266
|
+
finally { if (e_17) throw e_17.error; }
|
|
1286
1267
|
}
|
|
1287
1268
|
}
|
|
1288
1269
|
};
|
|
@@ -1290,15 +1271,15 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1290
1271
|
try {
|
|
1291
1272
|
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
1273
|
var col = fields_2_1.value;
|
|
1293
|
-
|
|
1274
|
+
_loop_2(col);
|
|
1294
1275
|
}
|
|
1295
1276
|
}
|
|
1296
|
-
catch (
|
|
1277
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1297
1278
|
finally {
|
|
1298
1279
|
try {
|
|
1299
1280
|
if (fields_2_1 && !fields_2_1.done && (_a = fields_2.return)) _a.call(fields_2);
|
|
1300
1281
|
}
|
|
1301
|
-
finally { if (
|
|
1282
|
+
finally { if (e_15) throw e_15.error; }
|
|
1302
1283
|
}
|
|
1303
1284
|
};
|
|
1304
1285
|
RepositoryImplementation.prototype.__getRelationAndInclude = function (col, loadOptions) {
|
|
@@ -1314,7 +1295,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1314
1295
|
};
|
|
1315
1296
|
/*@internal */
|
|
1316
1297
|
RepositoryImplementation.prototype._findOptionsBasedOnRelation = function (rel, field, moreFindOptions, row, otherRepo) {
|
|
1317
|
-
var
|
|
1298
|
+
var e_18, _a, e_19, _b, _c, _d;
|
|
1318
1299
|
var returnNull = false;
|
|
1319
1300
|
var returnUndefined = false;
|
|
1320
1301
|
var where = [];
|
|
@@ -1334,7 +1315,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1334
1315
|
if (source.where)
|
|
1335
1316
|
where.push(source.where);
|
|
1336
1317
|
try {
|
|
1337
|
-
for (var _e = (
|
|
1318
|
+
for (var _e = (e_19 = void 0, tslib_1.__values([
|
|
1338
1319
|
'limit',
|
|
1339
1320
|
'include',
|
|
1340
1321
|
'orderBy',
|
|
@@ -1346,21 +1327,21 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1346
1327
|
findOptions[key] = source[key];
|
|
1347
1328
|
}
|
|
1348
1329
|
}
|
|
1349
|
-
catch (
|
|
1330
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1350
1331
|
finally {
|
|
1351
1332
|
try {
|
|
1352
1333
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1353
1334
|
}
|
|
1354
|
-
finally { if (
|
|
1335
|
+
finally { if (e_19) throw e_19.error; }
|
|
1355
1336
|
}
|
|
1356
1337
|
}
|
|
1357
1338
|
}
|
|
1358
|
-
catch (
|
|
1339
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1359
1340
|
finally {
|
|
1360
1341
|
try {
|
|
1361
1342
|
if (findOptionsSources_1_1 && !findOptionsSources_1_1.done && (_a = findOptionsSources_1.return)) _a.call(findOptionsSources_1);
|
|
1362
1343
|
}
|
|
1363
|
-
finally { if (
|
|
1344
|
+
finally { if (e_18) throw e_18.error; }
|
|
1364
1345
|
}
|
|
1365
1346
|
var relFields = rel.getFields();
|
|
1366
1347
|
var getFieldValue = function (key) {
|
|
@@ -1438,7 +1419,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1438
1419
|
return this.getEntityRef(item).toApiJson(true);
|
|
1439
1420
|
};
|
|
1440
1421
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
1441
|
-
var
|
|
1422
|
+
var e_20, _a;
|
|
1442
1423
|
var _this = this;
|
|
1443
1424
|
if (json === null || json === undefined)
|
|
1444
1425
|
return json;
|
|
@@ -1464,12 +1445,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1464
1445
|
}
|
|
1465
1446
|
}
|
|
1466
1447
|
}
|
|
1467
|
-
catch (
|
|
1448
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1468
1449
|
finally {
|
|
1469
1450
|
try {
|
|
1470
1451
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1471
1452
|
}
|
|
1472
|
-
finally { if (
|
|
1453
|
+
finally { if (e_20) throw e_20.error; }
|
|
1473
1454
|
}
|
|
1474
1455
|
this._fixTypes(result);
|
|
1475
1456
|
if (newRow) {
|
|
@@ -1502,9 +1483,9 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1502
1483
|
};
|
|
1503
1484
|
RepositoryImplementation.prototype.deleteMany = function (_a) {
|
|
1504
1485
|
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,
|
|
1486
|
+
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;
|
|
1487
|
+
var e_22, _m;
|
|
1488
|
+
var _o, e_21, _p, _q;
|
|
1508
1489
|
var where = _b.where;
|
|
1509
1490
|
return tslib_1.__generator(this, function (_r) {
|
|
1510
1491
|
switch (_r.label) {
|
|
@@ -1547,8 +1528,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1547
1528
|
return [3 /*break*/, 6];
|
|
1548
1529
|
case 10: return [3 /*break*/, 17];
|
|
1549
1530
|
case 11:
|
|
1550
|
-
|
|
1551
|
-
|
|
1531
|
+
e_21_1 = _r.sent();
|
|
1532
|
+
e_21 = { error: e_21_1 };
|
|
1552
1533
|
return [3 /*break*/, 17];
|
|
1553
1534
|
case 12:
|
|
1554
1535
|
_r.trys.push([12, , 15, 16]);
|
|
@@ -1559,7 +1540,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1559
1540
|
_r.label = 14;
|
|
1560
1541
|
case 14: return [3 /*break*/, 16];
|
|
1561
1542
|
case 15:
|
|
1562
|
-
if (
|
|
1543
|
+
if (e_21) throw e_21.error;
|
|
1563
1544
|
return [7 /*endfinally*/];
|
|
1564
1545
|
case 16: return [7 /*endfinally*/];
|
|
1565
1546
|
case 17:
|
|
@@ -1585,14 +1566,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1585
1566
|
return [3 /*break*/, 20];
|
|
1586
1567
|
case 23: return [3 /*break*/, 26];
|
|
1587
1568
|
case 24:
|
|
1588
|
-
|
|
1589
|
-
|
|
1569
|
+
e_22_1 = _r.sent();
|
|
1570
|
+
e_22 = { error: e_22_1 };
|
|
1590
1571
|
return [3 /*break*/, 26];
|
|
1591
1572
|
case 25:
|
|
1592
1573
|
try {
|
|
1593
1574
|
if (prepared_1_1 && !prepared_1_1.done && (_m = prepared_1.return)) _m.call(prepared_1);
|
|
1594
1575
|
}
|
|
1595
|
-
finally { if (
|
|
1576
|
+
finally { if (e_22) throw e_22.error; }
|
|
1596
1577
|
return [7 /*endfinally*/];
|
|
1597
1578
|
case 26: return [2 /*return*/, prepared.length];
|
|
1598
1579
|
}
|
|
@@ -1682,7 +1663,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1682
1663
|
return this.metadata.fields.toArray().filter(function (x) { return keys.includes(x.key); });
|
|
1683
1664
|
};
|
|
1684
1665
|
RepositoryImplementation.prototype.create = function (item) {
|
|
1685
|
-
var
|
|
1666
|
+
var e_23, _a;
|
|
1686
1667
|
var _b;
|
|
1687
1668
|
var r = new this._entity(this._remult);
|
|
1688
1669
|
if (item) {
|
|
@@ -1693,12 +1674,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1693
1674
|
r[key] = item[key];
|
|
1694
1675
|
}
|
|
1695
1676
|
}
|
|
1696
|
-
catch (
|
|
1677
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
1697
1678
|
finally {
|
|
1698
1679
|
try {
|
|
1699
1680
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1700
1681
|
}
|
|
1701
|
-
finally { if (
|
|
1682
|
+
finally { if (e_23) throw e_23.error; }
|
|
1702
1683
|
}
|
|
1703
1684
|
this._fixTypes(r);
|
|
1704
1685
|
}
|
|
@@ -1712,7 +1693,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1712
1693
|
RepositoryImplementation.prototype._fixTypes = function (item) {
|
|
1713
1694
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1714
1695
|
var _a, _b, field, val, _c, _d, _e, type, typeName;
|
|
1715
|
-
var
|
|
1696
|
+
var e_24, _f, e_25, _g;
|
|
1716
1697
|
return tslib_1.__generator(this, function (_h) {
|
|
1717
1698
|
try {
|
|
1718
1699
|
for (_a = tslib_1.__values(this._fieldsOf(item)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
@@ -1723,7 +1704,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1723
1704
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1724
1705
|
else
|
|
1725
1706
|
try {
|
|
1726
|
-
for (_c = (
|
|
1707
|
+
for (_c = (e_25 = void 0, tslib_1.__values([
|
|
1727
1708
|
[String, 'string'],
|
|
1728
1709
|
[Number, 'number'],
|
|
1729
1710
|
[Boolean, 'boolean'],
|
|
@@ -1733,22 +1714,22 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1733
1714
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1734
1715
|
}
|
|
1735
1716
|
}
|
|
1736
|
-
catch (
|
|
1717
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1737
1718
|
finally {
|
|
1738
1719
|
try {
|
|
1739
1720
|
if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
|
|
1740
1721
|
}
|
|
1741
|
-
finally { if (
|
|
1722
|
+
finally { if (e_25) throw e_25.error; }
|
|
1742
1723
|
}
|
|
1743
1724
|
}
|
|
1744
1725
|
}
|
|
1745
1726
|
}
|
|
1746
|
-
catch (
|
|
1727
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1747
1728
|
finally {
|
|
1748
1729
|
try {
|
|
1749
1730
|
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
1750
1731
|
}
|
|
1751
|
-
finally { if (
|
|
1732
|
+
finally { if (e_24) throw e_24.error; }
|
|
1752
1733
|
}
|
|
1753
1734
|
return [2 /*return*/, item];
|
|
1754
1735
|
});
|
|
@@ -1824,8 +1805,8 @@ function createOldEntity(entity, remult) {
|
|
|
1824
1805
|
var info = (0, getEntityRef_js_1.getEntitySettings)(entity)(remult);
|
|
1825
1806
|
var key = (0, getEntityRef_js_1.getEntityKey)(entity);
|
|
1826
1807
|
var base = Object.getPrototypeOf(entity);
|
|
1827
|
-
var
|
|
1828
|
-
var
|
|
1808
|
+
var _loop_4 = function () {
|
|
1809
|
+
var e_26, _a;
|
|
1829
1810
|
var baseCols = remult_static_js_1.remultStatic.columnsOfType.get(base);
|
|
1830
1811
|
if (baseCols) {
|
|
1831
1812
|
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 +1822,7 @@ function createOldEntity(entity, remult) {
|
|
|
1841
1822
|
'deleted',
|
|
1842
1823
|
'validation',
|
|
1843
1824
|
];
|
|
1844
|
-
var
|
|
1825
|
+
var _loop_5 = function (key_1) {
|
|
1845
1826
|
if (baseSettings_1[key_1] && baseSettings_1[key_1] !== info[key_1]) {
|
|
1846
1827
|
var x_1 = info[key_1];
|
|
1847
1828
|
//@ts-ignore
|
|
@@ -1868,29 +1849,29 @@ function createOldEntity(entity, remult) {
|
|
|
1868
1849
|
}
|
|
1869
1850
|
};
|
|
1870
1851
|
try {
|
|
1871
|
-
for (var functions_1 = (
|
|
1852
|
+
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
1853
|
var key_1 = functions_1_1.value;
|
|
1873
|
-
|
|
1854
|
+
_loop_5(key_1);
|
|
1874
1855
|
}
|
|
1875
1856
|
}
|
|
1876
|
-
catch (
|
|
1857
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
1877
1858
|
finally {
|
|
1878
1859
|
try {
|
|
1879
1860
|
if (functions_1_1 && !functions_1_1.done && (_a = functions_1.return)) _a.call(functions_1);
|
|
1880
1861
|
}
|
|
1881
|
-
finally { if (
|
|
1862
|
+
finally { if (e_26) throw e_26.error; }
|
|
1882
1863
|
}
|
|
1883
1864
|
}
|
|
1884
1865
|
base = Object.getPrototypeOf(base);
|
|
1885
1866
|
};
|
|
1886
1867
|
while (base != null) {
|
|
1887
|
-
|
|
1868
|
+
_loop_4();
|
|
1888
1869
|
}
|
|
1889
1870
|
return new EntityFullInfo(prepareColumnInfo(r, remult), info, remult, entity, key);
|
|
1890
1871
|
}
|
|
1891
1872
|
var rowHelperBase = /** @class */ (function () {
|
|
1892
1873
|
function rowHelperBase(fieldsMetadata, instance, remult, isNewRow, excludeRelationMembers) {
|
|
1893
|
-
var
|
|
1874
|
+
var e_27, _a;
|
|
1894
1875
|
var _this = this;
|
|
1895
1876
|
this.fieldsMetadata = fieldsMetadata;
|
|
1896
1877
|
this.instance = instance;
|
|
@@ -1905,7 +1886,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1905
1886
|
remult = remult_static_js_1.remultStatic.remultFactory();
|
|
1906
1887
|
}
|
|
1907
1888
|
}
|
|
1908
|
-
var
|
|
1889
|
+
var _loop_6 = function (col) {
|
|
1909
1890
|
var ei = (0, getEntityRef_js_1.getEntitySettings)(col.valueType, false);
|
|
1910
1891
|
if (ei && remult) {
|
|
1911
1892
|
var lookup_1 = new column_js_1.LookupColumn(remult.repo(col.valueType), Boolean((0, relationInfoMember_js_1.getRelationFieldInfo)(col)), col.allowNull);
|
|
@@ -1983,15 +1964,15 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1983
1964
|
try {
|
|
1984
1965
|
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
1966
|
var col = fieldsMetadata_1_1.value;
|
|
1986
|
-
|
|
1967
|
+
_loop_6(col);
|
|
1987
1968
|
}
|
|
1988
1969
|
}
|
|
1989
|
-
catch (
|
|
1970
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
1990
1971
|
finally {
|
|
1991
1972
|
try {
|
|
1992
1973
|
if (fieldsMetadata_1_1 && !fieldsMetadata_1_1.done && (_a = fieldsMetadata_1.return)) _a.call(fieldsMetadata_1);
|
|
1993
1974
|
}
|
|
1994
|
-
finally { if (
|
|
1975
|
+
finally { if (e_27) throw e_27.error; }
|
|
1995
1976
|
}
|
|
1996
1977
|
}
|
|
1997
1978
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -2013,11 +1994,11 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2013
1994
|
return this._subscribers.subscribe(listener);
|
|
2014
1995
|
};
|
|
2015
1996
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
2016
|
-
var
|
|
1997
|
+
var e_28, _a;
|
|
2017
1998
|
if (!this._subscribers) {
|
|
2018
1999
|
this._subscribers = new SubscribableImp_js_1.SubscribableImp();
|
|
2019
2000
|
var safeSubscribers_1 = this._subscribers;
|
|
2020
|
-
var
|
|
2001
|
+
var _loop_7 = function (col) {
|
|
2021
2002
|
var ei = (0, getEntityRef_js_1.getEntitySettings)(col.valueType, false);
|
|
2022
2003
|
var refImpl = this_3.fields.find(col.key);
|
|
2023
2004
|
refImpl._subscribers = new SubscribableImp_js_1.SubscribableImp();
|
|
@@ -2044,15 +2025,15 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2044
2025
|
try {
|
|
2045
2026
|
for (var _b = tslib_1.__values(this.fieldsMetadata), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
2046
2027
|
var col = _c.value;
|
|
2047
|
-
|
|
2028
|
+
_loop_7(col);
|
|
2048
2029
|
}
|
|
2049
2030
|
}
|
|
2050
|
-
catch (
|
|
2031
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
2051
2032
|
finally {
|
|
2052
2033
|
try {
|
|
2053
2034
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2054
2035
|
}
|
|
2055
|
-
finally { if (
|
|
2036
|
+
finally { if (e_28) throw e_28.error; }
|
|
2056
2037
|
}
|
|
2057
2038
|
}
|
|
2058
2039
|
};
|
|
@@ -2087,7 +2068,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2087
2068
|
throw this.buildErrorInfoObject();
|
|
2088
2069
|
};
|
|
2089
2070
|
rowHelperBase.prototype.buildErrorInfoObject = function () {
|
|
2090
|
-
var
|
|
2071
|
+
var e_29, _a;
|
|
2091
2072
|
var _b;
|
|
2092
2073
|
var error = {
|
|
2093
2074
|
modelState: Object.assign({}, this.errors),
|
|
@@ -2107,12 +2088,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2107
2088
|
}
|
|
2108
2089
|
}
|
|
2109
2090
|
}
|
|
2110
|
-
catch (
|
|
2091
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
2111
2092
|
finally {
|
|
2112
2093
|
try {
|
|
2113
2094
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2114
2095
|
}
|
|
2115
|
-
finally { if (
|
|
2096
|
+
finally { if (e_29) throw e_29.error; }
|
|
2116
2097
|
}
|
|
2117
2098
|
}
|
|
2118
2099
|
return new data_interfaces_js_1.EntityError(error);
|
|
@@ -2146,7 +2127,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2146
2127
|
this._reportChangedToEntityAndFields();
|
|
2147
2128
|
};
|
|
2148
2129
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
2149
|
-
var
|
|
2130
|
+
var e_30, _a;
|
|
2150
2131
|
if (this._subscribers) {
|
|
2151
2132
|
this._subscribers.reportChanged();
|
|
2152
2133
|
try {
|
|
@@ -2156,12 +2137,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2156
2137
|
ref._subscribers.reportChanged();
|
|
2157
2138
|
}
|
|
2158
2139
|
}
|
|
2159
|
-
catch (
|
|
2140
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
2160
2141
|
finally {
|
|
2161
2142
|
try {
|
|
2162
2143
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2163
2144
|
}
|
|
2164
|
-
finally { if (
|
|
2145
|
+
finally { if (e_30) throw e_30.error; }
|
|
2165
2146
|
}
|
|
2166
2147
|
}
|
|
2167
2148
|
};
|
|
@@ -2171,7 +2152,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2171
2152
|
return !!!this.error && this.errors == undefined;
|
|
2172
2153
|
};
|
|
2173
2154
|
rowHelperBase.prototype.copyDataToObject = function (isNew) {
|
|
2174
|
-
var
|
|
2155
|
+
var e_31, _a;
|
|
2175
2156
|
if (isNew === void 0) { isNew = false; }
|
|
2176
2157
|
var d = {};
|
|
2177
2158
|
try {
|
|
@@ -2203,12 +2184,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2203
2184
|
}
|
|
2204
2185
|
}
|
|
2205
2186
|
}
|
|
2206
|
-
catch (
|
|
2187
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2207
2188
|
finally {
|
|
2208
2189
|
try {
|
|
2209
2190
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2210
2191
|
}
|
|
2211
|
-
finally { if (
|
|
2192
|
+
finally { if (e_31) throw e_31.error; }
|
|
2212
2193
|
}
|
|
2213
2194
|
return d;
|
|
2214
2195
|
};
|
|
@@ -2268,7 +2249,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2268
2249
|
}); });
|
|
2269
2250
|
};
|
|
2270
2251
|
rowHelperBase.prototype.toApiJson = function (includeRelatedEntities, notJustApi) {
|
|
2271
|
-
var
|
|
2252
|
+
var e_32, _a;
|
|
2272
2253
|
var _b;
|
|
2273
2254
|
if (includeRelatedEntities === void 0) { includeRelatedEntities = false; }
|
|
2274
2255
|
if (notJustApi === void 0) { notJustApi = false; }
|
|
@@ -2314,19 +2295,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2314
2295
|
}
|
|
2315
2296
|
}
|
|
2316
2297
|
}
|
|
2317
|
-
catch (
|
|
2298
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2318
2299
|
finally {
|
|
2319
2300
|
try {
|
|
2320
2301
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2321
2302
|
}
|
|
2322
|
-
finally { if (
|
|
2303
|
+
finally { if (e_32) throw e_32.error; }
|
|
2323
2304
|
}
|
|
2324
2305
|
return result;
|
|
2325
2306
|
};
|
|
2326
2307
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body_1) {
|
|
2327
2308
|
return tslib_1.__awaiter(this, arguments, void 0, function (body, ignoreApiAllowed) {
|
|
2328
2309
|
var keys, _a, _b, col, lu;
|
|
2329
|
-
var
|
|
2310
|
+
var e_33, _c;
|
|
2330
2311
|
if (ignoreApiAllowed === void 0) { ignoreApiAllowed = false; }
|
|
2331
2312
|
return tslib_1.__generator(this, function (_d) {
|
|
2332
2313
|
switch (_d.label) {
|
|
@@ -2349,12 +2330,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2349
2330
|
}
|
|
2350
2331
|
}
|
|
2351
2332
|
}
|
|
2352
|
-
catch (
|
|
2333
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2353
2334
|
finally {
|
|
2354
2335
|
try {
|
|
2355
2336
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2356
2337
|
}
|
|
2357
|
-
finally { if (
|
|
2338
|
+
finally { if (e_33) throw e_33.error; }
|
|
2358
2339
|
}
|
|
2359
2340
|
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
2341
|
case 1:
|
|
@@ -2369,7 +2350,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2369
2350
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
2370
2351
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
2371
2352
|
function rowHelperImplementation(info, instance, repo, edp, remult, _isNew, excludeRelationMembers) {
|
|
2372
|
-
var
|
|
2353
|
+
var e_34, _a;
|
|
2373
2354
|
var _this = _super.call(this, info.fieldsMetadata, instance, remult, _isNew, excludeRelationMembers) || this;
|
|
2374
2355
|
_this.info = info;
|
|
2375
2356
|
_this.repo = repo;
|
|
@@ -2393,12 +2374,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2393
2374
|
}
|
|
2394
2375
|
}
|
|
2395
2376
|
}
|
|
2396
|
-
catch (
|
|
2377
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2397
2378
|
finally {
|
|
2398
2379
|
try {
|
|
2399
2380
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2400
2381
|
}
|
|
2401
|
-
finally { if (
|
|
2382
|
+
finally { if (e_34) throw e_34.error; }
|
|
2402
2383
|
}
|
|
2403
2384
|
}
|
|
2404
2385
|
if (_this.info.entityInfo.entityRefInit)
|
|
@@ -2518,7 +2499,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2518
2499
|
};
|
|
2519
2500
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
2520
2501
|
get: function () {
|
|
2521
|
-
var _a,
|
|
2502
|
+
var _a, e_35, _b;
|
|
2522
2503
|
if (!this._columns) {
|
|
2523
2504
|
var _items_1 = [];
|
|
2524
2505
|
var r_1 = (_a = {
|
|
@@ -2539,12 +2520,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2539
2520
|
(r_1[c.key] = new FieldRefImplementation(c.options, c, this.instance, this, this)));
|
|
2540
2521
|
}
|
|
2541
2522
|
}
|
|
2542
|
-
catch (
|
|
2523
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
2543
2524
|
finally {
|
|
2544
2525
|
try {
|
|
2545
2526
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
2546
2527
|
}
|
|
2547
|
-
finally { if (
|
|
2528
|
+
finally { if (e_35) throw e_35.error; }
|
|
2548
2529
|
}
|
|
2549
2530
|
this._columns = r_1;
|
|
2550
2531
|
}
|
|
@@ -2555,8 +2536,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2555
2536
|
});
|
|
2556
2537
|
rowHelperImplementation.prototype.save = function (options, onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject) {
|
|
2557
2538
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2558
|
-
var doNotSave_1, e, _a, _b, col,
|
|
2559
|
-
var
|
|
2539
|
+
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;
|
|
2540
|
+
var e_36, _l, e_38, _m, _o, _p, e_37, _q;
|
|
2560
2541
|
var _r, _s;
|
|
2561
2542
|
return tslib_1.__generator(this, function (_t) {
|
|
2562
2543
|
switch (_t.label) {
|
|
@@ -2598,14 +2579,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2598
2579
|
return [3 /*break*/, 4];
|
|
2599
2580
|
case 7: return [3 /*break*/, 10];
|
|
2600
2581
|
case 8:
|
|
2601
|
-
|
|
2602
|
-
|
|
2582
|
+
e_36_1 = _t.sent();
|
|
2583
|
+
e_36 = { error: e_36_1 };
|
|
2603
2584
|
return [3 /*break*/, 10];
|
|
2604
2585
|
case 9:
|
|
2605
2586
|
try {
|
|
2606
2587
|
if (_b && !_b.done && (_l = _a.return)) _l.call(_a);
|
|
2607
2588
|
}
|
|
2608
|
-
finally { if (
|
|
2589
|
+
finally { if (e_36) throw e_36.error; }
|
|
2609
2590
|
return [7 /*endfinally*/];
|
|
2610
2591
|
case 10:
|
|
2611
2592
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 12];
|
|
@@ -2631,12 +2612,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2631
2612
|
}
|
|
2632
2613
|
}
|
|
2633
2614
|
}
|
|
2634
|
-
catch (
|
|
2615
|
+
catch (e_38_1) { e_38 = { error: e_38_1 }; }
|
|
2635
2616
|
finally {
|
|
2636
2617
|
try {
|
|
2637
2618
|
if (_d && !_d.done && (_m = _c.return)) _m.call(_c);
|
|
2638
2619
|
}
|
|
2639
|
-
finally { if (
|
|
2620
|
+
finally { if (e_38) throw e_38.error; }
|
|
2640
2621
|
}
|
|
2641
2622
|
updatedRow = void 0;
|
|
2642
2623
|
isNew = this.isNew();
|
|
@@ -2725,14 +2706,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2725
2706
|
return [3 /*break*/, 31];
|
|
2726
2707
|
case 34: return [3 /*break*/, 37];
|
|
2727
2708
|
case 35:
|
|
2728
|
-
|
|
2729
|
-
|
|
2709
|
+
e_37_1 = _t.sent();
|
|
2710
|
+
e_37 = { error: e_37_1 };
|
|
2730
2711
|
return [3 /*break*/, 37];
|
|
2731
2712
|
case 36:
|
|
2732
2713
|
try {
|
|
2733
2714
|
if (_k && !_k.done && (_q = _j.return)) _q.call(_j);
|
|
2734
2715
|
}
|
|
2735
|
-
finally { if (
|
|
2716
|
+
finally { if (e_37) throw e_37.error; }
|
|
2736
2717
|
return [7 /*endfinally*/];
|
|
2737
2718
|
case 37:
|
|
2738
2719
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2756,8 +2737,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2756
2737
|
};
|
|
2757
2738
|
rowHelperImplementation.prototype.processInsertResponseDto = function (updatedRow) {
|
|
2758
2739
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2759
|
-
var e, _a, _b, listener,
|
|
2760
|
-
var
|
|
2740
|
+
var e, _a, _b, listener, e_39_1, err_2;
|
|
2741
|
+
var e_39, _c;
|
|
2761
2742
|
var _d;
|
|
2762
2743
|
return tslib_1.__generator(this, function (_e) {
|
|
2763
2744
|
switch (_e.label) {
|
|
@@ -2796,14 +2777,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2796
2777
|
return [3 /*break*/, 6];
|
|
2797
2778
|
case 9: return [3 /*break*/, 12];
|
|
2798
2779
|
case 10:
|
|
2799
|
-
|
|
2800
|
-
|
|
2780
|
+
e_39_1 = _e.sent();
|
|
2781
|
+
e_39 = { error: e_39_1 };
|
|
2801
2782
|
return [3 /*break*/, 12];
|
|
2802
2783
|
case 11:
|
|
2803
2784
|
try {
|
|
2804
2785
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2805
2786
|
}
|
|
2806
|
-
finally { if (
|
|
2787
|
+
finally { if (e_39) throw e_39.error; }
|
|
2807
2788
|
return [7 /*endfinally*/];
|
|
2808
2789
|
case 12:
|
|
2809
2790
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2821,8 +2802,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2821
2802
|
};
|
|
2822
2803
|
rowHelperImplementation.prototype.buildDtoForInsert = function () {
|
|
2823
2804
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2824
|
-
var skip, e, _a, _b, col,
|
|
2825
|
-
var
|
|
2805
|
+
var skip, e, _a, _b, col, e_40_1, d, _c, _d, field, f;
|
|
2806
|
+
var e_40, _e, e_41, _f;
|
|
2826
2807
|
return tslib_1.__generator(this, function (_g) {
|
|
2827
2808
|
switch (_g.label) {
|
|
2828
2809
|
case 0: return [4 /*yield*/, this.__validateEntity()];
|
|
@@ -2851,14 +2832,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2851
2832
|
return [3 /*break*/, 3];
|
|
2852
2833
|
case 6: return [3 /*break*/, 9];
|
|
2853
2834
|
case 7:
|
|
2854
|
-
|
|
2855
|
-
|
|
2835
|
+
e_40_1 = _g.sent();
|
|
2836
|
+
e_40 = { error: e_40_1 };
|
|
2856
2837
|
return [3 /*break*/, 9];
|
|
2857
2838
|
case 8:
|
|
2858
2839
|
try {
|
|
2859
2840
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2860
2841
|
}
|
|
2861
|
-
finally { if (
|
|
2842
|
+
finally { if (e_40) throw e_40.error; }
|
|
2862
2843
|
return [7 /*endfinally*/];
|
|
2863
2844
|
case 9:
|
|
2864
2845
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
@@ -2879,12 +2860,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2879
2860
|
}
|
|
2880
2861
|
}
|
|
2881
2862
|
}
|
|
2882
|
-
catch (
|
|
2863
|
+
catch (e_41_1) { e_41 = { error: e_41_1 }; }
|
|
2883
2864
|
finally {
|
|
2884
2865
|
try {
|
|
2885
2866
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
2886
2867
|
}
|
|
2887
|
-
finally { if (
|
|
2868
|
+
finally { if (e_41) throw e_41.error; }
|
|
2888
2869
|
}
|
|
2889
2870
|
if (skip)
|
|
2890
2871
|
return [2 /*return*/, null];
|
|
@@ -2973,8 +2954,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2973
2954
|
//@internal
|
|
2974
2955
|
rowHelperImplementation.prototype.__finishDelete = function (e) {
|
|
2975
2956
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2976
|
-
var _a, _b, listener,
|
|
2977
|
-
var
|
|
2957
|
+
var _a, _b, listener, e_42_1;
|
|
2958
|
+
var e_42, _c;
|
|
2978
2959
|
var _d;
|
|
2979
2960
|
return tslib_1.__generator(this, function (_e) {
|
|
2980
2961
|
switch (_e.label) {
|
|
@@ -3004,14 +2985,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3004
2985
|
return [3 /*break*/, 4];
|
|
3005
2986
|
case 7: return [3 /*break*/, 10];
|
|
3006
2987
|
case 8:
|
|
3007
|
-
|
|
3008
|
-
|
|
2988
|
+
e_42_1 = _e.sent();
|
|
2989
|
+
e_42 = { error: e_42_1 };
|
|
3009
2990
|
return [3 /*break*/, 10];
|
|
3010
2991
|
case 9:
|
|
3011
2992
|
try {
|
|
3012
2993
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3013
2994
|
}
|
|
3014
|
-
finally { if (
|
|
2995
|
+
finally { if (e_42) throw e_42.error; }
|
|
3015
2996
|
return [7 /*endfinally*/];
|
|
3016
2997
|
case 10:
|
|
3017
2998
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [
|
|
@@ -3025,8 +3006,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3025
3006
|
};
|
|
3026
3007
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
3027
3008
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3028
|
-
var _a, _b, col, lu,
|
|
3029
|
-
var
|
|
3009
|
+
var _a, _b, col, lu, e_43_1;
|
|
3010
|
+
var e_43, _c;
|
|
3030
3011
|
return tslib_1.__generator(this, function (_d) {
|
|
3031
3012
|
switch (_d.label) {
|
|
3032
3013
|
case 0:
|
|
@@ -3067,14 +3048,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3067
3048
|
return [3 /*break*/, 1];
|
|
3068
3049
|
case 9: return [3 /*break*/, 12];
|
|
3069
3050
|
case 10:
|
|
3070
|
-
|
|
3071
|
-
|
|
3051
|
+
e_43_1 = _d.sent();
|
|
3052
|
+
e_43 = { error: e_43_1 };
|
|
3072
3053
|
return [3 /*break*/, 12];
|
|
3073
3054
|
case 11:
|
|
3074
3055
|
try {
|
|
3075
3056
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3076
3057
|
}
|
|
3077
|
-
finally { if (
|
|
3058
|
+
finally { if (e_43) throw e_43.error; }
|
|
3078
3059
|
return [7 /*endfinally*/];
|
|
3079
3060
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
3080
3061
|
case 13:
|
|
@@ -3090,40 +3071,42 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3090
3071
|
};
|
|
3091
3072
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
3092
3073
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3093
|
-
var _a, _b, col, result,
|
|
3094
|
-
var
|
|
3095
|
-
|
|
3096
|
-
|
|
3074
|
+
var _a, _b, col, result, e_44_1;
|
|
3075
|
+
var e_44, _c;
|
|
3076
|
+
var _d;
|
|
3077
|
+
return tslib_1.__generator(this, function (_e) {
|
|
3078
|
+
switch (_e.label) {
|
|
3097
3079
|
case 0:
|
|
3098
3080
|
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 8];
|
|
3099
|
-
|
|
3081
|
+
_e.label = 1;
|
|
3100
3082
|
case 1:
|
|
3101
|
-
|
|
3083
|
+
_e.trys.push([1, 6, 7, 8]);
|
|
3102
3084
|
_a = tslib_1.__values(this.info.fieldsMetadata), _b = _a.next();
|
|
3103
|
-
|
|
3085
|
+
_e.label = 2;
|
|
3104
3086
|
case 2:
|
|
3105
3087
|
if (!!_b.done) return [3 /*break*/, 5];
|
|
3106
3088
|
col = _b.value;
|
|
3107
|
-
if (!col.options.serverExpression
|
|
3089
|
+
if (!(col.options.serverExpression &&
|
|
3090
|
+
!((_d = this._fieldsExcludedBySelect) === null || _d === void 0 ? void 0 : _d.has(col.key)))) return [3 /*break*/, 4];
|
|
3108
3091
|
return [4 /*yield*/, col.options.serverExpression(this.instance)];
|
|
3109
3092
|
case 3:
|
|
3110
|
-
result = (
|
|
3093
|
+
result = (_e.sent());
|
|
3111
3094
|
if (result !== undefined)
|
|
3112
3095
|
this.instance[col.key] = result;
|
|
3113
|
-
|
|
3096
|
+
_e.label = 4;
|
|
3114
3097
|
case 4:
|
|
3115
3098
|
_b = _a.next();
|
|
3116
3099
|
return [3 /*break*/, 2];
|
|
3117
3100
|
case 5: return [3 /*break*/, 8];
|
|
3118
3101
|
case 6:
|
|
3119
|
-
|
|
3120
|
-
|
|
3102
|
+
e_44_1 = _e.sent();
|
|
3103
|
+
e_44 = { error: e_44_1 };
|
|
3121
3104
|
return [3 /*break*/, 8];
|
|
3122
3105
|
case 7:
|
|
3123
3106
|
try {
|
|
3124
3107
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3125
3108
|
}
|
|
3126
|
-
finally { if (
|
|
3109
|
+
finally { if (e_44) throw e_44.error; }
|
|
3127
3110
|
return [7 /*endfinally*/];
|
|
3128
3111
|
case 8: return [2 /*return*/];
|
|
3129
3112
|
}
|
|
@@ -3136,7 +3119,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3136
3119
|
return this._isNew;
|
|
3137
3120
|
};
|
|
3138
3121
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
3139
|
-
var
|
|
3122
|
+
var e_45, _a;
|
|
3140
3123
|
var _b;
|
|
3141
3124
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
3142
3125
|
try {
|
|
@@ -3148,19 +3131,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3148
3131
|
return true;
|
|
3149
3132
|
}
|
|
3150
3133
|
}
|
|
3151
|
-
catch (
|
|
3134
|
+
catch (e_45_1) { e_45 = { error: e_45_1 }; }
|
|
3152
3135
|
finally {
|
|
3153
3136
|
try {
|
|
3154
3137
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
3155
3138
|
}
|
|
3156
|
-
finally { if (
|
|
3139
|
+
finally { if (e_45) throw e_45.error; }
|
|
3157
3140
|
}
|
|
3158
3141
|
return false;
|
|
3159
3142
|
};
|
|
3160
3143
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
3161
3144
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3162
|
-
var _a, _b, c, col,
|
|
3163
|
-
var
|
|
3145
|
+
var _a, _b, c, col, e_46_1, e, _c, _d, listener, e_47_1;
|
|
3146
|
+
var e_46, _e, e_47, _f;
|
|
3164
3147
|
var _g;
|
|
3165
3148
|
return tslib_1.__generator(this, function (_h) {
|
|
3166
3149
|
switch (_h.label) {
|
|
@@ -3182,14 +3165,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3182
3165
|
return [3 /*break*/, 1];
|
|
3183
3166
|
case 4: return [3 /*break*/, 7];
|
|
3184
3167
|
case 5:
|
|
3185
|
-
|
|
3186
|
-
|
|
3168
|
+
e_46_1 = _h.sent();
|
|
3169
|
+
e_46 = { error: e_46_1 };
|
|
3187
3170
|
return [3 /*break*/, 7];
|
|
3188
3171
|
case 6:
|
|
3189
3172
|
try {
|
|
3190
3173
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3191
3174
|
}
|
|
3192
|
-
finally { if (
|
|
3175
|
+
finally { if (e_46) throw e_46.error; }
|
|
3193
3176
|
return [7 /*endfinally*/];
|
|
3194
3177
|
case 7:
|
|
3195
3178
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -3217,14 +3200,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
3217
3200
|
return [3 /*break*/, 11];
|
|
3218
3201
|
case 14: return [3 /*break*/, 17];
|
|
3219
3202
|
case 15:
|
|
3220
|
-
|
|
3221
|
-
|
|
3203
|
+
e_47_1 = _h.sent();
|
|
3204
|
+
e_47 = { error: e_47_1 };
|
|
3222
3205
|
return [3 /*break*/, 17];
|
|
3223
3206
|
case 16:
|
|
3224
3207
|
try {
|
|
3225
3208
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
3226
3209
|
}
|
|
3227
|
-
finally { if (
|
|
3210
|
+
finally { if (e_47) throw e_47.error; }
|
|
3228
3211
|
return [7 /*endfinally*/];
|
|
3229
3212
|
case 17: return [2 /*return*/];
|
|
3230
3213
|
}
|
|
@@ -3271,7 +3254,7 @@ function getControllerRef(container, remultArg) {
|
|
|
3271
3254
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
3272
3255
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
3273
3256
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
3274
|
-
var _a,
|
|
3257
|
+
var _a, e_48, _b;
|
|
3275
3258
|
var _this = _super.call(this, columnsInfo, instance, remult, false) || this;
|
|
3276
3259
|
var _items = [];
|
|
3277
3260
|
var r = (_a = {
|
|
@@ -3288,20 +3271,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3288
3271
|
_items.push((r[col.key] = new FieldRefImplementation(col.options, col, instance, undefined, _this)));
|
|
3289
3272
|
}
|
|
3290
3273
|
}
|
|
3291
|
-
catch (
|
|
3274
|
+
catch (e_48_1) { e_48 = { error: e_48_1 }; }
|
|
3292
3275
|
finally {
|
|
3293
3276
|
try {
|
|
3294
3277
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_b = columnsInfo_1.return)) _b.call(columnsInfo_1);
|
|
3295
3278
|
}
|
|
3296
|
-
finally { if (
|
|
3279
|
+
finally { if (e_48) throw e_48.error; }
|
|
3297
3280
|
}
|
|
3298
3281
|
_this.fields = r;
|
|
3299
3282
|
return _this;
|
|
3300
3283
|
}
|
|
3301
3284
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
3302
3285
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3303
|
-
var _a, _b, col,
|
|
3304
|
-
var
|
|
3286
|
+
var _a, _b, col, e_49_1;
|
|
3287
|
+
var e_49, _c;
|
|
3305
3288
|
return tslib_1.__generator(this, function (_d) {
|
|
3306
3289
|
switch (_d.label) {
|
|
3307
3290
|
case 0:
|
|
@@ -3321,14 +3304,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
3321
3304
|
return [3 /*break*/, 1];
|
|
3322
3305
|
case 4: return [3 /*break*/, 7];
|
|
3323
3306
|
case 5:
|
|
3324
|
-
|
|
3325
|
-
|
|
3307
|
+
e_49_1 = _d.sent();
|
|
3308
|
+
e_49 = { error: e_49_1 };
|
|
3326
3309
|
return [3 /*break*/, 7];
|
|
3327
3310
|
case 6:
|
|
3328
3311
|
try {
|
|
3329
3312
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3330
3313
|
}
|
|
3331
|
-
finally { if (
|
|
3314
|
+
finally { if (e_49) throw e_49.error; }
|
|
3332
3315
|
return [7 /*endfinally*/];
|
|
3333
3316
|
case 7: return [2 /*return*/];
|
|
3334
3317
|
}
|
|
@@ -3525,8 +3508,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3525
3508
|
};
|
|
3526
3509
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
3527
3510
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3528
|
-
var processValidation, self_1, event_2, _a, _b, v, _c,
|
|
3529
|
-
var
|
|
3511
|
+
var processValidation, self_1, event_2, _a, _b, v, _c, e_50_1, _d, error_1;
|
|
3512
|
+
var e_50, _e;
|
|
3530
3513
|
var _this = this;
|
|
3531
3514
|
var _f, _g;
|
|
3532
3515
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -3580,14 +3563,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3580
3563
|
return [3 /*break*/, 2];
|
|
3581
3564
|
case 5: return [3 /*break*/, 8];
|
|
3582
3565
|
case 6:
|
|
3583
|
-
|
|
3584
|
-
|
|
3566
|
+
e_50_1 = _h.sent();
|
|
3567
|
+
e_50 = { error: e_50_1 };
|
|
3585
3568
|
return [3 /*break*/, 8];
|
|
3586
3569
|
case 7:
|
|
3587
3570
|
try {
|
|
3588
3571
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3589
3572
|
}
|
|
3590
|
-
finally { if (
|
|
3573
|
+
finally { if (e_50) throw e_50.error; }
|
|
3591
3574
|
return [7 /*endfinally*/];
|
|
3592
3575
|
case 8: return [3 /*break*/, 11];
|
|
3593
3576
|
case 9:
|
|
@@ -3651,10 +3634,24 @@ function buildLabel(label, key, remult, metaData) {
|
|
|
3651
3634
|
return (0, column_js_1.makeTitle)(key);
|
|
3652
3635
|
return '';
|
|
3653
3636
|
}
|
|
3637
|
+
/** Migrations give the column a default value (`''`, `0`, `false`), so it is `not null`. */
|
|
3638
|
+
function hasColumnDefault(_a) {
|
|
3639
|
+
var valueType = _a.valueType, valueConverter = _a.valueConverter;
|
|
3640
|
+
if (valueType === Number || valueType === Boolean)
|
|
3641
|
+
return true;
|
|
3642
|
+
if (valueType === Date)
|
|
3643
|
+
return false;
|
|
3644
|
+
// A relation id is an integer or a string, and its fieldTypeInDb would load the related entity.
|
|
3645
|
+
if ((0, getEntityRef_js_1.getEntitySettings)(valueType, false))
|
|
3646
|
+
return true;
|
|
3647
|
+
var type = valueConverter === null || valueConverter === void 0 ? void 0 : valueConverter.fieldTypeInDb;
|
|
3648
|
+
// None is a string column, default ''. `dbid` is a Mongo ObjectId marker, not a column type.
|
|
3649
|
+
return !type || type === 'dbid' || type === 'integer';
|
|
3650
|
+
}
|
|
3654
3651
|
var columnDefsImpl = /** @class */ (function () {
|
|
3655
3652
|
function columnDefsImpl(settings, entityDefs, remult) {
|
|
3656
3653
|
var _this = this;
|
|
3657
|
-
var _a, _b;
|
|
3654
|
+
var _a, _b, _c;
|
|
3658
3655
|
this.settings = settings;
|
|
3659
3656
|
this.entityDefs = entityDefs;
|
|
3660
3657
|
this.remult = remult;
|
|
@@ -3689,7 +3686,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3689
3686
|
return result;
|
|
3690
3687
|
},
|
|
3691
3688
|
});
|
|
3692
|
-
this.allowNull =
|
|
3689
|
+
this.allowNull = (_b = this.settings.allowNull) !== null && _b !== void 0 ? _b : !hasColumnDefault(settings);
|
|
3693
3690
|
this.valueType = this.settings.valueType;
|
|
3694
3691
|
this.key = this.settings.key;
|
|
3695
3692
|
this.inputType = this.settings.inputType;
|
|
@@ -3702,7 +3699,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3702
3699
|
this.dbName = settings.dbName;
|
|
3703
3700
|
if (this.dbName == undefined)
|
|
3704
3701
|
this.dbName = settings.key;
|
|
3705
|
-
this.label = buildLabel((
|
|
3702
|
+
this.label = buildLabel((_c = settings.label) !== null && _c !== void 0 ? _c : settings.caption, settings.key, remult, entityDefs);
|
|
3706
3703
|
}
|
|
3707
3704
|
columnDefsImpl.prototype.apiUpdateAllowed = function (item) {
|
|
3708
3705
|
if (this.options.allowApiUpdate === undefined)
|
|
@@ -3752,9 +3749,9 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3752
3749
|
exports.columnDefsImpl = columnDefsImpl;
|
|
3753
3750
|
var EntityFullInfo = /** @class */ (function () {
|
|
3754
3751
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
3755
|
-
var _a,
|
|
3752
|
+
var _a, e_51, _b, e_52, _c;
|
|
3756
3753
|
var _this = this;
|
|
3757
|
-
var
|
|
3754
|
+
var _d, _e;
|
|
3758
3755
|
this.entityInfo = entityInfo;
|
|
3759
3756
|
this.remult = remult;
|
|
3760
3757
|
this.entityType = entityType;
|
|
@@ -3857,15 +3854,15 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3857
3854
|
this.fieldsMetadata.push((r[x.key] = new columnDefsImpl(x, this, remult)));
|
|
3858
3855
|
}
|
|
3859
3856
|
}
|
|
3860
|
-
catch (
|
|
3857
|
+
catch (e_51_1) { e_51 = { error: e_51_1 }; }
|
|
3861
3858
|
finally {
|
|
3862
3859
|
try {
|
|
3863
3860
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
3864
3861
|
}
|
|
3865
|
-
finally { if (
|
|
3862
|
+
finally { if (e_51) throw e_51.error; }
|
|
3866
3863
|
}
|
|
3867
3864
|
this.fields = r;
|
|
3868
|
-
this.label = buildLabel((
|
|
3865
|
+
this.label = buildLabel((_d = entityInfo.label) !== null && _d !== void 0 ? _d : entityInfo.caption, this.key, remult, this);
|
|
3869
3866
|
if (entityInfo.id) {
|
|
3870
3867
|
var r_2 = typeof entityInfo.id === 'string'
|
|
3871
3868
|
? this.fields.find(entityInfo.id)
|
|
@@ -3890,6 +3887,21 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3890
3887
|
else
|
|
3891
3888
|
this.idMetadata.field = tslib_1.__spreadArray([], tslib_1.__read(this.fields), false)[0];
|
|
3892
3889
|
}
|
|
3890
|
+
try {
|
|
3891
|
+
// The database rejects NULL in a primary key.
|
|
3892
|
+
for (var _f = tslib_1.__values(this.idMetadata.fields), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
3893
|
+
var f = _g.value;
|
|
3894
|
+
if (f)
|
|
3895
|
+
f.allowNull = (_e = f.options.allowNull) !== null && _e !== void 0 ? _e : false;
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
3899
|
+
finally {
|
|
3900
|
+
try {
|
|
3901
|
+
if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
|
|
3902
|
+
}
|
|
3903
|
+
finally { if (e_52) throw e_52.error; }
|
|
3904
|
+
}
|
|
3893
3905
|
}
|
|
3894
3906
|
EntityFullInfo.prototype.apiUpdateAllowed = function (item) {
|
|
3895
3907
|
if (this.options.allowApiUpdate === undefined)
|
|
@@ -3982,7 +3994,7 @@ function ValueListFieldType() {
|
|
|
3982
3994
|
}
|
|
3983
3995
|
var ValueListInfo = /** @class */ (function () {
|
|
3984
3996
|
function ValueListInfo(valueListType) {
|
|
3985
|
-
var
|
|
3997
|
+
var e_53, _a, _b;
|
|
3986
3998
|
var _this = this;
|
|
3987
3999
|
this.valueListType = valueListType;
|
|
3988
4000
|
this.byIdMap = new Map();
|
|
@@ -4022,12 +4034,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
4022
4034
|
this.unknownIdValue = op.unknownIdValue;
|
|
4023
4035
|
}
|
|
4024
4036
|
}
|
|
4025
|
-
catch (
|
|
4037
|
+
catch (e_53_1) { e_53 = { error: e_53_1 }; }
|
|
4026
4038
|
finally {
|
|
4027
4039
|
try {
|
|
4028
4040
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
4029
4041
|
}
|
|
4030
|
-
finally { if (
|
|
4042
|
+
finally { if (e_53) throw e_53.error; }
|
|
4031
4043
|
}
|
|
4032
4044
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
4033
4045
|
throw new Error("ValueType ".concat(this.valueListType, " has values without an id"));
|
|
@@ -4118,7 +4130,7 @@ function getValueList(type) {
|
|
|
4118
4130
|
exports.storableMember = Symbol.for('storableMember');
|
|
4119
4131
|
exports.fieldOptionalValuesFunctionKey = Symbol.for('fieldOptionalValues');
|
|
4120
4132
|
function buildOptions(options, remult) {
|
|
4121
|
-
var
|
|
4133
|
+
var e_54, _a;
|
|
4122
4134
|
var _b;
|
|
4123
4135
|
var r = {};
|
|
4124
4136
|
try {
|
|
@@ -4135,12 +4147,12 @@ function buildOptions(options, remult) {
|
|
|
4135
4147
|
}
|
|
4136
4148
|
}
|
|
4137
4149
|
}
|
|
4138
|
-
catch (
|
|
4150
|
+
catch (e_54_1) { e_54 = { error: e_54_1 }; }
|
|
4139
4151
|
finally {
|
|
4140
4152
|
try {
|
|
4141
4153
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
4142
4154
|
}
|
|
4143
|
-
finally { if (
|
|
4155
|
+
finally { if (e_54) throw e_54.error; }
|
|
4144
4156
|
}
|
|
4145
4157
|
(_b = exports.fieldOptionsEnricher.enrichFieldOptions) === null || _b === void 0 ? void 0 : _b.call(exports.fieldOptionsEnricher, r);
|
|
4146
4158
|
return r;
|
|
@@ -4183,7 +4195,7 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4183
4195
|
};
|
|
4184
4196
|
settings.valueConverter = new Proxy(settings.valueConverter, {
|
|
4185
4197
|
get: function (target, property) {
|
|
4186
|
-
var
|
|
4198
|
+
var e_55, _a;
|
|
4187
4199
|
if (target[property] === undefined) {
|
|
4188
4200
|
if (isIdNumeric_1 === undefined) {
|
|
4189
4201
|
if (property === 'inputType')
|
|
@@ -4206,12 +4218,12 @@ function decorateColumnSettings(settings, remult) {
|
|
|
4206
4218
|
: valueConverters_js_1.ValueConverters.String[key];
|
|
4207
4219
|
}
|
|
4208
4220
|
}
|
|
4209
|
-
catch (
|
|
4221
|
+
catch (e_55_1) { e_55 = { error: e_55_1 }; }
|
|
4210
4222
|
finally {
|
|
4211
4223
|
try {
|
|
4212
4224
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4213
4225
|
}
|
|
4214
|
-
finally { if (
|
|
4226
|
+
finally { if (e_55) throw e_55.error; }
|
|
4215
4227
|
}
|
|
4216
4228
|
}
|
|
4217
4229
|
}
|