@automerge/subduction 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cjs/wasm-base64.cjs +1 -1
  2. package/dist/cjs/web-bindings.cjs +232 -85
  3. package/dist/cjs/web.cjs +233 -86
  4. package/dist/esm/wasm-base64.js +1 -1
  5. package/dist/iife/index.js +232 -86
  6. package/dist/index.d.ts +83 -11
  7. package/dist/subduction.wasm +0 -0
  8. package/dist/wasm_bindgen/bundler/snippets/subduction_wasm-ec51bcf335db35bd/inline0.js +8 -0
  9. package/dist/wasm_bindgen/bundler/subduction_wasm.d.ts +83 -11
  10. package/dist/wasm_bindgen/bundler/subduction_wasm.js +1 -1
  11. package/dist/wasm_bindgen/bundler/subduction_wasm_bg.js +212 -83
  12. package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm +0 -0
  13. package/dist/wasm_bindgen/bundler/subduction_wasm_bg.wasm.d.ts +17 -13
  14. package/dist/wasm_bindgen/nodejs/snippets/subduction_wasm-ec51bcf335db35bd/inline0.js +8 -0
  15. package/dist/wasm_bindgen/nodejs/subduction_wasm.cjs +217 -85
  16. package/dist/wasm_bindgen/nodejs/subduction_wasm.d.ts +83 -11
  17. package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm +0 -0
  18. package/dist/wasm_bindgen/nodejs/subduction_wasm_bg.wasm.d.ts +17 -13
  19. package/dist/wasm_bindgen/web/snippets/subduction_wasm-ec51bcf335db35bd/inline0.js +8 -0
  20. package/dist/wasm_bindgen/web/subduction_wasm.d.ts +100 -24
  21. package/dist/wasm_bindgen/web/subduction_wasm.js +216 -85
  22. package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm +0 -0
  23. package/dist/wasm_bindgen/web/subduction_wasm_bg.wasm.d.ts +17 -13
  24. package/package.json +3 -2
  25. /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline0.js +0 -0
  26. /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline1.js +0 -0
  27. /package/dist/wasm_bindgen/bundler/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline2.js +0 -0
  28. /package/dist/wasm_bindgen/bundler/snippets/{subduction_wasm-0ed7fd66cebca59f/inline0.js → subduction_wasm-ec51bcf335db35bd/inline1.js} +0 -0
  29. /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline0.js +0 -0
  30. /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline1.js +0 -0
  31. /package/dist/wasm_bindgen/nodejs/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline2.js +0 -0
  32. /package/dist/wasm_bindgen/nodejs/snippets/{subduction_wasm-0ed7fd66cebca59f/inline0.js → subduction_wasm-ec51bcf335db35bd/inline1.js} +0 -0
  33. /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline0.js +0 -0
  34. /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline1.js +0 -0
  35. /package/dist/wasm_bindgen/web/snippets/{sedimentree_wasm-1de4a01519b0f11f → sedimentree_wasm-75027ecce41278de}/inline2.js +0 -0
  36. /package/dist/wasm_bindgen/web/snippets/{subduction_wasm-0ed7fd66cebca59f/inline0.js → subduction_wasm-ec51bcf335db35bd/inline1.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-1de4a01519b0f11f/inline2.js';
1
+ import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-75027ecce41278de/inline2.js';
2
2
 
3
3
  /**
4
4
  * An authenticated HTTP long-poll transport.
@@ -2409,6 +2409,10 @@ export class Subduction {
2409
2409
  * When set, clients can connect without knowing the server's peer ID.
2410
2410
  * * `hash_metric_override` - Optional custom depth metric function
2411
2411
  * * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
2412
+ * * `policy` - Optional connection/storage authorization policy.
2413
+ * Defaults to allow-all.
2414
+ * * `ephemeral_policy` - Optional ephemeral message authorization policy.
2415
+ * Defaults to allow-all.
2412
2416
  *
2413
2417
  * # Panics
2414
2418
  *
@@ -2423,15 +2427,16 @@ export class Subduction {
2423
2427
  * @param {string | null} [service_name]
2424
2428
  * @param {(digest: Digest) => Depth | null} [hash_metric_override]
2425
2429
  * @param {number | null} [max_pending_blob_requests]
2426
- * @param {any | null} [policy]
2430
+ * @param {Policy | null} [policy]
2431
+ * @param {EphemeralPolicy | null} [ephemeral_policy]
2427
2432
  * @param {Function | null} [on_remote_heads]
2428
2433
  * @param {Function | null} [on_ephemeral]
2429
2434
  * @returns {Promise<Subduction>}
2430
2435
  */
2431
- static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
2436
+ static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, ephemeral_policy, on_remote_heads, on_ephemeral) {
2432
2437
  var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2433
2438
  var len0 = WASM_VECTOR_LEN;
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));
2439
+ 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(ephemeral_policy) ? 0 : addToExternrefTable0(ephemeral_policy), isLikeNone(on_remote_heads) ? 0 : addToExternrefTable0(on_remote_heads), isLikeNone(on_ephemeral) ? 0 : addToExternrefTable0(on_ephemeral));
2435
2440
  return ret;
