@midwayjs/faas 3.4.6 → 3.4.9
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.
- package/dist/framework.js +5 -2
- package/dist/interface.d.ts +1 -0
- package/package.json +5 -5
package/dist/framework.js
CHANGED
|
@@ -187,7 +187,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
187
187
|
getTriggerFunction(handlerMapping) {
|
|
188
188
|
let funOptions = this.funMappingStore.get(handlerMapping);
|
|
189
189
|
return async (context, options) => {
|
|
190
|
-
var _a;
|
|
190
|
+
var _a, _b;
|
|
191
191
|
const isHttpFunction = options.isHttpFunction;
|
|
192
192
|
if (!funOptions && isHttpFunction) {
|
|
193
193
|
funOptions = await this.serverlessFunctionService.getMatchedRouterInfo(context.path, context.method);
|
|
@@ -200,6 +200,9 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
200
200
|
throw new Error(`function handler = ${handlerMapping} not found`);
|
|
201
201
|
}
|
|
202
202
|
context = this.getContext(context);
|
|
203
|
+
if ((_a = this.configurationOptions.applicationAdapter) === null || _a === void 0 ? void 0 : _a.runContextHook) {
|
|
204
|
+
this.configurationOptions.applicationAdapter.runContextHook(context);
|
|
205
|
+
}
|
|
203
206
|
const result = await (await this.applyMiddleware(async (ctx, next) => {
|
|
204
207
|
const fn = await this.middlewareService.compose([
|
|
205
208
|
...(isHttpFunction
|
|
@@ -235,7 +238,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
235
238
|
return await fn(ctx, next);
|
|
236
239
|
}))(context);
|
|
237
240
|
if (isHttpFunction) {
|
|
238
|
-
if (!((
|
|
241
|
+
if (!((_b = context.response) === null || _b === void 0 ? void 0 : _b._explicitStatus)) {
|
|
239
242
|
if (context.body === null || context.body === 'undefined') {
|
|
240
243
|
context.body = '';
|
|
241
244
|
context.type = 'text';
|
package/dist/interface.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/faas",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.9",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@midwayjs/core": "^3.4.
|
|
7
|
+
"@midwayjs/core": "^3.4.9",
|
|
8
8
|
"@midwayjs/faas-typings": "^3.3.5",
|
|
9
9
|
"@midwayjs/logger": "^2.15.0",
|
|
10
10
|
"@midwayjs/serverless-http-parser": "^3.4.0",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@midwayjs/decorator": "^3.4.4",
|
|
15
|
-
"@midwayjs/mock": "^3.4.
|
|
16
|
-
"@midwayjs/serverless-fc-starter": "^3.4.
|
|
15
|
+
"@midwayjs/mock": "^3.4.9",
|
|
16
|
+
"@midwayjs/serverless-fc-starter": "^3.4.9",
|
|
17
17
|
"@midwayjs/serverless-scf-starter": "^3.4.4",
|
|
18
18
|
"mm": "3.2.0"
|
|
19
19
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"url": "git@github.com:midwayjs/midway.git"
|
|
47
47
|
},
|
|
48
48
|
"license": "MIT",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bc8113cff70d88a31e44bde69c395f61a7de2045"
|
|
50
50
|
}
|