@nestia/core 7.3.1 → 7.3.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 (109) hide show
  1. package/lib/decorators/DynamicModule.d.ts +3 -2
  2. package/lib/decorators/DynamicModule.js +3 -2
  3. package/lib/decorators/DynamicModule.js.map +1 -1
  4. package/lib/decorators/EncryptedBody.d.ts +11 -11
  5. package/lib/decorators/EncryptedBody.js +13 -17
  6. package/lib/decorators/EncryptedBody.js.map +1 -1
  7. package/lib/decorators/EncryptedController.d.ts +15 -13
  8. package/lib/decorators/EncryptedController.js +15 -13
  9. package/lib/decorators/EncryptedController.js.map +1 -1
  10. package/lib/decorators/EncryptedModule.d.ts +22 -22
  11. package/lib/decorators/EncryptedModule.js +23 -25
  12. package/lib/decorators/EncryptedModule.js.map +1 -1
  13. package/lib/decorators/EncryptedRoute.d.ts +20 -20
  14. package/lib/decorators/EncryptedRoute.js +23 -29
  15. package/lib/decorators/EncryptedRoute.js.map +1 -1
  16. package/lib/decorators/HumanRoute.d.ts +3 -3
  17. package/lib/decorators/HumanRoute.js +3 -3
  18. package/lib/decorators/NoTransformConfigurationError.d.ts +10 -8
  19. package/lib/decorators/NoTransformConfigurationError.js +10 -8
  20. package/lib/decorators/NoTransformConfigurationError.js.map +1 -1
  21. package/lib/decorators/PlainBody.d.ts +7 -6
  22. package/lib/decorators/PlainBody.js +2 -6
  23. package/lib/decorators/PlainBody.js.map +1 -1
  24. package/lib/decorators/SwaggerCustomizer.d.ts +12 -30
  25. package/lib/decorators/SwaggerCustomizer.js +3 -3
  26. package/lib/decorators/TypedBody.d.ts +7 -7
  27. package/lib/decorators/TypedBody.js +8 -10
  28. package/lib/decorators/TypedBody.js.map +1 -1
  29. package/lib/decorators/TypedException.d.ts +41 -58
  30. package/lib/decorators/TypedException.js +1 -3
  31. package/lib/decorators/TypedException.js.map +1 -1
  32. package/lib/decorators/TypedFormData.d.ts +16 -16
  33. package/lib/decorators/TypedFormData.js +17 -23
  34. package/lib/decorators/TypedFormData.js.map +1 -1
  35. package/lib/decorators/TypedHeaders.d.ts +27 -25
  36. package/lib/decorators/TypedHeaders.js +27 -25
  37. package/lib/decorators/TypedHeaders.js.map +1 -1
  38. package/lib/decorators/TypedParam.d.ts +5 -5
  39. package/lib/decorators/TypedParam.js +5 -5
  40. package/lib/decorators/TypedQuery.d.ts +7 -6
  41. package/lib/decorators/TypedQuery.js +13 -24
  42. package/lib/decorators/TypedQuery.js.map +1 -1
  43. package/lib/decorators/TypedRoute.d.ts +24 -34
  44. package/lib/decorators/TypedRoute.js +19 -28
  45. package/lib/decorators/TypedRoute.js.map +1 -1
  46. package/lib/decorators/WebSocketRoute.d.ts +33 -31
  47. package/lib/decorators/WebSocketRoute.js +34 -34
  48. package/lib/decorators/WebSocketRoute.js.map +1 -1
  49. package/lib/decorators/internal/EncryptedConstant.js +1 -3
  50. package/lib/decorators/internal/EncryptedConstant.js.map +1 -1
  51. package/lib/decorators/internal/get_path_and_querify.js +7 -21
  52. package/lib/decorators/internal/get_path_and_querify.js.map +1 -1
  53. package/lib/decorators/internal/get_path_and_stringify.js +6 -18
  54. package/lib/decorators/internal/get_path_and_stringify.js.map +1 -1
  55. package/lib/decorators/internal/get_text_body.js +2 -6
  56. package/lib/decorators/internal/get_text_body.js.map +1 -1
  57. package/lib/decorators/internal/headers_to_object.js +1 -3
  58. package/lib/decorators/internal/headers_to_object.js.map +1 -1
  59. package/lib/decorators/internal/is_request_body_undefined.js +1 -3
  60. package/lib/decorators/internal/is_request_body_undefined.js.map +1 -1
  61. package/lib/decorators/internal/load_controller.js +3 -7
  62. package/lib/decorators/internal/load_controller.js.map +1 -1
  63. package/lib/decorators/internal/route_error.js +1 -3
  64. package/lib/decorators/internal/route_error.js.map +1 -1
  65. package/lib/decorators/internal/validate_request_body.js +5 -15
  66. package/lib/decorators/internal/validate_request_body.js.map +1 -1
  67. package/lib/decorators/internal/validate_request_form_data.js +5 -15
  68. package/lib/decorators/internal/validate_request_form_data.js.map +1 -1
  69. package/lib/decorators/internal/validate_request_headers.js +5 -15
  70. package/lib/decorators/internal/validate_request_headers.js.map +1 -1
  71. package/lib/decorators/internal/validate_request_query.js +5 -15
  72. package/lib/decorators/internal/validate_request_query.js.map +1 -1
  73. package/lib/utils/ExceptionManager.d.ts +27 -20
  74. package/lib/utils/ExceptionManager.js +20 -20
  75. package/lib/utils/ExceptionManager.js.map +1 -1
  76. package/lib/utils/Singleton.js +2 -6
  77. package/lib/utils/Singleton.js.map +1 -1
  78. package/package.json +6 -6
  79. package/src/decorators/DynamicModule.ts +3 -2
  80. package/src/decorators/EncryptedBody.ts +13 -17
  81. package/src/decorators/EncryptedController.ts +15 -13
  82. package/src/decorators/EncryptedModule.ts +23 -25
  83. package/src/decorators/EncryptedRoute.ts +23 -29
  84. package/src/decorators/HumanRoute.ts +3 -3
  85. package/src/decorators/NoTransformConfigurationError.ts +10 -8
  86. package/src/decorators/PlainBody.ts +9 -12
  87. package/src/decorators/SwaggerCustomizer.ts +12 -30
  88. package/src/decorators/TypedBody.ts +8 -10
  89. package/src/decorators/TypedException.ts +42 -61
  90. package/src/decorators/TypedFormData.ts +34 -34
  91. package/src/decorators/TypedHeaders.ts +27 -25
  92. package/src/decorators/TypedParam.ts +5 -5
  93. package/src/decorators/TypedQuery.ts +13 -24
  94. package/src/decorators/TypedRoute.ts +28 -46
  95. package/src/decorators/WebSocketRoute.ts +34 -34
  96. package/src/decorators/internal/EncryptedConstant.ts +1 -3
  97. package/src/decorators/internal/get_path_and_querify.ts +7 -21
  98. package/src/decorators/internal/get_path_and_stringify.ts +6 -18
  99. package/src/decorators/internal/get_text_body.ts +2 -6
  100. package/src/decorators/internal/headers_to_object.ts +1 -3
  101. package/src/decorators/internal/is_request_body_undefined.ts +1 -3
  102. package/src/decorators/internal/load_controller.ts +3 -7
  103. package/src/decorators/internal/route_error.ts +1 -3
  104. package/src/decorators/internal/validate_request_body.ts +5 -15
  105. package/src/decorators/internal/validate_request_form_data.ts +5 -15
  106. package/src/decorators/internal/validate_request_headers.ts +5 -15
  107. package/src/decorators/internal/validate_request_query.ts +5 -15
  108. package/src/utils/ExceptionManager.ts +29 -26
  109. package/src/utils/Singleton.ts +2 -6
