@bitwarden/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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- a36a8efc38331088705791faf9248362d821ef42
1
+ a3665fd60b34fa25255b2d05144e414c4f74587d
@@ -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
@@ -906,7 +906,7 @@ function __wbg_adapter_60(arg0, arg1) {
906
906
  );
907
907
  }
908
908
 
909
- function __wbg_adapter_353(arg0, arg1, arg2, arg3) {
909
+ function __wbg_adapter_355(arg0, arg1, arg2, arg3) {
910
910
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h849ee2a9e4ae2f91(
911
911
  arg0,
912
912
  arg1,
@@ -1464,6 +1464,50 @@ export class CiphersClient {
1464
1464
  const ret = wasm.ciphersclient_edit(this.__wbg_ptr, addHeapObject(request));
1465
1465
  return takeObject(ret);
1466
1466
  }
1467
+ /**
1468
+ * Moves a cipher into an organization, adds it to collections, and calls the share_cipher API.
1469
+ * @param {CipherView} cipher_view
1470
+ * @param {OrganizationId} organization_id
1471
+ * @param {CollectionId[]} collection_ids
1472
+ * @param {Cipher | null} [original_cipher]
1473
+ * @returns {Promise<Cipher>}
1474
+ */
1475
+ share_cipher(cipher_view, organization_id, collection_ids, original_cipher) {
1476
+ const ptr0 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1477
+ const len0 = WASM_VECTOR_LEN;
1478
+ const ret = wasm.ciphersclient_share_cipher(
1479
+ this.__wbg_ptr,
1480
+ addHeapObject(cipher_view),
1481
+ addHeapObject(organization_id),
1482
+ ptr0,
1483
+ len0,
1484
+ isLikeNone(original_cipher) ? 0 : addHeapObject(original_cipher),
1485
+ );
1486
+ return takeObject(ret);
1487
+ }
1488
+ /**
1489
+ * Moves a group of ciphers into an organization, adds them to collections, and calls the
1490
+ * share_ciphers API.
1491
+ * @param {CipherView[]} cipher_views
1492
+ * @param {OrganizationId} organization_id
1493
+ * @param {CollectionId[]} collection_ids
1494
+ * @returns {Promise<Cipher[]>}
1495
+ */
1496
+ share_ciphers_bulk(cipher_views, organization_id, collection_ids) {
1497
+ const ptr0 = passArrayJsValueToWasm0(cipher_views, wasm.__wbindgen_malloc);
1498
+ const len0 = WASM_VECTOR_LEN;
1499
+ const ptr1 = passArrayJsValueToWasm0(collection_ids, wasm.__wbindgen_malloc);
1500
+ const len1 = WASM_VECTOR_LEN;
1501
+ const ret = wasm.ciphersclient_share_ciphers_bulk(
1502
+ this.__wbg_ptr,
1503
+ ptr0,
1504
+ len0,
1505
+ addHeapObject(organization_id),
1506
+ ptr1,
1507
+ len1,
1508
+ );
1509
+ return takeObject(ret);
1510
+ }
1467
1511
  /**
1468
1512
  * @param {CipherView} cipher_view
1469
1513
  * @returns {EncryptionContext}
@@ -4245,7 +4289,7 @@ export function __wbg_call_7cccdd69e0791ae2() {
4245
4289
  }, arguments);
4246
4290
  }
4247
4291
 
4248
- export function __wbg_cipher_b9bba3bed549c7a1(arg0) {
4292
+ export function __wbg_cipher_8a6269e122b390ae(arg0) {
4249
4293
  const ret = getObject(arg0).cipher;
4250
4294
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4251
4295
  }
@@ -4325,7 +4369,7 @@ export function __wbg_fetch_509096533071c657(arg0, arg1) {
4325
4369
  return addHeapObject(ret);
4326
4370
  }
4327
4371
 
4328
- export function __wbg_folder_2e8e018716a86b20(arg0) {
4372
+ export function __wbg_folder_6dfae1b1134b74f8(arg0) {
4329
4373
  const ret = getObject(arg0).folder;
4330
4374
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4331
4375
  }
@@ -4352,7 +4396,14 @@ export function __wbg_getTime_46267b1c24877e30(arg0) {
4352
4396
  return ret;
4353
4397
  }
4354
4398
 
4355
- export function __wbg_get_06a7c389d73976e4() {
4399
+ export function __wbg_get_67b2ba62fc30de12() {
4400
+ return handleError(function (arg0, arg1) {
4401
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4402
+ return addHeapObject(ret);
4403
+ }, arguments);
4404
+ }
4405
+
4406
+ export function __wbg_get_77a3546428c7fc7d() {
4356
4407
  return handleError(function (arg0, arg1, arg2) {
4357
4408
  let deferred0_0;
4358
4409
  let deferred0_1;
@@ -4367,7 +4418,7 @@ export function __wbg_get_06a7c389d73976e4() {
4367
4418
  }, arguments);
4368
4419
  }
4369
4420
 
4370
- export function __wbg_get_0d53d8bad034f847() {
4421
+ export function __wbg_get_94e67783f37c82cd() {
4371
4422
  return handleError(function (arg0, arg1, arg2) {
4372
4423
  let deferred0_0;
4373
4424
  let deferred0_1;
@@ -4382,19 +4433,12 @@ export function __wbg_get_0d53d8bad034f847() {
4382
4433
  }, arguments);
4383
4434
  }
4384
4435
 
4385
- export function __wbg_get_67b2ba62fc30de12() {
4386
- return handleError(function (arg0, arg1) {
4387
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4388
- return addHeapObject(ret);
4389
- }, arguments);
4390
- }
4391
-
4392
4436
  export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
4393
4437
  const ret = getObject(arg0)[arg1 >>> 0];
4394
4438
  return addHeapObject(ret);
4395
4439
  }
4396
4440
 
4397
- export function __wbg_getaccesstoken_3a9776f32a1130a3(arg0) {
4441
+ export function __wbg_getaccesstoken_9240256d891025b6(arg0) {
4398
4442
  const ret = getObject(arg0).get_access_token();
4399
4443
  return addHeapObject(ret);
4400
4444
  }
@@ -4579,14 +4623,14 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
4579
4623
  return ret;
4580
4624
  }
4581
4625
 
4582
- export function __wbg_list_6fcd7aa4f49b230e() {
4626
+ export function __wbg_list_005a77213c99fcd3() {
4583
4627
  return handleError(function (arg0) {
4584
4628
  const ret = getObject(arg0).list();
4585
4629
  return addHeapObject(ret);
4586
4630
  }, arguments);
4587
4631
  }
4588
4632
 
4589
- export function __wbg_list_b8eb4a9fd04e8583() {
4633
+ export function __wbg_list_b0cae842e3a13e2c() {
4590
4634
  return handleError(function (arg0) {
4591
4635
  const ret = getObject(arg0).list();
4592
4636
  return addHeapObject(ret);
@@ -4629,7 +4673,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
4629
4673
  const a = state0.a;
4630
4674
  state0.a = 0;
4631
4675
  try {
4632
- return __wbg_adapter_353(a, state0.b, arg0, arg1);
4676
+ return __wbg_adapter_355(a, state0.b, arg0, arg1);
4633
4677
  } finally {
4634
4678
  state0.a = a;
4635
4679
  }
@@ -4792,7 +4836,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
4792
4836
  }, arguments);
4793
4837
  }
4794
4838
 
4795
- export function __wbg_remove_b61892357ced7e0d() {
4839
+ export function __wbg_remove_4817686ccc51caea() {
4796
4840
  return handleError(function (arg0, arg1, arg2) {
4797
4841
  let deferred0_0;
4798
4842
  let deferred0_1;
@@ -4807,7 +4851,7 @@ export function __wbg_remove_b61892357ced7e0d() {
4807
4851
  }, arguments);
4808
4852
  }
4809
4853
 
4810
- export function __wbg_remove_d38612e2e58a9e8f() {
4854
+ export function __wbg_remove_d197cb44124071d6() {
4811
4855
  return handleError(function (arg0, arg1, arg2) {
4812
4856
  let deferred0_0;
4813
4857
  let deferred0_1;
@@ -4853,7 +4897,15 @@ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
4853
4897
  return addHeapObject(ret);
4854
4898
  }
4855
4899
 
4856
- export function __wbg_set_21a2ed8a70365e91() {
4900
+ export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
4901
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4902
+ }
4903
+
4904
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
4905
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4906
+ }
4907
+
4908
+ export function __wbg_set_595fa1ff8502ba96() {
4857
4909
  return handleError(function (arg0, arg1, arg2, arg3) {
4858
4910
  let deferred0_0;
4859
4911
  let deferred0_1;
@@ -4868,19 +4920,11 @@ export function __wbg_set_21a2ed8a70365e91() {
4868
4920
  }, arguments);
4869
4921
  }
4870
4922
 
4871
- export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
4872
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
4873
- }
4874
-
4875
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
4876
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4877
- }
4878
-
4879
4923
  export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
4880
4924
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4881
4925
  }
4882
4926
 
4883
- export function __wbg_set_8e9c610c5c900fb3() {
4927
+ export function __wbg_set_66f7f1ab8b1b0899() {
4884
4928
  return handleError(function (arg0, arg1, arg2, arg3) {
4885
4929
  let deferred0_0;
4886
4930
  let deferred0_1;
@@ -5125,17 +5169,17 @@ export function __wbindgen_closure_wrapper200(arg0, arg1, arg2) {
5125
5169
  return addHeapObject(ret);
5126
5170
  }
5127
5171
 
5128
- export function __wbindgen_closure_wrapper4262(arg0, arg1, arg2) {
5172
+ export function __wbindgen_closure_wrapper4512(arg0, arg1, arg2) {
5129
5173
  const ret = makeMutClosure(arg0, arg1, 349, __wbg_adapter_60);
5130
5174
  return addHeapObject(ret);
5131
5175
  }
5132
5176
 
5133
- export function __wbindgen_closure_wrapper8237(arg0, arg1, arg2) {
5177
+ export function __wbindgen_closure_wrapper8569(arg0, arg1, arg2) {
5134
5178
  const ret = makeMutClosure(arg0, arg1, 516, __wbg_adapter_60);
5135
5179
  return addHeapObject(ret);
5136
5180
  }
5137
5181
 
5138
- export function __wbindgen_closure_wrapper8620(arg0, arg1, arg2) {
5182
+ export function __wbindgen_closure_wrapper8955(arg0, arg1, arg2) {
5139
5183
  const ret = makeMutClosure(arg0, arg1, 538, __wbg_adapter_54);
5140
5184
  return addHeapObject(ret);
5141
5185
  }
Binary file
@@ -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,