@nestia/core 12.0.0-rc.2 → 12.0.0-rc.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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/MIGRATION.md +138 -169
  3. package/lib/decorators/NoTransformConfigurationError.js +5 -5
  4. package/lib/decorators/NoTransformConfigurationError.js.map +1 -1
  5. package/native/cmd/ttsc-nestia/main.go +11 -11
  6. package/native/go.mod +32 -32
  7. package/native/go.sum +54 -54
  8. package/native/plugin/plan.go +102 -102
  9. package/native/transform/ast.go +32 -32
  10. package/native/transform/build.go +388 -380
  11. package/native/transform/cleanup.go +408 -408
  12. package/native/transform/contributor.go +97 -97
  13. package/native/transform/core_querify.go +231 -231
  14. package/native/transform/core_transform.go +1996 -1996
  15. package/native/transform/core_websocket.go +115 -115
  16. package/native/transform/exports.go +13 -13
  17. package/native/transform/mcp_transform.go +414 -414
  18. package/native/transform/node_transform.go +357 -357
  19. package/native/transform/path_rewrite.go +285 -285
  20. package/native/transform/printer.go +244 -244
  21. package/native/transform/rewrite.go +668 -668
  22. package/native/transform/run.go +73 -73
  23. package/native/transform/transform.go +336 -336
  24. package/native/transform/typia_fast.go +375 -352
  25. package/native/transform/typia_replacement.go +24 -24
  26. package/native/transform.cjs +43 -43
  27. package/package.json +9 -9
  28. package/src/adaptors/McpAdaptor.ts +276 -276
  29. package/src/adaptors/WebSocketAdaptor.ts +429 -429
  30. package/src/decorators/DynamicModule.ts +44 -44
  31. package/src/decorators/EncryptedBody.ts +97 -97
  32. package/src/decorators/EncryptedController.ts +40 -40
  33. package/src/decorators/EncryptedModule.ts +98 -98
  34. package/src/decorators/EncryptedRoute.ts +213 -213
  35. package/src/decorators/HumanRoute.ts +21 -21
  36. package/src/decorators/McpRoute.ts +154 -154
  37. package/src/decorators/NoTransformConfigurationError.ts +40 -40
  38. package/src/decorators/PlainBody.ts +76 -76
  39. package/src/decorators/SwaggerCustomizer.ts +97 -97
  40. package/src/decorators/SwaggerExample.ts +180 -180
  41. package/src/decorators/TypedBody.ts +57 -57
  42. package/src/decorators/TypedException.ts +147 -147
  43. package/src/decorators/TypedFormData.ts +187 -187
  44. package/src/decorators/TypedHeaders.ts +66 -66
  45. package/src/decorators/TypedParam.ts +77 -77
  46. package/src/decorators/TypedQuery.ts +234 -234
  47. package/src/decorators/TypedRoute.ts +198 -198
  48. package/src/decorators/WebSocketRoute.ts +242 -242
  49. package/src/decorators/doNotThrowTransformError.ts +5 -5
  50. package/src/decorators/internal/EncryptedConstant.ts +2 -2
  51. package/src/decorators/internal/IMcpRouteReflect.ts +40 -40
  52. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  53. package/src/decorators/internal/get_path_and_querify.ts +94 -94
  54. package/src/decorators/internal/get_path_and_stringify.ts +110 -110
  55. package/src/decorators/internal/get_text_body.ts +16 -16
  56. package/src/decorators/internal/headers_to_object.ts +11 -11
  57. package/src/decorators/internal/is_request_body_undefined.ts +12 -12
  58. package/src/decorators/internal/load_controller.ts +94 -94
  59. package/src/decorators/internal/route_error.ts +43 -43
  60. package/src/decorators/internal/validate_request_body.ts +64 -64
  61. package/src/decorators/internal/validate_request_form_data.ts +67 -67
  62. package/src/decorators/internal/validate_request_headers.ts +76 -76
  63. package/src/decorators/internal/validate_request_query.ts +83 -83
  64. package/src/index.ts +5 -5
  65. package/src/module.ts +25 -25
  66. package/src/options/IRequestBodyValidator.ts +20 -20
  67. package/src/options/IRequestFormDataProps.ts +27 -27
  68. package/src/options/IRequestHeadersValidator.ts +22 -22
  69. package/src/options/IRequestQueryValidator.ts +20 -20
  70. package/src/options/IResponseBodyQuerifier.ts +25 -25
  71. package/src/options/IResponseBodyStringifier.ts +30 -30
  72. package/src/transform.ts +26 -26
  73. package/src/typings/Creator.ts +3 -3
  74. package/src/typings/get-function-location.d.ts +7 -7
  75. package/src/utils/ArrayUtil.ts +7 -7
  76. package/src/utils/ExceptionManager.ts +115 -115
  77. package/src/utils/Singleton.ts +16 -16
  78. package/src/utils/SourceFinder.ts +54 -54
  79. package/src/utils/VersioningStrategy.ts +27 -27
  80. package/README.md +0 -93
