@midwayjs/core 3.10.7 → 3.10.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.
|
@@ -52,7 +52,7 @@ let MidwayServerlessFunctionService = class MidwayServerlessFunctionService exte
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
collectFunctionRoute(module) {
|
|
55
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
56
56
|
// serverlessTrigger metadata
|
|
57
57
|
const webRouterInfo = (0, decorator_1.getClassMetadata)(decorator_1.FUNC_KEY, module);
|
|
58
58
|
const controllerId = (0, decorator_1.getProviderName)(module);
|
|
@@ -93,19 +93,19 @@ let MidwayServerlessFunctionService = class MidwayServerlessFunctionService exte
|
|
|
93
93
|
responseMetadata: routerResponseData,
|
|
94
94
|
};
|
|
95
95
|
const functionMeta = (0, decorator_1.getPropertyMetadata)(decorator_1.SERVERLESS_FUNC_KEY, module, webRouter['methodName']) || {};
|
|
96
|
-
const functionName = (
|
|
96
|
+
const functionName = (_g = (_e = functionMeta['functionName']) !== null && _e !== void 0 ? _e : (_f = webRouter === null || webRouter === void 0 ? void 0 : webRouter['metadata']) === null || _f === void 0 ? void 0 : _f['functionName']) !== null && _g !== void 0 ? _g : createFunctionName(module, webRouter['methodName']);
|
|
97
97
|
data.functionName = functionName;
|
|
98
98
|
data.functionTriggerName = webRouter['type'];
|
|
99
99
|
data.functionTriggerMetadata = webRouter['metadata'];
|
|
100
100
|
data.functionMetadata = {
|
|
101
|
-
...functionMeta,
|
|
102
101
|
functionName,
|
|
102
|
+
...functionMeta,
|
|
103
103
|
};
|
|
104
104
|
this.checkDuplicateAndPush(prefix, data);
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
const functionMeta = (0, decorator_1.getPropertyMetadata)(decorator_1.SERVERLESS_FUNC_KEY, module, webRouter['methodName']) || {};
|
|
108
|
-
const functionName = (
|
|
108
|
+
const functionName = (_j = (_h = functionMeta['functionName']) !== null && _h !== void 0 ? _h : webRouter['functionName']) !== null && _j !== void 0 ? _j : createFunctionName(module, webRouter['methodName']);
|
|
109
109
|
// 其他类型的函数
|
|
110
110
|
this.checkDuplicateAndPush(prefix, {
|
|
111
111
|
id,
|
|
@@ -119,7 +119,7 @@ let MidwayServerlessFunctionService = class MidwayServerlessFunctionService exte
|
|
|
119
119
|
handlerName: `${controllerId}.${webRouter['methodName']}`,
|
|
120
120
|
funcHandlerName: `${controllerId}.${webRouter['methodName']}`,
|
|
121
121
|
controllerId,
|
|
122
|
-
middleware: ((
|
|
122
|
+
middleware: ((_k = webRouter['metadata']) === null || _k === void 0 ? void 0 : _k['middleware']) || [],
|
|
123
123
|
controllerMiddleware: [],
|
|
124
124
|
requestMetadata: [],
|
|
125
125
|
responseMetadata: [],
|
|
@@ -11,11 +11,11 @@ interface IOptions {
|
|
|
11
11
|
data?: any;
|
|
12
12
|
timeout?: number;
|
|
13
13
|
}
|
|
14
|
-
export interface IResponse extends http.IncomingMessage {
|
|
14
|
+
export interface IResponse<ResType = any> extends http.IncomingMessage {
|
|
15
15
|
status: number;
|
|
16
|
-
data: Buffer | string |
|
|
16
|
+
data: Buffer | string | ResType;
|
|
17
17
|
}
|
|
18
|
-
export declare function makeHttpRequest(url: string, options?: IOptions): Promise<IResponse
|
|
18
|
+
export declare function makeHttpRequest<ResType>(url: string, options?: IOptions): Promise<IResponse<ResType>>;
|
|
19
19
|
/**
|
|
20
20
|
* A simple http client
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.9",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=12"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "4c8368283bd5ff3c14c23080838e2567c3e9a749"
|
|
46
46
|
}
|