mqtt 5.10.3 → 5.10.4
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 +2 -1
- package/build/bin/mqtt.js.map +1 -1
- package/build/bin/pub.js +1 -1
- package/build/bin/pub.js.map +1 -1
- package/build/bin/sub.js +1 -1
- package/build/bin/sub.js.map +1 -1
- package/build/index.js +17 -7
- package/build/index.js.map +1 -1
- package/build/lib/BufferedDuplex.js +3 -3
- package/build/lib/BufferedDuplex.js.map +1 -1
- package/build/lib/KeepaliveManager.js.map +1 -1
- package/build/lib/client.d.ts +0 -2
- package/build/lib/client.js +17 -7
- package/build/lib/client.js.map +1 -1
- package/build/lib/connect/ali.js.map +1 -1
- package/build/lib/connect/index.js +6 -7
- package/build/lib/connect/index.js.map +1 -1
- package/build/lib/connect/tls.js.map +1 -1
- package/build/lib/connect/ws.js +4 -3
- package/build/lib/connect/ws.js.map +1 -1
- package/build/lib/connect/wx.js.map +1 -1
- package/build/lib/default-message-id-provider.js.map +1 -1
- package/build/lib/get-timer.js +17 -7
- package/build/lib/get-timer.js.map +1 -1
- package/build/lib/handlers/ack.js.map +1 -1
- package/build/lib/handlers/auth.js.map +1 -1
- package/build/lib/handlers/connack.js.map +1 -1
- package/build/lib/handlers/index.js.map +1 -1
- package/build/lib/handlers/publish.js.map +1 -1
- package/build/lib/handlers/pubrel.js.map +1 -1
- package/build/lib/is-browser.js.map +1 -1
- package/build/lib/shared.d.ts +0 -1
- package/build/lib/shared.js +2 -2
- package/build/lib/shared.js.map +1 -1
- package/build/lib/store.js.map +1 -1
- package/build/lib/topic-alias-recv.js.map +1 -1
- package/build/lib/topic-alias-send.js.map +1 -1
- package/build/lib/validations.js +2 -3
- package/build/lib/validations.js.map +1 -1
- package/build/mqtt.js +17 -7
- package/build/mqtt.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +8 -5
- package/dist/mqtt.js +4471 -5381
- package/dist/mqtt.min.js +8 -5
- package/package.json +32 -32
- package/src/lib/BufferedDuplex.ts +1 -1
- package/src/lib/client.ts +1 -1
- package/src/lib/connect/index.ts +2 -5
- package/src/lib/connect/ws.ts +4 -3
- package/src/lib/shared.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mqtt",
|
|
3
3
|
"description": "A library for the MQTT protocol",
|
|
4
|
-
"version": "5.10.
|
|
4
|
+
"version": "5.10.4",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Adam Rudd <adamvrr@gmail.com>",
|
|
7
7
|
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
|
|
@@ -111,48 +111,48 @@
|
|
|
111
111
|
"net": false
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@types/readable-stream": "^4.0.
|
|
115
|
-
"@types/ws": "^8.5.
|
|
114
|
+
"@types/readable-stream": "^4.0.18",
|
|
115
|
+
"@types/ws": "^8.5.14",
|
|
116
116
|
"commist": "^3.2.0",
|
|
117
117
|
"concat-stream": "^2.0.0",
|
|
118
|
-
"debug": "^4.
|
|
118
|
+
"debug": "^4.4.0",
|
|
119
119
|
"help-me": "^5.0.0",
|
|
120
|
-
"lru-cache": "^10.
|
|
120
|
+
"lru-cache": "^10.4.3",
|
|
121
121
|
"minimist": "^1.2.8",
|
|
122
122
|
"mqtt-packet": "^9.0.1",
|
|
123
123
|
"number-allocator": "^1.0.14",
|
|
124
|
-
"readable-stream": "^4.
|
|
124
|
+
"readable-stream": "^4.7.0",
|
|
125
125
|
"reinterval": "^1.1.0",
|
|
126
|
-
"rfdc": "^1.
|
|
126
|
+
"rfdc": "^1.4.1",
|
|
127
127
|
"split2": "^4.2.0",
|
|
128
|
-
"worker-timers": "^7.1.
|
|
129
|
-
"ws": "^8.
|
|
128
|
+
"worker-timers": "^7.1.8",
|
|
129
|
+
"ws": "^8.18.0"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@esm-bundle/chai": "^4.3.4
|
|
132
|
+
"@esm-bundle/chai": "^4.3.4",
|
|
133
133
|
"@release-it/conventional-changelog": "^7.0.2",
|
|
134
|
-
"@types/chai": "^4.3.
|
|
135
|
-
"@types/node": "^20.
|
|
136
|
-
"@types/sinon": "^17.0.
|
|
137
|
-
"@types/tape": "^5.
|
|
138
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
139
|
-
"@typescript-eslint/parser": "^6.
|
|
140
|
-
"@web/test-runner": "^0.
|
|
134
|
+
"@types/chai": "^4.3.20",
|
|
135
|
+
"@types/node": "^20.17.16",
|
|
136
|
+
"@types/sinon": "^17.0.3",
|
|
137
|
+
"@types/tape": "^5.8.1",
|
|
138
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
139
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
140
|
+
"@web/test-runner": "^0.19.0",
|
|
141
141
|
"@web/test-runner-playwright": "^0.11.0",
|
|
142
142
|
"aedes-cli": "^0.8.0",
|
|
143
|
-
"chai": "^4.
|
|
144
|
-
"chokidar": "^3.
|
|
143
|
+
"chai": "^4.5.0",
|
|
144
|
+
"chokidar": "^3.6.0",
|
|
145
145
|
"conventional-changelog-cli": "^4.1.0",
|
|
146
146
|
"end-of-stream": "^1.4.4",
|
|
147
|
-
"esbuild": "^0.
|
|
147
|
+
"esbuild": "^0.24.2",
|
|
148
148
|
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
149
|
-
"esbuild-register": "^3.
|
|
150
|
-
"eslint": "^8.
|
|
149
|
+
"esbuild-register": "^3.6.0",
|
|
150
|
+
"eslint": "^8.57.1",
|
|
151
151
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
152
152
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
153
|
-
"eslint-config-prettier": "^9.
|
|
154
|
-
"eslint-plugin-import": "^2.
|
|
155
|
-
"eslint-plugin-prettier": "^5.
|
|
153
|
+
"eslint-config-prettier": "^9.1.0",
|
|
154
|
+
"eslint-plugin-import": "^2.31.0",
|
|
155
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
156
156
|
"global": "^4.4.0",
|
|
157
157
|
"leaked-handles": "^5.2.0",
|
|
158
158
|
"mkdirp": "^3.0.1",
|
|
@@ -160,14 +160,14 @@
|
|
|
160
160
|
"mqtt-level-store": "^3.1.0",
|
|
161
161
|
"nyc": "^15.1.0",
|
|
162
162
|
"pre-commit": "^1.2.2",
|
|
163
|
-
"prettier": "^3.
|
|
164
|
-
"release-it": "^16.
|
|
165
|
-
"rimraf": "^5.0.
|
|
163
|
+
"prettier": "^3.4.2",
|
|
164
|
+
"release-it": "^16.3.0",
|
|
165
|
+
"rimraf": "^5.0.10",
|
|
166
166
|
"should": "^13.2.3",
|
|
167
|
-
"sinon": "^17.0.
|
|
167
|
+
"sinon": "^17.0.2",
|
|
168
168
|
"snazzy": "^9.0.0",
|
|
169
|
-
"tape": "^5.
|
|
170
|
-
"ts-node": "^10.9.
|
|
171
|
-
"typescript": "^5.
|
|
169
|
+
"tape": "^5.9.0",
|
|
170
|
+
"ts-node": "^10.9.2",
|
|
171
|
+
"typescript": "^5.7.3"
|
|
172
172
|
}
|
|
173
173
|
}
|
package/src/lib/client.ts
CHANGED
|
@@ -571,7 +571,7 @@ export default class MqttClient extends TypedEventEmitter<MqttClientEventCallbac
|
|
|
571
571
|
? options.customHandleAcks
|
|
572
572
|
: (...args) => {
|
|
573
573
|
args[3](null, 0)
|
|
574
|
-
|
|
574
|
+
}
|
|
575
575
|
|
|
576
576
|
// Disable pre-generated write cache if requested. Will allocate buffers on-the-fly instead. WARNING: This can affect write performance
|
|
577
577
|
if (!this.options.writeCache) {
|
package/src/lib/connect/index.ts
CHANGED
|
@@ -72,17 +72,14 @@ function connect(
|
|
|
72
72
|
parsedOptions.protocol = parsedUrl.protocol as MqttProtocol
|
|
73
73
|
parsedOptions.path = parsedUrl.path
|
|
74
74
|
|
|
75
|
-
parsedOptions.protocol = parsedOptions.protocol?.replace(
|
|
76
|
-
/:$/,
|
|
77
|
-
'',
|
|
78
|
-
) as MqttProtocol
|
|
79
|
-
|
|
80
75
|
opts = { ...parsedOptions, ...opts }
|
|
81
76
|
|
|
82
77
|
// when parsing an url expect the protocol to be set
|
|
83
78
|
if (!opts.protocol) {
|
|
84
79
|
throw new Error('Missing protocol')
|
|
85
80
|
}
|
|
81
|
+
|
|
82
|
+
opts.protocol = opts.protocol.replace(/:$/, '') as MqttProtocol
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
opts.unixSocket = opts.unixSocket || opts.protocol?.includes('+unix')
|
package/src/lib/connect/ws.ts
CHANGED
|
@@ -257,14 +257,15 @@ const browserStreamBuilder: StreamBuilder = (client, opts) => {
|
|
|
257
257
|
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event
|
|
258
258
|
*/
|
|
259
259
|
async function onMessage(event: MessageEvent) {
|
|
260
|
+
if (!proxy || proxy.destroyed || !proxy.readable) {
|
|
261
|
+
return
|
|
262
|
+
}
|
|
260
263
|
let { data } = event
|
|
261
264
|
if (data instanceof ArrayBuffer) data = Buffer.from(data)
|
|
262
265
|
else if (data instanceof Blob)
|
|
263
266
|
data = Buffer.from(await new Response(data).arrayBuffer())
|
|
264
267
|
else data = Buffer.from(data as string, 'utf8')
|
|
265
|
-
|
|
266
|
-
proxy.push(data)
|
|
267
|
-
}
|
|
268
|
+
proxy.push(data)
|
|
268
269
|
}
|
|
269
270
|
|
|
270
271
|
function socketWriteBrowser(
|
package/src/lib/shared.ts
CHANGED