@midwayjs/core 3.0.0-beta.4 → 3.0.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/CHANGELOG.md +46 -0
- package/README.md +1 -1
- package/dist/baseFramework.js +4 -1
- package/dist/common/filterManager.js +1 -1
- package/dist/common/middlewareManager.d.ts +62 -5
- package/dist/common/middlewareManager.js +141 -6
- package/dist/common/webGenerator.js +4 -0
- package/dist/common/webRouterCollector.js +8 -6
- package/dist/error/code.d.ts +2 -1
- package/dist/error/code.js +1 -0
- package/dist/error/framework.d.ts +3 -0
- package/dist/error/framework.js +7 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -4
- package/dist/interface.d.ts +1 -1
- package/dist/service/decoratorService.js +21 -21
- package/dist/service/middlewareService.d.ts +1 -1
- package/dist/service/middlewareService.js +29 -21
- package/dist/util/index.d.ts +9 -0
- package/dist/util/index.js +61 -3
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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.8](https://github.com/midwayjs/midway/compare/v3.0.0-beta.7...v3.0.0-beta.8) (2021-12-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* express routing middleware takes effect at the controller level ([#1364](https://github.com/midwayjs/midway/issues/1364)) ([b9272e0](https://github.com/midwayjs/midway/commit/b9272e0971003443304b0c53815be31a0061b4bd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* add app.keys ([#1395](https://github.com/midwayjs/midway/issues/1395)) ([c44afc6](https://github.com/midwayjs/midway/commit/c44afc6cc6764a959d1fa7ae04d60099282d156a))
|
|
23
|
+
* middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* class transformer method missing ([#1387](https://github.com/midwayjs/midway/issues/1387)) ([074e839](https://github.com/midwayjs/midway/commit/074e8393598dc95e2742f735df75a2191c5fe25d))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# [3.0.0-beta.5](https://github.com/midwayjs/midway/compare/v3.0.0-beta.4...v3.0.0-beta.5) (2021-11-25)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* [@match](https://github.com/match) empty args ([#1384](https://github.com/midwayjs/midway/issues/1384)) ([6f90fc9](https://github.com/midwayjs/midway/commit/6f90fc993ff01e078288ff664833c61c02dede51))
|
|
46
|
+
* router sort ([#1383](https://github.com/midwayjs/midway/issues/1383)) ([f253887](https://github.com/midwayjs/midway/commit/f2538876d3eaf7dec55173d86b5b9caeeeb7be64))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
# [3.0.0-beta.4](https://github.com/midwayjs/midway/compare/v3.0.0-beta.3...v3.0.0-beta.4) (2021-11-24)
|
|
7
53
|
|
|
8
54
|
|
package/README.md
CHANGED
package/dist/baseFramework.js
CHANGED
|
@@ -215,7 +215,10 @@ class BaseFramework {
|
|
|
215
215
|
catch (err) {
|
|
216
216
|
returnResult = await this.filterManager.runErrorFilter(err, ctx);
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
if (returnResult.error) {
|
|
219
|
+
throw returnResult.error;
|
|
220
|
+
}
|
|
221
|
+
return returnResult.result;
|
|
219
222
|
}));
|
|
220
223
|
this.composeMiddleware = await this.middlewareService.compose(this.middlewareManager);
|
|
221
224
|
await this.filterManager.init(this.applicationContext);
|
|
@@ -71,7 +71,7 @@ class FilterManager {
|
|
|
71
71
|
async runResultFilter(result, ctx, res, next) {
|
|
72
72
|
let returnValue = result;
|
|
73
73
|
for (const matchData of this.matchFnList) {
|
|
74
|
-
if (matchData.matchFn(ctx)) {
|
|
74
|
+
if (matchData.matchFn(ctx, res)) {
|
|
75
75
|
returnValue = await matchData.target.match(returnValue, ctx, res, next);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -1,11 +1,68 @@
|
|
|
1
1
|
import { CommonMiddleware, CommonMiddlewareUnion, IMidwayContext } from '../interface';
|
|
2
2
|
export declare class ContextMiddlewareManager<CTX extends IMidwayContext, R, N> extends Array<CommonMiddleware<CTX, R, N>> {
|
|
3
|
+
/**
|
|
4
|
+
* insert a middleware or middleware array to first
|
|
5
|
+
* @param middleware
|
|
6
|
+
*/
|
|
3
7
|
insertFirst(middleware: CommonMiddlewareUnion<CTX, R, N>): void;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* insert a middleware or middleware array to last
|
|
10
|
+
* @param middleware
|
|
11
|
+
*/
|
|
8
12
|
insertLast(middleware: CommonMiddlewareUnion<CTX, R, N>): void;
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* insert a middleware or middleware array to after another middleware
|
|
15
|
+
* @param middleware
|
|
16
|
+
* @param idxOrBeforeMiddleware
|
|
17
|
+
*/
|
|
18
|
+
insertBefore(middleware: CommonMiddlewareUnion<CTX, R, N>, idxOrBeforeMiddleware: CommonMiddleware<CTX, R, N> | string | number): void;
|
|
19
|
+
/**
|
|
20
|
+
* insert a middleware or middleware array to after another middleware
|
|
21
|
+
* @param middleware
|
|
22
|
+
* @param idxOrAfterMiddleware
|
|
23
|
+
*/
|
|
24
|
+
insertAfter(middleware: CommonMiddlewareUnion<CTX, R, N>, idxOrAfterMiddleware: CommonMiddleware<CTX, R, N> | string | number): void;
|
|
25
|
+
/**
|
|
26
|
+
* move a middleware after another middleware
|
|
27
|
+
* @param middlewareOrName
|
|
28
|
+
* @param afterMiddleware
|
|
29
|
+
*/
|
|
30
|
+
findAndInsertAfter(middlewareOrName: CommonMiddleware<CTX, R, N> | string, afterMiddleware: CommonMiddleware<CTX, R, N> | string | number): void;
|
|
31
|
+
/**
|
|
32
|
+
* move a middleware before another middleware
|
|
33
|
+
* @param middlewareOrName
|
|
34
|
+
* @param beforeMiddleware
|
|
35
|
+
*/
|
|
36
|
+
findAndInsertBefore(middlewareOrName: CommonMiddleware<CTX, R, N> | string, beforeMiddleware: CommonMiddleware<CTX, R, N> | string | number): void;
|
|
37
|
+
/**
|
|
38
|
+
* find middleware and move to first
|
|
39
|
+
* @param middlewareOrName
|
|
40
|
+
*/
|
|
41
|
+
findAndInsertFirst(middlewareOrName: CommonMiddleware<CTX, R, N> | string): void;
|
|
42
|
+
/**
|
|
43
|
+
* find middleware and move to last
|
|
44
|
+
* @param middlewareOrName
|
|
45
|
+
*/
|
|
46
|
+
findAndInsertLast(middlewareOrName: CommonMiddleware<CTX, R, N> | string): void;
|
|
47
|
+
/**
|
|
48
|
+
* find a middleware and return index
|
|
49
|
+
* @param middlewareOrName
|
|
50
|
+
*/
|
|
51
|
+
findItemIndex(middlewareOrName: CommonMiddleware<CTX, R, N> | string | number): number;
|
|
52
|
+
findItem(middlewareOrName: CommonMiddleware<CTX, R, N> | string | number): CommonMiddleware<CTX, R, N>;
|
|
53
|
+
/**
|
|
54
|
+
* get name from middleware
|
|
55
|
+
* @param middleware
|
|
56
|
+
*/
|
|
57
|
+
getMiddlewareName(middleware: CommonMiddleware<CTX, R, N>): string;
|
|
58
|
+
/**
|
|
59
|
+
* remove a middleware
|
|
60
|
+
* @param middlewareOrNameOrIdx
|
|
61
|
+
*/
|
|
62
|
+
remove(middlewareOrNameOrIdx: CommonMiddleware<CTX, R, N> | string | number): CommonMiddleware<CTX, R, N>;
|
|
63
|
+
/**
|
|
64
|
+
* get middleware name list
|
|
65
|
+
*/
|
|
66
|
+
getNames(): string[];
|
|
10
67
|
}
|
|
11
68
|
//# sourceMappingURL=middlewareManager.d.ts.map
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContextMiddlewareManager = void 0;
|
|
4
4
|
class ContextMiddlewareManager extends Array {
|
|
5
|
+
/**
|
|
6
|
+
* insert a middleware or middleware array to first
|
|
7
|
+
* @param middleware
|
|
8
|
+
*/
|
|
5
9
|
insertFirst(middleware) {
|
|
6
10
|
if (Array.isArray(middleware)) {
|
|
7
11
|
this.unshift(...middleware);
|
|
@@ -10,6 +14,23 @@ class ContextMiddlewareManager extends Array {
|
|
|
10
14
|
this.unshift(middleware);
|
|
11
15
|
}
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* insert a middleware or middleware array to last
|
|
19
|
+
* @param middleware
|
|
20
|
+
*/
|
|
21
|
+
insertLast(middleware) {
|
|
22
|
+
if (Array.isArray(middleware)) {
|
|
23
|
+
this.push(...middleware);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.push(middleware);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* insert a middleware or middleware array to after another middleware
|
|
31
|
+
* @param middleware
|
|
32
|
+
* @param idxOrBeforeMiddleware
|
|
33
|
+
*/
|
|
13
34
|
insertBefore(middleware, idxOrBeforeMiddleware) {
|
|
14
35
|
if (typeof idxOrBeforeMiddleware !== 'number') {
|
|
15
36
|
idxOrBeforeMiddleware = this.findItemIndex(idxOrBeforeMiddleware);
|
|
@@ -21,6 +42,11 @@ class ContextMiddlewareManager extends Array {
|
|
|
21
42
|
this.splice(idxOrBeforeMiddleware, 0, middleware);
|
|
22
43
|
}
|
|
23
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* insert a middleware or middleware array to after another middleware
|
|
47
|
+
* @param middleware
|
|
48
|
+
* @param idxOrAfterMiddleware
|
|
49
|
+
*/
|
|
24
50
|
insertAfter(middleware, idxOrAfterMiddleware) {
|
|
25
51
|
if (typeof idxOrAfterMiddleware !== 'number') {
|
|
26
52
|
idxOrAfterMiddleware = this.findItemIndex(idxOrAfterMiddleware);
|
|
@@ -32,16 +58,125 @@ class ContextMiddlewareManager extends Array {
|
|
|
32
58
|
this.splice(idxOrAfterMiddleware + 1, 0, middleware);
|
|
33
59
|
}
|
|
34
60
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
61
|
+
/**
|
|
62
|
+
* move a middleware after another middleware
|
|
63
|
+
* @param middlewareOrName
|
|
64
|
+
* @param afterMiddleware
|
|
65
|
+
*/
|
|
66
|
+
findAndInsertAfter(middlewareOrName, afterMiddleware) {
|
|
67
|
+
middlewareOrName = this.findItem(middlewareOrName);
|
|
68
|
+
afterMiddleware = this.findItem(afterMiddleware);
|
|
69
|
+
if (!middlewareOrName ||
|
|
70
|
+
!afterMiddleware ||
|
|
71
|
+
middlewareOrName === afterMiddleware) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (afterMiddleware) {
|
|
75
|
+
const mw = this.remove(middlewareOrName);
|
|
76
|
+
if (mw) {
|
|
77
|
+
this.insertAfter(mw, afterMiddleware);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* move a middleware before another middleware
|
|
83
|
+
* @param middlewareOrName
|
|
84
|
+
* @param beforeMiddleware
|
|
85
|
+
*/
|
|
86
|
+
findAndInsertBefore(middlewareOrName, beforeMiddleware) {
|
|
87
|
+
middlewareOrName = this.findItem(middlewareOrName);
|
|
88
|
+
beforeMiddleware = this.findItem(beforeMiddleware);
|
|
89
|
+
if (!middlewareOrName ||
|
|
90
|
+
!beforeMiddleware ||
|
|
91
|
+
middlewareOrName === beforeMiddleware) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (beforeMiddleware) {
|
|
95
|
+
const mw = this.remove(middlewareOrName);
|
|
96
|
+
if (mw) {
|
|
97
|
+
this.insertBefore(mw, beforeMiddleware);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* find middleware and move to first
|
|
103
|
+
* @param middlewareOrName
|
|
104
|
+
*/
|
|
105
|
+
findAndInsertFirst(middlewareOrName) {
|
|
106
|
+
const mw = this.remove(middlewareOrName);
|
|
107
|
+
if (mw) {
|
|
108
|
+
this.insertFirst(mw);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* find middleware and move to last
|
|
113
|
+
* @param middlewareOrName
|
|
114
|
+
*/
|
|
115
|
+
findAndInsertLast(middlewareOrName) {
|
|
116
|
+
const mw = this.remove(middlewareOrName);
|
|
117
|
+
if (mw) {
|
|
118
|
+
this.insertLast(mw);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* find a middleware and return index
|
|
123
|
+
* @param middlewareOrName
|
|
124
|
+
*/
|
|
125
|
+
findItemIndex(middlewareOrName) {
|
|
126
|
+
if (typeof middlewareOrName === 'number') {
|
|
127
|
+
return middlewareOrName;
|
|
128
|
+
}
|
|
129
|
+
else if (typeof middlewareOrName === 'string') {
|
|
130
|
+
return this.findIndex(item => this.getMiddlewareName(item) === middlewareOrName);
|
|
38
131
|
}
|
|
39
132
|
else {
|
|
40
|
-
this.
|
|
133
|
+
return this.findIndex(item => item === middlewareOrName);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
findItem(middlewareOrName) {
|
|
137
|
+
if (typeof middlewareOrName === 'number') {
|
|
138
|
+
if (middlewareOrName >= 0 && middlewareOrName <= this.length - 1) {
|
|
139
|
+
return this[middlewareOrName];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (typeof middlewareOrName === 'string') {
|
|
143
|
+
return this.find(item => this.getMiddlewareName(item) === middlewareOrName);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return middlewareOrName;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* get name from middleware
|
|
151
|
+
* @param middleware
|
|
152
|
+
*/
|
|
153
|
+
getMiddlewareName(middleware) {
|
|
154
|
+
var _a;
|
|
155
|
+
return (_a = middleware._name) !== null && _a !== void 0 ? _a : middleware.name;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* remove a middleware
|
|
159
|
+
* @param middlewareOrNameOrIdx
|
|
160
|
+
*/
|
|
161
|
+
remove(middlewareOrNameOrIdx) {
|
|
162
|
+
if (typeof middlewareOrNameOrIdx === 'number' &&
|
|
163
|
+
middlewareOrNameOrIdx !== -1) {
|
|
164
|
+
return this.splice(middlewareOrNameOrIdx, 1)[0];
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
const idx = this.findItemIndex(middlewareOrNameOrIdx);
|
|
168
|
+
if (idx !== -1) {
|
|
169
|
+
return this.splice(idx, 1)[0];
|
|
170
|
+
}
|
|
41
171
|
}
|
|
42
172
|
}
|
|
43
|
-
|
|
44
|
-
|
|
173
|
+
/**
|
|
174
|
+
* get middleware name list
|
|
175
|
+
*/
|
|
176
|
+
getNames() {
|
|
177
|
+
return this.map(item => {
|
|
178
|
+
return this.getMiddlewareName(item);
|
|
179
|
+
});
|
|
45
180
|
}
|
|
46
181
|
}
|
|
47
182
|
exports.ContextMiddlewareManager = ContextMiddlewareManager;
|
|
@@ -9,6 +9,8 @@ exports.WebControllerGenerator = void 0;
|
|
|
9
9
|
*/
|
|
10
10
|
const decorator_1 = require("@midwayjs/decorator");
|
|
11
11
|
const index_1 = require("../index");
|
|
12
|
+
const util = require("util");
|
|
13
|
+
const debug = util.debuglog('midway:debug');
|
|
12
14
|
class WebControllerGenerator {
|
|
13
15
|
constructor(applicationContext, frameworkType, logger) {
|
|
14
16
|
this.applicationContext = applicationContext;
|
|
@@ -67,6 +69,7 @@ class WebControllerGenerator {
|
|
|
67
69
|
// bind controller first
|
|
68
70
|
this.applicationContext.bindClass(routerInfo.routerModule);
|
|
69
71
|
(_a = this.logger) === null || _a === void 0 ? void 0 : _a.debug(`Load Controller "${routerInfo.controllerId}", prefix=${routerInfo.prefix}`);
|
|
72
|
+
debug(`[core:webGenerator]: Load Controller "${routerInfo.controllerId}", prefix=${routerInfo.prefix}`);
|
|
70
73
|
// new router
|
|
71
74
|
const newRouter = this.createRouter({
|
|
72
75
|
prefix: routerInfo.prefix,
|
|
@@ -97,6 +100,7 @@ class WebControllerGenerator {
|
|
|
97
100
|
this.generateController(routeInfo),
|
|
98
101
|
];
|
|
99
102
|
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.debug(`Load Router "${routeInfo.requestMethod.toUpperCase()} ${routeInfo.url}"`);
|
|
103
|
+
debug(`[core:webGenerator]: Load Router "${routeInfo.requestMethod.toUpperCase()} ${routeInfo.url}"`);
|
|
100
104
|
// apply controller from request context
|
|
101
105
|
// eslint-disable-next-line prefer-spread
|
|
102
106
|
newRouter[routeInfo.requestMethod].apply(newRouter, routerArgs);
|
|
@@ -229,12 +229,14 @@ class WebRouterCollector {
|
|
|
229
229
|
.map(item => {
|
|
230
230
|
const urlString = item.url.toString();
|
|
231
231
|
const weightArr = (0, decorator_1.isRegExp)(item.url)
|
|
232
|
-
? urlString.split('
|
|
232
|
+
? urlString.split('\\/')
|
|
233
233
|
: urlString.split('/');
|
|
234
234
|
let weight = 0;
|
|
235
235
|
// 权重,比如通配的不加权,非通配加权,防止通配出现在最前面
|
|
236
236
|
for (const fragment of weightArr) {
|
|
237
|
-
if (fragment
|
|
237
|
+
if (fragment === '' ||
|
|
238
|
+
fragment.includes(':') ||
|
|
239
|
+
fragment.includes('*')) {
|
|
238
240
|
weight += 0;
|
|
239
241
|
}
|
|
240
242
|
else {
|
|
@@ -265,12 +267,12 @@ class WebRouterCollector {
|
|
|
265
267
|
if (handlerA._category !== handlerB._category) {
|
|
266
268
|
return handlerB._category - handlerA._category;
|
|
267
269
|
}
|
|
270
|
+
// 不同权重
|
|
271
|
+
if (handlerA._weight !== handlerB._weight) {
|
|
272
|
+
return handlerB._weight - handlerA._weight;
|
|
273
|
+
}
|
|
268
274
|
// 不同长度
|
|
269
275
|
if (handlerA._level === handlerB._level) {
|
|
270
|
-
// 不同权重
|
|
271
|
-
if (handlerA._weight !== handlerB._weight) {
|
|
272
|
-
return handlerB._weight - handlerA._weight;
|
|
273
|
-
}
|
|
274
276
|
if (handlerB._pureRouter === handlerA._pureRouter) {
|
|
275
277
|
return (handlerA.url.toString().length - handlerB.url.toString().length);
|
|
276
278
|
}
|
package/dist/error/code.d.ts
CHANGED
package/dist/error/code.js
CHANGED
|
@@ -60,5 +60,6 @@ var FrameworkErrorEnum;
|
|
|
60
60
|
FrameworkErrorEnum[FrameworkErrorEnum["DEFINITION_NOT_FOUND"] = 10003] = "DEFINITION_NOT_FOUND";
|
|
61
61
|
FrameworkErrorEnum[FrameworkErrorEnum["FEATURE_NO_LONGER_SUPPORTED"] = 10004] = "FEATURE_NO_LONGER_SUPPORTED";
|
|
62
62
|
FrameworkErrorEnum[FrameworkErrorEnum["VALIDATE_FAIL"] = 10005] = "VALIDATE_FAIL";
|
|
63
|
+
FrameworkErrorEnum[FrameworkErrorEnum["MISSING_CONFIG"] = 10006] = "MISSING_CONFIG";
|
|
63
64
|
})(FrameworkErrorEnum = exports.FrameworkErrorEnum || (exports.FrameworkErrorEnum = {}));
|
|
64
65
|
//# sourceMappingURL=code.js.map
|
|
@@ -18,4 +18,7 @@ export declare class MidwayFeatureNoLongerSupportedError extends MidwayError {
|
|
|
18
18
|
export declare class MidwayValidationError extends MidwayError {
|
|
19
19
|
constructor(message: any, status: any, cause: any);
|
|
20
20
|
}
|
|
21
|
+
export declare class MidwayConfigMissingError extends MidwayError {
|
|
22
|
+
constructor(configKey: string);
|
|
23
|
+
}
|
|
21
24
|
//# sourceMappingURL=framework.d.ts.map
|
package/dist/error/framework.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MidwayValidationError = exports.MidwayFeatureNoLongerSupportedError = exports.MidwayDefinitionNotFoundError = exports.MidwayParameterError = exports.MidwayCommonError = void 0;
|
|
3
|
+
exports.MidwayConfigMissingError = exports.MidwayValidationError = exports.MidwayFeatureNoLongerSupportedError = exports.MidwayDefinitionNotFoundError = exports.MidwayParameterError = exports.MidwayCommonError = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
const code_1 = require("./code");
|
|
6
6
|
class MidwayCommonError extends base_1.MidwayError {
|
|
@@ -49,4 +49,10 @@ class MidwayValidationError extends base_1.MidwayError {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
exports.MidwayValidationError = MidwayValidationError;
|
|
52
|
+
class MidwayConfigMissingError extends base_1.MidwayError {
|
|
53
|
+
constructor(configKey) {
|
|
54
|
+
super(`Can't found config key "${configKey}" in your config, please set it first`, code_1.FrameworkErrorEnum.MISSING_CONFIG);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.MidwayConfigMissingError = MidwayConfigMissingError;
|
|
52
58
|
//# sourceMappingURL=framework.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,11 @@ export { MidwayRequestContainer } from './context/requestContainer';
|
|
|
4
4
|
export { BaseFramework } from './baseFramework';
|
|
5
5
|
export * from './context/providerWrapper';
|
|
6
6
|
export * from './common/constants';
|
|
7
|
-
export { safelyGet, safeRequire, delegateTargetPrototypeMethod, delegateTargetMethod, delegateTargetProperties, deprecatedOutput, transformRequestObjectByType, } from './util/';
|
|
7
|
+
export { safelyGet, safeRequire, delegateTargetPrototypeMethod, delegateTargetMethod, delegateTargetProperties, deprecatedOutput, transformRequestObjectByType, pathMatching, wrapMiddleware, } from './util/';
|
|
8
8
|
export * from './util/pathFileUtil';
|
|
9
9
|
export * from './util/webRouterParam';
|
|
10
10
|
export * from './common/webRouterCollector';
|
|
11
11
|
export * from './common/triggerCollector';
|
|
12
|
-
export { plainToClass, classToPlain } from 'class-transformer';
|
|
13
12
|
export { createConfiguration } from './functional/configuration';
|
|
14
13
|
export { MidwayConfigService } from './service/configService';
|
|
15
14
|
export { MidwayEnvironmentService } from './service/environmentService';
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.MidwayFrameworkType = exports.MidwayDecoratorService = exports.MidwayMiddlewareService = exports.MidwayLifeCycleService = exports.MidwayAspectService = exports.MidwayFrameworkService = exports.MidwayLoggerService = exports.MidwayInformationService = exports.MidwayEnvironmentService = exports.MidwayConfigService = exports.createConfiguration = exports.
|
|
13
|
+
exports.MidwayFrameworkType = exports.MidwayDecoratorService = exports.MidwayMiddlewareService = exports.MidwayLifeCycleService = exports.MidwayAspectService = exports.MidwayFrameworkService = exports.MidwayLoggerService = exports.MidwayInformationService = exports.MidwayEnvironmentService = exports.MidwayConfigService = exports.createConfiguration = exports.wrapMiddleware = exports.pathMatching = exports.transformRequestObjectByType = exports.deprecatedOutput = exports.delegateTargetProperties = exports.delegateTargetMethod = exports.delegateTargetPrototypeMethod = exports.safeRequire = exports.safelyGet = exports.BaseFramework = exports.MidwayRequestContainer = void 0;
|
|
14
14
|
__exportStar(require("./interface"), exports);
|
|
15
15
|
__exportStar(require("./context/container"), exports);
|
|
16
16
|
var requestContainer_1 = require("./context/requestContainer");
|
|
@@ -27,13 +27,12 @@ Object.defineProperty(exports, "delegateTargetMethod", { enumerable: true, get:
|
|
|
27
27
|
Object.defineProperty(exports, "delegateTargetProperties", { enumerable: true, get: function () { return util_1.delegateTargetProperties; } });
|
|
28
28
|
Object.defineProperty(exports, "deprecatedOutput", { enumerable: true, get: function () { return util_1.deprecatedOutput; } });
|
|
29
29
|
Object.defineProperty(exports, "transformRequestObjectByType", { enumerable: true, get: function () { return util_1.transformRequestObjectByType; } });
|
|
30
|
+
Object.defineProperty(exports, "pathMatching", { enumerable: true, get: function () { return util_1.pathMatching; } });
|
|
31
|
+
Object.defineProperty(exports, "wrapMiddleware", { enumerable: true, get: function () { return util_1.wrapMiddleware; } });
|
|
30
32
|
__exportStar(require("./util/pathFileUtil"), exports);
|
|
31
33
|
__exportStar(require("./util/webRouterParam"), exports);
|
|
32
34
|
__exportStar(require("./common/webRouterCollector"), exports);
|
|
33
35
|
__exportStar(require("./common/triggerCollector"), exports);
|
|
34
|
-
var class_transformer_1 = require("class-transformer");
|
|
35
|
-
Object.defineProperty(exports, "plainToClass", { enumerable: true, get: function () { return class_transformer_1.plainToClass; } });
|
|
36
|
-
Object.defineProperty(exports, "classToPlain", { enumerable: true, get: function () { return class_transformer_1.classToPlain; } });
|
|
37
36
|
var configuration_1 = require("./functional/configuration");
|
|
38
37
|
Object.defineProperty(exports, "createConfiguration", { enumerable: true, get: function () { return configuration_1.createConfiguration; } });
|
|
39
38
|
var configService_1 = require("./service/configService");
|
package/dist/interface.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare type ServiceFactoryConfigOption<OPTIONS> = {
|
|
|
14
14
|
[key: string]: PowerPartial<OPTIONS>;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
declare type ConfigType<T> = T extends (args: any[]) => any ? PowerPartial<ReturnType<T>> : PowerPartial<T>;
|
|
17
|
+
declare type ConfigType<T> = T extends (...args: any[]) => any ? PowerPartial<ReturnType<T>> : PowerPartial<T>;
|
|
18
18
|
export declare type FileConfigOption<T, K = unknown> = K extends keyof ConfigType<T> ? Pick<ConfigType<T>, K> : ConfigType<T>;
|
|
19
19
|
/**
|
|
20
20
|
* 生命周期定义
|
|
@@ -24,7 +24,27 @@ let MidwayDecoratorService = class MidwayDecoratorService {
|
|
|
24
24
|
}
|
|
25
25
|
async init() {
|
|
26
26
|
// add custom method decorator listener
|
|
27
|
-
this.applicationContext.onBeforeBind(
|
|
27
|
+
this.applicationContext.onBeforeBind(Clzz => {
|
|
28
|
+
// find custom method decorator metadata, include method decorator information array
|
|
29
|
+
const methodDecoratorMetadataList = (0, decorator_1.getClassMetadata)(decorator_1.INJECT_CUSTOM_METHOD, Clzz);
|
|
30
|
+
if (methodDecoratorMetadataList) {
|
|
31
|
+
// loop it, save this order for decorator run
|
|
32
|
+
for (const meta of methodDecoratorMetadataList) {
|
|
33
|
+
const { propertyName, key, metadata } = meta;
|
|
34
|
+
// add aspect implementation first
|
|
35
|
+
this.aspectService.interceptPrototypeMethod(Clzz, propertyName, () => {
|
|
36
|
+
const methodDecoratorHandler = this.methodDecoratorMap.get(key);
|
|
37
|
+
if (!methodDecoratorHandler) {
|
|
38
|
+
throw new error_1.MidwayCommonError(`Method Decorator "${key}" handler not found, please register first.`);
|
|
39
|
+
}
|
|
40
|
+
return this.methodDecoratorMap.get(key)({
|
|
41
|
+
target: Clzz,
|
|
42
|
+
propertyName,
|
|
43
|
+
metadata,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
28
48
|
// find custom param decorator metadata
|
|
29
49
|
const parameterDecoratorMetadata = (0, decorator_1.getClassMetadata)(decorator_1.INJECT_CUSTOM_PARAM, Clzz);
|
|
30
50
|
if (parameterDecoratorMetadata) {
|
|
@@ -58,26 +78,6 @@ let MidwayDecoratorService = class MidwayDecoratorService {
|
|
|
58
78
|
});
|
|
59
79
|
}
|
|
60
80
|
}
|
|
61
|
-
// find custom method decorator metadata, include method decorator information array
|
|
62
|
-
const methodDecoratorMetadataList = (0, decorator_1.getClassMetadata)(decorator_1.INJECT_CUSTOM_METHOD, Clzz);
|
|
63
|
-
if (methodDecoratorMetadataList) {
|
|
64
|
-
// loop it, save this order for decorator run
|
|
65
|
-
for (const meta of methodDecoratorMetadataList) {
|
|
66
|
-
const { propertyName, key, metadata } = meta;
|
|
67
|
-
// add aspect implementation first
|
|
68
|
-
this.aspectService.interceptPrototypeMethod(Clzz, propertyName, () => {
|
|
69
|
-
const methodDecoratorHandler = this.methodDecoratorMap.get(key);
|
|
70
|
-
if (!methodDecoratorHandler) {
|
|
71
|
-
throw new error_1.MidwayCommonError(`Method Decorator "${key}" handler not found, please register first.`);
|
|
72
|
-
}
|
|
73
|
-
return this.methodDecoratorMap.get(key)({
|
|
74
|
-
target: Clzz,
|
|
75
|
-
propertyName,
|
|
76
|
-
metadata,
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
81
|
});
|
|
82
82
|
// add custom property decorator listener
|
|
83
83
|
this.applicationContext.onObjectCreated((instance, options) => {
|
|
@@ -6,6 +6,6 @@ export declare class MidwayMiddlewareService<T, R, N = unknown> {
|
|
|
6
6
|
(context: any, next?: any): Promise<any>;
|
|
7
7
|
_name: string;
|
|
8
8
|
}>;
|
|
9
|
+
getMiddlewareName(mw: any): any;
|
|
9
10
|
}
|
|
10
|
-
export declare function pathMatching(options: any): (ctx?: any) => any;
|
|
11
11
|
//# sourceMappingURL=middlewareService.d.ts.map
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.MidwayMiddlewareService = void 0;
|
|
13
13
|
const decorator_1 = require("@midwayjs/decorator");
|
|
14
14
|
const error_1 = require("../error");
|
|
15
15
|
const util_1 = require("../util");
|
|
@@ -32,14 +32,16 @@ let MidwayMiddlewareService = class MidwayMiddlewareService {
|
|
|
32
32
|
if (classMiddleware) {
|
|
33
33
|
fn = classMiddleware.resolve();
|
|
34
34
|
if (!classMiddleware.match && !classMiddleware.ignore) {
|
|
35
|
-
fn.
|
|
35
|
+
if (!fn.name) {
|
|
36
|
+
fn._name = classMiddleware.constructor.name;
|
|
37
|
+
}
|
|
36
38
|
// just got fn
|
|
37
39
|
newMiddlewareArr.push(fn);
|
|
38
40
|
}
|
|
39
41
|
else {
|
|
40
42
|
// wrap ignore and match
|
|
41
43
|
const mw = fn;
|
|
42
|
-
const match = pathMatching({
|
|
44
|
+
const match = (0, util_1.pathMatching)({
|
|
43
45
|
match: classMiddleware.match,
|
|
44
46
|
ignore: classMiddleware.ignore,
|
|
45
47
|
});
|
|
@@ -67,6 +69,7 @@ let MidwayMiddlewareService = class MidwayMiddlewareService {
|
|
|
67
69
|
* @api public
|
|
68
70
|
*/
|
|
69
71
|
const composeFn = (context, next) => {
|
|
72
|
+
const supportBody = (0, util_1.isIncludeProperty)(context, 'body');
|
|
70
73
|
// last called middleware #
|
|
71
74
|
let index = -1;
|
|
72
75
|
return dispatch(0);
|
|
@@ -80,9 +83,25 @@ let MidwayMiddlewareService = class MidwayMiddlewareService {
|
|
|
80
83
|
if (!fn)
|
|
81
84
|
return Promise.resolve();
|
|
82
85
|
try {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
if (supportBody) {
|
|
87
|
+
return Promise.resolve(fn(context, dispatch.bind(null, i + 1), {
|
|
88
|
+
index,
|
|
89
|
+
})).then(result => {
|
|
90
|
+
// need to set body
|
|
91
|
+
if (context.body && !result) {
|
|
92
|
+
result = context.body;
|
|
93
|
+
}
|
|
94
|
+
else if (result && context.body !== result) {
|
|
95
|
+
context.body = result;
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return Promise.resolve(fn(context, dispatch.bind(null, i + 1), {
|
|
102
|
+
index,
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
86
105
|
}
|
|
87
106
|
catch (err) {
|
|
88
107
|
return Promise.reject(err);
|
|
@@ -94,6 +113,10 @@ let MidwayMiddlewareService = class MidwayMiddlewareService {
|
|
|
94
113
|
}
|
|
95
114
|
return composeFn;
|
|
96
115
|
}
|
|
116
|
+
getMiddlewareName(mw) {
|
|
117
|
+
var _a;
|
|
118
|
+
return (_a = mw.name) !== null && _a !== void 0 ? _a : mw._name;
|
|
119
|
+
}
|
|
97
120
|
};
|
|
98
121
|
MidwayMiddlewareService = __decorate([
|
|
99
122
|
(0, decorator_1.Provide)(),
|
|
@@ -101,19 +124,4 @@ MidwayMiddlewareService = __decorate([
|
|
|
101
124
|
__metadata("design:paramtypes", [Object])
|
|
102
125
|
], MidwayMiddlewareService);
|
|
103
126
|
exports.MidwayMiddlewareService = MidwayMiddlewareService;
|
|
104
|
-
function pathMatching(options) {
|
|
105
|
-
options = options || {};
|
|
106
|
-
if (options.match && options.ignore)
|
|
107
|
-
throw new error_1.MidwayCommonError('options.match and options.ignore can not both present');
|
|
108
|
-
if (!options.match && !options.ignore)
|
|
109
|
-
return () => true;
|
|
110
|
-
const matchFn = options.match
|
|
111
|
-
? (0, util_1.toPathMatch)(options.match)
|
|
112
|
-
: (0, util_1.toPathMatch)(options.ignore);
|
|
113
|
-
return function pathMatch(ctx) {
|
|
114
|
-
const matched = matchFn(ctx);
|
|
115
|
-
return options.match ? matched : !matched;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
exports.pathMatching = pathMatching;
|
|
119
127
|
//# sourceMappingURL=middlewareService.js.map
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FunctionMiddleware } from '../interface';
|
|
1
2
|
/**
|
|
2
3
|
* @since 2.0.0
|
|
3
4
|
* @param env
|
|
@@ -73,4 +74,12 @@ export declare const deprecatedOutput: (message: string) => void;
|
|
|
73
74
|
*/
|
|
74
75
|
export declare const transformRequestObjectByType: (originValue: any, targetType?: any) => any;
|
|
75
76
|
export declare function toPathMatch(pattern: any): any;
|
|
77
|
+
export declare function pathMatching(options: any): (ctx?: any) => any;
|
|
78
|
+
/**
|
|
79
|
+
* wrap function middleware with match and ignore
|
|
80
|
+
* @param mw
|
|
81
|
+
* @param options
|
|
82
|
+
*/
|
|
83
|
+
export declare function wrapMiddleware(mw: FunctionMiddleware<any, any>, options: any): (context: any, next: any, options?: any) => any;
|
|
84
|
+
export declare function isIncludeProperty(obj: any, prop: string): boolean;
|
|
76
85
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/util/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toPathMatch = exports.transformRequestObjectByType = exports.deprecatedOutput = exports.getCurrentDateString = exports.delegateTargetProperties = exports.delegateTargetMethod = exports.delegateTargetPrototypeMethod = exports.joinURLPath = exports.getUserHome = exports.parsePrefix = exports.safelyGet = exports.safeRequire = exports.getCurrentEnvironment = exports.isDevelopmentEnvironment = void 0;
|
|
3
|
+
exports.isIncludeProperty = exports.wrapMiddleware = exports.pathMatching = exports.toPathMatch = exports.transformRequestObjectByType = exports.deprecatedOutput = exports.getCurrentDateString = exports.delegateTargetProperties = exports.delegateTargetMethod = exports.delegateTargetPrototypeMethod = exports.joinURLPath = exports.getUserHome = exports.parsePrefix = exports.safelyGet = exports.safeRequire = exports.getCurrentEnvironment = exports.isDevelopmentEnvironment = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const util_1 = require("util");
|
|
7
|
-
const
|
|
7
|
+
const transformer = require("class-transformer");
|
|
8
8
|
const pathToRegexp_1 = require("./pathToRegexp");
|
|
9
9
|
const error_1 = require("../error");
|
|
10
10
|
const debug = (0, util_1.debuglog)('midway:container:util');
|
|
@@ -205,12 +205,16 @@ const transformRequestObjectByType = (originValue, targetType) => {
|
|
|
205
205
|
return originValue;
|
|
206
206
|
}
|
|
207
207
|
else {
|
|
208
|
-
|
|
208
|
+
const transformToInstance = transformer['plainToClass'] || transformer['plainToInstance'];
|
|
209
|
+
return transformToInstance(targetType, originValue);
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
};
|
|
212
213
|
exports.transformRequestObjectByType = transformRequestObjectByType;
|
|
213
214
|
function toPathMatch(pattern) {
|
|
215
|
+
if (typeof pattern === 'boolean') {
|
|
216
|
+
return ctx => pattern;
|
|
217
|
+
}
|
|
214
218
|
if (typeof pattern === 'string') {
|
|
215
219
|
const reg = (0, pathToRegexp_1.pathToRegexp)(pattern, [], { end: false });
|
|
216
220
|
if (reg.global)
|
|
@@ -233,4 +237,58 @@ function toPathMatch(pattern) {
|
|
|
233
237
|
throw new error_1.MidwayCommonError('match/ignore pattern must be RegExp, Array or String, but got ' + pattern);
|
|
234
238
|
}
|
|
235
239
|
exports.toPathMatch = toPathMatch;
|
|
240
|
+
function pathMatching(options) {
|
|
241
|
+
options = options || {};
|
|
242
|
+
if (options.match && options.ignore)
|
|
243
|
+
throw new error_1.MidwayCommonError('options.match and options.ignore can not both present');
|
|
244
|
+
if (!options.match && !options.ignore)
|
|
245
|
+
return () => true;
|
|
246
|
+
const matchFn = options.match
|
|
247
|
+
? toPathMatch(options.match)
|
|
248
|
+
: toPathMatch(options.ignore);
|
|
249
|
+
return function pathMatch(ctx) {
|
|
250
|
+
const matched = matchFn(ctx);
|
|
251
|
+
return options.match ? matched : !matched;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
exports.pathMatching = pathMatching;
|
|
255
|
+
/**
|
|
256
|
+
* wrap function middleware with match and ignore
|
|
257
|
+
* @param mw
|
|
258
|
+
* @param options
|
|
259
|
+
*/
|
|
260
|
+
function wrapMiddleware(mw, options) {
|
|
261
|
+
// support options.enable
|
|
262
|
+
if (options.enable === false)
|
|
263
|
+
return null;
|
|
264
|
+
// support options.match and options.ignore
|
|
265
|
+
if (!options.match && !options.ignore)
|
|
266
|
+
return mw;
|
|
267
|
+
const match = pathMatching(options);
|
|
268
|
+
const fn = (ctx, next) => {
|
|
269
|
+
if (!match(ctx))
|
|
270
|
+
return next();
|
|
271
|
+
return mw(ctx, next);
|
|
272
|
+
};
|
|
273
|
+
fn._name = mw._name + 'middlewareWrapper';
|
|
274
|
+
return fn;
|
|
275
|
+
}
|
|
276
|
+
exports.wrapMiddleware = wrapMiddleware;
|
|
277
|
+
function isOwnPropertyWritable(obj, prop) {
|
|
278
|
+
if (obj == null)
|
|
279
|
+
return false;
|
|
280
|
+
const type = typeof obj;
|
|
281
|
+
if (type !== 'object' && type !== 'function')
|
|
282
|
+
return false;
|
|
283
|
+
return !!Object.getOwnPropertyDescriptor(obj, prop);
|
|
284
|
+
}
|
|
285
|
+
function isIncludeProperty(obj, prop) {
|
|
286
|
+
while (obj) {
|
|
287
|
+
if (isOwnPropertyWritable(obj, prop))
|
|
288
|
+
return true;
|
|
289
|
+
obj = Object.getPrototypeOf(obj);
|
|
290
|
+
}
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
exports.isIncludeProperty = isIncludeProperty;
|
|
236
294
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.8",
|
|
4
4
|
"description": "midway core",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@midwayjs/decorator": "^3.0.0-beta.
|
|
24
|
+
"@midwayjs/decorator": "^3.0.0-beta.8",
|
|
25
|
+
"koa": "^2.13.4",
|
|
25
26
|
"midway-test-component": "*",
|
|
26
27
|
"mm": "3",
|
|
27
28
|
"sinon": "^7.2.2"
|
|
@@ -31,8 +32,8 @@
|
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@midwayjs/glob": "^1.0.2",
|
|
34
|
-
"@midwayjs/logger": "^3.0.0-beta.
|
|
35
|
-
"class-transformer": "^0.
|
|
35
|
+
"@midwayjs/logger": "^3.0.0-beta.8",
|
|
36
|
+
"class-transformer": "^0.5.1",
|
|
36
37
|
"extend2": "^1.0.0",
|
|
37
38
|
"picomatch": "^2.2.2",
|
|
38
39
|
"reflect-metadata": "^0.1.13"
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"engines": {
|
|
46
47
|
"node": ">=12"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "bfafbdf8798f48d4daac5dd88ad53c6b2f33c110"
|
|
49
50
|
}
|