@bitwarden/commercial-sdk-internal 0.2.0-main.487 → 0.2.0-main.488
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/bitwarden_wasm_internal.d.ts +471 -471
- package/bitwarden_wasm_internal_bg.js +59 -59
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +5 -5
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +471 -471
- package/node/bitwarden_wasm_internal.js +63 -63
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +9 -9
- package/package.json +1 -1
|
@@ -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,22 +194,6 @@ export interface Repositories {
|
|
|
190
194
|
*/
|
|
191
195
|
export interface FeatureFlags extends Map<string, boolean> {}
|
|
192
196
|
|
|
193
|
-
export interface IndexedDbConfiguration {
|
|
194
|
-
db_name: string;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Credentials for sending password secured access requests.
|
|
199
|
-
* Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
|
|
200
|
-
* struct.
|
|
201
|
-
*/
|
|
202
|
-
export interface SendPasswordCredentials {
|
|
203
|
-
/**
|
|
204
|
-
* A Base64-encoded hash of the password protecting the send.
|
|
205
|
-
*/
|
|
206
|
-
passwordHashB64: string;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
197
|
/**
|
|
210
198
|
* Credentials for getting a send access token using an email and OTP.
|
|
211
199
|
*/
|
|
@@ -220,6 +208,14 @@ export interface SendEmailOtpCredentials {
|
|
|
220
208
|
otp: string;
|
|
221
209
|
}
|
|
222
210
|
|
|
211
|
+
/**
|
|
212
|
+
* The credentials used for send access requests.
|
|
213
|
+
*/
|
|
214
|
+
export type SendAccessCredentials =
|
|
215
|
+
| SendPasswordCredentials
|
|
216
|
+
| SendEmailOtpCredentials
|
|
217
|
+
| SendEmailCredentials;
|
|
218
|
+
|
|
223
219
|
/**
|
|
224
220
|
* Credentials for sending an OTP to the user\'s email address.
|
|
225
221
|
* This is used when the send requires email verification with an OTP.
|
|
@@ -231,6 +227,18 @@ export interface SendEmailCredentials {
|
|
|
231
227
|
email: string;
|
|
232
228
|
}
|
|
233
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Credentials for sending password secured access requests.
|
|
232
|
+
* Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
|
|
233
|
+
* struct.
|
|
234
|
+
*/
|
|
235
|
+
export interface SendPasswordCredentials {
|
|
236
|
+
/**
|
|
237
|
+
* A Base64-encoded hash of the password protecting the send.
|
|
238
|
+
*/
|
|
239
|
+
passwordHashB64: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
234
242
|
/**
|
|
235
243
|
* A request structure for requesting a send access token from the API.
|
|
236
244
|
*/
|
|
@@ -245,14 +253,6 @@ export interface SendAccessTokenRequest {
|
|
|
245
253
|
sendAccessCredentials?: SendAccessCredentials;
|
|
246
254
|
}
|
|
247
255
|
|
|
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
|
* Any unexpected error that occurs when making requests to identity. This could be
|
|
258
258
|
* local/transport/decoding failure from the HTTP client (DNS/TLS/connect/read timeout,
|
|
@@ -263,14 +263,6 @@ export type SendAccessCredentials =
|
|
|
263
263
|
*/
|
|
264
264
|
export type UnexpectedIdentityError = string;
|
|
265
265
|
|
|
266
|
-
/**
|
|
267
|
-
* Represents errors that can occur when requesting a send access token.
|
|
268
|
-
* It includes expected and unexpected API errors.
|
|
269
|
-
*/
|
|
270
|
-
export type SendAccessTokenError =
|
|
271
|
-
| { kind: "unexpected"; data: UnexpectedIdentityError }
|
|
272
|
-
| { kind: "expected"; data: SendAccessTokenApiErrorResponse };
|
|
273
|
-
|
|
274
266
|
/**
|
|
275
267
|
* A send access token which can be used to access a send.
|
|
276
268
|
*/
|
|
@@ -285,6 +277,35 @@ export interface SendAccessTokenResponse {
|
|
|
285
277
|
expiresAt: number;
|
|
286
278
|
}
|
|
287
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Represents errors that can occur when requesting a send access token.
|
|
282
|
+
* It includes expected and unexpected API errors.
|
|
283
|
+
*/
|
|
284
|
+
export type SendAccessTokenError =
|
|
285
|
+
| { kind: "unexpected"; data: UnexpectedIdentityError }
|
|
286
|
+
| { kind: "expected"; data: SendAccessTokenApiErrorResponse };
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Invalid request errors - typically due to missing parameters.
|
|
290
|
+
*/
|
|
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";
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Invalid grant errors - typically due to invalid credentials.
|
|
300
|
+
*/
|
|
301
|
+
export type SendAccessTokenInvalidGrantError =
|
|
302
|
+
| "send_id_invalid"
|
|
303
|
+
| "password_hash_b64_invalid"
|
|
304
|
+
| "email_invalid"
|
|
305
|
+
| "otp_invalid"
|
|
306
|
+
| "otp_generation_failed"
|
|
307
|
+
| "unknown";
|
|
308
|
+
|
|
288
309
|
/**
|
|
289
310
|
* Represents the possible, expected errors that can occur when requesting a send access token.
|
|
290
311
|
*/
|
|
@@ -306,67 +327,41 @@ export type SendAccessTokenApiErrorResponse =
|
|
|
306
327
|
| { error: "invalid_target"; error_description?: string };
|
|
307
328
|
|
|
308
329
|
/**
|
|
309
|
-
*
|
|
310
|
-
*/
|
|
311
|
-
export type SendAccessTokenInvalidGrantError =
|
|
312
|
-
| "send_id_invalid"
|
|
313
|
-
| "password_hash_b64_invalid"
|
|
314
|
-
| "email_invalid"
|
|
315
|
-
| "otp_invalid"
|
|
316
|
-
| "otp_generation_failed"
|
|
317
|
-
| "unknown";
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Invalid request errors - typically due to missing parameters.
|
|
321
|
-
*/
|
|
322
|
-
export type SendAccessTokenInvalidRequestError =
|
|
323
|
-
| "send_id_required"
|
|
324
|
-
| "password_hash_b64_required"
|
|
325
|
-
| "email_required"
|
|
326
|
-
| "email_and_otp_required_otp_sent"
|
|
327
|
-
| "unknown";
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Request parameters for TDE (Trusted Device Encryption) registration.
|
|
330
|
+
* Result of JIT master password registration process.
|
|
331
331
|
*/
|
|
332
|
-
export interface
|
|
333
|
-
/**
|
|
334
|
-
* Organization ID to enroll in
|
|
335
|
-
*/
|
|
336
|
-
org_id: OrganizationId;
|
|
337
|
-
/**
|
|
338
|
-
* Organization\'s public key for encrypting the reset password key. This should be verified by
|
|
339
|
-
* the client and not verifying may compromise the security of the user\'s account.
|
|
340
|
-
*/
|
|
341
|
-
org_public_key: B64;
|
|
332
|
+
export interface JitMasterPasswordRegistrationResponse {
|
|
342
333
|
/**
|
|
343
|
-
*
|
|
334
|
+
* The account cryptographic state of the user
|
|
344
335
|
*/
|
|
345
|
-
|
|
336
|
+
account_cryptographic_state: WrappedAccountCryptographicState;
|
|
346
337
|
/**
|
|
347
|
-
*
|
|
338
|
+
* The master password unlock data
|
|
348
339
|
*/
|
|
349
|
-
|
|
340
|
+
master_password_unlock: MasterPasswordUnlockData;
|
|
350
341
|
/**
|
|
351
|
-
*
|
|
342
|
+
* The decrypted user key.
|
|
352
343
|
*/
|
|
353
|
-
|
|
344
|
+
user_key: B64;
|
|
354
345
|
}
|
|
355
346
|
|
|
356
347
|
/**
|
|
357
|
-
* Result of
|
|
348
|
+
* Result of Key Connector registration process.
|
|
358
349
|
*/
|
|
359
|
-
export interface
|
|
350
|
+
export interface KeyConnectorRegistrationResult {
|
|
360
351
|
/**
|
|
361
|
-
* The account cryptographic state of the user
|
|
352
|
+
* The account cryptographic state of the user.
|
|
362
353
|
*/
|
|
363
354
|
account_cryptographic_state: WrappedAccountCryptographicState;
|
|
364
355
|
/**
|
|
365
|
-
* The
|
|
356
|
+
* The key connector key used for unlocking.
|
|
366
357
|
*/
|
|
367
|
-
|
|
358
|
+
key_connector_key: B64;
|
|
368
359
|
/**
|
|
369
|
-
* The
|
|
360
|
+
* The encrypted user key, wrapped with the key connector key.
|
|
361
|
+
*/
|
|
362
|
+
key_connector_key_wrapped_user_key: EncString;
|
|
363
|
+
/**
|
|
364
|
+
* The decrypted user key. This can be used to get the consuming client to an unlocked state.
|
|
370
365
|
*/
|
|
371
366
|
user_key: B64;
|
|
372
367
|
}
|
|
@@ -410,53 +405,69 @@ export interface JitMasterPasswordRegistrationRequest {
|
|
|
410
405
|
reset_password_enroll: boolean;
|
|
411
406
|
}
|
|
412
407
|
|
|
408
|
+
export interface RegistrationError extends Error {
|
|
409
|
+
name: "RegistrationError";
|
|
410
|
+
variant: "KeyConnectorApi" | "Api" | "Crypto";
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export function isRegistrationError(error: any): error is RegistrationError;
|
|
414
|
+
|
|
413
415
|
/**
|
|
414
|
-
*
|
|
416
|
+
* Request parameters for TDE (Trusted Device Encryption) registration.
|
|
415
417
|
*/
|
|
416
|
-
export interface
|
|
418
|
+
export interface TdeRegistrationRequest {
|
|
417
419
|
/**
|
|
418
|
-
*
|
|
420
|
+
* Organization ID to enroll in
|
|
419
421
|
*/
|
|
420
|
-
|
|
422
|
+
org_id: OrganizationId;
|
|
421
423
|
/**
|
|
422
|
-
*
|
|
424
|
+
* Organization\'s public key for encrypting the reset password key. This should be verified by
|
|
425
|
+
* the client and not verifying may compromise the security of the user\'s account.
|
|
423
426
|
*/
|
|
424
|
-
|
|
427
|
+
org_public_key: B64;
|
|
425
428
|
/**
|
|
426
|
-
*
|
|
429
|
+
* User ID for the account being initialized
|
|
427
430
|
*/
|
|
428
|
-
|
|
431
|
+
user_id: UserId;
|
|
432
|
+
/**
|
|
433
|
+
* Device identifier for TDE enrollment
|
|
434
|
+
*/
|
|
435
|
+
device_identifier: string;
|
|
436
|
+
/**
|
|
437
|
+
* Whether to trust this device for TDE
|
|
438
|
+
*/
|
|
439
|
+
trust_device: boolean;
|
|
429
440
|
}
|
|
430
441
|
|
|
431
442
|
/**
|
|
432
|
-
* Result of
|
|
443
|
+
* Result of TDE registration process.
|
|
433
444
|
*/
|
|
434
|
-
export interface
|
|
445
|
+
export interface TdeRegistrationResponse {
|
|
435
446
|
/**
|
|
436
|
-
* The account cryptographic state of the user
|
|
447
|
+
* The account cryptographic state of the user
|
|
437
448
|
*/
|
|
438
449
|
account_cryptographic_state: WrappedAccountCryptographicState;
|
|
439
450
|
/**
|
|
440
|
-
* The
|
|
441
|
-
*/
|
|
442
|
-
key_connector_key: B64;
|
|
443
|
-
/**
|
|
444
|
-
* The encrypted user key, wrapped with the key connector key.
|
|
451
|
+
* The device key
|
|
445
452
|
*/
|
|
446
|
-
|
|
453
|
+
device_key: B64;
|
|
447
454
|
/**
|
|
448
455
|
* The decrypted user key. This can be used to get the consuming client to an unlocked state.
|
|
449
456
|
*/
|
|
450
457
|
user_key: B64;
|
|
451
458
|
}
|
|
452
459
|
|
|
453
|
-
export interface
|
|
454
|
-
|
|
455
|
-
|
|
460
|
+
export interface CollectionView {
|
|
461
|
+
id: CollectionId | undefined;
|
|
462
|
+
organizationId: OrganizationId;
|
|
463
|
+
name: string;
|
|
464
|
+
externalId: string | undefined;
|
|
465
|
+
hidePasswords: boolean;
|
|
466
|
+
readOnly: boolean;
|
|
467
|
+
manage: boolean;
|
|
468
|
+
type: CollectionType;
|
|
456
469
|
}
|
|
457
470
|
|
|
458
|
-
export function isRegistrationError(error: any): error is RegistrationError;
|
|
459
|
-
|
|
460
471
|
export interface Collection {
|
|
461
472
|
id: CollectionId | undefined;
|
|
462
473
|
organizationId: OrganizationId;
|
|
@@ -469,26 +480,15 @@ export interface Collection {
|
|
|
469
480
|
type: CollectionType;
|
|
470
481
|
}
|
|
471
482
|
|
|
472
|
-
/**
|
|
473
|
-
* Type of collection
|
|
474
|
-
*/
|
|
475
|
-
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
476
|
-
|
|
477
483
|
/**
|
|
478
484
|
* NewType wrapper for `CollectionId`
|
|
479
485
|
*/
|
|
480
486
|
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
481
487
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
externalId: string | undefined;
|
|
487
|
-
hidePasswords: boolean;
|
|
488
|
-
readOnly: boolean;
|
|
489
|
-
manage: boolean;
|
|
490
|
-
type: CollectionType;
|
|
491
|
-
}
|
|
488
|
+
/**
|
|
489
|
+
* Type of collection
|
|
490
|
+
*/
|
|
491
|
+
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
492
492
|
|
|
493
493
|
export interface CollectionDecryptError extends Error {
|
|
494
494
|
name: "CollectionDecryptError";
|
|
@@ -554,6 +554,13 @@ export function isAccountCryptographyInitializationError(
|
|
|
554
554
|
error: any,
|
|
555
555
|
): error is AccountCryptographyInitializationError;
|
|
556
556
|
|
|
557
|
+
export interface RotateCryptographyStateError extends Error {
|
|
558
|
+
name: "RotateCryptographyStateError";
|
|
559
|
+
variant: "KeyMissing" | "InvalidData";
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export function isRotateCryptographyStateError(error: any): error is RotateCryptographyStateError;
|
|
563
|
+
|
|
557
564
|
/**
|
|
558
565
|
* Any keys / cryptographic protection \"downstream\" from the account symmetric key (user key).
|
|
559
566
|
* Private keys are protected by the user key.
|
|
@@ -569,26 +576,12 @@ export type WrappedAccountCryptographicState =
|
|
|
569
576
|
};
|
|
570
577
|
};
|
|
571
578
|
|
|
572
|
-
export interface RotateCryptographyStateError extends Error {
|
|
573
|
-
name: "RotateCryptographyStateError";
|
|
574
|
-
variant: "KeyMissing" | "InvalidData";
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
export function isRotateCryptographyStateError(error: any): error is RotateCryptographyStateError;
|
|
578
|
-
|
|
579
579
|
/**
|
|
580
|
-
*
|
|
580
|
+
* Auth requests supports multiple initialization methods.
|
|
581
581
|
*/
|
|
582
|
-
export
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
*/
|
|
586
|
-
passwordHash: B64;
|
|
587
|
-
/**
|
|
588
|
-
* User key, encrypted with the new password
|
|
589
|
-
*/
|
|
590
|
-
newKey: EncString;
|
|
591
|
-
}
|
|
582
|
+
export type AuthRequestMethod =
|
|
583
|
+
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
584
|
+
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
592
585
|
|
|
593
586
|
/**
|
|
594
587
|
* Request for `verify_asymmetric_keys`.
|
|
@@ -609,50 +602,58 @@ export interface VerifyAsymmetricKeysRequest {
|
|
|
609
602
|
}
|
|
610
603
|
|
|
611
604
|
/**
|
|
612
|
-
*
|
|
605
|
+
* Response for `verify_asymmetric_keys`.
|
|
613
606
|
*/
|
|
614
|
-
export interface
|
|
615
|
-
/**
|
|
616
|
-
* The user\'s ID.
|
|
617
|
-
*/
|
|
618
|
-
userId: UserId | undefined;
|
|
619
|
-
/**
|
|
620
|
-
* The user\'s KDF parameters, as received from the prelogin request
|
|
621
|
-
*/
|
|
622
|
-
kdfParams: Kdf;
|
|
623
|
-
/**
|
|
624
|
-
* The user\'s email address
|
|
625
|
-
*/
|
|
626
|
-
email: string;
|
|
607
|
+
export interface VerifyAsymmetricKeysResponse {
|
|
627
608
|
/**
|
|
628
|
-
*
|
|
629
|
-
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
609
|
+
* Whether the user\'s private key was decryptable by the user key.
|
|
630
610
|
*/
|
|
631
|
-
|
|
611
|
+
privateKeyDecryptable: boolean;
|
|
632
612
|
/**
|
|
633
|
-
*
|
|
613
|
+
* Whether the user\'s private key was a valid RSA key and matched the public key provided.
|
|
634
614
|
*/
|
|
635
|
-
|
|
615
|
+
validPrivateKey: boolean;
|
|
636
616
|
}
|
|
637
617
|
|
|
618
|
+
export interface DeriveKeyConnectorError extends Error {
|
|
619
|
+
name: "DeriveKeyConnectorError";
|
|
620
|
+
variant: "WrongPassword" | "Crypto";
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
624
|
+
|
|
638
625
|
/**
|
|
639
|
-
* Response from the `
|
|
626
|
+
* Response from the `make_update_password` function
|
|
640
627
|
*/
|
|
641
|
-
export interface
|
|
642
|
-
/**
|
|
643
|
-
* The authentication data for the new KDF setting
|
|
644
|
-
*/
|
|
645
|
-
masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
628
|
+
export interface UpdatePasswordResponse {
|
|
646
629
|
/**
|
|
647
|
-
*
|
|
630
|
+
* Hash of the new password
|
|
648
631
|
*/
|
|
649
|
-
|
|
632
|
+
passwordHash: B64;
|
|
650
633
|
/**
|
|
651
|
-
*
|
|
634
|
+
* User key, encrypted with the new password
|
|
652
635
|
*/
|
|
653
|
-
|
|
636
|
+
newKey: EncString;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export interface MakeKeysError extends Error {
|
|
640
|
+
name: "MakeKeysError";
|
|
641
|
+
variant:
|
|
642
|
+
| "AccountCryptographyInitialization"
|
|
643
|
+
| "MasterPasswordDerivation"
|
|
644
|
+
| "RequestModelCreation"
|
|
645
|
+
| "Crypto";
|
|
654
646
|
}
|
|
655
647
|
|
|
648
|
+
export function isMakeKeysError(error: any): error is MakeKeysError;
|
|
649
|
+
|
|
650
|
+
export interface EnrollAdminPasswordResetError extends Error {
|
|
651
|
+
name: "EnrollAdminPasswordResetError";
|
|
652
|
+
variant: "Crypto";
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
656
|
+
|
|
656
657
|
/**
|
|
657
658
|
* The crypto method used to initialize the user cryptographic state.
|
|
658
659
|
*/
|
|
@@ -671,6 +672,41 @@ export type InitUserCryptoMethod =
|
|
|
671
672
|
}
|
|
672
673
|
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
673
674
|
|
|
675
|
+
export interface CryptoClientError extends Error {
|
|
676
|
+
name: "CryptoClientError";
|
|
677
|
+
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Request for deriving a pin protected user key
|
|
684
|
+
*/
|
|
685
|
+
export interface DerivePinKeyResponse {
|
|
686
|
+
/**
|
|
687
|
+
* [UserKey] protected by PIN
|
|
688
|
+
*/
|
|
689
|
+
pinProtectedUserKey: EncString;
|
|
690
|
+
/**
|
|
691
|
+
* PIN protected by [UserKey]
|
|
692
|
+
*/
|
|
693
|
+
encryptedPin: EncString;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Request for deriving a pin protected user key
|
|
698
|
+
*/
|
|
699
|
+
export interface EnrollPinResponse {
|
|
700
|
+
/**
|
|
701
|
+
* [UserKey] protected by PIN
|
|
702
|
+
*/
|
|
703
|
+
pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
|
|
704
|
+
/**
|
|
705
|
+
* PIN protected by [UserKey]
|
|
706
|
+
*/
|
|
707
|
+
userKeyEncryptedPin: EncString;
|
|
708
|
+
}
|
|
709
|
+
|
|
674
710
|
/**
|
|
675
711
|
* Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
|
|
676
712
|
*/
|
|
@@ -709,46 +745,22 @@ export interface UserCryptoV2KeysResponse {
|
|
|
709
745
|
securityVersion: number;
|
|
710
746
|
}
|
|
711
747
|
|
|
712
|
-
export interface DeriveKeyConnectorError extends Error {
|
|
713
|
-
name: "DeriveKeyConnectorError";
|
|
714
|
-
variant: "WrongPassword" | "Crypto";
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
718
|
-
|
|
719
748
|
/**
|
|
720
|
-
*
|
|
749
|
+
* Response from the `update_kdf` function
|
|
721
750
|
*/
|
|
722
|
-
export interface
|
|
723
|
-
/**
|
|
724
|
-
* [UserKey] protected by PIN
|
|
725
|
-
*/
|
|
726
|
-
pinProtectedUserKey: EncString;
|
|
751
|
+
export interface UpdateKdfResponse {
|
|
727
752
|
/**
|
|
728
|
-
*
|
|
753
|
+
* The authentication data for the new KDF setting
|
|
729
754
|
*/
|
|
730
|
-
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
export interface CryptoClientError extends Error {
|
|
734
|
-
name: "CryptoClientError";
|
|
735
|
-
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Request for deriving a pin protected user key
|
|
742
|
-
*/
|
|
743
|
-
export interface EnrollPinResponse {
|
|
755
|
+
masterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
744
756
|
/**
|
|
745
|
-
*
|
|
757
|
+
* The unlock data for the new KDF setting
|
|
746
758
|
*/
|
|
747
|
-
|
|
759
|
+
masterPasswordUnlockData: MasterPasswordUnlockData;
|
|
748
760
|
/**
|
|
749
|
-
*
|
|
761
|
+
* The authentication data for the KDF setting prior to the change
|
|
750
762
|
*/
|
|
751
|
-
|
|
763
|
+
oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
752
764
|
}
|
|
753
765
|
|
|
754
766
|
/**
|
|
@@ -773,45 +785,6 @@ export interface DeriveKeyConnectorRequest {
|
|
|
773
785
|
email: string;
|
|
774
786
|
}
|
|
775
787
|
|
|
776
|
-
export interface MakeKeysError extends Error {
|
|
777
|
-
name: "MakeKeysError";
|
|
778
|
-
variant:
|
|
779
|
-
| "AccountCryptographyInitialization"
|
|
780
|
-
| "MasterPasswordDerivation"
|
|
781
|
-
| "RequestModelCreation"
|
|
782
|
-
| "Crypto";
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
export function isMakeKeysError(error: any): error is MakeKeysError;
|
|
786
|
-
|
|
787
|
-
/**
|
|
788
|
-
* Response for `verify_asymmetric_keys`.
|
|
789
|
-
*/
|
|
790
|
-
export interface VerifyAsymmetricKeysResponse {
|
|
791
|
-
/**
|
|
792
|
-
* Whether the user\'s private key was decryptable by the user key.
|
|
793
|
-
*/
|
|
794
|
-
privateKeyDecryptable: boolean;
|
|
795
|
-
/**
|
|
796
|
-
* Whether the user\'s private key was a valid RSA key and matched the public key provided.
|
|
797
|
-
*/
|
|
798
|
-
validPrivateKey: boolean;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
export interface EnrollAdminPasswordResetError extends Error {
|
|
802
|
-
name: "EnrollAdminPasswordResetError";
|
|
803
|
-
variant: "Crypto";
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Auth requests supports multiple initialization methods.
|
|
810
|
-
*/
|
|
811
|
-
export type AuthRequestMethod =
|
|
812
|
-
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
813
|
-
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
814
|
-
|
|
815
788
|
/**
|
|
816
789
|
* Response from the `make_key_pair` function
|
|
817
790
|
*/
|
|
@@ -837,15 +810,42 @@ export interface InitOrgCryptoRequest {
|
|
|
837
810
|
}
|
|
838
811
|
|
|
839
812
|
/**
|
|
840
|
-
*
|
|
813
|
+
* State used for initializing the user cryptographic state.
|
|
841
814
|
*/
|
|
842
|
-
export
|
|
815
|
+
export interface InitUserCryptoRequest {
|
|
816
|
+
/**
|
|
817
|
+
* The user\'s ID.
|
|
818
|
+
*/
|
|
819
|
+
userId: UserId | undefined;
|
|
820
|
+
/**
|
|
821
|
+
* The user\'s KDF parameters, as received from the prelogin request
|
|
822
|
+
*/
|
|
823
|
+
kdfParams: Kdf;
|
|
824
|
+
/**
|
|
825
|
+
* The user\'s email address
|
|
826
|
+
*/
|
|
827
|
+
email: string;
|
|
828
|
+
/**
|
|
829
|
+
* The user\'s account cryptographic state, containing their signature and
|
|
830
|
+
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
831
|
+
*/
|
|
832
|
+
accountCryptographicState: WrappedAccountCryptographicState;
|
|
833
|
+
/**
|
|
834
|
+
* The method to decrypt the user\'s account symmetric key (user key)
|
|
835
|
+
*/
|
|
836
|
+
method: InitUserCryptoMethod;
|
|
837
|
+
}
|
|
843
838
|
|
|
844
839
|
/**
|
|
845
840
|
* NewType wrapper for `OrganizationId`
|
|
846
841
|
*/
|
|
847
842
|
export type OrganizationId = Tagged<Uuid, "OrganizationId">;
|
|
848
843
|
|
|
844
|
+
/**
|
|
845
|
+
* NewType wrapper for `UserId`
|
|
846
|
+
*/
|
|
847
|
+
export type UserId = Tagged<Uuid, "UserId">;
|
|
848
|
+
|
|
849
849
|
export interface StatefulCryptoError extends Error {
|
|
850
850
|
name: "StatefulCryptoError";
|
|
851
851
|
variant: "MissingSecurityState" | "WrongAccountCryptoVersion" | "Crypto";
|
|
@@ -1111,6 +1111,13 @@ export interface PassphraseGeneratorRequest {
|
|
|
1111
1111
|
includeNumber: boolean;
|
|
1112
1112
|
}
|
|
1113
1113
|
|
|
1114
|
+
export interface PasswordError extends Error {
|
|
1115
|
+
name: "PasswordError";
|
|
1116
|
+
variant: "NoCharacterSetEnabled" | "InvalidLength";
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
export function isPasswordError(error: any): error is PasswordError;
|
|
1120
|
+
|
|
1114
1121
|
/**
|
|
1115
1122
|
* Password generator request options.
|
|
1116
1123
|
*/
|
|
@@ -1163,12 +1170,18 @@ export interface PasswordGeneratorRequest {
|
|
|
1163
1170
|
minSpecial: number | undefined;
|
|
1164
1171
|
}
|
|
1165
1172
|
|
|
1166
|
-
export interface
|
|
1167
|
-
name: "
|
|
1168
|
-
variant: "
|
|
1173
|
+
export interface UsernameError extends Error {
|
|
1174
|
+
name: "UsernameError";
|
|
1175
|
+
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
1169
1176
|
}
|
|
1170
1177
|
|
|
1171
|
-
export function
|
|
1178
|
+
export function isUsernameError(error: any): error is UsernameError;
|
|
1179
|
+
|
|
1180
|
+
export type UsernameGeneratorRequest =
|
|
1181
|
+
| { word: { capitalize: boolean; include_number: boolean } }
|
|
1182
|
+
| { subaddress: { type: AppendType; email: string } }
|
|
1183
|
+
| { catchall: { type: AppendType; domain: string } }
|
|
1184
|
+
| { forwarded: { service: ForwarderServiceType; website: string | undefined } };
|
|
1172
1185
|
|
|
1173
1186
|
/**
|
|
1174
1187
|
* Configures the email forwarding service to use.
|
|
@@ -1183,21 +1196,8 @@ export type ForwarderServiceType =
|
|
|
1183
1196
|
| { forwardEmail: { api_token: string; domain: string } }
|
|
1184
1197
|
| { simpleLogin: { api_key: string; base_url: string } };
|
|
1185
1198
|
|
|
1186
|
-
export interface UsernameError extends Error {
|
|
1187
|
-
name: "UsernameError";
|
|
1188
|
-
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
export function isUsernameError(error: any): error is UsernameError;
|
|
1192
|
-
|
|
1193
1199
|
export type AppendType = "random" | { websiteName: { website: string } };
|
|
1194
1200
|
|
|
1195
|
-
export type UsernameGeneratorRequest =
|
|
1196
|
-
| { word: { capitalize: boolean; include_number: boolean } }
|
|
1197
|
-
| { subaddress: { type: AppendType; email: string } }
|
|
1198
|
-
| { catchall: { type: AppendType; domain: string } }
|
|
1199
|
-
| { forwarded: { service: ForwarderServiceType; website: string | undefined } };
|
|
1200
|
-
|
|
1201
1201
|
export interface ReceiveError extends Error {
|
|
1202
1202
|
name: "ReceiveError";
|
|
1203
1203
|
variant: "Channel" | "Timeout" | "Cancelled";
|
|
@@ -1259,13 +1259,6 @@ export type Endpoint =
|
|
|
1259
1259
|
| "DesktopRenderer"
|
|
1260
1260
|
| "DesktopMain";
|
|
1261
1261
|
|
|
1262
|
-
export interface KeyGenerationError extends Error {
|
|
1263
|
-
name: "KeyGenerationError";
|
|
1264
|
-
variant: "KeyGeneration" | "KeyConversion";
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
export function isKeyGenerationError(error: any): error is KeyGenerationError;
|
|
1268
|
-
|
|
1269
1262
|
export interface SshKeyExportError extends Error {
|
|
1270
1263
|
name: "SshKeyExportError";
|
|
1271
1264
|
variant: "KeyConversion";
|
|
@@ -1273,11 +1266,18 @@ export interface SshKeyExportError extends Error {
|
|
|
1273
1266
|
|
|
1274
1267
|
export function isSshKeyExportError(error: any): error is SshKeyExportError;
|
|
1275
1268
|
|
|
1276
|
-
export interface
|
|
1277
|
-
name: "
|
|
1278
|
-
variant: "
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1269
|
+
export interface KeyGenerationError extends Error {
|
|
1270
|
+
name: "KeyGenerationError";
|
|
1271
|
+
variant: "KeyGeneration" | "KeyConversion";
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export function isKeyGenerationError(error: any): error is KeyGenerationError;
|
|
1275
|
+
|
|
1276
|
+
export interface SshKeyImportError extends Error {
|
|
1277
|
+
name: "SshKeyImportError";
|
|
1278
|
+
variant: "Parsing" | "PasswordRequired" | "WrongPassword" | "UnsupportedKeyType";
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
1281
|
export function isSshKeyImportError(error: any): error is SshKeyImportError;
|
|
1282
1282
|
|
|
1283
1283
|
export type KeyAlgorithm = "Ed25519" | "Rsa3072" | "Rsa4096";
|
|
@@ -1309,14 +1309,6 @@ export interface CipherRiskError extends Error {
|
|
|
1309
1309
|
|
|
1310
1310
|
export function isCipherRiskError(error: any): error is CipherRiskError;
|
|
1311
1311
|
|
|
1312
|
-
/**
|
|
1313
|
-
* Result of checking password exposure via HIBP API.
|
|
1314
|
-
*/
|
|
1315
|
-
export type ExposedPasswordResult =
|
|
1316
|
-
| { type: "NotChecked" }
|
|
1317
|
-
| { type: "Found"; value: number }
|
|
1318
|
-
| { type: "Error"; value: string };
|
|
1319
|
-
|
|
1320
1312
|
/**
|
|
1321
1313
|
* Password reuse map wrapper for WASM compatibility.
|
|
1322
1314
|
*/
|
|
@@ -1388,6 +1380,14 @@ export interface CipherRiskOptions {
|
|
|
1388
1380
|
hibpBaseUrl?: string | undefined;
|
|
1389
1381
|
}
|
|
1390
1382
|
|
|
1383
|
+
/**
|
|
1384
|
+
* Result of checking password exposure via HIBP API.
|
|
1385
|
+
*/
|
|
1386
|
+
export type ExposedPasswordResult =
|
|
1387
|
+
| { type: "NotChecked" }
|
|
1388
|
+
| { type: "Found"; value: number }
|
|
1389
|
+
| { type: "Error"; value: string };
|
|
1390
|
+
|
|
1391
1391
|
export interface PasswordHistoryView {
|
|
1392
1392
|
password: string;
|
|
1393
1393
|
lastUsedDate: DateTime<Utc>;
|
|
@@ -1434,18 +1434,6 @@ export interface DecryptError extends Error {
|
|
|
1434
1434
|
|
|
1435
1435
|
export function isDecryptError(error: any): error is DecryptError;
|
|
1436
1436
|
|
|
1437
|
-
export interface Attachment {
|
|
1438
|
-
id: string | undefined;
|
|
1439
|
-
url: string | undefined;
|
|
1440
|
-
size: string | undefined;
|
|
1441
|
-
/**
|
|
1442
|
-
* Readable size, ex: \"4.2 KB\" or \"1.43 GB\
|
|
1443
|
-
*/
|
|
1444
|
-
sizeName: string | undefined;
|
|
1445
|
-
fileName: EncString | undefined;
|
|
1446
|
-
key: EncString | undefined;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
1437
|
export interface AttachmentView {
|
|
1450
1438
|
id: string | undefined;
|
|
1451
1439
|
url: string | undefined;
|
|
@@ -1468,12 +1456,24 @@ export interface AttachmentView {
|
|
|
1468
1456
|
decryptedKey: string | undefined;
|
|
1469
1457
|
}
|
|
1470
1458
|
|
|
1471
|
-
export interface
|
|
1459
|
+
export interface Attachment {
|
|
1460
|
+
id: string | undefined;
|
|
1461
|
+
url: string | undefined;
|
|
1462
|
+
size: string | undefined;
|
|
1463
|
+
/**
|
|
1464
|
+
* Readable size, ex: \"4.2 KB\" or \"1.43 GB\
|
|
1465
|
+
*/
|
|
1466
|
+
sizeName: string | undefined;
|
|
1467
|
+
fileName: EncString | undefined;
|
|
1468
|
+
key: EncString | undefined;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
export interface LocalDataView {
|
|
1472
1472
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1473
1473
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1474
1474
|
}
|
|
1475
1475
|
|
|
1476
|
-
export interface
|
|
1476
|
+
export interface LocalData {
|
|
1477
1477
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1478
1478
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1479
1479
|
}
|
|
@@ -1573,6 +1573,13 @@ export interface RestoreCipherAdminError extends Error {
|
|
|
1573
1573
|
|
|
1574
1574
|
export function isRestoreCipherAdminError(error: any): error is RestoreCipherAdminError;
|
|
1575
1575
|
|
|
1576
|
+
export interface CreateCipherError extends Error {
|
|
1577
|
+
name: "CreateCipherError";
|
|
1578
|
+
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1582
|
+
|
|
1576
1583
|
/**
|
|
1577
1584
|
* Request to add a cipher.
|
|
1578
1585
|
*/
|
|
@@ -1588,13 +1595,6 @@ export interface CipherCreateRequest {
|
|
|
1588
1595
|
fields: FieldView[];
|
|
1589
1596
|
}
|
|
1590
1597
|
|
|
1591
|
-
export interface CreateCipherError extends Error {
|
|
1592
|
-
name: "CreateCipherError";
|
|
1593
|
-
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1597
|
-
|
|
1598
1598
|
export interface DeleteCipherError extends Error {
|
|
1599
1599
|
name: "DeleteCipherError";
|
|
1600
1600
|
variant: "Api" | "Repository";
|
|
@@ -1619,13 +1619,6 @@ export type CipherViewType =
|
|
|
1619
1619
|
| { secureNote: SecureNoteView }
|
|
1620
1620
|
| { sshKey: SshKeyView };
|
|
1621
1621
|
|
|
1622
|
-
export interface EncryptFileError extends Error {
|
|
1623
|
-
name: "EncryptFileError";
|
|
1624
|
-
variant: "Encrypt" | "Io";
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
export function isEncryptFileError(error: any): error is EncryptFileError;
|
|
1628
|
-
|
|
1629
1622
|
export interface DecryptFileError extends Error {
|
|
1630
1623
|
name: "DecryptFileError";
|
|
1631
1624
|
variant: "Decrypt" | "Io";
|
|
@@ -1633,18 +1626,25 @@ export interface DecryptFileError extends Error {
|
|
|
1633
1626
|
|
|
1634
1627
|
export function isDecryptFileError(error: any): error is DecryptFileError;
|
|
1635
1628
|
|
|
1629
|
+
export interface EncryptFileError extends Error {
|
|
1630
|
+
name: "EncryptFileError";
|
|
1631
|
+
variant: "Encrypt" | "Io";
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
export function isEncryptFileError(error: any): error is EncryptFileError;
|
|
1635
|
+
|
|
1636
1636
|
export interface CipherPermissions {
|
|
1637
1637
|
delete: boolean;
|
|
1638
1638
|
restore: boolean;
|
|
1639
1639
|
}
|
|
1640
1640
|
|
|
1641
|
-
export interface
|
|
1642
|
-
cardholderName:
|
|
1643
|
-
expMonth:
|
|
1644
|
-
expYear:
|
|
1645
|
-
code:
|
|
1646
|
-
brand:
|
|
1647
|
-
number:
|
|
1641
|
+
export interface Card {
|
|
1642
|
+
cardholderName: EncString | undefined;
|
|
1643
|
+
expMonth: EncString | undefined;
|
|
1644
|
+
expYear: EncString | undefined;
|
|
1645
|
+
code: EncString | undefined;
|
|
1646
|
+
brand: EncString | undefined;
|
|
1647
|
+
number: EncString | undefined;
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
1650
|
/**
|
|
@@ -1657,13 +1657,20 @@ export interface CardListView {
|
|
|
1657
1657
|
brand: string | undefined;
|
|
1658
1658
|
}
|
|
1659
1659
|
|
|
1660
|
-
export interface
|
|
1661
|
-
cardholderName:
|
|
1662
|
-
expMonth:
|
|
1663
|
-
expYear:
|
|
1664
|
-
code:
|
|
1665
|
-
brand:
|
|
1666
|
-
number:
|
|
1660
|
+
export interface CardView {
|
|
1661
|
+
cardholderName: string | undefined;
|
|
1662
|
+
expMonth: string | undefined;
|
|
1663
|
+
expYear: string | undefined;
|
|
1664
|
+
code: string | undefined;
|
|
1665
|
+
brand: string | undefined;
|
|
1666
|
+
number: string | undefined;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
export interface FieldView {
|
|
1670
|
+
name: string | undefined;
|
|
1671
|
+
value: string | undefined;
|
|
1672
|
+
type: FieldType;
|
|
1673
|
+
linkedId: LinkedIdType | undefined;
|
|
1667
1674
|
}
|
|
1668
1675
|
|
|
1669
1676
|
export interface Field {
|
|
@@ -1673,59 +1680,47 @@ export interface Field {
|
|
|
1673
1680
|
linkedId: LinkedIdType | undefined;
|
|
1674
1681
|
}
|
|
1675
1682
|
|
|
1676
|
-
export interface
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1683
|
+
export interface Login {
|
|
1684
|
+
username: EncString | undefined;
|
|
1685
|
+
password: EncString | undefined;
|
|
1686
|
+
passwordRevisionDate: DateTime<Utc> | undefined;
|
|
1687
|
+
uris: LoginUri[] | undefined;
|
|
1688
|
+
totp: EncString | undefined;
|
|
1689
|
+
autofillOnPageLoad: boolean | undefined;
|
|
1690
|
+
fido2Credentials: Fido2Credential[] | undefined;
|
|
1681
1691
|
}
|
|
1682
1692
|
|
|
1683
|
-
export interface
|
|
1693
|
+
export interface Fido2CredentialListView {
|
|
1684
1694
|
credentialId: string;
|
|
1685
|
-
keyType: string;
|
|
1686
|
-
keyAlgorithm: string;
|
|
1687
|
-
keyCurve: string;
|
|
1688
|
-
keyValue: string;
|
|
1689
1695
|
rpId: string;
|
|
1690
1696
|
userHandle: string | undefined;
|
|
1691
1697
|
userName: string | undefined;
|
|
1692
|
-
counter: string;
|
|
1693
|
-
rpName: string | undefined;
|
|
1694
1698
|
userDisplayName: string | undefined;
|
|
1695
|
-
|
|
1696
|
-
creationDate: DateTime<Utc>;
|
|
1699
|
+
counter: string;
|
|
1697
1700
|
}
|
|
1698
1701
|
|
|
1699
|
-
export interface
|
|
1702
|
+
export interface LoginUri {
|
|
1703
|
+
uri: EncString | undefined;
|
|
1704
|
+
match: UriMatchType | undefined;
|
|
1705
|
+
uriChecksum: EncString | undefined;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
export interface Fido2CredentialView {
|
|
1700
1709
|
credentialId: string;
|
|
1701
1710
|
keyType: string;
|
|
1702
1711
|
keyAlgorithm: string;
|
|
1703
1712
|
keyCurve: string;
|
|
1713
|
+
keyValue: EncString;
|
|
1704
1714
|
rpId: string;
|
|
1705
1715
|
userHandle: string | undefined;
|
|
1706
1716
|
userName: string | undefined;
|
|
1707
1717
|
counter: string;
|
|
1708
1718
|
rpName: string | undefined;
|
|
1709
1719
|
userDisplayName: string | undefined;
|
|
1720
|
+
discoverable: string;
|
|
1710
1721
|
creationDate: DateTime<Utc>;
|
|
1711
1722
|
}
|
|
1712
1723
|
|
|
1713
|
-
export interface Login {
|
|
1714
|
-
username: EncString | undefined;
|
|
1715
|
-
password: EncString | undefined;
|
|
1716
|
-
passwordRevisionDate: DateTime<Utc> | undefined;
|
|
1717
|
-
uris: LoginUri[] | undefined;
|
|
1718
|
-
totp: EncString | undefined;
|
|
1719
|
-
autofillOnPageLoad: boolean | undefined;
|
|
1720
|
-
fido2Credentials: Fido2Credential[] | undefined;
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
export interface LoginUriView {
|
|
1724
|
-
uri: string | undefined;
|
|
1725
|
-
match: UriMatchType | undefined;
|
|
1726
|
-
uriChecksum: string | undefined;
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
1724
|
export interface LoginView {
|
|
1730
1725
|
username: string | undefined;
|
|
1731
1726
|
password: string | undefined;
|
|
@@ -1736,46 +1731,40 @@ export interface LoginView {
|
|
|
1736
1731
|
fido2Credentials: Fido2Credential[] | undefined;
|
|
1737
1732
|
}
|
|
1738
1733
|
|
|
1739
|
-
export interface
|
|
1740
|
-
fido2Credentials: Fido2CredentialListView[] | undefined;
|
|
1741
|
-
hasFido2: boolean;
|
|
1742
|
-
username: string | undefined;
|
|
1743
|
-
/**
|
|
1744
|
-
* The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
|
|
1745
|
-
*/
|
|
1746
|
-
totp: EncString | undefined;
|
|
1747
|
-
uris: LoginUriView[] | undefined;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
export interface Fido2CredentialView {
|
|
1734
|
+
export interface Fido2CredentialNewView {
|
|
1751
1735
|
credentialId: string;
|
|
1752
1736
|
keyType: string;
|
|
1753
1737
|
keyAlgorithm: string;
|
|
1754
1738
|
keyCurve: string;
|
|
1755
|
-
keyValue: EncString;
|
|
1756
1739
|
rpId: string;
|
|
1757
1740
|
userHandle: string | undefined;
|
|
1758
1741
|
userName: string | undefined;
|
|
1759
1742
|
counter: string;
|
|
1760
1743
|
rpName: string | undefined;
|
|
1761
1744
|
userDisplayName: string | undefined;
|
|
1762
|
-
discoverable: string;
|
|
1763
1745
|
creationDate: DateTime<Utc>;
|
|
1764
1746
|
}
|
|
1765
1747
|
|
|
1766
|
-
export interface
|
|
1767
|
-
uri:
|
|
1748
|
+
export interface LoginUriView {
|
|
1749
|
+
uri: string | undefined;
|
|
1768
1750
|
match: UriMatchType | undefined;
|
|
1769
|
-
uriChecksum:
|
|
1751
|
+
uriChecksum: string | undefined;
|
|
1770
1752
|
}
|
|
1771
1753
|
|
|
1772
|
-
export interface
|
|
1754
|
+
export interface Fido2CredentialFullView {
|
|
1773
1755
|
credentialId: string;
|
|
1756
|
+
keyType: string;
|
|
1757
|
+
keyAlgorithm: string;
|
|
1758
|
+
keyCurve: string;
|
|
1759
|
+
keyValue: string;
|
|
1774
1760
|
rpId: string;
|
|
1775
1761
|
userHandle: string | undefined;
|
|
1776
1762
|
userName: string | undefined;
|
|
1777
|
-
userDisplayName: string | undefined;
|
|
1778
1763
|
counter: string;
|
|
1764
|
+
rpName: string | undefined;
|
|
1765
|
+
userDisplayName: string | undefined;
|
|
1766
|
+
discoverable: string;
|
|
1767
|
+
creationDate: DateTime<Utc>;
|
|
1779
1768
|
}
|
|
1780
1769
|
|
|
1781
1770
|
export interface Fido2Credential {
|
|
@@ -1794,6 +1783,39 @@ export interface Fido2Credential {
|
|
|
1794
1783
|
creationDate: DateTime<Utc>;
|
|
1795
1784
|
}
|
|
1796
1785
|
|
|
1786
|
+
export interface LoginListView {
|
|
1787
|
+
fido2Credentials: Fido2CredentialListView[] | undefined;
|
|
1788
|
+
hasFido2: boolean;
|
|
1789
|
+
username: string | undefined;
|
|
1790
|
+
/**
|
|
1791
|
+
* The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
|
|
1792
|
+
*/
|
|
1793
|
+
totp: EncString | undefined;
|
|
1794
|
+
uris: LoginUriView[] | undefined;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
export interface CipherError extends Error {
|
|
1798
|
+
name: "CipherError";
|
|
1799
|
+
variant:
|
|
1800
|
+
| "MissingField"
|
|
1801
|
+
| "Crypto"
|
|
1802
|
+
| "Decrypt"
|
|
1803
|
+
| "Encrypt"
|
|
1804
|
+
| "AttachmentsWithoutKeys"
|
|
1805
|
+
| "OrganizationAlreadySet"
|
|
1806
|
+
| "Repository"
|
|
1807
|
+
| "Chrono"
|
|
1808
|
+
| "SerdeJson"
|
|
1809
|
+
| "Api";
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
export function isCipherError(error: any): error is CipherError;
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* NewType wrapper for `CipherId`
|
|
1816
|
+
*/
|
|
1817
|
+
export type CipherId = Tagged<Uuid, "CipherId">;
|
|
1818
|
+
|
|
1797
1819
|
export interface Cipher {
|
|
1798
1820
|
id: CipherId | undefined;
|
|
1799
1821
|
organizationId: OrganizationId | undefined;
|
|
@@ -1829,78 +1851,6 @@ export interface Cipher {
|
|
|
1829
1851
|
data: string | undefined;
|
|
1830
1852
|
}
|
|
1831
1853
|
|
|
1832
|
-
/**
|
|
1833
|
-
* Represents the result of decrypting a list of ciphers.
|
|
1834
|
-
*
|
|
1835
|
-
* This struct contains two vectors: `successes` and `failures`.
|
|
1836
|
-
* `successes` contains the decrypted `CipherListView` objects,
|
|
1837
|
-
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1838
|
-
*/
|
|
1839
|
-
export interface DecryptCipherListResult {
|
|
1840
|
-
/**
|
|
1841
|
-
* The decrypted `CipherListView` objects.
|
|
1842
|
-
*/
|
|
1843
|
-
successes: CipherListView[];
|
|
1844
|
-
/**
|
|
1845
|
-
* The original `Cipher` objects that failed to decrypt.
|
|
1846
|
-
*/
|
|
1847
|
-
failures: Cipher[];
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
export interface CipherError extends Error {
|
|
1851
|
-
name: "CipherError";
|
|
1852
|
-
variant:
|
|
1853
|
-
| "MissingField"
|
|
1854
|
-
| "Crypto"
|
|
1855
|
-
| "Decrypt"
|
|
1856
|
-
| "Encrypt"
|
|
1857
|
-
| "AttachmentsWithoutKeys"
|
|
1858
|
-
| "OrganizationAlreadySet"
|
|
1859
|
-
| "Repository"
|
|
1860
|
-
| "Chrono"
|
|
1861
|
-
| "SerdeJson"
|
|
1862
|
-
| "Api";
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
export function isCipherError(error: any): error is CipherError;
|
|
1866
|
-
|
|
1867
|
-
/**
|
|
1868
|
-
* NewType wrapper for `CipherId`
|
|
1869
|
-
*/
|
|
1870
|
-
export type CipherId = Tagged<Uuid, "CipherId">;
|
|
1871
|
-
|
|
1872
|
-
/**
|
|
1873
|
-
* Available fields on a cipher and can be copied from a the list view in the UI.
|
|
1874
|
-
*/
|
|
1875
|
-
export type CopyableCipherFields =
|
|
1876
|
-
| "LoginUsername"
|
|
1877
|
-
| "LoginPassword"
|
|
1878
|
-
| "LoginTotp"
|
|
1879
|
-
| "CardNumber"
|
|
1880
|
-
| "CardSecurityCode"
|
|
1881
|
-
| "IdentityUsername"
|
|
1882
|
-
| "IdentityEmail"
|
|
1883
|
-
| "IdentityPhone"
|
|
1884
|
-
| "IdentityAddress"
|
|
1885
|
-
| "SshKey"
|
|
1886
|
-
| "SecureNotes";
|
|
1887
|
-
|
|
1888
|
-
export interface EncryptionContext {
|
|
1889
|
-
/**
|
|
1890
|
-
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1891
|
-
* Organization-owned ciphers
|
|
1892
|
-
*/
|
|
1893
|
-
encryptedFor: UserId;
|
|
1894
|
-
cipher: Cipher;
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
export type CipherListViewType =
|
|
1898
|
-
| { login: LoginListView }
|
|
1899
|
-
| "secureNote"
|
|
1900
|
-
| { card: CardListView }
|
|
1901
|
-
| "identity"
|
|
1902
|
-
| "sshKey";
|
|
1903
|
-
|
|
1904
1854
|
export interface CipherView {
|
|
1905
1855
|
id: CipherId | undefined;
|
|
1906
1856
|
organizationId: OrganizationId | undefined;
|
|
@@ -1934,6 +1884,31 @@ export interface CipherView {
|
|
|
1934
1884
|
archivedDate: DateTime<Utc> | undefined;
|
|
1935
1885
|
}
|
|
1936
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* Available fields on a cipher and can be copied from a the list view in the UI.
|
|
1889
|
+
*/
|
|
1890
|
+
export type CopyableCipherFields =
|
|
1891
|
+
| "LoginUsername"
|
|
1892
|
+
| "LoginPassword"
|
|
1893
|
+
| "LoginTotp"
|
|
1894
|
+
| "CardNumber"
|
|
1895
|
+
| "CardSecurityCode"
|
|
1896
|
+
| "IdentityUsername"
|
|
1897
|
+
| "IdentityEmail"
|
|
1898
|
+
| "IdentityPhone"
|
|
1899
|
+
| "IdentityAddress"
|
|
1900
|
+
| "SshKey"
|
|
1901
|
+
| "SecureNotes";
|
|
1902
|
+
|
|
1903
|
+
export interface EncryptionContext {
|
|
1904
|
+
/**
|
|
1905
|
+
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1906
|
+
* Organization-owned ciphers
|
|
1907
|
+
*/
|
|
1908
|
+
encryptedFor: UserId;
|
|
1909
|
+
cipher: Cipher;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1937
1912
|
export interface CipherListView {
|
|
1938
1913
|
id: CipherId | undefined;
|
|
1939
1914
|
organizationId: OrganizationId | undefined;
|
|
@@ -1971,21 +1946,31 @@ export interface CipherListView {
|
|
|
1971
1946
|
localData: LocalDataView | undefined;
|
|
1972
1947
|
}
|
|
1973
1948
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1949
|
+
/**
|
|
1950
|
+
* Represents the result of decrypting a list of ciphers.
|
|
1951
|
+
*
|
|
1952
|
+
* This struct contains two vectors: `successes` and `failures`.
|
|
1953
|
+
* `successes` contains the decrypted `CipherListView` objects,
|
|
1954
|
+
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1955
|
+
*/
|
|
1956
|
+
export interface DecryptCipherListResult {
|
|
1979
1957
|
/**
|
|
1980
|
-
*
|
|
1958
|
+
* The decrypted `CipherListView` objects.
|
|
1981
1959
|
*/
|
|
1982
|
-
|
|
1960
|
+
successes: CipherListView[];
|
|
1983
1961
|
/**
|
|
1984
|
-
*
|
|
1962
|
+
* The original `Cipher` objects that failed to decrypt.
|
|
1985
1963
|
*/
|
|
1986
|
-
|
|
1964
|
+
failures: Cipher[];
|
|
1987
1965
|
}
|
|
1988
1966
|
|
|
1967
|
+
export type CipherListViewType =
|
|
1968
|
+
| { login: LoginListView }
|
|
1969
|
+
| "secureNote"
|
|
1970
|
+
| { card: CardListView }
|
|
1971
|
+
| "identity"
|
|
1972
|
+
| "sshKey";
|
|
1973
|
+
|
|
1989
1974
|
export interface SshKey {
|
|
1990
1975
|
/**
|
|
1991
1976
|
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
@@ -2001,25 +1986,19 @@ export interface SshKey {
|
|
|
2001
1986
|
fingerprint: EncString;
|
|
2002
1987
|
}
|
|
2003
1988
|
|
|
2004
|
-
export interface
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
email: string | undefined;
|
|
2018
|
-
phone: string | undefined;
|
|
2019
|
-
ssn: string | undefined;
|
|
2020
|
-
username: string | undefined;
|
|
2021
|
-
passportNumber: string | undefined;
|
|
2022
|
-
licenseNumber: string | undefined;
|
|
1989
|
+
export interface SshKeyView {
|
|
1990
|
+
/**
|
|
1991
|
+
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
1992
|
+
*/
|
|
1993
|
+
privateKey: string;
|
|
1994
|
+
/**
|
|
1995
|
+
* SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6)
|
|
1996
|
+
*/
|
|
1997
|
+
publicKey: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT`
|
|
2000
|
+
*/
|
|
2001
|
+
fingerprint: string;
|
|
2023
2002
|
}
|
|
2024
2003
|
|
|
2025
2004
|
export interface Identity {
|
|
@@ -2043,25 +2022,46 @@ export interface Identity {
|
|
|
2043
2022
|
licenseNumber: EncString | undefined;
|
|
2044
2023
|
}
|
|
2045
2024
|
|
|
2046
|
-
export
|
|
2025
|
+
export interface IdentityView {
|
|
2026
|
+
title: string | undefined;
|
|
2027
|
+
firstName: string | undefined;
|
|
2028
|
+
middleName: string | undefined;
|
|
2029
|
+
lastName: string | undefined;
|
|
2030
|
+
address1: string | undefined;
|
|
2031
|
+
address2: string | undefined;
|
|
2032
|
+
address3: string | undefined;
|
|
2033
|
+
city: string | undefined;
|
|
2034
|
+
state: string | undefined;
|
|
2035
|
+
postalCode: string | undefined;
|
|
2036
|
+
country: string | undefined;
|
|
2037
|
+
company: string | undefined;
|
|
2038
|
+
email: string | undefined;
|
|
2039
|
+
phone: string | undefined;
|
|
2040
|
+
ssn: string | undefined;
|
|
2041
|
+
username: string | undefined;
|
|
2042
|
+
passportNumber: string | undefined;
|
|
2043
|
+
licenseNumber: string | undefined;
|
|
2044
|
+
}
|
|
2047
2045
|
|
|
2048
|
-
|
|
2049
|
-
* NewType wrapper for `FolderId`
|
|
2050
|
-
*/
|
|
2051
|
-
export type FolderId = Tagged<Uuid, "FolderId">;
|
|
2046
|
+
export type LinkedIdType = LoginLinkedIdType | CardLinkedIdType | IdentityLinkedIdType;
|
|
2052
2047
|
|
|
2053
|
-
export interface
|
|
2048
|
+
export interface Folder {
|
|
2054
2049
|
id: FolderId | undefined;
|
|
2055
|
-
name:
|
|
2050
|
+
name: EncString;
|
|
2056
2051
|
revisionDate: DateTime<Utc>;
|
|
2057
2052
|
}
|
|
2058
2053
|
|
|
2059
|
-
export interface
|
|
2054
|
+
export interface FolderView {
|
|
2060
2055
|
id: FolderId | undefined;
|
|
2061
|
-
name:
|
|
2056
|
+
name: string;
|
|
2062
2057
|
revisionDate: DateTime<Utc>;
|
|
2063
2058
|
}
|
|
2064
2059
|
|
|
2060
|
+
/**
|
|
2061
|
+
* NewType wrapper for `FolderId`
|
|
2062
|
+
*/
|
|
2063
|
+
export type FolderId = Tagged<Uuid, "FolderId">;
|
|
2064
|
+
|
|
2065
2065
|
export interface EditFolderError extends Error {
|
|
2066
2066
|
name: "EditFolderError";
|
|
2067
2067
|
variant:
|