ts-deco 1.0.30 → 1.0.31
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/src/decorators/controllers/lib/resource.decorator.d.ts.map +1 -1
- package/dist/src/decorators/controllers/lib/resource.decorator.js +5 -8
- package/dist/src/decorators/controllers/lib/resource.decorator.js.map +1 -1
- package/dist/src/decorators/controllers/utils/parse-resource-args.d.ts +0 -4
- package/dist/src/decorators/controllers/utils/parse-resource-args.d.ts.map +1 -1
- package/dist/src/decorators/controllers/utils/parse-resource-args.js +9 -2
- package/dist/src/decorators/controllers/utils/parse-resource-args.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/controllers/lib/resource.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,MAAM,GAAG,eAAe,EACtC,IAAI,CAAC,EAAE,MAAM,GACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"resource.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/controllers/lib/resource.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,MAAM,GAAG,eAAe,EACtC,IAAI,CAAC,EAAE,MAAM,GACZ,cAAc,CAiChB"}
|
|
@@ -40,19 +40,16 @@ function Resource(tagOrOptions, path) {
|
|
|
40
40
|
const controllerOptions = {};
|
|
41
41
|
if (tag)
|
|
42
42
|
controllerOptions.tag = tag;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
controllerOptions.path = resolvedPath;
|
|
43
|
+
if (controllerPath)
|
|
44
|
+
controllerOptions.path = controllerPath;
|
|
45
|
+
const resolvedPath = controllerPath ?? "";
|
|
47
46
|
// 1. NestJS 라우팅용 @Controller() - @nestjs/common 있을 때만 적용
|
|
48
47
|
const NestController = (0, nest_utils_1.getNestController)();
|
|
49
48
|
if (NestController) {
|
|
50
49
|
decorators.push(NestController(resolvedPath));
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
decorators.push((0, controller_decorator_1.Controller)(controllerOptions));
|
|
55
|
-
}
|
|
51
|
+
// 2. ts-deco Controller (Swagger 메타데이터 - CONTROLLER_PATH, DOC_TAGS)
|
|
52
|
+
decorators.push((0, controller_decorator_1.Controller)(controllerOptions));
|
|
56
53
|
}
|
|
57
54
|
if (extraTags && extraTags.length > 0) {
|
|
58
55
|
decorators.push((0, doc_tags_decorator_1.DocTags)(...extraTags));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.decorator.js","sourceRoot":"","sources":["../../../../../src/decorators/controllers/lib/resource.decorator.ts"],"names":[],"mappings":";;AAuCA,
|
|
1
|
+
{"version":3,"file":"resource.decorator.js","sourceRoot":"","sources":["../../../../../src/decorators/controllers/lib/resource.decorator.ts"],"names":[],"mappings":";;AAuCA,4BAoCC;AA3ED,4BAA0B;AAC1B,mEAA+D;AAC/D,iEAAoD;AACpD,6DAA+C;AAC/C,oDAAwD;AAKxD,sEAAiE;AAIjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,QAAQ,CACtB,YAAsC,EACtC,IAAa;IAEb,MAAM,UAAU,GAAqB,EAAE,CAAC;IACxC,MAAM,EACJ,GAAG,EACH,IAAI,EAAE,cAAc,EACpB,SAAS,GACV,GAAG,IAAA,uCAAiB,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAE1C,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;QAC1B,MAAM,iBAAiB,GAAsB,EAAE,CAAC;QAChD,IAAI,GAAG;YAAE,iBAAiB,CAAC,GAAG,GAAG,GAAG,CAAC;QACrC,IAAI,cAAc;YAAE,iBAAiB,CAAC,IAAI,GAAG,cAAc,CAAC;QAC5D,MAAM,YAAY,GAAG,cAAc,IAAI,EAAE,CAAC;QAC1C,yDAAyD;QACzD,MAAM,cAAc,GAAG,IAAA,8BAAiB,GAAE,CAAC;QAC3C,IAAI,cAAc,EAAE,CAAC;YACnB,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAmB,CAAC,CAAC;QAClE,CAAC;QACD,oEAAoE;QACpE,UAAU,CAAC,IAAI,CAAC,IAAA,iCAAU,EAAC,iBAAiB,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC,IAAA,4BAAO,EAAC,GAAG,SAAS,CAAmB,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,UAAU,MAAW;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,IAAA,kCAAe,EAAC,GAAG,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -4,9 +4,5 @@ export interface ParseResourceArgsResult {
|
|
|
4
4
|
path?: string;
|
|
5
5
|
extraTags?: string[];
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Resource 데코레이터 인자 파싱
|
|
9
|
-
* (tagOrOptions: string | ResourceOptions, path?) => { tag?, path?, extraTags? }
|
|
10
|
-
*/
|
|
11
7
|
export declare function parseResourceArgs(tagOrOptions: string | ResourceOptions, path?: string): ParseResourceArgsResult;
|
|
12
8
|
//# sourceMappingURL=parse-resource-args.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-resource-args.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/controllers/utils/parse-resource-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"parse-resource-args.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/controllers/utils/parse-resource-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAUD,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,GAAG,eAAe,EACtC,IAAI,CAAC,EAAE,MAAM,GACZ,uBAAuB,CAczB"}
|
|
@@ -5,13 +5,20 @@ exports.parseResourceArgs = parseResourceArgs;
|
|
|
5
5
|
* Resource 데코레이터 인자 파싱
|
|
6
6
|
* (tagOrOptions: string | ResourceOptions, path?) => { tag?, path?, extraTags? }
|
|
7
7
|
*/
|
|
8
|
+
function toPathFromTag(tag) {
|
|
9
|
+
return `/${tag.toLowerCase().replace(/\s+/g, "-")}`;
|
|
10
|
+
}
|
|
8
11
|
function parseResourceArgs(tagOrOptions, path) {
|
|
9
12
|
if (typeof tagOrOptions === "string") {
|
|
10
|
-
return {
|
|
13
|
+
return {
|
|
14
|
+
tag: tagOrOptions,
|
|
15
|
+
path: path ?? toPathFromTag(tagOrOptions),
|
|
16
|
+
};
|
|
11
17
|
}
|
|
12
18
|
return {
|
|
13
19
|
tag: tagOrOptions.tag,
|
|
14
|
-
path: tagOrOptions.path
|
|
20
|
+
path: tagOrOptions.path ??
|
|
21
|
+
(tagOrOptions.tag ? toPathFromTag(tagOrOptions.tag) : undefined),
|
|
15
22
|
extraTags: tagOrOptions.extraTags,
|
|
16
23
|
};
|
|
17
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-resource-args.js","sourceRoot":"","sources":["../../../../../src/decorators/controllers/utils/parse-resource-args.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"parse-resource-args.js","sourceRoot":"","sources":["../../../../../src/decorators/controllers/utils/parse-resource-args.ts"],"names":[],"mappings":";;AAgBA,8CAiBC;AAzBD;;;GAGG;AACH,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,SAAgB,iBAAiB,CAC/B,YAAsC,EACtC,IAAa;IAEb,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO;YACL,GAAG,EAAE,YAAY;YACjB,IAAI,EAAE,IAAI,IAAI,aAAa,CAAC,YAAY,CAAC;SAC1C,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,IAAI,EACF,YAAY,CAAC,IAAI;YACjB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,SAAS,EAAE,YAAY,CAAC,SAAS;KAClC,CAAC;AACJ,CAAC"}
|