From b4c8d8aec936a065a565c5c7666172b66378d26e Mon Sep 17 00:00:00 2001 From: Martin Buchleitner Date: Fri, 30 Sep 2022 09:17:14 +0200 Subject: [PATCH] fix: eslint/prettier combination also with github actions --- .eslintrc.yml | 1 + .github/workflows/ci.yml | 40 +- CHANGELOG.md | 186 ++-- README.md | 24 +- alexa/alexa-helper.js | 38 +- alexa/alexa-home-controller.js | 882 ++++++++++-------- alexa/alexa-home.js | 200 ++-- alexa/alexa-hub.js | 273 +++--- docker-package.json | 3 - package-lock.json | 1578 +++++++++++++++++--------------- package.json | 13 +- scripts/lint.sh | 8 - test/controller_spec.js | 157 ++-- test/home_spec.js | 97 +- 14 files changed, 1863 insertions(+), 1637 deletions(-) delete mode 100644 docker-package.json delete mode 100755 scripts/lint.sh diff --git a/.eslintrc.yml b/.eslintrc.yml index 54e79ed..460f006 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -4,6 +4,7 @@ env: es2021: true extends: - standard + - prettier parserOptions: ecmaVersion: latest rules: {} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be9cabf..5bcd214 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,24 +15,36 @@ jobs: matrix: node: [14,16] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - uses: actions/checkout@master - - name: Shell Linter - uses: azohra/shell-linter@v0.3.0 - - name: Cache node_modules - id: cache-modules + + - name: Cache node modules + id: cache uses: actions/cache@v1 with: - path: node_modules - key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }} - - name: install check deps - run: npm install npm-check mocha eslint - - name: eslint - run: ./scripts/lint.sh - - run: npm ci + path: node_modules # npm cache files are stored in `~/.npm` on Linux/macOS + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Prettier + run: npm run fmt:check + + - name: ESlint + run: npm run eslint:github-action + + - name: Shell Linter + uses: azohra/shell-linter@v0.3.0 + # - run: npm test release: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index c302de4..b8c443f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,285 +1,262 @@ + # [v2.0.1](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v2.0.1) - 27 Sep 2022 ## 2.0.1 (2022-09-27) #### Bug Fixes -* #113 ip detection seperated to single function and refactored (#118) (a7c5c36f) - - +- #113 ip detection seperated to single function and refactored (#118) (a7c5c36f) [Changes][v2.0.1] - + # [v2.0.0](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v2.0.0) - 28 Jun 2022 ## 2.0.0 (2022-06-28) #### Breaking Changes -* use nodered http endpoint for alexa as option (#111) (94296626) +- use nodered http endpoint for alexa as option (#111) (94296626) + ``` * feat: use nodered http endpoint for alexa as option if nodered runs on port80 -* include pr #108 - +* include pr #108 - BREAKING CHANGE: API v1 conform implementation breaks detection of nodes - so there will be duplicates if you do not remove the previous ones! ``` - - [Changes][v2.0.0] - + # [v1.4.3](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.4.3) - 08 Oct 2021 ## 1.4.3 (2021-10-08) #### Bug Fixes -* test on node14 (81bf2767) - - +- test on node14 (81bf2767) [Changes][v1.4.3] - + # [v1.4.2](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.4.2) - 08 Oct 2021 ## 1.4.2 (2021-10-08) #### Bug Fixes -* liniting errors (e7a1a8e8) -* master -> main (c120dd38) - - +- liniting errors (e7a1a8e8) +- master -> main (c120dd38) [Changes][v1.4.2] - + # [v1.4.1](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.4.1) - 07 Oct 2021 ## 1.4.1 (2021-10-07) #### Bug Fixes -* package.json & package-lock.json to reduce vulnerabilities (#103) (edaedef1) - - +- package.json & package-lock.json to reduce vulnerabilities (#103) (edaedef1) [Changes][v1.4.1] - + # [v1.4.0](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.4.0) - 07 Jul 2021 ## 1.4.0 (2021-07-07) #### Feature -* update to semantic versioning (96a3b9fd) +- update to semantic versioning (96a3b9fd) #### Bug Fixes -* ci release bugs (448f50a4) -* valid gh actions def (3dfbb696) -* cicd changelog automation (921a6861) -* merge artifacts... (efeb9044) -* missing supertest dependency... (91d5b8d2) -* updates from master (73d9dc7e) -* revert linting script (be247603) -* ci gh action (c3dce598) -* allow linting bypass argument 1 (a51a240b) -* upgrade mustache from 4.0.1 to 4.1.0 (#85) (65c476db) -* upgrade mustache from 4.0.1 to 4.1.0 (#85) (279d50f7) -* package update and set all responses to utf-8 (#83) (fc745d61) -* pin node-red-node-test-helper to 0.2.2 (#35) (2cd2613d) -* **package:** update mustache to version 3.0.2 (3b0ca3d1) -* **package:** update node-persist to version 3.0.0 (512c95c0) +- ci release bugs (448f50a4) +- valid gh actions def (3dfbb696) +- cicd changelog automation (921a6861) +- merge artifacts... (efeb9044) +- missing supertest dependency... (91d5b8d2) +- updates from master (73d9dc7e) +- revert linting script (be247603) +- ci gh action (c3dce598) +- allow linting bypass argument 1 (a51a240b) +- upgrade mustache from 4.0.1 to 4.1.0 (#85) (65c476db) +- upgrade mustache from 4.0.1 to 4.1.0 (#85) (279d50f7) +- package update and set all responses to utf-8 (#83) (fc745d61) +- pin node-red-node-test-helper to 0.2.2 (#35) (2cd2613d) +- **package:** update mustache to version 3.0.2 (3b0ca3d1) +- **package:** update node-persist to version 3.0.0 (512c95c0) #### Documentation -* **readme:** add Greenkeeper badge (487944f4) +- **readme:** add Greenkeeper badge (487944f4) #### Code Refactoring -* ci update (#97) (1dbbf227) -* also update changelog file (04013cf6) -* github actions magic (0eb4824c) -* github actions split (edd78182) +- ci update (#97) (1dbbf227) +- also update changelog file (04013cf6) +- github actions magic (0eb4824c) +- github actions split (edd78182) #### Chores -* **package:** update lockfile package-lock.json (8fcc0427) +- **package:** update lockfile package-lock.json (8fcc0427) #### doc -* update readme (6fec0210) +- update readme (6fec0210) #### linting -* fix eslint not globally installed (497f00e0) +- fix eslint not globally installed (497f00e0) #### ghaction -* fix linter (95a63c66) -* fix linter (4fa0cd2e) -* introduction and remove traevis (96fa859b) -* introduction and remove traevis (4efdf747) +- fix linter (95a63c66) +- fix linter (4fa0cd2e) +- introduction and remove traevis (96fa859b) +- introduction and remove traevis (4efdf747) #### wip -* fix limitations .. unit tests (6ab82b2a) -* fix limitation of about 33 devices... (d759c147) -* fix limitation of about 33 devices... (36466dc8) - - +- fix limitations .. unit tests (6ab82b2a) +- fix limitation of about 33 devices... (d759c147) +- fix limitation of about 33 devices... (36466dc8) [Changes][v1.4.0] - + # [v1.3.4](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.3.4) - 07 Jul 2021 ## 1.3.4 (2021-07-07) #### Bug Fixes -* upgrade mustache from 4.1.0 to 4.2.0 (#95) (48b81f81) - - +- upgrade mustache from 4.1.0 to 4.2.0 (#95) (48b81f81) [Changes][v1.3.4] - + # [v1.3.3](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.3.3) - 07 Jul 2021 ## 1.3.3 (2021-07-07) #### Bug Fixes -* ci release bugs (448f50a4) +- ci release bugs (448f50a4) #### Code Refactoring -* ci update (#97) (1dbbf227) -* also update changelog file (04013cf6) +- ci update (#97) (1dbbf227) +- also update changelog file (04013cf6) #### doc -* update readme (6fec0210) - - +- update readme (6fec0210) [Changes][v1.3.3] - + # [v1.3.2](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.3.2) - 04 Mar 2021 ## 1.3.2 (2021-03-04) #### Bug Fixes -* valid gh actions def (3dfbb696) +- valid gh actions def (3dfbb696) #### Code Refactoring -* github actions magic (0eb4824c) -* github actions split (edd78182) - - +- github actions magic (0eb4824c) +- github actions split (edd78182) [Changes][v1.3.2] - + # [v1.3.1](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.3.1) - 04 Mar 2021 ## 1.3.1 (2021-03-04) #### Bug Fixes -* cicd changelog automation (921a6861) - - +- cicd changelog automation (921a6861) [Changes][v1.3.1] - + # [v1.3.0](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/v1.3.0) - 04 Mar 2021 ## 1.3.0 (2021-03-04) #### 🎁 Feature -* update to semantic versioning (96a3b9fd) +- update to semantic versioning (96a3b9fd) #### 🐞 Bug Fixes -* merge artifacts... (efeb9044) -* missing supertest dependency... (91d5b8d2) -* updates from master (73d9dc7e) -* revert linting script (be247603) -* ci gh action (c3dce598) -* allow linting bypass argument 1 (a51a240b) -* upgrade mustache from 4.0.1 to 4.1.0 (#85) (65c476db) -* upgrade mustache from 4.0.1 to 4.1.0 (#85) (279d50f7) - - +- merge artifacts... (efeb9044) +- missing supertest dependency... (91d5b8d2) +- updates from master (73d9dc7e) +- revert linting script (be247603) +- ci gh action (c3dce598) +- allow linting bypass argument 1 (a51a240b) +- upgrade mustache from 4.0.1 to 4.1.0 (#85) (65c476db) +- upgrade mustache from 4.0.1 to 4.1.0 (#85) (279d50f7) [Changes][v1.3.0] - -# [Fix detection of gen3 devices (1.1.3)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.1.3) - 02 Sep 2019 -Thanks to @nepee for the input to fix some json stuff within the detection process. +# [Fix detection of gen3 devices (1.1.3)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.1.3) - 02 Sep 2019 +Thanks to @nepee for the input to fix some json stuff within the detection process. [Changes][1.1.3] - + # [Codecleanup + Registration fix for gen3 devices (1.1.2)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.1.2) - 29 Aug 2019 -Internal Code cleanup because of introduction of linting the Code... but +Internal Code cleanup because of introduction of linting the Code... but -Also take fix from [derSebbl](https://github.com/mabunixda/node-red-contrib-alexa-home/issues/16#issuecomment-526085758) to get Alexa Gen3 devices to work and hopefully fix #16 +Also take fix from [derSebbl](https://github.com/mabunixda/node-red-contrib-alexa-home/issues/16#issuecomment-526085758) to get Alexa Gen3 devices to work and hopefully fix #16 The change of the port is not made per default, because i expect not everybody to have port 80 open and available. It might also cause permissions problems, because that port might not be used by a default linux user e.g. - [Changes][1.1.2] - + # [fix http/https configuration setup (1.1.1)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.1.1) - 28 Aug 2019 http/https setup was incorrect routed through the node to reflect http/https setup of node-red [Changes][1.1.1] - + # [Start webserver for item information (1.1.0)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.1.0) - 28 Aug 2019 SSDP and HTTP Server are now seperate components to provide information about items. - [Changes][1.1.0] - + # [multiple fixxes (1.0.4)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.0.4) - 10 Jun 2019 Fixing #21 to get on/off command back - this is now @@ -293,39 +270,38 @@ Also a finding was that alexa does not support endless response bodies. To get a [Changes][1.0.4] - + # [fix ssdp location announcement (1.0.3)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.0.3) - 10 Jun 2019 -fix #16 +fix #16 [Changes][1.0.3] - + # [Remove debug() dependency to cleanup logging (1.0.2)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.0.2) - 07 Jun 2019 Logging is now done entirely via node-red routines [Changes][1.0.2] - + # [add error logging for missing node (1.0.1)](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.0.1) - 05 Jun 2019 #16 displayed the need that also error logs must be written when no controller node is available - even when this spams the logs when multiple alexa nodes are already present [Changes][1.0.1] - + # [1.0.0](https://github.com/mabunixda/node-red-contrib-alexa-home/releases/tag/1.0.0) - 05 Jun 2019 Relase of rewritten node implementation [Changes][1.0.0] - [v2.0.1]: https://github.com/mabunixda/node-red-contrib-alexa-home/compare/v2.0.0...v2.0.1 [v2.0.0]: https://github.com/mabunixda/node-red-contrib-alexa-home/compare/v1.4.3...v2.0.0 [v1.4.3]: https://github.com/mabunixda/node-red-contrib-alexa-home/compare/v1.4.2...v1.4.3 diff --git a/README.md b/README.md index 7348172..7dc2ab6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # node-red-contrib-alexa-home - [![CI](https://github.com/mabunixda/node-red-contrib-alexa-home/actions/workflows/ci.yml/badge.svg)](https://github.com/mabunixda/node-red-contrib-alexa-home/actions/workflows/ci.yml) [![Known Vulnerabilities](https://snyk.io/test/github/mabunixda/node-red-contrib-alexa-home/badge.svg)](https://snyk.io/test/github/mabunixda/node-red-contrib-alexa-home) @@ -28,28 +27,23 @@ They do rely that all communication is done on port 80! To estatlish this you go You must define an environment variable **ALEXA_PORT** and set its value to 80. When running node-red as systemd unit as -` -Environment=ALEXA_PORT=80 -` +`Environment=ALEXA_PORT=80` To test the change you can also start node-red manually with following: -` -ALEXA_PORT=80 node-red start -` +`ALEXA_PORT=80 node-red start` ### using iptables and port forwarding You can leave everything as it is and just define port forwarding using iptables -` -sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 60000 -` +`sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 60000` Please consider that any changes to iptables are not presistent, after reboot you have to forward the port again, or use iptables-save as described [here](https://www.poftut.com/how-to-save-and-restore-iptables-rules-permanently-in-ubuntu-centos-fedora-debian-kali-mint/) ## Message Object Properties -the follow *msg* properties are generated within this node + +the follow _msg_ properties are generated within this node **payload.on:** true|false @@ -61,12 +55,12 @@ the follow *msg* properties are generated within this node With version 1.x now also the input is processed within the node and updates the data to alexa. Within the alexa app you are now able to get the current state of your nodes. - ### Message input to the nodes At the moment you can input as payload objects: -* [brightness](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L85) -* [color](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L79) -* [on/off](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L95) + +- [brightness](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L85) +- [color](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L79) +- [on/off](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L95) Normal an input is not routed as output because this would possibly cause endless update loops. But if you want this and know what you are doing, you can set the [output param on the msg](https://github.com/mabunixda/node-red-contrib-alexa-home/blob/master/alexa/alexa-home.js#L133) to let the input passthrough. diff --git a/alexa/alexa-helper.js b/alexa/alexa-helper.js index 11dddec..2f6f8ae 100644 --- a/alexa/alexa-helper.js +++ b/alexa/alexa-helper.js @@ -1,31 +1,31 @@ -'use strict' +"use strict"; module.exports = { - hubPort: (process.env.ALEXA_PORT !== undefined && - parseInt(process.env.ALEXA_PORT) - ) || - 80, + hubPort: + (process.env.ALEXA_PORT !== undefined && + parseInt(process.env.ALEXA_PORT)) || + 80, controllerNode: undefined, - isDebug: (process.env.DEBUG && - process.env.DEBUG.indexOf('node-red-contrib-alexa-home') > 0 - ) || - false, + isDebug: + (process.env.DEBUG && + process.env.DEBUG.indexOf("node-red-contrib-alexa-home") > 0) || + false, bri_default: process.env.BRI_DEFAULT || 254, - prefixUUID: 'f6543a06-da50-11ba-8d8f-', + prefixUUID: "f6543a06-da50-11ba-8d8f-", - AlexaIPAddress: function (req) { - if (req.headers['x-forwarded-for'] !== undefined) { - return req.headers['x-forwarded-for'] + AlexaIPAddress: function(req) { + if (req.headers["x-forwarded-for"] !== undefined) { + return req.headers["x-forwarded-for"]; } if (req.socket.remoteAddress !== undefined) { - return req.socket.remoteAddress + return req.socket.remoteAddress; } if (req.connection.remoteAddress !== undefined) { - return req.connection.remoteAddress + return req.connection.remoteAddress; } - if ((req.connection.socket) && (req.connection.socket.remoteAddress)) { - return req.connection.socket.remoteAddress + if (req.connection.socket && req.connection.socket.remoteAddress) { + return req.connection.socket.remoteAddress; } - return undefined + return undefined; } -} +}; diff --git a/alexa/alexa-home-controller.js b/alexa/alexa-home-controller.js index 3d26eda..5eb0578 100644 --- a/alexa/alexa-home-controller.js +++ b/alexa/alexa-home-controller.js @@ -1,128 +1,128 @@ -module.exports = function (RED) { - 'use strict' - - const Mustache = require('mustache') - const fs = require('fs') - const alexaHome = require('./alexa-helper') - const AlexaHub = require('./alexa-hub') - const path = require('path') - - function getControllerId () { - const results = [] - RED.nodes.eachNode(function (n) { - if (n.type === 'alexa-home-controller') { - results.push(n) +module.exports = function(RED) { + "use strict"; + + const Mustache = require("mustache"); + const fs = require("fs"); + const alexaHome = require("./alexa-helper"); + const AlexaHub = require("./alexa-hub"); + const path = require("path"); + + function getControllerId() { + const results = []; + RED.nodes.eachNode(function(n) { + if (n.type === "alexa-home-controller") { + results.push(n); } - }) + }); if (results.length === 0) { - return undefined + return undefined; } - return results[0].id + return results[0].id; } - RED.httpNode.use(function (req, res, next) { - req.headers.alexaIp = alexaHome.AlexaIPAddress(req) - return next() - }) + RED.httpNode.use(function(req, res, next) { + req.headers.alexaIp = alexaHome.AlexaIPAddress(req); + return next(); + }); - RED.httpNode.get('/alexa-home/setup.xml', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/alexa-home/setup.xml", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleSetup(node.id, req, res) - }) + node.handleSetup(node.id, req, res); + }); - RED.httpNode.post('/api', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.post("/api", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (node === undefined) { - return + return; } - node.handleRegistration(node.id, req, res) - }) + node.handleRegistration(node.id, req, res); + }); - RED.httpNode.get('/api/', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (node === undefined) { - return + return; } - node.handleApiCall(node.id, req, res) - }) + node.handleApiCall(node.id, req, res); + }); - RED.httpNode.get('/api/config', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/config", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (node === undefined) { - return + return; } - node.handleConfigList(node.id, req, res) - }) + node.handleConfigList(node.id, req, res); + }); - RED.httpNode.get('/api/:username', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/:username", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleApiCall(node.id, req, res) - }) + node.handleApiCall(node.id, req, res); + }); - RED.httpNode.get('/api/:username/config', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/:username/config", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleConfigList(node.id, req, res) - }) + node.handleConfigList(node.id, req, res); + }); - RED.httpNode.get('/api/:username/:itemType', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/:username/:itemType", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleItemList(node.id, req, res) - }) + node.handleItemList(node.id, req, res); + }); - RED.httpNode.post('/api/:username/:itemType', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.post("/api/:username/:itemType", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleItemList(node.id, req, res) - }) + node.handleItemList(node.id, req, res); + }); - RED.httpNode.get('/api/:username/:itemType/new', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/:username/:itemType/new", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.handleItemList(node.id, req, res) - }) + node.handleItemList(node.id, req, res); + }); - RED.httpNode.get('/api/:username/:itemType/:id', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.get("/api/:username/:itemType/:id", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.getItemInfo(node.id, req, res) - }) + node.getItemInfo(node.id, req, res); + }); - RED.httpNode.put('/api/:username/:itemType/:id/state', function (req, res) { - const nodeId = getControllerId() - const node = RED.nodes.getNode(nodeId) + RED.httpNode.put("/api/:username/:itemType/:id/state", function(req, res) { + const nodeId = getControllerId(); + const node = RED.nodes.getNode(nodeId); if (!node) { - return + return; } - node.controlItem(node.id, req, res) - }) + node.controlItem(node.id, req, res); + }); /** * generates a controller node which manages the creation @@ -130,301 +130,400 @@ module.exports = function (RED) { * @constructor * @param {map} config nodered configuration */ - function AlexaHomeController (config) { - RED.nodes.createNode(this, config) + function AlexaHomeController(config) { + RED.nodes.createNode(this, config); - const node = this - alexaHome.controllerNode = node - node.name = config.controllername + const node = this; + alexaHome.controllerNode = node; + node.name = config.controllername; if (config.port === undefined || config.port === null) { - node.port = alexaHome.hubPort + node.port = alexaHome.hubPort; } else { - node.port = parseInt(config.port) + node.port = parseInt(config.port); } - const mac = node.generateMacAddress(config.id) - node.macaddress = mac - node.bridgeid = node.getBridgeIdFromMacAddress(mac) - node.maxItems = config.maxItems - node._commands = new Map() - node._hub = [] + const mac = node.generateMacAddress(config.id); + node.macaddress = mac; + node.bridgeid = node.getBridgeIdFromMacAddress(mac); + node.maxItems = config.maxItems; + node._commands = new Map(); + node._hub = []; - node.port = alexaHome.hubPort - node._hub.push(new AlexaHub(this, node.port, this._hub.length)) + node.port = alexaHome.hubPort; + node._hub.push(new AlexaHub(this, node.port, this._hub.length)); - node.on('close', function (removed, done) { + node.on("close", function(removed, done) { try { while (node._hub.length > 0) { - const hub = node._hub.pop() - hub.stopServers() + const hub = node._hub.pop(); + hub.stopServers(); } } catch (error) { - RED.log.warn('Error at closing hubs: ' + error) + RED.log.warn("Error at closing hubs: " + error); } - alexaHome.controllerNode = undefined - done() - }) + alexaHome.controllerNode = undefined; + done(); + }); - node.setConnectionStatusMsg('yellow', 'setup done') + node.setConnectionStatusMsg("yellow", "setup done"); - const globalContext = this.context().global - globalContext.alexaHomeController = node + const globalContext = this.context().global; + globalContext.alexaHomeController = node; - RED.log.info('Assigning alexa-home nodes to this controller') + RED.log.info("Assigning alexa-home nodes to this controller"); - RED.nodes.eachNode(function (n) { - if (n.type === 'alexa-home') { - const x = RED.nodes.getNode(n.id) + RED.nodes.eachNode(function(n) { + if (n.type === "alexa-home") { + const x = RED.nodes.getNode(n.id); if (x) { - node.registerCommand(x) + node.registerCommand(x); } } - }) - node.setConnectionStatusMsg('green', 'Ok') + }); + node.setConnectionStatusMsg("green", "Ok"); } - AlexaHomeController.prototype.generateMacAddress = function (id) { - let i = 9 - const base = '00:11:22:33:44:55' - const nodeid = id.replace(/[^a-fA-F0-9]/g, 'f').toUpperCase().split('') - const bridgeid = base.replace(/\d/g, () => - nodeid.shift() || Math.max(--i, 0), 'g') - return bridgeid - } - - AlexaHomeController.prototype.getBridgeIdFromMacAddress = function (mac) { - const id = mac.replace(/[:]/g, '') - const bridgeid = id.slice(0, 6) + 'FFFE' + id.slice(6) - return bridgeid - } - - AlexaHomeController.prototype.getDevices = function () { - const node = this - return node._commands - } - - AlexaHomeController.prototype.getDevice = function (uuid) { - const node = this + AlexaHomeController.prototype.generateMacAddress = function(id) { + let i = 9; + const base = "00:11:22:33:44:55"; + const nodeid = id + .replace(/[^a-fA-F0-9]/g, "f") + .toUpperCase() + .split(""); + const bridgeid = base.replace( + /\d/g, + () => nodeid.shift() || Math.max(--i, 0), + "g" + ); + return bridgeid; + }; + + AlexaHomeController.prototype.getBridgeIdFromMacAddress = function(mac) { + const id = mac.replace(/[:]/g, ""); + const bridgeid = id.slice(0, 6) + "FFFE" + id.slice(6); + return bridgeid; + }; + + AlexaHomeController.prototype.getDevices = function() { + const node = this; + return node._commands; + }; + + AlexaHomeController.prototype.getDevice = function(uuid) { + const node = this; if (node._commands.has(uuid)) { - return node._commands.get(uuid) - } - return undefined - } - - AlexaHomeController.prototype.registerCommand = function (deviceNode) { - const node = this - - deviceNode.updateController(node) - node._commands.set(node.formatUUID(deviceNode.id), deviceNode) - const itemCount = node.maxItems <= 0 || node.maxItems === undefined ? node._commands.size : node.maxItems - const currentNeed = Math.ceil(node._commands.size / itemCount) - - RED.log.debug('upscaling: ' + node.maxItems + '/' + node._commands.size + '/' + itemCount + '/' + currentNeed + '/' + node._hub.length) + return node._commands.get(uuid); + } + return undefined; + }; + + AlexaHomeController.prototype.registerCommand = function(deviceNode) { + const node = this; + + deviceNode.updateController(node); + node._commands.set(node.formatUUID(deviceNode.id), deviceNode); + const itemCount = + node.maxItems <= 0 || node.maxItems === undefined + ? node._commands.size + : node.maxItems; + const currentNeed = Math.ceil(node._commands.size / itemCount); + + RED.log.debug( + "upscaling: " + + node.maxItems + + "/" + + node._commands.size + + "/" + + itemCount + + "/" + + currentNeed + + "/" + + node._hub.length + ); if (currentNeed <= node._hub.length && node._hub.length > 0) { - return + return; } - node._hub.push(new AlexaHub(node, node.port, node._hub.length)) - } + node._hub.push(new AlexaHub(node, node.port, node._hub.length)); + }; - AlexaHomeController.prototype.deregisterCommand = function (deviceNode) { - const node = this + AlexaHomeController.prototype.deregisterCommand = function(deviceNode) { + const node = this; - node._commands.delete(node.formatUUID(deviceNode.id)) + node._commands.delete(node.formatUUID(deviceNode.id)); if (node._commands.size === 0) { - return + return; } - const itemCount = node.maxItems <= 0 ? node._commands.size : node.maxItems - const currentNeed = Math.ceil(node._commands.size / itemCount) + const itemCount = node.maxItems <= 0 ? node._commands.size : node.maxItems; + const currentNeed = Math.ceil(node._commands.size / itemCount); if (currentNeed >= node._hub.length) { - return + return; } - RED.log.debug('downscale') - const hub = node._hub.pop() - hub.stopServers(function () {}) - } + RED.log.debug("downscale"); + const hub = node._hub.pop(); + hub.stopServers(function() {}); + }; - AlexaHomeController.prototype.test = function (req, response) { - let content = '--\n' - const node = this + AlexaHomeController.prototype.test = function(req, response) { + let content = "--\n"; + const node = this; for (const [, v] of node._hub) { - content += JSON.stringify(v) + '\n' + content += JSON.stringify(v) + "\n"; } - response.type('text').send(content) - } + response.type("text").send(content); + }; - AlexaHomeController.prototype.stripSpace = function (content) { - while (content.indexOf(' ') > 0) { - content = content.replace(/ {2}/g, '') + AlexaHomeController.prototype.stripSpace = function(content) { + while (content.indexOf(" ") > 0) { + content = content.replace(/ {2}/g, ""); } - content = content.replace(/\r?\n/g, '') - return content - } + content = content.replace(/\r?\n/g, ""); + return content; + }; - AlexaHomeController.prototype.handleIndex = function (id, request, response) { - const node = this + AlexaHomeController.prototype.handleIndex = function(id, request, response) { + const node = this; - RED.log.debug(node.name + '/' + id + ' - Handling index request') - const template = fs.readFileSync(path.join(__dirname, - '/templates/index.html'), 'utf8').toString() + RED.log.debug(node.name + "/" + id + " - Handling index request"); + const template = fs + .readFileSync(path.join(__dirname, "/templates/index.html"), "utf8") + .toString(); const data = { id, uuid: node.formatHueBridgeUUID(node.id), - baseUrl: 'http://' + request.headers.host - } - const content = Mustache.render(template, data) - response.type('html').send(Buffer.from(content)) - } - - AlexaHomeController.prototype.handleSetup = function (id, request, response) { - const node = this - - RED.log.debug(node.name + '/' + id + ' - Handling setup request') - const template = fs.readFileSync(path.join(__dirname, - '/templates/setup.xml'), 'utf8').toString() + baseUrl: "http://" + request.headers.host + }; + const content = Mustache.render(template, data); + response.type("html").send(Buffer.from(content)); + }; + + AlexaHomeController.prototype.handleSetup = function(id, request, response) { + const node = this; + + RED.log.debug(node.name + "/" + id + " - Handling setup request"); + const template = fs + .readFileSync(path.join(__dirname, "/templates/setup.xml"), "utf8") + .toString(); const data = { uuid: node.formatHueBridgeUUID(node.id), - baseUrl: 'http://' + request.headers.host - } - const content = Mustache.render(template, data) - node.setConnectionStatusMsg('green', 'setup requested') - response.type('xml').send(content) - } - - AlexaHomeController.prototype.handleRegistration = function (id, + baseUrl: "http://" + request.headers.host + }; + const content = Mustache.render(template, data); + node.setConnectionStatusMsg("green", "setup requested"); + response.type("xml").send(content); + }; + + AlexaHomeController.prototype.handleRegistration = function( + id, request, - response) { - const node = this - - RED.log.debug(node.name + '/' + id + ' - Handling registration request') - const template = fs.readFileSync(path.join(__dirname, - '/templates/registration.json'), 'utf8').toString() - - let username = request.params.username + response + ) { + const node = this; + + RED.log.debug(node.name + "/" + id + " - Handling registration request"); + const template = fs + .readFileSync( + path.join(__dirname, "/templates/registration.json"), + "utf8" + ) + .toString(); + + let username = request.params.username; if (username === undefined || username === null) { - username = 'c6260f982b43a226b5542b967f612ce' + username = "c6260f982b43a226b5542b967f612ce"; } const data = { username - } - const content = Mustache.render(template, data) - response.type('json').send(content) - } + }; + const content = Mustache.render(template, data); + response.type("json").send(content); + }; // max response size of alexa seems at content-length=14173 - AlexaHomeController.prototype.handleItemList = function (id, + AlexaHomeController.prototype.handleItemList = function( + id, request, - response) { - const node = this - - RED.log.debug(node.name + '/' + id + - ' - handling api item list request: ' + request.params.itemType) - if (request.params.itemType !== 'lights') { - response.status(200).type('json').send('{}') - return - } - const template = fs.readFileSync(path.join(__dirname, - '/templates/items/list.json'), 'utf8').toString() + response + ) { + const node = this; + + RED.log.debug( + node.name + + "/" + + id + + " - handling api item list request: " + + request.params.itemType + ); + if (request.params.itemType !== "lights") { + response + .status(200) + .type("json") + .send("{}"); + return; + } + const template = fs + .readFileSync(path.join(__dirname, "/templates/items/list.json"), "utf8") + .toString(); const data = { lights: node.generateAPIDeviceList(id), - date: new Date().toISOString().split('.').shift() - } - const content = Mustache.render(template, data) - .replace(/(\{\s+)?,?[^,]+_emptyIteratorStopper": \{\}/g, '$1') - RED.log.debug(node.name + '/' + id + - ' - listing ' + request.params.username + - ' #' + data.lights.length + ' api information to ' + - request.connection.remoteAddress) - - node.setConnectionStatusMsg('yellow', request.params.itemType + - ' list requested: ' + node._commands.size) - - response.type('json').send(this.stripSpace(content)) - } - - AlexaHomeController.prototype.handleConfigList = function (id, + date: new Date() + .toISOString() + .split(".") + .shift() + }; + const content = Mustache.render(template, data).replace( + /(\{\s+)?,?[^,]+_emptyIteratorStopper": \{\}/g, + "$1" + ); + RED.log.debug( + node.name + + "/" + + id + + " - listing " + + request.params.username + + " #" + + data.lights.length + + " api information to " + + request.connection.remoteAddress + ); + + node.setConnectionStatusMsg( + "yellow", + request.params.itemType + " list requested: " + node._commands.size + ); + + response.type("json").send(this.stripSpace(content)); + }; + + AlexaHomeController.prototype.handleConfigList = function( + id, request, - response) { - const node = this - - RED.log.debug(node.name + '/' + id + ' - Handling Config listing request') - const config = fs.readFileSync(path.join(__dirname, - '/templates/items/config.json'), 'utf8').toString() + response + ) { + const node = this; + + RED.log.debug(node.name + "/" + id + " - Handling Config listing request"); + const config = fs + .readFileSync( + path.join(__dirname, "/templates/items/config.json"), + "utf8" + ) + .toString(); const data = { address: request.hostname, username: request.params.username, - date: new Date().toISOString().split('.').shift(), + date: new Date() + .toISOString() + .split(".") + .shift(), bridgeid: node.bridgeid, macaddress: node.macaddress - } - const content = Mustache.render(config, data) - RED.log.debug(node.name + '/' + id + ' - Sending ' + - (request.params.username ? 'full ' : '') + - 'config information to ' + request.connection.remoteAddress) - node.setConnectionStatusMsg('yellow', 'config requested') - - response.type('json').send(this.stripSpace(content)) - } - - AlexaHomeController.prototype.handleApiCall = function (id, + }; + const content = Mustache.render(config, data); + RED.log.debug( + node.name + + "/" + + id + + " - Sending " + + (request.params.username ? "full " : "") + + "config information to " + + request.connection.remoteAddress + ); + node.setConnectionStatusMsg("yellow", "config requested"); + + response.type("json").send(this.stripSpace(content)); + }; + + AlexaHomeController.prototype.handleApiCall = function( + id, request, - response) { - const node = this - - RED.log.debug(node.name + '/' + id + ' - Handling API listing request') - const responseTemplate = fs.readFileSync(path.join(__dirname, - '/templates/response.json'), 'utf8').toString() - const lights = fs.readFileSync(path.join(__dirname, - '/templates/items/list.json'), 'utf8').toString() - const config = fs.readFileSync(path.join(__dirname, - '/templates/items/config.json'), 'utf8').toString() + response + ) { + const node = this; + + RED.log.debug(node.name + "/" + id + " - Handling API listing request"); + const responseTemplate = fs + .readFileSync(path.join(__dirname, "/templates/response.json"), "utf8") + .toString(); + const lights = fs + .readFileSync(path.join(__dirname, "/templates/items/list.json"), "utf8") + .toString(); + const config = fs + .readFileSync( + path.join(__dirname, "/templates/items/config.json"), + "utf8" + ) + .toString(); const data = { lights: node.generateAPIDeviceList(id), address: request.hostname, username: request.params.username, - date: new Date().toISOString().split('.').shift(), + date: new Date() + .toISOString() + .split(".") + .shift(), bridgeid: node.bridgeid, macaddress: node.macaddress - } + }; const content = Mustache.render(responseTemplate, data, { itemsTemplate: lights, configTemplate: config - }) - RED.log.debug(node.name + '/' + id + ' - Sending ' + - request.params.username + ' #' + data.lights.length + - ' api information to ' + request.connection.remoteAddress) - node.setConnectionStatusMsg('yellow', 'api requested') - - response.type('json').send(this.stripSpace(content)) - } - - AlexaHomeController.prototype.generateAPIDeviceList = function (id) { - const deviceList = [] - const node = this - const itemCount = node.maxItems <= 0 || node.maxItems === undefined ? node._commands.size : node.maxItems - const startItem = (id * itemCount) + 1 - const endItem = ((id + 1) * itemCount) + 1 - let count = 0 - RED.log.debug(node.name + '/' + id + ' - starting at ' + (startItem - 1) + - ' till ' + (endItem - 1) + ' at #' + node._commands.size) + }); + RED.log.debug( + node.name + + "/" + + id + + " - Sending " + + request.params.username + + " #" + + data.lights.length + + " api information to " + + request.connection.remoteAddress + ); + node.setConnectionStatusMsg("yellow", "api requested"); + + response.type("json").send(this.stripSpace(content)); + }; + + AlexaHomeController.prototype.generateAPIDeviceList = function(id) { + const deviceList = []; + const node = this; + const itemCount = + node.maxItems <= 0 || node.maxItems === undefined + ? node._commands.size + : node.maxItems; + const startItem = id * itemCount + 1; + const endItem = (id + 1) * itemCount + 1; + let count = 0; + RED.log.debug( + node.name + + "/" + + id + + " - starting at " + + (startItem - 1) + + " till " + + (endItem - 1) + + " at #" + + node._commands.size + ); for (const [uuid, dev] of node._commands) { - count += 1 + count += 1; if (count < startItem) { - continue + continue; } if (count >= endItem) { - break + break; } const device = { id: uuid, name: dev.name - } - const deviceData = node.generateAPIDevice(uuid, dev) - deviceList.push(Object.assign({}, deviceData, device)) + }; + const deviceData = node.generateAPIDevice(uuid, dev); + deviceList.push(Object.assign({}, deviceData, device)); } - return deviceList - } + return deviceList; + }; - AlexaHomeController.prototype.generateAPIDevice = function (uuid, node) { + AlexaHomeController.prototype.generateAPIDevice = function(uuid, node) { const defaultAttributes = { on: node.state || false, bri: node.bri, @@ -434,111 +533,138 @@ module.exports = function (RED) { hue: 0, sat: 254, ct: 199, - colormode: 'ct', + colormode: "ct", uniqueid: node.uniqueid - } - - return defaultAttributes - } - - AlexaHomeController.prototype.controlItem = function (id, request, response) { - if (request.params.itemType !== 'lights') { - response.status(200).send('{}') - return - } - const node = this - - const template = fs.readFileSync(path.join(__dirname, - '/templates/items/set-state.json'), 'utf8').toString() - const username = request.params.username - let uuid = request.params.id - uuid = uuid.replace('/', '') - const targetNode = node.getDevice(uuid) + }; + + return defaultAttributes; + }; + + AlexaHomeController.prototype.controlItem = function(id, request, response) { + if (request.params.itemType !== "lights") { + response.status(200).send("{}"); + return; + } + const node = this; + + const template = fs + .readFileSync( + path.join(__dirname, "/templates/items/set-state.json"), + "utf8" + ) + .toString(); + const username = request.params.username; + let uuid = request.params.id; + uuid = uuid.replace("/", ""); + const targetNode = node.getDevice(uuid); if (targetNode === undefined) { - RED.log.warn('control item - unknown alexa node of type ' + - request.params.itemType + ' was requested: ' + uuid) - response.status(502).type('json').send('{}') - return + RED.log.warn( + "control item - unknown alexa node of type " + + request.params.itemType + + " was requested: " + + uuid + ); + response + .status(502) + .type("json") + .send("{}"); + return; } const msg = { username, payload: request.body - } + }; - msg.alexa_ip = alexaHome.AlexaIPAddress(request) + msg.alexa_ip = alexaHome.AlexaIPAddress(request); if (alexaHome.isDebug) { - const httpHeader = Object.keys(request.headers) - httpHeader.forEach(function (key) { - msg['http_header_' + key] = request.headers[key] - }) + const httpHeader = Object.keys(request.headers); + httpHeader.forEach(function(key) { + msg["http_header_" + key] = request.headers[key]; + }); } - targetNode.processCommand(msg) + targetNode.processCommand(msg); - const data = node.generateAPIDevice(uuid, targetNode) - const output = Mustache.render(template, data).replace(/\s/g, '') + const data = node.generateAPIDevice(uuid, targetNode); + const output = Mustache.render(template, data).replace(/\s/g, ""); - response.type('json').send(this.stripSpace(output)) - } + response.type("json").send(this.stripSpace(output)); + }; - AlexaHomeController.prototype.getItemInfo = function (id, request, response) { - if (request.params.itemType !== 'lights') { - response.status(200).end('{}') - return + AlexaHomeController.prototype.getItemInfo = function(id, request, response) { + if (request.params.itemType !== "lights") { + response.status(200).end("{}"); + return; } - const node = this + const node = this; - const template = fs.readFileSync(path.join(__dirname, - '/templates/items/get-state.json'), 'utf8').toString() + const template = fs + .readFileSync( + path.join(__dirname, "/templates/items/get-state.json"), + "utf8" + ) + .toString(); // const username = request.params.username; - const uuid = request.params.id + const uuid = request.params.id; - const targetNode = node.getDevice(uuid) + const targetNode = node.getDevice(uuid); if (targetNode === undefined) { - RED.log.warn('unknown alexa node of type ' + - request.params.itemType + ' was requested: ' + uuid) - response.status(502).type('json').send('{}') - return - } - const data = node.generateAPIDevice(uuid, targetNode) - data.name = targetNode.name - data.date = new Date().toISOString().split('.').shift() - const output = Mustache.render(template, data).replace(/\s/g, '') - - response.type('json').send(this.stripSpace(output)) - } - - AlexaHomeController.prototype.setConnectionStatusMsg = function (color, + RED.log.warn( + "unknown alexa node of type " + + request.params.itemType + + " was requested: " + + uuid + ); + response + .status(502) + .type("json") + .send("{}"); + return; + } + const data = node.generateAPIDevice(uuid, targetNode); + data.name = targetNode.name; + data.date = new Date() + .toISOString() + .split(".") + .shift(); + const output = Mustache.render(template, data).replace(/\s/g, ""); + + response.type("json").send(this.stripSpace(output)); + }; + + AlexaHomeController.prototype.setConnectionStatusMsg = function( + color, text, - shape) { - shape = shape || 'dot' + shape + ) { + shape = shape || "dot"; this.status({ fill: color, shape, text - }) - } + }); + }; - AlexaHomeController.prototype.formatUUID = function (lightId) { + AlexaHomeController.prototype.formatUUID = function(lightId) { if (lightId === null || lightId === undefined) { - return '' + return ""; } - const string = ('' + lightId) - return string.replace('.', '').trim() - } + const string = "" + lightId; + return string.replace(".", "").trim(); + }; - AlexaHomeController.prototype.formatHueBridgeUUID = function (lightId) { + AlexaHomeController.prototype.formatHueBridgeUUID = function(lightId) { if (lightId === null || lightId === undefined) { - return '' + return ""; } - let uuid = alexaHome.prefixUUID - uuid += this.formatUUID(lightId) - return uuid - } + let uuid = alexaHome.prefixUUID; + uuid += this.formatUUID(lightId); + return uuid; + }; - RED.nodes.registerType('alexa-home-controller', AlexaHomeController) -} + RED.nodes.registerType("alexa-home-controller", AlexaHomeController); +}; diff --git a/alexa/alexa-home.js b/alexa/alexa-home.js index 0ee1c84..590f2a6 100644 --- a/alexa/alexa-home.js +++ b/alexa/alexa-home.js @@ -1,157 +1,157 @@ -module.exports = function (RED) { - 'use strict' - const alexaHome = require('./alexa-helper') +module.exports = function(RED) { + "use strict"; + const alexaHome = require("./alexa-helper"); /** * creates a node which is reflected as command in alexa * @constructor * @param {map} config configuration injected by node-red **/ - function AlexaHomeNode (config) { - RED.nodes.createNode(this, config) - const node = this - node.name = config.devicename - node.control = config.control + function AlexaHomeNode(config) { + RED.nodes.createNode(this, config); + const node = this; + node.name = config.devicename; + node.control = config.control; if (config.devicetype) { - node.devicetype = config.devicetype + node.devicetype = config.devicetype; } else { - node.devicetype = 'Extended color light' + node.devicetype = "Extended color light"; } - node.inputTrigger = config.inputtrigger - node.state = false - node.bri = alexaHome.bri_default - node.xy = [0, 0] - node.uniqueid = node.generateUniqueId(config.id) - - node.on('input', function (msg) { - msg.inputTrigger = true - node.processCommand(msg) - }) - - node.on('close', function (done) { + node.inputTrigger = config.inputtrigger; + node.state = false; + node.bri = alexaHome.bri_default; + node.xy = [0, 0]; + node.uniqueid = node.generateUniqueId(config.id); + + node.on("input", function(msg) { + msg.inputTrigger = true; + node.processCommand(msg); + }); + + node.on("close", function(done) { if (node.controller) { - node.controller.deregisterCommand(node) + node.controller.deregisterCommand(node); } - done() - }) + done(); + }); - const controller = alexaHome.controllerNode + const controller = alexaHome.controllerNode; if (controller) { - controller.registerCommand(node) - return + controller.registerCommand(node); + return; } - RED.log.debug('No Alexa Home Controller available') - node.setConnectionStatusMsg('red', 'No Alexa Home Controller available') + RED.log.debug("No Alexa Home Controller available"); + node.setConnectionStatusMsg("red", "No Alexa Home Controller available"); } - AlexaHomeNode.prototype.setConnectionStatusMsg = function (color, + AlexaHomeNode.prototype.setConnectionStatusMsg = function( + color, text, - shape) { - shape = shape || 'dot' + shape + ) { + shape = shape || "dot"; this.status({ fill: color, shape, text - }) - } + }); + }; - AlexaHomeNode.prototype.updateController = function (controllerNode) { - const node = this - node.controller = controllerNode - node.setConnectionStatusMsg('green', 'Ok') - } + AlexaHomeNode.prototype.updateController = function(controllerNode) { + const node = this; + node.controller = controllerNode; + node.setConnectionStatusMsg("green", "Ok"); + }; - AlexaHomeNode.prototype.processCommand = function (msg) { - const node = this + AlexaHomeNode.prototype.processCommand = function(msg) { + const node = this; if (node.controller === null || node.controller === undefined) { - node.warn('Ignoring process command - no controller available!') - node.setConnectionStatusMsg('red', 'No Alexa Home Controller available') - return + node.warn("Ignoring process command - no controller available!"); + node.setConnectionStatusMsg("red", "No Alexa Home Controller available"); + return; } // Detect increase/decrease command - msg.change_direction = 0 + msg.change_direction = 0; if (msg.payload.bri) { if (msg.payload.bri < node.bri) { - msg.change_direction = -1 + msg.change_direction = -1; } if (msg.payload.bri > node.bri) { - msg.change_direction = 1 + msg.change_direction = 1; } } // set color if (msg.payload.xy) { - RED.log.debug(node.name + ' - Setting values on xy: ' + msg.payload.xy) - node.setConnectionStatusMsg('blue', 'xy: ' + msg.payload.xy) - msg.payload.command = 'color' + RED.log.debug(node.name + " - Setting values on xy: " + msg.payload.xy); + node.setConnectionStatusMsg("blue", "xy: " + msg.payload.xy); + msg.payload.command = "color"; } // Dimming or Temperature command if (msg.payload.bri) { - RED.log.debug(node.name + ' - Setting values on bri: ' + msg.payload.bri) - msg.payload.on = msg.payload.bri > 0 - msg.payload.command = 'dim' - node.setConnectionStatusMsg('blue', - 'bri:' + msg.payload.bri - ) + RED.log.debug(node.name + " - Setting values on bri: " + msg.payload.bri); + msg.payload.on = msg.payload.bri > 0; + msg.payload.command = "dim"; + node.setConnectionStatusMsg("blue", "bri:" + msg.payload.bri); } else { - RED.log.debug(node.name + ' - Setting values on On/Off') - let isOn = false - if (typeof msg.payload === 'object') { - isOn = msg.payload.on + RED.log.debug(node.name + " - Setting values on On/Off"); + let isOn = false; + if (typeof msg.payload === "object") { + isOn = msg.payload.on; } else { - if (typeof msg.payload === 'string') { - isOn = msg.payload === '1' || msg.payload === 'on' - } else if (typeof msg.payload === 'number') { - isOn = msg.payload === 1 + if (typeof msg.payload === "string") { + isOn = msg.payload === "1" || msg.payload === "on"; + } else if (typeof msg.payload === "number") { + isOn = msg.payload === 1; } else { - node.setConnectionStatusMsg('orange', 'could not process input msg') - return + node.setConnectionStatusMsg("orange", "could not process input msg"); + return; } - msg.payload = {} + msg.payload = {}; } - msg.payload.on = isOn - msg.payload.bri = node.bri + msg.payload.on = isOn; + msg.payload.bri = node.bri; if (msg.payload.xy === undefined) { - msg.payload.command = 'switch' + msg.payload.command = "switch"; // Node status - node.setConnectionStatusMsg( - 'blue', - (isOn ? 'On' : 'Off') - ) + node.setConnectionStatusMsg("blue", isOn ? "On" : "Off"); } } - msg.payload.bri_normalized = Math.round(msg.payload.bri / 254.0 * 100.0) - msg.device_name = node.name - msg.light_id = node.id - node.state = msg.payload.on - node.bri = msg.payload.bri - node.xy = msg.payload.xy + msg.payload.bri_normalized = Math.round((msg.payload.bri / 254.0) * 100.0); + msg.device_name = node.name; + msg.light_id = node.id; + node.state = msg.payload.on; + node.bri = msg.payload.bri; + node.xy = msg.payload.xy; if (node.xy === undefined) { - node.xy = [0, 0] + node.xy = [0, 0]; } if (msg.inputTrigger && !msg.output) { - RED.log.debug(node.name + ' - Set values on input') - return + RED.log.debug(node.name + " - Set values on input"); + return; } - RED.log.debug(node.name + ' - Pass values to output') - - node.send(msg) - } - - AlexaHomeNode.prototype.generateUniqueId = function (uuid) { - let i = 9 - const base = '00:11:22:33:44:55:66:77-88' - const nodeid = uuid.split('') - const uniqueid = base.replace(/\d/g, () => - nodeid.shift() || Math.max(--i, 0), 'g') - return uniqueid - } - - RED.nodes.registerType('alexa-home', AlexaHomeNode) -} + RED.log.debug(node.name + " - Pass values to output"); + + node.send(msg); + }; + + AlexaHomeNode.prototype.generateUniqueId = function(uuid) { + let i = 9; + const base = "00:11:22:33:44:55:66:77-88"; + const nodeid = uuid.split(""); + const uniqueid = base.replace( + /\d/g, + () => nodeid.shift() || Math.max(--i, 0), + "g" + ); + return uniqueid; + }; + + RED.nodes.registerType("alexa-home", AlexaHomeNode); +}; diff --git a/alexa/alexa-hub.js b/alexa/alexa-hub.js index 13058d8..83bcbf3 100644 --- a/alexa/alexa-hub.js +++ b/alexa/alexa-hub.js @@ -1,8 +1,8 @@ -'use strict' +"use strict"; -const express = require('express') -const bodyParser = require('body-parser') -const alexaHome = require('./alexa-home') +const express = require("express"); +const bodyParser = require("body-parser"); +const alexaHome = require("./alexa-home"); /** * Hub to create communication with alexa devices * @constructor @@ -10,153 +10,162 @@ const alexaHome = require('./alexa-home') * @param {number} port - base port where controllerhub starts * @param {number} id - counting number which is maintained in controller node */ -function AlexaHub (controller, port, id) { - const node = this - node.controller = controller - node.id = id - node.port = port + id - node.willClose = false - const protocol = 'http' - const options = undefined - node.startSsdp(protocol) +function AlexaHub(controller, port, id) { + const node = this; + node.controller = controller; + node.id = id; + node.port = port + id; + node.willClose = false; + const protocol = "http"; + const options = undefined; + node.startSsdp(protocol); if (node.controller.useNode) { - return + return; } - node.createServer(protocol, options) + node.createServer(protocol, options); } -AlexaHub.prototype.createServer = function (protocol, options) { - const node = this - const app = express() - node.app = app - node.ip = '0.0.0.0' +AlexaHub.prototype.createServer = function(protocol, options) { + const node = this; + const app = express(); + node.app = app; + node.ip = "0.0.0.0"; if (process.env.ALEXA_IP !== undefined) { - node.ip = process.env.ALEXA_IP - node.controller.log('Using ' + node.ip + ' to listing to alexa commands') + node.ip = process.env.ALEXA_IP; + node.controller.log("Using " + node.ip + " to listing to alexa commands"); } - node.httpServer = require(protocol).createServer(options, app) - node.server = node.httpServer.listen(node.port, node.ip, function (error) { + node.httpServer = require(protocol).createServer(options, app); + node.server = node.httpServer.listen(node.port, node.ip, function(error) { if (error) { - node.controller.log(error) + node.controller.log(error); } - app.on('error', function (error) { - node.controller.log(error) - }) - - app.use(bodyParser.json({ - type: '*/*' - })) - - app.use(function (err, req, res, next) { - if (err instanceof SyntaxError && err.status === 400 && 'body' in err) { - node.controller.log('Error: Invalid JSON request: ' + - JSON.stringify(err.body)) + app.on("error", function(error) { + node.controller.log(error); + }); + + app.use( + bodyParser.json({ + type: "*/*" + }) + ); + + app.use(function(err, req, res, next) { + if (err instanceof SyntaxError && err.status === 400 && "body" in err) { + node.controller.log( + "Error: Invalid JSON request: " + JSON.stringify(err.body) + ); } - next() - }) - - app.use(function (req, res, next) { - req.headers.alexaIp = alexaHome.AlexaIPAddress(req) - node.controller.log('Request data: ' + req.alexaIp + '-' + - node.port + '/' + - req.method + ' -> ' + - req.url) + next(); + }); + + app.use(function(req, res, next) { + req.headers.alexaIp = alexaHome.AlexaIPAddress(req); + node.controller.log( + "Request data: " + + req.alexaIp + + "-" + + node.port + + "/" + + req.method + + " -> " + + req.url + ); if (Object.keys(req.body).length > 0) { - node.controller.debug('Request body: ' + JSON.stringify(req.body)) + node.controller.debug("Request body: " + JSON.stringify(req.body)); } if (node.willClose) { - res.set('Connection', 'close') - res.status(503).json({ error: 'Temporarly Unavailable' }) - return + res.set("Connection", "close"); + res.status(503).json({ error: "Temporarly Unavailable" }); + return; } - next() - }) - - app.get('/', function (req, res) { - node.controller.handleIndex(node.id, req, res) - }) - - app.get('/alexa-home/setup.xml', function (req, res) { - node.controller.handleSetup(node.id, req, res) - }) - - app.post('/api', function (req, res) { - node.controller.handleRegistration(node.id, req, res) - }) - - app.get('/api/', function (req, res) { - node.controller.handleApiCall(node.id, req, res) - }) - - app.get('/api/config', function (req, res) { - node.controller.handleConfigList(node.id, req, res) - }) - - app.get('/api/:username', function (req, res) { - node.controller.handleApiCall(node.id, req, res) - }) - - app.get('/api/:username/config', function (req, res) { - node.controller.handleConfigList(node.id, req, res) - }) - - app.get('/api/:username/:itemType', function (req, res) { - node.controller.handleItemList(node.id, req, res) - }) - - app.post('/api/:username/:itemType', function (req, res) { - node.controller.handleItemList(node.id, req, res) - }) - - app.get('/api/:username/:itemType/new', function (req, res) { - node.controller.handleItemList(node.id, req, res) - }) - - app.get('/api/:username/:itemType/:id', function (req, res) { - node.controller.getItemInfo(node.id, req, res) - }) - - app.put('/api/:username/:itemType/:id/state', function (req, res) { - node.controller.controlItem(node.id, req, res) - }) - }) -} - -AlexaHub.prototype.stopServers = function () { - const node = this - node.controller.log('Stopping ssdp') - node.ssdpServer.stop() + next(); + }); + + app.get("/", function(req, res) { + node.controller.handleIndex(node.id, req, res); + }); + + app.get("/alexa-home/setup.xml", function(req, res) { + node.controller.handleSetup(node.id, req, res); + }); + + app.post("/api", function(req, res) { + node.controller.handleRegistration(node.id, req, res); + }); + + app.get("/api/", function(req, res) { + node.controller.handleApiCall(node.id, req, res); + }); + + app.get("/api/config", function(req, res) { + node.controller.handleConfigList(node.id, req, res); + }); + + app.get("/api/:username", function(req, res) { + node.controller.handleApiCall(node.id, req, res); + }); + + app.get("/api/:username/config", function(req, res) { + node.controller.handleConfigList(node.id, req, res); + }); + + app.get("/api/:username/:itemType", function(req, res) { + node.controller.handleItemList(node.id, req, res); + }); + + app.post("/api/:username/:itemType", function(req, res) { + node.controller.handleItemList(node.id, req, res); + }); + + app.get("/api/:username/:itemType/new", function(req, res) { + node.controller.handleItemList(node.id, req, res); + }); + + app.get("/api/:username/:itemType/:id", function(req, res) { + node.controller.getItemInfo(node.id, req, res); + }); + + app.put("/api/:username/:itemType/:id/state", function(req, res) { + node.controller.controlItem(node.id, req, res); + }); + }); +}; + +AlexaHub.prototype.stopServers = function() { + const node = this; + node.controller.log("Stopping ssdp"); + node.ssdpServer.stop(); if (!node.server) { - return + return; } - node.controller.log('Stopping app') - node.server.close(function () { - node.controller.log('stopped http') - }) -} -AlexaHub.prototype.startSsdp = function (protocol) { - const node = this - node.controller.log(node.id + ' - alexa-home - Starting SSDP') - const hueuuid = node.controller.formatHueBridgeUUID(node.id) - const Ssdp = require('node-ssdp').Server - let location = process.env.ALEXA_URI + '/alexa-home/setup.xml' + node.controller.log("Stopping app"); + node.server.close(function() { + node.controller.log("stopped http"); + }); +}; +AlexaHub.prototype.startSsdp = function(protocol) { + const node = this; + node.controller.log(node.id + " - alexa-home - Starting SSDP"); + const hueuuid = node.controller.formatHueBridgeUUID(node.id); + const Ssdp = require("node-ssdp").Server; + let location = process.env.ALEXA_URI + "/alexa-home/setup.xml"; if (process.env.ALEXA_URI === undefined) { location = { - protocol: protocol + '://', + protocol: protocol + "://", port: node.port, - path: '/alexa-home/setup.xml' - } + path: "/alexa-home/setup.xml" + }; } node.ssdpServer = new Ssdp({ location, - udn: 'uuid:' + hueuuid - }) - node.ssdpServer.addUSN('upnp:rootdevice') - node.ssdpServer.addUSN('urn:schemas-upnp-org:device:basic:1') - node.ssdpServer.reuseAddr = true - node.ssdpServer.start() - - node.controller.log(node.id + ' - announcing location is ' + location) -} + udn: "uuid:" + hueuuid + }); + node.ssdpServer.addUSN("upnp:rootdevice"); + node.ssdpServer.addUSN("urn:schemas-upnp-org:device:basic:1"); + node.ssdpServer.reuseAddr = true; + node.ssdpServer.start(); + + node.controller.log(node.id + " - announcing location is " + location); +}; -module.exports = AlexaHub +module.exports = AlexaHub; diff --git a/docker-package.json b/docker-package.json deleted file mode 100644 index 9e883a9..0000000 --- a/docker-package.json +++ /dev/null @@ -1,3 +0,0 @@ -// "node-red-contrib-loxone": "*" -// "node-red-contrib-samsung-tv": "*" -// "node-red-contrib-alexa-remote2": "*" diff --git a/package-lock.json b/package-lock.json index 1a87b9e..eb97708 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,8 +16,9 @@ }, "devDependencies": { "@babel/eslint-parser": "^7.5.4", - "eslint": "^8.18.0", + "eslint": "^8.24.0", "eslint-config-google": "^0.14.0", + "eslint-config-prettier": "^8.5.0", "eslint-config-standard": "^17.0.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-n": "^15.2.3", @@ -26,20 +27,126 @@ "node-red": "^3.0.2", "node-red-node-test-helper": "^0.3.0", "npm-check": "^6.0.1", + "prettier": "^1.19.1", "should": "^13.2.3", "supertest": "^6.2.3" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@ampproject/remapping/node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.3.tgz", + "integrity": "sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", "dev": true, + "peer": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/@babel/parser": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", + "dev": true, + "peer": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/core/node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" } }, "node_modules/@babel/eslint-parser": { @@ -101,12 +208,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.0.tgz", - "integrity": "sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz", + "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==", "dev": true, "dependencies": { - "@babel/types": "^7.19.0", + "@babel/types": "^7.19.3", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" }, @@ -114,6 +221,35 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", + "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.19.3", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-environment-visitor": { "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", @@ -148,6 +284,52 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-module-imports": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", + "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/types": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", @@ -170,38 +352,51 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", - "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "node_modules/@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", + "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", + "dev": true, + "peer": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.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==", + "node_modules/@babel/highlight": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" } }, "node_modules/@babel/highlight/node_modules/chalk": { @@ -224,18 +419,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "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_modules/@babel/parser": { "version": "7.16.4", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.4.tgz", @@ -280,41 +463,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template/node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/template/node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/template/node_modules/@babel/parser": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", @@ -327,40 +475,20 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/template/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/template/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/@babel/traverse": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.1.tgz", - "integrity": "sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", + "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", "dev": true, "dependencies": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", + "@babel/generator": "^7.19.3", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.19.1", - "@babel/types": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/types": "^7.19.3", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -368,45 +496,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/traverse/node_modules/@babel/parser": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", - "integrity": "sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -415,49 +508,20 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/traverse/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/traverse/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/@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", + "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/types/node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@devexpress/error-stack-parser": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@devexpress/error-stack-parser/-/error-stack-parser-2.0.6.tgz", @@ -468,14 +532,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.2.tgz", + "integrity": "sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -485,6 +549,9 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/eslintrc/node_modules/argparse": { @@ -494,9 +561,9 @@ "dev": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -520,18 +587,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -545,9 +600,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", + "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -558,6 +613,29 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -1787,6 +1865,35 @@ "node": ">=8" } }, + "node_modules/browserslist": { + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", + "node-releases": "^2.0.6", + "update-browserslist-db": "^1.0.9" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -2029,6 +2136,23 @@ "node": ">=8" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001414", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz", + "integrity": "sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ], + "peer": true + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2499,6 +2623,16 @@ "node": ">= 0.6" } }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, "node_modules/cookie": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", @@ -3048,6 +3182,13 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "node_modules/electron-to-chromium": { + "version": "1.4.269", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.269.tgz", + "integrity": "sha512-7mHFONwp7MNvdyto1v70fCwk28NJMFgsK79op+iYHzz1BLE8T66a1B2qW5alb8XgE0yi3FL3ZQjSYZpJpF6snw==", + "dev": true, + "peer": true + }, "node_modules/emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -3216,13 +3357,15 @@ } }, "node_modules/eslint": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.18.0.tgz", - "integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==", + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.24.0.tgz", + "integrity": "sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.2", + "@humanwhocodes/config-array": "^0.10.5", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@humanwhocodes/module-importer": "^1.0.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -3232,18 +3375,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.4.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", + "find-up": "^5.0.0", "glob-parent": "^6.0.1", "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -3254,8 +3400,7 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -3279,6 +3424,18 @@ "eslint": ">=5.16.0" } }, + "node_modules/eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-config-standard": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", @@ -3516,18 +3673,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-n": { "version": "15.2.3", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.3.tgz", @@ -3565,18 +3710,6 @@ "node": ">=10" } }, - "node_modules/eslint-plugin-n/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/eslint-plugin-n/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -3683,89 +3816,33 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/eslint/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/eslint/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/eslint/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -3786,81 +3863,63 @@ }, "funding": { "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/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/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eslint/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + } + }, + "node_modules/eslint/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, - "engines": { - "node": ">=8" + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/eslint/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "shebang-regex": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/strip-json-comments": { @@ -3875,45 +3934,33 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/espree": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/eslint/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "node_modules/espree/node_modules/acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true, - "dependencies": { - "acorn": "^8.7.1", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=0.4.0" } }, "node_modules/esprima": { @@ -4533,12 +4580,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -4624,6 +4665,16 @@ "node": ">=8" } }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -4960,6 +5011,12 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -5089,18 +5146,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/help-me/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/hexoid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", @@ -6362,9 +6407,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -6956,6 +7001,13 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/node-releases": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", + "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", + "dev": true, + "peer": true + }, "node_modules/node-ssdp": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/node-ssdp/-/node-ssdp-4.0.1.tgz", @@ -7811,6 +7863,18 @@ "node": ">=4" } }, + "node_modules/prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -8322,18 +8386,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -9354,6 +9406,33 @@ "node": ">= 0.8" } }, + "node_modules/update-browserslist-db": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz", + "integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "peer": true, + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/update-notifier": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", @@ -9459,12 +9538,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -9866,13 +9939,91 @@ } }, "dependencies": { + "@ampproject/remapping": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, + "peer": true, + "requires": { + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "peer": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "dev": true, + "requires": { + "@babel/highlight": "^7.18.6" + } + }, + "@babel/compat-data": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.19.3.tgz", + "integrity": "sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw==", "dev": true, + "peer": true + }, + "@babel/core": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", + "dev": true, + "peer": true, "requires": { - "@babel/highlight": "^7.16.7" + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "dependencies": { + "@babel/parser": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", + "dev": true, + "peer": true + }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "peer": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true + } } }, "@babel/eslint-parser": { @@ -9917,16 +10068,38 @@ } }, "@babel/generator": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.0.tgz", - "integrity": "sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz", + "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==", "dev": true, "requires": { - "@babel/types": "^7.19.0", + "@babel/types": "^7.19.3", "@jridgewell/gen-mapping": "^0.3.2", "jsesc": "^2.5.1" } }, + "@babel/helper-compilation-targets": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz", + "integrity": "sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg==", + "dev": true, + "peer": true, + "requires": { + "@babel/compat-data": "^7.19.3", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.21.3", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "peer": true + } + } + }, "@babel/helper-environment-visitor": { "version": "7.18.9", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", @@ -9952,6 +10125,43 @@ "@babel/types": "^7.18.6" } }, + "@babel/helper-module-imports": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.18.6" + } + }, + "@babel/helper-module-transforms": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz", + "integrity": "sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==", + "dev": true, + "peer": true, + "requires": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" + } + }, + "@babel/helper-simple-access": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "dev": true, + "peer": true, + "requires": { + "@babel/types": "^7.18.6" + } + }, "@babel/helper-split-export-declaration": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", @@ -9968,31 +10178,41 @@ "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true }, + "@babel/helper-validator-option": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "dev": true, + "peer": true + }, + "@babel/helpers": { + "version": "7.19.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.19.0.tgz", + "integrity": "sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==", + "dev": true, + "peer": true, + "requires": { + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.0", + "@babel/types": "^7.19.0" + } + }, "@babel/highlight": { - "version": "7.17.12", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz", - "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "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" - } - }, + "js-tokens": "^4.0.0" + }, + "dependencies": { "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -10009,15 +10229,6 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "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" - } } } }, @@ -10055,143 +10266,49 @@ "@babel/types": "^7.18.10" }, "dependencies": { - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "requires": { - "@babel/highlight": "^7.18.6" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, "@babel/parser": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", "integrity": "sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==", "dev": true - }, - "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" - } - }, - "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 } } }, "@babel/traverse": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.1.tgz", - "integrity": "sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz", + "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.19.0", + "@babel/generator": "^7.19.3", "@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-function-name": "^7.19.0", "@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.19.1", - "@babel/types": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/types": "^7.19.3", "debug": "^4.1.0", "globals": "^11.1.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dev": true, - "requires": { - "@babel/highlight": "^7.18.6" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, "@babel/parser": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", - "integrity": "sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==", - "dev": true - }, - "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" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.3.tgz", + "integrity": "sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ==", "dev": true } } }, "@babel/types": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.0.tgz", - "integrity": "sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==", + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.19.3.tgz", + "integrity": "sha512-hGCaQzIY22DJlDh9CH7NOxgKkFjBk0Cw9xDO1Xmh2151ti7wiGfQ3LauXzL4HP1fmFlTX6XjpRETTpUcv7wQLw==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.19.1", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "dev": true - } } }, "@devexpress/error-stack-parser": { @@ -10204,14 +10321,14 @@ } }, "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.2.tgz", + "integrity": "sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -10227,9 +10344,9 @@ "dev": true }, "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -10244,15 +10361,6 @@ "argparse": "^2.0.1" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -10262,9 +10370,9 @@ } }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.7.tgz", + "integrity": "sha512-MDl6D6sBsaV452/QSdX+4CXIjZhIcI0PELsxUjk4U828yd58vk3bTIvk/6w5FY+4hIy9sLW0sfrV7K7Kc++j/w==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -10272,6 +10380,18 @@ "minimatch": "^3.0.4" } }, + "@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "dev": true + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -11296,6 +11416,19 @@ "fill-range": "^7.0.1" } }, + "browserslist": { + "version": "4.21.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz", + "integrity": "sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==", + "dev": true, + "peer": true, + "requires": { + "caniuse-lite": "^1.0.30001400", + "electron-to-chromium": "^1.4.251", + "node-releases": "^2.0.6", + "update-browserslist-db": "^1.0.9" + } + }, "buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -11475,6 +11608,13 @@ } } }, + "caniuse-lite": { + "version": "1.0.30001414", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz", + "integrity": "sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg==", + "dev": true, + "peer": true + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -11836,6 +11976,16 @@ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "peer": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "cookie": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", @@ -12253,6 +12403,13 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "electron-to-chromium": { + "version": "1.4.269", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.269.tgz", + "integrity": "sha512-7mHFONwp7MNvdyto1v70fCwk28NJMFgsK79op+iYHzz1BLE8T66a1B2qW5alb8XgE0yi3FL3ZQjSYZpJpF6snw==", + "dev": true, + "peer": true + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -12390,13 +12547,15 @@ "dev": true }, "eslint": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.18.0.tgz", - "integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==", + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.24.0.tgz", + "integrity": "sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@eslint/eslintrc": "^1.3.2", + "@humanwhocodes/config-array": "^0.10.5", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@humanwhocodes/module-importer": "^1.0.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -12406,18 +12565,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.4.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", + "find-up": "^5.0.0", "glob-parent": "^6.0.1", "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -12428,73 +12590,31 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, "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 }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, "globals": { "version": "13.15.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", @@ -12504,12 +12624,6 @@ "type-fest": "^0.20.2" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -12519,43 +12633,31 @@ "argparse": "^2.0.1" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "p-locate": "^5.0.0" } }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "shebang-regex": "^3.0.0" + "yocto-queue": "^0.1.0" } }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "ansi-regex": "^5.0.1" + "p-limit": "^3.0.2" } }, "strip-json-comments": { @@ -12563,24 +12665,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } } } }, @@ -12591,6 +12675,13 @@ "dev": true, "requires": {} }, + "eslint-config-prettier": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", + "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "dev": true, + "requires": {} + }, "eslint-config-standard": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", @@ -12766,15 +12857,6 @@ "requires": { "esutils": "^2.0.2" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -12803,15 +12885,6 @@ "yallist": "^4.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -12877,14 +12950,22 @@ "dev": true }, "espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "requires": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true + } } }, "esprima": { @@ -13349,12 +13430,6 @@ "functions-have-names": "^1.2.2" } }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -13424,6 +13499,13 @@ } } }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "peer": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -13680,6 +13762,12 @@ "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", "dev": true }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -13772,15 +13860,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -14718,9 +14797,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -15183,6 +15262,13 @@ } } }, + "node-releases": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", + "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", + "dev": true, + "peer": true + }, "node-ssdp": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/node-ssdp/-/node-ssdp-4.0.1.tgz", @@ -15810,6 +15896,12 @@ "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", "dev": true }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -16191,15 +16283,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -17019,6 +17102,17 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "update-browserslist-db": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz", + "integrity": "sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==", + "dev": true, + "peer": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, "update-notifier": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", @@ -17102,12 +17196,6 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/package.json b/package.json index c17c6f4..2634b26 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ }, "devDependencies": { "@babel/eslint-parser": "^7.5.4", - "eslint": "^8.18.0", - "eslint-config-google": "^0.14.0", + "eslint": "^8.24.0", + "eslint-config-prettier": "^8.5.0", "eslint-config-standard": "^17.0.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-n": "^15.2.3", @@ -33,8 +33,17 @@ "node-red": "^3.0.2", "node-red-node-test-helper": "^0.3.0", "npm-check": "^6.0.1", + "prettier": "^1.19.1", "should": "^13.2.3", "supertest": "^6.2.3" }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "lint:fix": "eslint --fix alexa/**.js", + "lint": "eslint alexa/**.js", + "eslint:github-action": "eslint alexa/**.js", + "fmt": "prettier --write ./*/**.{json,js,ts,yml,md}", + "fmt:check": "prettier --check ./*/**.{json,js,ts,yml,md}" + }, "repository": "mabunixda/node-red-contrib-alexa-home" } diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100755 index f8d3758..0000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -NODE_MAJOR=$(node --version | awk -F '.' '{print $1}') -if [ "$NODE_MAJOR" = "v7" ] || [ "$NODE_MAJOR" = "v6" ]; then - exit 0 -fi - -./node_modules/eslint/bin/eslint.js alexa/*.js diff --git a/test/controller_spec.js b/test/controller_spec.js index 2d24bec..cc9bc80 100644 --- a/test/controller_spec.js +++ b/test/controller_spec.js @@ -1,16 +1,14 @@ -const request = require('supertest'); -const should = require('should'); -const helper = require('node-red-node-test-helper'); -const controllerNode = require('../alexa/alexa-home-controller.js'); -const alexaNode = require('../alexa/alexa-home.js'); +const request = require("supertest"); +const should = require("should"); +const helper = require("node-red-node-test-helper"); +const controllerNode = require("../alexa/alexa-home-controller.js"); +const alexaNode = require("../alexa/alexa-home.js"); -let alexaHelper = require('../alexa/alexa-helper.js'); -alexaHelper.hubPort = 60000 +let alexaHelper = require("../alexa/alexa-helper.js"); +alexaHelper.hubPort = 60000; function between(min, max) { - return Math.floor( - Math.random() * (max - min) + min - ) + return Math.floor(Math.random() * (max - min) + min); } function IsJsonString(str) { @@ -22,89 +20,98 @@ function IsJsonString(str) { return true; } - function isURL(str) { - const urlRegex = '^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$'; - const url = new RegExp(urlRegex, 'i'); + const urlRegex = + "^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$"; + const url = new RegExp(urlRegex, "i"); return str.length < 2083 && url.test(str); } -helper.init(require.resolve('node-red')); +helper.init(require.resolve("node-red")); -describe('alexa-home-controller Node', function () { - beforeEach(function (done) { +describe("alexa-home-controller Node", function() { + beforeEach(function(done) { helper.startServer(done); }); - afterEach(function (done) { + afterEach(function(done) { helper.unload(); helper.stopServer(done); }); - it('should be loaded with correct default params', function (done) { + it("should be loaded with correct default params", function(done) { hubPort = between(50000, 60000); - const flow = [{ id: 'n1', type: 'alexa-home-controller', controllername: 'Test', port: hubPort, useNode: false }]; - helper.load(controllerNode, flow, function () { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Test'); + const flow = [ + { + id: "n1", + type: "alexa-home-controller", + controllername: "Test", + port: hubPort, + useNode: false + } + ]; + helper.load(controllerNode, flow, function() { + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Test"); n1._hub.should.have.length(1); //n1._hub[0].httpServer.should.have.property('_connectionKey', '4:0.0.0.0:60000'); - n1._hub[0].ssdpServer.should.have.property('_started', true); - n1._hub[0].ssdpServer.should.have.property('_sourcePort', 1900); + n1._hub[0].ssdpServer.should.have.property("_started", true); + n1._hub[0].ssdpServer.should.have.property("_sourcePort", 1900); request(n1._hub[0].app) - .get('/') + .get("/") .expect(200) - .end(function (err, res) { + .end(function(err, res) { if (err) throw err; done(); }); }); }); - it('should respond to setup request', function (done) { + it("should respond to setup request", function(done) { hubPort = between(50000, 60000); - const flow = [{ - id: 'n1', - type: 'alexa-home-controller', - controllername: 'Test', - port: hubPort, - useNode: false - }]; - helper.load(controllerNode, flow, function () { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Test'); + const flow = [ + { + id: "n1", + type: "alexa-home-controller", + controllername: "Test", + port: hubPort, + useNode: false + } + ]; + helper.load(controllerNode, flow, function() { + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Test"); n1._hub.should.have.length(1); request(n1._hub[0].app) - .get('/alexa-home/setup.xml') - .expect('Content-Type', /xml/) + .get("/alexa-home/setup.xml") + .expect("Content-Type", /xml/) .expect(200) - .end(function (err, res) { + .end(function(err, res) { if (err) throw err; done(); }); }); }); - it('should respond to config request', function (done) { + it("should respond to config request", function(done) { hubPort = between(50000, 60000); const flow = [ { - id: 'n1', - type: 'alexa-home-controller', - controllername: 'Test', + id: "n1", + type: "alexa-home-controller", + controllername: "Test", port: hubPort, useNode: false - }, + } ]; - helper.load(controllerNode, flow, function () { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Test'); + helper.load(controllerNode, flow, function() { + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Test"); n1._hub.should.have.length(1); request(n1._hub[0].app) - .get('/api/config') - .expect('Content-Type', /json/) + .get("/api/config") + .expect("Content-Type", /json/) .expect(200) - .end(function (err, res) { - + .end(function(err, res) { if (err) throw err; //let isJson = IsJsonString(res.body) @@ -114,27 +121,26 @@ describe('alexa-home-controller Node', function () { }); }); }); - it('should respond to lights request', function (done) { + it("should respond to lights request", function(done) { hubPort = between(50000, 60000); const flow = [ { - id: 'n1', - type: 'alexa-home-controller', - controllername: 'Test', + id: "n1", + type: "alexa-home-controller", + controllername: "Test", port: hubPort, useNode: false - }, + } ]; - helper.load(controllerNode, flow, function () { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Test'); + helper.load(controllerNode, flow, function() { + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Test"); n1._hub.should.have.length(1); request(n1._hub[0].app) - .get('/api/my-username/lights') - .expect('Content-Type', /json/) + .get("/api/my-username/lights") + .expect("Content-Type", /json/) .expect(200) - .end(function (err, res) { - + .end(function(err, res) { if (err) throw err; //var isJson = IsJsonString(res.body) @@ -144,27 +150,26 @@ describe('alexa-home-controller Node', function () { }); }); }); - it('should respond to registration request', function (done) { + it("should respond to registration request", function(done) { hubPort = between(50000, 60000); const flow = [ { - id: 'n1', - type: 'alexa-home-controller', - controllername: 'Test', + id: "n1", + type: "alexa-home-controller", + controllername: "Test", port: hubPort, useNode: false - }, + } ]; - helper.load(controllerNode, flow, function () { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Test'); + helper.load(controllerNode, flow, function() { + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Test"); n1._hub.should.have.length(1); request(n1._hub[0].app) - .post('/api') - .expect('Content-Type', /json/) + .post("/api") + .expect("Content-Type", /json/) .expect(200) - .end(function (err, res) { - + .end(function(err, res) { if (err) throw err; //var isJson = IsJsonString(res.body) diff --git a/test/home_spec.js b/test/home_spec.js index 4974116..0759553 100644 --- a/test/home_spec.js +++ b/test/home_spec.js @@ -1,10 +1,10 @@ -const should = require('should'); -const helper = require('node-red-node-test-helper'); -const alexaNode = require('../alexa/alexa-home.js'); +const should = require("should"); +const helper = require("node-red-node-test-helper"); +const alexaNode = require("../alexa/alexa-home.js"); -helper.init(require.resolve('node-red')); +helper.init(require.resolve("node-red")); -describe('alexa-home Node', function() { +describe("alexa-home Node", function() { beforeEach(function(done) { helper.startServer(done); }); @@ -14,69 +14,86 @@ describe('alexa-home Node', function() { helper.stopServer(done); }); - it('should be loaded with correct default params', function(done) { - const flow = [{id: 'n1', type: 'alexa-home', devicename: 'Kitchen Light'}]; + it("should be loaded with correct default params", function(done) { + const flow = [ + { id: "n1", type: "alexa-home", devicename: "Kitchen Light" } + ]; helper.load(alexaNode, flow, function() { - const n1 = helper.getNode('n1'); - n1.should.have.property('name', 'Kitchen Light'); - n1.should.have.property('devicetype', 'Extended color light'); + const n1 = helper.getNode("n1"); + n1.should.have.property("name", "Kitchen Light"); + n1.should.have.property("devicetype", "Extended color light"); done(); }); }); - it('should round bri 127 to 50% normalized', function(done) { + it("should round bri 127 to 50% normalized", function(done) { const flow = [ - {id: 'n1', type: 'alexa-home', devicename: 'Kitchen Light', wires: [['n2']]}, - {id: 'n2', type: 'helper'}, + { + id: "n1", + type: "alexa-home", + devicename: "Kitchen Light", + wires: [["n2"]] + }, + { id: "n2", type: "helper" } ]; helper.load(alexaNode, flow, function() { - const n2 = helper.getNode('n2'); - const n1 = helper.getNode('n1'); + const n2 = helper.getNode("n2"); + const n1 = helper.getNode("n1"); n1.controller = n2; - n2.on('input', function(msg) { - msg.payload.should.have.property('on', true); - msg.payload.should.have.property('bri', 127); - msg.payload.should.have.property('bri_normalized', 50); + n2.on("input", function(msg) { + msg.payload.should.have.property("on", true); + msg.payload.should.have.property("bri", 127); + msg.payload.should.have.property("bri_normalized", 50); done(); }); - n1.receive({payload: {bri: 127}, output: true}); + n1.receive({ payload: { bri: 127 }, output: true }); }); }); - it('should switch to on', function(done) { + it("should switch to on", function(done) { const flow = [ - {id: 'n1', type: 'alexa-home', devicename: 'Kitchen Light', wires: [['n2']]}, - {id: 'n2', type: 'helper'}, + { + id: "n1", + type: "alexa-home", + devicename: "Kitchen Light", + wires: [["n2"]] + }, + { id: "n2", type: "helper" } ]; helper.load(alexaNode, flow, function() { - const n2 = helper.getNode('n2'); - const n1 = helper.getNode('n1'); + const n2 = helper.getNode("n2"); + const n1 = helper.getNode("n1"); n1.controller = n2; - n2.on('input', function(msg) { - msg.payload.should.have.property('on', true); - msg.payload.should.have.property('bri', 254); - msg.payload.should.have.property('bri_normalized', 100); + n2.on("input", function(msg) { + msg.payload.should.have.property("on", true); + msg.payload.should.have.property("bri", 254); + msg.payload.should.have.property("bri_normalized", 100); done(); }); - n1.receive({payload: {on: true}, output: true}); + n1.receive({ payload: { on: true }, output: true }); }); }); - it('should set color to defined', function(done) { + it("should set color to defined", function(done) { const flow = [ - {id: 'n1', type: 'alexa-home', devicename: 'Kitchen Light', wires: [['n2']]}, - {id: 'n2', type: 'helper'}, + { + id: "n1", + type: "alexa-home", + devicename: "Kitchen Light", + wires: [["n2"]] + }, + { id: "n2", type: "helper" } ]; helper.load(alexaNode, flow, function() { - const n2 = helper.getNode('n2'); - const n1 = helper.getNode('n1'); + const n2 = helper.getNode("n2"); + const n1 = helper.getNode("n1"); n1.controller = n2; - n2.on('input', function(msg) { - msg.payload.should.have.property('on', true); - msg.payload.should.have.property('bri_normalized', 100); - msg.payload.should.have.property('xy', [0.3, 0.3]); + n2.on("input", function(msg) { + msg.payload.should.have.property("on", true); + msg.payload.should.have.property("bri_normalized", 100); + msg.payload.should.have.property("xy", [0.3, 0.3]); done(); }); - n1.receive({payload: {on: true, xy: [0.3, 0.3]}, output: true}); + n1.receive({ payload: { on: true, xy: [0.3, 0.3] }, output: true }); }); }); });