@wireapp/core-crypto 1.0.0-pre.8 → 1.0.0-rc.10

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.
@@ -234,12 +234,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
234
234
  return real;
235
235
  }
236
236
  function __wbg_adapter_52(arg0, arg1, arg2) {
237
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h3add802d7f539fd6(arg0, arg1, addHeapObject(arg2));
237
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__hdb6540dbb26cf63b(arg0, arg1, addHeapObject(arg2));
238
238
  }
239
239
  function __wbg_adapter_55(arg0, arg1, arg2) {
240
240
  try {
241
241
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
242
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__hcf65d5abe1723dcf(retptr, arg0, arg1, addHeapObject(arg2));
242
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h3c15a82f614455aa(retptr, arg0, arg1, addHeapObject(arg2));
243
243
  var r0 = getInt32Memory0()[retptr / 4 + 0];
244
244
  var r1 = getInt32Memory0()[retptr / 4 + 1];
245
245
  if (r1) {
@@ -313,8 +313,8 @@ function handleError(f, args) {
313
313
  wasm$1.__wbindgen_exn_store(addHeapObject(e));
314
314
  }
315
315
  }
316
- function __wbg_adapter_296(arg0, arg1, arg2, arg3) {
317
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h7d17d9f660171c31(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
316
+ function __wbg_adapter_312(arg0, arg1, arg2, arg3) {
317
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h5286c52f12e3fed2(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
318
318
  }
319
319
  /**
320
320
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -343,7 +343,6 @@ const CredentialType$1 = Object.freeze({
343
343
  X509: 2, "2": "X509",
344
344
  });
345
345
  /**
346
- * see [core_crypto::prelude::CiphersuiteName]
347
346
  */
348
347
  const Ciphersuite$1 = Object.freeze({
349
348
  /**
@@ -482,15 +481,18 @@ class AcmeDirectory {
482
481
  * @param {string} new_nonce
483
482
  * @param {string} new_account
484
483
  * @param {string} new_order
484
+ * @param {string} revoke_cert
485
485
  */
486
- constructor(new_nonce, new_account, new_order) {
486
+ constructor(new_nonce, new_account, new_order, revoke_cert) {
487
487
  const ptr0 = passStringToWasm0(new_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
488
488
  const len0 = WASM_VECTOR_LEN;
489
489
  const ptr1 = passStringToWasm0(new_account, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
490
490
  const len1 = WASM_VECTOR_LEN;
491
491
  const ptr2 = passStringToWasm0(new_order, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
492
492
  const len2 = WASM_VECTOR_LEN;
493
- const ret = wasm$1.acmedirectory_new(ptr0, len0, ptr1, len1, ptr2, len2);
493
+ const ptr3 = passStringToWasm0(revoke_cert, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
494
+ const len3 = WASM_VECTOR_LEN;
495
+ const ret = wasm$1.acmedirectory_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
494
496
  return AcmeDirectory.__wrap(ret);
495
497
  }
496
498
  /**
@@ -553,6 +555,103 @@ class AcmeDirectory {
553
555
  wasm$1.__wbindgen_free(deferred1_0, deferred1_1, 1);
554
556
  }
555
557
  }
558
+ /**
559
+ * @returns {string}
560
+ */
561
+ get revokeCert() {
562
+ let deferred1_0;
563
+ let deferred1_1;
564
+ try {
565
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
566
+ wasm$1.acmedirectory_revokeCert(retptr, this.__wbg_ptr);
567
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
568
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
569
+ deferred1_0 = r0;
570
+ deferred1_1 = r1;
571
+ return getStringFromWasm0(r0, r1);
572
+ }
573
+ finally {
574
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
575
+ wasm$1.__wbindgen_free(deferred1_0, deferred1_1, 1);
576
+ }
577
+ }
578
+ }
579
+ /**
580
+ * to avoid recursion
581
+ */
582
+ class BufferedDecryptedMessage {
583
+ static __wrap(ptr) {
584
+ ptr = ptr >>> 0;
585
+ const obj = Object.create(BufferedDecryptedMessage.prototype);
586
+ obj.__wbg_ptr = ptr;
587
+ return obj;
588
+ }
589
+ __destroy_into_raw() {
590
+ const ptr = this.__wbg_ptr;
591
+ this.__wbg_ptr = 0;
592
+ return ptr;
593
+ }
594
+ free() {
595
+ const ptr = this.__destroy_into_raw();
596
+ wasm$1.__wbg_buffereddecryptedmessage_free(ptr);
597
+ }
598
+ /**
599
+ * @returns {any}
600
+ */
601
+ get message() {
602
+ const ret = wasm$1.buffereddecryptedmessage_message(this.__wbg_ptr);
603
+ return takeObject(ret);
604
+ }
605
+ /**
606
+ * @returns {Array<any>}
607
+ */
608
+ get proposals() {
609
+ const ret = wasm$1.buffereddecryptedmessage_proposals(this.__wbg_ptr);
610
+ return takeObject(ret);
611
+ }
612
+ /**
613
+ * @returns {boolean}
614
+ */
615
+ get is_active() {
616
+ const ret = wasm$1.buffereddecryptedmessage_is_active(this.__wbg_ptr);
617
+ return ret !== 0;
618
+ }
619
+ /**
620
+ * @returns {number | undefined}
621
+ */
622
+ get commit_delay() {
623
+ try {
624
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
625
+ wasm$1.buffereddecryptedmessage_commit_delay(retptr, this.__wbg_ptr);
626
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
627
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
628
+ return r0 === 0 ? undefined : r1 >>> 0;
629
+ }
630
+ finally {
631
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
632
+ }
633
+ }
634
+ /**
635
+ * @returns {any}
636
+ */
637
+ get sender_client_id() {
638
+ const ret = wasm$1.buffereddecryptedmessage_sender_client_id(this.__wbg_ptr);
639
+ return takeObject(ret);
640
+ }
641
+ /**
642
+ * @returns {boolean}
643
+ */
644
+ get has_epoch_changed() {
645
+ const ret = wasm$1.buffereddecryptedmessage_has_epoch_changed(this.__wbg_ptr);
646
+ return ret !== 0;
647
+ }
648
+ /**
649
+ * @returns {WireIdentity | undefined}
650
+ */
651
+ get identity() {
652
+ const ret = wasm$1.buffereddecryptedmessage_identity(this.__wbg_ptr);
653
+ return ret === 0 ? undefined : WireIdentity.__wrap(ret);
654
+ }
556
655
  }
557
656
  /**
558
657
  */
@@ -618,12 +717,25 @@ class ConversationConfiguration {
618
717
  * @param {(Uint8Array)[] | undefined} external_senders
619
718
  * @param {number | undefined} key_rotation_span
620
719
  * @param {number | undefined} wire_policy
720
+ * @param {Array<any>} per_domain_trust_anchors
621
721
  */
622
- constructor(ciphersuite, external_senders, key_rotation_span, wire_policy) {
623
- var ptr0 = isLikeNone(external_senders) ? 0 : passArrayJsValueToWasm0(external_senders, wasm$1.__wbindgen_malloc);
624
- var len0 = WASM_VECTOR_LEN;
625
- const ret = wasm$1.conversationconfiguration_new(isLikeNone(ciphersuite) ? 8 : ciphersuite, ptr0, len0, !isLikeNone(key_rotation_span), isLikeNone(key_rotation_span) ? 0 : key_rotation_span, isLikeNone(wire_policy) ? 3 : wire_policy);
626
- return ConversationConfiguration.__wrap(ret);
722
+ constructor(ciphersuite, external_senders, key_rotation_span, wire_policy, per_domain_trust_anchors) {
723
+ try {
724
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
725
+ var ptr0 = isLikeNone(external_senders) ? 0 : passArrayJsValueToWasm0(external_senders, wasm$1.__wbindgen_malloc);
726
+ var len0 = WASM_VECTOR_LEN;
727
+ wasm$1.conversationconfiguration_new(retptr, isLikeNone(ciphersuite) ? 8 : ciphersuite, ptr0, len0, !isLikeNone(key_rotation_span), isLikeNone(key_rotation_span) ? 0 : key_rotation_span, isLikeNone(wire_policy) ? 3 : wire_policy, addHeapObject(per_domain_trust_anchors));
728
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
729
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
730
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
731
+ if (r2) {
732
+ throw takeObject(r1);
733
+ }
734
+ return ConversationConfiguration.__wrap(r0);
735
+ }
736
+ finally {
737
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
738
+ }
627
739
  }
628
740
  }
629
741
  /**
@@ -679,7 +791,7 @@ let CoreCrypto$1 = class CoreCrypto {
679
791
  wasm$1.__wbg_corecrypto_free(ptr);
680
792
  }
681
793
  /**
682
- * Returns: [`WasmCryptoResult<WireE2eIdentity>`]
794
+ * Returns: [`WasmCryptoResult<E2eiEnrollment>`]
683
795
  *
684
796
  * see [core_crypto::mls::MlsCentral::e2ei_new_enrollment]
685
797
  * @param {string} client_id
@@ -700,39 +812,45 @@ let CoreCrypto$1 = class CoreCrypto {
700
812
  return takeObject(ret);
701
813
  }
702
814
  /**
703
- * Returns: [`WasmCryptoResult<WireE2eIdentity>`]
815
+ * Returns: [`WasmCryptoResult<E2eiEnrollment>`]
704
816
  *
705
817
  * see [core_crypto::mls::MlsCentral::e2ei_new_activation_enrollment]
818
+ * @param {string} client_id
706
819
  * @param {string} display_name
707
820
  * @param {string} handle
708
821
  * @param {number} expiry_days
709
822
  * @param {number} ciphersuite
710
823
  * @returns {Promise<any>}
711
824
  */
712
- e2ei_new_activation_enrollment(display_name, handle, expiry_days, ciphersuite) {
713
- const ptr0 = passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
825
+ e2ei_new_activation_enrollment(client_id, display_name, handle, expiry_days, ciphersuite) {
826
+ const ptr0 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
714
827
  const len0 = WASM_VECTOR_LEN;
715
- const ptr1 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
828
+ const ptr1 = passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
716
829
  const len1 = WASM_VECTOR_LEN;
717
- const ret = wasm$1.corecrypto_e2ei_new_activation_enrollment(this.__wbg_ptr, ptr0, len0, ptr1, len1, expiry_days, ciphersuite);
830
+ const ptr2 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
831
+ const len2 = WASM_VECTOR_LEN;
832
+ const ret = wasm$1.corecrypto_e2ei_new_activation_enrollment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, expiry_days, ciphersuite);
718
833
  return takeObject(ret);
719
834
  }
720
835
  /**
721
- * Returns: [`WasmCryptoResult<WireE2eIdentity>`]
836
+ * Returns: [`WasmCryptoResult<E2eiEnrollment>`]
722
837
  *
723
838
  * see [core_crypto::mls::MlsCentral::e2ei_new_rotate_enrollment]
839
+ * @param {string} client_id
724
840
  * @param {string | undefined} display_name
725
841
  * @param {string | undefined} handle
726
842
  * @param {number} expiry_days
727
843
  * @param {number} ciphersuite
728
844
  * @returns {Promise<any>}
729
845
  */
730
- e2ei_new_rotate_enrollment(display_name, handle, expiry_days, ciphersuite) {
731
- var ptr0 = isLikeNone(display_name) ? 0 : passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
732
- var len0 = WASM_VECTOR_LEN;
733
- var ptr1 = isLikeNone(handle) ? 0 : passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
846
+ e2ei_new_rotate_enrollment(client_id, display_name, handle, expiry_days, ciphersuite) {
847
+ const ptr0 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
848
+ const len0 = WASM_VECTOR_LEN;
849
+ var ptr1 = isLikeNone(display_name) ? 0 : passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
734
850
  var len1 = WASM_VECTOR_LEN;
735
- const ret = wasm$1.corecrypto_e2ei_new_rotate_enrollment(this.__wbg_ptr, ptr0, len0, ptr1, len1, expiry_days, ciphersuite);
851
+ var ptr2 = isLikeNone(handle) ? 0 : passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
852
+ var len2 = WASM_VECTOR_LEN;
853
+ const ret = wasm$1.corecrypto_e2ei_new_rotate_enrollment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, expiry_days, ciphersuite);
736
854
  return takeObject(ret);
737
855
  }
738
856
  /**
@@ -789,14 +907,41 @@ let CoreCrypto$1 = class CoreCrypto {
789
907
  /**
790
908
  * Returns [`WasmCryptoResult<bool>`]
791
909
  *
792
- * see [core_crypto::mls::MlsCentral::e2ei_is_degraded]
910
+ * see [core_crypto::mls::MlsCentral::e2ei_conversation_state]
911
+ * @param {Uint8Array} conversation_id
912
+ * @returns {Promise<any>}
913
+ */
914
+ e2ei_conversation_state(conversation_id) {
915
+ const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
916
+ const len0 = WASM_VECTOR_LEN;
917
+ const ret = wasm$1.corecrypto_e2ei_conversation_state(this.__wbg_ptr, ptr0, len0);
918
+ return takeObject(ret);
919
+ }
920
+ /**
921
+ * Returns [`WasmCryptoResult<bool>`]
922
+ *
923
+ * see [core_crypto::mls::MlsCentral::e2ei_is_enabled]
924
+ * @param {number} ciphersuite
925
+ * @returns {Promise<any>}
926
+ */
927
+ e2ei_is_enabled(ciphersuite) {
928
+ const ret = wasm$1.corecrypto_e2ei_is_enabled(this.__wbg_ptr, ciphersuite);
929
+ return takeObject(ret);
930
+ }
931
+ /**
932
+ * Returns [`WasmCryptoResult<Vec<WireIdentity>>`]
933
+ *
934
+ * see [core_crypto::mls::MlsCentral::get_user_identities]
793
935
  * @param {Uint8Array} conversation_id
936
+ * @param {(Uint8Array)[]} client_ids
794
937
  * @returns {Promise<any>}
795
938
  */
796
- e2ei_is_degraded(conversation_id) {
939
+ get_user_identities(conversation_id, client_ids) {
797
940
  const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
798
941
  const len0 = WASM_VECTOR_LEN;
799
- const ret = wasm$1.corecrypto_e2ei_is_degraded(this.__wbg_ptr, ptr0, len0);
942
+ const ptr1 = passArrayJsValueToWasm0(client_ids, wasm$1.__wbindgen_malloc);
943
+ const len1 = WASM_VECTOR_LEN;
944
+ const ret = wasm$1.corecrypto_get_user_identities(this.__wbg_ptr, ptr0, len0, ptr1, len1);
800
945
  return takeObject(ret);
801
946
  }
802
947
  /**
@@ -867,7 +1012,7 @@ let CoreCrypto$1 = class CoreCrypto {
867
1012
  * see [core_crypto::mls::MlsCentral::mls_init]
868
1013
  * @param {Uint8Array} client_id
869
1014
  * @param {Uint16Array} ciphersuites
870
- * @returns {Promise<Promise<any>>}
1015
+ * @returns {Promise<any>}
871
1016
  */
872
1017
  mls_init(client_id, ciphersuites) {
873
1018
  const ptr0 = passArray8ToWasm0(client_id, wasm$1.__wbindgen_malloc);
@@ -1178,9 +1323,26 @@ let CoreCrypto$1 = class CoreCrypto {
1178
1323
  return takeObject(ret);
1179
1324
  }
1180
1325
  /**
1326
+ * Returns: [`WasmCryptoResult<CommitBundle>`]
1327
+ *
1328
+ * see [core_crypto::mls::MlsCentral::update_trust_anchors_from_conversation]
1329
+ * @param {Uint8Array} conversation_id
1330
+ * @param {(string)[]} remove_domain_names
1331
+ * @param {Array<any>} add_trust_anchors
1332
+ * @returns {Promise<any>}
1333
+ */
1334
+ update_trust_anchors_from_conversation(conversation_id, remove_domain_names, add_trust_anchors) {
1335
+ const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
1336
+ const len0 = WASM_VECTOR_LEN;
1337
+ const ptr1 = passArrayJsValueToWasm0(remove_domain_names, wasm$1.__wbindgen_malloc);
1338
+ const len1 = WASM_VECTOR_LEN;
1339
+ const ret = wasm$1.corecrypto_update_trust_anchors_from_conversation(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(add_trust_anchors));
1340
+ return takeObject(ret);
1341
+ }
1342
+ /**
1181
1343
  * Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
1182
1344
  *
1183
- * see [core_crypto::mls::MlsCentral::new_proposal]
1345
+ * see [core_crypto::mls::MlsCentral::new_add_proposal]
1184
1346
  * @param {Uint8Array} conversation_id
1185
1347
  * @param {Uint8Array} keypackage
1186
1348
  * @returns {Promise<any>}
@@ -1196,7 +1358,7 @@ let CoreCrypto$1 = class CoreCrypto {
1196
1358
  /**
1197
1359
  * Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
1198
1360
  *
1199
- * see [core_crypto::mls::MlsCentral::new_proposal]
1361
+ * see [core_crypto::mls::MlsCentral::new_update_proposal]
1200
1362
  * @param {Uint8Array} conversation_id
1201
1363
  * @returns {Promise<any>}
1202
1364
  */
@@ -1209,7 +1371,7 @@ let CoreCrypto$1 = class CoreCrypto {
1209
1371
  /**
1210
1372
  * Returns: [`WasmCryptoResult<js_sys::Uint8Array>`]
1211
1373
  *
1212
- * see [core_crypto::mls::MlsCentral::new_proposal]
1374
+ * see [core_crypto::mls::MlsCentral::new_remove_proposal]
1213
1375
  * @param {Uint8Array} conversation_id
1214
1376
  * @param {Uint8Array} client_id
1215
1377
  * @returns {Promise<any>}
@@ -1446,7 +1608,7 @@ let CoreCrypto$1 = class CoreCrypto {
1446
1608
  * see [core_crypto::proteus::ProteusCentral::encrypt]
1447
1609
  * @param {string} session_id
1448
1610
  * @param {Uint8Array} plaintext
1449
- * @returns {Promise<Promise<any>>}
1611
+ * @returns {Promise<any>}
1450
1612
  */
1451
1613
  proteus_encrypt(session_id, plaintext) {
1452
1614
  const ptr0 = passStringToWasm0(session_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
@@ -1477,7 +1639,7 @@ let CoreCrypto$1 = class CoreCrypto {
1477
1639
  *
1478
1640
  * see [core_crypto::proteus::ProteusCentral::new_prekey]
1479
1641
  * @param {number} prekey_id
1480
- * @returns {Promise<Promise<any>>}
1642
+ * @returns {Promise<any>}
1481
1643
  */
1482
1644
  proteus_new_prekey(prekey_id) {
1483
1645
  const ret = wasm$1.corecrypto_proteus_new_prekey(this.__wbg_ptr, prekey_id);
@@ -1487,7 +1649,7 @@ let CoreCrypto$1 = class CoreCrypto {
1487
1649
  * Returns: [`WasmCryptoResult<ProteusAutoPrekeyBundle>`]
1488
1650
  *
1489
1651
  * see [core_crypto::proteus::ProteusCentral::new_prekey]
1490
- * @returns {Promise<Promise<any>>}
1652
+ * @returns {Promise<any>}
1491
1653
  */
1492
1654
  proteus_new_prekey_auto() {
1493
1655
  const ret = wasm$1.corecrypto_proteus_new_prekey_auto(this.__wbg_ptr);
@@ -1720,14 +1882,14 @@ class DecryptedMessage {
1720
1882
  * @returns {any}
1721
1883
  */
1722
1884
  get message() {
1723
- const ret = wasm$1.decryptedmessage_message(this.__wbg_ptr);
1885
+ const ret = wasm$1.buffereddecryptedmessage_message(this.__wbg_ptr);
1724
1886
  return takeObject(ret);
1725
1887
  }
1726
1888
  /**
1727
1889
  * @returns {Array<any>}
1728
1890
  */
1729
1891
  get proposals() {
1730
- const ret = wasm$1.decryptedmessage_proposals(this.__wbg_ptr);
1892
+ const ret = wasm$1.buffereddecryptedmessage_proposals(this.__wbg_ptr);
1731
1893
  return takeObject(ret);
1732
1894
  }
1733
1895
  /**
@@ -1743,7 +1905,7 @@ class DecryptedMessage {
1743
1905
  get commit_delay() {
1744
1906
  try {
1745
1907
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1746
- wasm$1.decryptedmessage_commit_delay(retptr, this.__wbg_ptr);
1908
+ wasm$1.buffereddecryptedmessage_commit_delay(retptr, this.__wbg_ptr);
1747
1909
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1748
1910
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1749
1911
  return r0 === 0 ? undefined : r1 >>> 0;
@@ -1756,7 +1918,7 @@ class DecryptedMessage {
1756
1918
  * @returns {any}
1757
1919
  */
1758
1920
  get sender_client_id() {
1759
- const ret = wasm$1.decryptedmessage_sender_client_id(this.__wbg_ptr);
1921
+ const ret = wasm$1.buffereddecryptedmessage_sender_client_id(this.__wbg_ptr);
1760
1922
  return takeObject(ret);
1761
1923
  }
1762
1924
  /**
@@ -1770,9 +1932,16 @@ class DecryptedMessage {
1770
1932
  * @returns {WireIdentity | undefined}
1771
1933
  */
1772
1934
  get identity() {
1773
- const ret = wasm$1.decryptedmessage_identity(this.__wbg_ptr);
1935
+ const ret = wasm$1.buffereddecryptedmessage_identity(this.__wbg_ptr);
1774
1936
  return ret === 0 ? undefined : WireIdentity.__wrap(ret);
1775
1937
  }
1938
+ /**
1939
+ * @returns {Array<any> | undefined}
1940
+ */
1941
+ get buffered_messages() {
1942
+ const ret = wasm$1.decryptedmessage_buffered_messages(this.__wbg_ptr);
1943
+ return takeObject(ret);
1944
+ }
1776
1945
  }
1777
1946
  /**
1778
1947
  */
@@ -2437,6 +2606,37 @@ class NewAcmeOrder {
2437
2606
  }
2438
2607
  /**
2439
2608
  */
2609
+ class PerDomainTrustAnchor {
2610
+ static __wrap(ptr) {
2611
+ ptr = ptr >>> 0;
2612
+ const obj = Object.create(PerDomainTrustAnchor.prototype);
2613
+ obj.__wbg_ptr = ptr;
2614
+ return obj;
2615
+ }
2616
+ __destroy_into_raw() {
2617
+ const ptr = this.__wbg_ptr;
2618
+ this.__wbg_ptr = 0;
2619
+ return ptr;
2620
+ }
2621
+ free() {
2622
+ const ptr = this.__destroy_into_raw();
2623
+ wasm$1.__wbg_perdomaintrustanchor_free(ptr);
2624
+ }
2625
+ /**
2626
+ * @param {string} domain_name
2627
+ * @param {string} intermediate_certificate_chain
2628
+ */
2629
+ constructor(domain_name, intermediate_certificate_chain) {
2630
+ const ptr0 = passStringToWasm0(domain_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2631
+ const len0 = WASM_VECTOR_LEN;
2632
+ const ptr1 = passStringToWasm0(intermediate_certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2633
+ const len1 = WASM_VECTOR_LEN;
2634
+ const ret = wasm$1.perdomaintrustanchor_new(ptr0, len0, ptr1, len1);
2635
+ return PerDomainTrustAnchor.__wrap(ret);
2636
+ }
2637
+ }
2638
+ /**
2639
+ */
2440
2640
  class ProposalBundle {
2441
2641
  static __wrap(ptr) {
2442
2642
  ptr = ptr >>> 0;
@@ -2538,7 +2738,7 @@ class RotateBundle {
2538
2738
  wasm$1.__wbg_rotatebundle_free(ptr);
2539
2739
  }
2540
2740
  /**
2541
- * @returns {Array<any>}
2741
+ * @returns {Map<any, any>}
2542
2742
  */
2543
2743
  get commits() {
2544
2744
  const ret = wasm$1.rotatebundle_commits(this.__wbg_ptr);
@@ -2603,8 +2803,9 @@ class WireIdentity {
2603
2803
  * @param {string} handle
2604
2804
  * @param {string} display_name
2605
2805
  * @param {string} domain
2806
+ * @param {string} certificate
2606
2807
  */
2607
- constructor(client_id, handle, display_name, domain) {
2808
+ constructor(client_id, handle, display_name, domain, certificate) {
2608
2809
  const ptr0 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2609
2810
  const len0 = WASM_VECTOR_LEN;
2610
2811
  const ptr1 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
@@ -2613,7 +2814,9 @@ class WireIdentity {
2613
2814
  const len2 = WASM_VECTOR_LEN;
2614
2815
  const ptr3 = passStringToWasm0(domain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2615
2816
  const len3 = WASM_VECTOR_LEN;
2616
- const ret = wasm$1.wireidentity_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
2817
+ const ptr4 = passStringToWasm0(certificate, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2818
+ const len4 = WASM_VECTOR_LEN;
2819
+ const ret = wasm$1.wireidentity_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
2617
2820
  return WireIdentity.__wrap(ret);
2618
2821
  }
2619
2822
  /**
@@ -2684,7 +2887,27 @@ class WireIdentity {
2684
2887
  let deferred1_1;
2685
2888
  try {
2686
2889
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2687
- wasm$1.wireidentity_domain(retptr, this.__wbg_ptr);
2890
+ wasm$1.acmedirectory_revokeCert(retptr, this.__wbg_ptr);
2891
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2892
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2893
+ deferred1_0 = r0;
2894
+ deferred1_1 = r1;
2895
+ return getStringFromWasm0(r0, r1);
2896
+ }
2897
+ finally {
2898
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2899
+ wasm$1.__wbindgen_free(deferred1_0, deferred1_1, 1);
2900
+ }
2901
+ }
2902
+ /**
2903
+ * @returns {string}
2904
+ */
2905
+ get certificate() {
2906
+ let deferred1_0;
2907
+ let deferred1_1;
2908
+ try {
2909
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2910
+ wasm$1.wireidentity_certificate(retptr, this.__wbg_ptr);
2688
2911
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2689
2912
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2690
2913
  deferred1_0 = r0;
@@ -2732,14 +2955,14 @@ function __wbg_get_imports() {
2732
2955
  const ret = getObject(arg0);
2733
2956
  return addHeapObject(ret);
2734
2957
  };
2958
+ imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
2959
+ takeObject(arg0);
2960
+ };
2735
2961
  imports.wbg.__wbindgen_is_object = function (arg0) {
2736
2962
  const val = getObject(arg0);
2737
2963
  const ret = typeof (val) === 'object' && val !== null;
2738
2964
  return ret;
2739
2965
  };
2740
- imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
2741
- takeObject(arg0);
2742
- };
2743
2966
  imports.wbg.__wbg_getwithrefkey_5e6d9547403deab8 = function (arg0, arg1) {
2744
2967
  const ret = getObject(arg0)[getObject(arg1)];
2745
2968
  return addHeapObject(ret);
@@ -2792,16 +3015,16 @@ function __wbg_get_imports() {
2792
3015
  const ret = getObject(arg0).length;
2793
3016
  return ret;
2794
3017
  };
2795
- imports.wbg.__wbg_new_b51585de1b234aff = function () {
2796
- const ret = new Object();
2797
- return addHeapObject(ret);
2798
- };
2799
3018
  imports.wbg.__wbg_call_01734de55d61e11d = function () {
2800
3019
  return handleError(function (arg0, arg1, arg2) {
2801
3020
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2802
3021
  return addHeapObject(ret);
2803
3022
  }, arguments);
2804
3023
  };
3024
+ imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
3025
+ const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
3026
+ return addHeapObject(ret);
3027
+ };
2805
3028
  imports.wbg.__wbg_new_8125e318e6245eed = function (arg0) {
2806
3029
  const ret = new Uint8Array(getObject(arg0));
2807
3030
  return addHeapObject(ret);
@@ -2810,47 +3033,12 @@ function __wbg_get_imports() {
2810
3033
  const ret = new Array();
2811
3034
  return addHeapObject(ret);
2812
3035
  };
2813
- imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
2814
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2815
- };
2816
- imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
2817
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2818
- };
2819
- imports.wbg.__wbindgen_number_new = function (arg0) {
2820
- const ret = arg0;
2821
- return addHeapObject(ret);
2822
- };
2823
- imports.wbg.__wbg_new_43f1b47c28813cbd = function (arg0, arg1) {
2824
- try {
2825
- var state0 = { a: arg0, b: arg1 };
2826
- var cb0 = (arg0, arg1) => {
2827
- const a = state0.a;
2828
- state0.a = 0;
2829
- try {
2830
- return __wbg_adapter_296(a, state0.b, arg0, arg1);
2831
- }
2832
- finally {
2833
- state0.a = a;
2834
- }
2835
- };
2836
- const ret = new Promise(cb0);
2837
- return addHeapObject(ret);
2838
- }
2839
- finally {
2840
- state0.a = state0.b = 0;
2841
- }
2842
- };
2843
3036
  imports.wbg.__wbg_push_ca1c26067ef907ac = function (arg0, arg1) {
2844
3037
  const ret = getObject(arg0).push(getObject(arg1));
2845
3038
  return ret;
2846
3039
  };
2847
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2848
- const ret = BigInt.asUintN(64, arg0);
2849
- return addHeapObject(ret);
2850
- };
2851
- imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
2852
- const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
2853
- return addHeapObject(ret);
3040
+ imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
3041
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2854
3042
  };
2855
3043
  imports.wbg.__wbg_new_56693dbed0c32988 = function () {
2856
3044
  const ret = new Map();
@@ -2860,26 +3048,41 @@ function __wbg_get_imports() {
2860
3048
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2861
3049
  return addHeapObject(ret);
2862
3050
  };
3051
+ imports.wbg.__wbindgen_number_new = function (arg0) {
3052
+ const ret = arg0;
3053
+ return addHeapObject(ret);
3054
+ };
3055
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
3056
+ const ret = BigInt.asUintN(64, arg0);
3057
+ return addHeapObject(ret);
3058
+ };
2863
3059
  imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
2864
3060
  const ret = FfiWireE2EIdentity.__wrap(arg0);
2865
3061
  return addHeapObject(ret);
2866
3062
  };
3063
+ imports.wbg.__wbg_new_b51585de1b234aff = function () {
3064
+ const ret = new Object();
3065
+ return addHeapObject(ret);
3066
+ };
3067
+ imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
3068
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3069
+ };
2867
3070
  imports.wbg.__wbg_new_d258248ed531ff54 = function (arg0, arg1) {
2868
3071
  const ret = new Error(getStringFromWasm0(arg0, arg1));
2869
3072
  return addHeapObject(ret);
2870
3073
  };
2871
- imports.wbg.__wbg_openCursor_555d508ba71b21cc = function () {
2872
- return handleError(function (arg0, arg1) {
2873
- const ret = getObject(arg0).openCursor(getObject(arg1));
2874
- return addHeapObject(ret);
2875
- }, arguments);
2876
- };
2877
3074
  imports.wbg.__wbg_openCursor_4d6f62b69b34be26 = function () {
2878
3075
  return handleError(function (arg0) {
2879
3076
  const ret = getObject(arg0).openCursor();
2880
3077
  return addHeapObject(ret);
2881
3078
  }, arguments);
2882
3079
  };
3080
+ imports.wbg.__wbg_openCursor_555d508ba71b21cc = function () {
3081
+ return handleError(function (arg0, arg1) {
3082
+ const ret = getObject(arg0).openCursor(getObject(arg1));
3083
+ return addHeapObject(ret);
3084
+ }, arguments);
3085
+ };
2883
3086
  imports.wbg.__wbg_setonsuccess_f518a37d8228a576 = function (arg0, arg1) {
2884
3087
  getObject(arg0).onsuccess = getObject(arg1);
2885
3088
  };
@@ -2980,6 +3183,30 @@ function __wbg_get_imports() {
2980
3183
  const ret = performance.now();
2981
3184
  return ret;
2982
3185
  };
3186
+ imports.wbg.__wbg_new_43f1b47c28813cbd = function (arg0, arg1) {
3187
+ try {
3188
+ var state0 = { a: arg0, b: arg1 };
3189
+ var cb0 = (arg0, arg1) => {
3190
+ const a = state0.a;
3191
+ state0.a = 0;
3192
+ try {
3193
+ return __wbg_adapter_312(a, state0.b, arg0, arg1);
3194
+ }
3195
+ finally {
3196
+ state0.a = a;
3197
+ }
3198
+ };
3199
+ const ret = new Promise(cb0);
3200
+ return addHeapObject(ret);
3201
+ }
3202
+ finally {
3203
+ state0.a = state0.b = 0;
3204
+ }
3205
+ };
3206
+ imports.wbg.__wbindgen_is_string = function (arg0) {
3207
+ const ret = typeof (getObject(arg0)) === 'string';
3208
+ return ret;
3209
+ };
2983
3210
  imports.wbg.__wbg_reject_7bd6ac9617013c02 = function (arg0) {
2984
3211
  const ret = Promise.reject(getObject(arg0));
2985
3212
  return addHeapObject(ret);
@@ -2988,6 +3215,10 @@ function __wbg_get_imports() {
2988
3215
  const ret = ProposalBundle.__wrap(arg0);
2989
3216
  return addHeapObject(ret);
2990
3217
  };
3218
+ imports.wbg.__wbg_buffereddecryptedmessage_new = function (arg0) {
3219
+ const ret = BufferedDecryptedMessage.__wrap(arg0);
3220
+ return addHeapObject(ret);
3221
+ };
2991
3222
  imports.wbg.__wbg_commitbundle_new = function (arg0) {
2992
3223
  const ret = CommitBundle.__wrap(arg0);
2993
3224
  return addHeapObject(ret);
@@ -3057,11 +3288,9 @@ function __wbg_get_imports() {
3057
3288
  return addHeapObject(ret);
3058
3289
  }, arguments);
3059
3290
  };
3060
- imports.wbg.__wbg_put_fb32824d87feec5c = function () {
3061
- return handleError(function (arg0, arg1, arg2) {
3062
- const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
3063
- return addHeapObject(ret);
3064
- }, arguments);
3291
+ imports.wbg.__wbg_now_9c5990bda04c7e53 = function () {
3292
+ const ret = Date.now();
3293
+ return ret;
3065
3294
  };
3066
3295
  imports.wbg.__wbg_put_d6937bc51f51a398 = function () {
3067
3296
  return handleError(function (arg0, arg1) {
@@ -3069,6 +3298,12 @@ function __wbg_get_imports() {
3069
3298
  return addHeapObject(ret);
3070
3299
  }, arguments);
3071
3300
  };
3301
+ imports.wbg.__wbg_put_fb32824d87feec5c = function () {
3302
+ return handleError(function (arg0, arg1, arg2) {
3303
+ const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
3304
+ return addHeapObject(ret);
3305
+ }, arguments);
3306
+ };
3072
3307
  imports.wbg.__wbg_delete_ca1cfc48f1f7981c = function () {
3073
3308
  return handleError(function (arg0, arg1) {
3074
3309
  const ret = getObject(arg0).delete(getObject(arg1));
@@ -3099,10 +3334,6 @@ function __wbg_get_imports() {
3099
3334
  return addHeapObject(ret);
3100
3335
  }, arguments);
3101
3336
  };
3102
- imports.wbg.__wbg_now_9c5990bda04c7e53 = function () {
3103
- const ret = Date.now();
3104
- return ret;
3105
- };
3106
3337
  imports.wbg.__wbindgen_memory = function () {
3107
3338
  const ret = wasm$1.memory;
3108
3339
  return addHeapObject(ret);
@@ -3145,10 +3376,6 @@ function __wbg_get_imports() {
3145
3376
  const ret = getObject(arg0).node;
3146
3377
  return addHeapObject(ret);
3147
3378
  };
3148
- imports.wbg.__wbindgen_is_string = function (arg0) {
3149
- const ret = typeof (getObject(arg0)) === 'string';
3150
- return ret;
3151
- };
3152
3379
  imports.wbg.__wbg_require_8f08ceecec0f4fee = function () {
3153
3380
  return handleError(function () {
3154
3381
  const ret = module.require;
@@ -3416,12 +3643,12 @@ function __wbg_get_imports() {
3416
3643
  return addHeapObject(ret);
3417
3644
  }, arguments);
3418
3645
  };
3419
- imports.wbg.__wbindgen_closure_wrapper1985 = function (arg0, arg1, arg2) {
3420
- const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_52);
3646
+ imports.wbg.__wbindgen_closure_wrapper1718 = function (arg0, arg1, arg2) {
3647
+ const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_52);
3421
3648
  return addHeapObject(ret);
3422
3649
  };
3423
- imports.wbg.__wbindgen_closure_wrapper4648 = function (arg0, arg1, arg2) {
3424
- const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_55);
3650
+ imports.wbg.__wbindgen_closure_wrapper4849 = function (arg0, arg1, arg2) {
3651
+ const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_55);
3425
3652
  return addHeapObject(ret);
3426
3653
  };
3427
3654
  return imports;
@@ -3462,6 +3689,7 @@ var exports = /*#__PURE__*/Object.freeze({
3462
3689
  __proto__: null,
3463
3690
  AcmeChallenge: AcmeChallenge,
3464
3691
  AcmeDirectory: AcmeDirectory,
3692
+ BufferedDecryptedMessage: BufferedDecryptedMessage,
3465
3693
  Ciphersuite: Ciphersuite$1,
3466
3694
  CommitBundle: CommitBundle,
3467
3695
  ConversationConfiguration: ConversationConfiguration,
@@ -3477,6 +3705,7 @@ var exports = /*#__PURE__*/Object.freeze({
3477
3705
  MemberAddedMessages: MemberAddedMessages,
3478
3706
  NewAcmeAuthz: NewAcmeAuthz,
3479
3707
  NewAcmeOrder: NewAcmeOrder,
3708
+ PerDomainTrustAnchor: PerDomainTrustAnchor,
3480
3709
  ProposalBundle: ProposalBundle,
3481
3710
  ProteusAutoPrekeyBundle: ProteusAutoPrekeyBundle,
3482
3711
  RotateBundle: RotateBundle,
@@ -3486,26 +3715,35 @@ var exports = /*#__PURE__*/Object.freeze({
3486
3715
  initSync: initSync
3487
3716
  });
3488
3717
 
3489
- var wasm = async (opt = {}) => {
3490
- let {importHook, serverPath} = opt;
3718
+ const wasm_path = "assets/core_crypto_ffi-0cc267da.wasm";
3719
+
3720
+
3721
+ var wasm = async (opt = {}) => {
3722
+ let {importHook, serverPath, initializeHook} = opt;
3491
3723
 
3492
- let path = "assets/core_crypto_ffi-4208aa56.wasm";
3724
+ let final_path = wasm_path;
3493
3725
 
3494
3726
  if (serverPath != null) {
3495
- path = serverPath + /[^\/\\]*$/.exec(path)[0];
3727
+ final_path = serverPath + /[^\/\\]*$/.exec(final_path)[0];
3496
3728
  }
3497
3729
 
3498
3730
  if (importHook != null) {
3499
- path = importHook(path);
3731
+ final_path = importHook(final_path);
3732
+ }
3733
+
3734
+ if (initializeHook != null) {
3735
+ await initializeHook(__wbg_init, final_path);
3736
+
3737
+ } else {
3738
+ await __wbg_init(final_path);
3500
3739
  }
3501
3740
 
3502
- await __wbg_init(path);
3503
3741
  return exports;
3504
3742
  };
3505
3743
 
3506
3744
  // Wire
3507
3745
  // Copyright (C) 2022 Wire Swiss GmbH
3508
- var _a, _CoreCrypto_module, _CoreCrypto_cc, _CoreCrypto_assertModuleLoaded, _WireE2eIdentity_e2ei;
3746
+ var _a, _CoreCrypto_module, _CoreCrypto_cc, _CoreCrypto_assertModuleLoaded, _E2eiEnrollment_enrollment;
3509
3747
  /**
3510
3748
  * Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
3511
3749
  *
@@ -3813,7 +4051,7 @@ class CoreCrypto {
3813
4051
  /**
3814
4052
  * Closes this {@link CoreCrypto} instance and deallocates all loaded resources
3815
4053
  *
3816
- * **CAUTION**: This {@link CoreCrypto} instance won't be useable after a call to this method, but there's no way to express this requirement in TypeScript so you'll get errors instead!
4054
+ * **CAUTION**: This {@link CoreCrypto} instance won't be usable after a call to this method, but there's no way to express this requirement in TypeScript, so you'll get errors instead!
3817
4055
  */
3818
4056
  async close() {
3819
4057
  await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").close());
@@ -3897,8 +4135,8 @@ class CoreCrypto {
3897
4135
  */
3898
4136
  async createConversation(conversationId, creatorCredentialType, configuration = {}) {
3899
4137
  try {
3900
- const { ciphersuite, externalSenders, custom = {} } = configuration || {};
3901
- const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(ciphersuite, externalSenders, custom?.keyRotationSpan);
4138
+ const { ciphersuite, externalSenders, custom = {}, perDomainTrustAnchors = [] } = configuration || {};
4139
+ const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(ciphersuite, externalSenders, custom?.keyRotationSpan, custom?.wirePolicy, perDomainTrustAnchors);
3902
4140
  const ret = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, creatorCredentialType, config));
3903
4141
  return ret;
3904
4142
  }
@@ -3907,7 +4145,12 @@ class CoreCrypto {
3907
4145
  }
3908
4146
  }
3909
4147
  /**
3910
- * Decrypts a message for a given conversation
4148
+ * Decrypts a message for a given conversation.
4149
+ *
4150
+ * Note: you should catch & ignore the following error reasons:
4151
+ * * "We already decrypted this message once"
4152
+ * * "You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit"
4153
+ * * "Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives"
3911
4154
  *
3912
4155
  * @param conversationId - The ID of the conversation
3913
4156
  * @param payload - The encrypted message buffer
@@ -3932,6 +4175,16 @@ class CoreCrypto {
3932
4175
  senderClientId: ffiDecryptedMessage.sender_client_id,
3933
4176
  commitDelay,
3934
4177
  hasEpochChanged: ffiDecryptedMessage.has_epoch_changed,
4178
+ bufferedMessages: ffiDecryptedMessage.buffered_messages?.map(m => {
4179
+ return {
4180
+ message: m.message,
4181
+ proposals: m.proposals,
4182
+ isActive: m.is_active,
4183
+ senderClientId: m.sender_client_id,
4184
+ commitDelay: m.commit_delay,
4185
+ hasEpochChanged: m.has_epoch_changed,
4186
+ };
4187
+ }),
3935
4188
  };
3936
4189
  return ret;
3937
4190
  }
@@ -3950,9 +4203,47 @@ class CoreCrypto {
3950
4203
  async encryptMessage(conversationId, message) {
3951
4204
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").encrypt_message(conversationId, message));
3952
4205
  }
4206
+ /**
4207
+ * Updates the trust anchors for a conversation. This should be called when a federated event happens (new team added/removed).
4208
+ * Clients should add and/or remove trust anchors from the new backend to the conversation. The method will check
4209
+ * for duplicated domains and the validity of the certificate chain.
4210
+ *
4211
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
4212
+ * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
4213
+ * epoch, use new encryption secrets etc...
4214
+ *
4215
+ * @param conversationId - The ID of the conversation
4216
+ * @param removeDomainNames - Domains to remove from the trust anchors
4217
+ * @param addTrustAnchors - New trust anchors to add to the conversation
4218
+ *
4219
+ * @returns A {@link CommitBundle}
4220
+ */
4221
+ async updateTrustAnchorsFromConversation(conversationId, removeDomainNames, addTrustAnchors) {
4222
+ try {
4223
+ const ffiRet = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").update_trust_anchors_from_conversation(conversationId, removeDomainNames, addTrustAnchors));
4224
+ const gi = ffiRet.group_info;
4225
+ const ret = {
4226
+ welcome: ffiRet.welcome,
4227
+ commit: ffiRet.commit,
4228
+ groupInfo: {
4229
+ encryptionType: gi.encryption_type,
4230
+ ratchetTreeType: gi.ratchet_tree_type,
4231
+ payload: gi.payload
4232
+ },
4233
+ };
4234
+ return ret;
4235
+ }
4236
+ catch (e) {
4237
+ throw CoreCryptoError.fromStdError(e);
4238
+ }
4239
+ }
3953
4240
  /**
3954
4241
  * Ingest a TLS-serialized MLS welcome message to join an existing MLS group
3955
4242
  *
4243
+ * Important: you have to catch the error with this reason "Although this Welcome seems valid, the local KeyPackage
4244
+ * it references has already been deleted locally. Join this group with an external commit", ignore it and then try
4245
+ * to join this group with an external commit.
4246
+ *
3956
4247
  * @param welcomeMessage - TLS-serialized MLS Welcome message
3957
4248
  * @param configuration - configuration of the MLS group
3958
4249
  * @returns The conversation ID of the newly joined group. You can use the same ID to decrypt/encrypt messages
@@ -3968,7 +4259,10 @@ class CoreCrypto {
3968
4259
  }
3969
4260
  }
3970
4261
  /**
3971
- * @returns The client's public key
4262
+ * Get the client's public signature key. To upload to the DS for further backend side validation
4263
+ *
4264
+ * @param ciphersuite - of the signature key to get
4265
+ * @returns the client's public signature key
3972
4266
  */
3973
4267
  async clientPublicKey(ciphersuite) {
3974
4268
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").client_public_key(ciphersuite));
@@ -4005,7 +4299,7 @@ class CoreCrypto {
4005
4299
  /**
4006
4300
  * Adds new clients to a conversation, assuming the current client has the right to add new clients to the conversation.
4007
4301
  *
4008
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
4302
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
4009
4303
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
4010
4304
  * epoch, use new encryption secrets etc...
4011
4305
  *
@@ -4039,7 +4333,7 @@ class CoreCrypto {
4039
4333
  * Removes the provided clients from a conversation; Assuming those clients exist and the current client is allowed
4040
4334
  * to do so, otherwise this operation does nothing.
4041
4335
  *
4042
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
4336
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
4043
4337
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
4044
4338
  * epoch, use new encryption secrets etc...
4045
4339
  *
@@ -4068,9 +4362,9 @@ class CoreCrypto {
4068
4362
  }
4069
4363
  }
4070
4364
  /**
4071
- * Creates an update commit which forces every client to update their keypackages in the conversation
4365
+ * Creates an update commit which forces every client to update their LeafNode in the conversation
4072
4366
  *
4073
- * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterwards **ONLY IF** the Delivery Service responds
4367
+ * **CAUTION**: {@link CoreCrypto.commitAccepted} **HAS TO** be called afterward **ONLY IF** the Delivery Service responds
4074
4368
  * '200 OK' to the {@link CommitBundle} upload. It will "merge" the commit locally i.e. increment the local group
4075
4369
  * epoch, use new encryption secrets etc...
4076
4370
  *
@@ -4158,6 +4452,9 @@ class CoreCrypto {
4158
4452
  throw new Error("Invalid proposal type!");
4159
4453
  }
4160
4454
  }
4455
+ /**
4456
+ * Creates a new external Add proposal for self client to join a conversation.
4457
+ */
4161
4458
  async newExternalProposal(externalProposalType, args) {
4162
4459
  switch (externalProposalType) {
4163
4460
  case ExternalProposalType.Add: {
@@ -4211,6 +4508,7 @@ class CoreCrypto {
4211
4508
  * and deletes the temporary one. This step makes the group operational and ready to encrypt/decrypt message
4212
4509
  *
4213
4510
  * @param conversationId - The ID of the conversation
4511
+ * @returns eventually decrypted buffered messages if any
4214
4512
  */
4215
4513
  async mergePendingGroupFromExternalCommit(conversationId) {
4216
4514
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").merge_pending_group_from_external_commit(conversationId));
@@ -4226,20 +4524,19 @@ class CoreCrypto {
4226
4524
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_group_from_external_commit(conversationId));
4227
4525
  }
4228
4526
  /**
4229
- * Allows to mark the latest commit produced as "accepted" and be able to safely merge it
4230
- * into the local group state
4527
+ * Allows to mark the latest commit produced as "accepted" and be able to safely merge it into the local group state
4231
4528
  *
4232
4529
  * @param conversationId - The group's ID
4530
+ * @returns the messages from current epoch which had been buffered, if any
4233
4531
  */
4234
4532
  async commitAccepted(conversationId) {
4235
4533
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").commit_accepted(conversationId));
4236
4534
  }
4237
4535
  /**
4238
- * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions
4239
- * have changed meanwhile.
4536
+ * Allows to remove a pending proposal (rollback). Use this when backend rejects the proposal you just sent e.g. if permissions have changed meanwhile.
4240
4537
  *
4241
4538
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
4242
- * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc..
4539
+ * e.g. 403 or 409. Do not use otherwise e.g. 5xx responses, timeout etc
4243
4540
  *
4244
4541
  * @param conversationId - The group's ID
4245
4542
  * @param proposalRef - A reference to the proposal to delete. You get one when using {@link CoreCrypto.newProposal}
@@ -4248,8 +4545,7 @@ class CoreCrypto {
4248
4545
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").clear_pending_proposal(conversationId, proposalRef));
4249
4546
  }
4250
4547
  /**
4251
- * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions
4252
- * have changed meanwhile.
4548
+ * Allows to remove a pending commit (rollback). Use this when backend rejects the commit you just sent e.g. if permissions have changed meanwhile.
4253
4549
  *
4254
4550
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
4255
4551
  * e.g. 403. Do not use otherwise e.g. 5xx responses, timeout etc..
@@ -4306,7 +4602,7 @@ class CoreCrypto {
4306
4602
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").reseed_rng(seed));
4307
4603
  }
4308
4604
  /**
4309
- * Initiailizes the proteus client
4605
+ * Initializes the proteus client
4310
4606
  */
4311
4607
  async proteusInit() {
4312
4608
  return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_init());
@@ -4483,54 +4779,56 @@ class CoreCrypto {
4483
4779
  * Creates an enrollment instance with private key material you can use in order to fetch
4484
4780
  * a new x509 certificate from the acme server.
4485
4781
  *
4486
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4487
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
4488
- * @param handle user handle e.g. `alice.smith.qa@example.com`
4489
- * @param expiryDays generated x509 certificate expiry
4782
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4783
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
4784
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
4785
+ * @param expiryDays - generated x509 certificate expiry
4490
4786
  * @param ciphersuite - for generating signing key material
4491
- * @returns The new {@link WireE2eIdentity} object
4787
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiMlsInitOnly}
4492
4788
  */
4493
4789
  async e2eiNewEnrollment(clientId, displayName, handle, expiryDays, ciphersuite) {
4494
4790
  const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_new_enrollment(clientId, displayName, handle, expiryDays, ciphersuite));
4495
- return new WireE2eIdentity(e2ei);
4791
+ return new E2eiEnrollment(e2ei);
4496
4792
  }
4497
4793
  /**
4498
4794
  * Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI.
4499
- * As a consequence, this method does not support changing the ClientId which should remain the same as the Basic one.
4500
4795
  * Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
4501
4796
  *
4502
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
4503
- * @param handle user handle e.g. `alice.smith.qa@example.com`
4504
- * @param expiryDays generated x509 certificate expiry
4797
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4798
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
4799
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
4800
+ * @param expiryDays - generated x509 certificate expiry
4505
4801
  * @param ciphersuite - for generating signing key material
4506
- * @returns The new {@link WireE2eIdentity} object
4802
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
4507
4803
  */
4508
- async e2eiNewActivationEnrollment(displayName, handle, expiryDays, ciphersuite) {
4509
- const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_new_activation_enrollment(displayName, handle, expiryDays, ciphersuite));
4510
- return new WireE2eIdentity(e2ei);
4804
+ async e2eiNewActivationEnrollment(clientId, displayName, handle, expiryDays, ciphersuite) {
4805
+ const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_new_activation_enrollment(clientId, displayName, handle, expiryDays, ciphersuite));
4806
+ return new E2eiEnrollment(e2ei);
4511
4807
  }
4512
4808
  /**
4513
4809
  * Generates an E2EI enrollment instance for a E2EI client (with a X509 certificate credential)
4514
4810
  * having to change/rotate their credential, either because the former one is expired or it
4515
- * has been revoked. As a consequence, this method does not support changing neither ClientId which
4516
- * should remain the same as the previous one. It lets you change the DisplayName or the handle
4811
+ * has been revoked. It lets you change the DisplayName or the handle
4517
4812
  * if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
4518
4813
  *
4519
- * @param expiryDays generated x509 certificate expiry
4814
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4815
+ * @param expiryDays - generated x509 certificate expiry
4520
4816
  * @param ciphersuite - for generating signing key material
4521
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
4522
- * @param handle user handle e.g. `alice.smith.qa@example.com`
4523
- * @returns The new {@link WireE2eIdentity} object
4817
+ * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
4818
+ * @param handle - user handle e.g. `alice.smith.qa@example.com`
4819
+ * @returns The new {@link E2eiEnrollment} enrollment instance to use with {@link CoreCrypto.e2eiRotateAll}
4524
4820
  */
4525
- async e2eiNewRotateEnrollment(expiryDays, ciphersuite, displayName, handle) {
4526
- const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_new_rotate_enrollment(displayName, handle, expiryDays, ciphersuite));
4527
- return new WireE2eIdentity(e2ei);
4821
+ async e2eiNewRotateEnrollment(clientId, expiryDays, ciphersuite, displayName, handle) {
4822
+ const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_new_rotate_enrollment(clientId, displayName, handle, expiryDays, ciphersuite));
4823
+ return new E2eiEnrollment(e2ei);
4528
4824
  }
4529
4825
  /**
4530
- * Use this method to initialize end-to-end identity when a client signs up and the grace period is already expired ; that means he cannot initialize with a Basic credential
4826
+ * Use this method to initialize end-to-end identity when a client signs up and the grace period is already expired ;
4827
+ * that means he cannot initialize with a Basic credential
4531
4828
  *
4532
4829
  * @param enrollment - the enrollment instance used to fetch the certificates
4533
4830
  * @param certificateChain - the raw response from ACME server
4831
+ * @returns a MlsClient initialized with only a x509 credential
4534
4832
  */
4535
4833
  async e2eiMlsInitOnly(enrollment, certificateChain) {
4536
4834
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_mls_init_only(enrollment.inner(), certificateChain);
@@ -4543,9 +4841,16 @@ class CoreCrypto {
4543
4841
  * @param enrollment - the enrollment instance used to fetch the certificates
4544
4842
  * @param certificateChain - the raw response from ACME server
4545
4843
  * @param newKeyPackageCount - number of KeyPackages with new identity to generate
4844
+ * @returns a {@link RotateBundle} with commits to fan-out to other group members, KeyPackages to upload and old ones to delete
4546
4845
  */
4547
4846
  async e2eiRotateAll(enrollment, certificateChain, newKeyPackageCount) {
4548
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_rotate_all(enrollment.inner(), certificateChain, newKeyPackageCount);
4847
+ const ffiRet = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_rotate_all(enrollment.inner(), certificateChain, newKeyPackageCount);
4848
+ const ret = {
4849
+ commits: ffiRet.commits,
4850
+ newKeyPackages: ffiRet.new_key_packages,
4851
+ keyPackageRefsToRemove: ffiRet.key_package_refs_to_remove,
4852
+ };
4853
+ return ret;
4549
4854
  }
4550
4855
  /**
4551
4856
  * Allows persisting an active enrollment (for example while redirecting the user during OAuth) in order to resume
@@ -4565,17 +4870,39 @@ class CoreCrypto {
4565
4870
  */
4566
4871
  async e2eiEnrollmentStashPop(handle) {
4567
4872
  const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_enrollment_stash_pop(handle));
4568
- return new WireE2eIdentity(e2ei);
4873
+ return new E2eiEnrollment(e2ei);
4569
4874
  }
4570
4875
  /**
4571
4876
  * Indicates when to mark a conversation as degraded i.e. when not all its members have a X509.
4572
4877
  * Credential generated by Wire's end-to-end identity enrollment
4573
4878
  *
4574
4879
  * @param conversationId The group's ID
4575
- * @returns true if all the members have valid X509 credentials
4880
+ * @returns the conversation state given current members
4576
4881
  */
4577
- async e2eiIsDegraded(conversationId) {
4578
- return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_is_degraded(conversationId));
4882
+ async e2eiConversationState(conversationId) {
4883
+ let state = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_conversation_state(conversationId));
4884
+ // @ts-ignore
4885
+ return E2eiConversationState[E2eiConversationState[state]];
4886
+ }
4887
+ /**
4888
+ * Returns true when end-to-end-identity is enabled for the given Ciphersuite
4889
+ *
4890
+ * @param ciphersuite of the credential to check
4891
+ * @returns true if end-to-end identity is enabled for the given ciphersuite
4892
+ */
4893
+ async e2eiIsEnabled(ciphersuite) {
4894
+ return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_is_enabled(ciphersuite));
4895
+ }
4896
+ /**
4897
+ * From a given conversation, get the identity of the members supplied. Identity is only present for members with a
4898
+ * Certificate Credential (after turning on end-to-end identity).
4899
+ *
4900
+ * @param conversationId - identifier of the conversation
4901
+ * @param clientIds - identifiers of the user
4902
+ * @returns identities or if no member has a x509 certificate, it will return an empty List
4903
+ */
4904
+ async getUserIdentities(conversationId, clientIds) {
4905
+ return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").get_user_identities(conversationId, clientIds));
4579
4906
  }
4580
4907
  /**
4581
4908
  * Returns the current version of {@link CoreCrypto}
@@ -4594,21 +4921,21 @@ _a = CoreCrypto, _CoreCrypto_cc = new WeakMap(), _CoreCrypto_assertModuleLoaded
4594
4921
  };
4595
4922
  /** @hidden */
4596
4923
  _CoreCrypto_module = { value: void 0 };
4597
- class WireE2eIdentity {
4924
+ class E2eiEnrollment {
4598
4925
  /** @hidden */
4599
4926
  constructor(e2ei) {
4600
4927
  /** @hidden */
4601
- _WireE2eIdentity_e2ei.set(this, void 0);
4602
- __classPrivateFieldSet(this, _WireE2eIdentity_e2ei, e2ei, "f");
4928
+ _E2eiEnrollment_enrollment.set(this, void 0);
4929
+ __classPrivateFieldSet(this, _E2eiEnrollment_enrollment, e2ei, "f");
4603
4930
  }
4604
4931
  free() {
4605
- __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").free();
4932
+ __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").free();
4606
4933
  }
4607
4934
  /**
4608
4935
  * Should only be used internally
4609
4936
  */
4610
4937
  inner() {
4611
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f");
4938
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f");
4612
4939
  }
4613
4940
  /**
4614
4941
  * Parses the response from `GET /acme/{provisioner-name}/directory`.
@@ -4620,7 +4947,7 @@ class WireE2eIdentity {
4620
4947
  */
4621
4948
  directoryResponse(directory) {
4622
4949
  try {
4623
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").directory_response(directory);
4950
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").directory_response(directory);
4624
4951
  }
4625
4952
  catch (e) {
4626
4953
  throw CoreCryptoError.fromStdError(e);
@@ -4635,7 +4962,7 @@ class WireE2eIdentity {
4635
4962
  */
4636
4963
  newAccountRequest(previousNonce) {
4637
4964
  try {
4638
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_request(previousNonce);
4965
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_account_request(previousNonce);
4639
4966
  }
4640
4967
  catch (e) {
4641
4968
  throw CoreCryptoError.fromStdError(e);
@@ -4648,7 +4975,7 @@ class WireE2eIdentity {
4648
4975
  */
4649
4976
  newAccountResponse(account) {
4650
4977
  try {
4651
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_response(account);
4978
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_account_response(account);
4652
4979
  }
4653
4980
  catch (e) {
4654
4981
  throw CoreCryptoError.fromStdError(e);
@@ -4662,7 +4989,7 @@ class WireE2eIdentity {
4662
4989
  */
4663
4990
  newOrderRequest(previousNonce) {
4664
4991
  try {
4665
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_request(previousNonce);
4992
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_order_request(previousNonce);
4666
4993
  }
4667
4994
  catch (e) {
4668
4995
  throw CoreCryptoError.fromStdError(e);
@@ -4676,7 +5003,7 @@ class WireE2eIdentity {
4676
5003
  */
4677
5004
  newOrderResponse(order) {
4678
5005
  try {
4679
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_response(order);
5006
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_order_response(order);
4680
5007
  }
4681
5008
  catch (e) {
4682
5009
  throw CoreCryptoError.fromStdError(e);
@@ -4692,7 +5019,7 @@ class WireE2eIdentity {
4692
5019
  */
4693
5020
  newAuthzRequest(url, previousNonce) {
4694
5021
  try {
4695
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_request(url, previousNonce);
5022
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_authz_request(url, previousNonce);
4696
5023
  }
4697
5024
  catch (e) {
4698
5025
  throw CoreCryptoError.fromStdError(e);
@@ -4706,7 +5033,7 @@ class WireE2eIdentity {
4706
5033
  */
4707
5034
  newAuthzResponse(authz) {
4708
5035
  try {
4709
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_response(authz);
5036
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_authz_response(authz);
4710
5037
  }
4711
5038
  catch (e) {
4712
5039
  throw CoreCryptoError.fromStdError(e);
@@ -4725,7 +5052,7 @@ class WireE2eIdentity {
4725
5052
  */
4726
5053
  createDpopToken(expirySecs, backendNonce) {
4727
5054
  try {
4728
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").create_dpop_token(expirySecs, backendNonce);
5055
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").create_dpop_token(expirySecs, backendNonce);
4729
5056
  }
4730
5057
  catch (e) {
4731
5058
  throw CoreCryptoError.fromStdError(e);
@@ -4740,7 +5067,7 @@ class WireE2eIdentity {
4740
5067
  */
4741
5068
  newDpopChallengeRequest(accessToken, previousNonce) {
4742
5069
  try {
4743
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_dpop_challenge_request(accessToken, previousNonce);
5070
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_dpop_challenge_request(accessToken, previousNonce);
4744
5071
  }
4745
5072
  catch (e) {
4746
5073
  throw CoreCryptoError.fromStdError(e);
@@ -4755,7 +5082,7 @@ class WireE2eIdentity {
4755
5082
  */
4756
5083
  newOidcChallengeRequest(idToken, previousNonce) {
4757
5084
  try {
4758
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_oidc_challenge_request(idToken, previousNonce);
5085
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_oidc_challenge_request(idToken, previousNonce);
4759
5086
  }
4760
5087
  catch (e) {
4761
5088
  throw CoreCryptoError.fromStdError(e);
@@ -4769,7 +5096,7 @@ class WireE2eIdentity {
4769
5096
  */
4770
5097
  newChallengeResponse(challenge) {
4771
5098
  try {
4772
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_challenge_response(challenge);
5099
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").new_challenge_response(challenge);
4773
5100
  }
4774
5101
  catch (e) {
4775
5102
  throw CoreCryptoError.fromStdError(e);
@@ -4784,7 +5111,7 @@ class WireE2eIdentity {
4784
5111
  */
4785
5112
  checkOrderRequest(orderUrl, previousNonce) {
4786
5113
  try {
4787
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_request(orderUrl, previousNonce);
5114
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").check_order_request(orderUrl, previousNonce);
4788
5115
  }
4789
5116
  catch (e) {
4790
5117
  throw CoreCryptoError.fromStdError(e);
@@ -4794,12 +5121,12 @@ class WireE2eIdentity {
4794
5121
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
4795
5122
  *
4796
5123
  * @param order HTTP response body
4797
- * @return the finalize url to use with {@link finalizeRequest}
5124
+ * @return finalize url to use with {@link finalizeRequest}
4798
5125
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
4799
5126
  */
4800
5127
  checkOrderResponse(order) {
4801
5128
  try {
4802
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_response(order);
5129
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").check_order_response(order);
4803
5130
  }
4804
5131
  catch (e) {
4805
5132
  throw CoreCryptoError.fromStdError(e);
@@ -4813,7 +5140,7 @@ class WireE2eIdentity {
4813
5140
  */
4814
5141
  finalizeRequest(previousNonce) {
4815
5142
  try {
4816
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_request(previousNonce);
5143
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").finalize_request(previousNonce);
4817
5144
  }
4818
5145
  catch (e) {
4819
5146
  throw CoreCryptoError.fromStdError(e);
@@ -4828,7 +5155,7 @@ class WireE2eIdentity {
4828
5155
  */
4829
5156
  finalizeResponse(finalize) {
4830
5157
  try {
4831
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_response(finalize);
5158
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").finalize_response(finalize);
4832
5159
  }
4833
5160
  catch (e) {
4834
5161
  throw CoreCryptoError.fromStdError(e);
@@ -4842,13 +5169,33 @@ class WireE2eIdentity {
4842
5169
  */
4843
5170
  certificateRequest(previousNonce) {
4844
5171
  try {
4845
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_request(previousNonce);
5172
+ return __classPrivateFieldGet(this, _E2eiEnrollment_enrollment, "f").certificate_request(previousNonce);
4846
5173
  }
4847
5174
  catch (e) {
4848
5175
  throw CoreCryptoError.fromStdError(e);
4849
5176
  }
4850
5177
  }
4851
5178
  }
4852
- _WireE2eIdentity_e2ei = new WeakMap();
5179
+ _E2eiEnrollment_enrollment = new WeakMap();
5180
+ /**
5181
+ * Indicates the state of a Conversation regarding end-to-end identity.
5182
+ * Note: this does not check pending state (pending commit, pending proposals) so it does not
5183
+ * consider members about to be added/removed
5184
+ */
5185
+ var E2eiConversationState;
5186
+ (function (E2eiConversationState) {
5187
+ /**
5188
+ * All clients have a valid E2EI certificate
5189
+ */
5190
+ E2eiConversationState[E2eiConversationState["Verified"] = 1] = "Verified";
5191
+ /**
5192
+ * Some clients are either still Basic or their certificate is expired
5193
+ */
5194
+ E2eiConversationState[E2eiConversationState["Degraded"] = 2] = "Degraded";
5195
+ /**
5196
+ * All clients are still Basic. If all client have expired certificates, Degraded is returned.
5197
+ */
5198
+ E2eiConversationState[E2eiConversationState["NotEnabled"] = 3] = "NotEnabled";
5199
+ })(E2eiConversationState || (E2eiConversationState = {}));
4853
5200
 
4854
- export { Ciphersuite, CoreCrypto, CoreCryptoError, CredentialType, ExternalProposalType, GroupInfoEncryptionType, ProposalType, RatchetTreeType, WireE2eIdentity, WirePolicy };
5201
+ export { Ciphersuite, CoreCrypto, CoreCryptoError, CredentialType, E2eiConversationState, E2eiEnrollment, ExternalProposalType, GroupInfoEncryptionType, ProposalType, RatchetTreeType, WirePolicy };