@easel-sh/cli 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"handler-wrapper.d.ts","sourceRoot":"","sources":["../src/handler-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAwQlE"}
1
+ {"version":3,"file":"handler-wrapper.d.ts","sourceRoot":"","sources":["../src/handler-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAgRlE"}
@@ -49,14 +49,12 @@ module.exports.handler = async (event, _context) => {
49
49
  }
50
50
 
51
51
  const queryParams = { ...(event.queryStringParameters || {}) };
52
- let path = "/";
53
- const matchedPath = normalizedHeaders["x-matched-path"];
54
- if (matchedPath) {
55
- path = matchedPath.startsWith("/") ? matchedPath : "/" + matchedPath;
56
- } else {
57
- path = isV2 ? event.rawPath || event.path || "/" : event.path || "/";
58
- }
59
-
52
+ // Prefer original client path from router when present so Lambda sees the same URL the client requested (event.rawPath may be wrong if event was built by API Gateway or an older gateway)
53
+ const originalPath = normalizedHeaders["x-router-original-path"];
54
+ const pathFromEvent = isV2 ? event.rawPath || event.path || "/" : event.path || "/";
55
+ const path = (originalPath && originalPath.trim())
56
+ ? (originalPath.trim().startsWith("/") ? originalPath.trim() : "/" + originalPath.trim())
57
+ : pathFromEvent;
60
58
  const host = event.headers?.host || event.headers?.["host"] || "localhost";
61
59
  const url = new URL(path, "http://" + host);
62
60
  Object.entries(queryParams).forEach(([key, value]) => {
@@ -77,6 +75,16 @@ module.exports.handler = async (event, _context) => {
77
75
  body: bodyBuffer && bodyBuffer.length > 0 ? bodyBuffer : undefined,
78
76
  });
79
77
 
78
+ const requestDetails = {
79
+ method: method,
80
+ url: requestUrl,
81
+ path: url.pathname,
82
+ query: queryParams,
83
+ headers: normalizedHeaders,
84
+ bodyLength: bodyBuffer ? bodyBuffer.length : 0,
85
+ };
86
+ console.log("[handler] reconstructed request:", JSON.stringify(requestDetails));
87
+
80
88
  // Vercel: named method export (e.g. export function GET(request) { ... })
81
89
  if (HTTP_METHODS.includes(method) && typeof mod[method] === "function") {
82
90
  const response = await Promise.resolve(mod[method](webRequest));
@@ -1 +1 @@
1
- {"version":3,"file":"handler-wrapper.js","sourceRoot":"","sources":["../src/handler-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3E,OAAO;;;;;;;;;;iCAUwB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2P3C,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"handler-wrapper.js","sourceRoot":"","sources":["../src/handler-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3E,OAAO;;;;;;;;;;iCAUwB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmQ3C,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easel-sh/cli",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "cli": "./dist/cli.js"