diff --git a/package-lock.json b/package-lock.json index a908c9147..68d13836d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2427,9 +2427,9 @@ } }, "node_modules/@types/qs": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.14.tgz", - "integrity": "sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", "dev": true }, "node_modules/@types/semver": { @@ -12140,24 +12140,24 @@ } }, "node_modules/ts-json-schema-generator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.0.1.tgz", - "integrity": "sha512-0sWa9uXFzkcZS/0LV4BLB91elC+2brg6JyIYXZEUCs6P7Z/BXuhUutxO4ssg7Kb9Xe4dzQXsc5IAmOHt7IETmA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.1.0.tgz", + "integrity": "sha512-w0Mlotd5SIUEGpXcg54UwpTRLXNtUaItt1XQO7mpW63TeV6gKmaGIInENxgccpUkj/ReBxbRoZAN79YU2Mc3YA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.15", "commander": "^12.0.0", - "glob": "^8.0.3", + "glob": "^10.3.12", "json5": "^2.2.3", "normalize-path": "^3.0.0", "safe-stable-stringify": "^2.4.3", - "typescript": "~5.4.5" + "typescript": "^5.4.5" }, "bin": { "ts-json-schema-generator": "bin/ts-json-schema-generator" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0" } }, "node_modules/ts-json-schema-generator/node_modules/commander": { @@ -12170,32 +12170,49 @@ } }, "node_modules/ts-json-schema-generator/node_modules/glob": { - "version": "8.1.0", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dev": true, - "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.6", + "minimatch": "^9.0.1", + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/ts-json-schema-generator/node_modules/minimatch": { - "version": "5.1.6", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/ts-mockito": { @@ -13297,7 +13314,7 @@ "@types/lodash": "^4.17.0", "@types/luxon": "^3.4.2", "@types/qrcode": "^1.5.5", - "ts-json-schema-generator": "^2.0.1" + "ts-json-schema-generator": "^2.1.0" } }, "packages/transport": { @@ -13330,7 +13347,7 @@ "@types/json-stringify-safe": "^5.0.3", "@types/lodash": "^4.17.0", "@types/luxon": "^3.4.2", - "@types/qs": "^6.9.14", + "@types/qs": "^6.9.15", "@types/uuid": "^9.0.8", "expect": "^29.7.0", "ts-mockito": "^2.6.1" diff --git a/packages/runtime/package.json b/packages/runtime/package.json index db77baf5b..8b6fbb263 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -88,7 +88,7 @@ "@types/lodash": "^4.17.0", "@types/luxon": "^3.4.2", "@types/qrcode": "^1.5.5", - "ts-json-schema-generator": "^2.0.1" + "ts-json-schema-generator": "^2.1.0" }, "publishConfig": { "access": "public", diff --git a/packages/runtime/scripts/buildSchemas.js b/packages/runtime/scripts/buildSchemas.js index 7da690e5f..015e62008 100644 --- a/packages/runtime/scripts/buildSchemas.js +++ b/packages/runtime/scripts/buildSchemas.js @@ -1,34 +1,35 @@ -const tsj = require("ts-json-schema-generator"); const fs = require("fs"); const path = require("path"); -const config = { - tsconfig: path.join(__dirname, "../tsconfig.json"), - type: "*", - extraTags: ["errorMessage"] -}; +import("ts-json-schema-generator").then((tsj) => { + const config = { + tsconfig: path.join(__dirname, "../tsconfig.json"), + type: "*", + extraTags: ["errorMessage"] + }; -const schemaGenerator = tsj.createGenerator(config); + const schemaGenerator = tsj.createGenerator(config); -const requestTypes = schemaGenerator - .getRootNodes() - .map((x) => x.symbol.escapedName) - .filter((x) => x.endsWith("Request")); + const requestTypes = schemaGenerator + .getRootNodes() + .map((x) => x.symbol.escapedName) + .filter((x) => x.endsWith("Request")); -const schemaDeclarations = requestTypes - .map((type) => { - try { - const schema = schemaGenerator.createSchema(type); - return `export const ${type}: any = ${JSON.stringify(schema, undefined, 4)}`; - } catch (e) { - if (!(e instanceof tsj.NoRootTypeError)) throw e; - } - }) - .filter((s) => s) - .join("\n\n"); + const schemaDeclarations = requestTypes + .map((type) => { + try { + const schema = schemaGenerator.createSchema(type); + return `export const ${type}: any = ${JSON.stringify(schema, undefined, 4)}`; + } catch (e) { + if (!(e instanceof tsj.NoRootTypeError)) throw e; + } + }) + .filter((s) => s) + .join("\n\n"); -const output_path = path.join(__dirname, "../src/useCases/common/Schemas.ts"); + const output_path = path.join(__dirname, "../src/useCases/common/Schemas.ts"); -fs.writeFile(output_path, schemaDeclarations, (err) => { - if (err) throw err; + fs.writeFile(output_path, schemaDeclarations, (err) => { + if (err) throw err; + }); }); diff --git a/packages/transport/package.json b/packages/transport/package.json index e5b2b1838..0cf9bef5c 100644 --- a/packages/transport/package.json +++ b/packages/transport/package.json @@ -92,7 +92,7 @@ "@types/json-stringify-safe": "^5.0.3", "@types/lodash": "^4.17.0", "@types/luxon": "^3.4.2", - "@types/qs": "^6.9.14", + "@types/qs": "^6.9.15", "@types/uuid": "^9.0.8", "expect": "^29.7.0", "ts-mockito": "^2.6.1"