@midwayjs/fc-starter 3.7.3 → 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/index.js +9 -14
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -90,6 +90,14 @@ class BootstrapStarter extends faas_1.AbstractBootstrapStarter {
|
|
|
90
90
|
context.logger = console;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
let handlerName = (oldContext === null || oldContext === void 0 ? void 0 : oldContext.function.handler) || context.function.handler;
|
|
94
|
+
// 聚合部署的情况
|
|
95
|
+
if (this.options.aggregationHandlerName) {
|
|
96
|
+
if (this.options.handlerNameMapping) {
|
|
97
|
+
[handlerName, event, context, oldContext] =
|
|
98
|
+
this.options.handlerNameMapping(handlerName, event, context, oldContext);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
93
101
|
let ctx;
|
|
94
102
|
if (isHTTPMode) {
|
|
95
103
|
event.getOriginContext = () => {
|
|
@@ -126,22 +134,9 @@ class BootstrapStarter extends faas_1.AbstractBootstrapStarter {
|
|
|
126
134
|
logger: context.logger,
|
|
127
135
|
};
|
|
128
136
|
}
|
|
129
|
-
let handlerName = (oldContext === null || oldContext === void 0 ? void 0 : oldContext.function.handler) || context.function.handler;
|
|
130
|
-
// 聚合部署的情况
|
|
131
|
-
if (this.options.aggregationHandlerName) {
|
|
132
|
-
if (this.options.handlerNameMapping) {
|
|
133
|
-
[handlerName, event, context, oldContext] =
|
|
134
|
-
this.options.handlerNameMapping(handlerName, event, context, oldContext);
|
|
135
|
-
}
|
|
136
|
-
else if (isHTTPMode) {
|
|
137
|
-
handlerName = ctx.path;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
137
|
try {
|
|
141
|
-
const result = await this.framework.
|
|
138
|
+
const result = await this.framework.invokeTriggerFunction(ctx, handlerName, {
|
|
142
139
|
isHttpFunction: isHTTPMode || isApiGateway,
|
|
143
|
-
originEvent: event,
|
|
144
|
-
originContext: context,
|
|
145
140
|
});
|
|
146
141
|
if (isHTTPMode || isApiGateway) {
|
|
147
142
|
const { isBase64Encoded, statusCode, headers, body } = result;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/fc-starter",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@midwayjs/async-hooks-context-manager": "^3.
|
|
8
|
-
"@midwayjs/faas": "^3.
|
|
7
|
+
"@midwayjs/async-hooks-context-manager": "^3.9.0",
|
|
8
|
+
"@midwayjs/faas": "^3.9.0",
|
|
9
9
|
"raw-body": "2.5.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@midwayjs/core": "^3.
|
|
12
|
+
"@midwayjs/core": "^3.9.0",
|
|
13
13
|
"@midwayjs/serverless-http-parser": "^3.6.0"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"url": "git@github.com:midwayjs/midway.git"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5f6603d2c9606fc6fc7ece71f956e89e394efeee"
|
|
33
33
|
}
|