@nestjs/core 7.6.9 → 7.6.13
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/Readme.md +3 -1
- package/errors/messages.js +7 -1
- package/middleware/routes-mapper.js +8 -4
- package/nest-application.js +1 -0
- package/nest-factory.js +15 -2
- package/package.json +2 -2
- package/router/router-execution-context.js +1 -1
- package/router/router-response-controller.d.ts +1 -1
- package/router/router-response-controller.js +1 -1
package/Readme.md
CHANGED
|
@@ -99,7 +99,9 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
|
|
99
99
|
<td align="center" valign="middle"><a href="https://filmen.nu/" target="_blank"><img src="https://nestjs.com/img/filmen-logo.png" width="120" valign="middle" /></a></td></tr><tr>
|
|
100
100
|
<td align="center" valign="middle"><a href="https://meercode.io/" target="_blank"><img src="https://nestjs.com/img/meercode-logo.png" width="60" valign="middle" /></a></td>
|
|
101
101
|
<td align="center" valign="middle"><a href="https://www.najlepszeplatformyforex.pl/blog/broker-xtb/" target="_blank"><img src="https://nestjs.com/img/npf-logo.jpg" width="200" valign="middle" /></a></td>
|
|
102
|
-
|
|
102
|
+
<td align="center" valign="middle"><a href="https://thestandarddaily.com/" target="_blank"><img src="https://nestjs.com/img/the-standard-daily-logo.png" width="180" valign="middle" /></a></td>
|
|
103
|
+
<td align="center" valign="middle"><a href="https://houseofangular.io/" target="_blank"><img src="https://nestjs.com/img/house-of-angular.png" width="100" valign="middle" /></a></td>
|
|
104
|
+
<td align="center" valign="middle"><a href="https://rocketech.it/cases/?utm_source=google&utm_medium=badge&utm_campaign=nestjs" target="_blank"><img src="https://nestjs.com/img/rocketech-logo.svg" width="110" valign="middle" /></a></td>
|
|
103
105
|
</tr></table>
|
|
104
106
|
|
|
105
107
|
## Backers
|
package/errors/messages.js
CHANGED
|
@@ -6,7 +6,13 @@ const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
|
6
6
|
* Returns the name of an instance
|
|
7
7
|
* @param instance The instance which should get the name from
|
|
8
8
|
*/
|
|
9
|
-
const getInstanceName = (instance) =>
|
|
9
|
+
const getInstanceName = (instance) => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
if ((_a = instance) === null || _a === void 0 ? void 0 : _a.forwardRef) {
|
|
12
|
+
return (_b = instance.forwardRef()) === null || _b === void 0 ? void 0 : _b.name;
|
|
13
|
+
}
|
|
14
|
+
return (_c = instance) === null || _c === void 0 ? void 0 : _c.name;
|
|
15
|
+
};
|
|
10
16
|
/**
|
|
11
17
|
* Returns the name of the dependency
|
|
12
18
|
* Tries to get the class name, otherwise the string value
|
|
@@ -19,8 +19,8 @@ class RoutesMapper {
|
|
|
19
19
|
},
|
|
20
20
|
];
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
if (this.isRouteInfo(
|
|
22
|
+
const routePathOrPaths = Reflect.getMetadata(constants_1.PATH_METADATA, route);
|
|
23
|
+
if (this.isRouteInfo(routePathOrPaths, route)) {
|
|
24
24
|
return [
|
|
25
25
|
{
|
|
26
26
|
path: this.validateRoutePath(route.path),
|
|
@@ -30,12 +30,16 @@ class RoutesMapper {
|
|
|
30
30
|
}
|
|
31
31
|
const paths = this.routerExplorer.scanForPaths(Object.create(route), route.prototype);
|
|
32
32
|
const concatPaths = (acc, currentValue) => acc.concat(currentValue);
|
|
33
|
-
return
|
|
33
|
+
return []
|
|
34
|
+
.concat(routePathOrPaths)
|
|
35
|
+
.map(routePath => paths
|
|
34
36
|
.map(item => item.path &&
|
|
35
37
|
item.path.map(p => ({
|
|
36
|
-
path: this.validateGlobalPath(routePath) +
|
|
38
|
+
path: this.validateGlobalPath(routePath) +
|
|
39
|
+
this.validateRoutePath(p),
|
|
37
40
|
method: item.requestMethod,
|
|
38
41
|
})))
|
|
42
|
+
.reduce(concatPaths, []))
|
|
39
43
|
.reduce(concatPaths, []);
|
|
40
44
|
}
|
|
41
45
|
isRouteInfo(path, objectOrClass) {
|
package/nest-application.js
CHANGED
|
@@ -37,6 +37,7 @@ class NestApplication extends nest_application_context_1.NestApplicationContext
|
|
|
37
37
|
}
|
|
38
38
|
async dispose() {
|
|
39
39
|
this.socketModule && (await this.socketModule.close());
|
|
40
|
+
this.microservicesModule && (await this.microservicesModule.close());
|
|
40
41
|
this.httpAdapter && (await this.httpAdapter.close());
|
|
41
42
|
await Promise.all(iterare_1.iterate(this.microservices).map(async (microservice) => {
|
|
42
43
|
microservice.setIsTerminated(true);
|
package/nest-factory.js
CHANGED
|
@@ -148,14 +148,27 @@ class NestFactoryStatic {
|
|
|
148
148
|
: !(serverOrOptions && serverOrOptions.abortOnError === false);
|
|
149
149
|
}
|
|
150
150
|
createAdapterProxy(app, adapter) {
|
|
151
|
-
|
|
151
|
+
const proxy = new Proxy(app, {
|
|
152
152
|
get: (receiver, prop) => {
|
|
153
153
|
if (!(prop in receiver) && prop in adapter) {
|
|
154
|
-
return
|
|
154
|
+
return (...args) => {
|
|
155
|
+
this.createExceptionZone(adapter, prop)(...args);
|
|
156
|
+
return proxy;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (shared_utils_1.isFunction(receiver[prop])) {
|
|
160
|
+
const mapToProxy = (result) => result instanceof nest_application_1.NestApplication ? proxy : result;
|
|
161
|
+
return (...args) => {
|
|
162
|
+
const result = receiver[prop](...args);
|
|
163
|
+
return result instanceof Promise
|
|
164
|
+
? result.then(mapToProxy)
|
|
165
|
+
: mapToProxy(result);
|
|
166
|
+
};
|
|
155
167
|
}
|
|
156
168
|
return receiver[prop];
|
|
157
169
|
},
|
|
158
170
|
});
|
|
171
|
+
return proxy;
|
|
159
172
|
}
|
|
160
173
|
}
|
|
161
174
|
exports.NestFactoryStatic = NestFactoryStatic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "7.6.
|
|
3
|
+
"version": "7.6.13",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"uuid": "8.3.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@nestjs/common": "7.6.
|
|
39
|
+
"@nestjs/common": "7.6.13"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@nestjs/common": "^7.0.0",
|
|
@@ -153,7 +153,7 @@ class RouterExecutionContext {
|
|
|
153
153
|
const renderTemplate = this.reflectRenderTemplate(callback);
|
|
154
154
|
if (renderTemplate) {
|
|
155
155
|
return async (result, res) => {
|
|
156
|
-
await this.responseController.render(result, res, renderTemplate);
|
|
156
|
+
return await this.responseController.render(result, res, renderTemplate);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
if (redirectResponse && typeof redirectResponse.url === 'string') {
|
|
@@ -16,7 +16,7 @@ export declare class RouterResponseController {
|
|
|
16
16
|
constructor(applicationRef: HttpServer);
|
|
17
17
|
apply<TInput = any, TResponse = any>(result: TInput, response: TResponse, httpStatusCode?: number): Promise<any>;
|
|
18
18
|
redirect<TInput = any, TResponse = any>(resultOrDeferred: TInput, response: TResponse, redirectResponse: RedirectResponse): Promise<void>;
|
|
19
|
-
render<TInput = unknown, TResponse = unknown>(resultOrDeferred: TInput, response: TResponse, template: string): Promise<
|
|
19
|
+
render<TInput = unknown, TResponse = unknown>(resultOrDeferred: TInput, response: TResponse, template: string): Promise<any>;
|
|
20
20
|
transformToResult(resultOrDeferred: any): Promise<any>;
|
|
21
21
|
getStatusByMethod(requestMethod: RequestMethod): number;
|
|
22
22
|
setHeaders<TResponse = unknown>(response: TResponse, headers: CustomHeader[]): void;
|
|
@@ -24,7 +24,7 @@ class RouterResponseController {
|
|
|
24
24
|
}
|
|
25
25
|
async render(resultOrDeferred, response, template) {
|
|
26
26
|
const result = await this.transformToResult(resultOrDeferred);
|
|
27
|
-
this.applicationRef.render(response, template, result);
|
|
27
|
+
return this.applicationRef.render(response, template, result);
|
|
28
28
|
}
|
|
29
29
|
async transformToResult(resultOrDeferred) {
|
|
30
30
|
if (resultOrDeferred && shared_utils_1.isFunction(resultOrDeferred.subscribe)) {
|