@wireapp/core-crypto 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -648,12 +648,13 @@ export declare class CoreCrypto {
648
648
  * You will want to use {@link CoreCrypto.addClientsToConversation} afterwards to add clients to this conversation
649
649
  *
650
650
  * @param conversationId - The conversation ID; You can either make them random or let the backend attribute MLS group IDs
651
+ * @param creatorCredentialType - kind of credential the creator wants to create the group with
651
652
  * @param configuration - configuration of the MLS group
652
653
  * @param configuration.ciphersuite - The {@link Ciphersuite} that is chosen to be the group's
653
654
  * @param configuration.externalSenders - Array of Client IDs that are qualified as external senders within the group
654
655
  * @param configuration.custom - {@link CustomConfiguration}
655
656
  */
656
- createConversation(conversationId: ConversationId, configuration?: ConversationConfiguration): Promise<any>;
657
+ createConversation(conversationId: ConversationId, creatorCredentialType: CredentialType, configuration?: ConversationConfiguration): Promise<any>;
657
658
  /**
658
659
  * Decrypts a message for a given conversation
659
660
  *
@@ -230,12 +230,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
230
230
  return real;
231
231
  }
232
232
  function __wbg_adapter_52(arg0, arg1, arg2) {
233
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9c249377169e2f4c(arg0, arg1, addHeapObject(arg2));
233
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb4735603d1460e0b(arg0, arg1, addHeapObject(arg2));
234
234
  }
235
235
  function __wbg_adapter_55(arg0, arg1, arg2) {
236
236
  try {
237
237
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
238
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hee720ad0abaf79d4(retptr, arg0, arg1, addHeapObject(arg2));
238
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hae47a88d8cc19d80(retptr, arg0, arg1, addHeapObject(arg2));
239
239
  var r0 = getInt32Memory0()[retptr / 4 + 0];
240
240
  var r1 = getInt32Memory0()[retptr / 4 + 1];
241
241
  if (r1) {
@@ -300,7 +300,7 @@ function handleError(f, args) {
300
300
  }
301
301
  }
302
302
  function __wbg_adapter_288(arg0, arg1, arg2, arg3) {
303
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__ha9bc5bb1a764a589(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
303
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h29314eb9a720dde0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
304
304
  }
305
305
  /**
306
306
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -903,15 +903,16 @@ let CoreCrypto$1 = class CoreCrypto {
903
903
  *
904
904
  * see [core_crypto::mls::MlsCentral::new_conversation]
905
905
  * @param {Uint8Array} conversation_id
906
+ * @param {number} creator_credential_type
906
907
  * @param {ConversationConfiguration} config
907
908
  * @returns {Promise<any>}
908
909
  */
909
- create_conversation(conversation_id, config) {
910
+ create_conversation(conversation_id, creator_credential_type, config) {
910
911
  const ptr0 = passArray8ToWasm0(conversation_id, wasm$1.__wbindgen_malloc);
911
912
  const len0 = WASM_VECTOR_LEN;
912
913
  _assertClass(config, ConversationConfiguration);
913
914
  var ptr1 = config.__destroy_into_raw();
914
- const ret = wasm$1.corecrypto_create_conversation(this.__wbg_ptr, ptr0, len0, ptr1);
915
+ const ret = wasm$1.corecrypto_create_conversation(this.__wbg_ptr, ptr0, len0, creator_credential_type, ptr1);
915
916
  return takeObject(ret);
916
917
  }
917
918
  /**
@@ -2624,17 +2625,6 @@ function __wbg_get_imports() {
2624
2625
  const ret = getObject(arg0) in getObject(arg1);
2625
2626
  return ret;
2626
2627
  };
2627
- imports.wbg.__wbg_commit_008545ae6e591814 = function () {
2628
- return handleError(function (arg0) {
2629
- getObject(arg0).commit();
2630
- }, arguments);
2631
- };
2632
- imports.wbg.__wbg_setoncomplete_1a27889412475f6f = function (arg0, arg1) {
2633
- getObject(arg0).oncomplete = getObject(arg1);
2634
- };
2635
- imports.wbg.__wbg_setonerror_74c492184749a58a = function (arg0, arg1) {
2636
- getObject(arg0).onerror = getObject(arg1);
2637
- };
2638
2628
  imports.wbg.__wbg_objectStoreNames_432a9424fbdfefda = function (arg0) {
2639
2629
  const ret = getObject(arg0).objectStoreNames;
2640
2630
  return addHeapObject(ret);
@@ -2663,16 +2653,6 @@ function __wbg_get_imports() {
2663
2653
  const ret = getObject(arg0).length;
2664
2654
  return ret;
2665
2655
  };
2666
- imports.wbg.__wbg_call_587b30eea3e09332 = function () {
2667
- return handleError(function (arg0, arg1, arg2) {
2668
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2669
- return addHeapObject(ret);
2670
- }, arguments);
2671
- };
2672
- imports.wbg.__wbg_new_09938a7d020f049b = function (arg0) {
2673
- const ret = new Uint8Array(getObject(arg0));
2674
- return addHeapObject(ret);
2675
- };
2676
2656
  imports.wbg.__wbg_new_2b55e405e4af4986 = function (arg0, arg1) {
2677
2657
  try {
2678
2658
  var state0 = { a: arg0, b: arg1 };
@@ -2693,6 +2673,16 @@ function __wbg_get_imports() {
2693
2673
  state0.a = state0.b = 0;
2694
2674
  }
2695
2675
  };
2676
+ imports.wbg.__wbg_call_587b30eea3e09332 = function () {
2677
+ return handleError(function (arg0, arg1, arg2) {
2678
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2679
+ return addHeapObject(ret);
2680
+ }, arguments);
2681
+ };
2682
+ imports.wbg.__wbg_new_09938a7d020f049b = function (arg0) {
2683
+ const ret = new Uint8Array(getObject(arg0));
2684
+ return addHeapObject(ret);
2685
+ };
2696
2686
  imports.wbg.__wbg_new_0394642eae39db16 = function () {
2697
2687
  const ret = new Array();
2698
2688
  return addHeapObject(ret);
@@ -2701,28 +2691,28 @@ function __wbg_get_imports() {
2701
2691
  const ret = getObject(arg0).push(getObject(arg1));
2702
2692
  return ret;
2703
2693
  };
2704
- imports.wbg.__wbg_new_0f2b71ca2f2a6029 = function () {
2705
- const ret = new Map();
2706
- return addHeapObject(ret);
2707
- };
2708
- imports.wbg.__wbg_set_da7be7bf0e037b14 = function (arg0, arg1, arg2) {
2709
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2694
+ imports.wbg.__wbindgen_number_new = function (arg0) {
2695
+ const ret = arg0;
2710
2696
  return addHeapObject(ret);
2711
2697
  };
2712
2698
  imports.wbg.__wbg_new_2b6fea4ea03b1b95 = function () {
2713
2699
  const ret = new Object();
2714
2700
  return addHeapObject(ret);
2715
2701
  };
2702
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2703
+ const ret = BigInt.asUintN(64, arg0);
2704
+ return addHeapObject(ret);
2705
+ };
2716
2706
  imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
2717
2707
  const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
2718
2708
  return addHeapObject(ret);
2719
2709
  };
2720
- imports.wbg.__wbindgen_number_new = function (arg0) {
2721
- const ret = arg0;
2710
+ imports.wbg.__wbg_new_0f2b71ca2f2a6029 = function () {
2711
+ const ret = new Map();
2722
2712
  return addHeapObject(ret);
2723
2713
  };
2724
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2725
- const ret = BigInt.asUintN(64, arg0);
2714
+ imports.wbg.__wbg_set_da7be7bf0e037b14 = function (arg0, arg1, arg2) {
2715
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2726
2716
  return addHeapObject(ret);
2727
2717
  };
2728
2718
  imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
@@ -3301,11 +3291,11 @@ function __wbg_get_imports() {
3301
3291
  return addHeapObject(ret);
3302
3292
  }, arguments);
3303
3293
  };
3304
- imports.wbg.__wbindgen_closure_wrapper1659 = function (arg0, arg1, arg2) {
3294
+ imports.wbg.__wbindgen_closure_wrapper1634 = function (arg0, arg1, arg2) {
3305
3295
  const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_52);
3306
3296
  return addHeapObject(ret);
3307
3297
  };
3308
- imports.wbg.__wbindgen_closure_wrapper4794 = function (arg0, arg1, arg2) {
3298
+ imports.wbg.__wbindgen_closure_wrapper4776 = function (arg0, arg1, arg2) {
3309
3299
  const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_55);
3310
3300
  return addHeapObject(ret);
3311
3301
  };
@@ -3373,7 +3363,7 @@ var exports = /*#__PURE__*/Object.freeze({
3373
3363
  var wasm = async (opt = {}) => {
3374
3364
  let {importHook, serverPath} = opt;
3375
3365
 
3376
- let path = "assets/core_crypto_ffi-8c5ea533.wasm";
3366
+ let path = "assets/core_crypto_ffi-3ec195cb.wasm";
3377
3367
 
3378
3368
  if (serverPath != null) {
3379
3369
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -3773,16 +3763,17 @@ class CoreCrypto {
3773
3763
  * You will want to use {@link CoreCrypto.addClientsToConversation} afterwards to add clients to this conversation
3774
3764
  *
3775
3765
  * @param conversationId - The conversation ID; You can either make them random or let the backend attribute MLS group IDs
3766
+ * @param creatorCredentialType - kind of credential the creator wants to create the group with
3776
3767
  * @param configuration - configuration of the MLS group
3777
3768
  * @param configuration.ciphersuite - The {@link Ciphersuite} that is chosen to be the group's
3778
3769
  * @param configuration.externalSenders - Array of Client IDs that are qualified as external senders within the group
3779
3770
  * @param configuration.custom - {@link CustomConfiguration}
3780
3771
  */
3781
- async createConversation(conversationId, configuration = {}) {
3772
+ async createConversation(conversationId, creatorCredentialType, configuration = {}) {
3782
3773
  try {
3783
3774
  const { ciphersuite, externalSenders, custom = {} } = configuration || {};
3784
3775
  const config = new (__classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module).ConversationConfiguration)(ciphersuite, externalSenders, custom?.keyRotationSpan);
3785
- const ret = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, config));
3776
+ const ret = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").create_conversation(conversationId, creatorCredentialType, config));
3786
3777
  return ret;
3787
3778
  }
3788
3779
  catch (e) {