remult 0.20.0-exp.5 → 0.20.0-exp.7
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/server/expressBridge.js +10 -2
- package/package.json +1 -1
- package/server/expressBridge.js +10 -2
|
@@ -256,6 +256,11 @@ export class RemultServerImplementation {
|
|
|
256
256
|
process(what) {
|
|
257
257
|
return async (req, origRes) => {
|
|
258
258
|
const genReq = this.coreOptions.buildGenericRequest(req);
|
|
259
|
+
if (!genReq.query) {
|
|
260
|
+
genReq.query = req["_tempQuery"];
|
|
261
|
+
}
|
|
262
|
+
if (!genReq.params)
|
|
263
|
+
genReq.params = req["_tempParams"];
|
|
259
264
|
let myReq = new ExpressRequestBridgeToDataApiRequest(genReq);
|
|
260
265
|
let myRes = new ExpressResponseBridgeToDataApiResponse(origRes, req);
|
|
261
266
|
await this.runWithRemult(async (remult) => {
|
|
@@ -286,7 +291,7 @@ export class RemultServerImplementation {
|
|
|
286
291
|
});
|
|
287
292
|
}
|
|
288
293
|
}
|
|
289
|
-
await what(remult, myReq, myRes,
|
|
294
|
+
await what(remult, myReq, myRes, req, origRes);
|
|
290
295
|
});
|
|
291
296
|
};
|
|
292
297
|
}
|
|
@@ -872,6 +877,7 @@ class RouteImplementation {
|
|
|
872
877
|
}
|
|
873
878
|
query[key] = [current, val];
|
|
874
879
|
});
|
|
880
|
+
origReq["_tempQuery"] = query;
|
|
875
881
|
req.query = query;
|
|
876
882
|
}
|
|
877
883
|
let lowerPath = path.toLowerCase();
|
|
@@ -890,8 +896,10 @@ class RouteImplementation {
|
|
|
890
896
|
if (m) {
|
|
891
897
|
let h = m.get(req.method.toLowerCase());
|
|
892
898
|
if (h) {
|
|
893
|
-
if (!req.params)
|
|
899
|
+
if (!req.params) {
|
|
894
900
|
req.params = {};
|
|
901
|
+
origReq["_tempParams"] = req.params;
|
|
902
|
+
}
|
|
895
903
|
req.params.id = path.substring(idPosition + 1);
|
|
896
904
|
h(origReq, res, next);
|
|
897
905
|
return;
|
package/package.json
CHANGED
package/server/expressBridge.js
CHANGED
|
@@ -478,6 +478,11 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
478
478
|
switch (_a.label) {
|
|
479
479
|
case 0:
|
|
480
480
|
genReq = this.coreOptions.buildGenericRequest(req);
|
|
481
|
+
if (!genReq.query) {
|
|
482
|
+
genReq.query = req["_tempQuery"];
|
|
483
|
+
}
|
|
484
|
+
if (!genReq.params)
|
|
485
|
+
genReq.params = req["_tempParams"];
|
|
481
486
|
myReq = new ExpressRequestBridgeToDataApiRequest(genReq);
|
|
482
487
|
myRes = new ExpressResponseBridgeToDataApiResponse(origRes, req);
|
|
483
488
|
return [4 /*yield*/, this.runWithRemult(function (remult) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
@@ -520,7 +525,7 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
520
525
|
case 5:
|
|
521
526
|
_b.sent();
|
|
522
527
|
_b.label = 6;
|
|
523
|
-
case 6: return [4 /*yield*/, what(remult, myReq, myRes,
|
|
528
|
+
case 6: return [4 /*yield*/, what(remult, myReq, myRes, req, origRes)];
|
|
524
529
|
case 7:
|
|
525
530
|
_b.sent();
|
|
526
531
|
return [2 /*return*/];
|
|
@@ -1246,6 +1251,7 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1246
1251
|
}
|
|
1247
1252
|
query_1[key] = [current, val];
|
|
1248
1253
|
});
|
|
1254
|
+
origReq["_tempQuery"] = query_1;
|
|
1249
1255
|
req.query = query_1;
|
|
1250
1256
|
}
|
|
1251
1257
|
var lowerPath = path.toLowerCase();
|
|
@@ -1264,8 +1270,10 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1264
1270
|
if (m) {
|
|
1265
1271
|
var h = m.get(req.method.toLowerCase());
|
|
1266
1272
|
if (h) {
|
|
1267
|
-
if (!req.params)
|
|
1273
|
+
if (!req.params) {
|
|
1268
1274
|
req.params = {};
|
|
1275
|
+
origReq["_tempParams"] = req.params;
|
|
1276
|
+
}
|
|
1269
1277
|
req.params.id = path.substring(idPosition + 1);
|
|
1270
1278
|
h(origReq, res, next);
|
|
1271
1279
|
return;
|