@nestjs/common 8.4.3 → 8.4.6

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.
Files changed (65) hide show
  1. package/Readme.md +7 -4
  2. package/decorators/http/render.decorator.d.ts +1 -1
  3. package/decorators/http/render.decorator.js +1 -1
  4. package/exceptions/bad-gateway.exception.d.ts +1 -1
  5. package/exceptions/bad-gateway.exception.js +1 -1
  6. package/exceptions/bad-request.exception.d.ts +1 -1
  7. package/exceptions/bad-request.exception.js +1 -1
  8. package/exceptions/conflict.exception.d.ts +1 -1
  9. package/exceptions/conflict.exception.js +1 -1
  10. package/exceptions/forbidden.exception.d.ts +1 -1
  11. package/exceptions/forbidden.exception.js +1 -1
  12. package/exceptions/gateway-timeout.exception.d.ts +1 -1
  13. package/exceptions/gateway-timeout.exception.js +1 -1
  14. package/exceptions/gone.exception.d.ts +1 -1
  15. package/exceptions/gone.exception.js +1 -1
  16. package/exceptions/http-version-not-supported.exception.d.ts +1 -1
  17. package/exceptions/http-version-not-supported.exception.js +1 -1
  18. package/exceptions/http.exception.d.ts +1 -1
  19. package/exceptions/http.exception.js +1 -1
  20. package/exceptions/im-a-teapot.exception.d.ts +1 -1
  21. package/exceptions/im-a-teapot.exception.js +1 -1
  22. package/exceptions/internal-server-error.exception.d.ts +1 -1
  23. package/exceptions/internal-server-error.exception.js +1 -1
  24. package/exceptions/method-not-allowed.exception.d.ts +1 -1
  25. package/exceptions/method-not-allowed.exception.js +1 -1
  26. package/exceptions/misdirected.exception.d.ts +1 -1
  27. package/exceptions/misdirected.exception.js +1 -1
  28. package/exceptions/not-acceptable.exception.d.ts +1 -1
  29. package/exceptions/not-acceptable.exception.js +1 -1
  30. package/exceptions/not-found.exception.d.ts +1 -1
  31. package/exceptions/not-found.exception.js +1 -1
  32. package/exceptions/not-implemented.exception.d.ts +1 -1
  33. package/exceptions/not-implemented.exception.js +1 -1
  34. package/exceptions/payload-too-large.exception.d.ts +1 -1
  35. package/exceptions/payload-too-large.exception.js +1 -1
  36. package/exceptions/precondition-failed.exception.d.ts +1 -1
  37. package/exceptions/precondition-failed.exception.js +1 -1
  38. package/exceptions/request-timeout.exception.d.ts +1 -1
  39. package/exceptions/request-timeout.exception.js +1 -1
  40. package/exceptions/service-unavailable.exception.d.ts +1 -1
  41. package/exceptions/service-unavailable.exception.js +1 -1
  42. package/exceptions/unauthorized.exception.d.ts +1 -1
  43. package/exceptions/unauthorized.exception.js +1 -1
  44. package/exceptions/unprocessable-entity.exception.d.ts +1 -1
  45. package/exceptions/unprocessable-entity.exception.js +1 -1
  46. package/exceptions/unsupported-media-type.exception.d.ts +1 -1
  47. package/exceptions/unsupported-media-type.exception.js +1 -1
  48. package/file-stream/streamable-file.js +3 -0
  49. package/http/interfaces/index.d.ts +1 -0
  50. package/http/interfaces/index.js +1 -0
  51. package/http/interfaces/raw-body-request.interface.d.ts +4 -0
  52. package/http/interfaces/raw-body-request.interface.js +2 -0
  53. package/index.js +1 -1
  54. package/interfaces/http/http-server.interface.d.ts +1 -1
  55. package/interfaces/modules/provider.interface.d.ts +4 -4
  56. package/interfaces/nest-application-options.interface.d.ts +4 -0
  57. package/package.json +3 -3
  58. package/pipes/default-value.pipe.d.ts +1 -1
  59. package/pipes/parse-array.pipe.d.ts +1 -1
  60. package/pipes/parse-bool.pipe.d.ts +12 -0
  61. package/pipes/parse-bool.pipe.js +18 -2
  62. package/pipes/parse-float.pipe.d.ts +5 -0
  63. package/pipes/parse-float.pipe.js +10 -4
  64. package/pipes/parse-int.pipe.d.ts +5 -0
  65. package/pipes/parse-int.pipe.js +10 -4
