mqtt5-wasm 1.0.0 → 1.2.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 +27 -1
- package/mqtt5_wasm.d.ts +24 -12
- package/mqtt5_wasm.js +59 -25
- package/mqtt5_wasm_bg.wasm +0 -0
- package/mqtt5_wasm_bg.wasm.d.ts +252 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ MQTT v5.0 and v3.1.1 WebAssembly client and broker for browser environments.
|
|
|
17
17
|
- **Broker lifecycle events** - Monitor client connections, publishes, and subscriptions
|
|
18
18
|
- **Automatic keepalive** - Connection health monitoring with timeout detection
|
|
19
19
|
- **Will messages** - Last Will and Testament (LWT) support
|
|
20
|
+
- **Load balancer redirect** - Server redirect via CONNACK UseAnotherServer for horizontal scaling
|
|
20
21
|
|
|
21
22
|
## Installation
|
|
22
23
|
|
|
@@ -30,7 +31,7 @@ npm install mqtt5-wasm
|
|
|
30
31
|
|
|
31
32
|
```toml
|
|
32
33
|
[dependencies]
|
|
33
|
-
mqtt5-wasm = "1.
|
|
34
|
+
mqtt5-wasm = "1.2"
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
Build with wasm-bindgen:
|
|
@@ -141,6 +142,31 @@ broker.onMessageDelivered((event) => {
|
|
|
141
142
|
});
|
|
142
143
|
```
|
|
143
144
|
|
|
145
|
+
### Load Balancer Redirect
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
import init, { Broker, BrokerConfig, MqttClient } from "mqtt5-wasm";
|
|
149
|
+
|
|
150
|
+
await init();
|
|
151
|
+
|
|
152
|
+
const lbConfig = new BrokerConfig();
|
|
153
|
+
lbConfig.allowAnonymous = true;
|
|
154
|
+
lbConfig.addLoadBalancerBackend("broker-a");
|
|
155
|
+
lbConfig.addLoadBalancerBackend("broker-b");
|
|
156
|
+
const lb = Broker.withConfig(lbConfig);
|
|
157
|
+
|
|
158
|
+
const client = new MqttClient("my-client");
|
|
159
|
+
const port = lb.createClientPort();
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
await client.connectMessagePort(port);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
if (err.type === "redirect") {
|
|
165
|
+
console.log(`Redirected to ${err.url}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
144
170
|
## Documentation
|
|
145
171
|
|
|
146
172
|
See the [main repository](https://github.com/LabOverWire/mqtt-lib) for complete documentation and examples.
|
package/mqtt5_wasm.d.ts
CHANGED
|
@@ -51,6 +51,11 @@ export class Broker {
|
|
|
51
51
|
* Returns an error if the bridge cannot be added.
|
|
52
52
|
*/
|
|
53
53
|
addBridge(config: BridgeConfig, remotePort: MessagePort): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* # Errors
|
|
56
|
+
* Returns an error if the bridge cannot be added or WebSocket connection fails.
|
|
57
|
+
*/
|
|
58
|
+
addBridgeWebSocket(config: BridgeConfig, url: string, opts: ConnectOptions): Promise<void>;
|
|
54
59
|
addRole(name: string): Promise<void>;
|
|
55
60
|
/**
|
|
56
61
|
* # Errors
|
|
@@ -132,13 +137,16 @@ export class BrokerConfig {
|
|
|
132
137
|
free(): void;
|
|
133
138
|
[Symbol.dispose](): void;
|
|
134
139
|
addChangeOnlyDeliveryPattern(pattern: string): void;
|
|
140
|
+
addLoadBalancerBackend(backend: string): void;
|
|
135
141
|
clearChangeOnlyDeliveryPatterns(): void;
|
|
142
|
+
clearLoadBalancerBackends(): void;
|
|
136
143
|
constructor();
|
|
137
144
|
set allowAnonymous(value: boolean);
|
|
138
145
|
set changeOnlyDeliveryEnabled(value: boolean);
|
|
139
146
|
set echoSuppressionEnabled(value: boolean);
|
|
140
147
|
set echoSuppressionPropertyKey(value: string | null | undefined);
|
|
141
148
|
set maxClients(value: number);
|
|
149
|
+
set maxOutboundRatePerClient(value: number);
|
|
142
150
|
set maxPacketSize(value: number);
|
|
143
151
|
set maximumQos(value: number);
|
|
144
152
|
set retainAvailable(value: boolean);
|
|
@@ -434,6 +442,7 @@ export interface InitOutput {
|
|
|
434
442
|
readonly broker_aclRuleCount: (a: number) => number;
|
|
435
443
|
readonly broker_addAclRule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
436
444
|
readonly broker_addBridge: (a: number, b: number, c: number) => number;
|
|
445
|
+
readonly broker_addBridgeWebSocket: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
437
446
|
readonly broker_addRole: (a: number, b: number, c: number) => number;
|
|
438
447
|
readonly broker_addRoleRule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
439
448
|
readonly broker_addUser: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
@@ -474,13 +483,16 @@ export interface InitOutput {
|
|
|
474
483
|
readonly broker_userCount: (a: number) => number;
|
|
475
484
|
readonly broker_withConfig: (a: number, b: number) => void;
|
|
476
485
|
readonly brokerconfig_addChangeOnlyDeliveryPattern: (a: number, b: number, c: number) => void;
|
|
486
|
+
readonly brokerconfig_addLoadBalancerBackend: (a: number, b: number, c: number) => void;
|
|
477
487
|
readonly brokerconfig_clearChangeOnlyDeliveryPatterns: (a: number) => void;
|
|
488
|
+
readonly brokerconfig_clearLoadBalancerBackends: (a: number) => void;
|
|
478
489
|
readonly brokerconfig_new: () => number;
|
|
479
490
|
readonly brokerconfig_set_allowAnonymous: (a: number, b: number) => void;
|
|
480
491
|
readonly brokerconfig_set_changeOnlyDeliveryEnabled: (a: number, b: number) => void;
|
|
481
492
|
readonly brokerconfig_set_echoSuppressionEnabled: (a: number, b: number) => void;
|
|
482
493
|
readonly brokerconfig_set_echoSuppressionPropertyKey: (a: number, b: number, c: number) => void;
|
|
483
494
|
readonly brokerconfig_set_maxClients: (a: number, b: number) => void;
|
|
495
|
+
readonly brokerconfig_set_maxOutboundRatePerClient: (a: number, b: number) => void;
|
|
484
496
|
readonly brokerconfig_set_maxPacketSize: (a: number, b: number) => void;
|
|
485
497
|
readonly brokerconfig_set_maximumQos: (a: number, b: number) => void;
|
|
486
498
|
readonly brokerconfig_set_retainAvailable: (a: number, b: number) => void;
|
|
@@ -632,22 +644,22 @@ export interface InitOutput {
|
|
|
632
644
|
readonly willmessage_topic: (a: number, b: number) => void;
|
|
633
645
|
readonly willmessage_willDelayInterval: (a: number) => number;
|
|
634
646
|
readonly createCodecRegistry: () => number;
|
|
647
|
+
readonly gzipcodec_withLevel: (a: number, b: number) => number;
|
|
635
648
|
readonly gzipcodec_new: () => number;
|
|
636
649
|
readonly createGzipCodec: (a: number, b: number) => number;
|
|
650
|
+
readonly __wbg_gzipcodec_free: (a: number, b: number) => void;
|
|
637
651
|
readonly gzipcodec_withMinSize: (a: number, b: number) => number;
|
|
638
652
|
readonly gzipcodec_withMaxDecompressedSize: (a: number, b: number) => number;
|
|
639
|
-
readonly
|
|
640
|
-
readonly
|
|
641
|
-
readonly
|
|
642
|
-
readonly
|
|
643
|
-
readonly
|
|
644
|
-
readonly
|
|
645
|
-
readonly
|
|
646
|
-
readonly
|
|
647
|
-
readonly
|
|
648
|
-
readonly
|
|
649
|
-
readonly __wasm_bindgen_func_elem_1030_5: (a: number, b: number, c: number) => void;
|
|
650
|
-
readonly __wasm_bindgen_func_elem_2590: (a: number, b: number) => void;
|
|
653
|
+
readonly __wasm_bindgen_func_elem_2610: (a: number, b: number) => void;
|
|
654
|
+
readonly __wasm_bindgen_func_elem_2770: (a: number, b: number) => void;
|
|
655
|
+
readonly __wasm_bindgen_func_elem_183: (a: number, b: number) => void;
|
|
656
|
+
readonly __wasm_bindgen_func_elem_4240: (a: number, b: number, c: number, d: number) => void;
|
|
657
|
+
readonly __wasm_bindgen_func_elem_4252: (a: number, b: number, c: number, d: number) => void;
|
|
658
|
+
readonly __wasm_bindgen_func_elem_1047: (a: number, b: number, c: number) => void;
|
|
659
|
+
readonly __wasm_bindgen_func_elem_1047_3: (a: number, b: number, c: number) => void;
|
|
660
|
+
readonly __wasm_bindgen_func_elem_1047_4: (a: number, b: number, c: number) => void;
|
|
661
|
+
readonly __wasm_bindgen_func_elem_1047_5: (a: number, b: number, c: number) => void;
|
|
662
|
+
readonly __wasm_bindgen_func_elem_2630: (a: number, b: number) => void;
|
|
651
663
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
652
664
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
653
665
|
readonly __wbindgen_export3: (a: number) => void;
|
package/mqtt5_wasm.js
CHANGED
|
@@ -170,6 +170,23 @@ export class Broker {
|
|
|
170
170
|
const ret = wasm.broker_addBridge(this.__wbg_ptr, ptr0, addHeapObject(remotePort));
|
|
171
171
|
return takeObject(ret);
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* # Errors
|
|
175
|
+
* Returns an error if the bridge cannot be added or WebSocket connection fails.
|
|
176
|
+
* @param {BridgeConfig} config
|
|
177
|
+
* @param {string} url
|
|
178
|
+
* @param {ConnectOptions} opts
|
|
179
|
+
* @returns {Promise<void>}
|
|
180
|
+
*/
|
|
181
|
+
addBridgeWebSocket(config, url, opts) {
|
|
182
|
+
_assertClass(config, BridgeConfig);
|
|
183
|
+
var ptr0 = config.__destroy_into_raw();
|
|
184
|
+
const ptr1 = passStringToWasm0(url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
185
|
+
const len1 = WASM_VECTOR_LEN;
|
|
186
|
+
_assertClass(opts, ConnectOptions);
|
|
187
|
+
const ret = wasm.broker_addBridgeWebSocket(this.__wbg_ptr, ptr0, ptr1, len1, opts.__wbg_ptr);
|
|
188
|
+
return takeObject(ret);
|
|
189
|
+
}
|
|
173
190
|
/**
|
|
174
191
|
* @param {string} name
|
|
175
192
|
* @returns {Promise<void>}
|
|
@@ -604,9 +621,20 @@ export class BrokerConfig {
|
|
|
604
621
|
const len0 = WASM_VECTOR_LEN;
|
|
605
622
|
wasm.brokerconfig_addChangeOnlyDeliveryPattern(this.__wbg_ptr, ptr0, len0);
|
|
606
623
|
}
|
|
624
|
+
/**
|
|
625
|
+
* @param {string} backend
|
|
626
|
+
*/
|
|
627
|
+
addLoadBalancerBackend(backend) {
|
|
628
|
+
const ptr0 = passStringToWasm0(backend, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
630
|
+
wasm.brokerconfig_addLoadBalancerBackend(this.__wbg_ptr, ptr0, len0);
|
|
631
|
+
}
|
|
607
632
|
clearChangeOnlyDeliveryPatterns() {
|
|
608
633
|
wasm.brokerconfig_clearChangeOnlyDeliveryPatterns(this.__wbg_ptr);
|
|
609
634
|
}
|
|
635
|
+
clearLoadBalancerBackends() {
|
|
636
|
+
wasm.brokerconfig_clearLoadBalancerBackends(this.__wbg_ptr);
|
|
637
|
+
}
|
|
610
638
|
constructor() {
|
|
611
639
|
const ret = wasm.brokerconfig_new();
|
|
612
640
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -645,6 +673,12 @@ export class BrokerConfig {
|
|
|
645
673
|
set maxClients(value) {
|
|
646
674
|
wasm.brokerconfig_set_maxClients(this.__wbg_ptr, value);
|
|
647
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* @param {number} value
|
|
678
|
+
*/
|
|
679
|
+
set maxOutboundRatePerClient(value) {
|
|
680
|
+
wasm.brokerconfig_set_maxOutboundRatePerClient(this.__wbg_ptr, value);
|
|
681
|
+
}
|
|
648
682
|
/**
|
|
649
683
|
* @param {number} value
|
|
650
684
|
*/
|
|
@@ -2342,7 +2376,7 @@ function __wbg_get_imports() {
|
|
|
2342
2376
|
const a = state0.a;
|
|
2343
2377
|
state0.a = 0;
|
|
2344
2378
|
try {
|
|
2345
|
-
return
|
|
2379
|
+
return __wasm_bindgen_func_elem_4252(a, state0.b, arg0, arg1);
|
|
2346
2380
|
} finally {
|
|
2347
2381
|
state0.a = a;
|
|
2348
2382
|
}
|
|
@@ -2372,7 +2406,7 @@ function __wbg_get_imports() {
|
|
|
2372
2406
|
const a = state0.a;
|
|
2373
2407
|
state0.a = 0;
|
|
2374
2408
|
try {
|
|
2375
|
-
return
|
|
2409
|
+
return __wasm_bindgen_func_elem_4252(a, state0.b, arg0, arg1);
|
|
2376
2410
|
} finally {
|
|
2377
2411
|
state0.a = a;
|
|
2378
2412
|
}
|
|
@@ -2449,7 +2483,7 @@ function __wbg_get_imports() {
|
|
|
2449
2483
|
__wbg_send_d31a693c975dea74: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2450
2484
|
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
|
|
2451
2485
|
}, arguments); },
|
|
2452
|
-
|
|
2486
|
+
__wbg_setTimeout_28af72ed644fd498: function(arg0, arg1) {
|
|
2453
2487
|
const ret = setTimeout(getObject(arg0), arg1);
|
|
2454
2488
|
return ret;
|
|
2455
2489
|
},
|
|
@@ -2523,33 +2557,33 @@ function __wbg_get_imports() {
|
|
|
2523
2557
|
console.warn(getObject(arg0));
|
|
2524
2558
|
},
|
|
2525
2559
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2526
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2527
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2560
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 425, function: Function { arguments: [], shim_idx: 426, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2561
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2610, __wasm_bindgen_func_elem_2630);
|
|
2528
2562
|
return addHeapObject(ret);
|
|
2529
2563
|
},
|
|
2530
2564
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2531
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2532
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2565
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 443, function: Function { arguments: [Externref], shim_idx: 607, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2566
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_2770, __wasm_bindgen_func_elem_4240);
|
|
2533
2567
|
return addHeapObject(ret);
|
|
2534
2568
|
},
|
|
2535
2569
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2536
2570
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [Externref], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2537
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2571
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_183, __wasm_bindgen_func_elem_1047);
|
|
2538
2572
|
return addHeapObject(ret);
|
|
2539
2573
|
},
|
|
2540
2574
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2541
2575
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2542
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2576
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_183, __wasm_bindgen_func_elem_1047_3);
|
|
2543
2577
|
return addHeapObject(ret);
|
|
2544
2578
|
},
|
|
2545
2579
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2546
2580
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2547
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2581
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_183, __wasm_bindgen_func_elem_1047_4);
|
|
2548
2582
|
return addHeapObject(ret);
|
|
2549
2583
|
},
|
|
2550
2584
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2551
2585
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2552
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2586
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_183, __wasm_bindgen_func_elem_1047_5);
|
|
2553
2587
|
return addHeapObject(ret);
|
|
2554
2588
|
},
|
|
2555
2589
|
__wbindgen_cast_0000000000000007: function(arg0) {
|
|
@@ -2583,30 +2617,30 @@ function __wbg_get_imports() {
|
|
|
2583
2617
|
};
|
|
2584
2618
|
}
|
|
2585
2619
|
|
|
2586
|
-
function
|
|
2587
|
-
wasm.
|
|
2620
|
+
function __wasm_bindgen_func_elem_2630(arg0, arg1) {
|
|
2621
|
+
wasm.__wasm_bindgen_func_elem_2630(arg0, arg1);
|
|
2588
2622
|
}
|
|
2589
2623
|
|
|
2590
|
-
function
|
|
2591
|
-
wasm.
|
|
2624
|
+
function __wasm_bindgen_func_elem_1047(arg0, arg1, arg2) {
|
|
2625
|
+
wasm.__wasm_bindgen_func_elem_1047(arg0, arg1, addHeapObject(arg2));
|
|
2592
2626
|
}
|
|
2593
2627
|
|
|
2594
|
-
function
|
|
2595
|
-
wasm.
|
|
2628
|
+
function __wasm_bindgen_func_elem_1047_3(arg0, arg1, arg2) {
|
|
2629
|
+
wasm.__wasm_bindgen_func_elem_1047_3(arg0, arg1, addHeapObject(arg2));
|
|
2596
2630
|
}
|
|
2597
2631
|
|
|
2598
|
-
function
|
|
2599
|
-
wasm.
|
|
2632
|
+
function __wasm_bindgen_func_elem_1047_4(arg0, arg1, arg2) {
|
|
2633
|
+
wasm.__wasm_bindgen_func_elem_1047_4(arg0, arg1, addHeapObject(arg2));
|
|
2600
2634
|
}
|
|
2601
2635
|
|
|
2602
|
-
function
|
|
2603
|
-
wasm.
|
|
2636
|
+
function __wasm_bindgen_func_elem_1047_5(arg0, arg1, arg2) {
|
|
2637
|
+
wasm.__wasm_bindgen_func_elem_1047_5(arg0, arg1, addHeapObject(arg2));
|
|
2604
2638
|
}
|
|
2605
2639
|
|
|
2606
|
-
function
|
|
2640
|
+
function __wasm_bindgen_func_elem_4240(arg0, arg1, arg2) {
|
|
2607
2641
|
try {
|
|
2608
2642
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2609
|
-
wasm.
|
|
2643
|
+
wasm.__wasm_bindgen_func_elem_4240(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2610
2644
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2611
2645
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2612
2646
|
if (r1) {
|
|
@@ -2617,8 +2651,8 @@ function __wasm_bindgen_func_elem_4195(arg0, arg1, arg2) {
|
|
|
2617
2651
|
}
|
|
2618
2652
|
}
|
|
2619
2653
|
|
|
2620
|
-
function
|
|
2621
|
-
wasm.
|
|
2654
|
+
function __wasm_bindgen_func_elem_4252(arg0, arg1, arg2, arg3) {
|
|
2655
|
+
wasm.__wasm_bindgen_func_elem_4252(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2622
2656
|
}
|
|
2623
2657
|
|
|
2624
2658
|
|
package/mqtt5_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_bridgeconfig_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_broker_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_brokerconfig_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_codecregistry_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_connectoptions_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_deflatecodec_free: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_messageproperties_free: (a: number, b: number) => void;
|
|
11
|
+
export const __wbg_mqttclient_free: (a: number, b: number) => void;
|
|
12
|
+
export const __wbg_publishoptions_free: (a: number, b: number) => void;
|
|
13
|
+
export const __wbg_reconnectoptions_free: (a: number, b: number) => void;
|
|
14
|
+
export const __wbg_subscribeoptions_free: (a: number, b: number) => void;
|
|
15
|
+
export const __wbg_topicmapping_free: (a: number, b: number) => void;
|
|
16
|
+
export const __wbg_willmessage_free: (a: number, b: number) => void;
|
|
17
|
+
export const bridgeconfig_addTopic: (a: number, b: number) => void;
|
|
18
|
+
export const bridgeconfig_new: (a: number, b: number) => number;
|
|
19
|
+
export const bridgeconfig_set_cleanStart: (a: number, b: number) => void;
|
|
20
|
+
export const bridgeconfig_set_clientId: (a: number, b: number, c: number) => void;
|
|
21
|
+
export const bridgeconfig_set_keepAliveSecs: (a: number, b: number) => void;
|
|
22
|
+
export const bridgeconfig_set_loopPreventionCacheSize: (a: number, b: number) => void;
|
|
23
|
+
export const bridgeconfig_set_loopPreventionTtlSecs: (a: number, b: bigint) => void;
|
|
24
|
+
export const bridgeconfig_set_password: (a: number, b: number, c: number) => void;
|
|
25
|
+
export const bridgeconfig_set_username: (a: number, b: number, c: number) => void;
|
|
26
|
+
export const bridgeconfig_validate: (a: number, b: number) => void;
|
|
27
|
+
export const broker_aclRuleCount: (a: number) => number;
|
|
28
|
+
export const broker_addAclRule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
29
|
+
export const broker_addBridge: (a: number, b: number, c: number) => number;
|
|
30
|
+
export const broker_addBridgeWebSocket: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
31
|
+
export const broker_addRole: (a: number, b: number, c: number) => number;
|
|
32
|
+
export const broker_addRoleRule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
33
|
+
export const broker_addUser: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
34
|
+
export const broker_addUserWithHash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
35
|
+
export const broker_assignRole: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
36
|
+
export const broker_clearAclRules: (a: number) => number;
|
|
37
|
+
export const broker_clearRoles: (a: number) => number;
|
|
38
|
+
export const broker_createClientPort: (a: number, b: number) => void;
|
|
39
|
+
export const broker_getConfigHash: (a: number) => number;
|
|
40
|
+
export const broker_getMaxClients: (a: number) => number;
|
|
41
|
+
export const broker_getMaxPacketSize: (a: number) => number;
|
|
42
|
+
export const broker_getSessionExpiryIntervalSecs: (a: number) => number;
|
|
43
|
+
export const broker_getUserRoles: (a: number, b: number, c: number) => number;
|
|
44
|
+
export const broker_hasUser: (a: number, b: number, c: number) => number;
|
|
45
|
+
export const broker_hashPassword: (a: number, b: number, c: number) => void;
|
|
46
|
+
export const broker_listBridges: (a: number, b: number) => void;
|
|
47
|
+
export const broker_listRoles: (a: number) => number;
|
|
48
|
+
export const broker_new: (a: number) => void;
|
|
49
|
+
export const broker_onClientConnect: (a: number, b: number) => void;
|
|
50
|
+
export const broker_onClientDisconnect: (a: number, b: number) => void;
|
|
51
|
+
export const broker_onClientPublish: (a: number, b: number) => void;
|
|
52
|
+
export const broker_onClientSubscribe: (a: number, b: number) => void;
|
|
53
|
+
export const broker_onClientUnsubscribe: (a: number, b: number) => void;
|
|
54
|
+
export const broker_onConfigChange: (a: number, b: number) => void;
|
|
55
|
+
export const broker_onMessageDelivered: (a: number, b: number) => void;
|
|
56
|
+
export const broker_removeBridge: (a: number, b: number, c: number) => number;
|
|
57
|
+
export const broker_removeRole: (a: number, b: number, c: number) => number;
|
|
58
|
+
export const broker_removeUser: (a: number, b: number, c: number) => number;
|
|
59
|
+
export const broker_roleCount: (a: number) => number;
|
|
60
|
+
export const broker_setAclDefaultAllow: (a: number) => number;
|
|
61
|
+
export const broker_setAclDefaultDeny: (a: number) => number;
|
|
62
|
+
export const broker_startSysTopics: (a: number) => void;
|
|
63
|
+
export const broker_startSysTopicsWithIntervalSecs: (a: number, b: number) => void;
|
|
64
|
+
export const broker_stopAllBridges: (a: number) => number;
|
|
65
|
+
export const broker_stopSysTopics: (a: number) => void;
|
|
66
|
+
export const broker_unassignRole: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
67
|
+
export const broker_updateConfig: (a: number, b: number, c: number) => void;
|
|
68
|
+
export const broker_userCount: (a: number) => number;
|
|
69
|
+
export const broker_withConfig: (a: number, b: number) => void;
|
|
70
|
+
export const brokerconfig_addChangeOnlyDeliveryPattern: (a: number, b: number, c: number) => void;
|
|
71
|
+
export const brokerconfig_addLoadBalancerBackend: (a: number, b: number, c: number) => void;
|
|
72
|
+
export const brokerconfig_clearChangeOnlyDeliveryPatterns: (a: number) => void;
|
|
73
|
+
export const brokerconfig_clearLoadBalancerBackends: (a: number) => void;
|
|
74
|
+
export const brokerconfig_new: () => number;
|
|
75
|
+
export const brokerconfig_set_allowAnonymous: (a: number, b: number) => void;
|
|
76
|
+
export const brokerconfig_set_changeOnlyDeliveryEnabled: (a: number, b: number) => void;
|
|
77
|
+
export const brokerconfig_set_echoSuppressionEnabled: (a: number, b: number) => void;
|
|
78
|
+
export const brokerconfig_set_echoSuppressionPropertyKey: (a: number, b: number, c: number) => void;
|
|
79
|
+
export const brokerconfig_set_maxClients: (a: number, b: number) => void;
|
|
80
|
+
export const brokerconfig_set_maxOutboundRatePerClient: (a: number, b: number) => void;
|
|
81
|
+
export const brokerconfig_set_maxPacketSize: (a: number, b: number) => void;
|
|
82
|
+
export const brokerconfig_set_maximumQos: (a: number, b: number) => void;
|
|
83
|
+
export const brokerconfig_set_retainAvailable: (a: number, b: number) => void;
|
|
84
|
+
export const brokerconfig_set_serverKeepAliveSecs: (a: number, b: number) => void;
|
|
85
|
+
export const brokerconfig_set_sessionExpiryIntervalSecs: (a: number, b: number) => void;
|
|
86
|
+
export const brokerconfig_set_sharedSubscriptionAvailable: (a: number, b: number) => void;
|
|
87
|
+
export const brokerconfig_set_subscriptionIdentifierAvailable: (a: number, b: number) => void;
|
|
88
|
+
export const brokerconfig_set_topicAliasMaximum: (a: number, b: number) => void;
|
|
89
|
+
export const brokerconfig_set_wildcardSubscriptionAvailable: (a: number, b: number) => void;
|
|
90
|
+
export const codecregistry_getDefault: (a: number, b: number) => void;
|
|
91
|
+
export const codecregistry_hasCodec: (a: number, b: number, c: number) => number;
|
|
92
|
+
export const codecregistry_new: () => number;
|
|
93
|
+
export const codecregistry_registerDeflate: (a: number, b: number) => void;
|
|
94
|
+
export const codecregistry_registerGzip: (a: number, b: number) => void;
|
|
95
|
+
export const codecregistry_setDefault: (a: number, b: number, c: number, d: number) => void;
|
|
96
|
+
export const connectoptions_addBackupUrl: (a: number, b: number, c: number) => void;
|
|
97
|
+
export const connectoptions_addUserProperty: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
98
|
+
export const connectoptions_authenticationMethod: (a: number, b: number) => void;
|
|
99
|
+
export const connectoptions_cleanStart: (a: number) => number;
|
|
100
|
+
export const connectoptions_clearBackupUrls: (a: number) => void;
|
|
101
|
+
export const connectoptions_clearCodecRegistry: (a: number) => void;
|
|
102
|
+
export const connectoptions_clearUserProperties: (a: number) => void;
|
|
103
|
+
export const connectoptions_clearWill: (a: number) => void;
|
|
104
|
+
export const connectoptions_getBackupUrls: (a: number, b: number) => void;
|
|
105
|
+
export const connectoptions_keepAlive: (a: number) => number;
|
|
106
|
+
export const connectoptions_maximumPacketSize: (a: number) => number;
|
|
107
|
+
export const connectoptions_new: () => number;
|
|
108
|
+
export const connectoptions_protocolVersion: (a: number) => number;
|
|
109
|
+
export const connectoptions_receiveMaximum: (a: number) => number;
|
|
110
|
+
export const connectoptions_requestProblemInformation: (a: number) => number;
|
|
111
|
+
export const connectoptions_requestResponseInformation: (a: number) => number;
|
|
112
|
+
export const connectoptions_sessionExpiryInterval: (a: number) => number;
|
|
113
|
+
export const connectoptions_setCodecRegistry: (a: number, b: number) => void;
|
|
114
|
+
export const connectoptions_setWill: (a: number, b: number) => void;
|
|
115
|
+
export const connectoptions_set_authenticationData: (a: number, b: number, c: number) => void;
|
|
116
|
+
export const connectoptions_set_authenticationMethod: (a: number, b: number, c: number) => void;
|
|
117
|
+
export const connectoptions_set_cleanStart: (a: number, b: number) => void;
|
|
118
|
+
export const connectoptions_set_keepAlive: (a: number, b: number) => void;
|
|
119
|
+
export const connectoptions_set_maximumPacketSize: (a: number, b: number) => void;
|
|
120
|
+
export const connectoptions_set_password: (a: number, b: number, c: number) => void;
|
|
121
|
+
export const connectoptions_set_protocolVersion: (a: number, b: number) => void;
|
|
122
|
+
export const connectoptions_set_receiveMaximum: (a: number, b: number) => void;
|
|
123
|
+
export const connectoptions_set_requestProblemInformation: (a: number, b: number) => void;
|
|
124
|
+
export const connectoptions_set_requestResponseInformation: (a: number, b: number) => void;
|
|
125
|
+
export const connectoptions_set_sessionExpiryInterval: (a: number, b: number) => void;
|
|
126
|
+
export const connectoptions_set_topicAliasMaximum: (a: number, b: number) => void;
|
|
127
|
+
export const connectoptions_set_username: (a: number, b: number, c: number) => void;
|
|
128
|
+
export const connectoptions_topicAliasMaximum: (a: number) => number;
|
|
129
|
+
export const connectoptions_username: (a: number, b: number) => void;
|
|
130
|
+
export const createDeflateCodec: (a: number, b: number) => number;
|
|
131
|
+
export const deflatecodec_new: () => number;
|
|
132
|
+
export const deflatecodec_withLevel: (a: number, b: number) => number;
|
|
133
|
+
export const deflatecodec_withMaxDecompressedSize: (a: number, b: number) => number;
|
|
134
|
+
export const deflatecodec_withMinSize: (a: number, b: number) => number;
|
|
135
|
+
export const messageproperties_contentType: (a: number, b: number) => void;
|
|
136
|
+
export const messageproperties_correlationData: (a: number, b: number) => void;
|
|
137
|
+
export const messageproperties_getUserProperties: (a: number) => number;
|
|
138
|
+
export const messageproperties_messageExpiryInterval: (a: number) => number;
|
|
139
|
+
export const messageproperties_payloadFormatIndicator: (a: number) => number;
|
|
140
|
+
export const messageproperties_responseTopic: (a: number, b: number) => void;
|
|
141
|
+
export const messageproperties_subscriptionIdentifiers: (a: number, b: number) => void;
|
|
142
|
+
export const mqttclient_connect: (a: number, b: number, c: number) => number;
|
|
143
|
+
export const mqttclient_connectBroadcastChannel: (a: number, b: number, c: number) => number;
|
|
144
|
+
export const mqttclient_connectMessagePort: (a: number, b: number) => number;
|
|
145
|
+
export const mqttclient_connectMessagePortWithOptions: (a: number, b: number, c: number) => number;
|
|
146
|
+
export const mqttclient_connectWithOptions: (a: number, b: number, c: number, d: number) => number;
|
|
147
|
+
export const mqttclient_destroy: (a: number) => void;
|
|
148
|
+
export const mqttclient_disconnect: (a: number) => number;
|
|
149
|
+
export const mqttclient_enableAutoReconnect: (a: number, b: number) => void;
|
|
150
|
+
export const mqttclient_isBrowserOnline: (a: number) => number;
|
|
151
|
+
export const mqttclient_isConnected: (a: number) => number;
|
|
152
|
+
export const mqttclient_isReconnecting: (a: number) => number;
|
|
153
|
+
export const mqttclient_new: (a: number, b: number) => number;
|
|
154
|
+
export const mqttclient_onAuthChallenge: (a: number, b: number) => void;
|
|
155
|
+
export const mqttclient_onConnect: (a: number, b: number) => void;
|
|
156
|
+
export const mqttclient_onConnectivityChange: (a: number, b: number) => void;
|
|
157
|
+
export const mqttclient_onDisconnect: (a: number, b: number) => void;
|
|
158
|
+
export const mqttclient_onError: (a: number, b: number) => void;
|
|
159
|
+
export const mqttclient_onReconnectFailed: (a: number, b: number) => void;
|
|
160
|
+
export const mqttclient_onReconnecting: (a: number, b: number) => void;
|
|
161
|
+
export const mqttclient_publish: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
162
|
+
export const mqttclient_publishQos1: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
163
|
+
export const mqttclient_publishQos2: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
164
|
+
export const mqttclient_publishWithOptions: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
165
|
+
export const mqttclient_respondAuth: (a: number, b: number, c: number, d: number) => void;
|
|
166
|
+
export const mqttclient_setReconnectOptions: (a: number, b: number) => void;
|
|
167
|
+
export const mqttclient_subscribe: (a: number, b: number, c: number) => number;
|
|
168
|
+
export const mqttclient_subscribeWithCallback: (a: number, b: number, c: number, d: number) => number;
|
|
169
|
+
export const mqttclient_subscribeWithOptions: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
170
|
+
export const mqttclient_unsubscribe: (a: number, b: number, c: number) => number;
|
|
171
|
+
export const publishoptions_addUserProperty: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
172
|
+
export const publishoptions_clearUserProperties: (a: number) => void;
|
|
173
|
+
export const publishoptions_contentType: (a: number, b: number) => void;
|
|
174
|
+
export const publishoptions_messageExpiryInterval: (a: number) => number;
|
|
175
|
+
export const publishoptions_new: () => number;
|
|
176
|
+
export const publishoptions_payloadFormatIndicator: (a: number) => number;
|
|
177
|
+
export const publishoptions_qos: (a: number) => number;
|
|
178
|
+
export const publishoptions_responseTopic: (a: number, b: number) => void;
|
|
179
|
+
export const publishoptions_retain: (a: number) => number;
|
|
180
|
+
export const publishoptions_set_contentType: (a: number, b: number, c: number) => void;
|
|
181
|
+
export const publishoptions_set_correlationData: (a: number, b: number, c: number) => void;
|
|
182
|
+
export const publishoptions_set_messageExpiryInterval: (a: number, b: number) => void;
|
|
183
|
+
export const publishoptions_set_payloadFormatIndicator: (a: number, b: number) => void;
|
|
184
|
+
export const publishoptions_set_qos: (a: number, b: number) => void;
|
|
185
|
+
export const publishoptions_set_responseTopic: (a: number, b: number, c: number) => void;
|
|
186
|
+
export const publishoptions_set_retain: (a: number, b: number) => void;
|
|
187
|
+
export const publishoptions_set_topicAlias: (a: number, b: number) => void;
|
|
188
|
+
export const publishoptions_topicAlias: (a: number) => number;
|
|
189
|
+
export const reconnectoptions_backoffFactor: (a: number) => number;
|
|
190
|
+
export const reconnectoptions_disabled: () => number;
|
|
191
|
+
export const reconnectoptions_enabled: (a: number) => number;
|
|
192
|
+
export const reconnectoptions_initialDelayMs: (a: number) => number;
|
|
193
|
+
export const reconnectoptions_maxAttempts: (a: number) => number;
|
|
194
|
+
export const reconnectoptions_maxDelayMs: (a: number) => number;
|
|
195
|
+
export const reconnectoptions_new: () => number;
|
|
196
|
+
export const reconnectoptions_set_backoffFactor: (a: number, b: number) => void;
|
|
197
|
+
export const reconnectoptions_set_enabled: (a: number, b: number) => void;
|
|
198
|
+
export const reconnectoptions_set_initialDelayMs: (a: number, b: number) => void;
|
|
199
|
+
export const reconnectoptions_set_maxAttempts: (a: number, b: number) => void;
|
|
200
|
+
export const reconnectoptions_set_maxDelayMs: (a: number, b: number) => void;
|
|
201
|
+
export const subscribeoptions_new: () => number;
|
|
202
|
+
export const subscribeoptions_noLocal: (a: number) => number;
|
|
203
|
+
export const subscribeoptions_qos: (a: number) => number;
|
|
204
|
+
export const subscribeoptions_retainAsPublished: (a: number) => number;
|
|
205
|
+
export const subscribeoptions_retainHandling: (a: number) => number;
|
|
206
|
+
export const subscribeoptions_set_noLocal: (a: number, b: number) => void;
|
|
207
|
+
export const subscribeoptions_set_qos: (a: number, b: number) => void;
|
|
208
|
+
export const subscribeoptions_set_retainAsPublished: (a: number, b: number) => void;
|
|
209
|
+
export const subscribeoptions_set_retainHandling: (a: number, b: number) => void;
|
|
210
|
+
export const subscribeoptions_set_subscriptionIdentifier: (a: number, b: number) => void;
|
|
211
|
+
export const subscribeoptions_subscriptionIdentifier: (a: number) => number;
|
|
212
|
+
export const topicmapping_new: (a: number, b: number, c: number) => number;
|
|
213
|
+
export const topicmapping_set_localPrefix: (a: number, b: number, c: number) => void;
|
|
214
|
+
export const topicmapping_set_qos: (a: number, b: number) => void;
|
|
215
|
+
export const topicmapping_set_remotePrefix: (a: number, b: number, c: number) => void;
|
|
216
|
+
export const willmessage_contentType: (a: number, b: number) => void;
|
|
217
|
+
export const willmessage_messageExpiryInterval: (a: number) => number;
|
|
218
|
+
export const willmessage_new: (a: number, b: number, c: number, d: number) => number;
|
|
219
|
+
export const willmessage_qos: (a: number) => number;
|
|
220
|
+
export const willmessage_responseTopic: (a: number, b: number) => void;
|
|
221
|
+
export const willmessage_retain: (a: number) => number;
|
|
222
|
+
export const willmessage_set_contentType: (a: number, b: number, c: number) => void;
|
|
223
|
+
export const willmessage_set_messageExpiryInterval: (a: number, b: number) => void;
|
|
224
|
+
export const willmessage_set_qos: (a: number, b: number) => void;
|
|
225
|
+
export const willmessage_set_responseTopic: (a: number, b: number, c: number) => void;
|
|
226
|
+
export const willmessage_set_retain: (a: number, b: number) => void;
|
|
227
|
+
export const willmessage_set_topic: (a: number, b: number, c: number) => void;
|
|
228
|
+
export const willmessage_set_willDelayInterval: (a: number, b: number) => void;
|
|
229
|
+
export const willmessage_topic: (a: number, b: number) => void;
|
|
230
|
+
export const willmessage_willDelayInterval: (a: number) => number;
|
|
231
|
+
export const createCodecRegistry: () => number;
|
|
232
|
+
export const gzipcodec_withLevel: (a: number, b: number) => number;
|
|
233
|
+
export const gzipcodec_new: () => number;
|
|
234
|
+
export const createGzipCodec: (a: number, b: number) => number;
|
|
235
|
+
export const __wbg_gzipcodec_free: (a: number, b: number) => void;
|
|
236
|
+
export const gzipcodec_withMinSize: (a: number, b: number) => number;
|
|
237
|
+
export const gzipcodec_withMaxDecompressedSize: (a: number, b: number) => number;
|
|
238
|
+
export const __wasm_bindgen_func_elem_2610: (a: number, b: number) => void;
|
|
239
|
+
export const __wasm_bindgen_func_elem_2770: (a: number, b: number) => void;
|
|
240
|
+
export const __wasm_bindgen_func_elem_183: (a: number, b: number) => void;
|
|
241
|
+
export const __wasm_bindgen_func_elem_4240: (a: number, b: number, c: number, d: number) => void;
|
|
242
|
+
export const __wasm_bindgen_func_elem_4252: (a: number, b: number, c: number, d: number) => void;
|
|
243
|
+
export const __wasm_bindgen_func_elem_1047: (a: number, b: number, c: number) => void;
|
|
244
|
+
export const __wasm_bindgen_func_elem_1047_3: (a: number, b: number, c: number) => void;
|
|
245
|
+
export const __wasm_bindgen_func_elem_1047_4: (a: number, b: number, c: number) => void;
|
|
246
|
+
export const __wasm_bindgen_func_elem_1047_5: (a: number, b: number, c: number) => void;
|
|
247
|
+
export const __wasm_bindgen_func_elem_2630: (a: number, b: number) => void;
|
|
248
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
249
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
250
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
251
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
252
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mqtt5-wasm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"description": "MQTT v5.0 WebAssembly client and broker for browser environments",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -11,10 +11,14 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"mqtt5_wasm_bg.wasm",
|
|
13
13
|
"mqtt5_wasm.js",
|
|
14
|
-
"mqtt5_wasm.d.ts"
|
|
14
|
+
"mqtt5_wasm.d.ts",
|
|
15
|
+
"mqtt5_wasm_bg.wasm.d.ts"
|
|
15
16
|
],
|
|
16
17
|
"main": "mqtt5_wasm.js",
|
|
17
18
|
"types": "mqtt5_wasm.d.ts",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"./mqtt5_wasm.js"
|
|
21
|
+
],
|
|
18
22
|
"keywords": [
|
|
19
23
|
"mqtt",
|
|
20
24
|
"wasm",
|