@nestia/core 14.0.1 → 14.0.3

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 (156) hide show
  1. package/lib/adaptors/McpAdaptor.d.ts +24 -3
  2. package/lib/adaptors/McpAdaptor.js +72 -34
  3. package/lib/adaptors/McpAdaptor.js.map +1 -1
  4. package/lib/adaptors/WebSocketAdaptor.d.ts +37 -0
  5. package/lib/adaptors/WebSocketAdaptor.js +60 -16
  6. package/lib/adaptors/WebSocketAdaptor.js.map +1 -1
  7. package/lib/adaptors/internal/external_context.js +18 -5
  8. package/lib/adaptors/internal/external_context.js.map +1 -1
  9. package/lib/decorators/DynamicModule.d.ts +13 -1
  10. package/lib/decorators/DynamicModule.js +12 -0
  11. package/lib/decorators/DynamicModule.js.map +1 -1
  12. package/lib/decorators/EncryptedBody.d.ts +14 -6
  13. package/lib/decorators/EncryptedBody.js +37 -14
  14. package/lib/decorators/EncryptedBody.js.map +1 -1
  15. package/lib/decorators/EncryptedController.d.ts +6 -1
  16. package/lib/decorators/EncryptedController.js +6 -1
  17. package/lib/decorators/EncryptedController.js.map +1 -1
  18. package/lib/decorators/EncryptedModule.d.ts +18 -3
  19. package/lib/decorators/EncryptedModule.js +18 -3
  20. package/lib/decorators/EncryptedModule.js.map +1 -1
  21. package/lib/decorators/EncryptedRoute.d.ts +20 -11
  22. package/lib/decorators/EncryptedRoute.js +20 -11
  23. package/lib/decorators/EncryptedRoute.js.map +1 -1
  24. package/lib/decorators/HumanRoute.d.ts +5 -0
  25. package/lib/decorators/HumanRoute.js +5 -0
  26. package/lib/decorators/HumanRoute.js.map +1 -1
  27. package/lib/decorators/McpRoute.d.ts +31 -19
  28. package/lib/decorators/McpRoute.js +12 -1
  29. package/lib/decorators/McpRoute.js.map +1 -1
  30. package/lib/decorators/PlainBody.d.ts +7 -1
  31. package/lib/decorators/PlainBody.js +16 -8
  32. package/lib/decorators/PlainBody.js.map +1 -1
  33. package/lib/decorators/SwaggerCustomizer.d.ts +15 -0
  34. package/lib/decorators/SwaggerCustomizer.js +5 -0
  35. package/lib/decorators/SwaggerCustomizer.js.map +1 -1
  36. package/lib/decorators/SwaggerExample.d.ts +51 -22
  37. package/lib/decorators/SwaggerExample.js +35 -22
  38. package/lib/decorators/SwaggerExample.js.map +1 -1
  39. package/lib/decorators/TypedBody.d.ts +9 -2
  40. package/lib/decorators/TypedBody.js +19 -9
  41. package/lib/decorators/TypedBody.js.map +1 -1
  42. package/lib/decorators/TypedException.d.ts +10 -0
  43. package/lib/decorators/TypedFormData.d.ts +59 -1
  44. package/lib/decorators/TypedFormData.js +5 -0
  45. package/lib/decorators/TypedFormData.js.map +1 -1
  46. package/lib/decorators/TypedHeaders.d.ts +5 -0
  47. package/lib/decorators/TypedHeaders.js +5 -0
  48. package/lib/decorators/TypedHeaders.js.map +1 -1
  49. package/lib/decorators/TypedParam.d.ts +9 -0
  50. package/lib/decorators/TypedParam.js +9 -0
  51. package/lib/decorators/TypedParam.js.map +1 -1
  52. package/lib/decorators/TypedQuery.d.ts +16 -0
  53. package/lib/decorators/TypedQuery.js +16 -0
  54. package/lib/decorators/TypedQuery.js.map +1 -1
  55. package/lib/decorators/TypedRoute.d.ts +25 -10
  56. package/lib/decorators/TypedRoute.js +19 -10
  57. package/lib/decorators/TypedRoute.js.map +1 -1
  58. package/lib/decorators/WebSocketRoute.d.ts +18 -1
  59. package/lib/decorators/WebSocketRoute.js +18 -1
  60. package/lib/decorators/WebSocketRoute.js.map +1 -1
  61. package/lib/decorators/doNotThrowTransformError.d.ts +14 -0
  62. package/lib/decorators/doNotThrowTransformError.js +14 -0
  63. package/lib/decorators/doNotThrowTransformError.js.map +1 -1
  64. package/lib/decorators/internal/IRequestBodyValidation.d.ts +66 -0
  65. package/lib/decorators/internal/IRequestBodyValidation.js +3 -0
  66. package/lib/decorators/internal/IRequestBodyValidation.js.map +1 -0
  67. package/lib/decorators/internal/IWebSocketRouteReflect.d.ts +93 -1
  68. package/lib/decorators/internal/get_path_and_querify.js +3 -7
  69. package/lib/decorators/internal/get_path_and_querify.js.map +1 -1
  70. package/lib/decorators/internal/get_path_and_stringify.js +3 -7
  71. package/lib/decorators/internal/get_path_and_stringify.js.map +1 -1
  72. package/lib/decorators/internal/load_controller.d.ts +14 -0
  73. package/lib/decorators/internal/load_controller.js +14 -0
  74. package/lib/decorators/internal/load_controller.js.map +1 -1
  75. package/lib/decorators/internal/split_route_arguments.d.ts +1 -0
  76. package/lib/decorators/internal/split_route_arguments.js +22 -0
  77. package/lib/decorators/internal/split_route_arguments.js.map +1 -0
  78. package/lib/decorators/internal/validate_request_body.js +68 -25
  79. package/lib/decorators/internal/validate_request_body.js.map +1 -1
  80. package/lib/options/IRequestBodyValidator.d.ts +71 -0
  81. package/lib/options/IRequestFormDataProps.d.ts +80 -0
  82. package/lib/options/IRequestHeadersValidator.d.ts +67 -0
  83. package/lib/options/IRequestQueryValidator.d.ts +68 -0
  84. package/lib/options/IResponseBodyQuerifier.d.ts +120 -0
  85. package/lib/options/IResponseBodyStringifier.d.ts +107 -0
  86. package/lib/typings/Creator.d.ts +10 -0
  87. package/lib/utils/ArrayUtil.d.ts +21 -0
  88. package/lib/utils/ArrayUtil.js +22 -1
  89. package/lib/utils/ArrayUtil.js.map +1 -1
  90. package/lib/utils/ExceptionManager.d.ts +40 -0
  91. package/lib/utils/ExceptionManager.js +34 -0
  92. package/lib/utils/ExceptionManager.js.map +1 -1
  93. package/lib/utils/SourceFinder.d.ts +22 -0
  94. package/lib/utils/SourceFinder.js +34 -7
  95. package/lib/utils/SourceFinder.js.map +1 -1
  96. package/lib/utils/VersioningStrategy.d.ts +37 -2
  97. package/lib/utils/VersioningStrategy.js +30 -9
  98. package/lib/utils/VersioningStrategy.js.map +1 -1
  99. package/native/go.mod +1 -1
  100. package/native/go.sum +2 -2
  101. package/native/plugin/plan.go +68 -2
  102. package/native/transform/ast.go +19 -1
  103. package/native/transform/build.go +51 -57
  104. package/native/transform/buildoutput/output.go +147 -0
  105. package/native/transform/contributor.go +9 -0
  106. package/native/transform/core_querify.go +37 -3
  107. package/native/transform/core_transform.go +105 -98
  108. package/native/transform/core_websocket.go +21 -5
  109. package/native/transform/node_transform.go +11 -8
  110. package/native/transform/package.go +55 -0
  111. package/native/transform/printer.go +1 -3
  112. package/native/transform/run.go +18 -0
  113. package/native/transform/schemaprojection/project.go +213 -0
  114. package/native/transform/transform.go +21 -0
  115. package/package.json +9 -7
  116. package/src/adaptors/McpAdaptor.ts +86 -26
  117. package/src/adaptors/WebSocketAdaptor.ts +70 -15
  118. package/src/adaptors/internal/external_context.ts +43 -6
  119. package/src/decorators/DynamicModule.ts +13 -1
  120. package/src/decorators/EncryptedBody.ts +37 -13
  121. package/src/decorators/EncryptedController.ts +6 -1
  122. package/src/decorators/EncryptedModule.ts +18 -3
  123. package/src/decorators/EncryptedRoute.ts +21 -12
  124. package/src/decorators/HumanRoute.ts +5 -0
  125. package/src/decorators/McpRoute.ts +31 -19
  126. package/src/decorators/PlainBody.ts +20 -10
  127. package/src/decorators/SwaggerCustomizer.ts +15 -0
  128. package/src/decorators/SwaggerExample.ts +51 -22
  129. package/src/decorators/TypedBody.ts +17 -8
  130. package/src/decorators/TypedException.ts +10 -0
  131. package/src/decorators/TypedFormData.ts +60 -2
  132. package/src/decorators/TypedHeaders.ts +5 -0
  133. package/src/decorators/TypedParam.ts +9 -0
  134. package/src/decorators/TypedQuery.ts +17 -1
  135. package/src/decorators/TypedRoute.ts +26 -11
  136. package/src/decorators/WebSocketRoute.ts +18 -1
  137. package/src/decorators/doNotThrowTransformError.ts +14 -0
  138. package/src/decorators/internal/IMcpRouteReflect.ts +7 -1
  139. package/src/decorators/internal/IRequestBodyValidation.ts +65 -0
  140. package/src/decorators/internal/IWebSocketRouteReflect.ts +95 -1
  141. package/src/decorators/internal/get_path_and_querify.ts +3 -9
  142. package/src/decorators/internal/get_path_and_stringify.ts +3 -9
  143. package/src/decorators/internal/load_controller.ts +14 -0
  144. package/src/decorators/internal/split_route_arguments.ts +20 -0
  145. package/src/decorators/internal/validate_request_body.ts +87 -34
  146. package/src/options/IRequestBodyValidator.ts +71 -0
  147. package/src/options/IRequestFormDataProps.ts +80 -0
  148. package/src/options/IRequestHeadersValidator.ts +67 -0
  149. package/src/options/IRequestQueryValidator.ts +68 -0
  150. package/src/options/IResponseBodyQuerifier.ts +120 -0
  151. package/src/options/IResponseBodyStringifier.ts +107 -0
  152. package/src/typings/Creator.ts +10 -0
  153. package/src/utils/ArrayUtil.ts +22 -3
  154. package/src/utils/ExceptionManager.ts +40 -0
  155. package/src/utils/SourceFinder.ts +38 -7
  156. package/src/utils/VersioningStrategy.ts +47 -14
