@webtypen/webframez-core 0.0.47 → 0.0.48

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.
@@ -190,8 +190,12 @@ class RouterFacade {
190
190
  if (!req && this.mode === "aws-lambda" && options && options.event) {
191
191
  customRequest = {
192
192
  method: options.event.requestContext.http.method,
193
- url: options.event.requestContext.http.path,
193
+ url: options.event.rawPath +
194
+ (options.event.rawQueryString && options.event.rawQueryString.trim() !== '' ?
195
+ "?" + options.event.rawQueryString
196
+ : ""),
194
197
  headers: options.event.headers,
198
+ urlParams: options.event.queryStringParameters ? options.event.queryStringParameters : {},
195
199
  };
196
200
  }
197
201
  if (!this.kernel) {
@@ -223,16 +227,18 @@ class RouterFacade {
223
227
  })
224
228
  : null;
225
229
  const urlParams = {};
226
- if (req && req.url && req.url.indexOf("?") > 0) {
227
- const temp = req.url.substring(req.url.indexOf("?") + 1);
228
- if (temp && temp.trim() !== "") {
229
- const entries = temp.split("&");
230
- for (let entry of entries) {
231
- if (entry.indexOf("=") > 0) {
232
- urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(entry.indexOf("=") + 1);
233
- }
234
- else {
235
- urlParams[entry] = true;
230
+ if (!customRequest) {
231
+ if (req && req.url && req.url.indexOf("?") > 0) {
232
+ const temp = req.url.substring(req.url.indexOf("?") + 1);
233
+ if (temp && temp.trim() !== "") {
234
+ const entries = temp.split("&");
235
+ for (let entry of entries) {
236
+ if (entry.indexOf("=") > 0) {
237
+ urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(entry.indexOf("=") + 1);
238
+ }
239
+ else {
240
+ urlParams[entry] = true;
241
+ }
236
242
  }
237
243
  }
238
244
  }
@@ -251,7 +257,8 @@ class RouterFacade {
251
257
  : {},
252
258
  bodyPlain: bodyPlain,
253
259
  params: route && route.params ? route.params : {},
254
- urlParams: urlParams,
260
+ url: customRequest.url,
261
+ urlParams: customRequest.urlParams,
255
262
  headers: customRequest.headers,
256
263
  method: customRequest.method,
257
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -227,8 +227,14 @@ class RouterFacade {
227
227
  if (!req && this.mode === "aws-lambda" && options && options.event) {
228
228
  customRequest = {
229
229
  method: options.event.requestContext.http.method,
230
- url: options.event.requestContext.http.path,
230
+ url:
231
+ options.event.rawPath +
232
+ (options.event.rawQueryString && options.event.rawQueryString.trim() !== '' ?
233
+ "?" + options.event.rawQueryString
234
+ : ""
235
+ ),
231
236
  headers: options.event.headers,
237
+ urlParams: options.event.queryStringParameters ? options.event.queryStringParameters : {},
232
238
  };
233
239
  }
234
240
 
@@ -267,17 +273,19 @@ class RouterFacade {
267
273
  : null;
268
274
 
269
275
  const urlParams: any = {};
270
- if (req && req.url && req.url.indexOf("?") > 0) {
271
- const temp = req.url.substring(req.url.indexOf("?") + 1);
272
- if (temp && temp.trim() !== "") {
273
- const entries = temp.split("&");
274
- for (let entry of entries) {
275
- if (entry.indexOf("=") > 0) {
276
- urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(
277
- entry.indexOf("=") + 1
278
- );
279
- } else {
280
- urlParams[entry] = true;
276
+ if (!customRequest) {
277
+ if (req && req.url && req.url.indexOf("?") > 0) {
278
+ const temp = req.url.substring(req.url.indexOf("?") + 1);
279
+ if (temp && temp.trim() !== "") {
280
+ const entries = temp.split("&");
281
+ for (let entry of entries) {
282
+ if (entry.indexOf("=") > 0) {
283
+ urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(
284
+ entry.indexOf("=") + 1
285
+ );
286
+ } else {
287
+ urlParams[entry] = true;
288
+ }
281
289
  }
282
290
  }
283
291
  }
@@ -299,10 +307,10 @@ class RouterFacade {
299
307
  : bodyPlain
300
308
  )
301
309
  : {},
302
-
303
310
  bodyPlain: bodyPlain,
304
311
  params: route && route.params ? route.params : {},
305
- urlParams: urlParams,
312
+ url: customRequest.url,
313
+ urlParams: customRequest.urlParams,
306
314
  headers: customRequest.headers,
307
315
  method: customRequest.method,
308
316
  }