@tsed/platform-serverless 8.46.1 → 8.46.3
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.
|
@@ -14,8 +14,8 @@ export class PlatformServerlessHandler {
|
|
|
14
14
|
const promisedHandler = this.params.compileHandler({ token, propertyKey });
|
|
15
15
|
return ($ctx) => {
|
|
16
16
|
return runInContext($ctx, async () => {
|
|
17
|
-
await $asyncEmit("$onRequest", $ctx);
|
|
18
17
|
try {
|
|
18
|
+
await $asyncEmit("$onRequest", [$ctx]);
|
|
19
19
|
const resolver = new AnyToPromise();
|
|
20
20
|
const handler = await promisedHandler;
|
|
21
21
|
const result = await resolver.call(() => handler({ $ctx }));
|
|
@@ -32,9 +32,13 @@ export class PlatformServerlessHandler {
|
|
|
32
32
|
}
|
|
33
33
|
async flush($ctx) {
|
|
34
34
|
const body = $ctx.isHttpEvent() && !$ctx.isAuthorizerEvent() ? await this.makeHttpResponse($ctx) : $ctx.response.getBody();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
try {
|
|
36
|
+
await $asyncEmit("$onResponse", [$ctx]);
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
$ctx.logger.flush();
|
|
40
|
+
$ctx.destroy();
|
|
41
|
+
}
|
|
38
42
|
if (!$ctx.isHttpEvent() && $ctx.response.statusCode >= 400 && body) {
|
|
39
43
|
throw new Error(body.message);
|
|
40
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-serverless",
|
|
3
|
-
"version": "8.46.
|
|
3
|
+
"version": "8.46.3",
|
|
4
4
|
"description": "Platform serverless module for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -23,23 +23,23 @@
|
|
|
23
23
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tsed/core": "8.46.
|
|
27
|
-
"@tsed/di": "8.46.
|
|
28
|
-
"@tsed/exceptions": "8.46.
|
|
29
|
-
"@tsed/hooks": "8.46.
|
|
30
|
-
"@tsed/json-mapper": "8.46.
|
|
31
|
-
"@tsed/platform-exceptions": "8.46.
|
|
32
|
-
"@tsed/platform-params": "8.46.
|
|
33
|
-
"@tsed/schema": "8.46.
|
|
26
|
+
"@tsed/core": "8.46.3",
|
|
27
|
+
"@tsed/di": "8.46.3",
|
|
28
|
+
"@tsed/exceptions": "8.46.3",
|
|
29
|
+
"@tsed/hooks": "8.46.3",
|
|
30
|
+
"@tsed/json-mapper": "8.46.3",
|
|
31
|
+
"@tsed/platform-exceptions": "8.46.3",
|
|
32
|
+
"@tsed/platform-params": "8.46.3",
|
|
33
|
+
"@tsed/schema": "8.46.3",
|
|
34
34
|
"encodeurl": "^2.0.0",
|
|
35
35
|
"mime": "^4.0.4",
|
|
36
36
|
"tslib": ">=2.7.0",
|
|
37
37
|
"uuid": "^14.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@tsed/barrels": "8.46.
|
|
41
|
-
"@tsed/platform-serverless-testing": "8.46.
|
|
42
|
-
"@tsed/typescript": "8.46.
|
|
40
|
+
"@tsed/barrels": "8.46.3",
|
|
41
|
+
"@tsed/platform-serverless-testing": "8.46.3",
|
|
42
|
+
"@tsed/typescript": "8.46.3",
|
|
43
43
|
"@types/aws-lambda": "^8.10.145",
|
|
44
44
|
"@types/encodeurl": "^1.0.2",
|
|
45
45
|
"@types/mime": "^4.0.0",
|