@midwayjs/faas 3.4.7 → 3.4.10

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 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 (!((_a = context.response) === null || _a === void 0 ? void 0 : _a._explicitStatus)) {
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';
@@ -54,6 +54,7 @@ export interface IFaaSConfigurationOptions extends IConfigurationOptions {
54
54
  getFunctionName(): string;
55
55
  getFunctionServiceName(): string;
56
56
  runAppHook?(app: Application): void;
57
+ runContextHook?(ctx: Context): void;
57
58
  };
58
59
  }
59
60
  /**
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@midwayjs/faas",
3
- "version": "3.4.7",
3
+ "version": "3.4.10",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "dependencies": {
7
- "@midwayjs/core": "^3.4.7",
7
+ "@midwayjs/core": "^3.4.10",
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.7",
16
- "@midwayjs/serverless-fc-starter": "^3.4.7",
15
+ "@midwayjs/mock": "^3.4.10",
16
+ "@midwayjs/serverless-fc-starter": "^3.4.10",
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": "3c60619a65c6776d99fbf0b30ac454d3cb6926b9"
49
+ "gitHead": "aeb117633ecbc3299002b220f436dc3b5450d361"
50
50
  }