@massalabs/gossip-sdk 0.1.1-dev.20260903185520 → 0.2.1-dev.20260903201459

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 (58) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +31 -0
  3. package/THIRD_PARTY_NOTICES.txt +7 -45
  4. package/dist/api/restClient.js +5 -3
  5. package/dist/assets/generated/wasm/gossip_wasm.d.ts +8 -8
  6. package/dist/assets/generated/wasm/gossip_wasm.js +26 -27
  7. package/dist/assets/generated/wasm/gossip_wasm_bg.wasm +0 -0
  8. package/dist/assets/generated/wasm-secureStorage/secureStorage.d.ts +115 -21
  9. package/dist/assets/generated/wasm-secureStorage/secureStorage.js +381 -119
  10. package/dist/assets/generated/wasm-secureStorage/secureStorage_bg.wasm +0 -0
  11. package/dist/assets/generated/wasm-secureStorage/secureStorage_bg.wasm.d.ts +25 -5
  12. package/dist/db/db.d.ts +23 -13
  13. package/dist/db/db.js +6 -0
  14. package/dist/db/generated-migrations.d.ts +1 -0
  15. package/dist/db/generated-migrations.js +24 -0
  16. package/dist/db/migrate.d.ts +1 -0
  17. package/dist/db/migrate.js +61 -4
  18. package/dist/db/queries/accountSettings.d.ts +16 -0
  19. package/dist/db/queries/accountSettings.js +87 -0
  20. package/dist/db/queries/index.d.ts +8 -0
  21. package/dist/db/queries/index.js +24 -0
  22. package/dist/db/queries/messagingSessionRecovery.d.ts +11 -0
  23. package/dist/db/queries/messagingSessionRecovery.js +38 -0
  24. package/dist/db/queries/privateMigration.d.ts +14 -0
  25. package/dist/db/queries/privateMigration.js +113 -0
  26. package/dist/db/queries/userProfile.d.ts +3 -2
  27. package/dist/db/queries/userProfile.js +184 -37
  28. package/dist/db/schema/accountSettings.d.ts +79 -0
  29. package/dist/db/schema/accountSettings.js +13 -0
  30. package/dist/db/schema/index.d.ts +2 -0
  31. package/dist/db/schema/index.js +2 -0
  32. package/dist/db/schema/privateMigration.d.ts +85 -0
  33. package/dist/db/schema/privateMigration.js +17 -0
  34. package/dist/db/secure-storage-errors.d.ts +6 -0
  35. package/dist/db/secure-storage-errors.js +20 -0
  36. package/dist/db/secure-storage-native.d.ts +41 -0
  37. package/dist/db/secure-storage-native.js +116 -0
  38. package/dist/db/secure-storage-portable-web.d.ts +97 -0
  39. package/dist/db/secure-storage-portable-web.js +1638 -0
  40. package/dist/db/secure-storage-worker-api.d.ts +222 -0
  41. package/dist/db/secure-storage-worker-api.js +1166 -0
  42. package/dist/db/secure-storage-worker.d.ts +1 -151
  43. package/dist/db/secure-storage-worker.js +1 -318
  44. package/dist/db/sql-statement.d.ts +4 -0
  45. package/dist/db/sql-statement.js +90 -0
  46. package/dist/db/sqlite.d.ts +28 -14
  47. package/dist/db/sqlite.js +469 -47
  48. package/dist/gossip.d.ts +107 -7
  49. package/dist/gossip.js +910 -154
  50. package/dist/services/auth.d.ts +7 -0
  51. package/dist/services/auth.js +82 -9
  52. package/dist/services/discussion.d.ts +4 -1
  53. package/dist/services/discussion.js +9 -4
  54. package/dist/services/profile.d.ts +2 -1
  55. package/dist/services/profile.js +10 -1
  56. package/dist/wasm/session.d.ts +2 -0
  57. package/dist/wasm/session.js +35 -7
  58. package/package.json +5 -2
@@ -190,7 +190,7 @@ state => {
190
190
  }
191
191
  );
192
192
 
