@nestia/core 4.2.0 → 4.3.0-dev.20241215-2

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 (74) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +87 -87
  3. package/package.json +4 -4
  4. package/src/adaptors/WebSocketAdaptor.ts +426 -426
  5. package/src/decorators/DynamicModule.ts +43 -43
  6. package/src/decorators/EncryptedBody.ts +101 -101
  7. package/src/decorators/EncryptedController.ts +38 -38
  8. package/src/decorators/EncryptedModule.ts +100 -100
  9. package/src/decorators/EncryptedRoute.ts +219 -219
  10. package/src/decorators/NoTransformConfigurationError.ts +32 -32
  11. package/src/decorators/PlainBody.ts +79 -79
  12. package/src/decorators/SwaggerCustomizer.ts +115 -115
  13. package/src/decorators/SwaggerExample.ts +100 -100
  14. package/src/decorators/TypedBody.ts +59 -59
  15. package/src/decorators/TypedException.ts +128 -128
  16. package/src/decorators/TypedFormData.ts +195 -195
  17. package/src/decorators/TypedHeaders.ts +64 -64
  18. package/src/decorators/TypedParam.ts +66 -66
  19. package/src/decorators/TypedQuery.ts +245 -245
  20. package/src/decorators/TypedRoute.ts +214 -214
  21. package/src/decorators/WebSocketRoute.ts +242 -242
  22. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  23. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  24. package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
  25. package/src/decorators/internal/get_path_and_querify.ts +108 -108
  26. package/src/decorators/internal/get_path_and_stringify.ts +122 -122
  27. package/src/decorators/internal/get_text_body.ts +20 -20
  28. package/src/decorators/internal/headers_to_object.ts +13 -13
  29. package/src/decorators/internal/is_request_body_undefined.ts +14 -14
  30. package/src/decorators/internal/load_controller.ts +49 -49
  31. package/src/decorators/internal/route_error.ts +45 -45
  32. package/src/decorators/internal/validate_request_body.ts +74 -74
  33. package/src/decorators/internal/validate_request_form_data.ts +77 -77
  34. package/src/decorators/internal/validate_request_headers.ts +86 -86
  35. package/src/decorators/internal/validate_request_query.ts +74 -74
  36. package/src/index.ts +5 -5
  37. package/src/module.ts +21 -21
  38. package/src/options/INestiaTransformOptions.ts +24 -24
  39. package/src/options/INestiaTransformProject.ts +8 -8
  40. package/src/options/IRequestBodyValidator.ts +20 -20
  41. package/src/options/IRequestFormDataProps.ts +27 -27
  42. package/src/options/IRequestHeadersValidator.ts +22 -22
  43. package/src/options/IRequestQueryValidator.ts +20 -20
  44. package/src/options/IResponseBodyQuerifier.ts +25 -25
  45. package/src/options/IResponseBodyStringifier.ts +30 -30
  46. package/src/programmers/PlainBodyProgrammer.ts +70 -70
  47. package/src/programmers/TypedBodyProgrammer.ts +132 -132
  48. package/src/programmers/TypedFormDataBodyProgrammer.ts +118 -118
  49. package/src/programmers/TypedHeadersProgrammer.ts +63 -63
  50. package/src/programmers/TypedParamProgrammer.ts +30 -30
  51. package/src/programmers/TypedQueryBodyProgrammer.ts +63 -63
  52. package/src/programmers/TypedQueryProgrammer.ts +65 -65
  53. package/src/programmers/TypedQueryRouteProgrammer.ts +56 -56
  54. package/src/programmers/TypedRouteProgrammer.ts +76 -76
  55. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +72 -72
  56. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +75 -75
  57. package/src/programmers/http/HttpQuerifyProgrammer.ts +108 -108
  58. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +76 -76
  59. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  60. package/src/transform.ts +35 -35
  61. package/src/transformers/FileTransformer.ts +110 -110
  62. package/src/transformers/MethodTransformer.ts +103 -103
  63. package/src/transformers/NodeTransformer.ts +23 -23
  64. package/src/transformers/ParameterDecoratorTransformer.ts +143 -143
  65. package/src/transformers/ParameterTransformer.ts +57 -57
  66. package/src/transformers/TypedRouteTransformer.ts +85 -85
  67. package/src/transformers/WebSocketRouteTransformer.ts +120 -120
  68. package/src/typings/Creator.ts +3 -3
  69. package/src/typings/get-function-location.d.ts +7 -7
  70. package/src/utils/ArrayUtil.ts +7 -7
  71. package/src/utils/ExceptionManager.ts +112 -112
  72. package/src/utils/Singleton.ts +20 -20
  73. package/src/utils/SourceFinder.ts +57 -57
  74. package/src/utils/VersioningStrategy.ts +27 -27
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Jeongho Nam
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Jeongho Nam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # Nestia
2
- ![Nestia Logo](https://nestia.io/logo.png)
3
-
4
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
5
- [![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
6
- [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
7
- [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
8
- [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)
9
- [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
10
-
11
- Nestia is a set of helper libraries for NestJS, supporting below features:
12
-
13
- - `@nestia/core`:
14
- - Super-fast/easy decorators
15
- - Advanced WebSocket routes
16
- - `@nestia/sdk`:
17
- - Swagger generator evolved than ever
18
- - SDK library generator for clients
19
- - Mockup Simulator for client applications
20
- - Automatic E2E test functions generator
21
- - `@nestia/e2e`: Test program utilizing e2e test functions
22
- - `@nestia/benchmark`: Benchmark program using e2e test functions
23
- - `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
24
- - `@nestia/editor`: Swagger-UI with Online TypeScript Editor
25
- - `nestia`: Just CLI (command line interface) tool
26
-
27
- > [!NOTE]
28
- >
29
- > - **Only one line** required, with pure TypeScript type
30
- > - Enhance performance **30x** up
31
- > - Runtime validator is **20,000x faster** than `class-validator`
32
- > - JSON serialization is **200x faster** than `class-transformer`
33
- > - Software Development Kit
34
- > - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
35
- > - Mockup simulator means embedded backend simulator in the SDK
36
- > - similar with [msw](https://mswjs.io/), but fully automated
37
-
38
- ![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)
39
-
40
- > Left is NestJS server code, and right is client (frontend) code utilizing SDK
41
-
42
-
43
-
44
-
45
- ## Sponsors and Backers
46
- Thanks for your support.
47
-
48
- Your donation would encourage `nestia` development.
49
-
50
- [![Backers](https://opencollective.com/nestia/backers.svg?avatarHeight=75&width=600)](https://opencollective.com/nestia)
51
-
52
-
53
-
54
-
55
- ## Guide Documents
56
- Check out the document in the [website](https://nestia.io/docs/):
57
-
58
- ### 🏠 Home
59
- - [Introduction](https://nestia.io/docs/)
60
- - [Setup](https://nestia.io/docs/setup/)
61
- - [Pure TypeScript](https://nestia.io/docs/pure)
62
-
63
- ### 📖 Features
64
- - Core Library
65
- - [WebSocketRoute](https://nestia.io/docs/core/WebSocketRoute)
66
- - [TypedRoute](https://nestia.io/docs/core/TypedRoute/)
67
- - [TypedBody](https://nestia.io/docs/core/TypedBody/)
68
- - [TypedParam](https://nestia.io/docs/core/TypedParam/)
69
- - [TypedQuery](https://nestia.io/docs/core/TypedQuery/)
70
- - [TypedHeaders](https://nestia.io/docs/core/TypedHeaders/)
71
- - [TypedException](https://nestia.io/docs/core/TypedException/)
72
- - Generators
73
- - [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
74
- - [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
75
- - [E2E Functions](https://nestia.io/docs/sdk/e2e/)
76
- - [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
77
- - E2E Testing
78
- - [Why E2E Test?](https://nestia.io/docs/e2e/why/)
79
- - [Test Program Development](https://nestia.io/docs/e2e/development/)
80
- - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
81
- - [Swagger to NestJS](https://nestia.io/docs/migrate/)
82
- - [TypeScript Swagger Editor](https://nestia.io/docs/editor/)
83
-
84
- ### 🔗 Appendix
85
- - [API Documents](https://nestia.io/api)
86
- - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
87
- - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751)
1
+ # Nestia
2
+ ![Nestia Logo](https://nestia.io/logo.png)
3
+
4
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)
5
+ [![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
6
+ [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher)
7
+ [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)
8
+ [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)
9
+ [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
10
+
11
+ Nestia is a set of helper libraries for NestJS, supporting below features:
12
+
13
+ - `@nestia/core`:
14
+ - Super-fast/easy decorators
15
+ - Advanced WebSocket routes
16
+ - `@nestia/sdk`:
17
+ - Swagger generator evolved than ever
18
+ - SDK library generator for clients
19
+ - Mockup Simulator for client applications
20
+ - Automatic E2E test functions generator
21
+ - `@nestia/e2e`: Test program utilizing e2e test functions
22
+ - `@nestia/benchmark`: Benchmark program using e2e test functions
23
+ - `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK
24
+ - `@nestia/editor`: Swagger-UI with Online TypeScript Editor
25
+ - `nestia`: Just CLI (command line interface) tool
26
+
27
+ > [!NOTE]
28
+ >
29
+ > - **Only one line** required, with pure TypeScript type
30
+ > - Enhance performance **30x** up
31
+ > - Runtime validator is **20,000x faster** than `class-validator`
32
+ > - JSON serialization is **200x faster** than `class-transformer`
33
+ > - Software Development Kit
34
+ > - Collection of typed `fetch` functions with DTO structures like [tRPC](https://trpc.io/)
35
+ > - Mockup simulator means embedded backend simulator in the SDK
36
+ > - similar with [msw](https://mswjs.io/), but fully automated
37
+
38
+ ![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)
39
+
40
+ > Left is NestJS server code, and right is client (frontend) code utilizing SDK
41
+
42
+
43
+
44
+
45
+ ## Sponsors and Backers
46
+ Thanks for your support.
47
+
48
+ Your donation would encourage `nestia` development.
49
+
50
+ [![Backers](https://opencollective.com/nestia/backers.svg?avatarHeight=75&width=600)](https://opencollective.com/nestia)
51
+
52
+
53
+
54
+
55
+ ## Guide Documents
56
+ Check out the document in the [website](https://nestia.io/docs/):
57
+
58
+ ### 🏠 Home
59
+ - [Introduction](https://nestia.io/docs/)
60
+ - [Setup](https://nestia.io/docs/setup/)
61
+ - [Pure TypeScript](https://nestia.io/docs/pure)
62
+
63
+ ### 📖 Features
64
+ - Core Library
65
+ - [WebSocketRoute](https://nestia.io/docs/core/WebSocketRoute)
66
+ - [TypedRoute](https://nestia.io/docs/core/TypedRoute/)
67
+ - [TypedBody](https://nestia.io/docs/core/TypedBody/)
68
+ - [TypedParam](https://nestia.io/docs/core/TypedParam/)
69
+ - [TypedQuery](https://nestia.io/docs/core/TypedQuery/)
70
+ - [TypedHeaders](https://nestia.io/docs/core/TypedHeaders/)
71
+ - [TypedException](https://nestia.io/docs/core/TypedException/)
72
+ - Generators
73
+ - [Swagger Documents](https://nestia.io/docs/sdk/swagger/)
74
+ - [Software Development Kit](https://nestia.io/docs/sdk/sdk/)
75
+ - [E2E Functions](https://nestia.io/docs/sdk/e2e/)
76
+ - [Mockup Simulator](https://nestia.io/docs/sdk/simulator/)
77
+ - E2E Testing
78
+ - [Why E2E Test?](https://nestia.io/docs/e2e/why/)
79
+ - [Test Program Development](https://nestia.io/docs/e2e/development/)
80
+ - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/)
81
+ - [Swagger to NestJS](https://nestia.io/docs/migrate/)
82
+ - [TypeScript Swagger Editor](https://nestia.io/docs/editor/)
83
+
84
+ ### 🔗 Appendix
85
+ - [API Documents](https://nestia.io/api)
86
+ - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)
87
+ - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "4.2.0",
3
+ "version": "4.3.0-dev.20241215-2",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "homepage": "https://nestia.io",
38
38
  "dependencies": {
39
- "@nestia/fetcher": "^4.2.0",
39
+ "@nestia/fetcher": "^4.3.0-dev.20241215-2",
40
40
  "@nestjs/common": ">=7.0.1",
41
41
  "@nestjs/core": ">=7.0.1",
42
42
  "@samchon/openapi": "^2.0.1",
@@ -48,11 +48,11 @@
48
48
  "reflect-metadata": ">=0.1.12",
49
49
  "rxjs": ">=6.0.3",
50
50
  "tgrid": "^1.1.0",
51
- "typia": "^7.2.0",
51
+ "typia": "^7.3.0",
52
52
  "ws": "^7.5.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@nestia/fetcher": ">=4.2.0",
55
+ "@nestia/fetcher": ">=4.3.0-dev.20241215-2",
56
56
  "@nestjs/common": ">=7.0.1",
57
57
  "@nestjs/core": ">=7.0.1",
58
58
  "reflect-metadata": ">=0.1.12",