@@ -4,17 +4,88 @@ export type IRequestBodyValidator<T> =
4
4
  | IRequestBodyValidator.IAssert<T>
5
5
  | IRequestBodyValidator.IIs<T>
6
6
  | IRequestBodyValidator.IValidate<T>;
7
+ /**
8
+ * The request body validator that the transform passes to `TypedBody`,
9
+ * `EncryptedBody`, `PlainBody`, `WebSocketRoute.Header`, and
10
+ * `McpRoute.Params`.
11
+ *
12
+ * The literal `type` field selects which typia function generated the
13
+ * validator: `assert`, `is`, or `validate`. `validate_request_body` turns a
14
+ * failure of any variant into a 400 response. Assert and validate success
15
+ * supply their returned data to the decorated argument; is success keeps the
16
+ * input.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation The union is discriminated by the literal `type`, so the runtime selects the assert, is, or validate path with one comparison and the compiler checks that each variant carries the function its tag names.
19
+ * @evidence contracts/common.md#clear-and-simple-design Three variants, one per typia function family, with no shared base because each function has a different shape.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior; the runtime rejects an unknown `type` with an error instead of accepting it.
21
+ * @evidence contracts/common.md#meaningful-documentation The comment names the decorators that receive the validator, the meaning of the discriminant, and the response a failure becomes.
22
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
23
+ */
7
24
  export namespace IRequestBodyValidator {
25
+ /**
26
+ * Validator generated from `typia.assert`.
27
+ *
28
+ * @evidence contracts/common.md#principled-implementation The variant tags a function returning validated data, which may be a clone, or throwing TypeGuardError. The shared runner retains successful data and converts the guard error to BadRequestException carrying the first failure's path, reason, expected type and value.
29
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
30
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
31
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from; the failure response is stated on the union.
32
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
33
+ */
8
34
  export interface IAssert<T> {
9
35
  type: "assert";
36
+ /**
37
+ * The typia assertion function generated for the requested type.
38
+ *
39
+ * @evidence contracts/common.md#principled-implementation The generated assertion returns the validated value, including a separate clone for clone modes, or throws TypeGuardError. Successful data becomes the decorated argument without requiring identity with the parsed input.
40
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
41
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
42
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its input is in the signature.
43
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
44
+ */
10
45
  assert: (input: T) => T;
11
46
  }
47
+ /**
48
+ * Validator generated from `typia.is`.
49
+ *
50
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the parsed value that returns a boolean, because the value is already parsed and is returned as it is; a failing result becomes a `BadRequestException` with only the fixed message, because `typia.is` records no failure detail.
51
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
52
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
53
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
54
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
55
+ */
12
56
  export interface IIs<T> {
13
57
  type: "is";
58
+ /**
59
+ * The typia check function generated for the requested type.
60
+ *
61
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the parsed value and returning a boolean, because the value is already parsed and is returned as it is.
62
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
63
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
64
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
65
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
66
+ */
14
67
  is: (input: T) => boolean;
15
68
  }
69
+ /**
70
+ * Validator generated from `typia.validate`.
71
+ *
72
+ * @evidence contracts/common.md#principled-implementation The callback returns IValidation; successful result.data becomes the decorated argument, including a clone, while failure becomes BadRequestException carrying every validation error.
73
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
74
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
75
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
76
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
77
+ */
16
78
  export interface IValidate<T> {
17
79
  type: "validate";
80
+ /**
81
+ * The typia validation function generated for the requested type.
82
+ *
83
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the parsed value and returning the validation result with every error.
84
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
85
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
86
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
87
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The union and callback members describe validation of parsed body values without native platform resources.
88
+ */
18
89
  validate: (input: T) => IValidation<T>;
19
90
  }
20
91
  }
