@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,5 +1,5 @@
1
1
  /* @ts-self-types="./subduction_wasm.d.ts" */
2
- import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-1de4a01519b0f11f/inline2.js';
2
+ import { tryIntoJsSedimentreeIdsArray } from './snippets/sedimentree_wasm-75027ecce41278de/inline2.js';
3
3
 
4
4
  /**
5
5
  * An authenticated HTTP long-poll transport.
@@ -2410,6 +2410,10 @@ export class Subduction {
2410
2410
  * When set, clients can connect without knowing the server's peer ID.
2411
2411
  * * `hash_metric_override` - Optional custom depth metric function
2412
2412
  * * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
2413
+ * * `policy` - Optional connection/storage authorization policy.
2414
+ * Defaults to allow-all.
2415
+ * * `ephemeral_policy` - Optional ephemeral message authorization policy.
2416
+ * Defaults to allow-all.
2413
2417
  *
2414
2418
  * # Panics
2415
2419
  *
@@ -2424,15 +2428,16 @@ export class Subduction {
2424
2428
  * @param {string | null} [service_name]
2425
2429
  * @param {(digest: Digest) => Depth | null} [hash_metric_override]
2426
2430
  * @param {number | null} [max_pending_blob_requests]
2427
- * @param {any | null} [policy]
2431
+ * @param {Policy | null} [policy]
2432
+ * @param {EphemeralPolicy | null} [ephemeral_policy]
2428
2433
  * @param {Function | null} [on_remote_heads]
2429
2434
  * @param {Function | null} [on_ephemeral]
2430
2435
  * @returns {Promise<Subduction>}
2431
2436
  */
2432
- static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
2437
+ static hydrate(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, ephemeral_policy, on_remote_heads, on_ephemeral) {
2433
2438
  var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2434
2439
  var len0 = WASM_VECTOR_LEN;
2435
- 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));
2440
+ 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));
2436
2441
  return ret;
2437
2442
  }
2438
2443
  /**
@@ -2467,9 +2472,10 @@ export class Subduction {
2467
2472
  * When set, clients can connect without knowing the server's peer ID.
2468
2473
  * * `hash_metric_override` - Optional custom depth metric function
2469
2474
  * * `max_pending_blob_requests` - Optional maximum number of pending blob requests (default: 10,000)
2470
- * * `policy` - Optional JS object implementing authorization.
2471
- * Must have `authorizeConnect(...)`, `authorizeFetch(...)`, `authorizePut(...)`,
2472
- * `filterAuthorizedFetch(...)`. Defaults to allow-all.
2475
+ * * `policy` - Optional connection/storage authorization policy.
2476
+ * Defaults to allow-all.
2477
+ * * `ephemeral_policy` - Optional ephemeral message authorization policy.
2478
+ * Defaults to allow-all.
2473
2479
  *
2474
2480
  * # Panics
2475
2481
  *
@@ -2480,32 +2486,37 @@ export class Subduction {
2480
2486
  * @param {string | null} [service_name]
2481
2487
  * @param {(digest: Digest) => Depth | null} [hash_metric_override]
2482
2488
  * @param {number | null} [max_pending_blob_requests]
2483
- * @param {any | null} [policy]
2489
+ * @param {Policy | null} [policy]
2490
+ * @param {EphemeralPolicy | null} [ephemeral_policy]
2484
2491
  * @param {Function | null} [on_remote_heads]
2485
2492
  * @param {Function | null} [on_ephemeral]
2486
2493
  */
2487
- constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, on_remote_heads, on_ephemeral) {
2494
+ constructor(signer, storage, service_name, hash_metric_override, max_pending_blob_requests, policy, ephemeral_policy, on_remote_heads, on_ephemeral) {
2488
2495
  var ptr0 = isLikeNone(service_name) ? 0 : passStringToWasm0(service_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2489
2496
  var len0 = WASM_VECTOR_LEN;
2490
- 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));
2497
+ 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));
2491
2498
  this.__wbg_ptr = ret >>> 0;
2492
2499
  SubductionFinalization.register(this, this.__wbg_ptr, this);
2493
2500
  return this;
2494
2501
  }
2495
2502
  /**
2496
- * Publish an ephemeral message to all subscribers of a sedimentree.
2503
+ * Publish an ephemeral message to all subscribers of a topic.
2497
2504
  *
2498
2505
  * The payload is opaque bytes — encoding is the caller's responsibility.
2499
2506
  * Messages are fire-and-forget; delivery is best-effort.
2500
- * @param {SedimentreeId} id
2507
+ *
2508
+ * # Panics
2509
+ *
2510
+ * Panics if the platform's random number generator fails.
2511
+ * @param {Topic} topic
2501
2512
  * @param {Uint8Array} payload
2502
2513
  * @returns {Promise<void>}
2503
2514
  */
