@bitwarden/sdk-internal 0.2.0-main.371 → 0.2.0-main.373

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
  }
@@ -1918,6 +1923,24 @@ export class CiphersClient {
1918
1923
  * Edit an existing [Cipher] and save it to the server.
1919
1924
  */
1920
1925
  edit(request: CipherEditRequest): Promise<CipherView>;
1926
+ /**
1927
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1928
+ */
1929
+ share_cipher(
1930
+ cipher_view: CipherView,
1931
+ organization_id: OrganizationId,
1932
+ collection_ids: CollectionId[],
1933
+ original_cipher?: Cipher | null,
1934
+ ): Promise<Cipher>;
1935
+ /**
1936
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1937
+ * share_ciphers API.
1938
+ */
1939
+ share_ciphers_bulk(
1940
+ cipher_views: CipherView[],
1941
+ organization_id: OrganizationId,
1942
+ collection_ids: CollectionId[],
1943
+ ): Promise<Cipher[]>;
1921
1944
  encrypt(cipher_view: CipherView): EncryptionContext;
1922
1945
  /**
1923
1946
  * 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_353(arg0, arg1, arg2, arg3) {
903
+ function __wbg_adapter_355(arg0, arg1, arg2, arg3) {
904
904
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h849ee2a9e4ae2f91(
905
905
  arg0,
906
906
  arg1,
@@ -1462,6 +1462,50 @@ class CiphersClient {
1462
1462
  const ret = wasm.ciphersclient_edit(this.__wbg_ptr, addHeapObject(request));
1463
1463
  return takeObject(ret);
1464
1464
  }
1465
+ /**
1466
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1467
+ * @param {CipherView} cipher_view
1468
+ * @param {OrganizationId} organization_id
1469
+ * @param {CollectionId[]} collection_ids
1470
+ * @param {Cipher | null} [original_cipher]
1471
+ * @returns {Promise<Cipher>}
1472
+ */
1473
+ share_cipher(cipher_view, organization_id, collection_ids, original_cipher) {
1474
+ const ptr0 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1475
+ const len0 = WASM_VECTOR_LEN;
1476
+ const ret = wasm.ciphersclient_share_cipher(
1477
+ this.__wbg_ptr,
1478
+ addHeapObject(cipher_view),
1479
+ addHeapObject(organization_id),
1480
+ ptr0,
1481
+ len0,
1482
+ isLikeNone(original_cipher) ? 0 : addHeapObject(original_cipher),
1483
+ );
1484
+ return takeObject(ret);
1485
+ }
1486
+ /**
1487
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1488
+ * share_ciphers API.
1489
+ * @param {CipherView[]} cipher_views
1490
+ * @param {OrganizationId} organization_id
1491
+ * @param {CollectionId[]} collection_ids
1492
+ * @returns {Promise<Cipher[]>}
1493
+ */
1494
+ share_ciphers_bulk(cipher_views, organization_id, collection_ids) {
1495
+ const ptr0 = passArrayJsValueToWasm0(cipher_views, wasm.__wbindgen_malloc);
1496
+ const len0 = WASM_VECTOR_LEN;
1497
+ const ptr1 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1498
+ const len1 = WASM_VECTOR_LEN;
1499
+ const ret = wasm.ciphersclient_share_ciphers_bulk(
1500
+ this.__wbg_ptr,
1501
+ ptr0,
1502
+ len0,
1503
+ addHeapObject(organization_id),
1504
+ ptr1,
1505
+ len1,
1506
+ );
1507
+ return takeObject(ret);
1508
+ }
1465
1509
  /**
1466
1510
  * @param {CipherView} cipher_view
1467
1511
  * @returns {EncryptionContext}
@@ -4263,7 +4307,7 @@ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
4263
4307
  }, arguments);
4264
4308
  };
4265
4309
 
4266
- module.exports.__wbg_cipher_6d4b0329aa713e6f = function (arg0) {
4310
+ module.exports.__wbg_cipher_a27a94359315cc93 = function (arg0) {
4267
4311
  const ret = getObject(arg0).cipher;
4268
4312
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4269
4313
  };
@@ -4343,7 +4387,7 @@ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
4343
4387
  return addHeapObject(ret);
4344
4388
  };
4345
4389
 
4346
- module.exports.__wbg_folder_f0f5221fba71a8d6 = function (arg0) {
4390
+ module.exports.__wbg_folder_ff53d2d4dc2faf85 = function (arg0) {
4347
4391
  const ret = getObject(arg0).folder;
4348
4392
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4349
4393
  };
@@ -4370,7 +4414,7 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
4370
4414
  return ret;
4371
4415
  };
4372
4416
 
4373
- module.exports.__wbg_get_61df30619186fd87 = function () {
4417
+ module.exports.__wbg_get_669deafd63743335 = function () {
4374
4418
  return handleError(function (arg0, arg1, arg2) {
4375
4419
  let deferred0_0;
4376
4420
  let deferred0_1;
@@ -4392,12 +4436,7 @@ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
4392
4436
  }, arguments);
4393
4437
  };
4394
4438
 
4395
- module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4396
- const ret = getObject(arg0)[arg1 >>> 0];
4397
- return addHeapObject(ret);
4398
- };
4399
-
4400
- module.exports.__wbg_get_e4ef7322d68ab383 = function () {
4439
+ module.exports.__wbg_get_ab004b7c5fd98da4 = function () {
4401
4440
  return handleError(function (arg0, arg1, arg2) {
4402
4441
  let deferred0_0;
4403
4442
  let deferred0_1;
@@ -4412,7 +4451,12 @@ module.exports.__wbg_get_e4ef7322d68ab383 = function () {
4412
4451
  }, arguments);
4413
4452
  };
4414
4453
 
4415
- module.exports.__wbg_getaccesstoken_9cbe5828ab38b4c1 = function (arg0) {
4454
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
4455
+ const ret = getObject(arg0)[arg1 >>> 0];
4456
+ return addHeapObject(ret);
4457
+ };
4458
+
4459
+ module.exports.__wbg_getaccesstoken_005ebb39d33faf4d = function (arg0) {
4416
4460
  const ret = getObject(arg0).get_access_token();
4417
4461
  return addHeapObject(ret);
4418
4462
  };
@@ -4597,14 +4641,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
4597
4641
  return ret;
4598
4642
  };
4599
4643
 
4600
- module.exports.__wbg_list_562f9b41c2eddcc7 = function () {
4644
+ module.exports.__wbg_list_8a771eed93888b5d = function () {
4601
4645
  return handleError(function (arg0) {
4602
4646
  const ret = getObject(arg0).list();
4603
4647
  return addHeapObject(ret);
4604
4648
  }, arguments);
4605
4649
  };
4606
4650
 
4607
- module.exports.__wbg_list_8619d74e75f24d17 = function () {
4651
+ module.exports.__wbg_list_97f0fbb3cdf20313 = function () {
4608
4652
  return handleError(function (arg0) {
4609
4653
  const ret = getObject(arg0).list();
4610
4654
  return addHeapObject(ret);
@@ -4647,7 +4691,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
4647
4691
  const a = state0.a;
4648
4692
  state0.a = 0;
4649
4693
  try {
4650
- return __wbg_adapter_353(a, state0.b, arg0, arg1);
4694
+ return __wbg_adapter_355(a, state0.b, arg0, arg1);
4651
4695
  } finally {
4652
4696
  state0.a = a;
4653
4697
  }
@@ -4810,7 +4854,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
4810
4854
  }, arguments);
4811
4855
  };
4812
4856
 
4813
- module.exports.__wbg_remove_b7ea90f3b7133fcb = function () {
4857
+ module.exports.__wbg_remove_956f7c593f896a01 = function () {
4814
4858
  return handleError(function (arg0, arg1, arg2) {
4815
4859
  let deferred0_0;
4816
4860
  let deferred0_1;
@@ -4825,7 +4869,7 @@ module.exports.__wbg_remove_b7ea90f3b7133fcb = function () {
4825
4869
  }, arguments);
4826
4870
  };
4827
4871
 
4828
- module.exports.__wbg_remove_d3f3781a0f03446c = function () {
4872
+ module.exports.__wbg_remove_e3a32c8e47e778c1 = function () {
4829
4873
  return handleError(function (arg0, arg1, arg2) {
4830
4874
  let deferred0_0;
4831
4875
  let deferred0_1;
@@ -4883,7 +4927,7 @@ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4883
4927
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4884
4928
  };
4885
4929
 
4886
- module.exports.__wbg_set_7f067b933dc18d3c = function () {
4930
+ module.exports.__wbg_set_89104a657df0b114 = function () {
4887
4931
  return handleError(function (arg0, arg1, arg2, arg3) {
4888
4932
  let deferred0_0;
4889
4933
  let deferred0_1;
@@ -4903,7 +4947,7 @@ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4903
4947
  return addHeapObject(ret);
4904
4948
  };
4905
4949
 
4906
- module.exports.__wbg_set_99d30132201b391d = function () {
4950
+ module.exports.__wbg_set_d46a2477f493c1aa = function () {
4907
4951
  return handleError(function (arg0, arg1, arg2, arg3) {
4908
4952
  let deferred0_0;
4909
4953
  let deferred0_1;
@@ -5143,17 +5187,17 @@ module.exports.__wbindgen_closure_wrapper200 = function (arg0, arg1, arg2) {
5143
5187
  return addHeapObject(ret);
5144
5188
  };
5145
5189
 
5146
- module.exports.__wbindgen_closure_wrapper4262 = function (arg0, arg1, arg2) {
5190
+ module.exports.__wbindgen_closure_wrapper4512 = function (arg0, arg1, arg2) {
5147
5191
  const ret = makeMutClosure(arg0, arg1, 349, __wbg_adapter_60);
5148
5192
  return addHeapObject(ret);
5149
5193
  };
5150
5194
 
5151
- module.exports.__wbindgen_closure_wrapper8237 = function (arg0, arg1, arg2) {
5195
+ module.exports.__wbindgen_closure_wrapper8569 = function (arg0, arg1, arg2) {
5152
5196
  const ret = makeMutClosure(arg0, arg1, 516, __wbg_adapter_60);
5153
5197
  return addHeapObject(ret);
5154
5198
  };
5155
5199
 
5156
- module.exports.__wbindgen_closure_wrapper8620 = function (arg0, arg1, arg2) {
5200
+ module.exports.__wbindgen_closure_wrapper8955 = function (arg0, arg1, arg2) {
5157
5201
  const ret = makeMutClosure(arg0, arg1, 538, __wbg_adapter_54);
5158
5202
  return addHeapObject(ret);
5159
5203
  };
@@ -321,6 +321,22 @@ export const attachmentsclient_decrypt_buffer: (
321
321
  ) => void;
322
322
  export const ciphersclient_create: (a: number, b: number) => number;
323
323
  export const ciphersclient_edit: (a: number, b: number) => number;
324
+ export const ciphersclient_share_cipher: (
325
+ a: number,
326
+ b: number,
327
+ c: number,
328
+ d: number,
329
+ e: number,
330
+ f: number,
331
+ ) => number;
332
+ export const ciphersclient_share_ciphers_bulk: (
333
+ a: number,
334
+ b: number,
335
+ c: number,
336
+ d: number,
337
+ e: number,
338
+ f: number,
339
+ ) => number;
324
340
  export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
325
341
  export const ciphersclient_encrypt_cipher_for_rotation: (
326
342
  a: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.371",
3
+ "version": "0.2.0-main.373",
4
4
  "license": "GPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",