@keyhive/keyhive 0.0.0-alpha.4 → 0.0.0-alpha.40

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.
@@ -111,6 +111,12 @@ function isLikeNone(x) {
111
111
  return x === undefined || x === null;
112
112
  }
113
113
 
114
+ function _assertClass(instance, klass) {
115
+ if (!(instance instanceof klass)) {
116
+ throw new Error(`expected instance of ${klass.name}`);
117
+ }
118
+ }
119
+
114
120
  function debugString(val) {
115
121
  // primitive types
116
122
  const type = typeof val;
@@ -176,11 +182,22 @@ function debugString(val) {
176
182
  return className;
177
183
  }
178
184
 
185
+ function getArrayJsValueFromWasm0(ptr, len) {
186
+ ptr = ptr >>> 0;
187
+ const mem = getDataViewMemory0();
188
+ const result = [];
189
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
190
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
191
+ }
192
+ wasm.__externref_drop_slice(ptr, len);
193
+ return result;
194
+ }
195
+
179
196
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
180
197
  ? { register: () => {}, unregister: () => {} }
181
198
  : new FinalizationRegistry(
182
199
  state => {
183
- wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
200
+ wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b);
184
201
  }
185
202
  );
186
203
 
@@ -198,7 +215,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
198
215
  return f(a, state.b, ...args);