2436
2441
  }
2437
2442
  /**
@@ -2466,9 +2471,10 @@ export class Subduction {
2466
2471
  * When set, clients can connect without knowing the server's peer ID.
2467
2472
  * * `hash_metric_override` - Optional custom depth metric function
2468
2473
  * * `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.
2474
+ * * `policy` - Optional connection/storage authorization policy.
2475
+ * Defaults to allow-all.
2476
+ * * `ephemeral_policy` - Optional ephemeral message authorization policy.
2477
+ * Defaults to allow-all.
2472
2478
  *
2473
2479
  * # Panics
2474
2480
  *
@@ -2479,32 +2485,37 @@ export class Subduction {
2479
2485
  * @param {string | null} [service_name]
2480
2486
  * @param {(digest: Digest) => Depth | null} [hash_metric_override]
2481
2487
  * @param {number | null} [max_pending_blob_requests]
2482
- * @param {any | null} [policy]
2488
+ * @param {Policy | null} [policy]
2489
+ * @param {EphemeralPolicy | null} [ephemeral_policy]
2483
2490
  * @param {Function | null} [on_remote_heads]
2484
2491
  * @param {Function | null} [on_ephemeral]
2485
2492
  */
2486
- constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
2493
+ constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, ephemeral_policy, on_remote_heads, on_ephemeral) {
2487
2494
  var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2488
2495
  var len0 = WASM_VECTOR_LEN;
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));
2496
+ 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(ephemeral_policy) ? 0 : addToExternrefTable0(ephemeral_policy), isLikeNone(on_remote_heads) ? 0 : addToExternrefTable0(on_remote_heads), isLikeNone(on_ephemeral) ? 0 : addToExternrefTable0(on_ephemeral));
2490
2497
  this.__wbg_ptr = ret >>> 0;
2491
2498
  SubductionFinalization.register(this, this.__wbg_ptr, this);
2492
2499
  return this;
2493
2500
  }
2494
2501
  /**
2495
- * Publish an ephemeral message to all subscribers of a sedimentree.
2502
+ * Publish an ephemeral message to all subscribers of a topic.
2496
2503
  *
2497
2504
  * The payload is opaque bytes — encoding is the caller's responsibility.
2498
2505
  * Messages are fire-and-forget; delivery is best-effort.
2499
- * @param {SedimentreeId} id
2506
+ *
2507
+ * # Panics
2508
+ *
2509
+ * Panics if the platform's random number generator fails.
2510
+ * @param {Topic} topic
2500
2511
  * @param {Uint8Array} payload
2501
2512
  * @returns {Promise<void>}
2502
2513
  */
