@nestia/core 4.3.0 → 4.4.0-dev.20241216-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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +87 -87
  3. package/lib/decorators/TypedParam.d.ts +1 -1
  4. package/lib/decorators/TypedParam.js +12 -7
  5. package/lib/decorators/TypedParam.js.map +1 -1
  6. package/lib/options/INestiaTransformOptions.d.ts +6 -2
  7. package/lib/programmers/TypedParamProgrammer.js +8 -0
  8. package/lib/programmers/TypedParamProgrammer.js.map +1 -1
  9. package/package.json +6 -6
  10. package/src/adaptors/WebSocketAdaptor.ts +426 -426
  11. package/src/decorators/DynamicModule.ts +43 -43
  12. package/src/decorators/EncryptedBody.ts +101 -101
  13. package/src/decorators/EncryptedController.ts +38 -38
  14. package/src/decorators/EncryptedModule.ts +100 -100
  15. package/src/decorators/EncryptedRoute.ts +219 -219
  16. package/src/decorators/NoTransformConfigurationError.ts +32 -32
  17. package/src/decorators/PlainBody.ts +79 -79
  18. package/src/decorators/SwaggerCustomizer.ts +115 -115
  19. package/src/decorators/SwaggerExample.ts +100 -100
  20. package/src/decorators/TypedBody.ts +59 -59
  21. package/src/decorators/TypedException.ts +128 -128
  22. package/src/decorators/TypedFormData.ts +195 -195
  23. package/src/decorators/TypedHeaders.ts +64 -64
  24. package/src/decorators/TypedParam.ts +77 -66
  25. package/src/decorators/TypedQuery.ts +245 -245
  26. package/src/decorators/TypedRoute.ts +214 -214
  27. package/src/decorators/WebSocketRoute.ts +242 -242
  28. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  29. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  30. package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
  31. package/src/decorators/internal/get_path_and_querify.ts +108 -108
  32. package/src/decorators/internal/get_path_and_stringify.ts +122 -122
  33. package/src/decorators/internal/get_text_body.ts +20 -20
  34. package/src/decorators/internal/headers_to_object.ts +13 -13
  35. package/src/decorators/internal/is_request_body_undefined.ts +14 -14
  36. package/src/decorators/internal/load_controller.ts +49 -49
  37. package/src/decorators/internal/route_error.ts +45 -45
  38. package/src/decorators/internal/validate_request_body.ts +74 -74
  39. package/src/decorators/internal/validate_request_form_data.ts +77 -77
  40. package/src/decorators/internal/validate_request_headers.ts +86 -86
  41. package/src/decorators/internal/validate_request_query.ts +74 -74
  42. package/src/index.ts +5 -5
  43. package/src/module.ts +21 -21
  44. package/src/options/INestiaTransformOptions.ts +29 -24
  45. package/src/options/INestiaTransformProject.ts +8 -8
  46. package/src/options/IRequestBodyValidator.ts +20 -20
  47. package/src/options/IRequestFormDataProps.ts +27 -27
  48. package/src/options/IRequestHeadersValidator.ts +22 -22
  49. package/src/options/IRequestQueryValidator.ts +20 -20
  50. package/src/options/IResponseBodyQuerifier.ts +25 -25
  51. package/src/options/IResponseBodyStringifier.ts +30 -30
  52. package/src/programmers/PlainBodyProgrammer.ts +70 -70
  53. package/src/programmers/TypedBodyProgrammer.ts +132 -132
  54. package/src/programmers/TypedFormDataBodyProgrammer.ts +118 -118
  55. package/src/programmers/TypedHeadersProgrammer.ts +63 -63
  56. package/src/programmers/TypedParamProgrammer.ts +33 -30
  57. package/src/programmers/TypedQueryBodyProgrammer.ts +63 -63
  58. package/src/programmers/TypedQueryProgrammer.ts +65 -65
  59. package/src/programmers/TypedQueryRouteProgrammer.ts +56 -56
  60. package/src/programmers/TypedRouteProgrammer.ts +76 -76
  61. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +72 -72
  62. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +75 -75
  63. package/src/programmers/http/HttpQuerifyProgrammer.ts +108 -108
  64. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +76 -76
  65. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  66. package/src/transform.ts +35 -35
  67. package/src/transformers/FileTransformer.ts +110 -110
  68. package/src/transformers/MethodTransformer.ts +103 -103
  69. package/src/transformers/NodeTransformer.ts +23 -23
  70. package/src/transformers/ParameterDecoratorTransformer.ts +143 -143
  71. package/src/transformers/ParameterTransformer.ts +57 -57
  72. package/src/transformers/TypedRouteTransformer.ts +85 -85
  73. package/src/transformers/WebSocketRouteTransformer.ts +120 -120
  74. package/src/typings/Creator.ts +3 -3
  75. package/src/typings/get-function-location.d.ts +7 -7
  76. package/src/utils/ArrayUtil.ts +7 -7
  77. package/src/utils/ExceptionManager.ts +112 -112
  78. package/src/utils/Singleton.ts +20 -20
  79. package/src/utils/SourceFinder.ts +57 -57
  80. 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)
