@wireapp/core-crypto 0.6.0-pre.3 → 0.6.0-pre.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "0.6.0-pre.3",
3
+ "version": "0.6.0-pre.4",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -722,6 +722,12 @@ export declare class CoreCrypto {
722
722
  * @param sessionId - ID of the Proteus session
723
723
  */
724
724
  proteusSessionDelete(sessionId: string): Promise<void>;
725
+ /**
726
+ * Checks if a session exists
727
+ *
728
+ * @param sessionId - ID of the Proteus session
729
+ */
730
+ proteusSessionExists(sessionId: string): Promise<void>;
725
731
  /**
726
732
  * Decrypt an incoming message for an existing Proteus session
727
733
  *
@@ -252,7 +252,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
252
252
  function __wbg_adapter_52(arg0, arg1, arg2) {
253
253
  try {
254
254
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
255
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4b8933be611c74ec(retptr, arg0, arg1, addHeapObject(arg2));
255
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h700a51df4dcb59a1(retptr, arg0, arg1, addHeapObject(arg2));
256
256
  var r0 = getInt32Memory0()[retptr / 4 + 0];
257
257
  var r1 = getInt32Memory0()[retptr / 4 + 1];
258
258
  if (r1) {
@@ -264,7 +264,7 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
264
264
  }
265
265
 
266
266
  function __wbg_adapter_55(arg0, arg1, arg2) {
267
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf134d073b748780a(arg0, arg1, addHeapObject(arg2));
267
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he9e5ec6c41a75df4(arg0, arg1, addHeapObject(arg2));
268
268
  }
269
269
 
270
270
  /**
@@ -328,18 +328,10 @@ function handleError(f, args) {
328
328
  function getArrayU8FromWasm0(ptr, len) {
329
329
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
330
330
  }
331
- function __wbg_adapter_212(arg0, arg1, arg2, arg3) {
332
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h36fd127c91f164e3(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
331
+ function __wbg_adapter_213(arg0, arg1, arg2, arg3) {
332
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h880776ea65aca59d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
333
333
  }
334
334
 
335
- /**
336
- * see [core_crypto::prelude::mls::conversation::public_group_state::MlsRatchetTreeType]
337
- */
338
- const RatchetTreeType$1 = Object.freeze({ Full:1,"1":"Full",Delta:2,"2":"Delta",ByRef:3,"3":"ByRef", });
339
- /**
340
- * see [core_crypto::prelude::mls::conversation::public_group_state::MlsPublicGroupStateEncryptionType]
341
- */
342
- const PublicGroupStateEncryptionType$1 = Object.freeze({ Plaintext:1,"1":"Plaintext",JweEncrypted:2,"2":"JweEncrypted", });
343
335
  /**
344
336
  * see [core_crypto::prelude::CiphersuiteName]
345
337
  */
@@ -466,7 +458,7 @@ class ConversationInitBundle {
466
458
  * @returns {Uint8Array}
467
459
  */
468
460
  get conversation_id() {
469
- const ret = wasm$1.conversationinitbundle_conversation_id(this.ptr);
461
+ const ret = wasm$1.commitbundle_commit(this.ptr);
470
462
  return takeObject(ret);
471
463
  }
472
464
  /**
@@ -480,7 +472,7 @@ class ConversationInitBundle {
480
472
  * @returns {PublicGroupStateBundle}
481
473
  */
482
474
  get public_group_state() {
483
- const ret = wasm$1.conversationinitbundle_public_group_state(this.ptr);
475
+ const ret = wasm$1.commitbundle_public_group_state(this.ptr);
484
476
  return PublicGroupStateBundle.__wrap(ret);
485
477
  }
486
478
  }
@@ -1011,6 +1003,19 @@ class CoreCrypto$1 {
1011
1003
  return takeObject(ret);
1012
1004
  }
1013
1005
  /**
1006
+ * Returns: [`WasmCryptoResult<bool>`]
1007
+ *
1008
+ * see [core_crypto::proteus::ProteusCentral::session_exists]
1009
+ * @param {string} session_id
1010
+ * @returns {Promise<any>}
1011
+ */
1012
+ proteus_session_exists(session_id) {
1013
+ const ptr0 = passStringToWasm0(session_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1014
+ const len0 = WASM_VECTOR_LEN;
1015
+ const ret = wasm$1.corecrypto_proteus_session_exists(this.ptr, ptr0, len0);
1016
+ return takeObject(ret);
1017
+ }
1018
+ /**
1014
1019
  * Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
1015
1020
  *
1016
1021
  * see [core_crypto::proteus::ProteusCentral::decrypt]
@@ -1170,7 +1175,7 @@ class DecryptedMessage {
1170
1175
  wasm$1.__wbg_decryptedmessage_free(ptr);
1171
1176
  }
1172
1177
  /**
1173
- * @returns {Uint8Array | undefined}
1178
+ * @returns {any}
1174
1179
  */
1175
1180
  get message() {
1176
1181
  const ret = wasm$1.decryptedmessage_message(this.ptr);
@@ -1205,7 +1210,7 @@ class DecryptedMessage {
1205
1210
  }
1206
1211
  }
1207
1212
  /**
1208
- * @returns {Uint8Array | undefined}
1213
+ * @returns {any}
1209
1214
  */
1210
1215
  get sender_client_id() {
1211
1216
  const ret = wasm$1.decryptedmessage_sender_client_id(this.ptr);
@@ -1254,14 +1259,14 @@ class Invitee {
1254
1259
  * @returns {Uint8Array}
1255
1260
  */
1256
1261
  get id() {
1257
- const ret = wasm$1.invitee_id(this.ptr);
1262
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1258
1263
  return takeObject(ret);
1259
1264
  }
1260
1265
  /**
1261
1266
  * @returns {Uint8Array}
1262
1267
  */
1263
1268
  get kp() {
1264
- const ret = wasm$1.invitee_kp(this.ptr);
1269
+ const ret = wasm$1.conversationinitbundle_commit(this.ptr);
1265
1270
  return takeObject(ret);
1266
1271
  }
1267
1272
  }
@@ -1304,21 +1309,21 @@ class MemberAddedMessages {
1304
1309
  * @returns {Uint8Array}
1305
1310
  */
1306
1311
  get welcome() {
1307
- const ret = wasm$1.memberaddedmessages_welcome(this.ptr);
1312
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1308
1313
  return takeObject(ret);
1309
1314
  }
1310
1315
  /**
1311
1316
  * @returns {Uint8Array}
1312
1317
  */
1313
1318
  get commit() {
1314
- const ret = wasm$1.memberaddedmessages_commit(this.ptr);
1319
+ const ret = wasm$1.conversationinitbundle_commit(this.ptr);
1315
1320
  return takeObject(ret);
1316
1321
  }
1317
1322
  /**
1318
1323
  * @returns {PublicGroupStateBundle}
1319
1324
  */
1320
1325
  get public_group_state() {
1321
- const ret = wasm$1.memberaddedmessages_public_group_state(this.ptr);
1326
+ const ret = wasm$1.commitbundle_public_group_state(this.ptr);
1322
1327
  return PublicGroupStateBundle.__wrap(ret);
1323
1328
  }
1324
1329
  }
@@ -1348,14 +1353,14 @@ class ProposalBundle {
1348
1353
  * @returns {Uint8Array}
1349
1354
  */
1350
1355
  get proposal() {
1351
- const ret = wasm$1.proposalbundle_proposal(this.ptr);
1356
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1352
1357
  return takeObject(ret);
1353
1358
  }
1354
1359
  /**
1355
1360
  * @returns {Uint8Array}
1356
1361
  */
1357
1362
  get proposal_ref() {
1358
- const ret = wasm$1.proposalbundle_proposal_ref(this.ptr);
1363
+ const ret = wasm$1.conversationinitbundle_commit(this.ptr);
1359
1364
  return takeObject(ret);
1360
1365
  }
1361
1366
  }
@@ -1386,20 +1391,20 @@ class PublicGroupStateBundle {
1386
1391
  */
1387
1392
  get encryption_type() {
1388
1393
  const ret = wasm$1.publicgroupstatebundle_encryption_type(this.ptr);
1389
- return ret >>> 0;
1394
+ return ret;
1390
1395
  }
1391
1396
  /**
1392
1397
  * @returns {number}
1393
1398
  */
1394
1399
  get ratchet_tree_type() {
1395
1400
  const ret = wasm$1.publicgroupstatebundle_ratchet_tree_type(this.ptr);
1396
- return ret >>> 0;
1401
+ return ret;
1397
1402
  }
1398
1403
  /**
1399
1404
  * @returns {Uint8Array}
1400
1405
  */
1401
1406
  get payload() {
1402
- const ret = wasm$1.publicgroupstatebundle_payload(this.ptr);
1407
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1403
1408
  return takeObject(ret);
1404
1409
  }
1405
1410
  }
@@ -1442,14 +1447,14 @@ function getImports() {
1442
1447
  const ret = getObject(arg0);
1443
1448
  return addHeapObject(ret);
1444
1449
  };
1445
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1446
- takeObject(arg0);
1447
- };
1448
1450
  imports.wbg.__wbindgen_is_object = function(arg0) {
1449
1451
  const val = getObject(arg0);
1450
1452
  const ret = typeof(val) === 'object' && val !== null;
1451
1453
  return ret;
1452
1454
  };
1455
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1456
+ takeObject(arg0);
1457
+ };
1453
1458
  imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
1454
1459
  const ret = getObject(arg0)[getObject(arg1)];
1455
1460
  return addHeapObject(ret);
@@ -1496,14 +1501,14 @@ function getImports() {
1496
1501
  imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
1497
1502
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1498
1503
  };
1499
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1500
- const ret = arg0;
1501
- return addHeapObject(ret);
1502
- };
1503
1504
  imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1504
