diff --git a/package-lock.json b/package-lock.json index a83fd0f..e7b9dc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.23.2", - "@cyclonedx/cyclonedx-library": "^4.0.0", + "@cyclonedx/cyclonedx-library": "^1.13.3", "fast-toml": "^0.5.4", "fast-xml-parser": "^4.2.4", "help": "^3.0.2", @@ -537,7 +537,9 @@ "license": "MIT" }, "node_modules/@cyclonedx/cyclonedx-library": { - "version": "4.0.0", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/@cyclonedx/cyclonedx-library/-/cyclonedx-library-1.13.3.tgz", + "integrity": "sha512-L3i4OWc5pUbmds7dy4jdrHmVQ2qwiqdNrh62g1OpDtBxOUMbMhlGtNTK8htJOvrAeyj7oBxghpOCjHgAMpdtYQ==", "funding": [ { "type": "github", @@ -548,42 +550,16 @@ "url": "https://owasp.org/donate/?reponame=www-project-cyclonedx&title=OWASP+CycloneDX" } ], - "license": "Apache-2.0", "dependencies": { - "packageurl-js": ">=0.0.6 <0.0.8 || ^1", - "spdx-expression-parse": "^3.0.1" + "packageurl-js": ">=0.0.6 <0.0.8 || ^1" }, "engines": { "node": ">=14.0.0" }, "optionalDependencies": { - "ajv": "^8.12.0", - "ajv-formats": "^2.1.1", - "ajv-formats-draft2019": "^1.6.1", - "libxmljs2": "^0.31.0 || ^0.32.0", "xmlbuilder2": "^3.0.2" } }, - "node_modules/@cyclonedx/cyclonedx-library/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "optional": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@cyclonedx/cyclonedx-library/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "dev": true, @@ -724,31 +700,13 @@ }, "node_modules/@lukeed/csprng": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "license": "BSD-3-Clause", - "optional": true, - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, "node_modules/@mswjs/cookies": { "version": "0.2.2", "dev": true, @@ -788,44 +746,37 @@ } }, "node_modules/@nestjs/axios": { - "version": "0.0.8", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.2.tgz", + "integrity": "sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==", "dev": true, - "license": "MIT", - "dependencies": { - "axios": "0.27.2" - }, "peerDependencies": { - "@nestjs/common": "^7.0.0 || ^8.0.0", - "reflect-metadata": "^0.1.12", + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "axios": "^1.3.1", "rxjs": "^6.0.0 || ^7.0.0" } }, "node_modules/@nestjs/common": { - "version": "8.4.7", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz", + "integrity": "sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { - "axios": "0.27.2", "iterare": "1.2.1", - "tslib": "2.4.0", - "uuid": "8.3.2" + "tslib": "2.6.2", + "uid": "2.0.2" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/nest" }, "peerDependencies": { - "cache-manager": "*", "class-transformer": "*", "class-validator": "*", "reflect-metadata": "^0.1.12", "rxjs": "^7.1.0" }, "peerDependenciesMeta": { - "cache-manager": { - "optional": true - }, "class-transformer": { "optional": true }, @@ -834,11 +785,43 @@ } } }, - "node_modules/@nestjs/common/node_modules/tslib": { - "version": "2.4.0", + "node_modules/@nestjs/core": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz", + "integrity": "sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA==", "dev": true, - "license": "0BSD", - "peer": true + "hasInstallScript": true, + "dependencies": { + "@nuxtjs/opencollective": "0.3.2", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "3.2.0", + "tslib": "2.6.2", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/microservices": "^10.0.0", + "@nestjs/platform-express": "^10.0.0", + "@nestjs/websockets": "^10.0.0", + "reflect-metadata": "^0.1.12", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -874,8 +857,9 @@ }, "node_modules/@nuxtjs/opencollective": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.1.0", "consola": "^2.15.0", @@ -944,27 +928,30 @@ "license": "MIT" }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.6.0", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.4.tgz", + "integrity": "sha512-4JKyrk55ohQK2FcuZbPdNvxdyXD14jjOIvE8hYjJ+E1cHbRbfXQXbYnjTODFE52Gx8eAxz8C9icuhDYDLn7nww==", "dev": true, "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "0.0.8", - "@nestjs/common": "9.3.11", - "@nestjs/core": "9.3.11", + "@nestjs/axios": "3.0.2", + "@nestjs/common": "10.3.0", + "@nestjs/core": "10.3.0", "@nuxtjs/opencollective": "0.3.2", + "axios": "1.6.8", "chalk": "4.1.2", "commander": "8.3.0", "compare-versions": "4.1.4", "concurrently": "6.5.1", "console.table": "0.10.0", "fs-extra": "10.1.0", - "glob": "7.1.6", - "inquirer": "8.2.5", + "glob": "7.2.3", + "https-proxy-agent": "7.0.4", + "inquirer": "8.2.6", "lodash": "4.17.21", "reflect-metadata": "0.1.13", - "rxjs": "7.8.0", - "tslib": "2.0.3" + "rxjs": "7.8.1", + "tslib": "2.6.2" }, "bin": { "openapi-generator-cli": "main.js" @@ -977,85 +964,6 @@ "url": "https://opencollective.com/openapi_generator" } }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/common": { - "version": "9.3.11", - "dev": true, - "license": "MIT", - "dependencies": { - "iterare": "1.2.1", - "tslib": "2.5.0", - "uid": "2.0.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" - }, - "peerDependencies": { - "cache-manager": "<=5", - "class-transformer": "*", - "class-validator": "*", - "reflect-metadata": "^0.1.12", - "rxjs": "^7.1.0" - }, - "peerDependenciesMeta": { - "cache-manager": { - "optional": true - }, - "class-transformer": { - "optional": true - }, - "class-validator": { - "optional": true - } - } - }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/common/node_modules/tslib": { - "version": "2.5.0", - "dev": true, - "license": "0BSD" - }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/core": { - "version": "9.3.11", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@nuxtjs/opencollective": "0.3.2", - "fast-safe-stringify": "2.1.1", - "iterare": "1.2.1", - "path-to-regexp": "3.2.0", - "tslib": "2.5.0", - "uid": "2.0.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" - }, - "peerDependencies": { - "@nestjs/common": "^9.0.0", - "@nestjs/microservices": "^9.0.0", - "@nestjs/platform-express": "^9.0.0", - "@nestjs/websockets": "^9.0.0", - "reflect-metadata": "^0.1.12", - "rxjs": "^7.1.0" - }, - "peerDependenciesMeta": { - "@nestjs/microservices": { - "optional": true - }, - "@nestjs/platform-express": { - "optional": true - }, - "@nestjs/websockets": { - "optional": true - } - } - }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/@nestjs/core/node_modules/tslib": { - "version": "2.5.0", - "dev": true, - "license": "0BSD" - }, "node_modules/@openapitools/openapi-generator-cli/node_modules/commander": { "version": "8.3.0", "dev": true, @@ -1065,14 +973,15 @@ } }, "node_modules/@openapitools/openapi-generator-cli/node_modules/glob": { - "version": "7.1.6", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, - "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -1182,11 +1091,6 @@ "license": "(Unlicense OR Apache-2.0)", "optional": true }, - "node_modules/abbrev": { - "version": "1.1.1", - "license": "ISC", - "optional": true - }, "node_modules/acorn": { "version": "8.11.2", "dev": true, @@ -1207,19 +1111,20 @@ } }, "node_modules/agent-base": { - "version": "6.0.2", - "license": "MIT", - "optional": true, + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ajv": { "version": "6.12.6", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -1232,56 +1137,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-formats": { - "version": "2.1.1", - "license": "MIT", - "optional": true, - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/ajv-formats-draft2019": { - "version": "1.6.1", - "license": "MIT", - "optional": true, - "dependencies": { - "punycode": "^2.1.1", - "schemes": "^1.4.0", - "smtp-address-parser": "^1.0.3", - "uri-js": "^4.4.1" - }, - "peerDependencies": { - "ajv": "*" - } - }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "optional": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/ansi-colors": { "version": "4.1.1", "dev": true, @@ -1347,23 +1202,6 @@ "node": ">= 8" } }, - "node_modules/aproba": { - "version": "2.0.0", - "license": "ISC", - "optional": true - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/argparse": { "version": "2.0.1", "dev": true, @@ -1379,8 +1217,9 @@ }, "node_modules/asynckit": { "version": "0.4.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -1394,12 +1233,14 @@ } }, "node_modules/axios": { - "version": "0.27.2", + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", + "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "dev": true, - "license": "MIT", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/babel-plugin-rewire": { @@ -1409,7 +1250,7 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/base64-js": { @@ -1439,14 +1280,6 @@ "node": ">=8" } }, - "node_modules/bindings": { - "version": "1.5.0", - "license": "MIT", - "optional": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, "node_modules/bl": { "version": "4.1.0", "dev": true, @@ -1459,7 +1292,7 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -1717,14 +1550,6 @@ "node": ">= 6" } }, - "node_modules/chownr": { - "version": "2.0.0", - "license": "ISC", - "optional": true, - "engines": { - "node": ">=10" - } - }, "node_modules/cli-cursor": { "version": "3.1.0", "dev": true, @@ -1789,18 +1614,11 @@ "version": "1.1.4", "license": "MIT" }, - "node_modules/color-support": { - "version": "1.1.3", - "license": "ISC", - "optional": true, - "bin": { - "color-support": "bin.js" - } - }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1823,7 +1641,7 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/concurrently": { @@ -1914,13 +1732,9 @@ }, "node_modules/consola": { "version": "2.15.3", - "dev": true, - "license": "MIT" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "license": "ISC", - "optional": true + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "dev": true }, "node_modules/console.table": { "version": "0.10.0", @@ -1976,7 +1790,7 @@ }, "node_modules/debug": { "version": "4.3.4", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -2019,25 +1833,13 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, - "node_modules/detect-libc": { - "version": "2.0.2", - "license": "Apache-2.0", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/diff": { "version": "5.0.0", "dev": true, @@ -2046,11 +1848,6 @@ "node": ">=0.3.1" } }, - "node_modules/discontinuous-range": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/doctrine": { "version": "3.0.0", "dev": true, @@ -2313,11 +2110,6 @@ "node": ">=0.8.x" } }, - "node_modules/extend": { - "version": "3.0.2", - "license": "MIT", - "optional": true - }, "node_modules/external-editor": { "version": "3.1.0", "dev": true, @@ -2333,12 +2125,12 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -2348,8 +2140,9 @@ }, "node_modules/fast-safe-stringify": { "version": "2.1.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "node_modules/fast-toml": { "version": "0.5.4", @@ -2417,11 +2210,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/fill-range": { "version": "7.0.1", "dev": true, @@ -2474,7 +2262,9 @@ "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.15.2", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "dev": true, "funding": [ { @@ -2482,7 +2272,6 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -2514,8 +2303,9 @@ }, "node_modules/form-data": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -2538,31 +2328,9 @@ "node": ">=12" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/function-bind": { @@ -2573,25 +2341,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "3.0.2", - "license": "ISC", - "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "dev": true, @@ -2631,7 +2380,7 @@ }, "node_modules/glob": { "version": "7.2.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2754,11 +2503,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "license": "ISC", - "optional": true - }, "node_modules/he": { "version": "1.2.0", "dev": true, @@ -2782,15 +2526,16 @@ "license": "MIT" }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "license": "MIT", - "optional": true, + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/iconv-lite": { @@ -2856,7 +2601,7 @@ }, "node_modules/inflight": { "version": "1.0.6", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -2865,13 +2610,14 @@ }, "node_modules/inherits": { "version": "2.0.4", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/inquirer": { - "version": "8.2.5", + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", "dev": true, - "license": "MIT", "dependencies": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.1", @@ -2887,12 +2633,26 @@ "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6", - "wrap-ansi": "^7.0.0" + "wrap-ansi": "^6.0.1" }, "engines": { "node": ">=12.0.0" } }, + "node_modules/inquirer/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-arguments": { "version": "1.1.1", "dev": true, @@ -3077,8 +2837,9 @@ }, "node_modules/iterare": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", "dev": true, - "license": "ISC", "engines": { "node": ">=6" } @@ -3104,7 +2865,7 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -3148,20 +2909,6 @@ "node": ">= 0.8.0" } }, - "node_modules/libxmljs2": { - "version": "0.32.0", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.10", - "bindings": "~1.5.0", - "nan": "~2.17.0" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/locate-path": { "version": "6.0.0", "dev": true, @@ -3229,7 +2976,7 @@ }, "node_modules/make-dir": { "version": "3.1.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -3243,7 +2990,7 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "devOptional": true, + "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -3251,16 +2998,18 @@ }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -3278,7 +3027,7 @@ }, "node_modules/minimatch": { "version": "3.1.2", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -3287,48 +3036,6 @@ "node": "*" } }, - "node_modules/minipass": { - "version": "5.0.0", - "license": "ISC", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "license": "MIT", - "optional": true, - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "license": "MIT", - "optional": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/mocha": { "version": "10.2.0", "dev": true, @@ -3441,14 +3148,9 @@ "node": ">=10" } }, - "node_modules/moo": { - "version": "0.5.2", - "license": "BSD-3-Clause", - "optional": true - }, "node_modules/ms": { "version": "2.1.2", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/msw": { @@ -3517,11 +3219,6 @@ "dev": true, "license": "ISC" }, - "node_modules/nan": { - "version": "2.17.0", - "license": "MIT", - "optional": true - }, "node_modules/nanoid": { "version": "3.3.3", "dev": true, @@ -3538,32 +3235,6 @@ "dev": true, "license": "MIT" }, - "node_modules/nearley": { - "version": "2.20.1", - "license": "MIT", - "optional": true, - "dependencies": { - "commander": "^2.19.0", - "moo": "^0.5.0", - "railroad-diagrams": "^1.0.0", - "randexp": "0.4.6" - }, - "bin": { - "nearley-railroad": "bin/nearley-railroad.js", - "nearley-test": "bin/nearley-test.js", - "nearley-unparse": "bin/nearley-unparse.js", - "nearleyc": "bin/nearleyc.js" - }, - "funding": { - "type": "individual", - "url": "https://nearley.js.org/#give-to-nearley" - } - }, - "node_modules/nearley/node_modules/commander": { - "version": "2.20.3", - "license": "MIT", - "optional": true - }, "node_modules/nise": { "version": "5.1.4", "dev": true, @@ -3594,7 +3265,7 @@ }, "node_modules/node-fetch": { "version": "2.6.11", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -3616,20 +3287,6 @@ "dev": true, "license": "MIT" }, - "node_modules/nopt": { - "version": "5.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "dev": true, @@ -3638,28 +3295,9 @@ "node": ">=0.10.0" } }, - "node_modules/npmlog": { - "version": "5.0.1", - "license": "ISC", - "optional": true, - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/once": { "version": "1.4.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -3783,7 +3421,7 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3799,8 +3437,9 @@ }, "node_modules/path-to-regexp": { "version": "3.2.0", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz", + "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA==", + "dev": true }, "node_modules/pathval": { "version": "1.1.1", @@ -3834,9 +3473,15 @@ "node": ">= 0.8.0" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/punycode": { "version": "2.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -3861,23 +3506,6 @@ ], "license": "MIT" }, - "node_modules/railroad-diagrams": { - "version": "1.0.0", - "license": "CC0-1.0", - "optional": true - }, - "node_modules/randexp": { - "version": "0.4.6", - "license": "MIT", - "optional": true, - "dependencies": { - "discontinuous-range": "1.0.0", - "ret": "~0.1.10" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/randombytes": { "version": "2.1.0", "dev": true, @@ -3888,7 +3516,7 @@ }, "node_modules/readable-stream": { "version": "3.6.2", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -3912,8 +3540,9 @@ }, "node_modules/reflect-metadata": { "version": "0.1.13", - "dev": true, - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true }, "node_modules/regenerator-runtime": { "version": "0.13.11", @@ -3927,14 +3556,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-from-string": { - "version": "2.0.2", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "dev": true, @@ -3955,14 +3576,6 @@ "node": ">=8" } }, - "node_modules/ret": { - "version": "0.1.15", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.12" - } - }, "node_modules/reusify": { "version": "1.0.4", "dev": true, @@ -3974,7 +3587,7 @@ }, "node_modules/rimraf": { "version": "3.0.2", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -4017,21 +3630,17 @@ } }, "node_modules/rxjs": { - "version": "7.8.0", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, - "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } }, - "node_modules/rxjs/node_modules/tslib": { - "version": "2.5.3", - "dev": true, - "license": "0BSD" - }, "node_modules/safe-buffer": { "version": "5.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -4053,17 +3662,9 @@ "dev": true, "license": "MIT" }, - "node_modules/schemes": { - "version": "1.4.0", - "license": "MIT", - "optional": true, - "dependencies": { - "extend": "^3.0.0" - } - }, "node_modules/semver": { "version": "7.5.4", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -4077,7 +3678,7 @@ }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", - "devOptional": true, + "dev": true, "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -4094,11 +3695,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "license": "ISC", - "optional": true - }, "node_modules/set-cookie-parser": { "version": "2.6.0", "dev": true, @@ -4125,7 +3721,7 @@ }, "node_modules/signal-exit": { "version": "3.0.7", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/sinon": { @@ -4162,38 +3758,11 @@ "node": ">=0.3.1" } }, - "node_modules/smtp-address-parser": { - "version": "1.0.10", - "license": "MIT", - "optional": true, - "dependencies": { - "nearley": "^2.20.1" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/spawn-command": { "version": "0.0.2-1", "dev": true, "license": "MIT" }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "license": "CC-BY-3.0" - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "license": "MIT", - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.13", - "license": "CC0-1.0" - }, "node_modules/sprintf-js": { "version": "1.0.3", "license": "BSD-3-Clause", @@ -4206,7 +3775,7 @@ }, "node_modules/string_decoder": { "version": "1.3.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -4260,22 +3829,6 @@ "node": ">=8" } }, - "node_modules/tar": { - "version": "6.1.15", - "license": "ISC", - "optional": true, - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "dev": true, @@ -4323,7 +3876,7 @@ }, "node_modules/tr46": { "version": "0.0.3", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/tree-kill": { @@ -4335,9 +3888,10 @@ } }, "node_modules/tslib": { - "version": "2.0.3", - "dev": true, - "license": "0BSD" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/type-check": { "version": "0.4.0", @@ -4382,9 +3936,10 @@ } }, "node_modules/uid": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", "dev": true, - "license": "MIT", "dependencies": { "@lukeed/csprng": "^1.0.0" }, @@ -4431,7 +3986,7 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "devOptional": true, + "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -4451,17 +4006,8 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", - "devOptional": true, - "license": "MIT" - }, - "node_modules/uuid": { - "version": "8.3.2", "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "uuid": "dist/bin/uuid" - } + "license": "MIT" }, "node_modules/v8-to-istanbul": { "version": "9.1.0", @@ -4497,12 +4043,12 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", - "devOptional": true, + "dev": true, "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -4541,14 +4087,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wide-align": { - "version": "1.1.5", - "license": "ISC", - "optional": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "node_modules/workerpool": { "version": "6.2.1", "dev": true, @@ -4571,7 +4109,7 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/xmlbuilder2": { @@ -4617,7 +4155,7 @@ }, "node_modules/yallist": { "version": "4.0.0", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/yargs": { diff --git a/package.json b/package.json index 77724c6..319b9ac 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ }, "dependencies": { "@babel/core": "^7.23.2", - "@cyclonedx/cyclonedx-library": "^4.0.0", + "@cyclonedx/cyclonedx-library": "^1.13.3", "fast-toml": "^0.5.4", "fast-xml-parser": "^4.2.4", "help": "^3.0.2", diff --git a/src/index.js b/src/index.js index 04288bf..8a0b429 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,13 @@ +import path from "node:path"; import {EOL} from "os"; import { availableProviders, match } from './provider.js' import {AnalysisReport} from '../generated/backend/AnalysisReport.js' import analysis from './analysis.js' import fs from 'node:fs' import {getCustom} from "./tools.js"; -import PackageJson from '../package.json' assert {type: 'json'}; +import.meta.dirname +import * as url from 'url'; +// const packageJson = await import ('../package.json',{ with: { type: 'json' } }) export default { AnalysisReport, componentAnalysis, stackAnalysis, validateToken } @@ -21,10 +24,10 @@ function logOptionsAndEnvironmentsVariables(alongsideText,valueToBePrinted) { } -/** This function is used to determine exhort url backend according to the following logic: +/** This function is used to determine exhort theUrl backend according to the following logic: * If EXHORT_DEV_MODE = true, then take the value of the EXHORT BACKEND URL of dev/staging environment in such a way: * take it as environment variable if exists, otherwise, take it from opts object if exists, otherwise, use the hardcoded default of DEV environment. - * If EXHORT_DEV_MODE = false , then select the production url of EXHORT Backend, which is hardcoded. + * If EXHORT_DEV_MODE = false , then select the production theUrl of EXHORT Backend, which is hardcoded. * EXHORT_DEV_MODE evaluated in the following order and selected when it finds it first: * 1. Environment Variable * 2. (key,value) from opts object @@ -34,8 +37,14 @@ function logOptionsAndEnvironmentsVariables(alongsideText,valueToBePrinted) { * @private */ function selectExhortBackend(opts= {}) { - - logOptionsAndEnvironmentsVariables("exhort-javascript-api analysis started, version: ",PackageJson.version) +// new ESM way in nodeJS ( since node version 22 ) to bring module directory. + let dirName = import.meta.dirname +// old ESM way in nodeJS ( before node versions 22.00 to bring module directory. + if (!dirName) { + dirName = url.fileURLToPath(new URL('.', import.meta.url)); + } + let packageJson = JSON.parse(fs.readFileSync(path.join(dirName, "..","package.json" )).toString()) + logOptionsAndEnvironmentsVariables("exhort-javascript-api analysis started, version: ",packageJson.version) let result let exhortDevModeBundled = "false" let exhortDevMode = getCustom("EXHORT_DEV_MODE",exhortDevModeBundled,opts) @@ -63,10 +72,10 @@ export function testSelectExhortBackend(opts) } /** - * @type {string} backend url to send requests to + * @type {string} backend theUrl to send requests to * @private */ -let url +let theUrl /** * Get stack analysis report for a manifest file. @@ -78,10 +87,10 @@ let url * or backend request failed */ async function stackAnalysis(manifest, html = false, opts = {}) { - url = selectExhortBackend(opts) + theUrl = selectExhortBackend(opts) fs.accessSync(manifest, fs.constants.R_OK) // throws error if file unreadable let provider = match(manifest, availableProviders) // throws error if no matching provider - return await analysis.requestStack(provider, manifest, url, html, opts) // throws error request sending failed + return await analysis.requestStack(provider, manifest, theUrl, html, opts) // throws error request sending failed } /** @@ -93,12 +102,12 @@ async function stackAnalysis(manifest, html = false, opts = {}) { * @throws {Error} if no matching provider, failed to get create content, or backend request failed */ async function componentAnalysis(manifestType, data, opts = {}, path = '') { - url = selectExhortBackend(opts) + theUrl = selectExhortBackend(opts) let provider = match(manifestType, availableProviders) // throws error if no matching provider - return await analysis.requestComponent(provider, data, url, opts,path) // throws error request sending failed + return await analysis.requestComponent(provider, data, theUrl, opts,path) // throws error request sending failed } async function validateToken(opts = {}) { - url = selectExhortBackend(opts) - return await analysis.validateToken(url, opts) // throws error request sending failed + theUrl = selectExhortBackend(opts) + return await analysis.validateToken(theUrl, opts) // throws error request sending failed } diff --git a/test/it/end-to-end.js b/test/it/end-to-end.js index 29fadb2..4bde719 100644 --- a/test/it/end-to-end.js +++ b/test/it/end-to-end.js @@ -23,12 +23,22 @@ function getParsedKeyFromHtml(html, key,keyLength) { return JSON.parse(summary); } +function extractTotalsGeneralOrFromProvider(providedDataForStack, provider) { + if(providedDataForStack.providers[provider].sources.length > 0) { + return providedDataForStack.providers[provider].sources[provider].summary.total; + } + else { + return providedDataForStack.scanned.total; + } +} + suite('Integration Tests', () => { // let opts = { // EXHORT_DEV_MODE: "true", // // } - ["gradle", + [ + "gradle", "maven", "npm", "go", @@ -56,7 +66,8 @@ suite('Integration Tests', () => { let providedDataForStack = await index.stackAnalysis(pomPath) console.log(JSON.stringify(providedDataForStack,null , 4)) let providers = ["osv-nvd"] - providers.forEach(provider => expect(providedDataForStack.providers[provider].sources[provider].summary.total).greaterThan(0)) + providers.forEach(provider => expect(extractTotalsGeneralOrFromProvider(providedDataForStack, provider)).greaterThan(0)) + //TO DO - if sources doesn't exists, add "scanned" instead // python transitive count for stack analysis is awaiting fix in exhort backend if(packageManager !== "pip") { @@ -66,6 +77,7 @@ suite('Integration Tests', () => { }).timeout(60000); test(`Stack Analysis html for ${packageManager}`, async () => { + let manifestName = getManifestNamePerPm(packageManager) let pomPath = `test/it/test_manifests/${packageManager}/${manifestName}` let html = await index.stackAnalysis(pomPath,true) @@ -78,21 +90,28 @@ suite('Integration Tests', () => { process.env["EXHORT_PYTHON_VIRTUAL_ENV"] = "" } let reportParsedFromHtml - reportParsedFromHtml = JSON.parse(html.substring(html.indexOf("\"report\" :") +10,html.search(/([}](\s*)){5}/) + html.substring(html.search(/([}](\s*)){5}/)).indexOf(","))) - let parsedSummaryFromHtml = getParsedKeyFromHtml(html,"\"summary\"",11) - let parsedScannedFromHtml = reportParsedFromHtml.scanned - let parsedStatusFromHtmlOsvNvd = reportParsedFromHtml.providers["osv-nvd"].status - expect( typeof html).equals("string") - expect(html).include("html").include("svg") - expect(parsedScannedFromHtml.total).greaterThan(0) - // python transitive count for stack analysis is awaiting fix in exhort backend - if(packageManager !== "pip") + let parsedSummaryFromHtml + let parsedStatusFromHtmlOsvNvd + let parsedScannedFromHtml + try { + reportParsedFromHtml = JSON.parse(html.substring(html.indexOf("\"report\" :") + 10, html.search(/([}](\s*)){5}/) + html.substring(html.search(/([}](\s*)){5}/)).indexOf(","))) + parsedSummaryFromHtml = getParsedKeyFromHtml(html,"\"summary\"",11) + expect(parsedSummaryFromHtml.total).greaterThanOrEqual(0) + } catch (e) { + let startOfJson = html.substring(html.indexOf("\"report\" :")) + reportParsedFromHtml = JSON.parse("{" + startOfJson.substring(0,startOfJson.indexOf("};") + 1)) + reportParsedFromHtml = reportParsedFromHtml.report + } + finally { + parsedStatusFromHtmlOsvNvd = reportParsedFromHtml.providers["osv-nvd"].status + expect(parsedStatusFromHtmlOsvNvd.code).equals(200) + parsedScannedFromHtml = reportParsedFromHtml.scanned + expect( typeof html).equals("string") + expect(html).include("html").include("svg") + expect(parsedScannedFromHtml.total).greaterThan(0) expect(parsedScannedFromHtml.transitive).greaterThan(0) } - expect(parsedSummaryFromHtml.total).greaterThanOrEqual(0) - expect(parsedStatusFromHtmlOsvNvd.code).equals(200) - // parsedSummaryFromHtml.providerStatuses.forEach(provider => expect(provider.status).equals(200)) }).timeout(30000); test(`Component Analysis for ${packageManager}`, async () => { @@ -110,7 +129,7 @@ suite('Integration Tests', () => { expect(analysisReport.scanned.total).greaterThan(0) expect(analysisReport.scanned.transitive).equal(0) let providers = ["osv-nvd"] - providers.forEach(provider => expect(analysisReport.providers[provider].sources[provider].summary.total).greaterThan(0)) + providers.forEach(provider => expect(extractTotalsGeneralOrFromProvider(analysisReport,provider)).greaterThan(0)) providers.forEach(provider => expect(analysisReport.providers[provider].status.code).equals(200)) }).timeout(20000);