@bitwarden/sdk-internal 0.2.0-main.513 → 0.2.0-main.514

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.
@@ -1,16 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Generate a new SSH key pair
5
- *
6
- * # Arguments
7
- * - `key_algorithm` - The algorithm to use for the key pair
8
- *
9
- * # Returns
10
- * - `Ok(SshKey)` if the key was successfully generated
11
- * - `Err(KeyGenerationError)` if the key could not be generated
12
- */
13
- export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
14
3
  /**
15
4
  * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
16
5
  * to an OpenSSH private key with public key and fingerprint
@@ -27,6 +16,17 @@ export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
27
16
  * - `Err(UnsupportedKeyType)` if the key type is not supported
28
17
  */
29
18
  export function import_ssh_key(imported_key: string, password?: string | null): SshKeyView;
19
+ /**
20
+ * Generate a new SSH key pair
21
+ *
22
+ * # Arguments
23
+ * - `key_algorithm` - The algorithm to use for the key pair
24
+ *
25
+ * # Returns
26
+ * - `Ok(SshKey)` if the key was successfully generated
27
+ * - `Err(KeyGenerationError)` if the key could not be generated
28
+ */
29
+ export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
30
30
  export function init_sdk(log_level?: LogLevel | null): void;
31
31
  /**
32
32
  * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
@@ -180,32 +180,42 @@ export interface TokenProvider {
180
180
  get_access_token(): Promise<string | undefined>;
181
181
  }
182
182
 
183
+ export interface IndexedDbConfiguration {
184
+ db_name: string;
185
+ }
186
+
183
187
  export interface Repositories {
184
188
  cipher: Repository<Cipher> | null;
185
189
  folder: Repository<Folder> | null;
186
190
  }
187
191
 
188
- export interface IndexedDbConfiguration {
189
- db_name: string;
190
- }
191
-
192
192
  /**
193
193
  * Active feature flags for the SDK.
194
194
  */
195
195
  export interface FeatureFlags extends Map<string, boolean> {}
196
196
 
197
197
  /**
198
- * Credentials for sending password secured access requests.
199
- * Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
200
- * struct.
198
+ * Credentials for getting a send access token using an email and OTP.
201
199
  */