2503
- publishEphemeral(id, payload) {
2504
- _assertClass(id, SedimentreeId);
2514
+ publishEphemeral(topic, payload) {
2515
+ _assertClass(topic, Topic);
2505
2516
  const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
2506
2517
  const len0 = WASM_VECTOR_LEN;
2507
- const ret = wasm.subduction_publishEphemeral(this.__wbg_ptr, id.__wbg_ptr, ptr0, len0);
2518
+ const ret = wasm.subduction_publishEphemeral(this.__wbg_ptr, topic.__wbg_ptr, ptr0, len0);
2508
2519
  return ret;
2509
2520
  }
2510
2521
  /**
@@ -2551,13 +2562,13 @@ export class Subduction {
2551
2562
  return ret;
2552
2563
  }
2553
2564
  /**
2554
- * Subscribe to ephemeral messages for the given sedimentree IDs
2565
+ * Subscribe to ephemeral messages for the given topics
2555
2566
  * from all connected peers.
2556
- * @param {SedimentreeId[]} ids
2567
+ * @param {Topic[]} topics
2557
2568
  * @returns {Promise<void>}
2558
2569
  */
2559
- subscribeEphemeral(ids) {
2560
- const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
2570
+ subscribeEphemeral(topics) {
2571
+ const ptr0 = passArrayJsValueToWasm0(topics, wasm.__wbindgen_export);
2561
2572
  const len0 = WASM_VECTOR_LEN;
2562
2573
  const ret = wasm.subduction_subscribeEphemeral(this.__wbg_ptr, ptr0, len0);
2563
2574
  return ret;
@@ -2610,13 +2621,13 @@ export class Subduction {
2610
2621
  return ret;
2611
2622
  }
2612
2623
  /**
2613
- * Unsubscribe from ephemeral messages for the given sedimentree IDs
2624
+ * Unsubscribe from ephemeral messages for the given topics
2614
2625
  * from all connected peers.
2615
- * @param {SedimentreeId[]} ids
2626
+ * @param {Topic[]} topics
2616
2627
  * @returns {Promise<void>}
2617
2628
  */
2618
- unsubscribeEphemeral(ids) {
2619
- const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
2629
+ unsubscribeEphemeral(topics) {
2630
+ const ptr0 = passArrayJsValueToWasm0(topics, wasm.__wbindgen_export);
2620
2631
  const len0 = WASM_VECTOR_LEN;
2621
2632
  const ret = wasm.subduction_unsubscribeEphemeral(this.__wbg_ptr, ptr0, len0);
2622
2633
  return ret;
@@ -3231,6 +3242,86 @@ export class SyncStats {
3231
3242
  }
3232
3243
  if (Symbol.dispose) SyncStats.prototype[Symbol.dispose] = SyncStats.prototype.free;
3233
3244
 
3245
+ /**
3246
+ * A Wasm wrapper around the ephemeral [`Topic`] type.
3247
+ *
3248
+ * Topics are opaque 32-byte identifiers for ephemeral pubsub channels.
3249
+ * A [`SedimentreeId`] can be used as a topic, but topics are not
3250
+ * limited to sedimentrees.
3251
+ *
3252
+ * [`SedimentreeId`]: sedimentree_core::id::SedimentreeId
3253
+ */
3254
+ export class Topic {
3255
+ static __wrap(ptr) {
3256
+ ptr = ptr >>> 0;
3257
+ const obj = Object.create(Topic.prototype);
3258
+ obj.__wbg_ptr = ptr;
3259
+ TopicFinalization.register(obj, obj.__wbg_ptr, obj);
3260
+ return obj;
3261
+ }
3262
+ static __unwrap(jsValue) {
3263
+ if (!(jsValue instanceof Topic)) {
3264
+ return 0;
3265
+ }
3266
+ return jsValue.__destroy_into_raw();
3267
+ }
3268
+ __destroy_into_raw() {
3269
+ const ptr = this.__wbg_ptr;
3270
+ this.__wbg_ptr = 0;
3271
+ TopicFinalization.unregister(this);
3272
+ return ptr;
3273
+ }
3274
+ free() {
3275
+ const ptr = this.__destroy_into_raw();
3276
+ wasm.__wbg_topic_free(ptr, 0);
3277
+ }
3278
+ /**
3279
+ * Create a topic from a 32-byte array.
3280
+ *
3281
+ * # Errors
3282
+ *
3283
+ * Returns an error if the provided byte array is not exactly 32 bytes.
3284
+ * @param {Uint8Array} bytes
3285
+ * @returns {Topic}
3286
+ */
3287
+ static fromBytes(bytes) {
3288
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
3289
+ const len0 = WASM_VECTOR_LEN;
3290
+ const ret = wasm.topic_fromBytes(ptr0, len0);
3291
+ if (ret[2]) {
3292
+ throw takeFromExternrefTable0(ret[1]);
3293
+ }
3294
+ return Topic.__wrap(ret[0]);
3295
+ }
3296
+ /**
3297
+ * Returns the raw 32 bytes of this topic.
3298
+ * @returns {Uint8Array}
3299
+ */
3300
+ toBytes() {
3301
+ const ret = wasm.topic_toBytes(this.__wbg_ptr);
3302
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3303
+ wasm.__wbindgen_export5(ret[0], ret[1] * 1, 1);
3304
+ return v1;
3305
+ }
3306
+ /**
3307
+ * Returns a shortened hex prefix representation (first 4 bytes + `…`).
3308
+ * @returns {string}
3309
+ */
3310
+ toString() {
3311
+ let deferred1_0;
3312
+ let deferred1_1;
3313
+ try {
3314
+ const ret = wasm.topic_toString(this.__wbg_ptr);
3315
+ deferred1_0 = ret[0];
3316
+ deferred1_1 = ret[1];
3317
+ return getStringFromWasm0(ret[0], ret[1]);
3318
+ } finally {
3319
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
3320
+ }
3321
+ }
3322
+ }
3323
+ if (Symbol.dispose) Topic.prototype[Symbol.dispose] = Topic.prototype.free;
3324
+
3234
3325
  /**
3235
3326
  * An Ed25519 signer using the browser's `WebCrypto` API.
3236
3327
  *
@@ -3336,37 +3427,37 @@ export function makeMessagePortTransport(port) {
3336
3427
  export function start() {
3337
3428
  wasm.start();
3338
3429
  }
3339
- export function __wbg___wasm_refgen_toWasmCommitWithBlob_4c1dc5cc453af7eb(arg0) {
3430
+ export function __wbg___wasm_refgen_toWasmCommitWithBlob_fcbd230cf952f128(arg0) {
3340
3431
  const ret = arg0.__wasm_refgen_toWasmCommitWithBlob();
3341
3432
  _assertClass(ret, CommitWithBlob);
3342
3433
  var ptr1 = ret.__destroy_into_raw();
3343
3434
  return ptr1;
3344
3435
  }
3345
- export function __wbg___wasm_refgen_toWasmDepth_e11bce6176c8257e(arg0) {
3436
+ export function __wbg___wasm_refgen_toWasmDepth_4f8de5b877457c3d(arg0) {
3346
3437
  const ret = arg0.__wasm_refgen_toWasmDepth();
3347
3438
  _assertClass(ret, Depth);
3348
3439
  var ptr1 = ret.__destroy_into_raw();
3349
3440
  return ptr1;
3350
3441
  }
3351
- export function __wbg___wasm_refgen_toWasmDigest_86d449f5dc99fc6a(arg0) {
3442
+ export function __wbg___wasm_refgen_toWasmDigest_d0fbca90d003e5b2(arg0) {
3352
3443
  const ret = arg0.__wasm_refgen_toWasmDigest();
3353
3444
  _assertClass(ret, Digest);
3354
3445
  var ptr1 = ret.__destroy_into_raw();
3355
3446
  return ptr1;
3356
3447
  }
3357
- export function __wbg___wasm_refgen_toWasmFragmentWithBlob_d7450dc251166eea(arg0) {
3448
+ export function __wbg___wasm_refgen_toWasmFragmentWithBlob_814bb2b3d862ac90(arg0) {
3358
3449
  const ret = arg0.__wasm_refgen_toWasmFragmentWithBlob();
3359
3450
  _assertClass(ret, FragmentWithBlob);
3360
3451
  var ptr1 = ret.__destroy_into_raw();
3361
3452
  return ptr1;
3362
3453
  }
3363
- export function __wbg___wasm_refgen_toWasmFragment_03b5e19d20693b4f(arg0) {
3454
+ export function __wbg___wasm_refgen_toWasmFragment_32ab33a0a1cf967b(arg0) {
3364
3455
  const ret = arg0.__wasm_refgen_toWasmFragment();
3365
3456
  _assertClass(ret, Fragment);
3366
3457
  var ptr1 = ret.__destroy_into_raw();
3367
3458
  return ptr1;
3368
3459
  }
3369
- export function __wbg___wasm_refgen_toWasmLooseCommit_bc6f015053af2dd7(arg0) {
3460
+ export function __wbg___wasm_refgen_toWasmLooseCommit_6deda612421ca7e6(arg0) {
3370
3461
  const ret = arg0.__wasm_refgen_toWasmLooseCommit();
3371
3462
  _assertClass(ret, LooseCommit);
3372
3463
  var ptr1 = ret.__destroy_into_raw();
@@ -3440,16 +3531,24 @@ export function __wbg_authenticatedwebsocket_new(arg0) {
3440
3531
  const ret = AuthenticatedWebSocket.__wrap(arg0);
3441
3532
  return ret;
3442
3533
  }
3443
- export function __wbg_authorizeConnect_0e61e98d289a37c9() { return handleError(function (arg0, arg1) {
3444
- const ret = arg0.authorizeConnect(arg1);
3534
+ export function __wbg_authorizeConnect_8e2609308bbbbcfd() { return handleError(function (arg0, arg1) {
3535
+ const ret = arg0.authorizeConnect(PeerId.__wrap(arg1));
3536
+ return ret;
3537
+ }, arguments); }
3538
+ export function __wbg_authorizeFetch_b7bcc4e437112c73() { return handleError(function (arg0, arg1, arg2) {
3539
+ const ret = arg0.authorizeFetch(PeerId.__wrap(arg1), SedimentreeId.__wrap(arg2));
3445
3540
  return ret;
3446
3541
  }, arguments); }
3447
- export function __wbg_authorizeFetch_88703389e9c295d0() { return handleError(function (arg0, arg1, arg2) {
3448
- const ret = arg0.authorizeFetch(arg1, arg2);
3542
+ export function __wbg_authorizePublish_7e546fc3d8103532() { return handleError(function (arg0, arg1, arg2) {
3543
+ const ret = arg0.authorizePublish(PeerId.__wrap(arg1), Topic.__wrap(arg2));
3449
3544
  return ret;
3450
3545
  }, arguments); }
3451
- export function __wbg_authorizePut_dab9270462803778() { return handleError(function (arg0, arg1, arg2, arg3) {
3452
- const ret = arg0.authorizePut(arg1, arg2, arg3);
3546
+ export function __wbg_authorizePut_ba5a5e36c9e9bbfa() { return handleError(function (arg0, arg1, arg2, arg3) {
3547
+ const ret = arg0.authorizePut(PeerId.__wrap(arg1), PeerId.__wrap(arg2), SedimentreeId.__wrap(arg3));
3548
+ return ret;
3549
+ }, arguments); }
3550
+ export function __wbg_authorizeSubscribe_34f5ba6f23bab853() { return handleError(function (arg0, arg1, arg2) {
3551
+ const ret = arg0.authorizeSubscribe(PeerId.__wrap(arg1), Topic.__wrap(arg2));
3453
3552
  return ret;
3454
3553
  }, arguments); }
3455
3554
  export function __wbg_buffer_60b8043cd926067d(arg0) {
@@ -3468,15 +3567,15 @@ export function __wbg_call_f858478a02f9600f() { return handleError(function (arg
3468
3567
  const ret = arg0.call(arg1, arg2, arg3, arg4);
3469
3568
  return ret;
3470
3569
  }, arguments); }
3471
- export function __wbg_close_574e2788efd7bb53(arg0) {
3472
- arg0.close();
3473
- }
3474
3570
  export function __wbg_close_af26905c832a88cb() { return handleError(function (arg0) {
3475
3571
  arg0.close();
3476
3572
  }, arguments); }
3477
3573
  export function __wbg_close_cbf870bdad0aad99(arg0) {
3478
3574
  arg0.close();
3479
3575
  }
3576
+ export function __wbg_close_f85b3643ad9ed8d4(arg0) {
3577
+ arg0.close();
3578
+ }
3480
3579
  export function __wbg_commitwithblob_new(arg0) {
3481
3580
  const ret = CommitWithBlob.__wrap(arg0);
3482
3581
  return ret;
@@ -3497,11 +3596,11 @@ export function __wbg_data_a3d9ff9cdd801002(arg0) {
3497
3596
  const ret = arg0.data;
3498
3597
  return ret;
3499
3598
  }
3500
- export function __wbg_deleteAllCommits_b0197e590f7fce60(arg0, arg1) {
3599
+ export function __wbg_deleteAllCommits_87e95e34aba169ea(arg0, arg1) {
3501
3600
  const ret = arg0.deleteAllCommits(arg1);
3502
3601
  return ret;
3503
3602
  }
3504
- export function __wbg_deleteAllFragments_f884845698f5afb7(arg0, arg1) {
3603
+ export function __wbg_deleteAllFragments_b5a40f8b94689ee5(arg0, arg1) {
3505
3604
  const ret = arg0.deleteAllFragments(arg1);
3506
3605
  return ret;
3507
3606
  }
@@ -3513,7 +3612,7 @@ export function __wbg_digest_unwrap(arg0) {
3513
3612
  const ret = Digest.__unwrap(arg0);
3514
3613
  return ret;
3515
3614
  }
3516
- export function __wbg_disconnect_849aae59f5879e45(arg0) {
3615
+ export function __wbg_disconnect_91312bb506e834b1(arg0) {
3517
3616
  const ret = arg0.disconnect();
3518
3617
  return ret;
3519
3618
  }
@@ -3540,8 +3639,16 @@ export function __wbg_fetch_f8a611684c3b5fe5(arg0, arg1) {
3540
3639
  const ret = arg0.fetch(arg1);
3541
3640
  return ret;
3542
3641
  }
3543
- export function __wbg_filterAuthorizedFetch_0d6450fa919b271d() { return handleError(function (arg0, arg1, arg2) {
3544
- const ret = arg0.filterAuthorizedFetch(arg1, arg2);
3642
+ export function __wbg_filterAuthorizedFetch_a647f13dc33948f1() { return handleError(function (arg0, arg1, arg2, arg3) {
3643
+ var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
3644
+ wasm.__wbindgen_export5(arg2, arg3 * 4, 4);
3645
+ const ret = arg0.filterAuthorizedFetch(PeerId.__wrap(arg1), v0);
3646
+ return ret;
3647
+ }, arguments); }
3648
+ export function __wbg_filterAuthorizedSubscribers_34bdeaaac0eb31a5() { return handleError(function (arg0, arg1, arg2, arg3) {
3649
+ var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
3650
+ wasm.__wbindgen_export5(arg2, arg3 * 4, 4);
3651
+ const ret = arg0.filterAuthorizedSubscribers(Topic.__wrap(arg1), v0);
3545
3652
  return ret;
3546
3653
  }, arguments); }
3547
3654
  export function __wbg_fragment_new(arg0) {
@@ -3732,15 +3839,15 @@ export function __wbg_length_ea16607d7b61445b(arg0) {
3732
3839
  const ret = arg0.length;
3733
3840
  return ret;
3734
3841
  }
3735
- export function __wbg_loadAllCommits_0e97df07ed213aa0(arg0, arg1) {
3842
+ export function __wbg_loadAllCommits_1b040f2bd61f63de(arg0, arg1) {
3736
3843
  const ret = arg0.loadAllCommits(arg1);
3737
3844
  return ret;
3738
3845
  }
3739
- export function __wbg_loadAllFragments_12ecf8f9bd0e0b58(arg0, arg1) {
3846
+ export function __wbg_loadAllFragments_cf081afbfee53965(arg0, arg1) {
3740
3847
  const ret = arg0.loadAllFragments(arg1);
3741
3848
  return ret;
3742
3849
  }
3743
- export function __wbg_loadAllSedimentreeIds_1a18451ef1f8e795(arg0) {
3850
+ export function __wbg_loadAllSedimentreeIds_a9046bfade082517(arg0) {
3744
3851
  const ret = arg0.loadAllSedimentreeIds();
3745
3852
  return ret;
3746
3853
  }
@@ -3783,7 +3890,7 @@ export function __wbg_new_d098e265629cd10f(arg0, arg1) {
3783
3890
  const a = state0.a;
3784
3891
  state0.a = 0;
3785
3892
  try {
3786
- return __wasm_bindgen_func_elem_1605_191(a, state0.b, arg0, arg1);
3893
+ return __wasm_bindgen_func_elem_1651_194(a, state0.b, arg0, arg1);
3787
3894
  } finally {
3788
3895
  state0.a = a;
3789
3896
  }
@@ -3817,7 +3924,7 @@ export function __wbg_new_typed_aaaeaf29cf802876(arg0, arg1) {
3817
3924
  const a = state0.a;
3818
3925
  state0.a = 0;
3819
3926
  try {
3820
- return __wasm_bindgen_func_elem_1605_192(a, state0.b, arg0, arg1);
3927
+ return __wasm_bindgen_func_elem_1651_195(a, state0.b, arg0, arg1);
3821
3928
  } finally {
3822
3929
  state0.a = a;
3823
3930
  }
@@ -3832,6 +3939,10 @@ export function __wbg_new_typed_bccac67128ed885a() {
3832
3939
  const ret = new Array();
3833
3940
  return ret;
3834
3941
  }
3942
+ export function __wbg_new_with_length_3259a525196bd8cc(arg0) {
3943
+ const ret = new Array(arg0 >>> 0);
3944
+ return ret;
3945
+ }
3835
3946
  export function __wbg_new_with_length_825018a1616e9e55(arg0) {
3836
3947
  const ret = new Uint8Array(arg0 >>> 0);
3837
3948
  return ret;
@@ -3864,7 +3975,7 @@ export function __wbg_of_d6376e3774c51f89(arg0, arg1) {
3864
3975
  const ret = Array.of(arg0, arg1);
3865
3976
  return ret;
3866
3977
  }
3867
- export function __wbg_onDisconnect_12d6884490508121(arg0, arg1) {
3978
+ export function __wbg_onDisconnect_a24437def131c941(arg0, arg1) {
3868
3979
  arg0.onDisconnect(arg1);
3869
3980
  }
3870
3981
  export function __wbg_open_e7a9d3d6344572f6() { return handleError(function (arg0, arg1, arg2, arg3) {
@@ -3891,7 +4002,7 @@ export function __wbg_port2_947a51b8ba00adc9(arg0) {
3891
4002
  const ret = arg0.port2;
3892
4003
  return ret;
3893
4004
  }
3894
- export function __wbg_postMessage_0541d6c31330afe3(arg0, arg1) {
4005
+ export function __wbg_postMessage_fb1c205fdbbf796d(arg0, arg1) {
3895
4006
  arg0.postMessage(arg1);
3896
4007
  }
3897
4008
  export function __wbg_process_44c7a14e11e9f69e(arg0) {
@@ -3923,7 +4034,7 @@ export function __wbg_readyState_1f1e7f1bdf9f4d42(arg0) {
3923
4034
  const ret = arg0.readyState;
3924
4035
  return ret;
3925
4036
  }
3926
- export function __wbg_recvBytes_c85b12fb48cd7a35(arg0) {
4037
+ export function __wbg_recvBytes_e13f381294da16db(arg0) {
3927
4038
  const ret = arg0.recvBytes();
3928
4039
  return ret;
3929
4040
  }
@@ -3939,15 +4050,19 @@ export function __wbg_result_c5baa2d3d690a01a() { return handleError(function (a
3939
4050
  const ret = arg0.result;
3940
4051
  return ret;
3941
4052
  }, arguments); }
3942
- export function __wbg_saveCommit_02f095436fc502e0(arg0, arg1, arg2, arg3, arg4) {
4053
+ export function __wbg_saveBatchAll_b9359532f5a65936(arg0, arg1, arg2, arg3) {
4054
+ const ret = arg0.saveBatchAll(arg1, arg2, arg3);
4055
+ return ret;
4056
+ }
4057
+ export function __wbg_saveCommit_f6c4180a159edfdf(arg0, arg1, arg2, arg3, arg4) {
3943
4058
  const ret = arg0.saveCommit(arg1, arg2, arg3, arg4);
3944
4059
  return ret;
3945
4060
  }
3946
- export function __wbg_saveFragment_7681b2171b8cfb35(arg0, arg1, arg2, arg3, arg4) {
4061
+ export function __wbg_saveFragment_49505af74bd5abe3(arg0, arg1, arg2, arg3, arg4) {
3947
4062
  const ret = arg0.saveFragment(arg1, arg2, arg3, arg4);
3948
4063
  return ret;
3949
4064
  }
3950
- export function __wbg_saveSedimentreeId_c265aaeef5af34b6(arg0, arg1) {
4065
+ export function __wbg_saveSedimentreeId_7b6b4310628fe78c(arg0, arg1) {
3951
4066
  const ret = arg0.saveSedimentreeId(arg1);
3952
4067
  return ret;
3953
4068
  }
@@ -3959,17 +4074,20 @@ export function __wbg_sedimentreeid_unwrap(arg0) {
3959
4074
  const ret = SedimentreeId.__unwrap(arg0);
3960
4075
  return ret;
3961
4076
  }
3962
- export function __wbg_sendBytes_e6262dd74f1c260a(arg0, arg1) {
4077
+ export function __wbg_sendBytes_9a00cdaf7c891eff(arg0, arg1) {
3963
4078
  const ret = arg0.sendBytes(arg1);
3964
4079
  return ret;
3965
4080
  }
3966
4081
  export function __wbg_send_d31a693c975dea74() { return handleError(function (arg0, arg1, arg2) {
3967
4082
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
3968
4083
  }, arguments); }
3969
- export function __wbg_setTimeout_7829585928963a1f(arg0, arg1) {
4084
+ export function __wbg_setTimeout_43db2c2050a4d3d2(arg0, arg1) {
3970
4085
  const ret = setTimeout(arg0, arg1);
3971
4086
  return ret;
3972
4087
  }
4088
+ export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
4089
+ arg0[arg1 >>> 0] = arg2;
4090
+ }
3973
4091
  export function __wbg_set_7eaa4f96924fd6b3() { return handleError(function (arg0, arg1, arg2) {
3974
4092
  const ret = Reflect.set(arg0, arg1, arg2);
3975
4093
  return ret;
@@ -4004,7 +4122,7 @@ export function __wbg_set_onerror_8a268cb237177bba(arg0, arg1) {
4004
4122
  export function __wbg_set_onerror_901ca711f94a5bbb(arg0, arg1) {
4005
4123
  arg0.onerror = arg1;
4006
4124
  }
4007
- export function __wbg_set_onmessage_29558b29aee9a78a(arg0, arg1) {
4125
+ export function __wbg_set_onmessage_284248c97c42cb93(arg0, arg1) {
4008
4126
  arg0.onmessage = arg1;
4009
4127
  }
4010
4128
  export function __wbg_set_onmessage_6f80ab771bf151aa(arg0, arg1) {
@@ -4023,7 +4141,7 @@ export function __wbg_sign_a34d057afd14c54d() { return handleError(function (arg
4023
4141
  const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
4024
4142
  return ret;
4025
4143
  }, arguments); }
4026
- export function __wbg_sign_d03455abc6736428(arg0, arg1) {
4144
+ export function __wbg_sign_e6fa76bd4ef9c75a(arg0, arg1) {
4027
4145
  const ret = arg0.sign(arg1);
4028
4146
  return ret;
4029
4147
  }
@@ -4097,6 +4215,14 @@ export function __wbg_then_9e335f6dd892bc11(arg0, arg1, arg2) {
4097
4215
  const ret = arg0.then(arg1, arg2);
4098
4216
  return ret;
4099
4217
  }
4218
+ export function __wbg_topic_new(arg0) {
4219
+ const ret = Topic.__wrap(arg0);
4220
+ return ret;
4221
+ }
4222
+ export function __wbg_topic_unwrap(arg0) {
4223
+ const ret = Topic.__unwrap(arg0);
4224
+ return ret;
4225
+ }
4100
4226
  export function __wbg_transaction_1309b463c399d2b3() { return handleError(function (arg0, arg1, arg2, arg3) {
4101
4227
  const ret = arg0.transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
4102
4228
  return ret;
@@ -4105,14 +4231,14 @@ export function __wbg_transaction_2237af0233efbdf3() { return handleError(functi
4105
4231
  const ret = arg0.transaction(getStringFromWasm0(arg1, arg2));
4106
4232
  return ret;
4107
4233
  }, arguments); }
4108
- export function __wbg_tryIntoJsSedimentreeIdsArray_d6337c0aa0f28604() { return handleError(function (arg0, arg1) {
4234
+ export function __wbg_tryIntoJsSedimentreeIdsArray_6803cc05ac20ff4f() { return handleError(function (arg0, arg1) {
4109
4235
  const ret = tryIntoJsSedimentreeIdsArray(arg1);
4110
4236
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
4111
4237
  const len1 = WASM_VECTOR_LEN;
4112
4238
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4113
4239
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4114
4240
  }, arguments); }
4115
- export function __wbg_verifyingKey_29533740d75f8cdb(arg0) {
4241
+ export function __wbg_verifyingKey_28c38fc6525caed5(arg0) {
4116
4242
  const ret = arg0.verifyingKey();
4117
4243
  return ret;
4118
4244
  }
@@ -4126,32 +4252,32 @@ export function __wbg_webcryptosigner_new(arg0) {
4126
4252
  }
4127
4253
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
4128
4254
  // 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);
4255
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638);
4130
4256
  return ret;
4131
4257
  }
4132
4258
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
4133
4259
  // 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);
4260
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_1);
4135
4261
  return ret;
4136
4262
  }
4137
4263
  export function __wbindgen_cast_0000000000000003(arg0, arg1) {
4138
4264
  // 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);
4265
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_2);
4140
4266
  return ret;
4141
4267
  }
4142
4268
  export function __wbindgen_cast_0000000000000004(arg0, arg1) {
4143
4269
  // 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);
4270
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_3);
4145
4271
  return ret;
4146
4272
  }
4147
4273
  export function __wbindgen_cast_0000000000000005(arg0, arg1) {
4148
4274
  // 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);
4275
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_637);
4150
4276
  return ret;
4151
4277
  }
4152
4278
  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);
4279
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 672, function: Function { arguments: [Externref], shim_idx: 756, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4280
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_1651);
4155
4281
  return ret;
4156
4282
  }
4157
4283
  export function __wbindgen_cast_0000000000000007(arg0) {
@@ -4213,39 +4339,39 @@ export function __wbindgen_init_externref_table() {
4213
4339
  table.set(offset + 2, true);
4214
4340
  table.set(offset + 3, false);
4215
4341
  }
4216
- function __wasm_bindgen_func_elem_589(arg0, arg1) {
4217
- wasm.__wasm_bindgen_func_elem_589(arg0, arg1);
4342
+ function __wasm_bindgen_func_elem_637(arg0, arg1) {
4343
+ wasm.__wasm_bindgen_func_elem_637(arg0, arg1);
4218
4344
  }
4219
4345
 
4220
- function __wasm_bindgen_func_elem_590(arg0, arg1, arg2) {
4221
- wasm.__wasm_bindgen_func_elem_590(arg0, arg1, arg2);
4346
+ function __wasm_bindgen_func_elem_638(arg0, arg1, arg2) {
4347
+ wasm.__wasm_bindgen_func_elem_638(arg0, arg1, arg2);
4222
4348
  }
4223
4349
 
4224
- function __wasm_bindgen_func_elem_590_1(arg0, arg1, arg2) {
4225
- wasm.__wasm_bindgen_func_elem_590_1(arg0, arg1, arg2);
4350
+ function __wasm_bindgen_func_elem_638_1(arg0, arg1, arg2) {
4351
+ wasm.__wasm_bindgen_func_elem_638_1(arg0, arg1, arg2);
4226
4352
  }
4227
4353
 
4228
- function __wasm_bindgen_func_elem_590_2(arg0, arg1, arg2) {
4229
- wasm.__wasm_bindgen_func_elem_590_2(arg0, arg1, arg2);
4354
+ function __wasm_bindgen_func_elem_638_2(arg0, arg1, arg2) {
4355
+ wasm.__wasm_bindgen_func_elem_638_2(arg0, arg1, arg2);
4230
4356
  }
4231
4357
 
4232
- function __wasm_bindgen_func_elem_590_3(arg0, arg1, arg2) {
4233
- wasm.__wasm_bindgen_func_elem_590_3(arg0, arg1, arg2);
4358
+ function __wasm_bindgen_func_elem_638_3(arg0, arg1, arg2) {
4359
+ wasm.__wasm_bindgen_func_elem_638_3(arg0, arg1, arg2);
4234
4360
  }
4235
4361
 
4236
- function __wasm_bindgen_func_elem_1605(arg0, arg1, arg2) {
4237
- const ret = wasm.__wasm_bindgen_func_elem_1605(arg0, arg1, arg2);
4362
+ function __wasm_bindgen_func_elem_1651(arg0, arg1, arg2) {
4363
+ const ret = wasm.__wasm_bindgen_func_elem_1651(arg0, arg1, arg2);
4238
4364
  if (ret[1]) {
4239
4365
  throw takeFromExternrefTable0(ret[0]);
4240
4366
  }
4241
4367
  }
4242
4368
 
4243
- function __wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3) {
4244
- wasm.__wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3);
4369
+ function __wasm_bindgen_func_elem_1651_194(arg0, arg1, arg2, arg3) {
4370
+ wasm.__wasm_bindgen_func_elem_1651_194(arg0, arg1, arg2, arg3);
4245
4371
  }
4246
4372
 
4247
- function __wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3) {
4248
- wasm.__wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3);
4373
+ function __wasm_bindgen_func_elem_1651_195(arg0, arg1, arg2, arg3) {
4374
+ wasm.__wasm_bindgen_func_elem_1651_195(arg0, arg1, arg2, arg3);
4249
4375
  }
4250
4376
 
4251
4377
 
@@ -4358,6 +4484,9 @@ const SubductionFinalization = (typeof FinalizationRegistry === 'undefined')
4358
4484
  const SyncStatsFinalization = (typeof FinalizationRegistry === 'undefined')
4359
4485
  ? { register: () => {}, unregister: () => {} }
4360
4486
  : new FinalizationRegistry(ptr => wasm.__wbg_syncstats_free(ptr >>> 0, 1));
4487
+ const TopicFinalization = (typeof FinalizationRegistry === 'undefined')
4488
+ ? { register: () => {}, unregister: () => {} }
4489
+ : new FinalizationRegistry(ptr => wasm.__wbg_topic_free(ptr >>> 0, 1));
4361
4490
  const SubductionWebSocketFinalization = (typeof FinalizationRegistry === 'undefined')
4362
4491
  ? { register: () => {}, unregister: () => {} }
4363
4492
  : new FinalizationRegistry(ptr => wasm.__wbg_subductionwebsocket_free(ptr >>> 0, 1));