@midwayjs/faas 3.0.0-beta.5 → 3.0.0-beta.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/CHANGELOG.md CHANGED
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.9](https://github.com/midwayjs/midway/compare/v3.0.0-beta.8...v3.0.0-beta.9) (2021-12-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * faas missing config in framework ([#1413](https://github.com/midwayjs/midway/issues/1413)) ([7ab16a2](https://github.com/midwayjs/midway/commit/7ab16a24b29d5254a762bfffcdf18385effdf639))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.0.0-beta.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
18
+
19
+ **Note:** Version bump only for package @midwayjs/faas
20
+
21
+
22
+
23
+
24
+
25
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
31
+
32
+
33
+
34
+
35
+
36
+ # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
37
+
38
+ **Note:** Version bump only for package @midwayjs/faas
39
+
40
+
41
+
42
+
43
+
6
44
  # [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
7
45
 
8
46
  **Note:** Version bump only for package @midwayjs/faas
@@ -32,7 +32,9 @@ let FaaSConfiguration = class FaaSConfiguration {
32
32
  }
33
33
  async onReady(container) { }
34
34
  async onServerReady() {
35
- await this.framework.run();
35
+ if (!this.framework.isEnable()) {
36
+ await this.framework.run();
37
+ }
36
38
  }
37
39
  };
38
40
  __decorate([
@@ -8,9 +8,10 @@ export declare class MidwayFaaSFramework extends BaseFramework<IMidwayFaaSApplic
8
8
  private lock;
9
9
  app: IMidwayFaaSApplication;
10
10
  private isReplaceLogger;
11
+ private developmentRun;
11
12
  environmentService: MidwayEnvironmentService;
12
13
  middlewareService: MidwayMiddlewareService<FaaSContext, any>;
13
- configure(options: IFaaSConfigurationOptions): void;
14
+ configure(options: IFaaSConfigurationOptions): any;
14
15
  isEnable(): boolean;
15
16
  applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>;
16
17
  run(): Promise<void>;
package/dist/framework.js CHANGED
@@ -22,12 +22,19 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
22
22
  this.funMappingStore = new Map();
23
23
  this.lock = new simple_lock_1.default();
24
24
  this.isReplaceLogger = process.env['MIDWAY_SERVERLESS_REPLACE_LOGGER'] === 'true';
25
+ this.developmentRun = false;
25
26
  }
26
27
  configure(options) {
27
- this.configurationOptions = options;
28
+ if (options) {
29
+ this.developmentRun = true;
30
+ this.configurationOptions = options;
31
+ }
32
+ else {
33
+ return this.configService.getConfiguration('faas');
34
+ }
28
35
  }
29
36
  isEnable() {
30
- return false;
37
+ return !this.developmentRun;
31
38
  }
32
39
  async applicationInitialize(options) {
33
40
  var _a;
@@ -110,11 +117,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
110
117
  return await fn(ctx, next);
111
118
  });
112
119
  const composeMiddleware = await this.middlewareService.compose(middlewareManager);
113
- const { error, result } = await composeMiddleware(context);
114
- if (error) {
115
- throw error;
116
- }
117
- return result;
120
+ return await composeMiddleware(context);
118
121
  };
119
122
  }
120
123
  /**
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@midwayjs/faas",
3
- "version": "3.0.0-beta.5",
3
+ "version": "3.0.0-beta.9",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "dependencies": {
7
- "@midwayjs/core": "^3.0.0-beta.5",
8
- "@midwayjs/faas-typings": "^3.0.0-beta.5",
9
- "@midwayjs/logger": "^3.0.0-beta.5",
7
+ "@midwayjs/core": "^3.0.0-beta.9",
8
+ "@midwayjs/faas-typings": "^3.0.0-beta.9",
9
+ "@midwayjs/logger": "^3.0.0-beta.9",
10
10
  "@midwayjs/simple-lock": "^1.1.4"
11
11
  },
12
12
  "devDependencies": {
13
- "@midwayjs/decorator": "^3.0.0-beta.5",
14
- "@midwayjs/mock": "^3.0.0-beta.5",
15
- "@midwayjs/serverless-fc-starter": "^3.0.0-beta.5",
16
- "@midwayjs/serverless-scf-starter": "^3.0.0-beta.5",
13
+ "@midwayjs/decorator": "^3.0.0-beta.9",
14
+ "@midwayjs/mock": "^3.0.0-beta.9",
15
+ "@midwayjs/serverless-fc-starter": "^3.0.0-beta.9",
16
+ "@midwayjs/serverless-scf-starter": "^3.0.0-beta.9",
17
17
  "mm": "3"
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": "ab0bf05ae6d13f6435db2f7223202be61d585a1b"
48
+ "gitHead": "d23e4a4fee58097b98461625c428a37d55535cec"
49
49
  }