@midwayjs/faas 3.0.0-beta.3 → 3.0.0-beta.7
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 +40 -0
- package/dist/configuration.js +1 -1
- package/dist/framework.d.ts +2 -2
- package/dist/framework.js +2 -12
- package/dist/interface.d.ts +2 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
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.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @midwayjs/faas
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @midwayjs/faas
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* add i18n ([#1375](https://github.com/midwayjs/midway/issues/1375)) ([bffefe0](https://github.com/midwayjs/midway/commit/bffefe07afe45777d49b5a76b9ab17fc2b9d9a55))
|
|
39
|
+
* auto transform args to type ([#1372](https://github.com/midwayjs/midway/issues/1372)) ([bb3f7d2](https://github.com/midwayjs/midway/commit/bb3f7d2028a034e1926d9df554849332354c3762))
|
|
40
|
+
* support global prefix url ([#1371](https://github.com/midwayjs/midway/issues/1371)) ([cc5fe44](https://github.com/midwayjs/midway/commit/cc5fe44e1d221590562dc71e1f33ae96093e0da7))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
# [3.0.0-beta.3](https://github.com/midwayjs/midway/compare/v3.0.0-beta.2...v3.0.0-beta.3) (2021-11-18)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @midwayjs/faas
|
package/dist/configuration.js
CHANGED
|
@@ -27,7 +27,7 @@ let FaaSConfiguration = class FaaSConfiguration {
|
|
|
27
27
|
this.framework.getLogger());
|
|
28
28
|
});
|
|
29
29
|
this.decoratorService.registerParameterHandler(decorator_1.WEB_ROUTER_PARAM_KEY, options => {
|
|
30
|
-
return (0, core_1.extractKoaLikeValue)(options.metadata.type, options.metadata.propertyData)(options.originArgs[0], options.originArgs[1]);
|
|
30
|
+
return (0, core_1.extractKoaLikeValue)(options.metadata.type, options.metadata.propertyData, options.originParamType)(options.originArgs[0], options.originArgs[1]);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
async onReady(container) { }
|
package/dist/framework.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class MidwayFaaSFramework extends BaseFramework<IMidwayFaaSApplic
|
|
|
9
9
|
app: IMidwayFaaSApplication;
|
|
10
10
|
private isReplaceLogger;
|
|
11
11
|
environmentService: MidwayEnvironmentService;
|
|
12
|
-
middlewareService: MidwayMiddlewareService<FaaSContext>;
|
|
12
|
+
middlewareService: MidwayMiddlewareService<FaaSContext, any>;
|
|
13
13
|
configure(options: IFaaSConfigurationOptions): void;
|
|
14
14
|
isEnable(): boolean;
|
|
15
15
|
applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>;
|
|
@@ -20,7 +20,7 @@ export declare class MidwayFaaSFramework extends BaseFramework<IMidwayFaaSApplic
|
|
|
20
20
|
* @deprecated
|
|
21
21
|
* @param middlewareId
|
|
22
22
|
*/
|
|
23
|
-
generateMiddleware(middlewareId: string): Promise<FunctionMiddleware<FaaSContext>>;
|
|
23
|
+
generateMiddleware(middlewareId: string): Promise<FunctionMiddleware<FaaSContext, any>>;
|
|
24
24
|
getContext(context: any): any;
|
|
25
25
|
private invokeHandler;
|
|
26
26
|
protected getFunctionHandler(ctx: any, args: any, target: any, method: any): string;
|
package/dist/framework.js
CHANGED
|
@@ -14,7 +14,6 @@ const core_1 = require("@midwayjs/core");
|
|
|
14
14
|
const decorator_1 = require("@midwayjs/decorator");
|
|
15
15
|
const simple_lock_1 = require("@midwayjs/simple-lock");
|
|
16
16
|
const logger_1 = require("@midwayjs/logger");
|
|
17
|
-
const middlewareManager_1 = require("@midwayjs/core/dist/util/middlewareManager");
|
|
18
17
|
const LOCK_KEY = '_faas_starter_start_key';
|
|
19
18
|
let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework {
|
|
20
19
|
constructor() {
|
|
@@ -73,11 +72,6 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
73
72
|
for (const funcInfo of functionList) {
|
|
74
73
|
this.funMappingStore.set(funcInfo.funcHandlerName, funcInfo);
|
|
75
74
|
}
|
|
76
|
-
// bind func and controller module
|
|
77
|
-
const routerModules = await collector.getRouterModules();
|
|
78
|
-
for (const module of routerModules) {
|
|
79
|
-
this.getApplicationContext().bindClass(module);
|
|
80
|
-
}
|
|
81
75
|
}, LOCK_KEY);
|
|
82
76
|
}
|
|
83
77
|
getFrameworkType() {
|
|
@@ -95,7 +89,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
95
89
|
const context = this.getContext(args.shift());
|
|
96
90
|
const isHttpFunction = !!(context.headers && context.get);
|
|
97
91
|
const globalMiddlewareFn = await this.getMiddleware();
|
|
98
|
-
const middlewareManager = new
|
|
92
|
+
const middlewareManager = new core_1.ContextMiddlewareManager();
|
|
99
93
|
middlewareManager.insertLast(globalMiddlewareFn);
|
|
100
94
|
middlewareManager.insertLast(async (ctx, next) => {
|
|
101
95
|
const fn = await this.middlewareService.compose([
|
|
@@ -116,11 +110,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
116
110
|
return await fn(ctx, next);
|
|
117
111
|
});
|
|
118
112
|
const composeMiddleware = await this.middlewareService.compose(middlewareManager);
|
|
119
|
-
|
|
120
|
-
if (error) {
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
123
|
-
return result;
|
|
113
|
+
return await composeMiddleware(context);
|
|
124
114
|
};
|
|
125
115
|
}
|
|
126
116
|
/**
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MidwayRequestContainer, IMidwayApplication, IConfigurationOptions, IMidwayContext } from '@midwayjs/core';
|
|
1
|
+
import { MidwayRequestContainer, IMidwayApplication, IConfigurationOptions, IMidwayContext, NextFunction as BaseNextFunction } from '@midwayjs/core';
|
|
2
2
|
import { FaaSHTTPContext } from '@midwayjs/faas-typings';
|
|
3
3
|
import { ILogger } from '@midwayjs/logger';
|
|
4
4
|
export interface FaaSContext extends IMidwayContext<FaaSHTTPContext> {
|
|
@@ -29,6 +29,7 @@ export interface Application extends IMidwayFaaSApplication {
|
|
|
29
29
|
}
|
|
30
30
|
export interface Context extends FaaSContext {
|
|
31
31
|
}
|
|
32
|
+
export declare type NextFunction = BaseNextFunction;
|
|
32
33
|
export interface IFaaSConfigurationOptions extends IConfigurationOptions {
|
|
33
34
|
config?: object;
|
|
34
35
|
initializeContext?: object;
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/faas",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@midwayjs/core": "^3.0.0-beta.
|
|
8
|
-
"@midwayjs/faas-typings": "^3.0.0-beta.
|
|
9
|
-
"@midwayjs/logger": "^3.0.0-beta.
|
|
7
|
+
"@midwayjs/core": "^3.0.0-beta.7",
|
|
8
|
+
"@midwayjs/faas-typings": "^3.0.0-beta.7",
|
|
9
|
+
"@midwayjs/logger": "^3.0.0-beta.7",
|
|
10
10
|
"@midwayjs/simple-lock": "^1.1.4"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/decorator": "^3.0.0-beta.
|
|
14
|
-
"@midwayjs/mock": "^3.0.0-beta.
|
|
15
|
-
"@midwayjs/serverless-fc-starter": "^3.0.0-beta.
|
|
16
|
-
"@midwayjs/serverless-scf-starter": "^3.0.0-beta.
|
|
13
|
+
"@midwayjs/decorator": "^3.0.0-beta.7",
|
|
14
|
+
"@midwayjs/mock": "^3.0.0-beta.7",
|
|
15
|
+
"@midwayjs/serverless-fc-starter": "^3.0.0-beta.7",
|
|
16
|
+
"@midwayjs/serverless-scf-starter": "^3.0.0-beta.7",
|
|
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": "
|
|
48
|
+
"gitHead": "24590729121d9110e2d960db5b5e587cf55a1efc"
|
|
49
49
|
}
|