@nestia/core 4.6.2 → 5.0.0-dev.20250301

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 (77) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +91 -92
  3. package/lib/programmers/TypedBodyProgrammer.js +4 -4
  4. package/lib/programmers/TypedBodyProgrammer.js.map +1 -1
  5. package/package.json +7 -7
  6. package/src/adaptors/WebSocketAdaptor.ts +429 -429
  7. package/src/decorators/DynamicModule.ts +43 -43
  8. package/src/decorators/EncryptedBody.ts +101 -101
  9. package/src/decorators/EncryptedController.ts +38 -38
  10. package/src/decorators/EncryptedModule.ts +100 -100
  11. package/src/decorators/EncryptedRoute.ts +219 -219
  12. package/src/decorators/HumanRoute.ts +22 -22
  13. package/src/decorators/NoTransformConfigurationError.ts +32 -32
  14. package/src/decorators/PlainBody.ts +79 -79
  15. package/src/decorators/SwaggerCustomizer.ts +115 -115
  16. package/src/decorators/SwaggerExample.ts +100 -100
  17. package/src/decorators/TypedBody.ts +59 -59
  18. package/src/decorators/TypedException.ts +166 -166
  19. package/src/decorators/TypedFormData.ts +195 -195
  20. package/src/decorators/TypedHeaders.ts +64 -64
  21. package/src/decorators/TypedParam.ts +77 -77
  22. package/src/decorators/TypedQuery.ts +245 -245
  23. package/src/decorators/TypedRoute.ts +214 -214
  24. package/src/decorators/WebSocketRoute.ts +242 -242
  25. package/src/decorators/internal/EncryptedConstant.ts +4 -4
  26. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  27. package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
  28. package/src/decorators/internal/get_path_and_querify.ts +108 -108
  29. package/src/decorators/internal/get_path_and_stringify.ts +122 -122
  30. package/src/decorators/internal/get_text_body.ts +20 -20
  31. package/src/decorators/internal/headers_to_object.ts +13 -13
  32. package/src/decorators/internal/is_request_body_undefined.ts +14 -14
  33. package/src/decorators/internal/load_controller.ts +49 -49
  34. package/src/decorators/internal/route_error.ts +45 -45
  35. package/src/decorators/internal/validate_request_body.ts +74 -74
  36. package/src/decorators/internal/validate_request_form_data.ts +77 -77
  37. package/src/decorators/internal/validate_request_headers.ts +86 -86
  38. package/src/decorators/internal/validate_request_query.ts +74 -74
  39. package/src/index.ts +5 -5
  40. package/src/module.ts +22 -22
  41. package/src/options/INestiaTransformOptions.ts +38 -38
  42. package/src/options/INestiaTransformProject.ts +8 -8
  43. package/src/options/IRequestBodyValidator.ts +20 -20
  44. package/src/options/IRequestFormDataProps.ts +27 -27
  45. package/src/options/IRequestHeadersValidator.ts +22 -22
  46. package/src/options/IRequestQueryValidator.ts +20 -20
  47. package/src/options/IResponseBodyQuerifier.ts +25 -25
  48. package/src/options/IResponseBodyStringifier.ts +30 -30
  49. package/src/programmers/PlainBodyProgrammer.ts +70 -70
  50. package/src/programmers/TypedBodyProgrammer.ts +142 -142
  51. package/src/programmers/TypedFormDataBodyProgrammer.ts +118 -118
  52. package/src/programmers/TypedHeadersProgrammer.ts +63 -63
  53. package/src/programmers/TypedParamProgrammer.ts +33 -33
  54. package/src/programmers/TypedQueryBodyProgrammer.ts +112 -112
  55. package/src/programmers/TypedQueryProgrammer.ts +114 -114
  56. package/src/programmers/TypedQueryRouteProgrammer.ts +105 -105
  57. package/src/programmers/TypedRouteProgrammer.ts +94 -94
  58. package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +72 -72
  59. package/src/programmers/http/HttpIsQuerifyProgrammer.ts +75 -75
  60. package/src/programmers/http/HttpQuerifyProgrammer.ts +108 -108
  61. package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +76 -76
  62. package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
  63. package/src/transform.ts +35 -35
  64. package/src/transformers/FileTransformer.ts +110 -110
  65. package/src/transformers/MethodTransformer.ts +103 -103
  66. package/src/transformers/NodeTransformer.ts +23 -23
  67. package/src/transformers/ParameterDecoratorTransformer.ts +143 -143
  68. package/src/transformers/ParameterTransformer.ts +57 -57
  69. package/src/transformers/TypedRouteTransformer.ts +85 -85
  70. package/src/transformers/WebSocketRouteTransformer.ts +120 -120
  71. package/src/typings/Creator.ts +3 -3
  72. package/src/typings/get-function-location.d.ts +7 -7
  73. package/src/utils/ArrayUtil.ts +7 -7
  74. package/src/utils/ExceptionManager.ts +112 -112
  75. package/src/utils/Singleton.ts +20 -20
  76. package/src/utils/SourceFinder.ts +57 -57
  77. package/src/utils/VersioningStrategy.ts +27 -27
