@tsoa-next/runtime 8.0.5-dev.57.84bb4a63 → 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.
Files changed (80) hide show
  1. package/dist/config.d.ts +50 -45
  2. package/dist/decorators/customAttribute.d.ts +6 -0
  3. package/dist/decorators/customAttribute.js +6 -0
  4. package/dist/decorators/customAttribute.js.map +1 -1
  5. package/dist/decorators/deprecated.d.ts +1 -1
  6. package/dist/decorators/deprecated.js +1 -1
  7. package/dist/decorators/example.d.ts +6 -0
  8. package/dist/decorators/example.js +6 -0
  9. package/dist/decorators/example.js.map +1 -1
  10. package/dist/decorators/extension.d.ts +7 -0
  11. package/dist/decorators/extension.js +6 -0
  12. package/dist/decorators/extension.js.map +1 -1
  13. package/dist/decorators/methods.d.ts +7 -0
  14. package/dist/decorators/methods.js +7 -0
  15. package/dist/decorators/methods.js.map +1 -1
  16. package/dist/decorators/middlewares.d.ts +6 -7
  17. package/dist/decorators/middlewares.js +6 -7
  18. package/dist/decorators/middlewares.js.map +1 -1
  19. package/dist/decorators/operationid.d.ts +5 -0
  20. package/dist/decorators/operationid.js +5 -0
  21. package/dist/decorators/operationid.js.map +1 -1
  22. package/dist/decorators/parameter.d.ts +22 -24
  23. package/dist/decorators/parameter.js +22 -24
  24. package/dist/decorators/parameter.js.map +1 -1
  25. package/dist/decorators/response.d.ts +18 -3
  26. package/dist/decorators/response.js +18 -3
  27. package/dist/decorators/response.js.map +1 -1
  28. package/dist/decorators/route.d.ts +6 -1
  29. package/dist/decorators/route.js +6 -1
  30. package/dist/decorators/route.js.map +1 -1
  31. package/dist/decorators/security.d.ts +5 -2
  32. package/dist/decorators/security.js +5 -2
  33. package/dist/decorators/security.js.map +1 -1
  34. package/dist/decorators/specPath.d.ts +21 -0
  35. package/dist/decorators/specPath.js +9 -0
  36. package/dist/decorators/specPath.js.map +1 -1
  37. package/dist/decorators/tags.d.ts +5 -0
  38. package/dist/decorators/tags.js +5 -0
  39. package/dist/decorators/tags.js.map +1 -1
  40. package/dist/decorators/validate.d.ts +5 -0
  41. package/dist/decorators/validate.js +5 -0
  42. package/dist/decorators/validate.js.map +1 -1
  43. package/dist/interfaces/controller.d.ts +7 -0
  44. package/dist/interfaces/controller.js +8 -0
  45. package/dist/interfaces/controller.js.map +1 -1
  46. package/dist/interfaces/iocModule.d.ts +4 -0
  47. package/dist/interfaces/response.d.ts +8 -0
  48. package/dist/metadataGeneration/tsoa.d.ts +1 -0
  49. package/dist/routeGeneration/additionalProps.d.ts +1 -0
  50. package/dist/routeGeneration/externalValidation.d.ts +3 -0
  51. package/dist/routeGeneration/externalValidation.js +1 -0
  52. package/dist/routeGeneration/externalValidation.js.map +1 -1
  53. package/dist/routeGeneration/specPathSupport.d.ts +5 -0
  54. package/dist/routeGeneration/specPathSupport.js +3 -0
  55. package/dist/routeGeneration/specPathSupport.js.map +1 -1
  56. package/dist/routeGeneration/templateHelpers.d.ts +14 -0
  57. package/dist/routeGeneration/templateHelpers.js +2 -0
  58. package/dist/routeGeneration/templateHelpers.js.map +1 -1
  59. package/dist/routeGeneration/templates/express/expressTemplateService.d.ts +1 -0
  60. package/dist/routeGeneration/templates/express/expressTemplateService.js +1 -0
  61. package/dist/routeGeneration/templates/express/expressTemplateService.js.map +1 -1
  62. package/dist/routeGeneration/templates/hapi/hapiTemplateService.d.ts +1 -0
  63. package/dist/routeGeneration/templates/hapi/hapiTemplateService.js +1 -0
  64. package/dist/routeGeneration/templates/hapi/hapiTemplateService.js.map +1 -1
  65. package/dist/routeGeneration/templates/koa/koaTemplateService.d.ts +1 -0
  66. package/dist/routeGeneration/templates/koa/koaTemplateService.js +1 -0
  67. package/dist/routeGeneration/templates/koa/koaTemplateService.js.map +1 -1
  68. package/dist/routeGeneration/templates/templateService.d.ts +6 -0
  69. package/dist/routeGeneration/templates/templateService.js +3 -0
  70. package/dist/routeGeneration/templates/templateService.js.map +1 -1
  71. package/dist/routeGeneration/tsoa-route.d.ts +12 -2
  72. package/dist/routeGeneration/tsoa-route.js +1 -2
  73. package/dist/routeGeneration/tsoa-route.js.map +1 -1
  74. package/dist/swagger/swagger.d.ts +1 -0
  75. package/dist/swagger/swagger.js +1 -0
  76. package/dist/swagger/swagger.js.map +1 -1
  77. package/dist/utils/pathUtils.d.ts +3 -0
  78. package/dist/utils/pathUtils.js +3 -0
  79. package/dist/utils/pathUtils.js.map +1 -1
  80. package/package.json +1 -1
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
- * Swagger generation configuration object
6
+ * OpenAPI generation configuration.
6
7
  */
