From 77e2cc2027ae80636462f508a8dcfd7a72e7733b Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Thu, 28 Oct 2021 11:37:19 -0500 Subject: [PATCH] v1.4.0 (#72) ## [Version 1.4.0](https://github.com/donavanbecker/homebridge-rainbird/compare/v1.3.0...v1.4.0) (2021-10-28) ### Changes - Added support to show vavles as contact sensors - Allows you to get notified in the Home App when a Zone has started. - Added Device Logging and Debug Logging for plugin - Changed from `node-fetch` to `axios` - Updated dependencies - Persist configured and duration values - Fixed issue where some models were not able to stop a zone --- CHANGELOG.md | 12 + config.schema.json | 39 +- package-lock.json | 1603 ++++++++--------- package.json | 24 +- src/RainBird/RainBirdClient.ts | 51 +- src/RainBird/RainBirdService.ts | 44 +- src/devices/ContactSensor.ts | 91 + ...rrigationsystem.ts => IrrigationSystem.ts} | 175 +- src/devices/LeakSensor.ts | 21 +- src/platform.ts | 154 +- src/settings.ts | 3 +- 11 files changed, 1143 insertions(+), 1074 deletions(-) create mode 100644 src/devices/ContactSensor.ts rename src/devices/{irrigationsystem.ts => IrrigationSystem.ts} (59%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949b2bd..5cc7bc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [Version 1.4.0](https://github.com/donavanbecker/homebridge-rainbird/compare/v1.3.0...v1.4.0) (2021-10-28) + +### Changes + +- Added support to show vavles as contact sensors + - Allows you to get notified in the Home App when a Zone has started. +- Added Device Logging and Debug Logging for plugin +- Changed from `node-fetch` to `axios` +- Updated dependencies +- Persist configured and duration values +- Fixed issue where some models were not able to stop a zone + ## [Version 1.3.0](https://github.com/donavanbecker/homebridge-rainbird/compare/v1.2.0...v1.3.0) (2021-10-09) ### Changes diff --git a/config.schema.json b/config.schema.json index 85af140..6f6433a 100644 --- a/config.schema.json +++ b/config.schema.json @@ -40,6 +40,12 @@ "title": "Show Rain Sensor (as Leak Sensor)", "type": "boolean", "required": false + }, + "showValveSensor": { + "title": "Enable Valve Notifications (as Contact Sensors)", + "type": "boolean", + "required": false, + "description": "If enabled, whichever zone runs the contact sensors will go off as detected so you know that it is running." } } } @@ -61,15 +67,31 @@ "description": "Indicates the number of seconds between pushes to Rainbird Client." }, "debug": { - "title": "Debug", - "type": "boolean", - "description": "Turn plugin's debug mode on." + "title": "Logging Settings", + "type": "string", + "description": "Enable 'Device' or 'Debug' logging.", + "oneOf": [ + { + "title": "Enable Debug Logging", + "enum": [ + "debug" + ] + }, + { + "title": "Enable Device Logging", + "enum": [ + "device" + ] + } + ], + "required": false } } }, "disablePlugin": { "title": "Disable Plugin", - "type": "boolean" + "type": "boolean", + "description": "DO NOT USE, UNLESS YOU WANT TO REMOVE ACCESSORIES FROM CACHE." } } }, @@ -100,7 +122,8 @@ "expandable": true, "expanded": false, "items": [ - "devices[].showRainSensor" + "devices[].showRainSensor", + "devices[].showValveSensor" ] } ] @@ -132,11 +155,7 @@ "notitle": true }, "options.debug", - { - "key": "disablePlugin", - "title": "Disable Plugin", - "description": "If true, the plugin will remove all accessories and not load the plugin on restart." - } + "disablePlugin" ] } ] diff --git a/package-lock.json b/package-lock.json index b7c1481..a8331c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-rainbird", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "homebridge-rainbird", - "version": "1.3.0", + "version": "1.4.0", "funding": [ { "type": "Paypal", @@ -21,7 +21,8 @@ "dependencies": { "@homebridge/plugin-ui-utils": "^0.0.19", "aes-js": "^3.1.2", - "node-fetch": "^2.6.2", + "axios": "^0.24.0", + "concurrent-queue": "^7.0.2", "queue": "^6.0.2", "rxjs": "^7.4.0", "text-encoder": "0.0.4" @@ -29,124 +30,22 @@ "devDependencies": { "@types/aes-js": "^3.1.1", "@types/better-queue": "^3.8.3", - "@types/node": "^16.10.3", + "@types/node": "^16.11.6", "@types/node-fetch": "^3.0.3", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "eslint": "^7.32.0", + "@typescript-eslint/eslint-plugin": "^5.2.0", + "@typescript-eslint/parser": "^5.2.0", + "eslint": "^8.1.0", "homebridge": "^1.3.5", - "nodemon": "^2.0.13", + "nodemon": "^2.0.14", "npm-check-updates": "^11.8.5", "rimraf": "^3.0.2", - "ts-node": "^10.2.1", - "typescript": "^4.4.3" + "ts-node": "^10.4.0", + "typescript": "^4.4.4", + "typescript-axios-wb": "^1.0.3" }, "engines": { "homebridge": "^1.3.5", - "node": "^14.18.0 || ^16.10.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "node": "^14.18.1 || ^16.13.0" } }, "node_modules/@cspotcode/source-map-consumer": { @@ -159,9 +58,9 @@ } }, "node_modules/@cspotcode/source-map-support": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", - "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", "dev": true, "dependencies": { "@cspotcode/source-map-consumer": "0.8.0" @@ -171,14 +70,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz", + "integrity": "sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", + "debug": "^4.3.2", + "espree": "^9.0.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -187,7 +86,16 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" } }, "node_modules/@eslint/eslintrc/node_modules/ignore": { @@ -199,6 +107,19 @@ "node": ">= 4" } }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@gar/promisify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz", @@ -206,15 +127,15 @@ "dev": true }, "node_modules/@homebridge/ciao": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.2.tgz", - "integrity": "sha512-31IfDKMqxfT+uVNXj0/TmYMou57gP8CUrh0vABzsc5QMsoCQ4Oo5uYQp0oJJyzxTBkF2pFvjR3XlWAapl0VyCg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.3.tgz", + "integrity": "sha512-p9WgcSYUj3rtC1g3ywJpKxvIZXPkkv88JxbuW6idMHrUOqDMJlWIsWF0yXynQf8Z28gA0j6AJN9EnAr+hg5gNA==", "dev": true, "dependencies": { - "debug": "^4.3.1", + "debug": "^4.3.2", "fast-deep-equal": "^3.1.3", - "source-map-support": "^0.5.19", - "tslib": "^2.0.3" + "source-map-support": "^0.5.20", + "tslib": "^2.3.1" }, "bin": { "ciao-bcs": "lib/bonjour-conformance-testing.js" @@ -226,9 +147,9 @@ "integrity": "sha512-axFX7lN2Yd7bz/6SlD7dzq5sY/N9+XYuLHPukuiyHQRDtNMRL1uDqJhOx6RVaN2tYDHB75h7YxRQWP7U44Mgzg==" }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", + "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", @@ -468,9 +389,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz", - "integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ==", + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", "dev": true }, "node_modules/@types/node-fetch": { @@ -484,30 +405,30 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz", + "integrity": "sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.33.0", - "@typescript-eslint/scope-manager": "4.33.0", - "debug": "^4.3.1", + "@typescript-eslint/experimental-utils": "5.2.0", + "@typescript-eslint/scope-manager": "5.2.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", - "regexpp": "^3.1.0", + "regexpp": "^3.2.0", "semver": "^7.3.5", "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -516,20 +437,20 @@ } }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz", + "integrity": "sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.2.0", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/typescript-estree": "5.2.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -540,25 +461,25 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.2.0.tgz", + "integrity": "sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "debug": "^4.3.1" + "@typescript-eslint/scope-manager": "5.2.0", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/typescript-estree": "5.2.0", + "debug": "^4.3.2" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -567,16 +488,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz", + "integrity": "sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0" + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/visitor-keys": "5.2.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -584,12 +505,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.2.0.tgz", + "integrity": "sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ==", "dev": true, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -597,21 +518,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz", + "integrity": "sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/visitor-keys": "5.2.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", "semver": "^7.3.5", "tsutils": "^3.21.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -624,16 +545,16 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz", + "integrity": "sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.33.0", - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "5.2.0", + "eslint-visitor-keys": "^3.0.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "type": "opencollective", @@ -647,9 +568,9 @@ "dev": true }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -681,6 +602,14 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" }, + "node_modules/afterward": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/afterward/-/afterward-2.0.0.tgz", + "integrity": "sha1-lmp1MdL9tBv/Z7Tqg6vZ68vvXrI=", + "dependencies": { + "define-error": "~1.0.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -837,13 +766,10 @@ "dev": true }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/array-flatten": { "version": "2.1.2", @@ -878,15 +804,6 @@ "node": ">=0.8" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -920,6 +837,14 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, + "node_modules/axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "dependencies": { + "follow-redirects": "^1.14.4" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1159,6 +1084,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -1202,6 +1135,18 @@ "fsevents": "~2.3.2" } }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -1328,6 +1273,20 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "node_modules/concurrent-queue": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/concurrent-queue/-/concurrent-queue-7.0.2.tgz", + "integrity": "sha1-PPzPqLnOCMoj2FMZ9cNuwb+VQPo=", + "dependencies": { + "afterward": "~2.0.0", + "define-error": "~1.0.0", + "eventuate": "~4.0.0", + "object-assign": "~4.0.1", + "on-error": "~2.1.0", + "once": "~1.3.2", + "promise-polyfill": "~2.1.0" + } + }, "node_modules/configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -1398,6 +1357,15 @@ "node": ">=0.10" } }, + "node_modules/data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -1474,6 +1442,14 @@ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", "dev": true }, + "node_modules/define-error": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-error/-/define-error-1.0.0.tgz", + "integrity": "sha1-X7SKRd1fZfiPgrDJoiPAGTN50/4=", + "dependencies": { + "capture-stack-trace": "~1.0.0" + } + }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1608,6 +1584,15 @@ "once": "^1.4.0" } }, + "node_modules/end-of-stream/node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -1727,37 +1712,36 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.1.0.tgz", + "integrity": "sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw==", "dev": true, "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", + "@eslint/eslintrc": "^1.0.3", + "@humanwhocodes/config-array": "^0.6.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "eslint-scope": "^6.0.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", + "glob-parent": "^6.0.1", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -1765,11 +1749,10 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^3.1.0", + "regexpp": "^3.2.0", "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -1777,7 +1760,7 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1814,7 +1797,7 @@ "eslint": ">=5" } }, - "node_modules/eslint-visitor-keys": { + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", @@ -1823,28 +1806,35 @@ "node": ">=10" } }, - "node_modules/eslint/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint-visitor-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", + "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", + "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=4.0" } }, "node_modules/eslint/node_modules/ignore": { @@ -1857,26 +1847,17 @@ } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", + "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", + "acorn": "^8.5.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "eslint-visitor-keys": "^3.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/esprima": { @@ -1905,9 +1886,9 @@ } }, "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -1926,9 +1907,9 @@ } }, "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -1952,6 +1933,24 @@ "node": ">=0.10.0" } }, + "node_modules/eventuate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventuate/-/eventuate-4.0.0.tgz", + "integrity": "sha1-TiaQVTFv/0EJB4FB+SZgDHS1caA=", + "dependencies": { + "define-error": "~1.0.0", + "object-assign": "~3.0.0", + "shallow-copy": "0.0.1" + } + }, + "node_modules/eventuate/node_modules/object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -1989,6 +1988,18 @@ "node": ">=8" } }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2025,6 +2036,28 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz", + "integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "dependencies": { + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -2090,6 +2123,25 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -2220,6 +2272,15 @@ "node": ">=0.10.0" } }, + "node_modules/gauge/node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/gauge/node_modules/strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -2316,15 +2377,15 @@ } }, "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 6" + "node": ">=10.13.0" } }, "node_modules/global-dirs": { @@ -2352,9 +2413,9 @@ } }, "node_modules/globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3121,20 +3182,13 @@ "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", "dev": true }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -3384,24 +3438,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -3703,14 +3745,20 @@ } }, "node_modules/node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz", + "integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==", + "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^3.0.1", + "fetch-blob": "^3.1.2" }, "engines": { - "node": "4.x || >=6.0.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, "node_modules/node-gyp": { @@ -3748,9 +3796,9 @@ } }, "node_modules/nodemon": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.13.tgz", - "integrity": "sha512-UMXMpsZsv1UXUttCn6gv8eQPhn6DR4BW+txnL3IN5IHqrCwcrT/yWHfL35UsClGXknTH79r5xbu+6J1zNHuSyA==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz", + "integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -4018,10 +4066,9 @@ } }, "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", + "integrity": "sha1-mVBEVsNZi1ytT8WcJuipuxB/4L0=", "engines": { "node": ">=0.10.0" } @@ -4078,11 +4125,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/on-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/on-error/-/on-error-2.1.0.tgz", + "integrity": "sha1-usVuS0mATEkWcVDa0nWbQmERfc4=" + }, "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", "dependencies": { "wrappy": "1" } @@ -4353,6 +4404,11 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, + "node_modules/promise-polyfill": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-2.1.4.tgz", + "integrity": "sha1-cxkiNTLCasPlVefpvMDPdiAbUa0=" + }, "node_modules/promise-retry": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", @@ -4505,24 +4561,6 @@ "require-from-string": "^2.0.2" } }, - "node_modules/rc-config-loader/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/rc-config-loader/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "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", @@ -4828,6 +4866,11 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "node_modules/shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4884,32 +4927,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -5131,68 +5148,6 @@ "node": ">=8" } }, - "node_modules/table": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", - "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", - "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -5300,18 +5255,13 @@ "node": ">=0.8" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "node_modules/ts-node": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz", - "integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", "dev": true, "dependencies": { - "@cspotcode/source-map-support": "0.6.1", + "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -5331,9 +5281,6 @@ "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=12.0.0" - }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", @@ -5349,18 +5296,6 @@ } } }, - "node_modules/ts-node/node_modules/acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -5440,9 +5375,9 @@ } }, "node_modules/typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5452,6 +5387,15 @@ "node": ">=4.2.0" } }, + "node_modules/typescript-axios-wb": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typescript-axios-wb/-/typescript-axios-wb-1.0.3.tgz", + "integrity": "sha512-lS0aojPRHE5nx1gglcqYXfzoEQWgxmMfXbTbozivTNJM6PfCS3a5sHfQPmxy7WQS1piQdGExB3/3GdHvtMDiqw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", @@ -5468,27 +5412,9 @@ } }, "node_modules/undefsafe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", - "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", - "dev": true, - "dependencies": { - "debug": "^2.2.0" - } - }, - "node_modules/undefsafe/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/undefsafe/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, "node_modules/unique-filename": { @@ -5630,18 +5556,13 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "node_modules/web-streams-polyfill": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", + "integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==", + "dev": true, + "engines": { + "node": ">= 8" } }, "node_modules/which": { @@ -5711,12 +5632,12 @@ } }, "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, "dependencies": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "node_modules/widest-line": { @@ -5806,8 +5727,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -5859,90 +5779,6 @@ } }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true - }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -5950,23 +5786,23 @@ "dev": true }, "@cspotcode/source-map-support": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz", - "integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", "dev": true, "requires": { "@cspotcode/source-map-consumer": "0.8.0" } }, "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz", + "integrity": "sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", + "debug": "^4.3.2", + "espree": "^9.0.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -5975,11 +5811,30 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } } } }, @@ -5990,15 +5845,15 @@ "dev": true }, "@homebridge/ciao": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.2.tgz", - "integrity": "sha512-31IfDKMqxfT+uVNXj0/TmYMou57gP8CUrh0vABzsc5QMsoCQ4Oo5uYQp0oJJyzxTBkF2pFvjR3XlWAapl0VyCg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@homebridge/ciao/-/ciao-1.1.3.tgz", + "integrity": "sha512-p9WgcSYUj3rtC1g3ywJpKxvIZXPkkv88JxbuW6idMHrUOqDMJlWIsWF0yXynQf8Z28gA0j6AJN9EnAr+hg5gNA==", "dev": true, "requires": { - "debug": "^4.3.1", + "debug": "^4.3.2", "fast-deep-equal": "^3.1.3", - "source-map-support": "^0.5.19", - "tslib": "^2.0.3" + "source-map-support": "^0.5.20", + "tslib": "^2.3.1" } }, "@homebridge/plugin-ui-utils": { @@ -6007,9 +5862,9 @@ "integrity": "sha512-axFX7lN2Yd7bz/6SlD7dzq5sY/N9+XYuLHPukuiyHQRDtNMRL1uDqJhOx6RVaN2tYDHB75h7YxRQWP7U44Mgzg==" }, "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", + "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.0", @@ -6211,9 +6066,9 @@ "dev": true }, "@types/node": { - "version": "16.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz", - "integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ==", + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", "dev": true }, "@types/node-fetch": { @@ -6226,86 +6081,86 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", - "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz", + "integrity": "sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.33.0", - "@typescript-eslint/scope-manager": "4.33.0", - "debug": "^4.3.1", + "@typescript-eslint/experimental-utils": "5.2.0", + "@typescript-eslint/scope-manager": "5.2.0", + "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", - "regexpp": "^3.1.0", + "regexpp": "^3.2.0", "semver": "^7.3.5", "tsutils": "^3.21.0" } }, "@typescript-eslint/experimental-utils": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", - "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz", + "integrity": "sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.2.0", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/typescript-estree": "5.2.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", - "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.2.0.tgz", + "integrity": "sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.33.0", - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/typescript-estree": "4.33.0", - "debug": "^4.3.1" + "@typescript-eslint/scope-manager": "5.2.0", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/typescript-estree": "5.2.0", + "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", - "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz", + "integrity": "sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0" + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/visitor-keys": "5.2.0" } }, "@typescript-eslint/types": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", - "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.2.0.tgz", + "integrity": "sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", - "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz", + "integrity": "sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "@typescript-eslint/visitor-keys": "4.33.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", + "@typescript-eslint/types": "5.2.0", + "@typescript-eslint/visitor-keys": "5.2.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", "semver": "^7.3.5", "tsutils": "^3.21.0" } }, "@typescript-eslint/visitor-keys": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", - "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz", + "integrity": "sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.33.0", - "eslint-visitor-keys": "^2.0.0" + "@typescript-eslint/types": "5.2.0", + "eslint-visitor-keys": "^3.0.0" } }, "abbrev": { @@ -6315,9 +6170,9 @@ "dev": true }, "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true }, "acorn-jsx": { @@ -6338,6 +6193,14 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" }, + "afterward": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/afterward/-/afterward-2.0.0.tgz", + "integrity": "sha1-lmp1MdL9tBv/Z7Tqg6vZ68vvXrI=", + "requires": { + "define-error": "~1.0.0" + } + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -6462,13 +6325,10 @@ "dev": true }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "array-flatten": { "version": "2.1.2", @@ -6497,12 +6357,6 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -6527,6 +6381,14 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, + "axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -6723,6 +6585,11 @@ "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, + "capture-stack-trace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==" + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -6753,6 +6620,17 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "chownr": { @@ -6851,6 +6729,20 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concurrent-queue": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/concurrent-queue/-/concurrent-queue-7.0.2.tgz", + "integrity": "sha1-PPzPqLnOCMoj2FMZ9cNuwb+VQPo=", + "requires": { + "afterward": "~2.0.0", + "define-error": "~1.0.0", + "eventuate": "~4.0.0", + "object-assign": "~4.0.1", + "on-error": "~2.1.0", + "once": "~1.3.2", + "promise-polyfill": "~2.1.0" + } + }, "configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -6909,6 +6801,12 @@ "assert-plus": "^1.0.0" } }, + "data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "dev": true + }, "debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -6968,6 +6866,14 @@ "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", "dev": true }, + "define-error": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-error/-/define-error-1.0.0.tgz", + "integrity": "sha1-X7SKRd1fZfiPgrDJoiPAGTN50/4=", + "requires": { + "capture-stack-trace": "~1.0.0" + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -7076,6 +6982,17 @@ "dev": true, "requires": { "once": "^1.4.0" + }, + "dependencies": { + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + } } }, "enquirer": { @@ -7167,37 +7084,36 @@ "dev": true }, "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.1.0.tgz", + "integrity": "sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw==", "dev": true, "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", + "@eslint/eslintrc": "^1.0.3", + "@humanwhocodes/config-array": "^0.6.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "eslint-scope": "^6.0.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", + "glob-parent": "^6.0.1", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -7205,32 +7121,30 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^3.1.0", + "regexpp": "^3.2.0", "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "eslint-scope": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", + "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" } }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -7256,31 +7170,31 @@ "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", + "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", "dev": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", + "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", "dev": true, "requires": { - "acorn": "^7.4.0", + "acorn": "^8.5.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "eslint-visitor-keys": "^3.0.0" } }, "esprima": { @@ -7299,9 +7213,9 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } @@ -7316,9 +7230,9 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } @@ -7335,6 +7249,23 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "eventuate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventuate/-/eventuate-4.0.0.tgz", + "integrity": "sha1-TiaQVTFv/0EJB4FB+SZgDHS1caA=", + "requires": { + "define-error": "~1.0.0", + "object-assign": "~3.0.0", + "shallow-copy": "0.0.1" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -7364,6 +7295,17 @@ "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "fast-json-stable-stringify": { @@ -7399,6 +7341,15 @@ "reusify": "^1.0.4" } }, + "fetch-blob": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz", + "integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==", + "dev": true, + "requires": { + "web-streams-polyfill": "^3.0.3" + } + }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -7449,6 +7400,11 @@ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, + "follow-redirects": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" + }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -7551,6 +7507,12 @@ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -7622,12 +7584,12 @@ } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "global-dirs": { @@ -7648,9 +7610,9 @@ } }, "globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -8208,20 +8170,13 @@ "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "jsbn": { @@ -8423,24 +8378,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -8676,11 +8619,13 @@ "dev": true }, "node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz", + "integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==", + "dev": true, "requires": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^3.0.1", + "fetch-blob": "^3.1.2" } }, "node-gyp": { @@ -8712,9 +8657,9 @@ } }, "nodemon": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.13.tgz", - "integrity": "sha512-UMXMpsZsv1UXUttCn6gv8eQPhn6DR4BW+txnL3IN5IHqrCwcrT/yWHfL35UsClGXknTH79r5xbu+6J1zNHuSyA==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz", + "integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==", "dev": true, "requires": { "chokidar": "^3.2.2", @@ -8923,10 +8868,9 @@ "dev": true }, "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", + "integrity": "sha1-mVBEVsNZi1ytT8WcJuipuxB/4L0=" }, "object-inspect": { "version": "1.11.0", @@ -8962,11 +8906,15 @@ "object-keys": "^1.1.1" } }, + "on-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/on-error/-/on-error-2.1.0.tgz", + "integrity": "sha1-usVuS0mATEkWcVDa0nWbQmERfc4=" + }, "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", "requires": { "wrappy": "1" } @@ -9160,6 +9108,11 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, + "promise-polyfill": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-2.1.4.tgz", + "integrity": "sha1-cxkiNTLCasPlVefpvMDPdiAbUa0=" + }, "promise-retry": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", @@ -9279,23 +9232,6 @@ "js-yaml": "^4.0.0", "json5": "^2.1.2", "require-from-string": "^2.0.2" - }, - "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - } } }, "read-package-json-fast": { @@ -9524,6 +9460,11 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=" + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -9568,25 +9509,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - } - } - }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -9757,57 +9679,6 @@ "has-flag": "^4.0.0" } }, - "table": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", - "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "version": "8.6.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", - "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - } - } - }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -9892,18 +9763,13 @@ "punycode": "^2.1.1" } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, "ts-node": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz", - "integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", "dev": true, "requires": { - "@cspotcode/source-map-support": "0.6.1", + "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -9915,14 +9781,6 @@ "diff": "^4.0.1", "make-error": "^1.1.1", "yn": "3.1.1" - }, - "dependencies": { - "acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true - } } }, "tslib": { @@ -9988,9 +9846,15 @@ } }, "typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true + }, + "typescript-axios-wb": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typescript-axios-wb/-/typescript-axios-wb-1.0.3.tgz", + "integrity": "sha512-lS0aojPRHE5nx1gglcqYXfzoEQWgxmMfXbTbozivTNJM6PfCS3a5sHfQPmxy7WQS1piQdGExB3/3GdHvtMDiqw==", "dev": true }, "unbox-primitive": { @@ -10006,30 +9870,10 @@ } }, "undefsafe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", - "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", - "dev": true, - "requires": { - "debug": "^2.2.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true }, "unique-filename": { "version": "1.1.1", @@ -10150,19 +9994,11 @@ } } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } + "web-streams-polyfill": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", + "integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==", + "dev": true }, "which": { "version": "2.0.2", @@ -10213,12 +10049,12 @@ } }, "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "widest-line": { @@ -10288,8 +10124,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "3.0.3", diff --git a/package.json b/package.json index 4db3293..e1e21a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Homebridge Rainbird", "name": "homebridge-rainbird", - "version": "1.3.0", + "version": "1.4.0", "description": "The [Homebridge](https://homebridge.io) Rainbird plugin allows you to access your [Rainbird](https://rainbird.com) device(s) from HomeKit.", "author": "donavanbecker", "license": "Apache-2.0", @@ -14,7 +14,7 @@ }, "engines": { "homebridge": "^1.3.5", - "node": "^14.18.0 || ^16.10.0" + "node": "^14.18.1 || ^16.13.0" }, "main": "dist/index.js", "scripts": { @@ -44,7 +44,8 @@ "dependencies": { "@homebridge/plugin-ui-utils": "^0.0.19", "aes-js": "^3.1.2", - "node-fetch": "^2.6.2", + "axios": "^0.24.0", + "concurrent-queue": "^7.0.2", "queue": "^6.0.2", "rxjs": "^7.4.0", "text-encoder": "0.0.4" @@ -52,16 +53,17 @@ "devDependencies": { "@types/aes-js": "^3.1.1", "@types/better-queue": "^3.8.3", - "@types/node": "^16.10.3", + "@types/node": "^16.11.6", "@types/node-fetch": "^3.0.3", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "eslint": "^7.32.0", + "@typescript-eslint/eslint-plugin": "^5.2.0", + "@typescript-eslint/parser": "^5.2.0", + "eslint": "^8.1.0", "homebridge": "^1.3.5", - "nodemon": "^2.0.13", - "npm-check-updates": "^11.8.5", + "nodemon": "^2.0.14", "rimraf": "^3.0.2", - "ts-node": "^10.2.1", - "typescript": "^4.4.3" + "ts-node": "^10.4.0", + "typescript": "^4.4.4", + "typescript-axios-wb": "^1.0.3", + "npm-check-updates": "^11.8.5" } } diff --git a/src/RainBird/RainBirdClient.ts b/src/RainBird/RainBirdClient.ts index c4f51fa..36b365b 100644 --- a/src/RainBird/RainBirdClient.ts +++ b/src/RainBird/RainBirdClient.ts @@ -1,7 +1,8 @@ -import fetch from 'node-fetch'; +import axios = require('axios'); import crypto = require('crypto'); import encoder = require('text-encoder'); import aesjs = require('aes-js'); +import cq = require('concurrent-queue'); import { Logger } from 'homebridge'; import { Request } from './requests/Request'; @@ -36,6 +37,10 @@ import { AdvanceZoneRequest } from './requests/AdvanceZoneRequest'; export class RainBirdClient { private readonly RETRY_DELAY = 60; + private requestQueue = cq() + .limit({ concurrency: 1 }) + .process(this.sendRequest.bind(this)); + constructor( private readonly address: string, private readonly password: string, @@ -44,22 +49,22 @@ export class RainBirdClient { public async getModelAndVersion(): Promise { const request = new ModelAndVersionRequest(); - return await this.sendRequest(request) as ModelAndVersionResponse; + return await this.requestQueue(request) as ModelAndVersionResponse; } public async getAvailableZones(): Promise { const request = new AvailableZonesRequest(); - return await this.sendRequest(request) as AvailableZonesResponse; + return await this.requestQueue(request) as AvailableZonesResponse; } public async getSerialNumber(): Promise { const request = new SerialNumberRequest(); - return await this.sendRequest(request) as SerialNumberResponse; + return await this.requestQueue(request) as SerialNumberResponse; } public async runProgram(program: number): Promise { const request = new RunProgramRequest(program); - const response = await this.sendRequest(request); + const response = await this.requestQueue(request); return response!.type === 0 ? response as NotAcknowledgedResponse : response as AcknowledgedResponse; @@ -67,7 +72,7 @@ export class RainBirdClient { public async runZone(zone: number, duration: number): Promise { const request = new RunZoneRequest(zone, Math.round(duration / 60)); - const response = await this.sendRequest(request); + const response = await this.requestQueue(request); return response!.type === 0 ? response as NotAcknowledgedResponse : response as AcknowledgedResponse; @@ -75,7 +80,7 @@ export class RainBirdClient { public async advanceZone(): Promise { const request = new AdvanceZoneRequest(); - const response = await this.sendRequest(request); + const response = await this.requestQueue(request); return response!.type === 0 ? response as NotAcknowledgedResponse : response as AcknowledgedResponse; @@ -83,7 +88,7 @@ export class RainBirdClient { public async stopIrrigation(): Promise { const request = new StopIrrigationRequest(); - const response = await this.sendRequest(request); + const response = await this.requestQueue(request); return response!.type === 0 ? response as NotAcknowledgedResponse : response as AcknowledgedResponse; @@ -91,37 +96,37 @@ export class RainBirdClient { public async getControllerState(): Promise { const request = new ControllerStateRequest(); - return await this.sendRequest(request, false) as ControllerStateResponse; + return await this.requestQueue(request, false) as ControllerStateResponse; } public async getControllerDate(): Promise { const request = new ControllerDateRequest(); - return await this.sendRequest(request, false) as ControllerDateResponse; + return await this.requestQueue(request, false) as ControllerDateResponse; } public async getControllerTime(): Promise { const request = new ControllerTimeRequest(); - return await this.sendRequest(request, false) as ControllerTimeResponse; + return await this.requestQueue(request, false) as ControllerTimeResponse; } public async getIrrigationState(): Promise { const request = new IrrigationStateRequest(); - return await this.sendRequest(request, false) as IrrigationStateResponse; + return await this.requestQueue(request, false) as IrrigationStateResponse; } public async getRainSensorState(): Promise { const request = new RainSensorStateRequest(); - return await this.sendRequest(request, false) as RainSensorStateResponse; + return await this.requestQueue(request, false) as RainSensorStateResponse; } public async getCurrentZone(): Promise { const request = new CurrentZoneRequest(); - return await this.sendRequest(request, false) as CurrentZoneResponse; + return await this.requestQueue(request, false) as CurrentZoneResponse; } public async getCurrentZoneState(): Promise { const request = new CurrentZoneStateRequest(); - return await this.sendRequest(request, false) as CurrentZoneStateResponse; + return await this.requestQueue(request, false) as CurrentZoneStateResponse; } private async sendRequest(request: Request, retry = true): Promise { @@ -131,15 +136,16 @@ export class RainBirdClient { while (true) { try { const url = `http://${this.address}/stick`; - const body: Buffer = this.encrypt(request); - const resp = await fetch(url, this.createRequestOptions(body)); + const data: Buffer = this.encrypt(request); + const config = this.createRequestConfig(); + + const resp = await axios.default.post(url, data, config); - if (!resp.ok || resp.status !== 200) { + if (!resp.statusText || resp.status !== 200) { throw new Error(`Invalid Response [Status: ${resp.status}, Text: ${resp.statusText}]`); } - const encryptedResponse: Buffer = await resp.buffer(); - const response = this.getResponse(encryptedResponse); + const response = this.getResponse(resp.data as Buffer); return response; } catch (error) { @@ -250,10 +256,9 @@ export class RainBirdClient { }); } - private createRequestOptions(body: Buffer) { + private createRequestConfig(): axios.AxiosRequestConfig { return { - method: 'POST', - body: body, + responseType: 'arraybuffer', headers: { 'Accept-Language': 'en', 'Accept-Encoding': 'gzip, deflate', diff --git a/src/RainBird/RainBirdService.ts b/src/RainBird/RainBirdService.ts index 1f6b5c0..572721a 100644 --- a/src/RainBird/RainBirdService.ts +++ b/src/RainBird/RainBirdService.ts @@ -3,6 +3,7 @@ import Queue from 'queue'; import { Logger } from 'homebridge'; import { RainBirdClient } from './RainBirdClient'; import { debounceTime, fromEvent, Subject, Subscription, timer } from 'rxjs'; +import { AcknowledgedResponse } from './responses/AcknowledgedResponse'; type RainBirdMetaData = { model: string, @@ -14,7 +15,7 @@ type RainBirdMetaData = { type ZoneStatus = { active: boolean, running: boolean, - durationRemaining: number, + RemainingDuration: number, durationTime?: Date } @@ -34,9 +35,10 @@ export class RainBirdService extends events.EventEmitter { version: 'Unknown', serialNumber: 'Unknown', zones: [], - } + }; private _currentZoneStateSupported = true; + private _advanceZoneSupported = true; private _currentZoneId = 0; private _zones: Record = {}; private _rainSetPointReached = false; @@ -90,7 +92,7 @@ export class RainBirdService extends events.EventEmitter { this._zones[zone] = { active: false, running: false, - durationRemaining: 0, + RemainingDuration: 0, durationTime: undefined, }; } @@ -148,24 +150,24 @@ export class RainBirdService extends events.EventEmitter { : this._zones[zone].durationTime !== undefined; } - durationRemaining(zone?: number): number { + RemainingDuration(zone?: number): number { if (zone === undefined) { let remaining = 0; for (const zone of this.zones) { - remaining += this.calcDurationRemaining(zone); + remaining += this.calcRemainingDuration(zone); } return remaining; } - return this.calcDurationRemaining(zone); + return this.calcRemainingDuration(zone); } - private calcDurationRemaining(zone: number): number { + private calcRemainingDuration(zone: number): number { if (!this._zones[zone].active) { return 0; } const remaining = this._zones[zone].durationTime === undefined - ? this._zones[zone].durationRemaining - : this._zones[zone].durationRemaining - Math.round( + ? this._zones[zone].RemainingDuration + : this._zones[zone].RemainingDuration - Math.round( ((new Date()).getTime() - this._zones[zone].durationTime!.getTime()) / 1000); return Math.max(remaining, 0); @@ -184,7 +186,13 @@ export class RainBirdService extends events.EventEmitter { this._zones[zone].active = false; if (this.isInUse(zone)) { - await this._client.advanceZone(); + if (this._advanceZoneSupported) { + const response = await this._client.advanceZone(); + this._advanceZoneSupported = response instanceof AcknowledgedResponse; + } + if (!this._advanceZoneSupported) { + await this._client.stopIrrigation(); + } this._statusRefreshSubject.next(); } } @@ -232,7 +240,7 @@ export class RainBirdService extends events.EventEmitter { await this._client.runZone(zone, duration); if (!this._currentZoneStateSupported) { - this._zones[zone].durationRemaining = duration; + this._zones[zone].RemainingDuration = duration; this._zones[zone].durationTime = new Date(); } @@ -248,11 +256,11 @@ export class RainBirdService extends events.EventEmitter { let timerDuration = this.options.refreshRate ?? 0; if (this._currentZoneId !== 0) { - const durationRemaining = this._zones[this._currentZoneId].durationRemaining; - if (durationRemaining > 0) { + const RemainingDuration = this._zones[this._currentZoneId].RemainingDuration; + if (RemainingDuration > 0) { timerDuration = timerDuration === 0 - ? durationRemaining - : Math.min(timerDuration, durationRemaining); + ? RemainingDuration + : Math.min(timerDuration, RemainingDuration); } } @@ -308,10 +316,10 @@ export class RainBirdService extends events.EventEmitter { zone.active = true; zone.running = true; if (this._currentZoneStateSupported) { - zone.durationRemaining = status.timeRemaining; + zone.RemainingDuration = status.timeRemaining; zone.durationTime = new Date(); } else if (zone.durationTime === undefined) { - zone.durationRemaining = 0; + zone.RemainingDuration = 0; zone.durationTime = new Date(); } continue; @@ -321,7 +329,7 @@ export class RainBirdService extends events.EventEmitter { zone.active = false; } zone.running = false; - zone.durationRemaining = 0; + zone.RemainingDuration = 0; zone.durationTime = undefined; } diff --git a/src/devices/ContactSensor.ts b/src/devices/ContactSensor.ts new file mode 100644 index 0000000..04a92e7 --- /dev/null +++ b/src/devices/ContactSensor.ts @@ -0,0 +1,91 @@ +import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge'; +import { RainbirdPlatform } from '../platform'; +import { RainBirdService } from '../RainBird/RainBirdService'; +import { fromEvent } from 'rxjs'; +import { DevicesConfig } from '../settings'; + +/** + * Platform Accessory + * An instance of this class is created for each accessory your platform registers + * Each accessory may expose multiple services of different service types. + */ +export class ContactSensor { + private contactSensor!: { + service: Service, + state: CharacteristicValue + }; + + constructor( + private readonly platform: RainbirdPlatform, + private accessory: PlatformAccessory, + public device: DevicesConfig, + public rainbird: RainBirdService, + ) { + // Set accessory information + accessory + .getService(this.platform.Service.AccessoryInformation)! + .setCharacteristic(this.platform.Characteristic.Manufacturer, 'RainBird') + .setCharacteristic(this.platform.Characteristic.Model, accessory.context.model ?? rainbird!.model) + .setCharacteristic(this.platform.Characteristic.SerialNumber, accessory.context.deviceID ?? rainbird!.serialNumber) + .setCharacteristic(this.platform.Characteristic.FirmwareRevision, accessory.context.FirmwareRevision ?? rainbird!.version) + .getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory.context.FirmwareRevision); + + // Contact Sensor Service + const name = `Zone ${accessory.context.zoneId}`; + this.platform.device(`Load Contact Sensor Service for ${name}`); + this.contactSensor = { + service: this.accessory.getService(this.platform.Service.ContactSensor) ?? + this.accessory.addService(this.platform.Service.ContactSensor), + state: this.platform.Characteristic.ContactSensorState.CONTACT_DETECTED, + }; + + // Add Contact Sensor's Characteristics + this.contactSensor.service + .setCharacteristic(this.platform.Characteristic.ContactSensorState, this.platform.Characteristic.ContactSensorState.CONTACT_DETECTED) + .setCharacteristic(this.platform.Characteristic.Name, name) + .setCharacteristic(this.platform.Characteristic.StatusFault, this.platform.Characteristic.StatusFault.NO_FAULT); + + this.contactSensor.service.getCharacteristic(this.platform.Characteristic.ContactSensorState) + .onGet(() => { + this.rainbird!.refreshStatus(); + return this.contactSensor.state; + }); + + // Initial Device Parse + this.parseStatus(); + this.updateHomeKitCharacteristics(); + + // Device Parse when status event emitted + fromEvent(rainbird!, 'status').subscribe({ + next: () => { + this.parseStatus(); + this.updateHomeKitCharacteristics(); + }, + }); + } + + /** + * Parse the device status from the RainbirdClient + */ + parseStatus() { + this.contactSensor.state = this.rainbird!.isInUse(this.accessory.context.zoneId) + ? this.platform.Characteristic.ContactSensorState.CONTACT_NOT_DETECTED + : this.platform.Characteristic.ContactSensorState.CONTACT_DETECTED; + this.platform.debug(`Contact Sensor: ${this.accessory.context.zoneId}, ContactSensorState: ${this.contactSensor.state}`); + } + + /** + * Updates the status for each of the HomeKit Characteristics + */ + updateHomeKitCharacteristics() { + // Valves + if (this.contactSensor.state === undefined) { + this.platform.debug( + `Contact Sensor ${this.accessory.displayName} ContactSensorState: ${this.contactSensor.state}, ${this.accessory.context.zoneId}`); + } else { + this.contactSensor.service.updateCharacteristic(this.platform.Characteristic.ContactSensorState, this.contactSensor.state); + this.platform.device( + `Contact Sensor ${this.accessory.displayName} ContactSensorState: ${this.contactSensor.state}, ${this.accessory.context.zoneId}`); + } + } +} diff --git a/src/devices/irrigationsystem.ts b/src/devices/IrrigationSystem.ts similarity index 59% rename from src/devices/irrigationsystem.ts rename to src/devices/IrrigationSystem.ts index 1370076..1a16d58 100644 --- a/src/devices/irrigationsystem.ts +++ b/src/devices/IrrigationSystem.ts @@ -1,8 +1,8 @@ import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge'; import { RainbirdPlatform } from '../platform'; import { RainBirdService } from '../RainBird/RainBirdService'; -import { Subject, fromEvent } from 'rxjs'; -import { debounceTime, tap } from 'rxjs/operators'; +import { Subject, fromEvent, interval } from 'rxjs'; +import { debounceTime, skipWhile, tap } from 'rxjs/operators'; import { DevicesConfig } from '../settings'; /** @@ -14,17 +14,17 @@ export class IrrigationSystem { private irrigation!: { service: Service, - active: CharacteristicValue, - inUse: CharacteristicValue, - } + Active: CharacteristicValue, + InUse: CharacteristicValue, + }; private valves: Map = new Map() + Active: CharacteristicValue, + InUse: CharacteristicValue, + SetDuration: number, + IsConfigured: CharacteristicValue; + }> = new Map(); // Irrigation System Updates private irrigationSystemUpdateInProgress!: boolean; @@ -40,6 +40,13 @@ export class IrrigationSystem { this.doIrrigationSystemUpdate = new Subject(); this.irrigationSystemUpdateInProgress = false; + if (accessory.context.configured === undefined) { + accessory.context.configured = {}; + } + if (accessory.context.duration === undefined) { + accessory.context.duration = {}; + } + // Set accessory information accessory .getService(this.platform.Service.AccessoryInformation)! @@ -54,15 +61,15 @@ export class IrrigationSystem { this.irrigation = { service: this.accessory.getService(this.platform.Service.IrrigationSystem) ?? this.accessory.addService(this.platform.Service.IrrigationSystem), - active: this.platform.Characteristic.Active.ACTIVE, - inUse: this.platform.Characteristic.InUse.NOT_IN_USE, + Active: this.platform.Characteristic.Active.ACTIVE, + InUse: this.platform.Characteristic.InUse.NOT_IN_USE, }; // Add Irrigation Service's Characteristics this.irrigation.service .setCharacteristic(this.platform.Characteristic.Name, accessory.displayName) - .setCharacteristic(this.platform.Characteristic.Active, this.irrigation.active) - .setCharacteristic(this.platform.Characteristic.InUse, this.irrigation.inUse) + .setCharacteristic(this.platform.Characteristic.Active, this.irrigation.Active) + .setCharacteristic(this.platform.Characteristic.InUse, this.irrigation.InUse) .setCharacteristic(this.platform.Characteristic.ProgramMode, this.platform.Characteristic.ProgramMode.NO_PROGRAM_SCHEDULED) .setCharacteristic(this.platform.Characteristic.RemainingDuration, 0) .setCharacteristic(this.platform.Characteristic.StatusFault, this.platform.Characteristic.StatusFault.NO_FAULT); @@ -71,7 +78,7 @@ export class IrrigationSystem { this.irrigation.service.getCharacteristic(this.platform.Characteristic.Active) .onGet(() => { this.rainbird!.refreshStatus(); - return this.irrigation.active; + return this.irrigation.Active; }) .onSet(this.setActive.bind(this)); @@ -83,7 +90,7 @@ export class IrrigationSystem { this.irrigation.service.getCharacteristic(this.platform.Characteristic.InUse) .onGet(() => { this.rainbird!.refreshStatus(); - return this.irrigation.inUse; + return this.irrigation.InUse; }); this.irrigation.service.getCharacteristic(this.platform.Characteristic.StatusFault) @@ -94,44 +101,44 @@ export class IrrigationSystem { this.irrigation.service.getCharacteristic(this.platform.Characteristic.RemainingDuration) .onGet(() => { this.rainbird!.refreshStatus(); - return this.rainbird!.durationRemaining(); + return this.rainbird!.RemainingDuration(); }); // Valves for zones for (const zone of rainbird!.zones) { const name = `Zone ${zone}`; - this.platform.debug(`Load Valve Service for ${name}`); + this.platform.device(`Load Valve Service for ${name}`); this.valves.set(zone, { service: this.accessory.getService(name) ?? this.accessory.addService(this.platform.Service.Valve, name, zone), - active: this.platform.Characteristic.Active.INACTIVE as CharacteristicValue, - inUse: this.platform.Characteristic.InUse.NOT_IN_USE as CharacteristicValue, - setDuration: 300, - isConfigured: this.platform.Characteristic.IsConfigured.CONFIGURED, + Active: this.platform.Characteristic.Active.INACTIVE as CharacteristicValue, + InUse: this.platform.Characteristic.InUse.NOT_IN_USE as CharacteristicValue, + SetDuration: this.accessory.context.duration[zone] ?? 300, + IsConfigured: this.accessory.context.configured[zone] ?? this.platform.Characteristic.IsConfigured.CONFIGURED, }); // Add Valve Service's Characteristics this.valves.get(zone)!.service .setCharacteristic(this.platform.Characteristic.Name, name) - .setCharacteristic(this.platform.Characteristic.Active, this.valves.get(zone)!.active) - .setCharacteristic(this.platform.Characteristic.InUse, this.valves.get(zone)!.inUse) + .setCharacteristic(this.platform.Characteristic.Active, this.valves.get(zone)!.Active) + .setCharacteristic(this.platform.Characteristic.InUse, this.valves.get(zone)!.InUse) .setCharacteristic(this.platform.Characteristic.ValveType, this.platform.Characteristic.ValveType.IRRIGATION) - .setCharacteristic(this.platform.Characteristic.SetDuration, this.valves.get(zone)!.setDuration) + .setCharacteristic(this.platform.Characteristic.SetDuration, this.valves.get(zone)!.SetDuration) .setCharacteristic(this.platform.Characteristic.RemainingDuration, 0) - .setCharacteristic(this.platform.Characteristic.IsConfigured, this.valves.get(zone)!.isConfigured) + .setCharacteristic(this.platform.Characteristic.IsConfigured, this.valves.get(zone)!.IsConfigured) .setCharacteristic(this.platform.Characteristic.ServiceLabelIndex, zone) .setCharacteristic(this.platform.Characteristic.StatusFault, this.platform.Characteristic.StatusFault.NO_FAULT); this.irrigation.service.addLinkedService(this.valves.get(zone)!.service); // Create handlers for required Valve characteristics - this.platform.debug(`Configure Characteristics for ${name}`); + this.platform.device(`Configure Characteristics for ${name}`); this.valves.get(zone)!.service .getCharacteristic(this.platform.Characteristic.Active) .onGet(() => { this.rainbird!.refreshStatus(); - return this.valves.get(zone)!.active; + return this.valves.get(zone)!.Active; }) .onSet(this.setValveActive.bind(this, zone)); @@ -139,7 +146,7 @@ export class IrrigationSystem { .getCharacteristic(this.platform.Characteristic.InUse) .onGet(() => { this.rainbird!.refreshStatus(); - return this.valves.get(zone)!.inUse; + return this.valves.get(zone)!.InUse; }); this.valves.get(zone)!.service @@ -164,7 +171,7 @@ export class IrrigationSystem { this.valves.get(zone)!.service .getCharacteristic(this.platform.Characteristic.SetDuration) .onGet(() => { - return Number(this.valves.get(zone)!.setDuration); + return Number(this.valves.get(zone)!.SetDuration); }) .onSet(this.setValveSetDuration.bind(this, zone)); @@ -172,7 +179,7 @@ export class IrrigationSystem { .getCharacteristic(this.platform.Characteristic.RemainingDuration) .onGet(() => { this.rainbird!.refreshStatus(); - return this.rainbird!.durationRemaining(zone); + return this.rainbird!.RemainingDuration(zone); }); } @@ -188,6 +195,13 @@ export class IrrigationSystem { }, }); + // Start an update interval + interval(this.platform.config.options!.refreshRate! * 1000) + .pipe(skipWhile(() => this.irrigationSystemUpdateInProgress)) + .subscribe(() => { + this.rainbird!.refreshStatus(); + }); + this.doIrrigationSystemUpdate .pipe( tap(() => { @@ -211,26 +225,27 @@ export class IrrigationSystem { */ parseStatus() { // Irrigation System - this.irrigation.active = this.rainbird!.isActive() + this.irrigation.Active = this.rainbird!.isActive() ? this.platform.Characteristic.Active.ACTIVE : this.platform.Characteristic.Active.INACTIVE; - this.irrigation.inUse = this.rainbird!.isInUse() + this.irrigation.InUse = this.rainbird!.isInUse() ? this.platform.Characteristic.InUse.IN_USE : this.platform.Characteristic.InUse.NOT_IN_USE; this.platform.debug( - `Irrigation System: ${this.accessory.displayName}, Active: ${this.irrigation.active}, InUse: ${this.irrigation.inUse}`); + `Irrigation System: ${this.accessory.displayName}, Active: ${this.irrigation.Active}, InUse: ${this.irrigation.InUse}`); // Valves for (const [zone, valve] of this.valves.entries()) { - valve.active = this.rainbird!.isActive(zone) + valve.Active = this.rainbird!.isActive(zone) ? this.platform.Characteristic.Active.ACTIVE : this.platform.Characteristic.Active.INACTIVE; - valve.inUse = this.rainbird!.isInUse(zone) + valve.InUse = this.rainbird!.isInUse(zone) ? this.platform.Characteristic.InUse.IN_USE : this.platform.Characteristic.InUse.NOT_IN_USE; - this.platform.debug(`Valve: ${zone}, Active: ${valve.active}, InUse: ${valve.inUse}`); + + this.platform.debug(`Valve: ${zone}, Active: ${valve.Active}, InUse: ${valve.InUse}`); } } @@ -239,31 +254,57 @@ export class IrrigationSystem { */ updateHomeKitCharacteristics() { // Irrigation System - if (this.irrigation.active !== undefined) { - this.irrigation.service.updateCharacteristic(this.platform.Characteristic.Active, this.irrigation.active); + if (this.irrigation.Active === undefined) { + this.platform.debug(`Irrigation ${this.accessory.displayName} Active: ${this.irrigation.Active}`); + } else { + this.irrigation.service.updateCharacteristic(this.platform.Characteristic.Active, this.irrigation.Active); + this.platform.device(`Irrigation ${this.accessory.displayName} updateCharacteristic Active: ${this.irrigation.Active}`); + } + if (this.irrigation.InUse === undefined) { + this.platform.debug(`Irrigation ${this.accessory.displayName} InUse: ${this.irrigation.InUse}`); + } else { + this.irrigation.service.updateCharacteristic(this.platform.Characteristic.InUse, this.irrigation.InUse); + this.platform.device(`Irrigation ${this.accessory.displayName} updateCharacteristic InUse: ${this.irrigation.InUse}`); } - if (this.irrigation.inUse !== undefined) { - this.irrigation.service.updateCharacteristic(this.platform.Characteristic.InUse, this.irrigation.inUse); + if (this.rainbird!.RemainingDuration() === undefined) { + this.platform.debug(`Irrigation ${this.accessory.displayName} RemainingDuration: ${this.rainbird!.RemainingDuration()}`); + } else { + this.irrigation.service.updateCharacteristic(this.platform.Characteristic.RemainingDuration, this.rainbird!.RemainingDuration()); + this.platform.device(`Irrigation ${this.accessory.displayName} updateCharacteristic RemainingDuration: ${this.rainbird!.RemainingDuration()}`); } - this.irrigation.service.updateCharacteristic(this.platform.Characteristic.RemainingDuration, - this.rainbird!.durationRemaining()); // Valves for (const [zone, valve] of this.valves.entries()) { - if (valve.active !== undefined) { - valve.service.updateCharacteristic(this.platform.Characteristic.Active, valve.active); + if (valve.Active === undefined) { + this.platform.debug(`Valve ${this.accessory.displayName} Active: ${valve.Active}`); + } else { + valve.service.updateCharacteristic(this.platform.Characteristic.Active, valve.Active); + this.platform.device(`Valve ${this.accessory.displayName} updateCharacteristic Active: ${valve.Active}`); } - if (valve.inUse !== undefined) { - valve.service.updateCharacteristic(this.platform.Characteristic.InUse, valve.inUse); + if (valve.InUse === undefined) { + this.platform.debug(`Valve ${this.accessory.displayName} InUse: ${valve.InUse}`); + } else { + valve.service.updateCharacteristic(this.platform.Characteristic.InUse, valve.InUse); + this.platform.device(`Valve ${this.accessory.displayName} updateCharacteristic InUse: ${valve.InUse}`); } - if (valve.setDuration !== undefined) { - valve.service.updateCharacteristic(this.platform.Characteristic.SetDuration, valve.setDuration); + if (valve.SetDuration === undefined) { + this.platform.debug(`Valve ${this.accessory.displayName} SetDuration: ${valve.InUse}`); + } else { + valve.service.updateCharacteristic(this.platform.Characteristic.SetDuration, valve.SetDuration); + this.platform.device(`Valve ${this.accessory.displayName} updateCharacteristic SetDuration: ${valve.SetDuration}`); } - if (valve.isConfigured !== undefined) { - valve.service.updateCharacteristic(this.platform.Characteristic.IsConfigured, valve.isConfigured); + if (valve.IsConfigured === undefined) { + this.platform.debug(`Valve ${this.accessory.displayName} IsConfigured: ${valve.IsConfigured}`); + } else { + valve.service.updateCharacteristic(this.platform.Characteristic.IsConfigured, valve.IsConfigured); + this.platform.device(`Valve ${this.accessory.displayName} updateCharacteristic IsConfigured: ${valve.IsConfigured}`); + } + if (this.rainbird!.RemainingDuration(zone) === undefined) { + this.platform.debug(`Valve ${this.accessory.displayName} RemainingDuration: ${this.rainbird!.RemainingDuration(zone)}`); + } else { + valve.service.updateCharacteristic(this.platform.Characteristic.RemainingDuration, this.rainbird!.RemainingDuration(zone)); + this.platform.device(`Valve ${this.accessory.displayName} updateCharacteristic RemainingDuration: ${this.rainbird!.RemainingDuration(zone)}`); } - valve.service.updateCharacteristic(this.platform.Characteristic.RemainingDuration, - this.rainbird!.durationRemaining(zone)); } } @@ -271,36 +312,36 @@ export class IrrigationSystem { * Pushes the requested changes to the RainbirdClient */ async pushChanges(zone: number): Promise { - if (this.valves.get(zone)!.active === this.platform.Characteristic.Active.ACTIVE) { - this.rainbird!.activateZone(zone, this.valves.get(zone)!.setDuration); + if (this.valves.get(zone)!.Active === this.platform.Characteristic.Active.ACTIVE) { + this.rainbird!.activateZone(zone, this.valves.get(zone)!.SetDuration); } else { await this.rainbird!.deactivateZone(zone); } - this.platform.debug(`Irrigation System ${this.accessory.displayName}, - pushChanges: [Valve: ${zone}, Active: ${this.valves.get(zone)!.active}, SetDuration: ${this.valves.get(zone)!.setDuration}]`); + this.platform.device(`Irrigation System ${this.accessory.displayName}, pushChanges: [Valve: ${zone},` + + ` Active: ${this.valves.get(zone)!.Active}, SetDuration: ${this.valves.get(zone)!.SetDuration}]`); } private setActive(value: CharacteristicValue) { - this.platform.debug(`Irrigation System ${this.accessory.displayName}, Set Active: ${value}`); - this.irrigation.active = value; + this.platform.device(`Irrigation System ${this.accessory.displayName}, Set Active: ${value}`); + this.irrigation.Active = value; } private setValveActive(zone: number, value: CharacteristicValue) { - this.platform.debug(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set Active: ${value}`); - this.valves.get(zone)!.active = value; + this.platform.device(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set Active: ${value}`); + this.valves.get(zone)!.Active = value; this.doIrrigationSystemUpdate.next(zone); } private setValveIsConfigured(zone: number, value: CharacteristicValue) { - this.platform.debug(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set IsConfigured: ${value}`); - this.valves.get(zone)!.isConfigured = value; - this.doIrrigationSystemUpdate.next(zone); + this.platform.device(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set IsConfigured: ${value}`); + this.valves.get(zone)!.IsConfigured = value; + this.accessory.context.configured[zone] = value; } private setValveSetDuration(zone: number, value: CharacteristicValue) { - this.platform.debug(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set SetDuration: ${value}`); - this.valves.get(zone)!.setDuration = value as number; - this.doIrrigationSystemUpdate.next(zone); + this.platform.device(`Irrigation System ${this.accessory.displayName}, Valve: ${zone}, Set SetDuration: ${value}`); + this.valves.get(zone)!.SetDuration = value as number; + this.accessory.context.duration[zone] = value; } } diff --git a/src/devices/LeakSensor.ts b/src/devices/LeakSensor.ts index 9b1fd0a..c7f524d 100644 --- a/src/devices/LeakSensor.ts +++ b/src/devices/LeakSensor.ts @@ -7,8 +7,8 @@ import { DevicesConfig } from '../settings'; export class LeakSensor { private leakSensor!: { service: Service, - leakDetected: CharacteristicValue - } + LeakDetected: CharacteristicValue + }; constructor( private readonly platform: RainbirdPlatform, @@ -29,23 +29,23 @@ export class LeakSensor { .getCharacteristic(this.platform.Characteristic.FirmwareRevision).updateValue(accessory.context.FirmwareRevision); // Leak Sensor Service - this.platform.debug('Configure Leak Sensor Service'); + this.platform.device('Configure Leak Sensor Service'); this.leakSensor = { service: this.accessory.getService(this.platform.Service.LeakSensor) ?? this.accessory.addService(this.platform.Service.LeakSensor), - leakDetected: this.platform.Characteristic.LeakDetected.LEAK_NOT_DETECTED, + LeakDetected: this.platform.Characteristic.LeakDetected.LEAK_NOT_DETECTED, }; // Add Leak Sensor's Characteristics this.leakSensor.service .setCharacteristic(this.platform.Characteristic.LeakDetected, this.platform.Characteristic.LeakDetected.LEAK_NOT_DETECTED) - .setCharacteristic(this.platform.Characteristic.Name, model) + .setCharacteristic(this.platform.Characteristic.Name, `${model} Leak Sensor`) .setCharacteristic(this.platform.Characteristic.StatusFault, this.platform.Characteristic.StatusFault.NO_FAULT); this.leakSensor.service.getCharacteristic(this.platform.Characteristic.LeakDetected) .onGet(() => { this.rainbird!.refreshStatus(); - return this.leakSensor.leakDetected; + return this.leakSensor.LeakDetected; }); // Initial Device Parse @@ -62,14 +62,17 @@ export class LeakSensor { } parseStatus() { - this.leakSensor.leakDetected = this.rainbird!.rainSetPointReached + this.leakSensor.LeakDetected = this.rainbird!.rainSetPointReached ? this.platform.Characteristic.LeakDetected.LEAK_DETECTED : this.platform.Characteristic.LeakDetected.LEAK_NOT_DETECTED; } updateHomeKitCharacteristics() { - if (this.leakSensor.leakDetected !== undefined) { - this.leakSensor.service.updateCharacteristic(this.platform.Characteristic.LeakDetected, this.leakSensor.leakDetected); + if (this.leakSensor.LeakDetected === undefined) { + this.platform.debug(`Leak Sensor ${this.accessory.displayName} LeakDetected: ${this.leakSensor.LeakDetected}`); + } else { + this.leakSensor.service.updateCharacteristic(this.platform.Characteristic.LeakDetected, this.leakSensor.LeakDetected); + this.platform.device(`Leak Sensor ${this.accessory.displayName} updateCharacteristic LeakDetected: ${this.leakSensor.LeakDetected}`); } } } \ No newline at end of file diff --git a/src/platform.ts b/src/platform.ts index cdc92ab..a530e22 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -6,7 +6,8 @@ import { RainbirdPlatformConfig, DevicesConfig, } from './settings'; -import { IrrigationSystem } from './devices/irrigationsystem'; +import { IrrigationSystem } from './devices/IrrigationSystem'; +import { ContactSensor } from './devices/ContactSensor'; import { LeakSensor } from './devices/LeakSensor'; /** @@ -21,11 +22,9 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { // this is used to track restored cached accessories public readonly accessories: PlatformAccessory[] = []; - version = require('../package.json').version // eslint-disable-line @typescript-eslint/no-var-requires + version = require('../package.json').version; // eslint-disable-line @typescript-eslint/no-var-requires public sensorData = []; - debugMode!: boolean; - rainbirdDebugMode!: boolean; constructor(public readonly log: Logger, public readonly config: RainbirdPlatformConfig, public readonly api: API) { this.debug('Finished initializing platform:', this.config.name); @@ -50,8 +49,6 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { return; } - this.debugMode = process.argv.includes('-D') || process.argv.includes('--debug'); - // When this event is fired it means Homebridge has restored all cached accessories from disk. // Dynamic Platform plugins should only register new accessories after this event was fired, // in order to ensure they weren't added to homebridge already. This event can also be used @@ -82,7 +79,10 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { * Verify the config passed to the plugin is valid */ verifyConfig() { - this.config.disablePlugin; + this.config.options?.debug; + this.config.disablePlugin = this.config.disablePlugin || false; + this.config.showRainSensor = this.config.showRainSensor || false; + this.config.showValveSensor = this.config.showValveSensor || false; if (this.config.devices) { for (const device of this.config.devices!) { @@ -106,18 +106,13 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { if (!this.config.options.refreshRate && !this.config.disablePlugin) { // default 300 seconds (5 minutes) this.config.options!.refreshRate! = 300; - if (this.debugMode) { - this.log.warn('Using Default Refresh Rate.'); - } + this.device('Using Default Refresh Rate.'); } if (!this.config.options.pushRate && !this.config.disablePlugin) { // default 100 milliseconds this.config.options!.pushRate! = 0.1; - if (this.debugMode) { - this.log.warn('Using Default Push Rate.'); - } - + this.device('Using Default Push Rate.'); } } @@ -133,17 +128,16 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { log: this.log, }); const metaData = await rainbird!.init(); + this.debug(JSON.stringify(metaData)); // Display device details - this.log.info( - 'Model: %s, [Version: %s, Serial Number: %s, Zones: %s]', - metaData.model, - metaData.version, - metaData.serialNumber, - JSON.stringify(metaData.zones), - ); + this.log.info(`Model: ${metaData.model}, [Version: ${metaData.version}, Serial Number: ${metaData.serialNumber},` + + ` Zones: ${JSON.stringify(metaData.zones)}]`); this.createIrrigationSystem(device, rainbird); this.createLeakSensor(device, rainbird); + for(const zoneId of metaData.zones) { + this.createContactSensor(device, rainbird, zoneId); + } } } @@ -156,12 +150,10 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { if (existingAccessory) { // the accessory already exists if (!this.config.disablePlugin) { - this.log.info( - 'Restoring existing accessory from cache: %s', - existingAccessory.displayName, - ); + this.log.info(`Restoring existing accessory from cache: ${existingAccessory.displayName}`); // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.: + existingAccessory.displayName = rainbird!.model; existingAccessory.context.device = device; existingAccessory.context.deviceID = rainbird!.serialNumber; existingAccessory.context.model = rainbird!.model; @@ -170,19 +162,13 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { // create the accessory handler for the restored accessory // this is imported from `platformAccessory.ts` new IrrigationSystem(this, existingAccessory, device, rainbird); - if (this.debugMode) { - this.log.warn(`Irrigation System UDID: ${device.ipaddress}-${rainbird!.model}-${rainbird!.serialNumber}`); - } - + this.device(`Irrigation System uuid: ${device.ipaddress}-${rainbird!.model}-${rainbird!.serialNumber}, (${existingAccessory.UUID})`); } else { this.unregisterPlatformAccessories(existingAccessory); } } else if (!this.config.disablePlugin) { // the accessory does not yet exist, so we need to create it - this.log.info( - 'Adding new accessory: %s', - rainbird!.model, - ); + this.log.info(`Adding new accessory: ${rainbird!.model}`); // create a new accessory const accessory = new this.api.platformAccessory(rainbird!.model, uuid); @@ -196,18 +182,15 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { // create the accessory handler for the newly create accessory // this is imported from `platformAccessory.ts` new IrrigationSystem(this, accessory, device, rainbird); - if (this.debugMode) { - this.log.warn(`Irrigation System UDID: ${device.ipaddress}-${rainbird!.model}-${rainbird!.serialNumber}`); - } + this.device(`Irrigation System uuid: ${device.ipaddress}-${rainbird!.model}-${rainbird!.serialNumber}, (${accessory.UUID})`); // link the accessory to your platform this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]); this.accessories.push(accessory); - } else if (this.debugMode) { - this.log.error( - 'Unable to Register new device: %s', - rainbird!.model, - ); + } else { + if (this.config.options?.debug === 'debug') { + this.log.error(`Unable to Register new device: ${rainbird!.model}`); + } } } @@ -221,9 +204,10 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { if (existingAccessory) { // the accessory already exists if (!this.config.disablePlugin && device.showRainSensor) { - this.log.info(`Restoring existing accessory from cache: ${model}`); + this.log.info(`Restoring existing accessory from cache: ${existingAccessory.displayName}`); // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.: + existingAccessory.displayName = model; existingAccessory.context.device = device; existingAccessory.context.deviceID = rainbird!.serialNumber; existingAccessory.context.model = model; @@ -232,9 +216,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { // create the accessory handler for the restored accessory // this is imported from `platformAccessory.ts` new LeakSensor(this, existingAccessory, device, rainbird); - if (this.debugMode) { - this.log.warn(`Leak Sensor UDID: ${device.ipaddress}-${model}-${rainbird!.serialNumber}`); - } + this.device(`Leak Sensor uuid: ${device.ipaddress}-${model}-${rainbird!.serialNumber}, (${existingAccessory.UUID})`); } else { this.unregisterPlatformAccessories(existingAccessory); @@ -255,15 +237,72 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { // create the accessory handler for the newly create accessory // this is imported from `platformAccessory.ts` new LeakSensor(this, accessory, device, rainbird); - if (this.debugMode) { - this.log.warn(`Leak Sensor UDID: ${device.ipaddress}-${model}-${rainbird!.serialNumber}`); + this.device(`Leak Sensor uuid: ${device.ipaddress}-${model}-${rainbird!.serialNumber}, (${accessory.UUID})`); + + // link the accessory to your platform + this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]); + this.accessories.push(accessory); + } else { + if (this.config.options?.debug === 'debug' && device.showRainSensor) { + this.log.error(`Unable to Register new device: ${model}`); + } + } + } + + createContactSensor(device: DevicesConfig, rainbird: RainBirdService, zoneId: number): void { + const model = `${rainbird!.model}-${zoneId}`; + const uuid = this.api.hap.uuid.generate(`${device.ipaddress}-${model}-${rainbird!.serialNumber}`); + // see if an accessory with the same uuid has already been registered and restored from + // the cached devices we stored in the `configureAccessory` method above + const existingAccessory = this.accessories.find((accessory) => accessory.UUID === uuid); + + if (existingAccessory) { + // the accessory already exists + if (!this.config.disablePlugin && device.showValveSensor) { + this.log.info(`Restoring existing accessory from cache: ${existingAccessory.displayName}`); + + // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.: + existingAccessory.displayName = model; + existingAccessory.context.device = device; + existingAccessory.context.deviceID = rainbird!.serialNumber; + existingAccessory.context.model = model; + existingAccessory.context.FirmwareRevision = rainbird!.version; + existingAccessory.context.zoneId = zoneId; + this.api.updatePlatformAccessories([existingAccessory]); + // create the accessory handler for the restored accessory + // this is imported from `platformAccessory.ts` + new ContactSensor(this, existingAccessory, device, rainbird); + this.device(`Contact Sensor uuid: ${device.ipaddress}-${model}-${rainbird!.serialNumber}, (${existingAccessory.UUID})`); + + } else { + this.unregisterPlatformAccessories(existingAccessory); } + } else if (!this.config.disablePlugin && device.showValveSensor) { + // the accessory does not yet exist, so we need to create it + this.log.info(`Adding new accessory: ${model}`); + + // create a new accessory + const accessory = new this.api.platformAccessory(model, uuid); + + // store a copy of the device object in the `accessory.context` + // the `context` property can be used to store any data about the accessory you may need + accessory.context.device = device; + accessory.context.deviceID = rainbird!.serialNumber; + accessory.context.model = model; + accessory.context.FirmwareRevision = rainbird!.version; + accessory.context.zoneId = zoneId; + // create the accessory handler for the newly create accessory + // this is imported from `platformAccessory.ts` + new ContactSensor(this, accessory, device, rainbird); + this.device(`Contact Sensor uuid: ${device.ipaddress}-${model}-${rainbird!.serialNumber}, (${accessory.UUID})`); // link the accessory to your platform this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]); this.accessories.push(accessory); - } else if (this.debugMode && device.showRainSensor) { - this.log.error(`Unable to Register new device: ${model}`); + } else { + if (this.config.options?.debug === 'debug' && device.showValveSensor) { + this.log.error(`Unable to Register new device: ${rainbird!.model}-${zoneId}`); + } } } @@ -276,11 +315,24 @@ export class RainbirdPlatform implements DynamicPlatformPlugin { /** * If debug level logging is turned on, log to log.info * Otherwise send debug logs to log.debug + * this.debugMode = process.argv.includes('-D') || process.argv.includes('--debug'); */ debug(...log: any[]) { - if (this.config.options?.debug) { + if (this.config.options!.debug === 'debug') { this.log.info('[DEBUG]', String(...log)); - } else{ + } else { + this.log.debug(String(...log)); + } + } + + /** + * If device level logging is turned on, log to log.warn + * Otherwise send debug logs to log.debug + */ + device(...log: any[]) { + if (this.config.options!.debug === 'device') { + this.log.warn('[DEVICE]', String(...log)); + } else { this.log.debug(String(...log)); } } diff --git a/src/settings.ts b/src/settings.ts index 6a3ee62..0151ee2 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -20,11 +20,12 @@ export type DevicesConfig = { ipaddress?: IPAddress; password?: string; showRainSensor?: boolean; + showValveSensor?: boolean; }; export type options = { refreshRate?: number; pushRate?: number; hide_device: string[]; - debug?: boolean; + debug?: string; };