mqtt 5.8.0 → 5.9.0
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/client.d.ts +2 -1
- package/build/lib/client.js +12 -2
- 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 +4 -2
- package/build/lib/connect/ws.js.map +1 -1
- package/build/lib/handlers/index.js +1 -1
- package/build/lib/handlers/index.js.map +1 -1
- package/build/lib/is-browser.js +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 +557 -552
- package/dist/mqtt.min.js +5 -5
- package/package.json +1 -1
- package/src/lib/client.ts +18 -2
- package/src/lib/connect/index.ts +31 -19
- package/src/lib/connect/ws.ts +3 -3
- package/src/lib/handlers/index.ts +1 -1
- 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.0" };
|
|
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,9 +12679,9 @@ 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;
|
|
12696
12687
|
exports5.ReasonCodes = {
|
|
@@ -12826,9 +12817,9 @@ var mqtt = (() => {
|
|
|
12826
12817
|
var require_auth = __commonJS({
|
|
12827
12818
|
"build/lib/handlers/auth.js"(exports5) {
|
|
12828
12819
|
"use strict";
|
|
12820
|
+
init_dirname();
|
|
12829
12821
|
init_buffer2();
|
|
12830
12822
|
init_process2();
|
|
12831
|
-
init_navigator();
|
|
12832
12823
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12833
12824
|
var shared_1 = require_shared();
|
|
12834
12825
|
var ack_1 = require_ack();
|
|
@@ -12863,9 +12854,9 @@ var mqtt = (() => {
|
|
|
12863
12854
|
var require_cjs = __commonJS({
|
|
12864
12855
|
"node_modules/lru-cache/dist/cjs/index.js"(exports5) {
|
|
12865
12856
|
"use strict";
|
|
12857
|
+
init_dirname();
|
|
12866
12858
|
init_buffer2();
|
|
12867
12859
|
init_process2();
|
|
12868
|
-
init_navigator();
|
|
12869
12860
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
12870
12861
|
exports5.LRUCache = void 0;
|
|
12871
12862
|
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
@@ -14109,9 +14100,9 @@ var mqtt = (() => {
|
|
|
14109
14100
|
var require_ContainerBase = __commonJS({
|
|
14110
14101
|
"node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js"(exports5) {
|
|
14111
14102
|
"use strict";
|
|
14103
|
+
init_dirname();
|
|
14112
14104
|
init_buffer2();
|
|
14113
14105
|
init_process2();
|
|
14114
|
-
init_navigator();
|
|
14115
14106
|
Object.defineProperty(exports5, "t", {
|
|
14116
14107
|
value: true
|
|
14117
14108
|
});
|
|
@@ -14150,9 +14141,9 @@ var mqtt = (() => {
|
|
|
14150
14141
|
var require_Stack = __commonJS({
|
|
14151
14142
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js"(exports5) {
|
|
14152
14143
|
"use strict";
|
|
14144
|
+
init_dirname();
|
|
14153
14145
|
init_buffer2();
|
|
14154
14146
|
init_process2();
|
|
14155
|
-
init_navigator();
|
|
14156
14147
|
Object.defineProperty(exports5, "t", {
|
|
14157
14148
|
value: true
|
|
14158
14149
|
});
|
|
@@ -14195,9 +14186,9 @@ var mqtt = (() => {
|
|
|
14195
14186
|
var require_Queue = __commonJS({
|
|
14196
14187
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js"(exports5) {
|
|
14197
14188
|
"use strict";
|
|
14189
|
+
init_dirname();
|
|
14198
14190
|
init_buffer2();
|
|
14199
14191
|
init_process2();
|
|
14200
|
-
init_navigator();
|
|
14201
14192
|
Object.defineProperty(exports5, "t", {
|
|
14202
14193
|
value: true
|
|
14203
14194
|
});
|
|
@@ -14252,9 +14243,9 @@ var mqtt = (() => {
|
|
|
14252
14243
|
var require_PriorityQueue = __commonJS({
|
|
14253
14244
|
"node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js"(exports5) {
|
|
14254
14245
|
"use strict";
|
|
14246
|
+
init_dirname();
|
|
14255
14247
|
init_buffer2();
|
|
14256
14248
|
init_process2();
|
|
14257
|
-
init_navigator();
|
|
14258
14249
|
Object.defineProperty(exports5, "t", {
|
|
14259
14250
|
value: true
|
|
14260
14251
|
});
|
|
@@ -14379,9 +14370,9 @@ var mqtt = (() => {
|
|
|
14379
14370
|
var require_Base = __commonJS({
|
|
14380
14371
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js"(exports5) {
|
|
14381
14372
|
"use strict";
|
|
14373
|
+
init_dirname();
|
|
14382
14374
|
init_buffer2();
|
|
14383
14375
|
init_process2();
|
|
14384
|
-
init_navigator();
|
|
14385
14376
|
Object.defineProperty(exports5, "t", {
|
|
14386
14377
|
value: true
|
|
14387
14378
|
});
|
|
@@ -14398,9 +14389,9 @@ var mqtt = (() => {
|
|
|
14398
14389
|
var require_throwError = __commonJS({
|
|
14399
14390
|
"node_modules/js-sdsl/dist/cjs/utils/throwError.js"(exports5) {
|
|
14400
14391
|
"use strict";
|
|
14392
|
+
init_dirname();
|
|
14401
14393
|
init_buffer2();
|
|
14402
14394
|
init_process2();
|
|
14403
|
-
init_navigator();
|
|
14404
14395
|
Object.defineProperty(exports5, "t", {
|
|
14405
14396
|
value: true
|
|
14406
14397
|
});
|
|
@@ -14415,9 +14406,9 @@ var mqtt = (() => {
|
|
|
14415
14406
|
var require_RandomIterator = __commonJS({
|
|
14416
14407
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js"(exports5) {
|
|
14417
14408
|
"use strict";
|
|
14409
|
+
init_dirname();
|
|
14418
14410
|
init_buffer2();
|
|
14419
14411
|
init_process2();
|
|
14420
|
-
init_navigator();
|
|
14421
14412
|
Object.defineProperty(exports5, "t", {
|
|
14422
14413
|
value: true
|
|
14423
14414
|
});
|
|
@@ -14475,9 +14466,9 @@ var mqtt = (() => {
|
|
|
14475
14466
|
var require_Vector = __commonJS({
|
|
14476
14467
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js"(exports5) {
|
|
14477
14468
|
"use strict";
|
|
14469
|
+
init_dirname();
|
|
14478
14470
|
init_buffer2();
|
|
14479
14471
|
init_process2();
|
|
14480
|
-
init_navigator();
|
|
14481
14472
|
Object.defineProperty(exports5, "t", {
|
|
14482
14473
|
value: true
|
|
14483
14474
|
});
|
|
@@ -14633,9 +14624,9 @@ var mqtt = (() => {
|
|
|
14633
14624
|
var require_LinkList = __commonJS({
|
|
14634
14625
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js"(exports5) {
|
|
14635
14626
|
"use strict";
|
|
14627
|
+
init_dirname();
|
|
14636
14628
|
init_buffer2();
|
|
14637
14629
|
init_process2();
|
|
14638
|
-
init_navigator();
|
|
14639
14630
|
Object.defineProperty(exports5, "t", {
|
|
14640
14631
|
value: true
|
|
14641
14632
|
});
|
|
@@ -14969,9 +14960,9 @@ var mqtt = (() => {
|
|
|
14969
14960
|
var require_Deque = __commonJS({
|
|
14970
14961
|
"node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js"(exports5) {
|
|
14971
14962
|
"use strict";
|
|
14963
|
+
init_dirname();
|
|
14972
14964
|
init_buffer2();
|
|
14973
14965
|
init_process2();
|
|
14974
|
-
init_navigator();
|
|
14975
14966
|
Object.defineProperty(exports5, "t", {
|
|
14976
14967
|
value: true
|
|
14977
14968
|
});
|
|
@@ -15332,9 +15323,9 @@ var mqtt = (() => {
|
|
|
15332
15323
|
var require_TreeNode = __commonJS({
|
|
15333
15324
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js"(exports5) {
|
|
15334
15325
|
"use strict";
|
|
15326
|
+
init_dirname();
|
|
15335
15327
|
init_buffer2();
|
|
15336
15328
|
init_process2();
|
|
15337
|
-
init_navigator();
|
|
15338
15329
|
Object.defineProperty(exports5, "t", {
|
|
15339
15330
|
value: true
|
|
15340
15331
|
});
|
|
@@ -15462,9 +15453,9 @@ var mqtt = (() => {
|
|
|
15462
15453
|
var require_Base2 = __commonJS({
|
|
15463
15454
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js"(exports5) {
|
|
15464
15455
|
"use strict";
|
|
15456
|
+
init_dirname();
|
|
15465
15457
|
init_buffer2();
|
|
15466
15458
|
init_process2();
|
|
15467
|
-
init_navigator();
|
|
15468
15459
|
Object.defineProperty(exports5, "t", {
|
|
15469
15460
|
value: true
|
|
15470
15461
|
});
|
|
@@ -16012,9 +16003,9 @@ var mqtt = (() => {
|
|
|
16012
16003
|
var require_TreeIterator = __commonJS({
|
|
16013
16004
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js"(exports5) {
|
|
16014
16005
|
"use strict";
|
|
16006
|
+
init_dirname();
|
|
16015
16007
|
init_buffer2();
|
|
16016
16008
|
init_process2();
|
|
16017
|
-
init_navigator();
|
|
16018
16009
|
Object.defineProperty(exports5, "t", {
|
|
16019
16010
|
value: true
|
|
16020
16011
|
});
|
|
@@ -16093,9 +16084,9 @@ var mqtt = (() => {
|
|
|
16093
16084
|
var require_OrderedSet = __commonJS({
|
|
16094
16085
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js"(exports5) {
|
|
16095
16086
|
"use strict";
|
|
16087
|
+
init_dirname();
|
|
16096
16088
|
init_buffer2();
|
|
16097
16089
|
init_process2();
|
|
16098
|
-
init_navigator();
|
|
16099
16090
|
Object.defineProperty(exports5, "t", {
|
|
16100
16091
|
value: true
|
|
16101
16092
|
});
|
|
@@ -16199,9 +16190,9 @@ var mqtt = (() => {
|
|
|
16199
16190
|
var require_OrderedMap = __commonJS({
|
|
16200
16191
|
"node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js"(exports5) {
|
|
16201
16192
|
"use strict";
|
|
16193
|
+
init_dirname();
|
|
16202
16194
|
init_buffer2();
|
|
16203
16195
|
init_process2();
|
|
16204
|
-
init_navigator();
|
|
16205
16196
|
Object.defineProperty(exports5, "t", {
|
|
16206
16197
|
value: true
|
|
16207
16198
|
});
|
|
@@ -16330,9 +16321,9 @@ var mqtt = (() => {
|
|
|
16330
16321
|
var require_checkObject = __commonJS({
|
|
16331
16322
|
"node_modules/js-sdsl/dist/cjs/utils/checkObject.js"(exports5) {
|
|
16332
16323
|
"use strict";
|
|
16324
|
+
init_dirname();
|
|
16333
16325
|
init_buffer2();
|
|
16334
16326
|
init_process2();
|
|
16335
|
-
init_navigator();
|
|
16336
16327
|
Object.defineProperty(exports5, "t", {
|
|
16337
16328
|
value: true
|
|
16338
16329
|
});
|
|
@@ -16348,9 +16339,9 @@ var mqtt = (() => {
|
|
|
16348
16339
|
var require_Base3 = __commonJS({
|
|
16349
16340
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js"(exports5) {
|
|
16350
16341
|
"use strict";
|
|
16342
|
+
init_dirname();
|
|
16351
16343
|
init_buffer2();
|
|
16352
16344
|
init_process2();
|
|
16353
|
-
init_navigator();
|
|
16354
16345
|
Object.defineProperty(exports5, "t", {
|
|
16355
16346
|
value: true
|
|
16356
16347
|
});
|
|
@@ -16540,9 +16531,9 @@ var mqtt = (() => {
|
|
|
16540
16531
|
var require_HashSet = __commonJS({
|
|
16541
16532
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js"(exports5) {
|
|
16542
16533
|
"use strict";
|
|
16534
|
+
init_dirname();
|
|
16543
16535
|
init_buffer2();
|
|
16544
16536
|
init_process2();
|
|
16545
|
-
init_navigator();
|
|
16546
16537
|
Object.defineProperty(exports5, "t", {
|
|
16547
16538
|
value: true
|
|
16548
16539
|
});
|
|
@@ -16634,9 +16625,9 @@ var mqtt = (() => {
|
|
|
16634
16625
|
var require_HashMap = __commonJS({
|
|
16635
16626
|
"node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js"(exports5) {
|
|
16636
16627
|
"use strict";
|
|
16628
|
+
init_dirname();
|
|
16637
16629
|
init_buffer2();
|
|
16638
16630
|
init_process2();
|
|
16639
|
-
init_navigator();
|
|
16640
16631
|
Object.defineProperty(exports5, "t", {
|
|
16641
16632
|
value: true
|
|
16642
16633
|
});
|
|
@@ -16763,9 +16754,9 @@ var mqtt = (() => {
|
|
|
16763
16754
|
var require_cjs2 = __commonJS({
|
|
16764
16755
|
"node_modules/js-sdsl/dist/cjs/index.js"(exports5) {
|
|
16765
16756
|
"use strict";
|
|
16757
|
+
init_dirname();
|
|
16766
16758
|
init_buffer2();
|
|
16767
16759
|
init_process2();
|
|
16768
|
-
init_navigator();
|
|
16769
16760
|
Object.defineProperty(exports5, "t", {
|
|
16770
16761
|
value: true
|
|
16771
16762
|
});
|
|
@@ -16851,9 +16842,9 @@ var mqtt = (() => {
|
|
|
16851
16842
|
var require_number_allocator = __commonJS({
|
|
16852
16843
|
"node_modules/number-allocator/lib/number-allocator.js"(exports5, module) {
|
|
16853
16844
|
"use strict";
|
|
16845
|
+
init_dirname();
|
|
16854
16846
|
init_buffer2();
|
|
16855
16847
|
init_process2();
|
|
16856
|
-
init_navigator();
|
|
16857
16848
|
var SortedSet = require_cjs2().OrderedSet;
|
|
16858
16849
|
var debugTrace = require_browser4()("number-allocator:trace");
|
|
16859
16850
|
var debugError = require_browser4()("number-allocator:error");
|
|
@@ -17013,9 +17004,9 @@ var mqtt = (() => {
|
|
|
17013
17004
|
// node_modules/number-allocator/index.js
|
|
17014
17005
|
var require_number_allocator2 = __commonJS({
|
|
17015
17006
|
"node_modules/number-allocator/index.js"(exports5, module) {
|
|
17007
|
+
init_dirname();
|
|
17016
17008
|
init_buffer2();
|
|
17017
17009
|
init_process2();
|
|
17018
|
-
init_navigator();
|
|
17019
17010
|
var NumberAllocator = require_number_allocator();
|
|
17020
17011
|
module.exports.NumberAllocator = NumberAllocator;
|
|
17021
17012
|
}
|
|
@@ -17025,9 +17016,9 @@ var mqtt = (() => {
|
|
|
17025
17016
|
var require_topic_alias_send = __commonJS({
|
|
17026
17017
|
"build/lib/topic-alias-send.js"(exports5) {
|
|
17027
17018
|
"use strict";
|
|
17019
|
+
init_dirname();
|
|
17028
17020
|
init_buffer2();
|
|
17029
17021
|
init_process2();
|
|
17030
|
-
init_navigator();
|
|
17031
17022
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17032
17023
|
var lru_cache_1 = require_cjs();
|
|
17033
17024
|
var number_allocator_1 = require_number_allocator2();
|
|
@@ -17086,9 +17077,9 @@ var mqtt = (() => {
|
|
|
17086
17077
|
var require_connack = __commonJS({
|
|
17087
17078
|
"build/lib/handlers/connack.js"(exports5) {
|
|
17088
17079
|
"use strict";
|
|
17080
|
+
init_dirname();
|
|
17089
17081
|
init_buffer2();
|
|
17090
17082
|
init_process2();
|
|
17091
|
-
init_navigator();
|
|
17092
17083
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17093
17084
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17094
17085
|
};
|
|
@@ -17139,9 +17130,9 @@ var mqtt = (() => {
|
|
|
17139
17130
|
var require_pubrel = __commonJS({
|
|
17140
17131
|
"build/lib/handlers/pubrel.js"(exports5) {
|
|
17141
17132
|
"use strict";
|
|
17133
|
+
init_dirname();
|
|
17142
17134
|
init_buffer2();
|
|
17143
17135
|
init_process2();
|
|
17144
|
-
init_navigator();
|
|
17145
17136
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17146
17137
|
var handlePubrel = (client, packet, done) => {
|
|
17147
17138
|
client.log("handling pubrel packet");
|
|
@@ -17171,9 +17162,9 @@ var mqtt = (() => {
|
|
|
17171
17162
|
var require_handlers = __commonJS({
|
|
17172
17163
|
"build/lib/handlers/index.js"(exports5) {
|
|
17173
17164
|
"use strict";
|
|
17165
|
+
init_dirname();
|
|
17174
17166
|
init_buffer2();
|
|
17175
17167
|
init_process2();
|
|
17176
|
-
init_navigator();
|
|
17177
17168
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17178
17169
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17179
17170
|
};
|
|
@@ -17223,7 +17214,7 @@ var mqtt = (() => {
|
|
|
17223
17214
|
break;
|
|
17224
17215
|
case "pingresp":
|
|
17225
17216
|
client.log("_handlePacket :: received pingresp");
|
|
17226
|
-
client.reschedulePing();
|
|
17217
|
+
client.reschedulePing(true);
|
|
17227
17218
|
done();
|
|
17228
17219
|
break;
|
|
17229
17220
|
case "disconnect":
|
|
@@ -17244,9 +17235,9 @@ var mqtt = (() => {
|
|
|
17244
17235
|
var require_TypedEmitter = __commonJS({
|
|
17245
17236
|
"build/lib/TypedEmitter.js"(exports5) {
|
|
17246
17237
|
"use strict";
|
|
17238
|
+
init_dirname();
|
|
17247
17239
|
init_buffer2();
|
|
17248
17240
|
init_process2();
|
|
17249
|
-
init_navigator();
|
|
17250
17241
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17251
17242
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17252
17243
|
};
|
|
@@ -17265,9 +17256,9 @@ var mqtt = (() => {
|
|
|
17265
17256
|
var require_is_browser = __commonJS({
|
|
17266
17257
|
"build/lib/is-browser.js"(exports5) {
|
|
17267
17258
|
"use strict";
|
|
17259
|
+
init_dirname();
|
|
17268
17260
|
init_buffer2();
|
|
17269
17261
|
init_process2();
|
|
17270
|
-
init_navigator();
|
|
17271
17262
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
17272
17263
|
exports5.isReactNativeBrowser = exports5.isWebWorker = void 0;
|
|
17273
17264
|
var isStandardBrowserEnv = () => {
|
|
@@ -17282,13 +17273,12 @@ var mqtt = (() => {
|
|
|
17282
17273
|
}
|
|
17283
17274
|
return false;
|
|
17284
17275
|
};
|
|
17285
|
-
var isTxikijsEnv = () => typeof navigator !== "undefined" && navigator.userAgent === "txiki.js";
|
|
17286
17276
|
var isWebWorkerEnv = () => {
|
|
17287
17277
|
var _a, _b;
|
|
17288
17278
|
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
17279
|
};
|
|
17290
17280
|
var isReactNativeEnv = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
17291
|
-
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv()
|
|
17281
|
+
var isBrowser = isStandardBrowserEnv() || isWebWorkerEnv() || isReactNativeEnv();
|
|
17292
17282
|
exports5.isWebWorker = isWebWorkerEnv();
|
|
17293
17283
|
exports5.isReactNativeBrowser = isReactNativeEnv();
|
|
17294
17284
|
exports5.default = isBrowser;
|
|
@@ -17298,9 +17288,9 @@ var mqtt = (() => {
|
|
|
17298
17288
|
// node_modules/fast-unique-numbers/build/es5/bundle.js
|
|
17299
17289
|
var require_bundle = __commonJS({
|
|
17300
17290
|
"node_modules/fast-unique-numbers/build/es5/bundle.js"(exports5, module) {
|
|
17291
|
+
init_dirname();
|
|
17301
17292
|
init_buffer2();
|
|
17302
17293
|
init_process2();
|
|
17303
|
-
init_navigator();
|
|
17304
17294
|
(function(global2, factory) {
|
|
17305
17295
|
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
17296
|
})(exports5, function(exports6) {
|
|
@@ -17356,9 +17346,9 @@ var mqtt = (() => {
|
|
|
17356
17346
|
// node_modules/worker-timers-broker/build/es5/bundle.js
|
|
17357
17347
|
var require_bundle2 = __commonJS({
|
|
17358
17348
|
"node_modules/worker-timers-broker/build/es5/bundle.js"(exports5, module) {
|
|
17349
|
+
init_dirname();
|
|
17359
17350
|
init_buffer2();
|
|
17360
17351
|
init_process2();
|
|
17361
|
-
init_navigator();
|
|
17362
17352
|
(function(global2, factory) {
|
|
17363
17353
|
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
17354
|
})(exports5, function(exports6, fastUniqueNumbers) {
|
|
@@ -17517,9 +17507,9 @@ var mqtt = (() => {
|
|
|
17517
17507
|
// node_modules/worker-timers/build/es5/bundle.js
|
|
17518
17508
|
var require_bundle3 = __commonJS({
|
|
17519
17509
|
"node_modules/worker-timers/build/es5/bundle.js"(exports5, module) {
|
|
17510
|
+
init_dirname();
|
|
17520
17511
|
init_buffer2();
|
|
17521
17512
|
init_process2();
|
|
17522
|
-
init_navigator();
|
|
17523
17513
|
(function(global2, factory) {
|
|
17524
17514
|
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
17515
|
})(exports5, function(exports6, workerTimersBroker) {
|
|
@@ -17569,9 +17559,9 @@ var mqtt = (() => {
|
|
|
17569
17559
|
var require_get_timer = __commonJS({
|
|
17570
17560
|
"build/lib/get-timer.js"(exports5) {
|
|
17571
17561
|
"use strict";
|
|
17562
|
+
init_dirname();
|
|
17572
17563
|
init_buffer2();
|
|
17573
17564
|
init_process2();
|
|
17574
|
-
init_navigator();
|
|
17575
17565
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
17576
17566
|
if (k22 === void 0)
|
|
17577
17567
|
k22 = k2;
|
|
@@ -17637,9 +17627,9 @@ var mqtt = (() => {
|
|
|
17637
17627
|
var require_KeepaliveManager = __commonJS({
|
|
17638
17628
|
"build/lib/KeepaliveManager.js"(exports5) {
|
|
17639
17629
|
"use strict";
|
|
17630
|
+
init_dirname();
|
|
17640
17631
|
init_buffer2();
|
|
17641
17632
|
init_process2();
|
|
17642
|
-
init_navigator();
|
|
17643
17633
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
17644
17634
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
17645
17635
|
};
|
|
@@ -17710,9 +17700,9 @@ var mqtt = (() => {
|
|
|
17710
17700
|
var require_client = __commonJS({
|
|
17711
17701
|
"build/lib/client.js"(exports5) {
|
|
17712
17702
|
"use strict";
|
|
17703
|
+
init_dirname();
|
|
17713
17704
|
init_buffer2();
|
|
17714
17705
|
init_process2();
|
|
17715
|
-
init_navigator();
|
|
17716
17706
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
17717
17707
|
if (k22 === void 0)
|
|
17718
17708
|
k22 = k2;
|
|
@@ -17913,6 +17903,12 @@ var mqtt = (() => {
|
|
|
17913
17903
|
const packets = [];
|
|
17914
17904
|
this.log("connect :: calling method to clear reconnect");
|
|
17915
17905
|
this._clearReconnect();
|
|
17906
|
+
if (this.disconnected && !this.reconnecting) {
|
|
17907
|
+
this.incomingStore = this.options.incomingStore || new store_1.default();
|
|
17908
|
+
this.outgoingStore = this.options.outgoingStore || new store_1.default();
|
|
17909
|
+
this.disconnecting = false;
|
|
17910
|
+
this.disconnected = false;
|
|
17911
|
+
}
|
|
17916
17912
|
this.log("connect :: using streamBuilder provided to client to create stream");
|
|
17917
17913
|
this.stream = this.streamBuilder(this);
|
|
17918
17914
|
parser.on("packet", (packet) => {
|
|
@@ -18323,6 +18319,8 @@ var mqtt = (() => {
|
|
|
18323
18319
|
});
|
|
18324
18320
|
if (this._deferredReconnect) {
|
|
18325
18321
|
this._deferredReconnect();
|
|
18322
|
+
} else if (this.options.reconnectPeriod === 0 || this.options.manualConnect) {
|
|
18323
|
+
this.disconnecting = false;
|
|
18326
18324
|
}
|
|
18327
18325
|
};
|
|
18328
18326
|
const finish = () => {
|
|
@@ -18684,8 +18682,8 @@ var mqtt = (() => {
|
|
|
18684
18682
|
this.keepaliveManager = null;
|
|
18685
18683
|
}
|
|
18686
18684
|
}
|
|
18687
|
-
reschedulePing() {
|
|
18688
|
-
if (this.keepaliveManager && this.options.keepalive && this.options.reschedulePings) {
|
|
18685
|
+
reschedulePing(force = false) {
|
|
18686
|
+
if (this.keepaliveManager && this.options.keepalive && (force || this.options.reschedulePings)) {
|
|
18689
18687
|
this._reschedulePing();
|
|
18690
18688
|
}
|
|
18691
18689
|
}
|
|
@@ -18853,9 +18851,9 @@ var mqtt = (() => {
|
|
|
18853
18851
|
var require_unique_message_id_provider = __commonJS({
|
|
18854
18852
|
"build/lib/unique-message-id-provider.js"(exports5) {
|
|
18855
18853
|
"use strict";
|
|
18854
|
+
init_dirname();
|
|
18856
18855
|
init_buffer2();
|
|
18857
18856
|
init_process2();
|
|
18858
|
-
init_navigator();
|
|
18859
18857
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
18860
18858
|
var number_allocator_1 = require_number_allocator2();
|
|
18861
18859
|
var UniqueMessageIdProvider = class {
|
|
@@ -18917,9 +18915,9 @@ var mqtt = (() => {
|
|
|
18917
18915
|
var t3, o3, n3, e3, r3, c3, s3, u3, a3, d2, h3, p3;
|
|
18918
18916
|
var init_chunk_924bb2e1 = __esm({
|
|
18919
18917
|
"node_modules/@jspm/core/nodelibs/browser/chunk-924bb2e1.js"() {
|
|
18918
|
+
init_dirname();
|
|
18920
18919
|
init_buffer2();
|
|
18921
18920
|
init_process2();
|
|
18922
|
-
init_navigator();
|
|
18923
18921
|
t3 = 2147483647;
|
|
18924
18922
|
o3 = /^xn--/;
|
|
18925
18923
|
n3 = /[^\0-\x7E]/;
|
|
@@ -19013,9 +19011,9 @@ var mqtt = (() => {
|
|
|
19013
19011
|
var n4, r4, t4, o4;
|
|
19014
19012
|
var init_chunk_b04e620d = __esm({
|
|
19015
19013
|
"node_modules/@jspm/core/nodelibs/browser/chunk-b04e620d.js"() {
|
|
19014
|
+
init_dirname();
|
|
19016
19015
|
init_buffer2();
|
|
19017
19016
|
init_process2();
|
|
19018
|
-
init_navigator();
|
|
19019
19017
|
n4 = function(n7, r7, t6, o7) {
|
|
19020
19018
|
r7 = r7 || "&", t6 = t6 || "=";
|
|
19021
19019
|
var a6 = {};
|
|
@@ -19121,9 +19119,9 @@ var mqtt = (() => {
|
|
|
19121
19119
|
var e5, t5, n5, r5, o5, l4, s4, f4, a4, T2;
|
|
19122
19120
|
var init_chunk_5decc758 = __esm({
|
|
19123
19121
|
"node_modules/@jspm/core/nodelibs/browser/chunk-5decc758.js"() {
|
|
19122
|
+
init_dirname();
|
|
19124
19123
|
init_buffer2();
|
|
19125
19124
|
init_process2();
|
|
19126
|
-
init_navigator();
|
|
19127
19125
|
r5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : global;
|
|
19128
19126
|
o5 = e5 = {};
|
|
19129
19127
|
!function() {
|
|
@@ -19351,9 +19349,9 @@ var mqtt = (() => {
|
|
|
19351
19349
|
var exports2, _dewExec2, _global, process2;
|
|
19352
19350
|
var init_chunk_2eac56ff = __esm({
|
|
19353
19351
|
"node_modules/@jspm/core/nodelibs/browser/chunk-2eac56ff.js"() {
|
|
19352
|
+
init_dirname();
|
|
19354
19353
|
init_buffer2();
|
|
19355
19354
|
init_process2();
|
|
19356
|
-
init_navigator();
|
|
19357
19355
|
exports2 = {};
|
|
19358
19356
|
_dewExec2 = false;
|
|
19359
19357
|
_global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : global;
|
|
@@ -19822,9 +19820,9 @@ var mqtt = (() => {
|
|
|
19822
19820
|
var exports$12, _dewExec3, exports3;
|
|
19823
19821
|
var init_chunk_23dbec7b = __esm({
|
|
19824
19822
|
"node_modules/@jspm/core/nodelibs/browser/chunk-23dbec7b.js"() {
|
|
19823
|
+
init_dirname();
|
|
19825
19824
|
init_buffer2();
|
|
19826
19825
|
init_process2();
|
|
19827
|
-
init_navigator();
|
|
19828
19826
|
init_chunk_2eac56ff();
|
|
19829
19827
|
exports$12 = {};
|
|
19830
19828
|
_dewExec3 = false;
|
|
@@ -20452,9 +20450,9 @@ var mqtt = (() => {
|
|
|
20452
20450
|
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;
|
|
20453
20451
|
var init_url = __esm({
|
|
20454
20452
|
"node_modules/@jspm/core/nodelibs/browser/url.js"() {
|
|
20453
|
+
init_dirname();
|
|
20455
20454
|
init_buffer2();
|
|
20456
20455
|
init_process2();
|
|
20457
|
-
init_navigator();
|
|
20458
20456
|
init_chunk_924bb2e1();
|
|
20459
20457
|
init_chunk_b04e620d();
|
|
20460
20458
|
init_chunk_5decc758();
|
|
@@ -20683,132 +20681,18 @@ var mqtt = (() => {
|
|
|
20683
20681
|
}
|
|
20684
20682
|
});
|
|
20685
20683
|
|
|
20686
|
-
// node_modules
|
|
20687
|
-
var
|
|
20688
|
-
|
|
20689
|
-
Server: () => unimplemented2,
|
|
20690
|
-
Socket: () => unimplemented2,
|
|
20691
|
-
Stream: () => unimplemented2,
|
|
20692
|
-
_createServerHandle: () => unimplemented2,
|
|
20693
|
-
_normalizeArgs: () => unimplemented2,
|
|
20694
|
-
_setSimultaneousAccepts: () => unimplemented2,
|
|
20695
|
-
connect: () => unimplemented2,
|
|
20696
|
-
createConnection: () => unimplemented2,
|
|
20697
|
-
createServer: () => unimplemented2,
|
|
20698
|
-
default: () => net,
|
|
20699
|
-
isIP: () => unimplemented2,
|
|
20700
|
-
isIPv4: () => unimplemented2,
|
|
20701
|
-
isIPv6: () => unimplemented2
|
|
20702
|
-
});
|
|
20703
|
-
function unimplemented2() {
|
|
20704
|
-
throw new Error("Node.js net module is not supported by JSPM core outside of Node.js");
|
|
20705
|
-
}
|
|
20706
|
-
var net;
|
|
20707
|
-
var init_net = __esm({
|
|
20708
|
-
"node_modules/@jspm/core/nodelibs/browser/net.js"() {
|
|
20709
|
-
init_buffer2();
|
|
20710
|
-
init_process2();
|
|
20711
|
-
init_navigator();
|
|
20712
|
-
net = {
|
|
20713
|
-
_createServerHandle: unimplemented2,
|
|
20714
|
-
_normalizeArgs: unimplemented2,
|
|
20715
|
-
_setSimultaneousAccepts: unimplemented2,
|
|
20716
|
-
connect: unimplemented2,
|
|
20717
|
-
createConnection: unimplemented2,
|
|
20718
|
-
createServer: unimplemented2,
|
|
20719
|
-
isIP: unimplemented2,
|
|
20720
|
-
isIPv4: unimplemented2,
|
|
20721
|
-
isIPv6: unimplemented2,
|
|
20722
|
-
Server: unimplemented2,
|
|
20723
|
-
Socket: unimplemented2,
|
|
20724
|
-
Stream: unimplemented2
|
|
20725
|
-
};
|
|
20726
|
-
}
|
|
20727
|
-
});
|
|
20728
|
-
|
|
20729
|
-
// build/lib/connect/tcp.js
|
|
20730
|
-
var require_tcp = __commonJS({
|
|
20731
|
-
"build/lib/connect/tcp.js"(exports5) {
|
|
20732
|
-
"use strict";
|
|
20733
|
-
init_buffer2();
|
|
20734
|
-
init_process2();
|
|
20735
|
-
init_navigator();
|
|
20736
|
-
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
20737
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
20738
|
-
};
|
|
20739
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20740
|
-
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
20741
|
-
var debug_1 = __importDefault(require_browser4());
|
|
20742
|
-
var debug = (0, debug_1.default)("mqttjs:tcp");
|
|
20743
|
-
var buildStream = (client, opts) => {
|
|
20744
|
-
opts.port = opts.port || 1883;
|
|
20745
|
-
opts.hostname = opts.hostname || opts.host || "localhost";
|
|
20746
|
-
const { port, path: path2 } = opts;
|
|
20747
|
-
const host = opts.hostname;
|
|
20748
|
-
debug("port %d and host %s", port, host);
|
|
20749
|
-
return net_1.default.createConnection({ port, host, path: path2 });
|
|
20750
|
-
};
|
|
20751
|
-
exports5.default = buildStream;
|
|
20752
|
-
}
|
|
20753
|
-
});
|
|
20754
|
-
|
|
20755
|
-
// node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js
|
|
20756
|
-
var empty_exports = {};
|
|
20757
|
-
__export(empty_exports, {
|
|
20758
|
-
default: () => empty_default
|
|
20759
|
-
});
|
|
20760
|
-
var empty_default;
|
|
20761
|
-
var init_empty = __esm({
|
|
20762
|
-
"node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js"() {
|
|
20763
|
-
init_buffer2();
|
|
20764
|
-
init_process2();
|
|
20765
|
-
init_navigator();
|
|
20766
|
-
empty_default = {};
|
|
20767
|
-
}
|
|
20768
|
-
});
|
|
20769
|
-
|
|
20770
|
-
// build/lib/connect/tls.js
|
|
20771
|
-
var require_tls = __commonJS({
|
|
20772
|
-
"build/lib/connect/tls.js"(exports5) {
|
|
20684
|
+
// node_modules/ws/browser.js
|
|
20685
|
+
var require_browser5 = __commonJS({
|
|
20686
|
+
"node_modules/ws/browser.js"(exports5, module) {
|
|
20773
20687
|
"use strict";
|
|
20688
|
+
init_dirname();
|
|
20774
20689
|
init_buffer2();
|
|
20775
20690
|
init_process2();
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20781
|
-
var tls_1 = __importDefault((init_empty(), __toCommonJS(empty_exports)));
|
|
20782
|
-
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
20783
|
-
var debug_1 = __importDefault(require_browser4());
|
|
20784
|
-
var debug = (0, debug_1.default)("mqttjs:tls");
|
|
20785
|
-
var buildStream = (client, opts) => {
|
|
20786
|
-
opts.port = opts.port || 8883;
|
|
20787
|
-
opts.host = opts.hostname || opts.host || "localhost";
|
|
20788
|
-
if (net_1.default.isIP(opts.host) === 0) {
|
|
20789
|
-
opts.servername = opts.host;
|
|
20790
|
-
}
|
|
20791
|
-
opts.rejectUnauthorized = opts.rejectUnauthorized !== false;
|
|
20792
|
-
delete opts.path;
|
|
20793
|
-
debug("port %d host %s rejectUnauthorized %b", opts.port, opts.host, opts.rejectUnauthorized);
|
|
20794
|
-
const connection = tls_1.default.connect(opts);
|
|
20795
|
-
connection.on("secureConnect", () => {
|
|
20796
|
-
if (opts.rejectUnauthorized && !connection.authorized) {
|
|
20797
|
-
connection.emit("error", new Error("TLS not authorized"));
|
|
20798
|
-
} else {
|
|
20799
|
-
connection.removeListener("error", handleTLSerrors);
|
|
20800
|
-
}
|
|
20801
|
-
});
|
|
20802
|
-
function handleTLSerrors(err) {
|
|
20803
|
-
if (opts.rejectUnauthorized) {
|
|
20804
|
-
client.emit("error", err);
|
|
20805
|
-
}
|
|
20806
|
-
connection.end();
|
|
20807
|
-
}
|
|
20808
|
-
connection.on("error", handleTLSerrors);
|
|
20809
|
-
return connection;
|
|
20691
|
+
module.exports = function() {
|
|
20692
|
+
throw new Error(
|
|
20693
|
+
"ws does not work in the browser. Browser clients must use the native WebSocket object"
|
|
20694
|
+
);
|
|
20810
20695
|
};
|
|
20811
|
-
exports5.default = buildStream;
|
|
20812
20696
|
}
|
|
20813
20697
|
});
|
|
20814
20698
|
|
|
@@ -20816,9 +20700,9 @@ var mqtt = (() => {
|
|
|
20816
20700
|
var require_BufferedDuplex = __commonJS({
|
|
20817
20701
|
"build/lib/BufferedDuplex.js"(exports5) {
|
|
20818
20702
|
"use strict";
|
|
20703
|
+
init_dirname();
|
|
20819
20704
|
init_buffer2();
|
|
20820
20705
|
init_process2();
|
|
20821
|
-
init_navigator();
|
|
20822
20706
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20823
20707
|
exports5.BufferedDuplex = exports5.writev = void 0;
|
|
20824
20708
|
var readable_stream_1 = require_browser3();
|
|
@@ -20893,94 +20777,434 @@ var mqtt = (() => {
|
|
|
20893
20777
|
}
|
|
20894
20778
|
});
|
|
20895
20779
|
|
|
20896
|
-
// build/lib/connect/
|
|
20897
|
-
var
|
|
20898
|
-
"build/lib/connect/
|
|
20780
|
+
// build/lib/connect/ws.js
|
|
20781
|
+
var require_ws = __commonJS({
|
|
20782
|
+
"build/lib/connect/ws.js"(exports5) {
|
|
20899
20783
|
"use strict";
|
|
20784
|
+
init_dirname();
|
|
20900
20785
|
init_buffer2();
|
|
20901
20786
|
init_process2();
|
|
20902
|
-
|
|
20787
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
20788
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
20789
|
+
};
|
|
20903
20790
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
20791
|
+
exports5.streamBuilder = exports5.browserStreamBuilder = void 0;
|
|
20904
20792
|
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
20793
|
+
var ws_1 = __importDefault(require_browser5());
|
|
20794
|
+
var debug_1 = __importDefault(require_browser4());
|
|
20905
20795
|
var readable_stream_1 = require_browser3();
|
|
20796
|
+
var is_browser_1 = __importDefault(require_is_browser());
|
|
20906
20797
|
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
20907
|
-
var
|
|
20908
|
-
var
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20912
|
-
|
|
20913
|
-
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
|
|
20921
|
-
|
|
20922
|
-
};
|
|
20923
|
-
_proxy._flush = (done) => {
|
|
20924
|
-
socketTask.close({
|
|
20925
|
-
success() {
|
|
20926
|
-
done();
|
|
20927
|
-
}
|
|
20928
|
-
});
|
|
20929
|
-
};
|
|
20930
|
-
return _proxy;
|
|
20798
|
+
var debug = (0, debug_1.default)("mqttjs:ws");
|
|
20799
|
+
var WSS_OPTIONS = [
|
|
20800
|
+
"rejectUnauthorized",
|
|
20801
|
+
"ca",
|
|
20802
|
+
"cert",
|
|
20803
|
+
"key",
|
|
20804
|
+
"pfx",
|
|
20805
|
+
"passphrase"
|
|
20806
|
+
];
|
|
20807
|
+
function buildUrl(opts, client) {
|
|
20808
|
+
let url = `${opts.protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
20809
|
+
if (typeof opts.transformWsUrl === "function") {
|
|
20810
|
+
url = opts.transformWsUrl(url, opts, client);
|
|
20811
|
+
}
|
|
20812
|
+
return url;
|
|
20931
20813
|
}
|
|
20932
20814
|
function setDefaultOpts(opts) {
|
|
20933
|
-
|
|
20934
|
-
|
|
20815
|
+
const options = opts;
|
|
20816
|
+
if (!opts.port) {
|
|
20817
|
+
if (opts.protocol === "wss") {
|
|
20818
|
+
options.port = 443;
|
|
20819
|
+
} else {
|
|
20820
|
+
options.port = 80;
|
|
20821
|
+
}
|
|
20935
20822
|
}
|
|
20936
20823
|
if (!opts.path) {
|
|
20937
|
-
|
|
20824
|
+
options.path = "/";
|
|
20938
20825
|
}
|
|
20939
20826
|
if (!opts.wsOptions) {
|
|
20940
|
-
|
|
20827
|
+
options.wsOptions = {};
|
|
20828
|
+
}
|
|
20829
|
+
if (!is_browser_1.default && !opts.forceNativeWebSocket && opts.protocol === "wss") {
|
|
20830
|
+
WSS_OPTIONS.forEach((prop) => {
|
|
20831
|
+
if (Object.prototype.hasOwnProperty.call(opts, prop) && !Object.prototype.hasOwnProperty.call(opts.wsOptions, prop)) {
|
|
20832
|
+
options.wsOptions[prop] = opts[prop];
|
|
20833
|
+
}
|
|
20834
|
+
});
|
|
20941
20835
|
}
|
|
20836
|
+
return options;
|
|
20942
20837
|
}
|
|
20943
|
-
function
|
|
20944
|
-
const
|
|
20945
|
-
|
|
20946
|
-
|
|
20947
|
-
url = `${protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
20838
|
+
function setDefaultBrowserOpts(opts) {
|
|
20839
|
+
const options = setDefaultOpts(opts);
|
|
20840
|
+
if (!options.hostname) {
|
|
20841
|
+
options.hostname = options.host;
|
|
20948
20842
|
}
|
|
20949
|
-
if (
|
|
20950
|
-
|
|
20843
|
+
if (!options.hostname) {
|
|
20844
|
+
if (typeof document === "undefined") {
|
|
20845
|
+
throw new Error("Could not determine host. Specify host manually.");
|
|
20846
|
+
}
|
|
20847
|
+
const parsed = new URL(document.URL);
|
|
20848
|
+
options.hostname = parsed.hostname;
|
|
20849
|
+
if (!options.port) {
|
|
20850
|
+
options.port = Number(parsed.port);
|
|
20851
|
+
}
|
|
20951
20852
|
}
|
|
20952
|
-
|
|
20953
|
-
|
|
20954
|
-
function bindEventHandler() {
|
|
20955
|
-
socketTask.onOpen(() => {
|
|
20956
|
-
stream.socketReady();
|
|
20957
|
-
});
|
|
20958
|
-
socketTask.onMessage((res) => {
|
|
20959
|
-
let { data } = res;
|
|
20960
|
-
if (data instanceof ArrayBuffer)
|
|
20961
|
-
data = buffer_1.Buffer.from(data);
|
|
20962
|
-
else
|
|
20963
|
-
data = buffer_1.Buffer.from(data, "utf8");
|
|
20964
|
-
proxy.push(data);
|
|
20965
|
-
});
|
|
20966
|
-
socketTask.onClose(() => {
|
|
20967
|
-
stream.emit("close");
|
|
20968
|
-
stream.end();
|
|
20969
|
-
stream.destroy();
|
|
20970
|
-
});
|
|
20971
|
-
socketTask.onError((error) => {
|
|
20972
|
-
const err = new Error(error.errMsg);
|
|
20973
|
-
stream.destroy(err);
|
|
20974
|
-
});
|
|
20975
|
-
}
|
|
20976
|
-
var buildStream = (client, opts) => {
|
|
20977
|
-
opts.hostname = opts.hostname || opts.host;
|
|
20978
|
-
if (!opts.hostname) {
|
|
20979
|
-
throw new Error("Could not determine host. Specify host manually.");
|
|
20853
|
+
if (options.objectMode === void 0) {
|
|
20854
|
+
options.objectMode = !(options.binary === true || options.binary === void 0);
|
|
20980
20855
|
}
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20856
|
+
return options;
|
|
20857
|
+
}
|
|
20858
|
+
function createWebSocket(client, url, opts) {
|
|
20859
|
+
debug("createWebSocket");
|
|
20860
|
+
debug(`protocol: ${opts.protocolId} ${opts.protocolVersion}`);
|
|
20861
|
+
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
20862
|
+
debug(`creating new Websocket for url: ${url} and protocol: ${websocketSubProtocol}`);
|
|
20863
|
+
let socket;
|
|
20864
|
+
if (opts.createWebsocket) {
|
|
20865
|
+
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
20866
|
+
} else {
|
|
20867
|
+
socket = new ws_1.default(url, [websocketSubProtocol], opts.wsOptions);
|
|
20868
|
+
}
|
|
20869
|
+
return socket;
|
|
20870
|
+
}
|
|
20871
|
+
function createBrowserWebSocket(client, opts) {
|
|
20872
|
+
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
20873
|
+
const url = buildUrl(opts, client);
|
|
20874
|
+
let socket;
|
|
20875
|
+
if (opts.createWebsocket) {
|
|
20876
|
+
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
20877
|
+
} else {
|
|
20878
|
+
socket = new WebSocket(url, [websocketSubProtocol]);
|
|
20879
|
+
}
|
|
20880
|
+
socket.binaryType = "arraybuffer";
|
|
20881
|
+
return socket;
|
|
20882
|
+
}
|
|
20883
|
+
var streamBuilder = (client, opts) => {
|
|
20884
|
+
debug("streamBuilder");
|
|
20885
|
+
const options = setDefaultOpts(opts);
|
|
20886
|
+
options.hostname = options.hostname || options.host || "localhost";
|
|
20887
|
+
const url = buildUrl(options, client);
|
|
20888
|
+
const socket = createWebSocket(client, url, options);
|
|
20889
|
+
const webSocketStream = ws_1.default.createWebSocketStream(socket, options.wsOptions);
|
|
20890
|
+
webSocketStream["url"] = url;
|
|
20891
|
+
socket.on("close", () => {
|
|
20892
|
+
webSocketStream.destroy();
|
|
20893
|
+
});
|
|
20894
|
+
return webSocketStream;
|
|
20895
|
+
};
|
|
20896
|
+
exports5.streamBuilder = streamBuilder;
|
|
20897
|
+
var browserStreamBuilder = (client, opts) => {
|
|
20898
|
+
debug("browserStreamBuilder");
|
|
20899
|
+
let stream;
|
|
20900
|
+
const options = setDefaultBrowserOpts(opts);
|
|
20901
|
+
const bufferSize = options.browserBufferSize || 1024 * 512;
|
|
20902
|
+
const bufferTimeout = opts.browserBufferTimeout || 1e3;
|
|
20903
|
+
const coerceToBuffer = !opts.objectMode;
|
|
20904
|
+
const socket = createBrowserWebSocket(client, opts);
|
|
20905
|
+
const proxy = buildProxy(opts, socketWriteBrowser, socketEndBrowser);
|
|
20906
|
+
if (!opts.objectMode) {
|
|
20907
|
+
proxy._writev = BufferedDuplex_1.writev.bind(proxy);
|
|
20908
|
+
}
|
|
20909
|
+
proxy.on("close", () => {
|
|
20910
|
+
socket.close();
|
|
20911
|
+
});
|
|
20912
|
+
const eventListenerSupport = typeof socket.addEventListener !== "undefined";
|
|
20913
|
+
if (socket.readyState === socket.OPEN) {
|
|
20914
|
+
stream = proxy;
|
|
20915
|
+
stream.socket = socket;
|
|
20916
|
+
} else {
|
|
20917
|
+
stream = new BufferedDuplex_1.BufferedDuplex(opts, proxy, socket);
|
|
20918
|
+
if (eventListenerSupport) {
|
|
20919
|
+
socket.addEventListener("open", onOpen);
|
|
20920
|
+
} else {
|
|
20921
|
+
socket.onopen = onOpen;
|
|
20922
|
+
}
|
|
20923
|
+
}
|
|
20924
|
+
if (eventListenerSupport) {
|
|
20925
|
+
socket.addEventListener("close", onClose);
|
|
20926
|
+
socket.addEventListener("error", onError);
|
|
20927
|
+
socket.addEventListener("message", onMessage);
|
|
20928
|
+
} else {
|
|
20929
|
+
socket.onclose = onClose;
|
|
20930
|
+
socket.onerror = onError;
|
|
20931
|
+
socket.onmessage = onMessage;
|
|
20932
|
+
}
|
|
20933
|
+
function buildProxy(pOptions, socketWrite, socketEnd) {
|
|
20934
|
+
const _proxy = new readable_stream_1.Transform({
|
|
20935
|
+
objectMode: pOptions.objectMode
|
|
20936
|
+
});
|
|
20937
|
+
_proxy._write = socketWrite;
|
|
20938
|
+
_proxy._flush = socketEnd;
|
|
20939
|
+
return _proxy;
|
|
20940
|
+
}
|
|
20941
|
+
function onOpen() {
|
|
20942
|
+
debug("WebSocket onOpen");
|
|
20943
|
+
if (stream instanceof BufferedDuplex_1.BufferedDuplex) {
|
|
20944
|
+
stream.socketReady();
|
|
20945
|
+
}
|
|
20946
|
+
}
|
|
20947
|
+
function onClose(event) {
|
|
20948
|
+
debug("WebSocket onClose", event);
|
|
20949
|
+
stream.end();
|
|
20950
|
+
stream.destroy();
|
|
20951
|
+
}
|
|
20952
|
+
function onError(err) {
|
|
20953
|
+
debug("WebSocket onError", err);
|
|
20954
|
+
const error = new Error("WebSocket error");
|
|
20955
|
+
error["event"] = err;
|
|
20956
|
+
stream.destroy(error);
|
|
20957
|
+
}
|
|
20958
|
+
function onMessage(event) {
|
|
20959
|
+
let { data } = event;
|
|
20960
|
+
if (data instanceof ArrayBuffer)
|
|
20961
|
+
data = buffer_1.Buffer.from(data);
|
|
20962
|
+
else
|
|
20963
|
+
data = buffer_1.Buffer.from(data, "utf8");
|
|
20964
|
+
proxy.push(data);
|
|
20965
|
+
}
|
|
20966
|
+
function socketWriteBrowser(chunk, enc, next) {
|
|
20967
|
+
if (socket.bufferedAmount > bufferSize) {
|
|
20968
|
+
setTimeout(socketWriteBrowser, bufferTimeout, chunk, enc, next);
|
|
20969
|
+
return;
|
|
20970
|
+
}
|
|
20971
|
+
if (coerceToBuffer && typeof chunk === "string") {
|
|
20972
|
+
chunk = buffer_1.Buffer.from(chunk, "utf8");
|
|
20973
|
+
}
|
|
20974
|
+
try {
|
|
20975
|
+
socket.send(chunk);
|
|
20976
|
+
} catch (err) {
|
|
20977
|
+
return next(err);
|
|
20978
|
+
}
|
|
20979
|
+
next();
|
|
20980
|
+
}
|
|
20981
|
+
function socketEndBrowser(done) {
|
|
20982
|
+
socket.close();
|
|
20983
|
+
done();
|
|
20984
|
+
}
|
|
20985
|
+
return stream;
|
|
20986
|
+
};
|
|
20987
|
+
exports5.browserStreamBuilder = browserStreamBuilder;
|
|
20988
|
+
}
|
|
20989
|
+
});
|
|
20990
|
+
|
|
20991
|
+
// node_modules/@jspm/core/nodelibs/browser/net.js
|
|
20992
|
+
var net_exports = {};
|
|
20993
|
+
__export(net_exports, {
|
|
20994
|
+
Server: () => unimplemented2,
|
|
20995
|
+
Socket: () => unimplemented2,
|
|
20996
|
+
Stream: () => unimplemented2,
|
|
20997
|
+
_createServerHandle: () => unimplemented2,
|
|
20998
|
+
_normalizeArgs: () => unimplemented2,
|
|
20999
|
+
_setSimultaneousAccepts: () => unimplemented2,
|
|
21000
|
+
connect: () => unimplemented2,
|
|
21001
|
+
createConnection: () => unimplemented2,
|
|
21002
|
+
createServer: () => unimplemented2,
|
|
21003
|
+
default: () => net,
|
|
21004
|
+
isIP: () => unimplemented2,
|
|
21005
|
+
isIPv4: () => unimplemented2,
|
|
21006
|
+
isIPv6: () => unimplemented2
|
|
21007
|
+
});
|
|
21008
|
+
function unimplemented2() {
|
|
21009
|
+
throw new Error("Node.js net module is not supported by JSPM core outside of Node.js");
|
|
21010
|
+
}
|
|
21011
|
+
var net;
|
|
21012
|
+
var init_net = __esm({
|
|
21013
|
+
"node_modules/@jspm/core/nodelibs/browser/net.js"() {
|
|
21014
|
+
init_dirname();
|
|
21015
|
+
init_buffer2();
|
|
21016
|
+
init_process2();
|
|
21017
|
+
net = {
|
|
21018
|
+
_createServerHandle: unimplemented2,
|
|
21019
|
+
_normalizeArgs: unimplemented2,
|
|
21020
|
+
_setSimultaneousAccepts: unimplemented2,
|
|
21021
|
+
connect: unimplemented2,
|
|
21022
|
+
createConnection: unimplemented2,
|
|
21023
|
+
createServer: unimplemented2,
|
|
21024
|
+
isIP: unimplemented2,
|
|
21025
|
+
isIPv4: unimplemented2,
|
|
21026
|
+
isIPv6: unimplemented2,
|
|
21027
|
+
Server: unimplemented2,
|
|
21028
|
+
Socket: unimplemented2,
|
|
21029
|
+
Stream: unimplemented2
|
|
21030
|
+
};
|
|
21031
|
+
}
|
|
21032
|
+
});
|
|
21033
|
+
|
|
21034
|
+
// build/lib/connect/tcp.js
|
|
21035
|
+
var require_tcp = __commonJS({
|
|
21036
|
+
"build/lib/connect/tcp.js"(exports5) {
|
|
21037
|
+
"use strict";
|
|
21038
|
+
init_dirname();
|
|
21039
|
+
init_buffer2();
|
|
21040
|
+
init_process2();
|
|
21041
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21042
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21043
|
+
};
|
|
21044
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21045
|
+
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
21046
|
+
var debug_1 = __importDefault(require_browser4());
|
|
21047
|
+
var debug = (0, debug_1.default)("mqttjs:tcp");
|
|
21048
|
+
var buildStream = (client, opts) => {
|
|
21049
|
+
opts.port = opts.port || 1883;
|
|
21050
|
+
opts.hostname = opts.hostname || opts.host || "localhost";
|
|
21051
|
+
const { port, path: path2 } = opts;
|
|
21052
|
+
const host = opts.hostname;
|
|
21053
|
+
debug("port %d and host %s", port, host);
|
|
21054
|
+
return net_1.default.createConnection({ port, host, path: path2 });
|
|
21055
|
+
};
|
|
21056
|
+
exports5.default = buildStream;
|
|
21057
|
+
}
|
|
21058
|
+
});
|
|
21059
|
+
|
|
21060
|
+
// node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js
|
|
21061
|
+
var empty_exports = {};
|
|
21062
|
+
__export(empty_exports, {
|
|
21063
|
+
default: () => empty_default
|
|
21064
|
+
});
|
|
21065
|
+
var empty_default;
|
|
21066
|
+
var init_empty = __esm({
|
|
21067
|
+
"node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js"() {
|
|
21068
|
+
init_dirname();
|
|
21069
|
+
init_buffer2();
|
|
21070
|
+
init_process2();
|
|
21071
|
+
empty_default = {};
|
|
21072
|
+
}
|
|
21073
|
+
});
|
|
21074
|
+
|
|
21075
|
+
// build/lib/connect/tls.js
|
|
21076
|
+
var require_tls = __commonJS({
|
|
21077
|
+
"build/lib/connect/tls.js"(exports5) {
|
|
21078
|
+
"use strict";
|
|
21079
|
+
init_dirname();
|
|
21080
|
+
init_buffer2();
|
|
21081
|
+
init_process2();
|
|
21082
|
+
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21083
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21084
|
+
};
|
|
21085
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21086
|
+
var tls_1 = __importDefault((init_empty(), __toCommonJS(empty_exports)));
|
|
21087
|
+
var net_1 = __importDefault((init_net(), __toCommonJS(net_exports)));
|
|
21088
|
+
var debug_1 = __importDefault(require_browser4());
|
|
21089
|
+
var debug = (0, debug_1.default)("mqttjs:tls");
|
|
21090
|
+
var buildStream = (client, opts) => {
|
|
21091
|
+
opts.port = opts.port || 8883;
|
|
21092
|
+
opts.host = opts.hostname || opts.host || "localhost";
|
|
21093
|
+
if (net_1.default.isIP(opts.host) === 0) {
|
|
21094
|
+
opts.servername = opts.host;
|
|
21095
|
+
}
|
|
21096
|
+
opts.rejectUnauthorized = opts.rejectUnauthorized !== false;
|
|
21097
|
+
delete opts.path;
|
|
21098
|
+
debug("port %d host %s rejectUnauthorized %b", opts.port, opts.host, opts.rejectUnauthorized);
|
|
21099
|
+
const connection = tls_1.default.connect(opts);
|
|
21100
|
+
connection.on("secureConnect", () => {
|
|
21101
|
+
if (opts.rejectUnauthorized && !connection.authorized) {
|
|
21102
|
+
connection.emit("error", new Error("TLS not authorized"));
|
|
21103
|
+
} else {
|
|
21104
|
+
connection.removeListener("error", handleTLSerrors);
|
|
21105
|
+
}
|
|
21106
|
+
});
|
|
21107
|
+
function handleTLSerrors(err) {
|
|
21108
|
+
if (opts.rejectUnauthorized) {
|
|
21109
|
+
client.emit("error", err);
|
|
21110
|
+
}
|
|
21111
|
+
connection.end();
|
|
21112
|
+
}
|
|
21113
|
+
connection.on("error", handleTLSerrors);
|
|
21114
|
+
return connection;
|
|
21115
|
+
};
|
|
21116
|
+
exports5.default = buildStream;
|
|
21117
|
+
}
|
|
21118
|
+
});
|
|
21119
|
+
|
|
21120
|
+
// build/lib/connect/wx.js
|
|
21121
|
+
var require_wx = __commonJS({
|
|
21122
|
+
"build/lib/connect/wx.js"(exports5) {
|
|
21123
|
+
"use strict";
|
|
21124
|
+
init_dirname();
|
|
21125
|
+
init_buffer2();
|
|
21126
|
+
init_process2();
|
|
21127
|
+
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21128
|
+
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21129
|
+
var readable_stream_1 = require_browser3();
|
|
21130
|
+
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
21131
|
+
var socketTask;
|
|
21132
|
+
var proxy;
|
|
21133
|
+
var stream;
|
|
21134
|
+
function buildProxy() {
|
|
21135
|
+
const _proxy = new readable_stream_1.Transform();
|
|
21136
|
+
_proxy._write = (chunk, encoding, next) => {
|
|
21137
|
+
socketTask.send({
|
|
21138
|
+
data: chunk.buffer,
|
|
21139
|
+
success() {
|
|
21140
|
+
next();
|
|
21141
|
+
},
|
|
21142
|
+
fail(errMsg) {
|
|
21143
|
+
next(new Error(errMsg));
|
|
21144
|
+
}
|
|
21145
|
+
});
|
|
21146
|
+
};
|
|
21147
|
+
_proxy._flush = (done) => {
|
|
21148
|
+
socketTask.close({
|
|
21149
|
+
success() {
|
|
21150
|
+
done();
|
|
21151
|
+
}
|
|
21152
|
+
});
|
|
21153
|
+
};
|
|
21154
|
+
return _proxy;
|
|
21155
|
+
}
|
|
21156
|
+
function setDefaultOpts(opts) {
|
|
21157
|
+
if (!opts.hostname) {
|
|
21158
|
+
opts.hostname = "localhost";
|
|
21159
|
+
}
|
|
21160
|
+
if (!opts.path) {
|
|
21161
|
+
opts.path = "/";
|
|
21162
|
+
}
|
|
21163
|
+
if (!opts.wsOptions) {
|
|
21164
|
+
opts.wsOptions = {};
|
|
21165
|
+
}
|
|
21166
|
+
}
|
|
21167
|
+
function buildUrl(opts, client) {
|
|
21168
|
+
const protocol = opts.protocol === "wxs" ? "wss" : "ws";
|
|
21169
|
+
let url = `${protocol}://${opts.hostname}${opts.path}`;
|
|
21170
|
+
if (opts.port && opts.port !== 80 && opts.port !== 443) {
|
|
21171
|
+
url = `${protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
21172
|
+
}
|
|
21173
|
+
if (typeof opts.transformWsUrl === "function") {
|
|
21174
|
+
url = opts.transformWsUrl(url, opts, client);
|
|
21175
|
+
}
|
|
21176
|
+
return url;
|
|
21177
|
+
}
|
|
21178
|
+
function bindEventHandler() {
|
|
21179
|
+
socketTask.onOpen(() => {
|
|
21180
|
+
stream.socketReady();
|
|
21181
|
+
});
|
|
21182
|
+
socketTask.onMessage((res) => {
|
|
21183
|
+
let { data } = res;
|
|
21184
|
+
if (data instanceof ArrayBuffer)
|
|
21185
|
+
data = buffer_1.Buffer.from(data);
|
|
21186
|
+
else
|
|
21187
|
+
data = buffer_1.Buffer.from(data, "utf8");
|
|
21188
|
+
proxy.push(data);
|
|
21189
|
+
});
|
|
21190
|
+
socketTask.onClose(() => {
|
|
21191
|
+
stream.emit("close");
|
|
21192
|
+
stream.end();
|
|
21193
|
+
stream.destroy();
|
|
21194
|
+
});
|
|
21195
|
+
socketTask.onError((error) => {
|
|
21196
|
+
const err = new Error(error.errMsg);
|
|
21197
|
+
stream.destroy(err);
|
|
21198
|
+
});
|
|
21199
|
+
}
|
|
21200
|
+
var buildStream = (client, opts) => {
|
|
21201
|
+
opts.hostname = opts.hostname || opts.host;
|
|
21202
|
+
if (!opts.hostname) {
|
|
21203
|
+
throw new Error("Could not determine host. Specify host manually.");
|
|
21204
|
+
}
|
|
21205
|
+
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21206
|
+
setDefaultOpts(opts);
|
|
21207
|
+
const url = buildUrl(opts, client);
|
|
20984
21208
|
socketTask = wx.connectSocket({
|
|
20985
21209
|
url,
|
|
20986
21210
|
protocols: [websocketSubProtocol]
|
|
@@ -21018,9 +21242,9 @@ var mqtt = (() => {
|
|
|
21018
21242
|
var require_ali = __commonJS({
|
|
21019
21243
|
"build/lib/connect/ali.js"(exports5) {
|
|
21020
21244
|
"use strict";
|
|
21245
|
+
init_dirname();
|
|
21021
21246
|
init_buffer2();
|
|
21022
21247
|
init_process2();
|
|
21023
|
-
init_navigator();
|
|
21024
21248
|
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21025
21249
|
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21026
21250
|
var readable_stream_1 = require_browser3();
|
|
@@ -21127,237 +21351,13 @@ var mqtt = (() => {
|
|
|
21127
21351
|
}
|
|
21128
21352
|
});
|
|
21129
21353
|
|
|
21130
|
-
// node_modules/ws/browser.js
|
|
21131
|
-
var require_browser5 = __commonJS({
|
|
21132
|
-
"node_modules/ws/browser.js"(exports5, module) {
|
|
21133
|
-
"use strict";
|
|
21134
|
-
init_buffer2();
|
|
21135
|
-
init_process2();
|
|
21136
|
-
init_navigator();
|
|
21137
|
-
module.exports = function() {
|
|
21138
|
-
throw new Error(
|
|
21139
|
-
"ws does not work in the browser. Browser clients must use the native WebSocket object"
|
|
21140
|
-
);
|
|
21141
|
-
};
|
|
21142
|
-
}
|
|
21143
|
-
});
|
|
21144
|
-
|
|
21145
|
-
// build/lib/connect/ws.js
|
|
21146
|
-
var require_ws = __commonJS({
|
|
21147
|
-
"build/lib/connect/ws.js"(exports5) {
|
|
21148
|
-
"use strict";
|
|
21149
|
-
init_buffer2();
|
|
21150
|
-
init_process2();
|
|
21151
|
-
init_navigator();
|
|
21152
|
-
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21153
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21154
|
-
};
|
|
21155
|
-
Object.defineProperty(exports5, "__esModule", { value: true });
|
|
21156
|
-
var buffer_1 = (init_buffer(), __toCommonJS(buffer_exports));
|
|
21157
|
-
var ws_1 = __importDefault(require_browser5());
|
|
21158
|
-
var debug_1 = __importDefault(require_browser4());
|
|
21159
|
-
var readable_stream_1 = require_browser3();
|
|
21160
|
-
var is_browser_1 = __importDefault(require_is_browser());
|
|
21161
|
-
var BufferedDuplex_1 = require_BufferedDuplex();
|
|
21162
|
-
var debug = (0, debug_1.default)("mqttjs:ws");
|
|
21163
|
-
var WSS_OPTIONS = [
|
|
21164
|
-
"rejectUnauthorized",
|
|
21165
|
-
"ca",
|
|
21166
|
-
"cert",
|
|
21167
|
-
"key",
|
|
21168
|
-
"pfx",
|
|
21169
|
-
"passphrase"
|
|
21170
|
-
];
|
|
21171
|
-
function buildUrl(opts, client) {
|
|
21172
|
-
let url = `${opts.protocol}://${opts.hostname}:${opts.port}${opts.path}`;
|
|
21173
|
-
if (typeof opts.transformWsUrl === "function") {
|
|
21174
|
-
url = opts.transformWsUrl(url, opts, client);
|
|
21175
|
-
}
|
|
21176
|
-
return url;
|
|
21177
|
-
}
|
|
21178
|
-
function setDefaultOpts(opts) {
|
|
21179
|
-
const options = opts;
|
|
21180
|
-
if (!opts.port) {
|
|
21181
|
-
if (opts.protocol === "wss") {
|
|
21182
|
-
options.port = 443;
|
|
21183
|
-
} else {
|
|
21184
|
-
options.port = 80;
|
|
21185
|
-
}
|
|
21186
|
-
}
|
|
21187
|
-
if (!opts.path) {
|
|
21188
|
-
options.path = "/";
|
|
21189
|
-
}
|
|
21190
|
-
if (!opts.wsOptions) {
|
|
21191
|
-
options.wsOptions = {};
|
|
21192
|
-
}
|
|
21193
|
-
if (!is_browser_1.default && opts.protocol === "wss") {
|
|
21194
|
-
WSS_OPTIONS.forEach((prop) => {
|
|
21195
|
-
if (Object.prototype.hasOwnProperty.call(opts, prop) && !Object.prototype.hasOwnProperty.call(opts.wsOptions, prop)) {
|
|
21196
|
-
options.wsOptions[prop] = opts[prop];
|
|
21197
|
-
}
|
|
21198
|
-
});
|
|
21199
|
-
}
|
|
21200
|
-
return options;
|
|
21201
|
-
}
|
|
21202
|
-
function setDefaultBrowserOpts(opts) {
|
|
21203
|
-
const options = setDefaultOpts(opts);
|
|
21204
|
-
if (!options.hostname) {
|
|
21205
|
-
options.hostname = options.host;
|
|
21206
|
-
}
|
|
21207
|
-
if (!options.hostname) {
|
|
21208
|
-
if (typeof document === "undefined") {
|
|
21209
|
-
throw new Error("Could not determine host. Specify host manually.");
|
|
21210
|
-
}
|
|
21211
|
-
const parsed = new URL(document.URL);
|
|
21212
|
-
options.hostname = parsed.hostname;
|
|
21213
|
-
if (!options.port) {
|
|
21214
|
-
options.port = Number(parsed.port);
|
|
21215
|
-
}
|
|
21216
|
-
}
|
|
21217
|
-
if (options.objectMode === void 0) {
|
|
21218
|
-
options.objectMode = !(options.binary === true || options.binary === void 0);
|
|
21219
|
-
}
|
|
21220
|
-
return options;
|
|
21221
|
-
}
|
|
21222
|
-
function createWebSocket(client, url, opts) {
|
|
21223
|
-
debug("createWebSocket");
|
|
21224
|
-
debug(`protocol: ${opts.protocolId} ${opts.protocolVersion}`);
|
|
21225
|
-
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21226
|
-
debug(`creating new Websocket for url: ${url} and protocol: ${websocketSubProtocol}`);
|
|
21227
|
-
let socket;
|
|
21228
|
-
if (opts.createWebsocket) {
|
|
21229
|
-
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
21230
|
-
} else {
|
|
21231
|
-
socket = new ws_1.default(url, [websocketSubProtocol], opts.wsOptions);
|
|
21232
|
-
}
|
|
21233
|
-
return socket;
|
|
21234
|
-
}
|
|
21235
|
-
function createBrowserWebSocket(client, opts) {
|
|
21236
|
-
const websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
|
|
21237
|
-
const url = buildUrl(opts, client);
|
|
21238
|
-
let socket;
|
|
21239
|
-
if (opts.createWebsocket) {
|
|
21240
|
-
socket = opts.createWebsocket(url, [websocketSubProtocol], opts);
|
|
21241
|
-
} else {
|
|
21242
|
-
socket = new WebSocket(url, [websocketSubProtocol]);
|
|
21243
|
-
}
|
|
21244
|
-
socket.binaryType = "arraybuffer";
|
|
21245
|
-
return socket;
|
|
21246
|
-
}
|
|
21247
|
-
var streamBuilder = (client, opts) => {
|
|
21248
|
-
debug("streamBuilder");
|
|
21249
|
-
const options = setDefaultOpts(opts);
|
|
21250
|
-
options.hostname = options.hostname || options.host || "localhost";
|
|
21251
|
-
const url = buildUrl(options, client);
|
|
21252
|
-
const socket = createWebSocket(client, url, options);
|
|
21253
|
-
const webSocketStream = ws_1.default.createWebSocketStream(socket, options.wsOptions);
|
|
21254
|
-
webSocketStream["url"] = url;
|
|
21255
|
-
socket.on("close", () => {
|
|
21256
|
-
webSocketStream.destroy();
|
|
21257
|
-
});
|
|
21258
|
-
return webSocketStream;
|
|
21259
|
-
};
|
|
21260
|
-
var browserStreamBuilder = (client, opts) => {
|
|
21261
|
-
debug("browserStreamBuilder");
|
|
21262
|
-
let stream;
|
|
21263
|
-
const options = setDefaultBrowserOpts(opts);
|
|
21264
|
-
const bufferSize = options.browserBufferSize || 1024 * 512;
|
|
21265
|
-
const bufferTimeout = opts.browserBufferTimeout || 1e3;
|
|
21266
|
-
const coerceToBuffer = !opts.objectMode;
|
|
21267
|
-
const socket = createBrowserWebSocket(client, opts);
|
|
21268
|
-
const proxy = buildProxy(opts, socketWriteBrowser, socketEndBrowser);
|
|
21269
|
-
if (!opts.objectMode) {
|
|
21270
|
-
proxy._writev = BufferedDuplex_1.writev.bind(proxy);
|
|
21271
|
-
}
|
|
21272
|
-
proxy.on("close", () => {
|
|
21273
|
-
socket.close();
|
|
21274
|
-
});
|
|
21275
|
-
const eventListenerSupport = typeof socket.addEventListener !== "undefined";
|
|
21276
|
-
if (socket.readyState === socket.OPEN) {
|
|
21277
|
-
stream = proxy;
|
|
21278
|
-
stream.socket = socket;
|
|
21279
|
-
} else {
|
|
21280
|
-
stream = new BufferedDuplex_1.BufferedDuplex(opts, proxy, socket);
|
|
21281
|
-
if (eventListenerSupport) {
|
|
21282
|
-
socket.addEventListener("open", onOpen);
|
|
21283
|
-
} else {
|
|
21284
|
-
socket.onopen = onOpen;
|
|
21285
|
-
}
|
|
21286
|
-
}
|
|
21287
|
-
if (eventListenerSupport) {
|
|
21288
|
-
socket.addEventListener("close", onClose);
|
|
21289
|
-
socket.addEventListener("error", onError);
|
|
21290
|
-
socket.addEventListener("message", onMessage);
|
|
21291
|
-
} else {
|
|
21292
|
-
socket.onclose = onClose;
|
|
21293
|
-
socket.onerror = onError;
|
|
21294
|
-
socket.onmessage = onMessage;
|
|
21295
|
-
}
|
|
21296
|
-
function buildProxy(pOptions, socketWrite, socketEnd) {
|
|
21297
|
-
const _proxy = new readable_stream_1.Transform({
|
|
21298
|
-
objectMode: pOptions.objectMode
|
|
21299
|
-
});
|
|
21300
|
-
_proxy._write = socketWrite;
|
|
21301
|
-
_proxy._flush = socketEnd;
|
|
21302
|
-
return _proxy;
|
|
21303
|
-
}
|
|
21304
|
-
function onOpen() {
|
|
21305
|
-
debug("WebSocket onOpen");
|
|
21306
|
-
if (stream instanceof BufferedDuplex_1.BufferedDuplex) {
|
|
21307
|
-
stream.socketReady();
|
|
21308
|
-
}
|
|
21309
|
-
}
|
|
21310
|
-
function onClose(event) {
|
|
21311
|
-
debug("WebSocket onClose", event);
|
|
21312
|
-
stream.end();
|
|
21313
|
-
stream.destroy();
|
|
21314
|
-
}
|
|
21315
|
-
function onError(err) {
|
|
21316
|
-
debug("WebSocket onError", err);
|
|
21317
|
-
const error = new Error("WebSocket error");
|
|
21318
|
-
error["event"] = err;
|
|
21319
|
-
stream.destroy(error);
|
|
21320
|
-
}
|
|
21321
|
-
function onMessage(event) {
|
|
21322
|
-
let { data } = event;
|
|
21323
|
-
if (data instanceof ArrayBuffer)
|
|
21324
|
-
data = buffer_1.Buffer.from(data);
|
|
21325
|
-
else
|
|
21326
|
-
data = buffer_1.Buffer.from(data, "utf8");
|
|
21327
|
-
proxy.push(data);
|
|
21328
|
-
}
|
|
21329
|
-
function socketWriteBrowser(chunk, enc, next) {
|
|
21330
|
-
if (socket.bufferedAmount > bufferSize) {
|
|
21331
|
-
setTimeout(socketWriteBrowser, bufferTimeout, chunk, enc, next);
|
|
21332
|
-
return;
|
|
21333
|
-
}
|
|
21334
|
-
if (coerceToBuffer && typeof chunk === "string") {
|
|
21335
|
-
chunk = buffer_1.Buffer.from(chunk, "utf8");
|
|
21336
|
-
}
|
|
21337
|
-
try {
|
|
21338
|
-
socket.send(chunk);
|
|
21339
|
-
} catch (err) {
|
|
21340
|
-
return next(err);
|
|
21341
|
-
}
|
|
21342
|
-
next();
|
|
21343
|
-
}
|
|
21344
|
-
function socketEndBrowser(done) {
|
|
21345
|
-
socket.close();
|
|
21346
|
-
done();
|
|
21347
|
-
}
|
|
21348
|
-
return stream;
|
|
21349
|
-
};
|
|
21350
|
-
exports5.default = is_browser_1.default ? browserStreamBuilder : streamBuilder;
|
|
21351
|
-
}
|
|
21352
|
-
});
|
|
21353
|
-
|
|
21354
21354
|
// build/lib/connect/index.js
|
|
21355
21355
|
var require_connect = __commonJS({
|
|
21356
21356
|
"build/lib/connect/index.js"(exports5) {
|
|
21357
21357
|
"use strict";
|
|
21358
|
+
init_dirname();
|
|
21358
21359
|
init_buffer2();
|
|
21359
21360
|
init_process2();
|
|
21360
|
-
init_navigator();
|
|
21361
21361
|
var __importDefault = exports5 && exports5.__importDefault || function(mod) {
|
|
21362
21362
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
21363
21363
|
};
|
|
@@ -21371,21 +21371,7 @@ var mqtt = (() => {
|
|
|
21371
21371
|
process_exports.nextTick = setImmediate;
|
|
21372
21372
|
}
|
|
21373
21373
|
var debug = (0, debug_1.default)("mqttjs");
|
|
21374
|
-
var protocols =
|
|
21375
|
-
if (!is_browser_1.default) {
|
|
21376
|
-
protocols.mqtt = require_tcp().default;
|
|
21377
|
-
protocols.tcp = require_tcp().default;
|
|
21378
|
-
protocols.ssl = require_tls().default;
|
|
21379
|
-
protocols.tls = protocols.ssl;
|
|
21380
|
-
protocols.mqtts = require_tls().default;
|
|
21381
|
-
} else {
|
|
21382
|
-
protocols.wx = require_wx().default;
|
|
21383
|
-
protocols.wxs = require_wx().default;
|
|
21384
|
-
protocols.ali = require_ali().default;
|
|
21385
|
-
protocols.alis = require_ali().default;
|
|
21386
|
-
}
|
|
21387
|
-
protocols.ws = require_ws().default;
|
|
21388
|
-
protocols.wss = require_ws().default;
|
|
21374
|
+
var protocols = null;
|
|
21389
21375
|
function parseAuthOptions(opts) {
|
|
21390
21376
|
let matches;
|
|
21391
21377
|
if (opts.auth) {
|
|
@@ -21457,6 +21443,25 @@ var mqtt = (() => {
|
|
|
21457
21443
|
throw new Error("Missing secure protocol key");
|
|
21458
21444
|
}
|
|
21459
21445
|
}
|
|
21446
|
+
if (!protocols) {
|
|
21447
|
+
protocols = {};
|
|
21448
|
+
if (!is_browser_1.default && !opts.forceNativeWebSocket) {
|
|
21449
|
+
protocols.ws = require_ws().streamBuilder;
|
|
21450
|
+
protocols.wss = require_ws().streamBuilder;
|
|
21451
|
+
protocols.mqtt = require_tcp().default;
|
|
21452
|
+
protocols.tcp = require_tcp().default;
|
|
21453
|
+
protocols.ssl = require_tls().default;
|
|
21454
|
+
protocols.tls = protocols.ssl;
|
|
21455
|
+
protocols.mqtts = require_tls().default;
|
|
21456
|
+
} else {
|
|
21457
|
+
protocols.ws = require_ws().browserStreamBuilder;
|
|
21458
|
+
protocols.wss = require_ws().browserStreamBuilder;
|
|
21459
|
+
protocols.wx = require_wx().default;
|
|
21460
|
+
protocols.wxs = require_wx().default;
|
|
21461
|
+
protocols.ali = require_ali().default;
|
|
21462
|
+
protocols.alis = require_ali().default;
|
|
21463
|
+
}
|
|
21464
|
+
}
|
|
21460
21465
|
if (!protocols[opts.protocol]) {
|
|
21461
21466
|
const isSecure = ["mqtts", "wss"].indexOf(opts.protocol) !== -1;
|
|
21462
21467
|
opts.protocol = [
|
|
@@ -21542,9 +21547,9 @@ var mqtt = (() => {
|
|
|
21542
21547
|
var require_mqtt2 = __commonJS({
|
|
21543
21548
|
"build/mqtt.js"(exports5) {
|
|
21544
21549
|
"use strict";
|
|
21550
|
+
init_dirname();
|
|
21545
21551
|
init_buffer2();
|
|
21546
21552
|
init_process2();
|
|
21547
|
-
init_navigator();
|
|
21548
21553
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
21549
21554
|
if (k22 === void 0)
|
|
21550
21555
|
k22 = k2;
|
|
@@ -21615,9 +21620,9 @@ var mqtt = (() => {
|
|
|
21615
21620
|
// build/index.js
|
|
21616
21621
|
var require_build = __commonJS({
|
|
21617
21622
|
"build/index.js"(exports5) {
|
|
21623
|
+
init_dirname();
|
|
21618
21624
|
init_buffer2();
|
|
21619
21625
|
init_process2();
|
|
21620
|
-
init_navigator();
|
|
21621
21626
|
var __createBinding = exports5 && exports5.__createBinding || (Object.create ? function(o7, m4, k2, k22) {
|
|
21622
21627
|
if (k22 === void 0)
|
|
21623
21628
|
k22 = k2;
|