@tsoa-next/runtime 8.0.4 → 8.0.5-dev.58.3748c499
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/dist/config.d.ts +50 -45
- package/dist/decorators/customAttribute.d.ts +6 -0
- package/dist/decorators/customAttribute.js +6 -0
- package/dist/decorators/customAttribute.js.map +1 -1
- package/dist/decorators/deprecated.d.ts +1 -1
- package/dist/decorators/deprecated.js +1 -1
- package/dist/decorators/example.d.ts +6 -0
- package/dist/decorators/example.js +6 -0
- package/dist/decorators/example.js.map +1 -1
- package/dist/decorators/extension.d.ts +7 -0
- package/dist/decorators/extension.js +6 -0
- package/dist/decorators/extension.js.map +1 -1
- package/dist/decorators/methods.d.ts +7 -0
- package/dist/decorators/methods.js +7 -0
- package/dist/decorators/methods.js.map +1 -1
- package/dist/decorators/middlewares.d.ts +6 -7
- package/dist/decorators/middlewares.js +6 -7
- package/dist/decorators/middlewares.js.map +1 -1
- package/dist/decorators/operationid.d.ts +5 -0
- package/dist/decorators/operationid.js +5 -0
- package/dist/decorators/operationid.js.map +1 -1
- package/dist/decorators/parameter.d.ts +22 -24
- package/dist/decorators/parameter.js +22 -24
- package/dist/decorators/parameter.js.map +1 -1
- package/dist/decorators/response.d.ts +18 -3
- package/dist/decorators/response.js +18 -3
- package/dist/decorators/response.js.map +1 -1
- package/dist/decorators/route.d.ts +6 -1
- package/dist/decorators/route.js +6 -1
- package/dist/decorators/route.js.map +1 -1
- package/dist/decorators/security.d.ts +5 -2
- package/dist/decorators/security.js +5 -2
- package/dist/decorators/security.js.map +1 -1
- package/dist/decorators/specPath.d.ts +66 -0
- package/dist/decorators/specPath.js +68 -0
- package/dist/decorators/specPath.js.map +1 -0
- package/dist/decorators/tags.d.ts +5 -0
- package/dist/decorators/tags.js +5 -0
- package/dist/decorators/tags.js.map +1 -1
- package/dist/decorators/validate.d.ts +5 -0
- package/dist/decorators/validate.js +5 -0
- package/dist/decorators/validate.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/controller.d.ts +7 -0
- package/dist/interfaces/controller.js +8 -0
- package/dist/interfaces/controller.js.map +1 -1
- package/dist/interfaces/iocModule.d.ts +4 -0
- package/dist/interfaces/response.d.ts +8 -0
- package/dist/metadataGeneration/tsoa.d.ts +1 -0
- package/dist/routeGeneration/additionalProps.d.ts +1 -0
- package/dist/routeGeneration/externalValidation.d.ts +3 -0
- package/dist/routeGeneration/externalValidation.js +1 -0
- package/dist/routeGeneration/externalValidation.js.map +1 -1
- package/dist/routeGeneration/specPathSupport.d.ts +32 -0
- package/dist/routeGeneration/specPathSupport.js +408 -0
- package/dist/routeGeneration/specPathSupport.js.map +1 -0
- package/dist/routeGeneration/templateHelpers.d.ts +14 -0
- package/dist/routeGeneration/templateHelpers.js +2 -0
- package/dist/routeGeneration/templateHelpers.js.map +1 -1
- package/dist/routeGeneration/templates/express/expressTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js +1 -0
- package/dist/routeGeneration/templates/express/expressTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js +1 -0
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/koa/koaTemplateService.d.ts +1 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js +1 -0
- package/dist/routeGeneration/templates/koa/koaTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/templateService.d.ts +6 -0
- package/dist/routeGeneration/templates/templateService.js +3 -0
- package/dist/routeGeneration/templates/templateService.js.map +1 -1
- package/dist/routeGeneration/tsoa-route.d.ts +12 -2
- package/dist/routeGeneration/tsoa-route.js +1 -2
- package/dist/routeGeneration/tsoa-route.js.map +1 -1
- package/dist/swagger/swagger.d.ts +1 -0
- package/dist/swagger/swagger.js +1 -0
- package/dist/swagger/swagger.js.map +1 -1
- package/dist/utils/pathUtils.d.ts +4 -0
- package/dist/utils/pathUtils.js +49 -0
- package/dist/utils/pathUtils.js.map +1 -0
- package/package.json +22 -2
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Options as MulterOpts } from 'multer';
|
|
2
2
|
import { Swagger } from './swagger/swagger';
|
|
3
|
+
/** Root tsoa-next configuration consumed by the CLI and programmatic generators. */
|
|
3
4
|
export interface Config {
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* OpenAPI generation configuration.
|
|
6
7
|
*/
|
|
7
8
|
spec: SpecConfig;
|
|
8
9
|
/**
|
|
9
|
-
* Route generation configuration
|
|
10
|
+
* Route generation configuration.
|
|
10
11
|
*/
|
|
11
12
|
routes: RoutesConfig;
|
|
12
13
|
/**
|
|
@@ -40,38 +41,45 @@ export interface Config {
|
|
|
40
41
|
*/
|
|
41
42
|
compilerOptions?: Record<string, unknown>;
|
|
42
43
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
44
|
+
* Legacy multer options forwarded into generated middleware.
|
|
45
|
+
* The `storage` option is not supported.
|
|
45
46
|
*
|
|
46
47
|
* @example {
|
|
47
48
|
* "dest": "/tmp"
|
|
48
|
-
* }
|
|
49
|
+
* } Allows multer to write files to disk instead of keeping them in memory.
|
|
49
50
|
* @deprecated
|
|
50
|
-
*
|
|
51
|
-
*
|
|
51
|
+
* Since v6.4.0, `RegisterRoutes` can receive `multerOptions` directly.
|
|
52
|
+
* This config-level option will be removed in a future release.
|
|
52
53
|
* (https://github.com/tsoa-next/tsoa-next/issues/1587#issuecomment-2391291433)
|
|
53
54
|
* (https://github.com/tsoa-next/tsoa-next/pull/1638)
|
|
54
55
|
*/
|
|
55
56
|
multerOpts?: MulterOpts;
|
|
57
|
+
/**
|
|
58
|
+
* OpenAPI number type to use for TypeScript `number` when no narrower annotation is present.
|
|
59
|
+
* @default double
|
|
60
|
+
*/
|
|
56
61
|
defaultNumberType?: 'double' | 'float' | 'integer' | 'long';
|
|
57
62
|
}
|
|
58
63
|
/**
|
|
59
|
-
*
|
|
64
|
+
* Legacy boolean form of `noImplicitAdditionalProperties`.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated Use the explicit string options instead.
|
|
60
67
|
*/
|
|
61
68
|
export type DeprecatedOptionForAdditionalPropertiesHandling = true | false;
|
|
69
|
+
/** OpenAPI generation settings. */
|
|
62
70
|
export interface SpecConfig {
|
|
63
71
|
/**
|
|
64
|
-
*
|
|
72
|
+
* Directory where the generated spec file should be written.
|
|
65
73
|
*/
|
|
66
74
|
outputDirectory: string;
|
|
67
75
|
/**
|
|
68
|
-
* API host,
|
|
76
|
+
* API host name for Swagger 2 output, for example `localhost:3000`.
|
|
69
77
|
*/
|
|
70
78
|
host?: string;
|
|
71
79
|
/**
|
|
72
|
-
*
|
|
80
|
+
* Server URLs for OpenAPI 3 output.
|
|
73
81
|
*
|
|
74
|
-
* Only available with
|
|
82
|
+
* Only available with spec version 3 or 3.1.
|
|
75
83
|
*/
|
|
76
84
|
servers?: string[];
|
|
77
85
|
/**
|
|
@@ -80,10 +88,7 @@ export interface SpecConfig {
|
|
|
80
88
|
* @default: "swagger"
|
|
81
89
|
*/
|
|
82
90
|
specFileBaseName?: string;
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
* API version number; defaults to npm package version
|
|
86
|
-
*/
|
|
91
|
+
/** API version number; defaults to the package version. */
|
|
87
92
|
version?: string;
|
|
88
93
|
/**
|
|
89
94
|
* Major OpenAPI version to generate; defaults to version 2 when not specified
|
|
@@ -107,7 +112,7 @@ export interface SpecConfig {
|
|
|
107
112
|
*/
|
|
108
113
|
termsOfService?: string;
|
|
109
114
|
/**
|
|
110
|
-
* Contact
|
|
115
|
+
* Contact information for the published API.
|
|
111
116
|
*/
|
|
112
117
|
contact?: {
|
|
113
118
|
/**
|
|
@@ -121,8 +126,7 @@ export interface SpecConfig {
|
|
|
121
126
|
*/
|
|
122
127
|
email?: string;
|
|
123
128
|
/**
|
|
124
|
-
*
|
|
125
|
-
* The URL pointing to the contact information.
|
|
129
|
+
* URL pointing to the contact information.
|
|
126
130
|
* @default npm package author url
|
|
127
131
|
*/
|
|
128
132
|
url?: string;
|
|
@@ -136,25 +140,22 @@ export interface SpecConfig {
|
|
|
136
140
|
*/
|
|
137
141
|
basePath?: string;
|
|
138
142
|
/**
|
|
139
|
-
*
|
|
140
|
-
* e.g. the 'v1' with toggle true will be https://myapi.comv1
|
|
141
|
-
* Otherwise, http://myapi.com/v1
|
|
143
|
+
* Controls whether `basePath` is prefixed with `/` when composing OpenAPI 3 server URLs.
|
|
142
144
|
*
|
|
143
|
-
* Only available with
|
|
145
|
+
* Only available with spec version 3 or 3.1.
|
|
144
146
|
*/
|
|
145
147
|
disableBasePathPrefixSlash?: boolean;
|
|
146
148
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
+
* Object merged into the generated spec.
|
|
150
|
+
* Generated properties always take precedence over values provided here.
|
|
149
151
|
*/
|
|
150
152
|
spec?: unknown;
|
|
151
153
|
/**
|
|
152
|
-
*
|
|
154
|
+
* Controls how `spec` is merged into the generated document.
|
|
153
155
|
* Possible values:
|
|
154
|
-
* - 'immediate'
|
|
155
|
-
* - 'recursive'
|
|
156
|
-
* - 'deepmerge'
|
|
157
|
-
* The default is set to immediate so it is not breaking previous versions.
|
|
156
|
+
* - 'immediate' overrides only top-level elements.
|
|
157
|
+
* - 'recursive' performs a deep merge using `merge`.
|
|
158
|
+
* - 'deepmerge' performs a deep merge using `ts-deepmerge`, including arrays.
|
|
158
159
|
* @default 'immediate'
|
|
159
160
|
*/
|
|
160
161
|
specMerging?: 'immediate' | 'recursive' | 'deepmerge';
|
|
@@ -169,19 +170,18 @@ export interface SpecConfig {
|
|
|
169
170
|
*/
|
|
170
171
|
operationIdTemplate?: string;
|
|
171
172
|
/**
|
|
172
|
-
* Security
|
|
173
|
-
* A declaration of the security schemes available to be used in the
|
|
174
|
-
* specification. This does not enforce the security schemes on the operations
|
|
175
|
-
* and only serves to provide the relevant details for each scheme.
|
|
173
|
+
* Security schemes declared for the specification.
|
|
176
174
|
*/
|
|
177
175
|
securityDefinitions?: {
|
|
178
176
|
[name: string]: Swagger.SecuritySchemes;
|
|
179
177
|
};
|
|
180
178
|
/**
|
|
181
|
-
*
|
|
179
|
+
* Top-level tag metadata for the generated specification.
|
|
182
180
|
*/
|
|
183
181
|
tags?: Swagger.Tag[];
|
|
182
|
+
/** Writes the generated spec as YAML instead of JSON. */
|
|
184
183
|
yaml?: boolean;
|
|
184
|
+
/** Supported protocols for Swagger 2 output. */
|
|
185
185
|
schemes?: Swagger.Protocol[];
|
|
186
186
|
/**
|
|
187
187
|
* Enable x-enum-varnames support
|
|
@@ -189,8 +189,7 @@ export interface SpecConfig {
|
|
|
189
189
|
*/
|
|
190
190
|
xEnumVarnames?: boolean;
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
193
|
-
* This helps to generate more consistent clients
|
|
192
|
+
* Adds titles to inline response and request-body object schemas to improve client generation.
|
|
194
193
|
*/
|
|
195
194
|
useTitleTagsForInlineObjects?: boolean;
|
|
196
195
|
/**
|
|
@@ -201,15 +200,15 @@ export interface SpecConfig {
|
|
|
201
200
|
}
|
|
202
201
|
export interface RoutesConfig {
|
|
203
202
|
/**
|
|
204
|
-
*
|
|
203
|
+
* Directory where generated route files are written.
|
|
205
204
|
*/
|
|
206
205
|
routesDir: string;
|
|
207
206
|
/**
|
|
208
|
-
*
|
|
207
|
+
* Filename for the generated route module.
|
|
209
208
|
*/
|
|
210
209
|
routesFileName?: string;
|
|
211
210
|
/**
|
|
212
|
-
*
|
|
211
|
+
* Skips writing the route file when the generated content matches the existing file.
|
|
213
212
|
*/
|
|
214
213
|
noWriteIfUnchanged?: boolean;
|
|
215
214
|
/**
|
|
@@ -221,26 +220,32 @@ export interface RoutesConfig {
|
|
|
221
220
|
*/
|
|
222
221
|
middleware?: 'express' | 'hapi' | 'koa';
|
|
223
222
|
/**
|
|
224
|
-
*
|
|
223
|
+
* Custom Handlebars template path used instead of the built-in middleware template.
|
|
225
224
|
*/
|
|
226
225
|
middlewareTemplate?: string;
|
|
227
226
|
/**
|
|
228
|
-
*
|
|
227
|
+
* IoC module path, for example `./inversify/ioc`.
|
|
229
228
|
*/
|
|
230
229
|
iocModule?: string;
|
|
231
230
|
/**
|
|
232
|
-
* Authentication
|
|
231
|
+
* Authentication module path used by generated routes.
|
|
233
232
|
*/
|
|
234
233
|
authenticationModule?: string;
|
|
235
234
|
/**
|
|
236
|
-
* When enabled,
|
|
235
|
+
* When enabled, generated route imports use `.js` extensions for ESM output.
|
|
237
236
|
*
|
|
238
237
|
* @default false
|
|
239
238
|
*/
|
|
240
239
|
esm?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Whether to implicitly coerce body parameters into an accepted type.
|
|
242
|
+
*
|
|
243
|
+
* @default true
|
|
244
|
+
*/
|
|
241
245
|
bodyCoercion?: boolean;
|
|
242
246
|
/**
|
|
243
|
-
* When enabled,
|
|
247
|
+
* When enabled, generated route imports keep `.ts` extensions to support TypeScript 5.7 `rewriteRelativeImportExtensions`.
|
|
248
|
+
*
|
|
244
249
|
* @default false
|
|
245
250
|
*/
|
|
246
251
|
rewriteRelativeImportExtensions?: boolean;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomAttribute = CustomAttribute;
|
|
4
|
+
/**
|
|
5
|
+
* Adds a custom metadata attribute to a model property.
|
|
6
|
+
*
|
|
7
|
+
* @param _name The custom attribute name.
|
|
8
|
+
* @param _value The string value stored for the attribute.
|
|
9
|
+
*/
|
|
4
10
|
function CustomAttribute(_name, _value) {
|
|
5
11
|
return () => {
|
|
6
12
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customAttribute.js","sourceRoot":"","sources":["../../src/decorators/customAttribute.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"customAttribute.js","sourceRoot":"","sources":["../../src/decorators/customAttribute.ts"],"names":[],"mappings":";;AAMA,0CAIC;AAVD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,KAAa,EAAE,MAAc;IAC3D,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Deprecated = Deprecated;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Marks a reflected API element as deprecated in generated documentation.
|
|
6
6
|
*/
|
|
7
7
|
function Deprecated() {
|
|
8
8
|
return () => {
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attaches an example value to a model property.
|
|
3
|
+
*
|
|
4
|
+
* @param _exampleModel The example value to include in generated schema metadata.
|
|
5
|
+
* @param _exampleLabel Optional label used when multiple examples are present.
|
|
6
|
+
*/
|
|
1
7
|
export declare function Example<T>(_exampleModel: T, _exampleLabel?: string): PropertyDecorator;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Example = Example;
|
|
4
|
+
/**
|
|
5
|
+
* Attaches an example value to a model property.
|
|
6
|
+
*
|
|
7
|
+
* @param _exampleModel The example value to include in generated schema metadata.
|
|
8
|
+
* @param _exampleLabel Optional label used when multiple examples are present.
|
|
9
|
+
*/
|
|
4
10
|
function Example(_exampleModel, _exampleLabel) {
|
|
5
11
|
return () => {
|
|
6
12
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/decorators/example.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/decorators/example.ts"],"names":[],"mappings":";;AAMA,0BAIC;AAVD;;;;;GAKG;AACH,SAAgB,OAAO,CAAI,aAAgB,EAAE,aAAsB;IACjE,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds an OpenAPI specification extension to a model property.
|
|
3
|
+
*
|
|
4
|
+
* @param _name The extension key, typically beginning with `x-`.
|
|
5
|
+
* @param _value The extension value.
|
|
6
|
+
*/
|
|
1
7
|
export declare function Extension(_name: string, _value: ExtensionType | ExtensionType[]): PropertyDecorator;
|
|
8
|
+
/** Value types supported by OpenAPI specification extensions. */
|
|
2
9
|
export type ExtensionType = string | number | boolean | null | ExtensionType[] | {
|
|
3
10
|
[name: string]: ExtensionType | ExtensionType[];
|
|
4
11
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Extension = Extension;
|
|
4
|
+
/**
|
|
5
|
+
* Adds an OpenAPI specification extension to a model property.
|
|
6
|
+
*
|
|
7
|
+
* @param _name The extension key, typically beginning with `x-`.
|
|
8
|
+
* @param _value The extension value.
|
|
9
|
+
*/
|
|
4
10
|
function Extension(_name, _value) {
|
|
5
11
|
return () => {
|
|
6
12
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/decorators/extension.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../../src/decorators/extension.ts"],"names":[],"mappings":";;AAMA,8BAIC;AAVD;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,MAAuC;IAC9E,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/** Marks a controller method as handling HTTP `OPTIONS` requests for the given relative path. */
|
|
1
2
|
export declare function Options(_value?: string): MethodDecorator;
|
|
3
|
+
/** Marks a controller method as handling HTTP `GET` requests for the given relative path. */
|
|
2
4
|
export declare function Get(_value?: string): MethodDecorator;
|
|
5
|
+
/** Marks a controller method as handling HTTP `POST` requests for the given relative path. */
|
|
3
6
|
export declare function Post(_value?: string): MethodDecorator;
|
|
7
|
+
/** Marks a controller method as handling HTTP `PUT` requests for the given relative path. */
|
|
4
8
|
export declare function Put(_value?: string): MethodDecorator;
|
|
9
|
+
/** Marks a controller method as handling HTTP `PATCH` requests for the given relative path. */
|
|
5
10
|
export declare function Patch(_value?: string): MethodDecorator;
|
|
11
|
+
/** Marks a controller method as handling HTTP `DELETE` requests for the given relative path. */
|
|
6
12
|
export declare function Delete(_value?: string): MethodDecorator;
|
|
13
|
+
/** Marks a controller method as handling HTTP `HEAD` requests for the given relative path. */
|
|
7
14
|
export declare function Head(_value?: string): MethodDecorator;
|
|
@@ -8,24 +8,31 @@ exports.Patch = Patch;
|
|
|
8
8
|
exports.Delete = Delete;
|
|
9
9
|
exports.Head = Head;
|
|
10
10
|
const noop_1 = require("./noop");
|
|
11
|
+
/** Marks a controller method as handling HTTP `OPTIONS` requests for the given relative path. */
|
|
11
12
|
function Options(_value) {
|
|
12
13
|
return (0, noop_1.createNoopMethodDecorator)('options');
|
|
13
14
|
}
|
|
15
|
+
/** Marks a controller method as handling HTTP `GET` requests for the given relative path. */
|
|
14
16
|
function Get(_value) {
|
|
15
17
|
return (0, noop_1.createNoopMethodDecorator)('get');
|
|
16
18
|
}
|
|
19
|
+
/** Marks a controller method as handling HTTP `POST` requests for the given relative path. */
|
|
17
20
|
function Post(_value) {
|
|
18
21
|
return (0, noop_1.createNoopMethodDecorator)('post');
|
|
19
22
|
}
|
|
23
|
+
/** Marks a controller method as handling HTTP `PUT` requests for the given relative path. */
|
|
20
24
|
function Put(_value) {
|
|
21
25
|
return (0, noop_1.createNoopMethodDecorator)('put');
|
|
22
26
|
}
|
|
27
|
+
/** Marks a controller method as handling HTTP `PATCH` requests for the given relative path. */
|
|
23
28
|
function Patch(_value) {
|
|
24
29
|
return (0, noop_1.createNoopMethodDecorator)('patch');
|
|
25
30
|
}
|
|
31
|
+
/** Marks a controller method as handling HTTP `DELETE` requests for the given relative path. */
|
|
26
32
|
function Delete(_value) {
|
|
27
33
|
return (0, noop_1.createNoopMethodDecorator)('delete');
|
|
28
34
|
}
|
|
35
|
+
/** Marks a controller method as handling HTTP `HEAD` requests for the given relative path. */
|
|
29
36
|
function Head(_value) {
|
|
30
37
|
return (0, noop_1.createNoopMethodDecorator)('head');
|
|
31
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":";;AAGA,0BAEC;AAGD,kBAEC;AAGD,oBAEC;AAGD,kBAEC;AAGD,sBAEC;AAGD,wBAEC;AAGD,oBAEC;AAnCD,iCAAkD;AAElD,iGAAiG;AACjG,SAAgB,OAAO,CAAC,MAAe;IACrC,OAAO,IAAA,gCAAyB,EAAC,SAAS,CAAC,CAAA;AAC7C,CAAC;AAED,6FAA6F;AAC7F,SAAgB,GAAG,CAAC,MAAe;IACjC,OAAO,IAAA,gCAAyB,EAAC,KAAK,CAAC,CAAA;AACzC,CAAC;AAED,8FAA8F;AAC9F,SAAgB,IAAI,CAAC,MAAe;IAClC,OAAO,IAAA,gCAAyB,EAAC,MAAM,CAAC,CAAA;AAC1C,CAAC;AAED,6FAA6F;AAC7F,SAAgB,GAAG,CAAC,MAAe;IACjC,OAAO,IAAA,gCAAyB,EAAC,KAAK,CAAC,CAAA;AACzC,CAAC;AAED,+FAA+F;AAC/F,SAAgB,KAAK,CAAC,MAAe;IACnC,OAAO,IAAA,gCAAyB,EAAC,OAAO,CAAC,CAAA;AAC3C,CAAC;AAED,gGAAgG;AAChG,SAAgB,MAAM,CAAC,MAAe;IACpC,OAAO,IAAA,gCAAyB,EAAC,QAAQ,CAAC,CAAA;AAC5C,CAAC;AAED,8FAA8F;AAC9F,SAAgB,IAAI,CAAC,MAAe;IAClC,OAAO,IAAA,gCAAyB,EAAC,MAAM,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
type Middleware<T extends CallableFunction | object> = T;
|
|
2
2
|
type MiddlewareTarget = CallableFunction | object;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
4
|
+
* Attaches one or more runtime middleware handlers to a controller or action.
|
|
5
|
+
*
|
|
6
|
+
* @param mws The middleware functions or middleware objects to install.
|
|
7
7
|
*/
|
|
8
8
|
export declare function Middlewares<T extends CallableFunction | object>(...mws: Array<Middleware<T>>): ClassDecorator & MethodDecorator;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param target
|
|
13
|
-
* @returns list of middlewares
|
|
10
|
+
* Returns middleware metadata previously attached with {@link Middlewares}.
|
|
11
|
+
*
|
|
12
|
+
* @param target The controller class or method function to inspect.
|
|
14
13
|
*/
|
|
15
14
|
export declare function fetchMiddlewares<T extends CallableFunction | object>(target: MiddlewareTarget): Array<Middleware<T>>;
|
|
16
15
|
export {};
|
|
@@ -32,9 +32,9 @@ function decorator(fn) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @
|
|
35
|
+
* Attaches one or more runtime middleware handlers to a controller or action.
|
|
36
|
+
*
|
|
37
|
+
* @param mws The middleware functions or middleware objects to install.
|
|
38
38
|
*/
|
|
39
39
|
function Middlewares(...mws) {
|
|
40
40
|
return decorator(target => {
|
|
@@ -45,10 +45,9 @@ function Middlewares(...mws) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param target
|
|
51
|
-
* @returns list of middlewares
|
|
48
|
+
* Returns middleware metadata previously attached with {@link Middlewares}.
|
|
49
|
+
*
|
|
50
|
+
* @param target The controller class or method function to inspect.
|
|
52
51
|
*/
|
|
53
52
|
function fetchMiddlewares(target) {
|
|
54
53
|
return Reflect.getMetadata(TSOA_MIDDLEWARES, target) ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../src/decorators/middlewares.ts"],"names":[],"mappings":";;AAwCA,kCAOC;
|
|
1
|
+
{"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../src/decorators/middlewares.ts"],"names":[],"mappings":";;AAwCA,kCAOC;AAOD,4CAEC;AApDD,MAAM,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAEpD,SAAS,kBAAkB,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAA;AACrF,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,EAAqC;IACtD,OAAO,CAAC,GAAG,IAA6B,EAAE,EAAE;QAC1C,kBAAkB;QAClB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;YACrB,EAAE,CAAC,MAAM,CAAC,CAAA;QACZ,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,mBAAmB;YACnB,MAAM,CAAC,EAAE,AAAD,EAAG,UAAU,CAAC,GAAG,IAAI,CAAA;YAC7B,IAAI,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YACtB,CAAC;QACH,CAAC;IACH,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAsC,GAAG,GAAyB;IAC3F,OAAO,SAAS,CAAC,MAAM,CAAC,EAAE;QACxB,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,OAAO,GAAG,gBAAgB,CAAI,MAAM,CAAC,CAAA;YAC3C,OAAO,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;QACxE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAsC,MAAwB;IAC5F,OAAQ,OAAO,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,CAAsC,IAAI,EAAE,CAAA;AAClG,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OperationId = OperationId;
|
|
4
|
+
/**
|
|
5
|
+
* Overrides the generated OpenAPI operation id for an action.
|
|
6
|
+
*
|
|
7
|
+
* @param _value The explicit operation id to emit into the specification.
|
|
8
|
+
*/
|
|
4
9
|
function OperationId(_value) {
|
|
5
10
|
return () => {
|
|
6
11
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationid.js","sourceRoot":"","sources":["../../src/decorators/operationid.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"operationid.js","sourceRoot":"","sources":["../../src/decorators/operationid.ts"],"names":[],"mappings":";;AAKA,kCAIC;AATD;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAc;IACxC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,73 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {string} [name] properties name in body object
|
|
2
|
+
* Binds the full HTTP request body to a controller parameter.
|
|
4
3
|
*/
|
|
5
4
|
export declare function Body(): ParameterDecorator;
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* Binds a single property from the request body to a controller parameter.
|
|
8
7
|
*
|
|
9
|
-
* @param
|
|
8
|
+
* @param _name The property name to read from the request body. Defaults to the parameter name.
|
|
10
9
|
*/
|
|
11
10
|
export declare function BodyProp(_name?: string): ParameterDecorator;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
12
|
+
* Injects the underlying runtime request object.
|
|
14
13
|
*/
|
|
15
14
|
export declare function Request(): ParameterDecorator;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
16
|
+
* Binds a property from the underlying runtime request object.
|
|
18
17
|
*
|
|
19
|
-
* @param
|
|
18
|
+
* @param _name The request property name to read. Defaults to the parameter name.
|
|
20
19
|
*/
|
|
21
20
|
export declare function RequestProp(_name?: string): ParameterDecorator;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* Binds a path parameter from the request URL.
|
|
24
23
|
*
|
|
25
|
-
* @param
|
|
24
|
+
* @param _name The path parameter name. Defaults to the parameter name.
|
|
26
25
|
*/
|
|
27
26
|
export declare function Path(_name?: string): ParameterDecorator;
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* Binds a query-string value to a controller parameter.
|
|
30
29
|
*
|
|
31
|
-
* @param
|
|
30
|
+
* @param _name The query parameter name. Defaults to the parameter name.
|
|
32
31
|
*/
|
|
33
32
|
export declare function Query(_name?: string): ParameterDecorator;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
34
|
+
* Binds the entire query object to a single controller parameter.
|
|
36
35
|
*/
|
|
37
36
|
export declare function Queries(): ParameterDecorator;
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
38
|
+
* Binds an HTTP header value to a controller parameter.
|
|
40
39
|
*
|
|
41
|
-
* @param
|
|
40
|
+
* @param _name The header name. Defaults to the parameter name.
|
|
42
41
|
*/
|
|
43
42
|
export declare function Header(_name?: string): ParameterDecorator;
|
|
44
43
|
/**
|
|
45
|
-
*
|
|
44
|
+
* Marks a parameter as injected by user code so tsoa skips route-generation metadata for it.
|
|
46
45
|
*/
|
|
47
46
|
export declare function Inject(): ParameterDecorator;
|
|
48
47
|
/**
|
|
49
|
-
*
|
|
48
|
+
* Binds a single uploaded file from a multipart/form-data request.
|
|
50
49
|
*
|
|
51
|
-
* @param
|
|
50
|
+
* @param _name The multipart field name. Defaults to the parameter name.
|
|
52
51
|
*/
|
|
53
52
|
export declare function UploadedFile(_name?: string): ParameterDecorator;
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
54
|
+
* Binds multiple uploaded files from a multipart/form-data request.
|
|
56
55
|
*
|
|
57
|
-
* @param
|
|
56
|
+
* @param _name The multipart field name. Defaults to the parameter name.
|
|
58
57
|
*/
|
|
59
58
|
export declare function UploadedFiles(_name?: string): ParameterDecorator;
|
|
60
59
|
/**
|
|
61
|
-
*
|
|
60
|
+
* Binds a regular multipart form field from a multipart/form-data request.
|
|
62
61
|
*
|
|
63
|
-
* @param
|
|
62
|
+
* @param _name The multipart field name. Defaults to the parameter name.
|
|
64
63
|
*/
|
|
65
64
|
export declare function FormField(_name?: string): ParameterDecorator;
|
|
66
65
|
/**
|
|
67
|
-
* Overrides the
|
|
68
|
-
* Can be used on specific method.
|
|
69
|
-
* Can't be used on controller level.
|
|
66
|
+
* Overrides the media type used to document a request body for a single action.
|
|
70
67
|
*
|
|
68
|
+
* @param _value The request body media type, for example `application/json`.
|
|
71
69
|
* @link https://swagger.io/docs/specification/describing-request-body/
|
|
72
70
|
*/
|
|
73
71
|
export declare function Consumes(_value: string): MethodDecorator;
|