@@ -7,9 +7,7 @@ exports.validate_request_body = void 0;
7
7
  const common_1 = require("@nestjs/common");
8
8
  const typia_1 = __importDefault(require("typia"));
9
9
  const NoTransformConfigurationError_1 = require("../NoTransformConfigurationError");
10
- /**
11
- * @internal
12
- */
10
+ /** @internal */
13
11
  const validate_request_body = (method) => (validator) => {
14
12
  if (!validator) {
15
13
  (0, NoTransformConfigurationError_1.NoTransformConfigurationError)(method);
@@ -24,9 +22,7 @@ const validate_request_body = (method) => (validator) => {
24
22
  return () => new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
25
23
  };
26
24
  exports.validate_request_body = validate_request_body;
27
- /**
28
- * @internal
29
- */
25
+ /** @internal */
30
26
  const assert = (closure) => (input) => {
31
27
  try {
32
28
  closure(input);
@@ -45,16 +41,12 @@ const assert = (closure) => (input) => {
45
41
  throw exp;
46
42
  }
47
43
  };
48
- /**
49
- * @internal
50
- */
44
+ /** @internal */
51
45
  const is = (closure) => (input) => {
52
46
  const success = closure(input);
53
47
  return success ? null : new common_1.BadRequestException(MESSAGE);
54
48
  };
55
- /**
56
- * @internal
57
- */
49
+ /** @internal */
58
50
  const validate = (closure) => (input) => {
59
51
  const result = closure(input);
60
52
  return result.success
@@ -64,8 +56,6 @@ const validate = (closure) => (input) => {
64
56
  message: MESSAGE,
65
57
  });
66
58
  };
67
- /**
68
- * @internal
69
- */
59
+ /** @internal */
70
60
  const MESSAGE = "Request body data is not following the promised type.";
71
61
  //# sourceMappingURL=validate_request_body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate_request_body.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_body.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF;;GAEG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CACrC,CAAC,KAAQ,EAAE,EAAE;IACX,MAAM,OAAO,GAAY,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,4BAAmB,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,QAAQ,GACZ,CAAI,OAAoC,EAAE,EAAE,CAC5C,CAAC,KAAQ,EAAE,EAAE;IACX,MAAM,MAAM,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,OAAO,GAAG,uDAAuD,CAAC"}
1
+ {"version":3,"file":"validate_request_body.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_body.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF,gBAAgB;AACT,MAAM,qBAAqB,GAChC,CAAC,MAAc,EAAE,EAAE,CACnB,CAAI,SAAoC,EAAgC,EAAE;IACxE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAA,6DAA6B,EAAC,MAAM,CAAC,CAAC;QACtC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC;SAAM,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACnE,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACrD,IAAI,SAAS,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,QAAQ,CAAC,SAAS,CAAC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YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ,gBAAgB;AAChB,MAAM,OAAO,GAAG,uDAAuD,CAAC"}
@@ -7,9 +7,7 @@ exports.validate_request_form_data = void 0;
7
7
  const common_1 = require("@nestjs/common");
8
8
  const typia_1 = __importDefault(require("typia"));
9
9
  const NoTransformConfigurationError_1 = require("../NoTransformConfigurationError");
10
- /**
11
- * @internal
12
- */
10
+ /** @internal */
13
11
  const validate_request_form_data = (props) => {
14
12
  if (!props) {
15
13
  (0, NoTransformConfigurationError_1.NoTransformConfigurationError)("TypedFormData.Body");
@@ -24,9 +22,7 @@ const validate_request_form_data = (props) => {
24
22
  return () => new Error(`Error on nestia.core.TypedFormData.Body(): invalid typed validator.`);
25
23
  };
26
24
  exports.validate_request_form_data = validate_request_form_data;
27
- /**
28
- * @internal
29
- */
25
+ /** @internal */
30
26
  const assert = (closure) => (input) => {
31
27
  try {
32
28
  return closure(input);
@@ -44,16 +40,12 @@ const assert = (closure) => (input) => {
44
40
  throw exp;
45
41
  }
46
42
  };
47
- /**
48
- * @internal
49
- */
43
+ /** @internal */
50
44
  const is = (closure) => (input) => {
51
45
  const result = closure(input);
52
46
  return result !== null ? result : new common_1.BadRequestException(MESSAGE);
53
47
  };
54
- /**
55
- * @internal
56
- */
48
+ /** @internal */
57
49
  const validate = (closure) => (input) => {
58
50
  const result = closure(input);
59
51
  return result.success
@@ -63,8 +55,6 @@ const validate = (closure) => (input) => {
63
55
  message: MESSAGE,
64
56
  });
65
57
  };
66
- /**
67
- * @internal
68
- */
58
+ /** @internal */
69
59
  const MESSAGE = "Request multipart data is not following the promised type.";
70
60
  //# sourceMappingURL=validate_request_form_data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate_request_form_data.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_form_data.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF;;GAEG;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EG;AACH,MAAM,EAAE,GACN,CAAI,OAAsC,EAAE,EAAE,CAC9C,CAAC,KAAe,EAA2B,EAAE;IAC3C,MAAM,MAAM,GAAa,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,4BAAmB,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,QAAQ,GACZ,CAAI,OAA4C,EAAE,EAAE,CACpD,CAAC,KAAe,EAA2B,EAAE;IAC3C,MAAM,MAAM,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,OAAO,GAAG,4DAA4D,CAAC"}
1
+ {"version":3,"file":"validate_request_form_data.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_form_data.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF,gBAAgB;AACT,MAAM,0BAA0B,GAAG,CACxC,KAAgC,EACE,EAAE;IACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,IAAA,6DAA6B,EAAC,oBAAoB,CAAC,CAAC;QACpD,OAAO,CAAC,KAAe,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAM,CAAC;IACzD,CAAC;SAAM,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,QAAQ;QAC1C,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACnC,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI;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AC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ,gBAAgB;AAChB,MAAM,OAAO,GAAG,4DAA4D,CAAC"}
@@ -7,9 +7,7 @@ exports.validate_request_headers = void 0;
7
7
  const common_1 = require("@nestjs/common");
8
8
  const typia_1 = __importDefault(require("typia"));
9
9
  const NoTransformConfigurationError_1 = require("../NoTransformConfigurationError");
10
- /**
11
- * @internal
12
- */
10
+ /** @internal */
13
11
  const validate_request_headers = (validator) => {
14
12
  if (!validator) {
15
13
  (0, NoTransformConfigurationError_1.NoTransformConfigurationError)("TypedHeaders");
@@ -24,9 +22,7 @@ const validate_request_headers = (validator) => {
24
22
  return () => new Error(`Error on nestia.core.TypedHeaders(): invalid typed validator.`);
25
23
  };
26
24
  exports.validate_request_headers = validate_request_headers;
27
- /**
28
- * @internal
29
- */
25
+ /** @internal */
30
26
  const assert = (closure) => (input) => {
31
27
  try {
32
28
  return closure(input);
@@ -44,16 +40,12 @@ const assert = (closure) => (input) => {
44
40
  throw exp;
45
41
  }
46
42
  };
47
- /**
48
- * @internal
49
- */
43
+ /** @internal */
50
44
  const is = (closure) => (input) => {
51
45
  const result = closure(input);
52
46
  return result !== null ? result : new common_1.BadRequestException(MESSAGE);
53
47
  };
54
- /**
55
- * @internal
56
- */
48
+ /** @internal */
57
49
  const validate = (closure) => (input) => {
58
50
  const result = closure(input);
59
51
  return result.success
@@ -63,8 +55,6 @@ const validate = (closure) => (input) => {
63
55
  message: MESSAGE,
64
56
  });
65
57
  };
66
- /**
67
- * @internal
68
- */
58
+ /** @internal */
69
59
  const MESSAGE = "Request headers data is not following the promised type.";
70
60
  //# sourceMappingURL=validate_request_headers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate_request_headers.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_headers.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF;;GAEG;AACI,MAAM,wBAAwB,GAAG,CACtC,SAAuC,EACgC,EAAE;IACzE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAA,6DAA6B,EAAC,cAAc,CAAC,CAAC;QAC9C,OAAO,CAAC,KAAoD,EAAE,EAAE,CAC9D,MAAM,CAAC,OAAO,CAAC,KAAK,CAAM,CAAC;IAC/B,CAAC;SAAM,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACnE,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACrD,IAAI,SAAS,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5E,OAAO,GAAG,EAAE,CACV,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;AAC/E,CAAC,CAAC;AAZW,QAAA,wBAAwB,4BAYnC;AAEF;;GAEG;AACH,MAAM,MAAM,GACV,CAAI,OAAoE,EAAE,EAAE,CAC5E,CACE,KAAoD,EAC3B,EAAE;IAC3B,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,6YAA6B,GAAG,GAAG,CAAC;YAClC,OAAO,IAAI,4BAAmB,CAAC;gBAC7B,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,MAAM,EAAE,GAAG,CAAC,OAAO;gBACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,EAAE,GACN,CACE,OAA2E,EAC3E,EAAE,CACJ,CACE,KAAoD,EAC3B,EAAE;IAC3B,MAAM,MAAM,GAAa,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,4BAAmB,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,QAAQ,GACZ,CACE,OAEmB,EACnB,EAAE,CACJ,CACE,KAAoD,EAC3B,EAAE;IAC3B,MAAM,MAAM,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,OAAO,GAAG,0DAA0D,CAAC"}
1
+ {"version":3,"file":"validate_request_headers.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_headers.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF,gBAAgB;AACT,MAAM,wBAAwB,GAAG,CACtC,SAAuC,EACgC,EAAE;IACzE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAA,6DAA6B,EAAC,cAAc,CAAC,CAAC;QAC9C,OAAO,CAAC,KAAoD,EAAE,EAAE,CAC9D,MAAM,CAAC,OAAO,CAAC,KAAK,CAAM,CAAC;IAC/B,CAAC;SAAM,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,C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AmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ,gBAAgB;AAChB,MAAM,OAAO,GAAG,0DAA0D,CAAC"}
@@ -7,9 +7,7 @@ exports.validate_request_query = void 0;
7
7
  const common_1 = require("@nestjs/common");
8
8
  const typia_1 = __importDefault(require("typia"));
9
9
  const NoTransformConfigurationError_1 = require("../NoTransformConfigurationError");
10
- /**
11
- * @internal
12
- */
10
+ /** @internal */
13
11
  const validate_request_query = (method) => (validator) => {
14
12
  if (!validator) {
15
13
  (0, NoTransformConfigurationError_1.NoTransformConfigurationError)(method);
@@ -24,9 +22,7 @@ const validate_request_query = (method) => (validator) => {
24
22
  return () => new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
25
23
  };
26
24
  exports.validate_request_query = validate_request_query;
27
- /**
28
- * @internal
29
- */
25
+ /** @internal */
30
26
  const assert = (closure) => (input) => {
31
27
  try {
32
28
  return closure(input);
@@ -44,16 +40,12 @@ const assert = (closure) => (input) => {
44
40
  throw exp;
45
41
  }
46
42
  };
47
- /**
48
- * @internal
49
- */
43
+ /** @internal */
50
44
  const is = (closure) => (input) => {
51
45
  const result = closure(input);
52
46
  return result !== null ? result : new common_1.BadRequestException(MESSAGE);
53
47
  };
54
- /**
55
- * @internal
56
- */
48
+ /** @internal */
57
49
  const validate = (closure) => (input) => {
58
50
  const result = closure(input);
59
51
  return result.success
@@ -63,8 +55,6 @@ const validate = (closure) => (input) => {
63
55
  message: MESSAGE,
64
56
  });
65
57
  };
66
- /**
67
- * @internal
68
- */
58
+ /** @internal */
69
59
  const MESSAGE = "Request query data is not following the promised type.";
70
60
  //# sourceMappingURL=validate_request_query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate_request_query.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_query.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF;;GAEG;AACI,MAAM,sBAAsB,GACjC,CAAC,MAAc,EAAE,EAAE,CACnB,CAAI,SAAqC,EAAE,EAAE;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAA,6DAA6B,EAAC,MAAM,CAAC,CAAC;QACtC,OAAO,CAAC,KAAsB,EAAE,EAAE,CAChC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,CAAM,CAAC;IAC7C,CAAC;SAAM,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACnE,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACrD,IAAI,SAAS,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5E,OAAO,GAAG,EAAE,CACV,IAAI,KAAK,CAAC,wBAAwB,MAAM,8BAA8B,CAAC,CAAC;AAC5E,CAAC,CAAC;AAZS,QAAA,sBAAsB,0BAY/B;AAEJ;;GAEG;AACH,MAAM,MAAM,GACV,CAAI,OAAsC,EAAE,EAAE,CAC9C,CAAC,KAAsB,EAA2B,EAAE;IAClD,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,6YAA6B,GAAG,GAAG,CAAC;YAClC,OAAO,IAAI,4BAAmB,CAAC;gBAC7B,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,MAAM,EAAE,GAAG,CAAC,OAAO;gBACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,EAAE,GACN,CAAI,OAA6C,EAAE,EAAE,CACrD,CAAC,KAAsB,EAA2B,EAAE;IAClD,MAAM,MAAM,GAAa,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,4BAAmB,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,QAAQ,GACZ,CAAI,OAAmD,EAAE,EAAE,CAC3D,CAAC,KAAsB,EAA2B,EAAE;IAClD,MAAM,MAAM,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,OAAO,GAAG,wDAAwD,CAAC"}
1
+ {"version":3,"file":"validate_request_query.js","sourceRoot":"","sources":["../../../src/decorators/internal/validate_request_query.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAqD;AACrD,kDAA2D;AAG3D,oFAAiF;AAEjF,gBAAgB;AACT,MAAM,sBAAsB,GACjC,CAAC,MAAc,EAAE,EAAE,CACnB,CAAI,SAAqC,EAAE,EAAE;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,IAAA,6DAA6B,EAAC,MAAM,CAAC,CAAC;QACtC,OAAO,CAAC,KAAsB,EAAE,EAAE,CAChC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,CAAM,CA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,CAAC;AAEJ,gBAAgB;AAChB,MAAM,QAAQ,GACZ,CAAI,OAAmD,EAAE,EAAE,CAC3D,CAAC,KAAsB,EAA2B,EAAE;IAClD,MAAM,MAAM,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,IAAI,4BAAmB,CAAC;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAC;AACT,CAAC,CAAC;AAEJ,gBAAgB;AAChB,MAAM,OAAO,GAAG,wDAAwD,CAAC"}
@@ -3,24 +3,27 @@ import { Creator } from "../typings/Creator";
3
3
  /**
4
4
  * Exception manager for HTTP server.
5
5
  *
6
- * `ExceptionManager` is an utility class who can insert or erase custom error class with
7
- * its conversion method to a regular {@link nest.HttpException} instance.
6
+ * `ExceptionManager` is an utility class who can insert or erase custom error
7
+ * class with its conversion method to a regular {@link nest.HttpException}
8
+ * instance.
8
9
  *
9
- * If you define an API function through {@link TypedRoute} or {@link EncryptedRoute}
10
- * instead of the basic router decorator functions like {@link nest.Get} or
11
- * {@link nest.Post} and the API function throws a custom error whose class has been
12
- * {@link ExceptionManager.insert inserted} in this `EntityManager`, the error would be
13
- * automatically converted to the regular {@link nest.HttpException} instance by the
14
- * {@link ExceptionManager.Closure} function.
10
+ * If you define an API function through {@link TypedRoute} or
11
+ * {@link EncryptedRoute} instead of the basic router decorator functions like
12
+ * {@link nest.Get} or {@link nest.Post} and the API function throws a custom
13
+ * error whose class has been {@link ExceptionManager.insert inserted} in this
14
+ * `EntityManager`, the error would be automatically converted to the regular
15
+ * {@link nest.HttpException} instance by the {@link ExceptionManager.Closure}
16
+ * function.
15
17
  *
16
- * Therefore, with this `ExceptionManager` and {@link TypedRoute} or {@link EncryptedRoute},
17
- * you can manage your custom error classes much systemtically. You can avoid 500 internal
18
- * server error or hard coding implementation about the custom error classes.
18
+ * Therefore, with this `ExceptionManager` and {@link TypedRoute} or
19
+ * {@link EncryptedRoute}, you can manage your custom error classes much
20
+ * systemtically. You can avoid 500 internal server error or hard coding
21
+ * implementation about the custom error classes.
19
22
  *
20
23
  * Below error classes are defaultly configured in this `ExceptionManager`
21
24
  *
22
- * - `typia.TypeGuardError`
23
- * - `@nestia/fetcher.HttpError`
25
+ * - `typia.TypeGuardError`
26
+ * - `@nestia/fetcher.HttpError`
24
27
  *
25
28
  * @author Jeongho Nam - https://github.com/samchon
26
29
  */
@@ -28,7 +31,8 @@ export declare namespace ExceptionManager {
28
31
  /**
29
32
  * Insert an error class with converter.
30
33
  *
31
- * If you've inserted an duplicated error class, the closure would be overwritten.
34
+ * If you've inserted an duplicated error class, the closure would be
35
+ * overwritten.
32
36
  *
33
37
  * @param creator Target error class
34
38
  * @param closure A closure function converting to the `HttpException` class
@@ -44,20 +48,23 @@ export declare namespace ExceptionManager {
44
48
  function on(closure: (error: any) => any): void;
45
49
  function off(closure: (error: any) => any): void;
46
50
  /**
47
- * Type of a closure function converting to the regular {@link nest.HttpException}.
51
+ * Type of a closure function converting to the regular
52
+ * {@link nest.HttpException}.
48
53
  *
49
- * `ExceptionManager.Closure` is a type of closure function who are converting from
50
- * custom error to the regular {@link nest.HttpException} instance. It would be used
51
- * in the {@link ExceptionManager} with {@link TypedRoute} or {@link EncryptedRoute}.
54
+ * `ExceptionManager.Closure` is a type of closure function who are converting
55
+ * from custom error to the regular {@link nest.HttpException} instance. It
56
+ * would be used in the {@link ExceptionManager} with {@link TypedRoute} or
57
+ * {@link EncryptedRoute}.
52
58
  */
53
59
  interface Closure<T extends Error> {
54
60
  /**
55
61
  * Error converter.
56
62
  *
57
- * Convert from custom error to the regular {@link nest.HttpException} instance.
63
+ * Convert from custom error to the regular {@link nest.HttpException}
64
+ * instance.
58
65
  *
59
66
  * @param exception Custom error instance
60
- * @return Regular {@link nest.HttpException} instance
67
+ * @returns Regular {@link nest.HttpException} instance
61
68
  */
62
69
  (exception: T): HttpException;
63
70
  }
@@ -6,24 +6,27 @@ const common_1 = require("@nestjs/common");
6
6
  /**
7
7
  * Exception manager for HTTP server.
8
8
  *
9
- * `ExceptionManager` is an utility class who can insert or erase custom error class with
10
- * its conversion method to a regular {@link nest.HttpException} instance.
9
+ * `ExceptionManager` is an utility class who can insert or erase custom error
10
+ * class with its conversion method to a regular {@link nest.HttpException}
11
+ * instance.
11
12
  *
12
- * If you define an API function through {@link TypedRoute} or {@link EncryptedRoute}
13
- * instead of the basic router decorator functions like {@link nest.Get} or
14
- * {@link nest.Post} and the API function throws a custom error whose class has been
15
- * {@link ExceptionManager.insert inserted} in this `EntityManager`, the error would be
16
- * automatically converted to the regular {@link nest.HttpException} instance by the
17
- * {@link ExceptionManager.Closure} function.
13
+ * If you define an API function through {@link TypedRoute} or
14
+ * {@link EncryptedRoute} instead of the basic router decorator functions like
15
+ * {@link nest.Get} or {@link nest.Post} and the API function throws a custom
16
+ * error whose class has been {@link ExceptionManager.insert inserted} in this
17
+ * `EntityManager`, the error would be automatically converted to the regular
18
+ * {@link nest.HttpException} instance by the {@link ExceptionManager.Closure}
19
+ * function.
18
20
  *
19
- * Therefore, with this `ExceptionManager` and {@link TypedRoute} or {@link EncryptedRoute},
20
- * you can manage your custom error classes much systemtically. You can avoid 500 internal
21
- * server error or hard coding implementation about the custom error classes.
21
+ * Therefore, with this `ExceptionManager` and {@link TypedRoute} or
22
+ * {@link EncryptedRoute}, you can manage your custom error classes much
23
+ * systemtically. You can avoid 500 internal server error or hard coding
24
+ * implementation about the custom error classes.
22
25
  *
23
26
  * Below error classes are defaultly configured in this `ExceptionManager`
24
27
  *
25
- * - `typia.TypeGuardError`
26
- * - `@nestia/fetcher.HttpError`
28
+ * - `typia.TypeGuardError`
29
+ * - `@nestia/fetcher.HttpError`
27
30
  *
28
31
  * @author Jeongho Nam - https://github.com/samchon
29
32
  */
@@ -32,7 +35,8 @@ var ExceptionManager;
32
35
  /**
33
36
  * Insert an error class with converter.
34
37
  *
35
- * If you've inserted an duplicated error class, the closure would be overwritten.
38
+ * If you've inserted an duplicated error class, the closure would be
39
+ * overwritten.
36
40
  *
37
41
  * @param creator Target error class
38
42
  * @param closure A closure function converting to the `HttpException` class
@@ -67,13 +71,9 @@ var ExceptionManager;
67
71
  ExceptionManager.listeners.delete(closure);
68
72
  }
69
73
  ExceptionManager.off = off;
70
- /**
71
- * @internal
72
- */
74
+ /** @internal */
73
75
  ExceptionManager.tuples = [];
74
- /**
75
- * @internal
76
- */
76
+ /** @internal */
77
77
  ExceptionManager.listeners = new Set();
78
78
  })(ExceptionManager || (exports.ExceptionManager = ExceptionManager = {}));
79
79
  ExceptionManager.insert(fetcher_1.HttpError, (error) => new common_1.HttpException({
@@ -1 +1 @@
1
- {"version":3,"file":"ExceptionManager.js","sourceRoot":"","sources":["../../src/utils/ExceptionManager.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA+C;AAI/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,IAAiB,gBAAgB,CAsEhC;AAtED,WAAiB,gBAAgB;IAC/B;;;;;;;OAOG;IACH,SAAgB,MAAM,CACpB,OAAmB,EACnB,OAAmB;QAEnB,MAAM,KAAK,GAAW,iBAAA,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;QACxE,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,iBAAA,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAE1C,iBAAA,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAChC,iBAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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AAM,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAFe,oBAAG,MAElB,CAAA;IAwBD,gBAAgB;IACH,uBAAM,GAAwC,EAAE,CAAC;IAE9D,gBAAgB;IACH,0BAAS,GAA6B,IAAI,GAAG,EAAE,CAAC;AAC/D,CAAC,EAtEgB,gBAAgB,gCAAhB,gBAAgB,QAsEhC;AAED,gBAAgB,CAAC,MAAM,CACrB,mBAAS,EACT,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,sBAAa,CACf;IACE,IAAI,EAAE,KAAK,CAAC,IAAI;IAChB,OAAO,EAAE,KAAK,CAAC,OAAO;CACvB,EACD,KAAK,CAAC,MAAM,CACb,CACJ,CAAC"}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Singleton = void 0;
4
- /**
5
- * @internal
6
- */
4
+ /** @internal */
7
5
  class Singleton {
8
6
  constructor(closure_) {
9
7
  this.closure_ = closure_;
@@ -16,8 +14,6 @@ class Singleton {
16
14
  }
17
15
  }
18
16
  exports.Singleton = Singleton;
19
- /**
20
- * @internal
21
- */
17
+ /** @internal */
22
18
  const NOT_MOUNTED_YET = {};
23
19
  //# sourceMappingURL=Singleton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Singleton.js","sourceRoot":"","sources":["../../src/utils/Singleton.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,SAAS;IAGpB,YAAoC,QAAiB;QAAjB,aAAQ,GAAR,QAAQ,CAAS;QACnD,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC;IAChC,CAAC;IAEM,GAAG;QACR,IAAI,IAAI,CAAC,MAAM,KAAK,eAAe;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,MAAW,CAAC;IAC1B,CAAC;CACF;AAXD,8BAWC;AAED;;GAEG;AACH,MAAM,eAAe,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"Singleton.js","sourceRoot":"","sources":["../../src/utils/Singleton.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,MAAa,SAAS;IAGpB,YAAoC,QAAiB;QAAjB,aAAQ,GAAR,QAAQ,CAAS;QACnD,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC;IAChC,CAAC;IAEM,GAAG;QACR,IAAI,IAAI,CAAC,MAAM,KAAK,eAAe;YAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,MAAW,CAAC;IAC1B,CAAC;CACF;AAXD,8BAWC;AAED,gBAAgB;AAChB,MAAM,eAAe,GAAG,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "7.3.1",
3
+ "version": "7.3.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": "^7.3.1",
39
+ "@nestia/fetcher": "^7.3.2",
40
40
  "@nestjs/common": ">=7.0.1",
41
41
  "@nestjs/core": ">=7.0.1",
42
42
  "@samchon/openapi": "^4.5.0",
@@ -48,17 +48,17 @@
48
48
  "reflect-metadata": ">=0.1.12",
49
49
  "rxjs": ">=6.0.3",
50
50
  "tgrid": "^1.1.0",
51
- "typia": "^9.5.0",
51
+ "typia": "^9.6.1",
52
52
  "ws": "^7.5.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@nestia/fetcher": ">=7.3.1",
55
+ "@nestia/fetcher": ">=7.3.2",
56
56
  "@nestjs/common": ">=7.0.1",
57
57
  "@nestjs/core": ">=7.0.1",
58
58
  "@samchon/openapi": ">=4.5.0 <5.0.0",
59
59
  "reflect-metadata": ">=0.1.12",
60
60
  "rxjs": ">=6.0.3",
61
- "typia": ">=9.5.0 <10.0.0"
61
+ "typia": "^9.6.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@nestjs/common": "^11.0.13",
@@ -80,7 +80,7 @@
80
80
  "ts-node": "^10.9.1",
81
81
  "ts-patch": "^3.3.0",
82
82
  "tstl": "^3.0.0",
83
- "typescript": "~5.8.3"
83
+ "typescript": "~5.9.2"
84
84
  },
85
85
  "files": [
86
86
  "README.md",
@@ -18,11 +18,12 @@ export namespace DynamicModule {
18
18
  *
19
19
  * Constructs a module instance with directory path of controller classes.
20
20
  *
21
- * Every controller classes in the target directory would be dynamically mounted.
21
+ * Every controller classes in the target directory would be dynamically
22
+ * mounted.
22
23
  *
23
24
  * @param path Path of controllers
24
25
  * @param metadata Additional metadata except controllers
25
- * @returns module instance
26
+ * @returns Module instance
26
27
  */
27
28
  export async function mount(
28
29
  path: string | string[] | { include: string[]; exclude?: string[] },
@@ -18,23 +18,23 @@ import { validate_request_body } from "./internal/validate_request_body";
18
18
  /**
19
19
  * Encrypted body decorator.
20
20
  *
21
- * `EncryptedBody` is a decorator function getting `application/json` typed data from
22
- * request body which has been encrypted by AES-128/256 algorithm. Also,
21
+ * `EncryptedBody` is a decorator function getting `application/json` typed data
22
+ * from request body which has been encrypted by AES-128/256 algorithm. Also,
23
23
  * `EncryptedBody` validates the request body data type through
24
- * [typia](https://github.com/samchon/typia) ad the validation speed is
25
- * maximum 15,000x times faster than `class-validator`.
24
+ * [typia](https://github.com/samchon/typia) ad the validation speed is maximum
25
+ * 15,000x times faster than `class-validator`.
26
26
  *
27
- * For reference, when the request body data is not following the promised type `T`,
28
- * `BadRequestException` error (status code: 400) would be thrown. Also,
27
+ * For reference, when the request body data is not following the promised type
28
+ * `T`, `BadRequestException` error (status code: 400) would be thrown. Also,
29
29
  * `EncryptedRoute` decrypts request body using those options.
30
30
  *
31
- * - AES-128/256
32
- * - CBC mode
33
- * - PKCS #5 Padding
34
- * - Base64 Encoding
31
+ * - AES-128/256
32
+ * - CBC mode
33
+ * - PKCS #5 Padding
34
+ * - Base64 Encoding
35
35
  *
36
- * @return Parameter decorator
37
36
  * @author Jeongho Nam - https://github.com/samchon
37
+ * @returns Parameter decorator
38
38
  */
39
39
  export function EncryptedBody<T>(
40
40
  validator?: IRequestBodyValidator<T>,
@@ -75,9 +75,7 @@ export function EncryptedBody<T>(
75
75
  })();
76
76
  }
77
77
 
78
- /**
79
- * @internal
80
- */
78
+ /** @internal */
81
79
  const decrypt = (body: string, key: string, iv: string): string => {
82
80
  try {
83
81
  return AesPkcs5.decrypt(body, key, iv);
@@ -90,9 +88,7 @@ const decrypt = (body: string, key: string, iv: string): string => {
90
88
  }
91
89
  };
92
90
 
93
- /**
94
- * @internal
95
- */
91
+ /** @internal */
96
92
  const isTextPlain = (text?: string): boolean =>
97
93
  text !== undefined &&
98
94
  text
@@ -6,26 +6,28 @@ import { ENCRYPTION_METADATA_KEY } from "./internal/EncryptedConstant";
6
6
  /**
7
7
  * Encrypted controller.
8
8
  *
9
- * `EncryptedController` is an extension of the {@link nest.Controller} class decorator
10
- * function who configures encryption password of the AES-128/256 algorithm. The
11
- * encryption algorithm and password would be used by {@link EncryptedRoute} and
12
- * {@link EncryptedBody} to encrypt the request and response body of the HTTP protocol.
9
+ * `EncryptedController` is an extension of the {@link nest.Controller} class
10
+ * decorator function who configures encryption password of the AES-128/256
11
+ * algorithm. The encryption algorithm and password would be used by
12
+ * {@link EncryptedRoute} and {@link EncryptedBody} to encrypt the request and
13
+ * response body of the HTTP protocol.
13
14
  *
14
- * By the way, you can configure the encryption password in the global level by using
15
- * {@link EncryptedModule} instead of the {@link nest.Module} in the module level. In
16
- * that case, you don't need to use this `EncryptedController` more. Just use the
17
- * {@link nest.Controller} without duplicated encryption password definitions.
15
+ * By the way, you can configure the encryption password in the global level by
16
+ * using {@link EncryptedModule} instead of the {@link nest.Module} in the module
17
+ * level. In that case, you don't need to use this `EncryptedController` more.
18
+ * Just use the {@link nest.Controller} without duplicated encryption password
19
+ * definitions.
18
20
  *
19
21
  * Of course, if you want to use different encryption password from the
20
- * {@link EncryptedModule}, this `EncryptedController` would be useful again. Therefore,
21
- * I recommend to use this `EncryptedController` decorator function only when you must
22
- * configure different encryption password from the {@link EncryptedModule}.
22
+ * {@link EncryptedModule}, this `EncryptedController` would be useful again.
23
+ * Therefore, I recommend to use this `EncryptedController` decorator function
24
+ * only when you must configure different encryption password from the
25
+ * {@link EncryptedModule}.
23
26
  *
27
+ * @author Jeongho Nam - https://github.com/samchon
24
28
  * @param path Path of the HTTP request
25
29
  * @param password Encryption password or its getter function
26
30
  * @returns Class decorator
27
- *
28
- * @author Jeongho Nam - https://github.com/samchon
29
31
  */
30
32
  export function EncryptedController(
31
33
  path: string,