From 41e5de83a2073cc7b7fa65e5d155553b021772bc Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Thu, 24 Oct 2024 18:32:15 -0400 Subject: [PATCH] feat: remove many unneded simple libraries --- api/package-lock.json | 922 +++++++++------------ api/package.json | 16 +- api/src/core/utils/misc/parse-config.ts | 172 ++-- api/src/core/utils/vms/parse-domain.ts | 33 +- api/src/core/utils/write-to-boot.ts | 15 + api/src/graphql/resolvers/query/info.ts | 16 +- api/src/store/listeners/config-listener.ts | 10 - 7 files changed, 544 insertions(+), 640 deletions(-) create mode 100644 api/src/core/utils/write-to-boot.ts diff --git a/api/package-lock.json b/api/package-lock.json index 7d662bc78..5d48fab58 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -32,6 +32,7 @@ "bycontract": "^2.0.11", "bytes": "^3.1.2", "cacheable-lookup": "^6.1.0", + "camelcase-keys": "^9.1.3", "catch-exit": "^1.2.2", "chokidar": "^3.6.0", "cli-table": "^0.3.11", @@ -41,11 +42,13 @@ "docker-event-emitter": "^0.3.0", "dockerode": "^3.3.5", "dotenv": "^16.4.5", + "execa": "^9.4.1", "exit-hook": "^4.0.0", "express": "^4.19.2", "filenamify": "^6.0.0", "fs-extra": "^11.2.0", "global-agent": "^3.0.0", + "got": "^14.4.3", "graphql": "^16.8.1", "graphql-fields": "^2.0.3", "graphql-scalars": "^1.23.0", @@ -69,6 +72,7 @@ "p-retry": "^4.6.2", "passport-custom": "^1.1.1", "passport-http-header-strategy": "^1.1.0", + "path-type": "^6.0.0", "pidusage": "^3.0.2", "pino": "^9.1.0", "pino-http": "^9.0.0", @@ -125,22 +129,10 @@ "@types/wtfnode": "^0.7.3", "@vitest/coverage-v8": "^2.1.1", "@vitest/ui": "^2.1.1", - "camelcase-keys": "^8.0.2", "cz-conventional-changelog": "3.3.0", "eslint": "^9.12.0", - "execa": "^7.1.1", - "filter-obj": "^5.1.0", - "got": "^13", "graphql-codegen-typescript-validation-schema": "^0.14.1", - "ip-regex": "^5.0.0", "jiti": "^2.3.3", - "json-difference": "^1.16.1", - "map-obj": "^5.0.2", - "p-props": "^5.0.0", - "path-exists": "^5.0.0", - "path-type": "^5.0.0", - "pretty-bytes": "^6.1.1", - "pretty-ms": "^8.0.0", "standard-version": "^9.5.0", "typescript": "^5.4.5", "typescript-eslint": "^8.10.0", @@ -4305,17 +4297,33 @@ "fast-xml-parser": "^4.0.3" } }, + "node_modules/@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==" + }, "node_modules/@sindresorhus/is": { - "version": "5.3.0", - "dev": true, - "license": "MIT", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==", "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/sindresorhus/is?sponsor=1" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@swc/core": { "version": "1.7.36", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.36.tgz", @@ -4547,7 +4555,6 @@ }, "node_modules/@szmarczak/http-timer": { "version": "5.0.1", - "dev": true, "license": "MIT", "dependencies": { "defer-to-connect": "^2.0.1" @@ -4791,9 +4798,9 @@ } }, "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "dev": true, - "license": "MIT" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" }, "node_modules/@types/ini": { "version": "4.1.0", @@ -6127,20 +6134,20 @@ } }, "node_modules/cacheable-request": { - "version": "10.2.9", - "dev": true, - "license": "MIT", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", "dependencies": { - "@types/http-cache-semantics": "^4.0.1", - "get-stream": "^6.0.1", + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.2", + "keyv": "^4.5.4", "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", + "normalize-url": "^8.0.1", "responselike": "^3.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" } }, "node_modules/cachedir": { @@ -6181,39 +6188,28 @@ } }, "node_modules/camelcase": { - "version": "7.0.1", - "dev": true, - "license": "MIT", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", "engines": { - "node": ">=14.16" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/camelcase-keys": { - "version": "8.0.2", - "dev": true, - "license": "MIT", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-9.1.3.tgz", + "integrity": "sha512-Rircqi9ch8AnZscQcsA1C47NFdaO3wukpmIRzYcDOrmvgt78hM/sj5pZhZNec2NM12uk5vTwRHZ4anGcrC4ZTg==", "dependencies": { - "camelcase": "^7.0.0", - "map-obj": "^4.3.0", + "camelcase": "^8.0.0", + "map-obj": "5.0.0", "quick-lru": "^6.1.1", - "type-fest": "^2.13.0" + "type-fest": "^4.3.2" }, "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/camelcase-keys/node_modules/map-obj": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7361,7 +7357,6 @@ }, "node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -7568,7 +7563,6 @@ }, "node_modules/decompress-response": { "version": "6.0.0", - "dev": true, "license": "MIT", "dependencies": { "mimic-response": "^3.1.0" @@ -7582,7 +7576,6 @@ }, "node_modules/decompress-response/node_modules/mimic-response": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -7638,7 +7631,6 @@ }, "node_modules/defer-to-connect": { "version": "2.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -8327,33 +8319,108 @@ } }, "node_modules/execa": { - "version": "7.2.0", - "dev": true, - "license": "MIT", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.4.1.tgz", + "integrity": "sha512-5eo/BRqZm3GYce+1jqX/tJ7duA2AnE39i88fuedNFUV8XxGxUpF3aWkBRfbUcjV49gCkvS/pzc0YrCPhaIewdg==", "dependencies": { + "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.0", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.0.0" }, "engines": { - "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + "node": "^18.19.0 || >=20.5.0" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/execa/node_modules/human-signals": { - "version": "4.3.1", - "dev": true, - "license": "Apache-2.0", + "node_modules/execa/node_modules/figures": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", + "dependencies": { + "is-unicode-supported": "^2.0.0" + }, "engines": { - "node": ">=14.18.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/human-signals": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", + "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/execa/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/parse-ms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/pretty-ms": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", + "integrity": "sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==", + "dependencies": { + "parse-ms": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/exit-hook": { @@ -8817,17 +8884,6 @@ "node": ">=8" } }, - "node_modules/filter-obj": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/finalhandler": { "version": "1.2.0", "license": "MIT", @@ -9015,11 +9071,11 @@ } }, "node_modules/form-data-encoder": { - "version": "2.1.4", - "dev": true, - "license": "MIT", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==", "engines": { - "node": ">= 14.17" + "node": ">= 18" } }, "node_modules/formdata-polyfill": { @@ -9248,11 +9304,15 @@ } }, "node_modules/get-stream": { - "version": "6.0.1", - "dev": true, - "license": "MIT", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "dependencies": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -9538,25 +9598,24 @@ } }, "node_modules/got": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/got/-/got-13.0.0.tgz", - "integrity": "sha512-XfBk1CxOOScDcMr9O1yKkNaQyy865NbYs+F7dr4H0LZMVgCj2Le59k6PqbNHoL5ToeaEQUYh6c6yMfVcc6SJxA==", - "dev": true, + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.3.tgz", + "integrity": "sha512-iTC0Z87yxSijWTh/IpvGpwOhIQK7+GgWkYrMRoN/hB9qeRj9RPuLGODwevs0p5idUf7nrxCVa5IlOmK3b8z+KA==", "dependencies": { - "@sindresorhus/is": "^5.2.0", + "@sindresorhus/is": "^7.0.1", "@szmarczak/http-timer": "^5.0.1", "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", + "cacheable-request": "^12.0.1", "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" }, "engines": { - "node": ">=16" + "node": ">=20" }, "funding": { "url": "https://github.com/sindresorhus/got?sponsor=1" @@ -9566,7 +9625,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true, "engines": { "node": ">=14.16" } @@ -9909,8 +9967,8 @@ }, "node_modules/http-cache-semantics": { "version": "4.1.1", - "dev": true, - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "node_modules/http-errors": { "version": "2.0.0", @@ -9952,9 +10010,9 @@ } }, "node_modules/http2-wrapper": { - "version": "2.2.0", - "dev": true, - "license": "MIT", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -9965,8 +10023,8 @@ }, "node_modules/http2-wrapper/node_modules/quick-lru": { "version": "5.1.1", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", "engines": { "node": ">=10" }, @@ -10175,17 +10233,6 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" }, - "node_modules/ip-regex": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "license": "MIT", @@ -10303,11 +10350,11 @@ } }, "node_modules/is-stream": { - "version": "3.0.0", - "dev": true, - "license": "MIT", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10375,7 +10422,6 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, "license": "ISC" }, "node_modules/isomorphic-ws": { @@ -10525,18 +10571,8 @@ }, "node_modules/json-buffer": { "version": "3.0.1", - "dev": true, "license": "MIT" }, - "node_modules/json-difference": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/json-difference/-/json-difference-1.16.1.tgz", - "integrity": "sha512-tNVUzBKn2I4BB4Cjn+j+Kq/BfLNwqtEvxhnlyuX5XJmKn9VlfV5MvaTbB/ure/toFgLaD6XglOUt+dd4iMQ3dA==", - "dev": true, - "engines": { - "node": ">=18.17.x" - } - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "dev": true, @@ -10664,7 +10700,6 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, "dependencies": { "json-buffer": "3.0.1" } @@ -10975,8 +11010,8 @@ }, "node_modules/lowercase-keys": { "version": "3.0.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -11048,9 +11083,9 @@ } }, "node_modules/map-obj": { - "version": "5.0.2", - "dev": true, - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz", + "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -11209,11 +11244,6 @@ "version": "1.0.1", "license": "MIT" }, - "node_modules/merge-stream": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/merge2": { "version": "1.4.1", "license": "MIT", @@ -11283,21 +11313,10 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mimic-response": { "version": "4.0.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -11698,9 +11717,9 @@ } }, "node_modules/normalize-url": { - "version": "8.0.0", - "dev": true, - "license": "MIT", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", "engines": { "node": ">=14.16" }, @@ -11713,14 +11732,15 @@ "license": "MIT" }, "node_modules/npm-run-path": { - "version": "5.1.0", - "dev": true, - "license": "MIT", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", "dependencies": { - "path-key": "^4.0.0" + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -11728,8 +11748,8 @@ }, "node_modules/npm-run-path/node_modules/path-key": { "version": "4.0.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "engines": { "node": ">=12" }, @@ -11833,20 +11853,6 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/openid-client": { "version": "5.6.5", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.5.tgz", @@ -11952,11 +11958,11 @@ } }, "node_modules/p-cancelable": { - "version": "3.0.0", - "dev": true, - "license": "MIT", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==", "engines": { - "node": ">=12.20" + "node": ">=14.16" } }, "node_modules/p-limit": { @@ -12001,85 +12007,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-props": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "p-map": "^5.0.0" - }, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-props/node_modules/aggregate-error": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-props/node_modules/clean-stack": { - "version": "4.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-props/node_modules/escape-string-regexp": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-props/node_modules/indent-string": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-props/node_modules/p-map": { - "version": "5.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-retry": { "version": "4.6.2", "license": "MIT", @@ -12187,17 +12114,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse-ms": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/parse-passwd": { "version": "1.0.0", "dev": true, @@ -12281,14 +12197,6 @@ "tslib": "^2.0.3" } }, - "node_modules/path-exists": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", "license": "MIT", @@ -12298,7 +12206,6 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -12352,11 +12259,11 @@ "license": "MIT" }, "node_modules/path-type": { - "version": "5.0.0", - "dev": true, - "license": "MIT", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", + "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12805,31 +12712,6 @@ "node": ">= 0.8.0" } }, - "node_modules/pretty-bytes": { - "version": "6.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pretty-ms": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "parse-ms": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -13001,9 +12883,9 @@ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" }, "node_modules/quick-lru": { - "version": "6.1.1", - "dev": true, - "license": "MIT", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==", "engines": { "node": ">=12" }, @@ -13373,8 +13255,8 @@ }, "node_modules/resolve-alpn": { "version": "1.2.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, "node_modules/resolve-dir": { "version": "1.0.1", @@ -13425,8 +13307,8 @@ }, "node_modules/responselike": { "version": "3.0.0", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dependencies": { "lowercase-keys": "^3.0.0" }, @@ -13803,7 +13685,6 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -13814,7 +13695,6 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -14311,11 +14191,11 @@ } }, "node_modules/strip-final-newline": { - "version": "3.0.0", - "dev": true, - "license": "MIT", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==", "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -15333,11 +15213,11 @@ } }, "node_modules/type-fest": { - "version": "2.19.0", - "dev": true, - "license": "(MIT OR CC0-1.0)", + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", "engines": { - "node": ">=12.20" + "node": ">=16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -15460,6 +15340,17 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, + "node_modules/unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universalify": { "version": "2.0.0", "license": "MIT", @@ -16282,7 +16173,6 @@ }, "node_modules/which": { "version": "2.0.2", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -16540,6 +16430,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yoctocolors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", + "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zen-observable": { "version": "0.8.15", "license": "MIT" @@ -19542,9 +19443,20 @@ "fast-xml-parser": "^4.0.3" } }, + "@sec-ant/readable-stream": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz", + "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==" + }, "@sindresorhus/is": { - "version": "5.3.0", - "dev": true + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.0.1.tgz", + "integrity": "sha512-QWLl2P+rsCJeofkDNIT3WFmb6NrRud1SUYW8dIhXK/46XFV8Q/g7Bsvib0Askb0reRLe+WYPeeE+l5cH7SlkuQ==" + }, + "@sindresorhus/merge-streams": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", + "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==" }, "@swc/core": { "version": "1.7.36", @@ -19669,7 +19581,6 @@ }, "@szmarczak/http-timer": { "version": "5.0.1", - "dev": true, "requires": { "defer-to-connect": "^2.0.1" } @@ -19884,8 +19795,9 @@ } }, "@types/http-cache-semantics": { - "version": "4.0.1", - "dev": true + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" }, "@types/ini": { "version": "4.1.0", @@ -20817,15 +20729,16 @@ "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==" }, "cacheable-request": { - "version": "10.2.9", - "dev": true, + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-12.0.1.tgz", + "integrity": "sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==", "requires": { - "@types/http-cache-semantics": "^4.0.1", - "get-stream": "^6.0.1", + "@types/http-cache-semantics": "^4.0.4", + "get-stream": "^9.0.1", "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.2", + "keyv": "^4.5.4", "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", + "normalize-url": "^8.0.1", "responselike": "^3.0.0" } }, @@ -20855,23 +20768,19 @@ } }, "camelcase": { - "version": "7.0.1", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==" }, "camelcase-keys": { - "version": "8.0.2", - "dev": true, + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-9.1.3.tgz", + "integrity": "sha512-Rircqi9ch8AnZscQcsA1C47NFdaO3wukpmIRzYcDOrmvgt78hM/sj5pZhZNec2NM12uk5vTwRHZ4anGcrC4ZTg==", "requires": { - "camelcase": "^7.0.0", - "map-obj": "^4.3.0", + "camelcase": "^8.0.0", + "map-obj": "5.0.0", "quick-lru": "^6.1.1", - "type-fest": "^2.13.0" - }, - "dependencies": { - "map-obj": { - "version": "4.3.0", - "dev": true - } + "type-fest": "^4.3.2" } }, "caniuse-lite": { @@ -21662,7 +21571,6 @@ }, "cross-spawn": { "version": "7.0.3", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -21801,14 +21709,12 @@ }, "decompress-response": { "version": "6.0.0", - "dev": true, "requires": { "mimic-response": "^3.1.0" }, "dependencies": { "mimic-response": { - "version": "3.1.0", - "dev": true + "version": "3.1.0" } } }, @@ -21843,8 +21749,7 @@ } }, "defer-to-connect": { - "version": "2.0.1", - "dev": true + "version": "2.0.1" }, "define-data-property": { "version": "1.1.1", @@ -22303,23 +22208,64 @@ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, "execa": { - "version": "7.2.0", - "dev": true, + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-9.4.1.tgz", + "integrity": "sha512-5eo/BRqZm3GYce+1jqX/tJ7duA2AnE39i88fuedNFUV8XxGxUpF3aWkBRfbUcjV49gCkvS/pzc0YrCPhaIewdg==", "requires": { + "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^4.3.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "figures": "^6.1.0", + "get-stream": "^9.0.0", + "human-signals": "^8.0.0", + "is-plain-obj": "^4.1.0", + "is-stream": "^4.0.1", + "npm-run-path": "^6.0.0", + "pretty-ms": "^9.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^4.0.0", + "yoctocolors": "^2.0.0" }, "dependencies": { + "figures": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", + "requires": { + "is-unicode-supported": "^2.0.0" + } + }, "human-signals": { - "version": "4.3.1", - "dev": true + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.0.tgz", + "integrity": "sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==" + }, + "is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==" + }, + "is-unicode-supported": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz", + "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==" + }, + "parse-ms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", + "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==" + }, + "pretty-ms": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", + "integrity": "sha512-o1piW0n3tgKIKCwk2vpM/vOV13zjJzvP37Ioze54YlTHE06m4tjEbzg9WsKkvTuyYln2DHjo5pY4qrZGI0otpw==", + "requires": { + "parse-ms": "^4.0.0" + } + }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" } } }, @@ -22680,10 +22626,6 @@ "to-regex-range": "^5.0.1" } }, - "filter-obj": { - "version": "5.1.0", - "dev": true - }, "finalhandler": { "version": "1.2.0", "requires": { @@ -22810,8 +22752,9 @@ } }, "form-data-encoder": { - "version": "2.1.4", - "dev": true + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", + "integrity": "sha512-KQVhvhK8ZkWzxKxOr56CPulAhH3dobtuQ4+hNQ+HekH/Wp5gSOafqRAeTphQUJAIk0GBvHZgJ2ZGRWd5kphMuw==" }, "formdata-polyfill": { "version": "4.0.10", @@ -22971,8 +22914,13 @@ } }, "get-stream": { - "version": "6.0.1", - "dev": true + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz", + "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==", + "requires": { + "@sec-ant/readable-stream": "^0.4.1", + "is-stream": "^4.0.1" + } }, "get-tsconfig": { "version": "4.8.1", @@ -23179,29 +23127,27 @@ } }, "got": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/got/-/got-13.0.0.tgz", - "integrity": "sha512-XfBk1CxOOScDcMr9O1yKkNaQyy865NbYs+F7dr4H0LZMVgCj2Le59k6PqbNHoL5ToeaEQUYh6c6yMfVcc6SJxA==", - "dev": true, + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/got/-/got-14.4.3.tgz", + "integrity": "sha512-iTC0Z87yxSijWTh/IpvGpwOhIQK7+GgWkYrMRoN/hB9qeRj9RPuLGODwevs0p5idUf7nrxCVa5IlOmK3b8z+KA==", "requires": { - "@sindresorhus/is": "^5.2.0", + "@sindresorhus/is": "^7.0.1", "@szmarczak/http-timer": "^5.0.1", "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", + "cacheable-request": "^12.0.1", "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", + "form-data-encoder": "^4.0.2", + "http2-wrapper": "^2.2.1", "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" + "p-cancelable": "^4.0.1", + "responselike": "^3.0.0", + "type-fest": "^4.26.1" }, "dependencies": { "cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==" } } }, @@ -23431,7 +23377,8 @@ }, "http-cache-semantics": { "version": "4.1.1", - "dev": true + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, "http-errors": { "version": "2.0.0", @@ -23461,8 +23408,9 @@ } }, "http2-wrapper": { - "version": "2.2.0", - "dev": true, + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", "requires": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.2.0" @@ -23470,7 +23418,8 @@ "dependencies": { "quick-lru": { "version": "5.1.1", - "dev": true + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" } } }, @@ -23605,10 +23554,6 @@ } } }, - "ip-regex": { - "version": "5.0.0", - "dev": true - }, "ipaddr.js": { "version": "1.9.1" }, @@ -23677,8 +23622,9 @@ } }, "is-stream": { - "version": "3.0.0", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==" }, "is-text-path": { "version": "1.0.1", @@ -23718,8 +23664,7 @@ "dev": true }, "isexe": { - "version": "2.0.0", - "dev": true + "version": "2.0.0" }, "isomorphic-ws": { "version": "5.0.0", @@ -23821,14 +23766,7 @@ "version": "2.5.2" }, "json-buffer": { - "version": "3.0.1", - "dev": true - }, - "json-difference": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/json-difference/-/json-difference-1.16.1.tgz", - "integrity": "sha512-tNVUzBKn2I4BB4Cjn+j+Kq/BfLNwqtEvxhnlyuX5XJmKn9VlfV5MvaTbB/ure/toFgLaD6XglOUt+dd4iMQ3dA==", - "dev": true + "version": "3.0.1" }, "json-parse-better-errors": { "version": "1.0.2", @@ -23915,7 +23853,6 @@ "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, "requires": { "json-buffer": "3.0.1" } @@ -24130,7 +24067,8 @@ }, "lowercase-keys": { "version": "3.0.0", - "dev": true + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==" }, "lru-cache": { "version": "7.18.3" @@ -24178,8 +24116,9 @@ "version": "0.2.2" }, "map-obj": { - "version": "5.0.2", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz", + "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==" }, "map-stream": { "version": "0.1.0", @@ -24277,10 +24216,6 @@ "merge-descriptors": { "version": "1.0.1" }, - "merge-stream": { - "version": "2.0.0", - "dev": true - }, "merge2": { "version": "1.4.1" }, @@ -24313,13 +24248,10 @@ "mime-db": "1.52.0" } }, - "mimic-fn": { - "version": "4.0.0", - "dev": true - }, "mimic-response": { "version": "4.0.0", - "dev": true + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==" }, "min-indent": { "version": "1.0.1", @@ -24558,22 +24490,26 @@ "version": "3.0.0" }, "normalize-url": { - "version": "8.0.0", - "dev": true + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", + "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==" }, "notation": { "version": "1.3.6" }, "npm-run-path": { - "version": "5.1.0", - "dev": true, + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz", + "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==", "requires": { - "path-key": "^4.0.0" + "path-key": "^4.0.0", + "unicorn-magic": "^0.3.0" }, "dependencies": { "path-key": { "version": "4.0.0", - "dev": true + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==" } } }, @@ -24642,13 +24578,6 @@ "wrappy": "1" } }, - "onetime": { - "version": "6.0.0", - "dev": true, - "requires": { - "mimic-fn": "^4.0.0" - } - }, "openid-client": { "version": "5.6.5", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.5.tgz", @@ -24729,8 +24658,9 @@ "dev": true }, "p-cancelable": { - "version": "3.0.0", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-4.0.1.tgz", + "integrity": "sha512-wBowNApzd45EIKdO1LaU+LrMBwAcjfPaYtVzV3lmfM3gf8Z4CHZsiIqlM8TZZ8okYvh5A1cP6gTfCRQtwUpaUg==" }, "p-limit": { "version": "3.1.0", @@ -24753,45 +24683,6 @@ "aggregate-error": "^3.0.0" } }, - "p-props": { - "version": "5.0.0", - "dev": true, - "requires": { - "p-map": "^5.0.0" - }, - "dependencies": { - "aggregate-error": { - "version": "4.0.1", - "dev": true, - "requires": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - } - }, - "clean-stack": { - "version": "4.2.0", - "dev": true, - "requires": { - "escape-string-regexp": "5.0.0" - } - }, - "escape-string-regexp": { - "version": "5.0.0", - "dev": true - }, - "indent-string": { - "version": "5.0.0", - "dev": true - }, - "p-map": { - "version": "5.5.0", - "dev": true, - "requires": { - "aggregate-error": "^4.0.0" - } - } - } - }, "p-retry": { "version": "4.6.2", "requires": { @@ -24869,10 +24760,6 @@ "lines-and-columns": "^1.1.6" } }, - "parse-ms": { - "version": "3.0.0", - "dev": true - }, "parse-passwd": { "version": "1.0.0", "dev": true @@ -24933,16 +24820,11 @@ "tslib": "^2.0.3" } }, - "path-exists": { - "version": "5.0.0", - "dev": true - }, "path-is-absolute": { "version": "1.0.1" }, "path-key": { - "version": "3.1.1", - "dev": true + "version": "3.1.1" }, "path-parse": { "version": "1.0.7" @@ -24978,8 +24860,9 @@ "version": "0.1.7" }, "path-type": { - "version": "5.0.0", - "dev": true + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", + "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==" }, "pathe": { "version": "1.1.2", @@ -25316,17 +25199,6 @@ "version": "1.2.1", "dev": true }, - "pretty-bytes": { - "version": "6.1.1", - "dev": true - }, - "pretty-ms": { - "version": "8.0.0", - "dev": true, - "requires": { - "parse-ms": "^3.0.0" - } - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -25445,8 +25317,9 @@ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" }, "quick-lru": { - "version": "6.1.1", - "dev": true + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz", + "integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==" }, "range-parser": { "version": "1.2.1" @@ -25690,7 +25563,8 @@ }, "resolve-alpn": { "version": "1.2.1", - "dev": true + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, "resolve-dir": { "version": "1.0.1", @@ -25722,7 +25596,8 @@ }, "responselike": { "version": "3.0.0", - "dev": true, + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "requires": { "lowercase-keys": "^3.0.0" } @@ -25971,14 +25846,12 @@ }, "shebang-command": { "version": "2.0.0", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "3.0.0", - "dev": true + "version": "3.0.0" }, "shell-quote": { "version": "1.8.1", @@ -26337,8 +26210,9 @@ "dev": true }, "strip-final-newline": { - "version": "3.0.0", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz", + "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==" }, "strip-indent": { "version": "3.0.0", @@ -26904,8 +26778,9 @@ } }, "type-fest": { - "version": "2.19.0", - "dev": true + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==" }, "type-is": { "version": "1.6.18", @@ -26966,6 +26841,11 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, + "unicorn-magic": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==" + }, "universalify": { "version": "2.0.0" }, @@ -27393,7 +27273,6 @@ }, "which": { "version": "2.0.2", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -27550,6 +27429,11 @@ "version": "0.1.0", "dev": true }, + "yoctocolors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.1.tgz", + "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==" + }, "zen-observable": { "version": "0.8.15" }, diff --git a/api/package.json b/api/package.json index 772db9533..0d56a1d6e 100644 --- a/api/package.json +++ b/api/package.json @@ -70,6 +70,7 @@ "bycontract": "^2.0.11", "bytes": "^3.1.2", "cacheable-lookup": "^6.1.0", + "camelcase-keys": "^9.1.3", "catch-exit": "^1.2.2", "chokidar": "^3.6.0", "cli-table": "^0.3.11", @@ -79,11 +80,13 @@ "docker-event-emitter": "^0.3.0", "dockerode": "^3.3.5", "dotenv": "^16.4.5", + "execa": "^9.4.1", "exit-hook": "^4.0.0", "express": "^4.19.2", "filenamify": "^6.0.0", "fs-extra": "^11.2.0", "global-agent": "^3.0.0", + "got": "^14.4.3", "graphql": "^16.8.1", "graphql-fields": "^2.0.3", "graphql-scalars": "^1.23.0", @@ -107,6 +110,7 @@ "p-retry": "^4.6.2", "passport-custom": "^1.1.1", "passport-http-header-strategy": "^1.1.0", + "path-type": "^6.0.0", "pidusage": "^3.0.2", "pino": "^9.1.0", "pino-http": "^9.0.0", @@ -160,22 +164,10 @@ "@types/wtfnode": "^0.7.3", "@vitest/coverage-v8": "^2.1.1", "@vitest/ui": "^2.1.1", - "camelcase-keys": "^8.0.2", "cz-conventional-changelog": "3.3.0", "eslint": "^9.12.0", - "execa": "^7.1.1", - "filter-obj": "^5.1.0", - "got": "^13", "graphql-codegen-typescript-validation-schema": "^0.14.1", - "ip-regex": "^5.0.0", "jiti": "^2.3.3", - "json-difference": "^1.16.1", - "map-obj": "^5.0.2", - "p-props": "^5.0.0", - "path-exists": "^5.0.0", - "path-type": "^5.0.0", - "pretty-bytes": "^6.1.1", - "pretty-ms": "^8.0.0", "standard-version": "^9.5.0", "typescript": "^5.4.5", "typescript-eslint": "^8.10.0", diff --git a/api/src/core/utils/misc/parse-config.ts b/api/src/core/utils/misc/parse-config.ts index c4baaeb5a..a0b70fbb2 100644 --- a/api/src/core/utils/misc/parse-config.ts +++ b/api/src/core/utils/misc/parse-config.ts @@ -1,7 +1,5 @@ import { parse as parseIni } from 'ini'; import camelCaseKeys from 'camelcase-keys'; -import { includeKeys } from 'filter-obj'; -import mapObject from 'map-obj'; import { AppError } from '@app/core/errors/app-error'; import { accessSync, readFileSync } from 'fs'; import { access } from 'fs/promises'; @@ -11,15 +9,15 @@ import { extname } from 'path'; type ConfigType = 'ini' | 'cfg'; type OptionsWithPath = { - /** Relative or absolute file path. */ - filePath: string; - /** If the file is an "ini" or a "cfg". */ - type?: ConfigType; + /** Relative or absolute file path. */ + filePath: string; + /** If the file is an "ini" or a "cfg". */ + type?: ConfigType; }; type OptionsWithLoadedFile = { - file: string; - type: ConfigType; + file: string; + type: ConfigType; }; /** @@ -38,53 +36,66 @@ type OptionsWithLoadedFile = { * ``` */ const fixObjectArrays = (object: Record) => { - // An object of arrays for keys that end in `:${number}` - const temporaryArrays = {}; + // An object of arrays for keys that end in `:${number}` + const temporaryArrays = {}; - // An object without any array items - const filteredObject = includeKeys(object, (key, value) => { - - const [, name, index] = [...((key).match(/(.*):(\d+$)/) ?? [])]; - if (!name || !index) { - return true; - } + // An object without any array items + const filteredObject = Object.fromEntries( + Object.entries(object).filter(([key, value]) => { + const match = key.match(/(.*):(\d+$)/); + if (!match) { + return true; + } - // Create initial array - if (!Array.isArray(temporaryArrays[name])) { - temporaryArrays[name] = []; - } + const [, name, index] = match; + if (!name || !index) { + return true; + } - // Add value - temporaryArrays[name].push(value); + // Create initial array + if (!Array.isArray(temporaryArrays[name])) { + temporaryArrays[name] = []; + } - // Remove the old field - return false; - }); + // Add value + temporaryArrays[name].push(value); - return { - ...filteredObject, - ...temporaryArrays, - }; + // Remove the old field + return false; + }) + ); + + return { + ...filteredObject, + ...temporaryArrays, + }; }; -export const fileExists = async (path: string) => access(path, F_OK).then(() => true).catch(() => false); +export const fileExists = async (path: string) => + access(path, F_OK) + .then(() => true) + .catch(() => false); export const fileExistsSync = (path: string) => { - try { - accessSync(path, F_OK); - return true; - } catch (error: unknown) { - return false; - } + try { + accessSync(path, F_OK); + return true; + } catch (error: unknown) { + return false; + } }; export const getExtensionFromPath = (filePath: string): string => extname(filePath); -const isFilePathOptions = (options: OptionsWithLoadedFile | OptionsWithPath): options is OptionsWithPath => Object.keys(options).includes('filePath'); -const isFileOptions = (options: OptionsWithLoadedFile | OptionsWithPath): options is OptionsWithLoadedFile => Object.keys(options).includes('file'); +const isFilePathOptions = ( + options: OptionsWithLoadedFile | OptionsWithPath +): options is OptionsWithPath => Object.keys(options).includes('filePath'); +const isFileOptions = ( + options: OptionsWithLoadedFile | OptionsWithPath +): options is OptionsWithLoadedFile => Object.keys(options).includes('file'); export const loadFileFromPathSync = (filePath: string): string => { - if (!fileExistsSync(filePath)) throw new Error(`Failed to load file at path: ${filePath}`); - return readFileSync(filePath, 'utf-8').toString(); + if (!fileExistsSync(filePath)) throw new Error(`Failed to load file at path: ${filePath}`); + return readFileSync(filePath, 'utf-8').toString(); }; /** @@ -94,48 +105,51 @@ export const loadFileFromPathSync = (filePath: string): string => { */ const isValidConfigExtension = (extension: string): boolean => ['ini', 'cfg'].includes(extension); -export const parseConfig = >(options: OptionsWithLoadedFile | OptionsWithPath): T => { - let fileContents: string; - let extension: string; +export const parseConfig = >( + options: OptionsWithLoadedFile | OptionsWithPath +): T => { + let fileContents: string; + let extension: string; - if (isFilePathOptions(options)) { - const { filePath, type } = options; + if (isFilePathOptions(options)) { + const { filePath, type } = options; - const validFile = fileExistsSync(filePath); - extension = type ?? getExtensionFromPath(filePath); - const validExtension = isValidConfigExtension(extension); + const validFile = fileExistsSync(filePath); + extension = type ?? getExtensionFromPath(filePath); + const validExtension = isValidConfigExtension(extension); - if (validFile && validExtension) { - fileContents = loadFileFromPathSync(options.filePath); - } else { - throw new AppError(`Invalid File Path: ${options.filePath}, or Extension: ${extension}`); - } - } else if (isFileOptions(options)) { - const { file, type } = options; - fileContents = file; - const extension = type; - if (!isValidConfigExtension(extension)) { - throw new AppError(`Invalid Extension for Ini File: ${extension}`); - } - } else { - throw new AppError('Invalid Parameters Passed to ParseConfig'); - } + if (validFile && validExtension) { + fileContents = loadFileFromPathSync(options.filePath); + } else { + throw new AppError(`Invalid File Path: ${options.filePath}, or Extension: ${extension}`); + } + } else if (isFileOptions(options)) { + const { file, type } = options; + fileContents = file; + const extension = type; + if (!isValidConfigExtension(extension)) { + throw new AppError(`Invalid Extension for Ini File: ${extension}`); + } + } else { + throw new AppError('Invalid Parameters Passed to ParseConfig'); + } - const data: Record = parseIni(fileContents); - // Remove quotes around keys - const dataWithoutQuoteKeys = mapObject(data, (key, value) => - // @SEE: https://stackoverflow.com/a/19156197/2311366 - [(key).replace(/^"(.+(?="$))"$/, '$1'), value], - ); + const data: Record = parseIni(fileContents); + // Remove quotes around keys + const dataWithoutQuoteKeys = Object.fromEntries( + Object.entries(data).map(([key, value]) => [key.replace(/^"(.+(?="$))"$/, '$1'), value]) + ); - // Result object with array items as actual arrays - const result = Object.fromEntries( - Object.entries(dataWithoutQuoteKeys) - .map(([key, value]) => [key, typeof value === 'object' ? fixObjectArrays(value) : value]), - ); + // Result object with array items as actual arrays + const result = Object.fromEntries( + Object.entries(dataWithoutQuoteKeys).map(([key, value]) => [ + key, + typeof value === 'object' ? fixObjectArrays(value) : value, + ]) + ); - // Convert all keys to camel case - return camelCaseKeys(result, { - deep: true, - }) as T; + // Convert all keys to camel case + return camelCaseKeys(result, { + deep: true, + }) as T; }; diff --git a/api/src/core/utils/vms/parse-domain.ts b/api/src/core/utils/vms/parse-domain.ts index 85d25980c..c63f88b78 100644 --- a/api/src/core/utils/vms/parse-domain.ts +++ b/api/src/core/utils/vms/parse-domain.ts @@ -1,4 +1,3 @@ -import pProps from 'p-props'; import { type Domain } from '@app/core/types'; import { getHypervisor } from '@app/core/utils/vms/get-hypervisor'; @@ -27,24 +26,34 @@ export const parseDomain = async (type: DomainLookupType, id: string): Promise { + logger.debug(`Writing ${convert(fileContents.length, 'bytes').to('kilobytes')} to ${filePath}`); + await fs.promises.writeFile(filePath, fileContents); +}; + +export const writeToBoot = async (filePath: string, fileContents: string | Buffer) => { + const basePath = '/boot/config/plugins/dynamix/'; + const resolvedPath = path.resolve(basePath, filePath); + await writeFile(resolvedPath, fileContents); +}; diff --git a/api/src/graphql/resolvers/query/info.ts b/api/src/graphql/resolvers/query/info.ts index e2cbf34e3..3d20b26c5 100644 --- a/api/src/graphql/resolvers/query/info.ts +++ b/api/src/graphql/resolvers/query/info.ts @@ -22,7 +22,6 @@ import { getUnraidVersion } from '@app/common/dashboard/get-unraid-version'; import { AppError } from '@app/core/errors/app-error'; import { cleanStdout } from '@app/core/utils/misc/clean-stdout'; import { execaCommandSync, execa } from 'execa'; -import { pathExists } from 'path-exists'; import { isSymlink } from 'path-type'; import type { PciDevice } from '@app/core/types'; import { vmRegExps } from '@app/core/utils/vms/domain/vm-regexps'; @@ -31,6 +30,7 @@ import { filterDevices } from '@app/core/utils/vms/filter-devices'; import { sanitizeVendor } from '@app/core/utils/vms/domain/sanitize-vendor'; import { sanitizeProduct } from '@app/core/utils/vms/domain/sanitize-product'; import { bootTimestamp } from '@app/common/dashboard/boot-timestamp'; +import { access } from 'fs/promises'; export const generateApps = async (): Promise => { const installed = await docker @@ -201,11 +201,12 @@ export const generateDevices = async (): Promise => { // Remove devices with no IOMMU support const filteredDevices = await Promise.all( - devices.map((device: Readonly) => - pathExists(`${basePath}${device.id}/iommu_group/`).then((exists) => - exists ? device : null - ) - ) + devices.map(async (device: Readonly) => { + const exists = await access(`${basePath}${device.id}/iommu_group/`) + .then(() => true) + .catch(() => false); + return exists ? device : null; + }) ).then((devices) => devices.filter((device) => device !== null)); /** @@ -281,7 +282,6 @@ export const generateDevices = async (): Promise => { const usbHubs = await execa('cat /sys/bus/usb/drivers/hub/*/modalias', { shell: true }) .then(({ stdout }) => stdout.split('\n').map((line) => { - const [, id] = line.match(/usb:v(\w{9})/) ?? []; return id.replace('p', ':'); }) @@ -316,7 +316,7 @@ export const generateDevices = async (): Promise => { // Parse the line const [, _] = line.split(/[ \t]{2,}/).filter(Boolean); - + const match = _.match(/^(\S+)\s(.*)/)?.slice(1); // If there's no match return nothing diff --git a/api/src/store/listeners/config-listener.ts b/api/src/store/listeners/config-listener.ts index 317cf2312..0b182c8db 100644 --- a/api/src/store/listeners/config-listener.ts +++ b/api/src/store/listeners/config-listener.ts @@ -1,5 +1,4 @@ import { startAppListening } from '@app/store/listeners/listener-middleware'; -import { getDiff } from 'json-difference'; import { isEqual } from 'lodash-es'; import { logger } from '@app/core/log'; import { @@ -40,15 +39,6 @@ export const enableConfigFileListener = (mode: ConfigType) => () => action.type !== loadConfigFile.fulfilled.type && action.type !== loadConfigFile.rejected.type ) { - logger.trace( - { - diff: getDiff(oldFlashConfig ?? {}, newFlashConfig), - }, - `${mode} Config Changed!`, - 'Action:', - action.type - ); - return true; }