package/Readme.md CHANGED
@@ -64,17 +64,20 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
64
64
  <a href="https://github.com/Sanofi-IADC" target="_blank"><img src="https://docs.nestjs.com/assets/sponsors/sanofi.png" width="180" valign="middle" /></a></td>
65
65
  <td>
66
66
  <a href="https://nx.dev" target="_blank"><img src="https://nestjs.com/img/nx-logo.png" height="45" valign="middle" /></a></td>
67
+ <td>
68
+ <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
69
  </tr></table>
68
70
 
69
71
  #### Gold Sponsors
70
72
 
71
73
  <table style="text-align:center;"><tr><td>
72
74
  <a href="https://careers.labster.com/departments/platform" target="_blank"><img src="https://nestjs.com/img/labster-logo.png" width="170" valign="middle" /></a></td><td>
73
- <a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="150" valign="middle" /></a></td>
74
- <td>
75
- <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>
75
+ <a href="https://weld.app/" target="_blank"><img src="https://nestjs.com/img/weld-logo.svg" width="140" valign="middle" /></a></td>
76
76
  <td>
77
- <a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td></</tr></table>
77
+ <a href="https://intrinsic.ventures/" target="_blank"><img src="https://nestjs.com/img/intrinisic-logo.png" width="210" valign="middle" /></a></td>
78
+ <td>
79
+ <a href="https://jetbrains.com/" target="_blank"><img src="https://nestjs.com/img/jetbrains-logo.svg" width="110" valign="middle" /></a></td><td>
80
+ <a href="https://snyk.co/nestjs" target="_blank"><img src="https://nestjs.com/img/snyk-logo-black.png" width="185" valign="middle" /></a></td></</tr></table>
78
81
 
79
82
  #### Silver Sponsors
80
83
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @param template name of the render engine template file
7
7
  *
8
- * @see [Model-View-Controller](https://docs.nestjs.com/techniques.mvc)
8
+ * @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc)
9
9
  *
10
10
  * @publicApi
11
11
  */
@@ -9,7 +9,7 @@ const constants_1 = require("../../constants");
9
9
  *
10
10
  * @param template name of the render engine template file
11
11
  *