7
8
  spec: SpecConfig;
8
9
  /**
9
- * Route generation configuration object
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
- * Multer's options to generate multer's middleware.
44
- * It doesn't support storage option
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
- * } Allow multer to write to file instead of using Memory's buffer
49
+ * } Allows multer to write files to disk instead of keeping them in memory.
49
50
  * @deprecated
50
- * since v6.4.0 instroduces RegisterRoutes can pass multerOptions,
51
- * we will quickly remove this options soon at future version.
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
- * these options will be removed in a future version since we would prefer consumers to explicitly state their preference that the tsoa validation throws or removes additional properties
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
- * Generated SwaggerConfig.json will output here
72
+ * Directory where the generated spec file should be written.
65
73
  */
66
74
  outputDirectory: string;
67
75
  /**
68
- * API host, expressTemplate.g. localhost:3000 or myapi.com
76
+ * API host name for Swagger 2 output, for example `localhost:3000`.
69
77
  */
70
78
  host?: string;
71
79
  /**
72
- * API servers, expressTemplate.g. [production.api.com, staging.api.com]
80
+ * Server URLs for OpenAPI 3 output.
73
81
  *
74
- * Only available with the specVersion 3
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 Information
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
- * API Info url
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
- * Base API prefix slash toggle
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 the specVersion 3
145
+ * Only available with spec version 3 or 3.1.
144
146
  */
145
147
  disableBasePathPrefixSlash?: boolean;
146
148
  /**
147
- * Extend generated swagger spec with this object
148
- * Note that generated properties will always take precedence over what get specified here
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
- * Alter how the spec is merged to generated swagger spec.
154
+ * Controls how `spec` is merged into the generated document.
153
155
  * Possible values:
154
- * - 'immediate' is overriding top level elements only thus you can not append a new path or alter an existing value without erasing same level elements.
155
- * - 'recursive' proceed to a deep merge and will concat every branches or override or create new values if needed. @see https://www.npmjs.com/package/merge
156
- * - 'deepmerge' uses `ts-deepmerge` to merge, which will concat object branches and concat arrays as well @see https://www.npmjs.com/package/deepmerge @see https://github.com/voodoocreation/ts-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 Definitions Object
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
- * Swagger Tags Information for your API
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
- * Sets a title for inline objects for responses and requestBodies
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
- * Routes directory; generated routes.ts (which contains the generated code wiring up routes using middleware of choice) will be dropped here
203
+ * Directory where generated route files are written.
205
204
  */
206
205
  routesDir: string;
207
206
  /**
208
- * Routes filename; the filename of the generated route file ('routes.ts' by default)
207
+ * Filename for the generated route module.
209
208
  */
210
209
  routesFileName?: string;
211
210
  /**
212
- * Avoid writing the generated route file if the existing file is identical (useful to optimize watch processes); false by default
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
- * Override the Middleware template
223
+ * Custom Handlebars template path used instead of the built-in middleware template.
225
224
  */
226
225
  middlewareTemplate?: string;
227
226
  /**
228
- * IOC module; e.g. './inversify/ioc' where IOC container named `iocContainer` is defined (https://github.com/inversify/InversifyJS)
227
+ * IoC module path, for example `./inversify/ioc`.
229
228
  */
230
229
  iocModule?: string;
231
230
  /**
232
- * Authentication Module for express, hapi and koa
231
+ * Authentication module path used by generated routes.
233
232
  */
234
233
  authenticationModule?: string;
