@midwayjs/fc-starter 3.9.0 → 3.10.1

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { AbstractBootstrapStarter, FC } from '@midwayjs/faas';
2
3
  export * from './mock';
3
4
  export declare class BootstrapStarter extends AbstractBootstrapStarter {
@@ -5,5 +6,31 @@ export declare class BootstrapStarter extends AbstractBootstrapStarter {
5
6
  onInit(context: FC.InitializeContext, exports: any): Promise<void>;
6
7
  onRequest(event: any, context: any, oldContext: any): Promise<any>;
7
8
  onClose(): Promise<void>;
9
+ protected createDefaultMockContext(): {
10
+ requestId: string;
11
+ credentials: {
12
+ accessKeyId: string;
13
+ accessKeySecret: string;
14
+ securityToken: string;
15
+ };
16
+ function: {
17
+ name: string;
18
+ handler: string;
19
+ memory: number;
20
+ timeout: number;
21
+ initializer: string;
22
+ initializationTimeout: number;
23
+ };
24
+ service: {
25
+ name: string;
26
+ logProject: string;
27
+ logStore: string;
28
+ qualifier: string;
29
+ versionId: string;
30
+ };
31
+ region: string;
32
+ accountId: string;
33
+ logger: Console;
34
+ };
8
35
  }
9
36
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -49,7 +49,7 @@ class BootstrapStarter extends faas_1.AbstractBootstrapStarter {
49
49
  }
50
50
  return exports;
51
51
  }
52
- async onInit(context = (0, mock_1.mockContext)(), exports) {
52
+ async onInit(context = this.createDefaultMockContext(), exports) {
53
53
  const applicationAdapter = {
54
54
  getFunctionName() {
55
55
  return context.function.name;
@@ -211,6 +211,9 @@ class BootstrapStarter extends faas_1.AbstractBootstrapStarter {
211
211
  }
212
212
  }
213
213
  async onClose() { }
214
+ createDefaultMockContext() {
215
+ return (0, mock_1.mockContext)();
216
+ }
214
217
  }
215
218
  exports.BootstrapStarter = BootstrapStarter;
216
219
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@midwayjs/fc-starter",
3
- "version": "3.9.0",
3
+ "version": "3.10.1",
4
4
  "main": "dist/index",
5
5
  "typings": "dist/index.d.ts",
6
6
  "dependencies": {
7
- "@midwayjs/async-hooks-context-manager": "^3.9.0",
8
- "@midwayjs/faas": "^3.9.0",
7
+ "@midwayjs/async-hooks-context-manager": "^3.10.1",
8
+ "@midwayjs/faas": "^3.10.1",
9
9
  "raw-body": "2.5.1"
10
10
  },
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.9.0",
13
- "@midwayjs/serverless-http-parser": "^3.6.0"
12
+ "@midwayjs/core": "^3.10.1",
13
+ "@midwayjs/serverless-http-parser": "^3.10.0"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=12"
@@ -29,5 +29,5 @@
29
29
  "url": "git@github.com:midwayjs/midway.git"
30
30
  },
31
31
  "license": "MIT",
32
- "gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
32
+ "gitHead": "6bc9f7a97e4188399d2406f5a38bad5aeb983e07"
33
33
  }