@bitwarden/commercial-sdk-internal 0.2.0-main.370 → 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
@@ -906,7 +906,7 @@ function __wbg_adapter_60(arg0, arg1) {
906
906
  );
907
907
  }
908
908
 
909
- function __wbg_adapter_355(arg0, arg1, arg2, arg3) {
909
+ function __wbg_adapter_357(arg0, arg1, arg2, arg3) {
910
910
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h849ee2a9e4ae2f91(
911
911
  arg0,
912
912
  arg1,
@@ -1472,6 +1472,50 @@ export class CiphersClient {
1472
1472
  const ret = wasm.ciphersclient_edit(this.__wbg_ptr, addHeapObject(request));
1473
1473
  return takeObject(ret);
1474
1474
  }
1475
+ /**
1476
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1477
+ * @param {CipherView} cipher_view
1478
+ * @param {OrganizationId} organization_id
1479
+ * @param {CollectionId[]} collection_ids
1480
+ * @param {Cipher | null} [original_cipher]
1481
+ * @returns {Promise<Cipher>}
1482
+ */
1483
+ share_cipher(cipher_view, organization_id, collection_ids, original_cipher) {
1484
+ const ptr0 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1485
+ const len0 = WASM_VECTOR_LEN;
1486
+ const ret = wasm.ciphersclient_share_cipher(
1487
+ this.__wbg_ptr,
1488
+ addHeapObject(cipher_view),
1489
+ addHeapObject(organization_id),
1490
+ ptr0,
1491
+ len0,
1492
+ isLikeNone(original_cipher) ? 0 : addHeapObject(original_cipher),
1493
+ );
1494
+ return takeObject(ret);
1495
+ }
1496
+ /**
1497
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1498
+ * share_ciphers API.
1499
+ * @param {CipherView[]} cipher_views
1500
+ * @param {OrganizationId} organization_id
1501
+ * @param {CollectionId[]} collection_ids
1502
+ * @returns {Promise<Cipher[]>}
1503
+ */
1504
+ share_ciphers_bulk(cipher_views, organization_id, collection_ids) {
1505
+ const ptr0 = passArrayJsValueToWasm0(cipher_views, wasm.__wbindgen_malloc);
1506
+ const len0 = WASM_VECTOR_LEN;
1507
+ const ptr1 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1508
+ const len1 = WASM_VECTOR_LEN;
1509
+ const ret = wasm.ciphersclient_share_ciphers_bulk(
1510
+ this.__wbg_ptr,
1511
+ ptr0,
1512
+ len0,
1513
+ addHeapObject(organization_id),
1514
+ ptr1,
1515
+ len1,
1516
+ );
1517
+ return takeObject(ret);
1518
+ }
1475
1519
  /**
1476
1520
  * @param {CipherView} cipher_view
1477
1521
  * @returns {EncryptionContext}
@@ -4319,7 +4363,7 @@ export function __wbg_call_7cccdd69e0791ae2() {
4319
4363
  }, arguments);
4320
4364
  }
4321
4365
 
4322
- export function __wbg_cipher_b9bba3bed549c7a1(arg0) {
4366
+ export function __wbg_cipher_8a6269e122b390ae(arg0) {
4323
4367
  const ret = getObject(arg0).cipher;
4324
4368
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4325
4369
  }
@@ -4399,7 +4443,7 @@ export function __wbg_fetch_509096533071c657(arg0, arg1) {
4399
4443
  return addHeapObject(ret);
4400
4444
  }
4401
4445
 
4402
- export function __wbg_folder_2e8e018716a86b20(arg0) {
4446
+ export function __wbg_folder_6dfae1b1134b74f8(arg0) {
4403
4447
  const ret = getObject(arg0).folder;
4404
4448
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4405
4449
  }
@@ -4426,7 +4470,14 @@ export function __wbg_getTime_46267b1c24877e30(arg0) {
4426
4470
  return ret;
4427
4471
  }
4428
4472
 
4429
- export function __wbg_get_06a7c389d73976e4() {
4473
+ export function __wbg_get_67b2ba62fc30de12() {
4474
+ return handleError(function (arg0, arg1) {
4475
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4476
+ return addHeapObject(ret);
4477
+ }, arguments);
4478
+ }
4479
+
4480
+ export function __wbg_get_77a3546428c7fc7d() {
4430
4481
  return handleError(function (arg0, arg1, arg2) {
4431
4482
  let deferred0_0;
4432
4483
  let deferred0_1;
@@ -4441,7 +4492,7 @@ export function __wbg_get_06a7c389d73976e4() {
4441
4492
  }, arguments);
4442
4493
  }
4443
4494
 
4444
- export function __wbg_get_0d53d8bad034f847() {
4495
+ export function __wbg_get_94e67783f37c82cd() {
4445
4496
  return handleError(function (arg0, arg1, arg2) {
4446
4497
  let deferred0_0;
4447
4498
  let deferred0_1;
@@ -4456,19 +4507,12 @@ export function __wbg_get_0d53d8bad034f847() {
4456
4507
  }, arguments);
4457
4508
  }
4458
4509
 
4459
- export function __wbg_get_67b2ba62fc30de12() {
4460
- return handleError(function (arg0, arg1) {
4461
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4462
- return addHeapObject(ret);
4463
- }, arguments);
4464
- }
4465
-
4466
4510
  export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
4467
4511
  const ret = getObject(arg0)[arg1 >>> 0];
4468
4512
  return addHeapObject(ret);
4469
4513
  }
4470
4514
 
4471
- export function __wbg_getaccesstoken_3a9776f32a1130a3(arg0) {
4515
+ export function __wbg_getaccesstoken_9240256d891025b6(arg0) {
4472
4516
  const ret = getObject(arg0).get_access_token();
4473
4517
  return addHeapObject(ret);
4474
4518
  }
@@ -4653,14 +4697,14 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
4653
4697
  return ret;
4654
4698
  }
4655
4699
 
4656
- export function __wbg_list_6fcd7aa4f49b230e() {
4700
+ export function __wbg_list_005a77213c99fcd3() {
4657
4701
  return handleError(function (arg0) {
4658
4702
  const ret = getObject(arg0).list();
4659
4703
  return addHeapObject(ret);
4660
4704
  }, arguments);
4661
4705
  }
4662
4706
 
4663
- export function __wbg_list_b8eb4a9fd04e8583() {
4707
+ export function __wbg_list_b0cae842e3a13e2c() {
4664
4708
  return handleError(function (arg0) {
4665
4709
  const ret = getObject(arg0).list();
4666
4710
  return addHeapObject(ret);
@@ -4703,7 +4747,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
4703
4747
  const a = state0.a;
4704
4748
  state0.a = 0;
4705
4749
  try {
4706
- return __wbg_adapter_355(a, state0.b, arg0, arg1);
4750
+ return __wbg_adapter_357(a, state0.b, arg0, arg1);
4707
4751
  } finally {
4708
4752
  state0.a = a;
4709
4753
  }
@@ -4866,7 +4910,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
4866
4910
  }, arguments);
4867
4911
  }
4868
4912
 
4869
- export function __wbg_remove_b61892357ced7e0d() {
4913
+ export function __wbg_remove_4817686ccc51caea() {
4870
4914
  return handleError(function (arg0, arg1, arg2) {
4871
4915
  let deferred0_0;
4872
4916
  let deferred0_1;
@@ -4881,7 +4925,7 @@ export function __wbg_remove_b61892357ced7e0d() {
4881
4925
  }, arguments);
4882
4926
  }
4883
4927
 
4884
- export function __wbg_remove_d38612e2e58a9e8f() {
4928
+ export function __wbg_remove_d197cb44124071d6() {
4885
4929
  return handleError(function (arg0, arg1, arg2) {
4886
4930
  let deferred0_0;
4887
4931
  let deferred0_1;
@@ -4927,7 +4971,15 @@ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
4927
4971
  return addHeapObject(ret);
4928
4972
  }
4929
4973
 
4930
- export function __wbg_set_21a2ed8a70365e91() {
4974
+ export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
4975
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4976
+ }
4977
+
4978
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
4979
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4980
+ }
4981
+
4982
+ export function __wbg_set_595fa1ff8502ba96() {
4931
4983
  return handleError(function (arg0, arg1, arg2, arg3) {
4932
4984
  let deferred0_0;
4933
4985
  let deferred0_1;
@@ -4942,19 +4994,11 @@ export function __wbg_set_21a2ed8a70365e91() {
4942
4994
  }, arguments);
4943
4995
  }
4944
4996
 
4945
- export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
4946
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4947
- }
4948
-
4949
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
4950
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4951
- }
4952
-
4953
4997
  export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
4954
4998
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4955
4999
  }
4956
5000
 
4957
- export function __wbg_set_8e9c610c5c900fb3() {
5001
+ export function __wbg_set_66f7f1ab8b1b0899() {
4958
5002
  return handleError(function (arg0, arg1, arg2, arg3) {
4959
5003
  let deferred0_0;
4960
5004
  let deferred0_1;
@@ -5199,17 +5243,17 @@ export function __wbindgen_closure_wrapper198(arg0, arg1, arg2) {
5199
5243
  return addHeapObject(ret);
5200
5244
  }
5201
5245
 
5202
- export function __wbindgen_closure_wrapper4273(arg0, arg1, arg2) {
5246
+ export function __wbindgen_closure_wrapper4523(arg0, arg1, arg2) {
5203
5247
  const ret = makeMutClosure(arg0, arg1, 349, __wbg_adapter_60);
5204
5248
  return addHeapObject(ret);
5205
5249
  }
5206
5250
 
5207
- export function __wbindgen_closure_wrapper8249(arg0, arg1, arg2) {
5251
+ export function __wbindgen_closure_wrapper8581(arg0, arg1, arg2) {
5208
5252
  const ret = makeMutClosure(arg0, arg1, 516, __wbg_adapter_60);
5209
5253
  return addHeapObject(ret);
5210
5254
  }
5211
5255
 
5212
- export function __wbindgen_closure_wrapper8632(arg0, arg1, arg2) {
5256
+ export function __wbindgen_closure_wrapper8967(arg0, arg1, arg2) {
5213
5257
  const ret = makeMutClosure(arg0, arg1, 538, __wbg_adapter_57);
5214
5258
  return addHeapObject(ret);
5215
5259
  }
Binary file
@@ -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,