remult 0.13.13 → 0.13.16
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/package.json +1 -1
- package/readme.md +7 -1
- package/server/expressBridge.d.ts +3 -0
- package/src/remult3/RepositoryImplementation.js +112 -99
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
<a href="https://circleci.com/gh/remult/remult/tree/master">
|
|
7
7
|
<img alt="CircleCI" src="https://circleci.com/gh/remult/remult/tree/master.svg?style=svg">
|
|
8
8
|
</a>
|
|
9
|
-
<a href="https://
|
|
9
|
+
<a href="https://codecov.io/gh/remult/remult">
|
|
10
|
+
<img src="https://codecov.io/gh/remult/remult/branch/master/graph/badge.svg?token=LYWQRUN3D1"/>
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://raw.githubusercontent.com/remult/remult/master/LICENSE">
|
|
10
13
|
<img alt="GitHub license" src="https://img.shields.io/badge/license-MIT-blue.svg">
|
|
11
14
|
</a>
|
|
12
15
|
<a href="https://www.npmjs.com/package/remult">
|
|
@@ -15,6 +18,9 @@
|
|
|
15
18
|
<a href="https://www.npmjs.com/package/remult">
|
|
16
19
|
<img alt="npm downloads" src="https://img.shields.io/npm/dm/remult">
|
|
17
20
|
</a>
|
|
21
|
+
<a href="https://snyk.io/test/npm/remult">
|
|
22
|
+
<img alt="snyk" src="https://snyk.io/test/npm/remult/badge.svg"/>
|
|
23
|
+
</a>
|
|
18
24
|
</div>
|
|
19
25
|
|
|
20
26
|
## What is Remult?
|
|
@@ -4,6 +4,7 @@ import { Repository } from '../src/remult3';
|
|
|
4
4
|
import { queuedJobInfoResponse } from '../src/server-action';
|
|
5
5
|
import { DataApi, DataApiRequest, DataApiResponse } from '../src/data-api';
|
|
6
6
|
import { AllowedForInstance } from '../src/context';
|
|
7
|
+
import { ClassType } from '../classType';
|
|
7
8
|
export declare function remultExpress(options?: {
|
|
8
9
|
/** Determines the Data Provider
|
|
9
10
|
|
|
@@ -17,6 +18,8 @@ export declare function remultExpress(options?: {
|
|
|
17
18
|
initApi?: (remult: Remult) => void | Promise<void>;
|
|
18
19
|
logApiEndPoints?: boolean;
|
|
19
20
|
defaultGetLimit?: number;
|
|
21
|
+
entities?: ClassType<any>[];
|
|
22
|
+
controllers?: [];
|
|
20
23
|
}): RemultExpressBridge;
|
|
21
24
|
export interface RemultExpressBridge extends express.RequestHandler {
|
|
22
25
|
getRemult(req: express.Request): Promise<Remult>;
|
|
@@ -522,16 +522,29 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
522
522
|
});
|
|
523
523
|
};
|
|
524
524
|
RepositoryImplementation.prototype.create = function (item) {
|
|
525
|
+
var e_8, _a;
|
|
525
526
|
var r = new this.entity(this.remult);
|
|
526
|
-
var z = this.getEntityRef(r);
|
|
527
527
|
if (item)
|
|
528
|
-
|
|
528
|
+
try {
|
|
529
|
+
for (var _b = tslib_1.__values(this.metadata.fields), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
530
|
+
var field = _c.value;
|
|
531
|
+
r[field.key] = item[field.key];
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
535
|
+
finally {
|
|
536
|
+
try {
|
|
537
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
538
|
+
}
|
|
539
|
+
finally { if (e_8) throw e_8.error; }
|
|
540
|
+
}
|
|
541
|
+
var z = this.getEntityRef(r);
|
|
529
542
|
return r;
|
|
530
543
|
};
|
|
531
544
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
532
545
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
533
546
|
var obj, _a, _b, col, r, helper;
|
|
534
|
-
var
|
|
547
|
+
var e_9, _c;
|
|
535
548
|
return tslib_1.__generator(this, function (_d) {
|
|
536
549
|
switch (_d.label) {
|
|
537
550
|
case 0:
|
|
@@ -544,12 +557,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
544
557
|
}
|
|
545
558
|
}
|
|
546
559
|
}
|
|
547
|
-
catch (
|
|
560
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
548
561
|
finally {
|
|
549
562
|
try {
|
|
550
563
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
551
564
|
}
|
|
552
|
-
finally { if (
|
|
565
|
+
finally { if (e_9) throw e_9.error; }
|
|
553
566
|
}
|
|
554
567
|
if (!newRow) return [3 /*break*/, 2];
|
|
555
568
|
r = this.create();
|
|
@@ -658,7 +671,7 @@ function createOldEntity(entity, remult) {
|
|
|
658
671
|
var key = getEntityKey(entity);
|
|
659
672
|
var base = Object.getPrototypeOf(entity);
|
|
660
673
|
var _loop_1 = function () {
|
|
661
|
-
var
|
|
674
|
+
var e_10, _a;
|
|
662
675
|
var baseCols = exports.columnsOfType.get(base);
|
|
663
676
|
if (baseCols) {
|
|
664
677
|
r.unshift.apply(r, tslib_1.__spread(baseCols.filter(function (x) { return !r.find(function (y) { return y.key == x.key; }); })));
|
|
@@ -687,17 +700,17 @@ function createOldEntity(entity, remult) {
|
|
|
687
700
|
}
|
|
688
701
|
};
|
|
689
702
|
try {
|
|
690
|
-
for (var _b = (
|
|
703
|
+
for (var _b = (e_10 = void 0, tslib_1.__values(functions)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
691
704
|
var key_1 = _c.value;
|
|
692
705
|
_loop_2(key_1);
|
|
693
706
|
}
|
|
694
707
|
}
|
|
695
|
-
catch (
|
|
708
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
696
709
|
finally {
|
|
697
710
|
try {
|
|
698
711
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
699
712
|
}
|
|
700
|
-
finally { if (
|
|
713
|
+
finally { if (e_10) throw e_10.error; }
|
|
701
714
|
}
|
|
702
715
|
}
|
|
703
716
|
base = Object.getPrototypeOf(base);
|
|
@@ -710,7 +723,7 @@ function createOldEntity(entity, remult) {
|
|
|
710
723
|
exports.createOldEntity = createOldEntity;
|
|
711
724
|
var rowHelperBase = /** @class */ (function () {
|
|
712
725
|
function rowHelperBase(columnsInfo, instance, remult) {
|
|
713
|
-
var
|
|
726
|
+
var e_11, _a;
|
|
714
727
|
var _this = this;
|
|
715
728
|
this.columnsInfo = columnsInfo;
|
|
716
729
|
this.instance = instance;
|
|
@@ -765,12 +778,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
765
778
|
_loop_3(col);
|
|
766
779
|
}
|
|
767
780
|
}
|
|
768
|
-
catch (
|
|
781
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
769
782
|
finally {
|
|
770
783
|
try {
|
|
771
784
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_a = columnsInfo_1.return)) _a.call(columnsInfo_1);
|
|
772
785
|
}
|
|
773
|
-
finally { if (
|
|
786
|
+
finally { if (e_11) throw e_11.error; }
|
|
774
787
|
}
|
|
775
788
|
}
|
|
776
789
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -792,7 +805,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
792
805
|
return this._subscribers.subscribe(listener);
|
|
793
806
|
};
|
|
794
807
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
795
|
-
var
|
|
808
|
+
var e_12, _a;
|
|
796
809
|
var _this = this;
|
|
797
810
|
if (!this._subscribers) {
|
|
798
811
|
this._subscribers = new SubscribableImp();
|
|
@@ -827,12 +840,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
827
840
|
_loop_4(col);
|
|
828
841
|
}
|
|
829
842
|
}
|
|
830
|
-
catch (
|
|
843
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
831
844
|
finally {
|
|
832
845
|
try {
|
|
833
846
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
834
847
|
}
|
|
835
|
-
finally { if (
|
|
848
|
+
finally { if (e_12) throw e_12.error; }
|
|
836
849
|
}
|
|
837
850
|
}
|
|
838
851
|
};
|
|
@@ -863,7 +876,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
863
876
|
});
|
|
864
877
|
};
|
|
865
878
|
rowHelperBase.prototype.__assertValidity = function () {
|
|
866
|
-
var
|
|
879
|
+
var e_13, _a;
|
|
867
880
|
if (!this.hasErrors()) {
|
|
868
881
|
var error = {
|
|
869
882
|
modelState: Object.assign({}, this.errors),
|
|
@@ -880,12 +893,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
880
893
|
}
|
|
881
894
|
}
|
|
882
895
|
}
|
|
883
|
-
catch (
|
|
896
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
884
897
|
finally {
|
|
885
898
|
try {
|
|
886
899
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
887
900
|
}
|
|
888
|
-
finally { if (
|
|
901
|
+
finally { if (e_13) throw e_13.error; }
|
|
889
902
|
}
|
|
890
903
|
}
|
|
891
904
|
throw error;
|
|
@@ -920,7 +933,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
920
933
|
this._reportChangedToEntityAndFields();
|
|
921
934
|
};
|
|
922
935
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
923
|
-
var
|
|
936
|
+
var e_14, _a;
|
|
924
937
|
if (this._subscribers) {
|
|
925
938
|
this._subscribers.reportChanged();
|
|
926
939
|
try {
|
|
@@ -930,12 +943,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
930
943
|
ref._subscribers.reportChanged();
|
|
931
944
|
}
|
|
932
945
|
}
|
|
933
|
-
catch (
|
|
946
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
934
947
|
finally {
|
|
935
948
|
try {
|
|
936
949
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
937
950
|
}
|
|
938
|
-
finally { if (
|
|
951
|
+
finally { if (e_14) throw e_14.error; }
|
|
939
952
|
}
|
|
940
953
|
}
|
|
941
954
|
};
|
|
@@ -945,7 +958,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
945
958
|
return !!!this.error && this.errors == undefined;
|
|
946
959
|
};
|
|
947
960
|
rowHelperBase.prototype.copyDataToObject = function () {
|
|
948
|
-
var
|
|
961
|
+
var e_15, _a;
|
|
949
962
|
var d = {};
|
|
950
963
|
try {
|
|
951
964
|
for (var _b = tslib_1.__values(this.columnsInfo), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -964,12 +977,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
964
977
|
d[col.key] = val;
|
|
965
978
|
}
|
|
966
979
|
}
|
|
967
|
-
catch (
|
|
980
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
968
981
|
finally {
|
|
969
982
|
try {
|
|
970
983
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
971
984
|
}
|
|
972
|
-
finally { if (
|
|
985
|
+
finally { if (e_15) throw e_15.error; }
|
|
973
986
|
}
|
|
974
987
|
return d;
|
|
975
988
|
};
|
|
@@ -1025,7 +1038,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1025
1038
|
});
|
|
1026
1039
|
};
|
|
1027
1040
|
rowHelperBase.prototype.toApiJson = function () {
|
|
1028
|
-
var
|
|
1041
|
+
var e_16, _a;
|
|
1029
1042
|
var result = {};
|
|
1030
1043
|
try {
|
|
1031
1044
|
for (var _b = tslib_1.__values(this.columnsInfo), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1050,19 +1063,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1050
1063
|
}
|
|
1051
1064
|
}
|
|
1052
1065
|
}
|
|
1053
|
-
catch (
|
|
1066
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
1054
1067
|
finally {
|
|
1055
1068
|
try {
|
|
1056
1069
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1057
1070
|
}
|
|
1058
|
-
finally { if (
|
|
1071
|
+
finally { if (e_16) throw e_16.error; }
|
|
1059
1072
|
}
|
|
1060
1073
|
return result;
|
|
1061
1074
|
};
|
|
1062
1075
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body) {
|
|
1063
1076
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1064
1077
|
var keys, _a, _b, col, lu;
|
|
1065
|
-
var
|
|
1078
|
+
var e_17, _c;
|
|
1066
1079
|
return tslib_1.__generator(this, function (_d) {
|
|
1067
1080
|
switch (_d.label) {
|
|
1068
1081
|
case 0:
|
|
@@ -1082,12 +1095,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1082
1095
|
}
|
|
1083
1096
|
}
|
|
1084
1097
|
}
|
|
1085
|
-
catch (
|
|
1098
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1086
1099
|
finally {
|
|
1087
1100
|
try {
|
|
1088
1101
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1089
1102
|
}
|
|
1090
|
-
finally { if (
|
|
1103
|
+
finally { if (e_17) throw e_17.error; }
|
|
1091
1104
|
}
|
|
1092
1105
|
return [4 /*yield*/, Promise.all(tslib_1.__spread(this.fields).map(function (x) { return x.load(); }))];
|
|
1093
1106
|
case 1:
|
|
@@ -1102,7 +1115,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1102
1115
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
1103
1116
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
1104
1117
|
function rowHelperImplementation(info, instance, repository, edp, remult, _isNew) {
|
|
1105
|
-
var
|
|
1118
|
+
var e_18, _a;
|
|
1106
1119
|
var _this = _super.call(this, info.columnsInfo, instance, remult) || this;
|
|
1107
1120
|
_this.info = info;
|
|
1108
1121
|
_this.repository = repository;
|
|
@@ -1124,12 +1137,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1124
1137
|
}
|
|
1125
1138
|
}
|
|
1126
1139
|
}
|
|
1127
|
-
catch (
|
|
1140
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1128
1141
|
finally {
|
|
1129
1142
|
try {
|
|
1130
1143
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1131
1144
|
}
|
|
1132
|
-
finally { if (
|
|
1145
|
+
finally { if (e_18) throw e_18.error; }
|
|
1133
1146
|
}
|
|
1134
1147
|
}
|
|
1135
1148
|
if (_this.info.options.entityRefInit)
|
|
@@ -1194,7 +1207,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1194
1207
|
};
|
|
1195
1208
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
1196
1209
|
get: function () {
|
|
1197
|
-
var _a,
|
|
1210
|
+
var _a, e_19, _b;
|
|
1198
1211
|
if (!this._columns) {
|
|
1199
1212
|
var _items_1 = [];
|
|
1200
1213
|
var r_1 = (_a = {
|
|
@@ -1209,12 +1222,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1209
1222
|
_items_1.push(r_1[c.key] = new FieldRefImplementation(c, this.info.fields[c.key], this.instance, this, this));
|
|
1210
1223
|
}
|
|
1211
1224
|
}
|
|
1212
|
-
catch (
|
|
1225
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1213
1226
|
finally {
|
|
1214
1227
|
try {
|
|
1215
1228
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
1216
1229
|
}
|
|
1217
|
-
finally { if (
|
|
1230
|
+
finally { if (e_19) throw e_19.error; }
|
|
1218
1231
|
}
|
|
1219
1232
|
this._columns = r_1;
|
|
1220
1233
|
}
|
|
@@ -1226,8 +1239,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1226
1239
|
rowHelperImplementation.prototype.save = function () {
|
|
1227
1240
|
var _a;
|
|
1228
1241
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1229
|
-
var doNotSave_1, _b, _c, col,
|
|
1230
|
-
var
|
|
1242
|
+
var doNotSave_1, _b, _c, col, e_20_1, d, ignoreKeys, _d, _e, field, f, updatedRow, changesOnly, wasChanged, key, element, err_1;
|
|
1243
|
+
var e_20, _f, e_21, _g;
|
|
1231
1244
|
return tslib_1.__generator(this, function (_h) {
|
|
1232
1245
|
switch (_h.label) {
|
|
1233
1246
|
case 0:
|
|
@@ -1260,14 +1273,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1260
1273
|
return [3 /*break*/, 3];
|
|
1261
1274
|
case 6: return [3 /*break*/, 9];
|
|
1262
1275
|
case 7:
|
|
1263
|
-
|
|
1264
|
-
|
|
1276
|
+
e_20_1 = _h.sent();
|
|
1277
|
+
e_20 = { error: e_20_1 };
|
|
1265
1278
|
return [3 /*break*/, 9];
|
|
1266
1279
|
case 8:
|
|
1267
1280
|
try {
|
|
1268
1281
|
if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
|
|
1269
1282
|
}
|
|
1270
|
-
finally { if (
|
|
1283
|
+
finally { if (e_20) throw e_20.error; }
|
|
1271
1284
|
return [7 /*endfinally*/];
|
|
1272
1285
|
case 9:
|
|
1273
1286
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 11];
|
|
@@ -1290,12 +1303,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1290
1303
|
}
|
|
1291
1304
|
}
|
|
1292
1305
|
}
|
|
1293
|
-
catch (
|
|
1306
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1294
1307
|
finally {
|
|
1295
1308
|
try {
|
|
1296
1309
|
if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
|
|
1297
1310
|
}
|
|
1298
|
-
finally { if (
|
|
1311
|
+
finally { if (e_21) throw e_21.error; }
|
|
1299
1312
|
}
|
|
1300
1313
|
if (this.info.idMetadata.field instanceof column_1.CompoundIdField)
|
|
1301
1314
|
delete (d.id);
|
|
@@ -1366,8 +1379,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1366
1379
|
};
|
|
1367
1380
|
rowHelperImplementation.prototype.delete = function () {
|
|
1368
1381
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1369
|
-
var _a, _b, listener,
|
|
1370
|
-
var
|
|
1382
|
+
var _a, _b, listener, e_22_1, err_2;
|
|
1383
|
+
var e_22, _c;
|
|
1371
1384
|
return tslib_1.__generator(this, function (_d) {
|
|
1372
1385
|
switch (_d.label) {
|
|
1373
1386
|
case 0:
|
|
@@ -1409,14 +1422,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1409
1422
|
return [3 /*break*/, 8];
|
|
1410
1423
|
case 11: return [3 /*break*/, 14];
|
|
1411
1424
|
case 12:
|
|
1412
|
-
|
|
1413
|
-
|
|
1425
|
+
e_22_1 = _d.sent();
|
|
1426
|
+
e_22 = { error: e_22_1 };
|
|
1414
1427
|
return [3 /*break*/, 14];
|
|
1415
1428
|
case 13:
|
|
1416
1429
|
try {
|
|
1417
1430
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1418
1431
|
}
|
|
1419
|
-
finally { if (
|
|
1432
|
+
finally { if (e_22) throw e_22.error; }
|
|
1420
1433
|
return [7 /*endfinally*/];
|
|
1421
1434
|
case 14:
|
|
1422
1435
|
this._wasDeleted = true;
|
|
@@ -1434,8 +1447,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1434
1447
|
};
|
|
1435
1448
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
1436
1449
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1437
|
-
var _a, _b, col, lu,
|
|
1438
|
-
var
|
|
1450
|
+
var _a, _b, col, lu, e_23_1;
|
|
1451
|
+
var e_23, _c;
|
|
1439
1452
|
return tslib_1.__generator(this, function (_d) {
|
|
1440
1453
|
switch (_d.label) {
|
|
1441
1454
|
case 0:
|
|
@@ -1470,14 +1483,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1470
1483
|
return [3 /*break*/, 1];
|
|
1471
1484
|
case 9: return [3 /*break*/, 12];
|
|
1472
1485
|
case 10:
|
|
1473
|
-
|
|
1474
|
-
|
|
1486
|
+
e_23_1 = _d.sent();
|
|
1487
|
+
e_23 = { error: e_23_1 };
|
|
1475
1488
|
return [3 /*break*/, 12];
|
|
1476
1489
|
case 11:
|
|
1477
1490
|
try {
|
|
1478
1491
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1479
1492
|
}
|
|
1480
|
-
finally { if (
|
|
1493
|
+
finally { if (e_23) throw e_23.error; }
|
|
1481
1494
|
return [7 /*endfinally*/];
|
|
1482
1495
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
1483
1496
|
case 13:
|
|
@@ -1497,8 +1510,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1497
1510
|
};
|
|
1498
1511
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
1499
1512
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1500
|
-
var _a, _b, col, _c, _d,
|
|
1501
|
-
var
|
|
1513
|
+
var _a, _b, col, _c, _d, e_24_1;
|
|
1514
|
+
var e_24, _e;
|
|
1502
1515
|
return tslib_1.__generator(this, function (_f) {
|
|
1503
1516
|
switch (_f.label) {
|
|
1504
1517
|
case 0:
|
|
@@ -1523,14 +1536,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1523
1536
|
return [3 /*break*/, 2];
|
|
1524
1537
|
case 5: return [3 /*break*/, 8];
|
|
1525
1538
|
case 6:
|
|
1526
|
-
|
|
1527
|
-
|
|
1539
|
+
e_24_1 = _f.sent();
|
|
1540
|
+
e_24 = { error: e_24_1 };
|
|
1528
1541
|
return [3 /*break*/, 8];
|
|
1529
1542
|
case 7:
|
|
1530
1543
|
try {
|
|
1531
1544
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1532
1545
|
}
|
|
1533
|
-
finally { if (
|
|
1546
|
+
finally { if (e_24) throw e_24.error; }
|
|
1534
1547
|
return [7 /*endfinally*/];
|
|
1535
1548
|
case 8: return [2 /*return*/];
|
|
1536
1549
|
}
|
|
@@ -1543,7 +1556,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1543
1556
|
return this._isNew;
|
|
1544
1557
|
};
|
|
1545
1558
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
1546
|
-
var
|
|
1559
|
+
var e_25, _a;
|
|
1547
1560
|
var _b;
|
|
1548
1561
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
1549
1562
|
try {
|
|
@@ -1553,19 +1566,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1553
1566
|
return true;
|
|
1554
1567
|
}
|
|
1555
1568
|
}
|
|
1556
|
-
catch (
|
|
1569
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1557
1570
|
finally {
|
|
1558
1571
|
try {
|
|
1559
1572
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1560
1573
|
}
|
|
1561
|
-
finally { if (
|
|
1574
|
+
finally { if (e_25) throw e_25.error; }
|
|
1562
1575
|
}
|
|
1563
1576
|
return false;
|
|
1564
1577
|
};
|
|
1565
1578
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
1566
1579
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1567
|
-
var _a, _b, c, col,
|
|
1568
|
-
var
|
|
1580
|
+
var _a, _b, c, col, e_26_1, _c, _d, listener, e_27_1;
|
|
1581
|
+
var e_26, _e, e_27, _f;
|
|
1569
1582
|
return tslib_1.__generator(this, function (_g) {
|
|
1570
1583
|
switch (_g.label) {
|
|
1571
1584
|
case 0:
|
|
@@ -1586,14 +1599,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1586
1599
|
return [3 /*break*/, 1];
|
|
1587
1600
|
case 4: return [3 /*break*/, 7];
|
|
1588
1601
|
case 5:
|
|
1589
|
-
|
|
1590
|
-
|
|
1602
|
+
e_26_1 = _g.sent();
|
|
1603
|
+
e_26 = { error: e_26_1 };
|
|
1591
1604
|
return [3 /*break*/, 7];
|
|
1592
1605
|
case 6:
|
|
1593
1606
|
try {
|
|
1594
1607
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
1595
1608
|
}
|
|
1596
|
-
finally { if (
|
|
1609
|
+
finally { if (e_26) throw e_26.error; }
|
|
1597
1610
|
return [7 /*endfinally*/];
|
|
1598
1611
|
case 7:
|
|
1599
1612
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -1620,14 +1633,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
1620
1633
|
return [3 /*break*/, 11];
|
|
1621
1634
|
case 14: return [3 /*break*/, 17];
|
|
1622
1635
|
case 15:
|
|
1623
|
-
|
|
1624
|
-
|
|
1636
|
+
e_27_1 = _g.sent();
|
|
1637
|
+
e_27 = { error: e_27_1 };
|
|
1625
1638
|
return [3 /*break*/, 17];
|
|
1626
1639
|
case 16:
|
|
1627
1640
|
try {
|
|
1628
1641
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
1629
1642
|
}
|
|
1630
|
-
finally { if (
|
|
1643
|
+
finally { if (e_27) throw e_27.error; }
|
|
1631
1644
|
return [7 /*endfinally*/];
|
|
1632
1645
|
case 17: return [2 /*return*/];
|
|
1633
1646
|
}
|
|
@@ -1669,7 +1682,7 @@ exports.getControllerRef = getControllerRef;
|
|
|
1669
1682
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
1670
1683
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
1671
1684
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
1672
|
-
var _a,
|
|
1685
|
+
var _a, e_28, _b;
|
|
1673
1686
|
var _this = _super.call(this, columnsInfo, instance, remult) || this;
|
|
1674
1687
|
var _items = [];
|
|
1675
1688
|
var r = (_a = {
|
|
@@ -1684,20 +1697,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1684
1697
|
_items.push(r[col.key] = new FieldRefImplementation(col, new columnDefsImpl(col, undefined, remult), instance, undefined, _this));
|
|
1685
1698
|
}
|
|
1686
1699
|
}
|
|
1687
|
-
catch (
|
|
1700
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
1688
1701
|
finally {
|
|
1689
1702
|
try {
|
|
1690
1703
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
1691
1704
|
}
|
|
1692
|
-
finally { if (
|
|
1705
|
+
finally { if (e_28) throw e_28.error; }
|
|
1693
1706
|
}
|
|
1694
1707
|
_this.fields = r;
|
|
1695
1708
|
return _this;
|
|
1696
1709
|
}
|
|
1697
1710
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
1698
1711
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1699
|
-
var _a, _b, col,
|
|
1700
|
-
var
|
|
1712
|
+
var _a, _b, col, e_29_1;
|
|
1713
|
+
var e_29, _c;
|
|
1701
1714
|
return tslib_1.__generator(this, function (_d) {
|
|
1702
1715
|
switch (_d.label) {
|
|
1703
1716
|
case 0:
|
|
@@ -1717,14 +1730,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
1717
1730
|
return [3 /*break*/, 1];
|
|
1718
1731
|
case 4: return [3 /*break*/, 7];
|
|
1719
1732
|
case 5:
|
|
1720
|
-
|
|
1721
|
-
|
|
1733
|
+
e_29_1 = _d.sent();
|
|
1734
|
+
e_29 = { error: e_29_1 };
|
|
1722
1735
|
return [3 /*break*/, 7];
|
|
1723
1736
|
case 6:
|
|
1724
1737
|
try {
|
|
1725
1738
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1726
1739
|
}
|
|
1727
|
-
finally { if (
|
|
1740
|
+
finally { if (e_29) throw e_29.error; }
|
|
1728
1741
|
return [7 /*endfinally*/];
|
|
1729
1742
|
case 7: return [2 /*return*/];
|
|
1730
1743
|
}
|
|
@@ -1883,8 +1896,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
1883
1896
|
};
|
|
1884
1897
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
1885
1898
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1886
|
-
var x, _a, _b, v,
|
|
1887
|
-
var
|
|
1899
|
+
var x, _a, _b, v, e_30_1;
|
|
1900
|
+
var e_30, _c;
|
|
1888
1901
|
return tslib_1.__generator(this, function (_d) {
|
|
1889
1902
|
switch (_d.label) {
|
|
1890
1903
|
case 0:
|
|
@@ -1907,14 +1920,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
1907
1920
|
return [3 /*break*/, 2];
|
|
1908
1921
|
case 5: return [3 /*break*/, 8];
|
|
1909
1922
|
case 6:
|
|
1910
|
-
|
|
1911
|
-
|
|
1923
|
+
e_30_1 = _d.sent();
|
|
1924
|
+
e_30 = { error: e_30_1 };
|
|
1912
1925
|
return [3 /*break*/, 8];
|
|
1913
1926
|
case 7:
|
|
1914
1927
|
try {
|
|
1915
1928
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
1916
1929
|
}
|
|
1917
|
-
finally { if (
|
|
1930
|
+
finally { if (e_30) throw e_30.error; }
|
|
1918
1931
|
return [7 /*endfinally*/];
|
|
1919
1932
|
case 8: return [3 /*break*/, 11];
|
|
1920
1933
|
case 9:
|
|
@@ -2041,7 +2054,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
2041
2054
|
exports.columnDefsImpl = columnDefsImpl;
|
|
2042
2055
|
var EntityFullInfo = /** @class */ (function () {
|
|
2043
2056
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
2044
|
-
var _a,
|
|
2057
|
+
var _a, e_31, _b;
|
|
2045
2058
|
var _this = this;
|
|
2046
2059
|
this.columnsInfo = columnsInfo;
|
|
2047
2060
|
this.entityInfo = entityInfo;
|
|
@@ -2111,12 +2124,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
2111
2124
|
_items.push(r[x.key] = new columnDefsImpl(x, this, remult));
|
|
2112
2125
|
}
|
|
2113
2126
|
}
|
|
2114
|
-
catch (
|
|
2127
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2115
2128
|
finally {
|
|
2116
2129
|
try {
|
|
2117
2130
|
if (columnsInfo_3_1 && !columnsInfo_3_1.done && (_b = columnsInfo_3.return)) _b.call(columnsInfo_3);
|
|
2118
2131
|
}
|
|
2119
|
-
finally { if (
|
|
2132
|
+
finally { if (e_31) throw e_31.error; }
|
|
2120
2133
|
}
|
|
2121
2134
|
this.fields = r;
|
|
2122
2135
|
this.caption = buildCaption(entityInfo.caption, this.key, remult);
|
|
@@ -2290,7 +2303,7 @@ function ValueListFieldType() {
|
|
|
2290
2303
|
exports.ValueListFieldType = ValueListFieldType;
|
|
2291
2304
|
var ValueListInfo = /** @class */ (function () {
|
|
2292
2305
|
function ValueListInfo(valueListType) {
|
|
2293
|
-
var
|
|
2306
|
+
var e_32, _a, _b;
|
|
2294
2307
|
var _this = this;
|
|
2295
2308
|
this.valueListType = valueListType;
|
|
2296
2309
|
this.byIdMap = new Map();
|
|
@@ -2328,12 +2341,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
2328
2341
|
}
|
|
2329
2342
|
}
|
|
2330
2343
|
}
|
|
2331
|
-
catch (
|
|
2344
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2332
2345
|
finally {
|
|
2333
2346
|
try {
|
|
2334
2347
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
2335
2348
|
}
|
|
2336
|
-
finally { if (
|
|
2349
|
+
finally { if (e_32) throw e_32.error; }
|
|
2337
2350
|
}
|
|
2338
2351
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
2339
2352
|
throw new Error("ValueType " + this.valueListType + " has values without an id");
|
|
@@ -2450,7 +2463,7 @@ function Field(valueType) {
|
|
|
2450
2463
|
exports.Field = Field;
|
|
2451
2464
|
exports.storableMember = Symbol("storableMember");
|
|
2452
2465
|
function buildOptions(options, remult) {
|
|
2453
|
-
var
|
|
2466
|
+
var e_33, _a;
|
|
2454
2467
|
var r = {};
|
|
2455
2468
|
try {
|
|
2456
2469
|
for (var options_2 = tslib_1.__values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) {
|
|
@@ -2463,12 +2476,12 @@ function buildOptions(options, remult) {
|
|
|
2463
2476
|
}
|
|
2464
2477
|
}
|
|
2465
2478
|
}
|
|
2466
|
-
catch (
|
|
2479
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2467
2480
|
finally {
|
|
2468
2481
|
try {
|
|
2469
2482
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
2470
2483
|
}
|
|
2471
|
-
finally { if (
|
|
2484
|
+
finally { if (e_33) throw e_33.error; }
|
|
2472
2485
|
}
|
|
2473
2486
|
return r;
|
|
2474
2487
|
}
|
|
@@ -2566,7 +2579,7 @@ function Entity(key) {
|
|
|
2566
2579
|
}
|
|
2567
2580
|
}
|
|
2568
2581
|
var factory = function (remult) {
|
|
2569
|
-
var
|
|
2582
|
+
var e_34, _a;
|
|
2570
2583
|
var r = {};
|
|
2571
2584
|
try {
|
|
2572
2585
|
for (var options_3 = tslib_1.__values(options), options_3_1 = options_3.next(); !options_3_1.done; options_3_1 = options_3.next()) {
|
|
@@ -2579,12 +2592,12 @@ function Entity(key) {
|
|
|
2579
2592
|
}
|
|
2580
2593
|
}
|
|
2581
2594
|
}
|
|
2582
|
-
catch (
|
|
2595
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2583
2596
|
finally {
|
|
2584
2597
|
try {
|
|
2585
2598
|
if (options_3_1 && !options_3_1.done && (_a = options_3.return)) _a.call(options_3);
|
|
2586
2599
|
}
|
|
2587
|
-
finally { if (
|
|
2600
|
+
finally { if (e_34) throw e_34.error; }
|
|
2588
2601
|
}
|
|
2589
2602
|
var base = Object.getPrototypeOf(target);
|
|
2590
2603
|
if (base) {
|
|
@@ -2690,9 +2703,9 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2690
2703
|
});
|
|
2691
2704
|
};
|
|
2692
2705
|
QueryResultImpl.prototype.forEach = function (what) {
|
|
2693
|
-
var
|
|
2706
|
+
var e_35, _a;
|
|
2694
2707
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2695
|
-
var i, _b, _c, x,
|
|
2708
|
+
var i, _b, _c, x, e_35_1;
|
|
2696
2709
|
return tslib_1.__generator(this, function (_d) {
|
|
2697
2710
|
switch (_d.label) {
|
|
2698
2711
|
case 0:
|
|
@@ -2714,8 +2727,8 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2714
2727
|
case 5: return [3 /*break*/, 2];
|
|
2715
2728
|
case 6: return [3 /*break*/, 13];
|
|
2716
2729
|
case 7:
|
|
2717
|
-
|
|
2718
|
-
|
|
2730
|
+
e_35_1 = _d.sent();
|
|
2731
|
+
e_35 = { error: e_35_1 };
|
|
2719
2732
|
return [3 /*break*/, 13];
|
|
2720
2733
|
case 8:
|
|
2721
2734
|
_d.trys.push([8, , 11, 12]);
|
|
@@ -2726,7 +2739,7 @@ var QueryResultImpl = /** @class */ (function () {
|
|
|
2726
2739
|
_d.label = 10;
|
|
2727
2740
|
case 10: return [3 /*break*/, 12];
|
|
2728
2741
|
case 11:
|
|
2729
|
-
if (
|
|
2742
|
+
if (e_35) throw e_35.error;
|
|
2730
2743
|
return [7 /*endfinally*/];
|
|
2731
2744
|
case 12: return [7 /*endfinally*/];
|
|
2732
2745
|
case 13: return [2 /*return*/, i];
|