199
216
  } finally {
200
217
  if (--state.cnt === 0) {
201
- wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
218
+ wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
202
219
  CLOSURE_DTORS.unregister(state);
203
220
  } else {
204
221
  state.a = a;
@@ -210,17 +227,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
210
227
  return real;
211
228
  }
212
229
 
213
- function getArrayJsValueFromWasm0(ptr, len) {
214
- ptr = ptr >>> 0;
215
- const mem = getDataViewMemory0();
216
- const result = [];
217
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
218
- result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
219
- }
220
- wasm.__externref_drop_slice(ptr, len);
221
- return result;
222
- }
223
-
224
230
  function passArray8ToWasm0(arg, malloc) {
225
231
  const ptr = malloc(arg.length * 1, 1) >>> 0;
226
232
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -234,12 +240,6 @@ function takeFromExternrefTable0(idx) {
234
240
  return value;
235
241
  }
236
242
 
237
- function _assertClass(instance, klass) {
238
- if (!(instance instanceof klass)) {
239
- throw new Error(`expected instance of ${klass.name}`);
240
- }
241
- }
242
-
243
243
  function passArrayJsValueToWasm0(array, malloc) {
244
244
  const ptr = malloc(array.length * 4, 4) >>> 0;
245
245
  for (let i = 0; i < array.length; i++) {
@@ -260,11 +260,11 @@ exports.setPanicHook = function() {
260
260
  };
261
261
 
262
262
  function __wbg_adapter_10(arg0, arg1, arg2) {
263
- wasm.closure423_externref_shim(arg0, arg1, arg2);
263
+ wasm.closure425_externref_shim(arg0, arg1, arg2);
264
264
  }
265
265
 
266
- function __wbg_adapter_274(arg0, arg1, arg2, arg3) {
267
- wasm.closure571_externref_shim(arg0, arg1, arg2, arg3);
266
+ function __wbg_adapter_315(arg0, arg1, arg2, arg3) {
267
+ wasm.closure582_externref_shim(arg0, arg1, arg2, arg3);
268
268
  }
269
269
 
270
270
  const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -322,51 +322,6 @@ if (Symbol.dispose) Access.prototype[Symbol.dispose] = Access.prototype.free;
322
322
 
323
323
  exports.Access = Access;
324
324
 
325
- const AddMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
326
- ? { register: () => {}, unregister: () => {} }
327
- : new FinalizationRegistry(ptr => wasm.__wbg_addmembererror_free(ptr >>> 0, 1));
328
-
329
- class AddMemberError {
330
-
331
- static __wrap(ptr) {
332
- ptr = ptr >>> 0;
333
- const obj = Object.create(AddMemberError.prototype);
334
- obj.__wbg_ptr = ptr;
335
- AddMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
336
- return obj;
337
- }
338
-
339
- __destroy_into_raw() {
340
- const ptr = this.__wbg_ptr;
341
- this.__wbg_ptr = 0;
342
- AddMemberErrorFinalization.unregister(this);
343
- return ptr;
344
- }
345
-
346
- free() {
347
- const ptr = this.__destroy_into_raw();
348
- wasm.__wbg_addmembererror_free(ptr, 0);
349
- }
350
- /**
351
- * @returns {string}
352
- */
353
- message() {
354
- let deferred1_0;
355
- let deferred1_1;
356
- try {
357
- const ret = wasm.addmembererror_message(this.__wbg_ptr);
358
- deferred1_0 = ret[0];
359
- deferred1_1 = ret[1];
360
- return getStringFromWasm0(ret[0], ret[1]);
361
- } finally {
362
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
363
- }
364
- }
365
- }
366
- if (Symbol.dispose) AddMemberError.prototype[Symbol.dispose] = AddMemberError.prototype.free;
367
-
368
- exports.AddMemberError = AddMemberError;
369
-
370
325
  const AgentFinalization = (typeof FinalizationRegistry === 'undefined')
371
326
  ? { register: () => {}, unregister: () => {} }
372
327
  : new FinalizationRegistry(ptr => wasm.__wbg_agent_free(ptr >>> 0, 1));
@@ -495,17 +450,14 @@ class Archive {
495
450
  * @param {CiphertextStore} ciphertext_store
496
451
  * @param {Signer} signer
497
452
  * @param {Function} event_handler
498
- * @returns {Keyhive}
453
+ * @returns {Promise<Keyhive>}
499
454
  */
500
455
  tryToKeyhive(ciphertext_store, signer, event_handler) {
501
456
  _assertClass(ciphertext_store, CiphertextStore);
502
457
  var ptr0 = ciphertext_store.__destroy_into_raw();
503
458
  _assertClass(signer, Signer);
504
459
  const ret = wasm.archive_tryToKeyhive(this.__wbg_ptr, ptr0, signer.__wbg_ptr, event_handler);
505
- if (ret[2]) {
506
- throw takeFromExternrefTable0(ret[1]);
507
- }
508
- return Keyhive.__wrap(ret[0]);
460
+ return ret;
509
461
  }
510
462
  }
511
463
  if (Symbol.dispose) Archive.prototype[Symbol.dispose] = Archive.prototype.free;
@@ -668,22 +620,22 @@ if (Symbol.dispose) CgkaOperation.prototype[Symbol.dispose] = CgkaOperation.prot
668
620
 
669
621
  exports.CgkaOperation = CgkaOperation;
670
622
 
671
- const ChangeRefFinalization = (typeof FinalizationRegistry === 'undefined')
623
+ const ChangeIdFinalization = (typeof FinalizationRegistry === 'undefined')
672
624
  ? { register: () => {}, unregister: () => {} }
673
- : new FinalizationRegistry(ptr => wasm.__wbg_changeref_free(ptr >>> 0, 1));
625
+ : new FinalizationRegistry(ptr => wasm.__wbg_changeid_free(ptr >>> 0, 1));
674
626
 
675
- class ChangeRef {
627
+ class ChangeId {
676
628
 
677
629
  static __wrap(ptr) {
678
630
  ptr = ptr >>> 0;
679
- const obj = Object.create(ChangeRef.prototype);
631
+ const obj = Object.create(ChangeId.prototype);
680
632
  obj.__wbg_ptr = ptr;
681
- ChangeRefFinalization.register(obj, obj.__wbg_ptr, obj);
633
+ ChangeIdFinalization.register(obj, obj.__wbg_ptr, obj);
682
634
  return obj;
683
635
  }
684
636
 
685
637
  static __unwrap(jsValue) {
686
- if (!(jsValue instanceof ChangeRef)) {
638
+ if (!(jsValue instanceof ChangeId)) {
687
639
  return 0;
688
640
  }
689
641
  return jsValue.__destroy_into_raw();
@@ -692,13 +644,13 @@ class ChangeRef {
692
644
  __destroy_into_raw() {
693
645
  const ptr = this.__wbg_ptr;
694
646
  this.__wbg_ptr = 0;
695
- ChangeRefFinalization.unregister(this);
647
+ ChangeIdFinalization.unregister(this);
696
648
  return ptr;
697
649
  }
698
650
 
699
651
  free() {
700
652
  const ptr = this.__destroy_into_raw();
701
- wasm.__wbg_changeref_free(ptr, 0);
653
+ wasm.__wbg_changeid_free(ptr, 0);
702
654
  }
703
655
  /**
704
656
  * @param {Uint8Array} bytes
@@ -706,24 +658,31 @@ class ChangeRef {
706
658
  constructor(bytes) {
707
659
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
708
660
  const len0 = WASM_VECTOR_LEN;
709
- const ret = wasm.changeref_new(ptr0, len0);
661
+ const ret = wasm.changeid_new(ptr0, len0);
710
662
  this.__wbg_ptr = ret >>> 0;
711
- ChangeRefFinalization.register(this, this.__wbg_ptr, this);
663
+ ChangeIdFinalization.register(this, this.__wbg_ptr, this);
712
664
  return this;
713
665
  }
714
666
  /**
715
667
  * @returns {Uint8Array}
716
668
  */
717
669
  get bytes() {
718
- const ret = wasm.changeref_bytes(this.__wbg_ptr);
670
+ const ret = wasm.changeid_bytes(this.__wbg_ptr);
719
671
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
720
672
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
721
673
  return v1;
722
674
  }
675
+ /**
676
+ * @returns {ChangeId}
677
+ */
678
+ __wasm_refgen_toChangeId() {
679
+ const ret = wasm.changeid___wasm_refgen_toChangeId(this.__wbg_ptr);
680
+ return ChangeId.__wrap(ret);
681
+ }
723
682
  }
724
- if (Symbol.dispose) ChangeRef.prototype[Symbol.dispose] = ChangeRef.prototype.free;
683
+ if (Symbol.dispose) ChangeId.prototype[Symbol.dispose] = ChangeId.prototype.free;
725
684
 
726
- exports.ChangeRef = ChangeRef;
685
+ exports.ChangeId = ChangeId;
727
686
 
728
687
  const CiphertextStoreFinalization = (typeof FinalizationRegistry === 'undefined')
729
688
  ? { register: () => {}, unregister: () => {} }
@@ -818,6 +777,13 @@ class ContactCard {
818
777
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
819
778
  return v1;
820
779
  }
780
+ /**
781
+ * @returns {Agent}
782
+ */
783
+ toAgent() {
784
+ const ret = wasm.contactcard_toAgent(this.__wbg_ptr);
785
+ return Agent.__wrap(ret);
786
+ }
821
787
  /**
822
788
  * @param {string} json
823
789
  * @returns {ContactCard}
@@ -915,28 +881,6 @@ if (Symbol.dispose) Delegation.prototype[Symbol.dispose] = Delegation.prototype.
915
881
 
916
882
  exports.Delegation = Delegation;
917
883
 
918
- const DelegationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
919
- ? { register: () => {}, unregister: () => {} }
920
- : new FinalizationRegistry(ptr => wasm.__wbg_delegationerror_free(ptr >>> 0, 1));
921
-
922
- class DelegationError {
923
-
924
- __destroy_into_raw() {
925
- const ptr = this.__wbg_ptr;
926
- this.__wbg_ptr = 0;
927
- DelegationErrorFinalization.unregister(this);
928
- return ptr;
929
- }
930
-
931
- free() {
932
- const ptr = this.__destroy_into_raw();
933
- wasm.__wbg_delegationerror_free(ptr, 0);
934
- }
935
- }
936
- if (Symbol.dispose) DelegationError.prototype[Symbol.dispose] = DelegationError.prototype.free;
937
-
938
- exports.DelegationError = DelegationError;
939
-
940
884
  const DocContentRefsFinalization = (typeof FinalizationRegistry === 'undefined')
941
885
  ? { register: () => {}, unregister: () => {} }
942
886
  : new FinalizationRegistry(ptr => wasm.__wbg_doccontentrefs_free(ptr >>> 0, 1));
@@ -964,7 +908,7 @@ class DocContentRefs {
964
908
  }
965
909
  /**
966
910
  * @param {DocumentId} doc_id
967
- * @param {ChangeRef[]} change_hashes
911
+ * @param {ChangeId[]} change_hashes
968
912
  */
969
913
  constructor(doc_id, change_hashes) {
970
914
  _assertClass(doc_id, DocumentId);
@@ -980,12 +924,14 @@ class DocContentRefs {
980
924
  return this;
981
925
  }
982
926
  /**
983
- * @param {ChangeRef} hash
927
+ * @param {ChangeId} hash
928
+ * @returns {Promise<void>}
984
929
  */
985
- addChangeRef(hash) {
986
- _assertClass(hash, ChangeRef);
930
+ addChangeId(hash) {
931
+ _assertClass(hash, ChangeId);
987
932
  var ptr0 = hash.__destroy_into_raw();
988
- wasm.doccontentrefs_addChangeRef(this.__wbg_ptr, ptr0);
933
+ const ret = wasm.doccontentrefs_addChangeId(this.__wbg_ptr, ptr0);
934
+ return ret;
989
935
  }
990
936
  /**
991
937
  * @returns {DocumentId}
@@ -995,13 +941,11 @@ class DocContentRefs {
995
941
  return DocumentId.__wrap(ret);
996
942
  }
997
943
  /**
998
- * @returns {ChangeRef[]}
944
+ * @returns {Promise<ChangeId[]>}
999
945
  */
1000
946
  get change_hashes() {
1001
947
  const ret = wasm.doccontentrefs_change_hashes(this.__wbg_ptr);
1002
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1003
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1004
- return v1;
948
+ return ret;
1005
949
  }
1006
950
  }
1007
951
  if (Symbol.dispose) DocContentRefs.prototype[Symbol.dispose] = DocContentRefs.prototype.free;
@@ -1022,13 +966,6 @@ class Document {
1022
966
  return obj;
1023
967
  }
1024
968
 
1025
- static __unwrap(jsValue) {
1026
- if (!(jsValue instanceof Document)) {
1027
- return 0;
1028
- }
1029
- return jsValue.__destroy_into_raw();
1030
- }
1031
-
1032
969
  __destroy_into_raw() {
1033
970
  const ptr = this.__wbg_ptr;
1034
971
  this.__wbg_ptr = 0;
@@ -1044,7 +981,7 @@ class Document {
1044
981
  * @returns {Identifier}
1045
982
  */
1046
983
  get id() {
1047
- const ret = wasm.document_id(this.__wbg_ptr);
984
+ const ret = wasm.document_doc_id(this.__wbg_ptr);
1048
985
  return Identifier.__wrap(ret);
1049
986
  }
1050
987
  /**
@@ -1068,6 +1005,20 @@ class Document {
1068
1005
  const ret = wasm.document_toAgent(this.__wbg_ptr);
1069
1006
  return Agent.__wrap(ret);
1070
1007
  }
1008
+ /**
1009
+ * @returns {Membered}
1010
+ */
1011
+ toMembered() {
1012
+ const ret = wasm.document_toMembered(this.__wbg_ptr);
1013
+ return Membered.__wrap(ret);
1014
+ }
1015
+ /**
1016
+ * @returns {Document}
1017
+ */
1018
+ __wasm_refgen_toDocument() {
1019
+ const ret = wasm.document___wasm_refgen_toDocument(this.__wbg_ptr);
1020
+ return Document.__wrap(ret);
1021
+ }
1071
1022
  }
1072
1023
  if (Symbol.dispose) Document.prototype[Symbol.dispose] = Document.prototype.free;
1073
1024
 
@@ -1115,11 +1066,11 @@ class DocumentId {
1115
1066
  /**
1116
1067
  * @returns {string}
1117
1068
  */
1118
- fromString() {
1069
+ toString() {
1119
1070
  let deferred1_0;
1120
1071
  let deferred1_1;
1121
1072
  try {
1122
- const ret = wasm.documentid_fromString(this.__wbg_ptr);
1073
+ const ret = wasm.documentid_toString(this.__wbg_ptr);
1123
1074
  deferred1_0 = ret[0];
1124
1075
  deferred1_1 = ret[1];
1125
1076
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1344,55 +1295,24 @@ class Event {
1344
1295
  const ret = wasm.event_tryIntoSignedRevocation(this.__wbg_ptr);
1345
1296
  return ret === 0 ? undefined : SignedRevocation.__wrap(ret);
1346
1297
  }
1347
- }
1348
- if (Symbol.dispose) Event.prototype[Symbol.dispose] = Event.prototype.free;
1349
-
1350
- exports.Event = Event;
1351
-
1352
- const GenerateDocErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1353
- ? { register: () => {}, unregister: () => {} }
1354
- : new FinalizationRegistry(ptr => wasm.__wbg_generatedocerror_free(ptr >>> 0, 1));
1355
-
1356
- class GenerateDocError {
1357
-
1358
- static __wrap(ptr) {
1359
- ptr = ptr >>> 0;
1360
- const obj = Object.create(GenerateDocError.prototype);
1361
- obj.__wbg_ptr = ptr;
1362
- GenerateDocErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1363
- return obj;
1364
- }
1365
-
1366
- __destroy_into_raw() {
1367
- const ptr = this.__wbg_ptr;
1368
- this.__wbg_ptr = 0;
1369
- GenerateDocErrorFinalization.unregister(this);
1370
- return ptr;
1371
- }
1372
-
1373
- free() {
1374
- const ptr = this.__destroy_into_raw();
1375
- wasm.__wbg_generatedocerror_free(ptr, 0);
1376
- }
1377
1298
  /**
1378
- * @returns {string}
1299
+ * Converts the underlying [`Event`] to a [`StaticEvent`] and then
1300
+ * serializes it.
1301
+ * @returns {Uint8Array}
1379
1302
  */
1380
- message() {
1381
- let deferred1_0;
1382
- let deferred1_1;
1383
- try {
1384
- const ret = wasm.generatedocerror_message(this.__wbg_ptr);
1385
- deferred1_0 = ret[0];
1386
- deferred1_1 = ret[1];
1387
- return getStringFromWasm0(ret[0], ret[1]);
1388
- } finally {
1389
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1303
+ toBytes() {
1304
+ const ret = wasm.event_toBytes(this.__wbg_ptr);
1305
+ if (ret[3]) {
1306
+ throw takeFromExternrefTable0(ret[2]);
1390
1307
  }
1308
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1309
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1310
+ return v1;
1391
1311
  }
1392
1312
  }
1393
- if (Symbol.dispose) GenerateDocError.prototype[Symbol.dispose] = GenerateDocError.prototype.free;
1313
+ if (Symbol.dispose) Event.prototype[Symbol.dispose] = Event.prototype.free;
1394
1314
 
1395
- exports.GenerateDocError = GenerateDocError;
1315
+ exports.Event = Event;
1396
1316
 
1397
1317
  const GenerateWebCryptoErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1398
1318
  ? { register: () => {}, unregister: () => {} }
@@ -1439,43 +1359,6 @@ if (Symbol.dispose) GenerateWebCryptoError.prototype[Symbol.dispose] = GenerateW
1439
1359
 
1440
1360
  exports.GenerateWebCryptoError = GenerateWebCryptoError;
1441
1361
 
1442
- const GetCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1443
- ? { register: () => {}, unregister: () => {} }
1444
- : new FinalizationRegistry(ptr => wasm.__wbg_getciphertexterror_free(ptr >>> 0, 1));
1445
-
1446
- class GetCiphertextError {
1447
-
1448
- __destroy_into_raw() {
1449
- const ptr = this.__wbg_ptr;
1450
- this.__wbg_ptr = 0;
1451
- GetCiphertextErrorFinalization.unregister(this);
1452
- return ptr;
1453
- }
1454
-
1455
- free() {
1456
- const ptr = this.__destroy_into_raw();
1457
- wasm.__wbg_getciphertexterror_free(ptr, 0);
1458
- }
1459
- /**
1460
- * @returns {string}
1461
- */
1462
- get message() {
1463
- let deferred1_0;
1464
- let deferred1_1;
1465
- try {
1466
- const ret = wasm.getciphertexterror_message(this.__wbg_ptr);
1467
- deferred1_0 = ret[0];
1468
- deferred1_1 = ret[1];
1469
- return getStringFromWasm0(ret[0], ret[1]);
1470
- } finally {
1471
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1472
- }
1473
- }
1474
- }
1475
- if (Symbol.dispose) GetCiphertextError.prototype[Symbol.dispose] = GetCiphertextError.prototype.free;
1476
-
1477
- exports.GetCiphertextError = GetCiphertextError;
1478
-
1479
1362
  const GroupFinalization = (typeof FinalizationRegistry === 'undefined')
1480
1363
  ? { register: () => {}, unregister: () => {} }
1481
1364
  : new FinalizationRegistry(ptr => wasm.__wbg_group_free(ptr >>> 0, 1));
@@ -1505,7 +1388,7 @@ class Group {
1505
1388
  * @returns {Identifier}
1506
1389
  */
1507
1390
  get id() {
1508
- const ret = wasm.group_id(this.__wbg_ptr);
1391
+ const ret = wasm.group_groupId(this.__wbg_ptr);
1509
1392
  return Identifier.__wrap(ret);
1510
1393
  }
1511
1394
  /**
@@ -1516,13 +1399,11 @@ class Group {
1516
1399
  return GroupId.__wrap(ret);
1517
1400
  }
1518
1401
  /**
1519
- * @returns {Capability[]}
1402
+ * @returns {Promise<Capability[]>}
1520
1403
  */
1521
- get members() {
1404
+ members() {
1522
1405
  const ret = wasm.group_members(this.__wbg_ptr);
1523
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1524
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1525
- return v1;
1406
+ return ret;
1526
1407
  }
1527
1408
  /**
1528
1409
  * @returns {Peer}
@@ -1545,6 +1426,13 @@ class Group {
1545
1426
  const ret = wasm.group_toMembered(this.__wbg_ptr);
1546
1427
  return Membered.__wrap(ret);
1547
1428
  }
1429
+ /**
1430
+ * @returns {Group}
1431
+ */
1432
+ __wasm_refgen_toGroup() {
1433
+ const ret = wasm.group___wasm_refgen_toGroup(this.__wbg_ptr);
1434
+ return Group.__wrap(ret);
1435
+ }
1548
1436
  }
1549
1437
  if (Symbol.dispose) Group.prototype[Symbol.dispose] = Group.prototype.free;
1550
1438
 
@@ -1755,18 +1643,18 @@ class Individual {
1755
1643
  * @returns {IndividualId}
1756
1644
  */
1757
1645
  get individualId() {
1758
- const ret = wasm.individual_individualId(this.__wbg_ptr);
1646
+ const ret = wasm.individual_id(this.__wbg_ptr);
1759
1647
  return IndividualId.__wrap(ret);
1760
1648
  }
1761
1649
  /**
1762
1650
  * @param {DocumentId} doc_id
1763
- * @returns {ShareKey}
1651
+ * @returns {Promise<ShareKey>}
1764
1652
  */
1765
1653
  pickPrekey(doc_id) {
1766
1654
  _assertClass(doc_id, DocumentId);
1767
1655
  var ptr0 = doc_id.__destroy_into_raw();
1768
1656
  const ret = wasm.individual_pickPrekey(this.__wbg_ptr, ptr0);
1769
- return ShareKey.__wrap(ret);
1657
+ return ret;
1770
1658
  }
1771
1659
  }
1772
1660
  if (Symbol.dispose) Individual.prototype[Symbol.dispose] = Individual.prototype.free;
@@ -1834,178 +1722,64 @@ if (Symbol.dispose) Invocation.prototype[Symbol.dispose] = Invocation.prototype.
1834
1722
 
1835
1723
  exports.Invocation = Invocation;
1836
1724
 
1837
- const JsDecryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1725
+ const KeyhiveFinalization = (typeof FinalizationRegistry === 'undefined')
1838
1726
  ? { register: () => {}, unregister: () => {} }
1839
- : new FinalizationRegistry(ptr => wasm.__wbg_jsdecrypterror_free(ptr >>> 0, 1));
1727
+ : new FinalizationRegistry(ptr => wasm.__wbg_keyhive_free(ptr >>> 0, 1));
1840
1728
 
1841
- class JsDecryptError {
1729
+ class Keyhive {
1842
1730
 
1843
1731
  static __wrap(ptr) {
1844
1732
  ptr = ptr >>> 0;
1845
- const obj = Object.create(JsDecryptError.prototype);
1733
+ const obj = Object.create(Keyhive.prototype);
1846
1734
  obj.__wbg_ptr = ptr;
1847
- JsDecryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1735
+ KeyhiveFinalization.register(obj, obj.__wbg_ptr, obj);
1848
1736
  return obj;
1849
1737
  }
1850
1738
 
1851
1739
  __destroy_into_raw() {
1852
1740
  const ptr = this.__wbg_ptr;
1853
1741
  this.__wbg_ptr = 0;
1854
- JsDecryptErrorFinalization.unregister(this);
1742
+ KeyhiveFinalization.unregister(this);
1855
1743
  return ptr;
1856
1744
  }
1857
1745
 
1858
1746
  free() {
1859
1747
  const ptr = this.__destroy_into_raw();
1860
- wasm.__wbg_jsdecrypterror_free(ptr, 0);
1748
+ wasm.__wbg_keyhive_free(ptr, 0);
1861
1749
  }
1862
- }
1863
- if (Symbol.dispose) JsDecryptError.prototype[Symbol.dispose] = JsDecryptError.prototype.free;
1864
-
1865
- exports.JsDecryptError = JsDecryptError;
1866
-
1867
- const JsEncryptErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1868
- ? { register: () => {}, unregister: () => {} }
1869
- : new FinalizationRegistry(ptr => wasm.__wbg_jsencrypterror_free(ptr >>> 0, 1));
1870
-
1871
- class JsEncryptError {
1872
-
1873
- static __wrap(ptr) {
1874
- ptr = ptr >>> 0;
1875
- const obj = Object.create(JsEncryptError.prototype);
1876
- obj.__wbg_ptr = ptr;
1877
- JsEncryptErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1878
- return obj;
1750
+ /**
1751
+ * @param {Signer} signer
1752
+ * @param {CiphertextStore} ciphertext_store
1753
+ * @param {Function} event_handler
1754
+ * @returns {Promise<Keyhive>}
1755
+ */
1756
+ static init(signer, ciphertext_store, event_handler) {
1757
+ _assertClass(signer, Signer);
1758
+ _assertClass(ciphertext_store, CiphertextStore);
1759
+ const ret = wasm.keyhive_init(signer.__wbg_ptr, ciphertext_store.__wbg_ptr, event_handler);
1760
+ return ret;
1879
1761
  }
1880
-
1881
- __destroy_into_raw() {
1882
- const ptr = this.__wbg_ptr;
1883
- this.__wbg_ptr = 0;
1884
- JsEncryptErrorFinalization.unregister(this);
1885
- return ptr;
1762
+ /**
1763
+ * @returns {IndividualId}
1764
+ */
1765
+ get id() {
1766
+ const ret = wasm.keyhive_id(this.__wbg_ptr);
1767
+ return IndividualId.__wrap(ret);
1886
1768
  }
1887
-
1888
- free() {
1889
- const ptr = this.__destroy_into_raw();
1890
- wasm.__wbg_jsencrypterror_free(ptr, 0);
1891
- }
1892
- }
1893
- if (Symbol.dispose) JsEncryptError.prototype[Symbol.dispose] = JsEncryptError.prototype.free;
1894
-
1895
- exports.JsEncryptError = JsEncryptError;
1896
-
1897
- const JsReceivePreKeyOpErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1898
- ? { register: () => {}, unregister: () => {} }
1899
- : new FinalizationRegistry(ptr => wasm.__wbg_jsreceiveprekeyoperror_free(ptr >>> 0, 1));
1900
-
1901
- class JsReceivePreKeyOpError {
1902
-
1903
- static __wrap(ptr) {
1904
- ptr = ptr >>> 0;
1905
- const obj = Object.create(JsReceivePreKeyOpError.prototype);
1906
- obj.__wbg_ptr = ptr;
1907
- JsReceivePreKeyOpErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1908
- return obj;
1909
- }
1910
-
1911
- __destroy_into_raw() {
1912
- const ptr = this.__wbg_ptr;
1913
- this.__wbg_ptr = 0;
1914
- JsReceivePreKeyOpErrorFinalization.unregister(this);
1915
- return ptr;
1916
- }
1917
-
1918
- free() {
1919
- const ptr = this.__destroy_into_raw();
1920
- wasm.__wbg_jsreceiveprekeyoperror_free(ptr, 0);
1921
- }
1922
- }
1923
- if (Symbol.dispose) JsReceivePreKeyOpError.prototype[Symbol.dispose] = JsReceivePreKeyOpError.prototype.free;
1924
-
1925
- exports.JsReceivePreKeyOpError = JsReceivePreKeyOpError;
1926
-
1927
- const JsReceiveStaticEventErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1928
- ? { register: () => {}, unregister: () => {} }
1929
- : new FinalizationRegistry(ptr => wasm.__wbg_jsreceivestaticeventerror_free(ptr >>> 0, 1));
1930
-
1931
- class JsReceiveStaticEventError {
1932
-
1933
- static __wrap(ptr) {
1934
- ptr = ptr >>> 0;
1935
- const obj = Object.create(JsReceiveStaticEventError.prototype);
1936
- obj.__wbg_ptr = ptr;
1937
- JsReceiveStaticEventErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1938
- return obj;
1939
- }
1940
-
1941
- __destroy_into_raw() {
1942
- const ptr = this.__wbg_ptr;
1943
- this.__wbg_ptr = 0;
1944
- JsReceiveStaticEventErrorFinalization.unregister(this);
1945
- return ptr;
1946
- }
1947
-
1948
- free() {
1949
- const ptr = this.__destroy_into_raw();
1950
- wasm.__wbg_jsreceivestaticeventerror_free(ptr, 0);
1951
- }
1952
- }
1953
- if (Symbol.dispose) JsReceiveStaticEventError.prototype[Symbol.dispose] = JsReceiveStaticEventError.prototype.free;
1954
-
1955
- exports.JsReceiveStaticEventError = JsReceiveStaticEventError;
1956
-
1957
- const KeyhiveFinalization = (typeof FinalizationRegistry === 'undefined')
1958
- ? { register: () => {}, unregister: () => {} }
1959
- : new FinalizationRegistry(ptr => wasm.__wbg_keyhive_free(ptr >>> 0, 1));
1960
-
1961
- class Keyhive {
1962
-
1963
- static __wrap(ptr) {
1964
- ptr = ptr >>> 0;
1965
- const obj = Object.create(Keyhive.prototype);
1966
- obj.__wbg_ptr = ptr;
1967
- KeyhiveFinalization.register(obj, obj.__wbg_ptr, obj);
1968
- return obj;
1969
- }
1970
-
1971
- __destroy_into_raw() {
1972
- const ptr = this.__wbg_ptr;
1973
- this.__wbg_ptr = 0;
1974
- KeyhiveFinalization.unregister(this);
1975
- return ptr;
1976
- }
1977
-
1978
- free() {
1979
- const ptr = this.__destroy_into_raw();
1980
- wasm.__wbg_keyhive_free(ptr, 0);
1769
+ /**
1770
+ * @returns {IndividualId}
1771
+ */
1772
+ get whoami() {
1773
+ const ret = wasm.keyhive_whoami(this.__wbg_ptr);
1774
+ return IndividualId.__wrap(ret);
1981
1775
  }
1982
1776
  /**
1983
- * @param {Signer} signer
1984
- * @param {CiphertextStore} ciphertext_store
1985
- * @param {Function} event_handler
1986
- * @returns {Promise<Keyhive>}
1777
+ * @returns {Promise<Individual>}
1987
1778
  */
1988
- static init(signer, ciphertext_store, event_handler) {
1989
- _assertClass(signer, Signer);
1990
- _assertClass(ciphertext_store, CiphertextStore);
1991
- var ptr0 = ciphertext_store.__destroy_into_raw();
1992
- const ret = wasm.keyhive_init(signer.__wbg_ptr, ptr0, event_handler);
1779
+ get individual() {
1780
+ const ret = wasm.keyhive_individual(this.__wbg_ptr);
1993
1781
  return ret;
1994
1782
  }
1995
- /**
1996
- * @returns {IndividualId}
1997
- */
1998
- get id() {
1999
- const ret = wasm.keyhive_id(this.__wbg_ptr);
2000
- return IndividualId.__wrap(ret);
2001
- }
2002
- /**
2003
- * @returns {IndividualId}
2004
- */
2005
- get whoami() {
2006
- const ret = wasm.keyhive_id(this.__wbg_ptr);
2007
- return IndividualId.__wrap(ret);
2008
- }
2009
1783
  /**
2010
1784
  * @returns {string}
2011
1785
  */
@@ -2022,25 +1796,25 @@ class Keyhive {
2022
1796
  }
2023
1797
  }
2024
1798
  /**
2025
- * @param {Peer[]} coparents
1799
+ * @param {Peer[]} js_coparents
2026
1800
  * @returns {Promise<Group>}
2027
1801
  */
2028
- generateGroup(coparents) {
2029
- const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
1802
+ generateGroup(js_coparents) {
1803
+ const ptr0 = passArrayJsValueToWasm0(js_coparents, wasm.__wbindgen_malloc);
2030
1804
  const len0 = WASM_VECTOR_LEN;
2031
1805
  const ret = wasm.keyhive_generateGroup(this.__wbg_ptr, ptr0, len0);
2032
1806
  return ret;
2033
1807
  }
2034
1808
  /**
2035
1809
  * @param {Peer[]} coparents
2036
- * @param {ChangeRef} initial_content_ref_head
2037
- * @param {ChangeRef[]} more_initial_content_refs
1810
+ * @param {ChangeId} initial_content_ref_head
1811
+ * @param {ChangeId[]} more_initial_content_refs
2038
1812
  * @returns {Promise<Document>}
2039
1813
  */
2040
1814
  generateDocument(coparents, initial_content_ref_head, more_initial_content_refs) {
2041
1815
  const ptr0 = passArrayJsValueToWasm0(coparents, wasm.__wbindgen_malloc);
2042
1816
  const len0 = WASM_VECTOR_LEN;
2043
- _assertClass(initial_content_ref_head, ChangeRef);
1817
+ _assertClass(initial_content_ref_head, ChangeId);
2044
1818
  var ptr1 = initial_content_ref_head.__destroy_into_raw();
2045
1819
  const ptr2 = passArrayJsValueToWasm0(more_initial_content_refs, wasm.__wbindgen_malloc);
2046
1820
  const len2 = WASM_VECTOR_LEN;
@@ -2059,17 +1833,17 @@ class Keyhive {
2059
1833
  }
2060
1834
  /**
2061
1835
  * @param {Document} doc
2062
- * @param {ChangeRef} content_ref
2063
- * @param {ChangeRef[]} pred_refs
1836
+ * @param {ChangeId} content_ref
1837
+ * @param {ChangeId[]} js_pred_refs
2064
1838
  * @param {Uint8Array} content
2065
1839
  * @returns {Promise<EncryptedContentWithUpdate>}
2066
1840
  */
2067
- tryEncrypt(doc, content_ref, pred_refs, content) {
1841
+ tryEncrypt(doc, content_ref, js_pred_refs, content) {
2068
1842
  _assertClass(doc, Document);
2069
1843
  var ptr0 = doc.__destroy_into_raw();
2070
- _assertClass(content_ref, ChangeRef);
1844
+ _assertClass(content_ref, ChangeId);
2071
1845
  var ptr1 = content_ref.__destroy_into_raw();
2072
- const ptr2 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
1846
+ const ptr2 = passArrayJsValueToWasm0(js_pred_refs, wasm.__wbindgen_malloc);
2073
1847
  const len2 = WASM_VECTOR_LEN;
2074
1848
  const ptr3 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2075
1849
  const len3 = WASM_VECTOR_LEN;
@@ -2078,40 +1852,31 @@ class Keyhive {
2078
1852
  }
2079
1853
  /**
2080
1854
  * @param {Document} doc
2081
- * @param {ChangeRef} content_ref
2082
- * @param {ChangeRef[]} pred_refs
1855
+ * @param {ChangeId} content_ref
1856
+ * @param {ChangeId[]} pred_refs
2083
1857
  * @param {Uint8Array} content
2084
1858
  * @returns {Promise<EncryptedContentWithUpdate>}
2085
1859
  */
2086
1860
  tryEncryptArchive(doc, content_ref, pred_refs, content) {
2087
1861
  _assertClass(doc, Document);
2088
- var ptr0 = doc.__destroy_into_raw();
2089
- _assertClass(content_ref, ChangeRef);
2090
- var ptr1 = content_ref.__destroy_into_raw();
2091
- const ptr2 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
2092
- const len2 = WASM_VECTOR_LEN;
2093
- const ptr3 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
2094
- const len3 = WASM_VECTOR_LEN;
2095
- const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, ptr0, ptr1, ptr2, len2, ptr3, len3);
1862
+ _assertClass(content_ref, ChangeId);
1863
+ const ptr0 = passArrayJsValueToWasm0(pred_refs, wasm.__wbindgen_malloc);
1864
+ const len0 = WASM_VECTOR_LEN;
1865
+ const ptr1 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
1866
+ const len1 = WASM_VECTOR_LEN;
1867
+ const ret = wasm.keyhive_tryEncryptArchive(this.__wbg_ptr, doc.__wbg_ptr, content_ref.__wbg_ptr, ptr0, len0, ptr1, len1);
2096
1868
  return ret;
2097
1869
  }
2098
1870
  /**
2099
1871
  * @param {Document} doc
2100
1872
  * @param {Encrypted} encrypted
2101
- * @returns {Uint8Array}
1873
+ * @returns {Promise<Uint8Array>}
2102
1874
  */
2103
1875
  tryDecrypt(doc, encrypted) {
2104
1876
  _assertClass(doc, Document);
2105
- var ptr0 = doc.__destroy_into_raw();
2106
1877
  _assertClass(encrypted, Encrypted);
2107
- var ptr1 = encrypted.__destroy_into_raw();
2108
- const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, ptr0, ptr1);
2109
- if (ret[3]) {
2110
- throw takeFromExternrefTable0(ret[2]);
2111
- }
2112
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2113
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2114
- return v3;
1878
+ const ret = wasm.keyhive_tryDecrypt(this.__wbg_ptr, doc.__wbg_ptr, encrypted.__wbg_ptr);
1879
+ return ret;
2115
1880
  }
2116
1881
  /**
2117
1882
  * @param {Agent} to_add
@@ -2143,13 +1908,11 @@ class Keyhive {
2143
1908
  return ret;
2144
1909
  }
2145
1910
  /**
2146
- * @returns {Summary[]}
1911
+ * @returns {Promise<Summary[]>}
2147
1912
  */
2148
1913
  reachableDocs() {
2149
1914
  const ret = wasm.keyhive_reachableDocs(this.__wbg_ptr);
2150
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2151
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2152
- return v1;
1915
+ return ret;
2153
1916
  }
2154
1917
  /**
2155
1918
  * @param {Document} doc
@@ -2186,71 +1949,74 @@ class Keyhive {
2186
1949
  }
2187
1950
  /**
2188
1951
  * @param {ContactCard} contact_card
2189
- * @returns {Individual}
1952
+ * @returns {Promise<Individual>}
2190
1953
  */
2191
1954
  receiveContactCard(contact_card) {
2192
1955
  _assertClass(contact_card, ContactCard);
2193
- var ptr0 = contact_card.__destroy_into_raw();
2194
- const ret = wasm.keyhive_receiveContactCard(this.__wbg_ptr, ptr0);
2195
- if (ret[2]) {
2196
- throw takeFromExternrefTable0(ret[1]);
2197
- }
2198
- return Individual.__wrap(ret[0]);
1956
+ const ret = wasm.keyhive_receiveContactCard(this.__wbg_ptr, contact_card.__wbg_ptr);
1957
+ return ret;
2199
1958
  }
2200
1959
  /**
2201
1960
  * @param {Identifier} id
2202
- * @returns {Agent | undefined}
1961
+ * @returns {Promise<Agent | undefined>}
2203
1962
  */
2204
1963
  getAgent(id) {
2205
1964
  _assertClass(id, Identifier);
2206
1965
  const ret = wasm.keyhive_getAgent(this.__wbg_ptr, id.__wbg_ptr);
2207
- return ret === 0 ? undefined : Agent.__wrap(ret);
1966
+ return ret;
2208
1967
  }
2209
1968
  /**
2210
- * @param {Identifier} id
2211
- * @returns {Group | undefined}
1969
+ * @param {GroupId} group_id
1970
+ * @returns {Promise<Group | undefined>}
2212
1971
  */
2213
- getGroup(id) {
2214
- _assertClass(id, Identifier);
2215
- const ret = wasm.keyhive_getGroup(this.__wbg_ptr, id.__wbg_ptr);
2216
- return ret === 0 ? undefined : Group.__wrap(ret);
1972
+ getGroup(group_id) {
1973
+ _assertClass(group_id, GroupId);
1974
+ const ret = wasm.keyhive_getGroup(this.__wbg_ptr, group_id.__wbg_ptr);
1975
+ return ret;
2217
1976
  }
2218
1977
  /**
2219
1978
  * @param {DocumentId} doc_id
2220
- * @returns {SimpleCapability[]}
1979
+ * @returns {Promise<Document | undefined>}
1980
+ */
1981
+ getDocument(doc_id) {
1982
+ _assertClass(doc_id, DocumentId);
1983
+ const ret = wasm.keyhive_getDocument(this.__wbg_ptr, doc_id.__wbg_ptr);
1984
+ return ret;
1985
+ }
1986
+ /**
1987
+ * @param {DocumentId} doc_id
1988
+ * @returns {Promise<Membership[]>}
2221
1989
  */
2222
1990
  docMemberCapabilities(doc_id) {
2223
1991
  _assertClass(doc_id, DocumentId);
2224
1992
  const ret = wasm.keyhive_docMemberCapabilities(this.__wbg_ptr, doc_id.__wbg_ptr);
2225
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2226
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2227
- return v1;
1993
+ return ret;
2228
1994
  }
2229
1995
  /**
2230
1996
  * @param {Identifier} id
2231
1997
  * @param {DocumentId} doc_id
2232
- * @returns {Access | undefined}
1998
+ * @returns {Promise<Access | undefined>}
2233
1999
  */
2234
2000
  accessForDoc(id, doc_id) {
2235
2001
  _assertClass(id, Identifier);
2236
2002
  _assertClass(doc_id, DocumentId);
2237
2003
  const ret = wasm.keyhive_accessForDoc(this.__wbg_ptr, id.__wbg_ptr, doc_id.__wbg_ptr);
2238
- return ret === 0 ? undefined : Access.__wrap(ret);
2004
+ return ret;
2239
2005
  }
2240
2006
  /**
2241
- * @returns {Archive}
2007
+ * @returns {Promise<Archive>}
2242
2008
  */
2243
2009
  intoArchive() {
2244
2010
  const ptr = this.__destroy_into_raw();
2245
2011
  const ret = wasm.keyhive_intoArchive(ptr);
2246
- return Archive.__wrap(ret);
2012
+ return ret;
2247
2013
  }
2248
2014
  /**
2249
- * @returns {Archive}
2015
+ * @returns {Promise<Archive>}
2250
2016
  */
2251
2017
  toArchive() {
2252
2018
  const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2253
- return Archive.__wrap(ret);
2019
+ return ret;
2254
2020
  }
2255
2021
  /**
2256
2022
  * @param {Archive} archive
@@ -2261,6 +2027,21 @@ class Keyhive {
2261
2027
  const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
2262
2028
  return ret;
2263
2029
  }
2030
+ /**
2031
+ * @param {Array<any>} events_bytes_array
2032
+ * @returns {Promise<Array<any>>}
2033
+ */
2034
+ ingestEventsBytes(events_bytes_array) {
2035
+ const ret = wasm.keyhive_ingestEventsBytes(this.__wbg_ptr, events_bytes_array);
2036
+ return ret;
2037
+ }
2038
+ /**
2039
+ * @returns {Promise<Stats>}
2040
+ */
2041
+ stats() {
2042
+ const ret = wasm.keyhive_stats(this.__wbg_ptr);
2043
+ return ret;
2044
+ }
2264
2045
  }
2265
2046
  if (Symbol.dispose) Keyhive.prototype[Symbol.dispose] = Keyhive.prototype.free;
2266
2047
 
@@ -2296,6 +2077,50 @@ if (Symbol.dispose) Membered.prototype[Symbol.dispose] = Membered.prototype.free
2296
2077
 
2297
2078
  exports.Membered = Membered;
2298
2079
 
2080
+ const MembershipFinalization = (typeof FinalizationRegistry === 'undefined')
2081
+ ? { register: () => {}, unregister: () => {} }
2082
+ : new FinalizationRegistry(ptr => wasm.__wbg_membership_free(ptr >>> 0, 1));
2083
+
2084
+ class Membership {
2085
+
2086
+ static __wrap(ptr) {
2087
+ ptr = ptr >>> 0;
2088
+ const obj = Object.create(Membership.prototype);
2089
+ obj.__wbg_ptr = ptr;
2090
+ MembershipFinalization.register(obj, obj.__wbg_ptr, obj);
2091
+ return obj;
2092
+ }
2093
+
2094
+ __destroy_into_raw() {
2095
+ const ptr = this.__wbg_ptr;
2096
+ this.__wbg_ptr = 0;
2097
+ MembershipFinalization.unregister(this);
2098
+ return ptr;
2099
+ }
2100
+
2101
+ free() {
2102
+ const ptr = this.__destroy_into_raw();
2103
+ wasm.__wbg_membership_free(ptr, 0);
2104
+ }
2105
+ /**
2106
+ * @returns {Agent}
2107
+ */
2108
+ get who() {
2109
+ const ret = wasm.membership_who(this.__wbg_ptr);
2110
+ return Agent.__wrap(ret);
2111
+ }
2112
+ /**
2113
+ * @returns {Access}
2114
+ */
2115
+ get can() {
2116
+ const ret = wasm.membership_can(this.__wbg_ptr);
2117
+ return Access.__wrap(ret);
2118
+ }
2119
+ }
2120
+ if (Symbol.dispose) Membership.prototype[Symbol.dispose] = Membership.prototype.free;
2121
+
2122
+ exports.Membership = Membership;
2123
+
2299
2124
  const PeerFinalization = (typeof FinalizationRegistry === 'undefined')
2300
2125
  ? { register: () => {}, unregister: () => {} }
2301
2126
  : new FinalizationRegistry(ptr => wasm.__wbg_peer_free(ptr >>> 0, 1));
@@ -2310,13 +2135,6 @@ class Peer {
2310
2135
  return obj;
2311
2136
  }
2312
2137
 
2313
- static __unwrap(jsValue) {
2314
- if (!(jsValue instanceof Peer)) {
2315
- return 0;
2316
- }
2317
- return jsValue.__destroy_into_raw();
2318
- }
2319
-
2320
2138
  __destroy_into_raw() {
2321
2139
  const ptr = this.__wbg_ptr;
2322
2140
  this.__wbg_ptr = 0;
@@ -2328,6 +2146,13 @@ class Peer {
2328
2146
  const ptr = this.__destroy_into_raw();
2329
2147
  wasm.__wbg_peer_free(ptr, 0);
2330
2148
  }
2149
+ /**
2150
+ * @returns {Identifier}
2151
+ */
2152
+ get id() {
2153
+ const ret = wasm.peer_id(this.__wbg_ptr);
2154
+ return Identifier.__wrap(ret);
2155
+ }
2331
2156
  /**
2332
2157
  * @returns {string}
2333
2158
  */
@@ -2364,33 +2189,18 @@ class Peer {
2364
2189
  const ret = wasm.peer_isDocument(this.__wbg_ptr);
2365
2190
  return ret !== 0;
2366
2191
  }
2192
+ /**
2193
+ * @returns {Peer}
2194
+ */
2195
+ __wasm_refgen_toPeer() {
2196
+ const ret = wasm.peer___wasm_refgen_toPeer(this.__wbg_ptr);
2197
+ return Peer.__wrap(ret);
2198
+ }
2367
2199
  }
2368
2200
  if (Symbol.dispose) Peer.prototype[Symbol.dispose] = Peer.prototype.free;
2369
2201
 
2370
2202
  exports.Peer = Peer;
2371
2203
 
2372
- const RemoveCiphertextErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2373
- ? { register: () => {}, unregister: () => {} }
2374
- : new FinalizationRegistry(ptr => wasm.__wbg_removeciphertexterror_free(ptr >>> 0, 1));
2375
-
2376
- class RemoveCiphertextError {
2377
-
2378
- __destroy_into_raw() {
2379
- const ptr = this.__wbg_ptr;
2380
- this.__wbg_ptr = 0;
2381
- RemoveCiphertextErrorFinalization.unregister(this);
2382
- return ptr;
2383
- }
2384
-
2385
- free() {
2386
- const ptr = this.__destroy_into_raw();
2387
- wasm.__wbg_removeciphertexterror_free(ptr, 0);
2388
- }
2389
- }
2390
- if (Symbol.dispose) RemoveCiphertextError.prototype[Symbol.dispose] = RemoveCiphertextError.prototype.free;
2391
-
2392
- exports.RemoveCiphertextError = RemoveCiphertextError;
2393
-
2394
2204
  const RevocationFinalization = (typeof FinalizationRegistry === 'undefined')
2395
2205
  ? { register: () => {}, unregister: () => {} }
2396
2206
  : new FinalizationRegistry(ptr => wasm.__wbg_revocation_free(ptr >>> 0, 1));
@@ -2449,89 +2259,6 @@ if (Symbol.dispose) Revocation.prototype[Symbol.dispose] = Revocation.prototype.
2449
2259
 
2450
2260
  exports.Revocation = Revocation;
2451
2261
 
2452
- const RevokeMemberErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2453
- ? { register: () => {}, unregister: () => {} }
2454
- : new FinalizationRegistry(ptr => wasm.__wbg_revokemembererror_free(ptr >>> 0, 1));
2455
-
2456
- class RevokeMemberError {
2457
-
2458
- static __wrap(ptr) {
2459
- ptr = ptr >>> 0;
2460
- const obj = Object.create(RevokeMemberError.prototype);
2461
- obj.__wbg_ptr = ptr;
2462
- RevokeMemberErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2463
- return obj;
2464
- }
2465
-
2466
- __destroy_into_raw() {
2467
- const ptr = this.__wbg_ptr;
2468
- this.__wbg_ptr = 0;
2469
- RevokeMemberErrorFinalization.unregister(this);
2470
- return ptr;
2471
- }
2472
-
2473
- free() {
2474
- const ptr = this.__destroy_into_raw();
2475
- wasm.__wbg_revokemembererror_free(ptr, 0);
2476
- }
2477
- /**
2478
- * @returns {string}
2479
- */
2480
- get message() {
2481
- let deferred1_0;
2482
- let deferred1_1;
2483
- try {
2484
- const ret = wasm.revokemembererror_message(this.__wbg_ptr);
2485
- deferred1_0 = ret[0];
2486
- deferred1_1 = ret[1];
2487
- return getStringFromWasm0(ret[0], ret[1]);
2488
- } finally {
2489
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2490
- }
2491
- }
2492
- }
2493
- if (Symbol.dispose) RevokeMemberError.prototype[Symbol.dispose] = RevokeMemberError.prototype.free;
2494
-
2495
- exports.RevokeMemberError = RevokeMemberError;
2496
-
2497
- const SerializationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2498
- ? { register: () => {}, unregister: () => {} }
2499
- : new FinalizationRegistry(ptr => wasm.__wbg_serializationerror_free(ptr >>> 0, 1));
2500
-
2501
- class SerializationError {
2502
-
2503
- static __wrap(ptr) {
2504
- ptr = ptr >>> 0;
2505
- const obj = Object.create(SerializationError.prototype);
2506
- obj.__wbg_ptr = ptr;
2507
- SerializationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2508
- return obj;
2509
- }
2510
-
2511
- __destroy_into_raw() {
2512
- const ptr = this.__wbg_ptr;
2513
- this.__wbg_ptr = 0;
2514
- SerializationErrorFinalization.unregister(this);
2515
- return ptr;
2516
- }
2517
-
2518
- free() {
2519
- const ptr = this.__destroy_into_raw();
2520
- wasm.__wbg_serializationerror_free(ptr, 0);
2521
- }
2522
- /**
2523
- * @returns {any}
2524
- */
2525
- toError() {
2526
- const ptr = this.__destroy_into_raw();
2527
- const ret = wasm.serializationerror_toError(ptr);
2528
- return ret;
2529
- }
2530
- }
2531
- if (Symbol.dispose) SerializationError.prototype[Symbol.dispose] = SerializationError.prototype.free;
2532
-
2533
- exports.SerializationError = SerializationError;
2534
-
2535
2262
  const ShareKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2536
2263
  ? { register: () => {}, unregister: () => {} }
2537
2264
  : new FinalizationRegistry(ptr => wasm.__wbg_sharekey_free(ptr >>> 0, 1));
@@ -2595,13 +2322,19 @@ class Signed {
2595
2322
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
2596
2323
  const len0 = WASM_VECTOR_LEN;
2597
2324
  const ret = wasm.signed_fromBytes(ptr0, len0);
2598
- return Signed.__wrap(ret);
2325
+ if (ret[2]) {
2326
+ throw takeFromExternrefTable0(ret[1]);
2327
+ }
2328
+ return Signed.__wrap(ret[0]);
2599
2329
  }
2600
2330
  /**
2601
2331
  * @returns {Uint8Array}
2602
2332
  */
2603
2333
  toBytes() {
2604
2334
  const ret = wasm.signed_toBytes(this.__wbg_ptr);
2335
+ if (ret[3]) {
2336
+ throw takeFromExternrefTable0(ret[2]);
2337
+ }
2605
2338
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
2606
2339
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2607
2340
  return v1;
@@ -2958,102 +2691,93 @@ class Signer {
2958
2691
  * @returns {Signer}
2959
2692
  */
2960
2693
  clone() {
2961
- const ret = wasm.signer_clone(this.__wbg_ptr);
2962
- return Signer.__wrap(ret);
2963
- }
2964
- }
2965
- if (Symbol.dispose) Signer.prototype[Symbol.dispose] = Signer.prototype.free;
2966
-
2967
- exports.Signer = Signer;
2968
-
2969
- const SigningErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2970
- ? { register: () => {}, unregister: () => {} }
2971
- : new FinalizationRegistry(ptr => wasm.__wbg_signingerror_free(ptr >>> 0, 1));
2972
-
2973
- class SigningError {
2974
-
2975
- static __wrap(ptr) {
2976
- ptr = ptr >>> 0;
2977
- const obj = Object.create(SigningError.prototype);
2978
- obj.__wbg_ptr = ptr;
2979
- SigningErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2980
- return obj;
2981
- }
2982
-
2983
- __destroy_into_raw() {
2984
- const ptr = this.__wbg_ptr;
2985
- this.__wbg_ptr = 0;
2986
- SigningErrorFinalization.unregister(this);
2987
- return ptr;
2988
- }
2989
-
2990
- free() {
2991
- const ptr = this.__destroy_into_raw();
2992
- wasm.__wbg_signingerror_free(ptr, 0);
2993
- }
2994
- /**
2995
- * @returns {string}
2996
- */
2997
- message() {
2998
- let deferred1_0;
2999
- let deferred1_1;
3000
- try {
3001
- const ret = wasm.signingerror_message(this.__wbg_ptr);
3002
- deferred1_0 = ret[0];
3003
- deferred1_1 = ret[1];
3004
- return getStringFromWasm0(ret[0], ret[1]);
3005
- } finally {
3006
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3007
- }
2694
+ const ret = wasm.signer_clone(this.__wbg_ptr);
2695
+ return Signer.__wrap(ret);
3008
2696
  }
3009
2697
  }
3010
- if (Symbol.dispose) SigningError.prototype[Symbol.dispose] = SigningError.prototype.free;
2698
+ if (Symbol.dispose) Signer.prototype[Symbol.dispose] = Signer.prototype.free;
3011
2699
 
3012
- exports.SigningError = SigningError;
2700
+ exports.Signer = Signer;
3013
2701
 
3014
- const SimpleCapabilityFinalization = (typeof FinalizationRegistry === 'undefined')
2702
+ const StatsFinalization = (typeof FinalizationRegistry === 'undefined')
3015
2703
  ? { register: () => {}, unregister: () => {} }
3016
- : new FinalizationRegistry(ptr => wasm.__wbg_simplecapability_free(ptr >>> 0, 1));
2704
+ : new FinalizationRegistry(ptr => wasm.__wbg_stats_free(ptr >>> 0, 1));
3017
2705
 
3018
- class SimpleCapability {
2706
+ class Stats {
3019
2707
 
3020
2708
  static __wrap(ptr) {
3021
2709
  ptr = ptr >>> 0;
3022
- const obj = Object.create(SimpleCapability.prototype);
2710
+ const obj = Object.create(Stats.prototype);
3023
2711
  obj.__wbg_ptr = ptr;
3024
- SimpleCapabilityFinalization.register(obj, obj.__wbg_ptr, obj);
2712
+ StatsFinalization.register(obj, obj.__wbg_ptr, obj);
3025
2713
  return obj;
3026
2714
  }
3027
2715
 
3028
2716
  __destroy_into_raw() {
3029
2717
  const ptr = this.__wbg_ptr;
3030
2718
  this.__wbg_ptr = 0;
3031
- SimpleCapabilityFinalization.unregister(this);
2719
+ StatsFinalization.unregister(this);
3032
2720
  return ptr;
3033
2721
  }
3034
2722
 
3035
2723
  free() {
3036
2724
  const ptr = this.__destroy_into_raw();
3037
- wasm.__wbg_simplecapability_free(ptr, 0);
2725
+ wasm.__wbg_stats_free(ptr, 0);
3038
2726
  }
3039
2727
  /**
3040
- * @returns {Agent}
2728
+ * @returns {bigint}
3041
2729
  */
3042
- get who() {
3043
- const ret = wasm.simplecapability_who(this.__wbg_ptr);
3044
- return Agent.__wrap(ret);
2730
+ get individuals() {
2731
+ const ret = wasm.stats_individuals(this.__wbg_ptr);
2732
+ return BigInt.asUintN(64, ret);
3045
2733
  }
3046
2734
  /**
3047
- * @returns {Access}
2735
+ * @returns {bigint}
3048
2736
  */
3049
- get can() {
3050
- const ret = wasm.simplecapability_can(this.__wbg_ptr);
3051
- return Access.__wrap(ret);
2737
+ get groups() {
2738
+ const ret = wasm.stats_groups(this.__wbg_ptr);
2739
+ return BigInt.asUintN(64, ret);
2740
+ }
2741
+ /**
2742
+ * @returns {bigint}
2743
+ */
2744
+ get docs() {
2745
+ const ret = wasm.stats_docs(this.__wbg_ptr);
2746
+ return BigInt.asUintN(64, ret);
2747
+ }
2748
+ /**
2749
+ * @returns {bigint}
2750
+ */
2751
+ get delegations() {
2752
+ const ret = wasm.stats_delegations(this.__wbg_ptr);
2753
+ return BigInt.asUintN(64, ret);
2754
+ }
2755
+ /**
2756
+ * @returns {bigint}
2757
+ */
2758
+ get revocations() {
2759
+ const ret = wasm.stats_revocations(this.__wbg_ptr);
2760
+ return BigInt.asUintN(64, ret);
2761
+ }
2762
+ /**
2763
+ * @returns {string}
2764
+ */
2765
+ toString() {
2766
+ let deferred1_0;
2767
+ let deferred1_1;
2768
+ try {
2769
+ const ret = wasm.stats_toString(this.__wbg_ptr);
2770
+ deferred1_0 = ret[0];
2771
+ deferred1_1 = ret[1];
2772
+ return getStringFromWasm0(ret[0], ret[1]);
2773
+ } finally {
2774
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2775
+ }
3052
2776
  }
3053
2777
  }
3054
- if (Symbol.dispose) SimpleCapability.prototype[Symbol.dispose] = SimpleCapability.prototype.free;
2778
+ if (Symbol.dispose) Stats.prototype[Symbol.dispose] = Stats.prototype.free;
3055
2779
 
3056
- exports.SimpleCapability = SimpleCapability;
2780
+ exports.Stats = Stats;
3057
2781
 
3058
2782
  const SummaryFinalization = (typeof FinalizationRegistry === 'undefined')
3059
2783
  ? { register: () => {}, unregister: () => {} }
@@ -3099,51 +2823,23 @@ if (Symbol.dispose) Summary.prototype[Symbol.dispose] = Summary.prototype.free;
3099
2823
 
3100
2824
  exports.Summary = Summary;
3101
2825
 
3102
- const TryFromArchiveErrorFinalization = (typeof FinalizationRegistry === 'undefined')
3103
- ? { register: () => {}, unregister: () => {} }
3104
- : new FinalizationRegistry(ptr => wasm.__wbg_tryfromarchiveerror_free(ptr >>> 0, 1));
3105
-
3106
- class TryFromArchiveError {
3107
-
3108
- static __wrap(ptr) {
3109
- ptr = ptr >>> 0;
3110
- const obj = Object.create(TryFromArchiveError.prototype);
3111
- obj.__wbg_ptr = ptr;
3112
- TryFromArchiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
3113
- return obj;
3114
- }
3115
-
3116
- __destroy_into_raw() {
3117
- const ptr = this.__wbg_ptr;
3118
- this.__wbg_ptr = 0;
3119
- TryFromArchiveErrorFinalization.unregister(this);
3120
- return ptr;
3121
- }
3122
-
3123
- free() {
3124
- const ptr = this.__destroy_into_raw();
3125
- wasm.__wbg_tryfromarchiveerror_free(ptr, 0);
3126
- }
3127
- /**
3128
- * @returns {any}
3129
- */
3130
- toError() {
3131
- const ptr = this.__destroy_into_raw();
3132
- const ret = wasm.tryfromarchiveerror_toError(ptr);
3133
- return ret;
3134
- }
3135
- }
3136
- if (Symbol.dispose) TryFromArchiveError.prototype[Symbol.dispose] = TryFromArchiveError.prototype.free;
3137
-
3138
- exports.TryFromArchiveError = TryFromArchiveError;
3139
-
3140
2826
  exports.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
3141
2827
  const ret = Error(getStringFromWasm0(arg0, arg1));
3142
2828
  return ret;
3143
2829
  };
3144
2830
 
3145
- exports.__wbg_addmembererror_new = function(arg0) {
3146
- const ret = AddMemberError.__wrap(arg0);
2831
+ exports.__wbg_access_new = function(arg0) {
2832
+ const ret = Access.__wrap(arg0);
2833
+ return ret;
2834
+ };
2835
+
2836
+ exports.__wbg_agent_new = function(arg0) {
2837
+ const ret = Agent.__wrap(arg0);
2838
+ return ret;
2839
+ };
2840
+
2841
+ exports.__wbg_archive_new = function(arg0) {
2842
+ const ret = Archive.__wrap(arg0);
3147
2843
  return ret;
3148
2844
  };
3149
2845
 
@@ -3172,13 +2868,13 @@ exports.__wbg_capability_new = function(arg0) {
3172
2868
  return ret;
3173
2869
  };
3174
2870
 
3175
- exports.__wbg_changeref_new = function(arg0) {
3176
- const ret = ChangeRef.__wrap(arg0);
2871
+ exports.__wbg_changeid_new = function(arg0) {
2872
+ const ret = ChangeId.__wrap(arg0);
3177
2873
  return ret;
3178
2874
  };
3179
2875
 
3180
- exports.__wbg_changeref_unwrap = function(arg0) {
3181
- const ret = ChangeRef.__unwrap(arg0);
2876
+ exports.__wbg_changeid_unwrap = function(arg0) {
2877
+ const ret = ChangeId.__unwrap(arg0);
3182
2878
  return ret;
3183
2879
  };
3184
2880
 
@@ -3192,10 +2888,29 @@ exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
3192
2888
  return ret;
3193
2889
  };
3194
2890
 
3195
- exports.__wbg_crypto_92ce5ebc02988b17 = function() { return handleError(function (arg0) {
3196
- const ret = arg0.crypto;
3197
- return ret;
3198
- }, arguments) };
2891
+ exports.__wbg_debug_68afdd09483bcd1b = function(arg0, arg1) {
2892
+ let deferred0_0;
2893
+ let deferred0_1;
2894
+ try {
2895
+ deferred0_0 = arg0;
2896
+ deferred0_1 = arg1;
2897
+ console.debug(getStringFromWasm0(arg0, arg1));
2898
+ } finally {
2899
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2900
+ }
2901
+ };
2902
+
2903
+ exports.__wbg_debug_a4fe41d1a79aaba9 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2904
+ let deferred0_0;
2905
+ let deferred0_1;
2906
+ try {
2907
+ deferred0_0 = arg0;
2908
+ deferred0_1 = arg1;
2909
+ console.debug(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
2910
+ } finally {
2911
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2912
+ }
2913
+ };
3199
2914
 
3200
2915
  exports.__wbg_doccontentrefs_new = function(arg0) {
3201
2916
  const ret = DocContentRefs.__wrap(arg0);
@@ -3207,11 +2922,6 @@ exports.__wbg_document_new = function(arg0) {
3207
2922
  return ret;
3208
2923
  };
3209
2924
 
3210
- exports.__wbg_document_unwrap = function(arg0) {
3211
- const ret = Document.__unwrap(arg0);
3212
- return ret;
3213
- };
3214
-
3215
2925
  exports.__wbg_encryptedcontentwithupdate_new = function(arg0) {
3216
2926
  const ret = EncryptedContentWithUpdate.__wrap(arg0);
3217
2927
  return ret;
@@ -3229,6 +2939,30 @@ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
3229
2939
  }
3230
2940
  };
3231
2941
 
2942
+ exports.__wbg_error_be2b0d69ec6dd379 = function(arg0, arg1) {
2943
+ let deferred0_0;
2944
+ let deferred0_1;
2945
+ try {
2946
+ deferred0_0 = arg0;
2947
+ deferred0_1 = arg1;
2948
+ console.error(getStringFromWasm0(arg0, arg1));
2949
+ } finally {
2950
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2951
+ }
2952
+ };
2953
+
2954
+ exports.__wbg_error_fa36d085107c9dd5 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
2955
+ let deferred0_0;
2956
+ let deferred0_1;
2957
+ try {
2958
+ deferred0_0 = arg0;
2959
+ deferred0_1 = arg1;
2960
+ console.error(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
2961
+ } finally {
2962
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2963
+ }
2964
+ };
2965
+
3232
2966
  exports.__wbg_event_new = function(arg0) {
3233
2967
  const ret = Event.__wrap(arg0);
3234
2968
  return ret;
@@ -3244,11 +2978,6 @@ exports.__wbg_generateKey_b8902ccb0e50ff4e = function() { return handleError(fun
3244
2978
  return ret;
3245
2979
  }, arguments) };
3246
2980
 
3247
- exports.__wbg_generatedocerror_new = function(arg0) {
3248
- const ret = GenerateDocError.__wrap(arg0);
3249
- return ret;
3250
- };
3251
-
3252
2981
  exports.__wbg_generatewebcryptoerror_new = function(arg0) {
3253
2982
  const ret = GenerateWebCryptoError.__wrap(arg0);
3254
2983
  return ret;
@@ -3258,6 +2987,11 @@ exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError
3258
2987
  arg0.getRandomValues(arg1);
3259
2988
  }, arguments) };
3260
2989
 
2990
+ exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
2991
+ const ret = arg0[arg1 >>> 0];
2992
+ return ret;
2993
+ };
2994
+
3261
2995
  exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
3262
2996
  const ret = Reflect.get(arg0, arg1);
3263
2997
  return ret;
@@ -3278,6 +3012,11 @@ exports.__wbg_group_new = function(arg0) {
3278
3012
  return ret;
3279
3013
  };
3280
3014
 
3015
+ exports.__wbg_individual_new = function(arg0) {
3016
+ const ret = Individual.__wrap(arg0);
3017
+ return ret;
3018
+ };
3019
+
3281
3020
  exports.__wbg_instanceof_Crypto_33ac2d91cca59233 = function(arg0) {
3282
3021
  let result;
3283
3022
  try {
@@ -3289,44 +3028,68 @@ exports.__wbg_instanceof_Crypto_33ac2d91cca59233 = function(arg0) {
3289
3028
  return ret;
3290
3029
  };
3291
3030
 
3292
- exports.__wbg_instanceof_Window_12d20d558ef92592 = function(arg0) {
3293
- let result;
3294
- try {
3295
- result = arg0 instanceof Window;
3296
- } catch (_) {
3297
- result = false;
3298
- }
3299
- const ret = result;
3031
+ exports.__wbg_keyhive_new = function(arg0) {
3032
+ const ret = Keyhive.__wrap(arg0);
3300
3033
  return ret;
3301
3034
  };
3302
3035
 
3303
- exports.__wbg_jsdecrypterror_new = function(arg0) {
3304
- const ret = JsDecryptError.__wrap(arg0);
3036
+ exports.__wbg_length_186546c51cd61acd = function(arg0) {
3037
+ const ret = arg0.length;
3305
3038
  return ret;
3306
3039
  };
3307
3040
 
3308
- exports.__wbg_jsencrypterror_new = function(arg0) {
3309
- const ret = JsEncryptError.__wrap(arg0);
3041
+ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
3042
+ const ret = arg0.length;
3310
3043
  return ret;
3311
3044
  };
3312
3045
 
3313
- exports.__wbg_jsreceiveprekeyoperror_new = function(arg0) {
3314
- const ret = JsReceivePreKeyOpError.__wrap(arg0);
3315
- return ret;
3046
+ exports.__wbg_log_98ea330cbdc64a56 = function(arg0, arg1) {
3047
+ let deferred0_0;
3048
+ let deferred0_1;
3049
+ try {
3050
+ deferred0_0 = arg0;
3051
+ deferred0_1 = arg1;
3052
+ console.log(getStringFromWasm0(arg0, arg1));
3053
+ } finally {
3054
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3055
+ }
3316
3056
  };
3317
3057
 
3318
- exports.__wbg_jsreceivestaticeventerror_new = function(arg0) {
3319
- const ret = JsReceiveStaticEventError.__wrap(arg0);
3320
- return ret;
3058
+ exports.__wbg_log_f996de40931ab7d1 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
3059
+ let deferred0_0;
3060
+ let deferred0_1;
3061
+ try {
3062
+ deferred0_0 = arg0;
3063
+ deferred0_1 = arg1;
3064
+ console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
3065
+ } finally {
3066
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3067
+ }
3321
3068
  };
3322
3069
 
3323
- exports.__wbg_keyhive_new = function(arg0) {
3324
- const ret = Keyhive.__wrap(arg0);
3325
- return ret;
3070
+ exports.__wbg_mark_49688daf5a319979 = function(arg0, arg1) {
3071
+ performance.mark(getStringFromWasm0(arg0, arg1));
3326
3072
  };
3327
3073
 
3328
- exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
3329
- const ret = arg0.length;
3074
+ exports.__wbg_measure_52555d98d3c0f41a = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3075
+ let deferred0_0;
3076
+ let deferred0_1;
3077
+ let deferred1_0;
3078
+ let deferred1_1;
3079
+ try {
3080
+ deferred0_0 = arg0;
3081
+ deferred0_1 = arg1;
3082
+ deferred1_0 = arg2;
3083
+ deferred1_1 = arg3;
3084
+ performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
3085
+ } finally {
3086
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3087
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3088
+ }
3089
+ }, arguments) };
3090
+
3091
+ exports.__wbg_membership_new = function(arg0) {
3092
+ const ret = Membership.__wrap(arg0);
3330
3093
  return ret;
3331
3094
  };
3332
3095
 
@@ -3335,6 +3098,11 @@ exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
3335
3098
  return ret;
3336
3099
  };
3337
3100
 
3101
+ exports.__wbg_new_1f3a344cf3123716 = function() {
3102
+ const ret = new Array();
3103
+ return ret;
3104
+ };
3105
+
3338
3106
  exports.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
3339
3107
  try {
3340
3108
  var state0 = {a: arg0, b: arg1};
@@ -3342,7 +3110,7 @@ exports.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
3342
3110
  const a = state0.a;
3343
3111
  state0.a = 0;
3344
3112
  try {
3345
- return __wbg_adapter_274(a, state0.b, arg0, arg1);
3113
+ return __wbg_adapter_315(a, state0.b, arg0, arg1);
3346
3114
  } finally {
3347
3115
  state0.a = a;
3348
3116
  }
@@ -3364,6 +3132,16 @@ exports.__wbg_new_8a6f238a6ece86ea = function() {
3364
3132
  return ret;
3365
3133
  };
3366
3134
 
3135
+ exports.__wbg_new_da9dc54c5db29dfa = function(arg0, arg1) {
3136
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3137
+ return ret;
3138
+ };
3139
+
3140
+ exports.__wbg_newfromslice_074c56947bd43469 = function(arg0, arg1) {
3141
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
3142
+ return ret;
3143
+ };
3144
+
3367
3145
  exports.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
3368
3146
  const ret = new Function(getStringFromWasm0(arg0, arg1));
3369
3147
  return ret;
@@ -3379,11 +3157,6 @@ exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
3379
3157
  return ret;
3380
3158
  };
3381
3159
 
3382
- exports.__wbg_peer_unwrap = function(arg0) {
3383
- const ret = Peer.__unwrap(arg0);
3384
- return ret;
3385
- };
3386
-
3387
3160
  exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
3388
3161
  const ret = arg0.process;
3389
3162
  return ret;
@@ -3393,6 +3166,11 @@ exports.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
3393
3166
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
3394
3167
  };
3395
3168
 
3169
+ exports.__wbg_push_330b2eb93e4e1212 = function(arg0, arg1) {
3170
+ const ret = arg0.push(arg1);
3171
+ return ret;
3172
+ };
3173
+
3396
3174
  exports.__wbg_queueMicrotask_25d0739ac89e8c88 = function(arg0) {
3397
3175
  queueMicrotask(arg0);
3398
3176
  };
@@ -3416,14 +3194,8 @@ exports.__wbg_resolve_4055c623acdd6a1b = function(arg0) {
3416
3194
  return ret;
3417
3195
  };
3418
3196
 
3419
- exports.__wbg_revokemembererror_new = function(arg0) {
3420
- const ret = RevokeMemberError.__wrap(arg0);
3421
- return ret;
3422
- };
3423
-
3424
- exports.__wbg_serializationerror_new = function(arg0) {
3425
- const ret = SerializationError.__wrap(arg0);
3426
- return ret;
3197
+ exports.__wbg_setname_832b43d4602cb930 = function(arg0, arg1, arg2) {
3198
+ arg0.name = getStringFromWasm0(arg1, arg2);
3427
3199
  };
3428
3200
 
3429
3201
  exports.__wbg_sharekey_new = function(arg0) {
@@ -3456,16 +3228,6 @@ exports.__wbg_signer_new = function(arg0) {
3456
3228
  return ret;
3457
3229
  };
3458
3230
 
3459
- exports.__wbg_signingerror_new = function(arg0) {
3460
- const ret = SigningError.__wrap(arg0);
3461
- return ret;
3462
- };
3463
-
3464
- exports.__wbg_simplecapability_new = function(arg0) {
3465
- const ret = SimpleCapability.__wrap(arg0);
3466
- return ret;
3467
- };
3468
-
3469
3231
  exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
3470
3232
  const ret = arg1.stack;
3471
3233
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -3494,6 +3256,11 @@ exports.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
3494
3256
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
3495
3257
  };
3496
3258
 
3259
+ exports.__wbg_stats_new = function(arg0) {
3260
+ const ret = Stats.__wrap(arg0);
3261
+ return ret;
3262
+ };
3263
+
3497
3264
  exports.__wbg_subarray_70fd07feefe14294 = function(arg0, arg1, arg2) {
3498
3265
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
3499
3266
  return ret;
@@ -3519,16 +3286,56 @@ exports.__wbg_then_e22500defe16819f = function(arg0, arg1) {
3519
3286
  return ret;
3520
3287
  };
3521
3288
 
3522
- exports.__wbg_tryfromarchiveerror_new = function(arg0) {
3523
- const ret = TryFromArchiveError.__wrap(arg0);
3524
- return ret;
3525
- };
3526
-
3527
3289
  exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
3528
3290
  const ret = arg0.versions;
3529
3291
  return ret;
3530
3292
  };
3531
3293
 
3294
+ exports.__wbg_warn_c6311e9cb983aa2a = function(arg0, arg1) {
3295
+ let deferred0_0;
3296
+ let deferred0_1;
3297
+ try {
3298
+ deferred0_0 = arg0;
3299
+ deferred0_1 = arg1;
3300
+ console.warn(getStringFromWasm0(arg0, arg1));
3301
+ } finally {
3302
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3303
+ }
3304
+ };
3305
+
3306
+ exports.__wbg_warn_de3a09d072c895e6 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
3307
+ let deferred0_0;
3308
+ let deferred0_1;
3309
+ try {
3310
+ deferred0_0 = arg0;
3311
+ deferred0_1 = arg1;
3312
+ console.warn(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
3313
+ } finally {
3314
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3315
+ }
3316
+ };
3317
+
3318
+ exports.__wbg_wasmrefgentoChangeId_31238620806c0c3d = function(arg0) {
3319
+ const ret = arg0.__wasm_refgen_toChangeId();
3320
+ _assertClass(ret, ChangeId);
3321
+ var ptr1 = ret.__destroy_into_raw();
3322
+ return ptr1;
3323
+ };
3324
+
3325
+ exports.__wbg_wasmrefgentoDocument_d755d52439ab43bc = function(arg0) {
3326
+ const ret = arg0.__wasm_refgen_toDocument();
3327
+ _assertClass(ret, Document);
3328
+ var ptr1 = ret.__destroy_into_raw();
3329
+ return ptr1;
3330
+ };
3331
+
3332
+ exports.__wbg_wasmrefgentoPeer_e7758239790d7eb6 = function(arg0) {
3333
+ const ret = arg0.__wasm_refgen_toPeer();
3334
+ _assertClass(ret, Peer);
3335
+ var ptr1 = ret.__destroy_into_raw();
3336
+ return ptr1;
3337
+ };
3338
+
3532
3339
  exports.__wbg_wbindgencbdrop_eb10308566512b88 = function(arg0) {
3533
3340
  const obj = arg0.original;
3534
3341
  if (obj.cnt-- == 1) {
@@ -3572,12 +3379,6 @@ exports.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
3572
3379
  throw new Error(getStringFromWasm0(arg0, arg1));
3573
3380
  };
3574
3381
 
3575
- exports.__wbindgen_cast_133053e9d0cd85aa = function(arg0, arg1) {
3576
- // Cast intrinsic for `Closure(Closure { dtor_idx: 422, function: Function { arguments: [Externref], shim_idx: 423, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3577
- const ret = makeMutClosure(arg0, arg1, 422, __wbg_adapter_10);
3578
- return ret;
3579
- };
3580
-
3581
3382
  exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
3582
3383
  // Cast intrinsic for `Ref(String) -> Externref`.
3583
3384
  const ret = getStringFromWasm0(arg0, arg1);
@@ -3592,6 +3393,46 @@ exports.__wbindgen_cast_25a0a844437d0e92 = function(arg0, arg1) {
3592
3393
  return ret;
3593
3394
  };
3594
3395
 
3396
+ exports.__wbindgen_cast_6300122139088863 = function(arg0, arg1) {
3397
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3398
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3399
+ // Cast intrinsic for `Vector(NamedExternref("ChangeId")) -> Externref`.
3400
+ const ret = v0;
3401
+ return ret;
3402
+ };
3403
+
3404
+ exports.__wbindgen_cast_6d311b4990fb968e = function(arg0, arg1) {
3405
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3406
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3407
+ // Cast intrinsic for `Vector(NamedExternref("Summary")) -> Externref`.
3408
+ const ret = v0;
3409
+ return ret;
3410
+ };
3411
+
3412
+ exports.__wbindgen_cast_6e33e4871eebdb43 = function(arg0, arg1) {
3413
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3414
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3415
+ // Cast intrinsic for `Vector(NamedExternref("Membership")) -> Externref`.
3416
+ const ret = v0;
3417
+ return ret;
3418
+ };
3419
+
3420
+ exports.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
3421
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
3422
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
3423
+ // Cast intrinsic for `Vector(U8) -> Externref`.
3424
+ const ret = v0;
3425
+ return ret;
3426
+ };
3427
+
3428
+ exports.__wbindgen_cast_a81e76255c07f2e8 = function(arg0, arg1) {
3429
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3430
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3431
+ // Cast intrinsic for `Vector(NamedExternref("Capability")) -> Externref`.
3432
+ const ret = v0;
3433
+ return ret;
3434
+ };
3435
+
3595
3436
  exports.__wbindgen_cast_ae91babfc5c19b28 = function(arg0, arg1) {
3596
3437
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3597
3438
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
@@ -3606,6 +3447,12 @@ exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
3606
3447
  return ret;
3607
3448
  };
3608
3449
 
3450
+ exports.__wbindgen_cast_eec2736b920f1ce2 = function(arg0, arg1) {
3451
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 424, function: Function { arguments: [Externref], shim_idx: 425, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3452
+ const ret = makeMutClosure(arg0, arg1, 424, __wbg_adapter_10);
3453
+ return ret;
3454
+ };
3455
+
3609
3456
  exports.__wbindgen_init_externref_table = function() {
3610
3457
  const table = wasm.__wbindgen_export_2;
3611
3458
  const offset = table.grow(4);