1505
  const ret = BigInt.asUintN(64, arg0);
1505
1506
  return addHeapObject(ret);
1506
1507
  };
1508
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1509
+ const ret = arg0;
1510
+ return addHeapObject(ret);
1511
+ };
1507
1512
  imports.wbg.__wbg_objectStoreNames_8c06c40d2b05141c = function(arg0) {
1508
1513
  const ret = getObject(arg0).objectStoreNames;
1509
1514
  return addHeapObject(ret);
@@ -1585,6 +1590,10 @@ function getImports() {
1585
1590
  const ret = new Uint8Array(getObject(arg0));
1586
1591
  return addHeapObject(ret);
1587
1592
  };
1593
+ imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
1594
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1595
+ return addHeapObject(ret);
1596
+ }, arguments) };
1588
1597
  imports.wbg.__wbg_corecrypto_new = function(arg0) {
1589
1598
  const ret = CoreCrypto$1.__wrap(arg0);
1590
1599
  return addHeapObject(ret);
@@ -1593,6 +1602,10 @@ function getImports() {
1593
1602
  const ret = getObject(arg0).push(getObject(arg1));
1594
1603
  return ret;
1595
1604
  };
1605
+ imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1606
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1607
+ return addHeapObject(ret);
1608
+ }, arguments) };
1596
1609
  imports.wbg.__wbg_call_e1f72c051cdab859 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1597