235
234
  /**
236
- * When enabled, the imports in the routes files will have a `.js` extention to support esm.
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, the imports in the routes files will keep having a `.ts` extention to support the TypeScript 5.7 feature rewriteRelativeImportExtensions.
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 +1,7 @@
1
+ /**
2
+ * Adds a custom metadata attribute to a model property.
3
+ *
4
+ * @param _name The custom attribute name.
5
+ * @param _value The string value stored for the attribute.
6
+ */
1
7
  export declare function CustomAttribute(_name: string, _value: string): PropertyDecorator;
@@ -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":";;AAAA,0CAIC;AAJD,SAAgB,eAAe,CAAC,KAAa,EAAE,MAAc;IAC3D,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
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"}
@@ -1,4 +1,4 @@
1
1
  /**
2
- * used to show a method as deprecated on swagger documentation
2
+ * Marks a reflected API element as deprecated in generated documentation.
3
3
  */
4
4
  export declare function Deprecated(): PropertyDecorator & ClassDecorator & ParameterDecorator;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Deprecated = Deprecated;
4
4
  /**
5
- * used to show a method as deprecated on swagger documentation
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":";;AAAA,0BAIC;AAJD,SAAgB,OAAO,CAAI,aAAgB,EAAE,aAAsB;IACjE,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
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":";;AAAA,8BAIC;AAJD,SAAgB,SAAS,CAAC,KAAa,EAAE,MAAuC;IAC9E,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
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":";;AAEA,0BAEC;AAED,kBAEC;AAED,oBAEC;AAED,kBAEC;AAED,sBAEC;AAED,wBAEC;AAED,oBAEC;AA5BD,iCAAkD;AAElD,SAAgB,OAAO,CAAC,MAAe;IACrC,OAAO,IAAA,gCAAyB,EAAC,SAAS,CAAC,CAAA;AAC7C,CAAC;AAED,SAAgB,GAAG,CAAC,MAAe;IACjC,OAAO,I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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
- * Install middlewares to the Controller or a specific method.
5
- * @param middlewares
6
- * @returns
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
- * Internal function used to retrieve installed middlewares
11
- * in controller and methods (used during routes generation)
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
- * Install middlewares to the Controller or a specific method.
36
- * @param middlewares
37
- * @returns
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
- * Internal function used to retrieve installed middlewares
49
- * in controller and methods (used during routes generation)
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;AAQD,4CAEC;AArDD,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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AAI,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 +1,6 @@
1
+ /**
2
+ * Overrides the generated OpenAPI operation id for an action.
3
+ *
4
+ * @param _value The explicit operation id to emit into the specification.
5
+ */
1
6
  export declare function OperationId(_value: string): MethodDecorator;
@@ -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":";;AAAA,kCAIC;AAJD,SAAgB,WAAW,CAAC,MAAc;IACxC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
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
- * Inject http Body
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
- * Inject value from body
6
+ * Binds a single property from the request body to a controller parameter.
8
7
  *
9
- * @param {string} [name] The name of the body parameter
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
- * Inject http request
12
+ * Injects the underlying runtime request object.
14
13
  */
15
14
  export declare function Request(): ParameterDecorator;
16
15
  /**
17
- * Inject value from request
16
+ * Binds a property from the underlying runtime request object.
18
17
  *
19
- * @param {name} [name] The name of the request parameter
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
- * Inject value from Path
22
+ * Binds a path parameter from the request URL.
24
23
  *
25
- * @param {string} [name] The name of the path parameter
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
- * Inject value from query string
28
+ * Binds a query-string value to a controller parameter.
30
29
  *
31
- * @param {string} [name] The name of the query parameter
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
- * Inject all query values in a single object
34
+ * Binds the entire query object to a single controller parameter.
36
35
  */
37
36
  export declare function Queries(): ParameterDecorator;
38
37
  /**
39
- * Inject value from Http header
38
+ * Binds an HTTP header value to a controller parameter.
40
39
  *
41
- * @param {string} [name] The name of the header parameter
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
- * Mark parameter as manually injected, which will not be generated
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
- * Inject uploaded file
48
+ * Binds a single uploaded file from a multipart/form-data request.
50
49
  *
51
- * @param {string} [name] The name of the uploaded file parameter
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
- * Inject uploaded files
54
+ * Binds multiple uploaded files from a multipart/form-data request.
56
55
  *
57
- * @param {string} [name] The name of the uploaded files parameter
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
- * Inject uploaded files
60
+ * Binds a regular multipart form field from a multipart/form-data request.
62
61
  *
63
- * @param {string} [name] The name of the uploaded files parameter
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 default media type of request body.
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;