202
- export interface SendPasswordCredentials {
200
+ export interface SendEmailOtpCredentials {
203
201
  /**
204
- * A Base64-encoded hash of the password protecting the send.
202
+ * The email address to which the OTP will be sent.
205
203
  */
206
- passwordHashB64: string;
204
+ email: string;
205
+ /**
206
+ * The one-time password (OTP) that the user has received via email.
207
+ */
208
+ otp: string;
207
209
  }
208
210
 
211
+ /**
212
+ * The credentials used for send access requests.
213
+ */
214
+ export type SendAccessCredentials =
215
+ | SendPasswordCredentials
216
+ | SendEmailOtpCredentials
217
+ | SendEmailCredentials;
218
+
209
219
  /**
210
220
  * A request structure for requesting a send access token from the API.
211
221
  */
@@ -221,36 +231,26 @@ export interface SendAccessTokenRequest {
221
231
  }
222
232
 
223
233
  /**
224
- * The credentials used for send access requests.
225
- */
226
- export type SendAccessCredentials =
227
- | SendPasswordCredentials
228
- | SendEmailOtpCredentials
229
- | SendEmailCredentials;
230
-
231
- /**
232
- * Credentials for sending an OTP to the user\'s email address.
233
- * This is used when the send requires email verification with an OTP.
234
+ * Credentials for sending password secured access requests.
235
+ * Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
236
+ * struct.
234
237
  */
235
- export interface SendEmailCredentials {
238
+ export interface SendPasswordCredentials {
236
239
  /**
237
- * The email address to which the OTP will be sent.
240
+ * A Base64-encoded hash of the password protecting the send.
238
241
  */
239
- email: string;
242
+ passwordHashB64: string;
240
243
  }
241
244
 
242
245
  /**
243
- * Credentials for getting a send access token using an email and OTP.
246
+ * Credentials for sending an OTP to the user\'s email address.
247
+ * This is used when the send requires email verification with an OTP.
244
248
  */
245
- export interface SendEmailOtpCredentials {
249
+ export interface SendEmailCredentials {
246
250
  /**
247
251
  * The email address to which the OTP will be sent.
248
252
  */
249
253
  email: string;
250
- /**
251
- * The one-time password (OTP) that the user has received via email.
252
- */
253
- otp: string;
254
254
  }
255
255
 
256
256
  /**
@@ -263,6 +263,14 @@ export interface SendEmailOtpCredentials {
263
263
  */
264
264
  export type UnexpectedIdentityError = string;
265
265
 
266
+ /**
267
+ * Represents errors that can occur when requesting a send access token.
268
+ * It includes expected and unexpected API errors.
269
+ */
270
+ export type SendAccessTokenError =
271
+ | { kind: "unexpected"; data: UnexpectedIdentityError }
272
+ | { kind: "expected"; data: SendAccessTokenApiErrorResponse };
273
+
266
274
  /**
267
275
  * A send access token which can be used to access a send.
268
276
  */
@@ -278,12 +286,14 @@ export interface SendAccessTokenResponse {
278
286
  }
279
287
 
280
288
  /**
281
- * Represents errors that can occur when requesting a send access token.
282
- * It includes expected and unexpected API errors.
289
+ * Invalid grant errors - typically due to invalid credentials.
283
290
  */
284
- export type SendAccessTokenError =
285
- | { kind: "unexpected"; data: UnexpectedIdentityError }
286
- | { kind: "expected"; data: SendAccessTokenApiErrorResponse };
291
+ export type SendAccessTokenInvalidGrantError =
292
+ | "send_id_invalid"
293
+ | "password_hash_b64_invalid"
294
+ | "otp_invalid"
295
+ | "otp_generation_failed"
296
+ | "unknown";
287
297
 
288
298
  /**
289
299
  * Represents the possible, expected errors that can occur when requesting a send access token.
@@ -305,16 +315,6 @@ export type SendAccessTokenApiErrorResponse =
305
315
  | { error: "invalid_scope"; error_description?: string }
306
316
  | { error: "invalid_target"; error_description?: string };
307
317
 
308
- /**
309
- * Invalid grant errors - typically due to invalid credentials.
310
- */
311
- export type SendAccessTokenInvalidGrantError =
312
- | "send_id_invalid"
313
- | "password_hash_b64_invalid"
314
- | "otp_invalid"
315
- | "otp_generation_failed"
316
- | "unknown";
317
-
318
318
  /**
319
319
  * Invalid request errors - typically due to missing parameters.
320
320
  */
@@ -325,13 +325,28 @@ export type SendAccessTokenInvalidRequestError =
325
325
  | "email_and_otp_required"
326
326
  | "unknown";
327
327
 
328
- export interface RegistrationError extends Error {
329
- name: "RegistrationError";
330
- variant: "KeyConnectorApi" | "Api" | "Crypto";
328
+ /**
329
+ * Result of Key Connector registration process.
330
+ */
331
+ export interface KeyConnectorRegistrationResult {
332
+ /**
333
+ * The account cryptographic state of the user.
334
+ */
335
+ account_cryptographic_state: WrappedAccountCryptographicState;
336
+ /**
337
+ * The key connector key used for unlocking.
338
+ */
339
+ key_connector_key: B64;
340
+ /**
341
+ * The encrypted user key, wrapped with the key connector key.
342
+ */
343
+ key_connector_key_wrapped_user_key: EncString;
344
+ /**
345
+ * The decrypted user key. This can be used to get the consuming client to an unlocked state.
346
+ */
347
+ user_key: B64;
331
348
  }
332
349
 
333
- export function isRegistrationError(error: any): error is RegistrationError;
334
-
335
350
  /**
336
351
  * Request parameters for SSO JIT master password registration.
337
352
  */
@@ -371,33 +386,6 @@ export interface JitMasterPasswordRegistrationRequest {
371
386
  reset_password_enroll: boolean;
372
387
  }
373
388
 
374
- /**
375
- * Request parameters for TDE (Trusted Device Encryption) registration.
376
- */
377
- export interface TdeRegistrationRequest {
378
- /**
379
- * Organization ID to enroll in
380
- */
381
- org_id: OrganizationId;
382
- /**
383
- * Organization\'s public key for encrypting the reset password key. This should be verified by
384
- * the client and not verifying may compromise the security of the user\'s account.
385
- */
386
- org_public_key: B64;
387
- /**
388
- * User ID for the account being initialized
389
- */
390
- user_id: UserId;
391
- /**
392
- * Device identifier for TDE enrollment
393
- */
394
- device_identifier: string;
395
- /**
396
- * Whether to trust this device for TDE
397
- */
398
- trust_device: boolean;
399
- }
400
-
401
389
  /**
402
390
  * Result of TDE registration process.
403
391
  */
@@ -416,26 +404,38 @@ export interface TdeRegistrationResponse {
416
404
  user_key: B64;
417
405
  }
418
406
 
407
+ export interface RegistrationError extends Error {
408
+ name: "RegistrationError";
409
+ variant: "KeyConnectorApi" | "Api" | "Crypto";
410
+ }
411
+
412
+ export function isRegistrationError(error: any): error is RegistrationError;
413
+
419
414
  /**
420
- * Result of Key Connector registration process.
415
+ * Request parameters for TDE (Trusted Device Encryption) registration.
421
416
  */
422
- export interface KeyConnectorRegistrationResult {
417
+ export interface TdeRegistrationRequest {
423
418
  /**
424
- * The account cryptographic state of the user.
419
+ * Organization ID to enroll in
425
420
  */
426
- account_cryptographic_state: WrappedAccountCryptographicState;
421
+ org_id: OrganizationId;
427
422
  /**
428
- * The key connector key used for unlocking.
423
+ * Organization\'s public key for encrypting the reset password key. This should be verified by
424
+ * the client and not verifying may compromise the security of the user\'s account.
429
425
  */
430
- key_connector_key: B64;
426
+ org_public_key: B64;
431
427
  /**
432
- * The encrypted user key, wrapped with the key connector key.
428
+ * User ID for the account being initialized
433
429
  */
434
- key_connector_key_wrapped_user_key: EncString;
430
+ user_id: UserId;
435
431
  /**
436
- * The decrypted user key. This can be used to get the consuming client to an unlocked state.
432
+ * Device identifier for TDE enrollment
437
433
  */
438
- user_key: B64;
434
+ device_identifier: string;
435
+ /**
436
+ * Whether to trust this device for TDE
437
+ */
438
+ trust_device: boolean;
439
439
  }
440
440
 
441
441
  /**
@@ -456,6 +456,11 @@ export interface JitMasterPasswordRegistrationResponse {
456
456
  user_key: B64;
457
457
  }
458
458
 
459
+ /**
460
+ * NewType wrapper for `CollectionId`
461
+ */
462
+ export type CollectionId = Tagged<Uuid, "CollectionId">;
463
+
459
464
  export interface CollectionView {
460
465
  id: CollectionId | undefined;
461
466
  organizationId: OrganizationId;
@@ -484,11 +489,6 @@ export interface Collection {
484
489
  type: CollectionType;
485
490
  }
486
491
 
487
- /**
488
- * NewType wrapper for `CollectionId`
489
- */
490
- export type CollectionId = Tagged<Uuid, "CollectionId">;
491
-
492
492
  export interface CollectionDecryptError extends Error {
493
493
  name: "CollectionDecryptError";
494
494
  variant: "Crypto";
@@ -538,21 +538,6 @@ export interface MasterPasswordAuthenticationData {
538
538
  masterPasswordAuthenticationHash: B64;
539
539
  }
540
540
 
541
- export interface AccountCryptographyInitializationError extends Error {
542
- name: "AccountCryptographyInitializationError";
543
- variant:
544
- | "WrongUserKeyType"
545
- | "WrongUserKey"
546
- | "CorruptData"
547
- | "TamperedData"
548
- | "KeyStoreAlreadyInitialized"
549
- | "GenericCrypto";
550
- }
551
-
552
- export function isAccountCryptographyInitializationError(
553
- error: any,
554
- ): error is AccountCryptographyInitializationError;
555
-
556
541
  /**
557
542
  * Any keys / cryptographic protection \"downstream\" from the account symmetric key (user key).
558
543
  * Private keys are protected by the user key.
@@ -575,107 +560,23 @@ export interface RotateCryptographyStateError extends Error {
575
560
 
576
561
  export function isRotateCryptographyStateError(error: any): error is RotateCryptographyStateError;
577
562
 
578
- /**
579
- * Represents the request to initialize the user\'s organizational cryptographic state.
580
- */
581
- export interface InitOrgCryptoRequest {
582
- /**
583
- * The encryption keys for all the organizations the user is a part of
584
- */
585
- organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
586
- }
587
-
588
- export interface MakeKeysError extends Error {
589
- name: "MakeKeysError";
563
+ export interface AccountCryptographyInitializationError extends Error {
564
+ name: "AccountCryptographyInitializationError";
590
565
  variant:
591
- | "AccountCryptographyInitialization"
592
- | "MasterPasswordDerivation"
593
- | "RequestModelCreation"
594
- | "Crypto";
566
+ | "WrongUserKeyType"
567
+ | "WrongUserKey"
568
+ | "CorruptData"
569
+ | "TamperedData"
570
+ | "KeyStoreAlreadyInitialized"
571
+ | "GenericCrypto";
595
572
  }
596
573
 
597
- export function isMakeKeysError(error: any): error is MakeKeysError;
574
+ export function isAccountCryptographyInitializationError(
575
+ error: any,
576
+ ): error is AccountCryptographyInitializationError;
598
577
 
599
578
  /**
600
- * The crypto method used to initialize the user cryptographic state.
601
- */
602
- export type InitUserCryptoMethod =
603
- | { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
604
- | { decryptedKey: { decrypted_user_key: string } }
605
- | { pin: { pin: string; pin_protected_user_key: EncString } }
606
- | { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
607
- | { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
608
- | {
609
- deviceKey: {
610
- device_key: string;
611
- protected_device_private_key: EncString;
612
- device_protected_user_key: UnsignedSharedKey;
613
- };
614
- }
615
- | { keyConnector: { master_key: B64; user_key: EncString } };
616
-
617
- /**
618
- * Request for deriving a pin protected user key
619
- */
620
- export interface EnrollPinResponse {
621
- /**
622
- * [UserKey] protected by PIN
623
- */
624
- pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
625
- /**
626
- * PIN protected by [UserKey]
627
- */
628
- userKeyEncryptedPin: EncString;
629
- }
630
-
631
- /**
632
- * Request for deriving a pin protected user key
633
- */
634
- export interface DerivePinKeyResponse {
635
- /**
636
- * [UserKey] protected by PIN
637
- */
638
- pinProtectedUserKey: EncString;
639
- /**
640
- * PIN protected by [UserKey]
641
- */
642
- encryptedPin: EncString;
643
- }
644
-
645
- /**
646
- * Request for `verify_asymmetric_keys`.
647
- */
648
- export interface VerifyAsymmetricKeysRequest {
649
- /**
650
- * The user\'s user key
651
- */
652
- userKey: B64;
653
- /**
654
- * The user\'s public key
655
- */
656
- userPublicKey: B64;
657
- /**
658
- * User\'s private key, encrypted with the user key
659
- */
660
- userKeyEncryptedPrivateKey: EncString;
661
- }
662
-
663
- /**
664
- * Response for `verify_asymmetric_keys`.
665
- */
666
- export interface VerifyAsymmetricKeysResponse {
667
- /**
668
- * Whether the user\'s private key was decryptable by the user key.
669
- */
670
- privateKeyDecryptable: boolean;
671
- /**
672
- * Whether the user\'s private key was a valid RSA key and matched the public key provided.
673
- */
674
- validPrivateKey: boolean;
675
- }
676
-
677
- /**
678
- * Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
579
+ * Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
679
580
  */
680
581
  export interface UserCryptoV2KeysResponse {
681
582
  /**
@@ -719,59 +620,66 @@ export interface EnrollAdminPasswordResetError extends Error {
719
620
 
720
621
  export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
721
622
 
722
- export interface CryptoClientError extends Error {
723
- name: "CryptoClientError";
724
- variant:
725
- | "NotAuthenticated"
726
- | "Crypto"
727
- | "InvalidKdfSettings"
728
- | "PasswordProtectedKeyEnvelope"
729
- | "InvalidPrfInput";
730
- }
731
-
732
- export function isCryptoClientError(error: any): error is CryptoClientError;
733
-
734
623
  /**
735
- * Request for migrating an account from password to key connector.
624
+ * Response from the `update_kdf` function
736
625
  */
737
- export interface DeriveKeyConnectorRequest {
626
+ export interface UpdateKdfResponse {
738
627
  /**
739
- * Encrypted user key, used to validate the master key
628
+ * The authentication data for the new KDF setting
740
629
  */
741
- userKeyEncrypted: EncString;
630
+ masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
742
631
  /**
743
- * The user\'s master password
632
+ * The unlock data for the new KDF setting
744
633
  */
745
- password: string;
634
+ masterPasswordUnlockData: MasterPasswordUnlockData;
746
635
  /**
747
- * The KDF parameters used to derive the master key
636
+ * The authentication data for the KDF setting prior to the change
748
637
  */
749
- kdf: Kdf;
638
+ oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
639
+ }
640
+
641
+ /**
642
+ * Request for deriving a pin protected user key
643
+ */
644
+ export interface DerivePinKeyResponse {
750
645
  /**
751
- * The user\'s email address
646
+ * [UserKey] protected by PIN
752
647
  */
753
- email: string;
648
+ pinProtectedUserKey: EncString;
649
+ /**
650
+ * PIN protected by [UserKey]
651
+ */
652
+ encryptedPin: EncString;
754
653
  }
755
654
 
756
- export interface DeriveKeyConnectorError extends Error {
757
- name: "DeriveKeyConnectorError";
758
- variant: "WrongPassword" | "Crypto";
655
+ export interface CryptoClientError extends Error {
656
+ name: "CryptoClientError";
657
+ variant:
658
+ | "NotAuthenticated"
659
+ | "Crypto"
660
+ | "InvalidKdfSettings"
661
+ | "PasswordProtectedKeyEnvelope"
662
+ | "InvalidPrfInput";
759
663
  }
760
664
 
761
- export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
665
+ export function isCryptoClientError(error: any): error is CryptoClientError;
762
666
 
763
667
  /**
764
- * Response from the `make_update_password` function
668
+ * Request for `verify_asymmetric_keys`.
765
669
  */
766
- export interface UpdatePasswordResponse {
670
+ export interface VerifyAsymmetricKeysRequest {
767
671
  /**
768
- * Hash of the new password
672
+ * The user\'s user key
769
673
  */
770
- passwordHash: B64;
674
+ userKey: B64;
771
675
  /**
772
- * User key, encrypted with the new password
676
+ * The user\'s public key
773
677
  */
774
- newKey: EncString;
678
+ userPublicKey: B64;
679
+ /**
680
+ * User\'s private key, encrypted with the user key
681
+ */
682
+ userKeyEncryptedPrivateKey: EncString;
775
683
  }
776
684
 
777
685
  /**
@@ -788,6 +696,52 @@ export interface MakeKeyPairResponse {
788
696
  userKeyEncryptedPrivateKey: EncString;
789
697
  }
790
698
 
699
+ /**
700
+ * Represents the request to initialize the user\'s organizational cryptographic state.
701
+ */
702
+ export interface InitOrgCryptoRequest {
703
+ /**
704
+ * The encryption keys for all the organizations the user is a part of
705
+ */
706
+ organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
707
+ }
708
+
709
+ /**
710
+ * Auth requests supports multiple initialization methods.
711
+ */
712
+ export type AuthRequestMethod =
713
+ | { userKey: { protected_user_key: UnsignedSharedKey } }
714
+ | { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
715
+
716
+ /**
717
+ * The crypto method used to initialize the user cryptographic state.
718
+ */
719
+ export type InitUserCryptoMethod =
720
+ | { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
721
+ | { decryptedKey: { decrypted_user_key: string } }
722
+ | { pin: { pin: string; pin_protected_user_key: EncString } }
723
+ | { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
724
+ | { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
725
+ | {
726
+ deviceKey: {
727
+ device_key: string;
728
+ protected_device_private_key: EncString;
729
+ device_protected_user_key: UnsignedSharedKey;
730
+ };
731
+ }
732
+ | { keyConnector: { master_key: B64; user_key: EncString } };
733
+
734
+ export interface MakeKeysError extends Error {
735
+ name: "MakeKeysError";
736
+ variant:
737
+ | "AccountCryptographyInitialization"
738
+ | "MasterPasswordDerivation"
739
+ | "RequestModelCreation"
740
+ | "Crypto";
741
+ }
742
+
743
+ export function isMakeKeysError(error: any): error is MakeKeysError;
744
+
791
745
  /**
792
746
  * State used for initializing the user cryptographic state.
793
747
  */
@@ -816,29 +770,75 @@ export interface InitUserCryptoRequest {
816
770
  }
817
771
 
818
772
  /**
819
- * Response from the `update_kdf` function
773
+ * Request for migrating an account from password to key connector.
820
774
  */
821
- export interface UpdateKdfResponse {
775
+ export interface DeriveKeyConnectorRequest {
822
776
  /**
823
- * The authentication data for the new KDF setting
777
+ * Encrypted user key, used to validate the master key
824
778
  */
825
- masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
779
+ userKeyEncrypted: EncString;
826
780
  /**
827
- * The unlock data for the new KDF setting
781
+ * The user\'s master password
828
782
  */
829
- masterPasswordUnlockData: MasterPasswordUnlockData;
783
+ password: string;
830
784
  /**
831
- * The authentication data for the KDF setting prior to the change
785
+ * The KDF parameters used to derive the master key
832
786
  */
833
- oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
787
+ kdf: Kdf;
788
+ /**
789
+ * The user\'s email address
790
+ */
791
+ email: string;
834
792
  }
835
793
 
836
794
  /**
837
- * Auth requests supports multiple initialization methods.
795
+ * Request for deriving a pin protected user key
838
796
  */
839
- export type AuthRequestMethod =
840
- | { userKey: { protected_user_key: UnsignedSharedKey } }
841
- | { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
797
+ export interface EnrollPinResponse {
798
+ /**
799
+ * [UserKey] protected by PIN
800
+ */
801
+ pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
802
+ /**
803
+ * PIN protected by [UserKey]
804
+ */
805
+ userKeyEncryptedPin: EncString;
806
+ }
807
+
808
+ /**
809
+ * Response from the `make_update_password` function
810
+ */
811
+ export interface UpdatePasswordResponse {
812
+ /**
813
+ * Hash of the new password
814
+ */
815
+ passwordHash: B64;
816
+ /**
817
+ * User key, encrypted with the new password
818
+ */
819
+ newKey: EncString;
820
+ }
821
+
822
+ /**
823
+ * Response for `verify_asymmetric_keys`.
824
+ */
825
+ export interface VerifyAsymmetricKeysResponse {
826
+ /**
827
+ * Whether the user\'s private key was decryptable by the user key.
828
+ */
829
+ privateKeyDecryptable: boolean;
830
+ /**
831
+ * Whether the user\'s private key was a valid RSA key and matched the public key provided.
832
+ */
833
+ validPrivateKey: boolean;
834
+ }
835
+
836
+ export interface DeriveKeyConnectorError extends Error {
837
+ name: "DeriveKeyConnectorError";
838
+ variant: "WrongPassword" | "Crypto";
839
+ }
840
+
841
+ export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
842
842
 
843
843
  /**
844
844
  * NewType wrapper for `OrganizationId`
@@ -857,35 +857,6 @@ export interface StatefulCryptoError extends Error {
857
857
 
858
858
  export function isStatefulCryptoError(error: any): error is StatefulCryptoError;
859
859
 
860
- export type DeviceType =
861
- | "Android"
862
- | "iOS"
863
- | "ChromeExtension"
864
- | "FirefoxExtension"
865
- | "OperaExtension"
866
- | "EdgeExtension"
867
- | "WindowsDesktop"
868
- | "MacOsDesktop"
869
- | "LinuxDesktop"
870
- | "ChromeBrowser"
871
- | "FirefoxBrowser"
872
- | "OperaBrowser"
873
- | "EdgeBrowser"
874
- | "IEBrowser"
875
- | "UnknownBrowser"
876
- | "AndroidAmazon"
877
- | "UWP"
878
- | "SafariBrowser"
879
- | "VivaldiBrowser"
880
- | "VivaldiExtension"
881
- | "SafariExtension"
882
- | "SDK"
883
- | "Server"
884
- | "WindowsCLI"
885
- | "MacOsCLI"
886
- | "LinuxCLI"
887
- | "DuckDuckGoBrowser";
888
-
889
860
  /**
890
861
  * Basic client behavior settings. These settings specify the various targets and behavior of the
891
862
  * Bitwarden Client. They are optional and uneditable once the client is initialized.
@@ -938,6 +909,35 @@ export interface ClientSettings {
938
909
  bitwardenPackageType?: string | undefined;
939
910
  }
940
911
 
912
+ export type DeviceType =
913
+ | "Android"
914
+ | "iOS"
915
+ | "ChromeExtension"
916
+ | "FirefoxExtension"
917
+ | "OperaExtension"
918
+ | "EdgeExtension"
919
+ | "WindowsDesktop"
920
+ | "MacOsDesktop"
921
+ | "LinuxDesktop"
922
+ | "ChromeBrowser"
923
+ | "FirefoxBrowser"
924
+ | "OperaBrowser"
925
+ | "EdgeBrowser"
926
+ | "IEBrowser"
927
+ | "UnknownBrowser"
928
+ | "AndroidAmazon"
929
+ | "UWP"
930
+ | "SafariBrowser"
931
+ | "VivaldiBrowser"
932
+ | "VivaldiExtension"
933
+ | "SafariExtension"
934
+ | "SDK"
935
+ | "Server"
936
+ | "WindowsCLI"
937
+ | "MacOsCLI"
938
+ | "LinuxCLI"
939
+ | "DuckDuckGoBrowser";
940
+
941
941
  export interface EncryptionSettingsError extends Error {
942
942
  name: "EncryptionSettingsError";
943
943
  variant:
@@ -1089,8 +1089,6 @@ export interface ExportError extends Error {
1089
1089
 
1090
1090
  export function isExportError(error: any): error is ExportError;
1091
1091
 
1092
- export type PassphraseError = { InvalidNumWords: { minimum: number; maximum: number } };
1093
-
1094
1092
  /**
1095
1093
  * Passphrase generator request options.
1096
1094
  */
@@ -1115,6 +1113,8 @@ export interface PassphraseGeneratorRequest {
1115
1113
  includeNumber: boolean;
1116
1114
  }
1117
1115
 
1116
+ export type PassphraseError = { InvalidNumWords: { minimum: number; maximum: number } };
1117
+
1118
1118
  /**
1119
1119
  * Password generator request options.
1120
1120
  */
@@ -1180,15 +1180,6 @@ export type UsernameGeneratorRequest =
1180
1180
  | { catchall: { type: AppendType; domain: string } }
1181
1181
  | { forwarded: { service: ForwarderServiceType; website: string | undefined } };
1182
1182
 
1183
- export type AppendType = "random" | { websiteName: { website: string } };
1184
-
1185
- export interface UsernameError extends Error {
1186
- name: "UsernameError";
1187
- variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
1188
- }
1189
-
1190
- export function isUsernameError(error: any): error is UsernameError;
1191
-
1192
1183
  /**
1193
1184
  * Configures the email forwarding service to use.
1194
1185
  * For instructions on how to configure each service, see the documentation:
@@ -1202,6 +1193,15 @@ export type ForwarderServiceType =
1202
1193
  | { forwardEmail: { api_token: string; domain: string } }
1203
1194
  | { simpleLogin: { api_key: string; base_url: string } };
1204
1195
 
1196
+ export type AppendType = "random" | { websiteName: { website: string } };
1197
+
1198
+ export interface UsernameError extends Error {
1199
+ name: "UsernameError";
1200
+ variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
1201
+ }
1202
+
1203
+ export function isUsernameError(error: any): error is UsernameError;
1204
+
1205
1205
  export interface ReceiveError extends Error {
1206
1206
  name: "ReceiveError";
1207
1207
  variant: "Channel" | "Timeout" | "Cancelled";
@@ -1263,13 +1263,6 @@ export type Endpoint =
1263
1263
  | "DesktopRenderer"
1264
1264
  | "DesktopMain";
1265
1265
 
1266
- export interface SshKeyImportError extends Error {
1267
- name: "SshKeyImportError";
1268
- variant: "Parsing" | "PasswordRequired" | "WrongPassword" | "UnsupportedKeyType";
1269
- }
1270
-
1271
- export function isSshKeyImportError(error: any): error is SshKeyImportError;
1272
-
1273
1266
  export interface SshKeyExportError extends Error {
1274
1267
  name: "SshKeyExportError";
1275
1268
  variant: "KeyConversion";
@@ -1277,6 +1270,13 @@ export interface SshKeyExportError extends Error {
1277
1270
 
1278
1271
  export function isSshKeyExportError(error: any): error is SshKeyExportError;
1279
1272
 
1273
+ export interface SshKeyImportError extends Error {
1274
+ name: "SshKeyImportError";
1275
+ variant: "Parsing" | "PasswordRequired" | "WrongPassword" | "UnsupportedKeyType";
1276
+ }
1277
+
1278
+ export function isSshKeyImportError(error: any): error is SshKeyImportError;
1279
+
1280
1280
  export interface KeyGenerationError extends Error {
1281
1281
  name: "KeyGenerationError";
1282
1282
  variant: "KeyGeneration" | "KeyConversion";
@@ -1313,14 +1313,6 @@ export interface CipherRiskError extends Error {
1313
1313
 
1314
1314
  export function isCipherRiskError(error: any): error is CipherRiskError;
1315
1315
 
1316
- /**
1317
- * Result of checking password exposure via HIBP API.
1318
- */
1319
- export type ExposedPasswordResult =
1320
- | { type: "NotChecked" }
1321
- | { type: "Found"; value: number }
1322
- | { type: "Error"; value: string };
1323
-
1324
1316
  /**
1325
1317
  * Password reuse map wrapper for WASM compatibility.
1326
1318
  */
@@ -1371,6 +1363,14 @@ export interface CipherRiskResult {
1371
1363
  reuse_count: number | undefined;
1372
1364
  }
1373
1365
 
1366
+ /**
1367
+ * Result of checking password exposure via HIBP API.
1368
+ */
1369
+ export type ExposedPasswordResult =
1370
+ | { type: "NotChecked" }
1371
+ | { type: "Found"; value: number }
1372
+ | { type: "Error"; value: string };
1373
+
1374
1374
  /**
1375
1375
  * Options for configuring risk computation.
1376
1376
  */
@@ -1392,13 +1392,13 @@ export interface CipherRiskOptions {
1392
1392
  hibpBaseUrl?: string | undefined;
1393
1393
  }
1394
1394
 
1395
- export interface PasswordHistory {
1396
- password: EncString;
1395
+ export interface PasswordHistoryView {
1396
+ password: string;
1397
1397
  lastUsedDate: DateTime<Utc>;
1398
1398
  }
1399
1399
 
1400
- export interface PasswordHistoryView {
1401
- password: string;
1400
+ export interface PasswordHistory {
1401
+ password: EncString;
1402
1402
  lastUsedDate: DateTime<Utc>;
1403
1403
  }
1404
1404
 
@@ -1406,13 +1406,6 @@ export interface AncestorMap {
1406
1406
  ancestors: Map<CollectionId, string>;
1407
1407
  }
1408
1408
 
1409
- export interface TotpError extends Error {
1410
- name: "TotpError";
1411
- variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
1412
- }
1413
-
1414
- export function isTotpError(error: any): error is TotpError;
1415
-
1416
1409
  export interface TotpResponse {
1417
1410
  /**
1418
1411
  * Generated TOTP code
@@ -1424,6 +1417,13 @@ export interface TotpResponse {
1424
1417
  period: number;
1425
1418
  }
1426
1419
 
1420
+ export interface TotpError extends Error {
1421
+ name: "TotpError";
1422
+ variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
1423
+ }
1424
+
1425
+ export function isTotpError(error: any): error is TotpError;
1426
+
1427
1427
  export interface DecryptError extends Error {
1428
1428
  name: "DecryptError";
1429
1429
  variant: "Crypto";
@@ -1482,11 +1482,11 @@ export interface LocalDataView {
1482
1482
  lastLaunched: DateTime<Utc> | undefined;
1483
1483
  }
1484
1484
 
1485
- export interface SecureNoteView {
1485
+ export interface SecureNote {
1486
1486
  type: SecureNoteType;
1487
1487
  }
1488
1488
 
1489
- export interface SecureNote {
1489
+ export interface SecureNoteView {
1490
1490
  type: SecureNoteType;
1491
1491
  }
1492
1492
 
@@ -1497,21 +1497,6 @@ export interface GetCipherError extends Error {
1497
1497
 
1498
1498
  export function isGetCipherError(error: any): error is GetCipherError;
1499
1499
 
1500
- export interface EditCipherError extends Error {
1501
- name: "EditCipherError";
1502
- variant:
1503
- | "ItemNotFound"
1504
- | "Crypto"
1505
- | "Api"
1506
- | "VaultParse"
1507
- | "MissingField"
1508
- | "NotAuthenticated"
1509
- | "Repository"
1510
- | "Uuid";
1511
- }
1512
-
1513
- export function isEditCipherError(error: any): error is EditCipherError;
1514
-
1515
1500
  /**
1516
1501
  * Request to edit a cipher.
1517
1502
  */
@@ -1531,6 +1516,21 @@ export interface CipherEditRequest {
1531
1516
  key: EncString | undefined;
1532
1517
  }
1533
1518
 
1519
+ export interface EditCipherError extends Error {
1520
+ name: "EditCipherError";
1521
+ variant:
1522
+ | "ItemNotFound"
1523
+ | "Crypto"
1524
+ | "Api"
1525
+ | "VaultParse"
1526
+ | "MissingField"
1527
+ | "NotAuthenticated"
1528
+ | "Repository"
1529
+ | "Uuid";
1530
+ }
1531
+
1532
+ export function isEditCipherError(error: any): error is EditCipherError;
1533
+
1534
1534
  export interface GetOrganizationCiphersAdminError extends Error {
1535
1535
  name: "GetOrganizationCiphersAdminError";
1536
1536
  variant: "Crypto" | "VaultParse" | "Api";
@@ -1623,13 +1623,6 @@ export type CipherViewType =
1623
1623
  | { secureNote: SecureNoteView }
1624
1624
  | { sshKey: SshKeyView };
1625
1625
 
1626
- export interface DecryptFileError extends Error {
1627
- name: "DecryptFileError";
1628
- variant: "Decrypt" | "Io";
1629
- }
1630
-
1631
- export function isDecryptFileError(error: any): error is DecryptFileError;
1632
-
1633
1626
  export interface EncryptFileError extends Error {
1634
1627
  name: "EncryptFileError";
1635
1628
  variant: "Encrypt" | "Io";
@@ -1637,18 +1630,26 @@ export interface EncryptFileError extends Error {
1637
1630
 
1638
1631
  export function isEncryptFileError(error: any): error is EncryptFileError;
1639
1632
 
1633
+ export interface DecryptFileError extends Error {
1634
+ name: "DecryptFileError";
1635
+ variant: "Decrypt" | "Io";
1636
+ }
1637
+
1638
+ export function isDecryptFileError(error: any): error is DecryptFileError;
1639
+
1640
1640
  export interface CipherPermissions {
1641
1641
  delete: boolean;
1642
1642
  restore: boolean;
1643
1643
  }
1644
1644
 
1645
- export interface CardView {
1646
- cardholderName: string | undefined;
1647
- expMonth: string | undefined;
1648
- expYear: string | undefined;
1649
- code: string | undefined;
1645
+ /**
1646
+ * Minimal CardView only including the needed details for list views
1647
+ */
1648
+ export interface CardListView {
1649
+ /**
1650
+ * The brand of the card, e.g. Visa, Mastercard, etc.
1651
+ */
1650
1652
  brand: string | undefined;
1651
- number: string | undefined;
1652
1653
  }
1653
1654
 
1654
1655
  export interface Card {
@@ -1660,14 +1661,13 @@ export interface Card {
1660
1661
  number: EncString | undefined;
1661
1662
  }
1662
1663
 
1663
- /**
1664
- * Minimal CardView only including the needed details for list views
1665
- */
1666
- export interface CardListView {
1667
- /**
1668
- * The brand of the card, e.g. Visa, Mastercard, etc.
1669
- */
1664
+ export interface CardView {
1665
+ cardholderName: string | undefined;
1666
+ expMonth: string | undefined;
1667
+ expYear: string | undefined;
1668
+ code: string | undefined;
1670
1669
  brand: string | undefined;
1670
+ number: string | undefined;
1671
1671
  }
1672
1672
 
1673
1673
  export interface FieldView {
@@ -1684,54 +1684,47 @@ export interface Field {
1684
1684
  linkedId: LinkedIdType | undefined;
1685
1685
  }
1686
1686
 
1687
- export interface LoginUriView {
1688
- uri: string | undefined;
1689
- match: UriMatchType | undefined;
1690
- uriChecksum: string | undefined;
1691
- }
1692
-
1693
- export interface LoginUri {
1694
- uri: EncString | undefined;
1695
- match: UriMatchType | undefined;
1696
- uriChecksum: EncString | undefined;
1697
- }
1698
-
1699
- export interface Fido2CredentialView {
1687
+ export interface Fido2CredentialNewView {
1700
1688
  credentialId: string;
1701
1689
  keyType: string;
1702
1690
  keyAlgorithm: string;
1703
1691
  keyCurve: string;
1704
- keyValue: EncString;
1705
1692
  rpId: string;
1706
1693
  userHandle: string | undefined;
1707
1694
  userName: string | undefined;
1708
1695
  counter: string;
1709
1696
  rpName: string | undefined;
1710
1697
  userDisplayName: string | undefined;
1711
- discoverable: string;
1712
1698
  creationDate: DateTime<Utc>;
1713
1699
  }
1714
1700
 
1715
- export interface Fido2CredentialNewView {
1701
+ export interface Fido2CredentialListView {
1716
1702
  credentialId: string;
1717
- keyType: string;
1718
- keyAlgorithm: string;
1719
- keyCurve: string;
1720
1703
  rpId: string;
1721
1704
  userHandle: string | undefined;
1722
1705
  userName: string | undefined;
1723
- counter: string;
1724
- rpName: string | undefined;
1725
1706
  userDisplayName: string | undefined;
1726
- creationDate: DateTime<Utc>;
1707
+ counter: string;
1727
1708
  }
1728
1709
 
1729
- export interface Fido2CredentialFullView {
1710
+ export interface LoginUri {
1711
+ uri: EncString | undefined;
1712
+ match: UriMatchType | undefined;
1713
+ uriChecksum: EncString | undefined;
1714
+ }
1715
+
1716
+ export interface LoginUriView {
1717
+ uri: string | undefined;
1718
+ match: UriMatchType | undefined;
1719
+ uriChecksum: string | undefined;
1720
+ }
1721
+
1722
+ export interface Fido2CredentialView {
1730
1723
  credentialId: string;
1731
1724
  keyType: string;
1732
1725
  keyAlgorithm: string;
1733
1726
  keyCurve: string;
1734
- keyValue: string;
1727
+ keyValue: EncString;
1735
1728
  rpId: string;
1736
1729
  userHandle: string | undefined;
1737
1730
  userName: string | undefined;
@@ -1752,6 +1745,17 @@ export interface LoginView {
1752
1745
  fido2Credentials: Fido2Credential[] | undefined;
1753
1746
  }
1754
1747
 
1748
+ export interface LoginListView {
1749
+ fido2Credentials: Fido2CredentialListView[] | undefined;
1750
+ hasFido2: boolean;
1751
+ username: string | undefined;
1752
+ /**
1753
+ * The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
1754
+ */
1755
+ totp: EncString | undefined;
1756
+ uris: LoginUriView[] | undefined;
1757
+ }
1758
+
1755
1759
  export interface Fido2Credential {
1756
1760
  credentialId: EncString;
1757
1761
  keyType: EncString;
@@ -1768,26 +1772,6 @@ export interface Fido2Credential {
1768
1772
  creationDate: DateTime<Utc>;
1769
1773
  }
1770
1774
 
1771
- export interface LoginListView {
1772
- fido2Credentials: Fido2CredentialListView[] | undefined;
1773
- hasFido2: boolean;
1774
- username: string | undefined;
1775
- /**
1776
- * The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
1777
- */
1778
- totp: EncString | undefined;
1779
- uris: LoginUriView[] | undefined;
1780
- }
1781
-
1782
- export interface Fido2CredentialListView {
1783
- credentialId: string;
1784
- rpId: string;
1785
- userHandle: string | undefined;
1786
- userName: string | undefined;
1787
- userDisplayName: string | undefined;
1788
- counter: string;
1789
- }
1790
-
1791
1775
  export interface Login {
1792
1776
  username: EncString | undefined;
1793
1777
  password: EncString | undefined;
@@ -1798,41 +1782,27 @@ export interface Login {
1798
1782
  fido2Credentials: Fido2Credential[] | undefined;
1799
1783
  }
1800
1784
 
1801
- export interface Cipher {
1802
- id: CipherId | undefined;
1803
- organizationId: OrganizationId | undefined;
1804
- folderId: FolderId | undefined;
1805
- collectionIds: CollectionId[];
1806
- /**
1807
- * More recent ciphers uses individual encryption keys to encrypt the other fields of the
1808
- * Cipher.
1809
- */
1810
- key: EncString | undefined;
1811
- name: EncString;
1812
- notes: EncString | undefined;
1813
- type: CipherType;
1814
- login: Login | undefined;
1815
- identity: Identity | undefined;
1816
- card: Card | undefined;
1817
- secureNote: SecureNote | undefined;
1818
- sshKey: SshKey | undefined;
1819
- favorite: boolean;
1820
- reprompt: CipherRepromptType;
1821
- organizationUseTotp: boolean;
1822
- edit: boolean;
1823
- permissions: CipherPermissions | undefined;
1824
- viewPassword: boolean;
1825
- localData: LocalData | undefined;
1826
- attachments: Attachment[] | undefined;
1827
- fields: Field[] | undefined;
1828
- passwordHistory: PasswordHistory[] | undefined;
1785
+ export interface Fido2CredentialFullView {
1786
+ credentialId: string;
1787
+ keyType: string;
1788
+ keyAlgorithm: string;
1789
+ keyCurve: string;
1790
+ keyValue: string;
1791
+ rpId: string;
1792
+ userHandle: string | undefined;
1793
+ userName: string | undefined;
1794
+ counter: string;
1795
+ rpName: string | undefined;
1796
+ userDisplayName: string | undefined;
1797
+ discoverable: string;
1829
1798
  creationDate: DateTime<Utc>;
1830
- deletedDate: DateTime<Utc> | undefined;
1831
- revisionDate: DateTime<Utc>;
1832
- archivedDate: DateTime<Utc> | undefined;
1833
- data: string | undefined;
1834
1799
  }
1835
1800
 
1801
+ /**
1802
+ * NewType wrapper for `CipherId`
1803
+ */
1804
+ export type CipherId = Tagged<Uuid, "CipherId">;
1805
+
1836
1806
  export interface CipherListView {
1837
1807
  id: CipherId | undefined;
1838
1808
  organizationId: OrganizationId | undefined;
@@ -1888,29 +1858,6 @@ export interface DecryptCipherListResult {
1888
1858
  failures: Cipher[];
1889
1859
  }
1890
1860
 
1891
- export type CipherListViewType =
1892
- | { login: LoginListView }
1893
- | "secureNote"
1894
- | { card: CardListView }
1895
- | "identity"
1896
- | "sshKey";
1897
-
1898
- /**
1899
- * Available fields on a cipher and can be copied from a the list view in the UI.
1900
- */
1901
- export type CopyableCipherFields =
1902
- | "LoginUsername"
1903
- | "LoginPassword"
1904
- | "LoginTotp"
1905
- | "CardNumber"
1906
- | "CardSecurityCode"
1907
- | "IdentityUsername"
1908
- | "IdentityEmail"
1909
- | "IdentityPhone"
1910
- | "IdentityAddress"
1911
- | "SshKey"
1912
- | "SecureNotes";
1913
-
1914
1861
  export interface CipherError extends Error {
1915
1862
  name: "CipherError";
1916
1863
  variant:
@@ -1928,15 +1875,6 @@ export interface CipherError extends Error {
1928
1875
 
1929
1876
  export function isCipherError(error: any): error is CipherError;
1930
1877
 
1931
- export interface EncryptionContext {
1932
- /**
1933
- * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
1934
- * Organization-owned ciphers
1935
- */
1936
- encryptedFor: UserId;
1937
- cipher: Cipher;
1938
- }
1939
-
1940
1878
  export interface CipherView {
1941
1879
  id: CipherId | undefined;
1942
1880
  organizationId: OrganizationId | undefined;
@@ -1974,10 +1912,72 @@ export interface CipherView {
1974
1912
  archivedDate: DateTime<Utc> | undefined;
1975
1913
  }
1976
1914
 
1915
+ export interface Cipher {
1916
+ id: CipherId | undefined;
1917
+ organizationId: OrganizationId | undefined;
1918
+ folderId: FolderId | undefined;
1919
+ collectionIds: CollectionId[];
1920
+ /**
1921
+ * More recent ciphers uses individual encryption keys to encrypt the other fields of the
1922
+ * Cipher.
1923
+ */
1924
+ key: EncString | undefined;
1925
+ name: EncString;
1926
+ notes: EncString | undefined;
1927
+ type: CipherType;
1928
+ login: Login | undefined;
1929
+ identity: Identity | undefined;
1930
+ card: Card | undefined;
1931
+ secureNote: SecureNote | undefined;
1932
+ sshKey: SshKey | undefined;
1933
+ favorite: boolean;
1934
+ reprompt: CipherRepromptType;
1935
+ organizationUseTotp: boolean;
1936
+ edit: boolean;
1937
+ permissions: CipherPermissions | undefined;
1938
+ viewPassword: boolean;
1939
+ localData: LocalData | undefined;
1940
+ attachments: Attachment[] | undefined;
1941
+ fields: Field[] | undefined;
1942
+ passwordHistory: PasswordHistory[] | undefined;
1943
+ creationDate: DateTime<Utc>;
1944
+ deletedDate: DateTime<Utc> | undefined;
1945
+ revisionDate: DateTime<Utc>;
1946
+ archivedDate: DateTime<Utc> | undefined;
1947
+ data: string | undefined;
1948
+ }
1949
+
1950
+ export interface EncryptionContext {
1951
+ /**
1952
+ * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
1953
+ * Organization-owned ciphers
1954
+ */
1955
+ encryptedFor: UserId;
1956
+ cipher: Cipher;
1957
+ }
1958
+
1959
+ export type CipherListViewType =
1960
+ | { login: LoginListView }
1961
+ | "secureNote"
1962
+ | { card: CardListView }
1963
+ | "identity"
1964
+ | "sshKey";
1965
+
1977
1966
  /**
1978
- * NewType wrapper for `CipherId`
1967
+ * Available fields on a cipher and can be copied from a the list view in the UI.
1979
1968
  */
1980
- export type CipherId = Tagged<Uuid, "CipherId">;
1969
+ export type CopyableCipherFields =
1970
+ | "LoginUsername"
1971
+ | "LoginPassword"
1972
+ | "LoginTotp"
1973
+ | "CardNumber"
1974
+ | "CardSecurityCode"
1975
+ | "IdentityUsername"
1976
+ | "IdentityEmail"
1977
+ | "IdentityPhone"
1978
+ | "IdentityAddress"
1979
+ | "SshKey"
1980
+ | "SecureNotes";
1981
1981
 
1982
1982
  export interface SshKey {
1983
1983
  /**
@@ -2053,11 +2053,10 @@ export interface IdentityView {
2053
2053
 
2054
2054
  export type LinkedIdType = LoginLinkedIdType | CardLinkedIdType | IdentityLinkedIdType;
2055
2055
 
2056
- export interface FolderView {
2057
- id: FolderId | undefined;
2058
- name: string;
2059
- revisionDate: DateTime<Utc>;
2060
- }
2056
+ /**
2057
+ * NewType wrapper for `FolderId`
2058
+ */
2059
+ export type FolderId = Tagged<Uuid, "FolderId">;
2061
2060
 
2062
2061
  export interface Folder {
2063
2062
  id: FolderId | undefined;
@@ -2065,10 +2064,11 @@ export interface Folder {
2065
2064
  revisionDate: DateTime<Utc>;
2066
2065
  }
2067
2066
 
2068
- /**
2069
- * NewType wrapper for `FolderId`
2070
- */
2071
- export type FolderId = Tagged<Uuid, "FolderId">;
2067
+ export interface FolderView {
2068
+ id: FolderId | undefined;
2069
+ name: string;
2070
+ revisionDate: DateTime<Utc>;
2071
+ }
2072
2072
 
2073
2073
  export interface EditFolderError extends Error {
2074
2074
  name: "EditFolderError";