1610
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
1598
1611
  return addHeapObject(ret);
@@ -1604,7 +1617,7 @@ function getImports() {
1604
1617
  const a = state0.a;
1605
1618
  state0.a = 0;
1606
1619
  try {
1607
- return __wbg_adapter_212(a, state0.b, arg0, arg1);
1620
+ return __wbg_adapter_213(a, state0.b, arg0, arg1);
1608
1621
  } finally {
1609
1622
  state0.a = a;
1610
1623
  }
@@ -1674,9 +1687,10 @@ function getImports() {
1674
1687
  const ret = false;
1675
1688
  return ret;
1676
1689
  };
1677
- imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
1678
- getObject(arg0).onsuccess = getObject(arg1);
1679
- };
1690
+ imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
1691
+ const ret = getObject(arg0).get(getObject(arg1));
1692
+ return addHeapObject(ret);
1693
+ }, arguments) };
1680
1694
  imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
1681
1695
  const ret = getObject(arg0).openCursor(getObject(arg1));
1682
1696
  return addHeapObject(ret);
@@ -1685,10 +1699,20 @@ function getImports() {
1685
1699
  const ret = getObject(arg0).openCursor();
1686
1700
  return addHeapObject(ret);
1687
1701
  }, arguments) };
1688
- imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
1689
- const ret = getObject(arg0).get(getObject(arg1));
1702
+ imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
1703
+ getObject(arg0).onsuccess = getObject(arg1);
1704
+ };
1705
+ imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
1706
+ const ret = getObject(arg0).delete(getObject(arg1));
1707
+ return addHeapObject(ret);
1708
+ }, arguments) };
1709
+ imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
1710
+ const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1690
1711
  return addHeapObject(ret);
1691
1712
  }, arguments) };
