@midwayjs/faas 3.10.9 → 3.10.11

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,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Context, IFaaSConfigurationOptions, Application, NextFunction, HandlerOptions, HttpResponseFormat } from './interface';
2
+ import { Context, IFaaSConfigurationOptions, Application, NextFunction, HandlerOptions, HttpResponseFormat, wrapHttpRequestOptions } from './interface';
3
3
  import { BaseFramework, CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, MidwayEnvironmentService, MidwayFrameworkType, MidwayMiddlewareService, RouterInfo } from '@midwayjs/core';
4
4
  import { LoggerOptions } from '@midwayjs/logger';
5
5
  import * as http from 'http';
@@ -36,7 +36,7 @@ export declare class MidwayFaaSFramework extends BaseFramework<Application, Cont
36
36
  formatHttpResponse(context: any, options?: {
37
37
  supportBufferResponse?: boolean;
38
38
  }): HttpResponseFormat;
39
- wrapHttpRequest(req: http.IncomingMessage | Record<string, any>, res?: http.ServerResponse | Record<string, any>): Promise<unknown>;
39
+ wrapHttpRequest(req: http.IncomingMessage | Record<string, any>, res?: http.ServerResponse | Record<string, any>, options?: wrapHttpRequestOptions): Promise<unknown>;
40
40
  /**
41
41
  * @deprecated
42
42
  * @param middlewareId
package/dist/framework.js CHANGED
@@ -312,9 +312,9 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
312
312
  body: context.body,
313
313
  };
314
314
  }
315
- async wrapHttpRequest(req, res) {
315
+ async wrapHttpRequest(req, res, options) {
316
316
  const newReq = res ? new serverless_http_parser_1.HTTPRequest(req, res) : req;
317
- const newRes = new serverless_http_parser_1.HTTPResponse();
317
+ const newRes = new serverless_http_parser_1.HTTPResponse(options);
318
318
  return this.createHttpContext(newReq, newRes);
319
319
  }
320
320
  /**
@@ -1,7 +1,7 @@
1
1
  import { MidwayRequestContainer, IMidwayApplication, IConfigurationOptions, IMidwayContext, NextFunction as BaseNextFunction, CommonMiddlewareUnion, ContextMiddlewareManager, IMidwayBootstrapOptions, ObjectIdentifier } from '@midwayjs/core';
2
2
  import { FaaSHTTPContext } from '@midwayjs/faas-typings';
3
3
  import { ILogger } from '@midwayjs/logger';
4
- import { Application as ServerlessHttpApplication } from '@midwayjs/serverless-http-parser';
4
+ import { Application as ServerlessHttpApplication, HttpResponseOptions } from '@midwayjs/serverless-http-parser';
5
5
  export interface FaaSContext extends IMidwayContext<FaaSHTTPContext> {
6
6
  logger: ILogger;
7
7
  env: string;
@@ -90,4 +90,6 @@ export interface HttpResponseFormat<T = unknown> {
90
90
  headers: Record<string, string>;
91
91
  body: T;
92
92
  }
93
+ export interface wrapHttpRequestOptions extends HttpResponseOptions {
94
+ }
93
95
  //# sourceMappingURL=interface.d.ts.map
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@midwayjs/faas",
3
- "version": "3.10.9",
3
+ "version": "3.10.11",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "dependencies": {
7
- "@midwayjs/core": "^3.10.9",
8
- "@midwayjs/faas-typings": "^3.6.0",
7
+ "@midwayjs/core": "^3.10.10",
8
+ "@midwayjs/faas-typings": "^3.10.11",
9
9
  "@midwayjs/logger": "^2.15.0",
10
- "@midwayjs/serverless-http-parser": "^3.10.0",
10
+ "@midwayjs/serverless-http-parser": "^3.10.11",
11
11
  "@midwayjs/simple-lock": "^1.1.4"
12
12
  },
13
13
  "devDependencies": {
14
- "@midwayjs/mock": "^3.10.9",
15
- "@midwayjs/serverless-fc-starter": "^3.10.9",
16
- "@midwayjs/serverless-scf-starter": "^3.10.0",
14
+ "@midwayjs/mock": "^3.10.11",
15
+ "@midwayjs/serverless-fc-starter": "^3.10.11",
16
+ "@midwayjs/serverless-scf-starter": "^3.10.11",
17
17
  "mm": "3.2.1"
18
18
  },
19
19
  "engines": {
@@ -45,5 +45,5 @@
45
45
  "url": "git@github.com:midwayjs/midway.git"
46
46
  },
47
47
  "license": "MIT",
48
- "gitHead": "4c8368283bd5ff3c14c23080838e2567c3e9a749"
48
+ "gitHead": "df0db0aaa0e3ff168204e3d5cf1c534dccc9b15e"
49
49
  }