@tsoa-next/runtime 7.1.0 → 7.2.1
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/README.MD +8 -2
- package/dist/config.d.ts +9 -2
- package/dist/decorators/example.d.ts +1 -1
- package/dist/decorators/example.js +1 -1
- package/dist/decorators/example.js.map +1 -1
- package/dist/decorators/methods.d.ts +7 -7
- package/dist/decorators/methods.js +7 -7
- package/dist/decorators/methods.js.map +1 -1
- package/dist/decorators/middlewares.d.ts +2 -1
- package/dist/decorators/middlewares.js +9 -6
- package/dist/decorators/middlewares.js.map +1 -1
- package/dist/decorators/operationid.d.ts +1 -1
- package/dist/decorators/operationid.js +1 -1
- package/dist/decorators/operationid.js.map +1 -1
- package/dist/decorators/parameter.d.ts +9 -9
- package/dist/decorators/parameter.js +9 -9
- package/dist/decorators/parameter.js.map +1 -1
- package/dist/decorators/response.d.ts +3 -3
- package/dist/decorators/response.js +3 -3
- package/dist/decorators/response.js.map +1 -1
- package/dist/decorators/route.d.ts +1 -1
- package/dist/decorators/route.js +1 -1
- package/dist/decorators/route.js.map +1 -1
- package/dist/decorators/security.d.ts +2 -2
- package/dist/decorators/security.js +1 -1
- package/dist/decorators/security.js.map +1 -1
- package/dist/decorators/tags.d.ts +1 -1
- package/dist/decorators/tags.js +1 -1
- package/dist/decorators/tags.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/interfaces/iocModule.d.ts +4 -2
- package/dist/interfaces/response.d.ts +1 -1
- package/dist/metadataGeneration/tsoa.d.ts +13 -9
- package/dist/routeGeneration/templateHelpers.d.ts +37 -20
- package/dist/routeGeneration/templateHelpers.js +76 -22
- package/dist/routeGeneration/templateHelpers.js.map +1 -1
- package/dist/routeGeneration/templates/express/expressTemplateService.d.ts +6 -4
- package/dist/routeGeneration/templates/express/expressTemplateService.js +27 -8
- package/dist/routeGeneration/templates/express/expressTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.d.ts +20 -8
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js +58 -11
- package/dist/routeGeneration/templates/hapi/hapiTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/index.d.ts +1 -1
- package/dist/routeGeneration/templates/index.js +1 -1
- package/dist/routeGeneration/templates/index.js.map +1 -1
- package/dist/routeGeneration/templates/koa/koaTemplateService.d.ts +13 -6
- package/dist/routeGeneration/templates/koa/koaTemplateService.js +55 -13
- package/dist/routeGeneration/templates/koa/koaTemplateService.js.map +1 -1
- package/dist/routeGeneration/templates/templateService.d.ts +9 -4
- package/dist/routeGeneration/templates/templateService.js +39 -1
- package/dist/routeGeneration/templates/templateService.js.map +1 -1
- package/dist/swagger/swagger.d.ts +42 -41
- package/dist/swagger/swagger.js +4 -0
- package/dist/swagger/swagger.js.map +1 -1
- package/package.json +3 -3
package/README.MD
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
This package contains the runtime helpers for tsoa
|
|
1
|
+
This package contains the runtime helpers for `tsoa-next`.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`tsoa-next` continues the original [`tsoa`](https://github.com/lukeautry/tsoa) project, and this package carries forward the runtime foundation established there.
|
|
4
|
+
|
|
5
|
+
For the main README and API reference, see:
|
|
6
|
+
|
|
7
|
+
- [Repository README](https://github.com/VannaDii/tsoa-next#readme)
|
|
8
|
+
- [Project documentation](https://vannadii.github.io/tsoa-next/docs/)
|
|
9
|
+
- [API reference](https://vannadii.github.io/tsoa-next/reference/)
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Swagger } from './swagger/swagger';
|
|
2
1
|
import { Options as MulterOpts } from 'multer';
|
|
2
|
+
import { Swagger } from './swagger/swagger';
|
|
3
3
|
export interface Config {
|
|
4
4
|
/**
|
|
5
5
|
* Swagger generation configuration object
|
|
@@ -26,7 +26,14 @@ export interface Config {
|
|
|
26
26
|
*/
|
|
27
27
|
noImplicitAdditionalProperties?: 'throw-on-extras' | 'silently-remove-extras' | 'ignore';
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Path to a tsconfig file used as an input source for compiler options during generation.
|
|
30
|
+
* If omitted, tsoa-next will look for tsconfig.json starting from the loaded tsoa config directory.
|
|
31
|
+
* Explicit compilerOptions in tsoa-next config still take precedence over tsconfig values.
|
|
32
|
+
*/
|
|
33
|
+
tsconfig?: string;
|
|
34
|
+
/**
|
|
35
|
+
* TypeScript CompilerOptions to be used during generation.
|
|
36
|
+
* These are merged over compiler options resolved from tsconfig.
|
|
30
37
|
*
|
|
31
38
|
* @type {Record<string, unknown>}
|
|
32
39
|
* @memberof RoutesConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function Example<T>(
|
|
1
|
+
export declare function Example<T>(_exampleModel: T, _exampleLabel?: string): PropertyDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../src/decorators/example.ts"],"names":[],"mappings":";;AAAA,0BAIC;AAJD,SAAgB,OAAO,CAAI,
|
|
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,7 +1,7 @@
|
|
|
1
|
-
export declare function Options(
|
|
2
|
-
export declare function Get(
|
|
3
|
-
export declare function Post(
|
|
4
|
-
export declare function Put(
|
|
5
|
-
export declare function Patch(
|
|
6
|
-
export declare function Delete(
|
|
7
|
-
export declare function Head(
|
|
1
|
+
export declare function Options(_value?: string): MethodDecorator;
|
|
2
|
+
export declare function Get(_value?: string): MethodDecorator;
|
|
3
|
+
export declare function Post(_value?: string): MethodDecorator;
|
|
4
|
+
export declare function Put(_value?: string): MethodDecorator;
|
|
5
|
+
export declare function Patch(_value?: string): MethodDecorator;
|
|
6
|
+
export declare function Delete(_value?: string): MethodDecorator;
|
|
7
|
+
export declare function Head(_value?: string): MethodDecorator;
|
|
@@ -7,37 +7,37 @@ exports.Put = Put;
|
|
|
7
7
|
exports.Patch = Patch;
|
|
8
8
|
exports.Delete = Delete;
|
|
9
9
|
exports.Head = Head;
|
|
10
|
-
function Options(
|
|
10
|
+
function Options(_value) {
|
|
11
11
|
return () => {
|
|
12
12
|
return;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function Get(
|
|
15
|
+
function Get(_value) {
|
|
16
16
|
return () => {
|
|
17
17
|
return;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function Post(
|
|
20
|
+
function Post(_value) {
|
|
21
21
|
return () => {
|
|
22
22
|
return;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
function Put(
|
|
25
|
+
function Put(_value) {
|
|
26
26
|
return () => {
|
|
27
27
|
return;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function Patch(
|
|
30
|
+
function Patch(_value) {
|
|
31
31
|
return () => {
|
|
32
32
|
return;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function Delete(
|
|
35
|
+
function Delete(_value) {
|
|
36
36
|
return () => {
|
|
37
37
|
return;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function Head(
|
|
40
|
+
function Head(_value) {
|
|
41
41
|
return () => {
|
|
42
42
|
return;
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":";;AAAA,0BAIC;AAED,kBAIC;AAED,oBAIC;AAED,kBAIC;AAED,sBAIC;AAED,wBAIC;AAED,oBAIC;AAxCD,SAAgB,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/decorators/methods.ts"],"names":[],"mappings":";;AAAA,0BAIC;AAED,kBAIC;AAED,oBAIC;AAED,kBAIC;AAED,sBAIC;AAED,wBAIC;AAED,oBAIC;AAxCD,SAAgB,OAAO,CAAC,MAAe;IACrC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,GAAG,CAAC,MAAe;IACjC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,IAAI,CAAC,MAAe;IAClC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,GAAG,CAAC,MAAe;IACjC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,KAAK,CAAC,MAAe;IACnC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,MAAM,CAAC,MAAe;IACpC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,IAAI,CAAC,MAAe;IAClC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type Middleware<T extends CallableFunction | object> = T;
|
|
2
|
+
type MiddlewareTarget = CallableFunction | object;
|
|
2
3
|
/**
|
|
3
4
|
* Install middlewares to the Controller or a specific method.
|
|
4
5
|
* @param middlewares
|
|
@@ -11,5 +12,5 @@ export declare function Middlewares<T extends CallableFunction | object>(...mws:
|
|
|
11
12
|
* @param target
|
|
12
13
|
* @returns list of middlewares
|
|
13
14
|
*/
|
|
14
|
-
export declare function fetchMiddlewares<T extends CallableFunction | object>(target:
|
|
15
|
+
export declare function fetchMiddlewares<T extends CallableFunction | object>(target: MiddlewareTarget): Array<Middleware<T>>;
|
|
15
16
|
export {};
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Middlewares = Middlewares;
|
|
4
4
|
exports.fetchMiddlewares = fetchMiddlewares;
|
|
5
5
|
const TSOA_MIDDLEWARES = Symbol('@tsoa:middlewares');
|
|
6
|
+
function isMiddlewareTarget(value) {
|
|
7
|
+
return typeof value === 'function' || (typeof value === 'object' && value !== null);
|
|
8
|
+
}
|
|
6
9
|
/**
|
|
7
10
|
* Helper function to create a decorator
|
|
8
11
|
* that can act as a class and method decorator.
|
|
@@ -16,13 +19,13 @@ function decorator(fn) {
|
|
|
16
19
|
return (...args) => {
|
|
17
20
|
// class decorator
|
|
18
21
|
if (args.length === 1) {
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const [target] = args;
|
|
23
|
+
fn(target);
|
|
21
24
|
}
|
|
22
|
-
else if (args.length === 3
|
|
25
|
+
else if (args.length === 3) {
|
|
23
26
|
// method decorator
|
|
24
|
-
const descriptor = args
|
|
25
|
-
if (descriptor.value) {
|
|
27
|
+
const [, , descriptor] = args;
|
|
28
|
+
if (isMiddlewareTarget(descriptor.value)) {
|
|
26
29
|
fn(descriptor.value);
|
|
27
30
|
}
|
|
28
31
|
}
|
|
@@ -48,6 +51,6 @@ function Middlewares(...mws) {
|
|
|
48
51
|
* @returns list of middlewares
|
|
49
52
|
*/
|
|
50
53
|
function fetchMiddlewares(target) {
|
|
51
|
-
return Reflect.getMetadata(TSOA_MIDDLEWARES, target)
|
|
54
|
+
return Reflect.getMetadata(TSOA_MIDDLEWARES, target) ?? [];
|
|
52
55
|
}
|
|
53
56
|
//# sourceMappingURL=middlewares.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middlewares.js","sourceRoot":"","sources":["../../src/decorators/middlewares.ts"],"names":[],"mappings":";;
|
|
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;QACxE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAsC,MAAwB;IAC5F,OAAQ,OAAO,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,CAAsC,IAAI,EAAE,CAAA;AAClG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function OperationId(
|
|
1
|
+
export declare function OperationId(_value: string): MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationid.js","sourceRoot":"","sources":["../../src/decorators/operationid.ts"],"names":[],"mappings":";;AAAA,kCAIC;AAJD,SAAgB,WAAW,CAAC,
|
|
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"}
|
|
@@ -8,7 +8,7 @@ export declare function Body(): ParameterDecorator;
|
|
|
8
8
|
*
|
|
9
9
|
* @param {string} [name] The name of the body parameter
|
|
10
10
|
*/
|
|
11
|
-
export declare function BodyProp(
|
|
11
|
+
export declare function BodyProp(_name?: string): ParameterDecorator;
|
|
12
12
|
/**
|
|
13
13
|
* Inject http request
|
|
14
14
|
*/
|
|
@@ -18,19 +18,19 @@ export declare function Request(): ParameterDecorator;
|
|
|
18
18
|
*
|
|
19
19
|
* @param {name} [name] The name of the request parameter
|
|
20
20
|
*/
|
|
21
|
-
export declare function RequestProp(
|
|
21
|
+
export declare function RequestProp(_name?: string): ParameterDecorator;
|
|
22
22
|
/**
|
|
23
23
|
* Inject value from Path
|
|
24
24
|
*
|
|
25
25
|
* @param {string} [name] The name of the path parameter
|
|
26
26
|
*/
|
|
27
|
-
export declare function Path(
|
|
27
|
+
export declare function Path(_name?: string): ParameterDecorator;
|
|
28
28
|
/**
|
|
29
29
|
* Inject value from query string
|
|
30
30
|
*
|
|
31
31
|
* @param {string} [name] The name of the query parameter
|
|
32
32
|
*/
|
|
33
|
-
export declare function Query(
|
|
33
|
+
export declare function Query(_name?: string): ParameterDecorator;
|
|
34
34
|
/**
|
|
35
35
|
* Inject all query values in a single object
|
|
36
36
|
*/
|
|
@@ -40,7 +40,7 @@ export declare function Queries(): ParameterDecorator;
|
|
|
40
40
|
*
|
|
41
41
|
* @param {string} [name] The name of the header parameter
|
|
42
42
|
*/
|
|
43
|
-
export declare function Header(
|
|
43
|
+
export declare function Header(_name?: string): ParameterDecorator;
|
|
44
44
|
/**
|
|
45
45
|
* Mark parameter as manually injected, which will not be generated
|
|
46
46
|
*/
|
|
@@ -50,19 +50,19 @@ export declare function Inject(): ParameterDecorator;
|
|
|
50
50
|
*
|
|
51
51
|
* @param {string} [name] The name of the uploaded file parameter
|
|
52
52
|
*/
|
|
53
|
-
export declare function UploadedFile(
|
|
53
|
+
export declare function UploadedFile(_name?: string): ParameterDecorator;
|
|
54
54
|
/**
|
|
55
55
|
* Inject uploaded files
|
|
56
56
|
*
|
|
57
57
|
* @param {string} [name] The name of the uploaded files parameter
|
|
58
58
|
*/
|
|
59
|
-
export declare function UploadedFiles(
|
|
59
|
+
export declare function UploadedFiles(_name?: string): ParameterDecorator;
|
|
60
60
|
/**
|
|
61
61
|
* Inject uploaded files
|
|
62
62
|
*
|
|
63
63
|
* @param {string} [name] The name of the uploaded files parameter
|
|
64
64
|
*/
|
|
65
|
-
export declare function FormField(
|
|
65
|
+
export declare function FormField(_name?: string): ParameterDecorator;
|
|
66
66
|
/**
|
|
67
67
|
* Overrides the default media type of request body.
|
|
68
68
|
* Can be used on specific method.
|
|
@@ -70,4 +70,4 @@ export declare function FormField(name?: string): ParameterDecorator;
|
|
|
70
70
|
*
|
|
71
71
|
* @link https://swagger.io/docs/specification/describing-request-body/
|
|
72
72
|
*/
|
|
73
|
-
export declare function Consumes(
|
|
73
|
+
export declare function Consumes(_value: string): MethodDecorator;
|
|
@@ -27,7 +27,7 @@ function Body() {
|
|
|
27
27
|
*
|
|
28
28
|
* @param {string} [name] The name of the body parameter
|
|
29
29
|
*/
|
|
30
|
-
function BodyProp(
|
|
30
|
+
function BodyProp(_name) {
|
|
31
31
|
return () => {
|
|
32
32
|
return;
|
|
33
33
|
};
|
|
@@ -45,7 +45,7 @@ function Request() {
|
|
|
45
45
|
*
|
|
46
46
|
* @param {name} [name] The name of the request parameter
|
|
47
47
|
*/
|
|
48
|
-
function RequestProp(
|
|
48
|
+
function RequestProp(_name) {
|
|
49
49
|
return () => {
|
|
50
50
|
return;
|
|
51
51
|
};
|
|
@@ -55,7 +55,7 @@ function RequestProp(name) {
|
|
|
55
55
|
*
|
|
56
56
|
* @param {string} [name] The name of the path parameter
|
|
57
57
|
*/
|
|
58
|
-
function Path(
|
|
58
|
+
function Path(_name) {
|
|
59
59
|
return () => {
|
|
60
60
|
return;
|
|
61
61
|
};
|
|
@@ -65,7 +65,7 @@ function Path(name) {
|
|
|
65
65
|
*
|
|
66
66
|
* @param {string} [name] The name of the query parameter
|
|
67
67
|
*/
|
|
68
|
-
function Query(
|
|
68
|
+
function Query(_name) {
|
|
69
69
|
return () => {
|
|
70
70
|
return;
|
|
71
71
|
};
|
|
@@ -83,7 +83,7 @@ function Queries() {
|
|
|
83
83
|
*
|
|
84
84
|
* @param {string} [name] The name of the header parameter
|
|
85
85
|
*/
|
|
86
|
-
function Header(
|
|
86
|
+
function Header(_name) {
|
|
87
87
|
return () => {
|
|
88
88
|
return;
|
|
89
89
|
};
|
|
@@ -101,7 +101,7 @@ function Inject() {
|
|
|
101
101
|
*
|
|
102
102
|
* @param {string} [name] The name of the uploaded file parameter
|
|
103
103
|
*/
|
|
104
|
-
function UploadedFile(
|
|
104
|
+
function UploadedFile(_name) {
|
|
105
105
|
return () => {
|
|
106
106
|
return;
|
|
107
107
|
};
|
|
@@ -111,7 +111,7 @@ function UploadedFile(name) {
|
|
|
111
111
|
*
|
|
112
112
|
* @param {string} [name] The name of the uploaded files parameter
|
|
113
113
|
*/
|
|
114
|
-
function UploadedFiles(
|
|
114
|
+
function UploadedFiles(_name) {
|
|
115
115
|
return () => {
|
|
116
116
|
return;
|
|
117
117
|
};
|
|
@@ -121,7 +121,7 @@ function UploadedFiles(name) {
|
|
|
121
121
|
*
|
|
122
122
|
* @param {string} [name] The name of the uploaded files parameter
|
|
123
123
|
*/
|
|
124
|
-
function FormField(
|
|
124
|
+
function FormField(_name) {
|
|
125
125
|
return () => {
|
|
126
126
|
return;
|
|
127
127
|
};
|
|
@@ -133,7 +133,7 @@ function FormField(name) {
|
|
|
133
133
|
*
|
|
134
134
|
* @link https://swagger.io/docs/specification/describing-request-body/
|
|
135
135
|
*/
|
|
136
|
-
function Consumes(
|
|
136
|
+
function Consumes(_value) {
|
|
137
137
|
return () => {
|
|
138
138
|
return;
|
|
139
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../src/decorators/parameter.ts"],"names":[],"mappings":";;AAIA,oBAIC;AAOD,4BAIC;AAKD,0BAIC;AAOD,kCAIC;AAOD,oBAIC;AAOD,sBAIC;AAKD,0BAIC;AAOD,wBAIC;AAKD,wBAIC;AAOD,oCAIC;AAOD,sCAIC;AAOD,8BAIC;AASD,4BAIC;AAxID;;;GAGG;AACH,SAAgB,IAAI;IAClB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../src/decorators/parameter.ts"],"names":[],"mappings":";;AAIA,oBAIC;AAOD,4BAIC;AAKD,0BAIC;AAOD,kCAIC;AAOD,oBAIC;AAOD,sBAIC;AAKD,0BAIC;AAOD,wBAIC;AAKD,wBAIC;AAOD,oCAIC;AAOD,sCAIC;AAOD,8BAIC;AASD,4BAIC;AAxID;;;GAGG;AACH,SAAgB,IAAI;IAClB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,IAAI,CAAC,KAAc;IACjC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,KAAK,CAAC,KAAc;IAClC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,MAAM,CAAC,KAAc;IACnC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM;IACpB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAc;IAC1C,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,MAAc;IACrC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IsValidHeader } from '../utils/isHeaderType';
|
|
2
2
|
import { HttpStatusCodeLiteral, HttpStatusCodeStringLiteral, OtherValidOpenApiHttpStatusCode } from '../interfaces/response';
|
|
3
|
-
export declare function SuccessResponse<HeaderType extends IsValidHeader<HeaderType> = object>(
|
|
4
|
-
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = object>(
|
|
3
|
+
export declare function SuccessResponse<HeaderType extends IsValidHeader<HeaderType> = object>(_name: string | number, _description?: string, _produces?: string | string[]): MethodDecorator;
|
|
4
|
+
export declare function Response<ExampleType, HeaderType extends IsValidHeader<HeaderType> = object>(_name: HttpStatusCodeLiteral | HttpStatusCodeStringLiteral | OtherValidOpenApiHttpStatusCode, _description?: string, _example?: ExampleType, _produces?: string | string[]): MethodDecorator & ClassDecorator;
|
|
5
5
|
/**
|
|
6
6
|
* Inject a library-agnostic responder function that can be used to construct type-checked (usually error-) responses.
|
|
7
7
|
*
|
|
@@ -14,4 +14,4 @@ export declare function Res(): ParameterDecorator;
|
|
|
14
14
|
*
|
|
15
15
|
* @link https://swagger.io/docs/specification/media-types/
|
|
16
16
|
*/
|
|
17
|
-
export declare function Produces(
|
|
17
|
+
export declare function Produces(_value: string): MethodDecorator & ClassDecorator;
|
|
@@ -4,12 +4,12 @@ exports.SuccessResponse = SuccessResponse;
|
|
|
4
4
|
exports.Response = Response;
|
|
5
5
|
exports.Res = Res;
|
|
6
6
|
exports.Produces = Produces;
|
|
7
|
-
function SuccessResponse(
|
|
7
|
+
function SuccessResponse(_name, _description, _produces) {
|
|
8
8
|
return () => {
|
|
9
9
|
return;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function Response(
|
|
12
|
+
function Response(_name, _description, _example, _produces) {
|
|
13
13
|
return () => {
|
|
14
14
|
return;
|
|
15
15
|
};
|
|
@@ -30,7 +30,7 @@ function Res() {
|
|
|
30
30
|
*
|
|
31
31
|
* @link https://swagger.io/docs/specification/media-types/
|
|
32
32
|
*/
|
|
33
|
-
function Produces(
|
|
33
|
+
function Produces(_value) {
|
|
34
34
|
return () => {
|
|
35
35
|
return;
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/decorators/response.ts"],"names":[],"mappings":";;AAGA,0CAIC;AAED,4BASC;AAOD,kBAIC;AAQD,4BAIC;AAtCD,SAAgB,eAAe,CAAwD,
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/decorators/response.ts"],"names":[],"mappings":";;AAGA,0CAIC;AAED,4BASC;AAOD,kBAIC;AAQD,4BAIC;AAtCD,SAAgB,eAAe,CAAwD,KAAsB,EAAE,YAAqB,EAAE,SAA6B;IACjK,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED,SAAgB,QAAQ,CACtB,KAA4F,EAC5F,YAAqB,EACrB,QAAsB,EACtB,SAA6B;IAE7B,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,GAAG;IACjB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,MAAc;IACrC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
package/dist/decorators/route.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/decorators/route.ts"],"names":[],"mappings":";;AAAA,sBAIC;AAKD,wBAIC;AAbD,SAAgB,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/decorators/route.ts"],"names":[],"mappings":";;AAAA,sBAIC;AAKD,wBAIC;AAbD,SAAgB,KAAK,CAAC,KAAc;IAClC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM;IACpB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -5,6 +5,6 @@ export declare function NoSecurity(): ClassDecorator & MethodDecorator;
|
|
|
5
5
|
/**
|
|
6
6
|
* @param {name} security name from securityDefinitions
|
|
7
7
|
*/
|
|
8
|
-
export declare function Security(
|
|
8
|
+
export declare function Security(_name: string | {
|
|
9
9
|
[name: string]: string[];
|
|
10
|
-
},
|
|
10
|
+
}, _scopes?: string[]): ClassDecorator & MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/decorators/security.ts"],"names":[],"mappings":";;AAGA,gCAIC;AAKD,4BAIC;AAhBD;;GAEG;AACH,SAAgB,UAAU;IACxB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/decorators/security.ts"],"names":[],"mappings":";;AAGA,gCAIC;AAKD,4BAIC;AAhBD;;GAEG;AACH,SAAgB,UAAU;IACxB,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAA4C,EAAE,OAAkB;IACvF,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function Tags(...
|
|
1
|
+
export declare function Tags(..._values: string[]): ClassDecorator & MethodDecorator;
|
package/dist/decorators/tags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/decorators/tags.ts"],"names":[],"mappings":";;AAAA,oBAIC;AAJD,SAAgB,IAAI,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/decorators/tags.ts"],"names":[],"mappings":";;AAAA,oBAIC;AAJD,SAAgB,IAAI,CAAC,GAAG,OAAiB;IACvC,OAAO,GAAG,EAAE;QACV,OAAM;IACR,CAAC,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
+
export * from './config';
|
|
2
3
|
export * from './decorators/deprecated';
|
|
3
4
|
export * from './decorators/example';
|
|
4
|
-
export * from './decorators/
|
|
5
|
+
export * from './decorators/extension';
|
|
5
6
|
export * from './decorators/methods';
|
|
6
|
-
export * from './decorators/
|
|
7
|
+
export * from './decorators/middlewares';
|
|
7
8
|
export * from './decorators/operationid';
|
|
9
|
+
export * from './decorators/parameter';
|
|
10
|
+
export * from './decorators/response';
|
|
8
11
|
export * from './decorators/route';
|
|
9
12
|
export * from './decorators/security';
|
|
10
|
-
export * from './decorators/
|
|
11
|
-
export * from './decorators/middlewares';
|
|
13
|
+
export * from './decorators/tags';
|
|
12
14
|
export * from './interfaces/controller';
|
|
13
|
-
export * from './interfaces/response';
|
|
14
|
-
export * from './interfaces/iocModule';
|
|
15
15
|
export * from './interfaces/file';
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './interfaces/iocModule';
|
|
17
|
+
export * from './interfaces/response';
|
|
17
18
|
export * from './metadataGeneration/tsoa';
|
|
18
|
-
export * from './routeGeneration/
|
|
19
|
+
export * from './routeGeneration/additionalProps';
|
|
19
20
|
export * from './routeGeneration/templateHelpers';
|
|
21
|
+
export * from './routeGeneration/templates';
|
|
20
22
|
export * from './routeGeneration/tsoa-route';
|
|
21
|
-
export * from './utils/assertNever';
|
|
22
23
|
export * from './swagger/swagger';
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './routeGeneration/additionalProps';
|
|
24
|
+
export * from './utils/assertNever';
|
package/dist/index.js
CHANGED
|
@@ -15,27 +15,27 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
require("reflect-metadata");
|
|
18
|
+
__exportStar(require("./config"), exports);
|
|
18
19
|
__exportStar(require("./decorators/deprecated"), exports);
|
|
19
20
|
__exportStar(require("./decorators/example"), exports);
|
|
20
|
-
__exportStar(require("./decorators/
|
|
21
|
+
__exportStar(require("./decorators/extension"), exports);
|
|
21
22
|
__exportStar(require("./decorators/methods"), exports);
|
|
22
|
-
__exportStar(require("./decorators/
|
|
23
|
+
__exportStar(require("./decorators/middlewares"), exports);
|
|
23
24
|
__exportStar(require("./decorators/operationid"), exports);
|
|
25
|
+
__exportStar(require("./decorators/parameter"), exports);
|
|
26
|
+
__exportStar(require("./decorators/response"), exports);
|
|
24
27
|
__exportStar(require("./decorators/route"), exports);
|
|
25
28
|
__exportStar(require("./decorators/security"), exports);
|
|
26
|
-
__exportStar(require("./decorators/
|
|
27
|
-
__exportStar(require("./decorators/middlewares"), exports);
|
|
29
|
+
__exportStar(require("./decorators/tags"), exports);
|
|
28
30
|
__exportStar(require("./interfaces/controller"), exports);
|
|
29
|
-
__exportStar(require("./interfaces/response"), exports);
|
|
30
|
-
__exportStar(require("./interfaces/iocModule"), exports);
|
|
31
31
|
__exportStar(require("./interfaces/file"), exports);
|
|
32
|
-
__exportStar(require("./
|
|
32
|
+
__exportStar(require("./interfaces/iocModule"), exports);
|
|
33
|
+
__exportStar(require("./interfaces/response"), exports);
|
|
33
34
|
__exportStar(require("./metadataGeneration/tsoa"), exports);
|
|
34
|
-
__exportStar(require("./routeGeneration/
|
|
35
|
+
__exportStar(require("./routeGeneration/additionalProps"), exports);
|
|
35
36
|
__exportStar(require("./routeGeneration/templateHelpers"), exports);
|
|
37
|
+
__exportStar(require("./routeGeneration/templates"), exports);
|
|
36
38
|
__exportStar(require("./routeGeneration/tsoa-route"), exports);
|
|
37
|
-
__exportStar(require("./utils/assertNever"), exports);
|
|
38
39
|
__exportStar(require("./swagger/swagger"), exports);
|
|
39
|
-
__exportStar(require("./
|
|
40
|
-
__exportStar(require("./routeGeneration/additionalProps"), exports);
|
|
40
|
+
__exportStar(require("./utils/assertNever"), exports);
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAAyB;AACzB,0DAAuC;AACvC,uDAAoC;AACpC,yDAAsC;AACtC,uDAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4BAAyB;AACzB,2CAAwB;AACxB,0DAAuC;AACvC,uDAAoC;AACpC,yDAAsC;AACtC,uDAAoC;AACpC,2DAAwC;AACxC,2DAAwC;AACxC,yDAAsC;AACtC,wDAAqC;AACrC,qDAAkC;AAClC,wDAAqC;AACrC,oDAAiC;AACjC,0DAAuC;AACvC,oDAAiC;AACjC,yDAAsC;AACtC,wDAAqC;AACrC,4DAAyC;AACzC,oEAAiD;AACjD,oEAAiD;AACjD,8DAA2C;AAC3C,+DAA4C;AAC5C,oDAAiC;AACjC,sDAAmC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export type Newable<T = unknown, TArgs extends unknown[] =
|
|
1
|
+
export type Newable<T = unknown, TArgs extends unknown[] = unknown[]> = new (...args: TArgs) => T;
|
|
2
2
|
export type ServiceIdentifier<T = unknown> = string | symbol | Newable<T> | Function;
|
|
3
3
|
export interface IocContainer {
|
|
4
4
|
get<T>(controller: ServiceIdentifier<T>): T;
|
|
5
5
|
get<T>(controller: ServiceIdentifier<T>): Promise<T>;
|
|
6
6
|
}
|
|
7
|
-
export type IocContainerFactory<T =
|
|
7
|
+
export type IocContainerFactory<T = unknown> = {
|
|
8
|
+
bivarianceHack(request: T): IocContainer;
|
|
9
|
+
}['bivarianceHack'];
|
|
@@ -2,4 +2,4 @@ import { IsValidHeader } from '../utils/isHeaderType';
|
|
|
2
2
|
export type HttpStatusCodeLiteral = 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
3
3
|
export type HttpStatusCodeStringLiteral = `${HttpStatusCodeLiteral}`;
|
|
4
4
|
export type OtherValidOpenApiHttpStatusCode = '1XX' | '2XX' | '3XX' | '4XX' | '5XX' | 'default';
|
|
5
|
-
export type TsoaResponse<T extends HttpStatusCodeLiteral, BodyType, HeaderType extends IsValidHeader<HeaderType> = object> = (status: T, data: BodyType, headers?: HeaderType) =>
|
|
5
|
+
export type TsoaResponse<T extends HttpStatusCodeLiteral, BodyType, HeaderType extends IsValidHeader<HeaderType> = object, ReturnType = never> = (status: T, data: BodyType, headers?: HeaderType) => ReturnType;
|