@@ -7,19 +7,99 @@ export interface IRequestFormDataProps<T> {
7
7
  | IRequestFormDataProps.IIs<T>
8
8
  | IRequestFormDataProps.IValidate<T>;
9
9
  }
10
+ /**
11
+ * Properties that the transform passes to `TypedFormData.Body`: the file fields
12
+ * and the validator.
13
+ *
14
+ * `files` names the file fields of the type with their limits, and `validator`
15
+ * validates the `FormData` made from the fields and the uploaded files.
16
+ *
17
+ * @evidence contracts/common.md#principled-implementation The record carries what the multipart handling needs: which fields are files, with how many each may hold, and how to validate the assembled form.
18
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record whose nested types describe the variants and the file entries.
19
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
20
+ * @evidence contracts/common.md#meaningful-documentation The comment names the two members and the decorator that receives them.
21
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
22
+ */
10
23
  export namespace IRequestFormDataProps {
24
+ /**
25
+ * Validator generated from `typia.assert`.
26
+ *
27
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of `FormData` that returns the decoded object or throws the `TypeGuardError` of typia, which becomes a `BadRequestException` with the path, reason, expected type, and value.
28
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
29
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
30
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
31
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
32
+ */
11
33
  export interface IAssert<T> {
12
34
  type: "assert";
35
+ /**
36
+ * The typia assertion function generated for the requested type.
37
+ *
38
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument, taking the form and returning the decoded object or throwing.
39
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
40
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
41
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type.
42
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
43
+ */
13
44
  assert: (input: FormData) => T;
14
45
  }
46
+ /**
47
+ * Validator generated from `typia.is`.
48
+ *
49
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of `FormData` that returns the decoded object or `null`; `null` becomes a `BadRequestException` with only the fixed message.
50
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
51
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
52
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
53
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
54
+ */
15
55
  export interface IIs<T> {
16
56
  type: "is";
57
+ /**
58
+ * The typia check function generated for the requested type.
59
+ *
60
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument, taking the form and returning the decoded object or `null`.
61
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
62
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
63
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type.
64
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
65
+ */
17
66
  is: (input: FormData) => T | null;
18
67
  }
68
+ /**
69
+ * Validator generated from `typia.validate`.
70
+ *
71
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of `FormData` that returns the `IValidation` of typia; a failure becomes a `BadRequestException` carrying every error.
72
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
73
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
74
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
75
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
76
+ */
19
77
  export interface IValidate<T> {
20
78
  type: "validate";
79
+ /**
80
+ * The typia validation function generated for the requested type.
81
+ *
82
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument, taking the form and returning the validation result.
83
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
84
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
85
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type.
86
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
87
+ */
21
88
  validate: (input: FormData) => IValidation<T>;
22
89
  }
90
+ /**
91
+ * A file field of a multipart form: its name and the number of files it may
92
+ * hold, or `null` for no limit.
93
+ *
94
+ * A limit of 1 makes the multer field accept one file; any other value leaves
95
+ * the field unlimited.
96
+ *
97
+ * @evidence contracts/common.md#principled-implementation A limit of 1 makes the multer field accept one file and any other value leaves the field unlimited, which is how the runtime configures `multer.fields`.
98
+ * @evidence contracts/common.md#clear-and-simple-design A two-field record with no behavior.
99
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The values come from the type through the transform, not from a fixture.
100
+ * @evidence contracts/common.md#meaningful-documentation The comment states the meaning of the name and of the limit.
101
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation FormData validators and file-field names describe multipart protocol data; no member is a native storage path or handle.
102
+ */
23
103
  export interface IFile {
24
104
  name: string;
25
105
  limit: number | null;
@@ -4,17 +4,84 @@ export type IRequestHeadersValidator<T> =
4
4
  | IRequestHeadersValidator.IAssert<T>
5
5
  | IRequestHeadersValidator.IIs<T>
6
6
  | IRequestHeadersValidator.IValidate<T>;
7
+ /**
8
+ * The request headers validator that the transform passes to `TypedHeaders`.
9
+ *
10
+ * The literal `type` field selects which typia function generated the
11
+ * validator: `assert`, `is`, or `validate`. `validate_request_headers` turns a
12
+ * failure of any variant into a 400 response.
13
+ *
14
+ * @evidence contracts/common.md#principled-implementation The union is discriminated by the literal `type`, so the runtime selects the assert, is, or validate path with one comparison and the compiler checks that each variant carries the function its tag names.
15
+ * @evidence contracts/common.md#clear-and-simple-design Three variants, one per typia function family, with no shared base because each function has a different shape.
16
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior; the runtime rejects an unknown `type` with an error instead of accepting it.
17
+ * @evidence contracts/common.md#meaningful-documentation The comment names the decorators that receive the validator, the meaning of the discriminant, and the response a failure becomes.
18
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
19
+ */
7
20
  export namespace IRequestHeadersValidator {
21
+ /**
22
+ * Validator generated from `typia.assert`.
23
+ *
24
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the header record of the request, whose values are strings, string arrays, or undefined that returns the decoded object or throws the `TypeGuardError` of typia; `validate_request_headers` catches the error and converts it to a `BadRequestException` carrying the path, reason, expected type, and value of the first failure.
25
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
26
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
27
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from; the failure response is stated on the union.
28
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
29
+ */
8
30
  export interface IAssert<T> {
9
31
  type: "assert";
32
+ /**
33
+ * The typia assertion function generated for the requested type.
34
+ *
35
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the header record of the request, whose values are strings, string arrays, or undefined and it returns the decoded object or throws the `TypeGuardError` of typia.
36
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
37
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
38
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its input is in the signature.
39
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
40
+ */
10
41
  assert: (input: Record<string, string | string[] | undefined>) => T;
11
42
  }
43
+ /**
44
+ * Validator generated from `typia.is`.
45
+ *
46
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the header record of the request, whose values are strings, string arrays, or undefined that returns the decoded object or `null`; a failing result becomes a `BadRequestException` with only the fixed message, because `typia.is` records no failure detail.
47
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
48
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
49
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
50
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
51
+ */
12
52
  export interface IIs<T> {
13
53
  type: "is";
54
+ /**
55
+ * The typia check function generated for the requested type.
56
+ *
57
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the header record of the request, whose values are strings, string arrays, or undefined and returning the decoded object or `null`.
58
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
59
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
60
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
61
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
62
+ */
14
63
  is: (input: Record<string, string | string[] | undefined>) => T | null;
15
64
  }
65
+ /**
66
+ * Validator generated from `typia.validate`.
67
+ *
68
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the header record of the request, whose values are strings, string arrays, or undefined that returns the `IValidation` of typia; a failed result becomes a `BadRequestException` carrying every error of the validation.
69
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
70
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
71
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
72
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
73
+ */
16
74
  export interface IValidate<T> {
17
75
  type: "validate";
76
+ /**
77
+ * The typia validation function generated for the requested type.
78
+ *
79
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the header record of the request, whose values are strings, string arrays, or undefined and returning the validation result with every error.
80
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
81
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
82
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
83
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes HTTP header records and returns decoded values independently of native filesystem or process spelling.
84
+ */
18
85
  validate: (
19
86
  input: Record<string, string | string[] | undefined>,
20
87
  ) => IValidation<T>;
@@ -4,17 +4,85 @@ export type IRequestQueryValidator<T> =
4
4
  | IRequestQueryValidator.IAssert<T>
5
5
  | IRequestQueryValidator.IIs<T>
6
6
  | IRequestQueryValidator.IValidate<T>;
7
+ /**
8
+ * The request query validator that the transform passes to `TypedQuery`,
9
+ * `TypedQuery.Body`, and `WebSocketRoute.Query`.
10
+ *
11
+ * The literal `type` field selects which typia function generated the
12
+ * validator: `assert`, `is`, or `validate`. `validate_request_query` turns a
13
+ * failure of any variant into a 400 response.
14
+ *
15
+ * @evidence contracts/common.md#principled-implementation The union is discriminated by the literal `type`, so the runtime selects the assert, is, or validate path with one comparison and the compiler checks that each variant carries the function its tag names.
16
+ * @evidence contracts/common.md#clear-and-simple-design Three variants, one per typia function family, with no shared base because each function has a different shape.
17
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior; the runtime rejects an unknown `type` with an error instead of accepting it.
18
+ * @evidence contracts/common.md#meaningful-documentation The comment names the decorators that receive the validator, the meaning of the discriminant, and the response a failure becomes.
19
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
20
+ */
7
21
  export namespace IRequestQueryValidator {
22
+ /**
23
+ * Validator generated from `typia.assert`.
24
+ *
25
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the `URLSearchParams` of the query string or of an urlencoded body that returns the decoded object or throws the `TypeGuardError` of typia; `validate_request_query` catches the error and converts it to a `BadRequestException` carrying the path, reason, expected type, and value of the first failure, and a message-only one when a required property is missing.
26
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
27
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
28
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from; the failure response is stated on the union.
29
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
30
+ */
8
31
  export interface IAssert<T> {
9
32
  type: "assert";
33
+ /**
34
+ * The typia assertion function generated for the requested type.
35
+ *
36
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the `URLSearchParams` of the query string or of an urlencoded body and it returns the decoded object or throws the `TypeGuardError` of typia.
37
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
38
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
39
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its input is in the signature.
40
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
41
+ */
10
42
  assert: (input: URLSearchParams) => T;
11
43
  }
44
+ /**
45
+ * Validator generated from `typia.is`.
46
+ *
47
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the `URLSearchParams` of the query string or of an urlencoded body that returns the decoded object or `null`; a failing result becomes a `BadRequestException` with only the fixed message, because `typia.is` records no failure detail.
48
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
49
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
50
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
51
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
52
+ */
12
53
  export interface IIs<T> {
13
54
  type: "is";
55
+ /**
56
+ * The typia check function generated for the requested type.
57
+ *
58
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the `URLSearchParams` of the query string or of an urlencoded body and returning the decoded object or `null`.
59
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
60
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
61
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
62
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
63
+ */
14
64
  is: (input: URLSearchParams) => T | null;
15
65
  }
66
+ /**
67
+ * Validator generated from `typia.validate`.
68
+ *
69
+ * @evidence contracts/common.md#principled-implementation The variant tags a function of the `URLSearchParams` of the query string or of an urlencoded body that returns the `IValidation` of typia; a failed result becomes a `BadRequestException` carrying every error of the validation.
70
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
71
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
72
+ * @evidence contracts/common.md#meaningful-documentation The comment names the typia function the variant comes from.
73
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
74
+ */
16
75
  export interface IValidate<T> {
17
76
  type: "validate";
77
+ /**
78
+ * The typia validation function generated for the requested type.
79
+ *
80
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the type argument of the decorator, taking the `URLSearchParams` of the query string or of an urlencoded body and returning the validation result with every error.
81
+ * @evidence contracts/common.md#clear-and-simple-design One function member with the input the decorator has.
82
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
83
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the requested type; its result is in the signature.
84
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The validator consumes URLSearchParams and describes query data rather than native paths or process arguments.
85
+ */
18
86
  validate: (input: URLSearchParams) => IValidation<T>;
19
87
  }
20
88
  }
@@ -1,30 +1,150 @@
1
1
  import { IValidation } from "typia";
2
2
 
3
+ /**
4
+ * The serializer that the transform passes to `TypedQuery.Get`,
5
+ * `TypedQuery.Post`, `TypedQuery.Put`, `TypedQuery.Patch`, and
6
+ * `TypedQuery.Delete` for the urlencoded form of the response body.
7
+ *
8
+ * The literal `type` field selects which generated encoder/validator
9
+ * combination it contains: `stringify` (no validation), `is`, `assert`,
10
+ * `validate`, or `validate.log`. `get_path_and_querify` turns a failing
11
+ * validation into a 500 response, except `validate.log`, which logs the failure
12
+ * and answers with the plain conversion of the data into `URLSearchParams`.
13
+ *
14
+ * @evidence contracts/common.md#principled-implementation The union is discriminated by the literal `type`, so the runtime selects the serializer with one comparison; the transform combines its URLSearchParams encoder with assert, is or validate checks as selected, while stringify performs encoding alone and validate.log reports failures before fallback encoding.
15
+ * @evidence contracts/common.md#clear-and-simple-design Five variants describe plain encoding and the three validation callback shapes, with validate.log sharing the validate shape but selecting a different failure policy.
16
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior; the runtime rejects an unknown `type` with an error instead of accepting it.
17
+ * @evidence contracts/common.md#meaningful-documentation The comment names the decorators that receive the serializer and the response each variant produces on a failed validation.
18
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
19
+ */
3
20
  export type IResponseBodyQuerifier<T> =
4
21
  | IResponseBodyquerifier.IStringify<T>
5
22
  | IResponseBodyquerifier.IIs<T>
6
23
  | IResponseBodyquerifier.IAssert<T>
7
24
  | IResponseBodyquerifier.IValidate<T>
8
25
  | IResponseBodyquerifier.IValidateLog<T>;
26
+ /**
27
+ * The variant records of {@link IResponseBodyQuerifier}.
28
+ *
29
+ * The lowercase q is the spelling of the exported namespace name, which
30
+ * existing code may reference.
31
+ *
32
+ * @evidence contracts/common.md#principled-implementation The namespace declares the five variant records that IResponseBodyQuerifier combines, so the union and its variants are one public family.
33
+ * @evidence contracts/common.md#clear-and-simple-design Five records with no runtime members.
34
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It contains types only; the spelling is kept because renaming an exported identifier is a breaking change.
35
+ * @evidence contracts/common.md#meaningful-documentation The comment states what the namespace holds and why its name has a lowercase q.
36
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
37
+ */
9
38
  export namespace IResponseBodyquerifier {
39
+ /**
40
+ * Generated URLSearchParams encoder without validation.
41
+ *
42
+ * @evidence contracts/common.md#principled-implementation The variant tags a function that serializes the data as it is, so a value of the wrong type is serialized as far as its shape allows without this variant performing validation.
43
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
44
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
45
+ * @evidence contracts/common.md#meaningful-documentation The comment identifies how validation and URLSearchParams encoding are combined.
46
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
47
+ */
10
48
  export interface IStringify<T> {
11
49
  type: "stringify";
50
+ /**
51
+ * The generated function of the variant, taking the response data.
52
+ *
53
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the return type of the route method, and the runtime uses the result as the response body as it is.
54
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
55
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
56
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the return type; its result is in the signature.
57
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
58
+ */
12
59
  stringify: (input: T) => URLSearchParams;
13
60
  }
61
+ /**
62
+ * Generated URLSearchParams encoder guarded by a typia is check.
63
+ *
64
+ * @evidence contracts/common.md#principled-implementation The variant tags a function that returns the encoded URLSearchParams, or `null` when the data is not of the type; `null` becomes a 500 `InternalServerErrorException` with a fixed message.
65
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
66
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
67
+ * @evidence contracts/common.md#meaningful-documentation The comment identifies how validation and URLSearchParams encoding are combined.
68
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
69
+ */
14
70
  export interface IIs<T> {
15
71
  type: "is";
72
+ /**
73
+ * The generated function of the variant, taking the response data.
74
+ *
75
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the return type of the route method, and it returns the serialized text or `null`.
76
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
77
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
78
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the return type; its result is in the signature.
79
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
80
+ */
16
81
  is: (input: T) => URLSearchParams | null;
17
82
  }
83
+ /**
84
+ * Generated URLSearchParams encoder preceded by a typia assertion.
85
+ *
86
+ * @evidence contracts/common.md#principled-implementation The variant tags a function that returns the serialized text or throws the `TypeGuardError` of typia, which becomes a 500 `InternalServerErrorException` with the path, reason, expected type, and value.
87
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
88
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
89
+ * @evidence contracts/common.md#meaningful-documentation The comment identifies how validation and URLSearchParams encoding are combined.
90
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
91
+ */
18
92
  export interface IAssert<T> {
19
93
  type: "assert";
94
+ /**
95
+ * The generated function of the variant, taking the response data.
96
+ *
97
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the return type of the route method, and it returns the encoded URLSearchParams or throws.
98
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
99
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
100
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the return type; its result is in the signature.
101
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
102
+ */
20
103
  assert: (input: T) => URLSearchParams;
21
104
  }
105
+ /**
106
+ * Generated URLSearchParams encoder wrapped in a typia validation result.
107
+ *
108
+ * @evidence contracts/common.md#principled-implementation The variant tags a function that returns IValidation<URLSearchParams>; a failure becomes a 500 `InternalServerErrorException` carrying every error.
109
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
110
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
111
+ * @evidence contracts/common.md#meaningful-documentation The comment identifies how validation and URLSearchParams encoding are combined.
112
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
113
+ */
22
114
  export interface IValidate<T> {
23
115
  type: "validate";
116
+ /**
117
+ * The generated function of the variant, taking the response data.
118
+ *
119
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the return type of the route method, and it returns the validation result.
120
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
121
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
122
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the return type; its result is in the signature.
123
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
124
+ */
24
125
  validate: (input: T) => IValidation<URLSearchParams>;
25
126
  }
127
+ /**
128
+ * Generated validation and URLSearchParams encoding for the `validate.log`
129
+ * mode.
130
+ *
131
+ * @evidence contracts/common.md#principled-implementation The variant tags the same function shape as `validate`, but a failure is passed to the logger registered with `TypedRoute.setValidateErrorLogger` and the response is the plain conversion of the data into `URLSearchParams`, so a validation failure never changes the status.
132
+ * @evidence contracts/common.md#clear-and-simple-design A two-member record, the tag and the function.
133
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
134
+ * @evidence contracts/common.md#meaningful-documentation The comment identifies how validation and URLSearchParams encoding are combined.
135
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
136
+ */
26
137
  export interface IValidateLog<T> {
27
138
  type: "validate.log";
139
+ /**
140
+ * The generated function of the variant, taking the response data.
141
+ *
142
+ * @evidence contracts/common.md#principled-implementation The transform generates the function for the return type of the route method, and it returns the validation result.
143
+ * @evidence contracts/common.md#clear-and-simple-design One function member.
144
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The function is generated from the type, and the runtime never edits its result.
145
+ * @evidence contracts/common.md#meaningful-documentation The comment states that the function is generated for the return type; its result is in the signature.
146
+ * @evidenceExclude contracts/portability.md#os-neutral-implementation The variants describe conversion of JavaScript response values to HTTP query text without native file access.
147
+ */
28
148
  validate: (input: T) => IValidation<URLSearchParams>;
29
149
  }
30
150
  }