@bitwarden/sdk-internal 0.2.0-main.425 → 0.2.0-main.427
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +468 -468
- package/bitwarden_wasm_internal_bg.js +75 -75
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +7 -7
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +468 -468
- package/node/bitwarden_wasm_internal.js +79 -79
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +7 -7
- package/package.json +1 -1
|
@@ -194,14 +194,6 @@ export interface IndexedDbConfiguration {
|
|
|
194
194
|
db_name: string;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
/**
|
|
198
|
-
* The credentials used for send access requests.
|
|
199
|
-
*/
|
|
200
|
-
export type SendAccessCredentials =
|
|
201
|
-
| SendPasswordCredentials
|
|
202
|
-
| SendEmailOtpCredentials
|
|
203
|
-
| SendEmailCredentials;
|
|
204
|
-
|
|
205
197
|
/**
|
|
206
198
|
* Credentials for sending an OTP to the user\'s email address.
|
|
207
199
|
* This is used when the send requires email verification with an OTP.
|
|
@@ -253,6 +245,28 @@ export interface SendAccessTokenRequest {
|
|
|
253
245
|
sendAccessCredentials?: SendAccessCredentials;
|
|
254
246
|
}
|
|
255
247
|
|
|
248
|
+
/**
|
|
249
|
+
* The credentials used for send access requests.
|
|
250
|
+
*/
|
|
251
|
+
export type SendAccessCredentials =
|
|
252
|
+
| SendPasswordCredentials
|
|
253
|
+
| SendEmailOtpCredentials
|
|
254
|
+
| SendEmailCredentials;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* A send access token which can be used to access a send.
|
|
258
|
+
*/
|
|
259
|
+
export interface SendAccessTokenResponse {
|
|
260
|
+
/**
|
|
261
|
+
* The actual token string.
|
|
262
|
+
*/
|
|
263
|
+
token: string;
|
|
264
|
+
/**
|
|
265
|
+
* The timestamp in milliseconds when the token expires.
|
|
266
|
+
*/
|
|
267
|
+
expiresAt: number;
|
|
268
|
+
}
|
|
269
|
+
|
|
256
270
|
/**
|
|
257
271
|
* Represents errors that can occur when requesting a send access token.
|
|
258
272
|
* It includes expected and unexpected API errors.
|
|
@@ -272,18 +286,14 @@ export type SendAccessTokenError =
|
|
|
272
286
|
export type UnexpectedIdentityError = string;
|
|
273
287
|
|
|
274
288
|
/**
|
|
275
|
-
*
|
|
289
|
+
* Invalid request errors - typically due to missing parameters.
|
|
276
290
|
*/
|
|
277
|
-
export
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
* The timestamp in milliseconds when the token expires.
|
|
284
|
-
*/
|
|
285
|
-
expiresAt: number;
|
|
286
|
-
}
|
|
291
|
+
export type SendAccessTokenInvalidRequestError =
|
|
292
|
+
| "send_id_required"
|
|
293
|
+
| "password_hash_b64_required"
|
|
294
|
+
| "email_required"
|
|
295
|
+
| "email_and_otp_required_otp_sent"
|
|
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 request errors - typically due to missing parameters.
|
|
310
|
-
*/
|
|
311
|
-
export type SendAccessTokenInvalidRequestError =
|
|
312
|
-
| "send_id_required"
|
|
313
|
-
| "password_hash_b64_required"
|
|
314
|
-
| "email_required"
|
|
315
|
-
| "email_and_otp_required_otp_sent"
|
|
316
|
-
| "unknown";
|
|
317
|
-
|
|
318
318
|
/**
|
|
319
319
|
* Invalid grant errors - typically due to invalid credentials.
|
|
320
320
|
*/
|
|
@@ -350,14 +350,14 @@ export interface Collection {
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
/**
|
|
353
|
-
*
|
|
353
|
+
* Type of collection
|
|
354
354
|
*/
|
|
355
|
-
export type
|
|
355
|
+
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
356
356
|
|
|
357
357
|
/**
|
|
358
|
-
*
|
|
358
|
+
* NewType wrapper for `CollectionId`
|
|
359
359
|
*/
|
|
360
|
-
export type
|
|
360
|
+
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
361
361
|
|
|
362
362
|
export interface CollectionDecryptError extends Error {
|
|
363
363
|
name: "CollectionDecryptError";
|
|
@@ -368,18 +368,6 @@ export function isCollectionDecryptError(error: any): error is CollectionDecrypt
|
|
|
368
368
|
|
|
369
369
|
export type SignedSecurityState = string;
|
|
370
370
|
|
|
371
|
-
export interface MasterPasswordError extends Error {
|
|
372
|
-
name: "MasterPasswordError";
|
|
373
|
-
variant:
|
|
374
|
-
| "EncryptionKeyMalformed"
|
|
375
|
-
| "KdfMalformed"
|
|
376
|
-
| "InvalidKdfConfiguration"
|
|
377
|
-
| "MissingField"
|
|
378
|
-
| "Crypto";
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export function isMasterPasswordError(error: any): error is MasterPasswordError;
|
|
382
|
-
|
|
383
371
|
/**
|
|
384
372
|
* Represents the data required to unlock with the master password.
|
|
385
373
|
*/
|
|
@@ -398,6 +386,18 @@ export interface MasterPasswordUnlockData {
|
|
|
398
386
|
salt: string;
|
|
399
387
|
}
|
|
400
388
|
|
|
389
|
+
export interface MasterPasswordError extends Error {
|
|
390
|
+
name: "MasterPasswordError";
|
|
391
|
+
variant:
|
|
392
|
+
| "EncryptionKeyMalformed"
|
|
393
|
+
| "KdfMalformed"
|
|
394
|
+
| "InvalidKdfConfiguration"
|
|
395
|
+
| "MissingField"
|
|
396
|
+
| "Crypto";
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export function isMasterPasswordError(error: any): error is MasterPasswordError;
|
|
400
|
+
|
|
401
401
|
/**
|
|
402
402
|
* Represents the data required to authenticate with the master password.
|
|
403
403
|
*/
|
|
@@ -437,77 +437,86 @@ export function isAccountCryptographyInitializationError(
|
|
|
437
437
|
error: any,
|
|
438
438
|
): error is AccountCryptographyInitializationError;
|
|
439
439
|
|
|
440
|
+
export interface CryptoClientError extends Error {
|
|
441
|
+
name: "CryptoClientError";
|
|
442
|
+
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
446
|
+
|
|
447
|
+
export interface EnrollAdminPasswordResetError extends Error {
|
|
448
|
+
name: "EnrollAdminPasswordResetError";
|
|
449
|
+
variant: "Crypto";
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
453
|
+
|
|
440
454
|
/**
|
|
441
|
-
*
|
|
455
|
+
* Auth requests supports multiple initialization methods.
|
|
442
456
|
*/
|
|
443
|
-
export
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
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 {
|
|
448
465
|
/**
|
|
449
|
-
*
|
|
466
|
+
* The encryption keys for all the organizations the user is a part of
|
|
450
467
|
*/
|
|
451
|
-
|
|
468
|
+
organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
|
|
452
469
|
}
|
|
453
470
|
|
|
454
471
|
/**
|
|
455
|
-
*
|
|
472
|
+
* The crypto method used to initialize the user cryptographic state.
|
|
456
473
|
*/
|
|
457
|
-
export
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
signingKey: EncString;
|
|
478
|
-
/**
|
|
479
|
-
* Base64 encoded verifying key
|
|
480
|
-
*/
|
|
481
|
-
verifyingKey: B64;
|
|
474
|
+
export type InitUserCryptoMethod =
|
|
475
|
+
| { password: { password: string; user_key: EncString } }
|
|
476
|
+
| { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
|
|
477
|
+
| { decryptedKey: { decrypted_user_key: string } }
|
|
478
|
+
| { pin: { pin: string; pin_protected_user_key: EncString } }
|
|
479
|
+
| { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
|
|
480
|
+
| { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
|
|
481
|
+
| {
|
|
482
|
+
deviceKey: {
|
|
483
|
+
device_key: string;
|
|
484
|
+
protected_device_private_key: EncString;
|
|
485
|
+
device_protected_user_key: UnsignedSharedKey;
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Response from the `make_update_password` function
|
|
492
|
+
*/
|
|
493
|
+
export interface UpdatePasswordResponse {
|
|
482
494
|
/**
|
|
483
|
-
*
|
|
495
|
+
* Hash of the new password
|
|
484
496
|
*/
|
|
485
|
-
|
|
497
|
+
passwordHash: B64;
|
|
486
498
|
/**
|
|
487
|
-
*
|
|
499
|
+
* User key, encrypted with the new password
|
|
488
500
|
*/
|
|
489
|
-
|
|
501
|
+
newKey: EncString;
|
|
490
502
|
}
|
|
491
503
|
|
|
492
504
|
/**
|
|
493
|
-
*
|
|
494
|
-
*/
|
|
495
|
-
export type AuthRequestMethod =
|
|
496
|
-
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
497
|
-
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Response from the `make_key_pair` function
|
|
505
|
+
* Response from the `update_kdf` function
|
|
501
506
|
*/
|
|
502
|
-
export interface
|
|
507
|
+
export interface UpdateKdfResponse {
|
|
503
508
|
/**
|
|
504
|
-
* The
|
|
509
|
+
* The authentication data for the new KDF setting
|
|
505
510
|
*/
|
|
506
|
-
|
|
511
|
+
masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
507
512
|
/**
|
|
508
|
-
*
|
|
513
|
+
* The unlock data for the new KDF setting
|
|
509
514
|
*/
|
|
510
|
-
|
|
515
|
+
masterPasswordUnlockData: MasterPasswordUnlockData;
|
|
516
|
+
/**
|
|
517
|
+
* The authentication data for the KDF setting prior to the change
|
|
518
|
+
*/
|
|
519
|
+
oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
511
520
|
}
|
|
512
521
|
|
|
513
522
|
export interface DeriveKeyConnectorError extends Error {
|
|
@@ -518,184 +527,175 @@ export interface DeriveKeyConnectorError extends Error {
|
|
|
518
527
|
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
519
528
|
|
|
520
529
|
/**
|
|
521
|
-
*
|
|
530
|
+
* Request for deriving a pin protected user key
|
|
522
531
|
*/
|
|
523
|
-
export interface
|
|
532
|
+
export interface EnrollPinResponse {
|
|
524
533
|
/**
|
|
525
|
-
*
|
|
534
|
+
* [UserKey] protected by PIN
|
|
526
535
|
*/
|
|
527
|
-
|
|
536
|
+
pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
|
|
537
|
+
/**
|
|
538
|
+
* PIN protected by [UserKey]
|
|
539
|
+
*/
|
|
540
|
+
userKeyEncryptedPin: EncString;
|
|
528
541
|
}
|
|
529
542
|
|
|
530
543
|
/**
|
|
531
|
-
*
|
|
544
|
+
* Request for migrating an account from password to key connector.
|
|
532
545
|
*/
|
|
533
|
-
export interface
|
|
546
|
+
export interface DeriveKeyConnectorRequest {
|
|
534
547
|
/**
|
|
535
|
-
*
|
|
548
|
+
* Encrypted user key, used to validate the master key
|
|
536
549
|
*/
|
|
537
|
-
|
|
550
|
+
userKeyEncrypted: EncString;
|
|
538
551
|
/**
|
|
539
|
-
* The user\'s
|
|
552
|
+
* The user\'s master password
|
|
540
553
|
*/
|
|
541
|
-
|
|
554
|
+
password: string;
|
|
555
|
+
/**
|
|
556
|
+
* The KDF parameters used to derive the master key
|
|
557
|
+
*/
|
|
558
|
+
kdf: Kdf;
|
|
542
559
|
/**
|
|
543
560
|
* The user\'s email address
|
|
544
561
|
*/
|
|
545
562
|
email: string;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Request for `verify_asymmetric_keys`.
|
|
567
|
+
*/
|
|
568
|
+
export interface VerifyAsymmetricKeysRequest {
|
|
546
569
|
/**
|
|
547
|
-
* The user\'s
|
|
548
|
-
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
570
|
+
* The user\'s user key
|
|
549
571
|
*/
|
|
550
|
-
|
|
572
|
+
userKey: B64;
|
|
551
573
|
/**
|
|
552
|
-
* The
|
|
574
|
+
* The user\'s public key
|
|
553
575
|
*/
|
|
554
|
-
|
|
576
|
+
userPublicKey: B64;
|
|
577
|
+
/**
|
|
578
|
+
* User\'s private key, encrypted with the user key
|
|
579
|
+
*/
|
|
580
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
555
581
|
}
|
|
556
582
|
|
|
557
583
|
/**
|
|
558
|
-
*
|
|
584
|
+
* Response for `verify_asymmetric_keys`.
|
|
559
585
|
*/
|
|
560
|
-
export interface
|
|
586
|
+
export interface VerifyAsymmetricKeysResponse {
|
|
561
587
|
/**
|
|
562
|
-
*
|
|
588
|
+
* Whether the user\'s private key was decryptable by the user key.
|
|
563
589
|
*/
|
|
564
|
-
|
|
590
|
+
privateKeyDecryptable: boolean;
|
|
565
591
|
/**
|
|
566
|
-
*
|
|
592
|
+
* Whether the user\'s private key was a valid RSA key and matched the public key provided.
|
|
567
593
|
*/
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
export interface CryptoClientError extends Error {
|
|
572
|
-
name: "CryptoClientError";
|
|
573
|
-
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
594
|
+
validPrivateKey: boolean;
|
|
574
595
|
}
|
|
575
596
|
|
|
576
|
-
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
577
|
-
|
|
578
597
|
/**
|
|
579
|
-
*
|
|
598
|
+
* Request for deriving a pin protected user key
|
|
580
599
|
*/
|
|
581
|
-
export interface
|
|
600
|
+
export interface DerivePinKeyResponse {
|
|
582
601
|
/**
|
|
583
|
-
*
|
|
602
|
+
* [UserKey] protected by PIN
|
|
584
603
|
*/
|
|
585
|
-
|
|
604
|
+
pinProtectedUserKey: EncString;
|
|
586
605
|
/**
|
|
587
|
-
*
|
|
606
|
+
* PIN protected by [UserKey]
|
|
588
607
|
*/
|
|
589
|
-
|
|
608
|
+
encryptedPin: EncString;
|
|
590
609
|
}
|
|
591
610
|
|
|
592
611
|
/**
|
|
593
|
-
*
|
|
612
|
+
* Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
|
|
594
613
|
*/
|
|
595
|
-
export interface
|
|
614
|
+
export interface UserCryptoV2KeysResponse {
|
|
596
615
|
/**
|
|
597
|
-
*
|
|
616
|
+
* User key
|
|
598
617
|
*/
|
|
599
618
|
userKey: B64;
|
|
600
619
|
/**
|
|
601
|
-
*
|
|
620
|
+
* Wrapped private key
|
|
602
621
|
*/
|
|
603
|
-
|
|
622
|
+
privateKey: EncString;
|
|
604
623
|
/**
|
|
605
|
-
*
|
|
624
|
+
* Public key
|
|
606
625
|
*/
|
|
607
|
-
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* The crypto method used to initialize the user cryptographic state.
|
|
612
|
-
*/
|
|
613
|
-
export type InitUserCryptoMethod =
|
|
614
|
-
| { password: { password: string; user_key: EncString } }
|
|
615
|
-
| { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
|
|
616
|
-
| { decryptedKey: { decrypted_user_key: string } }
|
|
617
|
-
| { pin: { pin: string; pin_protected_user_key: EncString } }
|
|
618
|
-
| { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
|
|
619
|
-
| { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
|
|
620
|
-
| {
|
|
621
|
-
deviceKey: {
|
|
622
|
-
device_key: string;
|
|
623
|
-
protected_device_private_key: EncString;
|
|
624
|
-
device_protected_user_key: UnsignedSharedKey;
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
628
|
-
|
|
629
|
-
export interface EnrollAdminPasswordResetError extends Error {
|
|
630
|
-
name: "EnrollAdminPasswordResetError";
|
|
631
|
-
variant: "Crypto";
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
635
|
-
|
|
636
|
-
/**
|
|
637
|
-
* Response from the `update_kdf` function
|
|
638
|
-
*/
|
|
639
|
-
export interface UpdateKdfResponse {
|
|
626
|
+
publicKey: B64;
|
|
640
627
|
/**
|
|
641
|
-
* The
|
|
628
|
+
* The user\'s public key, signed by the signing key
|
|
642
629
|
*/
|
|
643
|
-
|
|
630
|
+
signedPublicKey: SignedPublicKey;
|
|
644
631
|
/**
|
|
645
|
-
*
|
|
632
|
+
* Signing key, encrypted with the user\'s symmetric key
|
|
646
633
|
*/
|
|
647
|
-
|
|
634
|
+
signingKey: EncString;
|
|
648
635
|
/**
|
|
649
|
-
*
|
|
636
|
+
* Base64 encoded verifying key
|
|
650
637
|
*/
|
|
651
|
-
|
|
638
|
+
verifyingKey: B64;
|
|
639
|
+
/**
|
|
640
|
+
* The user\'s signed security state
|
|
641
|
+
*/
|
|
642
|
+
securityState: SignedSecurityState;
|
|
643
|
+
/**
|
|
644
|
+
* The security state\'s version
|
|
645
|
+
*/
|
|
646
|
+
securityVersion: number;
|
|
652
647
|
}
|
|
653
648
|
|
|
654
649
|
/**
|
|
655
|
-
*
|
|
650
|
+
* State used for initializing the user cryptographic state.
|
|
656
651
|
*/
|
|
657
|
-
export interface
|
|
658
|
-
/**
|
|
659
|
-
* Encrypted user key, used to validate the master key
|
|
660
|
-
*/
|
|
661
|
-
userKeyEncrypted: EncString;
|
|
652
|
+
export interface InitUserCryptoRequest {
|
|
662
653
|
/**
|
|
663
|
-
* The user\'s
|
|
654
|
+
* The user\'s ID.
|
|
664
655
|
*/
|
|
665
|
-
|
|
656
|
+
userId: UserId | undefined;
|
|
666
657
|
/**
|
|
667
|
-
* The KDF parameters
|
|
658
|
+
* The user\'s KDF parameters, as received from the prelogin request
|
|
668
659
|
*/
|
|
669
|
-
|
|
660
|
+
kdfParams: Kdf;
|
|
670
661
|
/**
|
|
671
662
|
* The user\'s email address
|
|
672
663
|
*/
|
|
673
664
|
email: string;
|
|
665
|
+
/**
|
|
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
|
|
668
|
+
*/
|
|
669
|
+
accountCryptographicState: WrappedAccountCryptographicState;
|
|
670
|
+
/**
|
|
671
|
+
* The method to decrypt the user\'s account symmetric key (user key)
|
|
672
|
+
*/
|
|
673
|
+
method: InitUserCryptoMethod;
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
/**
|
|
677
|
-
*
|
|
677
|
+
* Response from the `make_key_pair` function
|
|
678
678
|
*/
|
|
679
|
-
export interface
|
|
679
|
+
export interface MakeKeyPairResponse {
|
|
680
680
|
/**
|
|
681
|
-
*
|
|
681
|
+
* The user\'s public key
|
|
682
682
|
*/
|
|
683
|
-
|
|
683
|
+
userPublicKey: B64;
|
|
684
684
|
/**
|
|
685
|
-
*
|
|
685
|
+
* User\'s private key, encrypted with the user key
|
|
686
686
|
*/
|
|
687
|
-
|
|
687
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
/**
|
|
691
|
-
* NewType wrapper for `
|
|
691
|
+
* NewType wrapper for `UserId`
|
|
692
692
|
*/
|
|
693
|
-
export type
|
|
693
|
+
export type UserId = Tagged<Uuid, "UserId">;
|
|
694
694
|
|
|
695
695
|
/**
|
|
696
|
-
* NewType wrapper for `
|
|
696
|
+
* NewType wrapper for `OrganizationId`
|
|
697
697
|
*/
|
|
698
|
-
export type
|
|
698
|
+
export type OrganizationId = Tagged<Uuid, "OrganizationId">;
|
|
699
699
|
|
|
700
700
|
export interface StatefulCryptoError extends Error {
|
|
701
701
|
name: "StatefulCryptoError";
|
|
@@ -704,6 +704,35 @@ 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
|
+
|
|
707
736
|
/**
|
|
708
737
|
* Basic client behavior settings. These settings specify the various targets and behavior of the
|
|
709
738
|
* Bitwarden Client. They are optional and uneditable once the client is initialized.
|
|
@@ -745,35 +774,6 @@ export interface ClientSettings {
|
|
|
745
774
|
bitwardenClientVersion?: string | undefined;
|
|
746
775
|
}
|
|
747
776
|
|
|
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,8 +905,6 @@ 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
|
-
|
|
910
908
|
/**
|
|
911
909
|
* Passphrase generator request options.
|
|
912
910
|
*/
|
|
@@ -931,6 +929,8 @@ export interface PassphraseGeneratorRequest {
|
|
|
931
929
|
includeNumber: boolean;
|
|
932
930
|
}
|
|
933
931
|
|
|
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";
|
|
@@ -992,19 +992,6 @@ export interface PasswordGeneratorRequest {
|
|
|
992
992
|
|
|
993
993
|
export type AppendType = "random" | { websiteName: { website: string } };
|
|
994
994
|
|
|
995
|
-
/**
|
|
996
|
-
* Configures the email forwarding service to use.
|
|
997
|
-
* For instructions on how to configure each service, see the documentation:
|
|
998
|
-
* <https://bitwarden.com/help/generator/#username-types>
|
|
999
|
-
*/
|
|
1000
|
-
export type ForwarderServiceType =
|
|
1001
|
-
| { addyIo: { api_token: string; domain: string; base_url: string } }
|
|
1002
|
-
| { duckDuckGo: { token: string } }
|
|
1003
|
-
| { firefox: { api_token: string } }
|
|
1004
|
-
| { fastmail: { api_token: string } }
|
|
1005
|
-
| { forwardEmail: { api_token: string; domain: string } }
|
|
1006
|
-
| { simpleLogin: { api_key: string; base_url: string } };
|
|
1007
|
-
|
|
1008
995
|
export interface UsernameError extends Error {
|
|
1009
996
|
name: "UsernameError";
|
|
1010
997
|
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
@@ -1018,6 +1005,19 @@ export type UsernameGeneratorRequest =
|
|
|
1018
1005
|
| { catchall: { type: AppendType; domain: string } }
|
|
1019
1006
|
| { forwarded: { service: ForwarderServiceType; website: string | undefined } };
|
|
1020
1007
|
|
|
1008
|
+
/**
|
|
1009
|
+
* Configures the email forwarding service to use.
|
|
1010
|
+
* For instructions on how to configure each service, see the documentation:
|
|
1011
|
+
* <https://bitwarden.com/help/generator/#username-types>
|
|
1012
|
+
*/
|
|
1013
|
+
export type ForwarderServiceType =
|
|
1014
|
+
| { addyIo: { api_token: string; domain: string; base_url: string } }
|
|
1015
|
+
| { duckDuckGo: { token: string } }
|
|
1016
|
+
| { firefox: { api_token: string } }
|
|
1017
|
+
| { fastmail: { api_token: string } }
|
|
1018
|
+
| { forwardEmail: { api_token: string; domain: string } }
|
|
1019
|
+
| { simpleLogin: { api_key: string; base_url: string } };
|
|
1020
|
+
|
|
1021
1021
|
export interface RequestError extends Error {
|
|
1022
1022
|
name: "RequestError";
|
|
1023
1023
|
variant: "Subscribe" | "Receive" | "Timeout" | "Send" | "Rpc";
|
|
@@ -1079,13 +1079,6 @@ export type Endpoint =
|
|
|
1079
1079
|
| "DesktopRenderer"
|
|
1080
1080
|
| "DesktopMain";
|
|
1081
1081
|
|
|
1082
|
-
export interface SshKeyExportError extends Error {
|
|
1083
|
-
name: "SshKeyExportError";
|
|
1084
|
-
variant: "KeyConversion";
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
export function isSshKeyExportError(error: any): error is SshKeyExportError;
|
|
1088
|
-
|
|
1089
1082
|
export interface KeyGenerationError extends Error {
|
|
1090
1083
|
name: "KeyGenerationError";
|
|
1091
1084
|
variant: "KeyGeneration" | "KeyConversion";
|
|
@@ -1093,6 +1086,13 @@ export interface KeyGenerationError extends Error {
|
|
|
1093
1086
|
|
|
1094
1087
|
export function isKeyGenerationError(error: any): error is KeyGenerationError;
|
|
1095
1088
|
|
|
1089
|
+
export interface SshKeyExportError extends Error {
|
|
1090
|
+
name: "SshKeyExportError";
|
|
1091
|
+
variant: "KeyConversion";
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export function isSshKeyExportError(error: any): error is SshKeyExportError;
|
|
1095
|
+
|
|
1096
1096
|
export interface SshKeyImportError extends Error {
|
|
1097
1097
|
name: "SshKeyImportError";
|
|
1098
1098
|
variant: "Parsing" | "PasswordRequired" | "WrongPassword" | "UnsupportedKeyType";
|
|
@@ -1130,63 +1130,63 @@ export interface CipherRiskError extends Error {
|
|
|
1130
1130
|
export function isCipherRiskError(error: any): error is CipherRiskError;
|
|
1131
1131
|
|
|
1132
1132
|
/**
|
|
1133
|
-
*
|
|
1133
|
+
* Risk evaluation result for a single cipher.
|
|
1134
1134
|
*/
|
|
1135
|
-
export interface
|
|
1135
|
+
export interface CipherRiskResult {
|
|
1136
1136
|
/**
|
|
1137
|
-
* Cipher ID
|
|
1137
|
+
* Cipher ID matching the input CipherLoginDetails.
|
|
1138
1138
|
*/
|
|
1139
1139
|
id: CipherId;
|
|
1140
1140
|
/**
|
|
1141
|
-
*
|
|
1141
|
+
* Password strength score from 0 (weakest) to 4 (strongest).
|
|
1142
|
+
* Calculated using zxcvbn with cipher-specific context.
|
|
1142
1143
|
*/
|
|
1143
|
-
|
|
1144
|
+
password_strength: number;
|
|
1144
1145
|
/**
|
|
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
|
|
1146
1150
|
*/
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
| { type: "NotChecked" }
|
|
1155
|
-
| { type: "Found"; value: number }
|
|
1156
|
-
| { type: "Error"; value: string };
|
|
1157
|
-
|
|
1158
|
-
/**
|
|
1159
|
-
* Password reuse map wrapper for WASM compatibility.
|
|
1160
|
-
*/
|
|
1161
|
-
export type PasswordReuseMap = Record<string, number>;
|
|
1151
|
+
exposed_result: ExposedPasswordResult;
|
|
1152
|
+
/**
|
|
1153
|
+
* Number of times this password appears in the provided password_map.
|
|
1154
|
+
* None if not found or if no password_map was provided.
|
|
1155
|
+
*/
|
|
1156
|
+
reuse_count: number | undefined;
|
|
1157
|
+
}
|
|
1162
1158
|
|
|
1163
1159
|
/**
|
|
1164
|
-
*
|
|
1160
|
+
* Login cipher data needed for risk evaluation.
|
|
1165
1161
|
*/
|
|
1166
|
-
export interface
|
|
1162
|
+
export interface CipherLoginDetails {
|
|
1167
1163
|
/**
|
|
1168
|
-
* Cipher ID
|
|
1164
|
+
* Cipher ID to identify which cipher in results.
|
|
1169
1165
|
*/
|
|
1170
1166
|
id: CipherId;
|
|
1171
1167
|
/**
|
|
1172
|
-
*
|
|
1173
|
-
* Calculated using zxcvbn with cipher-specific context.
|
|
1174
|
-
*/
|
|
1175
|
-
password_strength: number;
|
|
1176
|
-
/**
|
|
1177
|
-
* Result of checking password exposure via HIBP API.
|
|
1178
|
-
* - `NotChecked`: check_exposed was false, or password was empty
|
|
1179
|
-
* - `Found(n)`: Successfully checked, found in n breaches
|
|
1180
|
-
* - `Error(msg)`: HIBP API request failed for this cipher with the given error message
|
|
1168
|
+
* The decrypted password to evaluate.
|
|
1181
1169
|
*/
|
|
1182
|
-
|
|
1170
|
+
password: string;
|
|
1183
1171
|
/**
|
|
1184
|
-
*
|
|
1185
|
-
* None if not found or if no password_map was provided.
|
|
1172
|
+
* Username or email (login ciphers only have one field).
|
|
1186
1173
|
*/
|
|
1187
|
-
|
|
1174
|
+
username: string | undefined;
|
|
1188
1175
|
}
|
|
1189
1176
|
|
|
1177
|
+
/**
|
|
1178
|
+
* Password reuse map wrapper for WASM compatibility.
|
|
1179
|
+
*/
|
|
1180
|
+
export type PasswordReuseMap = Record<string, number>;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Result of checking password exposure via HIBP API.
|
|
1184
|
+
*/
|
|
1185
|
+
export type ExposedPasswordResult =
|
|
1186
|
+
| { type: "NotChecked" }
|
|
1187
|
+
| { type: "Found"; value: number }
|
|
1188
|
+
| { type: "Error"; value: string };
|
|
1189
|
+
|
|
1190
1190
|
/**
|
|
1191
1191
|
* Options for configuring risk computation.
|
|
1192
1192
|
*/
|
|
@@ -1208,13 +1208,13 @@ export interface CipherRiskOptions {
|
|
|
1208
1208
|
hibpBaseUrl?: string | undefined;
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
-
export interface
|
|
1212
|
-
password:
|
|
1211
|
+
export interface PasswordHistory {
|
|
1212
|
+
password: EncString;
|
|
1213
1213
|
lastUsedDate: DateTime<Utc>;
|
|
1214
1214
|
}
|
|
1215
1215
|
|
|
1216
|
-
export interface
|
|
1217
|
-
password:
|
|
1216
|
+
export interface PasswordHistoryView {
|
|
1217
|
+
password: string;
|
|
1218
1218
|
lastUsedDate: DateTime<Utc>;
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
@@ -1222,6 +1222,13 @@ 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
|
+
|
|
1225
1232
|
export interface TotpResponse {
|
|
1226
1233
|
/**
|
|
1227
1234
|
* Generated TOTP code
|
|
@@ -1233,13 +1240,6 @@ export interface TotpResponse {
|
|
|
1233
1240
|
period: number;
|
|
1234
1241
|
}
|
|
1235
1242
|
|
|
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,18 +1254,6 @@ 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
|
-
|
|
1269
1257
|
export interface AttachmentView {
|
|
1270
1258
|
id: string | undefined;
|
|
1271
1259
|
url: string | undefined;
|
|
@@ -1288,12 +1276,24 @@ export interface AttachmentView {
|
|
|
1288
1276
|
decryptedKey: string | undefined;
|
|
1289
1277
|
}
|
|
1290
1278
|
|
|
1291
|
-
export interface
|
|
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
|
+
export interface LocalData {
|
|
1292
1292
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1293
1293
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1294
1294
|
}
|
|
1295
1295
|
|
|
1296
|
-
export interface
|
|
1296
|
+
export interface LocalDataView {
|
|
1297
1297
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1298
1298
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1299
1299
|
}
|
|
@@ -1378,13 +1378,6 @@ export type CipherViewType =
|
|
|
1378
1378
|
| { secureNote: SecureNoteView }
|
|
1379
1379
|
| { sshKey: SshKeyView };
|
|
1380
1380
|
|
|
1381
|
-
export interface DecryptFileError extends Error {
|
|
1382
|
-
name: "DecryptFileError";
|
|
1383
|
-
variant: "Decrypt" | "Io";
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
export function isDecryptFileError(error: any): error is DecryptFileError;
|
|
1387
|
-
|
|
1388
1381
|
export interface EncryptFileError extends Error {
|
|
1389
1382
|
name: "EncryptFileError";
|
|
1390
1383
|
variant: "Encrypt" | "Io";
|
|
@@ -1392,6 +1385,13 @@ export interface EncryptFileError extends Error {
|
|
|
1392
1385
|
|
|
1393
1386
|
export function isEncryptFileError(error: any): error is EncryptFileError;
|
|
1394
1387
|
|
|
1388
|
+
export interface DecryptFileError extends Error {
|
|
1389
|
+
name: "DecryptFileError";
|
|
1390
|
+
variant: "Decrypt" | "Io";
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
export function isDecryptFileError(error: any): error is DecryptFileError;
|
|
1394
|
+
|
|
1395
1395
|
export interface CipherPermissions {
|
|
1396
1396
|
delete: boolean;
|
|
1397
1397
|
restore: boolean;
|
|
@@ -1406,15 +1406,6 @@ export interface CardView {
|
|
|
1406
1406
|
number: string | undefined;
|
|
1407
1407
|
}
|
|
1408
1408
|
|
|
1409
|
-
export interface Card {
|
|
1410
|
-
cardholderName: EncString | undefined;
|
|
1411
|
-
expMonth: EncString | undefined;
|
|
1412
|
-
expYear: EncString | undefined;
|
|
1413
|
-
code: EncString | undefined;
|
|
1414
|
-
brand: EncString | undefined;
|
|
1415
|
-
number: EncString | undefined;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
1409
|
/**
|
|
1419
1410
|
* Minimal CardView only including the needed details for list views
|
|
1420
1411
|
*/
|
|
@@ -1425,6 +1416,15 @@ export interface CardListView {
|
|
|
1425
1416
|
brand: string | undefined;
|
|
1426
1417
|
}
|
|
1427
1418
|
|
|
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;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
1428
|
export interface Field {
|
|
1429
1429
|
name: EncString | undefined;
|
|
1430
1430
|
value: EncString | undefined;
|
|
@@ -1439,6 +1439,21 @@ export interface FieldView {
|
|
|
1439
1439
|
linkedId: LinkedIdType | undefined;
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
|
+
export interface LoginUri {
|
|
1443
|
+
uri: EncString | undefined;
|
|
1444
|
+
match: UriMatchType | undefined;
|
|
1445
|
+
uriChecksum: EncString | undefined;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
export interface Fido2CredentialListView {
|
|
1449
|
+
credentialId: string;
|
|
1450
|
+
rpId: string;
|
|
1451
|
+
userHandle: string | undefined;
|
|
1452
|
+
userName: string | undefined;
|
|
1453
|
+
userDisplayName: string | undefined;
|
|
1454
|
+
counter: string;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1442
1457
|
export interface Fido2CredentialFullView {
|
|
1443
1458
|
credentialId: string;
|
|
1444
1459
|
keyType: string;
|
|
@@ -1455,13 +1470,37 @@ export interface Fido2CredentialFullView {
|
|
|
1455
1470
|
creationDate: DateTime<Utc>;
|
|
1456
1471
|
}
|
|
1457
1472
|
|
|
1458
|
-
export interface
|
|
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
|
+
export interface Fido2CredentialView {
|
|
1459
1491
|
credentialId: string;
|
|
1492
|
+
keyType: string;
|
|
1493
|
+
keyAlgorithm: string;
|
|
1494
|
+
keyCurve: string;
|
|
1495
|
+
keyValue: EncString;
|
|
1460
1496
|
rpId: string;
|
|
1461
1497
|
userHandle: string | undefined;
|
|
1462
1498
|
userName: string | undefined;
|
|
1463
|
-
userDisplayName: string | undefined;
|
|
1464
1499
|
counter: string;
|
|
1500
|
+
rpName: string | undefined;
|
|
1501
|
+
userDisplayName: string | undefined;
|
|
1502
|
+
discoverable: string;
|
|
1503
|
+
creationDate: DateTime<Utc>;
|
|
1465
1504
|
}
|
|
1466
1505
|
|
|
1467
1506
|
export interface LoginView {
|
|
@@ -1474,15 +1513,18 @@ export interface LoginView {
|
|
|
1474
1513
|
fido2Credentials: Fido2Credential[] | undefined;
|
|
1475
1514
|
}
|
|
1476
1515
|
|
|
1477
|
-
export interface
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
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>;
|
|
1486
1528
|
}
|
|
1487
1529
|
|
|
1488
1530
|
export interface Login {
|
|
@@ -1511,122 +1553,46 @@ export interface Fido2Credential {
|
|
|
1511
1553
|
creationDate: DateTime<Utc>;
|
|
1512
1554
|
}
|
|
1513
1555
|
|
|
1514
|
-
export interface LoginUri {
|
|
1515
|
-
uri: EncString | undefined;
|
|
1516
|
-
match: UriMatchType | undefined;
|
|
1517
|
-
uriChecksum: EncString | undefined;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
export interface Fido2CredentialNewView {
|
|
1521
|
-
credentialId: string;
|
|
1522
|
-
keyType: string;
|
|
1523
|
-
keyAlgorithm: string;
|
|
1524
|
-
keyCurve: string;
|
|
1525
|
-
rpId: string;
|
|
1526
|
-
userHandle: string | undefined;
|
|
1527
|
-
userName: string | undefined;
|
|
1528
|
-
counter: string;
|
|
1529
|
-
rpName: string | undefined;
|
|
1530
|
-
userDisplayName: string | undefined;
|
|
1531
|
-
creationDate: DateTime<Utc>;
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
export interface LoginUriView {
|
|
1535
|
-
uri: string | undefined;
|
|
1536
|
-
match: UriMatchType | undefined;
|
|
1537
|
-
uriChecksum: string | undefined;
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
export interface Fido2CredentialView {
|
|
1541
|
-
credentialId: string;
|
|
1542
|
-
keyType: string;
|
|
1543
|
-
keyAlgorithm: string;
|
|
1544
|
-
keyCurve: string;
|
|
1545
|
-
keyValue: EncString;
|
|
1546
|
-
rpId: string;
|
|
1547
|
-
userHandle: string | undefined;
|
|
1548
|
-
userName: string | undefined;
|
|
1549
|
-
counter: string;
|
|
1550
|
-
rpName: string | undefined;
|
|
1551
|
-
userDisplayName: string | undefined;
|
|
1552
|
-
discoverable: string;
|
|
1553
|
-
creationDate: DateTime<Utc>;
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
export interface CipherError extends Error {
|
|
1557
|
-
name: "CipherError";
|
|
1558
|
-
variant:
|
|
1559
|
-
| "MissingField"
|
|
1560
|
-
| "Crypto"
|
|
1561
|
-
| "Decrypt"
|
|
1562
|
-
| "Encrypt"
|
|
1563
|
-
| "AttachmentsWithoutKeys"
|
|
1564
|
-
| "OrganizationAlreadySet"
|
|
1565
|
-
| "PutShare"
|
|
1566
|
-
| "PutShareMany"
|
|
1567
|
-
| "Repository"
|
|
1568
|
-
| "Chrono"
|
|
1569
|
-
| "SerdeJson";
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
export function isCipherError(error: any): error is CipherError;
|
|
1573
|
-
|
|
1574
1556
|
/**
|
|
1575
|
-
*
|
|
1557
|
+
* NewType wrapper for `CipherId`
|
|
1576
1558
|
*/
|
|
1577
|
-
export type
|
|
1578
|
-
| "LoginUsername"
|
|
1579
|
-
| "LoginPassword"
|
|
1580
|
-
| "LoginTotp"
|
|
1581
|
-
| "CardNumber"
|
|
1582
|
-
| "CardSecurityCode"
|
|
1583
|
-
| "IdentityUsername"
|
|
1584
|
-
| "IdentityEmail"
|
|
1585
|
-
| "IdentityPhone"
|
|
1586
|
-
| "IdentityAddress"
|
|
1587
|
-
| "SshKey"
|
|
1588
|
-
| "SecureNotes";
|
|
1559
|
+
export type CipherId = Tagged<Uuid, "CipherId">;
|
|
1589
1560
|
|
|
1590
|
-
export interface
|
|
1561
|
+
export interface Cipher {
|
|
1591
1562
|
id: CipherId | undefined;
|
|
1592
1563
|
organizationId: OrganizationId | undefined;
|
|
1593
1564
|
folderId: FolderId | undefined;
|
|
1594
1565
|
collectionIds: CollectionId[];
|
|
1595
1566
|
/**
|
|
1596
|
-
*
|
|
1567
|
+
* More recent ciphers uses individual encryption keys to encrypt the other fields of the
|
|
1568
|
+
* Cipher.
|
|
1597
1569
|
*/
|
|
1598
1570
|
key: EncString | undefined;
|
|
1599
|
-
name:
|
|
1600
|
-
notes:
|
|
1571
|
+
name: EncString;
|
|
1572
|
+
notes: EncString | undefined;
|
|
1601
1573
|
type: CipherType;
|
|
1602
|
-
login:
|
|
1603
|
-
identity:
|
|
1604
|
-
card:
|
|
1605
|
-
secureNote:
|
|
1606
|
-
sshKey:
|
|
1574
|
+
login: Login | undefined;
|
|
1575
|
+
identity: Identity | undefined;
|
|
1576
|
+
card: Card | undefined;
|
|
1577
|
+
secureNote: SecureNote | undefined;
|
|
1578
|
+
sshKey: SshKey | undefined;
|
|
1607
1579
|
favorite: boolean;
|
|
1608
1580
|
reprompt: CipherRepromptType;
|
|
1609
1581
|
organizationUseTotp: boolean;
|
|
1610
1582
|
edit: boolean;
|
|
1611
1583
|
permissions: CipherPermissions | undefined;
|
|
1612
1584
|
viewPassword: boolean;
|
|
1613
|
-
localData:
|
|
1614
|
-
attachments:
|
|
1615
|
-
fields:
|
|
1616
|
-
passwordHistory:
|
|
1585
|
+
localData: LocalData | undefined;
|
|
1586
|
+
attachments: Attachment[] | undefined;
|
|
1587
|
+
fields: Field[] | undefined;
|
|
1588
|
+
passwordHistory: PasswordHistory[] | undefined;
|
|
1617
1589
|
creationDate: DateTime<Utc>;
|
|
1618
1590
|
deletedDate: DateTime<Utc> | undefined;
|
|
1619
1591
|
revisionDate: DateTime<Utc>;
|
|
1620
1592
|
archivedDate: DateTime<Utc> | undefined;
|
|
1593
|
+
data: string | undefined;
|
|
1621
1594
|
}
|
|
1622
1595
|
|
|
1623
|
-
export type CipherListViewType =
|
|
1624
|
-
| { login: LoginListView }
|
|
1625
|
-
| "secureNote"
|
|
1626
|
-
| { card: CardListView }
|
|
1627
|
-
| "identity"
|
|
1628
|
-
| "sshKey";
|
|
1629
|
-
|
|
1630
1596
|
/**
|
|
1631
1597
|
* Represents the result of decrypting a list of ciphers.
|
|
1632
1598
|
*
|
|
@@ -1645,45 +1611,39 @@ export interface DecryptCipherListResult {
|
|
|
1645
1611
|
failures: Cipher[];
|
|
1646
1612
|
}
|
|
1647
1613
|
|
|
1648
|
-
export interface
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1614
|
+
export interface CipherError extends Error {
|
|
1615
|
+
name: "CipherError";
|
|
1616
|
+
variant:
|
|
1617
|
+
| "MissingField"
|
|
1618
|
+
| "Crypto"
|
|
1619
|
+
| "Decrypt"
|
|
1620
|
+
| "Encrypt"
|
|
1621
|
+
| "AttachmentsWithoutKeys"
|
|
1622
|
+
| "OrganizationAlreadySet"
|
|
1623
|
+
| "PutShare"
|
|
1624
|
+
| "PutShareMany"
|
|
1625
|
+
| "Repository"
|
|
1626
|
+
| "Chrono"
|
|
1627
|
+
| "SerdeJson";
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
export function isCipherError(error: any): error is CipherError;
|
|
1631
|
+
|
|
1632
|
+
export interface EncryptionContext {
|
|
1653
1633
|
/**
|
|
1654
|
-
*
|
|
1655
|
-
*
|
|
1634
|
+
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1635
|
+
* Organization-owned ciphers
|
|
1656
1636
|
*/
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
notes: EncString | undefined;
|
|
1660
|
-
type: CipherType;
|
|
1661
|
-
login: Login | undefined;
|
|
1662
|
-
identity: Identity | undefined;
|
|
1663
|
-
card: Card | undefined;
|
|
1664
|
-
secureNote: SecureNote | undefined;
|
|
1665
|
-
sshKey: SshKey | undefined;
|
|
1666
|
-
favorite: boolean;
|
|
1667
|
-
reprompt: CipherRepromptType;
|
|
1668
|
-
organizationUseTotp: boolean;
|
|
1669
|
-
edit: boolean;
|
|
1670
|
-
permissions: CipherPermissions | undefined;
|
|
1671
|
-
viewPassword: boolean;
|
|
1672
|
-
localData: LocalData | undefined;
|
|
1673
|
-
attachments: Attachment[] | undefined;
|
|
1674
|
-
fields: Field[] | undefined;
|
|
1675
|
-
passwordHistory: PasswordHistory[] | undefined;
|
|
1676
|
-
creationDate: DateTime<Utc>;
|
|
1677
|
-
deletedDate: DateTime<Utc> | undefined;
|
|
1678
|
-
revisionDate: DateTime<Utc>;
|
|
1679
|
-
archivedDate: DateTime<Utc> | undefined;
|
|
1680
|
-
data: string | undefined;
|
|
1637
|
+
encryptedFor: UserId;
|
|
1638
|
+
cipher: Cipher;
|
|
1681
1639
|
}
|
|
1682
1640
|
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1641
|
+
export type CipherListViewType =
|
|
1642
|
+
| { login: LoginListView }
|
|
1643
|
+
| "secureNote"
|
|
1644
|
+
| { card: CardListView }
|
|
1645
|
+
| "identity"
|
|
1646
|
+
| "sshKey";
|
|
1687
1647
|
|
|
1688
1648
|
export interface CipherListView {
|
|
1689
1649
|
id: CipherId | undefined;
|
|
@@ -1722,15 +1682,55 @@ export interface CipherListView {
|
|
|
1722
1682
|
localData: LocalDataView | undefined;
|
|
1723
1683
|
}
|
|
1724
1684
|
|
|
1725
|
-
export interface
|
|
1685
|
+
export interface CipherView {
|
|
1686
|
+
id: CipherId | undefined;
|
|
1687
|
+
organizationId: OrganizationId | undefined;
|
|
1688
|
+
folderId: FolderId | undefined;
|
|
1689
|
+
collectionIds: CollectionId[];
|
|
1726
1690
|
/**
|
|
1727
|
-
*
|
|
1728
|
-
* Organization-owned ciphers
|
|
1691
|
+
* Temporary, required to support re-encrypting existing items.
|
|
1729
1692
|
*/
|
|
1730
|
-
|
|
1731
|
-
|
|
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;
|
|
1732
1716
|
}
|
|
1733
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* Available fields on a cipher and can be copied from a the list view in the UI.
|
|
1720
|
+
*/
|
|
1721
|
+
export type CopyableCipherFields =
|
|
1722
|
+
| "LoginUsername"
|
|
1723
|
+
| "LoginPassword"
|
|
1724
|
+
| "LoginTotp"
|
|
1725
|
+
| "CardNumber"
|
|
1726
|
+
| "CardSecurityCode"
|
|
1727
|
+
| "IdentityUsername"
|
|
1728
|
+
| "IdentityEmail"
|
|
1729
|
+
| "IdentityPhone"
|
|
1730
|
+
| "IdentityAddress"
|
|
1731
|
+
| "SshKey"
|
|
1732
|
+
| "SecureNotes";
|
|
1733
|
+
|
|
1734
1734
|
export interface SshKeyView {
|
|
1735
1735
|
/**
|
|
1736
1736
|
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|