diff --git a/package-lock.json b/package-lock.json index 0b8439b..8134d8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ulms/api-clients", - "version": "7.6.2", + "version": "7.6.2-dev.1-update-mqtt", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ulms/api-clients", - "version": "7.6.2", + "version": "7.6.2-dev.1-update-mqtt", "license": "MIT", "dependencies": { "axios": "1.6.2", @@ -14,7 +14,7 @@ "events": "3.3.0", "lodash": "4.17.21", "mime": "2.6.0", - "mqtt": "5.5.5", + "mqtt": "5.6.2", "mqtt-pattern": "2.1.0", "nats.ws": "1.7.2", "p-queue": "7.4.1", @@ -9730,9 +9730,9 @@ } }, "node_modules/mqtt": { - "version": "5.5.5", - "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.5.5.tgz", - "integrity": "sha512-vWglkVfumjnI53/tV+RMWbDuQL4ldGqc/wFX2EHkMy9sSV7Q0TQK+HcAtmg2QupI8DpcyNpoe2mNhaO/H4ILUg==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.6.2.tgz", + "integrity": "sha512-bbmR8b4luc4UedbteHJ5Idc5zngJglVyogrJcE2buu+5Iipk5e3du3doBr+HCqKJt/OfuLQ9v0SfVgs6zOGZlg==", "dependencies": { "@types/readable-stream": "^4.0.5", "@types/ws": "^8.5.9", diff --git a/package.json b/package.json index eae3a5d..1b46b27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ulms/api-clients", - "version": "7.6.2", + "version": "7.6.2-dev.1-update-mqtt", "description": "JavaScript API clients for ULMS platform", "keywords": [], "homepage": "https://github.com/foxford/ulms-api-clients-js#readme", @@ -40,7 +40,7 @@ "events": "3.3.0", "lodash": "4.17.21", "mime": "2.6.0", - "mqtt": "5.5.5", + "mqtt": "5.6.2", "mqtt-pattern": "2.1.0", "nats.ws": "1.7.2", "p-queue": "7.4.1", diff --git a/src/mqtt.js b/src/mqtt.js index 5f4d951..5469de9 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -14,6 +14,7 @@ const defaultOptions = { }, protocolVersion: 5, reconnectPeriod: 0, + // timerVariant: 'native', username: '', } @@ -83,7 +84,11 @@ class MQTTClient { } connect(options) { - this.client = mqtt.connect(this.url, options) + this.client = mqtt.connect(this.url, { + ...options, + // todo: remove it after fix (https://github.com/mqttjs/MQTT.js/issues/1873) + transformWsUrl: () => this.url, + }) this.bindEventListeners() }