@nestjs/core 11.0.21 → 11.1.1

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 CHANGED
@@ -62,9 +62,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
62
62
  <td><a href="https://trilon.io" target="_blank"><img src="https://nestjs.com/img/trilon.svg" width="200" valign="middle" /></a></td>
63
63
  <td><a href="https://microsoft.com/" target="_blank"><img src="https://nestjs.com/img/logos/microsoft-logo.png" width="180" valign="middle" /></a></td>
64
64
  <td><a href="https://mojam.co" target="_blank"><img src="https://nestjs.com/img/logos/mojam-logo.png" width="80" valign="middle" /></a></td>
65
- <td><a href="https://marblism.com?utm_source=nest" target="_blank"><img src="https://nestjs.com/img/logos/marblism-logo.png" width="180" valign="middle" /></a></td>
66
65
  <td><a href="https://valor-software.com/" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="170" valign="middle" /></a></td>
67
- <td><a href="https://amplication.com/" target="_blank"><img src="https://nestjs.com/img/logos/amplication-logo.svg" width="190" valign="middle" /></a></td>
68
66
  </tr>
69
67
  </table>
70
68
 
@@ -64,7 +64,9 @@ export declare abstract class AbstractHttpAdapter<TServer = any, TRequest = any,
64
64
  abstract setErrorHandler(handler: Function, prefix?: string): any;
65
65
  abstract setNotFoundHandler(handler: Function, prefix?: string): any;
66
66
  abstract isHeadersSent(response: any): any;
67
+ abstract getHeader(response: any, name: string): any;
67
68
  abstract setHeader(response: any, name: string, value: string): any;
69
+ abstract appendHeader(response: any, name: string, value: string): any;
68
70
  abstract registerParserMiddleware(prefix?: string, rawBody?: boolean): any;
69
71
  abstract enableCors(options?: any, prefix?: string): any;
70
72
  abstract createMiddlewareFactory(requestMethod: RequestMethod): ((path: string, callback: Function) => any) | Promise<(path: string, callback: Function) => any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/core",
3
- "version": "11.0.21",
3
+ "version": "11.1.1",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@core)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "uid": "2.0.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@nestjs/common": "11.0.21"
42
+ "@nestjs/common": "11.1.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@nestjs/common": "^11.0.0",
@@ -20,6 +20,7 @@ export declare class RoutesResolver implements Resolver {
20
20
  registerNotFoundHandler(): void;
21
21
  registerExceptionHandler(): void;
22
22
  mapExternalException(err: any): any;
23
+ private isHttpFastifyError;
23
24
  private getModulePathMetadata;
24
25
  private getHostMetadata;
25
26
  private getVersionMetadata;
@@ -98,10 +98,18 @@ class RoutesResolver {
98
98
  // encoding, e.g. '%FF' (#8915)
99
99
  case err instanceof SyntaxError || err instanceof URIError:
100
100
  return new common_1.BadRequestException(err.message);
101
+ case this.isHttpFastifyError(err):
102
+ return new common_1.HttpException(err.message, err.statusCode);
101
103
  default:
102
104
  return err;
103
105
  }
104
106
  }
107
+ isHttpFastifyError(error) {
108
+ // condition based on this code - https://github.com/fastify/fastify-error/blob/d669b150a82968322f9f7be992b2f6b463272de3/index.js#L22
109
+ return (error.statusCode !== undefined &&
110
+ error instanceof Error &&
111
+ error.name === 'FastifyError');
112
+ }
105
113
  getModulePathMetadata(metatype) {
106
114
  const modulesContainer = this.container.getModules();
107
115
  const modulePath = Reflect.getMetadata(constants_1.MODULE_PATH + modulesContainer.applicationId, metatype);