@automerge/subduction 0.8.0-alpha.1 → 0.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/dist/cjs/wasm-base64.cjs +1 -1
- package/dist/cjs/web-bindings.cjs +308 -87
- package/dist/cjs/web.cjs +309 -88
- package/dist/esm/wasm-base64.js +1 -1
- package/dist/iife/index.js +309 -88
- package/dist/index.d.ts +87 -24
- package/dist/subduction.wasm +0 -0
- package/dist/wasm_bindgen/bundler/snippets/subduction_wasm-0ed7fd66cebca59f/inline0.js +9 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm.d.ts +87 -24
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.js +294 -96
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm.d.ts +28 -20
- package/dist/wasm_bindgen/nodejs/snippets/subduction_wasm-0ed7fd66cebca59f/inline0.js +9 -0
- package/dist/wasm_bindgen/nodejs/subduction_wasm.cjs +296 -96
- package/dist/wasm_bindgen/nodejs/subduction_wasm.d.ts +87 -24
- package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm.d.ts +28 -20
- package/dist/wasm_bindgen/web/snippets/subduction_wasm-0ed7fd66cebca59f/inline0.js +9 -0
- package/dist/wasm_bindgen/web/subduction_wasm.d.ts +115 -44
- package/dist/wasm_bindgen/web/subduction_wasm.js +296 -96
- package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm.d.ts +28 -20
- package/package.json +1 -1
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline0.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline1.js +0 -0
- /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline2.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline0.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline1.js +0 -0
- /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline2.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline0.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline1.js +0 -0
- /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-68c0499598a3382c → sedimentree_wasm-1de4a01519b0f11f}/inline2.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-
|
|
1
|
+
import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-1de4a01519b0f11f/inline2.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* An authenticated HTTP long-poll transport.
|
|
@@ -73,23 +73,30 @@ if (Symbol.dispose) AuthenticatedLongPoll.prototype[Symbol.dispose] = Authentica
|
|
|
73
73
|
* There are three ways to obtain an `AuthenticatedTransport`:
|
|
74
74
|
*
|
|
75
75
|
* 1. **Custom transport** — implement the `Transport` interface
|
|
76
|
-
* (`sendBytes`/`recvBytes`/`disconnect`) and call
|
|
76
|
+
* (`sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`) and call
|
|
77
|
+
* [`setup`](Self::setup):
|
|
77
78
|
*
|
|
78
79
|
* ```js
|
|
79
|
-
* const auth = await AuthenticatedTransport.setup(myTransport, signer, peerId)
|
|
80
|
+
* const auth = await AuthenticatedTransport.setup(myTransport, signer, peerId, (peerId) => {
|
|
81
|
+
* console.log(`${peerId} disconnected`);
|
|
82
|
+
* });
|
|
80
83
|
* ```
|
|
81
84
|
*
|
|
82
85
|
* 2. **From WebSocket** — authenticate via [`SubductionWebSocket`] then convert:
|
|
83
86
|
*
|
|
84
87
|
* ```js
|
|
85
|
-
* const wsAuth = await SubductionWebSocket.tryConnect(url, signer, peerId,
|
|
88
|
+
* const wsAuth = await SubductionWebSocket.tryConnect(url, signer, peerId, (peerId) => {
|
|
89
|
+
* console.log(`${peerId} disconnected`);
|
|
90
|
+
* });
|
|
86
91
|
* const auth = wsAuth.toTransport();
|
|
87
92
|
* ```
|
|
88
93
|
*
|
|
89
94
|
* 3. **From HTTP long-poll** — same pattern via [`SubductionLongPoll`]:
|
|
90
95
|
*
|
|
91
96
|
* ```js
|
|
92
|
-
* const lpAuth = await SubductionLongPoll.tryConnect(url, signer, peerId,
|
|
97
|
+
* const lpAuth = await SubductionLongPoll.tryConnect(url, signer, peerId, (peerId) => {
|
|
98
|
+
* console.log(`${peerId} disconnected`);
|
|
99
|
+
* });
|
|
93
100
|
* const auth = lpAuth.toTransport();
|
|
94
101
|
* ```
|
|
95
102
|
*/
|
|
@@ -119,7 +126,7 @@ export class AuthenticatedTransport {
|
|
|
119
126
|
*
|
|
120
127
|
* # Arguments
|
|
121
128
|
*
|
|
122
|
-
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`
|
|
129
|
+
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`
|
|
123
130
|
* * `signer` - The responder's signer for authentication
|
|
124
131
|
* * `max_drift_seconds` - Maximum acceptable clock drift in seconds (default: 600)
|
|
125
132
|
*
|
|
@@ -129,10 +136,11 @@ export class AuthenticatedTransport {
|
|
|
129
136
|
* @param {Transport} transport
|
|
130
137
|
* @param {any} signer
|
|
131
138
|
* @param {number | null} [max_drift_seconds]
|
|
139
|
+
* @param {Function | null} [on_disconnect]
|
|
132
140
|
* @returns {Promise<AuthenticatedTransport>}
|
|
133
141
|
*/
|
|
134
|
-
static accept(transport, signer, max_drift_seconds) {
|
|
135
|
-
const ret = wasm.authenticatedtransport_accept(transport, signer, isLikeNone(max_drift_seconds) ? 0x100000001 : (max_drift_seconds) >>> 0);
|
|
142
|
+
static accept(transport, signer, max_drift_seconds, on_disconnect) {
|
|
143
|
+
const ret = wasm.authenticatedtransport_accept(transport, signer, isLikeNone(max_drift_seconds) ? 0x100000001 : (max_drift_seconds) >>> 0, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
136
144
|
return ret;
|
|
137
145
|
}
|
|
138
146
|
/**
|
|
@@ -148,13 +156,13 @@ export class AuthenticatedTransport {
|
|
|
148
156
|
* authenticated transport.
|
|
149
157
|
*
|
|
150
158
|
* The `transport` object must implement the `Transport` interface
|
|
151
|
-
* (`sendBytes`/`recvBytes`/`disconnect`).
|
|
159
|
+
* (`sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`).
|
|
152
160
|
* The same object is used for both the handshake phase and post-handshake
|
|
153
161
|
* communication.
|
|
154
162
|
*
|
|
155
163
|
* # Arguments
|
|
156
164
|
*
|
|
157
|
-
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`
|
|
165
|
+
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`
|
|
158
166
|
* * `signer` - The client's signer for authentication
|
|
159
167
|
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
160
168
|
*
|
|
@@ -164,11 +172,12 @@ export class AuthenticatedTransport {
|
|
|
164
172
|
* @param {Transport} transport
|
|
165
173
|
* @param {any} signer
|
|
166
174
|
* @param {PeerId} expected_peer_id
|
|
175
|
+
* @param {Function | null} [on_disconnect]
|
|
167
176
|
* @returns {Promise<AuthenticatedTransport>}
|
|
168
177
|
*/
|
|
169
|
-
static setup(transport, signer, expected_peer_id) {
|
|
178
|
+
static setup(transport, signer, expected_peer_id, on_disconnect) {
|
|
170
179
|
_assertClass(expected_peer_id, PeerId);
|
|
171
|
-
const ret = wasm.authenticatedtransport_setup(transport, signer, expected_peer_id.__wbg_ptr);
|
|
180
|
+
const ret = wasm.authenticatedtransport_setup(transport, signer, expected_peer_id.__wbg_ptr, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
172
181
|
return ret;
|
|
173
182
|
}
|
|
174
183
|
/**
|
|
@@ -181,7 +190,7 @@ export class AuthenticatedTransport {
|
|
|
181
190
|
*
|
|
182
191
|
* # Arguments
|
|
183
192
|
*
|
|
184
|
-
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`
|
|
193
|
+
* * `transport` - A `Transport` implementing `sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`
|
|
185
194
|
* * `signer` - The client's signer for authentication
|
|
186
195
|
* * `service_name` - Shared service name for discovery.
|
|
187
196
|
* Defaults to [`DEFAULT_LOCAL_SERVICE_NAME`] (`"subduction:local"`) if omitted.
|
|
@@ -192,12 +201,13 @@ export class AuthenticatedTransport {
|
|
|
192
201
|
* @param {Transport} transport
|
|
193
202
|
* @param {any} signer
|
|
194
203
|
* @param {string | null} [service_name]
|
|
204
|
+
* @param {Function | null} [on_disconnect]
|
|
195
205
|
* @returns {Promise<AuthenticatedTransport>}
|
|
196
206
|
*/
|
|
197
|
-
static setupDiscover(transport, signer, service_name) {
|
|
207
|
+
static setupDiscover(transport, signer, service_name, on_disconnect) {
|
|
198
208
|
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
199
209
|
var len0 = WASM_VECTOR_LEN;
|
|
200
|
-
const ret = wasm.authenticatedtransport_setupDiscover(transport, signer, ptr0, len0);
|
|
210
|
+
const ret = wasm.authenticatedtransport_setupDiscover(transport, signer, ptr0, len0, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
201
211
|
return ret;
|
|
202
212
|
}
|
|
203
213
|
}
|
|
@@ -1359,7 +1369,7 @@ export class MessagePortTransport {
|
|
|
1359
1369
|
wasm.__wbg_messageporttransport_free(ptr, 0);
|
|
1360
1370
|
}
|
|
1361
1371
|
/**
|
|
1362
|
-
* Disconnect (close the port).
|
|
1372
|
+
* Disconnect (close the port) and fire the `onDisconnect` callback if registered.
|
|
1363
1373
|
* @returns {Promise<any>}
|
|
1364
1374
|
*/
|
|
1365
1375
|
disconnect() {
|
|
@@ -1376,6 +1386,16 @@ export class MessagePortTransport {
|
|
|
1376
1386
|
MessagePortTransportFinalization.register(this, this.__wbg_ptr, this);
|
|
1377
1387
|
return this;
|
|
1378
1388
|
}
|
|
1389
|
+
/**
|
|
1390
|
+
* Register a callback to be invoked when the transport disconnects.
|
|
1391
|
+
*
|
|
1392
|
+
* Part of the [`Transport`](super::JsTransport) interface contract.
|
|
1393
|
+
* Typically called by internal wiring rather than directly by user code.
|
|
1394
|
+
* @param {Function} callback
|
|
1395
|
+
*/
|
|
1396
|
+
onDisconnect(callback) {
|
|
1397
|
+
wasm.messageporttransport_onDisconnect(this.__wbg_ptr, callback);
|
|
1398
|
+
}
|
|
1379
1399
|
/**
|
|
1380
1400
|
* Receive raw bytes (for the handshake phase).
|
|
1381
1401
|
* @returns {Promise<any>}
|
|
@@ -2403,12 +2423,15 @@ export class Subduction {
|
|
|
2403
2423
|
* @param {string | null} [service_name]
|
|
2404
2424
|
* @param {(digest: Digest) => Depth | null} [hash_metric_override]
|
|
2405
2425
|
* @param {number | null} [max_pending_blob_requests]
|
|
2426
|
+
* @param {any | null} [policy]
|
|
2427
|
+
* @param {Function | null} [on_remote_heads]
|
|
2428
|
+
* @param {Function | null} [on_ephemeral]
|
|
2406
2429
|
* @returns {Promise<Subduction>}
|
|
2407
2430
|
*/
|
|
2408
|
-
static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests) {
|
|
2431
|
+
static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
|
|
2409
2432
|
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2410
2433
|
var len0 = WASM_VECTOR_LEN;
|
|
2411
|
-
const ret = wasm.subduction_hydrate(signer, storage, ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addToExternrefTable0(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 0x100000001 : (max_pending_blob_requests) >>> 0);
|
|
2434
|
+
const ret = wasm.subduction_hydrate(signer, storage, ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addToExternrefTable0(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 0x100000001 : (max_pending_blob_requests) >>> 0, isLikeNone(policy) ? 0 : addToExternrefTable0(policy), isLikeNone(on_remote_heads) ? 0 : addToExternrefTable0(on_remote_heads), isLikeNone(on_ephemeral) ? 0 : addToExternrefTable0(on_ephemeral));
|
|
2412
2435
|
return ret;
|
|
2413
2436
|
}
|
|
2414
2437
|
/**
|
|
@@ -2443,6 +2466,9 @@ export class Subduction {
|
|
|
2443
2466
|
* When set, clients can connect without knowing the server's peer ID.
|
|
2444
2467
|
* * `hash_metric_override` - Optional custom depth metric function
|
|
2445
2468
|
* * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
|
|
2469
|
+
* * `policy` - Optional JS object implementing authorization.
|
|
2470
|
+
* Must have `authorizeConnect(...)`, `authorizeFetch(...)`, `authorizePut(...)`,
|
|
2471
|
+
* `filterAuthorizedFetch(...)`. Defaults to allow-all.
|
|
2446
2472
|
*
|
|
2447
2473
|
* # Panics
|
|
2448
2474
|
*
|
|
@@ -2453,15 +2479,34 @@ export class Subduction {
|
|
|
2453
2479
|
* @param {string | null} [service_name]
|
|
2454
2480
|
* @param {(digest: Digest) => Depth | null} [hash_metric_override]
|
|
2455
2481
|
* @param {number | null} [max_pending_blob_requests]
|
|
2482
|
+
* @param {any | null} [policy]
|
|
2483
|
+
* @param {Function | null} [on_remote_heads]
|
|
2484
|
+
* @param {Function | null} [on_ephemeral]
|
|
2456
2485
|
*/
|
|
2457
|
-
constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests) {
|
|
2486
|
+
constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
|
|
2458
2487
|
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2459
2488
|
var len0 = WASM_VECTOR_LEN;
|
|
2460
|
-
const ret = wasm.subduction_new(signer, storage, ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addToExternrefTable0(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 0x100000001 : (max_pending_blob_requests) >>> 0);
|
|
2489
|
+
const ret = wasm.subduction_new(signer, storage, ptr0, len0, isLikeNone(hash_metric_override) ? 0 : addToExternrefTable0(hash_metric_override), isLikeNone(max_pending_blob_requests) ? 0x100000001 : (max_pending_blob_requests) >>> 0, isLikeNone(policy) ? 0 : addToExternrefTable0(policy), isLikeNone(on_remote_heads) ? 0 : addToExternrefTable0(on_remote_heads), isLikeNone(on_ephemeral) ? 0 : addToExternrefTable0(on_ephemeral));
|
|
2461
2490
|
this.__wbg_ptr = ret >>> 0;
|
|
2462
2491
|
SubductionFinalization.register(this, this.__wbg_ptr, this);
|
|
2463
2492
|
return this;
|
|
2464
2493
|
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Publish an ephemeral message to all subscribers of a sedimentree.
|
|
2496
|
+
*
|
|
2497
|
+
* The payload is opaque bytes — encoding is the caller's responsibility.
|
|
2498
|
+
* Messages are fire-and-forget; delivery is best-effort.
|
|
2499
|
+
* @param {SedimentreeId} id
|
|
2500
|
+
* @param {Uint8Array} payload
|
|
2501
|
+
* @returns {Promise<void>}
|
|
2502
|
+
*/
|
|
2503
|
+
publishEphemeral(id, payload) {
|
|
2504
|
+
_assertClass(id, SedimentreeId);
|
|
2505
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
|
|
2506
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2507
|
+
const ret = wasm.subduction_publishEphemeral(this.__wbg_ptr, id.__wbg_ptr, ptr0, len0);
|
|
2508
|
+
return ret;
|
|
2509
|
+
}
|
|
2465
2510
|
/**
|
|
2466
2511
|
* Remove a Sedimentree and all associated data.
|
|
2467
2512
|
*
|
|
@@ -2505,6 +2550,18 @@ export class Subduction {
|
|
|
2505
2550
|
const ret = wasm.subduction_storage(this.__wbg_ptr);
|
|
2506
2551
|
return ret;
|
|
2507
2552
|
}
|
|
2553
|
+
/**
|
|
2554
|
+
* Subscribe to ephemeral messages for the given sedimentree IDs
|
|
2555
|
+
* from all connected peers.
|
|
2556
|
+
* @param {SedimentreeId[]} ids
|
|
2557
|
+
* @returns {Promise<void>}
|
|
2558
|
+
*/
|
|
2559
|
+
subscribeEphemeral(ids) {
|
|
2560
|
+
const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
|
|
2561
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2562
|
+
const ret = wasm.subduction_subscribeEphemeral(this.__wbg_ptr, ptr0, len0);
|
|
2563
|
+
return ret;
|
|
2564
|
+
}
|
|
2508
2565
|
/**
|
|
2509
2566
|
* Request batch sync for a given Sedimentree ID from all connected peers.
|
|
2510
2567
|
*
|
|
@@ -2552,13 +2609,25 @@ export class Subduction {
|
|
|
2552
2609
|
const ret = wasm.subduction_syncWithPeer(this.__wbg_ptr, to_ask.__wbg_ptr, id.__wbg_ptr, subscribe, !isLikeNone(timeout_milliseconds), isLikeNone(timeout_milliseconds) ? BigInt(0) : timeout_milliseconds);
|
|
2553
2610
|
return ret;
|
|
2554
2611
|
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Unsubscribe from ephemeral messages for the given sedimentree IDs
|
|
2614
|
+
* from all connected peers.
|
|
2615
|
+
* @param {SedimentreeId[]} ids
|
|
2616
|
+
* @returns {Promise<void>}
|
|
2617
|
+
*/
|
|
2618
|
+
unsubscribeEphemeral(ids) {
|
|
2619
|
+
const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
|
|
2620
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2621
|
+
const ret = wasm.subduction_unsubscribeEphemeral(this.__wbg_ptr, ptr0, len0);
|
|
2622
|
+
return ret;
|
|
2623
|
+
}
|
|
2555
2624
|
}
|
|
2556
2625
|
if (Symbol.dispose) Subduction.prototype[Symbol.dispose] = Subduction.prototype.free;
|
|
2557
2626
|
|
|
2558
2627
|
/**
|
|
2559
2628
|
* JS-facing wrapper around [`HttpLongPollTransport`] that exposes the
|
|
2560
2629
|
* byte-oriented [`Transport`](super::JsTransport) interface
|
|
2561
|
-
* (`sendBytes`/`recvBytes`/`disconnect`) so it can be used as a
|
|
2630
|
+
* (`sendBytes`/`recvBytes`/`disconnect`/`onDisconnect`) so it can be used as a
|
|
2562
2631
|
* duck-typed `JsTransport` from JavaScript.
|
|
2563
2632
|
*/
|
|
2564
2633
|
export class SubductionHttpLongPoll {
|
|
@@ -2582,6 +2651,8 @@ export class SubductionHttpLongPoll {
|
|
|
2582
2651
|
/**
|
|
2583
2652
|
* Disconnect from the peer gracefully.
|
|
2584
2653
|
*
|
|
2654
|
+
* Fires the `onDisconnect` callback if one is registered.
|
|
2655
|
+
*
|
|
2585
2656
|
* # Errors
|
|
2586
2657
|
*
|
|
2587
2658
|
* Returns an error if the disconnect fails.
|
|
@@ -2591,6 +2662,16 @@ export class SubductionHttpLongPoll {
|
|
|
2591
2662
|
const ret = wasm.subductionhttplongpoll_disconnect(this.__wbg_ptr);
|
|
2592
2663
|
return ret;
|
|
2593
2664
|
}
|
|
2665
|
+
/**
|
|
2666
|
+
* Register a callback to be invoked when the transport disconnects.
|
|
2667
|
+
*
|
|
2668
|
+
* Part of the [`Transport`](super::JsTransport) interface contract.
|
|
2669
|
+
* Typically called by internal wiring rather than directly by user code.
|
|
2670
|
+
* @param {Function} callback
|
|
2671
|
+
*/
|
|
2672
|
+
onDisconnect(callback) {
|
|
2673
|
+
wasm.subductionhttplongpoll_onDisconnect(this.__wbg_ptr, callback);
|
|
2674
|
+
}
|
|
2594
2675
|
/**
|
|
2595
2676
|
* Receive the next message frame as raw bytes.
|
|
2596
2677
|
*
|
|
@@ -2645,7 +2726,7 @@ export class SubductionLongPoll {
|
|
|
2645
2726
|
* * `base_url` - The server's HTTP base URL (e.g., `http://localhost:8080`)
|
|
2646
2727
|
* * `signer` - The client's signer for authentication
|
|
2647
2728
|
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2648
|
-
* * `
|
|
2729
|
+
* * `on_disconnect` - Optional callback invoked with the peer's [`PeerId`] when the connection closes
|
|
2649
2730
|
*
|
|
2650
2731
|
* # Errors
|
|
2651
2732
|
*
|
|
@@ -2653,13 +2734,14 @@ export class SubductionLongPoll {
|
|
|
2653
2734
|
* @param {string} base_url
|
|
2654
2735
|
* @param {any} signer
|
|
2655
2736
|
* @param {PeerId} expected_peer_id
|
|
2737
|
+
* @param {Function | null} [on_disconnect]
|
|
2656
2738
|
* @returns {Promise<AuthenticatedLongPoll>}
|
|
2657
2739
|
*/
|
|
2658
|
-
static tryConnect(base_url, signer, expected_peer_id) {
|
|
2740
|
+
static tryConnect(base_url, signer, expected_peer_id, on_disconnect) {
|
|
2659
2741
|
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2660
2742
|
const len0 = WASM_VECTOR_LEN;
|
|
2661
2743
|
_assertClass(expected_peer_id, PeerId);
|
|
2662
|
-
const ret = wasm.subductionlongpoll_tryConnect(ptr0, len0, signer, expected_peer_id.__wbg_ptr);
|
|
2744
|
+
const ret = wasm.subductionlongpoll_tryConnect(ptr0, len0, signer, expected_peer_id.__wbg_ptr, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
2663
2745
|
return ret;
|
|
2664
2746
|
}
|
|
2665
2747
|
/**
|
|
@@ -2677,14 +2759,15 @@ export class SubductionLongPoll {
|
|
|
2677
2759
|
* @param {string} base_url
|
|
2678
2760
|
* @param {any} signer
|
|
2679
2761
|
* @param {string | null} [service_name]
|
|
2762
|
+
* @param {Function | null} [on_disconnect]
|
|
2680
2763
|
* @returns {Promise<AuthenticatedLongPoll>}
|
|
2681
2764
|
*/
|
|
2682
|
-
static tryDiscover(base_url, signer, service_name) {
|
|
2765
|
+
static tryDiscover(base_url, signer, service_name, on_disconnect) {
|
|
2683
2766
|
const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2684
2767
|
const len0 = WASM_VECTOR_LEN;
|
|
2685
2768
|
var ptr1 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2686
2769
|
var len1 = WASM_VECTOR_LEN;
|
|
2687
|
-
const ret = wasm.subductionlongpoll_tryDiscover(ptr0, len0, signer, ptr1, len1);
|
|
2770
|
+
const ret = wasm.subductionlongpoll_tryDiscover(ptr0, len0, signer, ptr1, len1, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
2688
2771
|
return ret;
|
|
2689
2772
|
}
|
|
2690
2773
|
}
|
|
@@ -2724,6 +2807,19 @@ export class SubductionWebSocket {
|
|
|
2724
2807
|
const ret = wasm.subductionwebsocket_disconnect(this.__wbg_ptr);
|
|
2725
2808
|
return ret;
|
|
2726
2809
|
}
|
|
2810
|
+
/**
|
|
2811
|
+
* Register a callback to be invoked when the WebSocket closes.
|
|
2812
|
+
*
|
|
2813
|
+
* Part of the [`Transport`](super::JsTransport) interface contract.
|
|
2814
|
+
* Typically called by internal wiring (factory methods like `tryConnect`
|
|
2815
|
+
* and `tryDiscover`) rather than directly by user code.
|
|
2816
|
+
*
|
|
2817
|
+
* The callback is fired from the browser WebSocket's `onclose` handler.
|
|
2818
|
+
* @param {Function} callback
|
|
2819
|
+
*/
|
|
2820
|
+
onDisconnect(callback) {
|
|
2821
|
+
wasm.subductionwebsocket_onDisconnect(this.__wbg_ptr, callback);
|
|
2822
|
+
}
|
|
2727
2823
|
/**
|
|
2728
2824
|
* Receive the next message frame as raw bytes.
|
|
2729
2825
|
*
|
|
@@ -2762,7 +2858,7 @@ export class SubductionWebSocket {
|
|
|
2762
2858
|
* * `ws` - An existing WebSocket (CONNECTING or OPEN)
|
|
2763
2859
|
* * `signer` - The client's signer for authentication
|
|
2764
2860
|
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2765
|
-
* * `
|
|
2861
|
+
* * `on_disconnect` - Optional callback invoked with the peer's [`PeerId`] when the connection closes
|
|
2766
2862
|
*
|
|
2767
2863
|
* # Errors
|
|
2768
2864
|
*
|
|
@@ -2770,11 +2866,12 @@ export class SubductionWebSocket {
|
|
|
2770
2866
|
* @param {WebSocket} ws
|
|
2771
2867
|
* @param {any} signer
|
|
2772
2868
|
* @param {PeerId} expected_peer_id
|
|
2869
|
+
* @param {Function | null} [on_disconnect]
|
|
2773
2870
|
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2774
2871
|
*/
|
|
2775
|
-
static setup(ws, signer, expected_peer_id) {
|
|
2872
|
+
static setup(ws, signer, expected_peer_id, on_disconnect) {
|
|
2776
2873
|
_assertClass(expected_peer_id, PeerId);
|
|
2777
|
-
const ret = wasm.subductionwebsocket_setup(ws, signer, expected_peer_id.__wbg_ptr);
|
|
2874
|
+
const ret = wasm.subductionwebsocket_setup(ws, signer, expected_peer_id.__wbg_ptr, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
2778
2875
|
return ret;
|
|
2779
2876
|
}
|
|
2780
2877
|
/**
|
|
@@ -2785,6 +2882,8 @@ export class SubductionWebSocket {
|
|
|
2785
2882
|
* * `address` - The WebSocket URL to connect to
|
|
2786
2883
|
* * `signer` - The client's signer for authentication
|
|
2787
2884
|
* * `expected_peer_id` - The expected server peer ID (verified during handshake)
|
|
2885
|
+
* * `on_disconnect` - Optional callback invoked with the peer's [`PeerId`] when the connection closes
|
|
2886
|
+
*
|
|
2788
2887
|
* # Errors
|
|
2789
2888
|
*
|
|
2790
2889
|
* Returns an error if:
|
|
@@ -2793,11 +2892,12 @@ export class SubductionWebSocket {
|
|
|
2793
2892
|
* @param {URL} address
|
|
2794
2893
|
* @param {any} signer
|
|
2795
2894
|
* @param {PeerId} expected_peer_id
|
|
2895
|
+
* @param {Function | null} [on_disconnect]
|
|
2796
2896
|
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2797
2897
|
*/
|
|
2798
|
-
static tryConnect(address, signer, expected_peer_id) {
|
|
2898
|
+
static tryConnect(address, signer, expected_peer_id, on_disconnect) {
|
|
2799
2899
|
_assertClass(expected_peer_id, PeerId);
|
|
2800
|
-
const ret = wasm.subductionwebsocket_tryConnect(address, signer, expected_peer_id.__wbg_ptr);
|
|
2900
|
+
const ret = wasm.subductionwebsocket_tryConnect(address, signer, expected_peer_id.__wbg_ptr, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
2801
2901
|
return ret;
|
|
2802
2902
|
}
|
|
2803
2903
|
/**
|
|
@@ -2811,9 +2911,9 @@ export class SubductionWebSocket {
|
|
|
2811
2911
|
*
|
|
2812
2912
|
* * `address` - The WebSocket URL to connect to
|
|
2813
2913
|
* * `signer` - The client's signer for authentication
|
|
2814
|
-
* * `timeout_milliseconds` - Request timeout in milliseconds. Defaults to 30000 (30s).
|
|
2815
2914
|
* * `service_name` - The service name for discovery (e.g., `localhost:8080`).
|
|
2816
2915
|
* If omitted, the host is extracted from the URL.
|
|
2916
|
+
* * `on_disconnect` - Optional callback invoked with the peer's [`PeerId`] when the connection closes
|
|
2817
2917
|
*
|
|
2818
2918
|
* # Errors
|
|
2819
2919
|
*
|
|
@@ -2823,12 +2923,13 @@ export class SubductionWebSocket {
|
|
|
2823
2923
|
* @param {URL} address
|
|
2824
2924
|
* @param {any} signer
|
|
2825
2925
|
* @param {string | null} [service_name]
|
|
2926
|
+
* @param {Function | null} [on_disconnect]
|
|
2826
2927
|
* @returns {Promise<AuthenticatedWebSocket>}
|
|
2827
2928
|
*/
|
|
2828
|
-
static tryDiscover(address, signer, service_name) {
|
|
2929
|
+
static tryDiscover(address, signer, service_name, on_disconnect) {
|
|
2829
2930
|
var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2830
2931
|
var len0 = WASM_VECTOR_LEN;
|
|
2831
|
-
const ret = wasm.subductionwebsocket_tryDiscover(address, signer, ptr0, len0);
|
|
2932
|
+
const ret = wasm.subductionwebsocket_tryDiscover(address, signer, ptr0, len0, isLikeNone(on_disconnect) ? 0 : addToExternrefTable0(on_disconnect));
|
|
2832
2933
|
return ret;
|
|
2833
2934
|
}
|
|
2834
2935
|
}
|
|
@@ -3091,13 +3192,26 @@ export class SyncStats {
|
|
|
3091
3192
|
return ret >>> 0;
|
|
3092
3193
|
}
|
|
3093
3194
|
/**
|
|
3094
|
-
* Returns true if no
|
|
3195
|
+
* Returns true if no commits or fragments were transferred.
|
|
3196
|
+
*
|
|
3197
|
+
* Note: `remoteHeads` may still be non-empty (heads metadata is not
|
|
3198
|
+
* considered "data" for this check).
|
|
3095
3199
|
* @returns {boolean}
|
|
3096
3200
|
*/
|
|
3097
3201
|
get isEmpty() {
|
|
3098
3202
|
const ret = wasm.syncstats_isEmpty(this.__wbg_ptr);
|
|
3099
3203
|
return ret !== 0;
|
|
3100
3204
|
}
|
|
3205
|
+
/**
|
|
3206
|
+
* The remote peer's heads for this sedimentree.
|
|
3207
|
+
* @returns {Digest[]}
|
|
3208
|
+
*/
|
|
3209
|
+
get remoteHeads() {
|
|
3210
|
+
const ret = wasm.syncstats_remoteHeads(this.__wbg_ptr);
|
|
3211
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
3212
|
+
wasm.__wbindgen_export5(ret[0], ret[1] * 4, 4);
|
|
3213
|
+
return v1;
|
|
3214
|
+
}
|
|
3101
3215
|
/**
|
|
3102
3216
|
* Total items received (commits + fragments).
|
|
3103
3217
|
* @returns {number}
|
|
@@ -3222,37 +3336,37 @@ export function makeMessagePortTransport(port) {
|
|
|
3222
3336
|
export function start() {
|
|
3223
3337
|
wasm.start();
|
|
3224
3338
|
}
|
|
3225
|
-
export function
|
|
3339
|
+
export function __wbg___wasm_refgen_toWasmCommitWithBlob_4c1dc5cc453af7eb(arg0) {
|
|
3226
3340
|
const ret = arg0.__wasm_refgen_toWasmCommitWithBlob();
|
|
3227
3341
|
_assertClass(ret, CommitWithBlob);
|
|
3228
3342
|
var ptr1 = ret.__destroy_into_raw();
|
|
3229
3343
|
return ptr1;
|
|
3230
3344
|
}
|
|
3231
|
-
export function
|
|
3345
|
+
export function __wbg___wasm_refgen_toWasmDepth_e11bce6176c8257e(arg0) {
|
|
3232
3346
|
const ret = arg0.__wasm_refgen_toWasmDepth();
|
|
3233
3347
|
_assertClass(ret, Depth);
|
|
3234
3348
|
var ptr1 = ret.__destroy_into_raw();
|
|
3235
3349
|
return ptr1;
|
|
3236
3350
|
}
|
|
3237
|
-
export function
|
|
3351
|
+
export function __wbg___wasm_refgen_toWasmDigest_86d449f5dc99fc6a(arg0) {
|
|
3238
3352
|
const ret = arg0.__wasm_refgen_toWasmDigest();
|
|
3239
3353
|
_assertClass(ret, Digest);
|
|
3240
3354
|
var ptr1 = ret.__destroy_into_raw();
|
|
3241
3355
|
return ptr1;
|
|
3242
3356
|
}
|
|
3243
|
-
export function
|
|
3357
|
+
export function __wbg___wasm_refgen_toWasmFragmentWithBlob_d7450dc251166eea(arg0) {
|
|
3244
3358
|
const ret = arg0.__wasm_refgen_toWasmFragmentWithBlob();
|
|
3245
3359
|
_assertClass(ret, FragmentWithBlob);
|
|
3246
3360
|
var ptr1 = ret.__destroy_into_raw();
|
|
3247
3361
|
return ptr1;
|
|
3248
3362
|
}
|
|
3249
|
-
export function
|
|
3363
|
+
export function __wbg___wasm_refgen_toWasmFragment_03b5e19d20693b4f(arg0) {
|
|
3250
3364
|
const ret = arg0.__wasm_refgen_toWasmFragment();
|
|
3251
3365
|
_assertClass(ret, Fragment);
|
|
3252
3366
|
var ptr1 = ret.__destroy_into_raw();
|
|
3253
3367
|
return ptr1;
|
|
3254
3368
|
}
|
|
3255
|
-
export function
|
|
3369
|
+
export function __wbg___wasm_refgen_toWasmLooseCommit_bc6f015053af2dd7(arg0) {
|
|
3256
3370
|
const ret = arg0.__wasm_refgen_toWasmLooseCommit();
|
|
3257
3371
|
_assertClass(ret, LooseCommit);
|
|
3258
3372
|
var ptr1 = ret.__destroy_into_raw();
|
|
@@ -3296,6 +3410,14 @@ export function __wbg___wbindgen_number_get_34bb9d9dcfa21373(arg0, arg1) {
|
|
|
3296
3410
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3297
3411
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3298
3412
|
}
|
|
3413
|
+
export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
|
|
3414
|
+
const obj = arg1;
|
|
3415
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
3416
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3417
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3418
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3419
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3420
|
+
}
|
|
3299
3421
|
export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
|
|
3300
3422
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3301
3423
|
}
|
|
@@ -3318,6 +3440,18 @@ export function __wbg_authenticatedwebsocket_new(arg0) {
|
|
|
3318
3440
|
const ret = AuthenticatedWebSocket.__wrap(arg0);
|
|
3319
3441
|
return ret;
|
|
3320
3442
|
}
|
|
3443
|
+
export function __wbg_authorizeConnect_0e61e98d289a37c9() { return handleError(function (arg0, arg1) {
|
|
3444
|
+
const ret = arg0.authorizeConnect(arg1);
|
|
3445
|
+
return ret;
|
|
3446
|
+
}, arguments); }
|
|
3447
|
+
export function __wbg_authorizeFetch_88703389e9c295d0() { return handleError(function (arg0, arg1, arg2) {
|
|
3448
|
+
const ret = arg0.authorizeFetch(arg1, arg2);
|
|
3449
|
+
return ret;
|
|
3450
|
+
}, arguments); }
|
|
3451
|
+
export function __wbg_authorizePut_dab9270462803778() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3452
|
+
const ret = arg0.authorizePut(arg1, arg2, arg3);
|
|
3453
|
+
return ret;
|
|
3454
|
+
}, arguments); }
|
|
3321
3455
|
export function __wbg_buffer_60b8043cd926067d(arg0) {
|
|
3322
3456
|
const ret = arg0.buffer;
|
|
3323
3457
|
return ret;
|
|
@@ -3326,9 +3460,20 @@ export function __wbg_call_2d781c1f4d5c0ef8() { return handleError(function (arg
|
|
|
3326
3460
|
const ret = arg0.call(arg1, arg2);
|
|
3327
3461
|
return ret;
|
|
3328
3462
|
}, arguments); }
|
|
3329
|
-
export function
|
|
3463
|
+
export function __wbg_call_e133b57c9155d22c() { return handleError(function (arg0, arg1) {
|
|
3464
|
+
const ret = arg0.call(arg1);
|
|
3465
|
+
return ret;
|
|
3466
|
+
}, arguments); }
|
|
3467
|
+
export function __wbg_call_f858478a02f9600f() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
3468
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
3469
|
+
return ret;
|
|
3470
|
+
}, arguments); }
|
|
3471
|
+
export function __wbg_close_574e2788efd7bb53(arg0) {
|
|
3330
3472
|
arg0.close();
|
|
3331
3473
|
}
|
|
3474
|
+
export function __wbg_close_af26905c832a88cb() { return handleError(function (arg0) {
|
|
3475
|
+
arg0.close();
|
|
3476
|
+
}, arguments); }
|
|
3332
3477
|
export function __wbg_close_cbf870bdad0aad99(arg0) {
|
|
3333
3478
|
arg0.close();
|
|
3334
3479
|
}
|
|
@@ -3352,11 +3497,11 @@ export function __wbg_data_a3d9ff9cdd801002(arg0) {
|
|
|
3352
3497
|
const ret = arg0.data;
|
|
3353
3498
|
return ret;
|
|
3354
3499
|
}
|
|
3355
|
-
export function
|
|
3500
|
+
export function __wbg_deleteAllCommits_b0197e590f7fce60(arg0, arg1) {
|
|
3356
3501
|
const ret = arg0.deleteAllCommits(arg1);
|
|
3357
3502
|
return ret;
|
|
3358
3503
|
}
|
|
3359
|
-
export function
|
|
3504
|
+
export function __wbg_deleteAllFragments_f884845698f5afb7(arg0, arg1) {
|
|
3360
3505
|
const ret = arg0.deleteAllFragments(arg1);
|
|
3361
3506
|
return ret;
|
|
3362
3507
|
}
|
|
@@ -3368,7 +3513,7 @@ export function __wbg_digest_unwrap(arg0) {
|
|
|
3368
3513
|
const ret = Digest.__unwrap(arg0);
|
|
3369
3514
|
return ret;
|
|
3370
3515
|
}
|
|
3371
|
-
export function
|
|
3516
|
+
export function __wbg_disconnect_849aae59f5879e45(arg0) {
|
|
3372
3517
|
const ret = arg0.disconnect();
|
|
3373
3518
|
return ret;
|
|
3374
3519
|
}
|
|
@@ -3395,6 +3540,10 @@ export function __wbg_fetch_f8a611684c3b5fe5(arg0, arg1) {
|
|
|
3395
3540
|
const ret = arg0.fetch(arg1);
|
|
3396
3541
|
return ret;
|
|
3397
3542
|
}
|
|
3543
|
+
export function __wbg_filterAuthorizedFetch_0d6450fa919b271d() { return handleError(function (arg0, arg1, arg2) {
|
|
3544
|
+
const ret = arg0.filterAuthorizedFetch(arg1, arg2);
|
|
3545
|
+
return ret;
|
|
3546
|
+
}, arguments); }
|
|
3398
3547
|
export function __wbg_fragment_new(arg0) {
|
|
3399
3548
|
const ret = Fragment.__wrap(arg0);
|
|
3400
3549
|
return ret;
|
|
@@ -3437,6 +3586,10 @@ export function __wbg_get_a8ee5c45dabc1b3b(arg0, arg1) {
|
|
|
3437
3586
|
const ret = arg0[arg1 >>> 0];
|
|
3438
3587
|
return ret;
|
|
3439
3588
|
}
|
|
3589
|
+
export function __wbg_get_unchecked_329cfe50afab7352(arg0, arg1) {
|
|
3590
|
+
const ret = arg0[arg1 >>> 0];
|
|
3591
|
+
return ret;
|
|
3592
|
+
}
|
|
3440
3593
|
export function __wbg_has_926ef2ff40b308cf() { return handleError(function (arg0, arg1) {
|
|
3441
3594
|
const ret = Reflect.has(arg0, arg1);
|
|
3442
3595
|
return ret;
|
|
@@ -3563,6 +3716,10 @@ export function __wbg_instanceof_WorkerGlobalScope_de6976d00cb213c6(arg0) {
|
|
|
3563
3716
|
const ret = result;
|
|
3564
3717
|
return ret;
|
|
3565
3718
|
}
|
|
3719
|
+
export function __wbg_isArray_33b91feb269ff46e(arg0) {
|
|
3720
|
+
const ret = Array.isArray(arg0);
|
|
3721
|
+
return ret;
|
|
3722
|
+
}
|
|
3566
3723
|
export function __wbg_isSafeInteger_ecd6a7f9c3e053cd(arg0) {
|
|
3567
3724
|
const ret = Number.isSafeInteger(arg0);
|
|
3568
3725
|
return ret;
|
|
@@ -3575,15 +3732,15 @@ export function __wbg_length_ea16607d7b61445b(arg0) {
|
|
|
3575
3732
|
const ret = arg0.length;
|
|
3576
3733
|
return ret;
|
|
3577
3734
|
}
|
|
3578
|
-
export function
|
|
3735
|
+
export function __wbg_loadAllCommits_0e97df07ed213aa0(arg0, arg1) {
|
|
3579
3736
|
const ret = arg0.loadAllCommits(arg1);
|
|
3580
3737
|
return ret;
|
|
3581
3738
|
}
|
|
3582
|
-
export function
|
|
3739
|
+
export function __wbg_loadAllFragments_12ecf8f9bd0e0b58(arg0, arg1) {
|
|
3583
3740
|
const ret = arg0.loadAllFragments(arg1);
|
|
3584
3741
|
return ret;
|
|
3585
3742
|
}
|
|
3586
|
-
export function
|
|
3743
|
+
export function __wbg_loadAllSedimentreeIds_1a18451ef1f8e795(arg0) {
|
|
3587
3744
|
const ret = arg0.loadAllSedimentreeIds();
|
|
3588
3745
|
return ret;
|
|
3589
3746
|
}
|
|
@@ -3626,7 +3783,7 @@ export function __wbg_new_d098e265629cd10f(arg0, arg1) {
|
|
|
3626
3783
|
const a = state0.a;
|
|
3627
3784
|
state0.a = 0;
|
|
3628
3785
|
try {
|
|
3629
|
-
return
|
|
3786
|
+
return __wasm_bindgen_func_elem_1605_191(a, state0.b, arg0, arg1);
|
|
3630
3787
|
} finally {
|
|
3631
3788
|
state0.a = a;
|
|
3632
3789
|
}
|
|
@@ -3660,7 +3817,7 @@ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
|
|
|
3660
3817
|
const a = state0.a;
|
|
3661
3818
|
state0.a = 0;
|
|
3662
3819
|
try {
|
|
3663
|
-
return
|
|
3820
|
+
return __wasm_bindgen_func_elem_1605_192(a, state0.b, arg0, arg1);
|
|
3664
3821
|
} finally {
|
|
3665
3822
|
state0.a = a;
|
|
3666
3823
|
}
|
|
@@ -3671,6 +3828,10 @@ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
|
|
|
3671
3828
|
state0.a = state0.b = 0;
|
|
3672
3829
|
}
|
|
3673
3830
|
}
|
|
3831
|
+
export function __wbg_new_typed_bccac67128ed885a() {
|
|
3832
|
+
const ret = new Array();
|
|
3833
|
+
return ret;
|
|
3834
|
+
}
|
|
3674
3835
|
export function __wbg_new_with_length_825018a1616e9e55(arg0) {
|
|
3675
3836
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
3676
3837
|
return ret;
|
|
@@ -3703,6 +3864,9 @@ export function __wbg_of_d6376e3774c51f89(arg0, arg1) {
|
|
|
3703
3864
|
const ret = Array.of(arg0, arg1);
|
|
3704
3865
|
return ret;
|
|
3705
3866
|
}
|
|
3867
|
+
export function __wbg_onDisconnect_12d6884490508121(arg0, arg1) {
|
|
3868
|
+
arg0.onDisconnect(arg1);
|
|
3869
|
+
}
|
|
3706
3870
|
export function __wbg_open_e7a9d3d6344572f6() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3707
3871
|
const ret = arg0.open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
3708
3872
|
return ret;
|
|
@@ -3727,7 +3891,7 @@ export function __wbg_port2_947a51b8ba00adc9(arg0) {
|
|
|
3727
3891
|
const ret = arg0.port2;
|
|
3728
3892
|
return ret;
|
|
3729
3893
|
}
|
|
3730
|
-
export function
|
|
3894
|
+
export function __wbg_postMessage_0541d6c31330afe3(arg0, arg1) {
|
|
3731
3895
|
arg0.postMessage(arg1);
|
|
3732
3896
|
}
|
|
3733
3897
|
export function __wbg_process_44c7a14e11e9f69e(arg0) {
|
|
@@ -3759,7 +3923,7 @@ export function __wbg_readyState_1f1e7f1bdf9f4d42(arg0) {
|
|
|
3759
3923
|
const ret = arg0.readyState;
|
|
3760
3924
|
return ret;
|
|
3761
3925
|
}
|
|
3762
|
-
export function
|
|
3926
|
+
export function __wbg_recvBytes_c85b12fb48cd7a35(arg0) {
|
|
3763
3927
|
const ret = arg0.recvBytes();
|
|
3764
3928
|
return ret;
|
|
3765
3929
|
}
|
|
@@ -3775,15 +3939,15 @@ export function __wbg_result_c5baa2d3d690a01a() { return handleError(function (a
|
|
|
3775
3939
|
const ret = arg0.result;
|
|
3776
3940
|
return ret;
|
|
3777
3941
|
}, arguments); }
|
|
3778
|
-
export function
|
|
3942
|
+
export function __wbg_saveCommit_02f095436fc502e0(arg0, arg1, arg2, arg3, arg4) {
|
|
3779
3943
|
const ret = arg0.saveCommit(arg1, arg2, arg3, arg4);
|
|
3780
3944
|
return ret;
|
|
3781
3945
|
}
|
|
3782
|
-
export function
|
|
3946
|
+
export function __wbg_saveFragment_7681b2171b8cfb35(arg0, arg1, arg2, arg3, arg4) {
|
|
3783
3947
|
const ret = arg0.saveFragment(arg1, arg2, arg3, arg4);
|
|
3784
3948
|
return ret;
|
|
3785
3949
|
}
|
|
3786
|
-
export function
|
|
3950
|
+
export function __wbg_saveSedimentreeId_c265aaeef5af34b6(arg0, arg1) {
|
|
3787
3951
|
const ret = arg0.saveSedimentreeId(arg1);
|
|
3788
3952
|
return ret;
|
|
3789
3953
|
}
|
|
@@ -3795,14 +3959,14 @@ export function __wbg_sedimentreeid_unwrap(arg0) {
|
|
|
3795
3959
|
const ret = SedimentreeId.__unwrap(arg0);
|
|
3796
3960
|
return ret;
|
|
3797
3961
|
}
|
|
3798
|
-
export function
|
|
3962
|
+
export function __wbg_sendBytes_e6262dd74f1c260a(arg0, arg1) {
|
|
3799
3963
|
const ret = arg0.sendBytes(arg1);
|
|
3800
3964
|
return ret;
|
|
3801
3965
|
}
|
|
3802
3966
|
export function __wbg_send_d31a693c975dea74() { return handleError(function (arg0, arg1, arg2) {
|
|
3803
3967
|
arg0.send(getArrayU8FromWasm0(arg1, arg2));
|
|
3804
3968
|
}, arguments); }
|
|
3805
|
-
export function
|
|
3969
|
+
export function __wbg_setTimeout_7829585928963a1f(arg0, arg1) {
|
|
3806
3970
|
const ret = setTimeout(arg0, arg1);
|
|
3807
3971
|
return ret;
|
|
3808
3972
|
}
|
|
@@ -3840,7 +4004,7 @@ export function __wbg_set_onerror_8a268cb237177bba(arg0, arg1) {
|
|
|
3840
4004
|
export function __wbg_set_onerror_901ca711f94a5bbb(arg0, arg1) {
|
|
3841
4005
|
arg0.onerror = arg1;
|
|
3842
4006
|
}
|
|
3843
|
-
export function
|
|
4007
|
+
export function __wbg_set_onmessage_29558b29aee9a78a(arg0, arg1) {
|
|
3844
4008
|
arg0.onmessage = arg1;
|
|
3845
4009
|
}
|
|
3846
4010
|
export function __wbg_set_onmessage_6f80ab771bf151aa(arg0, arg1) {
|
|
@@ -3855,14 +4019,14 @@ export function __wbg_set_onsuccess_fca94ded107b64af(arg0, arg1) {
|
|
|
3855
4019
|
export function __wbg_set_onupgradeneeded_860ce42184f987e7(arg0, arg1) {
|
|
3856
4020
|
arg0.onupgradeneeded = arg1;
|
|
3857
4021
|
}
|
|
3858
|
-
export function __wbg_sign_23c468db7fe0ee83(arg0, arg1) {
|
|
3859
|
-
const ret = arg0.sign(arg1);
|
|
3860
|
-
return ret;
|
|
3861
|
-
}
|
|
3862
4022
|
export function __wbg_sign_a34d057afd14c54d() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
3863
4023
|
const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
|
|
3864
4024
|
return ret;
|
|
3865
4025
|
}, arguments); }
|
|
4026
|
+
export function __wbg_sign_d03455abc6736428(arg0, arg1) {
|
|
4027
|
+
const ret = arg0.sign(arg1);
|
|
4028
|
+
return ret;
|
|
4029
|
+
}
|
|
3866
4030
|
export function __wbg_signedfragment_new(arg0) {
|
|
3867
4031
|
const ret = SignedFragment.__wrap(arg0);
|
|
3868
4032
|
return ret;
|
|
@@ -3941,14 +4105,14 @@ export function __wbg_transaction_2237af0233efbdf3() { return handleError(functi
|
|
|
3941
4105
|
const ret = arg0.transaction(getStringFromWasm0(arg1, arg2));
|
|
3942
4106
|
return ret;
|
|
3943
4107
|
}, arguments); }
|
|
3944
|
-
export function
|
|
4108
|
+
export function __wbg_tryIntoJsSedimentreeIdsArray_d6337c0aa0f28604() { return handleError(function (arg0, arg1) {
|
|
3945
4109
|
const ret = tryIntoJsSedimentreeIdsArray(arg1);
|
|
3946
4110
|
const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
|
|
3947
4111
|
const len1 = WASM_VECTOR_LEN;
|
|
3948
4112
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3949
4113
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3950
4114
|
}, arguments); }
|
|
3951
|
-
export function
|
|
4115
|
+
export function __wbg_verifyingKey_29533740d75f8cdb(arg0) {
|
|
3952
4116
|
const ret = arg0.verifyingKey();
|
|
3953
4117
|
return ret;
|
|
3954
4118
|
}
|
|
@@ -3961,74 +4125,79 @@ export function __wbg_webcryptosigner_new(arg0) {
|
|
|
3961
4125
|
return ret;
|
|
3962
4126
|
}
|
|
3963
4127
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
3964
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3965
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
4128
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [Externref], shim_idx: 12, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4129
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590);
|
|
3966
4130
|
return ret;
|
|
3967
4131
|
}
|
|
3968
4132
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
3969
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3970
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
4133
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [NamedExternref("Event")], shim_idx: 12, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4134
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_1);
|
|
3971
4135
|
return ret;
|
|
3972
4136
|
}
|
|
3973
4137
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
3974
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3975
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
4138
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 12, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4139
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_2);
|
|
3976
4140
|
return ret;
|
|
3977
4141
|
}
|
|
3978
4142
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
3979
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3980
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
4143
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 12, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
4144
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_3);
|
|
3981
4145
|
return ret;
|
|
3982
4146
|
}
|
|
3983
4147
|
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
3984
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3985
|
-
const ret =
|
|
4148
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [], shim_idx: 13, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
4149
|
+
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_589);
|
|
4150
|
+
return ret;
|
|
4151
|
+
}
|
|
4152
|
+
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
4153
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 655, function: Function { arguments: [Externref], shim_idx: 738, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
4154
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_1605);
|
|
3986
4155
|
return ret;
|
|
3987
4156
|
}
|
|
3988
|
-
export function
|
|
4157
|
+
export function __wbindgen_cast_0000000000000007(arg0) {
|
|
3989
4158
|
// Cast intrinsic for `F64 -> Externref`.
|
|
3990
4159
|
const ret = arg0;
|
|
3991
4160
|
return ret;
|
|
3992
4161
|
}
|
|
3993
|
-
export function
|
|
4162
|
+
export function __wbindgen_cast_0000000000000008(arg0, arg1) {
|
|
3994
4163
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
3995
4164
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
3996
4165
|
return ret;
|
|
3997
4166
|
}
|
|
3998
|
-
export function
|
|
4167
|
+
export function __wbindgen_cast_0000000000000009(arg0, arg1) {
|
|
3999
4168
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
4000
4169
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
4001
4170
|
return ret;
|
|
4002
4171
|
}
|
|
4003
|
-
export function
|
|
4172
|
+
export function __wbindgen_cast_000000000000000a(arg0, arg1) {
|
|
4004
4173
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4005
4174
|
wasm.__wbindgen_export5(arg0, arg1 * 4, 4);
|
|
4006
4175
|
// Cast intrinsic for `Vector(NamedExternref("Fragment")) -> Externref`.
|
|
4007
4176
|
const ret = v0;
|
|
4008
4177
|
return ret;
|
|
4009
4178
|
}
|
|
4010
|
-
export function
|
|
4179
|
+
export function __wbindgen_cast_000000000000000b(arg0, arg1) {
|
|
4011
4180
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4012
4181
|
wasm.__wbindgen_export5(arg0, arg1 * 4, 4);
|
|
4013
4182
|
// Cast intrinsic for `Vector(NamedExternref("LooseCommit")) -> Externref`.
|
|
4014
4183
|
const ret = v0;
|
|
4015
4184
|
return ret;
|
|
4016
4185
|
}
|
|
4017
|
-
export function
|
|
4186
|
+
export function __wbindgen_cast_000000000000000c(arg0, arg1) {
|
|
4018
4187
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4019
4188
|
wasm.__wbindgen_export5(arg0, arg1 * 4, 4);
|
|
4020
4189
|
// Cast intrinsic for `Vector(NamedExternref("PeerId")) -> Externref`.
|
|
4021
4190
|
const ret = v0;
|
|
4022
4191
|
return ret;
|
|
4023
4192
|
}
|
|
4024
|
-
export function
|
|
4193
|
+
export function __wbindgen_cast_000000000000000d(arg0, arg1) {
|
|
4025
4194
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4026
4195
|
wasm.__wbindgen_export5(arg0, arg1 * 4, 4);
|
|
4027
4196
|
// Cast intrinsic for `Vector(NamedExternref("SedimentreeId")) -> Externref`.
|
|
4028
4197
|
const ret = v0;
|
|
4029
4198
|
return ret;
|
|
4030
4199
|
}
|
|
4031
|
-
export function
|
|
4200
|
+
export function __wbindgen_cast_000000000000000e(arg0, arg1) {
|
|
4032
4201
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
4033
4202
|
wasm.__wbindgen_export5(arg0, arg1 * 4, 4);
|
|
4034
4203
|
// Cast intrinsic for `Vector(NamedExternref("Uint8Array")) -> Externref`.
|
|
@@ -4044,35 +4213,39 @@ export function __wbindgen_init_externref_table() {
|
|
|
4044
4213
|
table.set(offset + 2, true);
|
|
4045
4214
|
table.set(offset + 3, false);
|
|
4046
4215
|
}
|
|
4047
|
-
function
|
|
4048
|
-
wasm.
|
|
4216
|
+
function __wasm_bindgen_func_elem_589(arg0, arg1) {
|
|
4217
|
+
wasm.__wasm_bindgen_func_elem_589(arg0, arg1);
|
|
4049
4218
|
}
|
|
4050
4219
|
|
|
4051
|
-
function
|
|
4052
|
-
wasm.
|
|
4220
|
+
function __wasm_bindgen_func_elem_590(arg0, arg1, arg2) {
|
|
4221
|
+
wasm.__wasm_bindgen_func_elem_590(arg0, arg1, arg2);
|
|
4053
4222
|
}
|
|
4054
4223
|
|
|
4055
|
-
function
|
|
4056
|
-
wasm.
|
|
4224
|
+
function __wasm_bindgen_func_elem_590_1(arg0, arg1, arg2) {
|
|
4225
|
+
wasm.__wasm_bindgen_func_elem_590_1(arg0, arg1, arg2);
|
|
4057
4226
|
}
|
|
4058
4227
|
|
|
4059
|
-
function
|
|
4060
|
-
wasm.
|
|
4228
|
+
function __wasm_bindgen_func_elem_590_2(arg0, arg1, arg2) {
|
|
4229
|
+
wasm.__wasm_bindgen_func_elem_590_2(arg0, arg1, arg2);
|
|
4061
4230
|
}
|
|
4062
4231
|
|
|
4063
|
-
function
|
|
4064
|
-
|
|
4232
|
+
function __wasm_bindgen_func_elem_590_3(arg0, arg1, arg2) {
|
|
4233
|
+
wasm.__wasm_bindgen_func_elem_590_3(arg0, arg1, arg2);
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
function __wasm_bindgen_func_elem_1605(arg0, arg1, arg2) {
|
|
4237
|
+
const ret = wasm.__wasm_bindgen_func_elem_1605(arg0, arg1, arg2);
|
|
4065
4238
|
if (ret[1]) {
|
|
4066
4239
|
throw takeFromExternrefTable0(ret[0]);
|
|
4067
4240
|
}
|
|
4068
4241
|
}
|
|
4069
4242
|
|
|
4070
|
-
function
|
|
4071
|
-
wasm.
|
|
4243
|
+
function __wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3) {
|
|
4244
|
+
wasm.__wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3);
|
|
4072
4245
|
}
|
|
4073
4246
|
|
|
4074
|
-
function
|
|
4075
|
-
wasm.
|
|
4247
|
+
function __wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3) {
|
|
4248
|
+
wasm.__wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3);
|
|
4076
4249
|
}
|
|
4077
4250
|
|
|
4078
4251
|
|
|
@@ -4323,6 +4496,31 @@ function isLikeNone(x) {
|
|
|
4323
4496
|
return x === undefined || x === null;
|
|
4324
4497
|
}
|
|
4325
4498
|
|
|
4499
|
+
function makeClosure(arg0, arg1, dtor, f) {
|
|
4500
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
4501
|
+
const real = (...args) => {
|
|
4502
|
+
|
|
4503
|
+
// First up with a closure we increment the internal reference
|
|
4504
|
+
// count. This ensures that the Rust closure environment won't
|
|
4505
|
+
// be deallocated while we're invoking it.
|
|
4506
|
+
state.cnt++;
|
|
4507
|
+
try {
|
|
4508
|
+
return f(state.a, state.b, ...args);
|
|
4509
|
+
} finally {
|
|
4510
|
+
real._wbg_cb_unref();
|
|
4511
|
+
}
|
|
4512
|
+
};
|
|
4513
|
+
real._wbg_cb_unref = () => {
|
|
4514
|
+
if (--state.cnt === 0) {
|
|
4515
|
+
state.dtor(state.a, state.b);
|
|
4516
|
+
state.a = 0;
|
|
4517
|
+
CLOSURE_DTORS.unregister(state);
|
|
4518
|
+
}
|
|
4519
|
+
};
|
|
4520
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
4521
|
+
return real;
|
|
4522
|
+
}
|
|
4523
|
+
|
|
4326
4524
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
4327
4525
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
4328
4526
|
const real = (...args) => {
|