1713
+ imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
1714
+ getObject(arg0).close();
1715
+ };
1692
1716
  imports.wbg.__wbg_setonerror_d5771cc5bf9ea74c = function(arg0, arg1) {
1693
1717
  getObject(arg0).onerror = getObject(arg1);
1694
1718
  };
@@ -1700,23 +1724,19 @@ function getImports() {
1700
1724
  const ret = getObject(arg0).put(getObject(arg1));
1701
1725
  return addHeapObject(ret);
1702
1726
  }, arguments) };
1703
- imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
1704
- const ret = getObject(arg0).count();
1705
- return addHeapObject(ret);
1706
- }, arguments) };
1707
- imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
1708
- const ret = getObject(arg0).count(getObject(arg1));
1727
+ imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
1728
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
1709
1729
  return addHeapObject(ret);
1710
1730
  }, arguments) };
1711
- imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
1712
- const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1731
+ imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1732
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
1713
1733
  return addHeapObject(ret);
1714
1734
  }, arguments) };
1715
- imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
1716
- getObject(arg0).close();
1735
+ imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
1736
+ getObject(arg0).onupgradeneeded = getObject(arg1);
1717
1737
  };
1718
- imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
1719
- const ret = getObject(arg0).delete(getObject(arg1));
1738
+ imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
1739
+ const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
1720
1740
  return addHeapObject(ret);
1721
1741
  }, arguments) };
1722
1742
  imports.wbg.__wbg_get_765201544a2b6869 = function() { return handleError(function (arg0, arg1) {
@@ -1735,17 +1755,14 @@ function getImports() {
1735
1755
  const ret = getObject(arg0).openCursor(getObject(arg1));
1736
1756
  return addHeapObject(ret);
1737
1757
  }, arguments) };
1738
- imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
1739
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
1758
+ imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
1759
+ const ret = getObject(arg0).count();
1740
1760
  return addHeapObject(ret);
1741
1761
  }, arguments) };
1742
- imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1743
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
1762
+ imports.wbg.__wbg_count_46eda68a16dbe30e = function() { return handleError(function (arg0, arg1) {
1763
+ const ret = getObject(arg0).count(getObject(arg1));
1744
1764
  return addHeapObject(ret);
1745
1765
  }, arguments) };
1746
- imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
1747
- getObject(arg0).onupgradeneeded = getObject(arg1);
1748
- };
1749
1766
  imports.wbg.__wbg_randomFillSync_6894564c2c334c42 = function() { return handleError(function (arg0, arg1, arg2) {
1750
1767
  getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
1751
1768
  }, arguments) };
@@ -1784,10 +1801,6 @@ function getImports() {
1784
1801
  const ret = typeof(getObject(arg0)) === 'function';
1785
1802
  return ret;
1786
1803
  };
