@nestia/core 3.0.0-dev.20231209 → 3.0.0

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 (132) hide show
  1. package/README.md +12 -9
  2. package/lib/decorators/DynamicModule.js +3 -3
  3. package/lib/decorators/DynamicModule.js.map +1 -1
  4. package/lib/decorators/EncryptedBody.js +14 -13
  5. package/lib/decorators/EncryptedBody.js.map +1 -1
  6. package/lib/decorators/EncryptedModule.d.ts +1 -1
  7. package/lib/decorators/EncryptedModule.js +45 -21
  8. package/lib/decorators/EncryptedModule.js.map +1 -1
  9. package/lib/decorators/EncryptedRoute.d.ts +5 -5
  10. package/lib/decorators/EncryptedRoute.js +12 -29
  11. package/lib/decorators/EncryptedRoute.js.map +1 -1
  12. package/lib/decorators/PlainBody.js +3 -0
  13. package/lib/decorators/PlainBody.js.map +1 -1
  14. package/lib/decorators/SwaggerCustomizer.d.ts +79 -0
  15. package/lib/decorators/SwaggerCustomizer.js +32 -0
  16. package/lib/decorators/SwaggerCustomizer.js.map +1 -0
  17. package/lib/decorators/TypedBody.js +3 -0
  18. package/lib/decorators/TypedBody.js.map +1 -1
  19. package/lib/decorators/TypedException.d.ts +0 -1
  20. package/lib/decorators/TypedException.js +0 -1
  21. package/lib/decorators/TypedException.js.map +1 -1
  22. package/lib/decorators/TypedFormData.d.ts +60 -0
  23. package/lib/decorators/TypedFormData.js +403 -0
  24. package/lib/decorators/TypedFormData.js.map +1 -0
  25. package/lib/decorators/TypedQuery.d.ts +11 -6
  26. package/lib/decorators/TypedQuery.js +6 -1
  27. package/lib/decorators/TypedQuery.js.map +1 -1
  28. package/lib/decorators/TypedRoute.d.ts +5 -5
  29. package/lib/decorators/internal/get_path_and_querify.js +3 -0
  30. package/lib/decorators/internal/get_path_and_querify.js.map +1 -1
  31. package/lib/decorators/internal/load_controller.js.map +1 -1
  32. package/lib/decorators/internal/validate_request_body.d.ts +1 -3
  33. package/lib/decorators/internal/validate_request_body.js +15 -0
  34. package/lib/decorators/internal/validate_request_body.js.map +1 -1
  35. package/lib/decorators/internal/validate_request_form_data.js +79 -0
  36. package/lib/decorators/internal/validate_request_form_data.js.map +1 -0
  37. package/lib/decorators/internal/validate_request_headers.d.ts +1 -3
  38. package/lib/decorators/internal/validate_request_headers.js +15 -0
  39. package/lib/decorators/internal/validate_request_headers.js.map +1 -1
  40. package/lib/decorators/internal/validate_request_query.d.ts +1 -3
  41. package/lib/decorators/internal/validate_request_query.js +15 -0
  42. package/lib/decorators/internal/validate_request_query.js.map +1 -1
  43. package/lib/module.d.ts +2 -0
  44. package/lib/module.js +2 -0
  45. package/lib/module.js.map +1 -1
  46. package/lib/options/IRequestFormDataProps.d.ts +23 -0
  47. package/lib/options/IRequestFormDataProps.js +3 -0
  48. package/lib/options/IRequestFormDataProps.js.map +1 -0
  49. package/lib/programmers/PlainBodyProgrammer.js +1 -1
  50. package/lib/programmers/PlainBodyProgrammer.js.map +1 -1
  51. package/lib/programmers/TypedExceptionProgrammer.js +5 -5
  52. package/lib/programmers/TypedExceptionProgrammer.js.map +1 -1
  53. package/lib/programmers/TypedFormDataBodyProgrammer.d.ts +6 -0
  54. package/lib/programmers/TypedFormDataBodyProgrammer.js +84 -0
  55. package/lib/programmers/TypedFormDataBodyProgrammer.js.map +1 -0
  56. package/lib/programmers/http/HttpQuerifyProgrammer.js +2 -2
  57. package/lib/programmers/http/HttpQuerifyProgrammer.js.map +1 -1
  58. package/lib/transformers/NodeTransformer.js.map +1 -1
  59. package/lib/transformers/ParameterDecoratorTransformer.js +7 -1
  60. package/lib/transformers/ParameterDecoratorTransformer.js.map +1 -1
  61. package/lib/transformers/TypedExceptionTransformer.js +1 -1
  62. package/lib/transformers/TypedExceptionTransformer.js.map +1 -1
  63. package/lib/transformers/TypedRouteTransformer.js +1 -1
  64. package/lib/transformers/TypedRouteTransformer.js.map +1 -1
  65. package/package.json +15 -16
  66. package/src/decorators/DynamicModule.ts +39 -39
  67. package/src/decorators/EncryptedBody.ts +105 -107
  68. package/src/decorators/EncryptedController.ts +38 -38
  69. package/src/decorators/EncryptedModule.ts +96 -79
  70. package/src/decorators/EncryptedRoute.ts +182 -206
  71. package/src/decorators/PlainBody.ts +75 -72
  72. package/src/decorators/SwaggerCustomizer.ts +115 -0
  73. package/src/decorators/TypedBody.ts +62 -59
  74. package/src/decorators/TypedException.ts +90 -89
  75. package/src/decorators/TypedFormData.ts +219 -0
  76. package/src/decorators/TypedHeaders.ts +69 -69
  77. package/src/decorators/TypedParam.ts +65 -65
  78. package/src/decorators/TypedQuery.ts +251 -246
  79. package/src/decorators/TypedRoute.ts +144 -144
  80. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  81. package/src/decorators/internal/NoTransformConfigureError.ts +8 -8
  82. package/src/decorators/internal/get_path_and_querify.ts +106 -103
  83. package/src/decorators/internal/get_path_and_stringify.ts +91 -91
  84. package/src/decorators/internal/get_text_body.ts +20 -20
  85. package/src/decorators/internal/headers_to_object.ts +13 -13
  86. package/src/decorators/internal/load_controller.ts +51 -51
  87. package/src/decorators/internal/route_error.ts +45 -45
  88. package/src/decorators/internal/validate_request_body.ts +72 -57
  89. package/src/decorators/internal/validate_request_form_data.ts +75 -0
  90. package/src/decorators/internal/validate_request_headers.ts +83 -68
  91. package/src/decorators/internal/validate_request_query.ts +71 -56
  92. package/src/index.ts +5 -5
  93. package/src/module.ts +16 -14
  94. package/src/options/INestiaTransformOptions.ts +17 -17
  95. package/src/options/INestiaTransformProject.ts +7 -7
  96. package/src/options/IRequestBodyValidator.ts +20 -20
  97. package/src/options/IRequestFormDataProps.ts +27 -0
  98. package/src/options/IRequestHeadersValidator.ts +22 -22
  99. package/src/options/IRequestQueryValidator.ts +20 -20
  100. package/src/options/IResponseBodyQuerifier.ts +25 -25
  101. package/src/options/IResponseBodyStringifier.ts +25 -25
  102. package/src/programmers/PlainBodyProgrammer.ts +52 -52
  103. package/src/programmers/TypedBodyProgrammer.ts +108 -108
  104. package/src/programmers/TypedExceptionProgrammer.ts +71 -72
  105. package/src/programmers/TypedFormDataBodyProgrammer.ts +108 -0
  106. package/src/programmers/TypedHeadersProgrammer.ts +56 -56
  107. package/src/programmers/TypedParamProgrammer.ts +24 -24
  108. package/src/programmers/TypedQueryBodyProgrammer.ts +56 -56
  109. package/src/programmers/TypedQueryProgrammer.ts +56 -56
  110. package/src/programmers/TypedQueryRouteProgrammer.ts +51 -51
  111. package/src/programmers/TypedRouteProgrammer.ts +51 -51
  112. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +58 -58
  113. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +62 -62
  114. package/src/programmers/http/HttpQuerifyProgrammer.ts +96 -96
  115. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +63 -63
  116. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  117. package/src/transform.ts +35 -35
  118. package/src/transformers/FileTransformer.ts +66 -66
  119. package/src/transformers/MethodTransformer.ts +94 -94
  120. package/src/transformers/NodeTransformer.ts +16 -16
  121. package/src/transformers/ParameterDecoratorTransformer.ts +120 -121
  122. package/src/transformers/ParameterTransformer.ts +48 -48
  123. package/src/transformers/TypedExceptionTransformer.ts +48 -49
  124. package/src/transformers/TypedRouteTransformer.ts +88 -95
  125. package/src/typings/Creator.ts +3 -3
  126. package/src/utils/ExceptionManager.ts +112 -112
  127. package/src/utils/Singleton.ts +20 -20
  128. package/src/utils/SourceFinder.ts +57 -57
  129. package/lib/decorators/internal/get_binary_body.js +0 -66
  130. package/lib/decorators/internal/get_binary_body.js.map +0 -1
  131. package/src/decorators/internal/get_binary_body.ts +0 -18
  132. /package/lib/decorators/internal/{get_binary_body.d.ts → validate_request_form_data.d.ts} +0 -0
@@ -1,68 +1,83 @@
1
- import { BadRequestException } from "@nestjs/common";
2
- import typia, { IValidation, TypeGuardError } from "typia";
3
-
4
- import { IRequestHeadersValidator } from "../../options/IRequestHeadersValidator";
5
- import { NoTransformConfigureError } from "./NoTransformConfigureError";
6
-
7
- export const validate_request_headers = <T>(
8
- validator?: IRequestHeadersValidator<T>,
9
- ) => {
10
- if (!validator) return () => NoTransformConfigureError("TypedHeaders");
11
- else if (validator.type === "assert") return assert(validator.assert);
12
- else if (validator.type === "is") return is(validator.is);
13
- else if (validator.type === "validate") return validate(validator.validate);
14
- return () =>
15
- new Error(`Error on nestia.core.TypedHeaders(): invalid typed validator.`);
16
- };
17
-
18
- const assert =
19
- <T>(closure: (input: Record<string, string | string[] | undefined>) => T) =>
20
- (
21
- input: Record<string, string | string[] | undefined>,
22
- ): T | BadRequestException => {
23
- try {
24
- return closure(input);
25
- } catch (exp) {
26
- if (typia.is<TypeGuardError>(exp)) {
27
- return new BadRequestException({
28
- path: exp.path,
29
- reason: exp.message,
30
- expected: exp.expected,
31
- value: exp.value,
32
- message: MESSAGE,
33
- });
34
- }
35
- throw exp;
36
- }
37
- };
38
-
39
- const is =
40
- <T>(
41
- closure: (input: Record<string, string | string[] | undefined>) => T | null,
42
- ) =>
43
- (
44
- input: Record<string, string | string[] | undefined>,
45
- ): T | BadRequestException => {
46
- const result: T | null = closure(input);
47
- return result !== null ? result : new BadRequestException(MESSAGE);
48
- };
49
-
50
- const validate =
51
- <T>(
52
- closure: (
53
- input: Record<string, string | string[] | undefined>,
54
- ) => IValidation<T>,
55
- ) =>
56
- (
57
- input: Record<string, string | string[] | undefined>,
58
- ): T | BadRequestException => {
59
- const result: IValidation<T> = closure(input);
60
- return result.success
61
- ? result.data
62
- : new BadRequestException({
63
- errors: result.errors,
64
- message: MESSAGE,
65
- });
66
- };
67
-
68
- 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 { NoTransformConfigureError } from "./NoTransformConfigureError";
6
+
7
+ /**
8
+ * @internal
9
+ */
10
+ export const validate_request_headers = <T>(
11
+ validator?: IRequestHeadersValidator<T>,
12
+ ) => {
13
+ if (!validator) return () => NoTransformConfigureError("TypedHeaders");
14
+ else if (validator.type === "assert") return assert(validator.assert);
15
+ else if (validator.type === "is") return is(validator.is);
16
+ else if (validator.type === "validate") return validate(validator.validate);
17
+ return () =>
18
+ new Error(`Error on nestia.core.TypedHeaders(): invalid typed validator.`);
19
+ };
20
+
21
+ /**
22
+ * @internal
23
+ */
24
+ const assert =
25
+ <T>(closure: (input: Record<string, string | string[] | undefined>) => T) =>
26
+ (
27
+ input: Record<string, string | string[] | undefined>,
28
+ ): T | BadRequestException => {
29
+ try {
30
+ return closure(input);
31
+ } catch (exp) {
32
+ if (typia.is<TypeGuardError>(exp)) {
33
+ return new BadRequestException({
34
+ path: exp.path,
35
+ reason: exp.message,
36
+ expected: exp.expected,
37
+ value: exp.value,
38
+ message: MESSAGE,
39
+ });
40
+ }
41
+ throw exp;
42
+ }
43
+ };
44
+
45
+ /**
46
+ * @internal
47
+ */
48
+ const is =
49
+ <T>(
50
+ closure: (input: Record<string, string | string[] | undefined>) => T | null,
51
+ ) =>
52
+ (
53
+ input: Record<string, string | string[] | undefined>,
54
+ ): T | BadRequestException => {
55
+ const result: T | null = closure(input);
56
+ return result !== null ? result : new BadRequestException(MESSAGE);
57
+ };
58
+
59
+ /**
60
+ * @internal
61
+ */
62
+ const validate =
63
+ <T>(
64
+ closure: (
65
+ input: Record<string, string | string[] | undefined>,
66
+ ) => IValidation<T>,
67
+ ) =>
68
+ (
69
+ input: Record<string, string | string[] | undefined>,
70
+ ): T | BadRequestException => {
71
+ const result: IValidation<T> = closure(input);
72
+ return result.success
73
+ ? result.data
74
+ : new BadRequestException({
75
+ errors: result.errors,
76
+ message: MESSAGE,
77
+ });
78
+ };
79
+
80
+ /**
81
+ * @internal
82
+ */
83
+ const MESSAGE = "Request headers data is not following the promised type.";
@@ -1,56 +1,71 @@
1
- import { BadRequestException } from "@nestjs/common";
2
- import typia, { IValidation, TypeGuardError } from "typia";
3
-
4
- import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
- import { NoTransformConfigureError } from "./NoTransformConfigureError";
6
-
7
- export const validate_request_query = <T>(
8
- validator?: IRequestQueryValidator<T>,
9
- ) => {
10
- if (!validator) return () => NoTransformConfigureError("TypedQuery");
11
- else if (validator.type === "assert") return assert(validator.assert);
12
- else if (validator.type === "is") return is(validator.is);
13
- else if (validator.type === "validate") return validate(validator.validate);
14
- return () =>
15
- new Error(`Error on nestia.core.TypedQuery(): invalid typed validator.`);
16
- };
17
-
18
- const assert =
19
- <T>(closure: (input: URLSearchParams) => T) =>
20
- (input: URLSearchParams): T | BadRequestException => {
21
- try {
22
- return closure(input);
23
- } catch (exp) {
24
- if (typia.is<TypeGuardError>(exp)) {
25
- return new BadRequestException({
26
- path: exp.path,
27
- reason: exp.message,
28
- expected: exp.expected,
29
- value: exp.value,
30
- message: MESSAGE,
31
- });
32
- }
33
- throw exp;
34
- }
35
- };
36
-
37
- const is =
38
- <T>(closure: (input: URLSearchParams) => T | null) =>
39
- (input: URLSearchParams): T | BadRequestException => {
40
- const result: T | null = closure(input);
41
- return result !== null ? result : new BadRequestException(MESSAGE);
42
- };
43
-
44
- const validate =
45
- <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
46
- (input: URLSearchParams): T | BadRequestException => {
47
- const result: IValidation<T> = closure(input);
48
- return result.success
49
- ? result.data
50
- : new BadRequestException({
51
- errors: result.errors,
52
- message: MESSAGE,
53
- });
54
- };
55
-
56
- const MESSAGE = "Request query data is not following the promised type.";
1
+ import { BadRequestException } from "@nestjs/common";
2
+ import typia, { IValidation, TypeGuardError } from "typia";
3
+
4
+ import { IRequestQueryValidator } from "../../options/IRequestQueryValidator";
5
+ import { NoTransformConfigureError } from "./NoTransformConfigureError";
6
+
7
+ /**
8
+ * @internal
9
+ */
10
+ export const validate_request_query = <T>(
11
+ validator?: IRequestQueryValidator<T>,
12
+ ) => {
13
+ if (!validator) return () => NoTransformConfigureError("TypedQuery");
14
+ else if (validator.type === "assert") return assert(validator.assert);
15
+ else if (validator.type === "is") return is(validator.is);
16
+ else if (validator.type === "validate") return validate(validator.validate);
17
+ return () =>
18
+ new Error(`Error on nestia.core.TypedQuery(): invalid typed validator.`);
19
+ };
20
+
21
+ /**
22
+ * @internal
23
+ */
24
+ const assert =
25
+ <T>(closure: (input: URLSearchParams) => T) =>
26
+ (input: URLSearchParams): T | BadRequestException => {
27
+ try {
28
+ return closure(input);
29
+ } catch (exp) {
30
+ if (typia.is<TypeGuardError>(exp)) {
31
+ return new BadRequestException({
32
+ path: exp.path,
33
+ reason: exp.message,
34
+ expected: exp.expected,
35
+ value: exp.value,
36
+ message: MESSAGE,
37
+ });
38
+ }
39
+ throw exp;
40
+ }
41
+ };
42
+
43
+ /**
44
+ * @internal
45
+ */
46
+ const is =
47
+ <T>(closure: (input: URLSearchParams) => T | null) =>
48
+ (input: URLSearchParams): T | BadRequestException => {
49
+ const result: T | null = closure(input);
50
+ return result !== null ? result : new BadRequestException(MESSAGE);
51
+ };
52
+
53
+ /**
54
+ * @internal
55
+ */
56
+ const validate =
57
+ <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
58
+ (input: URLSearchParams): T | BadRequestException => {
59
+ const result: IValidation<T> = closure(input);
60
+ return result.success
61
+ ? result.data
62
+ : new BadRequestException({
63
+ errors: result.errors,
64
+ message: MESSAGE,
65
+ });
66
+ };
67
+
68
+ /**
69
+ * @internal
70
+ */
71
+ const MESSAGE = "Request query data is not following the promised type.";
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,14 +1,16 @@
1
- export * from "./decorators/DynamicModule";
2
- export * from "./decorators/EncryptedBody";
3
- export * from "./decorators/EncryptedController";
4
- export * from "./decorators/EncryptedModule";
5
- export * from "./decorators/EncryptedRoute";
6
- export * from "./utils/ExceptionManager";
7
- export * from "./decorators/PlainBody";
8
- export * from "./decorators/TypedBody";
9
- export * from "./decorators/TypedException";
10
- export * from "./decorators/TypedHeaders";
11
- export * from "./decorators/TypedParam";
12
- export * from "./decorators/TypedRoute";
13
- export * from "./decorators/TypedQuery";
14
- export * from "./options/INestiaTransformOptions";
1
+ export * from "./decorators/DynamicModule";
2
+ export * from "./decorators/EncryptedBody";
3
+ export * from "./decorators/EncryptedController";
4
+ export * from "./decorators/EncryptedModule";
5
+ export * from "./decorators/EncryptedRoute";
6
+ export * from "./utils/ExceptionManager";
7
+ export * from "./decorators/PlainBody";
8
+ export * from "./decorators/SwaggerCustomizer";
9
+ export * from "./decorators/TypedBody";
10
+ export * from "./decorators/TypedException";
11
+ export * from "./decorators/TypedHeaders";
12
+ export * from "./decorators/TypedFormData";
13
+ export * from "./decorators/TypedParam";
14
+ export * from "./decorators/TypedRoute";
15
+ export * from "./decorators/TypedQuery";
16
+ export * from "./options/INestiaTransformOptions";
@@ -1,17 +1,17 @@
1
- export interface INestiaTransformOptions {
2
- validate?: // NORMAL
3
- | "assert"
4
- | "is"
5
- | "validate"
6
- // STRICT
7
- | "assertEquals"
8
- | "equals"
9
- | "validateEquals"
10
- // CLONE
11
- | "assertClone"
12
- | "validateClone"
13
- // PRUNE
14
- | "assertPrune"
15
- | "validatePrune";
16
- stringify?: "stringify" | "assert" | "is" | "validate" | null;
17
- }
1
+ export interface INestiaTransformOptions {
2
+ validate?: // NORMAL
3
+ | "assert"
4
+ | "is"
5
+ | "validate"
6
+ // STRICT
7
+ | "assertEquals"
8
+ | "equals"
9
+ | "validateEquals"
10
+ // CLONE
11
+ | "assertClone"
12
+ | "validateClone"
13
+ // PRUNE
14
+ | "assertPrune"
15
+ | "validatePrune";
16
+ stringify?: "stringify" | "assert" | "is" | "validate" | null;
17
+ }
@@ -1,7 +1,7 @@
1
- import { IProject } from "typia/lib/transformers/IProject";
2
-
3
- import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
-
5
- export interface INestiaTransformProject extends Omit<IProject, "options"> {
6
- options: INestiaTransformOptions;
7
- }
1
+ import { IProject } from "typia/lib/transformers/IProject";
2
+
3
+ import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
+
5
+ export interface INestiaTransformProject extends Omit<IProject, "options"> {
6
+ options: INestiaTransformOptions;
7
+ }
@@ -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
+ }
@@ -0,0 +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,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
+ }
@@ -1,25 +1,25 @@
1
- import { IValidation } from "typia";
2
-
3
- export type IResponseBodyStringifier<T> =
4
- | IResponseBodyStringifier.IStringify<T>
5
- | IResponseBodyStringifier.IIs<T>
6
- | IResponseBodyStringifier.IAssert<T>
7
- | IResponseBodyStringifier.IValidate<T>;
8
- export namespace IResponseBodyStringifier {
9
- export interface IStringify<T> {
10
- type: "stringify";
11
- stringify: (input: T) => string;
12
- }
13
- export interface IIs<T> {
14
- type: "is";
15
- is: (input: T) => string | null;
16
- }
17
- export interface IAssert<T> {
18
- type: "assert";
19
- assert: (input: T) => string;
20
- }
21
- export interface IValidate<T> {
22
- type: "validate";
23
- validate: (input: T) => IValidation<string>;
24
- }
25
- }
1
+ import { IValidation } from "typia";
2
+
3
+ export type IResponseBodyStringifier<T> =
4
+ | IResponseBodyStringifier.IStringify<T>
5
+ | IResponseBodyStringifier.IIs<T>
6
+ | IResponseBodyStringifier.IAssert<T>
7
+ | IResponseBodyStringifier.IValidate<T>;
8
+ export namespace IResponseBodyStringifier {
9
+ export interface IStringify<T> {
10
+ type: "stringify";
11
+ stringify: (input: T) => string;
12
+ }
13
+ export interface IIs<T> {
14
+ type: "is";
15
+ is: (input: T) => string | null;
16
+ }
17
+ export interface IAssert<T> {
18
+ type: "assert";
19
+ assert: (input: T) => string;
20
+ }
21
+ export interface IValidate<T> {
22
+ type: "validate";
23
+ validate: (input: T) => IValidation<string>;
24
+ }
25
+ }