@@ -21,4 +21,4 @@
21
21
  *
22
22
  * @author Jeongho Nam - https://github.com/samchon
23
23
  */
24
- export declare function TypedParam<T extends boolean | bigint | number | string | null>(name: string, assert?: (value: string) => T): ParameterDecorator;
24
+ export declare function TypedParam<T extends boolean | bigint | number | string | null>(name: string, assert?: (value: string) => T, validate?: boolean): ParameterDecorator;
@@ -30,12 +30,13 @@ const NoTransformConfigurationError_1 = require("./NoTransformConfigurationError
30
30
  *
31
31
  * @author Jeongho Nam - https://github.com/samchon
32
32
  */
33
- function TypedParam(name, assert) {
33
+ function TypedParam(name, assert, validate) {
34
34
  if (assert === undefined) {
35
35
  (0, NoTransformConfigurationError_1.NoTransformConfigurationError)("TypedParam");
36
36
  assert = (value) => value;
37
37
  }
38
38
  return (0, common_1.createParamDecorator)(function TypedParam({}, context) {
39
+ var _a;
39
40
  const request = context
40
41
  .switchToHttp()
41
42
  .getRequest();
@@ -44,14 +45,18 @@ function TypedParam(name, assert) {
44
45
  return assert(str);
45
46
  }
46
47
  catch (exp) {
47
- if ((() => { const _io0 = input => "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && true && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); return input => "object" === typeof input && null !== input && _io0(input); })()(exp))
48
- throw new common_1.BadRequestException({
49
- path: exp.path,
50
- reason: exp.message,
48
+ if ((() => { const _io0 = input => "string" === typeof input.method && (undefined === input.path || "string" === typeof input.path) && "string" === typeof input.expected && true && true && "string" === typeof input.name && "string" === typeof input.message && (undefined === input.stack || "string" === typeof input.stack); return input => "object" === typeof input && null !== input && _io0(input); })()(exp)) {
49
+ const trace = {
50
+ path: (_a = exp.path) !== null && _a !== void 0 ? _a : "$input",
51
51
  expected: exp.expected,
52
52
  value: exp.value,
53
- message: `Invalid URL parameter value on "${name}".`,
54
- });
53
+ };
54
+ throw new common_1.BadRequestException(Object.assign({ message: `Invalid URL parameter value on "${name}".` }, (validate === true
55
+ ? {
56
+ errors: [trace],
57
+ }
58
+ : Object.assign(Object.assign({}, trace), { reason: exp.message }))));
59
+ }
55
60
  throw exp;
56
61
  }
57
62
  })(name);
@@ -1 +1 @@
1
- {"version":3,"file":"TypedParam.js","sourceRoot":"","sources":["../../src/decorators/TypedParam.ts"],"names":[],"mappings":";;;;;AAkCA,gCA+BC;AAjED,2CAIwB;AAGxB,kDAA8C;AAE9C,mFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,UAAU,CACxB,IAAY,EACZ,MAA6B;IAE7B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,IAAA,6DAA6B,EAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,KAAU,CAAC;IACjC,CAAC;IAED,OAAO,IAAA,6BAAoB,EAAC,SAAS,UAAU,CAC7C,EAAO,EACP,OAAyB;QAEzB,MAAM,OAAO,GAAqC,OAAO;aACtD,YAAY,EAAE;aACd,UAAU,EAAE,CAAC;QAChB,MAAM,GAAG,GAAY,OAAO,CAAC,MAAc,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qZAA6B,GAAG;gBAC9B,MAAM,IAAI,4BAAmB,CAAC;oBAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,MAAM,EAAE,GAAG,CAAC,OAAO;oBACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,OAAO,EAAE,mCAAmC,IAAI,IAAI;iBACrD,CAAC,CAAC;YACL,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"TypedParam.js","sourceRoot":"","sources":["../../src/decorators/TypedParam.ts"],"names":[],"mappings":";;;;;AAkCA,gCA0CC;AA5ED,2CAIwB;AAGxB,kDAA2D;AAE3D,mFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,UAAU,CACxB,IAAY,EACZ,MAA6B,EAC7B,QAAkB;IAElB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,IAAA,6DAA6B,EAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,KAAU,CAAC;IACjC,CAAC;IAED,OAAO,IAAA,6BAAoB,EAAC,SAAS,UAAU,CAC7C,EAAO,EACP,OAAyB;;QAEzB,MAAM,OAAO,GAAqC,OAAO;aACtD,YAAY,EAAE;aACd,UAAU,EAAE,CAAC;QAChB,MAAM,GAAG,GAAY,OAAO,CAAC,MAAc,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,qZAA6B,GAAG,GAAG,CAAC;gBAClC,MAAM,KAAK,GAAuB;oBAChC,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,QAAQ;oBAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;oBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;iBACjB,CAAC;gBACF,MAAM,IAAI,4BAAmB,iBAC3B,OAAO,EAAE,mCAAmC,IAAI,IAAI,IACjD,CAAC,QAAQ,KAAK,IAAI;oBACnB,CAAC,CAAC;wBACE,MAAM,EAAE,CAAC,KAAK,CAAC;qBAChB;oBACH,CAAC,iCACM,KAAK,KACR,MAAM,EAAE,GAAG,CAAC,OAAO,GACpB,CAAC,EACN,CAAC;YACL,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACX,CAAC"}
@@ -1,5 +1,9 @@
1
1
  export interface INestiaTransformOptions {
2
- validate?: "assert" | "is" | "validate" | "assertEquals" | "equals" | "validateEquals" | "assertClone" | "validateClone" | "assertPrune" | "validatePrune";
3
- stringify?: "stringify" | "assert" | "is" | "validate" | "validate.log" | null;
2
+ validate?: INestiaTransformOptions.Validate;
3
+ stringify?: INestiaTransformOptions.Stringify | null;
4
4
  throws?: boolean;
5
5
  }
6
+ export declare namespace INestiaTransformOptions {
7
+ type Validate = "assert" | "is" | "validate" | "assertEquals" | "equals" | "validateEquals" | "assertClone" | "validateClone" | "assertPrune" | "validatePrune";
8
+ type Stringify = "stringify" | "assert" | "is" | "validate" | "validate.log";
9
+ }
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TypedParamProgrammer = void 0;
7
+ const typescript_1 = __importDefault(require("typescript"));
4
8
  const HttpParameterProgrammer_1 = require("typia/lib/programmers/http/HttpParameterProgrammer");
5
9
  var TypedParamProgrammer;
6
10
  (function (TypedParamProgrammer) {
7
11
  TypedParamProgrammer.generate = (props) => {
12
+ var _a, _b;
8
13
  // ALREADY BEING TRANSFORMED
9
14
  if (props.arguments.length !== 1)
10
15
  return props.arguments;
@@ -18,6 +23,9 @@ var TypedParamProgrammer;
18
23
  type: props.type,
19
24
  name: undefined,
20
25
  }),
26
+ ...(((_b = (_a = props.context.options) === null || _a === void 0 ? void 0 : _a.validate) === null || _b === void 0 ? void 0 : _b.startsWith("validate"))
27
+ ? [typescript_1.default.factory.createTrue()]
28
+ : []),
21
29
  ];
22
30
  };
23
31
  })(TypedParamProgrammer || (exports.TypedParamProgrammer = TypedParamProgrammer = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"TypedParamProgrammer.js","sourceRoot":"","sources":["../../src/programmers/TypedParamProgrammer.ts"],"names":[],"mappings":";;;AACA,gGAA6F;AAI7F,IAAiB,oBAAoB,CAwBpC;AAxBD,WAAiB,oBAAoB;IACtB,6BAAQ,GAAG,CAAC,KAKxB,EAA4B,EAAE;QAC7B,4BAA4B;QAC5B,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC,SAAS,CAAC;QACzD,OAAO;YACL,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAClB,iDAAuB,CAAC,KAAK,CAAC;gBAC5B,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,OAAO,EAAE;wBACP,OAAO,EAAE,IAAI;qBACd,GACF;gBACD,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,SAAS;aAChB,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EAxBgB,oBAAoB,oCAApB,oBAAoB,QAwBpC"}
1
+ {"version":3,"file":"TypedParamProgrammer.js","sourceRoot":"","sources":["../../src/programmers/TypedParamProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,gGAA6F;AAI7F,IAAiB,oBAAoB,CA2BpC;AA3BD,WAAiB,oBAAoB;IACtB,6BAAQ,GAAG,CAAC,KAKxB,EAA4B,EAAE;;QAC7B,4BAA4B;QAC5B,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC,SAAS,CAAC;QACzD,OAAO;YACL,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAClB,iDAAuB,CAAC,KAAK,CAAC;gBAC5B,OAAO,kCACF,KAAK,CAAC,OAAO,KAChB,OAAO,EAAE;wBACP,OAAO,EAAE,IAAI;qBACd,GACF;gBACD,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,SAAS;aAChB,CAAC;YACF,GAAG,CAAC,CAAA,MAAA,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,0CAAE,QAAQ,0CAAE,UAAU,CAAC,UAAU,CAAC;gBACzD,CAAC,CAAC,CAAC,oBAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC3B,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EA3BgB,oBAAoB,oCAApB,oBAAoB,QA2BpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "4.3.0",
3
+ "version": "4.4.0-dev.20241216-2",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "homepage": "https://nestia.io",
38
38
  "dependencies": {
39
- "@nestia/fetcher": "^4.3.0",
39
+ "@nestia/fetcher": "^4.4.0-dev.20241216-2",
40
40
  "@nestjs/common": ">=7.0.1",
41
41
  "@nestjs/core": ">=7.0.1",
42
- "@samchon/openapi": "^2.1.2",
42
+ "@samchon/openapi": "^2.2.0",
43
43
  "detect-ts-node": "^1.0.5",
44
44
  "get-function-location": "^2.0.0",
45
45
  "glob": "^7.2.0",
@@ -48,16 +48,16 @@
48
48
  "reflect-metadata": ">=0.1.12",
49
49
  "rxjs": ">=6.0.3",
50
50
  "tgrid": "^1.1.0",
51
- "typia": "^7.3.0",
51
+ "typia": "^7.4.0",
52
52
  "ws": "^7.5.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@nestia/fetcher": ">=4.3.0",
55
+ "@nestia/fetcher": ">=4.4.0-dev.20241216-2",
56
56
  "@nestjs/common": ">=7.0.1",
57
57
  "@nestjs/core": ">=7.0.1",
58
58
  "reflect-metadata": ">=0.1.12",
59
59
  "rxjs": ">=6.0.3",
60
- "typia": ">=7.2.0 <8.0.0"
60
+ "typia": ">=7.4.0 <8.0.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@nestjs/common": "^10.4.13",