@bitwarden/sdk-internal 0.2.0-main.176 → 0.2.0-main.178

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
- c0f7f7237ee4147bf284e8853760a59e5e12cbf1
1
+ 91e3e2a0413ac153453740a7f2be78fedbaf93a7
@@ -101,6 +101,7 @@ export enum UriMatchType {
101
101
  * State used for initializing the user cryptographic state.
102
102
  */
103
103
  export interface InitUserCryptoRequest {
104
+ userId: Uuid | undefined;
104
105
  /**
105
106
  * The user\'s KDF parameters, as received from the prelogin request
106
107
  */
@@ -201,7 +202,13 @@ export interface VerifyAsymmetricKeysResponse {
201
202
 
202
203
  export interface EncryptionSettingsError extends Error {
203
204
  name: "EncryptionSettingsError";
204
- variant: "Crypto" | "InvalidBase64" | "VaultLocked" | "InvalidPrivateKey" | "MissingPrivateKey";
205
+ variant:
206
+ | "Crypto"
207
+ | "InvalidBase64"
208
+ | "VaultLocked"
209
+ | "InvalidPrivateKey"
210
+ | "MissingPrivateKey"
211
+ | "UserIdAlreadySetError";
205
212
  }
206
213
 
207
214
  export function isEncryptionSettingsError(error: any): error is EncryptionSettingsError;
@@ -503,6 +510,15 @@ export interface KeyGenerationError extends Error {
503
510
 
504
511
  export function isKeyGenerationError(error: any): error is KeyGenerationError;
505
512
 
513
+ export interface EncryptionContext {
514
+ /**
515
+ * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
516
+ * Organization-owned ciphers
517
+ */
518
+ encryptedFor: Uuid;
519
+ cipher: Cipher;
520
+ }
521
+
506
522
  export interface Cipher {
507
523
  id: Uuid | undefined;
508
524
  organizationId: Uuid | undefined;
@@ -744,7 +760,7 @@ export function isDecryptError(error: any): error is DecryptError;
744
760
 
745
761
  export interface EncryptError extends Error {
746
762
  name: "EncryptError";
747
- variant: "Crypto" | "VaultLocked";
763
+ variant: "Crypto" | "VaultLocked" | "MissingUserId";
748
764
  }
749
765
 
750
766
  export function isEncryptError(error: any): error is EncryptError;
@@ -1004,7 +1020,7 @@ export class CiphersClient {
1004
1020
  * - `Ok(Cipher)` containing the encrypted cipher
1005
1021
  * - `Err(EncryptError)` if encryption fails
1006
1022
  */
1007
- encrypt(cipher_view: CipherView): Cipher;
1023
+ encrypt(cipher_view: CipherView): EncryptionContext;
1008
1024
  /**
1009
1025
  * Decrypt cipher
1010
1026
  *
@@ -996,7 +996,7 @@ export class CiphersClient {
996
996
  * - `Ok(Cipher)` containing the encrypted cipher
997
997
  * - `Err(EncryptError)` if encryption fails
998
998
  * @param {CipherView} cipher_view
999
- * @returns {Cipher}
999
+ * @returns {EncryptionContext}
1000
1000
  */
1001
1001
  encrypt(cipher_view) {
1002
1002
  try {
@@ -3563,12 +3563,12 @@ export function __wbindgen_cb_drop(arg0) {
3563
3563
  return ret;
3564
3564
  }
3565
3565
 
3566
- export function __wbindgen_closure_wrapper3081(arg0, arg1, arg2) {
3566
+ export function __wbindgen_closure_wrapper3099(arg0, arg1, arg2) {
3567
3567
  const ret = makeMutClosure(arg0, arg1, 705, __wbg_adapter_50);
3568
3568
  return addHeapObject(ret);
3569
3569
  }
3570
3570
 
3571
- export function __wbindgen_closure_wrapper3476(arg0, arg1, arg2) {
3571
+ export function __wbindgen_closure_wrapper3494(arg0, arg1, arg2) {
3572
3572
  const ret = makeMutClosure(arg0, arg1, 827, __wbg_adapter_53);
3573
3573
  return addHeapObject(ret);
3574
3574
  }
Binary file