@vercube/serverless 0.0.24 → 0.0.26
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.
|
@@ -130,11 +130,10 @@ function getEventQuery(event) {
|
|
|
130
130
|
if (isV2Event(event) && typeof event.rawQueryString === "string") return event.rawQueryString;
|
|
131
131
|
const queryParams = event.queryStringParameters || {};
|
|
132
132
|
const multiValueParams = isV1Event(event) ? event.multiValueQueryStringParameters || {} : {};
|
|
133
|
-
|
|
133
|
+
return stringifyQuery({
|
|
134
134
|
...queryParams,
|
|
135
135
|
...multiValueParams
|
|
136
|
-
};
|
|
137
|
-
return stringifyQuery(combinedParams);
|
|
136
|
+
});
|
|
138
137
|
}
|
|
139
138
|
/**
|
|
140
139
|
* Converts API Gateway event headers to a standard Headers object.
|
|
@@ -262,8 +261,7 @@ async function convertBodyToAWSResponse(response) {
|
|
|
262
261
|
if (!response.body) return { body: DEFAULT_BODY };
|
|
263
262
|
try {
|
|
264
263
|
const buffer = await toBuffer(response.body);
|
|
265
|
-
|
|
266
|
-
if (isTextType(contentType)) return { body: buffer.toString(UTF8_ENCODING) };
|
|
264
|
+
if (isTextType(response.headers.get("content-type") || DEFAULT_CONTENT_TYPE)) return { body: buffer.toString(UTF8_ENCODING) };
|
|
267
265
|
else return {
|
|
268
266
|
body: buffer.toString(BASE64_ENCODING),
|
|
269
267
|
isBase64Encoded: true
|
|
@@ -184,8 +184,7 @@ function convertResponseToAzureFunctionsResponse(response) {
|
|
|
184
184
|
function toServerlessHandler(app) {
|
|
185
185
|
return async (event) => {
|
|
186
186
|
const request = convertEventToRequest(event);
|
|
187
|
-
|
|
188
|
-
return convertResponseToAzureFunctionsResponse(response);
|
|
187
|
+
return convertResponseToAzureFunctionsResponse(await app.fetch(request));
|
|
189
188
|
};
|
|
190
189
|
}
|
|
191
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/serverless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "Serverless module for Vercube framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"ufo": "1.6.1",
|
|
39
|
-
"@vercube/
|
|
40
|
-
"@vercube/
|
|
39
|
+
"@vercube/di": "0.0.26",
|
|
40
|
+
"@vercube/core": "0.0.26"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@azure/functions": "4.8.0",
|
|
44
|
-
"@types/aws-lambda": "8.10.
|
|
44
|
+
"@types/aws-lambda": "8.10.155"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|