mqtt 5.7.3 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/build/lib/KeepaliveManager.d.ts +2 -1
- package/build/lib/KeepaliveManager.js +6 -1
- package/build/lib/KeepaliveManager.js.map +1 -1
- package/build/lib/client.d.ts +3 -2
- package/build/lib/client.js +12 -2
- package/build/lib/client.js.map +1 -1
- package/build/lib/handlers/index.js +1 -1
- package/build/lib/handlers/index.js.map +1 -1
- package/build/lib/is-browser.js +5 -1
- package/build/lib/is-browser.js.map +1 -1
- package/build/mqtt.d.ts +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +5 -5
- package/dist/mqtt.js +15 -6
- package/dist/mqtt.min.js +5 -5
- package/package.json +1 -1
- package/src/lib/KeepaliveManager.ts +7 -2
- package/src/lib/client.ts +17 -3
- package/src/lib/handlers/index.ts +1 -1
- package/src/lib/is-browser.ts +7 -1
- package/src/mqtt.ts +1 -0
package/dist/mqtt.js
CHANGED
|
@@ -12634,7 +12634,7 @@ var mqtt = (() => {
|
|
|
12634
12634
|
// package-json:../../package.json
|
|
12635
12635
|
var require_package = __commonJS({
|
|
12636
12636
|
"package-json:../../package.json"(exports5, module) {
|
|
12637
|
-
module.exports = { version: "5.
|
|
12637
|
+
module.exports = { version: "5.8.1" };
|
|
12638
12638
|
}
|
|
12639
12639
|
});
|
|
12640
12640
|
|
|
@@ -17223,7 +17223,7 @@ var mqtt = (() => {
|
|
|
17223
17223
|
break;
|
|
17224
17224
|
case "pingresp":
|
|
17225
17225
|
client.log("_handlePacket :: received pingresp");
|
|
17226
|
-
client.reschedulePing();
|
|
17226
|
+
client.reschedulePing(true);
|
|
17227
17227
|
done();
|
|
17228
17228
|
break;
|
|
17229
17229
|
case "disconnect":
|
|
@@ -17282,12 +17282,13 @@ var mqtt = (() => {
|
|
|
17282
17282
|
}
|
|
17283
17283
|
return false;
|
|
17284
17284
|
};
|
|
17285
|
+
var isTxikijsEnv = () => typeof navigator !== "undefined" && navigator.userAgent === "txiki.js";
|
|
17285
17286
|
var isWebWorkerEnv = () => {
|
|
17286
17287
|
var _a, _b;
|
|
17287
17288
|
return Boolean(typeof self === "object" && ((_b = (_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.includes("WorkerGlobalScope")));
|
|
17288
17289
|
};
|
|
17289
17290
|
var isReactNativeEnv = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
17290
|
-
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv();
|
|
17291
|
+
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv() || isTxikijsEnv();
|
|
17291
17292
|
exports5.isWebWorker = isWebWorkerEnv();
|
|
17292
17293
|
exports5.isReactNativeBrowser = isReactNativeEnv();
|
|
17293
17294
|
exports5.default = isBrowser;
|
|
@@ -17657,7 +17658,7 @@ var mqtt = (() => {
|
|
|
17657
17658
|
constructor(client, variant) {
|
|
17658
17659
|
this.destroyed = false;
|
|
17659
17660
|
this.client = client;
|
|
17660
|
-
this.timer = (0, get_timer_1.default)(variant);
|
|
17661
|
+
this.timer = typeof variant === "object" && "set" in variant && "clear" in variant ? variant : (0, get_timer_1.default)(variant);
|
|
17661
17662
|
this.setKeepalive(client.options.keepalive);
|
|
17662
17663
|
}
|
|
17663
17664
|
clear() {
|
|
@@ -17912,6 +17913,12 @@ var mqtt = (() => {
|
|
|
17912
17913
|
const packets = [];
|
|
17913
17914
|
this.log("connect :: calling method to clear reconnect");
|
|
17914
17915
|
this._clearReconnect();
|
|
17916
|
+
if (this.disconnected && !this.reconnecting) {
|
|
17917
|
+
this.incomingStore = this.options.incomingStore || new store_1.default();
|
|
17918
|
+
this.outgoingStore = this.options.outgoingStore || new store_1.default();
|
|
17919
|
+
this.disconnecting = false;
|
|
17920
|
+
this.disconnected = false;
|
|
17921
|
+
}
|
|
17915
17922
|
this.log("connect :: using streamBuilder provided to client to create stream");
|
|
17916
17923
|
this.stream = this.streamBuilder(this);
|
|
17917
17924
|
parser.on("packet", (packet) => {
|
|
@@ -18322,6 +18329,8 @@ var mqtt = (() => {
|
|
|
18322
18329
|
});
|
|
18323
18330
|
if (this._deferredReconnect) {
|
|
18324
18331
|
this._deferredReconnect();
|
|
18332
|
+
} else if (this.options.reconnectPeriod === 0 || this.options.manualConnect) {
|
|
18333
|
+
this.disconnecting = false;
|
|
18325
18334
|
}
|
|
18326
18335
|
};
|
|
18327
18336
|
const finish = () => {
|
|
@@ -18683,8 +18692,8 @@ var mqtt = (() => {
|
|
|
18683
18692
|
this.keepaliveManager = null;
|
|
18684
18693
|
}
|
|
18685
18694
|
}
|
|
18686
|
-
reschedulePing() {
|
|
18687
|
-
if (this.keepaliveManager && this.options.keepalive && this.options.reschedulePings) {
|
|
18695
|
+
reschedulePing(force = false) {
|
|
18696
|
+
if (this.keepaliveManager && this.options.keepalive && (force || this.options.reschedulePings)) {
|
|
18688
18697
|
this._reschedulePing();
|
|
18689
18698
|
}
|
|
18690
18699
|
}
|