@bitwarden/commercial-sdk-internal 0.2.0-main.371 → 0.2.0-main.372

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.
@@ -1706,8 +1706,13 @@ export interface CipherError extends Error {
1706
1706
  variant:
1707
1707
  | "MissingField"
1708
1708
  | "Crypto"
1709
+ | "Decrypt"
1709
1710
  | "Encrypt"
1710
1711
  | "AttachmentsWithoutKeys"
1712
+ | "OrganizationAlreadySet"
1713
+ | "PutShare"
1714
+ | "PutShareMany"
1715
+ | "Repository"
1711
1716
  | "Chrono"
1712
1717
  | "SerdeJson";
1713
1718
  }
@@ -1922,6 +1927,24 @@ export class CiphersClient {
1922
1927
  * Edit an existing [Cipher] and save it to the server.
1923
1928
  */
1924
1929
  edit(request: CipherEditRequest): Promise<CipherView>;
1930
+ /**
1931
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1932
+ */
1933
+ share_cipher(
1934
+ cipher_view: CipherView,
1935
+ organization_id: OrganizationId,
1936
+ collection_ids: CollectionId[],
1937
+ original_cipher?: Cipher | null,
1938
+ ): Promise<Cipher>;
1939
+ /**
1940
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1941
+ * share_ciphers API.
1942
+ */
1943
+ share_ciphers_bulk(
1944
+ cipher_views: CipherView[],
1945
+ organization_id: OrganizationId,
1946
+ collection_ids: CollectionId[],
1947
+ ): Promise<Cipher[]>;
1925
1948
  encrypt(cipher_view: CipherView): EncryptionContext;
1926
1949
  /**
1927
1950
  * Encrypt a cipher with the provided key. This should only be used when rotating encryption
@@ -900,7 +900,7 @@ function __wbg_adapter_60(arg0, arg1) {
900
900
  );
901
901
  }
902
902
 
903
- function __wbg_adapter_355(arg0, arg1, arg2, arg3) {
903
+ function __wbg_adapter_357(arg0, arg1, arg2, arg3) {
904
904
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h849ee2a9e4ae2f91(
905
905
  arg0,
906
906
  arg1,
@@ -1470,6 +1470,50 @@ class CiphersClient {
1470
1470
  const ret = wasm.ciphersclient_edit(this.__wbg_ptr, addHeapObject(request));
1471
1471
  return takeObject(ret);
1472
1472
  }
1473
+ /**
1474
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1475
+ * @param {CipherView} cipher_view
1476
+ * @param {OrganizationId} organization_id
1477
+ * @param {CollectionId[]} collection_ids
1478
+ * @param {Cipher | null} [original_cipher]
1479
+ * @returns {Promise<Cipher>}
1480
+ */
1481
+ share_cipher(cipher_view, organization_id, collection_ids, original_cipher) {
1482
+ const ptr0 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1483
+ const len0 = WASM_VECTOR_LEN;
1484
+ const ret = wasm.ciphersclient_share_cipher(
1485
+ this.__wbg_ptr,
1486
+ addHeapObject(cipher_view),
1487
+ addHeapObject(organization_id),
1488
+ ptr0,
1489
+ len0,
1490
+ isLikeNone(original_cipher) ? 0 : addHeapObject(original_cipher),
1491
+ );
1492
+ return takeObject(ret);
1493
+ }
1494
+ /**
1495
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1496
+ * share_ciphers API.
1497
+ * @param {CipherView[]} cipher_views
1498
+ * @param {OrganizationId} organization_id
1499
+ * @param {CollectionId[]} collection_ids
1500
+ * @returns {Promise<Cipher[]>}
1501
+ */
1502
+ share_ciphers_bulk(cipher_views, organization_id, collection_ids) {
1503
+ const ptr0 = passArrayJsValueToWasm0(cipher_views, wasm.__wbindgen_malloc);
1504
+ const len0 = WASM_VECTOR_LEN;
1505
+ const ptr1 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1506
+ const len1 = WASM_VECTOR_LEN;
1507
+ const ret = wasm.ciphersclient_share_ciphers_bulk(
1508
+ this.__wbg_ptr,
1509
+ ptr0,
1510
+ len0,
1511
+ addHeapObject(organization_id),
1512
+ ptr1,
1513
+ len1,
1514
+ );
1515
+ return takeObject(ret);
1516
+ }
1473
1517
  /**
1474
1518
  * @param {CipherView} cipher_view
1475
1519
  * @returns {EncryptionContext}
@@ -4339,7 +4383,7 @@ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
4339
4383
  }, arguments);
4340
4384
  };
4341
4385
 
4342
- module.exports.__wbg_cipher_6d4b0329aa713e6f = function (arg0) {
4386
+ module.exports.__wbg_cipher_8a6269e122b390ae = function (arg0) {
4343
4387
  const ret = getObject(arg0).cipher;
4344
4388
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4345
4389
  };
@@ -4419,7 +4463,7 @@ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
4419
4463
  return addHeapObject(ret);
4420
4464
  };
4421
4465
 
4422
- module.exports.__wbg_folder_f0f5221fba71a8d6 = function (arg0) {
4466
+ module.exports.__wbg_folder_6dfae1b1134b74f8 = function (arg0) {
4423
4467
  const ret = getObject(arg0).folder;
4424
4468
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4425
4469
  };
@@ -4446,7 +4490,14 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
4446
4490
  return ret;
4447
4491
  };
4448
4492
 
4449
- module.exports.__wbg_get_61df30619186fd87 = function () {
4493
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4494
+ return handleError(function (arg0, arg1) {
4495
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4496
+ return addHeapObject(ret);
4497
+ }, arguments);
4498
+ };
4499
+
4500
+ module.exports.__wbg_get_77a3546428c7fc7d = function () {
4450
4501
  return handleError(function (arg0, arg1, arg2) {
4451
4502
  let deferred0_0;
4452
4503
  let deferred0_1;
@@ -4461,19 +4512,7 @@ module.exports.__wbg_get_61df30619186fd87 = function () {
4461
4512
  }, arguments);
4462
4513
  };
4463
4514
 
4464
- module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4465
- return handleError(function (arg0, arg1) {
4466
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4467
- return addHeapObject(ret);
4468
- }, arguments);
4469
- };
4470
-
4471
- module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4472
- const ret = getObject(arg0)[arg1 >>> 0];
4473
- return addHeapObject(ret);
4474
- };
4475
-
4476
- module.exports.__wbg_get_e4ef7322d68ab383 = function () {
4515
+ module.exports.__wbg_get_94e67783f37c82cd = function () {
4477
4516
  return handleError(function (arg0, arg1, arg2) {
4478
4517
  let deferred0_0;
4479
4518
  let deferred0_1;
@@ -4488,7 +4527,12 @@ module.exports.__wbg_get_e4ef7322d68ab383 = function () {
4488
4527
  }, arguments);
4489
4528
  };
4490
4529
 
4491
- module.exports.__wbg_getaccesstoken_9cbe5828ab38b4c1 = function (arg0) {
4530
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4531
+ const ret = getObject(arg0)[arg1 >>> 0];
4532
+ return addHeapObject(ret);
4533
+ };
4534
+
4535
+ module.exports.__wbg_getaccesstoken_9240256d891025b6 = function (arg0) {
4492
4536
  const ret = getObject(arg0).get_access_token();
4493
4537
  return addHeapObject(ret);
4494
4538
  };
@@ -4673,14 +4717,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
4673
4717
  return ret;
4674
4718
  };
4675
4719
 
4676
- module.exports.__wbg_list_562f9b41c2eddcc7 = function () {
4720
+ module.exports.__wbg_list_005a77213c99fcd3 = function () {
4677
4721
  return handleError(function (arg0) {
4678
4722
  const ret = getObject(arg0).list();
4679
4723
  return addHeapObject(ret);
4680
4724
  }, arguments);
4681
4725
  };
4682
4726
 
4683
- module.exports.__wbg_list_8619d74e75f24d17 = function () {
4727
+ module.exports.__wbg_list_b0cae842e3a13e2c = function () {
4684
4728
  return handleError(function (arg0) {
4685
4729
  const ret = getObject(arg0).list();
4686
4730
  return addHeapObject(ret);
@@ -4723,7 +4767,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
4723
4767
  const a = state0.a;
4724
4768
  state0.a = 0;
4725
4769
  try {
4726
- return __wbg_adapter_355(a, state0.b, arg0, arg1);
4770
+ return __wbg_adapter_357(a, state0.b, arg0, arg1);
4727
4771
  } finally {
4728
4772
  state0.a = a;
4729
4773
  }
@@ -4886,7 +4930,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
4886
4930
  }, arguments);
4887
4931
  };
4888
4932
 
4889
- module.exports.__wbg_remove_b7ea90f3b7133fcb = function () {
4933
+ module.exports.__wbg_remove_4817686ccc51caea = function () {
4890
4934
  return handleError(function (arg0, arg1, arg2) {
4891
4935
  let deferred0_0;
4892
4936
  let deferred0_1;
@@ -4901,7 +4945,7 @@ module.exports.__wbg_remove_b7ea90f3b7133fcb = function () {
4901
4945
  }, arguments);
4902
4946
  };
4903
4947
 
4904
- module.exports.__wbg_remove_d3f3781a0f03446c = function () {
4948
+ module.exports.__wbg_remove_d197cb44124071d6 = function () {
4905
4949
  return handleError(function (arg0, arg1, arg2) {
4906
4950
  let deferred0_0;
4907
4951
  let deferred0_1;
@@ -4955,11 +4999,7 @@ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
4955
4999
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4956
5000
  };
4957
5001
 
4958
- module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4959
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4960
- };
4961
-
4962
- module.exports.__wbg_set_7f067b933dc18d3c = function () {
5002
+ module.exports.__wbg_set_595fa1ff8502ba96 = function () {
4963
5003
  return handleError(function (arg0, arg1, arg2, arg3) {
4964
5004
  let deferred0_0;
4965
5005
  let deferred0_1;
@@ -4974,12 +5014,11 @@ module.exports.__wbg_set_7f067b933dc18d3c = function () {
4974
5014
  }, arguments);
4975
5015
  };
4976
5016
 
4977
- module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4978
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
4979
- return addHeapObject(ret);
5017
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
5018
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4980
5019
  };
4981
5020
 
4982
- module.exports.__wbg_set_99d30132201b391d = function () {
5021
+ module.exports.__wbg_set_66f7f1ab8b1b0899 = function () {
4983
5022
  return handleError(function (arg0, arg1, arg2, arg3) {
4984
5023
  let deferred0_0;
4985
5024
  let deferred0_1;
@@ -4994,6 +5033,11 @@ module.exports.__wbg_set_99d30132201b391d = function () {
4994
5033
  }, arguments);
4995
5034
  };
4996
5035
 
5036
+ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
5037
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
5038
+ return addHeapObject(ret);
5039
+ };
5040
+
4997
5041
  module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
4998
5042
  getObject(arg0).body = getObject(arg1);
4999
5043
  };
@@ -5219,17 +5263,17 @@ module.exports.__wbindgen_closure_wrapper198 = function (arg0, arg1, arg2) {
5219
5263
  return addHeapObject(ret);
5220
5264
  };
5221
5265
 
5222
- module.exports.__wbindgen_closure_wrapper4273 = function (arg0, arg1, arg2) {
5266
+ module.exports.__wbindgen_closure_wrapper4523 = function (arg0, arg1, arg2) {
5223
5267
  const ret = makeMutClosure(arg0, arg1, 349, __wbg_adapter_60);
5224
5268
  return addHeapObject(ret);
5225
5269
  };
5226
5270
 
5227
- module.exports.__wbindgen_closure_wrapper8249 = function (arg0, arg1, arg2) {
5271
+ module.exports.__wbindgen_closure_wrapper8581 = function (arg0, arg1, arg2) {
5228
5272
  const ret = makeMutClosure(arg0, arg1, 516, __wbg_adapter_60);
5229
5273
  return addHeapObject(ret);
5230
5274
  };
5231
5275
 
5232
- module.exports.__wbindgen_closure_wrapper8632 = function (arg0, arg1, arg2) {
5276
+ module.exports.__wbindgen_closure_wrapper8967 = function (arg0, arg1, arg2) {
5233
5277
  const ret = makeMutClosure(arg0, arg1, 538, __wbg_adapter_57);
5234
5278
  return addHeapObject(ret);
5235
5279
  };
@@ -325,6 +325,22 @@ export const attachmentsclient_decrypt_buffer: (
325
325
  ) => void;
326
326
  export const ciphersclient_create: (a: number, b: number) => number;
327
327
  export const ciphersclient_edit: (a: number, b: number) => number;
328
+ export const ciphersclient_share_cipher: (
329
+ a: number,
330
+ b: number,
331
+ c: number,
332
+ d: number,
333
+ e: number,
334
+ f: number,
335
+ ) => number;
336
+ export const ciphersclient_share_ciphers_bulk: (
337
+ a: number,
338
+ b: number,
339
+ c: number,
340
+ d: number,
341
+ e: number,
342
+ f: number,
343
+ ) => number;
328
344
  export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
329
345
  export const ciphersclient_encrypt_cipher_for_rotation: (
330
346
  a: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/commercial-sdk-internal",
3
- "version": "0.2.0-main.371",
3
+ "version": "0.2.0-main.372",
4
4
  "license": "BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT",
5
5
  "repository": {
6
6
  "type": "git",