diff --git a/package-lock.json b/package-lock.json index c79f2499..88d05448 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@types/mqtt": "^2.5.0", + "@types/uuid": "^10.0.0", "dotenv": "^16.4.1", "express": "^4.18.2", "jest": "^29.7.0", @@ -2011,9 +2013,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", - "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -3644,6 +3646,15 @@ "mongoose": "*" } }, + "node_modules/@types/mqtt": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@types/mqtt/-/mqtt-2.5.0.tgz", + "integrity": "sha512-n+0/ErBin30j+UbhcHGK/STjHjh65k85WNR6NlUjRG0g9yctpF12pS+SOkwz0wmp+7momAo9Cyi4Wmvy8UsCQg==", + "deprecated": "This is a stub types definition for MQTT (https://github.com/mqttjs/MQTT.js). MQTT provides its own type definitions, so you don't need @types/mqtt installed!", + "dependencies": { + "mqtt": "*" + } + }, "node_modules/@types/node": { "version": "20.10.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", @@ -3685,6 +3696,20 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, + "node_modules/@types/readable-stream": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.14.tgz", + "integrity": "sha512-xZn/AuUbCMShGsqH/ehZtGDwQtbx00M9rZ2ENLe4tOjFZ/JFeWMhEZkk2fEe1jAUqqEAURIkFJ7Az/go8mM1/w==", + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "node_modules/@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -3748,6 +3773,11 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==" + }, "node_modules/@types/webidl-conversions": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", @@ -4241,6 +4271,17 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -4968,6 +5009,25 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -5004,6 +5064,32 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.13.tgz", + "integrity": "sha512-tMncAcpsyjZgAVbVFupVIaB2xud13xxT59fdHkuszY2jdZkqIWfpQdmII1fOe3kOGAz0mNLTIHEm+KxpYsQKKg==", + "dependencies": { + "@types/readable-stream": "^4.0.0", + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -5152,6 +5238,29 @@ "node": ">=16.20.1" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -5523,6 +5632,11 @@ "node": ">= 12" } }, + "node_modules/commist": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz", + "integrity": "sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw==" + }, "node_modules/common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", @@ -5592,6 +5706,20 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", @@ -7478,6 +7606,14 @@ "node": ">= 0.6" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -7641,6 +7777,18 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "node_modules/fast-unique-numbers": { + "version": "8.0.13", + "resolved": "https://registry.npmjs.org/fast-unique-numbers/-/fast-unique-numbers-8.0.13.tgz", + "integrity": "sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g==", + "dependencies": { + "@babel/runtime": "^7.23.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.1.0" + } + }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -8412,6 +8560,11 @@ "he": "bin/he" } }, + "node_modules/help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==" + }, "node_modules/hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -8686,6 +8839,25 @@ "node": ">=4" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", @@ -10634,6 +10806,15 @@ "jiti": "bin/jiti.js" } }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -11423,6 +11604,71 @@ "node": ">=4.0.0" } }, + "node_modules/mqtt": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.7.2.tgz", + "integrity": "sha512-b5xIA9J/K1LTubSWKaNYYLxYIusQdip6o9/8bRWad2TelRr8xLifjQt+SnamDAwMp3O6NdvR9E8ae7VMuN02kg==", + "dependencies": { + "@types/readable-stream": "^4.0.5", + "@types/ws": "^8.5.9", + "commist": "^3.2.0", + "concat-stream": "^2.0.0", + "debug": "^4.3.4", + "help-me": "^5.0.0", + "lru-cache": "^10.0.1", + "minimist": "^1.2.8", + "mqtt": "^5.2.0", + "mqtt-packet": "^9.0.0", + "number-allocator": "^1.0.14", + "readable-stream": "^4.4.2", + "reinterval": "^1.1.0", + "rfdc": "^1.3.0", + "split2": "^4.2.0", + "worker-timers": "^7.1.4", + "ws": "^8.17.1" + }, + "bin": { + "mqtt": "build/bin/mqtt.js", + "mqtt_pub": "build/bin/pub.js", + "mqtt_sub": "build/bin/sub.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/mqtt-packet": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-9.0.0.tgz", + "integrity": "sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w==", + "dependencies": { + "bl": "^6.0.8", + "debug": "^4.3.4", + "process-nextick-args": "^2.0.1" + } + }, + "node_modules/mqtt/node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/mqtt/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/mquery": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", @@ -11636,6 +11882,15 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/number-allocator": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz", + "integrity": "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==", + "dependencies": { + "debug": "^4.3.1", + "js-sdsl": "4.3.0" + } + }, "node_modules/nwsapi": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", @@ -13426,6 +13681,14 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -15311,6 +15574,11 @@ "jsesc": "bin/jsesc" } }, + "node_modules/reinterval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", + "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==" + }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15465,6 +15733,11 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -16078,6 +16351,14 @@ "wbuf": "^1.7.3" } }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "engines": { + "node": ">= 10.x" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -17113,6 +17394,11 @@ "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==" }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -18166,6 +18452,37 @@ "workbox-core": "6.6.0" } }, + "node_modules/worker-timers": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/worker-timers/-/worker-timers-7.1.8.tgz", + "integrity": "sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw==", + "dependencies": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2", + "worker-timers-broker": "^6.1.8", + "worker-timers-worker": "^7.0.71" + } + }, + "node_modules/worker-timers-broker": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/worker-timers-broker/-/worker-timers-broker-6.1.8.tgz", + "integrity": "sha512-FUCJu9jlK3A8WqLTKXM9E6kAmI/dR1vAJ8dHYLMisLNB/n3GuaFIjJ7pn16ZcD1zCOf7P6H62lWIEBi+yz/zQQ==", + "dependencies": { + "@babel/runtime": "^7.24.5", + "fast-unique-numbers": "^8.0.13", + "tslib": "^2.6.2", + "worker-timers-worker": "^7.0.71" + } + }, + "node_modules/worker-timers-worker": { + "version": "7.0.71", + "resolved": "https://registry.npmjs.org/worker-timers-worker/-/worker-timers-worker-7.0.71.tgz", + "integrity": "sha512-ks/5YKwZsto1c2vmljroppOKCivB/ma97g9y77MAAz2TBBjPPgpoOiS1qYQKIgvGTr2QYPT3XhJWIB6Rj2MVPQ==", + "dependencies": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -18200,9 +18517,9 @@ } }, "node_modules/ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, @@ -19614,9 +19931,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "@babel/runtime": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", - "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -20756,6 +21073,14 @@ "mongoose": "*" } }, + "@types/mqtt": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@types/mqtt/-/mqtt-2.5.0.tgz", + "integrity": "sha512-n+0/ErBin30j+UbhcHGK/STjHjh65k85WNR6NlUjRG0g9yctpF12pS+SOkwz0wmp+7momAo9Cyi4Wmvy8UsCQg==", + "requires": { + "mqtt": "*" + } + }, "@types/node": { "version": "20.10.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", @@ -20797,6 +21122,22 @@ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, + "@types/readable-stream": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.14.tgz", + "integrity": "sha512-xZn/AuUbCMShGsqH/ehZtGDwQtbx00M9rZ2ENLe4tOjFZ/JFeWMhEZkk2fEe1jAUqqEAURIkFJ7Az/go8mM1/w==", + "requires": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -20860,6 +21201,11 @@ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==" + }, "@types/webidl-conversions": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", @@ -21227,6 +21573,14 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -21753,6 +22107,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -21780,6 +22139,31 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, + "bl": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.13.tgz", + "integrity": "sha512-tMncAcpsyjZgAVbVFupVIaB2xud13xxT59fdHkuszY2jdZkqIWfpQdmII1fOe3kOGAz0mNLTIHEm+KxpYsQKKg==", + "requires": { + "@types/readable-stream": "^4.0.0", + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "requires": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + } + } + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -21894,6 +22278,15 @@ "resolved": "https://registry.npmjs.org/bson/-/bson-6.2.0.tgz", "integrity": "sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==" }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -22157,6 +22550,11 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==" }, + "commist": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz", + "integrity": "sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw==" + }, "common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", @@ -22219,6 +22617,17 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, "confusing-browser-globals": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", @@ -23556,6 +23965,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -23699,6 +24113,15 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "fast-unique-numbers": { + "version": "8.0.13", + "resolved": "https://registry.npmjs.org/fast-unique-numbers/-/fast-unique-numbers-8.0.13.tgz", + "integrity": "sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g==", + "requires": { + "@babel/runtime": "^7.23.8", + "tslib": "^2.6.2" + } + }, "fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -24240,6 +24663,11 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, + "help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==" + }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -24440,6 +24868,11 @@ "harmony-reflect": "^1.4.6" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", @@ -25894,6 +26327,11 @@ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==" }, + "js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -26463,6 +26901,59 @@ "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==" }, + "mqtt": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.7.2.tgz", + "integrity": "sha512-b5xIA9J/K1LTubSWKaNYYLxYIusQdip6o9/8bRWad2TelRr8xLifjQt+SnamDAwMp3O6NdvR9E8ae7VMuN02kg==", + "requires": { + "@types/readable-stream": "^4.0.5", + "@types/ws": "^8.5.9", + "commist": "^3.2.0", + "concat-stream": "^2.0.0", + "debug": "^4.3.4", + "help-me": "^5.0.0", + "lru-cache": "^10.0.1", + "minimist": "^1.2.8", + "mqtt": "^5.2.0", + "mqtt-packet": "^9.0.0", + "number-allocator": "^1.0.14", + "readable-stream": "^4.4.2", + "reinterval": "^1.1.0", + "rfdc": "^1.3.0", + "split2": "^4.2.0", + "worker-timers": "^7.1.4", + "ws": "^8.17.1" + }, + "dependencies": { + "lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==" + }, + "readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "requires": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + } + } + } + }, + "mqtt-packet": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-9.0.0.tgz", + "integrity": "sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w==", + "requires": { + "bl": "^6.0.8", + "debug": "^4.3.4", + "process-nextick-args": "^2.0.1" + } + }, "mquery": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", @@ -26624,6 +27115,15 @@ "boolbase": "^1.0.0" } }, + "number-allocator": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz", + "integrity": "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==", + "requires": { + "debug": "^4.3.1", + "js-sdsl": "4.3.0" + } + }, "nwsapi": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", @@ -27716,6 +28216,11 @@ } } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -29161,6 +29666,11 @@ } } }, + "reinterval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", + "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==" + }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -29264,6 +29774,11 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, + "rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -29722,6 +30237,11 @@ "wbuf": "^1.7.3" } }, + "split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -30491,6 +31011,11 @@ "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz", "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q==" }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -31314,6 +31839,37 @@ "workbox-core": "6.6.0" } }, + "worker-timers": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/worker-timers/-/worker-timers-7.1.8.tgz", + "integrity": "sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw==", + "requires": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2", + "worker-timers-broker": "^6.1.8", + "worker-timers-worker": "^7.0.71" + } + }, + "worker-timers-broker": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/worker-timers-broker/-/worker-timers-broker-6.1.8.tgz", + "integrity": "sha512-FUCJu9jlK3A8WqLTKXM9E6kAmI/dR1vAJ8dHYLMisLNB/n3GuaFIjJ7pn16ZcD1zCOf7P6H62lWIEBi+yz/zQQ==", + "requires": { + "@babel/runtime": "^7.24.5", + "fast-unique-numbers": "^8.0.13", + "tslib": "^2.6.2", + "worker-timers-worker": "^7.0.71" + } + }, + "worker-timers-worker": { + "version": "7.0.71", + "resolved": "https://registry.npmjs.org/worker-timers-worker/-/worker-timers-worker-7.0.71.tgz", + "integrity": "sha512-ks/5YKwZsto1c2vmljroppOKCivB/ma97g9y77MAAz2TBBjPPgpoOiS1qYQKIgvGTr2QYPT3XhJWIB6Rj2MVPQ==", + "requires": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -31339,9 +31895,9 @@ } }, "ws": { - "version": "8.14.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", - "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "requires": {} }, "xml-name-validator": { diff --git a/package.json b/package.json index b1621741..889e98d7 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "author": "", "license": "ISC", "dependencies": { + "@types/mqtt": "^2.5.0", + "@types/uuid": "^10.0.0", "dotenv": "^16.4.1", "express": "^4.18.2", "jest": "^29.7.0", diff --git a/src/controllers/publishController.ts b/src/controllers/publishController.ts new file mode 100644 index 00000000..96f4abf7 --- /dev/null +++ b/src/controllers/publishController.ts @@ -0,0 +1,139 @@ +import { Request, Response } from 'express'; +import mqtt, { MqttClient } from 'mqtt'; +import { v1 as uuidv1 } from 'uuid'; +import mongoose from 'mongoose'; +import dotenv from 'dotenv'; +dotenv.config(); +import db from '../notification/publish/db'; // Import the db.ts file to access the dbURI variable +import Device from '../models/DeviceSchema'; // Import Device model +import User from '../models/UserSchema'; // Import User model + +const options = { + username: process.env.ACTIVE_MQ_USERNAME, + password: process.env.ACTIVE_MQ_PASSWORD, + clientId: `publish_${uuidv1()}`, + port: 1883, +}; +const topic = process.env.ACTIVE_MQ_TOPIC as string; // Type assertion + +// Establish Mongoose connection +mongoose.connect(db.dbURI, { + useNewUrlParser: true, + useUnifiedTopology: true, +} as mongoose.ConnectOptions).then(() => { + console.log('MongoDB connected'); +}).catch((error) => { + console.error('MongoDB connection error:', error); +}); + +// Register account +export const registerAccount = async (req: Request, res: Response) => { + try { + const { email, name, deletionDate, devicesLinked } = req.body; + const currentDate = new Date(); // Set current timestamp + const newAccountData = { + email, + name, + creationDate: currentDate, + lastUpdated: currentDate, + deletionDate: deletionDate ? new Date(deletionDate) : null, + }; + + const newAccount = new User(newAccountData); + + // Handle devicesLinked + if (devicesLinked && devicesLinked.length > 0) { + const devices = await Device.insertMany(devicesLinked); // Use Device to refer to the Device model + newAccount.devicesLinked = devices.map((device: any) => device._id); // Use explicit typing or adjust as needed + } else { + newAccount.devicesLinked = []; + } + + const savedAccount = await newAccount.save(); // Save the new account to the database + res.status(201).json(savedAccount); // HTTP 201 Created status code for successful creation + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +// Get all accounts +export const getAllAccounts = async (_req: Request, res: Response) => { + try { + const events = await User.find(); // Use User model + res.json(events); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +// Get account by ID +export const getAccountById = async (req: Request, res: Response) => { + try { + const event = await User.findById(req.params.id); // Use User model + + if (!event) { + res.status(404).json({ error: 'Event not found' }); + return; + } + + if (!req.params.id) { + res.status(400).json({ error: 'Bad Request' }); + return; + } + + res.json(event); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +// Delete account by ID +export const deleteAccountById = async (req: Request, res: Response) => { + try { + const events = await User.findByIdAndDelete(req.params.id); // Use User model + + if (!events) { + // If the document doesn't exist, return a 404 Not Found response + res.status(404).json({ error: 'Event not found' }); + return; + } + + // If the document is successfully deleted, return a success message + res.json({ message: 'Event deleted successfully' }); + } catch (error) { + // If an error occurs during deletion, return a 500 Internal Server Error response + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +// Publish message to MQTT +export const publishMessage = async (req: Request, res: Response) => { + const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); + + const event = { + id: req.params.id, + message: "From Publish Service", + }; + + client.on('connect', () => { + console.log("Broker connected"); + client.publish(topic, JSON.stringify(event), {}, (err) => { + if (err) { + console.error(`Error publishing message: ${err}`); + res.status(500).json({ error: 'Internal Server Error' }); + } else { + client.end(); + res.json(event); + } + }); + }); + + client.on('error', (error) => { + console.log(error); + res.status(500).json({ error: 'Internal Server Error' }); + }); +}; diff --git a/src/controllers/subscribeController.ts b/src/controllers/subscribeController.ts new file mode 100644 index 00000000..9ebb51b5 --- /dev/null +++ b/src/controllers/subscribeController.ts @@ -0,0 +1,73 @@ +import { Request, Response } from 'express'; +import mqtt, { MqttClient } from 'mqtt'; +import { v1 as uuidv1 } from 'uuid'; +import mongoose, { Schema, Document } from 'mongoose'; +import dotenv from 'dotenv'; +dotenv.config(); + +const options = { + username: process.env.ACTIVE_MQ_USERNAME, + password: process.env.ACTIVE_MQ_PASSWORD, + clientId: `subscribe_${uuidv1()}`, + port: 1883, +}; + +const topic = process.env.ACTIVE_MQ_TOPIC as string; // Type assertion +const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); // Type assertion + +client.on('connect', () => { + client.subscribe(topic); +}); + +let message: string | null = null; + +client.on('message', async (receivedTopic, msg) => { + console.log(`Message received on topic ${receivedTopic}`); + message = msg.toString(); + console.log(`Message received: ${message}`); + + // MongoDB logic for handling received message + try { + interface Subscription extends Document { + id: string; + message: string; + } + + const subscriptionSchema = new Schema({ + id: String, + message: String, + }); + + const SubscriptionModel = mongoose.model('Subscription', subscriptionSchema); + + const subscription = { + id: uuidv1(), + message: message, + }; + + await SubscriptionModel.create(subscription); + } catch (error) { + + // Simulate a 404 error + if (!message) { + throw { status: 404, message: 'Not Found' }; + } + + // Simulate a 403 error + if (message === 'Forbidden') { + throw { status: 403, message: 'Forbidden' }; + } + + // Simulate a 401 error + if (message === 'Unauthorized') { + throw { status: 401, message: 'Unauthorized' }; + } + + console.error(error); + } +}); + +// Check subscription status +export const checkSubscriptionStatus = (req: Request, res: Response) => { + res.status(200).json({ message: 'Subscriber is running' }); +}; diff --git a/src/controllers/userController.ts b/src/controllers/userController.ts new file mode 100644 index 00000000..efd31f8d --- /dev/null +++ b/src/controllers/userController.ts @@ -0,0 +1,74 @@ +import { Request, Response } from 'express'; +import Device, { DeviceInterface } from '../models/DeviceSchema'; // Import Device and DeviceInterface +import User, { UserInterface } from '../models/UserSchema'; // Import User and UserInterface + +// Controller to handle user registration +export const registerUser = async (req: Request, res: Response): Promise => { + try { + const { email, name, deletionDate, devicesLinked } = req.body; + const currentDate = new Date(); + + const newUser: UserInterface = new User({ + email, + name, + creationDate: currentDate, + lastUpdated: currentDate, + deletionDate: deletionDate ? new Date(deletionDate) : null, + devicesLinked: [], // Initialize as an empty array + }); + + if (devicesLinked && devicesLinked.length > 0) { + // Assuming devicesLinked is an array of objects that match DeviceInterface + const devices: any[] = await Device.insertMany(devicesLinked); // Cast to any[] temporarily + newUser.devicesLinked = devices.map((device: any) => device._id); // Map to _id + } + + const savedUser: UserInterface = await newUser.save(); + res.status(201).json(savedUser); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +export const getAllUsers = async (_req: Request, res: Response): Promise => { + try { + const users: UserInterface[] = await User.find().populate('devicesLinked'); + res.json(users); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +export const getUserById = async (req: Request, res: Response): Promise => { + try { + const user: UserInterface | null = await User.findById(req.params.id).populate('devicesLinked'); + + if (!user) { + res.status(404).json({ error: 'User not found' }); + return; + } + + res.json(user); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; + +export const deleteUserById = async (req: Request, res: Response): Promise => { + try { + const deletedUser: UserInterface | null = await User.findByIdAndDelete(req.params.id); + + if (!deletedUser) { + res.status(404).json({ error: 'User not found' }); + return; + } + + res.json({ message: 'User deleted successfully' }); + } catch (error) { + console.error(error); + res.status(500).json({ error: 'Internal Server Error' }); + } +}; diff --git a/src/models/DeviceSchema.ts b/src/models/DeviceSchema.ts index f798f331..7c07f65f 100644 --- a/src/models/DeviceSchema.ts +++ b/src/models/DeviceSchema.ts @@ -1,41 +1,55 @@ -import mongoose from 'mongoose'; +import mongoose, { Schema, Document } from 'mongoose'; -const DeviceSchema = new mongoose.Schema({ - uuid: { - type: String, - unique: true - }, - lastUpdated: { - type: Date, - default: new Date(), - required: true - }, - powered: { - type: Boolean - }, - poweredTimestamp: { - type: Date - }, - connected: { - type: Boolean - }, - connectedTimestamp: { - type: Date - }, - color: { - type: String - }, - colorTimestamp: { - type: String - }, - brightness: { - type: Number - }, - brightnessTimestamp:{ - type: Date - } -}) +export interface DeviceInterface extends Document { + uuid: string; + lastUpdated: Date; + powered?: boolean; + poweredTimestamp?: Date | null; + connected?: boolean; + connectedTimestamp?: Date | null; + color?: string; + colorTimestamp?: string; + brightness?: number; + brightnessTimestamp?: Date | null; +} -const Device = mongoose.model("Device", DeviceSchema); +const DeviceSchema: Schema = new mongoose.Schema({ + uuid: { + type: String, + unique: true, + required: true, + }, + lastUpdated: { + type: Date, + default: new Date(), + required: true, + }, + powered: { + type: Boolean, + }, + poweredTimestamp: { + type: Date, + }, + connected: { + type: Boolean, + }, + connectedTimestamp: { + type: Date, + }, + color: { + type: String, + }, + colorTimestamp: { + type: String, + }, + brightness: { + type: Number, + }, + brightnessTimestamp: { + type: Date, + }, +}); -module.exports = Device; \ No newline at end of file +const Device = mongoose.model('Device', DeviceSchema); + +export default Device; // Export Device as default diff --git a/src/models/UserSchema.ts b/src/models/UserSchema.ts index 78842fe4..71e31561 100644 --- a/src/models/UserSchema.ts +++ b/src/models/UserSchema.ts @@ -1,33 +1,43 @@ -import mongoose, { Schema } from 'mongoose'; +import mongoose, { Schema, Document } from 'mongoose'; +import { DeviceInterface } from './DeviceSchema'; // Import DeviceInterface -export const UserSchema = new mongoose.Schema({ - - creationDate:{ - type: Date, - default: Date.now() - }, - deletionDate:{ - type: Date, - default: null - }, - lastUpdated:{ - type: Date, - default: Date.now(), - required: true - }, - email: { - type: String, - unique: true - }, - name: { - type: String - }, - devicesLinked: [{ - type: Schema.Types.ObjectId, - ref: 'Device', - }] -}) +export interface UserInterface extends Document { + creationDate: Date; + deletionDate: Date | null; + lastUpdated: Date; + email: string; + name?: string; + devicesLinked: mongoose.Types.ObjectId[] | DeviceInterface[]; // Adjust type to handle populated documents +} -export const User = mongoose.model("Account", UserSchema) +const UserSchema: Schema = new mongoose.Schema({ + creationDate: { + type: Date, + default: Date.now(), + }, + deletionDate: { + type: Date, + default: null, + }, + lastUpdated: { + type: Date, + default: Date.now(), + required: true, + }, + email: { + type: String, + unique: true, + required: true, + }, + name: { + type: String, + }, + devicesLinked: [{ + type: Schema.Types.ObjectId, + ref: 'Device', + }], +}); -module.exports = User; \ No newline at end of file +const User = mongoose.model('User', UserSchema); + +export default User; diff --git a/src/notification/publish/publish.ts b/src/notification/publish/publish.ts index 50670603..89b98ca4 100644 --- a/src/notification/publish/publish.ts +++ b/src/notification/publish/publish.ts @@ -1,13 +1,10 @@ -import express from 'express'; import mqtt, { MqttClient } from 'mqtt'; import { v1 as uuidv1 } from 'uuid'; -import mongoose, { Schema, Document, ConnectOptions } from 'mongoose'; import dotenv from 'dotenv'; -dotenv.config(); -import db from './db'; // Import the db.ts file to access the dbURI variable +import express from 'express'; +dotenv.config(); -const server = express(); const options = { username: process.env.ACTIVE_MQ_USERNAME, password: process.env.ACTIVE_MQ_PASSWORD, @@ -15,195 +12,34 @@ const options = { port: 1883, }; const topic = process.env.ACTIVE_MQ_TOPIC as string; // Type assertion -server.use(express.json()); -// MongoDB event schema and model -// Define Device schema -interface Device extends Document { - uuid: string; - lastUpdated: Date; - powered?: boolean; - poweredTimestamp?: Date; - connected?: boolean; - connectedTimestamp?: Date; - color?: string; - colorTimestamp?: Date; - brightness?: number; - brightnessTimestamp?: Date; -} +const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); -const deviceSchema = new Schema({ - uuid: { - type: String, - unique: true, - }, - lastUpdated: { - type: Date, - default: Date.now, - required: true, - }, - powered: Boolean, - poweredTimestamp: Date, - connected: Boolean, - connectedTimestamp: Date, - color: String, - colorTimestamp: Date, - brightness: Number, - brightnessTimestamp: Date, +client.on('connect', () => { + console.log("Broker connected"); }); -const DeviceModel = mongoose.model('Device', deviceSchema); - -// MongoDB event schema and model -interface DeviceLinked extends Document { - device: typeof DeviceModel; -} - -interface accounts extends Document { - creationDate: Date; - deletionDate?: Date; - lastUpdated: Date; - email: string; - name: string; - devicesLinked?: DeviceLinked[]; -} - -const accountSchema = new Schema({ - creationDate: { type: Date, required: true }, - deletionDate: { type: Date }, - lastUpdated: { type: Date, required: true }, - email: { type: String, required: true }, - name: { type: String, required: true }, - devicesLinked: [{ type: Schema.Types.ObjectId, ref: 'Device' }], +client.on('error', (error) => { + console.error(error); }); -// Establish Mongoose connection -mongoose.connect(db.dbURI, { - useNewUrlParser: true, - useUnifiedTopology: true, -} as ConnectOptions) -.then(() => { - console.log('MongoDB connected'); - - // Define Mongoose model after connection is established - const EventModel = mongoose.model('accounts', accountSchema); - - // Define routes and other server logic after the connection is established - - server.get("/publish/accounts/all", async (_req, res) => { - try { - const events = await EventModel.find(); - res.json(events); - } catch (error) { - console.error(error); - res.status(500).json({ error: 'Internal Server Error' }); - } - }); - - server.get("/publish/accounts/:id", async (req, res) => { - try { - const event = await EventModel.findById(req.params.id); - - if (!event) { - res.status(404).json({ error: 'Event not found' }); - return; - } - - if (!req.params.id) { - res.status(400).json({ error: 'Bad Request' }); - return; - } - - res.json(event); - } catch (error) { - console.error(error); - res.status(500).json({ error: 'Internal Server Error' }); - } - }); - - server.post("/publish/accounts/new", async (req, res) => { - try { - const { email, name, deletionDate, devicesLinked } = req.body; - const currentDate = new Date(); // Set current timestamp - const newAccountData = { - email, - name, - creationDate: currentDate, - lastUpdated: currentDate, - deletionDate: deletionDate ? new Date(deletionDate) : null, - }; - - const newAccount = new EventModel(newAccountData); - - // Handle devicesLinked - if (devicesLinked && devicesLinked.length > 0) { - const devices = await DeviceModel.insertMany(devicesLinked); - newAccount.devicesLinked = devices.map(device => device._id); - } else { - newAccount.devicesLinked = []; // Set devicesLinked to null if not received - } - - const savedAccount = await newAccount.save(); // Save the new account to the database - res.status(201).json(savedAccount); // HTTP 201 Created status code for successful creation - } catch (error) { - console.error(error); - res.status(500).json({ error: 'Internal Server Error' }); - } - }); - - server.delete("/publish/accounts/:id/delete", async (req, res) => { - try { - const events = await EventModel.findByIdAndDelete(req.params.id); - - if (!events) { - // If the document doesn't exist, return a 404 Not Found response - res.status(404).json({ error: 'Event not found' }); - return; - } - - // If the document is successfully deleted, return a success message - res.json({ message: 'Event deleted successfully' }); - } catch (error) { - // If an error occurs during deletion, return a 500 Internal Server Error response - console.error(error); - res.status(500).json({ error: 'Internal Server Error' }); +const publishRouter = express.Router(); + +publishRouter.post('/publish', (req, res) => { + const event = { + id: uuidv1(), + message: "Hello from Publish Service", + }; + + client.publish(topic, JSON.stringify(event), {}, (err) => { + if (err) { + console.error(`Error publishing message: ${err}`); + res.status(500).json({ error: 'Failed to publish message' }); + } else { + console.log(`Published message: ${JSON.stringify(event)} to topic ${topic}`); + res.status(200).json({ message: 'Message published successfully' }); } }); - - - server.get("/publish/:id", async (req, res) => { - const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); - - const event = { - id: req.params.id, - message: "From Publish Service", - }; - - client.on('connect', () => { - console.log("Broker connected"); - client.publish(topic, JSON.stringify(event), {}, (err) => { - if (err) { - console.error(`Error publishing message: ${err}`); - res.status(500).json({ error: 'Internal Server Error' }); - } else { - client.end(); - res.json(event); - } - }); - }); - - client.on('error', (error) => { - console.log(error); - res.status(500).json({ error: 'Internal Server Error' }); - }); - }); - - server.listen(4000, () => { - console.log("Server connected"); - }); -}) -.catch((error) => { - console.error('MongoDB connection error:', error); }); -export default server; \ No newline at end of file +export { publishRouter }; diff --git a/src/notification/subscribe/subscribe.ts b/src/notification/subscribe/subscribe.ts index 312f2755..172cd009 100644 --- a/src/notification/subscribe/subscribe.ts +++ b/src/notification/subscribe/subscribe.ts @@ -1,77 +1,45 @@ -import express from 'express'; import mqtt, { MqttClient } from 'mqtt'; -import { v1 as uuidv1 } from 'uuid'; -import mongoose, { Schema, Document } from 'mongoose'; import dotenv from 'dotenv'; -dotenv.config(); +import express from 'express'; -const router = express.Router(); +dotenv.config(); const options = { username: process.env.ACTIVE_MQ_USERNAME, password: process.env.ACTIVE_MQ_PASSWORD, - clientId: `subscribe_${uuidv1()}`, + clientId: `subscribe_${Math.random().toString(16).substr(2, 8)}`, // Generate random client ID port: 1883, }; - const topic = process.env.ACTIVE_MQ_TOPIC as string; // Type assertion -const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); // Type assertion - -client.on('connect', () => { - client.subscribe(topic); -}); - -let message: string | null = null; - -client.on('message', async (receivedTopic, msg) => { - console.log(`Message received on topic ${receivedTopic}`); - message = msg.toString(); - console.log(`Message received: ${message}`); - - // MongoDB logic for handling received message - try { - interface Subscription extends Document { - id: string; - message: string; - } - - const subscriptionSchema = new Schema({ - id: String, - message: String, - }); - - const SubscriptionModel = mongoose.model('Subscription', subscriptionSchema); - const subscription = { - id: uuidv1(), - message: message, - }; - - await SubscriptionModel.create(subscription); - } catch (error) { - - // Simulate a 404 error - if (!message) { - throw { status: 404, message: 'Not Found' }; - } +const client: MqttClient = mqtt.connect(process.env.ACTIVE_MQ_ENDPOINT as string, options); - // Simulate a 403 error - if (message === 'Forbidden') { - throw { status: 403, message: 'Forbidden' }; +client.on('connect', () => { + console.log("Broker connected"); + client.subscribe(topic, (err) => { + if (err) { + console.error(`Error subscribing to topic: ${err}`); + } else { + console.log(`Subscribed to topic: ${topic}`); } + }); +}); - // Simulate a 401 error - if (message === 'Unauthorized') { - throw { status: 401, message: 'Unauthorized' }; - } - - console.error(error); - } +client.on('message', (topic, message) => { + console.log(`Received message from topic ${topic}: ${message.toString()}`); + // Process the received message as needed }); -// Define a route to check subscription status (example) -router.get('/status', (req: any, res: any) => { - res.status(200).json({ message: 'Subscriber is running' }); +client.on('error', (error) => { + console.error(error); }); -export default router; \ No newline at end of file +const subscribeRouter = express.Router(); + +// Define subscription routes if needed +// Example: +// subscribeRouter.get('/subscribe', (req, res) => { +// res.send('Subscribe endpoint'); +// }); + +export { subscribeRouter }; \ No newline at end of file diff --git a/src/routers/publishRoutes.ts b/src/routers/publishRoutes.ts new file mode 100644 index 00000000..366905be --- /dev/null +++ b/src/routers/publishRoutes.ts @@ -0,0 +1,18 @@ +import express from 'express'; +import { + registerAccount, + getAllAccounts, + getAccountById, + deleteAccountById, + publishMessage, +} from '../controllers/publishController'; + +const router = express.Router(); + +router.post('/accounts/new', registerAccount); +router.get('/accounts/all', getAllAccounts); +router.get('/accounts/:id', getAccountById); +router.delete('/accounts/:id/delete', deleteAccountById); +router.get('/:id', publishMessage); + +export default router; diff --git a/src/routers/subscribeRoutes.ts b/src/routers/subscribeRoutes.ts new file mode 100644 index 00000000..d2bfd3c1 --- /dev/null +++ b/src/routers/subscribeRoutes.ts @@ -0,0 +1,8 @@ +import express from 'express'; +import { checkSubscriptionStatus } from '../controllers/subscribeController'; + +const router = express.Router(); + +router.get('/status', checkSubscriptionStatus); + +export default router; diff --git a/src/routers/userRoutes.ts b/src/routers/userRoutes.ts new file mode 100644 index 00000000..00d6971e --- /dev/null +++ b/src/routers/userRoutes.ts @@ -0,0 +1,12 @@ +import express from 'express'; +import * as userController from '../controllers/userController'; + +const router = express.Router(); + +// Define routes +router.post('/users/register', userController.registerUser); +router.get('/users/all', userController.getAllUsers); +router.get('/users/:id', userController.getUserById); +router.delete('/users/:id/delete', userController.deleteUserById); + +export default router; diff --git a/src/routes/routes.ts b/src/routes/routes.ts index c74f4eed..83f75884 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -1,7 +1,7 @@ import express from 'express'; const User = require('../models/UserSchema'); -import publishRouter from '../notification/publish/publish'; -import subscribeRouter from '../notification/subscribe/subscribe'; +import { publishRouter } from '../notification/publish/publish'; +import { subscribeRouter } from '../notification/subscribe/subscribe'; const router = express.Router(); diff --git a/src/server/server.ts b/src/server/server.ts index ad117b25..d70c550d 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -1,17 +1,41 @@ -const express = require('express') -const app = express() -const { MongoClient, ServerApiVersion } = require('mongodb'); -const mongoose = require('mongoose') -const routeURLs = require('../src/routes/routes') -const cors = require('cors') -const User = require("../models/UserSchema") +const express = require('express'); +const mongoose = require('mongoose'); +const dotenv = require('dotenv'); +const cors = require('cors'); +const publishRouter = require('../src/publish/publishRoutes'); +const subscribeRouter = require('../src/subscribe/subscribeRoutes'); +const routeURLs = require('../src/routes/routes'); + +dotenv.config(); + +const app = express(); +const port = process.env.PORT || 4000; + +// MongoDB connection const USR = process.env.MONGO_INITDB_ROOT_USERNAME; const PSW = process.env.MONGO_INITDB_ROOT_PASSWORD; const DB = process.env.MONGO_INITDB_DATABASE; -mongoose.connect(`mongodb+srv://${USR}:${PSW}@${DB}.cgornhw.mongodb.net/Luminosity`, () => console.log('Database is connected')); -app.use(express.json()) -app.use(cors()) -app.use('/app', routeURLs) -app.listen(4000, () => console.log("server is up and running")) \ No newline at end of file +mongoose.connect(`mongodb+srv://${USR}:${PSW}@${DB}.cgornhw.mongodb.net/Luminosity`, { + useNewUrlParser: true, + useUnifiedTopology: true, +}, () => { + console.log('Database is connected'); +}).catch((error: any) => { + console.error('Database connection error:', error); +}); + +// Middleware setup +app.use(express.json()); +app.use(cors()); + +// Route setup +app.use('/app', routeURLs); // Existing routes +app.use('/publish', publishRouter); // Publish service routes +app.use('/subscribe', subscribeRouter); // Subscribe service routes + +// Start the server +app.listen(port, () => { + console.log(`Server is up and running on port ${port}`); +}); diff --git a/yarn.lock b/yarn.lock index 274a118f..7b02aeca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1109,10 +1109,10 @@ resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.8.4": - version "7.23.2" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz" - integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== +"@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.8", "@babel/runtime@^7.24.5", "@babel/runtime@^7.8.4": + version "7.24.7" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz" + integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw== dependencies: regenerator-runtime "^0.14.0" @@ -2295,6 +2295,13 @@ dependencies: mongoose "*" +"@types/mqtt@^2.5.0": + version "2.5.0" + resolved "https://registry.npmjs.org/@types/mqtt/-/mqtt-2.5.0.tgz" + integrity sha512-n+0/ErBin30j+UbhcHGK/STjHjh65k85WNR6NlUjRG0g9yctpF12pS+SOkwz0wmp+7momAo9Cyi4Wmvy8UsCQg== + dependencies: + mqtt "*" + "@types/node-forge@^1.3.0": version "1.3.10" resolved "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz" @@ -2334,6 +2341,14 @@ resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== +"@types/readable-stream@^4.0.0", "@types/readable-stream@^4.0.5": + version "4.0.14" + resolved "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.14.tgz" + integrity sha512-xZn/AuUbCMShGsqH/ehZtGDwQtbx00M9rZ2ENLe4tOjFZ/JFeWMhEZkk2fEe1jAUqqEAURIkFJ7Az/go8mM1/w== + dependencies: + "@types/node" "*" + safe-buffer "~5.1.1" + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz" @@ -2392,6 +2407,11 @@ resolved "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz" integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== +"@types/uuid@^10.0.0": + version "10.0.0" + resolved "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz" + integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== + "@types/webidl-conversions@*": version "7.0.3" resolved "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz" @@ -2404,7 +2424,7 @@ dependencies: "@types/webidl-conversions" "*" -"@types/ws@^8.5.5": +"@types/ws@^8.5.5", "@types/ws@^8.5.9": version "8.5.10" resolved "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz" integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A== @@ -2662,6 +2682,13 @@ abab@^2.0.3, abab@^2.0.5: resolved "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: version "1.3.8" resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz" @@ -3203,6 +3230,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + batch@0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz" @@ -3229,6 +3261,16 @@ binary-extensions@^2.0.0: resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +bl@^6.0.8: + version "6.0.13" + resolved "https://registry.npmjs.org/bl/-/bl-6.0.13.tgz" + integrity sha512-tMncAcpsyjZgAVbVFupVIaB2xud13xxT59fdHkuszY2jdZkqIWfpQdmII1fOe3kOGAz0mNLTIHEm+KxpYsQKKg== + dependencies: + "@types/readable-stream" "^4.0.0" + buffer "^6.0.3" + inherits "^2.0.4" + readable-stream "^4.2.0" + bluebird@^3.7.2: version "3.7.2" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" @@ -3321,6 +3363,14 @@ buffer-from@^1.0.0: resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + builtin-modules@^3.1.0: version "3.3.0" resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz" @@ -3588,6 +3638,11 @@ commander@^8.3.0: resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== +commist@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz" + integrity sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw== + common-path-prefix@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz" @@ -3628,6 +3683,16 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +concat-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz" + integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.0.2" + typedarray "^0.0.6" + confusing-browser-globals@^1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz" @@ -3972,7 +4037,7 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4, debug@4, debug@4.x: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@4, debug@4.x: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -4756,12 +4821,17 @@ etag@~1.8.1: resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@^3.2.0: +events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -4875,6 +4945,14 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== +fast-unique-numbers@^8.0.13: + version "8.0.13" + resolved "https://registry.npmjs.org/fast-unique-numbers/-/fast-unique-numbers-8.0.13.tgz" + integrity sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g== + dependencies: + "@babel/runtime" "^7.23.8" + tslib "^2.6.2" + fastq@^1.6.0: version "1.15.0" resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" @@ -5338,6 +5416,11 @@ he@^1.2.0: resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== +help-me@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz" + integrity sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg== + hoopy@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz" @@ -5508,6 +5591,11 @@ identity-obj-proxy@^3.0.0: dependencies: harmony-reflect "^1.4.6" +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore@^5.2.0: version "5.3.0" resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz" @@ -5547,7 +5635,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3, inherits@2, inherits@2.0.4: +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@2, inherits@2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -6785,6 +6873,11 @@ jiti@^1.19.1: resolved "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== +js-sdsl@4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz" + integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" @@ -7096,6 +7189,11 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" +lru-cache@^10.0.1: + version "10.2.2" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz" + integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" @@ -7260,7 +7358,7 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.0, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -7307,6 +7405,38 @@ mpath@0.9.0: resolved "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz" integrity sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew== +mqtt-packet@^9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-9.0.0.tgz" + integrity sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w== + dependencies: + bl "^6.0.8" + debug "^4.3.4" + process-nextick-args "^2.0.1" + +mqtt@*, mqtt@^5.2.0: + version "5.7.2" + resolved "https://registry.npmjs.org/mqtt/-/mqtt-5.7.2.tgz" + integrity sha512-b5xIA9J/K1LTubSWKaNYYLxYIusQdip6o9/8bRWad2TelRr8xLifjQt+SnamDAwMp3O6NdvR9E8ae7VMuN02kg== + dependencies: + "@types/readable-stream" "^4.0.5" + "@types/ws" "^8.5.9" + commist "^3.2.0" + concat-stream "^2.0.0" + debug "^4.3.4" + help-me "^5.0.0" + lru-cache "^10.0.1" + minimist "^1.2.8" + mqtt "^5.2.0" + mqtt-packet "^9.0.0" + number-allocator "^1.0.14" + readable-stream "^4.4.2" + reinterval "^1.1.0" + rfdc "^1.3.0" + split2 "^4.2.0" + worker-timers "^7.1.4" + ws "^8.17.1" + mquery@5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz" @@ -7447,6 +7577,14 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" +number-allocator@^1.0.14: + version "1.0.14" + resolved "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz" + integrity sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA== + dependencies: + debug "^4.3.1" + js-sdsl "4.3.0" + nwsapi@^2.2.0: version "2.2.7" resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz" @@ -8395,11 +8533,16 @@ pretty-format@^29.0.0, pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" -process-nextick-args@~2.0.0: +process-nextick-args@^2.0.1, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +process@^0.11.10: + version "0.11.10" + resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + promise@^8.1.0: version "8.3.0" resolved "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz" @@ -8672,7 +8815,7 @@ readable-stream@^2.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6: +readable-stream@^3.0.2, readable-stream@^3.0.6: version "3.6.2" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -8681,6 +8824,28 @@ readable-stream@^3.0.6: string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@^4.2.0: + version "4.5.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz" + integrity sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + string_decoder "^1.3.0" + +readable-stream@^4.4.2: + version "4.5.2" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz" + integrity sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + string_decoder "^1.3.0" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" @@ -8769,6 +8934,11 @@ regjsparser@^0.9.1: dependencies: jsesc "~0.5.0" +reinterval@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz" + integrity sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ== + relateurl@^0.2.7: version "0.2.7" resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz" @@ -8866,6 +9036,11 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.3.0: + version "1.4.1" + resolved "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" @@ -9318,6 +9493,11 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +split2@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -9357,7 +9537,7 @@ statuses@2.0.1: resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -string_decoder@^1.1.1: +string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -9810,7 +9990,7 @@ tslib@^1.8.1: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, "tslib@1 || 2": +tslib@^2.0.3, tslib@^2.6.2, "tslib@1 || 2": version "2.6.2" resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -9926,6 +10106,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + typescript-coverage-report@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/typescript-coverage-report/-/typescript-coverage-report-0.7.0.tgz" @@ -10566,6 +10751,34 @@ workbox-window@6.6.0: "@types/trusted-types" "^2.0.2" workbox-core "6.6.0" +worker-timers-broker@^6.1.8: + version "6.1.8" + resolved "https://registry.npmjs.org/worker-timers-broker/-/worker-timers-broker-6.1.8.tgz" + integrity sha512-FUCJu9jlK3A8WqLTKXM9E6kAmI/dR1vAJ8dHYLMisLNB/n3GuaFIjJ7pn16ZcD1zCOf7P6H62lWIEBi+yz/zQQ== + dependencies: + "@babel/runtime" "^7.24.5" + fast-unique-numbers "^8.0.13" + tslib "^2.6.2" + worker-timers-worker "^7.0.71" + +worker-timers-worker@^7.0.71: + version "7.0.71" + resolved "https://registry.npmjs.org/worker-timers-worker/-/worker-timers-worker-7.0.71.tgz" + integrity sha512-ks/5YKwZsto1c2vmljroppOKCivB/ma97g9y77MAAz2TBBjPPgpoOiS1qYQKIgvGTr2QYPT3XhJWIB6Rj2MVPQ== + dependencies: + "@babel/runtime" "^7.24.5" + tslib "^2.6.2" + +worker-timers@^7.1.4: + version "7.1.8" + resolved "https://registry.npmjs.org/worker-timers/-/worker-timers-7.1.8.tgz" + integrity sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw== + dependencies: + "@babel/runtime" "^7.24.5" + tslib "^2.6.2" + worker-timers-broker "^6.1.8" + worker-timers-worker "^7.0.71" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" @@ -10603,10 +10816,10 @@ ws@^7.4.6: resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== -ws@^8.13.0: - version "8.14.2" - resolved "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz" - integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== +ws@^8.13.0, ws@^8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xml-name-validator@^3.0.0: version "3.0.0"