@@ -1,74 +1,74 @@
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
- /**
8
- * @internal
9
- */
10
- export const validate_request_query =
11
- (method: string) =>
12
- <T>(validator?: IRequestQueryValidator<T>) => {
13
- if (!validator) {
14
- NoTransformConfigurationError(method);
15
- return (input: URLSearchParams) =>
16
- Object.fromEntries(input.entries()) as T;
17
- } else if (validator.type === "assert") return assert(validator.assert);
18
- else if (validator.type === "is") return is(validator.is);
19
- else if (validator.type === "validate") return validate(validator.validate);
20
- return () =>
21
- new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
22
- };
23
-
24
- /**
25
- * @internal
26
- */
27
- const assert =
28
- <T>(closure: (input: URLSearchParams) => T) =>
29
- (input: URLSearchParams): T | BadRequestException => {
30
- try {
31
- return closure(input);
32
- } catch (exp) {
33
- if (typia.is<TypeGuardError>(exp)) {
34
- return new BadRequestException({
35
- path: exp.path,
36
- reason: exp.message,
37
- expected: exp.expected,
38
- value: exp.value,
39
- message: MESSAGE,
40
- });
41
- }
42
- throw exp;
43
- }
44
- };
45
-
46
- /**
47
- * @internal
48
- */
49
- const is =
50
- <T>(closure: (input: URLSearchParams) => T | null) =>
51
- (input: URLSearchParams): T | BadRequestException => {
52
- const result: T | null = closure(input);
53
- return result !== null ? result : new BadRequestException(MESSAGE);
54
- };
55
-
56
- /**
57
- * @internal
58
- */
59
- const validate =
60
- <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
- (input: URLSearchParams): T | BadRequestException => {
62
- const result: IValidation<T> = closure(input);
63
- return result.success
64
- ? result.data
65
- : new BadRequestException({
66
- errors: result.errors,
67
- message: MESSAGE,
68
- });
69
- };
70
-
71
- /**
72
- * @internal
73
- */
74
- 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 { NoTransformConfigurationError } from "../NoTransformConfigurationError";
6
+
7
+ /**
8
+ * @internal
9
+ */
10
+ export const validate_request_query =
11
+ (method: string) =>
12
+ <T>(validator?: IRequestQueryValidator<T>) => {
13
+ if (!validator) {
14
+ NoTransformConfigurationError(method);
15
+ return (input: URLSearchParams) =>
16
+ Object.fromEntries(input.entries()) as T;
17
+ } else if (validator.type === "assert") return assert(validator.assert);
18
+ else if (validator.type === "is") return is(validator.is);
19
+ else if (validator.type === "validate") return validate(validator.validate);
20
+ return () =>
21
+ new Error(`Error on nestia.core.${method}(): invalid typed validator.`);
22
+ };
23
+
24
+ /**
25
+ * @internal
26
+ */
27
+ const assert =
28
+ <T>(closure: (input: URLSearchParams) => T) =>
29
+ (input: URLSearchParams): T | BadRequestException => {
30
+ try {
31
+ return closure(input);
32
+ } catch (exp) {
33
+ if (typia.is<TypeGuardError>(exp)) {
34
+ return new BadRequestException({
35
+ path: exp.path,
36
+ reason: exp.message,
37
+ expected: exp.expected,
38
+ value: exp.value,
39
+ message: MESSAGE,
40
+ });
41
+ }
42
+ throw exp;
43
+ }
44
+ };
45
+
46
+ /**
47
+ * @internal
48
+ */
49
+ const is =
50
+ <T>(closure: (input: URLSearchParams) => T | null) =>
51
+ (input: URLSearchParams): T | BadRequestException => {
52
+ const result: T | null = closure(input);
53
+ return result !== null ? result : new BadRequestException(MESSAGE);
54
+ };
55
+
56
+ /**
57
+ * @internal
58
+ */
59
+ const validate =
60
+ <T>(closure: (input: URLSearchParams) => IValidation<T>) =>
61
+ (input: URLSearchParams): T | BadRequestException => {
62
+ const result: IValidation<T> = closure(input);
63
+ return result.success
64
+ ? result.data
65
+ : new BadRequestException({
66
+ errors: result.errors,
67
+ message: MESSAGE,
68
+ });
69
+ };
70
+
71
+ /**
72
+ * @internal
73
+ */
74
+ 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,22 +1,22 @@
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";
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";
@@ -1,38 +1,38 @@
1
- import { ILlmSchema } from "@samchon/openapi";
2
-
3
- export interface INestiaTransformOptions {
4
- validate?: INestiaTransformOptions.Validate;
5
- stringify?: INestiaTransformOptions.Stringify | null;
6
- llm?: INestiaTransformOptions.ILlm<"chatgpt" | "gemini" | "3.0">;
7
- throws?: boolean;
8
- }
9
- export namespace INestiaTransformOptions {
10
- export type Validate =
11
- // NORMAL
12
- | "assert"
13
- | "is"
14
- | "validate"
15
- // STRICT
16
- | "assertEquals"
17
- | "equals"
18
- | "validateEquals"
19
- // CLONE
20
- | "assertClone"
21
- | "validateClone"
22
- // PRUNE
23
- | "assertPrune"
24
- | "validatePrune";
25
-
26
- export type Stringify =
27
- | "stringify"
28
- | "assert"
29
- | "is"
30
- | "validate"
31
- | "validate.log";
32
-
33
- export interface ILlm<Model extends ILlmSchema.Model> {
34
- model: Model;
35
- strict?: Model extends "chatgpt" ? boolean : never;
36
- recursive?: Model extends "gemini" | "3.0" ? false | number : never;
37
- }
38
- }
1
+ import { ILlmSchema } from "@samchon/openapi";
2
+
3
+ export interface INestiaTransformOptions {
4
+ validate?: INestiaTransformOptions.Validate;
5
+ stringify?: INestiaTransformOptions.Stringify | null;
6
+ llm?: INestiaTransformOptions.ILlm<"chatgpt" | "gemini" | "3.0">;
7
+ throws?: boolean;
8
+ }
9
+ export namespace INestiaTransformOptions {
10
+ export type Validate =
11
+ // NORMAL
12
+ | "assert"
13
+ | "is"
14
+ | "validate"
15
+ // STRICT
16
+ | "assertEquals"
17
+ | "equals"
18
+ | "validateEquals"
19
+ // CLONE
20
+ | "assertClone"
21
+ | "validateClone"
22
+ // PRUNE
23
+ | "assertPrune"
24
+ | "validatePrune";
25
+
26
+ export type Stringify =
27
+ | "stringify"
28
+ | "assert"
29
+ | "is"
30
+ | "validate"
31
+ | "validate.log";
32
+
33
+ export interface ILlm<Model extends ILlmSchema.Model> {
34
+ model: Model;
35
+ strict?: Model extends "chatgpt" ? boolean : never;
36
+ recursive?: Model extends "gemini" | "3.0" ? false | number : never;
37
+ }
38
+ }
@@ -1,8 +1,8 @@
1
- import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
2
-
3
- import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
-
5
- export interface INestiaTransformContext
6
- extends Omit<ITypiaContext, "options"> {
7
- options: INestiaTransformOptions;
8
- }
1
+ import { ITypiaContext } from "typia/lib/transformers/ITypiaContext";
2
+
3
+ import { INestiaTransformOptions } from "./INestiaTransformOptions";
4
+
5
+ export interface INestiaTransformContext
6
+ extends Omit<ITypiaContext, "options"> {
7
+ options: INestiaTransformOptions;
8
+ }
@@ -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
+ }
@@ -1,30 +1,30 @@
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
- | IResponseBodyStringifier.IValidateLog<T>;
9
- export namespace IResponseBodyStringifier {
10
- export interface IStringify<T> {
11
- type: "stringify";
12
- stringify: (input: T) => string;
13
- }
14
- export interface IIs<T> {
15
- type: "is";
16
- is: (input: T) => string | null;
17
- }
18
- export interface IAssert<T> {
19
- type: "assert";
20
- assert: (input: T) => string;
21
- }
22
- export interface IValidate<T> {
23
- type: "validate";
24
- validate: (input: T) => IValidation<string>;
25
- }
26
- export interface IValidateLog<T> {
27
- type: "validate.log";
28
- validate: (input: T) => IValidation<string>;
29
- }
30
- }
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
+ | IResponseBodyStringifier.IValidateLog<T>;
9
+ export namespace IResponseBodyStringifier {
10
+ export interface IStringify<T> {
11
+ type: "stringify";
12
+ stringify: (input: T) => string;
13
+ }
14
+ export interface IIs<T> {
15
+ type: "is";
16
+ is: (input: T) => string | null;
17
+ }
18
+ export interface IAssert<T> {
19
+ type: "assert";
20
+ assert: (input: T) => string;
21
+ }
22
+ export interface IValidate<T> {
23
+ type: "validate";
24
+ validate: (input: T) => IValidation<string>;
25
+ }
26
+ export interface IValidateLog<T> {
27
+ type: "validate.log";
28
+ validate: (input: T) => IValidation<string>;
29
+ }
30
+ }