@bitwarden/sdk-internal 0.2.0-main.434 → 0.2.0-main.435

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,5 +1,16 @@
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;
3
14
  /**
4
15
  * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
5
16
  * to an OpenSSH private key with public key and fingerprint
@@ -16,18 +27,14 @@
16
27
  * - `Err(UnsupportedKeyType)` if the key type is not supported
17
28
  */
18
29
  export function import_ssh_key(imported_key: string, password?: string | null): SshKeyView;
30
+ export function init_sdk(log_level?: LogLevel | null): void;
19
31
  /**
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
32
+ * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
28
33
  */
29
- export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
30
- export function init_sdk(log_level?: LogLevel | null): void;
34
+ export function ipcRegisterDiscoverHandler(
35
+ ipc_client: IpcClient,
36
+ response: DiscoverResponse,
37
+ ): Promise<void>;
31
38
  /**
32
39
  * Sends a DiscoverRequest to the specified destination and returns the response.
33
40
  */
@@ -36,13 +43,6 @@ export function ipcRequestDiscover(
36
43
  destination: Endpoint,
37
44
  abort_signal?: AbortSignal | null,
38
45
  ): Promise<DiscoverResponse>;
39
- /**
40
- * Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
41
- */
42
- export function ipcRegisterDiscoverHandler(
43
- ipc_client: IpcClient,
44
- response: DiscoverResponse,
45
- ): Promise<void>;
46
46
  export enum CardLinkedIdType {
47
47
  CardholderName = 300,
48
48
  ExpMonth = 301,
@@ -180,6 +180,10 @@ 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;
@@ -190,8 +194,26 @@ export interface Repositories {
190
194
  */
191
195
  export interface FeatureFlags extends Map<string, boolean> {}
192
196
 
193
- export interface IndexedDbConfiguration {
194
- db_name: string;
197
+ /**
198
+ * The credentials used for send access requests.
199
+ */
200
+ export type SendAccessCredentials =
201
+ | SendPasswordCredentials
202
+ | SendEmailOtpCredentials
203
+ | SendEmailCredentials;
204
+
205
+ /**
206
+ * A request structure for requesting a send access token from the API.
207
+ */
208
+ export interface SendAccessTokenRequest {
209
+ /**
210
+ * The id of the send for which the access token is requested.
211
+ */
212
+ sendId: string;
213
+ /**
214
+ * The optional send access credentials.
215
+ */
216
+ sendAccessCredentials?: SendAccessCredentials;
195
217
  }
196
218
 
197
219
  /**
@@ -231,28 +253,6 @@ export interface SendEmailOtpCredentials {
231
253
  otp: string;
232
254
  }
233
255
 
234
- /**
235
- * A request structure for requesting a send access token from the API.
236
- */
237
- export interface SendAccessTokenRequest {
238
- /**
239
- * The id of the send for which the access token is requested.
240
- */
241
- sendId: string;
242
- /**
243
- * The optional send access credentials.
244
- */
245
- sendAccessCredentials?: SendAccessCredentials;
246
- }
247
-
248
- /**
249
- * The credentials used for send access requests.
250
- */
251
- export type SendAccessCredentials =
252
- | SendPasswordCredentials
253
- | SendEmailOtpCredentials
254
- | SendEmailCredentials;
255
-
256
256
  /**
257
257
  * A send access token which can be used to access a send.
258
258
  */
@@ -286,13 +286,14 @@ export type SendAccessTokenError =
286
286
  export type UnexpectedIdentityError = string;
287
287
 
288
288
  /**
289
- * Invalid request errors - typically due to missing parameters.
289
+ * Invalid grant errors - typically due to invalid credentials.
290
290
  */
291
- export type SendAccessTokenInvalidRequestError =
292
- | "send_id_required"
293
- | "password_hash_b64_required"
294
- | "email_required"
295
- | "email_and_otp_required_otp_sent"
291
+ export type SendAccessTokenInvalidGrantError =
292
+ | "send_id_invalid"
293
+ | "password_hash_b64_invalid"
294
+ | "email_invalid"
295
+ | "otp_invalid"
296
+ | "otp_generation_failed"
296
297
  | "unknown";
297
298
 
298
299
  /**
@@ -316,16 +317,20 @@ export type SendAccessTokenApiErrorResponse =
316
317
  | { error: "invalid_target"; error_description?: string };
317
318
 
318
319
  /**
319
- * Invalid grant errors - typically due to invalid credentials.
320
+ * Invalid request errors - typically due to missing parameters.
320
321
  */
321
- export type SendAccessTokenInvalidGrantError =
322
- | "send_id_invalid"
323
- | "password_hash_b64_invalid"
324
- | "email_invalid"
325
- | "otp_invalid"
326
- | "otp_generation_failed"
322
+ export type SendAccessTokenInvalidRequestError =
323
+ | "send_id_required"
324
+ | "password_hash_b64_required"
325
+ | "email_required"
326
+ | "email_and_otp_required_otp_sent"
327
327
  | "unknown";
328
328
 
329
+ /**
330
+ * NewType wrapper for `CollectionId`
331
+ */
332
+ export type CollectionId = Tagged<Uuid, "CollectionId">;
333
+
329
334
  export interface CollectionView {
330
335
  id: CollectionId | undefined;
331
336
  organizationId: OrganizationId;
@@ -337,6 +342,11 @@ export interface CollectionView {
337
342
  type: CollectionType;
338
343
  }
339
344
 
345
+ /**
346
+ * Type of collection
347
+ */
348
+ export type CollectionType = "SharedCollection" | "DefaultUserCollection";
349
+
340
350
  export interface Collection {
341
351
  id: CollectionId | undefined;
342
352
  organizationId: OrganizationId;
@@ -349,16 +359,6 @@ export interface Collection {
349
359
  type: CollectionType;
350
360
  }
351
361
 
352
- /**
353
- * Type of collection
354
- */
355
- export type CollectionType = "SharedCollection" | "DefaultUserCollection";
356
-
357
- /**
358
- * NewType wrapper for `CollectionId`
359
- */
360
- export type CollectionId = Tagged<Uuid, "CollectionId">;
361
-
362
362
  export interface CollectionDecryptError extends Error {
363
363
  name: "CollectionDecryptError";
364
364
  variant: "Crypto";
@@ -407,6 +407,21 @@ export interface MasterPasswordAuthenticationData {
407
407
  masterPasswordAuthenticationHash: B64;
408
408
  }
409
409
 
410
+ export interface AccountCryptographyInitializationError extends Error {
411
+ name: "AccountCryptographyInitializationError";
412
+ variant:
413
+ | "WrongUserKeyType"
414
+ | "WrongUserKey"
415
+ | "CorruptData"
416
+ | "TamperedData"
417
+ | "KeyStoreAlreadyInitialized"
418
+ | "GenericCrypto";
419
+ }
420
+
421
+ export function isAccountCryptographyInitializationError(
422
+ error: any,
423
+ ): error is AccountCryptographyInitializationError;
424
+
410
425
  /**
411
426
  * Any keys / cryptographic protection \"downstream\" from the account symmetric key (user key).
412
427
  * Private keys are protected by the user key.
@@ -422,20 +437,40 @@ export type WrappedAccountCryptographicState =
422
437
  };
423
438
  };
424
439
 
425
- export interface AccountCryptographyInitializationError extends Error {
426
- name: "AccountCryptographyInitializationError";
427
- variant:
428
- | "WrongUserKeyType"
429
- | "WrongUserKey"
430
- | "CorruptData"
431
- | "TamperedData"
432
- | "KeyStoreAlreadyInitialized"
433
- | "GenericCrypto";
440
+ /**
441
+ * Request for deriving a pin protected user key
442
+ */
443
+ export interface EnrollPinResponse {
444
+ /**
445
+ * [UserKey] protected by PIN
446
+ */
447
+ pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
448
+ /**
449
+ * PIN protected by [UserKey]
450
+ */
451
+ userKeyEncryptedPin: EncString;
434
452
  }
435
453
 
436
- export function isAccountCryptographyInitializationError(
437
- error: any,
438
- ): error is AccountCryptographyInitializationError;
454
+ /**
455
+ * Auth requests supports multiple initialization methods.
456
+ */
457
+ export type AuthRequestMethod =
458
+ | { userKey: { protected_user_key: UnsignedSharedKey } }
459
+ | { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
460
+
461
+ /**
462
+ * Response from the `make_key_pair` function
463
+ */
464
+ export interface MakeKeyPairResponse {
465
+ /**
466
+ * The user\'s public key
467
+ */
468
+ userPublicKey: B64;
469
+ /**
470
+ * User\'s private key, encrypted with the user key
471
+ */
472
+ userKeyEncryptedPrivateKey: EncString;
473
+ }
439
474
 
440
475
  export interface CryptoClientError extends Error {
441
476
  name: "CryptoClientError";
@@ -451,23 +486,6 @@ export interface EnrollAdminPasswordResetError extends Error {
451
486
 
452
487
  export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
453
488
 
454
- /**
455
- * Auth requests supports multiple initialization methods.
456
- */
457
- export type AuthRequestMethod =
458
- | { userKey: { protected_user_key: UnsignedSharedKey } }
459
- | { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
460
-
461
- /**
462
- * Represents the request to initialize the user\'s organizational cryptographic state.
463
- */
464
- export interface InitOrgCryptoRequest {
465
- /**
466
- * The encryption keys for all the organizations the user is a part of
467
- */
468
- organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
469
- }
470
-
471
489
  /**
472
490
  * The crypto method used to initialize the user cryptographic state.
473
491
  */
@@ -488,82 +506,44 @@ export type InitUserCryptoMethod =
488
506
  | { keyConnector: { master_key: B64; user_key: EncString } };
489
507
 
490
508
  /**
491
- * Response from the `make_update_password` function
509
+ * Represents the request to initialize the user\'s organizational cryptographic state.
492
510
  */
493
- export interface UpdatePasswordResponse {
494
- /**
495
- * Hash of the new password
496
- */
497
- passwordHash: B64;
511
+ export interface InitOrgCryptoRequest {
498
512
  /**
499
- * User key, encrypted with the new password
513
+ * The encryption keys for all the organizations the user is a part of
500
514
  */
501
- newKey: EncString;
515
+ organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
502
516
  }
503
517
 
504
518
  /**
505
- * Response from the `update_kdf` function
519
+ * State used for initializing the user cryptographic state.
506
520
  */
507
- export interface UpdateKdfResponse {
521
+ export interface InitUserCryptoRequest {
508
522
  /**
509
- * The authentication data for the new KDF setting
523
+ * The user\'s ID.
510
524
  */
511
- masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
525
+ userId: UserId | undefined;
512
526
  /**
513
- * The unlock data for the new KDF setting
527
+ * The user\'s KDF parameters, as received from the prelogin request
514
528
  */
515
- masterPasswordUnlockData: MasterPasswordUnlockData;
529
+ kdfParams: Kdf;
516
530
  /**
517
- * The authentication data for the KDF setting prior to the change
531
+ * The user\'s email address
518
532
  */
519
- oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
520
- }
521
-
522
- export interface DeriveKeyConnectorError extends Error {
523
- name: "DeriveKeyConnectorError";
524
- variant: "WrongPassword" | "Crypto";
525
- }
526
-
527
- export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
528
-
529
- /**
530
- * Request for deriving a pin protected user key
531
- */
532
- export interface EnrollPinResponse {
533
+ email: string;
533
534
  /**
534
- * [UserKey] protected by PIN
535
+ * The user\'s account cryptographic state, containing their signature and
536
+ * public-key-encryption keys, along with the signed security state, protected by the user key
535
537
  */
536
- pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
538
+ accountCryptographicState: WrappedAccountCryptographicState;
537
539
  /**
538
- * PIN protected by [UserKey]
540
+ * The method to decrypt the user\'s account symmetric key (user key)
539
541
  */
540
- userKeyEncryptedPin: EncString;
542
+ method: InitUserCryptoMethod;
541
543
  }
542
544
 
543
545
  /**
544
- * Request for migrating an account from password to key connector.
545
- */
546
- export interface DeriveKeyConnectorRequest {
547
- /**
548
- * Encrypted user key, used to validate the master key
549
- */
550
- userKeyEncrypted: EncString;
551
- /**
552
- * The user\'s master password
553
- */
554
- password: string;
555
- /**
556
- * The KDF parameters used to derive the master key
557
- */
558
- kdf: Kdf;
559
- /**
560
- * The user\'s email address
561
- */
562
- email: string;
563
- }
564
-
565
- /**
566
- * Request for `verify_asymmetric_keys`.
546
+ * Request for `verify_asymmetric_keys`.
567
547
  */
568
548
  export interface VerifyAsymmetricKeysRequest {
569
549
  /**
@@ -580,34 +560,6 @@ export interface VerifyAsymmetricKeysRequest {
580
560
  userKeyEncryptedPrivateKey: EncString;
581
561
  }
582
562
 
583
- /**
584
- * Response for `verify_asymmetric_keys`.
585
- */
586
- export interface VerifyAsymmetricKeysResponse {
587
- /**
588
- * Whether the user\'s private key was decryptable by the user key.
589
- */
590
- privateKeyDecryptable: boolean;
591
- /**
592
- * Whether the user\'s private key was a valid RSA key and matched the public key provided.
593
- */
594
- validPrivateKey: boolean;
595
- }
596
-
597
- /**
598
- * Request for deriving a pin protected user key
599
- */
600
- export interface DerivePinKeyResponse {
601
- /**
602
- * [UserKey] protected by PIN
603
- */
604
- pinProtectedUserKey: EncString;
605
- /**
606
- * PIN protected by [UserKey]
607
- */
608
- encryptedPin: EncString;
609
- }
610
-
611
563
  /**
612
564
  * Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
613
565
  */
@@ -647,56 +599,104 @@ export interface UserCryptoV2KeysResponse {
647
599
  }
648
600
 
649
601
  /**
650
- * State used for initializing the user cryptographic state.
602
+ * Request for migrating an account from password to key connector.
651
603
  */
652
- export interface InitUserCryptoRequest {
604
+ export interface DeriveKeyConnectorRequest {
653
605
  /**
654
- * The user\'s ID.
606
+ * Encrypted user key, used to validate the master key
655
607
  */
656
- userId: UserId | undefined;
608
+ userKeyEncrypted: EncString;
657
609
  /**
658
- * The user\'s KDF parameters, as received from the prelogin request
610
+ * The user\'s master password
659
611
  */
660
- kdfParams: Kdf;
612
+ password: string;
613
+ /**
614
+ * The KDF parameters used to derive the master key
615
+ */
616
+ kdf: Kdf;
661
617
  /**
662
618
  * The user\'s email address
663
619
  */
664
620
  email: string;
621
+ }
622
+
623
+ /**
624
+ * Response from the `make_update_password` function
625
+ */
626
+ export interface UpdatePasswordResponse {
665
627
  /**
666
- * The user\'s account cryptographic state, containing their signature and
667
- * public-key-encryption keys, along with the signed security state, protected by the user key
628
+ * Hash of the new password
668
629
  */
669
- accountCryptographicState: WrappedAccountCryptographicState;
630
+ passwordHash: B64;
670
631
  /**
671
- * The method to decrypt the user\'s account symmetric key (user key)
632
+ * User key, encrypted with the new password
672
633
  */
673
- method: InitUserCryptoMethod;
634
+ newKey: EncString;
635
+ }
636
+
637
+ export interface DeriveKeyConnectorError extends Error {
638
+ name: "DeriveKeyConnectorError";
639
+ variant: "WrongPassword" | "Crypto";
674
640
  }
675
641
 
642
+ export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
643
+
676
644
  /**
677
- * Response from the `make_key_pair` function
645
+ * Request for deriving a pin protected user key
678
646
  */
679
- export interface MakeKeyPairResponse {
647
+ export interface DerivePinKeyResponse {
680
648
  /**
681
- * The user\'s public key
649
+ * [UserKey] protected by PIN
682
650
  */
683
- userPublicKey: B64;
651
+ pinProtectedUserKey: EncString;
684
652
  /**
685
- * User\'s private key, encrypted with the user key
653
+ * PIN protected by [UserKey]
686
654
  */
687
- userKeyEncryptedPrivateKey: EncString;
655
+ encryptedPin: EncString;
688
656
  }
689
657
 
690
658
  /**
691
- * NewType wrapper for `UserId`
659
+ * Response from the `update_kdf` function
692
660
  */
693
- export type UserId = Tagged<Uuid, "UserId">;
661
+ export interface UpdateKdfResponse {
662
+ /**
663
+ * The authentication data for the new KDF setting
664
+ */
665
+ masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
666
+ /**
667
+ * The unlock data for the new KDF setting
668
+ */
669
+ masterPasswordUnlockData: MasterPasswordUnlockData;
670
+ /**
671
+ * The authentication data for the KDF setting prior to the change
672
+ */
673
+ oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
674
+ }
675
+
676
+ /**
677
+ * Response for `verify_asymmetric_keys`.
678
+ */
679
+ export interface VerifyAsymmetricKeysResponse {
680
+ /**
681
+ * Whether the user\'s private key was decryptable by the user key.
682
+ */
683
+ privateKeyDecryptable: boolean;
684
+ /**
685
+ * Whether the user\'s private key was a valid RSA key and matched the public key provided.
686
+ */
687
+ validPrivateKey: boolean;
688
+ }
694
689
 
695
690
  /**
696
691
  * NewType wrapper for `OrganizationId`
697
692
  */
698
693
  export type OrganizationId = Tagged<Uuid, "OrganizationId">;
699
694
 
695
+ /**
696
+ * NewType wrapper for `UserId`
697
+ */
698
+ export type UserId = Tagged<Uuid, "UserId">;
699
+
700
700
  export interface StatefulCryptoError extends Error {
701
701
  name: "StatefulCryptoError";
702
702
  variant: "MissingSecurityState" | "WrongAccountCryptoVersion" | "Crypto";
@@ -704,35 +704,6 @@ export interface StatefulCryptoError extends Error {
704
704
 
705
705
  export function isStatefulCryptoError(error: any): error is StatefulCryptoError;
706
706
 
707
- export type DeviceType =
708
- | "Android"
709
- | "iOS"
710
- | "ChromeExtension"
711
- | "FirefoxExtension"
712
- | "OperaExtension"
713
- | "EdgeExtension"
714
- | "WindowsDesktop"
715
- | "MacOsDesktop"
716
- | "LinuxDesktop"
717
- | "ChromeBrowser"
718
- | "FirefoxBrowser"
719
- | "OperaBrowser"
720
- | "EdgeBrowser"
721
- | "IEBrowser"
722
- | "UnknownBrowser"
723
- | "AndroidAmazon"
724
- | "UWP"
725
- | "SafariBrowser"
726
- | "VivaldiBrowser"
727
- | "VivaldiExtension"
728
- | "SafariExtension"
729
- | "SDK"
730
- | "Server"
731
- | "WindowsCLI"
732
- | "MacOsCLI"
733
- | "LinuxCLI"
734
- | "DuckDuckGoBrowser";
735
-
736
707
  /**
737
708
  * Basic client behavior settings. These settings specify the various targets and behavior of the
738
709
  * Bitwarden Client. They are optional and uneditable once the client is initialized.
@@ -774,6 +745,35 @@ export interface ClientSettings {
774
745
  bitwardenClientVersion?: string | undefined;
775
746
  }
776
747
 
748
+ export type DeviceType =
749
+ | "Android"
750
+ | "iOS"
751
+ | "ChromeExtension"
752
+ | "FirefoxExtension"
753
+ | "OperaExtension"
754
+ | "EdgeExtension"
755
+ | "WindowsDesktop"
756
+ | "MacOsDesktop"
757
+ | "LinuxDesktop"
758
+ | "ChromeBrowser"
759
+ | "FirefoxBrowser"
760
+ | "OperaBrowser"
761
+ | "EdgeBrowser"
762
+ | "IEBrowser"
763
+ | "UnknownBrowser"
764
+ | "AndroidAmazon"
765
+ | "UWP"
766
+ | "SafariBrowser"
767
+ | "VivaldiBrowser"
768
+ | "VivaldiExtension"
769
+ | "SafariExtension"
770
+ | "SDK"
771
+ | "Server"
772
+ | "WindowsCLI"
773
+ | "MacOsCLI"
774
+ | "LinuxCLI"
775
+ | "DuckDuckGoBrowser";
776
+
777
777
  export interface EncryptionSettingsError extends Error {
778
778
  name: "EncryptionSettingsError";
779
779
  variant:
@@ -905,6 +905,8 @@ export interface ExportError extends Error {
905
905
 
906
906
  export function isExportError(error: any): error is ExportError;
907
907
 
908
+ export type PassphraseError = { InvalidNumWords: { minimum: number; maximum: number } };
909
+
908
910
  /**
909
911
  * Passphrase generator request options.
910
912
  */
@@ -929,8 +931,6 @@ export interface PassphraseGeneratorRequest {
929
931
  includeNumber: boolean;
930
932
  }
931
933
 
932
- export type PassphraseError = { InvalidNumWords: { minimum: number; maximum: number } };
933
-
934
934
  export interface PasswordError extends Error {
935
935
  name: "PasswordError";
936
936
  variant: "NoCharacterSetEnabled" | "InvalidLength";
@@ -990,7 +990,11 @@ export interface PasswordGeneratorRequest {
990
990
  minSpecial: number | undefined;
991
991
  }
992
992
 
993
- export type AppendType = "random" | { websiteName: { website: string } };
993
+ export type UsernameGeneratorRequest =
994
+ | { word: { capitalize: boolean; include_number: boolean } }
995
+ | { subaddress: { type: AppendType; email: string } }
996
+ | { catchall: { type: AppendType; domain: string } }
997
+ | { forwarded: { service: ForwarderServiceType; website: string | undefined } };
994
998
 
995
999
  export interface UsernameError extends Error {
996
1000
  name: "UsernameError";
@@ -999,11 +1003,7 @@ export interface UsernameError extends Error {
999
1003
 
1000
1004
  export function isUsernameError(error: any): error is UsernameError;
1001
1005
 
1002
- export type UsernameGeneratorRequest =
1003
- | { word: { capitalize: boolean; include_number: boolean } }
1004
- | { subaddress: { type: AppendType; email: string } }
1005
- | { catchall: { type: AppendType; domain: string } }
1006
- | { forwarded: { service: ForwarderServiceType; website: string | undefined } };
1006
+ export type AppendType = "random" | { websiteName: { website: string } };
1007
1007
 
1008
1008
  /**
1009
1009
  * Configures the email forwarding service to use.
@@ -1018,6 +1018,13 @@ export type ForwarderServiceType =
1018
1018
  | { forwardEmail: { api_token: string; domain: string } }
1019
1019
  | { simpleLogin: { api_key: string; base_url: string } };
1020
1020
 
1021
+ export interface ReceiveError extends Error {
1022
+ name: "ReceiveError";
1023
+ variant: "Channel" | "Timeout" | "Cancelled";
1024
+ }
1025
+
1026
+ export function isReceiveError(error: any): error is ReceiveError;
1027
+
1021
1028
  export interface RequestError extends Error {
1022
1029
  name: "RequestError";
1023
1030
  variant: "Subscribe" | "Receive" | "Timeout" | "Send" | "Rpc";
@@ -1025,13 +1032,6 @@ export interface RequestError extends Error {
1025
1032
 
1026
1033
  export function isRequestError(error: any): error is RequestError;
1027
1034
 
1028
- export interface TypedReceiveError extends Error {
1029
- name: "TypedReceiveError";
1030
- variant: "Channel" | "Timeout" | "Cancelled" | "Typing";
1031
- }
1032
-
1033
- export function isTypedReceiveError(error: any): error is TypedReceiveError;
1034
-
1035
1035
  export interface SubscribeError extends Error {
1036
1036
  name: "SubscribeError";
1037
1037
  variant: "NotStarted";
@@ -1039,12 +1039,12 @@ export interface SubscribeError extends Error {
1039
1039
 
1040
1040
  export function isSubscribeError(error: any): error is SubscribeError;
1041
1041
 
1042
- export interface ReceiveError extends Error {
1043
- name: "ReceiveError";
1044
- variant: "Channel" | "Timeout" | "Cancelled";
1042
+ export interface TypedReceiveError extends Error {
1043
+ name: "TypedReceiveError";
1044
+ variant: "Channel" | "Timeout" | "Cancelled" | "Typing";
1045
1045
  }
1046
1046
 
1047
- export function isReceiveError(error: any): error is ReceiveError;
1047
+ export function isTypedReceiveError(error: any): error is TypedReceiveError;
1048
1048
 
1049
1049
  export interface IpcCommunicationBackendSender {
1050
1050
  send(message: OutgoingMessage): Promise<void>;
@@ -1079,13 +1079,6 @@ export type Endpoint =
1079
1079
  | "DesktopRenderer"
1080
1080
  | "DesktopMain";
1081
1081
 
1082
- export interface KeyGenerationError extends Error {
1083
- name: "KeyGenerationError";
1084
- variant: "KeyGeneration" | "KeyConversion";
1085
- }
1086
-
1087
- export function isKeyGenerationError(error: any): error is KeyGenerationError;
1088
-
1089
1082
  export interface SshKeyExportError extends Error {
1090
1083
  name: "SshKeyExportError";
1091
1084
  variant: "KeyConversion";
@@ -1093,6 +1086,13 @@ export interface SshKeyExportError extends Error {
1093
1086
 
1094
1087
  export function isSshKeyExportError(error: any): error is SshKeyExportError;
1095
1088
 
1089
+ export interface KeyGenerationError extends Error {
1090
+ name: "KeyGenerationError";
1091
+ variant: "KeyGeneration" | "KeyConversion";
1092
+ }
1093
+
1094
+ export function isKeyGenerationError(error: any): error is KeyGenerationError;
1095
+
1096
1096
  export interface SshKeyImportError extends Error {
1097
1097
  name: "SshKeyImportError";
1098
1098
  variant: "Parsing" | "PasswordRequired" | "WrongPassword" | "UnsupportedKeyType";
@@ -1130,30 +1130,24 @@ export interface CipherRiskError extends Error {
1130
1130
  export function isCipherRiskError(error: any): error is CipherRiskError;
1131
1131
 
1132
1132
  /**
1133
- * Risk evaluation result for a single cipher.
1133
+ * Options for configuring risk computation.
1134
1134
  */
1135
- export interface CipherRiskResult {
1135
+ export interface CipherRiskOptions {
1136
1136
  /**
1137
- * Cipher ID matching the input CipherLoginDetails.
1137
+ * Pre-computed password reuse map (password → count).
1138
+ * If provided, enables reuse detection across ciphers.
1138
1139
  */
1139
- id: CipherId;
1140
+ passwordMap?: PasswordReuseMap | undefined;
1140
1141
  /**
1141
- * Password strength score from 0 (weakest) to 4 (strongest).
1142
- * Calculated using zxcvbn with cipher-specific context.
1143
- */
1144
- password_strength: number;
1145
- /**
1146
- * Result of checking password exposure via HIBP API.
1147
- * - `NotChecked`: check_exposed was false, or password was empty
1148
- * - `Found(n)`: Successfully checked, found in n breaches
1149
- * - `Error(msg)`: HIBP API request failed for this cipher with the given error message
1142
+ * Whether to check passwords against Have I Been Pwned API.
1143
+ * When true, makes network requests to check for exposed passwords.
1150
1144
  */
1151
- exposed_result: ExposedPasswordResult;
1145
+ checkExposed?: boolean;
1152
1146
  /**
1153
- * Number of times this password appears in the provided password_map.
1154
- * None if not found or if no password_map was provided.
1147
+ * Optional HIBP API base URL override. When None, uses the production HIBP URL.
1148
+ * Can be used for testing or alternative password breach checking services.
1155
1149
  */
1156
- reuse_count: number | undefined;
1150
+ hibpBaseUrl?: string | undefined;
1157
1151
  }
1158
1152
 
1159
1153
  /**
@@ -1174,11 +1168,6 @@ export interface CipherLoginDetails {
1174
1168
  username: string | undefined;
1175
1169
  }
1176
1170
 
1177
- /**
1178
- * Password reuse map wrapper for WASM compatibility.
1179
- */
1180
- export type PasswordReuseMap = Record<string, number>;
1181
-
1182
1171
  /**
1183
1172
  * Result of checking password exposure via HIBP API.
1184
1173
  */
@@ -1188,33 +1177,44 @@ export type ExposedPasswordResult =
1188
1177
  | { type: "Error"; value: string };
1189
1178
 
1190
1179
  /**
1191
- * Options for configuring risk computation.
1180
+ * Password reuse map wrapper for WASM compatibility.
1192
1181
  */
1193
- export interface CipherRiskOptions {
1182
+ export type PasswordReuseMap = Record<string, number>;
1183
+
1184
+ /**
1185
+ * Risk evaluation result for a single cipher.
1186
+ */
1187
+ export interface CipherRiskResult {
1194
1188
  /**
1195
- * Pre-computed password reuse map (password → count).
1196
- * If provided, enables reuse detection across ciphers.
1189
+ * Cipher ID matching the input CipherLoginDetails.
1197
1190
  */
1198
- passwordMap?: PasswordReuseMap | undefined;
1191
+ id: CipherId;
1199
1192
  /**
1200
- * Whether to check passwords against Have I Been Pwned API.
1201
- * When true, makes network requests to check for exposed passwords.
1193
+ * Password strength score from 0 (weakest) to 4 (strongest).
1194
+ * Calculated using zxcvbn with cipher-specific context.
1202
1195
  */
1203
- checkExposed?: boolean;
1196
+ password_strength: number;
1204
1197
  /**
1205
- * Optional HIBP API base URL override. When None, uses the production HIBP URL.
1206
- * Can be used for testing or alternative password breach checking services.
1198
+ * Result of checking password exposure via HIBP API.
1199
+ * - `NotChecked`: check_exposed was false, or password was empty
1200
+ * - `Found(n)`: Successfully checked, found in n breaches
1201
+ * - `Error(msg)`: HIBP API request failed for this cipher with the given error message
1207
1202
  */
1208
- hibpBaseUrl?: string | undefined;
1203
+ exposed_result: ExposedPasswordResult;
1204
+ /**
1205
+ * Number of times this password appears in the provided password_map.
1206
+ * None if not found or if no password_map was provided.
1207
+ */
1208
+ reuse_count: number | undefined;
1209
1209
  }
1210
1210
 
1211
- export interface PasswordHistory {
1212
- password: EncString;
1211
+ export interface PasswordHistoryView {
1212
+ password: string;
1213
1213
  lastUsedDate: DateTime<Utc>;
1214
1214
  }
1215
1215
 
1216
- export interface PasswordHistoryView {
1217
- password: string;
1216
+ export interface PasswordHistory {
1217
+ password: EncString;
1218
1218
  lastUsedDate: DateTime<Utc>;
1219
1219
  }
1220
1220
 
@@ -1222,13 +1222,6 @@ export interface AncestorMap {
1222
1222
  ancestors: Map<CollectionId, string>;
1223
1223
  }
1224
1224
 
1225
- export interface TotpError extends Error {
1226
- name: "TotpError";
1227
- variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
1228
- }
1229
-
1230
- export function isTotpError(error: any): error is TotpError;
1231
-
1232
1225
  export interface TotpResponse {
1233
1226
  /**
1234
1227
  * Generated TOTP code
@@ -1240,6 +1233,13 @@ export interface TotpResponse {
1240
1233
  period: number;
1241
1234
  }
1242
1235
 
1236
+ export interface TotpError extends Error {
1237
+ name: "TotpError";
1238
+ variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
1239
+ }
1240
+
1241
+ export function isTotpError(error: any): error is TotpError;
1242
+
1243
1243
  export interface DecryptError extends Error {
1244
1244
  name: "DecryptError";
1245
1245
  variant: "Crypto";
@@ -1254,6 +1254,18 @@ export interface EncryptError extends Error {
1254
1254
 
1255
1255
  export function isEncryptError(error: any): error is EncryptError;
1256
1256
 
1257
+ export interface Attachment {
1258
+ id: string | undefined;
1259
+ url: string | undefined;
1260
+ size: string | undefined;
1261
+ /**
1262
+ * Readable size, ex: \"4.2 KB\" or \"1.43 GB\
1263
+ */
1264
+ sizeName: string | undefined;
1265
+ fileName: EncString | undefined;
1266
+ key: EncString | undefined;
1267
+ }
1268
+
1257
1269
  export interface AttachmentView {
1258
1270
  id: string | undefined;
1259
1271
  url: string | undefined;
@@ -1276,18 +1288,6 @@ export interface AttachmentView {
1276
1288
  decryptedKey: string | undefined;
1277
1289
  }
1278
1290
 
1279
- export interface Attachment {
1280
- id: string | undefined;
1281
- url: string | undefined;
1282
- size: string | undefined;
1283
- /**
1284
- * Readable size, ex: \"4.2 KB\" or \"1.43 GB\
1285
- */
1286
- sizeName: string | undefined;
1287
- fileName: EncString | undefined;
1288
- key: EncString | undefined;
1289
- }
1290
-
1291
1291
  export interface LocalData {
1292
1292
  lastUsedDate: DateTime<Utc> | undefined;
1293
1293
  lastLaunched: DateTime<Utc> | undefined;
@@ -1298,11 +1298,11 @@ export interface LocalDataView {
1298
1298
  lastLaunched: DateTime<Utc> | undefined;
1299
1299
  }
1300
1300
 
1301
- export interface SecureNote {
1301
+ export interface SecureNoteView {
1302
1302
  type: SecureNoteType;
1303
1303
  }
1304
1304
 
1305
- export interface SecureNoteView {
1305
+ export interface SecureNote {
1306
1306
  type: SecureNoteType;
1307
1307
  }
1308
1308
 
@@ -1313,21 +1313,6 @@ export interface GetCipherError extends Error {
1313
1313
 
1314
1314
  export function isGetCipherError(error: any): error is GetCipherError;
1315
1315
 
1316
- export interface EditCipherError extends Error {
1317
- name: "EditCipherError";
1318
- variant:
1319
- | "ItemNotFound"
1320
- | "Crypto"
1321
- | "Api"
1322
- | "VaultParse"
1323
- | "MissingField"
1324
- | "NotAuthenticated"
1325
- | "Repository"
1326
- | "Uuid";
1327
- }
1328
-
1329
- export function isEditCipherError(error: any): error is EditCipherError;
1330
-
1331
1316
  /**
1332
1317
  * Request to edit a cipher.
1333
1318
  */
@@ -1347,6 +1332,28 @@ export interface CipherEditRequest {
1347
1332
  key: EncString | undefined;
1348
1333
  }
1349
1334
 
1335
+ export interface EditCipherError extends Error {
1336
+ name: "EditCipherError";
1337
+ variant:
1338
+ | "ItemNotFound"
1339
+ | "Crypto"
1340
+ | "Api"
1341
+ | "VaultParse"
1342
+ | "MissingField"
1343
+ | "NotAuthenticated"
1344
+ | "Repository"
1345
+ | "Uuid";
1346
+ }
1347
+
1348
+ export function isEditCipherError(error: any): error is EditCipherError;
1349
+
1350
+ export interface CreateCipherError extends Error {
1351
+ name: "CreateCipherError";
1352
+ variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
1353
+ }
1354
+
1355
+ export function isCreateCipherError(error: any): error is CreateCipherError;
1356
+
1350
1357
  /**
1351
1358
  * Request to add a cipher.
1352
1359
  */
@@ -1361,13 +1368,6 @@ export interface CipherCreateRequest {
1361
1368
  fields: FieldView[];
1362
1369
  }
1363
1370
 
1364
- export interface CreateCipherError extends Error {
1365
- name: "CreateCipherError";
1366
- variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
1367
- }
1368
-
1369
- export function isCreateCipherError(error: any): error is CreateCipherError;
1370
-
1371
1371
  /**
1372
1372
  * Represents the inner data of a cipher view.
1373
1373
  */
@@ -1397,6 +1397,15 @@ export interface CipherPermissions {
1397
1397
  restore: boolean;
1398
1398
  }
1399
1399
 
1400
+ export interface Card {
1401
+ cardholderName: EncString | undefined;
1402
+ expMonth: EncString | undefined;
1403
+ expYear: EncString | undefined;
1404
+ code: EncString | undefined;
1405
+ brand: EncString | undefined;
1406
+ number: EncString | undefined;
1407
+ }
1408
+
1400
1409
  export interface CardView {
1401
1410
  cardholderName: string | undefined;
1402
1411
  expMonth: string | undefined;
@@ -1416,13 +1425,11 @@ export interface CardListView {
1416
1425
  brand: string | undefined;
1417
1426
  }
1418
1427
 
1419
- export interface Card {
1420
- cardholderName: EncString | undefined;
1421
- expMonth: EncString | undefined;
1422
- expYear: EncString | undefined;
1423
- code: EncString | undefined;
1424
- brand: EncString | undefined;
1425
- number: EncString | undefined;
1428
+ export interface FieldView {
1429
+ name: string | undefined;
1430
+ value: string | undefined;
1431
+ type: FieldType;
1432
+ linkedId: LinkedIdType | undefined;
1426
1433
  }
1427
1434
 
1428
1435
  export interface Field {
@@ -1432,11 +1439,24 @@ export interface Field {
1432
1439
  linkedId: LinkedIdType | undefined;
1433
1440
  }
1434
1441
 
1435
- export interface FieldView {
1436
- name: string | undefined;
1437
- value: string | undefined;
1438
- type: FieldType;
1439
- linkedId: LinkedIdType | undefined;
1442
+ export interface LoginView {
1443
+ username: string | undefined;
1444
+ password: string | undefined;
1445
+ passwordRevisionDate: DateTime<Utc> | undefined;
1446
+ uris: LoginUriView[] | undefined;
1447
+ totp: string | undefined;
1448
+ autofillOnPageLoad: boolean | undefined;
1449
+ fido2Credentials: Fido2Credential[] | undefined;
1450
+ }
1451
+
1452
+ export interface Login {
1453
+ username: EncString | undefined;
1454
+ password: EncString | undefined;
1455
+ passwordRevisionDate: DateTime<Utc> | undefined;
1456
+ uris: LoginUri[] | undefined;
1457
+ totp: EncString | undefined;
1458
+ autofillOnPageLoad: boolean | undefined;
1459
+ fido2Credentials: Fido2Credential[] | undefined;
1440
1460
  }
1441
1461
 
1442
1462
  export interface LoginUri {
@@ -1445,13 +1465,18 @@ export interface LoginUri {
1445
1465
  uriChecksum: EncString | undefined;
1446
1466
  }
1447
1467
 
1448
- export interface Fido2CredentialListView {
1468
+ export interface Fido2CredentialNewView {
1449
1469
  credentialId: string;
1470
+ keyType: string;
1471
+ keyAlgorithm: string;
1472
+ keyCurve: string;
1450
1473
  rpId: string;
1451
1474
  userHandle: string | undefined;
1452
1475
  userName: string | undefined;
1453
- userDisplayName: string | undefined;
1454
1476
  counter: string;
1477
+ rpName: string | undefined;
1478
+ userDisplayName: string | undefined;
1479
+ creationDate: DateTime<Utc>;
1455
1480
  }
1456
1481
 
1457
1482
  export interface Fido2CredentialFullView {
@@ -1470,23 +1495,6 @@ export interface Fido2CredentialFullView {
1470
1495
  creationDate: DateTime<Utc>;
1471
1496
  }
1472
1497
 
1473
- export interface LoginUriView {
1474
- uri: string | undefined;
1475
- match: UriMatchType | undefined;
1476
- uriChecksum: string | undefined;
1477
- }
1478
-
1479
- export interface LoginListView {
1480
- fido2Credentials: Fido2CredentialListView[] | undefined;
1481
- hasFido2: boolean;
1482
- username: string | undefined;
1483
- /**
1484
- * The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
1485
- */
1486
- totp: EncString | undefined;
1487
- uris: LoginUriView[] | undefined;
1488
- }
1489
-
1490
1498
  export interface Fido2CredentialView {
1491
1499
  credentialId: string;
1492
1500
  keyType: string;
@@ -1503,38 +1511,21 @@ export interface Fido2CredentialView {
1503
1511
  creationDate: DateTime<Utc>;
1504
1512
  }
1505
1513
 
1506
- export interface LoginView {
1507
- username: string | undefined;
1508
- password: string | undefined;
1509
- passwordRevisionDate: DateTime<Utc> | undefined;
1510
- uris: LoginUriView[] | undefined;
1511
- totp: string | undefined;
1512
- autofillOnPageLoad: boolean | undefined;
1513
- fido2Credentials: Fido2Credential[] | undefined;
1514
- }
1515
-
1516
- export interface Fido2CredentialNewView {
1517
- credentialId: string;
1518
- keyType: string;
1519
- keyAlgorithm: string;
1520
- keyCurve: string;
1521
- rpId: string;
1522
- userHandle: string | undefined;
1523
- userName: string | undefined;
1524
- counter: string;
1525
- rpName: string | undefined;
1526
- userDisplayName: string | undefined;
1527
- creationDate: DateTime<Utc>;
1514
+ export interface LoginUriView {
1515
+ uri: string | undefined;
1516
+ match: UriMatchType | undefined;
1517
+ uriChecksum: string | undefined;
1528
1518
  }
1529
1519
 
1530
- export interface Login {
1531
- username: EncString | undefined;
1532
- password: EncString | undefined;
1533
- passwordRevisionDate: DateTime<Utc> | undefined;
1534
- uris: LoginUri[] | undefined;
1520
+ export interface LoginListView {
1521
+ fido2Credentials: Fido2CredentialListView[] | undefined;
1522
+ hasFido2: boolean;
1523
+ username: string | undefined;
1524
+ /**
1525
+ * The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
1526
+ */
1535
1527
  totp: EncString | undefined;
1536
- autofillOnPageLoad: boolean | undefined;
1537
- fido2Credentials: Fido2Credential[] | undefined;
1528
+ uris: LoginUriView[] | undefined;
1538
1529
  }
1539
1530
 
1540
1531
  export interface Fido2Credential {
@@ -1553,44 +1544,83 @@ export interface Fido2Credential {
1553
1544
  creationDate: DateTime<Utc>;
1554
1545
  }
1555
1546
 
1556
- /**
1557
- * NewType wrapper for `CipherId`
1558
- */
1559
- export type CipherId = Tagged<Uuid, "CipherId">;
1547
+ export interface Fido2CredentialListView {
1548
+ credentialId: string;
1549
+ rpId: string;
1550
+ userHandle: string | undefined;
1551
+ userName: string | undefined;
1552
+ userDisplayName: string | undefined;
1553
+ counter: string;
1554
+ }
1560
1555
 
1561
- export interface Cipher {
1556
+ export interface CipherListView {
1562
1557
  id: CipherId | undefined;
1563
1558
  organizationId: OrganizationId | undefined;
1564
1559
  folderId: FolderId | undefined;
1565
1560
  collectionIds: CollectionId[];
1566
1561
  /**
1567
- * More recent ciphers uses individual encryption keys to encrypt the other fields of the
1568
- * Cipher.
1562
+ * Temporary, required to support calculating TOTP from CipherListView.
1569
1563
  */
1570
1564
  key: EncString | undefined;
1571
- name: EncString;
1572
- notes: EncString | undefined;
1565
+ name: string;
1566
+ subtitle: string;
1567
+ type: CipherListViewType;
1568
+ favorite: boolean;
1569
+ reprompt: CipherRepromptType;
1570
+ organizationUseTotp: boolean;
1571
+ edit: boolean;
1572
+ permissions: CipherPermissions | undefined;
1573
+ viewPassword: boolean;
1574
+ /**
1575
+ * The number of attachments
1576
+ */
1577
+ attachments: number;
1578
+ /**
1579
+ * Indicates if the cipher has old attachments that need to be re-uploaded
1580
+ */
1581
+ hasOldAttachments: boolean;
1582
+ creationDate: DateTime<Utc>;
1583
+ deletedDate: DateTime<Utc> | undefined;
1584
+ revisionDate: DateTime<Utc>;
1585
+ archivedDate: DateTime<Utc> | undefined;
1586
+ /**
1587
+ * Hints for the presentation layer for which fields can be copied.
1588
+ */
1589
+ copyableFields: CopyableCipherFields[];
1590
+ localData: LocalDataView | undefined;
1591
+ }
1592
+
1593
+ export interface CipherView {
1594
+ id: CipherId | undefined;
1595
+ organizationId: OrganizationId | undefined;
1596
+ folderId: FolderId | undefined;
1597
+ collectionIds: CollectionId[];
1598
+ /**
1599
+ * Temporary, required to support re-encrypting existing items.
1600
+ */
1601
+ key: EncString | undefined;
1602
+ name: string;
1603
+ notes: string | undefined;
1573
1604
  type: CipherType;
1574
- login: Login | undefined;
1575
- identity: Identity | undefined;
1576
- card: Card | undefined;
1577
- secureNote: SecureNote | undefined;
1578
- sshKey: SshKey | undefined;
1605
+ login: LoginView | undefined;
1606
+ identity: IdentityView | undefined;
1607
+ card: CardView | undefined;
1608
+ secureNote: SecureNoteView | undefined;
1609
+ sshKey: SshKeyView | undefined;
1579
1610
  favorite: boolean;
1580
1611
  reprompt: CipherRepromptType;
1581
1612
  organizationUseTotp: boolean;
1582
1613
  edit: boolean;
1583
1614
  permissions: CipherPermissions | undefined;
1584
1615
  viewPassword: boolean;
1585
- localData: LocalData | undefined;
1586
- attachments: Attachment[] | undefined;
1587
- fields: Field[] | undefined;
1588
- passwordHistory: PasswordHistory[] | undefined;
1616
+ localData: LocalDataView | undefined;
1617
+ attachments: AttachmentView[] | undefined;
1618
+ fields: FieldView[] | undefined;
1619
+ passwordHistory: PasswordHistoryView[] | undefined;
1589
1620
  creationDate: DateTime<Utc>;
1590
1621
  deletedDate: DateTime<Utc> | undefined;
1591
1622
  revisionDate: DateTime<Utc>;
1592
1623
  archivedDate: DateTime<Utc> | undefined;
1593
- data: string | undefined;
1594
1624
  }
1595
1625
 
1596
1626
  /**
@@ -1611,6 +1641,11 @@ export interface DecryptCipherListResult {
1611
1641
  failures: Cipher[];
1612
1642
  }
1613
1643
 
1644
+ /**
1645
+ * NewType wrapper for `CipherId`
1646
+ */
1647
+ export type CipherId = Tagged<Uuid, "CipherId">;
1648
+
1614
1649
  export interface CipherError extends Error {
1615
1650
  name: "CipherError";
1616
1651
  variant:
@@ -1629,90 +1664,55 @@ export interface CipherError extends Error {
1629
1664
 
1630
1665
  export function isCipherError(error: any): error is CipherError;
1631
1666
 
1632
- export interface EncryptionContext {
1633
- /**
1634
- * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
1635
- * Organization-owned ciphers
1636
- */
1637
- encryptedFor: UserId;
1638
- cipher: Cipher;
1639
- }
1640
-
1641
- export type CipherListViewType =
1642
- | { login: LoginListView }
1643
- | "secureNote"
1644
- | { card: CardListView }
1645
- | "identity"
1646
- | "sshKey";
1647
-
1648
- export interface CipherListView {
1667
+ export interface Cipher {
1649
1668
  id: CipherId | undefined;
1650
1669
  organizationId: OrganizationId | undefined;
1651
1670
  folderId: FolderId | undefined;
1652
1671
  collectionIds: CollectionId[];
1653
1672
  /**
1654
- * Temporary, required to support calculating TOTP from CipherListView.
1673
+ * More recent ciphers uses individual encryption keys to encrypt the other fields of the
1674
+ * Cipher.
1655
1675
  */
1656
1676
  key: EncString | undefined;
1657
- name: string;
1658
- subtitle: string;
1659
- type: CipherListViewType;
1677
+ name: EncString;
1678
+ notes: EncString | undefined;
1679
+ type: CipherType;
1680
+ login: Login | undefined;
1681
+ identity: Identity | undefined;
1682
+ card: Card | undefined;
1683
+ secureNote: SecureNote | undefined;
1684
+ sshKey: SshKey | undefined;
1660
1685
  favorite: boolean;
1661
1686
  reprompt: CipherRepromptType;
1662
1687
  organizationUseTotp: boolean;
1663
1688
  edit: boolean;
1664
1689
  permissions: CipherPermissions | undefined;
1665
1690
  viewPassword: boolean;
1666
- /**
1667
- * The number of attachments
1668
- */
1669
- attachments: number;
1670
- /**
1671
- * Indicates if the cipher has old attachments that need to be re-uploaded
1672
- */
1673
- hasOldAttachments: boolean;
1691
+ localData: LocalData | undefined;
1692
+ attachments: Attachment[] | undefined;
1693
+ fields: Field[] | undefined;
1694
+ passwordHistory: PasswordHistory[] | undefined;
1674
1695
  creationDate: DateTime<Utc>;
1675
1696
  deletedDate: DateTime<Utc> | undefined;
1676
1697
  revisionDate: DateTime<Utc>;
1677
1698
  archivedDate: DateTime<Utc> | undefined;
1678
- /**
1679
- * Hints for the presentation layer for which fields can be copied.
1680
- */
1681
- copyableFields: CopyableCipherFields[];
1682
- localData: LocalDataView | undefined;
1699
+ data: string | undefined;
1683
1700
  }
1684
1701
 
1685
- export interface CipherView {
1686
- id: CipherId | undefined;
1687
- organizationId: OrganizationId | undefined;
1688
- folderId: FolderId | undefined;
1689
- collectionIds: CollectionId[];
1702
+ export type CipherListViewType =
1703
+ | { login: LoginListView }
1704
+ | "secureNote"
1705
+ | { card: CardListView }
1706
+ | "identity"
1707
+ | "sshKey";
1708
+
1709
+ export interface EncryptionContext {
1690
1710
  /**
1691
- * Temporary, required to support re-encrypting existing items.
1711
+ * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
1712
+ * Organization-owned ciphers
1692
1713
  */
1693
- key: EncString | undefined;
1694
- name: string;
1695
- notes: string | undefined;
1696
- type: CipherType;
1697
- login: LoginView | undefined;
1698
- identity: IdentityView | undefined;
1699
- card: CardView | undefined;
1700
- secureNote: SecureNoteView | undefined;
1701
- sshKey: SshKeyView | undefined;
1702
- favorite: boolean;
1703
- reprompt: CipherRepromptType;
1704
- organizationUseTotp: boolean;
1705
- edit: boolean;
1706
- permissions: CipherPermissions | undefined;
1707
- viewPassword: boolean;
1708
- localData: LocalDataView | undefined;
1709
- attachments: AttachmentView[] | undefined;
1710
- fields: FieldView[] | undefined;
1711
- passwordHistory: PasswordHistoryView[] | undefined;
1712
- creationDate: DateTime<Utc>;
1713
- deletedDate: DateTime<Utc> | undefined;
1714
- revisionDate: DateTime<Utc>;
1715
- archivedDate: DateTime<Utc> | undefined;
1714
+ encryptedFor: UserId;
1715
+ cipher: Cipher;
1716
1716
  }
1717
1717
 
1718
1718
  /**
@@ -1761,27 +1761,6 @@ export interface SshKey {
1761
1761
  fingerprint: EncString;
1762
1762
  }
1763
1763
 
1764
- export interface IdentityView {
1765
- title: string | undefined;
1766
- firstName: string | undefined;
1767
- middleName: string | undefined;
1768
- lastName: string | undefined;
1769
- address1: string | undefined;
1770
- address2: string | undefined;
1771
- address3: string | undefined;
1772
- city: string | undefined;
1773
- state: string | undefined;
1774
- postalCode: string | undefined;
1775
- country: string | undefined;
1776
- company: string | undefined;
1777
- email: string | undefined;
1778
- phone: string | undefined;
1779
- ssn: string | undefined;
1780
- username: string | undefined;
1781
- passportNumber: string | undefined;
1782
- licenseNumber: string | undefined;
1783
- }
1784
-
1785
1764
  export interface Identity {
1786
1765
  title: EncString | undefined;
1787
1766
  firstName: EncString | undefined;
@@ -1803,6 +1782,27 @@ export interface Identity {
1803
1782
  licenseNumber: EncString | undefined;
1804
1783
  }
1805
1784
 
1785
+ export interface IdentityView {
1786
+ title: string | undefined;
1787
+ firstName: string | undefined;
1788
+ middleName: string | undefined;
1789
+ lastName: string | undefined;
1790
+ address1: string | undefined;
1791
+ address2: string | undefined;
1792
+ address3: string | undefined;
1793
+ city: string | undefined;
1794
+ state: string | undefined;
1795
+ postalCode: string | undefined;
1796
+ country: string | undefined;
1797
+ company: string | undefined;
1798
+ email: string | undefined;
1799
+ phone: string | undefined;
1800
+ ssn: string | undefined;
1801
+ username: string | undefined;
1802
+ passportNumber: string | undefined;
1803
+ licenseNumber: string | undefined;
1804
+ }
1805
+
1806
1806
  export type LinkedIdType = LoginLinkedIdType | CardLinkedIdType | IdentityLinkedIdType;
1807
1807
 
1808
1808
  export interface FolderView {
@@ -1836,6 +1836,13 @@ export interface EditFolderError extends Error {
1836
1836
 
1837
1837
  export function isEditFolderError(error: any): error is EditFolderError;
1838
1838
 
1839
+ export interface CreateFolderError extends Error {
1840
+ name: "CreateFolderError";
1841
+ variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "Repository";
1842
+ }
1843
+
1844
+ export function isCreateFolderError(error: any): error is CreateFolderError;
1845
+
1839
1846
  /**
1840
1847
  * Request to add or edit a folder.
1841
1848
  */
@@ -1846,13 +1853,6 @@ export interface FolderAddEditRequest {
1846
1853
  name: string;
1847
1854
  }
1848
1855
 
1849
- export interface CreateFolderError extends Error {
1850
- name: "CreateFolderError";
1851
- variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "Repository";
1852
- }
1853
-
1854
- export function isCreateFolderError(error: any): error is CreateFolderError;
1855
-
1856
1856
  export interface GetFolderError extends Error {
1857
1857
  name: "GetFolderError";
1858
1858
  variant: "ItemNotFound" | "Crypto" | "Repository";