193
- function makeClosure(arg0, arg1, dtor, f) {
193
+ function makeMutClosure(arg0, arg1, dtor, f) {
194
194
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
195
195
  const real = (...args) => {
196
196
 
@@ -198,12 +198,16 @@ function makeClosure(arg0, arg1, dtor, f) {
198
198
  // count. This ensures that the Rust closure environment won't
199
199
  // be deallocated while we're invoking it.
200
200
  state.cnt++;
201
+ const a = state.a;
202
+ state.a = 0;
201
203
  try {
202
- return f(state.a, state.b, ...args);
204
+ return f(a, state.b, ...args);
203
205
  } finally {
204
206
  if (--state.cnt === 0) {
205
- wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b); state.a = 0;
207
+ wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
206
208
  CLOSURE_DTORS.unregister(state);
209
+ } else {
210
+ state.a = a;
207
211
  }
208
212
  }
209
213
  };
@@ -212,7 +216,7 @@ function makeClosure(arg0, arg1, dtor, f) {
212
216
  return real;
213
217
  }
214
218
 
215
- function makeMutClosure(arg0, arg1, dtor, f) {
219
+ function makeClosure(arg0, arg1, dtor, f) {
216
220
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
217
221
  const real = (...args) => {
218
222
 
@@ -220,16 +224,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
220
224
  // count. This ensures that the Rust closure environment won't
221
225
  // be deallocated while we're invoking it.
222
226
  state.cnt++;
223
- const a = state.a;
224
- state.a = 0;
225
227
  try {
226
- return f(a, state.b, ...args);
228
+ return f(state.a, state.b, ...args);
227
229
  } finally {
228
230
  if (--state.cnt === 0) {
229
- wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
231
+ wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b); state.a = 0;
230
232
  CLOSURE_DTORS.unregister(state);
231
- } else {
232
- state.a = a;
233
233
  }
234
234
  }
235
235
  };
@@ -251,12 +251,11 @@ export function initSecureStorage(domain, backend) {
251
251
  return ret;
252
252
  }
253
253
 
254
- /**
255
- * @returns {Promise<boolean>}
256
- */
257
- export function idbHasData() {
258
- const ret = wasm.idbHasData();
259
- return ret;
254
+ function passArray8ToWasm0(arg, malloc) {
255
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
256
+ getUint8ArrayMemory0().set(arg, ptr / 1);
257
+ WASM_VECTOR_LEN = arg.length;
258
+ return ptr;
260
259
  }
261
260
 
262
261
  function takeFromExternrefTable0(idx) {
@@ -264,39 +263,53 @@ function takeFromExternrefTable0(idx) {
264
263
  wasm.__externref_table_dealloc(idx);
265
264
  return value;
266
265
  }
267
-
268
- export function provisionStorage() {
269
- const ret = wasm.provisionStorage();
266
+ /**
267
+ * Permanently destroy the data of the currently unlocked slot.
268
+ *
269
+ * The actual writes (new dummy keypair + cover blocks) land in
270
+ * IdbBlockStorage's in-memory pending state. Durability comes from
271
+ * the caller's subsequent `flushEncrypted()` await — same pattern
272
+ * the worker uses for `lockSession`. A process crash before that
273
+ * flush rolls everything back: the IDB on-disk state is unchanged,
274
+ * the slot is left exactly as it was.
275
+ *
276
+ * **The caller must `closeDatabase()` first** so SQLite's xWrite
277
+ * flush on close lands in the buffer before destroy_session truncates
278
+ * the namespace. Mirrors `lockSession`'s contract.
279
+ * @param {Uint8Array} namespaces
280
+ */
281
+ export function destroySession(namespaces) {
282
+ const ptr0 = passArray8ToWasm0(namespaces, wasm.__wbindgen_malloc);
283
+ const len0 = WASM_VECTOR_LEN;
284
+ const ret = wasm.destroySession(ptr0, len0);
270
285
  if (ret[1]) {
271
286
  throw takeFromExternrefTable0(ret[0]);
272
287
  }
273
288
  }
274
289
 
275
- function passArray8ToWasm0(arg, malloc) {
276
- const ptr = malloc(arg.length * 1, 1) >>> 0;
277
- getUint8ArrayMemory0().set(arg, ptr / 1);
278
- WASM_VECTOR_LEN = arg.length;
279
- return ptr;
280
- }
281
290
  /**
282
- * @param {number} slot
283
- * @param {Uint8Array} password
291
+ * @param {number} namespace
284
292
  */
285
- export function allocateSession(slot, password) {
286
- const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
287
- const len0 = WASM_VECTOR_LEN;
288
- const ret = wasm.allocateSession(slot, ptr0, len0);
293
+ export function coverTrafficTick(namespace) {
294
+ const ret = wasm.coverTrafficTick(namespace);
289
295
  if (ret[1]) {
290
296
  throw takeFromExternrefTable0(ret[0]);
291
297
  }
292
298
  }
293
299
 
294
300
  /**
295
- * @returns {Promise<void>}
301
+ * Strictly validate one version-1 logical keypair record without unlocking it.
302
+ * Browser streaming export/import uses this bounded bridge so TypeScript never
303
+ * reimplements pq-rerand's canonical parser.
304
+ * @param {Uint8Array} value
296
305
  */
297
- export function flushEncrypted() {
298
- const ret = wasm.flushEncrypted();
299
- return ret;
306
+ export function validatePortableKeypair(value) {
307
+ const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
308
+ const len0 = WASM_VECTOR_LEN;
309
+ const ret = wasm.validatePortableKeypair(ptr0, len0);
310
+ if (ret[1]) {
311
+ throw takeFromExternrefTable0(ret[0]);
312
+ }
300
313
  }
301
314
 
302
315
  export function openDatabase() {
@@ -333,6 +346,210 @@ export function execSql(sql, params) {
333
346
  return ExecResult.__wrap(ret[0]);
334
347
  }
335
348
 
349
+ /**
350
+ * Strictly validate one version-1 encrypted block record.
351
+ * @param {Uint8Array} value
352
+ */
353
+ export function validatePortableBlock(value) {
354
+ const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
355
+ const len0 = WASM_VECTOR_LEN;
356
+ const ret = wasm.validatePortableBlock(ptr0, len0);
357
+ if (ret[1]) {
358
+ throw takeFromExternrefTable0(ret[0]);
359
+ }
360
+ }
361
+
362
+ /**
363
+ * @param {number} namespace
364
+ * @param {number} offset
365
+ * @param {Uint8Array} data
366
+ */
367
+ export function writeNamespaceData(namespace, offset, data) {
368
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
369
+ const len0 = WASM_VECTOR_LEN;
370
+ const ret = wasm.writeNamespaceData(namespace, offset, ptr0, len0);
371
+ if (ret[1]) {
372
+ throw takeFromExternrefTable0(ret[0]);
373
+ }
374
+ }
375
+
376
+ /**
377
+ * @param {number} namespace
378
+ * @param {number} offset
379
+ * @param {number} len
380
+ * @returns {Uint8Array}
381
+ */
382
+ export function readNamespaceData(namespace, offset, len) {
383
+ const ret = wasm.readNamespaceData(namespace, offset, len);
384
+ if (ret[3]) {
385
+ throw takeFromExternrefTable0(ret[2]);
386
+ }
387
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
388
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
389
+ return v1;
390
+ }
391
+
392
+ /**
393
+ * @param {number} namespace
394
+ * @returns {number}
395
+ */
396
+ export function namespaceDataLength(namespace) {
397
+ const ret = wasm.namespaceDataLength(namespace);
398
+ if (ret[2]) {
399
+ throw takeFromExternrefTable0(ret[1]);
400
+ }
401
+ return ret[0];
402
+ }
403
+
404
+ /**
405
+ * @param {number} namespace
406
+ */
407
+ export function clearNamespace(namespace) {
408
+ const ret = wasm.clearNamespace(namespace);
409
+ if (ret[1]) {
410
+ throw takeFromExternrefTable0(ret[0]);
411
+ }
412
+ }
413
+
414
+ /**
415
+ * Verify that this worker still owns the active IndexedDB generation.
416
+ * @returns {Promise<void>}
417
+ */
418
+ export function verifyStorageGeneration() {
419
+ const ret = wasm.verifyStorageGeneration();
420
+ return ret;
421
+ }
422
+
423
+ /**
424
+ * Called by the worker when an allocation or destruction transaction rejects.
425
+ * This prevents a later cover-traffic flush from durably carrying the failed
426
+ * lifecycle operation. The recovered state is always locked.
427
+ * @returns {Promise<void>}
428
+ */
429
+ export function reloadDurableStorage() {
430
+ const ret = wasm.reloadDurableStorage();
431
+ return ret;
432
+ }
433
+
434
+ /**
435
+ * Abandon a poisoned SQLite transaction and restore its last durable image
436
+ * while retaining the current unlocked session keys. No pending VFS bytes are
437
+ * flushed: closing SQLite rolls back its in-memory journal, then the IndexedDB
438
+ * cache is reloaded before a fresh database handle is opened.
439
+ * @returns {Promise<void>}
440
+ */
441
+ export function resetSqlDatabaseToDurable() {
442
+ const ret = wasm.resetSqlDatabaseToDurable();
443
+ return ret;
444
+ }
445
+
446
+ /**
447
+ * @returns {Promise<void>}
448
+ */
449
+ export function flushEncrypted() {
450
+ const ret = wasm.flushEncrypted();
451
+ return ret;
452
+ }
453
+
454
+ export function beginOnboardingCandidate() {
455
+ const ret = wasm.beginOnboardingCandidate();
456
+ if (ret[1]) {
457
+ throw takeFromExternrefTable0(ret[0]);
458
+ }
459
+ }
460
+
461
+ /**
462
+ * @returns {Uint8Array}
463
+ */
464
+ export function exportOnboardingCandidate() {
465
+ const ret = wasm.exportOnboardingCandidate();
466
+ if (ret[3]) {
467
+ throw takeFromExternrefTable0(ret[2]);
468
+ }
469
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
470
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
471
+ return v1;
472
+ }
473
+
474
+ /**
475
+ * @returns {Promise<void>}
476
+ */
477
+ export function activateOnboardingGeneration() {
478
+ const ret = wasm.activateOnboardingGeneration();
479
+ return ret;
480
+ }
481
+
482
+ /**
483
+ * Generate fresh current-suite keypairs for all slots at once. Every public
484
+ * key changes, so comparing source and destination cannot reveal selection.
485
+ * @returns {Array<any>}
486
+ */
487
+ export function finalizeOuterMigration() {
488
+ const ret = wasm.finalizeOuterMigration();
489
+ if (ret[2]) {
490
+ throw takeFromExternrefTable0(ret[1]);
491
+ }
492
+ return takeFromExternrefTable0(ret[0]);
493
+ }
494
+
495
+ /**
496
+ * Transform one complete fixed-slot block coordinate.
497
+ * @param {number} namespace
498
+ * @param {number} block_index
499
+ * @param {Array<any>} values
500
+ * @returns {Array<any>}
501
+ */
502
+ export function migrateOuterBlockBatch(namespace, block_index, values) {
503
+ const ret = wasm.migrateOuterBlockBatch(namespace, block_index, values);
504
+ if (ret[2]) {
505
+ throw takeFromExternrefTable0(ret[1]);
506
+ }
507
+ return takeFromExternrefTable0(ret[0]);
508
+ }
509
+
510
+ /**
511
+ * @param {number} namespace
512
+ * @param {number} source_block_count
513
+ */
514
+ export function finishOuterMigrationNamespace(namespace, source_block_count) {
515
+ const ret = wasm.finishOuterMigrationNamespace(namespace, source_block_count);
516
+ if (ret[1]) {
517
+ throw takeFromExternrefTable0(ret[0]);
518
+ }
519
+ }
520
+
521
+ export function endOuterMigration() {
522
+ wasm.endOuterMigration();
523
+ }
524
+
525
+ /**
526
+ * @returns {Promise<boolean>}
527
+ */
528
+ export function idbHasData() {
529
+ const ret = wasm.idbHasData();
530
+ return ret;
531
+ }
532
+
533
+ export function provisionStorage() {
534
+ const ret = wasm.provisionStorage();
535
+ if (ret[1]) {
536
+ throw takeFromExternrefTable0(ret[0]);
537
+ }
538
+ }
539
+
540
+ /**
541
+ * @param {number} slot
542
+ * @param {Uint8Array} password
543
+ */
544
+ export function allocateSession(slot, password) {
545
+ const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
546
+ const len0 = WASM_VECTOR_LEN;
547
+ const ret = wasm.allocateSession(slot, ptr0, len0);
548
+ if (ret[1]) {
549
+ throw takeFromExternrefTable0(ret[0]);
550
+ }
551
+ }
552
+
336
553
  /**
337
554
  * @param {Uint8Array} password
338
555
  * @returns {boolean}
@@ -354,92 +571,114 @@ export function lockSession() {
354
571
  }
355
572
  }
356
573
 
357
- /**
358
- * Permanently destroy the data of the currently unlocked slot.
359
- *
360
- * The actual writes (new dummy keypair + cover blocks) land in
361
- * IdbBlockStorage's in-memory pending state. Durability comes from
362
- * the caller's subsequent `flushEncrypted()` await — same pattern
363
- * the worker uses for `lockSession`. A process crash before that
364
- * flush rolls everything back: the IDB on-disk state is unchanged,
365
- * the slot is left exactly as it was.
366
- *
367
- * **The caller must `closeDatabase()` first** so SQLite's xWrite
368
- * flush on close lands in the buffer before destroy_session truncates
369
- * the namespace. Mirrors `lockSession`'s contract.
370
- * @param {Uint8Array} namespaces
371
- */
372
- export function destroySession(namespaces) {
373
- const ptr0 = passArray8ToWasm0(namespaces, wasm.__wbindgen_malloc);
374
- const len0 = WASM_VECTOR_LEN;
375
- const ret = wasm.destroySession(ptr0, len0);
574
+ export function endOnboardingCandidate() {
575
+ const ret = wasm.endOnboardingCandidate();
376
576
  if (ret[1]) {
377
577
  throw takeFromExternrefTable0(ret[0]);
378
578
  }
379
579
  }
380
580
 
381
581
  /**
382
- * @param {number} namespace
582
+ * Replace this terminal worker's active backend with an isolated in-memory
583
+ * portable candidate and authenticate its keypairs without exposing the
584
+ * matched slot to JavaScript.
585
+ * @param {string} domain
586
+ * @param {Uint8Array} password
587
+ * @param {Array<any>} keypairs
588
+ * @returns {boolean}
383
589
  */
384
- export function coverTrafficTick(namespace) {
385
- const ret = wasm.coverTrafficTick(namespace);
386
- if (ret[1]) {
387
- throw takeFromExternrefTable0(ret[0]);
590
+ export function beginCandidatePreview(domain, password, keypairs) {
591
+ const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
592
+ const len0 = WASM_VECTOR_LEN;
593
+ const ptr1 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
594
+ const len1 = WASM_VECTOR_LEN;
595
+ const ret = wasm.beginCandidatePreview(ptr0, len0, ptr1, len1, keypairs);
596
+ if (ret[2]) {
597
+ throw takeFromExternrefTable0(ret[1]);
388
598
  }
599
+ return ret[0] !== 0;
389
600
  }
390
601
 
391
602
  /**
603
+ * Admit one canonical candidate block. Only namespace 0 blocks belonging to
604
+ * the internally authenticated slot are retained; callers never learn which
605
+ * slot matched.
606
+ * @param {number} slot
392
607
  * @param {number} namespace
393
- * @param {number} offset
608
+ * @param {number} block_index
394
609
  * @param {Uint8Array} data
395
610
  */
396
- export function writeNamespaceData(namespace, offset, data) {
611
+ export function appendCandidatePreviewBlock(slot, namespace, block_index, data) {
397
612
  const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
398
613
  const len0 = WASM_VECTOR_LEN;
399
- const ret = wasm.writeNamespaceData(namespace, offset, ptr0, len0);
614
+ const ret = wasm.appendCandidatePreviewBlock(slot, namespace, block_index, ptr0, len0);
400
615
  if (ret[1]) {
401
616
  throw takeFromExternrefTable0(ret[0]);
402
617
  }
403
618
  }
404
619
 
405
620
  /**
406
- * @param {number} namespace
407
- * @param {number} offset
408
- * @param {number} len
409
- * @returns {Uint8Array}
621
+ * Load the candidate namespace length and open SQLite without write authority.
410
622
  */
411
- export function readNamespaceData(namespace, offset, len) {
412
- const ret = wasm.readNamespaceData(namespace, offset, len);
413
- if (ret[3]) {
414
- throw takeFromExternrefTable0(ret[2]);
623
+ export function finishCandidatePreview() {
624
+ const ret = wasm.finishCandidatePreview();
625
+ if (ret[1]) {
626
+ throw takeFromExternrefTable0(ret[0]);
415
627
  }
416
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
417
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
418
- return v1;
419
628
  }
420
629
 
421
630
  /**
422
- * @param {number} namespace
423
- * @returns {number}
631
+ * Project only bounded public profile fields inside WASM. The security JSON
632
+ * is validated and zeroized in Rust and never crosses the worker bridge.
633
+ * @returns {any}
424
634
  */
425
- export function namespaceDataLength(namespace) {
426
- const ret = wasm.namespaceDataLength(namespace);
635
+ export function queryCandidatePreview() {
636
+ const ret = wasm.queryCandidatePreview();
427
637
  if (ret[2]) {
428
638
  throw takeFromExternrefTable0(ret[1]);
429
639
  }
430
- return ret[0];
640
+ return takeFromExternrefTable0(ret[0]);
431
641
  }
432
642
 
433
643
  /**
434
- * @param {number} namespace
644
+ * @returns {Promise<void>}
435
645
  */
436
- export function clearNamespace(namespace) {
437
- const ret = wasm.clearNamespace(namespace);
646
+ export function endCandidatePreview() {
647
+ const ret = wasm.endCandidatePreview();
648
+ return ret;
649
+ }
650
+
651
+ /**
652
+ * Begin password admission for one validated candidate. Only opaque plan
653
+ * state is retained; no transformed/mixed-version generation is emitted.
654
+ * @param {string} domain
655
+ * @param {Array<any>} keypairs
656
+ */
657
+ export function beginOuterMigration(domain, keypairs) {
658
+ const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
659
+ const len0 = WASM_VECTOR_LEN;
660
+ const ret = wasm.beginOuterMigration(ptr0, len0, keypairs);
438
661
  if (ret[1]) {
439
662
  throw takeFromExternrefTable0(ret[0]);
440
663
  }
441
664
  }
442
665
 
666
+ /**
667
+ * Admit one password with all-slot constant work. The owned WASM copy is
668
+ * zeroized before return and a generic false discloses no matched slot.
669
+ * @param {Uint8Array} password
670
+ * @returns {boolean}
671
+ */
672
+ export function admitOuterMigrationPassword(password) {
673
+ const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
674
+ const len0 = WASM_VECTOR_LEN;
675
+ const ret = wasm.admitOuterMigrationPassword(ptr0, len0);
676
+ if (ret[2]) {
677
+ throw takeFromExternrefTable0(ret[1]);
678
+ }
679
+ return ret[0] !== 0;
680
+ }
681
+
443
682
  /**
444
683
  * @param {number} num_threads
445
684
  * @returns {Promise<any>}
@@ -456,27 +695,27 @@ export function wbg_rayon_start_worker(receiver) {
456
695
  wasm.wbg_rayon_start_worker(receiver);
457
696
  }
458
697
 
459
- function __wbg_adapter_6(arg0, arg1, arg2) {
460
- wasm.closure112_externref_shim(arg0, arg1, arg2);
698
+ function __wbg_adapter_8(arg0, arg1, arg2) {
699
+ wasm.closure127_externref_shim(arg0, arg1, arg2);
461
700
  }
462
701
 
463
- function __wbg_adapter_9(arg0, arg1) {
464
- wasm.wasm_bindgen_3f82e0ab9dbbc377___convert__closures_____invoke______(arg0, arg1);
702
+ function __wbg_adapter_13(arg0, arg1) {
703
+ wasm.wasm_bindgen_c8f7f980e6f4097b___convert__closures_____invoke______(arg0, arg1);
465
704
  }
466
705
 
467
- function __wbg_adapter_18(arg0, arg1, arg2) {
468
- const ret = wasm.closure56_externref_shim_multivalue_shim(arg0, arg1, arg2);
706
+ function __wbg_adapter_16(arg0, arg1, arg2) {
707
+ const ret = wasm.closure83_externref_shim_multivalue_shim(arg0, arg1, arg2);
469
708
  if (ret[1]) {
470
709
  throw takeFromExternrefTable0(ret[0]);
471
710
  }
472
711
  }
473
712
 
474
- function __wbg_adapter_21(arg0, arg1, arg2) {
475
- wasm.closure678_externref_shim(arg0, arg1, arg2);
713
+ function __wbg_adapter_23(arg0, arg1, arg2) {
714
+ wasm.closure702_externref_shim(arg0, arg1, arg2);
476
715
  }
477
716
 
478
- function __wbg_adapter_186(arg0, arg1, arg2, arg3) {
479
- wasm.closure723_externref_shim(arg0, arg1, arg2, arg3);
717
+ function __wbg_adapter_216(arg0, arg1, arg2, arg3) {
718
+ wasm.closure758_externref_shim(arg0, arg1, arg2, arg3);
480
719
  }
481
720
 
482
721
  const __wbindgen_enum_IdbRequestReadyState = ["pending", "done"];
@@ -627,6 +866,10 @@ function __wbg_get_imports() {
627
866
  const ret = arg0.async;
628
867
  return ret;
629
868
  };
869
+ imports.wbg.__wbg_bound_99d0883606949696 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
870
+ const ret = IDBKeyRange.bound(arg0, arg1, arg2 !== 0, arg3 !== 0);
871
+ return ret;
872
+ }, arguments) };
630
873
  imports.wbg.__wbg_buffer_40c0928cc927f62a = function(arg0) {
631
874
  const ret = arg0.buffer;
632
875
  return ret;
@@ -639,8 +882,8 @@ function __wbg_get_imports() {
639
882
  const ret = arg0.call(arg1, arg2);
640
883
  return ret;
641
884
  }, arguments) };
642
- imports.wbg.__wbg_count_1cff3c6a8d01b472 = function() { return handleError(function (arg0) {
643
- const ret = arg0.count();
885
+ imports.wbg.__wbg_count_4fa636eb52ae7a3d = function() { return handleError(function (arg0, arg1) {
886
+ const ret = arg0.count(arg1);
644
887
  return ret;
645
888
  }, arguments) };
646
889
  imports.wbg.__wbg_createObjectStore_2bc52da689ca2130 = function() { return handleError(function (arg0, arg1, arg2) {
@@ -674,12 +917,12 @@ function __wbg_get_imports() {
674
917
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
675
918
  }
676
919
  };
677
- imports.wbg.__wbg_getAllKeys_b922249231cbd849 = function() { return handleError(function (arg0) {
678
- const ret = arg0.getAllKeys();
920
+ imports.wbg.__wbg_getAllKeys_08c3ed5bd20b20ba = function() { return handleError(function (arg0, arg1) {
921
+ const ret = arg0.getAllKeys(arg1);
679
922
  return ret;
680
923
  }, arguments) };
681
- imports.wbg.__wbg_getAll_2783028eb1814671 = function() { return handleError(function (arg0) {
682
- const ret = arg0.getAll();
924
+ imports.wbg.__wbg_getAll_ff5bd24743b1031a = function() { return handleError(function (arg0, arg1) {
925
+ const ret = arg0.getAll(arg1);
683
926
  return ret;
684
927
  }, arguments) };
685
928
  imports.wbg.__wbg_getDate_9615e288fc892247 = function(arg0) {
@@ -728,6 +971,10 @@ function __wbg_get_imports() {
728
971
  const ret = arg0[arg1 >>> 0];
729
972
  return ret;
730
973
  };
974
+ imports.wbg.__wbg_get_1b2c33a63c4be73f = function() { return handleError(function (arg0, arg1) {
975
+ const ret = arg0.get(arg1);
976
+ return ret;
977
+ }, arguments) };
731
978
  imports.wbg.__wbg_global_b6f5c73312f62313 = function(arg0) {
732
979
  const ret = arg0.global;
733
980
  return ret;
@@ -787,6 +1034,10 @@ function __wbg_get_imports() {
787
1034
  const ret = new Date();
788
1035
  return ret;
789
1036
  };
1037
+ imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
1038
+ const ret = new Object();
1039
+ return ret;
1040
+ };
790
1041
  imports.wbg.__wbg_new_1f3a344cf3123716 = function() {
791
1042
  const ret = new Array();
792
1043
  return ret;
@@ -802,7 +1053,7 @@ function __wbg_get_imports() {
802
1053
  const a = state0.a;
803
1054
  state0.a = 0;
804
1055
  try {
805
- return __wbg_adapter_186(a, state0.b, arg0, arg1);
1056
+ return __wbg_adapter_216(a, state0.b, arg0, arg1);
806
1057
  } finally {
807
1058
  state0.a = a;
808
1059
  }
@@ -829,6 +1080,10 @@ function __wbg_get_imports() {
829
1080
  const ret = new Worker(getStringFromWasm0(arg0, arg1));
830
1081
  return ret;
831
1082
  }, arguments) };
1083
+ imports.wbg.__wbg_new_da9dc54c5db29dfa = function(arg0, arg1) {
1084
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1085
+ return ret;
1086
+ };
832
1087
  imports.wbg.__wbg_newfromslice_074c56947bd43469 = function(arg0, arg1) {
833
1088
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
834
1089
  return ret;
@@ -921,9 +1176,16 @@ function __wbg_get_imports() {
921
1176
  const ret = arg0.result;
922
1177
  return ret;
923
1178
  }, arguments) };
1179
+ imports.wbg.__wbg_set_453345bcda80b89a = function() { return handleError(function (arg0, arg1, arg2) {
1180
+ const ret = Reflect.set(arg0, arg1, arg2);
1181
+ return ret;
1182
+ }, arguments) };
924
1183
  imports.wbg.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
925
1184
  arg0[arg1 >>> 0] = arg2;
926
1185
  };
1186
+ imports.wbg.__wbg_setname_832b43d4602cb930 = function(arg0, arg1, arg2) {
1187
+ arg0.name = getStringFromWasm0(arg1, arg2);
1188
+ };
927
1189
  imports.wbg.__wbg_setonabort_4edac498cf4576fe = function(arg0, arg1) {
928
1190
  arg0.onabort = arg1;
929
1191
  };
@@ -1093,24 +1355,24 @@ function __wbg_get_imports() {
1093
1355
  imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
1094
1356
  throw new Error(getStringFromWasm0(arg0, arg1));
1095
1357
  };
1096
- imports.wbg.__wbindgen_cast_059aacf5a239a77f = function(arg0, arg1) {
1097
- // Cast intrinsic for `Closure(Closure { dtor_idx: 675, function: Function { arguments: [NamedExternref("Event")], shim_idx: 678, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1098
- const ret = makeClosure(arg0, arg1, 675, __wbg_adapter_21);
1358
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1359
+ // Cast intrinsic for `Ref(String) -> Externref`.
1360
+ const ret = getStringFromWasm0(arg0, arg1);
1099
1361
  return ret;
1100
1362
  };
1101
- imports.wbg.__wbindgen_cast_146fd35f906c65cd = function(arg0, arg1) {
1102
- // Cast intrinsic for `Closure(Closure { dtor_idx: 111, function: Function { arguments: [Externref], shim_idx: 112, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1103
- const ret = makeMutClosure(arg0, arg1, 111, __wbg_adapter_6);
1363
+ imports.wbg.__wbindgen_cast_386725c5b2a3b665 = function(arg0, arg1) {
1364
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 126, function: Function { arguments: [Externref], shim_idx: 127, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1365
+ const ret = makeMutClosure(arg0, arg1, 126, __wbg_adapter_8);
1104
1366
  return ret;
1105
1367
  };
1106
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1107
- // Cast intrinsic for `Ref(String) -> Externref`.
1108
- const ret = getStringFromWasm0(arg0, arg1);
1368
+ imports.wbg.__wbindgen_cast_3db871fda0707d58 = function(arg0, arg1) {
1369
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 126, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 127, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1370
+ const ret = makeMutClosure(arg0, arg1, 126, __wbg_adapter_8);
1109
1371
  return ret;
1110
1372
  };
1111
- imports.wbg.__wbindgen_cast_7ebbbe5a2f6a40ca = function(arg0, arg1) {
1112
- // Cast intrinsic for `Closure(Closure { dtor_idx: 55, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 56, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1113
- const ret = makeMutClosure(arg0, arg1, 55, __wbg_adapter_18);
1373
+ imports.wbg.__wbindgen_cast_79fe99a6bc147e05 = function(arg0, arg1) {
1374
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 82, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 83, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1375
+ const ret = makeMutClosure(arg0, arg1, 82, __wbg_adapter_16);
1114
1376
  return ret;
1115
1377
  };
1116
1378
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -1118,9 +1380,14 @@ function __wbg_get_imports() {
1118
1380
  const ret = arg0;
1119
1381
  return ret;
1120
1382
  };
1121
- imports.wbg.__wbindgen_cast_a53a037200293105 = function(arg0, arg1) {
1122
- // Cast intrinsic for `Closure(Closure { dtor_idx: 111, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 112, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1123
- const ret = makeMutClosure(arg0, arg1, 111, __wbg_adapter_6);
1383
+ imports.wbg.__wbindgen_cast_aa44825de43fe7af = function(arg0, arg1) {
1384
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 701, function: Function { arguments: [], shim_idx: 704, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1385
+ const ret = makeClosure(arg0, arg1, 701, __wbg_adapter_13);
1386
+ return ret;
1387
+ };
1388
+ imports.wbg.__wbindgen_cast_bdb4cf4490076bdf = function(arg0, arg1) {
1389
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 701, function: Function { arguments: [NamedExternref("Event")], shim_idx: 702, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1390
+ const ret = makeClosure(arg0, arg1, 701, __wbg_adapter_23);
1124
1391
  return ret;
1125
1392
  };
1126
1393
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
@@ -1133,11 +1400,6 @@ function __wbg_get_imports() {
1133
1400
  const ret = arg0;
1134
1401
  return ret;
1135
1402
  };
1136
- imports.wbg.__wbindgen_cast_e55b3bcdac329b29 = function(arg0, arg1) {
1137
- // Cast intrinsic for `Closure(Closure { dtor_idx: 675, function: Function { arguments: [], shim_idx: 676, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
1138
- const ret = makeClosure(arg0, arg1, 675, __wbg_adapter_9);
1139
- return ret;
1140
- };
1141
1403
  imports.wbg.__wbindgen_init_externref_table = function() {
1142
1404
  const table = wasm.__wbindgen_export_2;
1143
1405
  const offset = table.grow(4);
@@ -1167,7 +1429,7 @@ function __wbg_get_imports() {
1167
1429
  }
1168
1430
 
1169
1431
  function __wbg_init_memory(imports, memory) {
1170
- imports.wbg.memory = memory || new WebAssembly.Memory({initial:68,maximum:65536,shared:true});
1432
+ imports.wbg.memory = memory || new WebAssembly.Memory({initial:89,maximum:65536,shared:true});
1171
1433
  }
1172
1434
 
1173
1435
  function __wbg_finalize_init(instance, module, thread_stack_size) {