diff --git a/package-lock.json b/package-lock.json index 2dcf09431..4d4c77bb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,6 +87,7 @@ "eslint-plugin-tsdoc": "^0.4.0", "globals": "^15.13.0", "jest-mock": "^29.7.0", + "madge": "^8.0.0", "mocha": "^11.0.1", "mocha-each": "^2.0.1", "mocha-junit-reporter": "^2.2.1", @@ -131,11 +132,18 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", - "dev": true, + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "engines": { "node": ">=6.9.0" } @@ -218,9 +226,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", - "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dependencies": { + "@babel/types": "^7.26.3" + }, "bin": { "parser": "bin/babel-parser.js" }, @@ -228,6 +239,18 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/types": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -253,6 +276,19 @@ "kuler": "^2.0.0" } }, + "node_modules/@dependents/detective-less": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-5.0.0.tgz", + "integrity": "sha512-D/9dozteKcutI5OdxJd8rU+fL6XgaaRg60sPPJWkT33OCiRfkCu5wO5B/yXTaaL2e6EB0lcCBGe5E0XscZCvvQ==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.23.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", @@ -2314,6 +2350,92 @@ "node": ">=14.16" } }, + "node_modules/@ts-graphviz/adapter": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@ts-graphviz/adapter/-/adapter-2.0.6.tgz", + "integrity": "sha512-kJ10lIMSWMJkLkkCG5gt927SnGZcBuG0s0HHswGzcHTgvtUe7yk5/3zTEr0bafzsodsOq5Gi6FhQeV775nC35Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ts-graphviz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ts-graphviz" + } + ], + "dependencies": { + "@ts-graphviz/common": "^2.1.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ts-graphviz/ast": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@ts-graphviz/ast/-/ast-2.0.6.tgz", + "integrity": "sha512-JbOnw6+Pm+C9jRQlNV+qJG0/VTan4oCeZ0sClm++SjaaMBJ0q86O13i6wbcWKY2x8kKt9GP2hVCgM/p/BXtXWQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ts-graphviz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ts-graphviz" + } + ], + "dependencies": { + "@ts-graphviz/common": "^2.1.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ts-graphviz/common": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ts-graphviz/common/-/common-2.1.5.tgz", + "integrity": "sha512-S6/9+T6x8j6cr/gNhp+U2olwo1n0jKj/682QVqsh7yXWV6ednHYqxFw0ZsY3LyzT0N8jaZ6jQY9YD99le3cmvg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ts-graphviz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ts-graphviz" + } + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@ts-graphviz/core": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@ts-graphviz/core/-/core-2.0.6.tgz", + "integrity": "sha512-0hvrluFirC0ph3Dn2o1B0O1fI2n7Hre1HlScfmRcO6DDDq/05Vizg5UMI0LfvkJulLuz80RPjUHluh+QfBUBKw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ts-graphviz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ts-graphviz" + } + ], + "dependencies": { + "@ts-graphviz/ast": "^2.0.6", + "@ts-graphviz/common": "^2.1.5" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@types/adm-zip": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.7.tgz", @@ -2988,6 +3110,62 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", + "dev": true + }, "node_modules/abbrev": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", @@ -3096,6 +3274,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -3109,6 +3293,12 @@ "node": ">= 8" } }, + "node_modules/app-module-path": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==", + "dev": true + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -3150,6 +3340,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array.prototype.findlastindex": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", @@ -3268,6 +3467,15 @@ "node": ">=12" } }, + "node_modules/ast-module-types": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-6.0.0.tgz", + "integrity": "sha512-LFRg7178Fw5R4FAEwZxVqiRI8IxSM+Ay2UBrHoCerXNme+kMMMfz7T3xDGV/c2fer87hcrtgJGsnSOfUrPK6ng==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/async": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", @@ -3389,6 +3597,41 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -3792,6 +4035,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-truncate": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", @@ -3891,6 +4146,15 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/collapse-white-space": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", @@ -3992,6 +4256,12 @@ "node": ">= 6" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4206,12 +4476,33 @@ "node": ">=6" } }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -4262,6 +4553,33 @@ "node": ">=0.4.0" } }, + "node_modules/dependency-tree": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-11.0.1.tgz", + "integrity": "sha512-eCt7HSKIC9NxgIykG2DRq3Aewn9UhVS14MB3rEn6l/AsEI1FBg6ZGSlCU0SZ6Tjm2kkhj6/8c2pViinuyKELhg==", + "dev": true, + "dependencies": { + "commander": "^12.0.0", + "filing-cabinet": "^5.0.1", + "precinct": "^12.0.2", + "typescript": "^5.4.5" + }, + "bin": { + "dependency-tree": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dependency-tree/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -4271,68 +4589,294 @@ "node": ">=6" } }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "node_modules/detective-amd": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-6.0.0.tgz", + "integrity": "sha512-NTqfYfwNsW7AQltKSEaWR66hGkTeD52Kz3eRQ+nfkA9ZFZt3iifRCWh+yZ/m6t3H42JFwVFTrml/D64R2PAIOA==", "dev": true, "dependencies": { - "dequal": "^2.0.0" + "ast-module-types": "^6.0.0", + "escodegen": "^2.1.0", + "get-amd-module-type": "^6.0.0", + "node-source-walk": "^7.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "bin": { + "detective-amd": "bin/cli.js" + }, + "engines": { + "node": ">=18" } }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "node_modules/detective-cjs": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-6.0.0.tgz", + "integrity": "sha512-R55jTS6Kkmy6ukdrbzY4x+I7KkXiuDPpFzUViFV/tm2PBGtTCjkh9ZmTuJc1SaziMHJOe636dtiZLEuzBL9drg==", "dev": true, - "license": "BSD-3-Clause", + "dependencies": { + "ast-module-types": "^6.0.0", + "node-source-walk": "^7.0.0" + }, "engines": { - "node": ">=0.3.1" + "node": ">=18" } }, - "node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "node_modules/detective-es6": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-5.0.0.tgz", + "integrity": "sha512-NGTnzjvgeMW1khUSEXCzPDoraLenWbUjCFjwxReH+Ir+P6LGjYtaBbAvITWn2H0VSC+eM7/9LFOTAkrta6hNYg==", "dev": true, "dependencies": { - "esutils": "^2.0.2" + "node-source-walk": "^7.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=18" } }, - "node_modules/dot-object": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.5.tgz", - "integrity": "sha512-xHF8EP4XH/Ba9fvAF2LDd5O3IITVolerVV6xvkxoM8zlGEiCUrggpAnHyOoKJKCrhvPcGATFAUwIujj7bRG5UA==", - "license": "MIT", + "node_modules/detective-postcss": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-7.0.0.tgz", + "integrity": "sha512-pSXA6dyqmBPBuERpoOKKTUUjQCZwZPLRbd1VdsTbt6W+m/+6ROl4BbE87yQBUtLoK7yX8pvXHdKyM/xNIW9F7A==", + "dev": true, "dependencies": { - "commander": "^6.1.0", - "glob": "^7.1.6" + "is-url": "^1.2.4", + "postcss-values-parser": "^6.0.2" }, - "bin": { - "dot-object": "bin/dot-object" + "engines": { + "node": "^14.0.0 || >=16.0.0" + }, + "peerDependencies": { + "postcss": "^8.4.38" } }, - "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", - "license": "BSD-2-Clause", + "node_modules/detective-sass": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-6.0.0.tgz", + "integrity": "sha512-h5GCfFMkPm4ZUUfGHVPKNHKT8jV7cSmgK+s4dgQH4/dIUNh9/huR1fjEQrblOQNDalSU7k7g+tiW9LJ+nVEUhg==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^7.0.0" + }, "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/detective-scss": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-5.0.0.tgz", + "integrity": "sha512-Y64HyMqntdsCh1qAH7ci95dk0nnpA29g319w/5d/oYcHolcGUVJbIhOirOFjfN1KnMAXAFm5FIkZ4l2EKFGgxg==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "node-source-walk": "^7.0.0" }, - "funding": { - "url": "https://dotenvx.com" + "engines": { + "node": ">=18" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", + "node_modules/detective-stylus": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-5.0.0.tgz", + "integrity": "sha512-KMHOsPY6aq3196WteVhkY5FF+6Nnc/r7q741E+Gq+Ax9mhE2iwj8Hlw8pl+749hPDRDBHZ2WlgOjP+twIG61vQ==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/detective-typescript": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-13.0.0.tgz", + "integrity": "sha512-tcMYfiFWoUejSbvSblw90NDt76/4mNftYCX0SMnVRYzSXv8Fvo06hi4JOPdNvVNxRtCAKg3MJ3cBJh+ygEMH+A==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "^7.6.0", + "ast-module-types": "^6.0.0", + "node-source-walk": "^7.0.0" + }, + "engines": { + "node": "^14.14.0 || >=16.0.0" + }, + "peerDependencies": { + "typescript": "^5.4.4" + } + }, + "node_modules/detective-typescript/node_modules/@typescript-eslint/types": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/detective-typescript/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/detective-typescript/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.18.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/detective-typescript/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/detective-typescript/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/detective-vue2": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detective-vue2/-/detective-vue2-2.1.0.tgz", + "integrity": "sha512-IHQVhwk7dKaJ+GHBsL27mS9NRO1/vLZJPSODqtJgKquij0/UL8NvrbXbADbYeTkwyh1ReW/v9u9IRyEO5dvGZg==", + "dev": true, + "dependencies": { + "@dependents/detective-less": "^5.0.0", + "@vue/compiler-sfc": "^3.5.12", + "detective-es6": "^5.0.0", + "detective-sass": "^6.0.0", + "detective-scss": "^5.0.0", + "detective-stylus": "^5.0.0", + "detective-typescript": "^13.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "typescript": "^5.4.4" + } + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dev": true, + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dot-object": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.5.tgz", + "integrity": "sha512-xHF8EP4XH/Ba9fvAF2LDd5O3IITVolerVV6xvkxoM8zlGEiCUrggpAnHyOoKJKCrhvPcGATFAUwIujj7bRG5UA==", + "license": "MIT", + "dependencies": { + "commander": "^6.1.0", + "glob": "^7.1.6" + }, + "bin": { + "dot-object": "bin/dot-object" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, @@ -4634,6 +5178,27 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, "node_modules/eslint": { "version": "9.16.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", @@ -5171,6 +5736,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -5204,6 +5782,12 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -5384,6 +5968,54 @@ "node": ">=16.0.0" } }, + "node_modules/filing-cabinet": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-5.0.2.tgz", + "integrity": "sha512-RZlFj8lzyu6jqtFBeXNqUjjNG6xm+gwXue3T70pRxw1W40kJwlgq0PSWAmh0nAnn5DHuBIecLXk9+1VKS9ICXA==", + "dev": true, + "dependencies": { + "app-module-path": "^2.2.0", + "commander": "^12.0.0", + "enhanced-resolve": "^5.16.0", + "module-definition": "^6.0.0", + "module-lookup-amd": "^9.0.1", + "resolve": "^1.22.8", + "resolve-dependency-path": "^4.0.0", + "sass-lookup": "^6.0.1", + "stylus-lookup": "^6.0.0", + "tsconfig-paths": "^4.2.0", + "typescript": "^5.4.4" + }, + "bin": { + "filing-cabinet": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/filing-cabinet/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/filing-cabinet/node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -5593,6 +6225,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-amd-module-type": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-6.0.0.tgz", + "integrity": "sha512-hFM7oivtlgJ3d6XWD6G47l8Wyh/C6vFw5G24Kk1Tbq85yh5gcM8Fne5/lFhiuxB+RT6+SI7I1ThB9lG4FBh3jw==", + "dev": true, + "dependencies": { + "ast-module-types": "^6.0.0", + "node-source-walk": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -5641,6 +6286,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, "node_modules/get-symbol-description": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", @@ -5738,6 +6389,41 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gonzales-pe": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "gonzales": "bin/gonzales.js" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -6387,6 +7073,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -6423,6 +7118,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-plain-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", @@ -6451,6 +7155,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-shared-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", @@ -6540,6 +7253,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true + }, + "node_modules/is-url-superb": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", + "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -7278,6 +8009,78 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, + "node_modules/madge": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/madge/-/madge-8.0.0.tgz", + "integrity": "sha512-9sSsi3TBPhmkTCIpVQF0SPiChj1L7Rq9kU2KDG1o6v2XH9cCw086MopjVCD+vuoL5v8S77DTbVopTO8OUiQpIw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "commander": "^7.2.0", + "commondir": "^1.0.1", + "debug": "^4.3.4", + "dependency-tree": "^11.0.0", + "ora": "^5.4.1", + "pluralize": "^8.0.0", + "pretty-ms": "^7.0.1", + "rc": "^1.2.8", + "stream-to-array": "^2.3.0", + "ts-graphviz": "^2.1.2", + "walkdir": "^0.4.1" + }, + "bin": { + "madge": "bin/cli.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "individual", + "url": "https://www.paypal.me/pahen" + }, + "peerDependencies": { + "typescript": "^5.4.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/madge/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/madge/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/magic-string": { + "version": "0.30.14", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", + "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -8025,6 +8828,15 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", @@ -8426,6 +9238,49 @@ "node": ">=10" } }, + "node_modules/module-definition": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-6.0.0.tgz", + "integrity": "sha512-sEGP5nKEXU7fGSZUML/coJbrO+yQtxcppDAYWRE9ovWsTbFoUHB2qDUx564WUzDaBHXsD46JBbIK5WVTwCyu3w==", + "dev": true, + "dependencies": { + "ast-module-types": "^6.0.0", + "node-source-walk": "^7.0.0" + }, + "bin": { + "module-definition": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/module-lookup-amd": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-9.0.2.tgz", + "integrity": "sha512-p7PzSVEWiW9fHRX9oM+V4aV5B2nCVddVNv4DZ/JB6t9GsXY4E+ZVhPpnwUX7bbJyGeeVZqhS8q/JZ/H77IqPFA==", + "dev": true, + "dependencies": { + "commander": "^12.1.0", + "glob": "^7.2.3", + "requirejs": "^2.3.7", + "requirejs-config-file": "^4.0.0" + }, + "bin": { + "lookup-amd": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/module-lookup-amd/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -8440,6 +9295,24 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8469,6 +9342,18 @@ "node": ">= 6.13.0" } }, + "node_modules/node-source-walk": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-7.0.0.tgz", + "integrity": "sha512-1uiY543L+N7Og4yswvlm5NCKgPKDEXd9AUR9Jh3gen6oOeBsesr6LqhXom1er3eRzSUcVRWXzhv8tSNrIfGHKw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/nopt": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", @@ -8643,6 +9528,21 @@ "fn.name": "1.x.x" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/openid-client": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-6.1.3.tgz", @@ -8673,6 +9573,70 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -8763,6 +9727,15 @@ "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==", "dev": true }, + "node_modules/parse-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -8828,6 +9801,15 @@ "node": ">=16" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", @@ -8844,9 +9826,9 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -8968,6 +9950,89 @@ "node": ">= 0.4" } }, + "node_modules/postcss": { + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-values-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", + "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", + "dev": true, + "dependencies": { + "color-name": "^1.1.4", + "is-url-superb": "^4.0.0", + "quote-unquote": "^1.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "postcss": "^8.2.9" + } + }, + "node_modules/precinct": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-12.1.2.tgz", + "integrity": "sha512-x2qVN3oSOp3D05ihCd8XdkIPuEQsyte7PSxzLqiRgktu79S5Dr1I75/S+zAup8/0cwjoiJTQztE9h0/sWp9bJQ==", + "dev": true, + "dependencies": { + "@dependents/detective-less": "^5.0.0", + "commander": "^12.1.0", + "detective-amd": "^6.0.0", + "detective-cjs": "^6.0.0", + "detective-es6": "^5.0.0", + "detective-postcss": "^7.0.0", + "detective-sass": "^6.0.0", + "detective-scss": "^5.0.0", + "detective-stylus": "^5.0.0", + "detective-typescript": "^13.0.0", + "detective-vue2": "^2.0.3", + "module-definition": "^6.0.0", + "node-source-walk": "^7.0.0", + "postcss": "^8.4.40", + "typescript": "^5.5.4" + }, + "bin": { + "precinct": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/precinct/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -9005,6 +10070,21 @@ "node": ">=6.0.0" } }, + "node_modules/pretty-ms": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", + "dev": true, + "dependencies": { + "parse-ms": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/proc-log": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", @@ -9151,6 +10231,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/quote-unquote": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", + "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", + "dev": true + }, "node_modules/rambda": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/rambda/-/rambda-7.5.0.tgz", @@ -9168,6 +10254,36 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/read-package-json-fast": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", @@ -9947,6 +11063,32 @@ "node": ">=0.10.0" } }, + "node_modules/requirejs": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", + "integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==", + "dev": true, + "bin": { + "r_js": "bin/r.js", + "r.js": "bin/r.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/requirejs-config-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", + "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.0", + "stringify-object": "^3.2.1" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/requizzle": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", @@ -9977,6 +11119,15 @@ "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, + "node_modules/resolve-dependency-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-dependency-path/-/resolve-dependency-path-4.0.0.tgz", + "integrity": "sha512-hlY1SybBGm5aYN3PC4rp15MzsJLM1w+MEA/4KU3UBPfz4S0lL3FL6mgv7JgaA8a+ZTeEQAiF1a1BuN2nkqiIlg==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -10167,6 +11318,30 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/sass-lookup": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/sass-lookup/-/sass-lookup-6.0.1.tgz", + "integrity": "sha512-nl9Wxbj9RjEJA5SSV0hSDoU2zYGtE+ANaDS4OFUR7nYrquvBFvPKZZtQHe3lvnxCcylEDV00KUijjdMTUElcVQ==", + "dev": true, + "dependencies": { + "commander": "^12.0.0" + }, + "bin": { + "sass-lookup": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/sass-lookup/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", @@ -10262,6 +11437,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -10310,6 +11491,15 @@ "node": ">=0.3.1" } }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", @@ -10355,6 +11545,25 @@ "atomic-sleep": "^1.0.0" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/space-separated-tokens": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", @@ -10430,6 +11639,15 @@ "node": ">= 0.10.0" } }, + "node_modules/stream-to-array": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", + "integrity": "sha512-UsZtOYEn4tWU2RGLOXr/o/xjRBftZRlG3dEWoaHr8j4GuypJ3isitGbVyjQKAuMu+xbiop8q224TjiZWc4XTZA==", + "dev": true, + "dependencies": { + "any-promise": "^1.1.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -10528,6 +11746,20 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -10551,6 +11783,15 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -10562,6 +11803,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/stylus-lookup": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/stylus-lookup/-/stylus-lookup-6.0.0.tgz", + "integrity": "sha512-RaWKxAvPnIXrdby+UWCr1WRfa+lrPMSJPySte4Q6a+rWyjeJyFOLJxr5GrAVfcMCsfVlCuzTAJ/ysYT8p8do7Q==", + "dev": true, + "dependencies": { + "commander": "^12.0.0" + }, + "bin": { + "stylus-lookup": "bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/stylus-lookup/node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -10810,6 +12075,31 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-graphviz": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/ts-graphviz/-/ts-graphviz-2.1.5.tgz", + "integrity": "sha512-IigMCo40QZvyyURRdYFh0DV6DGDt7OqkPM/TBGXSJKfNKnYmOfRg0tzSlnJS1TQCWFSTEtpBQsqmAZcziXJrWg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ts-graphviz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/ts-graphviz" + } + ], + "dependencies": { + "@ts-graphviz/adapter": "^2.0.6", + "@ts-graphviz/ast": "^2.0.6", + "@ts-graphviz/common": "^2.1.5", + "@ts-graphviz/core": "^2.0.6" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -10836,16 +12126,6 @@ "json5": "lib/cli.js" } }, - "node_modules/tsconfig-paths/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", @@ -11684,6 +12964,24 @@ "integrity": "sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==", "dev": true }, + "node_modules/walkdir": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", + "integrity": "sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index a79b76a92..54f24f4ec 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "test-e2e-relay": "cross-env MOCHA_SUITE_NAME=\"Mocha E2E Relay Tests\" c8 --report-dir='coverage/e2e-relay' mocha 'test/e2e/commands/relay.test.ts' --reporter-options configFile=mocha-multi-reporter.json,cmrOutput=mocha-junit-reporter+mochaFile+junit-e2e-relay.xml", "solo-test": "tsx --no-deprecation --no-warnings solo.ts", "solo": "node --no-deprecation --no-warnings dist/solo.js", - "check": "remark . --quiet --frail && eslint . ; cd docs; jsdoc -c jsdoc.conf.json && tsc", - "format": "remark . --quiet --frail --output && eslint --fix . && tsc", + "check": "remark . --quiet --frail && eslint . && tsc && (madge --circular src/* || true) && cd docs; jsdoc -c jsdoc.conf.json", + "format": "remark . --quiet --frail --output && eslint --fix . && tsc && madge --circular src/* || true", "test-setup": "./test/e2e/setup-e2e.sh", "build": "rm -Rf dist && tsc && node resources/post-build-script.js" }, @@ -115,6 +115,7 @@ "eslint-plugin-tsdoc": "^0.4.0", "globals": "^15.13.0", "jest-mock": "^29.7.0", + "madge": "^8.0.0", "mocha": "^11.0.1", "mocha-each": "^2.0.1", "mocha-junit-reporter": "^2.2.1", diff --git a/src/commands/account.ts b/src/commands/account.ts index 371211d5f..938f99dff 100644 --- a/src/commands/account.ts +++ b/src/commands/account.ts @@ -17,9 +17,10 @@ import chalk from 'chalk'; import {BaseCommand} from './base.js'; import {SoloError, IllegalArgumentError} from '../core/errors.js'; -import {flags} from './index.js'; +import {Flags as flags} from './flags.js'; import {Listr} from 'listr2'; -import {constants, type AccountManager} from '../core/index.js'; +import * as constants from '../core/constants.js'; +import {type AccountManager} from '../core/account_manager.js'; import {type AccountId, AccountInfo, HbarUnit, PrivateKey} from '@hashgraph/sdk'; import {FREEZE_ADMIN_ACCOUNT} from '../core/constants.js'; import {type Opts} from '../types/index.js'; diff --git a/src/commands/base.ts b/src/commands/base.ts index c0850ccc9..7a0d87a3f 100644 --- a/src/commands/base.ts +++ b/src/commands/base.ts @@ -16,19 +16,19 @@ */ import paths from 'path'; -import {MissingArgumentError} from '../core/errors.js'; +import {MissingArgumentError, SoloError} from '../core/errors.js'; import {ShellRunner} from '../core/shell_runner.js'; -import type { - ChartManager, - ConfigManager, - Helm, - K8, - DependencyManager, - LeaseManager, - RemoteConfigManager, - LocalConfig, -} from '../core/index.js'; -import type {CommandFlag, Opts} from '../types/index.js'; +import {type LeaseManager} from '../core/lease/lease_manager.js'; +import {type LocalConfig} from '../core/config/local_config.js'; +import {type RemoteConfigManager} from '../core/config/remote/remote_config_manager.js'; +import {type Helm} from '../core/helm.js'; +import {type K8} from '../core/k8.js'; +import {type ChartManager} from '../core/chart_manager.js'; +import {type ConfigManager} from '../core/config_manager.js'; +import {type DependencyManager} from '../core/dependency_managers/index.js'; +import type {CommandFlag, CommandHandlers, Opts} from '../types/index.js'; +import type {Lease} from '../core/lease/lease.js'; +import {Listr} from 'listr2'; export class BaseCommand extends ShellRunner { protected readonly helm: Helm; @@ -178,4 +178,28 @@ export class BaseCommand extends ShellRunner { getLocalConfig() { return this.localConfig; } + + commandActionBuilder(actionTasks: any, options: any, errorString: string, lease: Lease | null) { + return async function (argv: any, commandDef: CommandHandlers) { + const tasks = new Listr([...actionTasks], options); + + try { + await tasks.run(); + } catch (e: Error | any) { + commandDef.parent.logger.error(`${errorString}: ${e.message}`, e); + throw new SoloError(`${errorString}: ${e.message}`, e); + } finally { + const promises = []; + + // @ts-ignore + if (commandDef.close) { + // @ts-ignore + promises.push(commandDef.close()); + } + + if (lease) promises.push(lease.release()); + await Promise.all(promises); + } + }; + } } diff --git a/src/commands/cluster.ts b/src/commands/cluster.ts index ae7cb9481..6048e6ee4 100644 --- a/src/commands/cluster.ts +++ b/src/commands/cluster.ts @@ -17,10 +17,10 @@ import {ListrEnquirerPromptAdapter} from '@listr2/prompt-adapter-enquirer'; import {Listr} from 'listr2'; import {SoloError} from '../core/errors.js'; -import {flags} from './index.js'; +import {Flags as flags} from './flags.js'; import {BaseCommand} from './base.js'; import chalk from 'chalk'; -import {constants} from '../core/index.js'; +import * as constants from '../core/constants.js'; import path from 'path'; import {ListrLease} from '../core/lease/listr_lease.js'; import {type CommandBuilder} from '../types/aliases.js'; diff --git a/src/commands/context/flags.ts b/src/commands/context/flags.ts index 4b53e6d2e..e7051fd07 100644 --- a/src/commands/context/flags.ts +++ b/src/commands/context/flags.ts @@ -15,7 +15,7 @@ * */ -import {flags} from '../index.js'; +import {Flags as flags} from '../flags.js'; export const USE_FLAGS = { requiredFlags: [], diff --git a/src/commands/context/handlers.ts b/src/commands/context/handlers.ts index 52a236c8f..e7b9d0511 100644 --- a/src/commands/context/handlers.ts +++ b/src/commands/context/handlers.ts @@ -17,7 +17,7 @@ import {type BaseCommand} from '../base.js'; import {type ContextCommandTasks} from './tasks.js'; import * as helpers from '../../core/helpers.js'; -import {constants} from '../../core/index.js'; +import * as constants from '../../core/constants.js'; import {type CommandHandlers} from '../../types/index.js'; import * as ContextFlags from './flags.js'; @@ -33,7 +33,7 @@ export class ContextCommandHandlers implements CommandHandlers { async connect(argv: any) { argv = helpers.addFlagsToArgv(argv, ContextFlags.USE_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv), this.parent.getLocalConfig().promptLocalConfigTask(), diff --git a/src/commands/context/index.ts b/src/commands/context/index.ts index bf3964849..950c81acc 100644 --- a/src/commands/context/index.ts +++ b/src/commands/context/index.ts @@ -15,12 +15,12 @@ * */ -import {YargsCommand} from '../../core/index.js'; +import * as ContextFlags from './flags.js'; +import {YargsCommand} from '../../core/yargs_command.js'; import {BaseCommand} from './../base.js'; import type {Opts} from '../../types/index.js'; import {ContextCommandTasks} from './tasks.js'; import {ContextCommandHandlers} from './handlers.js'; -import * as ContextFlags from './flags.js'; /** * Defines the core functionalities of 'node' command diff --git a/src/commands/context/tasks.ts b/src/commands/context/tasks.ts index fe7ccd21a..de5ce8bba 100644 --- a/src/commands/context/tasks.ts +++ b/src/commands/context/tasks.ts @@ -14,8 +14,9 @@ * limitations under the License. * */ -import {Task, Templates} from '../../core/index.js'; -import {flags} from '../index.js'; +import {Task} from '../../core/task.js'; +import {Templates} from '../../core/templates.js'; +import {Flags as flags} from '../flags.js'; import type {ListrTaskWrapper} from 'listr2'; import {type BaseCommand} from '../base.js'; diff --git a/src/commands/deployment.ts b/src/commands/deployment.ts index d39de5ecc..fe2242d3b 100644 --- a/src/commands/deployment.ts +++ b/src/commands/deployment.ts @@ -17,8 +17,9 @@ import {Listr, type ListrTaskWrapper} from 'listr2'; import {SoloError} from '../core/errors.js'; import {BaseCommand} from './base.js'; -import {flags} from './index.js'; -import {constants, Templates} from '../core/index.js'; +import {Flags as flags} from './flags.js'; +import * as constants from '../core/constants.js'; +import {Templates} from '../core/templates.js'; import chalk from 'chalk'; import {RemoteConfigTasks} from '../core/config/remote/remote_config_tasks.js'; import {ListrLease} from '../core/lease/listr_lease.js'; diff --git a/src/commands/flags.ts b/src/commands/flags.ts index d9ea23aab..922264bf0 100644 --- a/src/commands/flags.ts +++ b/src/commands/flags.ts @@ -14,8 +14,8 @@ * limitations under the License. * */ -import {ConfigManager, constants} from '../core/index.js'; -import * as core from '../core/index.js'; +import * as constants from '../core/constants.js'; +import {ConfigManager} from '../core/config_manager.js'; import * as version from '../../version.js'; import path from 'path'; import type {CommandFlag} from '../types/index.js'; @@ -497,7 +497,7 @@ export class Flags { name: 'cache-dir', definition: { describe: 'Local cache directory', - defaultValue: core.constants.SOLO_CACHE_DIR, + defaultValue: constants.SOLO_CACHE_DIR, type: 'string', }, prompt: async function promptCacheDir(task: ListrTaskWrapper, input: any) { diff --git a/src/commands/index.ts b/src/commands/index.ts index f73e2c0c9..6daeb53ca 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -14,7 +14,6 @@ * limitations under the License. * */ -import {Flags as flags} from './flags.js'; import {ClusterCommand} from './cluster.js'; import {ContextCommand} from './context/index.js'; import {InitCommand} from './init.js'; @@ -31,7 +30,7 @@ import {type Opts} from '../types/index.js'; * @param opts it is an Options object containing logger * @returns an array of Yargs command builder */ -function Initialize(opts: Opts) { +export function Initialize(opts: Opts) { const initCmd = new InitCommand(opts); const clusterCmd = new ClusterCommand(opts); const contextCmd = new ContextCommand(opts); @@ -55,6 +54,3 @@ function Initialize(opts: Opts) { deploymentCommand.getCommandDefinition(), ]; } - -// Expose components from the command module -export {Initialize, flags}; diff --git a/src/commands/init.ts b/src/commands/init.ts index 6b5d38384..0cca5174e 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -17,11 +17,10 @@ import {Listr} from 'listr2'; import path from 'path'; import {BaseCommand} from './base.js'; -import * as core from '../core/index.js'; -import {constants} from '../core/index.js'; -import * as fs from 'fs'; +import fs from 'fs'; +import * as constants from '../core/constants.js'; import {SoloError} from '../core/errors.js'; -import {flags} from './index.js'; +import {Flags as flags} from './flags.js'; import chalk from 'chalk'; /** @@ -82,7 +81,7 @@ export class InitCommand extends BaseCommand { { title: 'Check dependencies', task: (_, task) => { - const deps = [core.constants.HELM]; + const deps = [constants.HELM]; const subTasks = self.depManager.taskCheckDependencies(deps); diff --git a/src/commands/mirror_node.ts b/src/commands/mirror_node.ts index e7e3e5746..209552636 100644 --- a/src/commands/mirror_node.ts +++ b/src/commands/mirror_node.ts @@ -17,10 +17,12 @@ import {ListrEnquirerPromptAdapter} from '@listr2/prompt-adapter-enquirer'; import {Listr} from 'listr2'; import {SoloError, IllegalArgumentError, MissingArgumentError} from '../core/errors.js'; -import {constants, type ProfileManager, type AccountManager} from '../core/index.js'; +import * as constants from '../core/constants.js'; +import {type AccountManager} from '../core/account_manager.js'; +import {type ProfileManager} from '../core/profile_manager.js'; import {BaseCommand} from './base.js'; -import {flags} from './index.js'; -import {getFileContents, getEnvValue} from '../core/helpers.js'; +import {Flags as flags} from './flags.js'; +import {getEnvValue} from '../core/helpers.js'; import {RemoteConfigTasks} from '../core/config/remote/remote_config_tasks.js'; import {type CommandBuilder, type PodName} from '../types/aliases.js'; import type {Opts} from '../types/index.js'; @@ -369,8 +371,8 @@ export class MirrorNodeCommand extends BaseCommand { const exchangeRatesFileIdNum = 112; const timestamp = Date.now(); - const fees = await getFileContents(this.accountManager, namespace, feesFileIdNum); - const exchangeRates = await getFileContents(this.accountManager, namespace, exchangeRatesFileIdNum); + const fees = await this.accountManager.getFileContents(namespace, feesFileIdNum); + const exchangeRates = await this.accountManager.getFileContents(namespace, exchangeRatesFileIdNum); const importFeesQuery = `INSERT INTO public.file_data(file_data, consensus_timestamp, entity_id, transaction_type) VALUES (decode('${fees}', 'hex'), ${timestamp + '000000'}, ${feesFileIdNum}, 17);`; const importExchangeRatesQuery = `INSERT INTO public.file_data(file_data, consensus_timestamp, entity_id, transaction_type) VALUES (decode('${exchangeRates}', 'hex'), ${ diff --git a/src/commands/network.ts b/src/commands/network.ts index 345e64684..5d2781441 100644 --- a/src/commands/network.ts +++ b/src/commands/network.ts @@ -19,14 +19,18 @@ import chalk from 'chalk'; import {Listr} from 'listr2'; import {SoloError, IllegalArgumentError, MissingArgumentError} from '../core/errors.js'; import {BaseCommand} from './base.js'; -import {flags} from './index.js'; -import {constants, Templates} from '../core/index.js'; +import {Flags as flags} from './flags.js'; +import * as constants from '../core/constants.js'; +import {Templates} from '../core/templates.js'; import * as helpers from '../core/helpers.js'; import path from 'path'; import {addDebugOptions, validatePath} from '../core/helpers.js'; import fs from 'fs'; import {RemoteConfigTasks} from '../core/config/remote/remote_config_tasks.js'; -import type {CertificateManager, KeyManager, PlatformInstaller, ProfileManager} from '../core/index.js'; +import {type KeyManager} from '../core/key_manager.js'; +import {type PlatformInstaller} from '../core/platform_installer.js'; +import {type ProfileManager} from '../core/profile_manager.js'; +import {type CertificateManager} from '../core/certificate_manager.js'; import {type CommandBuilder, type NodeAlias, type NodeAliases} from '../types/aliases.js'; import type {Opts} from '../types/index.js'; import {ListrLease} from '../core/lease/listr_lease.js'; diff --git a/src/commands/node/configs.ts b/src/commands/node/configs.ts index 53780cc47..71cc0cd76 100644 --- a/src/commands/node/configs.ts +++ b/src/commands/node/configs.ts @@ -15,14 +15,15 @@ * */ import {FREEZE_ADMIN_ACCOUNT} from '../../core/constants.js'; -import {constants, Templates} from '../../core/index.js'; +import {Templates} from '../../core/templates.js'; +import * as constants from '../../core/constants.js'; import {PrivateKey} from '@hashgraph/sdk'; import {SoloError} from '../../core/errors.js'; import * as helpers from '../../core/helpers.js'; import path from 'path'; import fs from 'fs'; import {validatePath} from '../../core/helpers.js'; -import {flags} from '../index.js'; +import {Flags as flags} from '../flags.js'; import {type NodeAlias, type NodeAliases, type PodName} from '../../types/aliases.js'; import {type NetworkNodeServices} from '../../core/network_node_services.js'; diff --git a/src/commands/node/flags.ts b/src/commands/node/flags.ts index af2cf10c5..2ccf4b2ef 100644 --- a/src/commands/node/flags.ts +++ b/src/commands/node/flags.ts @@ -14,7 +14,7 @@ * limitations under the License. * */ -import {flags} from '../index.js'; +import {Flags as flags} from '../flags.js'; export const DEFAULT_FLAGS = { requiredFlags: [], diff --git a/src/commands/node/handlers.ts b/src/commands/node/handlers.ts index a70f5e8f4..f7057ed75 100644 --- a/src/commands/node/handlers.ts +++ b/src/commands/node/handlers.ts @@ -31,15 +31,13 @@ import { stopConfigBuilder, updateConfigBuilder, } from './configs.js'; -import { - type ConfigManager, - constants, - type K8, - type PlatformInstaller, - type AccountManager, - type LeaseManager, - type RemoteConfigManager, -} from '../../core/index.js'; +import * as constants from '../../core/constants.js'; +import {type AccountManager} from '../../core/account_manager.js'; +import {type ConfigManager} from '../../core/config_manager.js'; +import {type PlatformInstaller} from '../../core/platform_installer.js'; +import {type K8} from '../../core/k8.js'; +import {type LeaseManager} from '../../core/lease/lease_manager.js'; +import {type RemoteConfigManager} from '../../core/config/remote/remote_config_manager.js'; import {IllegalArgumentError} from '../../core/errors.js'; import {ConsensusNodeStates} from '../../core/config/remote/enumerations.js'; import {RemoteConfigTasks} from '../../core/config/remote/remote_config_tasks.js'; @@ -49,6 +47,7 @@ import type {NodeCommandTasks} from './tasks.js'; import {type Lease} from '../../core/lease/lease.js'; import {NodeSubcommandType} from '../../core/enumerations.js'; import {type CommandHandlers} from '../../types/index.js'; +import {NodeHelper} from './helper.js'; export class NodeCommandHandlers implements CommandHandlers { private readonly accountManager: AccountManager; @@ -255,7 +254,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, prepareUpgradeConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -277,7 +276,7 @@ export class NodeCommandHandlers implements CommandHandlers { async freezeUpgrade(argv: any) { argv = helpers.addFlagsToArgv(argv, NodeFlags.DEFAULT_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, prepareUpgradeConfigBuilder.bind(this), null), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -301,7 +300,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, downloadGeneratedFilesConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -325,7 +324,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ ...this.updatePrepareTasks(argv, lease), ...this.updateSubmitTransactionsTasks(argv), @@ -347,10 +346,10 @@ export class NodeCommandHandlers implements CommandHandlers { argv = helpers.addFlagsToArgv(argv, NodeFlags.UPDATE_PREPARE_FLAGS); const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ ...this.updatePrepareTasks(argv, lease), - this.tasks.saveContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, helpers.updateSaveContextParser), + this.tasks.saveContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, NodeHelper.updateSaveContextParser), ], { concurrent: false, @@ -367,11 +366,11 @@ export class NodeCommandHandlers implements CommandHandlers { async updateSubmitTransactions(argv) { const lease = await this.leaseManager.create(); argv = helpers.addFlagsToArgv(argv, NodeFlags.UPDATE_SUBMIT_TRANSACTIONS_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, updateConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), - this.tasks.loadContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, helpers.updateLoadContextParser), + this.tasks.loadContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, NodeHelper.updateLoadContextParser), ...this.updateSubmitTransactionsTasks(argv), ], { @@ -389,11 +388,11 @@ export class NodeCommandHandlers implements CommandHandlers { async updateExecute(argv) { const lease = await this.leaseManager.create(); argv = helpers.addFlagsToArgv(argv, NodeFlags.UPDATE_EXECUTE_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, updateConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), - this.tasks.loadContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, helpers.updateLoadContextParser), + this.tasks.loadContextData(argv, NodeCommandHandlers.UPDATE_CONTEXT_FILE, NodeHelper.updateLoadContextParser), ...this.updateExecuteTasks(argv), ], { @@ -411,7 +410,7 @@ export class NodeCommandHandlers implements CommandHandlers { async delete(argv: any) { argv = helpers.addFlagsToArgv(argv, NodeFlags.DELETE_FLAGS); const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ ...this.deletePrepareTaskList(argv, lease), ...this.deleteSubmitTransactionsTaskList(argv), @@ -434,10 +433,10 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ ...this.deletePrepareTaskList(argv, lease), - this.tasks.saveContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, helpers.deleteSaveContextParser), + this.tasks.saveContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, NodeHelper.deleteSaveContextParser), ], { concurrent: false, @@ -456,10 +455,10 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, deleteConfigBuilder.bind(this), lease), - this.tasks.loadContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, helpers.deleteLoadContextParser), + this.tasks.loadContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, NodeHelper.deleteLoadContextParser), ...this.deleteSubmitTransactionsTaskList(argv), ], { @@ -479,10 +478,10 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, deleteConfigBuilder.bind(this), lease), - this.tasks.loadContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, helpers.deleteLoadContextParser), + this.tasks.loadContextData(argv, NodeCommandHandlers.DELETE_CONTEXT_FILE, NodeHelper.deleteLoadContextParser), ...this.deleteExecuteTaskList(argv), ], { @@ -502,7 +501,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [...this.addPrepareTasks(argv, lease), ...this.addSubmitTransactionsTasks(argv), ...this.addExecuteTasks(argv)], { concurrent: false, @@ -521,7 +520,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ ...this.addPrepareTasks(argv, lease), this.tasks.saveContextData(argv, NodeCommandHandlers.ADD_CONTEXT_FILE, helpers.addSaveContextParser), @@ -543,7 +542,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, addConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -567,7 +566,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, addConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -589,7 +588,7 @@ export class NodeCommandHandlers implements CommandHandlers { async logs(argv: any) { argv = helpers.addFlagsToArgv(argv, NodeFlags.LOGS_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, logsConfigBuilder.bind(this), null), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -610,7 +609,7 @@ export class NodeCommandHandlers implements CommandHandlers { async states(argv: any) { argv = helpers.addFlagsToArgv(argv, NodeFlags.STATES_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [this.tasks.initialize(argv, statesConfigBuilder.bind(this), null), this.tasks.getNodeStateFiles()], { concurrent: false, @@ -629,7 +628,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, refreshConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -659,7 +658,7 @@ export class NodeCommandHandlers implements CommandHandlers { async keys(argv: any) { argv = helpers.addFlagsToArgv(argv, NodeFlags.KEYS_FLAGS); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, keysConfigBuilder.bind(this), null), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -684,7 +683,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, stopConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -712,7 +711,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, startConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), @@ -743,7 +742,7 @@ export class NodeCommandHandlers implements CommandHandlers { const lease = await this.leaseManager.create(); - const action = helpers.commandActionBuilder( + const action = this.parent.commandActionBuilder( [ this.tasks.initialize(argv, setupConfigBuilder.bind(this), lease), RemoteConfigTasks.loadRemoteConfig.bind(this)(argv), diff --git a/src/commands/node/helper.ts b/src/commands/node/helper.ts new file mode 100644 index 000000000..3c1eaba99 --- /dev/null +++ b/src/commands/node/helper.ts @@ -0,0 +1,131 @@ +/** + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the ""License""); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an ""AS IS"" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +import {type NodeDeleteConfigClass, type NodeUpdateConfigClass} from './configs.js'; +import {type NodeAlias, type NodeAliases} from '../../types/aliases.js'; +import {PrivateKey} from '@hashgraph/sdk'; + +/** + * Copyright (C) 2024 Hedera Hashgraph, LLC + * + * Licensed under the Apache License, Version 2.0 (the ""License""); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an ""AS IS"" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +export class NodeHelper { + /** + * Returns an object that can be written to a file without data loss. + * Contains fields needed for deleting a node through separate commands + * @param ctx - accumulator object + * @returns file writable object + */ + static deleteSaveContextParser(ctx: {config: NodeDeleteConfigClass; upgradeZipHash: any}) { + const exportedCtx = {} as { + adminKey: string; + existingNodeAliases: NodeAliases; + upgradeZipHash: string; + nodeAlias: NodeAlias; + }; + + const config = ctx.config; + exportedCtx.adminKey = config.adminKey.toString(); + exportedCtx.existingNodeAliases = config.existingNodeAliases; + exportedCtx.upgradeZipHash = ctx.upgradeZipHash; + exportedCtx.nodeAlias = config.nodeAlias; + return exportedCtx; + } + + /** + * Initializes objects in the context from a provided string + * Contains fields needed for deleting a node through separate commands + * @param ctx - accumulator object + * @param ctxData - data in string format + * @returns file writable object + */ + static deleteLoadContextParser(ctx: {config: NodeDeleteConfigClass; upgradeZipHash: any}, ctxData: any) { + const config = ctx.config; + config.adminKey = PrivateKey.fromStringED25519(ctxData.adminKey); + config.existingNodeAliases = ctxData.existingNodeAliases; + config.allNodeAliases = ctxData.existingNodeAliases; + ctx.upgradeZipHash = ctxData.upgradeZipHash; + config.podNames = {}; + } + + /** + * Returns an object that can be written to a file without data loss. + * Contains fields needed for updating a node through separate commands + * @param ctx - accumulator object + * @returns file writable object + */ + static updateSaveContextParser(ctx: {config: NodeUpdateConfigClass; upgradeZipHash: any}) { + const exportedCtx: any = {}; + + const config = /** @type {NodeUpdateConfigClass} **/ ctx.config; + exportedCtx.adminKey = config.adminKey.toString(); + exportedCtx.newAdminKey = config.newAdminKey.toString(); + exportedCtx.freezeAdminPrivateKey = config.freezeAdminPrivateKey.toString(); + exportedCtx.treasuryKey = config.treasuryKey.toString(); + exportedCtx.existingNodeAliases = config.existingNodeAliases; + exportedCtx.upgradeZipHash = ctx.upgradeZipHash; + exportedCtx.nodeAlias = config.nodeAlias; + exportedCtx.newAccountNumber = config.newAccountNumber; + exportedCtx.tlsPublicKey = config.tlsPublicKey; + exportedCtx.tlsPrivateKey = config.tlsPrivateKey; + exportedCtx.gossipPublicKey = config.gossipPublicKey; + exportedCtx.gossipPrivateKey = config.gossipPrivateKey; + exportedCtx.allNodeAliases = config.allNodeAliases; + + return exportedCtx; + } + + /** + * Initializes objects in the context from a provided string + * Contains fields needed for updating a node through separate commands + * @param ctx - accumulator object + * @param ctxData - data in string format + * @returns file writable object + */ + static updateLoadContextParser(ctx: {config: NodeUpdateConfigClass; upgradeZipHash: any}, ctxData: any) { + const config = ctx.config; + + if (ctxData.newAdminKey && ctxData.newAdminKey.length) { + config.newAdminKey = PrivateKey.fromStringED25519(ctxData.newAdminKey); + } + + config.freezeAdminPrivateKey = PrivateKey.fromStringED25519(ctxData.freezeAdminPrivateKey); + config.treasuryKey = PrivateKey.fromStringED25519(ctxData.treasuryKey); + config.adminKey = PrivateKey.fromStringED25519(ctxData.adminKey); + config.existingNodeAliases = ctxData.existingNodeAliases; + config.nodeAlias = ctxData.nodeAlias; + config.newAccountNumber = ctxData.newAccountNumber; + config.tlsPublicKey = ctxData.tlsPublicKey; + config.tlsPrivateKey = ctxData.tlsPrivateKey; + config.gossipPublicKey = ctxData.gossipPublicKey; + config.gossipPrivateKey = ctxData.gossipPrivateKey; + config.allNodeAliases = ctxData.allNodeAliases; + ctx.upgradeZipHash = ctxData.upgradeZipHash; + config.podNames = {}; + } +} diff --git a/src/commands/node/index.ts b/src/commands/node/index.ts index c7bac3d9f..c3d9be138 100644 --- a/src/commands/node/index.ts +++ b/src/commands/node/index.ts @@ -16,7 +16,8 @@ */ import {IllegalArgumentError} from '../../core/errors.js'; -import {type AccountManager, YargsCommand} from '../../core/index.js'; +import {type AccountManager} from '../../core/account_manager.js'; +import {YargsCommand} from '../../core/yargs_command.js'; import {BaseCommand} from './../base.js'; import {NodeCommandTasks} from './tasks.js'; import * as NodeFlags from './flags.js'; diff --git a/src/commands/node/tasks.ts b/src/commands/node/tasks.ts index 30676ef62..b638fc97a 100644 --- a/src/commands/node/tasks.ts +++ b/src/commands/node/tasks.ts @@ -14,20 +14,18 @@ * limitations under the License. * */ -import { - constants, - Task, - Templates, - Zippy, - type K8, - type ChartManager, - type ConfigManager, - type KeyManager, - type PlatformInstaller, - type ProfileManager, - type AccountManager, - type CertificateManager, -} from '../../core/index.js'; +import {type AccountManager} from '../../core/account_manager.js'; +import {type ConfigManager} from '../../core/config_manager.js'; +import {type KeyManager} from '../../core/key_manager.js'; +import {type ProfileManager} from '../../core/profile_manager.js'; +import {type PlatformInstaller} from '../../core/platform_installer.js'; +import {type K8} from '../../core/k8.js'; +import {type ChartManager} from '../../core/chart_manager.js'; +import {type CertificateManager} from '../../core/certificate_manager.js'; +import {Zippy} from '../../core/zippy.js'; +import * as constants from '../../core/constants.js'; +import {Templates} from '../../core/templates.js'; +import {Task} from '../../core/task.js'; import { DEFAULT_NETWORK_NODE_NAME, FREEZE_ADMIN_ACCOUNT, @@ -58,15 +56,13 @@ import crypto from 'crypto'; import { addDebugOptions, getNodeAccountMap, - getNodeLogs, - getNodeStatesFromPod, prepareEndpoints, renameAndCopyFile, sleep, splitFlagInput, } from '../../core/helpers.js'; import chalk from 'chalk'; -import {flags} from '../index.js'; +import {Flags as flags} from '../flags.js'; import {type SoloLogger} from '../../core/logging.js'; import type {Listr, ListrTaskWrapper} from 'listr2'; import { @@ -1123,7 +1119,7 @@ export class NodeCommandTasks { getNodeLogsAndConfigs() { return new Task('Get node logs and configs', async (ctx: any, task: ListrTaskWrapper) => { - await getNodeLogs(this.k8, ctx.config.namespace); + await this.k8.getNodeLogs(ctx.config.namespace); }); } @@ -1131,7 +1127,7 @@ export class NodeCommandTasks { const self = this; return new Task('Get node states', async (ctx: any, task: ListrTaskWrapper) => { for (const nodeAlias of ctx.config.nodeAliases) { - await getNodeStatesFromPod(self.k8, ctx.config.namespace, nodeAlias); + await self.k8.getNodeStatesFromPod(ctx.config.namespace, nodeAlias); } }); } diff --git a/src/commands/relay.ts b/src/commands/relay.ts index 553a2c9f2..872ef7502 100644 --- a/src/commands/relay.ts +++ b/src/commands/relay.ts @@ -17,10 +17,11 @@ import {Listr} from 'listr2'; import {SoloError, MissingArgumentError} from '../core/errors.js'; import * as helpers from '../core/helpers.js'; -import type {ProfileManager, AccountManager} from '../core/index.js'; -import {constants} from '../core/index.js'; +import * as constants from '../core/constants.js'; +import {type ProfileManager} from '../core/profile_manager.js'; +import {type AccountManager} from '../core/account_manager.js'; import {BaseCommand} from './base.js'; -import {flags} from './index.js'; +import {Flags as flags} from './flags.js'; import {getNodeAccountMap} from '../core/helpers.js'; import {RemoteConfigTasks} from '../core/config/remote/remote_config_tasks.js'; import {type CommandBuilder, type NodeAliases} from '../types/aliases.js'; diff --git a/src/core/account_manager.ts b/src/core/account_manager.ts index 27a161b74..d00b3fa2f 100644 --- a/src/core/account_manager.ts +++ b/src/core/account_manager.ts @@ -753,4 +753,12 @@ export class AccountManager { // @ts-ignore return Base64.encode(addressBookBytes); } + + async getFileContents(namespace: string, fileNum: number) { + await this.loadNodeClient(namespace); + const client = this._nodeClient; + const fileId = FileId.fromString(`0.0.${fileNum}`); + const queryFees = new FileContentsQuery().setFileId(fileId); + return Buffer.from(await queryFees.execute(client)).toString('hex'); + } } diff --git a/src/core/certificate_manager.ts b/src/core/certificate_manager.ts index f8ed7d392..d1e3876a5 100644 --- a/src/core/certificate_manager.ts +++ b/src/core/certificate_manager.ts @@ -15,7 +15,7 @@ * */ import {MissingArgumentError, SoloError} from './errors.js'; -import {flags} from '../commands/index.js'; +import {Flags as flags} from '../commands/flags.js'; import fs from 'fs'; import {Templates} from './templates.js'; import {GrpcProxyTlsEnums} from './enumerations.js'; diff --git a/src/core/chart_manager.ts b/src/core/chart_manager.ts index 07132cddb..cab158fa9 100644 --- a/src/core/chart_manager.ts +++ b/src/core/chart_manager.ts @@ -14,7 +14,8 @@ * limitations under the License. * */ -import {constants, type Helm} from './index.js'; +import * as constants from './constants.js'; +import {type Helm} from './helm.js'; import chalk from 'chalk'; import {SoloError} from './errors.js'; import {type SoloLogger} from './logging.js'; diff --git a/src/core/config/local_config.ts b/src/core/config/local_config.ts index 6a65fb55d..57ff22b2c 100644 --- a/src/core/config/local_config.ts +++ b/src/core/config/local_config.ts @@ -18,7 +18,7 @@ import {IsEmail, IsNotEmpty, IsObject, IsString, validateSync} from 'class-valid import type {ListrTask, ListrTaskWrapper} from 'listr2'; import fs from 'fs'; import * as yaml from 'yaml'; -import {flags} from '../../commands/index.js'; +import {Flags as flags} from '../../commands/flags.js'; import {type Deployments, type DeploymentStructure, type LocalConfigData} from './local_config_data.js'; import {MissingArgumentError, SoloError} from '../errors.js'; import {type SoloLogger} from '../logging.js'; diff --git a/src/core/config/remote/remote_config_manager.ts b/src/core/config/remote/remote_config_manager.ts index 1d574c832..50c047c1e 100644 --- a/src/core/config/remote/remote_config_manager.ts +++ b/src/core/config/remote/remote_config_manager.ts @@ -19,7 +19,7 @@ import {MissingArgumentError, SoloError} from '../../errors.js'; import {RemoteConfigDataWrapper} from './remote_config_data_wrapper.js'; import chalk from 'chalk'; import {RemoteConfigMetadata} from './metadata.js'; -import {flags} from '../../../commands/index.js'; +import {Flags as flags} from '../../../commands/flags.js'; import * as yaml from 'yaml'; import {ComponentsDataWrapper} from './components_data_wrapper.js'; import type {K8} from '../../k8.js'; diff --git a/src/core/config_manager.ts b/src/core/config_manager.ts index fd9c7820f..82d9fcc4a 100644 --- a/src/core/config_manager.ts +++ b/src/core/config_manager.ts @@ -16,7 +16,7 @@ */ import {SoloError, MissingArgumentError} from './errors.js'; import {SoloLogger} from './logging.js'; -import {flags} from '../commands/index.js'; +import {Flags as flags} from '../commands/flags.js'; import * as paths from 'path'; import * as helpers from './helpers.js'; import type * as yargs from 'yargs'; diff --git a/src/core/dependency_managers/helm_dependency_manager.ts b/src/core/dependency_managers/helm_dependency_manager.ts index 54f2ed8d7..120dd6904 100644 --- a/src/core/dependency_managers/helm_dependency_manager.ts +++ b/src/core/dependency_managers/helm_dependency_manager.ts @@ -20,7 +20,10 @@ import path from 'path'; import * as util from 'util'; import {IllegalArgumentError, MissingArgumentError} from '../errors.js'; import * as helpers from '../helpers.js'; -import {constants, type PackageDownloader, Templates, type Zippy} from '../index.js'; +import * as constants from '../constants.js'; +import {type PackageDownloader} from '../package_downloader.js'; +import {type Zippy} from '../zippy.js'; +import {Templates} from '../templates.js'; import * as version from '../../../version.js'; import {ShellRunner} from '../shell_runner.js'; import * as semver from 'semver'; diff --git a/src/core/helm.ts b/src/core/helm.ts index 59208e7f4..b2cec27f8 100644 --- a/src/core/helm.ts +++ b/src/core/helm.ts @@ -15,7 +15,7 @@ * */ import os from 'os'; -import {constants} from './index.js'; +import * as constants from './constants.js'; import {ShellRunner} from './shell_runner.js'; import {Templates} from './templates.js'; import {IllegalArgumentError} from './errors.js'; diff --git a/src/core/helpers.ts b/src/core/helpers.ts index 7e7a3f0e9..f8f9abcc2 100644 --- a/src/core/helpers.ts +++ b/src/core/helpers.ts @@ -21,18 +21,12 @@ import util from 'util'; import {SoloError} from './errors.js'; import * as semver from 'semver'; import {Templates} from './templates.js'; -import {HEDERA_HAPI_PATH, ROOT_CONTAINER, ROOT_DIR, SOLO_LOGS_DIR} from './constants.js'; -import {constants, type K8} from './index.js'; -import {FileContentsQuery, FileId, PrivateKey, ServiceEndpoint} from '@hashgraph/sdk'; -import {Listr} from 'listr2'; -import {type AccountManager} from './account_manager.js'; -import {type NodeAlias, type NodeAliases, type PodName} from '../types/aliases.js'; -import {type NodeDeleteConfigClass, type NodeUpdateConfigClass} from '../commands/node/configs.js'; -import {type CommandFlag, type CommandHandlers} from '../types/index.js'; -import {type V1Pod} from '@kubernetes/client-node'; +import {ROOT_DIR} from './constants.js'; +import * as constants from './constants.js'; +import {PrivateKey, ServiceEndpoint} from '@hashgraph/sdk'; +import {type NodeAlias, type NodeAliases} from '../types/aliases.js'; +import {type CommandFlag} from '../types/index.js'; import {type SoloLogger} from './logging.js'; -import {type NodeCommandHandlers} from '../commands/node/handlers.js'; -import {type Lease} from './lease/lease.js'; export function sleep(ms: number) { return new Promise(resolve => { @@ -183,91 +177,6 @@ export function validatePath(input: string) { return input; } -/** - * Download logs files from all network pods and save to local solo log directory - * @param k8 - an instance of core/K8 - * @param namespace - the namespace of the network - * @returns a promise that resolves when the logs are downloaded - */ -export async function getNodeLogs(k8: K8, namespace: string) { - const pods = await k8.getPodsByLabel(['solo.hedera.com/type=network-node']); - - const timeString = new Date().toISOString().replace(/:/g, '-').replace(/\./g, '-'); - - const promises = []; - for (const pod of pods) { - promises.push(getNodeLog(pod, namespace, timeString, k8)); - } - return await Promise.all(promises); -} - -async function getNodeLog(pod: V1Pod, namespace: string, timeString: string, k8: K8) { - const podName = pod.metadata!.name as PodName; - k8.logger.debug(`getNodeLogs(${pod.metadata.name}): begin...`); - const targetDir = path.join(SOLO_LOGS_DIR, namespace, timeString); - try { - if (!fs.existsSync(targetDir)) { - fs.mkdirSync(targetDir, {recursive: true}); - } - const scriptName = 'support-zip.sh'; - const sourcePath = path.join(constants.RESOURCES_DIR, scriptName); // script source path - await k8.copyTo(podName, ROOT_CONTAINER, sourcePath, `${HEDERA_HAPI_PATH}`); - await sleep(1000); // wait for the script to sync to the file system - await k8.execContainer(podName, ROOT_CONTAINER, [ - 'bash', - '-c', - `sync ${HEDERA_HAPI_PATH} && sudo chown hedera:hedera ${HEDERA_HAPI_PATH}/${scriptName}`, - ]); - await k8.execContainer(podName, ROOT_CONTAINER, [ - 'bash', - '-c', - `sudo chmod 0755 ${HEDERA_HAPI_PATH}/${scriptName}`, - ]); - await k8.execContainer(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/${scriptName}`); - await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/data/${podName}.zip`, targetDir); - } catch (e: Error | any) { - // not throw error here, so we can continue to finish downloading logs from other pods - // and also delete namespace in the end - k8.logger.error(`${constants.NODE_LOG_FAILURE_MSG} ${podName}`, e); - } - k8.logger.debug(`getNodeLogs(${pod.metadata.name}): ...end`); -} - -/** - * Download state files from a pod - * @param k8 - an instance of core/K8 - * @param namespace - the namespace of the network - * @param nodeAlias - the pod name - * @returns a promise that resolves when the state files are downloaded - */ -export async function getNodeStatesFromPod(k8: K8, namespace: string, nodeAlias: string) { - const pods = await k8.getPodsByLabel([`solo.hedera.com/node-name=${nodeAlias}`]); - // get length of pods - const promises = []; - for (const pod of pods) { - promises.push(getNodeState(pod, namespace, k8)); - } - return await Promise.all(promises); -} - -async function getNodeState(pod: V1Pod, namespace: string, k8: K8) { - const podName = pod.metadata!.name as PodName; - k8.logger.debug(`getNodeState(${pod.metadata.name}): begin...`); - const targetDir = path.join(SOLO_LOGS_DIR, namespace); - try { - if (!fs.existsSync(targetDir)) { - fs.mkdirSync(targetDir, {recursive: true}); - } - const zipCommand = `tar -czf ${HEDERA_HAPI_PATH}/${podName}-state.zip -C ${HEDERA_HAPI_PATH}/data/saved .`; - await k8.execContainer(podName, ROOT_CONTAINER, zipCommand); - await k8.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/${podName}-state.zip`, targetDir); - } catch (e: Error | any) { - k8.logger.error(`failed to download state from pod ${podName}`, e); - k8.logger.showUser(`Failed to download state from pod ${podName}` + e); - } - k8.logger.debug(`getNodeState(${pod.metadata.name}): ...end`); -} - /** * Create a map of node aliases to account IDs * @param nodeAliases @@ -286,14 +195,6 @@ export function getNodeAccountMap(nodeAliases: NodeAliases) { return accountMap; } -export async function getFileContents(accountManager: AccountManager, namespace: string, fileNum: number) { - await accountManager.loadNodeClient(namespace); - const client = accountManager._nodeClient; - const fileId = FileId.fromString(`0.0.${fileNum}`); - const queryFees = new FileContentsQuery().setFileId(fileId); - return Buffer.from(await queryFees.execute(client)).toString('hex'); -} - export function getEnvValue(envVarArray: string[], name: string) { const kvPair = envVarArray.find(v => v.startsWith(`${name}=`)); return kvPair ? kvPair.split('=')[1] : null; @@ -398,100 +299,6 @@ export function addLoadContextParser(ctx: any, ctxData: any) { } } -/** - * Returns an object that can be written to a file without data loss. - * Contains fields needed for deleting a node through separate commands - * @param ctx - accumulator object - * @returns file writable object - */ -export function deleteSaveContextParser(ctx: {config: NodeDeleteConfigClass; upgradeZipHash: any}) { - const exportedCtx = {} as { - adminKey: string; - existingNodeAliases: NodeAliases; - upgradeZipHash: string; - nodeAlias: NodeAlias; - }; - - const config = ctx.config; - exportedCtx.adminKey = config.adminKey.toString(); - exportedCtx.existingNodeAliases = config.existingNodeAliases; - exportedCtx.upgradeZipHash = ctx.upgradeZipHash; - exportedCtx.nodeAlias = config.nodeAlias; - return exportedCtx; -} - -/** - * Initializes objects in the context from a provided string - * Contains fields needed for deleting a node through separate commands - * @param ctx - accumulator object - * @param ctxData - data in string format - * @returns file writable object - */ -export function deleteLoadContextParser(ctx: {config: NodeDeleteConfigClass; upgradeZipHash: any}, ctxData: any) { - const config = ctx.config; - config.adminKey = PrivateKey.fromStringED25519(ctxData.adminKey); - config.existingNodeAliases = ctxData.existingNodeAliases; - config.allNodeAliases = ctxData.existingNodeAliases; - ctx.upgradeZipHash = ctxData.upgradeZipHash; - config.podNames = {}; -} - -/** - * Returns an object that can be written to a file without data loss. - * Contains fields needed for updating a node through separate commands - * @param ctx - accumulator object - * @returns file writable object - */ -export function updateSaveContextParser(ctx: {config: NodeUpdateConfigClass; upgradeZipHash: any}) { - const exportedCtx: any = {}; - - const config = /** @type {NodeUpdateConfigClass} **/ ctx.config; - exportedCtx.adminKey = config.adminKey.toString(); - exportedCtx.newAdminKey = config.newAdminKey.toString(); - exportedCtx.freezeAdminPrivateKey = config.freezeAdminPrivateKey.toString(); - exportedCtx.treasuryKey = config.treasuryKey.toString(); - exportedCtx.existingNodeAliases = config.existingNodeAliases; - exportedCtx.upgradeZipHash = ctx.upgradeZipHash; - exportedCtx.nodeAlias = config.nodeAlias; - exportedCtx.newAccountNumber = config.newAccountNumber; - exportedCtx.tlsPublicKey = config.tlsPublicKey; - exportedCtx.tlsPrivateKey = config.tlsPrivateKey; - exportedCtx.gossipPublicKey = config.gossipPublicKey; - exportedCtx.gossipPrivateKey = config.gossipPrivateKey; - exportedCtx.allNodeAliases = config.allNodeAliases; - - return exportedCtx; -} - -/** - * Initializes objects in the context from a provided string - * Contains fields needed for updating a node through separate commands - * @param ctx - accumulator object - * @param ctxData - data in string format - * @returns file writable object - */ -export function updateLoadContextParser(ctx: {config: NodeUpdateConfigClass; upgradeZipHash: any}, ctxData: any) { - const config = ctx.config; - - if (ctxData.newAdminKey && ctxData.newAdminKey.length) { - config.newAdminKey = PrivateKey.fromStringED25519(ctxData.newAdminKey); - } - - config.freezeAdminPrivateKey = PrivateKey.fromStringED25519(ctxData.freezeAdminPrivateKey); - config.treasuryKey = PrivateKey.fromStringED25519(ctxData.treasuryKey); - config.adminKey = PrivateKey.fromStringED25519(ctxData.adminKey); - config.existingNodeAliases = ctxData.existingNodeAliases; - config.nodeAlias = ctxData.nodeAlias; - config.newAccountNumber = ctxData.newAccountNumber; - config.tlsPublicKey = ctxData.tlsPublicKey; - config.tlsPrivateKey = ctxData.tlsPrivateKey; - config.gossipPublicKey = ctxData.gossipPublicKey; - config.gossipPrivateKey = ctxData.gossipPrivateKey; - config.allNodeAliases = ctxData.allNodeAliases; - ctx.upgradeZipHash = ctxData.upgradeZipHash; - config.podNames = {}; -} - export function prepareEndpoints(endpointType: string, endpoints: string[], defaultPort: number | string) { const ret: ServiceEndpoint[] = []; for (const endpoint of endpoints) { @@ -531,30 +338,6 @@ export function prepareEndpoints(endpointType: string, endpoints: string[], defa return ret; } -export function commandActionBuilder(actionTasks: any, options: any, errorString: string, lease: Lease | null) { - return async function (argv: any, commandDef: CommandHandlers) { - const tasks = new Listr([...actionTasks], options); - - try { - await tasks.run(); - } catch (e: Error | any) { - commandDef.parent.logger.error(`${errorString}: ${e.message}`, e); - throw new SoloError(`${errorString}: ${e.message}`, e); - } finally { - const promises = []; - - // @ts-ignore - if (commandDef.close) { - // @ts-ignore - promises.push(commandDef.close()); - } - - if (lease) promises.push(lease.release()); - await Promise.all(promises); - } - }; -} - /** Adds all the types of flags as properties on the provided argv object */ export function addFlagsToArgv( argv: any, diff --git a/src/core/index.ts b/src/core/index.ts deleted file mode 100644 index 182f8e00a..000000000 --- a/src/core/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2024 Hedera Hashgraph, LLC - * - * Licensed under the Apache License, Version 2.0 (the ""License""); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an ""AS IS"" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -import * as logging from './logging.js'; -import * as constants from './constants.js'; -import {Helm} from './helm.js'; -import {K8} from './k8.js'; -import {PackageDownloader} from './package_downloader.js'; -import {PlatformInstaller} from './platform_installer.js'; -import {Zippy} from './zippy.js'; -import {Templates} from './templates.js'; -import {ChartManager} from './chart_manager.js'; -import {ConfigManager} from './config_manager.js'; -import {KeyManager} from './key_manager.js'; -import {ProfileManager} from './profile_manager.js'; -import {YargsCommand} from './yargs_command.js'; -import {Task} from './task.js'; -import * as helpers from './helpers.js'; -import {DependencyManager} from './dependency_managers/index.js'; -import {AccountManager} from './account_manager.js'; -import {LeaseManager} from './lease/lease_manager.js'; -import {CertificateManager} from './certificate_manager.js'; -import {LocalConfig} from './config/local_config.js'; -import {RemoteConfigManager} from './config/remote/remote_config_manager.js'; - -// Expose components from the core module -export { - logging, - constants, - helpers, - Helm, - K8, - PackageDownloader, - PlatformInstaller, - Zippy, - Templates, - ChartManager, - ConfigManager, - KeyManager, - ProfileManager, - YargsCommand, - Task, - DependencyManager, - AccountManager, - LeaseManager, - CertificateManager, - LocalConfig, - RemoteConfigManager, -}; diff --git a/src/core/k8.ts b/src/core/k8.ts index c0d6022fe..ac7435e1a 100644 --- a/src/core/k8.ts +++ b/src/core/k8.ts @@ -19,21 +19,22 @@ import fs from 'fs'; import net from 'net'; import os from 'os'; import path from 'path'; -import {flags} from '../commands/index.js'; +import {Flags as flags} from '../commands/flags.js'; import {SoloError, IllegalArgumentError, MissingArgumentError} from './errors.js'; import * as tar from 'tar'; import {v4 as uuid4} from 'uuid'; -import {type V1Lease, V1ObjectMeta, V1Secret, type Context} from '@kubernetes/client-node'; -import {sleep} from './helpers.js'; -import {type ConfigManager, constants} from './index.js'; +import {type V1Lease, V1ObjectMeta, V1Secret, type Context, type V1Pod} from '@kubernetes/client-node'; import * as stream from 'node:stream'; +import type * as http from 'node:http'; +import type * as WebSocket from 'ws'; +import {sleep} from './helpers.js'; +import * as constants from './constants.js'; +import {type ConfigManager} from './config_manager.js'; import {type SoloLogger} from './logging.js'; -import type * as WebSocket from 'ws'; import {type PodName, type TarCreateFilter} from '../types/aliases.js'; import type {ExtendedNetServer, LocalContextObject} from '../types/index.js'; -import type * as http from 'node:http'; -import {MINUTES} from './constants.js'; +import {HEDERA_HAPI_PATH, MINUTES, ROOT_CONTAINER, SOLO_LOGS_DIR} from './constants.js'; interface TDirectoryData { directory: boolean; @@ -1532,4 +1533,88 @@ export class K8 { throw new SoloError(errorMessage, e); } } + + /** + * Download logs files from all network pods and save to local solo log directory + * @param namespace - the namespace of the network + * @returns a promise that resolves when the logs are downloaded + */ + async getNodeLogs(namespace: string) { + const pods = await this.getPodsByLabel(['solo.hedera.com/type=network-node']); + + const timeString = new Date().toISOString().replace(/:/g, '-').replace(/\./g, '-'); + + const promises = []; + for (const pod of pods) { + promises.push(this.getNodeLog(pod, namespace, timeString)); + } + return await Promise.all(promises); + } + + private async getNodeLog(pod: V1Pod, namespace: string, timeString: string) { + const podName = pod.metadata!.name as PodName; + this.logger.debug(`getNodeLogs(${pod.metadata.name}): begin...`); + const targetDir = path.join(SOLO_LOGS_DIR, namespace, timeString); + try { + if (!fs.existsSync(targetDir)) { + fs.mkdirSync(targetDir, {recursive: true}); + } + const scriptName = 'support-zip.sh'; + const sourcePath = path.join(constants.RESOURCES_DIR, scriptName); // script source path + await this.copyTo(podName, ROOT_CONTAINER, sourcePath, `${HEDERA_HAPI_PATH}`); + await sleep(1000); // wait for the script to sync to the file system + await this.execContainer(podName, ROOT_CONTAINER, [ + 'bash', + '-c', + `sync ${HEDERA_HAPI_PATH} && sudo chown hedera:hedera ${HEDERA_HAPI_PATH}/${scriptName}`, + ]); + await this.execContainer(podName, ROOT_CONTAINER, [ + 'bash', + '-c', + `sudo chmod 0755 ${HEDERA_HAPI_PATH}/${scriptName}`, + ]); + await this.execContainer(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/${scriptName}`); + await this.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/data/${podName}.zip`, targetDir); + } catch (e: Error | any) { + // not throw error here, so we can continue to finish downloading logs from other pods + // and also delete namespace in the end + this.logger.error(`${constants.NODE_LOG_FAILURE_MSG} ${podName}`, e); + } + this.logger.debug(`getNodeLogs(${pod.metadata.name}): ...end`); + } + + /** + * Download state files from a pod + * @param k8 - an instance of core/K8 + * @param namespace - the namespace of the network + * @param nodeAlias - the pod name + * @returns a promise that resolves when the state files are downloaded + */ + async getNodeStatesFromPod(namespace: string, nodeAlias: string) { + const pods = await this.getPodsByLabel([`solo.hedera.com/node-name=${nodeAlias}`]); + // get length of pods + const promises = []; + for (const pod of pods) { + promises.push(this.getNodeState(pod, namespace)); + } + return await Promise.all(promises); + } + + async getNodeState(pod: V1Pod, namespace: string) { + const podName = pod.metadata!.name as PodName; + this.logger.debug(`getNodeState(${pod.metadata.name}): begin...`); + const targetDir = path.join(SOLO_LOGS_DIR, namespace); + try { + if (!fs.existsSync(targetDir)) { + fs.mkdirSync(targetDir, {recursive: true}); + } + const zipCommand = `tar -czf ${HEDERA_HAPI_PATH}/${podName}-state.zip -C ${HEDERA_HAPI_PATH}/data/saved .`; + await this.execContainer(podName, ROOT_CONTAINER, zipCommand); + await this.copyFrom(podName, ROOT_CONTAINER, `${HEDERA_HAPI_PATH}/${podName}-state.zip`, targetDir); + } catch (e: Error | any) { + this.logger.error(`failed to download state from pod ${podName}`, e); + this.logger.showUser(`Failed to download state from pod ${podName}` + e); + } + this.logger.debug(`getNodeState(${pod.metadata.name}): ...end`); + } } diff --git a/src/core/key_manager.ts b/src/core/key_manager.ts index 122834a93..b55500bf6 100644 --- a/src/core/key_manager.ts +++ b/src/core/key_manager.ts @@ -19,7 +19,7 @@ import crypto from 'crypto'; import fs from 'fs'; import path from 'path'; import {SoloError, IllegalArgumentError, MissingArgumentError} from './errors.js'; -import {constants} from './index.js'; +import * as constants from './constants.js'; import {SoloLogger} from './logging.js'; import {Templates} from './templates.js'; import * as helpers from './helpers.js'; diff --git a/src/core/lease/lease_manager.ts b/src/core/lease/lease_manager.ts index 3487300cc..df89b0473 100644 --- a/src/core/lease/lease_manager.ts +++ b/src/core/lease/lease_manager.ts @@ -15,7 +15,7 @@ * */ import {MissingArgumentError} from '../errors.js'; -import {flags} from '../../commands/index.js'; +import {Flags as flags} from '../../commands/flags.js'; import type {ConfigManager} from '../config_manager.js'; import type {K8} from '../k8.js'; import type {SoloLogger} from '../logging.js'; diff --git a/src/core/logging.ts b/src/core/logging.ts index 1622d68fd..46c71f4d3 100644 --- a/src/core/logging.ts +++ b/src/core/logging.ts @@ -15,11 +15,11 @@ * */ import * as winston from 'winston'; -import {constants} from './index.js'; import {v4 as uuidv4} from 'uuid'; import * as util from 'util'; import chalk from 'chalk'; import path from 'path'; +import * as constants from './constants.js'; const customFormat = winston.format.combine( winston.format.label({label: 'SOLO', message: false}), diff --git a/src/core/package_downloader.ts b/src/core/package_downloader.ts index 39efa2a2e..8904003f7 100644 --- a/src/core/package_downloader.ts +++ b/src/core/package_downloader.ts @@ -29,7 +29,7 @@ import { import * as https from 'https'; import * as http from 'http'; import {Templates} from './templates.js'; -import {constants} from './index.js'; +import * as constants from './constants.js'; import {type SoloLogger} from './logging.js'; export class PackageDownloader { diff --git a/src/core/platform_installer.ts b/src/core/platform_installer.ts index 310cdc90b..0fa3fed2a 100644 --- a/src/core/platform_installer.ts +++ b/src/core/platform_installer.ts @@ -18,9 +18,11 @@ import * as fs from 'fs'; import {Listr} from 'listr2'; import * as path from 'path'; import {SoloError, IllegalArgumentError, MissingArgumentError} from './errors.js'; -import {type ConfigManager, constants, type K8} from './index.js'; +import * as constants from './constants.js'; +import {type ConfigManager} from './config_manager.js'; +import {type K8} from './k8.js'; import {Templates} from './templates.js'; -import {flags} from '../commands/index.js'; +import {Flags as flags} from '../commands/flags.js'; import * as Base64 from 'js-base64'; import chalk from 'chalk'; diff --git a/src/core/profile_manager.ts b/src/core/profile_manager.ts index 14d14f497..a64618a36 100644 --- a/src/core/profile_manager.ts +++ b/src/core/profile_manager.ts @@ -18,15 +18,18 @@ import fs from 'fs'; import path from 'path'; import {SoloError, IllegalArgumentError, MissingArgumentError} from './errors.js'; import * as yaml from 'yaml'; -import {flags} from '../commands/index.js'; -import {type ConfigManager, constants, helpers, Templates} from './index.js'; import dot from 'dot-object'; -import {getNodeAccountMap} from './helpers.js'; import * as semver from 'semver'; +import type {SemVer} from 'semver'; import {readFile, writeFile} from 'fs/promises'; +import {Flags as flags} from '../commands/flags.js'; +import {Templates} from './templates.js'; +import * as constants from './constants.js'; +import {type ConfigManager} from './config_manager.js'; +import * as helpers from './helpers.js'; +import {getNodeAccountMap} from './helpers.js'; import type {SoloLogger} from './logging.js'; -import type {SemVer} from 'semver'; import type {NodeAlias, NodeAliases} from '../types/aliases.js'; const consensusSidecars = [ diff --git a/src/core/templates.ts b/src/core/templates.ts index 855c93d5a..c3356e83e 100644 --- a/src/core/templates.ts +++ b/src/core/templates.ts @@ -18,13 +18,13 @@ import * as x509 from '@peculiar/x509'; import os from 'os'; import path from 'path'; import {DataValidationError, SoloError, IllegalArgumentError, MissingArgumentError} from './errors.js'; -import {constants} from './index.js'; +import * as constants from './constants.js'; import {type AccountId} from '@hashgraph/sdk'; import type {NodeAlias, PodName} from '../types/aliases.js'; import {GrpcProxyTlsEnums} from './enumerations.js'; import type {ContextClusterStructure} from '../types/index.js'; import type {Cluster, Context} from './config/remote/types.js'; -import {flags} from '../commands/index.js'; +import {Flags as flags} from '../commands/flags.js'; export class Templates { public static renderNetworkPodName(nodeAlias: NodeAlias): PodName { diff --git a/src/index.ts b/src/index.ts index b1f7a833e..773d1a1ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,34 +17,33 @@ import chalk from 'chalk'; import yargs from 'yargs'; import {hideBin} from 'yargs/helpers'; -import {flags} from './commands/index.js'; +import 'dotenv/config'; +import path from 'path'; +import {ListrLogger} from 'listr2'; + +import {Flags as flags} from './commands/flags.js'; import * as commands from './commands/index.js'; import {HelmDependencyManager, DependencyManager} from './core/dependency_managers/index.js'; -import { - ChartManager, - ConfigManager, - PackageDownloader, - PlatformInstaller, - Helm, - logging, - KeyManager, - Zippy, - constants, - ProfileManager, - AccountManager, - LeaseManager, - CertificateManager, - LocalConfig, - helpers, - RemoteConfigManager, -} from './core/index.js'; -import 'dotenv/config'; +import * as constants from './core/constants.js'; +import {PackageDownloader} from './core/package_downloader.js'; +import {Zippy} from './core/zippy.js'; +import {Helm} from './core/helm.js'; +import {ChartManager} from './core/chart_manager.js'; +import {ConfigManager} from './core/config_manager.js'; +import {AccountManager} from './core/account_manager.js'; +import {PlatformInstaller} from './core/platform_installer.js'; +import {KeyManager} from './core/key_manager.js'; +import {ProfileManager} from './core/profile_manager.js'; +import {LeaseManager} from './core/lease/lease_manager.js'; +import {CertificateManager} from './core/certificate_manager.js'; +import {LocalConfig} from './core/config/local_config.js'; +import {RemoteConfigManager} from './core/config/remote/remote_config_manager.js'; +import * as logging from './core/logging.js'; +import * as helpers from './core/helpers.js'; import {K8} from './core/k8.js'; -import {ListrLogger} from 'listr2'; import {CustomProcessOutput} from './core/process_output.js'; import {type Opts} from './types/index.js'; import {IntervalLeaseRenewalService, type LeaseRenewalService} from './core/lease/lease_renewal.js'; -import path from 'path'; export function main(argv: any) { const logger = logging.NewLogger('debug'); diff --git a/src/types/index.ts b/src/types/index.ts index 29d462e23..591341e3b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -19,22 +19,20 @@ import type net from 'net'; import type * as WebSocket from 'ws'; import type crypto from 'crypto'; import type {SoloLogger} from '../core/logging.js'; -import type { - ChartManager, - ConfigManager, - Helm, - K8, - KeyManager, - PackageDownloader, - PlatformInstaller, - ProfileManager, - DependencyManager, - AccountManager, - LeaseManager, - CertificateManager, - RemoteConfigManager, - LocalConfig, -} from '../core/index.js'; +import {type PlatformInstaller} from '../core/platform_installer.js'; +import {type ChartManager} from '../core/chart_manager.js'; +import {type ConfigManager} from '../core/config_manager.js'; +import {type DependencyManager} from '../core/dependency_managers/index.js'; +import {type KeyManager} from '../core/key_manager.js'; +import {type AccountManager} from '../core/account_manager.js'; +import {type ProfileManager} from '../core/profile_manager.js'; +import {type LeaseManager} from '../core/lease/lease_manager.js'; +import {type CertificateManager} from '../core/certificate_manager.js'; +import {type LocalConfig} from '../core/config/local_config.js'; +import {type RemoteConfigManager} from '../core/config/remote/remote_config_manager.js'; +import {type Helm} from '../core/helm.js'; +import {type K8} from '../core/k8.js'; +import {type PackageDownloader} from '../core/package_downloader.js'; import type {Cluster, Context} from '../core/config/remote/types.js'; import {type BaseCommand} from '../commands/base.js'; import {type PromptFunction} from './aliases.js'; diff --git a/test/e2e/commands/account.test.ts b/test/e2e/commands/account.test.ts index 0fd6086e5..c4fcdd914 100644 --- a/test/e2e/commands/account.test.ts +++ b/test/e2e/commands/account.test.ts @@ -30,7 +30,7 @@ import { TopicCreateTransaction, TopicMessageSubmitTransaction, } from '@hashgraph/sdk'; -import {constants} from '../../../src/core/index.js'; +import * as constants from '../../../src/core/constants.js'; import * as version from '../../../version.js'; import { bootstrapTestVariables, @@ -41,8 +41,7 @@ import { testLogger, } from '../../test_util.js'; import {AccountCommand} from '../../../src/commands/account.js'; -import {flags} from '../../../src/commands/index.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {MINUTES, SECONDS} from '../../../src/core/constants.js'; const defaultTimeout = 20 * SECONDS; @@ -73,7 +72,7 @@ e2eTestSuite(testName, argv, undefined, undefined, undefined, undefined, undefin after(async function () { this.timeout(3 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); await accountManager.close(); await nodeCmd.close(); diff --git a/test/e2e/commands/cluster.test.ts b/test/e2e/commands/cluster.test.ts index 1e3be72b1..c52c425e9 100644 --- a/test/e2e/commands/cluster.test.ts +++ b/test/e2e/commands/cluster.test.ts @@ -18,9 +18,10 @@ import sinon from 'sinon'; import {it, describe, after, before, afterEach, beforeEach} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {bootstrapTestVariables, getDefaultArgv, HEDERA_PLATFORM_VERSION_TAG, TEST_CLUSTER} from '../../test_util.js'; -import {constants, logging} from '../../../src/core/index.js'; +import * as constants from '../../../src/core/constants.js'; +import * as logging from '../../../src/core/logging.js'; import {sleep} from '../../../src/core/helpers.js'; import * as version from '../../../version.js'; import {MINUTES, SECONDS} from '../../../src/core/constants.js'; diff --git a/test/e2e/commands/mirror_node.test.ts b/test/e2e/commands/mirror_node.test.ts index 3fbbd5f26..bca802c5f 100644 --- a/test/e2e/commands/mirror_node.test.ts +++ b/test/e2e/commands/mirror_node.test.ts @@ -17,7 +17,7 @@ import {it, describe, after, before, afterEach} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -27,13 +27,13 @@ import { TEST_CLUSTER, } from '../../test_util.js'; import * as version from '../../../version.js'; -import {getNodeLogs, sleep} from '../../../src/core/helpers.js'; +import {sleep} from '../../../src/core/helpers.js'; import {MirrorNodeCommand} from '../../../src/commands/mirror_node.js'; -import * as core from '../../../src/core/index.js'; import {Status, TopicCreateTransaction, TopicMessageSubmitTransaction} from '@hashgraph/sdk'; import * as http from 'http'; import {MINUTES, SECONDS} from '../../../src/core/constants.js'; import type {PodName} from '../../../src/types/aliases.js'; +import {PackageDownloader} from '../../../src/core/package_downloader.js'; const testName = 'mirror-cmd-e2e'; const namespace = testName; @@ -57,7 +57,7 @@ e2eTestSuite(testName, argv, undefined, undefined, undefined, undefined, undefin describe('MirrorNodeCommand', async () => { const k8 = bootstrapResp.opts.k8; const mirrorNodeCmd = new MirrorNodeCommand(bootstrapResp.opts); - const downloader = new core.PackageDownloader(mirrorNodeCmd.logger); + const downloader = new PackageDownloader(mirrorNodeCmd.logger); const accountManager = bootstrapResp.opts.accountManager; const testMessage = 'Mirror node test message'; @@ -71,7 +71,7 @@ e2eTestSuite(testName, argv, undefined, undefined, undefined, undefined, undefin after(async function () { this.timeout(3 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); await accountManager.close(); diff --git a/test/e2e/commands/network.test.ts b/test/e2e/commands/network.test.ts index 77edd94c0..369392ae8 100644 --- a/test/e2e/commands/network.test.ts +++ b/test/e2e/commands/network.test.ts @@ -18,14 +18,14 @@ import {it, describe, after, before} from 'mocha'; import {expect} from 'chai'; import {bootstrapTestVariables, getDefaultArgv, getTmpDir, HEDERA_PLATFORM_VERSION_TAG} from '../../test_util.js'; -import {constants} from '../../../src/core/index.js'; +import * as constants from '../../../src/core/constants.js'; import * as version from '../../../version.js'; -import {getNodeLogs, sleep} from '../../../src/core/helpers.js'; +import {sleep} from '../../../src/core/helpers.js'; import path from 'path'; import fs from 'fs'; import {NetworkCommand} from '../../../src/commands/network.js'; import {MINUTES, SECONDS} from '../../../src/core/constants.js'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; describe('NetworkCommand', () => { const testName = 'network-cmd-e2e'; @@ -60,7 +60,7 @@ describe('NetworkCommand', () => { after(async function () { this.timeout(3 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); await accountManager.close(); }); diff --git a/test/e2e/commands/node_delete.test.ts b/test/e2e/commands/node_delete.test.ts index 94b013b8b..01c197420 100644 --- a/test/e2e/commands/node_delete.test.ts +++ b/test/e2e/commands/node_delete.test.ts @@ -17,7 +17,7 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -25,7 +25,7 @@ import { getDefaultArgv, HEDERA_PLATFORM_VERSION_TAG, } from '../../test_util.js'; -import {getNodeLogs, getTmpDir} from '../../../src/core/helpers.js'; +import {getTmpDir} from '../../../src/core/helpers.js'; import {HEDERA_HAPI_PATH, MINUTES, ROOT_CONTAINER} from '../../../src/core/constants.js'; import fs from 'fs'; import type {PodName} from '../../../src/types/aliases.js'; @@ -53,7 +53,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/commands/node_local_hedera.test.ts b/test/e2e/commands/node_local_hedera.test.ts index 43757e7a2..f918792c7 100644 --- a/test/e2e/commands/node_local_hedera.test.ts +++ b/test/e2e/commands/node_local_hedera.test.ts @@ -16,11 +16,11 @@ */ import {describe} from 'mocha'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, TEST_CLUSTER} from '../../test_util.js'; -import {getNodeLogs, sleep} from '../../../src/core/helpers.js'; +import {sleep} from '../../../src/core/helpers.js'; import {MINUTES, SOLO_LOGS_DIR} from '../../../src/core/constants.js'; -import type {K8} from '../../../src/core/index.js'; +import {type K8} from '../../../src/core/k8.js'; import path from 'path'; import {expect} from 'chai'; import {AccountBalanceQuery, AccountCreateTransaction, Hbar, HbarUnit, PrivateKey} from '@hashgraph/sdk'; @@ -100,7 +100,7 @@ e2eTestSuite( }).timeout(10 * MINUTES); it('get the logs and delete the namespace', async () => { - await getNodeLogs(hederaK8, LOCAL_HEDERA); + await hederaK8.getNodeLogs(LOCAL_HEDERA); await hederaK8.deleteNamespace(LOCAL_HEDERA); }).timeout(10 * MINUTES); }); diff --git a/test/e2e/commands/node_local_ptt.test.ts b/test/e2e/commands/node_local_ptt.test.ts index fee520a9c..c9ad17b5d 100644 --- a/test/e2e/commands/node_local_ptt.test.ts +++ b/test/e2e/commands/node_local_ptt.test.ts @@ -16,9 +16,8 @@ */ import {describe} from 'mocha'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, TEST_CLUSTER} from '../../test_util.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; import {MINUTES} from '../../../src/core/constants.js'; const LOCAL_PTT = 'local-ptt-app'; @@ -43,7 +42,7 @@ e2eTestSuite(LOCAL_PTT, argv, undefined, undefined, undefined, undefined, undefi const pttK8 = bootstrapResp.opts.k8; it('get the logs and delete the namespace', async () => { - await getNodeLogs(pttK8, LOCAL_PTT); + await pttK8.getNodeLogs(LOCAL_PTT); await pttK8.deleteNamespace(LOCAL_PTT); }).timeout(2 * MINUTES); }); diff --git a/test/e2e/commands/node_update.test.ts b/test/e2e/commands/node_update.test.ts index e410b60fa..a55ba91a3 100644 --- a/test/e2e/commands/node_update.test.ts +++ b/test/e2e/commands/node_update.test.ts @@ -17,8 +17,8 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; -import {constants} from '../../../src/core/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; +import * as constants from '../../../src/core/constants.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -28,7 +28,6 @@ import { getTmpDir, HEDERA_PLATFORM_VERSION_TAG, } from '../../test_util.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; import {HEDERA_HAPI_PATH, MINUTES, ROOT_CONTAINER} from '../../../src/core/constants.js'; import fs from 'fs'; import type {PodName} from '../../../src/types/aliases.js'; @@ -66,7 +65,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await nodeCmd.handlers.stop(argv); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/commands/node_upgrade.test.ts b/test/e2e/commands/node_upgrade.test.ts index 7c81e86dc..ed9fd318b 100644 --- a/test/e2e/commands/node_upgrade.test.ts +++ b/test/e2e/commands/node_upgrade.test.ts @@ -17,9 +17,8 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, HEDERA_PLATFORM_VERSION_TAG} from '../../test_util.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; import { PREPARE_UPGRADE_CONFIGS_NAME, DOWNLOAD_GENERATED_FILES_CONFIGS_NAME, @@ -48,7 +47,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/commands/relay.test.ts b/test/e2e/commands/relay.test.ts index 92c6a7db2..6345f88ae 100644 --- a/test/e2e/commands/relay.test.ts +++ b/test/e2e/commands/relay.test.ts @@ -18,10 +18,10 @@ import {after, afterEach, describe} from 'mocha'; import {expect} from 'chai'; import each from 'mocha-each'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, HEDERA_PLATFORM_VERSION_TAG, TEST_CLUSTER} from '../../test_util.js'; import * as version from '../../../version.js'; -import {getNodeLogs, sleep} from '../../../src/core/helpers.js'; +import {sleep} from '../../../src/core/helpers.js'; import {RelayCommand} from '../../../src/commands/relay.js'; import {MINUTES} from '../../../src/core/constants.js'; @@ -46,7 +46,7 @@ e2eTestSuite(testName, argv, undefined, undefined, undefined, undefined, undefin const relayCmd = new RelayCommand(bootstrapResp.opts); after(async () => { - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/commands/separate_node_add.test.ts b/test/e2e/commands/separate_node_add.test.ts index 28a7a68b4..54b1da599 100644 --- a/test/e2e/commands/separate_node_add.test.ts +++ b/test/e2e/commands/separate_node_add.test.ts @@ -17,7 +17,7 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -27,7 +27,6 @@ import { getTmpDir, HEDERA_PLATFORM_VERSION_TAG, } from '../../test_util.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; import * as NodeCommandConfigs from '../../../src/commands/node/configs.js'; import {MINUTES} from '../../../src/core/constants.js'; @@ -68,7 +67,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); // @ts-ignore await nodeCmd.accountManager.close(); await nodeCmd.handlers.stop(argv); diff --git a/test/e2e/commands/separate_node_delete.test.ts b/test/e2e/commands/separate_node_delete.test.ts index defd687e0..1c84cfd45 100644 --- a/test/e2e/commands/separate_node_delete.test.ts +++ b/test/e2e/commands/separate_node_delete.test.ts @@ -17,7 +17,7 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -25,7 +25,7 @@ import { getDefaultArgv, HEDERA_PLATFORM_VERSION_TAG, } from '../../test_util.js'; -import {getNodeLogs, getTmpDir} from '../../../src/core/helpers.js'; +import {getTmpDir} from '../../../src/core/helpers.js'; import {HEDERA_HAPI_PATH, MINUTES, ROOT_CONTAINER} from '../../../src/core/constants.js'; import fs from 'fs'; import type {NodeAlias, PodName} from '../../../src/types/aliases.js'; @@ -61,7 +61,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/commands/separate_node_update.test.ts b/test/e2e/commands/separate_node_update.test.ts index 88daa28e3..237f4fe82 100644 --- a/test/e2e/commands/separate_node_update.test.ts +++ b/test/e2e/commands/separate_node_update.test.ts @@ -17,8 +17,8 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../src/commands/index.js'; -import {constants} from '../../../src/core/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; +import * as constants from '../../../src/core/constants.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -28,7 +28,6 @@ import { getTmpDir, HEDERA_PLATFORM_VERSION_TAG, } from '../../test_util.js'; -import {getNodeLogs} from '../../../src/core/helpers.js'; import {HEDERA_HAPI_PATH, MINUTES, ROOT_CONTAINER} from '../../../src/core/constants.js'; import fs from 'fs'; import type {PodName} from '../../../src/types/aliases.js'; @@ -66,7 +65,7 @@ e2eTestSuite(namespace, argv, undefined, undefined, undefined, undefined, undefi after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await nodeCmd.handlers.stop(argv); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/e2e_node_util.ts b/test/e2e/e2e_node_util.ts index ebc335ab5..c64a73fef 100644 --- a/test/e2e/e2e_node_util.ts +++ b/test/e2e/e2e_node_util.ts @@ -17,7 +17,7 @@ import {it, describe, after, before, afterEach} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../src/commands/index.js'; +import {Flags as flags} from '../../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -27,12 +27,13 @@ import { TEST_CLUSTER, testLogger, } from '../test_util.js'; -import {getNodeLogs, sleep} from '../../src/core/helpers.js'; +import {sleep} from '../../src/core/helpers.js'; import * as NodeCommandConfigs from '../../src/commands/node/configs.js'; import {MINUTES, SECONDS} from '../../src/core/constants.js'; import type {NodeAlias} from '../../src/types/aliases.js'; import type {ListrTaskWrapper} from 'listr2'; -import {ConfigManager, type K8} from '../../src/core/index.js'; +import {ConfigManager} from '../../src/core/config_manager.js'; +import {type K8} from '../../src/core/k8.js'; import {type NodeCommand} from '../../src/commands/node/index.js'; export function e2eNodeKeyRefreshTest(testName: string, mode: string, releaseTag = HEDERA_PLATFORM_VERSION_TAG) { @@ -77,7 +78,7 @@ export function e2eNodeKeyRefreshTest(testName: string, mode: string, releaseTag after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await k8.deleteNamespace(namespace); }); diff --git a/test/e2e/integration/commands/init.test.ts b/test/e2e/integration/commands/init.test.ts index 7bec5ca62..856543f46 100644 --- a/test/e2e/integration/commands/init.test.ts +++ b/test/e2e/integration/commands/init.test.ts @@ -19,20 +19,18 @@ import {expect} from 'chai'; import {InitCommand} from '../../../../src/commands/init.js'; import {HelmDependencyManager, DependencyManager} from '../../../../src/core/dependency_managers/index.js'; -import { - ChartManager, - ConfigManager, - constants, - Helm, - K8, - KeyManager, - LeaseManager, - LocalConfig, - logging, - PackageDownloader, - RemoteConfigManager, - Zippy, -} from '../../../../src/core/index.js'; +import {Zippy} from '../../../../src/core/zippy.js'; +import * as constants from '../../../../src/core/constants.js'; +import {Helm} from '../../../../src/core/helm.js'; +import {ChartManager} from '../../../../src/core/chart_manager.js'; +import {ConfigManager} from '../../../../src/core/config_manager.js'; +import {K8} from '../../../../src/core/k8.js'; +import {LocalConfig} from '../../../../src/core/config/local_config.js'; +import {KeyManager} from '../../../../src/core/key_manager.js'; +import {LeaseManager} from '../../../../src/core/lease/lease_manager.js'; +import {RemoteConfigManager} from '../../../../src/core/config/remote/remote_config_manager.js'; +import * as logging from '../../../../src/core/logging.js'; +import {PackageDownloader} from '../../../../src/core/package_downloader.js'; import {SECONDS} from '../../../../src/core/constants.js'; import sinon from 'sinon'; import {IntervalLeaseRenewalService} from '../../../../src/core/lease/lease_renewal.js'; diff --git a/test/e2e/integration/core/account_manager.test.ts b/test/e2e/integration/core/account_manager.test.ts index ac9260723..7f85458a5 100644 --- a/test/e2e/integration/core/account_manager.test.ts +++ b/test/e2e/integration/core/account_manager.test.ts @@ -17,7 +17,7 @@ import {it, describe, after} from 'mocha'; import {expect} from 'chai'; -import {flags} from '../../../../src/commands/index.js'; +import {Flags as flags} from '../../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, TEST_CLUSTER} from '../../../test_util.js'; import * as version from '../../../../version.js'; import {MINUTES} from '../../../../src/core/constants.js'; diff --git a/test/e2e/integration/core/chart_manager.test.ts b/test/e2e/integration/core/chart_manager.test.ts index 7dca2106f..79d9d5e83 100644 --- a/test/e2e/integration/core/chart_manager.test.ts +++ b/test/e2e/integration/core/chart_manager.test.ts @@ -17,7 +17,9 @@ import {it, describe} from 'mocha'; import {expect} from 'chai'; -import {ChartManager, Helm, constants} from '../../../../src/core/index.js'; +import * as constants from '../../../../src/core/constants.js'; +import {Helm} from '../../../../src/core/helm.js'; +import {ChartManager} from '../../../../src/core/chart_manager.js'; import {testLogger} from '../../../test_util.js'; describe('ChartManager', () => { diff --git a/test/e2e/integration/core/dependency_managers/helm_dependency_manager.test.ts b/test/e2e/integration/core/dependency_managers/helm_dependency_manager.test.ts index aaed77ce8..0a360e275 100644 --- a/test/e2e/integration/core/dependency_managers/helm_dependency_manager.test.ts +++ b/test/e2e/integration/core/dependency_managers/helm_dependency_manager.test.ts @@ -21,7 +21,8 @@ import each from 'mocha-each'; import fs from 'fs'; import path from 'path'; import {HelmDependencyManager} from '../../../../../src/core/dependency_managers/index.js'; -import {PackageDownloader, Zippy} from '../../../../../src/core/index.js'; +import {PackageDownloader} from '../../../../../src/core/package_downloader.js'; +import {Zippy} from '../../../../../src/core/zippy.js'; import {getTestCacheDir, getTmpDir, testLogger} from '../../../../test_util.js'; import * as version from '../../../../../version.js'; diff --git a/test/e2e/integration/core/k8_e2e.test.ts b/test/e2e/integration/core/k8_e2e.test.ts index d71de60fc..075f5c758 100644 --- a/test/e2e/integration/core/k8_e2e.test.ts +++ b/test/e2e/integration/core/k8_e2e.test.ts @@ -24,9 +24,12 @@ import os from 'os'; import path from 'path'; import {v4 as uuid4} from 'uuid'; import {SoloError} from '../../../../src/core/errors.js'; -import {ConfigManager, constants, logging, Templates} from '../../../../src/core/index.js'; +import * as constants from '../../../../src/core/constants.js'; +import {Templates} from '../../../../src/core/templates.js'; +import {ConfigManager} from '../../../../src/core/config_manager.js'; +import * as logging from '../../../../src/core/logging.js'; import {K8} from '../../../../src/core/k8.js'; -import {flags} from '../../../../src/commands/index.js'; +import {Flags as flags} from '../../../../src/commands/flags.js'; import { V1Container, V1ExecAction, diff --git a/test/e2e/integration/core/lease.test.ts b/test/e2e/integration/core/lease.test.ts index 0595998c9..184940586 100644 --- a/test/e2e/integration/core/lease.test.ts +++ b/test/e2e/integration/core/lease.test.ts @@ -15,7 +15,8 @@ * */ import {it, describe, before, after} from 'mocha'; -import {ConfigManager, logging} from '../../../../src/core/index.js'; +import {ConfigManager} from '../../../../src/core/config_manager.js'; +import * as logging from '../../../../src/core/logging.js'; import {K8} from '../../../../src/core/k8.js'; import {MINUTES, SECONDS} from '../../../../src/core/constants.js'; import {expect} from 'chai'; diff --git a/test/e2e/integration/core/lease_renewal.test.ts b/test/e2e/integration/core/lease_renewal.test.ts index 541289e1e..9b043430d 100644 --- a/test/e2e/integration/core/lease_renewal.test.ts +++ b/test/e2e/integration/core/lease_renewal.test.ts @@ -15,7 +15,8 @@ * */ import {it, describe, before, after} from 'mocha'; -import {ConfigManager, logging} from '../../../../src/core/index.js'; +import {ConfigManager} from '../../../../src/core/config_manager.js'; +import * as logging from '../../../../src/core/logging.js'; import {K8} from '../../../../src/core/k8.js'; import {MINUTES, SECONDS} from '../../../../src/core/constants.js'; import {expect} from 'chai'; diff --git a/test/e2e/integration/core/package_downloader_e2e.test.ts b/test/e2e/integration/core/package_downloader_e2e.test.ts index 04a3e37ac..41f2ba8cf 100644 --- a/test/e2e/integration/core/package_downloader_e2e.test.ts +++ b/test/e2e/integration/core/package_downloader_e2e.test.ts @@ -20,7 +20,9 @@ import {it, describe} from 'mocha'; import {expect} from 'chai'; import * as fs from 'fs'; -import {logging, PackageDownloader, Templates} from '../../../../src/core/index.js'; +import {PackageDownloader} from '../../../../src/core/package_downloader.js'; +import {Templates} from '../../../../src/core/templates.js'; +import * as logging from '../../../../src/core/logging.js'; import {MINUTES} from '../../../../src/core/constants.js'; describe('PackageDownloaderE2E', () => { diff --git a/test/e2e/integration/core/platform_installer_e2e.test.ts b/test/e2e/integration/core/platform_installer_e2e.test.ts index e965961b8..788c1f1fa 100644 --- a/test/e2e/integration/core/platform_installer_e2e.test.ts +++ b/test/e2e/integration/core/platform_installer_e2e.test.ts @@ -17,11 +17,11 @@ import {it, describe, after, before} from 'mocha'; import {expect} from 'chai'; -import {constants} from '../../../../src/core/index.js'; +import * as constants from '../../../../src/core/constants.js'; import * as fs from 'fs'; import {e2eTestSuite, getDefaultArgv, getTestCacheDir, TEST_CLUSTER, testLogger} from '../../../test_util.js'; -import {flags} from '../../../../src/commands/index.js'; +import {Flags as flags} from '../../../../src/commands/flags.js'; import * as version from '../../../../version.js'; import {MINUTES, SECONDS} from '../../../../src/core/constants.js'; diff --git a/test/e2e/integration/core/remote_config_manager.test.ts b/test/e2e/integration/core/remote_config_manager.test.ts index fdf279b06..d6be5ba2b 100644 --- a/test/e2e/integration/core/remote_config_manager.test.ts +++ b/test/e2e/integration/core/remote_config_manager.test.ts @@ -17,12 +17,14 @@ import {it, describe, after, before} from 'mocha'; import {expect} from 'chai'; -import {constants, LocalConfig, RemoteConfigManager} from '../../../../src/core/index.js'; import * as fs from 'fs'; +import * as constants from '../../../../src/core/constants.js'; +import {LocalConfig} from '../../../../src/core/config/local_config.js'; +import {RemoteConfigManager} from '../../../../src/core/config/remote/remote_config_manager.js'; import {e2eTestSuite, getDefaultArgv, getTestCacheDir, TEST_CLUSTER} from '../../../test_util.js'; -import {flags} from '../../../../src/commands/index.js'; +import {Flags as flags} from '../../../../src/commands/flags.js'; import * as version from '../../../../version.js'; -import {MINUTES, SECONDS, SOLO_REMOTE_CONFIGMAP_NAME} from '../../../../src/core/constants.js'; +import {MINUTES, SECONDS} from '../../../../src/core/constants.js'; import path from 'path'; import {SoloError} from '../../../../src/core/errors.js'; import {RemoteConfigDataWrapper} from '../../../../src/core/config/remote/remote_config_data_wrapper.js'; diff --git a/test/test_add.ts b/test/test_add.ts index 06ea817f9..5dca1bc03 100644 --- a/test/test_add.ts +++ b/test/test_add.ts @@ -17,7 +17,7 @@ import {expect} from 'chai'; import {describe, it, after} from 'mocha'; -import {flags} from '../src/commands/index.js'; +import {Flags as flags} from '../src/commands/flags.js'; import { accountCreationShouldSucceed, balanceQueryShouldSucceed, @@ -27,7 +27,6 @@ import { getTmpDir, HEDERA_PLATFORM_VERSION_TAG, } from './test_util.js'; -import {getNodeLogs} from '../src/core/helpers.js'; import * as NodeCommandConfigs from '../src/commands/node/configs.js'; import {MINUTES} from '../src/core/constants.js'; import type {NodeAlias} from '../src/types/aliases.js'; @@ -78,7 +77,7 @@ export function testNodeAdd( after(async function () { this.timeout(10 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); await bootstrapResp.opts.accountManager.close(); await nodeCmd.handlers.stop(argv); await networkCmd.destroy(argv); diff --git a/test/test_util.ts b/test/test_util.ts index c6fc754ce..5a4d8c9e6 100644 --- a/test/test_util.ts +++ b/test/test_util.ts @@ -22,32 +22,13 @@ import {describe, it, after, before} from 'mocha'; import fs from 'fs'; import os from 'os'; import path from 'path'; -import {flags} from '../src/commands/index.js'; +import {Flags as flags} from '../src/commands/flags.js'; import {ClusterCommand} from '../src/commands/cluster.js'; import {InitCommand} from '../src/commands/init.js'; import {NetworkCommand} from '../src/commands/network.js'; import {NodeCommand} from '../src/commands/node/index.js'; import {DependencyManager, HelmDependencyManager} from '../src/core/dependency_managers/index.js'; -import {getNodeLogs, sleep} from '../src/core/helpers.js'; -import { - ChartManager, - ConfigManager, - constants, - Helm, - K8, - KeyManager, - LeaseManager, - logging, - PackageDownloader, - PlatformInstaller, - ProfileManager, - Templates, - Zippy, - AccountManager, - CertificateManager, - RemoteConfigManager, - LocalConfig, -} from '../src/core/index.js'; +import {sleep} from '../src/core/helpers.js'; import {AccountBalanceQuery, AccountCreateTransaction, Hbar, HbarUnit, PrivateKey} from '@hashgraph/sdk'; import {MINUTES, NODE_LOG_FAILURE_MSG, ROOT_CONTAINER, SECONDS, SOLO_LOGS_DIR} from '../src/core/constants.js'; import crypto from 'crypto'; @@ -59,7 +40,23 @@ import type {SoloLogger} from '../src/core/logging.js'; import type {BaseCommand} from '../src/commands/base.js'; import type {NodeAlias} from '../src/types/aliases.js'; import type {NetworkNodeServices} from '../src/core/network_node_services.js'; -import sinon from 'sinon'; +import {K8} from '../src/core/k8.js'; +import {AccountManager} from '../src/core/account_manager.js'; +import {PlatformInstaller} from '../src/core/platform_installer.js'; +import {ProfileManager} from '../src/core/profile_manager.js'; +import {LeaseManager} from '../src/core/lease/lease_manager.js'; +import {CertificateManager} from '../src/core/certificate_manager.js'; +import {LocalConfig} from '../src/core/config/local_config.js'; +import {RemoteConfigManager} from '../src/core/config/remote/remote_config_manager.js'; +import * as constants from '../src/core/constants.js'; +import {Templates} from '../src/core/templates.js'; +import {ConfigManager} from '../src/core/config_manager.js'; +import * as logging from '../src/core/logging.js'; +import {Helm} from '../src/core/helm.js'; +import {ChartManager} from '../src/core/chart_manager.js'; +import {PackageDownloader} from '../src/core/package_downloader.js'; +import {KeyManager} from '../src/core/key_manager.js'; +import {Zippy} from '../src/core/zippy.js'; import {HEDERA_PLATFORM_VERSION} from '../version.js'; import {IntervalLeaseRenewalService} from '../src/core/lease/lease_renewal.js'; @@ -241,7 +238,7 @@ export function e2eTestSuite( after(async function () { this.timeout(5 * MINUTES); - await getNodeLogs(k8, namespace); + await k8.getNodeLogs(namespace); bootstrapResp.opts.logger.showUser( `------------------------- END: bootstrap (${testName}) ----------------------------`, ); diff --git a/test/unit/commands/base.test.ts b/test/unit/commands/base.test.ts index 432d582db..2df6be98e 100644 --- a/test/unit/commands/base.test.ts +++ b/test/unit/commands/base.test.ts @@ -17,20 +17,18 @@ import {expect} from 'chai'; import {HelmDependencyManager, DependencyManager} from '../../../src/core/dependency_managers/index.js'; -import { - ChartManager, - ConfigManager, - Helm, - logging, - PackageDownloader, - Zippy, - constants, - K8, - LocalConfig, - RemoteConfigManager, -} from '../../../src/core/index.js'; +import {Helm} from '../../../src/core/helm.js'; +import {ChartManager} from '../../../src/core/chart_manager.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {PackageDownloader} from '../../../src/core/package_downloader.js'; +import {Zippy} from '../../../src/core/zippy.js'; +import * as constants from '../../../src/core/constants.js'; +import {LocalConfig} from '../../../src/core/config/local_config.js'; +import {RemoteConfigManager} from '../../../src/core/config/remote/remote_config_manager.js'; +import {K8} from '../../../src/core/k8.js'; +import * as logging from '../../../src/core/logging.js'; import {BaseCommand} from '../../../src/commands/base.js'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import sinon from 'sinon'; import path from 'path'; import {BASE_TEST_DIR} from '../../test_util.js'; diff --git a/test/unit/commands/context.test.ts b/test/unit/commands/context.test.ts index 9bab15bc3..525ffe5a0 100644 --- a/test/unit/commands/context.test.ts +++ b/test/unit/commands/context.test.ts @@ -19,25 +19,23 @@ import {describe, it, beforeEach} from 'mocha'; import {expect} from 'chai'; import {ContextCommandTasks} from '../../../src/commands/context/tasks.js'; -import { - AccountManager, - CertificateManager, - ChartManager, - ConfigManager, - DependencyManager, - Helm, - K8, - KeyManager, - LeaseManager, - LocalConfig, - PackageDownloader, - PlatformInstaller, - ProfileManager, - RemoteConfigManager, -} from '../../../src/core/index.js'; +import {DependencyManager} from '../../../src/core/dependency_managers/index.js'; +import {LocalConfig} from '../../../src/core/config/local_config.js'; +import {PackageDownloader} from '../../../src/core/package_downloader.js'; +import {KeyManager} from '../../../src/core/key_manager.js'; +import {AccountManager} from '../../../src/core/account_manager.js'; +import {PlatformInstaller} from '../../../src/core/platform_installer.js'; +import {ProfileManager} from '../../../src/core/profile_manager.js'; +import {LeaseManager} from '../../../src/core/lease/lease_manager.js'; +import {CertificateManager} from '../../../src/core/certificate_manager.js'; +import {RemoteConfigManager} from '../../../src/core/config/remote/remote_config_manager.js'; +import {K8} from '../../../src/core/k8.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {Helm} from '../../../src/core/helm.js'; +import {ChartManager} from '../../../src/core/chart_manager.js'; import {getTestCacheDir, testLocalConfigData} from '../../test_util.js'; import {BaseCommand} from '../../../src/commands/base.js'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {SoloLogger} from '../../../src/core/logging.js'; import {type Opts} from '../../../src/types/index.js'; import fs from 'fs'; diff --git a/test/unit/core/certificate_manager.test.ts b/test/unit/core/certificate_manager.test.ts index c56666104..60814eed4 100644 --- a/test/unit/core/certificate_manager.test.ts +++ b/test/unit/core/certificate_manager.test.ts @@ -18,8 +18,10 @@ import {expect} from 'chai'; import {after, before, describe, it} from 'mocha'; import jest from 'jest-mock'; -import {CertificateManager, ConfigManager, K8} from '../../../src/core/index.js'; -import {flags} from '../../../src/commands/index.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {K8} from '../../../src/core/k8.js'; +import {CertificateManager} from '../../../src/core/certificate_manager.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {testLogger} from '../../test_util.js'; import {SoloError} from '../../../src/core/errors.js'; diff --git a/test/unit/core/config_manager.test.ts b/test/unit/core/config_manager.test.ts index 94c141693..96aa9512f 100644 --- a/test/unit/core/config_manager.test.ts +++ b/test/unit/core/config_manager.test.ts @@ -17,8 +17,8 @@ import {expect} from 'chai'; import {describe, it} from 'mocha'; -import {ConfigManager} from '../../../src/core/index.js'; -import {flags} from '../../../src/commands/index.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {testLogger} from '../../test_util.js'; describe('ConfigManager', () => { diff --git a/test/unit/core/dependency_managers/dependency_manager.test.ts b/test/unit/core/dependency_managers/dependency_manager.test.ts index fdc0e4636..5e4274f79 100644 --- a/test/unit/core/dependency_managers/dependency_manager.test.ts +++ b/test/unit/core/dependency_managers/dependency_manager.test.ts @@ -18,8 +18,10 @@ import {expect} from 'chai'; import {describe, it} from 'mocha'; import {DependencyManager, HelmDependencyManager} from '../../../../src/core/dependency_managers/index.js'; -import {logging, constants, PackageDownloader, Zippy} from '../../../../src/core/index.js'; -import {SECONDS} from '../../../../src/core/constants.js'; +import {PackageDownloader} from '../../../../src/core/package_downloader.js'; +import {Zippy} from '../../../../src/core/zippy.js'; +import * as constants from '../../../../src/core/constants.js'; +import * as logging from '../../../../src/core/logging.js'; const testLogger = logging.NewLogger('debug', true); describe('DependencyManager', () => { diff --git a/test/unit/core/helm.test.ts b/test/unit/core/helm.test.ts index 2a5841571..2abfb2db1 100644 --- a/test/unit/core/helm.test.ts +++ b/test/unit/core/helm.test.ts @@ -19,7 +19,10 @@ import {expect} from 'chai'; import {afterEach, beforeEach, describe, it} from 'mocha'; import each from 'mocha-each'; -import {constants, Helm, logging, Templates} from '../../../src/core/index.js'; +import * as constants from '../../../src/core/constants.js'; +import * as logging from '../../../src/core/logging.js'; +import {Helm} from '../../../src/core/helm.js'; +import {Templates} from '../../../src/core/templates.js'; import {ShellRunner} from '../../../src/core/shell_runner.js'; describe('Helm platform specific tests', () => { diff --git a/test/unit/core/k8.test.ts b/test/unit/core/k8.test.ts index 66dd982e1..ed349aa9d 100644 --- a/test/unit/core/k8.test.ts +++ b/test/unit/core/k8.test.ts @@ -18,9 +18,11 @@ import {expect} from 'chai'; import {describe, it, after, before} from 'mocha'; import jest from 'jest-mock'; -import {ConfigManager, constants, K8} from '../../../src/core/index.js'; +import * as constants from '../../../src/core/constants.js'; +import {K8} from '../../../src/core/k8.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; import {testLogger} from '../../test_util.js'; -import {flags} from '../../../src/commands/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; import {SECONDS} from '../../../src/core/constants.js'; function listNamespacedPodMockSetup(k8: K8, numOfFailures: number, result: any) { diff --git a/test/unit/core/key_manager.test.ts b/test/unit/core/key_manager.test.ts index 6ad2408dd..3f3798152 100644 --- a/test/unit/core/key_manager.test.ts +++ b/test/unit/core/key_manager.test.ts @@ -20,7 +20,9 @@ import {describe, it} from 'mocha'; import fs from 'fs'; import os from 'os'; import path from 'path'; -import {constants, logging, KeyManager} from '../../../src/core/index.js'; +import {KeyManager} from '../../../src/core/key_manager.js'; +import * as constants from '../../../src/core/constants.js'; +import * as logging from '../../../src/core/logging.js'; import {SECONDS} from '../../../src/core/constants.js'; import type {NodeAlias} from '../../../src/types/aliases.js'; diff --git a/test/unit/core/local_config.test.ts b/test/unit/core/local_config.test.ts index 520d07a2d..141748dbc 100644 --- a/test/unit/core/local_config.test.ts +++ b/test/unit/core/local_config.test.ts @@ -14,10 +14,11 @@ * limitations under the License. * */ -import {type ConfigManager, LocalConfig} from '../../../src/core/index.js'; import fs from 'fs'; import {stringify} from 'yaml'; import {expect} from 'chai'; +import {LocalConfig} from '../../../src/core/config/local_config.js'; +import {type ConfigManager} from '../../../src/core/config_manager.js'; import {MissingArgumentError, SoloError} from '../../../src/core/errors.js'; import {getTestCacheDir, testLogger, testLocalConfigData} from '../../test_util.js'; import type {EmailAddress} from '../../../src/core/config/remote/types.js'; diff --git a/test/unit/core/package_downloader.test.ts b/test/unit/core/package_downloader.test.ts index 1047a933a..f3c060d8c 100644 --- a/test/unit/core/package_downloader.test.ts +++ b/test/unit/core/package_downloader.test.ts @@ -17,15 +17,16 @@ import {expect} from 'chai'; import {describe, it} from 'mocha'; -import * as core from '../../../src/core/index.js'; +import {PackageDownloader} from '../../../src/core/package_downloader.js'; +import * as logging from '../../../src/core/logging.js'; import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os'; import {IllegalArgumentError, MissingArgumentError, ResourceNotFoundError} from '../../../src/core/errors.js'; describe('PackageDownloader', () => { - const testLogger = core.logging.NewLogger('debug', true); - const downloader = new core.PackageDownloader(testLogger); + const testLogger = logging.NewLogger('debug', true); + const downloader = new PackageDownloader(testLogger); describe('urlExists', () => { it('should return true if source URL is valid', async () => { diff --git a/test/unit/core/platform_installer.test.ts b/test/unit/core/platform_installer.test.ts index 077ee7f4d..0506ea20b 100644 --- a/test/unit/core/platform_installer.test.ts +++ b/test/unit/core/platform_installer.test.ts @@ -17,17 +17,19 @@ import {expect} from 'chai'; import {describe, it} from 'mocha'; -import * as core from '../../../src/core/index.js'; -import {ConfigManager, PlatformInstaller} from '../../../src/core/index.js'; import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os'; +import * as constants from '../../../src/core/constants.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {PlatformInstaller} from '../../../src/core/platform_installer.js'; +import * as logging from '../../../src/core/logging.js'; import {IllegalArgumentError, MissingArgumentError} from '../../../src/core/errors.js'; import {getK8Instance} from '../../test_util.js'; import type {PodName} from '../../../src/types/aliases.js'; describe('PackageInstaller', () => { - const testLogger = core.logging.NewLogger('debug', true); + const testLogger = logging.NewLogger('debug', true); const configManager = new ConfigManager(testLogger); const k8 = getK8Instance(configManager); @@ -45,23 +47,23 @@ describe('PackageInstaller', () => { it('should fail if directory does not have data/apps directory', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'installer-')); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); expect(() => installer.validatePlatformReleaseDir(tmpDir)).to.throw(IllegalArgumentError); fs.rmSync(tmpDir, {recursive: true}); }); it('should fail if directory does not have data/libs directory', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'installer-')); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); expect(() => installer.validatePlatformReleaseDir(tmpDir)).to.throw(IllegalArgumentError); fs.rmSync(tmpDir, {recursive: true}); }); it('should fail if directory does not have data/app directory is empty', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'installer-')); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); - fs.writeFileSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}/test.jar`, ''); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); + fs.writeFileSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}/test.jar`, ''); // @ts-ignore expect(() => installer.validatePlatformReleaseDir()).to.throw(MissingArgumentError); fs.rmSync(tmpDir, {recursive: true}); @@ -69,9 +71,9 @@ describe('PackageInstaller', () => { it('should fail if directory does not have data/apps directory is empty', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'installer-app-')); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); - fs.writeFileSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}/app.jar`, ''); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); + fs.writeFileSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}/app.jar`, ''); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); // @ts-ignore expect(() => installer.validatePlatformReleaseDir()).to.throw(MissingArgumentError); fs.rmSync(tmpDir, {recursive: true}); @@ -79,10 +81,10 @@ describe('PackageInstaller', () => { it('should succeed with non-empty data/apps and data/libs directory', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'installer-lib-')); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); - fs.writeFileSync(`${tmpDir}/${core.constants.HEDERA_DATA_APPS_DIR}/app.jar`, ''); - fs.mkdirSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); - fs.writeFileSync(`${tmpDir}/${core.constants.HEDERA_DATA_LIB_DIR}/lib-1.jar`, ''); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}`, {recursive: true}); + fs.writeFileSync(`${tmpDir}/${constants.HEDERA_DATA_APPS_DIR}/app.jar`, ''); + fs.mkdirSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}`, {recursive: true}); + fs.writeFileSync(`${tmpDir}/${constants.HEDERA_DATA_LIB_DIR}/lib-1.jar`, ''); // @ts-ignore expect(() => installer.validatePlatformReleaseDir()).to.throw(MissingArgumentError); fs.rmSync(tmpDir, {recursive: true}); diff --git a/test/unit/core/profile_manager.test.ts b/test/unit/core/profile_manager.test.ts index d3dd5b3e8..a4b01a417 100644 --- a/test/unit/core/profile_manager.test.ts +++ b/test/unit/core/profile_manager.test.ts @@ -20,8 +20,10 @@ import {describe, it, after} from 'mocha'; import fs from 'fs'; import * as yaml from 'yaml'; import path from 'path'; -import {flags} from '../../../src/commands/index.js'; -import {ConfigManager, constants, ProfileManager} from '../../../src/core/index.js'; +import {Flags as flags} from '../../../src/commands/flags.js'; +import * as constants from '../../../src/core/constants.js'; +import {ConfigManager} from '../../../src/core/config_manager.js'; +import {ProfileManager} from '../../../src/core/profile_manager.js'; import {getTestCacheDir, getTmpDir, testLogger} from '../../test_util.js'; import * as version from '../../../version.js'; import type {NodeAlias} from '../../../src/types/aliases.js'; diff --git a/test/unit/core/zippy.test.ts b/test/unit/core/zippy.test.ts index 8743dc618..0466b1a46 100644 --- a/test/unit/core/zippy.test.ts +++ b/test/unit/core/zippy.test.ts @@ -19,15 +19,15 @@ import 'chai-as-promised'; import {expect} from 'chai'; import {describe, it} from 'mocha'; -import * as core from '../../../src/core/index.js'; import {IllegalArgumentError, MissingArgumentError, SoloError} from '../../../src/core/errors.js'; import os from 'os'; import fs from 'fs'; import path from 'path'; import {Zippy} from '../../../src/core/zippy.js'; +import * as logging from '../../../src/core/logging.js'; describe('Zippy', () => { - const testLogger = core.logging.NewLogger('debug', true); + const testLogger = logging.NewLogger('debug', true); const zippy = new Zippy(testLogger); describe('unzip', () => {