@tsed/schema 6.105.1 → 6.105.4
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.
|
@@ -4,9 +4,10 @@ exports.getOperationsRoutes = void 0;
|
|
|
4
4
|
const getOperationsStores_1 = require("./getOperationsStores");
|
|
5
5
|
const JsonOperationRoute_1 = require("../domain/JsonOperationRoute");
|
|
6
6
|
const getJsonEntityStore_1 = require("./getJsonEntityStore");
|
|
7
|
+
const concatPath_1 = require("./concatPath");
|
|
7
8
|
function getOperationsRoutes(token, options = {}) {
|
|
8
9
|
const store = token.isStore ? token : (0, getJsonEntityStore_1.getJsonEntityStore)(token);
|
|
9
|
-
const basePath = ((options.basePath
|
|
10
|
+
const basePath = (0, concatPath_1.concatPath)(options.basePath, store.path);
|
|
10
11
|
let operationsRoutes = [];
|
|
11
12
|
if (options.withChildren) {
|
|
12
13
|
const children = store.get("childrenControllers", []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOperationsRoutes.js","sourceRoot":"","sources":["../../../src/utils/getOperationsRoutes.ts"],"names":[],"mappings":";;;AAEA,+DAA0D;AAC1D,qEAAgE;AAEhE,6DAAwD;
|
|
1
|
+
{"version":3,"file":"getOperationsRoutes.js","sourceRoot":"","sources":["../../../src/utils/getOperationsRoutes.ts"],"names":[],"mappings":";;;AAEA,+DAA0D;AAC1D,qEAAgE;AAEhE,6DAAwD;AACxD,6CAAwC;AAOxC,SAAgB,mBAAmB,CACjC,KAAsB,EACtB,UAAsC,EAAE;IAExC,MAAM,KAAK,GAAoB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,uCAAkB,EAAC,KAAK,CAAC,CAAC;IACjF,MAAM,QAAQ,GAAG,IAAA,uBAAU,EAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,IAAI,gBAAgB,GAAiC,EAAE,CAAC;IAExD,IAAI,OAAO,CAAC,YAAY,EAAE;QACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAS,qBAAqB,EAAE,EAAE,CAAC,CAAC;QAE9D,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE;YAC7D,OAAO,gBAAgB,CAAC,MAAM,CAC5B,mBAAmB,CAAC,KAAK,EAAE;gBACzB,GAAG,OAAO;gBACV,QAAQ;aACT,CAAC,CACH,CAAC;QACJ,CAAC,EAAE,gBAAgB,CAAC,CAAC;KACtB;IAED,OAAO,CAAC,GAAG,IAAA,yCAAmB,EAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;QAC1E,MAAM,EAAC,SAAS,EAAC,GAAG,QAAQ,CAAC;QAE7B,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBACjD,MAAM,CAAC,IAAI,CACT,IAAI,uCAAkB,CAAS;oBAC7B,QAAQ;oBACR,KAAK;oBACL,QAAQ;oBACR,aAAa;iBACd,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvB,CAAC;AAvCD,kDAuCC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonMethodStore} from \"../domain/JsonMethodStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {JsonOperationRoute} from \"../domain/JsonOperationRoute\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {concatPath} from \"./concatPath\";\n\nexport interface GetOperationsRoutesOptions {\n withChildren?: boolean;\n basePath?: string;\n}\n\nexport function getOperationsRoutes<Entity extends JsonMethodStore = JsonMethodStore>(\n token: Type<any> | any,\n options: GetOperationsRoutesOptions = {}\n): JsonOperationRoute<Entity>[] {\n const store: JsonEntityStore = token.isStore ? token : getJsonEntityStore(token);\n const basePath = concatPath(options.basePath, store.path);\n let operationsRoutes: JsonOperationRoute<Entity>[] = [];\n\n if (options.withChildren) {\n const children = store.get<Type[]>(\"childrenControllers\", []);\n\n operationsRoutes = children.reduce((operationsRoutes, token) => {\n return operationsRoutes.concat(\n getOperationsRoutes(token, {\n ...options,\n basePath\n })\n );\n }, operationsRoutes);\n }\n\n return [...getOperationsStores(token).values()].reduce((routes, endpoint) => {\n const {operation} = endpoint;\n\n if (operation) {\n operation.operationPaths.forEach((operationPath) => {\n routes.push(\n new JsonOperationRoute<Entity>({\n basePath,\n token,\n endpoint,\n operationPath\n })\n );\n });\n }\n\n return routes;\n }, operationsRoutes);\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getOperationsStores } from "./getOperationsStores.js";
|
|
2
2
|
import { JsonOperationRoute } from "../domain/JsonOperationRoute.js";
|
|
3
3
|
import { getJsonEntityStore } from "./getJsonEntityStore.js";
|
|
4
|
+
import { concatPath } from "./concatPath.js";
|
|
4
5
|
export function getOperationsRoutes(token, options = {}) {
|
|
5
6
|
const store = token.isStore ? token : getJsonEntityStore(token);
|
|
6
|
-
const basePath = (
|
|
7
|
+
const basePath = concatPath(options.basePath, store.path);
|
|
7
8
|
let operationsRoutes = [];
|
|
8
9
|
if (options.withChildren) {
|
|
9
10
|
const children = store.get("childrenControllers", []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOperationsRoutes.js","sourceRoot":"","sources":["../../../src/utils/getOperationsRoutes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":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AAE;gBACjD,MAAM,CAAC,IAAI,CACT,IAAI,kBAAkB,CAAS;oBAC7B,QAAQ;oBACR,KAAK;oBACL,QAAQ;oBACR,aAAa;iBACd,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonMethodStore} from \"../domain/JsonMethodStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {JsonOperationRoute} from \"../domain/JsonOperationRoute\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {concatPath} from \"./concatPath\";\n\nexport interface GetOperationsRoutesOptions {\n withChildren?: boolean;\n basePath?: string;\n}\n\nexport function getOperationsRoutes<Entity extends JsonMethodStore = JsonMethodStore>(\n token: Type<any> | any,\n options: GetOperationsRoutesOptions = {}\n): JsonOperationRoute<Entity>[] {\n const store: JsonEntityStore = token.isStore ? token : getJsonEntityStore(token);\n const basePath = concatPath(options.basePath, store.path);\n let operationsRoutes: JsonOperationRoute<Entity>[] = [];\n\n if (options.withChildren) {\n const children = store.get<Type[]>(\"childrenControllers\", []);\n\n operationsRoutes = children.reduce((operationsRoutes, token) => {\n return operationsRoutes.concat(\n getOperationsRoutes(token, {\n ...options,\n basePath\n })\n );\n }, operationsRoutes);\n }\n\n return [...getOperationsStores(token).values()].reduce((routes, endpoint) => {\n const {operation} = endpoint;\n\n if (operation) {\n operation.operationPaths.forEach((operationPath) => {\n routes.push(\n new JsonOperationRoute<Entity>({\n basePath,\n token,\n endpoint,\n operationPath\n })\n );\n });\n }\n\n return routes;\n }, operationsRoutes);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "6.105.
|
|
3
|
+
"version": "6.105.4",
|
|
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.105.
|
|
35
|
+
"@tsed/openspec": "6.105.4",
|
|
36
36
|
"camel-case": "4.1.2",
|
|
37
37
|
"json-schema": "0.4.0",
|
|
38
38
|
"micromatch": "4.0.4",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@apidevtools/swagger-parser": "10.0.2",
|
|
45
|
-
"@tsed/core": "6.105.
|
|
46
|
-
"@tsed/openspec": "6.105.
|
|
45
|
+
"@tsed/core": "6.105.4",
|
|
46
|
+
"@tsed/openspec": "6.105.4",
|
|
47
47
|
"@types/fs-extra": "9.0.6",
|
|
48
48
|
"@types/json-schema": "7.0.7",
|
|
49
49
|
"@types/micromatch": "4.0.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"fs-extra": "9.0.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@tsed/core": "^6.105.
|
|
54
|
+
"@tsed/core": "^6.105.4"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"@tsed/code": {
|