@midwayjs/faas 3.4.0-beta.5 → 3.4.0-beta.8
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.d.ts +0 -1
- package/dist/framework.js +4 -14
- package/package.json +8 -8
package/dist/framework.d.ts
CHANGED
package/dist/framework.js
CHANGED
|
@@ -26,7 +26,6 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
26
26
|
this.lock = new simple_lock_1.default();
|
|
27
27
|
this.isReplaceLogger = process.env['MIDWAY_SERVERLESS_REPLACE_LOGGER'] === 'true';
|
|
28
28
|
this.developmentRun = false;
|
|
29
|
-
this.serverlessRoutes = [];
|
|
30
29
|
this.httpMiddlewareManager = this.createMiddlewareManager();
|
|
31
30
|
this.eventMiddlewareManager = this.createMiddlewareManager();
|
|
32
31
|
this.legacyVersion = false;
|
|
@@ -128,13 +127,6 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
128
127
|
for (const funcInfo of functionList) {
|
|
129
128
|
// store handler
|
|
130
129
|
this.funMappingStore.set(funcInfo.funcHandlerName, funcInfo);
|
|
131
|
-
if (funcInfo.url) {
|
|
132
|
-
// store router
|
|
133
|
-
this.serverlessRoutes.push({
|
|
134
|
-
matchPattern: (0, core_1.pathToRegexp)(funcInfo.url, [], { end: false }),
|
|
135
|
-
funcInfo: funcInfo,
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
130
|
}
|
|
139
131
|
this.respond = this.app.callback();
|
|
140
132
|
}, LOCK_KEY);
|
|
@@ -198,12 +190,10 @@ let MidwayFaaSFramework = class MidwayFaaSFramework extends core_1.BaseFramework
|
|
|
198
190
|
var _a;
|
|
199
191
|
const isHttpFunction = options.isHttpFunction;
|
|
200
192
|
if (!funOptions && isHttpFunction) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
193
|
+
funOptions = await this.serverlessFunctionService.getMatchedRouterInfo(context.path, context.method);
|
|
194
|
+
if (funOptions) {
|
|
195
|
+
const matchRes = core_1.PathToRegexpUtil.match(funOptions.fullUrlFlattenString)(context.path);
|
|
196
|
+
context.req.pathParameters = matchRes['params'] || {};
|
|
207
197
|
}
|
|
208
198
|
}
|
|
209
199
|
if (!funOptions) {
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/faas",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.8",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@midwayjs/core": "^3.4.0-beta.
|
|
7
|
+
"@midwayjs/core": "^3.4.0-beta.8",
|
|
8
8
|
"@midwayjs/faas-typings": "^3.3.5",
|
|
9
9
|
"@midwayjs/logger": "^2.15.0",
|
|
10
|
-
"@midwayjs/serverless-http-parser": "^3.4.0-beta.
|
|
10
|
+
"@midwayjs/serverless-http-parser": "^3.4.0-beta.8",
|
|
11
11
|
"@midwayjs/simple-lock": "^1.1.4"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@midwayjs/decorator": "^3.4.0-beta.
|
|
15
|
-
"@midwayjs/mock": "^3.4.0-beta.
|
|
16
|
-
"@midwayjs/serverless-fc-starter": "^3.4.0-beta.
|
|
17
|
-
"@midwayjs/serverless-scf-starter": "^3.4.0-beta.
|
|
14
|
+
"@midwayjs/decorator": "^3.4.0-beta.8",
|
|
15
|
+
"@midwayjs/mock": "^3.4.0-beta.8",
|
|
16
|
+
"@midwayjs/serverless-fc-starter": "^3.4.0-beta.8",
|
|
17
|
+
"@midwayjs/serverless-scf-starter": "^3.4.0-beta.8",
|
|
18
18
|
"mm": "3.2.0"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"url": "git@github.com:midwayjs/midway.git"
|
|
47
47
|
},
|
|
48
48
|
"license": "MIT",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9e4ed69eca31022e4dc93ed52ac503fe25ae383e"
|
|
50
50
|
}
|