mqtt 5.8.1 → 5.9.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 -7
- package/build/lib/BufferedDuplex.js +3 -1
- package/build/lib/BufferedDuplex.js.map +1 -1
- package/build/lib/client.d.ts +2 -1
- package/build/lib/client.js.map +1 -1
- package/build/lib/connect/index.d.ts +1 -0
- package/build/lib/connect/index.js +21 -16
- package/build/lib/connect/index.js.map +1 -1
- package/build/lib/connect/ws.d.ts +3 -2
- package/build/lib/connect/ws.js +7 -3
- package/build/lib/connect/ws.js.map +1 -1
- package/build/lib/handlers/ack.js +3 -4
- package/build/lib/handlers/ack.js.map +1 -1
- package/build/lib/is-browser.js +1 -5
- package/build/lib/is-browser.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.esm.js +5 -5
- package/dist/mqtt.js +553 -553
- package/dist/mqtt.min.js +5 -5
- package/package.json +1 -1
- package/src/lib/BufferedDuplex.ts +3 -1
- package/src/lib/client.ts +8 -1
- package/src/lib/connect/index.ts +31 -19
- package/src/lib/connect/ws.ts +6 -4
- package/src/lib/handlers/ack.ts +9 -5
- package/src/lib/is-browser.ts +1 -7
package/dist/mqtt.js
CHANGED
|
@@ -24,18 +24,9 @@ var mqtt = (() => {
|
|
|
24
24
|
};
|
|
25
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
26
|
|
|
27
|
-
// node_modules/esbuild-plugin-polyfill-node/polyfills/
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
"node_modules/esbuild-plugin-polyfill-node/polyfills/navigator.js"() {
|
|
31
|
-
navigator = {
|
|
32
|
-
deviceMemory: 8,
|
|
33
|
-
// Highest allowed value
|
|
34
|
-
hardwareConcurrency: 8,
|
|
35
|
-
// Fairly common default
|
|
36
|
-
language: "en-US"
|
|
37
|
-
// Most common default
|
|
38
|
-
};
|
|
27
|
+
// node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js
|
|
28
|
+
var init_dirname = __esm({
|
|
29
|
+
"node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js"() {
|
|
39
30
|
}
|
|
40
31
|
});
|
|
41
32
|
|
|
@@ -210,9 +201,9 @@ var mqtt = (() => {
|
|
|
210
201
|
var queue, draining, currentQueue, queueIndex, title, arch, platform, env, argv, execArgv, version, versions, emitWarning, binding, umask, cwd, chdir, release, _rawDebug, moduleLoadList, domain, _exiting, config, reallyExit, _kill, cpuUsage, resourceUsage, memoryUsage, kill, exit, openStdin, allowedNodeEnvironmentFlags, features, _fatalExceptions, setUncaughtExceptionCaptureCallback, _tickCallback, _debugProcess, _debugEnd, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, stdout, stderr, stdin, abort, pid, ppid, execPath, debugPort, argv0, _preload_modules, setSourceMapsEnabled, _performance, nowOffset, nanoPerSec, _maxListeners, _events, _eventsCount, addListener, once, off, removeListener, removeAllListeners, emit, prependListener, prependOnceListener, process;
|
|
211
202
|
var init_process = __esm({
|
|
212
203
|
"node_modules/@jspm/core/nodelibs/browser/process.js"() {
|
|
204
|
+
init_dirname();
|
|
213
205
|
init_buffer2();
|
|
214
206
|
init_process2();
|
|
215
|
-
init_navigator();
|
|
216
207
|
queue = [];
|
|
217
208
|
draining = false;
|
|
218
209
|
queueIndex = -1;
|
|
@@ -2237,9 +2228,9 @@ var mqtt = (() => {
|
|
|
2237
2228
|
var exports$3, _dewExec$2, exports$2, _dewExec$1, exports$1, _dewExec, exports, Buffer2, INSPECT_MAX_BYTES, kMaxLength;
|
|
2238
2229
|
var init_buffer = __esm({
|
|
2239
2230
|
"node_modules/@jspm/core/nodelibs/browser/buffer.js"() {
|
|
2231
|
+
init_dirname();
|
|
2240
2232
|
init_buffer2();
|
|
2241
2233
|
init_process2();
|
|
2242
|
-
init_navigator();
|
|
2243
2234
|
exports$3 = {};
|
|
2244
2235
|
_dewExec$2 = false;
|
|
2245
2236
|
exports$2 = {};
|
|
@@ -2268,9 +2259,9 @@ var mqtt = (() => {
|
|
|
2268
2259
|
var require_topic_alias_recv = __commonJS({
|
|
2269
2260
|
"build/lib/topic-alias-recv.js"(exports5) {
|
|
2270
2261
|
"use strict";
|
|
2262
|
+
init_dirname();
|
|
2271
2263
|
init_buffer2();
|
|
2272
2264
|
init_process2();
|
|
2273
|
-
init_navigator();
|
|
2274
2265
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
2275
2266
|
var TopicAliasRecv = class {
|
|
2276
2267
|
constructor(max) {
|
|
@@ -2300,9 +2291,9 @@ var mqtt = (() => {
|
|
|
2300
2291
|
var require_primordials = __commonJS({
|
|
2301
2292
|
"node_modules/readable-stream/lib/ours/primordials.js"(exports5, module) {
|
|
2302
2293
|
"use strict";
|
|
2294
|
+
init_dirname();
|
|
2303
2295
|
init_buffer2();
|
|
2304
2296
|
init_process2();
|
|
2305
|
-
init_navigator();
|
|
2306
2297
|
module.exports = {
|
|
2307
2298
|
ArrayIsArray(self2) {
|
|
2308
2299
|
return Array.isArray(self2);
|
|
@@ -2402,9 +2393,9 @@ var mqtt = (() => {
|
|
|
2402
2393
|
var require_util = __commonJS({
|
|
2403
2394
|
"node_modules/readable-stream/lib/ours/util.js"(exports5, module) {
|
|
2404
2395
|
"use strict";
|
|
2396
|
+
init_dirname();
|
|
2405
2397
|
init_buffer2();
|
|
2406
2398
|
init_process2();
|
|
2407
|
-
init_navigator();
|
|
2408
2399
|
var bufferModule = (init_buffer(), __toCommonJS(buffer_exports));
|
|
2409
2400
|
var AsyncFunction = Object.getPrototypeOf(async function() {
|
|
2410
2401
|
}).constructor;
|
|
@@ -2529,9 +2520,9 @@ var mqtt = (() => {
|
|
|
2529
2520
|
var require_browser = __commonJS({
|
|
2530
2521
|
"node_modules/abort-controller/browser.js"(exports5, module) {
|
|
2531
2522
|
"use strict";
|
|
2523
|
+
init_dirname();
|
|
2532
2524
|
init_buffer2();
|
|
2533
2525
|
init_process2();
|
|
2534
|
-
init_navigator();
|
|
2535
2526
|
var { AbortController, AbortSignal } = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : (
|
|
2536
2527
|
/* otherwise */
|
|
2537
2528
|
void 0
|
|
@@ -2546,9 +2537,9 @@ var mqtt = (() => {
|
|
|
2546
2537
|
var require_errors = __commonJS({
|
|
2547
2538
|
"node_modules/readable-stream/lib/ours/errors.js"(exports5, module) {
|
|
2548
2539
|
"use strict";
|
|
2540
|
+
init_dirname();
|
|
2549
2541
|
init_buffer2();
|
|
2550
2542
|
init_process2();
|
|
2551
|
-
init_navigator();
|
|
2552
2543
|
var { format: format2, inspect, AggregateError: CustomAggregateError } = require_util();
|
|
2553
2544
|
var AggregateError = globalThis.AggregateError || CustomAggregateError;
|
|
2554
2545
|
var kIsNodeError = Symbol("kIsNodeError");
|
|
@@ -2865,9 +2856,9 @@ var mqtt = (() => {
|
|
|
2865
2856
|
var require_validators = __commonJS({
|
|
2866
2857
|
"node_modules/readable-stream/lib/internal/validators.js"(exports5, module) {
|
|
2867
2858
|
"use strict";
|
|
2859
|
+
init_dirname();
|
|
2868
2860
|
init_buffer2();
|
|
2869
2861
|
init_process2();
|
|
2870
|
-
init_navigator();
|
|
2871
2862
|
var {
|
|
2872
2863
|
ArrayIsArray,
|
|
2873
2864
|
ArrayPrototypeIncludes,
|
|
@@ -3128,9 +3119,9 @@ var mqtt = (() => {
|
|
|
3128
3119
|
// node_modules/process/browser.js
|
|
3129
3120
|
var require_browser2 = __commonJS({
|
|
3130
3121
|
"node_modules/process/browser.js"(exports5, module) {
|
|
3122
|
+
init_dirname();
|
|
3131
3123
|
init_buffer2();
|
|
3132
3124
|
init_process2();
|
|
3133
|
-
init_navigator();
|
|
3134
3125
|
var process3 = module.exports = {};
|
|
3135
3126
|
var cachedSetTimeout;
|
|
3136
3127
|
var cachedClearTimeout;
|
|
@@ -3294,9 +3285,9 @@ var mqtt = (() => {
|
|
|
3294
3285
|
var require_utils = __commonJS({
|
|
3295
3286
|
"node_modules/readable-stream/lib/internal/streams/utils.js"(exports5, module) {
|
|
3296
3287
|
"use strict";
|
|
3288
|
+
init_dirname();
|
|
3297
3289
|
init_buffer2();
|
|
3298
3290
|
init_process2();
|
|
3299
|
-
init_navigator();
|
|
3300
3291
|
var { Symbol: Symbol2, SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials();
|
|
3301
3292
|
var kDestroyed = Symbol2("kDestroyed");
|
|
3302
3293
|
var kIsErrored = Symbol2("kIsErrored");
|
|
@@ -3527,9 +3518,9 @@ var mqtt = (() => {
|
|
|
3527
3518
|
// node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
3528
3519
|
var require_end_of_stream = __commonJS({
|
|
3529
3520
|
"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports5, module) {
|
|
3521
|
+
init_dirname();
|
|
3530
3522
|
init_buffer2();
|
|
3531
3523
|
init_process2();
|
|
3532
|
-
init_navigator();
|
|
3533
3524
|
var process3 = require_browser2();
|
|
3534
3525
|
var { AbortError, codes } = require_errors();
|
|
3535
3526
|
var { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes;
|
|
@@ -3782,9 +3773,9 @@ var mqtt = (() => {
|
|
|
3782
3773
|
var require_destroy = __commonJS({
|
|
3783
3774
|
"node_modules/readable-stream/lib/internal/streams/destroy.js"(exports5, module) {
|
|
3784
3775
|
"use strict";
|
|
3776
|
+
init_dirname();
|
|
3785
3777
|
init_buffer2();
|
|
3786
3778
|
init_process2();
|
|
3787
|
-
init_navigator();
|
|
3788
3779
|
var process3 = require_browser2();
|
|
3789
3780
|
var {
|
|
3790
3781
|
aggregateTwoErrors,
|
|
@@ -4106,9 +4097,9 @@ var mqtt = (() => {
|
|
|
4106
4097
|
var e, t, n, r, i, s, y;
|
|
4107
4098
|
var init_chunk_4bd36a8f = __esm({
|
|
4108
4099
|
"node_modules/@jspm/core/nodelibs/browser/chunk-4bd36a8f.js"() {
|
|
4100
|
+
init_dirname();
|
|
4109
4101
|
init_buffer2();
|
|
4110
4102
|
init_process2();
|
|
4111
|
-
init_navigator();
|
|
4112
4103
|
n = "object" == typeof Reflect ? Reflect : null;
|
|
4113
4104
|
r = n && "function" == typeof n.apply ? n.apply : function(e7, t6, n7) {
|
|
4114
4105
|
return Function.prototype.apply.call(e7, t6, n7);
|
|
@@ -4247,9 +4238,9 @@ var mqtt = (() => {
|
|
|
4247
4238
|
var EventEmitter, defaultMaxListeners, init, listenerCount, on2, once2;
|
|
4248
4239
|
var init_events = __esm({
|
|
4249
4240
|
"node_modules/@jspm/core/nodelibs/browser/events.js"() {
|
|
4241
|
+
init_dirname();
|
|
4250
4242
|
init_buffer2();
|
|
4251
4243
|
init_process2();
|
|
4252
|
-
init_navigator();
|
|
4253
4244
|
init_chunk_4bd36a8f();
|
|
4254
4245
|
init_chunk_4bd36a8f();
|
|
4255
4246
|
y.once = function(emitter, event) {
|
|
@@ -4347,9 +4338,9 @@ var mqtt = (() => {
|
|
|
4347
4338
|
var require_legacy = __commonJS({
|
|
4348
4339
|
"node_modules/readable-stream/lib/internal/streams/legacy.js"(exports5, module) {
|
|
4349
4340
|
"use strict";
|
|
4341
|
+
init_dirname();
|
|
4350
4342
|
init_buffer2();
|
|
4351
4343
|
init_process2();
|
|
4352
|
-
init_navigator();
|
|
4353
4344
|
var { ArrayIsArray, ObjectSetPrototypeOf } = require_primordials();
|
|
4354
4345
|
var { EventEmitter: EE } = (init_events(), __toCommonJS(events_exports));
|
|
4355
4346
|
function Stream(opts) {
|
|
@@ -4435,9 +4426,9 @@ var mqtt = (() => {
|
|
|
4435
4426
|
var require_add_abort_signal = __commonJS({
|
|
4436
4427
|
"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js"(exports5, module) {
|
|
4437
4428
|
"use strict";
|
|
4429
|
+
init_dirname();
|
|
4438
4430
|
init_buffer2();
|
|
4439
4431
|
init_process2();
|
|
4440
|
-
init_navigator();
|
|
4441
4432
|
var { AbortError, codes } = require_errors();
|
|
4442
4433
|
var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils();
|
|
4443
4434
|
var eos = require_end_of_stream();
|
|
@@ -4486,9 +4477,9 @@ var mqtt = (() => {
|
|
|
4486
4477
|
var require_buffer_list = __commonJS({
|
|
4487
4478
|
"node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports5, module) {
|
|
4488
4479
|
"use strict";
|
|
4480
|
+
init_dirname();
|
|
4489
4481
|
init_buffer2();
|
|
4490
4482
|
init_process2();
|
|
4491
|
-
init_navigator();
|
|
4492
4483
|
var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials();
|
|
4493
4484
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
4494
4485
|
var { inspect } = require_util();
|
|
@@ -4657,9 +4648,9 @@ var mqtt = (() => {
|
|
|
4657
4648
|
var require_state = __commonJS({
|
|
4658
4649
|
"node_modules/readable-stream/lib/internal/streams/state.js"(exports5, module) {
|
|
4659
4650
|
"use strict";
|
|
4651
|
+
init_dirname();
|
|
4660
4652
|
init_buffer2();
|
|
4661
4653
|
init_process2();
|
|
4662
|
-
init_navigator();
|
|
4663
4654
|
var { MathFloor, NumberIsInteger } = require_primordials();
|
|
4664
4655
|
var { ERR_INVALID_ARG_VALUE } = require_errors().codes;
|
|
4665
4656
|
function highWaterMarkFrom(options, isDuplex, duplexKey) {
|
|
@@ -5193,9 +5184,9 @@ var mqtt = (() => {
|
|
|
5193
5184
|
var r$1, t$1, e$2, n$2, o$2, a$1, h$1, a$1$1, e$1$1, n$1$1, i$1, o$1$1, j, Y, e2, n2, o2, u2, e$1, s2, i2;
|
|
5194
5185
|
var init_chunk_4ccc3a29 = __esm({
|
|
5195
5186
|
"node_modules/@jspm/core/nodelibs/browser/chunk-4ccc3a29.js"() {
|
|
5187
|
+
init_dirname();
|
|
5196
5188
|
init_buffer2();
|
|
5197
5189
|
init_process2();
|
|
5198
|
-
init_navigator();
|
|
5199
5190
|
for (r$1 = { byteLength: function(r7) {
|
|
5200
5191
|
var t6 = u$2(r7), e7 = t6[0], n7 = t6[1];
|
|
5201
5192
|
return 3 * (e7 + n7) / 4 - n7;
|
|
@@ -5690,9 +5681,9 @@ var mqtt = (() => {
|
|
|
5690
5681
|
var StringDecoder;
|
|
5691
5682
|
var init_string_decoder = __esm({
|
|
5692
5683
|
"node_modules/@jspm/core/nodelibs/browser/string_decoder.js"() {
|
|
5684
|
+
init_dirname();
|
|
5693
5685
|
init_buffer2();
|
|
5694
5686
|
init_process2();
|
|
5695
|
-
init_navigator();
|
|
5696
5687
|
init_chunk_4ccc3a29();
|
|
5697
5688
|
init_chunk_4ccc3a29();
|
|
5698
5689
|
StringDecoder = e$1.StringDecoder;
|
|
@@ -5703,9 +5694,9 @@ var mqtt = (() => {
|
|
|
5703
5694
|
var require_from = __commonJS({
|
|
5704
5695
|
"node_modules/readable-stream/lib/internal/streams/from.js"(exports5, module) {
|
|
5705
5696
|
"use strict";
|
|
5697
|
+
init_dirname();
|
|
5706
5698
|
init_buffer2();
|
|
5707
5699
|
init_process2();
|
|
5708
|
-
init_navigator();
|
|
5709
5700
|
var process3 = require_browser2();
|
|
5710
5701
|
var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials();
|
|
5711
5702
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
@@ -5800,9 +5791,9 @@ var mqtt = (() => {
|
|
|
5800
5791
|
// node_modules/readable-stream/lib/internal/streams/readable.js
|
|
5801
5792
|
var require_readable = __commonJS({
|
|
5802
5793
|
"node_modules/readable-stream/lib/internal/streams/readable.js"(exports5, module) {
|
|
5794
|
+
init_dirname();
|
|
5803
5795
|
init_buffer2();
|
|
5804
5796
|
init_process2();
|
|
5805
|
-
init_navigator();
|
|
5806
5797
|
var process3 = require_browser2();
|
|
5807
5798
|
var {
|
|
5808
5799
|
ArrayPrototypeIndexOf,
|
|
@@ -6755,9 +6746,9 @@ var mqtt = (() => {
|
|
|
6755
6746
|
// node_modules/readable-stream/lib/internal/streams/writable.js
|
|
6756
6747
|
var require_writable = __commonJS({
|
|
6757
6748
|
"node_modules/readable-stream/lib/internal/streams/writable.js"(exports5, module) {
|
|
6749
|
+
init_dirname();
|
|
6758
6750
|
init_buffer2();
|
|
6759
6751
|
init_process2();
|
|
6760
|
-
init_navigator();
|
|
6761
6752
|
var process3 = require_browser2();
|
|
6762
6753
|
var {
|
|
6763
6754
|
ArrayPrototypeSlice,
|
|
@@ -7401,9 +7392,9 @@ var mqtt = (() => {
|
|
|
7401
7392
|
// node_modules/readable-stream/lib/internal/streams/duplexify.js
|
|
7402
7393
|
var require_duplexify = __commonJS({
|
|
7403
7394
|
"node_modules/readable-stream/lib/internal/streams/duplexify.js"(exports5, module) {
|
|
7395
|
+
init_dirname();
|
|
7404
7396
|
init_buffer2();
|
|
7405
7397
|
init_process2();
|
|
7406
|
-
init_navigator();
|
|
7407
7398
|
var process3 = require_browser2();
|
|
7408
7399
|
var bufferModule = (init_buffer(), __toCommonJS(buffer_exports));
|
|
7409
7400
|
var {
|
|
@@ -7737,9 +7728,9 @@ var mqtt = (() => {
|
|
|
7737
7728
|
var require_duplex = __commonJS({
|
|
7738
7729
|
"node_modules/readable-stream/lib/internal/streams/duplex.js"(exports5, module) {
|
|
7739
7730
|
"use strict";
|
|
7731
|
+
init_dirname();
|
|
7740
7732
|
init_buffer2();
|
|
7741
7733
|
init_process2();
|
|
7742
|
-
init_navigator();
|
|
7743
7734
|
var {
|
|
7744
7735
|
ObjectDefineProperties,
|
|
7745
7736
|
ObjectGetOwnPropertyDescriptor,
|
|
@@ -7860,9 +7851,9 @@ var mqtt = (() => {
|
|
|
7860
7851
|
var require_transform = __commonJS({
|
|
7861
7852
|
"node_modules/readable-stream/lib/internal/streams/transform.js"(exports5, module) {
|
|
7862
7853
|
"use strict";
|
|
7854
|
+
init_dirname();
|
|
7863
7855
|
init_buffer2();
|
|
7864
7856
|
init_process2();
|
|
7865
|
-
init_navigator();
|
|
7866
7857
|
var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials();
|
|
7867
7858
|
module.exports = Transform;
|
|
7868
7859
|
var { ERR_METHOD_NOT_IMPLEMENTED } = require_errors().codes;
|
|
@@ -7968,9 +7959,9 @@ var mqtt = (() => {
|
|
|
7968
7959
|
var require_passthrough = __commonJS({
|
|
7969
7960
|
"node_modules/readable-stream/lib/internal/streams/passthrough.js"(exports5, module) {
|
|
7970
7961
|
"use strict";
|
|
7962
|
+
init_dirname();
|
|
7971
7963
|
init_buffer2();
|
|
7972
7964
|
init_process2();
|
|
7973
|
-
init_navigator();
|
|
7974
7965
|
var { ObjectSetPrototypeOf } = require_primordials();
|
|
7975
7966
|
module.exports = PassThrough;
|
|
7976
7967
|
var Transform = require_transform();
|
|
@@ -7990,9 +7981,9 @@ var mqtt = (() => {
|
|
|
7990
7981
|
// node_modules/readable-stream/lib/internal/streams/pipeline.js
|
|
7991
7982
|
var require_pipeline = __commonJS({
|
|
7992
7983
|
"node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports5, module) {
|
|
7984
|
+
init_dirname();
|
|
7993
7985
|
init_buffer2();
|
|
7994
7986
|
init_process2();
|
|
7995
|
-
init_navigator();
|
|
7996
7987
|
var process3 = require_browser2();
|
|
7997
7988
|
var { ArrayIsArray, Promise: Promise2, SymbolAsyncIterator } = require_primordials();
|
|
7998
7989
|
var eos = require_end_of_stream();
|
|
@@ -8416,9 +8407,9 @@ var mqtt = (() => {
|
|
|
8416
8407
|
var require_compose = __commonJS({
|
|
8417
8408
|
"node_modules/readable-stream/lib/internal/streams/compose.js"(exports5, module) {
|
|
8418
8409
|
"use strict";
|
|
8410
|
+
init_dirname();
|
|
8419
8411
|
init_buffer2();
|
|
8420
8412
|
init_process2();
|
|
8421
|
-
init_navigator();
|
|
8422
8413
|
var { pipeline } = require_pipeline();
|
|
8423
8414
|
var Duplex = require_duplex();
|
|
8424
8415
|
var { destroyer } = require_destroy();
|
|
@@ -8612,9 +8603,9 @@ var mqtt = (() => {
|
|
|
8612
8603
|
var require_operators = __commonJS({
|
|
8613
8604
|
"node_modules/readable-stream/lib/internal/streams/operators.js"(exports5, module) {
|
|
8614
8605
|
"use strict";
|
|
8606
|
+
init_dirname();
|
|
8615
8607
|
init_buffer2();
|
|
8616
8608
|
init_process2();
|
|
8617
|
-
init_navigator();
|
|
8618
8609
|
var AbortController = globalThis.AbortController || require_browser().AbortController;
|
|
8619
8610
|
var {
|
|
8620
8611
|
codes: { ERR_INVALID_ARG_VALUE, ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, ERR_OUT_OF_RANGE },
|
|
@@ -9009,9 +9000,9 @@ var mqtt = (() => {
|
|
|
9009
9000
|
var require_promises = __commonJS({
|
|
9010
9001
|
"node_modules/readable-stream/lib/stream/promises.js"(exports5, module) {
|
|
9011
9002
|
"use strict";
|
|
9003
|
+
init_dirname();
|
|
9012
9004
|
init_buffer2();
|
|
9013
9005
|
init_process2();
|
|
9014
|
-
init_navigator();
|
|
9015
9006
|
var { ArrayPrototypePop, Promise: Promise2 } = require_primordials();
|
|
9016
9007
|
var { isIterable, isNodeStream, isWebStream } = require_utils();
|
|
9017
9008
|
var { pipelineImpl: pl } = require_pipeline();
|
|
@@ -9053,9 +9044,9 @@ var mqtt = (() => {
|
|
|
9053
9044
|
// node_modules/readable-stream/lib/stream.js
|
|
9054
9045
|
var require_stream = __commonJS({
|
|
9055
9046
|
"node_modules/readable-stream/lib/stream.js"(exports5, module) {
|
|
9047
|
+
init_dirname();
|
|
9056
9048
|
init_buffer2();
|
|
9057
9049
|
init_process2();
|
|
9058
|
-
init_navigator();
|
|
9059
9050
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
9060
9051
|
var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials();
|
|
9061
9052
|
var {
|
|
@@ -9174,9 +9165,9 @@ var mqtt = (() => {
|
|
|
9174
9165
|
var require_browser3 = __commonJS({
|
|
9175
9166
|
"node_modules/readable-stream/lib/ours/browser.js"(exports5, module) {
|
|
9176
9167
|
"use strict";
|
|
9168
|
+
init_dirname();
|
|
9177
9169
|
init_buffer2();
|
|
9178
9170
|
init_process2();
|
|
9179
|
-
init_navigator();
|
|
9180
9171
|
var CustomStream = require_stream();
|
|
9181
9172
|
var promises = require_promises();
|
|
9182
9173
|
var originalDestroy = CustomStream.Readable.destroy;
|
|
@@ -9212,9 +9203,9 @@ var mqtt = (() => {
|
|
|
9212
9203
|
// node_modules/inherits/inherits_browser.js
|
|
9213
9204
|
var require_inherits_browser = __commonJS({
|
|
9214
9205
|
"node_modules/inherits/inherits_browser.js"(exports5, module) {
|
|
9206
|
+
init_dirname();
|
|
9215
9207
|
init_buffer2();
|
|
9216
9208
|
init_process2();
|
|
9217
|
-
init_navigator();
|
|
9218
9209
|
if (typeof Object.create === "function") {
|
|
9219
9210
|
module.exports = function inherits(ctor, superCtor) {
|
|
9220
9211
|
if (superCtor) {
|
|
@@ -9248,9 +9239,9 @@ var mqtt = (() => {
|
|
|
9248
9239
|
var require_BufferList = __commonJS({
|
|
9249
9240
|
"node_modules/mqtt-packet/node_modules/bl/BufferList.js"(exports5, module) {
|
|
9250
9241
|
"use strict";
|
|
9242
|
+
init_dirname();
|
|
9251
9243
|
init_buffer2();
|
|
9252
9244
|
init_process2();
|
|
9253
|
-
init_navigator();
|
|
9254
9245
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
9255
9246
|
var symbol = Symbol.for("BufferList");
|
|
9256
9247
|
function BufferList(buf) {
|
|
@@ -9559,9 +9550,9 @@ var mqtt = (() => {
|
|
|
9559
9550
|
var require_bl = __commonJS({
|
|
9560
9551
|
"node_modules/mqtt-packet/node_modules/bl/bl.js"(exports5, module) {
|
|
9561
9552
|
"use strict";
|
|
9553
|
+
init_dirname();
|
|
9562
9554
|
init_buffer2();
|
|
9563
9555
|
init_process2();
|
|
9564
|
-
init_navigator();
|
|
9565
9556
|
var DuplexStream = require_browser3().Duplex;
|
|
9566
9557
|
var inherits = require_inherits_browser();
|
|
9567
9558
|
var BufferList = require_BufferList();
|
|
@@ -9632,9 +9623,9 @@ var mqtt = (() => {
|
|
|
9632
9623
|
// node_modules/mqtt-packet/packet.js
|
|
9633
9624
|
var require_packet = __commonJS({
|
|
9634
9625
|
"node_modules/mqtt-packet/packet.js"(exports5, module) {
|
|
9626
|
+
init_dirname();
|
|
9635
9627
|
init_buffer2();
|
|
9636
9628
|
init_process2();
|
|
9637
|
-
init_navigator();
|
|
9638
9629
|
var Packet = class {
|
|
9639
9630
|
constructor() {
|
|
9640
9631
|
this.cmd = null;
|
|
@@ -9653,9 +9644,9 @@ var mqtt = (() => {
|
|
|
9653
9644
|
// node_modules/mqtt-packet/constants.js
|
|
9654
9645
|
var require_constants = __commonJS({
|
|
9655
9646
|
"node_modules/mqtt-packet/constants.js"(exports5, module) {
|
|
9647
|
+
init_dirname();
|
|
9656
9648
|
init_buffer2();
|
|
9657
9649
|
init_process2();
|
|
9658
|
-
init_navigator();
|
|
9659
9650
|
var protocol = module.exports;
|
|
9660
9651
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
9661
9652
|
protocol.types = {
|
|
@@ -9929,9 +9920,9 @@ var mqtt = (() => {
|
|
|
9929
9920
|
// node_modules/ms/index.js
|
|
9930
9921
|
var require_ms = __commonJS({
|
|
9931
9922
|
"node_modules/ms/index.js"(exports5, module) {
|
|
9923
|
+
init_dirname();
|
|
9932
9924
|
init_buffer2();
|
|
9933
9925
|
init_process2();
|
|
9934
|
-
init_navigator();
|
|
9935
9926
|
var s5 = 1e3;
|
|
9936
9927
|
var m4 = s5 * 60;
|
|
9937
9928
|
var h6 = m4 * 60;
|
|
@@ -10048,9 +10039,9 @@ var mqtt = (() => {
|
|
|
10048
10039
|
// node_modules/debug/src/common.js
|
|
10049
10040
|
var require_common = __commonJS({
|
|
10050
10041
|
"node_modules/debug/src/common.js"(exports5, module) {
|
|
10042
|
+
init_dirname();
|
|
10051
10043
|
init_buffer2();
|
|
10052
10044
|
init_process2();
|
|
10053
|
-
init_navigator();
|
|
10054
10045
|
function setup(env2) {
|
|
10055
10046
|
createDebug.debug = createDebug;
|
|
10056
10047
|
createDebug.default = createDebug;
|
|
@@ -10214,9 +10205,9 @@ var mqtt = (() => {
|
|
|
10214
10205
|
// node_modules/debug/src/browser.js
|
|
10215
10206
|
var require_browser4 = __commonJS({
|
|
10216
10207
|
"node_modules/debug/src/browser.js"(exports5, module) {
|
|
10208
|
+
init_dirname();
|
|
10217
10209
|
init_buffer2();
|
|
10218
10210
|
init_process2();
|
|
10219
|
-
init_navigator();
|
|
10220
10211
|
exports5.formatArgs = formatArgs;
|
|
10221
10212
|
exports5.save = save;
|
|
10222
10213
|
exports5.load = load;
|
|
@@ -10386,9 +10377,9 @@ var mqtt = (() => {
|
|
|
10386
10377
|
// node_modules/mqtt-packet/parser.js
|
|
10387
10378
|
var require_parser = __commonJS({
|
|
10388
10379
|
"node_modules/mqtt-packet/parser.js"(exports5, module) {
|
|
10380
|
+
init_dirname();
|
|
10389
10381
|
init_buffer2();
|
|
10390
10382
|
init_process2();
|
|
10391
|
-
init_navigator();
|
|
10392
10383
|
var bl = require_bl();
|
|
10393
10384
|
var { EventEmitter: EventEmitter2 } = (init_events(), __toCommonJS(events_exports));
|
|
10394
10385
|
var Packet = require_packet();
|
|
@@ -11083,9 +11074,9 @@ var mqtt = (() => {
|
|
|
11083
11074
|
// node_modules/mqtt-packet/numbers.js
|
|
11084
11075
|
var require_numbers = __commonJS({
|
|
11085
11076
|
"node_modules/mqtt-packet/numbers.js"(exports5, module) {
|
|
11077
|
+
init_dirname();
|
|
11086
11078
|
init_buffer2();
|
|
11087
11079
|
init_process2();
|
|
11088
|
-
init_navigator();
|
|
11089
11080
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
11090
11081
|
var max = 65536;
|
|
11091
11082
|
var cache = {};
|
|
@@ -11137,9 +11128,9 @@ var mqtt = (() => {
|
|
|
11137
11128
|
var require_process_nextick_args = __commonJS({
|
|
11138
11129
|
"node_modules/process-nextick-args/index.js"(exports5, module) {
|
|
11139
11130
|
"use strict";
|
|
11131
|
+
init_dirname();
|
|
11140
11132
|
init_buffer2();
|
|
11141
11133
|
init_process2();
|
|
11142
|
-
init_navigator();
|
|
11143
11134
|
if (typeof process_exports === "undefined" || !process_exports.version || process_exports.version.indexOf("v0.") === 0 || process_exports.version.indexOf("v1.") === 0 && process_exports.version.indexOf("v1.8.") !== 0) {
|
|
11144
11135
|
module.exports = { nextTick: nextTick2 };
|
|
11145
11136
|
} else {
|
|
@@ -11184,9 +11175,9 @@ var mqtt = (() => {
|
|
|
11184
11175
|
// node_modules/mqtt-packet/writeToStream.js
|
|
11185
11176
|
var require_writeToStream = __commonJS({
|
|
11186
11177
|
"node_modules/mqtt-packet/writeToStream.js"(exports5, module) {
|
|
11178
|
+
init_dirname();
|
|
11187
11179
|
init_buffer2();
|
|
11188
11180
|
init_process2();
|
|
11189
|
-
init_navigator();
|
|
11190
11181
|
var protocol = require_constants();
|
|
11191
11182
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
11192
11183
|
var empty = Buffer3.allocUnsafe(0);
|
|
@@ -12074,9 +12065,9 @@ var mqtt = (() => {
|
|
|
12074
12065
|
// node_modules/mqtt-packet/generate.js
|
|
12075
12066
|
var require_generate = __commonJS({
|
|
12076
12067
|
"node_modules/mqtt-packet/generate.js"(exports5, module) {
|
|
12068
|
+
init_dirname();
|
|
12077
12069
|
init_buffer2();
|
|
12078
12070
|
init_process2();
|
|
12079
|
-
init_navigator();
|
|
12080
12071
|
var writeToStream = require_writeToStream();
|
|
12081
12072
|
var { EventEmitter: EventEmitter2 } = (init_events(), __toCommonJS(events_exports));
|
|
12082
12073
|
var { Buffer: Buffer3 } = (init_buffer(), __toCommonJS(buffer_exports));
|
|
@@ -12132,9 +12123,9 @@ var mqtt = (() => {
|
|
|
12132
12123
|
// node_modules/mqtt-packet/mqtt.js
|
|
12133
12124
|
var require_mqtt = __commonJS({
|
|
12134
12125
|
"node_modules/mqtt-packet/mqtt.js"(exports5) {
|
|
12126
|
+
init_dirname();
|
|
12135
12127
|
init_buffer2();
|
|
12136
12128
|
init_process2();
|
|
12137
|
-
init_navigator();
|
|
12138
12129
|
exports5.parser = require_parser().parser;
|
|
12139
12130
|
exports5.generate = require_generate();
|
|
12140
12131
|
exports5.writeToStream = require_writeToStream();
|
|
@@ -12145,9 +12136,9 @@ var mqtt = (() => {
|
|
|
12145
12136
|
var require_default_message_id_provider = __commonJS({
|
|
12146
12137
|
"build/lib/default-message-id-provider.js"(exports5) {
|
|
12147
12138
|
"use strict";
|
|
12139
|
+
init_dirname();
|
|
12148
12140
|
init_buffer2();
|
|
12149
12141
|
init_process2();
|
|
12150
|
-
init_navigator();
|
|
12151
12142
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12152
12143
|
var DefaultMessageIdProvider = class {
|
|
12153
12144
|
constructor() {
|
|
@@ -12179,9 +12170,9 @@ var mqtt = (() => {
|
|
|
12179
12170
|
var require_rfdc = __commonJS({
|
|
12180
12171
|
"node_modules/rfdc/index.js"(exports5, module) {
|
|
12181
12172
|
"use strict";
|
|
12173
|
+
init_dirname();
|
|
12182
12174
|
init_buffer2();
|
|
12183
12175
|
init_process2();
|
|
12184
|
-
init_navigator();
|
|
12185
12176
|
module.exports = rfdc;
|
|
12186
12177
|
function copyBuffer(cur) {
|
|
12187
12178
|
if (cur instanceof Buffer2) {
|
|
@@ -12390,9 +12381,9 @@ var mqtt = (() => {
|
|
|
12390
12381
|
var require_default = __commonJS({
|
|
12391
12382
|
"node_modules/rfdc/default.js"(exports5, module) {
|
|
12392
12383
|
"use strict";
|
|
12384
|
+
init_dirname();
|
|
12393
12385
|
init_buffer2();
|
|
12394
12386
|
init_process2();
|
|
12395
|
-
init_navigator();
|
|
12396
12387
|
module.exports = require_rfdc()();
|
|
12397
12388
|
}
|
|
12398
12389
|
});
|
|
@@ -12401,9 +12392,9 @@ var mqtt = (() => {
|
|
|
12401
12392
|
var require_validations = __commonJS({
|
|
12402
12393
|
"build/lib/validations.js"(exports5) {
|
|
12403
12394
|
"use strict";
|
|
12395
|
+
init_dirname();
|
|
12404
12396
|
init_buffer2();
|
|
12405
12397
|
init_process2();
|
|
12406
|
-
init_navigator();
|
|
12407
12398
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12408
12399
|
exports5.validateTopics = exports5.validateTopic = void 0;
|
|
12409
12400
|
function validateTopic(topic) {
|
|
@@ -12441,9 +12432,9 @@ var mqtt = (() => {
|
|
|
12441
12432
|
var require_store = __commonJS({
|
|
12442
12433
|
"build/lib/store.js"(exports5) {
|
|
12443
12434
|
"use strict";
|
|
12435
|
+
init_dirname();
|
|
12444
12436
|
init_buffer2();
|
|
12445
12437
|
init_process2();
|
|
12446
|
-
init_navigator();
|
|
12447
12438
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12448
12439
|
var readable_stream_1 = require_browser3();
|
|
12449
12440
|
var streamsOpts = { objectMode: true };
|
|
@@ -12526,9 +12517,9 @@ var mqtt = (() => {
|
|
|
12526
12517
|
var require_publish = __commonJS({
|
|
12527
12518
|
"build/lib/handlers/publish.js"(exports5) {
|
|
12528
12519
|
"use strict";
|
|
12520
|
+
init_dirname();
|
|
12529
12521
|
init_buffer2();
|
|
12530
12522
|
init_process2();
|
|
12531
|
-
init_navigator();
|
|
12532
12523
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12533
12524
|
var validReasonCodes = [0, 16, 128, 131, 135, 144, 145, 151, 153];
|
|
12534
12525
|
var handlePublish = (client, packet, done) => {
|
|
@@ -12634,7 +12625,7 @@ var mqtt = (() => {
|
|
|
12634
12625
|
// package-json:../../package.json
|
|
12635
12626
|
var require_package = __commonJS({
|
|
12636
12627
|
"package-json:../../package.json"(exports5, module) {
|
|
12637
|
-
module.exports = { version: "5.
|
|
12628
|
+
module.exports = { version: "5.9.1" };
|
|
12638
12629
|
}
|
|
12639
12630
|
});
|
|
12640
12631
|
|
|
@@ -12642,9 +12633,9 @@ var mqtt = (() => {
|
|
|
12642
12633
|
var require_shared = __commonJS({
|
|
12643
12634
|
"build/lib/shared.js"(exports5) {
|
|
12644
12635
|
"use strict";
|
|
12636
|
+
init_dirname();
|
|
12645
12637
|
init_buffer2();
|
|
12646
12638
|
init_process2();
|
|
12647
|
-
init_navigator();
|
|
12648
12639
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12649
12640
|
exports5.MQTTJS_VERSION = exports5.nextTick = exports5.applyMixin = exports5.ErrorWithReasonCode = void 0;
|
|
12650
12641
|
var ErrorWithReasonCode = class _ErrorWithReasonCode extends Error {
|
|
@@ -12688,11 +12679,12 @@ var mqtt = (() => {
|
|
|
12688
12679
|
var require_ack = __commonJS({
|
|
12689
12680
|
"build/lib/handlers/ack.js"(exports5) {
|
|
12690
12681
|
"use strict";
|
|
12682
|
+
init_dirname();
|
|
12691
12683
|
init_buffer2();
|
|
12692
12684
|
init_process2();
|
|
12693
|
-
init_navigator();
|
|
12694
12685
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12695
12686
|
exports5.ReasonCodes = void 0;
|
|
12687
|
+
var shared_1 = require_shared();
|
|
12696
12688
|
exports5.ReasonCodes = {
|
|
12697
12689
|
0: "",
|
|
12698
12690
|
1: "Unacceptable protocol version",
|
|
@@ -12754,8 +12746,7 @@ var mqtt = (() => {
|
|
|
12754
12746
|
case "puback": {
|
|
12755
12747
|
const pubackRC = packet.reasonCode;
|
|
12756
12748
|
if (pubackRC && pubackRC > 0 && pubackRC !== 16) {
|
|
12757
|
-
err = new
|
|
12758
|
-
err.code = pubackRC;
|
|
12749
|
+
err = new shared_1.ErrorWithReasonCode(`Publish error: ${exports5.ReasonCodes[pubackRC]}`, pubackRC);
|
|
12759
12750
|
client["_removeOutgoingAndStoreMessage"](messageId, () => {
|
|
12760
12751
|
cb(err, packet);
|
|
12761
12752
|
});
|
|
@@ -12772,8 +12763,7 @@ var mqtt = (() => {
|
|
|
12772
12763
|
};
|
|
12773
12764
|
const pubrecRC = packet.reasonCode;
|
|
12774
12765
|
if (pubrecRC && pubrecRC > 0 && pubrecRC !== 16) {
|
|
12775
|
-
err = new
|
|
12776
|
-
err.code = pubrecRC;
|
|
12766
|
+
err = new shared_1.ErrorWithReasonCode(`Publish error: ${exports5.ReasonCodes[pubrecRC]}`, pubrecRC);
|
|
12777
12767
|
client["_removeOutgoingAndStoreMessage"](messageId, () => {
|
|
12778
12768
|
cb(err, packet);
|
|
12779
12769
|
});
|
|
@@ -12826,9 +12816,9 @@ var mqtt = (() => {
|
|
|
12826
12816
|
var require_auth = __commonJS({
|
|
12827
12817
|
"build/lib/handlers/auth.js"(exports5) {
|
|
12828
12818
|
"use strict";
|
|
12819
|
+
init_dirname();
|
|
12829
12820
|
init_buffer2();
|
|
12830
12821
|
init_process2();
|
|
12831
|
-
init_navigator();
|
|
12832
12822
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12833
12823
|
var shared_1 = require_shared();
|
|
12834
12824
|
var ack_1 = require_ack();
|
|
@@ -12863,9 +12853,9 @@ var mqtt = (() => {
|
|
|
12863
12853
|
var require_cjs = __commonJS({
|
|
12864
12854
|
"node_modules/lru-cache/dist/cjs/index.js"(exports5) {
|
|
12865
12855
|
"use strict";
|
|
12856
|
+
init_dirname();
|
|
12866
12857
|
init_buffer2();
|
|
12867
12858
|
init_process2();
|
|
12868
|
-
init_navigator();
|
|
12869
12859
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12870
12860
|
exports5.LRUCache = void 0;
|
|
12871
12861
|
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
@@ -14109,9 +14099,9 @@ var mqtt = (() => {
|
|
|
14109
14099
|
var require_ContainerBase = __commonJS({
|
|
14110
14100
|
"node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js"(exports5) {
|
|
14111
14101
|
"use strict";
|
|
14102
|
+
init_dirname();
|
|
14112
14103
|
init_buffer2();
|
|
14113
14104
|
init_process2();
|
|
14114
|
-
init_navigator();
|
|
14115
14105
|
Object.defineProperty(exports5, "t", {
|
|
14116
14106
|
value: true
|
|
14117
14107
|
});
|
|
@@ -14150,9 +14140,9 @@ var mqtt = (() => {
|
|
|
14150
14140
|
var require_Stack = __commonJS({
|
|
14151
14141
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js"(exports5) {
|
|
14152
14142
|
"use strict";
|
|
14143
|
+
init_dirname();
|
|
14153
14144
|
init_buffer2();
|
|
14154
14145
|
init_process2();
|
|
14155
|
-
init_navigator();
|
|
14156
14146
|
Object.defineProperty(exports5, "t", {
|
|
14157
14147
|
value: true
|
|
14158
14148
|
});
|
|
@@ -14195,9 +14185,9 @@ var mqtt = (() => {
|
|
|
14195
14185
|
var require_Queue = __commonJS({
|
|
14196
14186
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js"(exports5) {
|
|
14197
14187
|
"use strict";
|
|
14188
|
+
init_dirname();
|
|
14198
14189
|
init_buffer2();
|
|
14199
14190
|
init_process2();
|
|
14200
|
-
init_navigator();
|
|
14201
14191
|
Object.defineProperty(exports5, "t", {
|
|
14202
14192
|
value: true
|
|
14203
14193
|
});
|
|
@@ -14252,9 +14242,9 @@ var mqtt = (() => {
|
|
|
14252
14242
|
var require_PriorityQueue = __commonJS({
|
|
14253
14243
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js"(exports5) {
|
|
14254
14244
|
"use strict";
|
|
14245
|
+
init_dirname();
|
|
14255
14246
|
init_buffer2();
|
|
14256
14247
|
init_process2();
|
|
14257
|
-
init_navigator();
|
|
14258
14248
|
Object.defineProperty(exports5, "t", {
|
|
14259
14249
|
value: true
|
|
14260
14250
|
});
|
|
@@ -14379,9 +14369,9 @@ var mqtt = (() => {
|
|
|
14379
14369
|
var require_Base = __commonJS({
|
|
14380
14370
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js"(exports5) {
|
|
14381
14371
|
"use strict";
|
|
14372
|
+
init_dirname();
|
|
14382
14373
|
init_buffer2();
|
|
14383
14374
|
init_process2();
|
|
14384
|
-
init_navigator();
|
|
14385
14375
|
Object.defineProperty(exports5, "t", {
|
|
14386
14376
|
value: true
|
|
14387
14377
|
});
|
|
@@ -14398,9 +14388,9 @@ var mqtt = (() => {
|
|
|
14398
14388
|
var require_throwError = __commonJS({
|
|
14399
14389
|
"node_modules/js-sdsl/dist/cjs/utils/throwError.js"(exports5) {
|
|
14400
14390
|
"use strict";
|
|
14391
|
+
init_dirname();
|
|
14401
14392
|
init_buffer2();
|
|
14402
14393
|
init_process2();
|
|
14403
|
-
init_navigator();
|
|
14404
14394
|
Object.defineProperty(exports5, "t", {
|
|
14405
14395
|
value: true
|
|
14406
14396
|
});
|
|
@@ -14415,9 +14405,9 @@ var mqtt = (() => {
|
|
|
14415
14405
|
var require_RandomIterator = __commonJS({
|
|
14416
14406
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js"(exports5) {
|
|
14417
14407
|
"use strict";
|
|
14408
|
+
init_dirname();
|
|
14418
14409
|
init_buffer2();
|
|
14419
14410
|
init_process2();
|
|
14420
|
-
init_navigator();
|
|
14421
14411
|
Object.defineProperty(exports5, "t", {
|
|
14422
14412
|
value: true
|
|
14423
14413
|
});
|
|
@@ -14475,9 +14465,9 @@ var mqtt = (() => {
|
|
|
14475
14465
|
var require_Vector = __commonJS({
|
|
14476
14466
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js"(exports5) {
|
|
14477
14467
|
"use strict";
|
|
14468
|
+
init_dirname();
|
|
14478
14469
|
init_buffer2();
|
|
14479
14470
|
init_process2();
|
|
14480
|
-
init_navigator();
|
|
14481
14471
|
Object.defineProperty(exports5, "t", {
|
|
14482
14472
|
value: true
|
|
14483
14473
|
});
|
|
@@ -14633,9 +14623,9 @@ var mqtt = (() => {
|
|
|
14633
14623
|
var require_LinkList = __commonJS({
|
|
14634
14624
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js"(exports5) {
|
|
14635
14625
|
"use strict";
|
|
14626
|
+
init_dirname();
|
|
14636
14627
|
init_buffer2();
|
|
14637
14628
|
init_process2();
|
|
14638
|
-
init_navigator();
|
|
14639
14629
|
Object.defineProperty(exports5, "t", {
|
|
14640
14630
|
value: true
|
|
14641
14631
|
});
|
|
@@ -14969,9 +14959,9 @@ var mqtt = (() => {
|
|
|
14969
14959
|
var require_Deque = __commonJS({
|
|
14970
14960
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js"(exports5) {
|
|
14971
14961
|
"use strict";
|
|
14962
|
+
init_dirname();
|
|
14972
14963
|
init_buffer2();
|
|
14973
14964
|
init_process2();
|
|
14974
|
-
init_navigator();
|
|
14975
14965
|
Object.defineProperty(exports5, "t", {
|
|
14976
14966
|
value: true
|
|
14977
14967
|
});
|
|
@@ -15332,9 +15322,9 @@ var mqtt = (() => {
|
|
|
15332
15322
|
var require_TreeNode = __commonJS({
|
|
15333
15323
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js"(exports5) {
|
|
15334
15324
|
"use strict";
|
|
15325
|
+
init_dirname();
|
|
15335
15326
|
init_buffer2();
|
|
15336
15327
|
init_process2();
|
|
15337
|
-
init_navigator();
|
|
15338
15328
|
Object.defineProperty(exports5, "t", {
|
|
15339
15329
|
value: true
|
|
15340
15330
|
});
|
|
@@ -15462,9 +15452,9 @@ var mqtt = (() => {
|
|
|
15462
15452
|
var require_Base2 = __commonJS({
|
|
15463
15453
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js"(exports5) {
|
|
15464
15454
|
"use strict";
|
|
15455
|
+
init_dirname();
|
|
15465
15456
|
init_buffer2();
|
|
15466
15457
|
init_process2();
|
|
15467
|
-
init_navigator();
|
|
15468
15458
|
Object.defineProperty(exports5, "t", {
|
|
15469
15459
|
value: true
|
|
15470
15460
|
});
|
|
@@ -16012,9 +16002,9 @@ var mqtt = (() => {
|
|
|
16012
16002
|
var require_TreeIterator = __commonJS({
|
|
16013
16003
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js"(exports5) {
|
|
16014
16004
|
"use strict";
|
|
16005
|
+
init_dirname();
|
|
16015
16006
|
init_buffer2();
|
|
16016
16007
|
init_process2();
|
|
16017
|
-
init_navigator();
|
|
16018
16008
|
Object.defineProperty(exports5, "t", {
|
|
16019
16009
|
value: true
|
|
16020
16010
|
});
|
|
@@ -16093,9 +16083,9 @@ var mqtt = (() => {
|
|
|
16093
16083
|
var require_OrderedSet = __commonJS({
|
|
16094
16084
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js"(exports5) {
|
|
16095
16085
|
"use strict";
|
|
16086
|
+
init_dirname();
|
|
16096
16087
|
init_buffer2();
|
|
16097
16088
|
init_process2();
|
|
16098
|
-
init_navigator();
|
|
16099
16089
|
Object.defineProperty(exports5, "t", {
|
|
16100
16090
|
value: true
|
|
16101
16091
|
});
|
|
@@ -16199,9 +16189,9 @@ var mqtt = (() => {
|
|
|
16199
16189
|
var require_OrderedMap = __commonJS({
|
|
16200
16190
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js"(exports5) {
|
|
16201
16191
|
"use strict";
|
|
16192
|
+
init_dirname();
|
|
16202
16193
|
init_buffer2();
|
|
16203
16194
|
init_process2();
|
|
16204
|
-
init_navigator();
|
|
16205
16195
|
Object.defineProperty(exports5, "t", {
|
|
16206
16196
|
value: true
|
|
16207
16197
|
});
|
|
@@ -16330,9 +16320,9 @@ var mqtt = (() => {
|
|
|
16330
16320
|
var require_checkObject = __commonJS({
|
|
16331
16321
|
"node_modules/js-sdsl/dist/cjs/utils/checkObject.js"(exports5) {
|
|
16332
16322
|
"use strict";
|
|
16323
|
+
init_dirname();
|
|
16333
16324
|
init_buffer2();
|
|
16334
16325
|
init_process2();
|
|
16335
|
-
init_navigator();
|
|
16336
16326
|
Object.defineProperty(exports5, "t", {
|
|
16337
16327
|
value: true
|
|
16338
16328
|
});
|
|
@@ -16348,9 +16338,9 @@ var mqtt = (() => {
|
|
|
16348
16338
|
var require_Base3 = __commonJS({
|
|
16349
16339
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js"(exports5) {
|
|
16350
16340
|
"use strict";
|
|
16341
|
+
init_dirname();
|
|
16351
16342
|
init_buffer2();
|
|
16352
16343
|
init_process2();
|
|
16353
|
-
init_navigator();
|
|
16354
16344
|
Object.defineProperty(exports5, "t", {
|
|
16355
16345
|
value: true
|
|
16356
16346
|
});
|
|
@@ -16540,9 +16530,9 @@ var mqtt = (() => {
|
|
|
16540
16530
|
var require_HashSet = __commonJS({
|
|
16541
16531
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js"(exports5) {
|
|
16542
16532
|
"use strict";
|
|
16533
|
+
init_dirname();
|
|
16543
16534
|
init_buffer2();
|
|
16544
16535
|
init_process2();
|
|
16545
|
-
init_navigator();
|
|
16546
16536
|
Object.defineProperty(exports5, "t", {
|
|
16547
16537
|
value: true
|
|
16548
16538
|
});
|
|
@@ -16634,9 +16624,9 @@ var mqtt = (() => {
|
|
|
16634
16624
|
var require_HashMap = __commonJS({
|
|
16635
16625
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js"(exports5) {
|
|
16636
16626
|
"use strict";
|
|
16627
|
+
init_dirname();
|
|
16637
16628
|
init_buffer2();
|
|
16638
16629
|
init_process2();
|
|
16639
|
-
init_navigator();
|
|
16640
16630
|
Object.defineProperty(exports5, "t", {
|
|
16641
16631
|
value: true
|
|
16642
16632
|
});
|
|
@@ -16763,9 +16753,9 @@ var mqtt = (() => {
|
|
|
16763
16753
|
var require_cjs2 = __commonJS({
|
|
16764
16754
|
"node_modules/js-sdsl/dist/cjs/index.js"(exports5) {
|
|
16765
16755
|
"use strict";
|
|
16756
|
+
init_dirname();
|
|
16766
16757
|
init_buffer2();
|
|
16767
16758
|
init_process2();
|
|
16768
|
-
init_navigator();
|
|
16769
16759
|
Object.defineProperty(exports5, "t", {
|
|
16770
16760
|
value: true
|
|
16771
16761
|
});
|
|
@@ -16851,9 +16841,9 @@ var mqtt = (() => {
|
|
|
16851
16841
|
var require_number_allocator = __commonJS({
|
|
16852
16842
|
"node_modules/number-allocator/lib/number-allocator.js"(exports5, module) {
|
|
16853
16843
|
"use strict";
|
|
16844
|
+
init_dirname();
|
|
16854
16845
|
init_buffer2();
|
|
16855
16846
|
init_process2();
|
|
16856
|
-
init_navigator();
|
|
16857
16847
|
var SortedSet = require_cjs2().OrderedSet;
|
|
16858
16848
|
var debugTrace = require_browser4()("number-allocator:trace");
|
|
16859
16849
|
var debugError = require_browser4()("number-allocator:error");
|
|
@@ -17013,9 +17003,9 @@ var mqtt = (() => {
|
|
|
17013
17003
|
// node_modules/number-allocator/index.js
|
|
17014
17004
|
var require_number_allocator2 = __commonJS({
|
|
17015
17005
|
"node_modules/number-allocator/index.js"(exports5, module) {
|
|
17006
|
+
init_dirname();
|
|
17016
17007
|
init_buffer2();
|
|
17017
17008
|
init_process2();
|
|
17018
|
-
init_navigator();
|
|
17019
17009
|
var NumberAllocator = require_number_allocator();
|
|
17020
17010
|
module.exports.NumberAllocator = NumberAllocator;
|
|
17021
17011
|
}
|
|
@@ -17025,9 +17015,9 @@ var mqtt = (() => {
|
|
|
17025
17015
|
var require_topic_alias_send = __commonJS({
|
|
17026
17016
|
"build/lib/topic-alias-send.js"(exports5) {
|
|
17027
17017
|
"use strict";
|
|
17018
|
+
init_dirname();
|
|
17028
17019
|
init_buffer2();
|
|
17029
17020
|
init_process2();
|
|
17030
|
-
init_navigator();
|
|
17031
17021
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17032
17022
|
var lru_cache_1 = require_cjs();
|
|
17033
17023
|
var number_allocator_1 = require_number_allocator2();
|
|
@@ -17086,9 +17076,9 @@ var mqtt = (() => {
|
|
|
17086
17076
|
var require_connack = __commonJS({
|
|
17087
17077
|
"build/lib/handlers/connack.js"(exports5) {
|
|
17088
17078
|
"use strict";
|
|
17079
|
+
init_dirname();
|
|
17089
17080
|
init_buffer2();
|
|
17090
17081
|
init_process2();
|
|
17091
|
-
init_navigator();
|
|
17092
17082
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17093
17083
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17094
17084
|
};
|
|
@@ -17139,9 +17129,9 @@ var mqtt = (() => {
|
|
|
17139
17129
|
var require_pubrel = __commonJS({
|
|
17140
17130
|
"build/lib/handlers/pubrel.js"(exports5) {
|
|
17141
17131
|
"use strict";
|
|
17132
|
+
init_dirname();
|
|
17142
17133
|
init_buffer2();
|
|
17143
17134
|
init_process2();
|
|
17144
|
-
init_navigator();
|
|
17145
17135
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17146
17136
|
var handlePubrel = (client, packet, done) => {
|
|
17147
17137
|
client.log("handling pubrel packet");
|
|
@@ -17171,9 +17161,9 @@ var mqtt = (() => {
|
|
|
17171
17161
|
var require_handlers = __commonJS({
|
|
17172
17162
|
"build/lib/handlers/index.js"(exports5) {
|
|
17173
17163
|
"use strict";
|
|
17164
|
+
init_dirname();
|
|
17174
17165
|
init_buffer2();
|
|
17175
17166
|
init_process2();
|
|
17176
|
-
init_navigator();
|
|
17177
17167
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17178
17168
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17179
17169
|
};
|
|
@@ -17244,9 +17234,9 @@ var mqtt = (() => {
|
|
|
17244
17234
|
var require_TypedEmitter = __commonJS({
|
|
17245
17235
|
"build/lib/TypedEmitter.js"(exports5) {
|
|
17246
17236
|
"use strict";
|
|
17237
|
+
init_dirname();
|
|
17247
17238
|
init_buffer2();
|
|
17248
17239
|
init_process2();
|
|
17249
|
-
init_navigator();
|
|
17250
17240
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17251
17241
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17252
17242
|
};
|
|
@@ -17265,9 +17255,9 @@ var mqtt = (() => {
|
|
|
17265
17255
|
var require_is_browser = __commonJS({
|
|
17266
17256
|
"build/lib/is-browser.js"(exports5) {
|
|
17267
17257
|
"use strict";
|
|
17258
|
+
init_dirname();
|
|
17268
17259
|
init_buffer2();
|
|
17269
17260
|
init_process2();
|
|
17270
|
-
init_navigator();
|
|
17271
17261
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17272
17262
|
exports5.isReactNativeBrowser = exports5.isWebWorker = void 0;
|
|
17273
17263
|
var isStandardBrowserEnv = () => {
|
|
@@ -17282,13 +17272,12 @@ var mqtt = (() => {
|
|
|
17282
17272
|
}
|
|
17283
17273
|
return false;
|
|
17284
17274
|
};
|
|
17285
|
-
var isTxikijsEnv = () => typeof navigator !== "undefined" && navigator.userAgent === "txiki.js";
|
|
17286
17275
|
var isWebWorkerEnv = () => {
|
|
17287
17276
|
var _a, _b;
|
|
17288
17277
|
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")));
|
|
17289
17278
|
};
|
|
17290
17279
|
var isReactNativeEnv = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
17291
|
-
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv()
|
|
17280
|
+
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv();
|
|
17292
17281
|
exports5.isWebWorker = isWebWorkerEnv();
|
|
17293
17282
|
exports5.isReactNativeBrowser = isReactNativeEnv();
|
|
17294
17283
|
exports5.default = isBrowser;
|
|
@@ -17298,9 +17287,9 @@ var mqtt = (() => {
|
|
|
17298
17287
|
// node_modules/fast-unique-numbers/build/es5/bundle.js
|
|
17299
17288
|
var require_bundle = __commonJS({
|
|
17300
17289
|
"node_modules/fast-unique-numbers/build/es5/bundle.js"(exports5, module) {
|
|
17290
|
+
init_dirname();
|
|
17301
17291
|
init_buffer2();
|
|
17302
17292
|
init_process2();
|
|
17303
|
-
init_navigator();
|
|
17304
17293
|
(function(global2, factory) {
|
|
17305
17294
|
typeof exports5 === "object" && typeof module !== "undefined" ? factory(exports5) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.fastUniqueNumbers = {}));
|
|
17306
17295
|
})(exports5, function(exports6) {
|
|
@@ -17356,9 +17345,9 @@ var mqtt = (() => {
|
|
|
17356
17345
|
// node_modules/worker-timers-broker/build/es5/bundle.js
|
|
17357
17346
|
var require_bundle2 = __commonJS({
|
|
17358
17347
|
"node_modules/worker-timers-broker/build/es5/bundle.js"(exports5, module) {
|
|
17348
|
+
init_dirname();
|
|
17359
17349
|
init_buffer2();
|
|
17360
17350
|
init_process2();
|
|
17361
|
-
init_navigator();
|
|
17362
17351
|
(function(global2, factory) {
|
|
17363
17352
|
typeof exports5 === "object" && typeof module !== "undefined" ? factory(exports5, require_bundle()) : typeof define === "function" && define.amd ? define(["exports", "fast-unique-numbers"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.workerTimersBroker = {}, global2.fastUniqueNumbers));
|
|
17364
17353
|
})(exports5, function(exports6, fastUniqueNumbers) {
|
|
@@ -17517,9 +17506,9 @@ var mqtt = (() => {
|
|
|
17517
17506
|
// node_modules/worker-timers/build/es5/bundle.js
|
|
17518
17507
|
var require_bundle3 = __commonJS({
|
|
17519
17508
|
"node_modules/worker-timers/build/es5/bundle.js"(exports5, module) {
|
|
17509
|
+
init_dirname();
|
|
17520
17510
|
init_buffer2();
|
|
17521
17511
|
init_process2();
|
|
17522
|
-
init_navigator();
|
|
17523
17512
|
(function(global2, factory) {
|
|
17524
17513
|
typeof exports5 === "object" && typeof module !== "undefined" ? factory(exports5, require_bundle2()) : typeof define === "function" && define.amd ? define(["exports", "worker-timers-broker"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.workerTimers = {}, global2.workerTimersBroker));
|
|
17525
17514
|
})(exports5, function(exports6, workerTimersBroker) {
|
|
@@ -17569,9 +17558,9 @@ var mqtt = (() => {
|
|
|
17569
17558
|
var require_get_timer = __commonJS({
|
|
17570
17559
|
"build/lib/get-timer.js"(exports5) {
|
|
17571
17560
|
"use strict";
|
|
17561
|
+
init_dirname();
|
|
17572
17562
|
init_buffer2();
|
|
17573
17563
|
init_process2();
|
|
17574
|
-
init_navigator();
|
|
17575
17564
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
17576
17565
|
if (k22 === void 0)
|
|
17577
17566
|
k22 = k2;
|
|
@@ -17637,9 +17626,9 @@ var mqtt = (() => {
|
|
|
17637
17626
|
var require_KeepaliveManager = __commonJS({
|
|
17638
17627
|
"build/lib/KeepaliveManager.js"(exports5) {
|
|
17639
17628
|
"use strict";
|
|
17629
|
+
init_dirname();
|
|
17640
17630
|
init_buffer2();
|
|
17641
17631
|
init_process2();
|
|
17642
|
-
init_navigator();
|
|
17643
17632
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17644
17633
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17645
17634
|
};
|
|
@@ -17710,9 +17699,9 @@ var mqtt = (() => {
|
|
|
17710
17699
|
var require_client = __commonJS({
|
|
17711
17700
|
"build/lib/client.js"(exports5) {
|
|
17712
17701
|
"use strict";
|
|
17702
|
+
init_dirname();
|
|
17713
17703
|
init_buffer2();
|
|
17714
17704
|
init_process2();
|
|
17715
|
-
init_navigator();
|
|
17716
17705
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
17717
17706
|
if (k22 === void 0)
|
|
17718
17707
|
k22 = k2;
|
|
@@ -18861,9 +18850,9 @@ var mqtt = (() => {
|
|
|
18861
18850
|
var require_unique_message_id_provider = __commonJS({
|
|
18862
18851
|
"build/lib/unique-message-id-provider.js"(exports5) {
|
|
18863
18852
|
"use strict";
|
|
18853
|
+
init_dirname();
|
|
18864
18854
|
init_buffer2();
|
|
18865
18855
|
init_process2();
|
|
18866
|
-
init_navigator();
|
|
18867
18856
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
18868
18857
|
var number_allocator_1 = require_number_allocator2();
|
|
18869
18858
|
var UniqueMessageIdProvider = class {
|
|
@@ -18925,9 +18914,9 @@ var mqtt = (() => {
|
|
|
18925
18914
|
var t3, o3, n3, e3, r3, c3, s3, u3, a3, d2, h3, p3;
|
|
18926
18915
|
var init_chunk_924bb2e1 = __esm({
|
|
18927
18916
|
"node_modules/@jspm/core/nodelibs/browser/chunk-924bb2e1.js"() {
|
|
18917
|
+
init_dirname();
|
|
18928
18918
|
init_buffer2();
|
|
18929
18919
|
init_process2();
|
|
18930
|
-
init_navigator();
|
|
18931
18920
|
t3 = 2147483647;
|
|
18932
18921
|
o3 = /^xn--/;
|
|
18933
18922
|
n3 = /[^\0-\x7E]/;
|
|
@@ -19021,9 +19010,9 @@ var mqtt = (() => {
|
|
|
19021
19010
|
var n4, r4, t4, o4;
|
|
19022
19011
|
var init_chunk_b04e620d = __esm({
|
|
19023
19012
|
"node_modules/@jspm/core/nodelibs/browser/chunk-b04e620d.js"() {
|
|
19013
|
+
init_dirname();
|
|
19024
19014
|
init_buffer2();
|
|
19025
19015
|
init_process2();
|
|
19026
|
-
init_navigator();
|
|
19027
19016
|
n4 = function(n7, r7, t6, o7) {
|
|
19028
19017
|
r7 = r7 || "&", t6 = t6 || "=";
|
|
19029
19018
|
var a6 = {};
|
|
@@ -19129,9 +19118,9 @@ var mqtt = (() => {
|
|
|
19129
19118
|
var e5, t5, n5, r5, o5, l4, s4, f4, a4, T2;
|
|
19130
19119
|
var init_chunk_5decc758 = __esm({
|
|
19131
19120
|
"node_modules/@jspm/core/nodelibs/browser/chunk-5decc758.js"() {
|
|
19121
|
+
init_dirname();
|
|
19132
19122
|
init_buffer2();
|
|
19133
19123
|
init_process2();
|
|
19134
|
-
init_navigator();
|
|
19135
19124
|
r5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : global;
|
|
19136
19125
|
o5 = e5 = {};
|
|
19137
19126
|
!function() {
|
|
@@ -19359,9 +19348,9 @@ var mqtt = (() => {
|
|
|
19359
19348
|
var exports2, _dewExec2, _global, process2;
|
|
19360
19349
|
var init_chunk_2eac56ff = __esm({
|
|
19361
19350
|
"node_modules/@jspm/core/nodelibs/browser/chunk-2eac56ff.js"() {
|
|
19351
|
+
init_dirname();
|
|
19362
19352
|
init_buffer2();
|
|
19363
19353
|
init_process2();
|
|
19364
|
-
init_navigator();
|
|
19365
19354
|
exports2 = {};
|
|
19366
19355
|
_dewExec2 = false;
|
|
19367
19356
|
_global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global;
|
|
@@ -19830,9 +19819,9 @@ var mqtt = (() => {
|
|
|
19830
19819
|
var exports$12, _dewExec3, exports3;
|
|
19831
19820
|
var init_chunk_23dbec7b = __esm({
|
|
19832
19821
|
"node_modules/@jspm/core/nodelibs/browser/chunk-23dbec7b.js"() {
|
|
19822
|
+
init_dirname();
|
|
19833
19823
|
init_buffer2();
|
|
19834
19824
|
init_process2();
|
|
19835
|
-
init_navigator();
|
|
19836
19825
|
init_chunk_2eac56ff();
|
|
19837
19826
|
exports$12 = {};
|
|
19838
19827
|
_dewExec3 = false;
|
|
@@ -20460,9 +20449,9 @@ var mqtt = (() => {
|
|
|
20460
20449
|
var h5, e6, a5, o6, n6, i5, l5, p5, c5, u5, f5, m3, v3, g2, y3, b2, exports4, _dewExec4, path, processPlatform$1, CHAR_BACKWARD_SLASH$1, CHAR_FORWARD_SLASH$1, CHAR_LOWERCASE_A$1, CHAR_LOWERCASE_Z$1, isWindows$1, forwardSlashRegEx$1, percentRegEx$1, backslashRegEx$1, newlineRegEx$1, carriageReturnRegEx$1, tabRegEx$1, processPlatform, Url, format, resolve, resolveObject, parse, _URL, CHAR_BACKWARD_SLASH, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, isWindows, forwardSlashRegEx, percentRegEx, backslashRegEx, newlineRegEx, carriageReturnRegEx, tabRegEx;
|
|
20461
20450
|
var init_url = __esm({
|
|
20462
20451
|
"node_modules/@jspm/core/nodelibs/browser/url.js"() {
|
|
20452
|
+
init_dirname();
|
|
20463
20453
|
init_buffer2();
|
|
20464
20454
|
init_process2();
|
|
20465
|
-
init_navigator();
|
|
20466
20455
|
init_chunk_924bb2e1();
|
|
20467
20456
|
init_chunk_b04e620d();
|
|
20468
20457
|
init_chunk_5decc758();
|
|
@@ -20691,132 +20680,18 @@ var mqtt = (() => {
|
|
|
20691
20680
|
}
|
|
20692
20681
|
});
|
|
20693
20682
|
|
|
20694
|
-
// node_modules
|
|
20695
|
-
var
|
|
20696
|
-
|
|
20697
|
-
Server: () => unimplemented2,
|
|
20698
|
-
Socket: () => unimplemented2,
|
|
20699
|
-
Stream: () => unimplemented2,
|
|
20700
|
-
_createServerHandle: () => unimplemented2,
|
|
20701
|
-
_normalizeArgs: () => unimplemented2,
|
|
20702
|
-
_setSimultaneousAccepts: () => unimplemented2,
|
|
20703
|
-
connect: () => unimplemented2,
|
|
20704
|
-
createConnection: () => unimplemented2,
|
|
20705
|
-
createServer: () => unimplemented2,
|
|
20706
|
-
default: () => net,
|
|
20707
|
-
isIP: () => unimplemented2,
|
|
20708
|
-
isIPv4: () => unimplemented2,
|
|
20709
|
-
isIPv6: () => unimplemented2
|
|
20710
|
-
});
|
|
20711
|
-
function unimplemented2() {
|
|
20712
|
-
throw new Error("Node.js net module is not supported by JSPM core outside of Node.js");
|
|
20713
|
-
}
|
|
20714
|
-
var net;
|
|
20715
|
-
var init_net = __esm({
|
|
20716
|
-
"node_modules/@jspm/core/nodelibs/browser/net.js"() {
|
|
20717
|
-
init_buffer2();
|
|
20718
|
-
init_process2();
|
|
20719
|
-
init_navigator();
|
|
20720
|
-
net = {
|
|
20721
|
-
_createServerHandle: unimplemented2,
|
|
20722
|
-
_normalizeArgs: unimplemented2,
|
|
20723
|
-
_setSimultaneousAccepts: unimplemented2,
|
|
20724
|
-
connect: unimplemented2,
|
|
20725
|
-
createConnection: unimplemented2,
|
|
20726
|
-
createServer: unimplemented2,
|
|
20727
|
-
isIP: unimplemented2,
|
|
20728
|
-
isIPv4: unimplemented2,
|
|
20729
|
-
isIPv6: unimplemented2,
|
|
20730
|
-
Server: unimplemented2,
|
|
20731
|
-
Socket: unimplemented2,
|
|
20732
|
-
Stream: unimplemented2
|
|
20733
|
-
};
|
|
20734
|
-
}
|
|
20735
|
-
});
|
|
20736
|
-
|
|
20737
|
-
// build/lib/connect/tcp.js
|
|
20738
|
-
var require_tcp = __commonJS({
|
|
20739
|
-
"build/lib/connect/tcp.js"(exports5) {
|
|
20740
|
-
"use strict";
|
|
20741
|
-
init_buffer2();
|
|
20742
|
-
init_process2();
|
|
20743
|
-
init_navigator();
|
|
20744
|
-
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
20745
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
20746
|
-
};
|
|
20747
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20748
|
-
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
20749
|
-
var debug_1 = __importDefault(require_browser4());
|
|
20750
|
-
var debug = (0, debug_1.default)("mqttjs:tcp");
|
|
20751
|
-
var buildStream = (client, opts) => {
|
|
20752
|
-
opts.port = opts.port || 1883;
|
|
20753
|
-
opts.hostname = opts.hostname || opts.host || "localhost";
|
|
20754
|
-
const { port, path: path2 } = opts;
|
|
20755
|
-
const host = opts.hostname;
|
|
20756
|
-
debug("port %d and host %s", port, host);
|
|
20757
|
-
return net_1.default.createConnection({ port, host, path: path2 });
|
|
20758
|
-
};
|
|
20759
|
-
exports5.default = buildStream;
|
|
20760
|
-
}
|
|
20761
|
-
});
|
|
20762
|
-
|
|
20763
|
-
// node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js
|
|
20764
|
-
var empty_exports = {};
|
|
20765
|
-
__export(empty_exports, {
|
|
20766
|
-
default: () => empty_default
|
|
20767
|
-
});
|
|
20768
|
-
var empty_default;
|
|
20769
|
-
var init_empty = __esm({
|
|
20770
|
-
"node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js"() {
|
|
20771
|
-
init_buffer2();
|
|
20772
|
-
init_process2();
|
|
20773
|
-
init_navigator();
|
|
20774
|
-
empty_default = {};
|
|
20775
|
-
}
|
|
20776
|
-
});
|
|
20777
|
-
|
|
20778
|
-
// build/lib/connect/tls.js
|
|
20779
|
-
var require_tls = __commonJS({
|
|
20780
|
-
"build/lib/connect/tls.js"(exports5) {
|
|
20683
|
+
// node_modules/ws/browser.js
|
|
20684
|
+
var require_browser5 = __commonJS({
|
|
20685
|
+
"node_modules/ws/browser.js"(exports5, module) {
|
|
20781
20686
|
"use strict";
|
|
20687
|
+
init_dirname();
|
|
20782
20688
|
init_buffer2();
|
|
20783
20689
|
init_process2();
|
|
20784
|
-
|
|
20785
|
-
|
|
20786
|
-
|
|
20787
|
-
|
|
20788
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20789
|
-
var tls_1 = __importDefault((init_empty(), __toCommonJS(empty_exports)));
|
|
20790
|
-
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
20791
|
-
var debug_1 = __importDefault(require_browser4());
|
|
20792
|
-
var debug = (0, debug_1.default)("mqttjs:tls");
|
|
20793
|
-
var buildStream = (client, opts) => {
|
|
20794
|
-
opts.port = opts.port || 8883;
|
|
20795
|
-
opts.host = opts.hostname || opts.host || "localhost";
|
|
20796
|
-
if (net_1.default.isIP(opts.host) === 0) {
|
|
20797
|
-
opts.servername = opts.host;
|
|
20798
|
-
}
|
|
20799
|
-
opts.rejectUnauthorized = opts.rejectUnauthorized !== false;
|
|
20800
|
-
delete opts.path;
|
|
20801
|
-
debug("port %d host %s rejectUnauthorized %b", opts.port, opts.host, opts.rejectUnauthorized);
|
|
20802
|
-
const connection = tls_1.default.connect(opts);
|
|
20803
|
-
connection.on("secureConnect", () => {
|
|
20804
|
-
if (opts.rejectUnauthorized && !connection.authorized) {
|
|
20805
|
-
connection.emit("error", new Error("TLS not authorized"));
|
|
20806
|
-
} else {
|
|
20807
|
-
connection.removeListener("error", handleTLSerrors);
|
|
20808
|
-
}
|
|
20809
|
-
});
|
|
20810
|
-
function handleTLSerrors(err) {
|
|
20811
|
-
if (opts.rejectUnauthorized) {
|
|
20812
|
-
client.emit("error", err);
|
|
20813
|
-
}
|
|
20814
|
-
connection.end();
|
|
20815
|
-
}
|
|
20816
|
-
connection.on("error", handleTLSerrors);
|
|
20817
|
-
return connection;
|
|
20690
|
+
module.exports = function() {
|
|
20691
|
+
throw new Error(
|
|
20692
|
+
"ws does not work in the browser. Browser clients must use the native WebSocket object"
|
|
20693
|
+
);
|
|
20818
20694
|
};
|
|
20819
|
-
exports5.default = buildStream;
|
|
20820
20695
|
}
|
|
20821
20696
|
});
|
|
20822
20697
|
|
|
@@ -20824,9 +20699,9 @@ var mqtt = (() => {
|
|
|
20824
20699
|
var require_BufferedDuplex = __commonJS({
|
|
20825
20700
|
"build/lib/BufferedDuplex.js"(exports5) {
|
|
20826
20701
|
"use strict";
|
|
20702
|
+
init_dirname();
|
|
20827
20703
|
init_buffer2();
|
|
20828
20704
|
init_process2();
|
|
20829
|
-
init_navigator();
|
|
20830
20705
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20831
20706
|
exports5.BufferedDuplex = exports5.writev = void 0;
|
|
20832
20707
|
var readable_stream_1 = require_browser3();
|
|
@@ -20856,7 +20731,9 @@ var mqtt = (() => {
|
|
|
20856
20731
|
}
|
|
20857
20732
|
this.isSocketOpen = false;
|
|
20858
20733
|
this.proxy.on("data", (chunk) => {
|
|
20859
|
-
this.
|
|
20734
|
+
if (!this.destroyed) {
|
|
20735
|
+
this.push(chunk);
|
|
20736
|
+
}
|
|
20860
20737
|
});
|
|
20861
20738
|
}
|
|
20862
20739
|
_read(size) {
|
|
@@ -20901,94 +20778,436 @@ var mqtt = (() => {
|
|
|
20901
20778
|
}
|
|
20902
20779
|
});
|
|
20903
20780
|
|
|
20904
|
-
// build/lib/connect/
|
|
20905
|
-
var
|
|
20906
|
-
"build/lib/connect/
|
|
20781
|
+
// build/lib/connect/ws.js
|
|
20782
|
+
var require_ws = __commonJS({
|
|
20783
|
+
"build/lib/connect/ws.js"(exports5) {
|
|
20907
20784
|
"use strict";
|
|
20785
|
+
init_dirname();
|
|
20908
20786
|
init_buffer2();
|
|
20909
20787
|
init_process2();
|
|
20910
|
-
|
|
20788
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
20789
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
20790
|
+
};
|
|
20911
20791
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20792
|
+
exports5.streamBuilder = exports5.browserStreamBuilder = void 0;
|
|
20912
20793
|
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
20794
|
+
var ws_1 = __importDefault(require_browser5());
|
|
20795
|
+
var debug_1 = __importDefault(require_browser4());
|
|
20913
20796
|
var readable_stream_1 = require_browser3();
|
|
20797
|
+
var is_browser_1 = __importDefault(require_is_browser());
|
|
20914
20798
|
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
20915
|
-
var
|
|
20916
|
-
var
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
|
|
20921
|
-
|
|
20922
|
-
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
|
|
20927
|
-
|
|
20928
|
-
|
|
20929
|
-
|
|
20930
|
-
};
|
|
20931
|
-
_proxy._flush = (done) => {
|
|
20932
|
-
socketTask.close({
|
|
20933
|
-
success() {
|
|
20934
|
-
done();
|
|
20935
|
-
}
|
|
20936
|
-
});
|
|
20937
|
-
};
|
|
20938
|
-
return _proxy;
|
|
20799
|
+
var debug = (0, debug_1.default)("mqttjs:ws");
|
|
20800
|
+
var WSS_OPTIONS = [
|
|
20801
|
+
"rejectUnauthorized",
|
|
20802
|
+
"ca",
|
|
20803
|
+
"cert",
|
|
20804
|
+
"key",
|
|
20805
|
+
"pfx",
|
|
20806
|
+
"passphrase"
|
|
20807
|
+
];
|
|
20808
|
+
function buildUrl(opts, client) {
|
|
20809
|
+
let url = `${opts.protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
20810
|
+
if (typeof opts.transformWsUrl === "function") {
|
|
20811
|
+
url = opts.transformWsUrl(url, opts, client);
|
|
20812
|
+
}
|
|
20813
|
+
return url;
|
|
20939
20814
|
}
|
|
20940
20815
|
function setDefaultOpts(opts) {
|
|
20941
|
-
|
|
20942
|
-
|
|
20816
|
+
const options = opts;
|
|
20817
|
+
if (!opts.port) {
|
|
20818
|
+
if (opts.protocol === "wss") {
|
|
20819
|
+
options.port = 443;
|
|
20820
|
+
} else {
|
|
20821
|
+
options.port = 80;
|
|
20822
|
+
}
|
|
20943
20823
|
}
|
|
20944
20824
|
if (!opts.path) {
|
|
20945
|
-
|
|
20825
|
+
options.path = "/";
|
|
20946
20826
|
}
|
|
20947
20827
|
if (!opts.wsOptions) {
|
|
20948
|
-
|
|
20828
|
+
options.wsOptions = {};
|
|
20949
20829
|
}
|
|
20830
|
+
if (!is_browser_1.default && !opts.forceNativeWebSocket && opts.protocol === "wss") {
|
|
20831
|
+
WSS_OPTIONS.forEach((prop) => {
|
|
20832
|
+
if (Object.prototype.hasOwnProperty.call(opts, prop) && !Object.prototype.hasOwnProperty.call(opts.wsOptions, prop)) {
|
|
20833
|
+
options.wsOptions[prop] = opts[prop];
|
|
20834
|
+
}
|
|
20835
|
+
});
|
|
20836
|
+
}
|
|
20837
|
+
return options;
|
|
20950
20838
|
}
|
|
20951
|
-
function
|
|
20952
|
-
const
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
url = `${protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
20839
|
+
function setDefaultBrowserOpts(opts) {
|
|
20840
|
+
const options = setDefaultOpts(opts);
|
|
20841
|
+
if (!options.hostname) {
|
|
20842
|
+
options.hostname = options.host;
|
|
20956
20843
|
}
|
|
20957
|
-
if (
|
|
20958
|
-
|
|
20844
|
+
if (!options.hostname) {
|
|
20845
|
+
if (typeof document === "undefined") {
|
|
20846
|
+
throw new Error("Could not determine host. Specify host manually.");
|
|
20847
|
+
}
|
|
20848
|
+
const parsed = new URL(document.URL);
|
|
20849
|
+
options.hostname = parsed.hostname;
|
|
20850
|
+
if (!options.port) {
|
|
20851
|
+
options.port = Number(parsed.port);
|
|
20852
|
+
}
|
|
20959
20853
|
}
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
function bindEventHandler() {
|
|
20963
|
-
socketTask.onOpen(() => {
|
|
20964
|
-
stream.socketReady();
|
|
20965
|
-
});
|
|
20966
|
-
socketTask.onMessage((res) => {
|
|
20967
|
-
let { data } = res;
|
|
20968
|
-
if (data instanceof ArrayBuffer)
|
|
20969
|
-
data = buffer_1.Buffer.from(data);
|
|
20970
|
-
else
|
|
20971
|
-
data = buffer_1.Buffer.from(data, "utf8");
|
|
20972
|
-
proxy.push(data);
|
|
20973
|
-
});
|
|
20974
|
-
socketTask.onClose(() => {
|
|
20975
|
-
stream.emit("close");
|
|
20976
|
-
stream.end();
|
|
20977
|
-
stream.destroy();
|
|
20978
|
-
});
|
|
20979
|
-
socketTask.onError((error) => {
|
|
20980
|
-
const err = new Error(error.errMsg);
|
|
20981
|
-
stream.destroy(err);
|
|
20982
|
-
});
|
|
20983
|
-
}
|
|
20984
|
-
var buildStream = (client, opts) => {
|
|
20985
|
-
opts.hostname = opts.hostname || opts.host;
|
|
20986
|
-
if (!opts.hostname) {
|
|
20987
|
-
throw new Error("Could not determine host. Specify host manually.");
|
|
20854
|
+
if (options.objectMode === void 0) {
|
|
20855
|
+
options.objectMode = !(options.binary === true || options.binary === void 0);
|
|
20988
20856
|
}
|
|
20857
|
+
return options;
|
|
20858
|
+
}
|
|
20859
|
+
function createWebSocket(client, url, opts) {
|
|
20860
|
+
debug("createWebSocket");
|
|
20861
|
+
debug(`protocol: ${opts.protocolId} ${opts.protocolVersion}`);
|
|
20989
20862
|
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
20990
|
-
|
|
20991
|
-
|
|
20863
|
+
debug(`creating new Websocket for url: ${url} and protocol: ${websocketSubProtocol}`);
|
|
20864
|
+
let socket;
|
|
20865
|
+
if (opts.createWebsocket) {
|
|
20866
|
+
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
20867
|
+
} else {
|
|
20868
|
+
socket = new ws_1.default(url, [websocketSubProtocol], opts.wsOptions);
|
|
20869
|
+
}
|
|
20870
|
+
return socket;
|
|
20871
|
+
}
|
|
20872
|
+
function createBrowserWebSocket(client, opts) {
|
|
20873
|
+
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
20874
|
+
const url = buildUrl(opts, client);
|
|
20875
|
+
let socket;
|
|
20876
|
+
if (opts.createWebsocket) {
|
|
20877
|
+
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
20878
|
+
} else {
|
|
20879
|
+
socket = new WebSocket(url, [websocketSubProtocol]);
|
|
20880
|
+
}
|
|
20881
|
+
socket.binaryType = "arraybuffer";
|
|
20882
|
+
return socket;
|
|
20883
|
+
}
|
|
20884
|
+
var streamBuilder = (client, opts) => {
|
|
20885
|
+
debug("streamBuilder");
|
|
20886
|
+
const options = setDefaultOpts(opts);
|
|
20887
|
+
options.hostname = options.hostname || options.host || "localhost";
|
|
20888
|
+
const url = buildUrl(options, client);
|
|
20889
|
+
const socket = createWebSocket(client, url, options);
|
|
20890
|
+
const webSocketStream = ws_1.default.createWebSocketStream(socket, options.wsOptions);
|
|
20891
|
+
webSocketStream["url"] = url;
|
|
20892
|
+
socket.on("close", () => {
|
|
20893
|
+
webSocketStream.destroy();
|
|
20894
|
+
});
|
|
20895
|
+
return webSocketStream;
|
|
20896
|
+
};
|
|
20897
|
+
exports5.streamBuilder = streamBuilder;
|
|
20898
|
+
var browserStreamBuilder = (client, opts) => {
|
|
20899
|
+
debug("browserStreamBuilder");
|
|
20900
|
+
let stream;
|
|
20901
|
+
const options = setDefaultBrowserOpts(opts);
|
|
20902
|
+
const bufferSize = options.browserBufferSize || 1024 * 512;
|
|
20903
|
+
const bufferTimeout = opts.browserBufferTimeout || 1e3;
|
|
20904
|
+
const coerceToBuffer = !opts.objectMode;
|
|
20905
|
+
const socket = createBrowserWebSocket(client, opts);
|
|
20906
|
+
const proxy = buildProxy(opts, socketWriteBrowser, socketEndBrowser);
|
|
20907
|
+
if (!opts.objectMode) {
|
|
20908
|
+
proxy._writev = BufferedDuplex_1.writev.bind(proxy);
|
|
20909
|
+
}
|
|
20910
|
+
proxy.on("close", () => {
|
|
20911
|
+
socket.close();
|
|
20912
|
+
});
|
|
20913
|
+
const eventListenerSupport = typeof socket.addEventListener !== "undefined";
|
|
20914
|
+
if (socket.readyState === socket.OPEN) {
|
|
20915
|
+
stream = proxy;
|
|
20916
|
+
stream.socket = socket;
|
|
20917
|
+
} else {
|
|
20918
|
+
stream = new BufferedDuplex_1.BufferedDuplex(opts, proxy, socket);
|
|
20919
|
+
if (eventListenerSupport) {
|
|
20920
|
+
socket.addEventListener("open", onOpen);
|
|
20921
|
+
} else {
|
|
20922
|
+
socket.onopen = onOpen;
|
|
20923
|
+
}
|
|
20924
|
+
}
|
|
20925
|
+
if (eventListenerSupport) {
|
|
20926
|
+
socket.addEventListener("close", onClose);
|
|
20927
|
+
socket.addEventListener("error", onError);
|
|
20928
|
+
socket.addEventListener("message", onMessage);
|
|
20929
|
+
} else {
|
|
20930
|
+
socket.onclose = onClose;
|
|
20931
|
+
socket.onerror = onError;
|
|
20932
|
+
socket.onmessage = onMessage;
|
|
20933
|
+
}
|
|
20934
|
+
function buildProxy(pOptions, socketWrite, socketEnd) {
|
|
20935
|
+
const _proxy = new readable_stream_1.Transform({
|
|
20936
|
+
objectMode: pOptions.objectMode
|
|
20937
|
+
});
|
|
20938
|
+
_proxy._write = socketWrite;
|
|
20939
|
+
_proxy._flush = socketEnd;
|
|
20940
|
+
return _proxy;
|
|
20941
|
+
}
|
|
20942
|
+
function onOpen() {
|
|
20943
|
+
debug("WebSocket onOpen");
|
|
20944
|
+
if (stream instanceof BufferedDuplex_1.BufferedDuplex) {
|
|
20945
|
+
stream.socketReady();
|
|
20946
|
+
}
|
|
20947
|
+
}
|
|
20948
|
+
function onClose(event) {
|
|
20949
|
+
debug("WebSocket onClose", event);
|
|
20950
|
+
stream.end();
|
|
20951
|
+
stream.destroy();
|
|
20952
|
+
}
|
|
20953
|
+
function onError(err) {
|
|
20954
|
+
debug("WebSocket onError", err);
|
|
20955
|
+
const error = new Error("WebSocket error");
|
|
20956
|
+
error["event"] = err;
|
|
20957
|
+
stream.destroy(error);
|
|
20958
|
+
}
|
|
20959
|
+
function onMessage(event) {
|
|
20960
|
+
let { data } = event;
|
|
20961
|
+
if (data instanceof ArrayBuffer)
|
|
20962
|
+
data = buffer_1.Buffer.from(data);
|
|
20963
|
+
else
|
|
20964
|
+
data = buffer_1.Buffer.from(data, "utf8");
|
|
20965
|
+
if (proxy && !proxy.destroyed) {
|
|
20966
|
+
proxy.push(data);
|
|
20967
|
+
}
|
|
20968
|
+
}
|
|
20969
|
+
function socketWriteBrowser(chunk, enc, next) {
|
|
20970
|
+
if (socket.bufferedAmount > bufferSize) {
|
|
20971
|
+
setTimeout(socketWriteBrowser, bufferTimeout, chunk, enc, next);
|
|
20972
|
+
return;
|
|
20973
|
+
}
|
|
20974
|
+
if (coerceToBuffer && typeof chunk === "string") {
|
|
20975
|
+
chunk = buffer_1.Buffer.from(chunk, "utf8");
|
|
20976
|
+
}
|
|
20977
|
+
try {
|
|
20978
|
+
socket.send(chunk);
|
|
20979
|
+
} catch (err) {
|
|
20980
|
+
return next(err);
|
|
20981
|
+
}
|
|
20982
|
+
next();
|
|
20983
|
+
}
|
|
20984
|
+
function socketEndBrowser(done) {
|
|
20985
|
+
socket.close();
|
|
20986
|
+
done();
|
|
20987
|
+
}
|
|
20988
|
+
return stream;
|
|
20989
|
+
};
|
|
20990
|
+
exports5.browserStreamBuilder = browserStreamBuilder;
|
|
20991
|
+
}
|
|
20992
|
+
});
|
|
20993
|
+
|
|
20994
|
+
// node_modules/@jspm/core/nodelibs/browser/net.js
|
|
20995
|
+
var net_exports = {};
|
|
20996
|
+
__export(net_exports, {
|
|
20997
|
+
Server: () => unimplemented2,
|
|
20998
|
+
Socket: () => unimplemented2,
|
|
20999
|
+
Stream: () => unimplemented2,
|
|
21000
|
+
_createServerHandle: () => unimplemented2,
|
|
21001
|
+
_normalizeArgs: () => unimplemented2,
|
|
21002
|
+
_setSimultaneousAccepts: () => unimplemented2,
|
|
21003
|
+
connect: () => unimplemented2,
|
|
21004
|
+
createConnection: () => unimplemented2,
|
|
21005
|
+
createServer: () => unimplemented2,
|
|
21006
|
+
default: () => net,
|
|
21007
|
+
isIP: () => unimplemented2,
|
|
21008
|
+
isIPv4: () => unimplemented2,
|
|
21009
|
+
isIPv6: () => unimplemented2
|
|
21010
|
+
});
|
|
21011
|
+
function unimplemented2() {
|
|
21012
|
+
throw new Error("Node.js net module is not supported by JSPM core outside of Node.js");
|
|
21013
|
+
}
|
|
21014
|
+
var net;
|
|
21015
|
+
var init_net = __esm({
|
|
21016
|
+
"node_modules/@jspm/core/nodelibs/browser/net.js"() {
|
|
21017
|
+
init_dirname();
|
|
21018
|
+
init_buffer2();
|
|
21019
|
+
init_process2();
|
|
21020
|
+
net = {
|
|
21021
|
+
_createServerHandle: unimplemented2,
|
|
21022
|
+
_normalizeArgs: unimplemented2,
|
|
21023
|
+
_setSimultaneousAccepts: unimplemented2,
|
|
21024
|
+
connect: unimplemented2,
|
|
21025
|
+
createConnection: unimplemented2,
|
|
21026
|
+
createServer: unimplemented2,
|
|
21027
|
+
isIP: unimplemented2,
|
|
21028
|
+
isIPv4: unimplemented2,
|
|
21029
|
+
isIPv6: unimplemented2,
|
|
21030
|
+
Server: unimplemented2,
|
|
21031
|
+
Socket: unimplemented2,
|
|
21032
|
+
Stream: unimplemented2
|
|
21033
|
+
};
|
|
21034
|
+
}
|
|
21035
|
+
});
|
|
21036
|
+
|
|
21037
|
+
// build/lib/connect/tcp.js
|
|
21038
|
+
var require_tcp = __commonJS({
|
|
21039
|
+
"build/lib/connect/tcp.js"(exports5) {
|
|
21040
|
+
"use strict";
|
|
21041
|
+
init_dirname();
|
|
21042
|
+
init_buffer2();
|
|
21043
|
+
init_process2();
|
|
21044
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21045
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21046
|
+
};
|
|
21047
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21048
|
+
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
21049
|
+
var debug_1 = __importDefault(require_browser4());
|
|
21050
|
+
var debug = (0, debug_1.default)("mqttjs:tcp");
|
|
21051
|
+
var buildStream = (client, opts) => {
|
|
21052
|
+
opts.port = opts.port || 1883;
|
|
21053
|
+
opts.hostname = opts.hostname || opts.host || "localhost";
|
|
21054
|
+
const { port, path: path2 } = opts;
|
|
21055
|
+
const host = opts.hostname;
|
|
21056
|
+
debug("port %d and host %s", port, host);
|
|
21057
|
+
return net_1.default.createConnection({ port, host, path: path2 });
|
|
21058
|
+
};
|
|
21059
|
+
exports5.default = buildStream;
|
|
21060
|
+
}
|
|
21061
|
+
});
|
|
21062
|
+
|
|
21063
|
+
// node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js
|
|
21064
|
+
var empty_exports = {};
|
|
21065
|
+
__export(empty_exports, {
|
|
21066
|
+
default: () => empty_default
|
|
21067
|
+
});
|
|
21068
|
+
var empty_default;
|
|
21069
|
+
var init_empty = __esm({
|
|
21070
|
+
"node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js"() {
|
|
21071
|
+
init_dirname();
|
|
21072
|
+
init_buffer2();
|
|
21073
|
+
init_process2();
|
|
21074
|
+
empty_default = {};
|
|
21075
|
+
}
|
|
21076
|
+
});
|
|
21077
|
+
|
|
21078
|
+
// build/lib/connect/tls.js
|
|
21079
|
+
var require_tls = __commonJS({
|
|
21080
|
+
"build/lib/connect/tls.js"(exports5) {
|
|
21081
|
+
"use strict";
|
|
21082
|
+
init_dirname();
|
|
21083
|
+
init_buffer2();
|
|
21084
|
+
init_process2();
|
|
21085
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21086
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21087
|
+
};
|
|
21088
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21089
|
+
var tls_1 = __importDefault((init_empty(), __toCommonJS(empty_exports)));
|
|
21090
|
+
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
21091
|
+
var debug_1 = __importDefault(require_browser4());
|
|
21092
|
+
var debug = (0, debug_1.default)("mqttjs:tls");
|
|
21093
|
+
var buildStream = (client, opts) => {
|
|
21094
|
+
opts.port = opts.port || 8883;
|
|
21095
|
+
opts.host = opts.hostname || opts.host || "localhost";
|
|
21096
|
+
if (net_1.default.isIP(opts.host) === 0) {
|
|
21097
|
+
opts.servername = opts.host;
|
|
21098
|
+
}
|
|
21099
|
+
opts.rejectUnauthorized = opts.rejectUnauthorized !== false;
|
|
21100
|
+
delete opts.path;
|
|
21101
|
+
debug("port %d host %s rejectUnauthorized %b", opts.port, opts.host, opts.rejectUnauthorized);
|
|
21102
|
+
const connection = tls_1.default.connect(opts);
|
|
21103
|
+
connection.on("secureConnect", () => {
|
|
21104
|
+
if (opts.rejectUnauthorized && !connection.authorized) {
|
|
21105
|
+
connection.emit("error", new Error("TLS not authorized"));
|
|
21106
|
+
} else {
|
|
21107
|
+
connection.removeListener("error", handleTLSerrors);
|
|
21108
|
+
}
|
|
21109
|
+
});
|
|
21110
|
+
function handleTLSerrors(err) {
|
|
21111
|
+
if (opts.rejectUnauthorized) {
|
|
21112
|
+
client.emit("error", err);
|
|
21113
|
+
}
|
|
21114
|
+
connection.end();
|
|
21115
|
+
}
|
|
21116
|
+
connection.on("error", handleTLSerrors);
|
|
21117
|
+
return connection;
|
|
21118
|
+
};
|
|
21119
|
+
exports5.default = buildStream;
|
|
21120
|
+
}
|
|
21121
|
+
});
|
|
21122
|
+
|
|
21123
|
+
// build/lib/connect/wx.js
|
|
21124
|
+
var require_wx = __commonJS({
|
|
21125
|
+
"build/lib/connect/wx.js"(exports5) {
|
|
21126
|
+
"use strict";
|
|
21127
|
+
init_dirname();
|
|
21128
|
+
init_buffer2();
|
|
21129
|
+
init_process2();
|
|
21130
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21131
|
+
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21132
|
+
var readable_stream_1 = require_browser3();
|
|
21133
|
+
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
21134
|
+
var socketTask;
|
|
21135
|
+
var proxy;
|
|
21136
|
+
var stream;
|
|
21137
|
+
function buildProxy() {
|
|
21138
|
+
const _proxy = new readable_stream_1.Transform();
|
|
21139
|
+
_proxy._write = (chunk, encoding, next) => {
|
|
21140
|
+
socketTask.send({
|
|
21141
|
+
data: chunk.buffer,
|
|
21142
|
+
success() {
|
|
21143
|
+
next();
|
|
21144
|
+
},
|
|
21145
|
+
fail(errMsg) {
|
|
21146
|
+
next(new Error(errMsg));
|
|
21147
|
+
}
|
|
21148
|
+
});
|
|
21149
|
+
};
|
|
21150
|
+
_proxy._flush = (done) => {
|
|
21151
|
+
socketTask.close({
|
|
21152
|
+
success() {
|
|
21153
|
+
done();
|
|
21154
|
+
}
|
|
21155
|
+
});
|
|
21156
|
+
};
|
|
21157
|
+
return _proxy;
|
|
21158
|
+
}
|
|
21159
|
+
function setDefaultOpts(opts) {
|
|
21160
|
+
if (!opts.hostname) {
|
|
21161
|
+
opts.hostname = "localhost";
|
|
21162
|
+
}
|
|
21163
|
+
if (!opts.path) {
|
|
21164
|
+
opts.path = "/";
|
|
21165
|
+
}
|
|
21166
|
+
if (!opts.wsOptions) {
|
|
21167
|
+
opts.wsOptions = {};
|
|
21168
|
+
}
|
|
21169
|
+
}
|
|
21170
|
+
function buildUrl(opts, client) {
|
|
21171
|
+
const protocol = opts.protocol === "wxs" ? "wss" : "ws";
|
|
21172
|
+
let url = `${protocol}://${opts.hostname}${opts.path}`;
|
|
21173
|
+
if (opts.port && opts.port !== 80 && opts.port !== 443) {
|
|
21174
|
+
url = `${protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
21175
|
+
}
|
|
21176
|
+
if (typeof opts.transformWsUrl === "function") {
|
|
21177
|
+
url = opts.transformWsUrl(url, opts, client);
|
|
21178
|
+
}
|
|
21179
|
+
return url;
|
|
21180
|
+
}
|
|
21181
|
+
function bindEventHandler() {
|
|
21182
|
+
socketTask.onOpen(() => {
|
|
21183
|
+
stream.socketReady();
|
|
21184
|
+
});
|
|
21185
|
+
socketTask.onMessage((res) => {
|
|
21186
|
+
let { data } = res;
|
|
21187
|
+
if (data instanceof ArrayBuffer)
|
|
21188
|
+
data = buffer_1.Buffer.from(data);
|
|
21189
|
+
else
|
|
21190
|
+
data = buffer_1.Buffer.from(data, "utf8");
|
|
21191
|
+
proxy.push(data);
|
|
21192
|
+
});
|
|
21193
|
+
socketTask.onClose(() => {
|
|
21194
|
+
stream.emit("close");
|
|
21195
|
+
stream.end();
|
|
21196
|
+
stream.destroy();
|
|
21197
|
+
});
|
|
21198
|
+
socketTask.onError((error) => {
|
|
21199
|
+
const err = new Error(error.errMsg);
|
|
21200
|
+
stream.destroy(err);
|
|
21201
|
+
});
|
|
21202
|
+
}
|
|
21203
|
+
var buildStream = (client, opts) => {
|
|
21204
|
+
opts.hostname = opts.hostname || opts.host;
|
|
21205
|
+
if (!opts.hostname) {
|
|
21206
|
+
throw new Error("Could not determine host. Specify host manually.");
|
|
21207
|
+
}
|
|
21208
|
+
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21209
|
+
setDefaultOpts(opts);
|
|
21210
|
+
const url = buildUrl(opts, client);
|
|
20992
21211
|
socketTask = wx.connectSocket({
|
|
20993
21212
|
url,
|
|
20994
21213
|
protocols: [websocketSubProtocol]
|
|
@@ -21026,9 +21245,9 @@ var mqtt = (() => {
|
|
|
21026
21245
|
var require_ali = __commonJS({
|
|
21027
21246
|
"build/lib/connect/ali.js"(exports5) {
|
|
21028
21247
|
"use strict";
|
|
21248
|
+
init_dirname();
|
|
21029
21249
|
init_buffer2();
|
|
21030
21250
|
init_process2();
|
|
21031
|
-
init_navigator();
|
|
21032
21251
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21033
21252
|
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21034
21253
|
var readable_stream_1 = require_browser3();
|
|
@@ -21135,237 +21354,13 @@ var mqtt = (() => {
|
|
|
21135
21354
|
}
|
|
21136
21355
|
});
|
|
21137
21356
|
|
|
21138
|
-
// node_modules/ws/browser.js
|
|
21139
|
-
var require_browser5 = __commonJS({
|
|
21140
|
-
"node_modules/ws/browser.js"(exports5, module) {
|
|
21141
|
-
"use strict";
|
|
21142
|
-
init_buffer2();
|
|
21143
|
-
init_process2();
|
|
21144
|
-
init_navigator();
|
|
21145
|
-
module.exports = function() {
|
|
21146
|
-
throw new Error(
|
|
21147
|
-
"ws does not work in the browser. Browser clients must use the native WebSocket object"
|
|
21148
|
-
);
|
|
21149
|
-
};
|
|
21150
|
-
}
|
|
21151
|
-
});
|
|
21152
|
-
|
|
21153
|
-
// build/lib/connect/ws.js
|
|
21154
|
-
var require_ws = __commonJS({
|
|
21155
|
-
"build/lib/connect/ws.js"(exports5) {
|
|
21156
|
-
"use strict";
|
|
21157
|
-
init_buffer2();
|
|
21158
|
-
init_process2();
|
|
21159
|
-
init_navigator();
|
|
21160
|
-
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21161
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21162
|
-
};
|
|
21163
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21164
|
-
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21165
|
-
var ws_1 = __importDefault(require_browser5());
|
|
21166
|
-
var debug_1 = __importDefault(require_browser4());
|
|
21167
|
-
var readable_stream_1 = require_browser3();
|
|
21168
|
-
var is_browser_1 = __importDefault(require_is_browser());
|
|
21169
|
-
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
21170
|
-
var debug = (0, debug_1.default)("mqttjs:ws");
|
|
21171
|
-
var WSS_OPTIONS = [
|
|
21172
|
-
"rejectUnauthorized",
|
|
21173
|
-
"ca",
|
|
21174
|
-
"cert",
|
|
21175
|
-
"key",
|
|
21176
|
-
"pfx",
|
|
21177
|
-
"passphrase"
|
|
21178
|
-
];
|
|
21179
|
-
function buildUrl(opts, client) {
|
|
21180
|
-
let url = `${opts.protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
21181
|
-
if (typeof opts.transformWsUrl === "function") {
|
|
21182
|
-
url = opts.transformWsUrl(url, opts, client);
|
|
21183
|
-
}
|
|
21184
|
-
return url;
|
|
21185
|
-
}
|
|
21186
|
-
function setDefaultOpts(opts) {
|
|
21187
|
-
const options = opts;
|
|
21188
|
-
if (!opts.port) {
|
|
21189
|
-
if (opts.protocol === "wss") {
|
|
21190
|
-
options.port = 443;
|
|
21191
|
-
} else {
|
|
21192
|
-
options.port = 80;
|
|
21193
|
-
}
|
|
21194
|
-
}
|
|
21195
|
-
if (!opts.path) {
|
|
21196
|
-
options.path = "/";
|
|
21197
|
-
}
|
|
21198
|
-
if (!opts.wsOptions) {
|
|
21199
|
-
options.wsOptions = {};
|
|
21200
|
-
}
|
|
21201
|
-
if (!is_browser_1.default && opts.protocol === "wss") {
|
|
21202
|
-
WSS_OPTIONS.forEach((prop) => {
|
|
21203
|
-
if (Object.prototype.hasOwnProperty.call(opts, prop) && !Object.prototype.hasOwnProperty.call(opts.wsOptions, prop)) {
|
|
21204
|
-
options.wsOptions[prop] = opts[prop];
|
|
21205
|
-
}
|
|
21206
|
-
});
|
|
21207
|
-
}
|
|
21208
|
-
return options;
|
|
21209
|
-
}
|
|
21210
|
-
function setDefaultBrowserOpts(opts) {
|
|
21211
|
-
const options = setDefaultOpts(opts);
|
|
21212
|
-
if (!options.hostname) {
|
|
21213
|
-
options.hostname = options.host;
|
|
21214
|
-
}
|
|
21215
|
-
if (!options.hostname) {
|
|
21216
|
-
if (typeof document === "undefined") {
|
|
21217
|
-
throw new Error("Could not determine host. Specify host manually.");
|
|
21218
|
-
}
|
|
21219
|
-
const parsed = new URL(document.URL);
|
|
21220
|
-
options.hostname = parsed.hostname;
|
|
21221
|
-
if (!options.port) {
|
|
21222
|
-
options.port = Number(parsed.port);
|
|
21223
|
-
}
|
|
21224
|
-
}
|
|
21225
|
-
if (options.objectMode === void 0) {
|
|
21226
|
-
options.objectMode = !(options.binary === true || options.binary === void 0);
|
|
21227
|
-
}
|
|
21228
|
-
return options;
|
|
21229
|
-
}
|
|
21230
|
-
function createWebSocket(client, url, opts) {
|
|
21231
|
-
debug("createWebSocket");
|
|
21232
|
-
debug(`protocol: ${opts.protocolId} ${opts.protocolVersion}`);
|
|
21233
|
-
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21234
|
-
debug(`creating new Websocket for url: ${url} and protocol: ${websocketSubProtocol}`);
|
|
21235
|
-
let socket;
|
|
21236
|
-
if (opts.createWebsocket) {
|
|
21237
|
-
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
21238
|
-
} else {
|
|
21239
|
-
socket = new ws_1.default(url, [websocketSubProtocol], opts.wsOptions);
|
|
21240
|
-
}
|
|
21241
|
-
return socket;
|
|
21242
|
-
}
|
|
21243
|
-
function createBrowserWebSocket(client, opts) {
|
|
21244
|
-
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21245
|
-
const url = buildUrl(opts, client);
|
|
21246
|
-
let socket;
|
|
21247
|
-
if (opts.createWebsocket) {
|
|
21248
|
-
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
21249
|
-
} else {
|
|
21250
|
-
socket = new WebSocket(url, [websocketSubProtocol]);
|
|
21251
|
-
}
|
|
21252
|
-
socket.binaryType = "arraybuffer";
|
|
21253
|
-
return socket;
|
|
21254
|
-
}
|
|
21255
|
-
var streamBuilder = (client, opts) => {
|
|
21256
|
-
debug("streamBuilder");
|
|
21257
|
-
const options = setDefaultOpts(opts);
|
|
21258
|
-
options.hostname = options.hostname || options.host || "localhost";
|
|
21259
|
-
const url = buildUrl(options, client);
|
|
21260
|
-
const socket = createWebSocket(client, url, options);
|
|
21261
|
-
const webSocketStream = ws_1.default.createWebSocketStream(socket, options.wsOptions);
|
|
21262
|
-
webSocketStream["url"] = url;
|
|
21263
|
-
socket.on("close", () => {
|
|
21264
|
-
webSocketStream.destroy();
|
|
21265
|
-
});
|
|
21266
|
-
return webSocketStream;
|
|
21267
|
-
};
|
|
21268
|
-
var browserStreamBuilder = (client, opts) => {
|
|
21269
|
-
debug("browserStreamBuilder");
|
|
21270
|
-
let stream;
|
|
21271
|
-
const options = setDefaultBrowserOpts(opts);
|
|
21272
|
-
const bufferSize = options.browserBufferSize || 1024 * 512;
|
|
21273
|
-
const bufferTimeout = opts.browserBufferTimeout || 1e3;
|
|
21274
|
-
const coerceToBuffer = !opts.objectMode;
|
|
21275
|
-
const socket = createBrowserWebSocket(client, opts);
|
|
21276
|
-
const proxy = buildProxy(opts, socketWriteBrowser, socketEndBrowser);
|
|
21277
|
-
if (!opts.objectMode) {
|
|
21278
|
-
proxy._writev = BufferedDuplex_1.writev.bind(proxy);
|
|
21279
|
-
}
|
|
21280
|
-
proxy.on("close", () => {
|
|
21281
|
-
socket.close();
|
|
21282
|
-
});
|
|
21283
|
-
const eventListenerSupport = typeof socket.addEventListener !== "undefined";
|
|
21284
|
-
if (socket.readyState === socket.OPEN) {
|
|
21285
|
-
stream = proxy;
|
|
21286
|
-
stream.socket = socket;
|
|
21287
|
-
} else {
|
|
21288
|
-
stream = new BufferedDuplex_1.BufferedDuplex(opts, proxy, socket);
|
|
21289
|
-
if (eventListenerSupport) {
|
|
21290
|
-
socket.addEventListener("open", onOpen);
|
|
21291
|
-
} else {
|
|
21292
|
-
socket.onopen = onOpen;
|
|
21293
|
-
}
|
|
21294
|
-
}
|
|
21295
|
-
if (eventListenerSupport) {
|
|
21296
|
-
socket.addEventListener("close", onClose);
|
|
21297
|
-
socket.addEventListener("error", onError);
|
|
21298
|
-
socket.addEventListener("message", onMessage);
|
|
21299
|
-
} else {
|
|
21300
|
-
socket.onclose = onClose;
|
|
21301
|
-
socket.onerror = onError;
|
|
21302
|
-
socket.onmessage = onMessage;
|
|
21303
|
-
}
|
|
21304
|
-
function buildProxy(pOptions, socketWrite, socketEnd) {
|
|
21305
|
-
const _proxy = new readable_stream_1.Transform({
|
|
21306
|
-
objectMode: pOptions.objectMode
|
|
21307
|
-
});
|
|
21308
|
-
_proxy._write = socketWrite;
|
|
21309
|
-
_proxy._flush = socketEnd;
|
|
21310
|
-
return _proxy;
|
|
21311
|
-
}
|
|
21312
|
-
function onOpen() {
|
|
21313
|
-
debug("WebSocket onOpen");
|
|
21314
|
-
if (stream instanceof BufferedDuplex_1.BufferedDuplex) {
|
|
21315
|
-
stream.socketReady();
|
|
21316
|
-
}
|
|
21317
|
-
}
|
|
21318
|
-
function onClose(event) {
|
|
21319
|
-
debug("WebSocket onClose", event);
|
|
21320
|
-
stream.end();
|
|
21321
|
-
stream.destroy();
|
|
21322
|
-
}
|
|
21323
|
-
function onError(err) {
|
|
21324
|
-
debug("WebSocket onError", err);
|
|
21325
|
-
const error = new Error("WebSocket error");
|
|
21326
|
-
error["event"] = err;
|
|
21327
|
-
stream.destroy(error);
|
|
21328
|
-
}
|
|
21329
|
-
function onMessage(event) {
|
|
21330
|
-
let { data } = event;
|
|
21331
|
-
if (data instanceof ArrayBuffer)
|
|
21332
|
-
data = buffer_1.Buffer.from(data);
|
|
21333
|
-
else
|
|
21334
|
-
data = buffer_1.Buffer.from(data, "utf8");
|
|
21335
|
-
proxy.push(data);
|
|
21336
|
-
}
|
|
21337
|
-
function socketWriteBrowser(chunk, enc, next) {
|
|
21338
|
-
if (socket.bufferedAmount > bufferSize) {
|
|
21339
|
-
setTimeout(socketWriteBrowser, bufferTimeout, chunk, enc, next);
|
|
21340
|
-
return;
|
|
21341
|
-
}
|
|
21342
|
-
if (coerceToBuffer && typeof chunk === "string") {
|
|
21343
|
-
chunk = buffer_1.Buffer.from(chunk, "utf8");
|
|
21344
|
-
}
|
|
21345
|
-
try {
|
|
21346
|
-
socket.send(chunk);
|
|
21347
|
-
} catch (err) {
|
|
21348
|
-
return next(err);
|
|
21349
|
-
}
|
|
21350
|
-
next();
|
|
21351
|
-
}
|
|
21352
|
-
function socketEndBrowser(done) {
|
|
21353
|
-
socket.close();
|
|
21354
|
-
done();
|
|
21355
|
-
}
|
|
21356
|
-
return stream;
|
|
21357
|
-
};
|
|
21358
|
-
exports5.default = is_browser_1.default ? browserStreamBuilder : streamBuilder;
|
|
21359
|
-
}
|
|
21360
|
-
});
|
|
21361
|
-
|
|
21362
21357
|
// build/lib/connect/index.js
|
|
21363
21358
|
var require_connect = __commonJS({
|
|
21364
21359
|
"build/lib/connect/index.js"(exports5) {
|
|
21365
21360
|
"use strict";
|
|
21361
|
+
init_dirname();
|
|
21366
21362
|
init_buffer2();
|
|
21367
21363
|
init_process2();
|
|
21368
|
-
init_navigator();
|
|
21369
21364
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21370
21365
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21371
21366
|
};
|
|
@@ -21379,21 +21374,7 @@ var mqtt = (() => {
|
|
|
21379
21374
|
process_exports.nextTick = setImmediate;
|
|
21380
21375
|
}
|
|
21381
21376
|
var debug = (0, debug_1.default)("mqttjs");
|
|
21382
|
-
var protocols =
|
|
21383
|
-
if (!is_browser_1.default) {
|
|
21384
|
-
protocols.mqtt = require_tcp().default;
|
|
21385
|
-
protocols.tcp = require_tcp().default;
|
|
21386
|
-
protocols.ssl = require_tls().default;
|
|
21387
|
-
protocols.tls = protocols.ssl;
|
|
21388
|
-
protocols.mqtts = require_tls().default;
|
|
21389
|
-
} else {
|
|
21390
|
-
protocols.wx = require_wx().default;
|
|
21391
|
-
protocols.wxs = require_wx().default;
|
|
21392
|
-
protocols.ali = require_ali().default;
|
|
21393
|
-
protocols.alis = require_ali().default;
|
|
21394
|
-
}
|
|
21395
|
-
protocols.ws = require_ws().default;
|
|
21396
|
-
protocols.wss = require_ws().default;
|
|
21377
|
+
var protocols = null;
|
|
21397
21378
|
function parseAuthOptions(opts) {
|
|
21398
21379
|
let matches;
|
|
21399
21380
|
if (opts.auth) {
|
|
@@ -21465,6 +21446,25 @@ var mqtt = (() => {
|
|
|
21465
21446
|
throw new Error("Missing secure protocol key");
|
|
21466
21447
|
}
|
|
21467
21448
|
}
|
|
21449
|
+
if (!protocols) {
|
|
21450
|
+
protocols = {};
|
|
21451
|
+
if (!is_browser_1.default && !opts.forceNativeWebSocket) {
|
|
21452
|
+
protocols.ws = require_ws().streamBuilder;
|
|
21453
|
+
protocols.wss = require_ws().streamBuilder;
|
|
21454
|
+
protocols.mqtt = require_tcp().default;
|
|
21455
|
+
protocols.tcp = require_tcp().default;
|
|
21456
|
+
protocols.ssl = require_tls().default;
|
|
21457
|
+
protocols.tls = protocols.ssl;
|
|
21458
|
+
protocols.mqtts = require_tls().default;
|
|
21459
|
+
} else {
|
|
21460
|
+
protocols.ws = require_ws().browserStreamBuilder;
|
|
21461
|
+
protocols.wss = require_ws().browserStreamBuilder;
|
|
21462
|
+
protocols.wx = require_wx().default;
|
|
21463
|
+
protocols.wxs = require_wx().default;
|
|
21464
|
+
protocols.ali = require_ali().default;
|
|
21465
|
+
protocols.alis = require_ali().default;
|
|
21466
|
+
}
|
|
21467
|
+
}
|
|
21468
21468
|
if (!protocols[opts.protocol]) {
|
|
21469
21469
|
const isSecure = ["mqtts", "wss"].indexOf(opts.protocol) !== -1;
|
|
21470
21470
|
opts.protocol = [
|
|
@@ -21550,9 +21550,9 @@ var mqtt = (() => {
|
|
|
21550
21550
|
var require_mqtt2 = __commonJS({
|
|
21551
21551
|
"build/mqtt.js"(exports5) {
|
|
21552
21552
|
"use strict";
|
|
21553
|
+
init_dirname();
|
|
21553
21554
|
init_buffer2();
|
|
21554
21555
|
init_process2();
|
|
21555
|
-
init_navigator();
|
|
21556
21556
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
21557
21557
|
if (k22 === void 0)
|
|
21558
21558
|
k22 = k2;
|
|
@@ -21623,9 +21623,9 @@ var mqtt = (() => {
|
|
|
21623
21623
|
// build/index.js
|
|
21624
21624
|
var require_build = __commonJS({
|
|
21625
21625
|
"build/index.js"(exports5) {
|
|
21626
|
+
init_dirname();
|
|
21626
21627
|
init_buffer2();
|
|
21627
21628
|
init_process2();
|
|
21628
|
-
init_navigator();
|
|
21629
21629
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
21630
21630
|
if (k22 === void 0)
|
|
21631
21631
|
k22 = k2;
|