2504
- publishEphemeral(id, payload) {
2505
- _assertClass(id, SedimentreeId);
2515
+ publishEphemeral(topic, payload) {
2516
+ _assertClass(topic, Topic);
2506
2517
  const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
2507
2518
  const len0 = WASM_VECTOR_LEN;
2508
- const ret = wasm.subduction_publishEphemeral(this.__wbg_ptr, id.__wbg_ptr, ptr0, len0);
2519
+ const ret = wasm.subduction_publishEphemeral(this.__wbg_ptr, topic.__wbg_ptr, ptr0, len0);
2509
2520
  return ret;
2510
2521
  }
2511
2522
  /**
@@ -2552,13 +2563,13 @@ export class Subduction {
2552
2563
  return ret;
2553
2564
  }
2554
2565
  /**
2555
- * Subscribe to ephemeral messages for the given sedimentree IDs
2566
+ * Subscribe to ephemeral messages for the given topics
2556
2567
  * from all connected peers.
2557
- * @param {SedimentreeId[]} ids
2568
+ * @param {Topic[]} topics
2558
2569
  * @returns {Promise<void>}
2559
2570
  */
2560
- subscribeEphemeral(ids) {
2561
- const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
2571
+ subscribeEphemeral(topics) {
2572
+ const ptr0 = passArrayJsValueToWasm0(topics, wasm.__wbindgen_export);
2562
2573
  const len0 = WASM_VECTOR_LEN;
2563
2574
  const ret = wasm.subduction_subscribeEphemeral(this.__wbg_ptr, ptr0, len0);
2564
2575
  return ret;
@@ -2611,13 +2622,13 @@ export class Subduction {
2611
2622
  return ret;
2612
2623
  }
2613
2624
  /**
2614
- * Unsubscribe from ephemeral messages for the given sedimentree IDs
2625
+ * Unsubscribe from ephemeral messages for the given topics
2615
2626
  * from all connected peers.
2616
- * @param {SedimentreeId[]} ids
2627
+ * @param {Topic[]} topics
2617
2628
  * @returns {Promise<void>}
2618
2629
  */
2619
- unsubscribeEphemeral(ids) {
2620
- const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_export);
2630
+ unsubscribeEphemeral(topics) {
2631
+ const ptr0 = passArrayJsValueToWasm0(topics, wasm.__wbindgen_export);
2621
2632
  const len0 = WASM_VECTOR_LEN;
2622
2633
  const ret = wasm.subduction_unsubscribeEphemeral(this.__wbg_ptr, ptr0, len0);
2623
2634
  return ret;
@@ -3232,6 +3243,86 @@ export class SyncStats {
3232
3243
  }
3233
3244
  if (Symbol.dispose) SyncStats.prototype[Symbol.dispose] = SyncStats.prototype.free;
3234
3245
 
3246
+ /**
3247
+ * A Wasm wrapper around the ephemeral [`Topic`] type.
3248
+ *
3249
+ * Topics are opaque 32-byte identifiers for ephemeral pubsub channels.
3250
+ * A [`SedimentreeId`] can be used as a topic, but topics are not
3251
+ * limited to sedimentrees.
3252
+ *
3253
+ * [`SedimentreeId`]: sedimentree_core::id::SedimentreeId
3254
+ */
3255
+ export class Topic {
3256
+ static __wrap(ptr) {
3257
+ ptr = ptr >>> 0;
3258
+ const obj = Object.create(Topic.prototype);
3259
+ obj.__wbg_ptr = ptr;
3260
+ TopicFinalization.register(obj, obj.__wbg_ptr, obj);
3261
+ return obj;
3262
+ }
3263
+ static __unwrap(jsValue) {
3264
+ if (!(jsValue instanceof Topic)) {
3265
+ return 0;
3266
+ }
3267
+ return jsValue.__destroy_into_raw();
3268
+ }
3269
+ __destroy_into_raw() {
3270
+ const ptr = this.__wbg_ptr;
3271
+ this.__wbg_ptr = 0;
3272
+ TopicFinalization.unregister(this);
3273
+ return ptr;
3274
+ }
3275
+ free() {
3276
+ const ptr = this.__destroy_into_raw();
3277
+ wasm.__wbg_topic_free(ptr, 0);
3278
+ }
3279
+ /**
3280
+ * Create a topic from a 32-byte array.
3281
+ *
3282
+ * # Errors
3283
+ *
3284
+ * Returns an error if the provided byte array is not exactly 32 bytes.
3285
+ * @param {Uint8Array} bytes
3286
+ * @returns {Topic}
3287
+ */
3288
+ static fromBytes(bytes) {
3289
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
3290
+ const len0 = WASM_VECTOR_LEN;
3291
+ const ret = wasm.topic_fromBytes(ptr0, len0);
3292
+ if (ret[2]) {
3293
+ throw takeFromExternrefTable0(ret[1]);
3294
+ }
3295
+ return Topic.__wrap(ret[0]);
3296
+ }
3297
+ /**
3298
+ * Returns the raw 32 bytes of this topic.
3299
+ * @returns {Uint8Array}
3300
+ */
3301
+ toBytes() {
3302
+ const ret = wasm.topic_toBytes(this.__wbg_ptr);
3303
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3304
+ wasm.__wbindgen_export5(ret[0], ret[1] * 1, 1);
3305
+ return v1;
3306
+ }
3307
+ /**
3308
+ * Returns a shortened hex prefix representation (first 4 bytes + `…`).
3309
+ * @returns {string}
3310
+ */
3311
+ toString() {
3312
+ let deferred1_0;
3313
+ let deferred1_1;
3314
+ try {
3315
+ const ret = wasm.topic_toString(this.__wbg_ptr);
3316
+ deferred1_0 = ret[0];
3317
+ deferred1_1 = ret[1];
3318
+ return getStringFromWasm0(ret[0], ret[1]);
3319
+ } finally {
3320
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
3321
+ }
3322
+ }
3323
+ }
3324
+ if (Symbol.dispose) Topic.prototype[Symbol.dispose] = Topic.prototype.free;
3325
+
3235
3326
  /**
3236
3327
  * An Ed25519 signer using the browser's `WebCrypto` API.
3237
3328
  *
@@ -3337,42 +3428,43 @@ export function makeMessagePortTransport(port) {
3337
3428
  export function start() {
3338
3429
  wasm.start();
3339
3430
  }
3340
- import * as import1 from "./snippets/subduction_wasm-0ed7fd66cebca59f/inline0.js"
3431
+ import * as import1 from "./snippets/subduction_wasm-ec51bcf335db35bd/inline0.js"
3432
+ import * as import2 from "./snippets/subduction_wasm-ec51bcf335db35bd/inline1.js"
3341
3433
 
3342
3434
  function __wbg_get_imports() {
3343
3435
  const import0 = {
3344
3436
  __proto__: null,
3345
- __wbg___wasm_refgen_toWasmCommitWithBlob_4c1dc5cc453af7eb: function(arg0) {
3437
+ __wbg___wasm_refgen_toWasmCommitWithBlob_fcbd230cf952f128: function(arg0) {
3346
3438
  const ret = arg0.__wasm_refgen_toWasmCommitWithBlob();
3347
3439
  _assertClass(ret, CommitWithBlob);
3348
3440
  var ptr1 = ret.__destroy_into_raw();
3349
3441
  return ptr1;
3350
3442
  },
3351
- __wbg___wasm_refgen_toWasmDepth_e11bce6176c8257e: function(arg0) {
3443
+ __wbg___wasm_refgen_toWasmDepth_4f8de5b877457c3d: function(arg0) {
3352
3444
  const ret = arg0.__wasm_refgen_toWasmDepth();
3353
3445
  _assertClass(ret, Depth);
3354
3446
  var ptr1 = ret.__destroy_into_raw();
3355
3447
  return ptr1;
3356
3448
  },
3357
- __wbg___wasm_refgen_toWasmDigest_86d449f5dc99fc6a: function(arg0) {
3449
+ __wbg___wasm_refgen_toWasmDigest_d0fbca90d003e5b2: function(arg0) {
3358
3450
  const ret = arg0.__wasm_refgen_toWasmDigest();
3359
3451
  _assertClass(ret, Digest);
3360
3452
  var ptr1 = ret.__destroy_into_raw();
3361
3453
  return ptr1;
3362
3454
  },
3363
- __wbg___wasm_refgen_toWasmFragmentWithBlob_d7450dc251166eea: function(arg0) {
3455
+ __wbg___wasm_refgen_toWasmFragmentWithBlob_814bb2b3d862ac90: function(arg0) {
3364
3456
  const ret = arg0.__wasm_refgen_toWasmFragmentWithBlob();
3365
3457
  _assertClass(ret, FragmentWithBlob);
3366
3458
  var ptr1 = ret.__destroy_into_raw();
3367
3459
  return ptr1;
3368
3460
  },
3369
- __wbg___wasm_refgen_toWasmFragment_03b5e19d20693b4f: function(arg0) {
3461
+ __wbg___wasm_refgen_toWasmFragment_32ab33a0a1cf967b: function(arg0) {
3370
3462
  const ret = arg0.__wasm_refgen_toWasmFragment();
3371
3463
  _assertClass(ret, Fragment);
3372
3464
  var ptr1 = ret.__destroy_into_raw();
3373
3465
  return ptr1;
3374
3466
  },
3375
- __wbg___wasm_refgen_toWasmLooseCommit_bc6f015053af2dd7: function(arg0) {
3467
+ __wbg___wasm_refgen_toWasmLooseCommit_6deda612421ca7e6: function(arg0) {
3376
3468
  const ret = arg0.__wasm_refgen_toWasmLooseCommit();
3377
3469
  _assertClass(ret, LooseCommit);
3378
3470
  var ptr1 = ret.__destroy_into_raw();
@@ -3446,16 +3538,24 @@ function __wbg_get_imports() {
3446
3538
  const ret = AuthenticatedWebSocket.__wrap(arg0);
3447
3539
  return ret;
3448
3540
  },
3449
- __wbg_authorizeConnect_0e61e98d289a37c9: function() { return handleError(function (arg0, arg1) {
3450
- const ret = arg0.authorizeConnect(arg1);
3541
+ __wbg_authorizeConnect_8e2609308bbbbcfd: function() { return handleError(function (arg0, arg1) {
3542
+ const ret = arg0.authorizeConnect(PeerId.__wrap(arg1));
3543
+ return ret;
3544
+ }, arguments); },
3545
+ __wbg_authorizeFetch_b7bcc4e437112c73: function() { return handleError(function (arg0, arg1, arg2) {
3546
+ const ret = arg0.authorizeFetch(PeerId.__wrap(arg1), SedimentreeId.__wrap(arg2));
3451
3547
  return ret;
3452
3548
  }, arguments); },
3453
- __wbg_authorizeFetch_88703389e9c295d0: function() { return handleError(function (arg0, arg1, arg2) {
3454
- const ret = arg0.authorizeFetch(arg1, arg2);
3549
+ __wbg_authorizePublish_7e546fc3d8103532: function() { return handleError(function (arg0, arg1, arg2) {
3550
+ const ret = arg0.authorizePublish(PeerId.__wrap(arg1), Topic.__wrap(arg2));
3455
3551
  return ret;
3456
3552
  }, arguments); },
3457
- __wbg_authorizePut_dab9270462803778: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3458
- const ret = arg0.authorizePut(arg1, arg2, arg3);
3553
+ __wbg_authorizePut_ba5a5e36c9e9bbfa: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3554
+ const ret = arg0.authorizePut(PeerId.__wrap(arg1), PeerId.__wrap(arg2), SedimentreeId.__wrap(arg3));
3555
+ return ret;
3556
+ }, arguments); },
3557
+ __wbg_authorizeSubscribe_34f5ba6f23bab853: function() { return handleError(function (arg0, arg1, arg2) {
3558
+ const ret = arg0.authorizeSubscribe(PeerId.__wrap(arg1), Topic.__wrap(arg2));
3459
3559
  return ret;
3460
3560
  }, arguments); },
3461
3561
  __wbg_buffer_60b8043cd926067d: function(arg0) {
@@ -3474,15 +3574,15 @@ function __wbg_get_imports() {
3474
3574
  const ret = arg0.call(arg1, arg2, arg3, arg4);
3475
3575
  return ret;
3476
3576
  }, arguments); },
3477
- __wbg_close_574e2788efd7bb53: function(arg0) {
3478
- arg0.close();
3479
- },
3480
3577
  __wbg_close_af26905c832a88cb: function() { return handleError(function (arg0) {
3481
3578
  arg0.close();
3482
3579
  }, arguments); },
3483
3580
  __wbg_close_cbf870bdad0aad99: function(arg0) {
3484
3581
  arg0.close();
3485
3582
  },
3583
+ __wbg_close_f85b3643ad9ed8d4: function(arg0) {
3584
+ arg0.close();
3585
+ },
3486
3586
  __wbg_commitwithblob_new: function(arg0) {
3487
3587
  const ret = CommitWithBlob.__wrap(arg0);
3488
3588
  return ret;
@@ -3503,11 +3603,11 @@ function __wbg_get_imports() {
3503
3603
  const ret = arg0.data;
3504
3604
  return ret;
3505
3605
  },
3506
- __wbg_deleteAllCommits_b0197e590f7fce60: function(arg0, arg1) {
3606
+ __wbg_deleteAllCommits_87e95e34aba169ea: function(arg0, arg1) {
3507
3607
  const ret = arg0.deleteAllCommits(arg1);
3508
3608
  return ret;
3509
3609
  },
3510
- __wbg_deleteAllFragments_f884845698f5afb7: function(arg0, arg1) {
3610
+ __wbg_deleteAllFragments_b5a40f8b94689ee5: function(arg0, arg1) {
3511
3611
  const ret = arg0.deleteAllFragments(arg1);
3512
3612
  return ret;
3513
3613
  },
@@ -3519,7 +3619,7 @@ function __wbg_get_imports() {
3519
3619
  const ret = Digest.__unwrap(arg0);
3520
3620
  return ret;
3521
3621
  },
3522
- __wbg_disconnect_849aae59f5879e45: function(arg0) {
3622
+ __wbg_disconnect_91312bb506e834b1: function(arg0) {
3523
3623
  const ret = arg0.disconnect();
3524
3624
  return ret;
3525
3625
  },
@@ -3546,8 +3646,16 @@ function __wbg_get_imports() {
3546
3646
  const ret = arg0.fetch(arg1);
3547
3647
  return ret;
3548
3648
  },
3549
- __wbg_filterAuthorizedFetch_0d6450fa919b271d: function() { return handleError(function (arg0, arg1, arg2) {
3550
- const ret = arg0.filterAuthorizedFetch(arg1, arg2);
3649
+ __wbg_filterAuthorizedFetch_a647f13dc33948f1: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3650
+ var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
3651
+ wasm.__wbindgen_export5(arg2, arg3 * 4, 4);
3652
+ const ret = arg0.filterAuthorizedFetch(PeerId.__wrap(arg1), v0);
3653
+ return ret;
3654
+ }, arguments); },
3655
+ __wbg_filterAuthorizedSubscribers_34bdeaaac0eb31a5: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3656
+ var v0 = getArrayJsValueFromWasm0(arg2, arg3).slice();
3657
+ wasm.__wbindgen_export5(arg2, arg3 * 4, 4);
3658
+ const ret = arg0.filterAuthorizedSubscribers(Topic.__wrap(arg1), v0);
3551
3659
  return ret;
3552
3660
  }, arguments); },
3553
3661
  __wbg_fragment_new: function(arg0) {
@@ -3738,15 +3846,15 @@ function __wbg_get_imports() {
3738
3846
  const ret = arg0.length;
3739
3847
  return ret;
3740
3848
  },
3741
- __wbg_loadAllCommits_0e97df07ed213aa0: function(arg0, arg1) {
3849
+ __wbg_loadAllCommits_1b040f2bd61f63de: function(arg0, arg1) {
3742
3850
  const ret = arg0.loadAllCommits(arg1);
3743
3851
  return ret;
3744
3852
  },
3745
- __wbg_loadAllFragments_12ecf8f9bd0e0b58: function(arg0, arg1) {
3853
+ __wbg_loadAllFragments_cf081afbfee53965: function(arg0, arg1) {
3746
3854
  const ret = arg0.loadAllFragments(arg1);
3747
3855
  return ret;
3748
3856
  },
3749
- __wbg_loadAllSedimentreeIds_1a18451ef1f8e795: function(arg0) {
3857
+ __wbg_loadAllSedimentreeIds_a9046bfade082517: function(arg0) {
3750
3858
  const ret = arg0.loadAllSedimentreeIds();
3751
3859
  return ret;
3752
3860
  },
@@ -3789,7 +3897,7 @@ function __wbg_get_imports() {
3789
3897
  const a = state0.a;
3790
3898
  state0.a = 0;
3791
3899
  try {
3792
- return __wasm_bindgen_func_elem_1605_191(a, state0.b, arg0, arg1);
3900
+ return __wasm_bindgen_func_elem_1651_194(a, state0.b, arg0, arg1);
3793
3901
  } finally {
3794
3902
  state0.a = a;
3795
3903
  }
@@ -3823,7 +3931,7 @@ function __wbg_get_imports() {
3823
3931
  const a = state0.a;
3824
3932
  state0.a = 0;
3825
3933
  try {
3826
- return __wasm_bindgen_func_elem_1605_192(a, state0.b, arg0, arg1);
3934
+ return __wasm_bindgen_func_elem_1651_195(a, state0.b, arg0, arg1);
3827
3935
  } finally {
3828
3936
  state0.a = a;
3829
3937
  }
@@ -3838,6 +3946,10 @@ function __wbg_get_imports() {
3838
3946
  const ret = new Array();
3839
3947
  return ret;
3840
3948
  },
3949
+ __wbg_new_with_length_3259a525196bd8cc: function(arg0) {
3950
+ const ret = new Array(arg0 >>> 0);
3951
+ return ret;
3952
+ },
3841
3953
  __wbg_new_with_length_825018a1616e9e55: function(arg0) {
3842
3954
  const ret = new Uint8Array(arg0 >>> 0);
3843
3955
  return ret;
@@ -3870,7 +3982,7 @@ function __wbg_get_imports() {
3870
3982
  const ret = Array.of(arg0, arg1);
3871
3983
  return ret;
3872
3984
  },
3873
- __wbg_onDisconnect_12d6884490508121: function(arg0, arg1) {
3985
+ __wbg_onDisconnect_a24437def131c941: function(arg0, arg1) {
3874
3986
  arg0.onDisconnect(arg1);
3875
3987
  },
3876
3988
  __wbg_open_e7a9d3d6344572f6: function() { return handleError(function (arg0, arg1, arg2, arg3) {
@@ -3897,7 +4009,7 @@ function __wbg_get_imports() {
3897
4009
  const ret = arg0.port2;
3898
4010
  return ret;
3899
4011
  },
3900
- __wbg_postMessage_0541d6c31330afe3: function(arg0, arg1) {
4012
+ __wbg_postMessage_fb1c205fdbbf796d: function(arg0, arg1) {
3901
4013
  arg0.postMessage(arg1);
3902
4014
  },
3903
4015
  __wbg_process_44c7a14e11e9f69e: function(arg0) {
@@ -3929,7 +4041,7 @@ function __wbg_get_imports() {
3929
4041
  const ret = arg0.readyState;
3930
4042
  return ret;
3931
4043
  },
3932
- __wbg_recvBytes_c85b12fb48cd7a35: function(arg0) {
4044
+ __wbg_recvBytes_e13f381294da16db: function(arg0) {
3933
4045
  const ret = arg0.recvBytes();
3934
4046
  return ret;
3935
4047
  },
@@ -3945,15 +4057,19 @@ function __wbg_get_imports() {
3945
4057
  const ret = arg0.result;
3946
4058
  return ret;
3947
4059
  }, arguments); },
3948
- __wbg_saveCommit_02f095436fc502e0: function(arg0, arg1, arg2, arg3, arg4) {
4060
+ __wbg_saveBatchAll_b9359532f5a65936: function(arg0, arg1, arg2, arg3) {
4061
+ const ret = arg0.saveBatchAll(arg1, arg2, arg3);
4062
+ return ret;
4063
+ },
4064
+ __wbg_saveCommit_f6c4180a159edfdf: function(arg0, arg1, arg2, arg3, arg4) {
3949
4065
  const ret = arg0.saveCommit(arg1, arg2, arg3, arg4);
3950
4066
  return ret;
3951
4067
  },
3952
- __wbg_saveFragment_7681b2171b8cfb35: function(arg0, arg1, arg2, arg3, arg4) {
4068
+ __wbg_saveFragment_49505af74bd5abe3: function(arg0, arg1, arg2, arg3, arg4) {
3953
4069
  const ret = arg0.saveFragment(arg1, arg2, arg3, arg4);
3954
4070
  return ret;
3955
4071
  },
3956
- __wbg_saveSedimentreeId_c265aaeef5af34b6: function(arg0, arg1) {
4072
+ __wbg_saveSedimentreeId_7b6b4310628fe78c: function(arg0, arg1) {
3957
4073
  const ret = arg0.saveSedimentreeId(arg1);
3958
4074
  return ret;
3959
4075
  },
@@ -3965,17 +4081,20 @@ function __wbg_get_imports() {
3965
4081
  const ret = SedimentreeId.__unwrap(arg0);
3966
4082
  return ret;
3967
4083
  },
3968
- __wbg_sendBytes_e6262dd74f1c260a: function(arg0, arg1) {
4084
+ __wbg_sendBytes_9a00cdaf7c891eff: function(arg0, arg1) {
3969
4085
  const ret = arg0.sendBytes(arg1);
3970
4086
  return ret;
3971
4087
  },
3972
4088
  __wbg_send_d31a693c975dea74: function() { return handleError(function (arg0, arg1, arg2) {
3973
4089
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
3974
4090
  }, arguments); },
3975
- __wbg_setTimeout_7829585928963a1f: function(arg0, arg1) {
4091
+ __wbg_setTimeout_43db2c2050a4d3d2: function(arg0, arg1) {
3976
4092
  const ret = setTimeout(arg0, arg1);
3977
4093
  return ret;
3978
4094
  },
4095
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
4096
+ arg0[arg1 >>> 0] = arg2;
4097
+ },
3979
4098
  __wbg_set_7eaa4f96924fd6b3: function() { return handleError(function (arg0, arg1, arg2) {
3980
4099
  const ret = Reflect.set(arg0, arg1, arg2);
3981
4100
  return ret;
@@ -4010,7 +4129,7 @@ function __wbg_get_imports() {
4010
4129
  __wbg_set_onerror_901ca711f94a5bbb: function(arg0, arg1) {
4011
4130
  arg0.onerror = arg1;
4012
4131
  },
4013
- __wbg_set_onmessage_29558b29aee9a78a: function(arg0, arg1) {
4132
+ __wbg_set_onmessage_284248c97c42cb93: function(arg0, arg1) {
4014
4133
  arg0.onmessage = arg1;
4015
4134
  },
4016
4135
  __wbg_set_onmessage_6f80ab771bf151aa: function(arg0, arg1) {
@@ -4029,7 +4148,7 @@ function __wbg_get_imports() {
4029
4148
  const ret = arg0.sign(arg1, arg2, getArrayU8FromWasm0(arg3, arg4));
4030
4149
  return ret;
4031
4150
  }, arguments); },
4032
- __wbg_sign_d03455abc6736428: function(arg0, arg1) {
4151
+ __wbg_sign_e6fa76bd4ef9c75a: function(arg0, arg1) {
4033
4152
  const ret = arg0.sign(arg1);
4034
4153
  return ret;
4035
4154
  },
@@ -4103,6 +4222,14 @@ function __wbg_get_imports() {
4103
4222
  const ret = arg0.then(arg1, arg2);
4104
4223
  return ret;
4105
4224
  },
4225
+ __wbg_topic_new: function(arg0) {
4226
+ const ret = Topic.__wrap(arg0);
4227
+ return ret;
4228
+ },
4229
+ __wbg_topic_unwrap: function(arg0) {
4230
+ const ret = Topic.__unwrap(arg0);
4231
+ return ret;
4232
+ },
4106
4233
  __wbg_transaction_1309b463c399d2b3: function() { return handleError(function (arg0, arg1, arg2, arg3) {
4107
4234
  const ret = arg0.transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
4108
4235
  return ret;
@@ -4111,14 +4238,14 @@ function __wbg_get_imports() {
4111
4238
  const ret = arg0.transaction(getStringFromWasm0(arg1, arg2));
4112
4239
  return ret;
4113
4240
  }, arguments); },
4114
- __wbg_tryIntoJsSedimentreeIdsArray_d6337c0aa0f28604: function() { return handleError(function (arg0, arg1) {
4241
+ __wbg_tryIntoJsSedimentreeIdsArray_6803cc05ac20ff4f: function() { return handleError(function (arg0, arg1) {
4115
4242
  const ret = tryIntoJsSedimentreeIdsArray(arg1);
4116
4243
  const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_export);
4117
4244
  const len1 = WASM_VECTOR_LEN;
4118
4245
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
4119
4246
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
4120
4247
  }, arguments); },
4121
- __wbg_verifyingKey_29533740d75f8cdb: function(arg0) {
4248
+ __wbg_verifyingKey_28c38fc6525caed5: function(arg0) {
4122
4249
  const ret = arg0.verifyingKey();
4123
4250
  return ret;
4124
4251
  },
@@ -4132,32 +4259,32 @@ function __wbg_get_imports() {
4132
4259
  },
4133
4260
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
4134
4261
  // Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [Externref], shim_idx: 12, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4135
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590);
4262
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638);
4136
4263
  return ret;
4137
4264
  },
4138
4265
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
4139
4266
  // 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`.
4140
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_1);
4267
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_1);
4141
4268
  return ret;
4142
4269
  },
4143
4270
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
4144
4271
  // 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`.
4145
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_2);
4272
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_2);
4146
4273
  return ret;
4147
4274
  },
4148
4275
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
4149
4276
  // 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`.
4150
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_590_3);
4277
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_638_3);
4151
4278
  return ret;
4152
4279
  },
4153
4280
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
4154
4281
  // Cast intrinsic for `Closure(Closure { dtor_idx: 11, function: Function { arguments: [], shim_idx: 13, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
4155
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_589);
4282
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_637);
4156
4283
  return ret;
4157
4284
  },
4158
4285
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
4159
- // 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`.
4160
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_274, __wasm_bindgen_func_elem_1605);
4286
+ // 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`.
4287
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_285, __wasm_bindgen_func_elem_1651);
4161
4288
  return ret;
4162
4289
  },
4163
4290
  __wbindgen_cast_0000000000000007: function(arg0) {
@@ -4223,43 +4350,44 @@ function __wbg_get_imports() {
4223
4350
  return {
4224
4351
  __proto__: null,
4225
4352
  "./subduction_wasm_bg.js": import0,
4226
- "./snippets/subduction_wasm-0ed7fd66cebca59f/inline0.js": import1,
4353
+ "./snippets/subduction_wasm-ec51bcf335db35bd/inline0.js": import1,
4354
+ "./snippets/subduction_wasm-ec51bcf335db35bd/inline1.js": import2,
4227
4355
  };
4228
4356
  }
4229
4357
 
4230
- function __wasm_bindgen_func_elem_589(arg0, arg1) {
4231
- wasm.__wasm_bindgen_func_elem_589(arg0, arg1);
4358
+ function __wasm_bindgen_func_elem_637(arg0, arg1) {
4359
+ wasm.__wasm_bindgen_func_elem_637(arg0, arg1);
4232
4360
  }
4233
4361
 
4234
- function __wasm_bindgen_func_elem_590(arg0, arg1, arg2) {
4235
- wasm.__wasm_bindgen_func_elem_590(arg0, arg1, arg2);
4362
+ function __wasm_bindgen_func_elem_638(arg0, arg1, arg2) {
4363
+ wasm.__wasm_bindgen_func_elem_638(arg0, arg1, arg2);
4236
4364
  }
4237
4365
 
4238
- function __wasm_bindgen_func_elem_590_1(arg0, arg1, arg2) {
4239
- wasm.__wasm_bindgen_func_elem_590_1(arg0, arg1, arg2);
4366
+ function __wasm_bindgen_func_elem_638_1(arg0, arg1, arg2) {
4367
+ wasm.__wasm_bindgen_func_elem_638_1(arg0, arg1, arg2);
4240
4368
  }
4241
4369
 
4242
- function __wasm_bindgen_func_elem_590_2(arg0, arg1, arg2) {
4243
- wasm.__wasm_bindgen_func_elem_590_2(arg0, arg1, arg2);
4370
+ function __wasm_bindgen_func_elem_638_2(arg0, arg1, arg2) {
4371
+ wasm.__wasm_bindgen_func_elem_638_2(arg0, arg1, arg2);
4244
4372
  }
4245
4373
 
4246
- function __wasm_bindgen_func_elem_590_3(arg0, arg1, arg2) {
4247
- wasm.__wasm_bindgen_func_elem_590_3(arg0, arg1, arg2);
4374
+ function __wasm_bindgen_func_elem_638_3(arg0, arg1, arg2) {
4375
+ wasm.__wasm_bindgen_func_elem_638_3(arg0, arg1, arg2);
4248
4376
  }
4249
4377
 
4250
- function __wasm_bindgen_func_elem_1605(arg0, arg1, arg2) {
4251
- const ret = wasm.__wasm_bindgen_func_elem_1605(arg0, arg1, arg2);
4378
+ function __wasm_bindgen_func_elem_1651(arg0, arg1, arg2) {
4379
+ const ret = wasm.__wasm_bindgen_func_elem_1651(arg0, arg1, arg2);
4252
4380
  if (ret[1]) {
4253
4381
  throw takeFromExternrefTable0(ret[0]);
4254
4382
  }
4255
4383
  }
4256
4384
 
4257
- function __wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3) {
4258
- wasm.__wasm_bindgen_func_elem_1605_191(arg0, arg1, arg2, arg3);
4385
+ function __wasm_bindgen_func_elem_1651_194(arg0, arg1, arg2, arg3) {
4386
+ wasm.__wasm_bindgen_func_elem_1651_194(arg0, arg1, arg2, arg3);
4259
4387
  }
4260
4388
 
4261
- function __wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3) {
4262
- wasm.__wasm_bindgen_func_elem_1605_192(arg0, arg1, arg2, arg3);
4389
+ function __wasm_bindgen_func_elem_1651_195(arg0, arg1, arg2, arg3) {
4390
+ wasm.__wasm_bindgen_func_elem_1651_195(arg0, arg1, arg2, arg3);
4263
4391
  }
4264
4392
 
4265
4393
 
@@ -4372,6 +4500,9 @@ const SubductionFinalization = (typeof FinalizationRegistry === 'undefined')
4372
4500
  const SyncStatsFinalization = (typeof FinalizationRegistry === 'undefined')
4373
4501
  ? { register: () => {}, unregister: () => {} }
4374
4502
  : new FinalizationRegistry(ptr => wasm.__wbg_syncstats_free(ptr >>> 0, 1));
4503
+ const TopicFinalization = (typeof FinalizationRegistry === 'undefined')
4504
+ ? { register: () => {}, unregister: () => {} }
4505
+ : new FinalizationRegistry(ptr => wasm.__wbg_topic_free(ptr >>> 0, 1));
4375
4506
  const SubductionWebSocketFinalization = (typeof FinalizationRegistry === 'undefined')
4376
4507
  ? { register: () => {}, unregister: () => {} }
4377
4508
  : new FinalizationRegistry(ptr => wasm.__wbg_subductionwebsocket_free(ptr >>> 0, 1));