@tsed/schema 6.131.1 → 6.132.0
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.
|
@@ -27,13 +27,19 @@ const jsonEntityFn_1 = require("../common/jsonEntityFn");
|
|
|
27
27
|
*/
|
|
28
28
|
function Deprecated(deprecated = true) {
|
|
29
29
|
return (0, jsonEntityFn_1.JsonEntityFn)((store, args) => {
|
|
30
|
-
switch (
|
|
30
|
+
switch ((0, core_1.decoratorTypeOf)(args)) {
|
|
31
31
|
case core_1.DecoratorTypes.METHOD:
|
|
32
32
|
store.operation.deprecated(deprecated);
|
|
33
33
|
break;
|
|
34
34
|
case core_1.DecoratorTypes.CLASS:
|
|
35
35
|
(0, core_1.decorateMethodsOf)(args[0], Deprecated(deprecated));
|
|
36
36
|
break;
|
|
37
|
+
case core_1.DecoratorTypes.PARAM:
|
|
38
|
+
store.parameter.set("deprecated", deprecated);
|
|
39
|
+
break;
|
|
40
|
+
case core_1.DecoratorTypes.PROP:
|
|
41
|
+
store.schema.set("deprecated", deprecated);
|
|
42
|
+
break;
|
|
37
43
|
default:
|
|
38
44
|
throw new core_1.UnsupportedDecoratorType(Deprecated, args);
|
|
39
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,yDAAoD;AAIpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CAAC,aAAsB,IAAI;IACnD,OAAO,IAAA,2BAAY,EAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,qBAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBACtE,MAAM;YACR,KAAK,qBAAc,CAAC,IAAI;gBACrB,KAA2B,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAClE,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACxD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AApBD,gCAoBC","sourcesContent":["import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\nimport {JsonPropertyStore} from \"../../domain/JsonPropertyStore\";\nimport {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add deprecated metadata on the decorated element.\n *\n * ## Examples\n *\n * ```typescript\n *\n * @Deprecated()\n * class MyCtrl {\n * @Deprecated()\n * @Get(\"/\")\n * method(){\n * }\n * }\n * ```\n *\n * @param deprecated\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function Deprecated(deprecated: boolean = true) {\n return JsonEntityFn((store, args) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n store.operation!.deprecated(deprecated);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Deprecated(deprecated));\n break;\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.set(\"deprecated\", deprecated);\n break;\n case DecoratorTypes.PROP:\n (store as JsonPropertyStore).schema.set(\"deprecated\", deprecated);\n break;\n\n default:\n throw new UnsupportedDecoratorType(Deprecated, args);\n }\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
|
|
1
|
+
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
|
|
2
2
|
import { JsonEntityFn } from "../common/jsonEntityFn.js";
|
|
3
3
|
/**
|
|
4
4
|
* Add deprecated metadata on the decorated element.
|
|
@@ -24,13 +24,19 @@ import { JsonEntityFn } from "../common/jsonEntityFn.js";
|
|
|
24
24
|
*/
|
|
25
25
|
export function Deprecated(deprecated = true) {
|
|
26
26
|
return JsonEntityFn((store, args) => {
|
|
27
|
-
switch (
|
|
27
|
+
switch (decoratorTypeOf(args)) {
|
|
28
28
|
case DecoratorTypes.METHOD:
|
|
29
29
|
store.operation.deprecated(deprecated);
|
|
30
30
|
break;
|
|
31
31
|
case DecoratorTypes.CLASS:
|
|
32
32
|
decorateMethodsOf(args[0], Deprecated(deprecated));
|
|
33
33
|
break;
|
|
34
|
+
case DecoratorTypes.PARAM:
|
|
35
|
+
store.parameter.set("deprecated", deprecated);
|
|
36
|
+
break;
|
|
37
|
+
case DecoratorTypes.PROP:
|
|
38
|
+
store.schema.set("deprecated", deprecated);
|
|
39
|
+
break;
|
|
34
40
|
default:
|
|
35
41
|
throw new UnsupportedDecoratorType(Deprecated, args);
|
|
36
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../../src/decorators/operations/deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACxG,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAIpD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,UAAU,CAAC,aAAsB,IAAI;IACnD,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAClC,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,cAAc,CAAC,MAAM;gBACxB,KAAK,CAAC,SAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACxC,MAAM;YACR,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBACtE,MAAM;YACR,KAAK,cAAc,CAAC,IAAI;gBACrB,KAA2B,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAClE,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;SACxD;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} from \"../common/jsonEntityFn\";\nimport {JsonPropertyStore} from \"../../domain/JsonPropertyStore\";\nimport {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add deprecated metadata on the decorated element.\n *\n * ## Examples\n *\n * ```typescript\n *\n * @Deprecated()\n * class MyCtrl {\n * @Deprecated()\n * @Get(\"/\")\n * method(){\n * }\n * }\n * ```\n *\n * @param deprecated\n * @decorator\n * @swagger\n * @schema\n * @operation\n */\nexport function Deprecated(deprecated: boolean = true) {\n return JsonEntityFn((store, args) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n store.operation!.deprecated(deprecated);\n break;\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], Deprecated(deprecated));\n break;\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.set(\"deprecated\", deprecated);\n break;\n case DecoratorTypes.PROP:\n (store as JsonPropertyStore).schema.set(\"deprecated\", deprecated);\n break;\n\n default:\n throw new UnsupportedDecoratorType(Deprecated, args);\n }\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.132.0",
|
|
4
4
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"tsed"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tsed/openspec": "6.
|
|
35
|
+
"@tsed/openspec": "6.132.0",
|
|
36
36
|
"change-case": "^4.1.2",
|
|
37
37
|
"fs-extra": "^10.0.1",
|
|
38
38
|
"json-schema": "0.4.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
45
|
-
"@tsed/core": "6.
|
|
46
|
-
"@tsed/openspec": "6.
|
|
45
|
+
"@tsed/core": "6.132.0",
|
|
46
|
+
"@tsed/openspec": "6.132.0",
|
|
47
47
|
"@types/fs-extra": "9.0.13",
|
|
48
48
|
"@types/json-schema": "7.0.11",
|
|
49
49
|
"@types/micromatch": "4.0.2",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"api-spec-converter": "2.12.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@tsed/core": "^6.
|
|
55
|
-
"@tsed/openspec": "^6.
|
|
54
|
+
"@tsed/core": "^6.132.0",
|
|
55
|
+
"@tsed/openspec": "^6.132.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@tsed/openspec": {
|