1787
- imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
1788
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1789
- return addHeapObject(ret);
1790
- }, arguments) };
1791
1804
  imports.wbg.__wbg_msCrypto_6e7d3e1f92610cbb = function(arg0) {
1792
1805
  const ret = getObject(arg0).msCrypto;
1793
1806
  return addHeapObject(ret);
@@ -1836,10 +1849,6 @@ function getImports() {
1836
1849
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1837
1850
  return addHeapObject(ret);
1838
1851
  };
1839
- imports.wbg.__wbg_call_3999bee59e9f7719 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1840
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1841
- return addHeapObject(ret);
1842
- }, arguments) };
1843
1852
  imports.wbg.__wbg_set_bf3f89b92d5a34bf = function() { return handleError(function (arg0, arg1, arg2) {
1844
1853
  const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1845
1854
  return ret;
@@ -1867,6 +1876,10 @@ function getImports() {
1867
1876
  const ret = getObject(arg0).target;
1868
1877
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
1869
1878
  };
1879
+ imports.wbg.__wbg_result_9e399c14676970d9 = function() { return handleError(function (arg0) {
1880
+ const ret = getObject(arg0).result;
1881
+ return addHeapObject(ret);
1882
+ }, arguments) };
1870
1883
  imports.wbg.__wbg_error_aacf5ac191e54ed0 = function() { return handleError(function (arg0) {
1871
1884
  const ret = getObject(arg0).error;
1872
1885
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
@@ -1918,10 +1931,6 @@ function getImports() {
1918
1931
  const ret = result;
1919
1932
  return ret;
1920
1933
  };
1921
- imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
1922
- const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
1923
- return addHeapObject(ret);
1924
- }, arguments) };
1925
1934
  imports.wbg.__wbg_toString_73c9b562dccf34bd = function(arg0) {
1926
1935
  const ret = getObject(arg0).toString();
1927
1936
  return addHeapObject(ret);
@@ -1997,20 +2006,16 @@ function getImports() {
1997
2006
  const ret = getObject(arg0).openCursor(getObject(arg1), takeObject(arg2));
1998
2007
  return addHeapObject(ret);
1999
2008
  }, arguments) };
2000
- imports.wbg.__wbg_result_9e399c14676970d9 = function() { return handleError(function (arg0) {
2001
- const ret = getObject(arg0).result;
2002
- return addHeapObject(ret);
2003
- }, arguments) };
2004
2009
  imports.wbg.__wbg_objectStore_f17976b0e6377830 = function() { return handleError(function (arg0, arg1, arg2) {
2005
2010
  const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
2006
2011
  return addHeapObject(ret);
2007
2012
  }, arguments) };
2008
- imports.wbg.__wbindgen_closure_wrapper2859 = function(arg0, arg1, arg2) {
2009
- const ret = makeMutClosure(arg0, arg1, 130, __wbg_adapter_52);
2013
+ imports.wbg.__wbindgen_closure_wrapper2302 = function(arg0, arg1, arg2) {
2014
+ const ret = makeMutClosure(arg0, arg1, 123, __wbg_adapter_52);
2010
2015
  return addHeapObject(ret);
2011
2016
  };
2012
- imports.wbg.__wbindgen_closure_wrapper4965 = function(arg0, arg1, arg2) {
2013
- const ret = makeMutClosure(arg0, arg1, 137, __wbg_adapter_55);
2017
+ imports.wbg.__wbindgen_closure_wrapper3740 = function(arg0, arg1, arg2) {
2018
+ const ret = makeMutClosure(arg0, arg1, 123, __wbg_adapter_55);
2014
2019
  return addHeapObject(ret);
2015
2020
  };
2016
2021
 
@@ -2060,8 +2065,6 @@ async function init(input) {
2060
2065
  var exports = /*#__PURE__*/Object.freeze({
2061
2066
  __proto__: null,
2062
2067
  version: version,
2063
- RatchetTreeType: RatchetTreeType$1,
2064
- PublicGroupStateEncryptionType: PublicGroupStateEncryptionType$1,
2065
2068
  Ciphersuite: Ciphersuite$1,
2066
2069
  CommitBundle: CommitBundle,
2067
2070
  ConversationConfiguration: ConversationConfiguration,
@@ -2080,7 +2083,7 @@ var exports = /*#__PURE__*/Object.freeze({
2080
2083
  var wasm = async (opt = {}) => {
2081
2084
  let {importHook, serverPath} = opt;
2082
2085
 
2083
- let path = "assets/core_crypto_ffi-922b14ab.wasm";
2086
+ let path = "assets/core_crypto_ffi-c0caf497.wasm";
2084
2087
 
2085
2088
  if (serverPath != null) {
2086
2089
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -2412,13 +2415,14 @@ class CoreCrypto {
2412
2415
  const ffiClients = clients.map((invitee) => new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).Invitee)(invitee.id, invitee.kp));
2413
2416
  const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").add_clients_to_conversation(conversationId, ffiClients);
2414
2417
  ffiClients.forEach(c => c.free());
2418
+ const pgs = ffiRet.public_group_state;
2415
2419
  const ret = {
2416
2420
  welcome: ffiRet.welcome,
2417
2421
  commit: ffiRet.commit,
2418
2422
  publicGroupState: {
2419
- encryptionType: ffiRet.public_group_state.encryption_type,
2420
- ratchetTreeType: ffiRet.public_group_state.ratchet_tree_type,
2421
- payload: ffiRet.public_group_state.payload
2423
+ encryptionType: pgs.encryption_type,
2424
+ ratchetTreeType: pgs.ratchet_tree_type,
2425
+ payload: pgs.payload
2422
2426
  },
2423
2427
  };
2424
2428
  return ret;
@@ -2438,13 +2442,14 @@ class CoreCrypto {
2438
2442
  */
2439
2443
  async removeClientsFromConversation(conversationId, clientIds) {
2440
2444
  const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").remove_clients_from_conversation(conversationId, clientIds);
2445
+ const pgs = ffiRet.public_group_state;
2441
2446
  const ret = {
2442
2447
  welcome: ffiRet.welcome,
2443
2448
  commit: ffiRet.commit,
2444
2449
  publicGroupState: {
2445
- encryptionType: ffiRet.public_group_state.encryption_type,
2446
- ratchetTreeType: ffiRet.public_group_state.ratchet_tree_type,
2447
- payload: ffiRet.public_group_state.payload
2450
+ encryptionType: pgs.encryption_type,
2451
+ ratchetTreeType: pgs.ratchet_tree_type,
2452
+ payload: pgs.payload
2448
2453
  },
2449
2454
  };
2450
2455
  return ret;
@@ -2462,13 +2467,14 @@ class CoreCrypto {
2462
2467
  */
2463
2468
  async updateKeyingMaterial(conversationId) {
2464
2469
  const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").update_keying_material(conversationId);
2470
+ const pgs = ffiRet.public_group_state;
2465
2471
  const ret = {
2466
2472
  welcome: ffiRet.welcome,
2467
2473
  commit: ffiRet.commit,
2468
2474
  publicGroupState: {
2469
- encryptionType: ffiRet.public_group_state.encryption_type,
2470
- ratchetTreeType: ffiRet.public_group_state.ratchet_tree_type,
2471
- payload: ffiRet.public_group_state.payload
2475
+ encryptionType: pgs.encryption_type,
2476
+ ratchetTreeType: pgs.ratchet_tree_type,
2477
+ payload: pgs.payload
2472
2478
  },
2473
2479
  };
2474
2480
  return ret;
@@ -2486,15 +2492,19 @@ class CoreCrypto {
2486
2492
  */
2487
2493
  async commitPendingProposals(conversationId) {
2488
2494
  const ffiCommitBundle = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_pending_proposals(conversationId);
2489
- return ffiCommitBundle ? {
2495
+ if (!ffiCommitBundle) {
2496
+ return undefined;
2497
+ }
2498
+ const pgs = ffiCommitBundle.public_group_state;
2499
+ return {
2490
2500
  welcome: ffiCommitBundle.welcome,
2491
2501
  commit: ffiCommitBundle.commit,
2492
2502
  publicGroupState: {
2493
- encryptionType: ffiCommitBundle.public_group_state.encryption_type,
2494
- ratchetTreeType: ffiCommitBundle.public_group_state.ratchet_tree_type,
2495
- payload: ffiCommitBundle.public_group_state.payload
2503
+ encryptionType: pgs.encryption_type,
2504
+ ratchetTreeType: pgs.ratchet_tree_type,
2505
+ payload: pgs.payload
2496
2506
  },
2497
- } : undefined;
2507
+ };
2498
2508
  }
2499
2509
  /**
2500
2510
  * Creates a new proposal for the provided Conversation ID
@@ -2564,13 +2574,14 @@ class CoreCrypto {
2564
2574
  */
2565
2575
  async joinByExternalCommit(publicGroupState) {
2566
2576
  const ffiInitMessage = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").join_by_external_commit(publicGroupState);
2577
+ const pgs = ffiInitMessage.public_group_state;
2567
2578
  const ret = {
2568
2579
  conversationId: ffiInitMessage.conversation_id,
2569
2580
  commit: ffiInitMessage.commit,
2570
2581
  publicGroupState: {
2571
- encryptionType: ffiInitMessage.public_group_state.encryption_type,
2572
- ratchetTreeType: ffiInitMessage.public_group_state.ratchet_tree_type,
2573
- payload: ffiInitMessage.public_group_state.payload
2582
+ encryptionType: pgs.encryption_type,
2583
+ ratchetTreeType: pgs.ratchet_tree_type,
2584
+ payload: pgs.payload
2574
2585
  },
2575
2586
  };
2576
2587
  return ret;
@@ -2718,6 +2729,14 @@ class CoreCrypto {
2718
2729
  async proteusSessionDelete(sessionId) {
2719
2730
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_delete(sessionId);
2720
2731
  }
2732
+ /**
2733
+ * Checks if a session exists
2734
+ *
2735
+ * @param sessionId - ID of the Proteus session
2736
+ */
2737
+ async proteusSessionExists(sessionId) {
2738
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_session_exists(sessionId);
2739
+ }
2721
2740
  /**
2722
2741
  * Decrypt an incoming message for an existing Proteus session
2723
2742
  *