From 673afc80a1f0ab6996a8e5adb962af31197fcf41 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:47:02 +0100 Subject: [PATCH] add plugin config validation functionality --- CHANGELOG.md | 1 + package-lock.json | 102 +++++++----------- package.json | 12 +-- ui/package-lock.json | 6 +- .../custom-plugins.component.html | 21 ++-- .../custom-plugins.component.ts | 8 +- ...homebridge-google-smarthome.component.html | 2 +- .../plugin-config.component.html | 63 +++++++---- .../plugin-config/plugin-config.component.ts | 15 +++ .../users-2fa-enable.component.html | 2 +- ui/src/i18n/bg.json | 3 + ui/src/i18n/ca.json | 3 + ui/src/i18n/cs.json | 3 + ui/src/i18n/de.json | 3 + ui/src/i18n/en.json | 3 + ui/src/i18n/es.json | 3 + ui/src/i18n/fi.json | 3 + ui/src/i18n/fr.json | 3 + ui/src/i18n/he.json | 3 + ui/src/i18n/hu.json | 3 + ui/src/i18n/id.json | 3 + ui/src/i18n/it.json | 3 + ui/src/i18n/ja.json | 3 + ui/src/i18n/ko.json | 3 + ui/src/i18n/mk.json | 3 + ui/src/i18n/nl.json | 3 + ui/src/i18n/no.json | 3 + ui/src/i18n/pl.json | 3 + ui/src/i18n/pt-BR.json | 3 + ui/src/i18n/pt.json | 3 + ui/src/i18n/ru.json | 3 + ui/src/i18n/sl.json | 3 + ui/src/i18n/sv.json | 3 + ui/src/i18n/th.json | 3 + ui/src/i18n/tr.json | 3 + ui/src/i18n/uk.json | 3 + ui/src/i18n/zh-CN.json | 3 + ui/src/i18n/zh-TW.json | 3 + 38 files changed, 206 insertions(+), 110 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fcf984df..2263636ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file. - implement and allow switching to scoped plugins - fix widget config saving on dashboard +- add plugin config validation functionality ### Other Changes diff --git a/package-lock.json b/package-lock.json index 9353204a4..7ef648f0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,14 +25,14 @@ "@homebridge/hap-client": "1.10.2", "@homebridge/node-pty-prebuilt-multiarch": "0.11.14", "@nestjs/axios": "3.1.0", - "@nestjs/common": "10.4.5", - "@nestjs/core": "10.4.5", + "@nestjs/common": "10.4.6", + "@nestjs/core": "10.4.6", "@nestjs/jwt": "10.2.0", "@nestjs/passport": "10.0.3", - "@nestjs/platform-fastify": "10.4.5", - "@nestjs/platform-socket.io": "10.4.5", + "@nestjs/platform-fastify": "10.4.6", + "@nestjs/platform-socket.io": "10.4.6", "@nestjs/swagger": "7.4.2", - "@nestjs/websockets": "10.4.5", + "@nestjs/websockets": "10.4.6", "axios": "1.7.7", "bash-color": "0.0.4", "buffer-shims": "1.0.0", @@ -66,7 +66,7 @@ }, "devDependencies": { "@antfu/eslint-config": "^3.8.0", - "@nestjs/testing": "^10.4.5", + "@nestjs/testing": "^10.4.6", "@types/fs-extra": "^11.0.4", "@types/lodash": "^4.17.12", "@types/node": "^22.7.9", @@ -1518,9 +1518,9 @@ } }, "node_modules/@nestjs/common": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.5.tgz", - "integrity": "sha512-N/yUyuYCBMb0+H6jHhntR7PURzji0usID/DByhOfooyk/aPGscI0aQKwOA6edlJlT92hHUvXYLJ5p3npj7KcjQ==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.6.tgz", + "integrity": "sha512-KkezkZvU9poWaNq4L+lNvx+386hpOxPJkfXBBeSMrcqBOx8kVr36TGN2uYkF4Ta4zNu1KbCjmZbc0rhHSg296g==", "license": "MIT", "dependencies": { "iterare": "1.2.1", @@ -1547,9 +1547,9 @@ } }, "node_modules/@nestjs/core": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.5.tgz", - "integrity": "sha512-wk0KJ+6tuidqAdeemsQ40BCp1BgMsSuSLG577aqXLxXYoa8FQYPrdxoSzd05znYLwJYM55fisZWb3FLF9HT2qw==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-10.4.6.tgz", + "integrity": "sha512-zXVPxCNRfO6gAy0yvEDjUxE/8gfZICJFpsl2lZAUH31bPb6m+tXuhUq2mVCTEltyMYQ+DYtRe+fEYM2v152N1g==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1628,9 +1628,9 @@ } }, "node_modules/@nestjs/platform-fastify": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.4.5.tgz", - "integrity": "sha512-5kcLsloaKkG6i46qbHmz6m/XoEtwroBni3uwsNENw4OJ8fptllihOqG3PWKRfljfpH4twyKdtZfKvyjMHXNj4w==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/platform-fastify/-/platform-fastify-10.4.6.tgz", + "integrity": "sha512-0KnpilaXnAAaBeNTYvP1p4iJU2JFJPk3c+gXWh/NAOLCe+MuaprgvkNX/YUOycirvWr3qVTCgICO+xejgJyhhw==", "license": "MIT", "dependencies": { "@fastify/cors": "9.0.1", @@ -1661,12 +1661,12 @@ } }, "node_modules/@nestjs/platform-socket.io": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.4.5.tgz", - "integrity": "sha512-dHkHJQArhrpkX6qBdTW2ghuja3i3cCslwy4QHY6d46u+9UyANQlsNK9wt/lZnmXfCMaci8xAJvUpyODa6YtV7g==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-10.4.6.tgz", + "integrity": "sha512-lGv99O7C00wtnGq9M0mcwrOpH2qmuqAXQyvo/d/I7rmaf3OO1Sg8qWDLAnPKHdaumwOL2mnET3kvCJ06MaL6WA==", "license": "MIT", "dependencies": { - "socket.io": "4.7.5", + "socket.io": "4.8.0", "tslib": "2.7.0" }, "funding": { @@ -1713,9 +1713,9 @@ } }, "node_modules/@nestjs/testing": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.4.5.tgz", - "integrity": "sha512-3NhmztE+fK3MuuOZhXihvMIhxm0QuDM2BneHvM5A0oVLG+STsAeGBqbDr/Ef2qsvqH5HaqvfGbVJ4N1DQnZE5A==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.4.6.tgz", + "integrity": "sha512-aiDicKhlGibVGNYuew399H5qZZXaseOBT/BS+ERJxxCmco7ZdAqaujsNjSaSbTK9ojDPf27crLT0C4opjqJe3A==", "dev": true, "license": "MIT", "dependencies": { @@ -1741,9 +1741,9 @@ } }, "node_modules/@nestjs/websockets": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.4.5.tgz", - "integrity": "sha512-LbL/HRLWQUBTUPY7swojOHdvokyVGINIiuP/VmRdhob4T751r+9i09z2RqRpP71psuom9mnRHYI1+vT2FABrAw==", + "version": "10.4.6", + "resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-10.4.6.tgz", + "integrity": "sha512-53YqDQylPAOudNFiiBvrN8QrRl/sZ9oEjKbD3wBVgrFREbaiuTySoyyy6HwVs60HW29uQwck+Bp7qkKGjhtQKg==", "license": "MIT", "dependencies": { "iterare": "1.2.1", @@ -1890,15 +1890,15 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", - "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.3.tgz", + "integrity": "sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "picomatch": "^4.0.2" }, "engines": { "node": ">=14.0.0" @@ -1912,19 +1912,6 @@ } } }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.24.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", @@ -3898,9 +3885,9 @@ } }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, "license": "MIT", "dependencies": { @@ -4660,9 +4647,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", - "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.2.tgz", + "integrity": "sha512-gmNvsYi9C8iErnZdVcJnvCpSKbWTt1E8+JZo8b+daLninywUWi5NQ5STSHZ9rFjFO7imNcvb8Pc5pe/wMR5xEw==", "license": "MIT", "dependencies": { "@types/cookie": "^0.4.1", @@ -4670,7 +4657,7 @@ "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.4.1", + "cookie": "~0.7.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", @@ -4689,15 +4676,6 @@ "node": ">=10.0.0" } }, - "node_modules/engine.io/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/enhanced-resolve": { "version": "5.17.1", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", @@ -9721,16 +9699,16 @@ "license": "ISC" }, "node_modules/socket.io": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.5.tgz", - "integrity": "sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.0.tgz", + "integrity": "sha512-8U6BEgGjQOfGz3HHTYaC/L1GaxDCJ/KM0XTkJly0EhZ5U/du9uNEZy4ZgYzEzIqlx2CMm25CrCqr1ck899eLNA==", "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "cors": "~2.8.5", "debug": "~4.3.2", - "engine.io": "~6.5.2", + "engine.io": "~6.6.0", "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.4" }, diff --git a/package.json b/package.json index 5cd8a8037..aafd1de3c 100644 --- a/package.json +++ b/package.json @@ -85,14 +85,14 @@ "@homebridge/hap-client": "1.10.2", "@homebridge/node-pty-prebuilt-multiarch": "0.11.14", "@nestjs/axios": "3.1.0", - "@nestjs/common": "10.4.5", - "@nestjs/core": "10.4.5", + "@nestjs/common": "10.4.6", + "@nestjs/core": "10.4.6", "@nestjs/jwt": "10.2.0", "@nestjs/passport": "10.0.3", - "@nestjs/platform-fastify": "10.4.5", - "@nestjs/platform-socket.io": "10.4.5", + "@nestjs/platform-fastify": "10.4.6", + "@nestjs/platform-socket.io": "10.4.6", "@nestjs/swagger": "7.4.2", - "@nestjs/websockets": "10.4.5", + "@nestjs/websockets": "10.4.6", "axios": "1.7.7", "bash-color": "0.0.4", "buffer-shims": "1.0.0", @@ -122,7 +122,7 @@ }, "devDependencies": { "@antfu/eslint-config": "^3.8.0", - "@nestjs/testing": "^10.4.5", + "@nestjs/testing": "^10.4.6", "@types/fs-extra": "^11.0.4", "@types/lodash": "^4.17.12", "@types/node": "^22.7.9", diff --git a/ui/package-lock.json b/ui/package-lock.json index bceb81f9c..96e9d5206 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -3920,9 +3920,9 @@ } }, "node_modules/engine.io-client": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.1.tgz", - "integrity": "sha512-aYuoak7I+R83M/BBPIOs2to51BmFIpC1wZe6zZzMrT2llVsHy5cvcmdsJgP2Qz6smHu+sD9oexiSUAVd8OfBPw==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.2.tgz", + "integrity": "sha512-TAr+NKeoVTjEVW8P3iHguO1LO6RlUz9O5Y8o7EY0fU+gY1NYqas7NN3slpFtbXEsLMHk0h90fJMfKjRkQ0qUIw==", "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", diff --git a/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.html b/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.html index d421ef493..767433459 100644 --- a/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.html +++ b/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.html @@ -33,6 +33,7 @@