@@ -1,76 +1,76 @@
1
- import { BadRequestException } from "@nestjs/common";
2
- import typia, { IValidation, TypeGuardError } from "typia";
3
-
4
- import { IRequestHeadersValidator } from "../../options/IRequestHeadersValidator";
5
- import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
-
7
- /** @internal */
8
- export const validate_request_headers = <T>(
9
- validator?: IRequestHeadersValidator<T>,
10
- ): ((input: Record<string, string | string[] | undefined>) => T | Error) => {
11
- if (!validator) {
12
- NoTransformConfigurationError("TypedHeaders");
13
- return (input: Record<string, string | string[] | undefined>) =>
14
- Object.entries(input) as T;
15
- } else if (validator.type === "assert") return assert(validator.assert);
16
- else if (validator.type === "is") return is(validator.is);
17
- else if (validator.type === "validate") return validate(validator.validate);
18
- return () =>
19
- new Error(`Error on nestia.core.TypedHeaders(): invalid typed validator.`);
20
- };
21
-
22
- /** @internal */
23
- const assert =
24
- <T>(closure: (input: Record<string, string | string[] | undefined>) => T) =>
25
- (
26
- input: Record<string, string | string[] | undefined>,
27
- ): T | BadRequestException => {
28
- try {
29
- return closure(input);
30
- } catch (exp) {
31
- if (typia.is<TypeGuardError>(exp)) {
32
- return new BadRequestException({
33
- path: exp.path,
34
- reason: exp.message,
35
- expected: exp.expected,
36
- value: exp.value,
37
- message: MESSAGE,
38
- });
39
- }
40
- throw exp;
41
- }
42
- };
43
-
44
- /** @internal */
45
- const is =
46
- <T>(
47
- closure: (input: Record<string, string | string[] | undefined>) => T | null,
48
- ) =>
49
- (
50
- input: Record<string, string | string[] | undefined>,
51
- ): T | BadRequestException => {
52
- const result: T | null = closure(input);
53
- return result !== null ? result : new BadRequestException(MESSAGE);
54
- };
55
-
56
- /** @internal */
57
- const validate =
58
- <T>(
59
- closure: (
60
- input: Record<string, string | string[] | undefined>,
61
- ) => IValidation<T>,
62
- ) =>
63
- (
64
- input: Record<string, string | string[] | undefined>,
65
- ): T | BadRequestException => {
66
- const result: IValidation<T> = closure(input);
67
- return result.success
68
- ? result.data
69
- : new BadRequestException({
70
- errors: result.errors,
71
- message: MESSAGE,
72
- });
73
- };
74
-
75
- /** @internal */
76
- const MESSAGE = "Request headers data is not following the promised type.";
1
+ import { BadRequestException } from "@nestjs/common";
2
+ import typia, { IValidation, TypeGuardError } from "typia";
3
+
4
+ import { IRequestHeadersValidator } from "../../options/IRequestHeadersValidator";
5
+ import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
+
7
+ /** @internal */
8
+ export const validate_request_headers = <T>(
9
+ validator?: IRequestHeadersValidator<T>,
10
+ ): ((input: Record<string, string | string[] | undefined>) => T | Error) => {
11
+ if (!validator) {
12
+ NoTransformConfigurationError("TypedHeaders");
13
+ return (input: Record<string, string | string[] | undefined>) =>
14
+ Object.entries(input) as T;
15
+ } else if (validator.type === "assert") return assert(validator.assert);
16
+ else if (validator.type === "is") return is(validator.is);
17
+ else if (validator.type === "validate") return validate(validator.validate);
18
+ return () =>
19
+ new Error(`Error on nestia.core.TypedHeaders(): invalid typed validator.`);
20
+ };
21
+
22
+ /** @internal */
23
+ const assert =
24
+ <T>(closure: (input: Record<string, string | string[] | undefined>) => T) =>
25
+ (
26
+ input: Record<string, string | string[] | undefined>,
27
+ ): T | BadRequestException => {
28
+ try {
29
+ return closure(input);
30
+ } catch (exp) {
31
+ if (typia.is<TypeGuardError>(exp)) {
32
+ return new BadRequestException({
33
+ path: exp.path,
34
+ reason: exp.message,
35
+ expected: exp.expected,
36
+ value: exp.value,
37
+ message: MESSAGE,
38
+ });
39
+ }
40
+ throw exp;
41
+ }
42
+ };
43
+
44
+ /** @internal */
45
+ const is =
46
+ <T>(
47
+ closure: (input: Record<string, string | string[] | undefined>) => T | null,
48
+ ) =>
49
+ (
50
+ input: Record<string, string | string[] | undefined>,
51
+ ): T | BadRequestException => {
52
+ const result: T | null = closure(input);
53
+ return result !== null ? result : new BadRequestException(MESSAGE);
54
+ };
55
+
56
+ /** @internal */
57
+ const validate =
58
+ <T>(
59
+ closure: (
60
+ input: Record<string, string | string[] | undefined>,
61
+ ) => IValidation<T>,
62
+ ) =>
63
+ (
64
+ input: Record<string, string | string[] | undefined>,
65
+ ): T | BadRequestException => {
66
+ const result: IValidation<T> = closure(input);
67
+ return result.success
68
+ ? result.data
69
+ : new BadRequestException({
70
+ errors: result.errors,
71
+ message: MESSAGE,
72
+ });
73
+ };
74
+
75
+ /** @internal */
76
+ const MESSAGE = "Request headers data is not following the promised type.";
@@ -1,83 +1,83 @@
1
- import { BadRequestException } from "@nestjs/common";
2
- import typia, { IValidation, TypeGuardError } from "typia";
3
-
4
- import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
- import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
-
7
- /** @internal */
8
- export const validate_request_query =
9
- (method: string) =>
10
- <T>(validator?: IRequestQueryValidator<T>) => {
11
- if (!validator) {
12
- NoTransformConfigurationError(method);
13
- return (input: URLSearchParams) =>
14
- Object.fromEntries(input.entries()) as T;
15
- } else if (validator.type === "assert") return assert(validator.assert);
16
- else if (validator.type === "is") return is(validator.is);
17
- else if (validator.type === "validate") return validate(validator.validate);
18
- return () =>
19
- new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
20
- };
21
-
22
- /** @internal */
23
- const assert =
24
- <T>(closure: (input: URLSearchParams) => T) =>
25
- (input: URLSearchParams): T | BadRequestException => {
26
- try {
27
- return closure(input);
28
- } catch (exp) {
29
- if (typia.is<TypeGuardError>(exp)) {
30
- return new BadRequestException({
31
- path: exp.path,
32
- reason: exp.message,
33
- expected: exp.expected,
34
- value: exp.value,
35
- message: MESSAGE,
36
- });
37
- }
38
- if (is_missing_query_property(exp)) return new BadRequestException(MESSAGE);
39
- throw exp;
40
- }
41
- };
42
-
43
- /** @internal */
44
- const is =
45
- <T>(closure: (input: URLSearchParams) => T | null) =>
46
- (input: URLSearchParams): T | BadRequestException => {
47
- const result: T | null = (() => {
48
- try {
49
- return closure(input);
50
- } catch (exp) {
51
- if (is_missing_query_property(exp)) return null;
52
- throw exp;
53
- }
54
- })();
55
- return result !== null ? result : new BadRequestException(MESSAGE);
56
- };
57
-
58
- /** @internal */
59
- const validate =
60
- <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
- (input: URLSearchParams): T | BadRequestException => {
62
- const result: IValidation<T> | null = (() => {
63
- try {
64
- return closure(input);
65
- } catch (exp) {
66
- if (is_missing_query_property(exp)) return null;
67
- throw exp;
68
- }
69
- })();
70
- if (result === null) return new BadRequestException(MESSAGE);
71
- return result.success
72
- ? result.data
73
- : new BadRequestException({
74
- errors: result.errors,
75
- message: MESSAGE,
76
- });
77
- };
78
-
79
- /** @internal */
80
- const MESSAGE = "Request query data is not following the promised type.";
81
-
82
- const is_missing_query_property = (exp: unknown): exp is Error =>
83
- exp instanceof Error && /^missing [^.\[\]\s]+$/.test(exp.message);
1
+ import { BadRequestException } from "@nestjs/common";
2
+ import typia, { IValidation, TypeGuardError } from "typia";
3
+
4
+ import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
+ import { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
+
7
+ /** @internal */
8
+ export const validate_request_query =
9
+ (method: string) =>
10
+ <T>(validator?: IRequestQueryValidator<T>) => {
11
+ if (!validator) {
12
+ NoTransformConfigurationError(method);
13
+ return (input: URLSearchParams) =>
14
+ Object.fromEntries(input.entries()) as T;
15
+ } else if (validator.type === "assert") return assert(validator.assert);
16
+ else if (validator.type === "is") return is(validator.is);
17
+ else if (validator.type === "validate") return validate(validator.validate);
18
+ return () =>
19
+ new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
20
+ };
21
+
22
+ /** @internal */
23
+ const assert =
24
+ <T>(closure: (input: URLSearchParams) => T) =>
25
+ (input: URLSearchParams): T | BadRequestException => {
26
+ try {
27
+ return closure(input);
28
+ } catch (exp) {
29
+ if (typia.is<TypeGuardError>(exp)) {
30
+ return new BadRequestException({
31
+ path: exp.path,
32
+ reason: exp.message,
33
+ expected: exp.expected,
34
+ value: exp.value,
35
+ message: MESSAGE,
36
+ });
37
+ }
38
+ if (is_missing_query_property(exp)) return new BadRequestException(MESSAGE);
39
+ throw exp;
40
+ }
41
+ };
42
+
43
+ /** @internal */
44
+ const is =
45
+ <T>(closure: (input: URLSearchParams) => T | null) =>
46
+ (input: URLSearchParams): T | BadRequestException => {
47
+ const result: T | null = (() => {
48
+ try {
49
+ return closure(input);
50
+ } catch (exp) {
51
+ if (is_missing_query_property(exp)) return null;
52
+ throw exp;
53
+ }
54
+ })();
55
+ return result !== null ? result : new BadRequestException(MESSAGE);
56
+ };
57
+
58
+ /** @internal */
59
+ const validate =
60
+ <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
+ (input: URLSearchParams): T | BadRequestException => {
62
+ const result: IValidation<T> | null = (() => {
63
+ try {
64
+ return closure(input);
65
+ } catch (exp) {
66
+ if (is_missing_query_property(exp)) return null;
67
+ throw exp;
68
+ }
69
+ })();
70
+ if (result === null) return new BadRequestException(MESSAGE);
71
+ return result.success
72
+ ? result.data
73
+ : new BadRequestException({
74
+ errors: result.errors,
75
+ message: MESSAGE,
76
+ });
77
+ };
78
+
79
+ /** @internal */
80
+ const MESSAGE = "Request query data is not following the promised type.";
81
+
82
+ const is_missing_query_property = (exp: unknown): exp is Error =>
83
+ exp instanceof Error && /^missing [^.\[\]\s]+$/.test(exp.message);
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as core from "./module";
2
-
3
- export * from "./module";
4
-
5
- export default core;
1
+ import * as core from "./module";
2
+
3
+ export * from "./module";
4
+
5
+ export default core;
package/src/module.ts CHANGED
@@ -1,25 +1,25 @@
1
- export * from "./decorators/DynamicModule";
2
- export * from "./utils/ExceptionManager";
3
-
4
- export * from "./decorators/HumanRoute";
5
- export * from "./decorators/TypedRoute";
6
- export * from "./decorators/TypedBody";
7
- export * from "./decorators/TypedQuery";
8
- export * from "./decorators/TypedException";
9
- export * from "./decorators/TypedHeaders";
10
- export * from "./decorators/TypedFormData";
11
- export * from "./decorators/TypedParam";
12
-
13
- export * from "./decorators/EncryptedController";
14
- export * from "./decorators/EncryptedRoute";
15
- export * from "./decorators/EncryptedBody";
16
- export * from "./decorators/EncryptedModule";
17
- export * from "./decorators/PlainBody";
18
- export * from "./decorators/SwaggerCustomizer";
19
- export * from "./decorators/SwaggerExample";
20
-
21
- export * from "./adaptors/WebSocketAdaptor";
22
- export * from "./decorators/WebSocketRoute";
23
- export * from "./adaptors/McpAdaptor";
24
- export * from "./decorators/McpRoute";
25
- export * from "./decorators/doNotThrowTransformError";
1
+ export * from "./decorators/DynamicModule";
2
+ export * from "./utils/ExceptionManager";
3
+
4
+ export * from "./decorators/HumanRoute";
5
+ export * from "./decorators/TypedRoute";
6
+ export * from "./decorators/TypedBody";
7
+ export * from "./decorators/TypedQuery";
8
+ export * from "./decorators/TypedException";
9
+ export * from "./decorators/TypedHeaders";
10
+ export * from "./decorators/TypedFormData";
11
+ export * from "./decorators/TypedParam";
12
+
13
+ export * from "./decorators/EncryptedController";
14
+ export * from "./decorators/EncryptedRoute";
15
+ export * from "./decorators/EncryptedBody";
16
+ export * from "./decorators/EncryptedModule";
17
+ export * from "./decorators/PlainBody";
18
+ export * from "./decorators/SwaggerCustomizer";
19
+ export * from "./decorators/SwaggerExample";
20
+
21
+ export * from "./adaptors/WebSocketAdaptor";
22
+ export * from "./decorators/WebSocketRoute";
23
+ export * from "./adaptors/McpAdaptor";
24
+ export * from "./decorators/McpRoute";
25
+ export * from "./decorators/doNotThrowTransformError";
@@ -1,20 +1,20 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestBodyValidator<T> =
4
- | IRequestBodyValidator.IAssert<T>
5
- | IRequestBodyValidator.IIs<T>
6
- | IRequestBodyValidator.IValidate<T>;
7
- export namespace IRequestBodyValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: T) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: T) => boolean;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (input: T) => IValidation<T>;
19
- }
20
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestBodyValidator<T> =
4
+ | IRequestBodyValidator.IAssert<T>
5
+ | IRequestBodyValidator.IIs<T>
6
+ | IRequestBodyValidator.IValidate<T>;
7
+ export namespace IRequestBodyValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: T) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: T) => boolean;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (input: T) => IValidation<T>;
19
+ }
20
+ }
@@ -1,27 +1,27 @@
1
- import { IValidation } from "typia";
2
-
3
- export interface IRequestFormDataProps<T> {
4
- files: Array<IRequestFormDataProps.IFile>;
5
- validator:
6
- | IRequestFormDataProps.IAssert<T>
7
- | IRequestFormDataProps.IIs<T>
8
- | IRequestFormDataProps.IValidate<T>;
9
- }
10
- export namespace IRequestFormDataProps {
11
- export interface IAssert<T> {
12
- type: "assert";
13
- assert: (input: FormData) => T;
14
- }
15
- export interface IIs<T> {
16
- type: "is";
17
- is: (input: FormData) => T | null;
18
- }
19
- export interface IValidate<T> {
20
- type: "validate";
21
- validate: (input: FormData) => IValidation<T>;
22
- }
23
- export interface IFile {
24
- name: string;
25
- limit: number | null;
26
- }
27
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export interface IRequestFormDataProps<T> {
4
+ files: Array<IRequestFormDataProps.IFile>;
5
+ validator:
6
+ | IRequestFormDataProps.IAssert<T>
7
+ | IRequestFormDataProps.IIs<T>
8
+ | IRequestFormDataProps.IValidate<T>;
9
+ }
10
+ export namespace IRequestFormDataProps {
11
+ export interface IAssert<T> {
12
+ type: "assert";
13
+ assert: (input: FormData) => T;
14
+ }
15
+ export interface IIs<T> {
16
+ type: "is";
17
+ is: (input: FormData) => T | null;
18
+ }
19
+ export interface IValidate<T> {
20
+ type: "validate";
21
+ validate: (input: FormData) => IValidation<T>;
22
+ }
23
+ export interface IFile {
24
+ name: string;
25
+ limit: number | null;
26
+ }
27
+ }
@@ -1,22 +1,22 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestHeadersValidator<T> =
4
- | IRequestHeadersValidator.IAssert<T>
5
- | IRequestHeadersValidator.IIs<T>
6
- | IRequestHeadersValidator.IValidate<T>;
7
- export namespace IRequestHeadersValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: Record<string, string | string[] | undefined>) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: Record<string, string | string[] | undefined>) => T | null;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (
19
- input: Record<string, string | string[] | undefined>,
20
- ) => IValidation<T>;
21
- }
22
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestHeadersValidator<T> =
4
+ | IRequestHeadersValidator.IAssert<T>
5
+ | IRequestHeadersValidator.IIs<T>
6
+ | IRequestHeadersValidator.IValidate<T>;
7
+ export namespace IRequestHeadersValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: Record<string, string | string[] | undefined>) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: Record<string, string | string[] | undefined>) => T | null;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (
19
+ input: Record<string, string | string[] | undefined>,
20
+ ) => IValidation<T>;
21
+ }
22
+ }
@@ -1,20 +1,20 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IRequestQueryValidator<T> =
4
- | IRequestQueryValidator.IAssert<T>
5
- | IRequestQueryValidator.IIs<T>
6
- | IRequestQueryValidator.IValidate<T>;
7
- export namespace IRequestQueryValidator {
8
- export interface IAssert<T> {
9
- type: "assert";
10
- assert: (input: URLSearchParams) => T;
11
- }
12
- export interface IIs<T> {
13
- type: "is";
14
- is: (input: URLSearchParams) => T | null;
15
- }
16
- export interface IValidate<T> {
17
- type: "validate";
18
- validate: (input: URLSearchParams) => IValidation<T>;
19
- }
20
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IRequestQueryValidator<T> =
4
+ | IRequestQueryValidator.IAssert<T>
5
+ | IRequestQueryValidator.IIs<T>
6
+ | IRequestQueryValidator.IValidate<T>;
7
+ export namespace IRequestQueryValidator {
8
+ export interface IAssert<T> {
9
+ type: "assert";
10
+ assert: (input: URLSearchParams) => T;
11
+ }
12
+ export interface IIs<T> {
13
+ type: "is";
14
+ is: (input: URLSearchParams) => T | null;
15
+ }
16
+ export interface IValidate<T> {
17
+ type: "validate";
18
+ validate: (input: URLSearchParams) => IValidation<T>;
19
+ }
20
+ }
@@ -1,25 +1,25 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IResponseBodyQuerifier<T> =
4
- | IResponseBodyquerifier.IStringify<T>
5
- | IResponseBodyquerifier.IIs<T>
6
- | IResponseBodyquerifier.IAssert<T>
7
- | IResponseBodyquerifier.IValidate<T>;
8
- export namespace IResponseBodyquerifier {
9
- export interface IStringify<T> {
10
- type: "stringify";
11
- stringify: (input: T) => URLSearchParams;
12
- }
13
- export interface IIs<T> {
14
- type: "is";
15
- is: (input: T) => URLSearchParams | null;
16
- }
17
- export interface IAssert<T> {
18
- type: "assert";
19
- assert: (input: T) => URLSearchParams;
20
- }
21
- export interface IValidate<T> {
22
- type: "validate";
23
- validate: (input: T) => IValidation<URLSearchParams>;
24
- }
25
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IResponseBodyQuerifier<T> =
4
+ | IResponseBodyquerifier.IStringify<T>
5
+ | IResponseBodyquerifier.IIs<T>
6
+ | IResponseBodyquerifier.IAssert<T>
7
+ | IResponseBodyquerifier.IValidate<T>;
8
+ export namespace IResponseBodyquerifier {
9
+ export interface IStringify<T> {
10
+ type: "stringify";
11
+ stringify: (input: T) => URLSearchParams;
12
+ }
13
+ export interface IIs<T> {
14
+ type: "is";
15
+ is: (input: T) => URLSearchParams | null;
16
+ }
17
+ export interface IAssert<T> {
18
+ type: "assert";
19
+ assert: (input: T) => URLSearchParams;
20
+ }
21
+ export interface IValidate<T> {
22
+ type: "validate";
23
+ validate: (input: T) => IValidation<URLSearchParams>;
24
+ }
25
+ }