@bitwarden/sdk-internal 0.2.0-main.220 → 0.2.0-main.222

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.
@@ -290,6 +290,32 @@ export interface MakeUserSigningKeysResponse {
290
290
  signedPublicKey: SignedPublicKey;
291
291
  }
292
292
 
293
+ /**
294
+ * A rotated set of account keys for a user
295
+ */
296
+ export interface RotateUserKeysResponse {
297
+ /**
298
+ * The verifying key
299
+ */
300
+ verifyingKey: string;
301
+ /**
302
+ * Signing key, encrypted with a symmetric key (user key, org key)
303
+ */
304
+ signingKey: EncString;
305
+ /**
306
+ * The user\'s public key, signed by the signing key
307
+ */
308
+ signedPublicKey: string;
309
+ /**
310
+ * The user\'s public key, without signature
311
+ */
312
+ publicKey: string;
313
+ /**
314
+ * The user\'s private key, encrypted with the user key
315
+ */
316
+ privateKey: EncString;
317
+ }
318
+
293
319
  /**
294
320
  * NewType wrapper for `OrganizationId`
295
321
  */
@@ -809,6 +835,24 @@ export interface CipherListView {
809
835
  localData: LocalDataView | undefined;
810
836
  }
811
837
 
838
+ /**
839
+ * Represents the result of decrypting a list of ciphers.
840
+ *
841
+ * This struct contains two vectors: `successes` and `failures`.
842
+ * `successes` contains the decrypted `CipherListView` objects,
843
+ * while `failures` contains the original `Cipher` objects that failed to decrypt.
844
+ */
845
+ export interface DecryptCipherListResult {
846
+ /**
847
+ * The decrypted `CipherListView` objects.
848
+ */
849
+ successes: CipherListView[];
850
+ /**
851
+ * The original `Cipher` objects that failed to decrypt.
852
+ */
853
+ failures: Cipher[];
854
+ }
855
+
812
856
  export interface Field {
813
857
  name: EncString | undefined;
814
858
  value: EncString | undefined;
@@ -1236,6 +1280,11 @@ export class CiphersClient {
1236
1280
  encrypt(cipher_view: CipherView): EncryptionContext;
1237
1281
  decrypt(cipher: Cipher): CipherView;
1238
1282
  decrypt_list(ciphers: Cipher[]): CipherListView[];
1283
+ /**
1284
+ * Decrypt cipher list with failures
1285
+ * Returns both successfully decrypted ciphers and any that failed to decrypt
1286
+ */
1287
+ decrypt_list_with_failures(ciphers: Cipher[]): DecryptCipherListResult;
1239
1288
  decrypt_fido2_credentials(cipher_view: CipherView): Fido2CredentialView[];
1240
1289
  move_to_organization(cipher_view: CipherView, organization_id: OrganizationId): CipherView;
1241
1290
  decrypt_fido2_private_key(cipher_view: CipherView): string;
@@ -1271,6 +1320,10 @@ export class CryptoClient {
1271
1320
  * Makes a new signing key pair and signs the public key for the user
1272
1321
  */
1273
1322
  make_user_signing_keys_for_enrollment(): MakeUserSigningKeysResponse;
1323
+ /**
1324
+ * Creates a rotated set of account keys for the current state
1325
+ */
1326
+ get_v2_rotated_account_keys(user_key: string): RotateUserKeysResponse;
1274
1327
  }
1275
1328
  export class ExporterClient {
1276
1329
  private constructor();
@@ -747,7 +747,7 @@ function __wbg_adapter_56(arg0, arg1, arg2) {
747
747
  );
748
748
  }
749
749
 
750
- function __wbg_adapter_276(arg0, arg1, arg2, arg3) {
750
+ function __wbg_adapter_278(arg0, arg1, arg2, arg3) {
751
751
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
752
752
  arg0,
753
753
  arg1,
@@ -1195,6 +1195,18 @@ class CiphersClient {
1195
1195
  wasm.__wbindgen_add_to_stack_pointer(16);
1196
1196
  }
1197
1197
  }
1198
+ /**
1199
+ * Decrypt cipher list with failures
1200
+ * Returns both successfully decrypted ciphers and any that failed to decrypt
1201
+ * @param {Cipher[]} ciphers
1202
+ * @returns {DecryptCipherListResult}
1203
+ */
1204
+ decrypt_list_with_failures(ciphers) {
1205
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1206
+ const len0 = WASM_VECTOR_LEN;
1207
+ const ret = wasm.ciphersclient_decrypt_list_with_failures(this.__wbg_ptr, ptr0, len0);
1208
+ return takeObject(ret);
1209
+ }
1198
1210
  /**
1199
1211
  * @param {CipherView} cipher_view
1200
1212
  * @returns {Fido2CredentialView[]}
@@ -1393,6 +1405,28 @@ class CryptoClient {
1393
1405
  wasm.__wbindgen_add_to_stack_pointer(16);
1394
1406
  }
1395
1407
  }
1408
+ /**
1409
+ * Creates a rotated set of account keys for the current state
1410
+ * @param {string} user_key
1411
+ * @returns {RotateUserKeysResponse}
1412
+ */
1413
+ get_v2_rotated_account_keys(user_key) {
1414
+ try {
1415
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1416
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1417
+ const len0 = WASM_VECTOR_LEN;
1418
+ wasm.cryptoclient_get_v2_rotated_account_keys(retptr, this.__wbg_ptr, ptr0, len0);
1419
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1420
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1421
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1422
+ if (r2) {
1423
+ throw takeObject(r1);
1424
+ }
1425
+ return takeObject(r0);
1426
+ } finally {
1427
+ wasm.__wbindgen_add_to_stack_pointer(16);
1428
+ }
1429
+ }
1396
1430
  }
1397
1431
  module.exports.CryptoClient = CryptoClient;
1398
1432
 
@@ -3324,14 +3358,7 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
3324
3358
  return ret;
3325
3359
  };
3326
3360
 
3327
- module.exports.__wbg_get_67b2ba62fc30de12 = function () {
3328
- return handleError(function (arg0, arg1) {
3329
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
3330
- return addHeapObject(ret);
3331
- }, arguments);
3332
- };
3333
-
3334
- module.exports.__wbg_get_a3863a1264cebac2 = function () {
3361
+ module.exports.__wbg_get_19ade86a11be7465 = function () {
3335
3362
  return handleError(function (arg0, arg1, arg2) {
3336
3363
  let deferred0_0;
3337
3364
  let deferred0_1;
@@ -3346,12 +3373,19 @@ module.exports.__wbg_get_a3863a1264cebac2 = function () {
3346
3373
  }, arguments);
3347
3374
  };
3348
3375
 
3376
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
3377
+ return handleError(function (arg0, arg1) {
3378
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
3379
+ return addHeapObject(ret);
3380
+ }, arguments);
3381
+ };
3382
+
3349
3383
  module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
3350
3384
  const ret = getObject(arg0)[arg1 >>> 0];
3351
3385
  return addHeapObject(ret);
3352
3386
  };
3353
3387
 
3354
- module.exports.__wbg_getaccesstoken_136d18c86407dc71 = function (arg0) {
3388
+ module.exports.__wbg_getaccesstoken_6f28f7da38d99e02 = function (arg0) {
3355
3389
  const ret = getObject(arg0).get_access_token();
3356
3390
  return addHeapObject(ret);
3357
3391
  };
@@ -3456,7 +3490,7 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
3456
3490
  return ret;
3457
3491
  };
3458
3492
 
3459
- module.exports.__wbg_list_3165ae7a631e4388 = function () {
3493
+ module.exports.__wbg_list_405a6847e8a91187 = function () {
3460
3494
  return handleError(function (arg0) {
3461
3495
  const ret = getObject(arg0).list();
3462
3496
  return addHeapObject(ret);
@@ -3491,7 +3525,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
3491
3525
  const a = state0.a;
3492
3526
  state0.a = 0;
3493
3527
  try {
3494
- return __wbg_adapter_276(a, state0.b, arg0, arg1);
3528
+ return __wbg_adapter_278(a, state0.b, arg0, arg1);
3495
3529
  } finally {
3496
3530
  state0.a = a;
3497
3531
  }
@@ -3633,7 +3667,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
3633
3667
  }, arguments);
3634
3668
  };
3635
3669
 
3636
- module.exports.__wbg_remove_fd0081a475f8a37b = function () {
3670
+ module.exports.__wbg_remove_bb17db1971104c99 = function () {
3637
3671
  return handleError(function (arg0, arg1, arg2) {
3638
3672
  let deferred0_0;
3639
3673
  let deferred0_1;
@@ -3684,7 +3718,7 @@ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
3684
3718
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3685
3719
  };
3686
3720
 
3687
- module.exports.__wbg_set_8d6472bae5625430 = function () {
3721
+ module.exports.__wbg_set_ff21587e2212f1ae = function () {
3688
3722
  return handleError(function (arg0, arg1, arg2, arg3) {
3689
3723
  let deferred0_0;
3690
3724
  let deferred0_1;
@@ -3878,18 +3912,18 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
3878
3912
  return ret;
3879
3913
  };
3880
3914
 
3881
- module.exports.__wbindgen_closure_wrapper2853 = function (arg0, arg1, arg2) {
3882
- const ret = makeMutClosure(arg0, arg1, 913, __wbg_adapter_50);
3915
+ module.exports.__wbindgen_closure_wrapper2905 = function (arg0, arg1, arg2) {
3916
+ const ret = makeMutClosure(arg0, arg1, 919, __wbg_adapter_50);
3883
3917
  return addHeapObject(ret);
3884
3918
  };
3885
3919
 
3886
- module.exports.__wbindgen_closure_wrapper3693 = function (arg0, arg1, arg2) {
3887
- const ret = makeMutClosure(arg0, arg1, 997, __wbg_adapter_53);
3920
+ module.exports.__wbindgen_closure_wrapper3745 = function (arg0, arg1, arg2) {
3921
+ const ret = makeMutClosure(arg0, arg1, 1003, __wbg_adapter_53);
3888
3922
  return addHeapObject(ret);
3889
3923
  };
3890
3924
 
3891
- module.exports.__wbindgen_closure_wrapper4111 = function (arg0, arg1, arg2) {
3892
- const ret = makeMutClosure(arg0, arg1, 1120, __wbg_adapter_56);
3925
+ module.exports.__wbindgen_closure_wrapper4163 = function (arg0, arg1, arg2) {
3926
+ const ret = makeMutClosure(arg0, arg1, 1126, __wbg_adapter_56);
3893
3927
  return addHeapObject(ret);
3894
3928
  };
3895
3929
 
@@ -7,6 +7,12 @@ export const cryptoclient_initialize_org_crypto: (a: number, b: number) => numbe
7
7
  export const cryptoclient_make_key_pair: (a: number, b: number, c: number, d: number) => void;
8
8
  export const cryptoclient_verify_asymmetric_keys: (a: number, b: number, c: number) => void;
9
9
  export const cryptoclient_make_user_signing_keys_for_enrollment: (a: number, b: number) => void;
10
+ export const cryptoclient_get_v2_rotated_account_keys: (
11
+ a: number,
12
+ b: number,
13
+ c: number,
14
+ d: number,
15
+ ) => void;
10
16
  export const isDeriveKeyConnectorError: (a: number) => number;
11
17
  export const isEnrollAdminPasswordResetError: (a: number) => number;
12
18
  export const isCryptoClientError: (a: number) => number;
@@ -114,6 +120,7 @@ export const attachmentsclient_decrypt_buffer: (
114
120
  export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
115
121
  export const ciphersclient_decrypt: (a: number, b: number, c: number) => void;
116
122
  export const ciphersclient_decrypt_list: (a: number, b: number, c: number, d: number) => void;
123
+ export const ciphersclient_decrypt_list_with_failures: (a: number, b: number, c: number) => number;
117
124
  export const ciphersclient_decrypt_fido2_credentials: (a: number, b: number, c: number) => void;
118
125
  export const ciphersclient_move_to_organization: (
119
126
  a: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.220",
3
+ "version": "0.2.0-main.222",
4
4
  "license": "GPL-3.0",
5
5
  "files": [
6
6
  "bitwarden_wasm_internal_bg.js",