@midwayjs/faas 3.8.0 → 3.9.0
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 +5 -4
- package/dist/interface.d.ts +0 -2
- package/package.json +6 -6
package/dist/framework.js
CHANGED
|
@@ -107,12 +107,13 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
107
107
|
}
|
|
108
108
|
if (funcInfo) {
|
|
109
109
|
return async (...args) => {
|
|
110
|
-
const context = this.app.createAnonymousContext(
|
|
111
|
-
return this.invokeTriggerFunction(context, funcInfo.funcHandlerName, {
|
|
112
|
-
isHttpFunction: false,
|
|
110
|
+
const context = this.app.createAnonymousContext({
|
|
113
111
|
originContext: customContext,
|
|
114
112
|
originEvent: args[0],
|
|
115
113
|
});
|
|
114
|
+
return this.invokeTriggerFunction(context, funcInfo.funcHandlerName, {
|
|
115
|
+
isHttpFunction: false,
|
|
116
|
+
});
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
},
|
|
@@ -245,7 +246,7 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
245
246
|
args = [ctx];
|
|
246
247
|
}
|
|
247
248
|
else {
|
|
248
|
-
args = [
|
|
249
|
+
args = [ctx.originEvent, ctx.originContext];
|
|
249
250
|
}
|
|
250
251
|
// invoke handler
|
|
251
252
|
const result = await this.invokeHandler(funOptions, ctx, args, isHttpFunction);
|
package/dist/interface.d.ts
CHANGED
|
@@ -14,8 +14,6 @@ export interface FaaSContext extends IMidwayContext<FaaSHTTPContext> {
|
|
|
14
14
|
export declare type FaaSMiddleware = ((context: Context, next: () => Promise<any>) => any) | string;
|
|
15
15
|
export interface HandlerOptions {
|
|
16
16
|
isHttpFunction: boolean;
|
|
17
|
-
originEvent: any;
|
|
18
|
-
originContext: any;
|
|
19
17
|
}
|
|
20
18
|
export declare type IMidwayFaaSApplication = IMidwayApplication<Context, {
|
|
21
19
|
getInitializeContext(): any;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/faas",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@midwayjs/core": "^3.
|
|
7
|
+
"@midwayjs/core": "^3.9.0",
|
|
8
8
|
"@midwayjs/faas-typings": "^3.6.0",
|
|
9
9
|
"@midwayjs/logger": "^2.15.0",
|
|
10
10
|
"@midwayjs/serverless-http-parser": "^3.6.0",
|
|
11
11
|
"@midwayjs/simple-lock": "^1.1.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@midwayjs/mock": "^3.
|
|
15
|
-
"@midwayjs/serverless-fc-starter": "^3.
|
|
14
|
+
"@midwayjs/mock": "^3.9.0",
|
|
15
|
+
"@midwayjs/serverless-fc-starter": "^3.9.0",
|
|
16
16
|
"@midwayjs/serverless-scf-starter": "^3.7.0",
|
|
17
|
-
"mm": "3.2.
|
|
17
|
+
"mm": "3.2.1"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=12"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"url": "git@github.com:midwayjs/midway.git"
|
|
46
46
|
},
|
|
47
47
|
"license": "MIT",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
|
|
49
49
|
}
|