@nestia/core 2.5.9-dev.20240223 → 2.5.9
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.
|
@@ -1,16 +1,64 @@
|
|
|
1
1
|
import { ISwagger } from "../structures/ISwagger";
|
|
2
2
|
import { ISwaggerRoute } from "../structures/ISwaggerRoute";
|
|
3
|
+
/**
|
|
4
|
+
* Swagger customization decorator.
|
|
5
|
+
*
|
|
6
|
+
* `SwaggerCustomizer` is a method decorator function which can used for
|
|
7
|
+
* customizing the swagger data with `npx nestia swagger` command. Furthermore,
|
|
8
|
+
* it is possible to add plugin properties starting with `x-` characters.
|
|
9
|
+
*
|
|
10
|
+
* In other words, this decorator function does not affect to the runtime,
|
|
11
|
+
* but only for the swagger data customization.
|
|
12
|
+
*
|
|
13
|
+
* @param closure Callback function which can customize the swagger data
|
|
14
|
+
* @returns Method decorator
|
|
15
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
16
|
+
*/
|
|
3
17
|
export declare function SwaggerCustomizer(closure: (props: SwaggerCustomizer.IProps) => unknown): MethodDecorator;
|
|
4
18
|
export declare namespace SwaggerCustomizer {
|
|
19
|
+
/**
|
|
20
|
+
* Properties for the `SwaggerCustomizer` decorator.
|
|
21
|
+
*
|
|
22
|
+
* `SwaggerCustomizer.IProps` is a type for the `closure` parameter of the
|
|
23
|
+
* `SwaggerCustomizer` decorator. It's a callback function which can customize
|
|
24
|
+
* the swagger data.
|
|
25
|
+
*/
|
|
5
26
|
interface IProps {
|
|
27
|
+
/**
|
|
28
|
+
* Swagger data.
|
|
29
|
+
*/
|
|
6
30
|
swagger: ISwagger;
|
|
31
|
+
/**
|
|
32
|
+
* Method of the route.
|
|
33
|
+
*/
|
|
7
34
|
method: string;
|
|
35
|
+
/**
|
|
36
|
+
* Path of the route.
|
|
37
|
+
*/
|
|
8
38
|
path: string;
|
|
39
|
+
/**
|
|
40
|
+
* Route data.
|
|
41
|
+
*/
|
|
9
42
|
route: ISwaggerRoute;
|
|
43
|
+
/**
|
|
44
|
+
* Get neighbor route data.
|
|
45
|
+
*
|
|
46
|
+
* @param accessor Accessor for getting neighbor route data
|
|
47
|
+
* @returns Neighbor route data
|
|
48
|
+
*/
|
|
10
49
|
get(accessor: IAccessor): ISwaggerRoute | undefined;
|
|
11
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Accessor for getting neighbor route data.
|
|
53
|
+
*/
|
|
12
54
|
interface IAccessor {
|
|
55
|
+
/**
|
|
56
|
+
* Path of the neighbor route.
|
|
57
|
+
*/
|
|
13
58
|
path: string;
|
|
59
|
+
/**
|
|
60
|
+
* Method of the neighbor route.
|
|
61
|
+
*/
|
|
14
62
|
method: string;
|
|
15
63
|
}
|
|
16
64
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SwaggerCustomizer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Swagger customization decorator.
|
|
6
|
+
*
|
|
7
|
+
* `SwaggerCustomizer` is a method decorator function which can used for
|
|
8
|
+
* customizing the swagger data with `npx nestia swagger` command. Furthermore,
|
|
9
|
+
* it is possible to add plugin properties starting with `x-` characters.
|
|
10
|
+
*
|
|
11
|
+
* In other words, this decorator function does not affect to the runtime,
|
|
12
|
+
* but only for the swagger data customization.
|
|
13
|
+
*
|
|
14
|
+
* @param closure Callback function which can customize the swagger data
|
|
15
|
+
* @returns Method decorator
|
|
16
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
17
|
+
*/
|
|
4
18
|
function SwaggerCustomizer(closure) {
|
|
5
19
|
return function SwaggerCustomizer(target, propertyKey, descriptor) {
|
|
6
20
|
Reflect.defineMetadata("nestia/SwaggerCustomizer", closure, target, propertyKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerCustomizer.js","sourceRoot":"","sources":["../../src/decorators/SwaggerCustomizer.ts"],"names":[],"mappings":";;;AAGA,SAAgB,iBAAiB,CAC/B,OAAqD;IAErD,OAAO,SAAS,iBAAiB,CAC/B,MAAc,EACd,WAA4B,EAC5B,UAAwC;QAExC,OAAO,CAAC,cAAc,CACpB,0BAA0B,EAC1B,OAAO,EACP,MAAM,EACN,WAAW,CACZ,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAhBD,8CAgBC"}
|
|
1
|
+
{"version":3,"file":"SwaggerCustomizer.js","sourceRoot":"","sources":["../../src/decorators/SwaggerCustomizer.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;GAaG;AACH,SAAgB,iBAAiB,CAC/B,OAAqD;IAErD,OAAO,SAAS,iBAAiB,CAC/B,MAAc,EACd,WAA4B,EAC5B,UAAwC;QAExC,OAAO,CAAC,cAAc,CACpB,0BAA0B,EAC1B,OAAO,EACP,MAAM,EACN,WAAW,CACZ,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAhBD,8CAgBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/core",
|
|
3
|
-
"version": "2.5.9
|
|
3
|
+
"version": "2.5.9",
|
|
4
4
|
"description": "Super-fast validation decorators of NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://nestia.io",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nestia/fetcher": "^2.5.9
|
|
39
|
+
"@nestia/fetcher": "^2.5.9",
|
|
40
40
|
"@nestjs/common": ">=7.0.1",
|
|
41
41
|
"@nestjs/core": ">=7.0.1",
|
|
42
42
|
"detect-ts-node": "^1.0.5",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"typia": "^5.4.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@nestia/fetcher": ">=2.5.9
|
|
51
|
+
"@nestia/fetcher": ">=2.5.9",
|
|
52
52
|
"@nestjs/common": ">=7.0.1",
|
|
53
53
|
"@nestjs/core": ">=7.0.1",
|
|
54
54
|
"reflect-metadata": ">=0.1.12",
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ISwagger } from "../structures/ISwagger";
|
|
2
2
|
import { ISwaggerRoute } from "../structures/ISwaggerRoute";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Swagger customization decorator.
|
|
6
|
+
*
|
|
7
|
+
* `SwaggerCustomizer` is a method decorator function which can used for
|
|
8
|
+
* customizing the swagger data with `npx nestia swagger` command. Furthermore,
|
|
9
|
+
* it is possible to add plugin properties starting with `x-` characters.
|
|
10
|
+
*
|
|
11
|
+
* In other words, this decorator function does not affect to the runtime,
|
|
12
|
+
* but only for the swagger data customization.
|
|
13
|
+
*
|
|
14
|
+
* @param closure Callback function which can customize the swagger data
|
|
15
|
+
* @returns Method decorator
|
|
16
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
17
|
+
*/
|
|
4
18
|
export function SwaggerCustomizer(
|
|
5
19
|
closure: (props: SwaggerCustomizer.IProps) => unknown,
|
|
6
20
|
): MethodDecorator {
|
|
@@ -19,15 +33,55 @@ export function SwaggerCustomizer(
|
|
|
19
33
|
};
|
|
20
34
|
}
|
|
21
35
|
export namespace SwaggerCustomizer {
|
|
36
|
+
/**
|
|
37
|
+
* Properties for the `SwaggerCustomizer` decorator.
|
|
38
|
+
*
|
|
39
|
+
* `SwaggerCustomizer.IProps` is a type for the `closure` parameter of the
|
|
40
|
+
* `SwaggerCustomizer` decorator. It's a callback function which can customize
|
|
41
|
+
* the swagger data.
|
|
42
|
+
*/
|
|
22
43
|
export interface IProps {
|
|
44
|
+
/**
|
|
45
|
+
* Swagger data.
|
|
46
|
+
*/
|
|
23
47
|
swagger: ISwagger;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Method of the route.
|
|
51
|
+
*/
|
|
24
52
|
method: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Path of the route.
|
|
56
|
+
*/
|
|
25
57
|
path: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Route data.
|
|
61
|
+
*/
|
|
26
62
|
route: ISwaggerRoute;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get neighbor route data.
|
|
66
|
+
*
|
|
67
|
+
* @param accessor Accessor for getting neighbor route data
|
|
68
|
+
* @returns Neighbor route data
|
|
69
|
+
*/
|
|
27
70
|
get(accessor: IAccessor): ISwaggerRoute | undefined;
|
|
28
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Accessor for getting neighbor route data.
|
|
75
|
+
*/
|
|
29
76
|
export interface IAccessor {
|
|
77
|
+
/**
|
|
78
|
+
* Path of the neighbor route.
|
|
79
|
+
*/
|
|
30
80
|
path: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Method of the neighbor route.
|
|
84
|
+
*/
|
|
31
85
|
method: string;
|
|
32
86
|
}
|
|
33
87
|
}
|