12
- * @see [Model-View-Controller](https://docs.nestjs.com/techniques.mvc)
12
+ * @see [Model-View-Controller](https://docs.nestjs.com/techniques/mvc)
13
13
  *
14
14
  * @publicApi
15
15
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Bad Gateway* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Bad Gateway* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Bad Request* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Bad Request* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Conflict* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Conflict* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Forbidden* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Forbidden* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Gateway Timeout* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Gateway Timeout* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Gone* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Gone* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Http Version Not Supported* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Http Version Not Supported* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@
2
2
  * Defines the base Nest HTTP exception, which is handled by the default
3
3
  * Exceptions Handler.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const shared_utils_1 = require("../utils/shared.utils");
6
6
  * Defines the base Nest HTTP exception, which is handled by the default
7
7
  * Exceptions Handler.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -5,7 +5,7 @@ import { HttpException } from './http.exception';
5
5
  * Any attempt to brew coffee with a teapot should result in the error code
6
6
  * "418 I'm a teapot". The resulting entity body MAY be short and stout.
7
7
  *
8
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
8
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
9
9
  *
10
10
  * @publicApi
11
11
  */
@@ -9,7 +9,7 @@ const http_exception_1 = require("./http.exception");
9
9
  * Any attempt to brew coffee with a teapot should result in the error code
10
10
  * "418 I'm a teapot". The resulting entity body MAY be short and stout.
11
11
  *
12
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
12
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
13
13
  *
14
14
  * @publicApi
15
15
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Internal Server Error* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Internal Server Error* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Method Not Allowed* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Method Not Allowed* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Misdirected* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Misdirected* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Not Acceptable* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Not Acceptable* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Not Found* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Not Found* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Not Implemented* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Not Implemented* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Payload Too Large* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Payload Too Large* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Precondition Failed* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Precondition Failed* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Request Timeout* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Request Timeout* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Service Unavailable* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Service Unavailable* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Unauthorized* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Unauthorized* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Unprocessable Entity* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Unprocessable Entity* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -2,7 +2,7 @@ import { HttpException } from './http.exception';
2
2
  /**
3
3
  * Defines an HTTP exception for *Unsupported Media Type* type errors.
4
4
  *
5
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
5
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
6
6
  *
7
7
  * @publicApi
8
8
  */
@@ -6,7 +6,7 @@ const http_exception_1 = require("./http.exception");
6
6
  /**
7
7
  * Defines an HTTP exception for *Unsupported Media Type* type errors.
8
8
  *
9
- * @see [Base Exceptions](https://docs.nestjs.com/exception-filters#base-exceptions)
9
+ * @see [Built-in HTTP exceptions](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)
10
10
  *
11
11
  * @publicApi
12
12
  */
@@ -6,11 +6,14 @@ const util_1 = require("util");
6
6
  const shared_utils_1 = require("../utils/shared.utils");
7
7
  class StreamableFile {
8
8
  constructor(bufferOrReadStream, options = {}) {
9
+ var _a;
10
+ var _b;
9
11
  this.options = options;
10
12
  if (util_1.types.isUint8Array(bufferOrReadStream)) {
11
13
  this.stream = new stream_1.Readable();
12
14
  this.stream.push(bufferOrReadStream);
13
15
  this.stream.push(null);
16
+ (_a = (_b = this.options).length) !== null && _a !== void 0 ? _a : (_b.length = bufferOrReadStream.length);
14
17
  }
15
18
  else if (bufferOrReadStream.pipe && (0, shared_utils_1.isFunction)(bufferOrReadStream.pipe)) {
16
19
  this.stream = bufferOrReadStream;
@@ -1 +1,2 @@
1
1
  export * from './http-module.interface';
2
+ export * from './raw-body-request.interface';
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./http-module.interface"), exports);
5
+ tslib_1.__exportStar(require("./raw-body-request.interface"), exports);
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ export declare type RawBodyRequest<T> = T & {
3
+ rawBody?: Buffer;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.js CHANGED
@@ -4,7 +4,7 @@ exports.VERSION_NEUTRAL = exports.Scope = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  /*
6
6
  * Nest @common
7
- * Copyright(c) 2017 - 2021 Kamil Mysliwiec
7
+ * Copyright(c) 2017 - 2022 Kamil Mysliwiec
8
8
  * https://nestjs.com
9
9
  * MIT Licensed
10
10
  */
@@ -40,7 +40,7 @@ export interface HttpServer<TRequest = any, TResponse = any> {
40
40
  getRequestMethod?(request: TRequest): string;
41
41
  getRequestUrl?(request: TRequest): string;
42
42
  getInstance(): any;
43
- registerParserMiddleware(): any;
43
+ registerParserMiddleware(...args: any[]): any;
44
44
  enableCors(options: CorsOptions | CorsOptionsDelegate<TRequest>): any;
45
45
  getHttpServer(): any;
46
46
  initHttpServer(options: NestApplicationOptions): void;
@@ -21,7 +21,7 @@ export declare type Provider<T = any> = Type<any> | ClassProvider<T> | ValueProv
21
21
  * };
22
22
  * ```
23
23
  *
24
- * @see [Use class](https://docs.nestjs.com/fundamentals/custom-providers#use-class)
24
+ * @see [Class providers](https://docs.nestjs.com/fundamentals/custom-providers#class-providers-useclass)
25
25
  * @see [Injection scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
26
26
  *
27
27
  * @publicApi
@@ -51,7 +51,7 @@ export interface ClassProvider<T = any> {
51
51
  * };
52
52
  * ```
53
53
  *
54
- * @see [Use value](https://docs.nestjs.com/fundamentals/custom-providers#use-value)
54
+ * @see [Value providers](https://docs.nestjs.com/fundamentals/custom-providers#value-providers-usevalue)
55
55
  *
56
56
  * @publicApi
57
57
  */
@@ -80,7 +80,7 @@ export interface ValueProvider<T = any> {
80
80
  * };
81
81
  * ```
82
82
  *
83
- * @see [Use factory](https://docs.nestjs.com/fundamentals/custom-providers#use-factory)
83
+ * @see [Factory providers](https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory)
84
84
  * @see [Injection scopes](https://docs.nestjs.com/fundamentals/injection-scopes)
85
85
  *
86
86
  * @publicApi
@@ -114,7 +114,7 @@ export interface FactoryProvider<T = any> {
114
114
  * };
115
115
  * ```
116
116
  *
117
- * @see [Use existing](https://docs.nestjs.com/fundamentals/custom-providers#use-existing)
117
+ * @see [Alias providers](https://docs.nestjs.com/fundamentals/custom-providers#alias-providers-useexisting)
118
118
  *
119
119
  * @publicApi
120
120
  */
@@ -17,4 +17,8 @@ export interface NestApplicationOptions extends NestApplicationContextOptions {
17
17
  * Set of configurable HTTPS options
18
18
  */
19
19
  httpsOptions?: HttpsOptions;
20
+ /**
21
+ * Whether to register the raw request body on the request. Use `req.rawBody`.
22
+ */
23
+ rawBody?: boolean;
20
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/common",
3
- "version": "8.4.3",
3
+ "version": "8.4.6",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@common)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://nestjs.com",
@@ -17,9 +17,9 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "axios": "0.26.1",
20
+ "axios": "0.27.2",
21
21
  "iterare": "1.2.1",
22
- "tslib": "2.3.1",
22
+ "tslib": "2.4.0",
23
23
  "uuid": "8.3.2"
24
24
  },
25
25
  "peerDependencies": {
@@ -7,7 +7,7 @@ import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-tra
7
7
  * @publicApi
8
8
  */
9
9
  export declare class DefaultValuePipe<T = any, R = any> implements PipeTransform<T, T | R> {
10
- private readonly defaultValue;
10
+ protected readonly defaultValue: R;
11
11
  constructor(defaultValue: R);
12
12
  transform(value?: T, _metadata?: ArgumentMetadata): T | R;
13
13
  }
@@ -15,7 +15,7 @@ export interface ParseArrayOptions extends Omit<ValidationPipeOptions, 'transfor
15
15
  * @publicApi
16
16
  */
17
17
  export declare class ParseArrayPipe implements PipeTransform {
18
- private readonly options;
18
+ protected readonly options: ParseArrayOptions;
19
19
  protected readonly validationPipe: ValidationPipe;
20
20
  protected exceptionFactory: (error: string) => any;
21
21
  constructor(options?: ParseArrayOptions);
@@ -22,4 +22,16 @@ export declare class ParseBoolPipe implements PipeTransform<string | boolean, Pr
22
22
  * @param metadata contains metadata about the currently processed route argument
23
23
  */
24
24
  transform(value: string | boolean, metadata: ArgumentMetadata): Promise<boolean>;
25
+ /**
26
+ * @param value currently processed route argument
27
+ * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean
28
+ * `true` or the string `"true"`
29
+ */
30
+ protected isTrue(value: string | boolean): boolean;
31
+ /**
32
+ * @param value currently processed route argument
33
+ * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean
34
+ * `false` or the string `"false"`
35
+ */
36
+ protected isFalse(value: string | boolean): boolean;
25
37
  }
@@ -29,14 +29,30 @@ let ParseBoolPipe = class ParseBoolPipe {
29
29
  * @param metadata contains metadata about the currently processed route argument
30
30
  */
31
31
  async transform(value, metadata) {
32
- if (value === true || value === 'true') {
32
+ if (this.isTrue(value)) {
33
33
  return true;
34
34
  }
35
- if (value === false || value === 'false') {
35
+ if (this.isFalse(value)) {
36
36
  return false;
37
37
  }
38
38
  throw this.exceptionFactory('Validation failed (boolean string is expected)');
39
39
  }
40
+ /**
41
+ * @param value currently processed route argument
42
+ * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean
43
+ * `true` or the string `"true"`
44
+ */
45
+ isTrue(value) {
46
+ return value === true || value === 'true';
47
+ }
48
+ /**
49
+ * @param value currently processed route argument
50
+ * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean
51
+ * `false` or the string `"false"`
52
+ */
53
+ isFalse(value) {
54
+ return value === false || value === 'false';
55
+ }
40
56
  };
41
57
  ParseBoolPipe = tslib_1.__decorate([
42
58
  (0, injectable_decorator_1.Injectable)(),
@@ -23,4 +23,9 @@ export declare class ParseFloatPipe implements PipeTransform<string> {
23
23
  * @param metadata contains metadata about the currently processed route argument
24
24
  */
25
25
  transform(value: string, metadata: ArgumentMetadata): Promise<number>;
26
+ /**
27
+ * @param value currently processed route argument
28
+ * @returns `true` if `value` is a valid float number
29
+ */
30
+ protected isNumeric(value: string): boolean;
26
31
  }
@@ -27,14 +27,20 @@ let ParseFloatPipe = class ParseFloatPipe {
27
27
  * @param metadata contains metadata about the currently processed route argument
28
28
  */
29
29
  async transform(value, metadata) {
30
- const isNumeric = ['string', 'number'].includes(typeof value) &&
31
- !isNaN(parseFloat(value)) &&
32
- isFinite(value);
33
- if (!isNumeric) {
30
+ if (!this.isNumeric(value)) {
34
31
  throw this.exceptionFactory('Validation failed (numeric string is expected)');
35
32
  }
36
33
  return parseFloat(value);
37
34
  }
35
+ /**
36
+ * @param value currently processed route argument
37
+ * @returns `true` if `value` is a valid float number
38
+ */
39
+ isNumeric(value) {
40
+ return (['string', 'number'].includes(typeof value) &&
41
+ !isNaN(parseFloat(value)) &&
42
+ isFinite(value));
43
+ }
38
44
  };
39
45
  ParseFloatPipe = tslib_1.__decorate([
40
46
  (0, index_1.Injectable)(),
@@ -22,4 +22,9 @@ export declare class ParseIntPipe implements PipeTransform<string> {
22
22
  * @param metadata contains metadata about the currently processed route argument
23
23
  */
24
24
  transform(value: string, metadata: ArgumentMetadata): Promise<number>;
25
+ /**
26
+ * @param value currently processed route argument
27
+ * @returns `true` if `value` is a valid integer number
28
+ */
29
+ protected isNumeric(value: string): boolean;
25
30
  }
@@ -29,14 +29,20 @@ let ParseIntPipe = class ParseIntPipe {
29
29
  * @param metadata contains metadata about the currently processed route argument
30
30
  */
31
31
  async transform(value, metadata) {
32
- const isNumeric = ['string', 'number'].includes(typeof value) &&
33
- /^-?\d+$/.test(value) &&
34
- isFinite(value);
35
- if (!isNumeric) {
32
+ if (!this.isNumeric(value)) {
36
33
  throw this.exceptionFactory('Validation failed (numeric string is expected)');
37
34
  }
38
35
  return parseInt(value, 10);
39
36
  }
37
+ /**
38
+ * @param value currently processed route argument
39
+ * @returns `true` if `value` is a valid integer number
40
+ */
41
+ isNumeric(value) {
42
+ return (['string', 'number'].includes(typeof value) &&
43
+ /^-?\d+$/.test(value) &&
44
+ isFinite(value));
45
+ }
40
46
  };
41
47
  ParseIntPipe = tslib_1.__decorate([
42
48
  (0, injectable_decorator_1.Injectable)(),