@mono-labs/dev 0.1.259 → 0.1.261
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":"event-synthesizer.d.ts","sourceRoot":"","sources":["../../src/local-server/event-synthesizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAUlE,iEAAiE;AACjE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"event-synthesizer.d.ts","sourceRoot":"","sources":["../../src/local-server/event-synthesizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAUlE,iEAAiE;AACjE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,sBAAsB,CAqC9E;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,QAAQ,CAoBzD"}
|
|
@@ -6,7 +6,8 @@ const aws_event_synthesis_1 = require("../aws-event-synthesis");
|
|
|
6
6
|
/** Synthesize an API Gateway V2 event from an Express request */
|
|
7
7
|
function synthesizeApiGatewayEvent(req) {
|
|
8
8
|
const headers = (0, aws_event_synthesis_1.flattenHeaders)(req.headers);
|
|
9
|
-
const
|
|
9
|
+
const hasBody = req.method !== 'GET' && req.method !== 'HEAD';
|
|
10
|
+
const body = hasBody ? (0, aws_event_synthesis_1.serializeBody)(req.body) : null;
|
|
10
11
|
const queryParams = (0, aws_event_synthesis_1.extractQueryParams)(req.query);
|
|
11
12
|
const { path, queryString } = (0, aws_event_synthesis_1.splitUrl)(req.originalUrl);
|
|
12
13
|
const requestId = (0, aws_event_synthesis_1.generateRequestId)();
|
|
@@ -43,7 +44,8 @@ function synthesizeApiGatewayEvent(req) {
|
|
|
43
44
|
/** Synthesize an ALB event from an Express request */
|
|
44
45
|
function synthesizeALBEvent(req) {
|
|
45
46
|
const headers = (0, aws_event_synthesis_1.flattenHeaders)(req.headers);
|
|
46
|
-
const
|
|
47
|
+
const hasBody = req.method !== 'GET' && req.method !== 'HEAD';
|
|
48
|
+
const body = hasBody ? (0, aws_event_synthesis_1.serializeBody)(req.body) : null;
|
|
47
49
|
const queryParams = (0, aws_event_synthesis_1.extractQueryParams)(req.query);
|
|
48
50
|
const { path } = (0, aws_event_synthesis_1.splitUrl)(req.originalUrl);
|
|
49
51
|
return {
|
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
/** Synthesize an API Gateway V2 event from an Express request */
|
|
13
13
|
export function synthesizeApiGatewayEvent(req: Request): APIGatewayProxyEventV2 {
|
|
14
14
|
const headers = flattenHeaders(req.headers)
|
|
15
|
-
const
|
|
15
|
+
const hasBody = req.method !== 'GET' && req.method !== 'HEAD'
|
|
16
|
+
const body = hasBody ? serializeBody(req.body) : null
|
|
16
17
|
const queryParams = extractQueryParams(req.query as Record<string, unknown>)
|
|
17
18
|
const { path, queryString } = splitUrl(req.originalUrl)
|
|
18
19
|
const requestId = generateRequestId()
|
|
@@ -51,7 +52,8 @@ export function synthesizeApiGatewayEvent(req: Request): APIGatewayProxyEventV2
|
|
|
51
52
|
/** Synthesize an ALB event from an Express request */
|
|
52
53
|
export function synthesizeALBEvent(req: Request): ALBEvent {
|
|
53
54
|
const headers = flattenHeaders(req.headers)
|
|
54
|
-
const
|
|
55
|
+
const hasBody = req.method !== 'GET' && req.method !== 'HEAD'
|
|
56
|
+
const body = hasBody ? serializeBody(req.body) : null
|
|
55
57
|
const queryParams = extractQueryParams(req.query as Record<string, unknown>)
|
|
56
58
|
const { path } = splitUrl(req.originalUrl)
|
|
57
59
|
|