From 3be5efe731484be74ba2e9d33d2526f6025d92b0 Mon Sep 17 00:00:00 2001 From: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:10:40 -0400 Subject: [PATCH] Beta --- CHANGELOG.md | 4 +- config.schema.json | 2 +- test/jest.json => jest.config.json | 2 +- package-lock.json | 226 +++++++++++++++--------- package.json | 14 +- test/client.test.ts | 78 +++++--- test/matchers.ts | 166 +++++++++++++++++ test/server.ts | 4 +- test/server_helpers_for_client_tests.ts | 7 + tools/grabDiscover.js | 15 +- tools/newParseAccessories.js | 2 +- tools/sendStatusCommand.js | 60 +++++++ 12 files changed, 452 insertions(+), 128 deletions(-) rename test/jest.json => jest.config.json (93%) create mode 100644 test/matchers.ts create mode 100644 tools/sendStatusCommand.js diff --git a/CHANGELOG.md b/CHANGELOG.md index b29db3d..e5b406d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,12 @@ All notable changes to this project will be documented in this file. This projec ## 0.7.1 (2023-05-30) -## [Version 0.7.0](https://github.com/northernman54/homebridge-alexa/compare/v0.7.0...v0.7.1) +## [Version 0.7.1](https://github.com/northernman54/homebridge-alexa/compare/v0.7.0...v0.7.1) #### Changes +- Update `filter` to accept a list of addresses and ports ie "192.168.1.11:51551, 192.168.1.11:46047" + ## 0.7.0 (2023-05-30) ## [Version 0.7.0](https://github.com/northernman54/homebridge-alexa/compare/v0.6.9...v0.7.0) diff --git a/config.schema.json b/config.schema.json index d03efa4..649dbdb 100644 --- a/config.schema.json +++ b/config.schema.json @@ -143,7 +143,7 @@ "title": "Homebridge Instance Filter", "type": "string", "placeholder": "eg. 192.168.1.122:51826", - "description": "Limits accessories shared with Alexa to a single homebridge instance. Uses ip address and port of homebridge instance.", + "description": "Limits accessories shared with Alexa to particular homebridge instances. Uses ip address and port of homebridge instance, eg. '192.168.1.122:51826' or '192.168.1.11:51551, 192.168.1.11:46047'.", "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$" }, "deviceListHandling": { diff --git a/test/jest.json b/jest.config.json similarity index 93% rename from test/jest.json rename to jest.config.json index 341c7ce..817ae09 100644 --- a/test/jest.json +++ b/jest.config.json @@ -1,6 +1,6 @@ { "moduleFileExtensions": ["js", "json", "ts"], - "rootDir": "../", + "rootDir": "./", "testEnvironment": "node", "testRegex": ".test.ts$", "testTimeout": 10000, diff --git a/package-lock.json b/package-lock.json index 8c7db25..3aac020 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,34 +1,34 @@ { "name": "homebridge-alexa", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebridge-alexa", - "version": "0.7.0", + "version": "0.7.1", "license": "Apache-2.0", "dependencies": { "bottleneck": "2.19.5", - "debug": "4.3.5", - "hap-node-client": "0.2.7", + "debug": "4.3.6", + "hap-node-client": "0.2.8-beta.12", "is-my-json-valid": "2.20.6", - "mqtt": "5.8.0" + "mqtt": "5.9.1" }, "devDependencies": { "@oznu/hap-client": "^1.9.0", "@types/jest": "^29.5.10", - "@types/node": "^20.14.10", + "@types/node": "^22.2.0", "babel-jest": "^29.7.0", "documentation": "^14.0.3", "jest": "^29.7.0", "mqtt-connection": "^4.1.0", "nodemon": "^3.1.4", "rimraf": "^6.0.1", - "semver": "^7.5.4", - "ts-jest": "^29.2.2", + "semver": "^7.6.3", + "ts-jest": "^29.2.4", "ts-node": "^10.9.1", - "typescript": "^5.5.3", + "typescript": "^5.5.4", "ws": "^8.14.2" }, "engines": { @@ -5406,17 +5406,19 @@ } }, "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz", + "integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==", + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.13.0" } }, "node_modules/@types/node/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", + "license": "MIT" }, "node_modules/babel-jest": { "version": "29.7.0", @@ -6651,9 +6653,10 @@ "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -10094,30 +10097,33 @@ } }, "node_modules/hap-node-client": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/hap-node-client/-/hap-node-client-0.2.7.tgz", - "integrity": "sha512-sHQtOhzUZwaiMp2mLIAgpMi8X2H/lfRRkd/1bKC68Tn6Qg2h5L9WNuC7Un/WSUWFNbld/c17tDWgXWQT6pPK4w==", + "version": "0.2.8-beta.12", + "resolved": "https://registry.npmjs.org/hap-node-client/-/hap-node-client-0.2.8-beta.12.tgz", + "integrity": "sha512-Z05GyxK5J5MvurTsf5s/v99KYBMj7CqPkSvoyrCOK4pG+Io4pWsO8LierP2TUYs4aR86tJVrtcGsQkhOMdjB6A==", + "license": "ISC", "dependencies": { - "axios": "1.6.8", - "axios-retry": "4.1.0", + "axios": "1.7.3", + "axios-retry": "4.5.0", "better-queue": "3.8.12", - "bonjour-hap": "3.6.5", + "bonjour-hap": "3.8.0", "buffer": "6.0.3", - "debug": "4.3.4", + "debug": "4.3.6", "extend": "3.0.2", "ip": "2.0.1", "once": "1.4.0" } }, "node_modules/hap-node-client/node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", + "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -10130,19 +10136,22 @@ } }, "node_modules/hap-node-client/node_modules/array-flatten": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", - "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz", + "integrity": "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -10154,9 +10163,10 @@ } }, "node_modules/hap-node-client/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", + "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -10164,9 +10174,10 @@ } }, "node_modules/hap-node-client/node_modules/axios-retry": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.1.0.tgz", - "integrity": "sha512-svdth4H00yhlsjBbjfLQ/sMLkXqeLxhiFC1nE1JtkN/CIssGxqk0UwTEdrVjwA2gr3yJkAulwvDSIm4z4HyPvg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.5.0.tgz", + "integrity": "sha512-aR99oXhpEDGo0UuAlYcn2iGRds30k366Zfa05XWScR9QaQD4JYiP3/1Qt1u7YlefUOK+cn0CcwoL1oefavQUlQ==", + "license": "Apache-2.0", "dependencies": { "is-retry-allowed": "^2.2.0" }, @@ -10209,11 +10220,12 @@ "integrity": "sha512-SWg5wFIShYffEmJpI6LgbL8/3Dqhku7xI1oEiy6FroP9DbcZlG0ZDjxvPdP9t7hTGW40IpIcC6zVoGT1oxjOuA==" }, "node_modules/hap-node-client/node_modules/bonjour-hap": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/bonjour-hap/-/bonjour-hap-3.6.5.tgz", - "integrity": "sha512-WsAbvzqveQHukBR4OPTgcZYG0+MxiksihmpMlKHOIOEBw3+iKDeqVPI/LutImZ4DAXBigYYD/JKJEXtZa9ZtLA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/bonjour-hap/-/bonjour-hap-3.8.0.tgz", + "integrity": "sha512-l/Ptvrt/pjN2pCgiVyyA0EkE0uVoXXYZ4DW4xhL4kDVBaw0w54/3Jhdhzn5EyT1Z8YhNXiNhSX0uW6xz2zSxqQ==", + "license": "MIT", "dependencies": { - "array-flatten": "^2.1.2", + "array-flatten": "^3.0.0", "deep-equal": "^2.2.3", "multicast-dns": "^7.2.5", "multicast-dns-service-types": "^1.1.0" @@ -10246,6 +10258,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -10264,6 +10277,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -10271,26 +10285,11 @@ "node": ">= 0.8" } }, - "node_modules/hap-node-client/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/hap-node-client/node_modules/deep-equal": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.5", @@ -10322,6 +10321,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -10338,6 +10338,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -10354,6 +10355,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -10362,6 +10364,7 @@ "version": "5.6.1", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", + "license": "MIT", "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" }, @@ -10373,6 +10376,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -10384,6 +10388,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -10392,6 +10397,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -10422,6 +10428,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -10435,6 +10442,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } @@ -10443,6 +10451,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -10456,6 +10465,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10464,6 +10474,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10472,6 +10483,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -10490,6 +10502,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -10501,6 +10514,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10509,6 +10523,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -10520,6 +10535,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10531,6 +10547,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10542,6 +10559,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -10556,6 +10574,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -10586,6 +10605,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -10604,6 +10624,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -10619,6 +10640,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -10634,6 +10656,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -10645,6 +10668,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -10660,6 +10684,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10671,6 +10696,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -10685,6 +10711,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10696,6 +10723,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -10710,6 +10738,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -10725,6 +10754,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz", "integrity": "sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -10736,6 +10766,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10747,6 +10778,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.7" }, @@ -10761,6 +10793,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -10775,6 +10808,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -10789,6 +10823,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -10800,6 +10835,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4" @@ -10814,12 +10850,14 @@ "node_modules/hap-node-client/node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -10828,6 +10866,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -10835,15 +10874,11 @@ "node": ">= 0.6" } }, - "node_modules/hap-node-client/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/hap-node-client/node_modules/multicast-dns": { "version": "7.2.5", "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", + "license": "MIT", "dependencies": { "dns-packet": "^5.2.2", "thunky": "^1.0.2" @@ -10855,7 +10890,8 @@ "node_modules/hap-node-client/node_modules/multicast-dns-service-types": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", - "integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ==" + "integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/node-eta": { "version": "0.9.0", @@ -10863,9 +10899,13 @@ "integrity": "sha512-mTCTZk29tmX1OGfVkPt63H3c3VqXrI2Kvua98S7iUIB/Gbp0MNw05YtUomxQIxnnKMyRIIuY9izPcFixzhSBrA==" }, "node_modules/hap-node-client/node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10874,6 +10914,7 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" @@ -10889,6 +10930,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -10897,6 +10939,7 @@ "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -10922,6 +10965,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -10929,12 +10973,14 @@ "node_modules/hap-node-client/node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -10952,6 +10998,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -10968,6 +11015,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -10982,6 +11030,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -10999,6 +11048,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "license": "MIT", "dependencies": { "internal-slot": "^1.0.4" }, @@ -11009,7 +11059,8 @@ "node_modules/hap-node-client/node_modules/thunky": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", - "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "license": "MIT" }, "node_modules/hap-node-client/node_modules/uuid": { "version": "9.0.1", @@ -11027,6 +11078,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -11042,6 +11094,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "license": "MIT", "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -11059,6 +11112,7 @@ "version": "1.1.15", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -14033,9 +14087,10 @@ } }, "node_modules/mqtt": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.8.0.tgz", - "integrity": "sha512-/+H04mv6goy6K5gHMNH3uS0icBzXapS+4uUf4yZyQWXi72APPZNb81bQhvkm99poEQettXVT8XETB0mPxl5Wjg==", + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.9.1.tgz", + "integrity": "sha512-FMENfSUMfCSUCnkuUVAL4U01795SUEfrX0NZ53HNr1r2VNpwKhR5Au9viq9WCFGtgrDAmsll4fkloqFCFgStYA==", + "license": "MIT", "dependencies": { "@types/readable-stream": "^4.0.5", "@types/ws": "^8.5.9", @@ -15516,10 +15571,11 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -15528,13 +15584,14 @@ } }, "node_modules/ts-jest": { - "version": "29.2.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.2.tgz", - "integrity": "sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg==", + "version": "29.2.4", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.4.tgz", + "integrity": "sha512-3d6tgDyhCI29HlpwIq87sNuI+3Q6GLTTCeYRHCs7vDz+/3GCMwEtV9jezLyl4ZtnBgx00I7hm8PCP8cTksMGrw==", "dev": true, + "license": "MIT", "dependencies": { "bs-logger": "0.x", - "ejs": "^3.0.0", + "ejs": "^3.1.10", "fast-json-stable-stringify": "2.x", "jest-util": "^29.0.0", "json5": "^2.2.3", @@ -16017,10 +16074,11 @@ } }, "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 9d6331f..189e492 100644 --- a/package.json +++ b/package.json @@ -34,25 +34,25 @@ "devDependencies": { "@oznu/hap-client": "^1.9.0", "@types/jest": "^29.5.10", - "@types/node": "^20.14.10", + "@types/node": "^22.2.0", "babel-jest": "^29.7.0", "documentation": "^14.0.3", "jest": "^29.7.0", "mqtt-connection": "^4.1.0", "nodemon": "^3.1.4", "rimraf": "^6.0.1", - "semver": "^7.5.4", - "ts-jest": "^29.2.2", + "semver": "^7.6.3", + "ts-jest": "^29.2.4", "ts-node": "^10.9.1", - "typescript": "^5.5.3", + "typescript": "^5.5.4", "ws": "^8.14.2" }, "dependencies": { "bottleneck": "2.19.5", - "debug": "4.3.5", - "hap-node-client": "0.2.7", + "debug": "4.3.6", + "hap-node-client": "0.2.8-beta.12", "is-my-json-valid": "2.20.6", - "mqtt": "5.8.0" + "mqtt": "5.9.1" }, "author": "NorthernMan54", "license": "Apache-2.0", diff --git a/test/client.test.ts b/test/client.test.ts index 5c6978f..82d523b 100644 --- a/test/client.test.ts +++ b/test/client.test.ts @@ -1,55 +1,77 @@ +import { Server } from 'net'; +import { MqttServer, MqttSecureServer, MqttServerListener } from './server' import serverBuilder from './server_helpers_for_client_tests'; var AlexaLocal = require('../lib/alexaLocal.js').alexaLocal; jest.setTimeout(30000); +// const ports = getPorts(2) +var server: MqttServer; +var alexa: any; describe('MQTT Client', () => { beforeAll(async () => { - - var version; - let client = null - let publishCount = 0 - const server2 = serverBuilder('mqtt', (serverClient) => { + var version: number; + server = serverBuilder('mqtt', (serverClient) => { serverClient.on('connect', () => { - console.log('connect'); const connack = version === 5 ? { reasonCode: 0 } : { returnCode: 0 } serverClient.connack(connack) }) - serverClient.on('publish', (packet) => { + serverClient.on('publish', (packet: { payload: { toString: () => any; }; qos: number; messageId: any; }) => { console.log('publish', packet.payload.toString()); if (packet.qos !== 0) { serverClient.puback({ messageId: packet.messageId }) } }) + serverClient.on('auth', (packet: any) => { + console.log('auth'); + if (serverClient.writable) return false + const rc = 'reasonCode' + const connack = {} + connack[rc] = 0 + serverClient.connack(connack) + }) + serverClient.on('subscribe', (packet: { subscriptions: any[]; messageId: any; }) => { + console.log('subscribe', packet.subscriptions); + if (!serverClient.writable) return false + serverClient.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map((e: { qos: any; }) => e.qos), + }) + }) }) + console.log('MQTT Server starting listener') + await server.listen(1883) + console.log('MQTT Server listening') + var options = { + // MQTT Options + log: console.log, + mqttURL: 'mqtt://localhost:1883', + transport: 'mqtt', + mqttOptions: { + username: 'TEST', + password: 'PASSWORD', + reconnectPeriod: 33, // Increased reconnect period to allow DDOS protection to reset + keepalive: 55, + rejectUnauthorized: false + }, + }; + alexa = new AlexaLocal(options); }, 300000); afterAll(async () => { - - // await sleep(10000) - + console.log('MQTT Server exiting', server.listening) + if (server.listening) { + await server.close() + } }); describe('Validate Inital Startup', () => { - test('getconf GNU_LIBC_VERSION', async () => { - var options = { - // MQTT Options - log: console.log, - mqttURL: 'mqtt://localhost:1883', - transport: 'mqtt', - mqttOptions: { - username: 'TEST', - password: 'PASSWORD', - reconnectPeriod: 33, // Increased reconnect period to allow DDOS protection to reset - keepalive: 55, - rejectUnauthorized: false - }, - - }; - var alexa = new AlexaLocal(options); - await sleep(10000) + test('Discover Devices', async () => { + server.publish('command/TEST/1', {"directive":{"header":{"namespace":"Alexa.Discovery","name":"Discover","payloadVersion":"3","messageId":"e68a6720-1222-4030-b044-f01360935f18"},"payload":{}}}); + expect(server).toReceiveMessage('junk'); + // await sleep(10000) }); @@ -58,6 +80,6 @@ describe('MQTT Client', () => { }); -async function sleep(ms) { +async function sleep(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)); } diff --git a/test/matchers.ts b/test/matchers.ts new file mode 100644 index 0000000..49baa34 --- /dev/null +++ b/test/matchers.ts @@ -0,0 +1,166 @@ +import { diff } from "jest-diff"; +import WS from "./websocket"; +import { DeserializedMessage } from "./websocket"; + +type ReceiveMessageOptions = { + timeout?: number; +}; + +declare global { + namespace jest { + interface Matchers { + toReceiveMessage( + message: DeserializedMessage, + options?: ReceiveMessageOptions, + ): Promise; + toHaveReceivedMessages( + messages: Array>, + ): R; + } + } +} + +const WAIT_DELAY = 1000; +const TIMEOUT = Symbol("timoeut"); + +const makeInvalidWsMessage = function makeInvalidWsMessage( + this: jest.MatcherUtils, + ws: WS, + matcher: string, +) { + return ( + this.utils.matcherHint( + this.isNot ? `.not.${matcher}` : `.${matcher}`, + "WS", + "expected", + ) + + "\n\n" + + `Expected the websocket object to be a valid WS mock.\n` + + `Received: ${typeof ws}\n` + + ` ${this.utils.printReceived(ws)}` + ); +}; + +expect.extend({ + async toReceiveMessage( + ws: WS, + expected: DeserializedMessage, + options?: ReceiveMessageOptions, + ) { + const isWS = ws instanceof WS; + if (!isWS) { + return { + pass: !!this.isNot, // always fail + message: makeInvalidWsMessage.bind(this, ws, "toReceiveMessage"), + }; + } + + const waitDelay = options?.timeout ?? WAIT_DELAY; + + let timeoutId; + const messageOrTimeout = await Promise.race([ + ws.nextMessage, + new Promise((resolve) => { + timeoutId = setTimeout(() => resolve(TIMEOUT), waitDelay); + }), + ]); + clearTimeout(timeoutId); + + if (messageOrTimeout === TIMEOUT) { + return { + pass: !!this.isNot, // always fail + message: () => + this.utils.matcherHint( + this.isNot ? ".not.toReceiveMessage" : ".toReceiveMessage", + "WS", + "expected", + ) + + "\n\n" + + `Expected the websocket server to receive a message,\n` + + `but it didn't receive anything in ${waitDelay}ms.`, + }; + } + const received = messageOrTimeout; + + const pass = this.equals(received, expected); + + const message = pass + ? () => + this.utils.matcherHint(".not.toReceiveMessage", "WS", "expected") + + "\n\n" + + `Expected the next received message to not equal:\n` + + ` ${this.utils.printExpected(expected)}\n` + + `Received:\n` + + ` ${this.utils.printReceived(received)}` + : () => { + const diffString = diff(expected, received, { expand: this.expand }); + return ( + this.utils.matcherHint(".toReceiveMessage", "WS", "expected") + + "\n\n" + + `Expected the next received message to equal:\n` + + ` ${this.utils.printExpected(expected)}\n` + + `Received:\n` + + ` ${this.utils.printReceived(received)}\n\n` + + `Difference:\n\n${diffString}` + ); + }; + + return { + actual: received, + expected, + message, + name: "toReceiveMessage", + pass, + }; + }, + + toHaveReceivedMessages(ws: WS, messages: Array) { + const isWS = ws instanceof WS; + if (!isWS) { + return { + pass: !!this.isNot, // always fail + message: makeInvalidWsMessage.bind(this, ws, "toHaveReceivedMessages"), + }; + } + + const received = messages.map((expected) => + // object comparison to handle JSON protocols + ws.messages.some((actual) => this.equals(actual, expected)), + ); + const pass = this.isNot ? received.some(Boolean) : received.every(Boolean); + const message = pass + ? () => + this.utils.matcherHint( + ".not.toHaveReceivedMessages", + "WS", + "expected", + ) + + "\n\n" + + `Expected the WS server to not have received the following messages:\n` + + ` ${this.utils.printExpected(messages)}\n` + + `But it received:\n` + + ` ${this.utils.printReceived(ws.messages)}` + : () => { + return ( + this.utils.matcherHint( + ".toHaveReceivedMessages", + "WS", + "expected", + ) + + "\n\n" + + `Expected the WS server to have received the following messages:\n` + + ` ${this.utils.printExpected(messages)}\n` + + `Received:\n` + + ` ${this.utils.printReceived(ws.messages)}\n\n` + ); + }; + + return { + actual: ws.messages, + expected: messages, + message, + name: "toHaveReceivedMessages", + pass, + }; + }, +}); \ No newline at end of file diff --git a/test/server.ts b/test/server.ts index b6dbd12..b182163 100644 --- a/test/server.ts +++ b/test/server.ts @@ -1,7 +1,7 @@ import * as net from 'net' import { TlsOptions } from 'tls' import * as tls from 'tls' -import Connection from 'mqtt-connection' +import * as Connection from 'mqtt-connection' import { Duplex } from 'stream' export type MqttServerListener = (client: Connection) => void @@ -29,7 +29,7 @@ export class MqttServer extends net.Server { this.on('client', listener) } } -} +} /** * MqttServerNoWait (w/o waiting for initialization) diff --git a/test/server_helpers_for_client_tests.ts b/test/server_helpers_for_client_tests.ts index bd537aa..27cea55 100644 --- a/test/server_helpers_for_client_tests.ts +++ b/test/server_helpers_for_client_tests.ts @@ -25,15 +25,21 @@ export default function serverBuilder( handler?: MqttServerListener, ): Server { const sockets = [] + + const defaultHandler: MqttServerListener = (serverClient) => { + sockets.push(serverClient) + serverClient.on('auth', (packet) => { + console.log('auth'); if (serverClient.writable) return false const rc = 'reasonCode' const connack = {} connack[rc] = 0 serverClient.connack(connack) }) + serverClient.on('connect', (packet) => { if (!serverClient.writable) return false let rc = 'returnCode' @@ -63,6 +69,7 @@ export default function serverBuilder( }) serverClient.on('publish', (packet) => { + console.log('publish'); if (!serverClient.writable) return false setImmediate(() => { switch (packet.qos) { diff --git a/tools/grabDiscover.js b/tools/grabDiscover.js index 81f98b6..8aa2ade 100644 --- a/tools/grabDiscover.js +++ b/tools/grabDiscover.js @@ -31,19 +31,28 @@ client.on('connect', function () { client.subscribe("response/" + clientUsername + "/#"); client.publish("command/" + clientUsername + "/1", JSON.stringify(discoveryCommand)); - client.on('message', function (topic, message) { + client.on('message', async function (topic, message) { try { var msg = JSON.parse(message.toString()); console.log(message.toString()); + + const homeDir = require('os').homedir(); // See: https://www.npmjs.com/package/os + const desktopDir = `${homeDir}/Desktop/discovery-`; + + fs.writeFileSync(desktopDir + clientUsername + '.json', message); + await sleep(5000); + process.exit(); // debug("Count", this.listenerCount(msg.directive.header.namespace.toLowerCase())); // process.exit(); } catch (err) { - options.log.error("ERROR: MQTT Message on topic \"%s\" triggered an internal error\n", topic, err); + console.log("ERROR: MQTT Message on topic \"%s\" triggered an internal error\n", topic, err); } }); }); - +async function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} diff --git a/tools/newParseAccessories.js b/tools/newParseAccessories.js index 8f3e6e6..af88186 100644 --- a/tools/newParseAccessories.js +++ b/tools/newParseAccessories.js @@ -157,7 +157,7 @@ var hbDevices = new Homebridges(endPoints, { "combine": combine, "inputs": inputs, "channel": channel, - "blind": true, + "blind": false, mergeServiceName: true }); debug("Homebridges"); diff --git a/tools/sendStatusCommand.js b/tools/sendStatusCommand.js new file mode 100644 index 0000000..5a9d645 --- /dev/null +++ b/tools/sendStatusCommand.js @@ -0,0 +1,60 @@ +"use strict"; +var debug = require('debug')('grabDiscover'); +var fs = require('fs'); +var mqtt = require('mqtt'); + +var passwords = JSON.parse(fs.readFileSync(process.argv[2])); + +var clientUsername = process.argv[3]; + +var statusCommand = JSON.parse(fs.readFileSync(process.argv[4])); + +if (!clientUsername) { + console.log("Missing clientUsername"); + process.exit(); +} + +var options = { + mqttURL: "mqtts://alexa.homebridge.ca:8883/", + mqttOptions: { + username: passwords.username, + password: passwords.password, + rejectUnauthorized: false + } +} + +var client = mqtt.connect(options.mqttURL, options.mqttOptions); + +var discoveryCommand = { "directive": { "header": { "namespace": "Alexa.Discovery", "name": "Discover", "payloadVersion": "3", "messageId": "d5945222-26dd-40ee-a59f-3ea49a7af43a" }, "payload": {} } }; + +client.on('connect', function () { + debug('connect', options.mqttURL, "command/" + clientUsername + "/#"); + client.removeAllListeners('message'); // Clean up event handlers + client.subscribe("response/" + clientUsername + "/#"); + client.publish("command/" + clientUsername + "/1", JSON.stringify(statusCommand)); + + client.on('message', async function (topic, message) { + try { + var msg = JSON.parse(message.toString()); + console.log(message.toString()); + + const homeDir = require('os').homedir(); // See: https://www.npmjs.com/package/os + const desktopDir = `${homeDir}/Desktop/status-`; + + fs.writeFileSync(desktopDir + clientUsername + '.json', message); + await sleep(5000); + process.exit(); + // debug("Count", this.listenerCount(msg.directive.header.namespace.toLowerCase())); + // process.exit(); + } catch (err) { + console.log("ERROR: MQTT Message on topic \"%s\" triggered an internal error\n", topic, err); + } + }); +}); + + +async function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +