@nestia/core 10.0.2 → 11.0.0-dev.20260305
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.
- package/LICENSE +21 -21
- package/README.md +93 -93
- package/lib/adaptors/WebSocketAdaptor.js.map +1 -1
- package/lib/decorators/DynamicModule.js +54 -10
- package/lib/decorators/DynamicModule.js.map +1 -1
- package/lib/decorators/EncryptedBody.js +2 -2
- package/lib/decorators/EncryptedBody.js.map +1 -1
- package/lib/decorators/EncryptedController.d.ts +1 -1
- package/lib/decorators/EncryptedModule.d.ts +1 -1
- package/lib/decorators/EncryptedModule.js +54 -10
- package/lib/decorators/EncryptedModule.js.map +1 -1
- package/lib/decorators/EncryptedRoute.js +2 -2
- package/lib/decorators/EncryptedRoute.js.map +1 -1
- package/lib/decorators/HumanRoute.d.ts +1 -2
- package/lib/decorators/HumanRoute.js +1 -2
- package/lib/decorators/HumanRoute.js.map +1 -1
- package/lib/decorators/NoTransformConfigurationError.js +1 -1
- package/lib/decorators/NoTransformConfigurationError.js.map +1 -1
- package/lib/decorators/SwaggerCustomizer.d.ts +1 -1
- package/lib/decorators/TypedFormData.js.map +1 -1
- package/lib/decorators/TypedParam.js +1 -1
- package/lib/decorators/TypedParam.js.map +1 -1
- package/lib/decorators/internal/get_path_and_querify.js +1 -1
- package/lib/decorators/internal/get_path_and_querify.js.map +1 -1
- package/lib/decorators/internal/get_path_and_stringify.js +1 -1
- package/lib/decorators/internal/get_path_and_stringify.js.map +1 -1
- package/lib/decorators/internal/headers_to_object.js.map +1 -1
- package/lib/decorators/internal/validate_request_body.js +1 -1
- package/lib/decorators/internal/validate_request_body.js.map +1 -1
- package/lib/decorators/internal/validate_request_form_data.js +1 -1
- package/lib/decorators/internal/validate_request_form_data.js.map +1 -1
- package/lib/decorators/internal/validate_request_headers.js +1 -1
- package/lib/decorators/internal/validate_request_headers.js.map +1 -1
- package/lib/decorators/internal/validate_request_query.js +1 -1
- package/lib/decorators/internal/validate_request_query.js.map +1 -1
- package/lib/module.d.ts +1 -0
- package/lib/module.js +1 -0
- package/lib/module.js.map +1 -1
- package/lib/options/INestiaTransformProject.d.ts +1 -1
- package/lib/programmers/PlainBodyProgrammer.js +5 -8
- package/lib/programmers/PlainBodyProgrammer.js.map +1 -1
- package/lib/programmers/TypedBodyProgrammer.js +13 -21
- package/lib/programmers/TypedBodyProgrammer.js.map +1 -1
- package/lib/programmers/TypedFormDataBodyProgrammer.js +11 -20
- package/lib/programmers/TypedFormDataBodyProgrammer.js.map +1 -1
- package/lib/programmers/TypedHeadersProgrammer.js +4 -6
- package/lib/programmers/TypedHeadersProgrammer.js.map +1 -1
- package/lib/programmers/TypedParamProgrammer.js +2 -2
- package/lib/programmers/TypedParamProgrammer.js.map +1 -1
- package/lib/programmers/TypedQueryBodyProgrammer.js +9 -16
- package/lib/programmers/TypedQueryBodyProgrammer.js.map +1 -1
- package/lib/programmers/TypedQueryProgrammer.js +9 -16
- package/lib/programmers/TypedQueryProgrammer.js.map +1 -1
- package/lib/programmers/TypedQueryRouteProgrammer.js +6 -10
- package/lib/programmers/TypedQueryRouteProgrammer.js.map +1 -1
- package/lib/programmers/TypedRouteProgrammer.js +8 -13
- package/lib/programmers/TypedRouteProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpAssertQuerifyProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertQuerifyProgrammer.js +5 -7
- package/lib/programmers/http/HttpAssertQuerifyProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpIsQuerifyProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpIsQuerifyProgrammer.js +5 -7
- package/lib/programmers/http/HttpIsQuerifyProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpQuerifyProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpQuerifyProgrammer.js +13 -19
- package/lib/programmers/http/HttpQuerifyProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpValidateQuerifyProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpValidateQuerifyProgrammer.js +6 -8
- package/lib/programmers/http/HttpValidateQuerifyProgrammer.js.map +1 -1
- package/lib/programmers/internal/CoreMetadataUtil.d.ts +3 -3
- package/lib/programmers/internal/CoreMetadataUtil.js.map +1 -1
- package/lib/transform.d.ts +1 -1
- package/lib/transform.js.map +1 -1
- package/lib/transformers/FileTransformer.js +2 -2
- package/lib/transformers/FileTransformer.js.map +1 -1
- package/lib/transformers/MethodTransformer.js.map +1 -1
- package/lib/transformers/ParameterDecoratorTransformer.js +1 -1
- package/lib/transformers/ParameterDecoratorTransformer.js.map +1 -1
- package/lib/transformers/TypedRouteTransformer.js +1 -1
- package/lib/transformers/TypedRouteTransformer.js.map +1 -1
- package/lib/transformers/WebSocketRouteTransformer.js +1 -1
- package/lib/transformers/WebSocketRouteTransformer.js.map +1 -1
- package/package.json +34 -26
- package/src/adaptors/WebSocketAdaptor.ts +429 -429
- package/src/decorators/DynamicModule.ts +44 -44
- package/src/decorators/EncryptedBody.ts +96 -97
- package/src/decorators/EncryptedController.ts +40 -40
- package/src/decorators/EncryptedModule.ts +98 -98
- package/src/decorators/EncryptedRoute.ts +212 -213
- package/src/decorators/HumanRoute.ts +21 -22
- package/src/decorators/NoTransformConfigurationError.ts +34 -34
- package/src/decorators/PlainBody.ts +76 -76
- package/src/decorators/SwaggerCustomizer.ts +97 -97
- package/src/decorators/SwaggerExample.ts +100 -100
- package/src/decorators/TypedBody.ts +57 -57
- package/src/decorators/TypedException.ts +147 -147
- package/src/decorators/TypedFormData.ts +187 -195
- package/src/decorators/TypedHeaders.ts +66 -66
- package/src/decorators/TypedParam.ts +77 -77
- package/src/decorators/TypedQuery.ts +234 -234
- package/src/decorators/TypedRoute.ts +196 -196
- package/src/decorators/WebSocketRoute.ts +242 -242
- package/src/decorators/internal/EncryptedConstant.ts +2 -2
- package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
- package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
- package/src/decorators/internal/get_path_and_querify.ts +94 -94
- package/src/decorators/internal/get_path_and_stringify.ts +110 -110
- package/src/decorators/internal/get_text_body.ts +16 -16
- package/src/decorators/internal/headers_to_object.ts +11 -11
- package/src/decorators/internal/is_request_body_undefined.ts +12 -12
- package/src/decorators/internal/load_controller.ts +45 -45
- package/src/decorators/internal/route_error.ts +43 -43
- package/src/decorators/internal/validate_request_body.ts +64 -64
- package/src/decorators/internal/validate_request_form_data.ts +67 -67
- package/src/decorators/internal/validate_request_headers.ts +76 -76
- package/src/decorators/internal/validate_request_query.ts +64 -64
- package/src/index.ts +5 -5
- package/src/module.ts +23 -22
- package/src/options/INestiaTransformOptions.ts +34 -34
- package/src/options/INestiaTransformProject.ts +10 -8
- package/src/options/IRequestBodyValidator.ts +20 -20
- package/src/options/IRequestFormDataProps.ts +27 -27
- package/src/options/IRequestHeadersValidator.ts +22 -22
- package/src/options/IRequestQueryValidator.ts +20 -20
- package/src/options/IResponseBodyQuerifier.ts +25 -25
- package/src/options/IResponseBodyStringifier.ts +30 -30
- package/src/programmers/PlainBodyProgrammer.ts +72 -70
- package/src/programmers/TypedBodyProgrammer.ts +144 -142
- package/src/programmers/TypedFormDataBodyProgrammer.ts +118 -118
- package/src/programmers/TypedHeadersProgrammer.ts +65 -63
- package/src/programmers/TypedParamProgrammer.ts +33 -33
- package/src/programmers/TypedQueryBodyProgrammer.ts +111 -109
- package/src/programmers/TypedQueryProgrammer.ts +113 -111
- package/src/programmers/TypedQueryRouteProgrammer.ts +104 -102
- package/src/programmers/TypedRouteProgrammer.ts +96 -94
- package/src/programmers/http/HttpAssertQuerifyProgrammer.ts +74 -72
- package/src/programmers/http/HttpIsQuerifyProgrammer.ts +77 -75
- package/src/programmers/http/HttpQuerifyProgrammer.ts +110 -108
- package/src/programmers/http/HttpValidateQuerifyProgrammer.ts +78 -76
- package/src/programmers/internal/CoreMetadataUtil.ts +21 -21
- package/src/transform.ts +35 -35
- package/src/transformers/FileTransformer.ts +109 -110
- package/src/transformers/MethodTransformer.ts +103 -103
- package/src/transformers/NodeTransformer.ts +23 -23
- package/src/transformers/ParameterDecoratorTransformer.ts +143 -143
- package/src/transformers/ParameterTransformer.ts +57 -57
- package/src/transformers/TypedRouteTransformer.ts +85 -85
- package/src/transformers/WebSocketRouteTransformer.ts +120 -120
- package/src/typings/Creator.ts +3 -3
- package/src/typings/get-function-location.d.ts +7 -7
- package/src/utils/ArrayUtil.ts +7 -7
- package/src/utils/ExceptionManager.ts +115 -115
- package/src/utils/Singleton.ts +16 -16
- package/src/utils/SourceFinder.ts +54 -54
- package/src/utils/VersioningStrategy.ts +27 -27
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* > You must configure the generic argument `T`
|
|
3
|
-
*
|
|
4
|
-
* Exception decorator.
|
|
5
|
-
*
|
|
6
|
-
* `TypedException` is a decorator function describing HTTP exception and its
|
|
7
|
-
* type which could be occurred in the method.
|
|
8
|
-
*
|
|
9
|
-
* For reference, this decorator function does not affect to the method's
|
|
10
|
-
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
11
|
-
* not affect to the SDK library generation yet, but will be used in the
|
|
12
|
-
* future.
|
|
13
|
-
*
|
|
14
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
-
* @param props Properties for the exception
|
|
16
|
-
* @returns Method decorator
|
|
17
|
-
*/
|
|
18
|
-
export function TypedException(props: TypedException.IProps<unknown>): never;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* > You must configure the generic argument `T`
|
|
22
|
-
*
|
|
23
|
-
* Exception decorator.
|
|
24
|
-
*
|
|
25
|
-
* `TypedException` is a decorator function describing HTTP exception and its
|
|
26
|
-
* type which could be occurred in the method.
|
|
27
|
-
*
|
|
28
|
-
* For reference, this decorator function does not affect to the method's
|
|
29
|
-
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
30
|
-
* not affect to the SDK library generation yet, but will be used in the
|
|
31
|
-
* future.
|
|
32
|
-
*
|
|
33
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
34
|
-
* @deprecated Use {@link TypedException.IProps} typed function instead. This
|
|
35
|
-
* typed function is deprecated and will be removed in the next major update.
|
|
36
|
-
* @param status Status number or pattern like "2XX", "3XX", "4XX", "5XX"
|
|
37
|
-
* @param description Description about the exception
|
|
38
|
-
* @returns Method decorator
|
|
39
|
-
*/
|
|
40
|
-
export function TypedException(
|
|
41
|
-
status: number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
42
|
-
description?: string | undefined,
|
|
43
|
-
): never;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Exception decorator.
|
|
47
|
-
*
|
|
48
|
-
* `TypedException` is a decorator function describing HTTP exception and its
|
|
49
|
-
* type which could be occurred in the method.
|
|
50
|
-
*
|
|
51
|
-
* For reference, this decorator function does not affect to the method's
|
|
52
|
-
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
53
|
-
* not affect to the SDK library generation yet, but will be used in the
|
|
54
|
-
* future.
|
|
55
|
-
*
|
|
56
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
57
|
-
* @template T Type of the exception
|
|
58
|
-
* @param props Properties for the exception
|
|
59
|
-
* @returns Method decorator
|
|
60
|
-
*/
|
|
61
|
-
export function TypedException<T>(
|
|
62
|
-
props: TypedException.IProps<T>,
|
|
63
|
-
): MethodDecorator;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Exception decorator.
|
|
67
|
-
*
|
|
68
|
-
* `TypedException` is a decorator function describing HTTP exception and its
|
|
69
|
-
* type which could be occurred in the method.
|
|
70
|
-
*
|
|
71
|
-
* For reference, this decorator function does not affect to the method's
|
|
72
|
-
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
73
|
-
* not affect to the SDK library generation yet, but will be used in the
|
|
74
|
-
* future.
|
|
75
|
-
*
|
|
76
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
77
|
-
* @deprecated Use {@link TypedException.IProps} typed function instead. This
|
|
78
|
-
* typed function is deprecated and will be removed in the next major update.
|
|
79
|
-
* @template T Type of the exception
|
|
80
|
-
* @param status Status number or pattern like "2XX", "3XX", "4XX", "5XX"
|
|
81
|
-
* @param description Description about the exception
|
|
82
|
-
* @returns Method decorator
|
|
83
|
-
*/
|
|
84
|
-
export function TypedException<T>(
|
|
85
|
-
status: number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
86
|
-
description?: string | undefined,
|
|
87
|
-
): MethodDecorator;
|
|
88
|
-
|
|
89
|
-
/** @internal */
|
|
90
|
-
export function TypedException<T>(...args: any[]): MethodDecorator {
|
|
91
|
-
const props: TypedException.IProps<T> =
|
|
92
|
-
typeof args[0] === "object"
|
|
93
|
-
? args[0]
|
|
94
|
-
: { status: args[0], description: args[1] };
|
|
95
|
-
return function TypedException(
|
|
96
|
-
target: Object | T,
|
|
97
|
-
propertyKey: string | symbol,
|
|
98
|
-
descriptor: TypedPropertyDescriptor<any>,
|
|
99
|
-
) {
|
|
100
|
-
const array: TypedException.IProps<any>[] = (() => {
|
|
101
|
-
const oldbie: TypedException.IProps<any>[] | undefined =
|
|
102
|
-
Reflect.getMetadata(
|
|
103
|
-
"nestia/TypedException",
|
|
104
|
-
(target as any)[propertyKey],
|
|
105
|
-
);
|
|
106
|
-
if (oldbie !== undefined) return oldbie;
|
|
107
|
-
|
|
108
|
-
const newbie: TypedException.IProps<any>[] = [];
|
|
109
|
-
Reflect.defineMetadata(
|
|
110
|
-
"nestia/TypedException",
|
|
111
|
-
newbie,
|
|
112
|
-
(target as any)[propertyKey],
|
|
113
|
-
);
|
|
114
|
-
return newbie;
|
|
115
|
-
})();
|
|
116
|
-
array.push(props);
|
|
117
|
-
return descriptor;
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
export namespace TypedException {
|
|
121
|
-
/** Properties for the exception. */
|
|
122
|
-
export interface IProps<T> {
|
|
123
|
-
/** Status number or pattern like "2XX", "3XX", "4XX", "5XX". */
|
|
124
|
-
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
125
|
-
|
|
126
|
-
/** Description about the exception. */
|
|
127
|
-
description?: string | undefined;
|
|
128
|
-
|
|
129
|
-
/** Example value. */
|
|
130
|
-
example?: T | undefined;
|
|
131
|
-
|
|
132
|
-
/** Collection of examples for the exception. */
|
|
133
|
-
examples?: Record<string, IExample<T>> | undefined;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/** Metadata collected in the {@link IProps.examples}. */
|
|
137
|
-
export interface IExample<T> {
|
|
138
|
-
/** Summary of the example. */
|
|
139
|
-
summary?: string | undefined;
|
|
140
|
-
|
|
141
|
-
/** Description of the example. */
|
|
142
|
-
description?: string | undefined;
|
|
143
|
-
|
|
144
|
-
/** Value of the example. */
|
|
145
|
-
value: T;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* > You must configure the generic argument `T`
|
|
3
|
+
*
|
|
4
|
+
* Exception decorator.
|
|
5
|
+
*
|
|
6
|
+
* `TypedException` is a decorator function describing HTTP exception and its
|
|
7
|
+
* type which could be occurred in the method.
|
|
8
|
+
*
|
|
9
|
+
* For reference, this decorator function does not affect to the method's
|
|
10
|
+
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
11
|
+
* not affect to the SDK library generation yet, but will be used in the
|
|
12
|
+
* future.
|
|
13
|
+
*
|
|
14
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
+
* @param props Properties for the exception
|
|
16
|
+
* @returns Method decorator
|
|
17
|
+
*/
|
|
18
|
+
export function TypedException(props: TypedException.IProps<unknown>): never;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* > You must configure the generic argument `T`
|
|
22
|
+
*
|
|
23
|
+
* Exception decorator.
|
|
24
|
+
*
|
|
25
|
+
* `TypedException` is a decorator function describing HTTP exception and its
|
|
26
|
+
* type which could be occurred in the method.
|
|
27
|
+
*
|
|
28
|
+
* For reference, this decorator function does not affect to the method's
|
|
29
|
+
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
30
|
+
* not affect to the SDK library generation yet, but will be used in the
|
|
31
|
+
* future.
|
|
32
|
+
*
|
|
33
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
34
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead. This
|
|
35
|
+
* typed function is deprecated and will be removed in the next major update.
|
|
36
|
+
* @param status Status number or pattern like "2XX", "3XX", "4XX", "5XX"
|
|
37
|
+
* @param description Description about the exception
|
|
38
|
+
* @returns Method decorator
|
|
39
|
+
*/
|
|
40
|
+
export function TypedException(
|
|
41
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
42
|
+
description?: string | undefined,
|
|
43
|
+
): never;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Exception decorator.
|
|
47
|
+
*
|
|
48
|
+
* `TypedException` is a decorator function describing HTTP exception and its
|
|
49
|
+
* type which could be occurred in the method.
|
|
50
|
+
*
|
|
51
|
+
* For reference, this decorator function does not affect to the method's
|
|
52
|
+
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
53
|
+
* not affect to the SDK library generation yet, but will be used in the
|
|
54
|
+
* future.
|
|
55
|
+
*
|
|
56
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
57
|
+
* @template T Type of the exception
|
|
58
|
+
* @param props Properties for the exception
|
|
59
|
+
* @returns Method decorator
|
|
60
|
+
*/
|
|
61
|
+
export function TypedException<T>(
|
|
62
|
+
props: TypedException.IProps<T>,
|
|
63
|
+
): MethodDecorator;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Exception decorator.
|
|
67
|
+
*
|
|
68
|
+
* `TypedException` is a decorator function describing HTTP exception and its
|
|
69
|
+
* type which could be occurred in the method.
|
|
70
|
+
*
|
|
71
|
+
* For reference, this decorator function does not affect to the method's
|
|
72
|
+
* behavior, but only affects to the swagger documents generation. Also, it does
|
|
73
|
+
* not affect to the SDK library generation yet, but will be used in the
|
|
74
|
+
* future.
|
|
75
|
+
*
|
|
76
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
77
|
+
* @deprecated Use {@link TypedException.IProps} typed function instead. This
|
|
78
|
+
* typed function is deprecated and will be removed in the next major update.
|
|
79
|
+
* @template T Type of the exception
|
|
80
|
+
* @param status Status number or pattern like "2XX", "3XX", "4XX", "5XX"
|
|
81
|
+
* @param description Description about the exception
|
|
82
|
+
* @returns Method decorator
|
|
83
|
+
*/
|
|
84
|
+
export function TypedException<T>(
|
|
85
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
86
|
+
description?: string | undefined,
|
|
87
|
+
): MethodDecorator;
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export function TypedException<T>(...args: any[]): MethodDecorator {
|
|
91
|
+
const props: TypedException.IProps<T> =
|
|
92
|
+
typeof args[0] === "object"
|
|
93
|
+
? args[0]
|
|
94
|
+
: { status: args[0], description: args[1] };
|
|
95
|
+
return function TypedException(
|
|
96
|
+
target: Object | T,
|
|
97
|
+
propertyKey: string | symbol,
|
|
98
|
+
descriptor: TypedPropertyDescriptor<any>,
|
|
99
|
+
) {
|
|
100
|
+
const array: TypedException.IProps<any>[] = (() => {
|
|
101
|
+
const oldbie: TypedException.IProps<any>[] | undefined =
|
|
102
|
+
Reflect.getMetadata(
|
|
103
|
+
"nestia/TypedException",
|
|
104
|
+
(target as any)[propertyKey],
|
|
105
|
+
);
|
|
106
|
+
if (oldbie !== undefined) return oldbie;
|
|
107
|
+
|
|
108
|
+
const newbie: TypedException.IProps<any>[] = [];
|
|
109
|
+
Reflect.defineMetadata(
|
|
110
|
+
"nestia/TypedException",
|
|
111
|
+
newbie,
|
|
112
|
+
(target as any)[propertyKey],
|
|
113
|
+
);
|
|
114
|
+
return newbie;
|
|
115
|
+
})();
|
|
116
|
+
array.push(props);
|
|
117
|
+
return descriptor;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export namespace TypedException {
|
|
121
|
+
/** Properties for the exception. */
|
|
122
|
+
export interface IProps<T> {
|
|
123
|
+
/** Status number or pattern like "2XX", "3XX", "4XX", "5XX". */
|
|
124
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
125
|
+
|
|
126
|
+
/** Description about the exception. */
|
|
127
|
+
description?: string | undefined;
|
|
128
|
+
|
|
129
|
+
/** Example value. */
|
|
130
|
+
example?: T | undefined;
|
|
131
|
+
|
|
132
|
+
/** Collection of examples for the exception. */
|
|
133
|
+
examples?: Record<string, IExample<T>> | undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Metadata collected in the {@link IProps.examples}. */
|
|
137
|
+
export interface IExample<T> {
|
|
138
|
+
/** Summary of the example. */
|
|
139
|
+
summary?: string | undefined;
|
|
140
|
+
|
|
141
|
+
/** Description of the example. */
|
|
142
|
+
description?: string | undefined;
|
|
143
|
+
|
|
144
|
+
/** Value of the example. */
|
|
145
|
+
value: T;
|
|
146
|
+
}
|
|
147
|
+
}
|