@bitwarden/sdk-internal 0.2.0-main.417 → 0.2.0-main.419
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 +473 -473
- package/bitwarden_wasm_internal_bg.js +87 -87
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +8 -8
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +473 -473
- package/node/bitwarden_wasm_internal.js +87 -87
- 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
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Generate a new SSH key pair
|
|
5
|
-
*
|
|
6
|
-
* # Arguments
|
|
7
|
-
* - `key_algorithm` - The algorithm to use for the key pair
|
|
8
|
-
*
|
|
9
|
-
* # Returns
|
|
10
|
-
* - `Ok(SshKey)` if the key was successfully generated
|
|
11
|
-
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
12
|
-
*/
|
|
13
|
-
export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
|
|
14
3
|
/**
|
|
15
4
|
* Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
|
|
16
5
|
* to an OpenSSH private key with public key and fingerprint
|
|
@@ -27,6 +16,17 @@ export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
|
|
|
27
16
|
* - `Err(UnsupportedKeyType)` if the key type is not supported
|
|
28
17
|
*/
|
|
29
18
|
export function import_ssh_key(imported_key: string, password?: string | null): SshKeyView;
|
|
19
|
+
/**
|
|
20
|
+
* Generate a new SSH key pair
|
|
21
|
+
*
|
|
22
|
+
* # Arguments
|
|
23
|
+
* - `key_algorithm` - The algorithm to use for the key pair
|
|
24
|
+
*
|
|
25
|
+
* # Returns
|
|
26
|
+
* - `Ok(SshKey)` if the key was successfully generated
|
|
27
|
+
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
28
|
+
*/
|
|
29
|
+
export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
|
|
30
30
|
export function init_sdk(log_level?: LogLevel | null): void;
|
|
31
31
|
/**
|
|
32
32
|
* Sends a DiscoverRequest to the specified destination and returns the response.
|
|
@@ -180,32 +180,29 @@ export interface TokenProvider {
|
|
|
180
180
|
get_access_token(): Promise<string | undefined>;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
/**
|
|
184
|
-
* Active feature flags for the SDK.
|
|
185
|
-
*/
|
|
186
|
-
export interface FeatureFlags extends Map<string, boolean> {}
|
|
187
|
-
|
|
188
183
|
export interface Repositories {
|
|
189
184
|
cipher: Repository<Cipher> | null;
|
|
190
185
|
folder: Repository<Folder> | null;
|
|
191
186
|
}
|
|
192
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Active feature flags for the SDK.
|
|
190
|
+
*/
|
|
191
|
+
export interface FeatureFlags extends Map<string, boolean> {}
|
|
192
|
+
|
|
193
193
|
export interface IndexedDbConfiguration {
|
|
194
194
|
db_name: string;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* Credentials for
|
|
198
|
+
* Credentials for sending an OTP to the user\'s email address.
|
|
199
|
+
* This is used when the send requires email verification with an OTP.
|
|
199
200
|
*/
|
|
200
|
-
export interface
|
|
201
|
+
export interface SendEmailCredentials {
|
|
201
202
|
/**
|
|
202
203
|
* The email address to which the OTP will be sent.
|
|
203
204
|
*/
|
|
204
205
|
email: string;
|
|
205
|
-
/**
|
|
206
|
-
* The one-time password (OTP) that the user has received via email.
|
|
207
|
-
*/
|
|
208
|
-
otp: string;
|
|
209
206
|
}
|
|
210
207
|
|
|
211
208
|
/**
|
|
@@ -221,24 +218,19 @@ export interface SendPasswordCredentials {
|
|
|
221
218
|
}
|
|
222
219
|
|
|
223
220
|
/**
|
|
224
|
-
* Credentials for
|
|
225
|
-
* This is used when the send requires email verification with an OTP.
|
|
221
|
+
* Credentials for getting a send access token using an email and OTP.
|
|
226
222
|
*/
|
|
227
|
-
export interface
|
|
223
|
+
export interface SendEmailOtpCredentials {
|
|
228
224
|
/**
|
|
229
225
|
* The email address to which the OTP will be sent.
|
|
230
226
|
*/
|
|
231
227
|
email: string;
|
|
228
|
+
/**
|
|
229
|
+
* The one-time password (OTP) that the user has received via email.
|
|
230
|
+
*/
|
|
231
|
+
otp: string;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
/**
|
|
235
|
-
* The credentials used for send access requests.
|
|
236
|
-
*/
|
|
237
|
-
export type SendAccessCredentials =
|
|
238
|
-
| SendPasswordCredentials
|
|
239
|
-
| SendEmailOtpCredentials
|
|
240
|
-
| SendEmailCredentials;
|
|
241
|
-
|
|
242
234
|
/**
|
|
243
235
|
* A request structure for requesting a send access token from the API.
|
|
244
236
|
*/
|
|
@@ -254,12 +246,22 @@ export interface SendAccessTokenRequest {
|
|
|
254
246
|
}
|
|
255
247
|
|
|
256
248
|
/**
|
|
257
|
-
*
|
|
258
|
-
* It includes expected and unexpected API errors.
|
|
249
|
+
* The credentials used for send access requests.
|
|
259
250
|
*/
|
|
260
|
-
export type
|
|
261
|
-
|
|
|
262
|
-
|
|
|
251
|
+
export type SendAccessCredentials =
|
|
252
|
+
| SendPasswordCredentials
|
|
253
|
+
| SendEmailOtpCredentials
|
|
254
|
+
| SendEmailCredentials;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Any unexpected error that occurs when making requests to identity. This could be
|
|
258
|
+
* local/transport/decoding failure from the HTTP client (DNS/TLS/connect/read timeout,
|
|
259
|
+
* connection reset, or JSON decode failure on a success response) or non-2xx response with an
|
|
260
|
+
* unexpected body or status. Used when decoding the server\'s error payload into
|
|
261
|
+
* `SendAccessTokenApiErrorResponse` fails, or for 5xx responses where no structured error is
|
|
262
|
+
* available.
|
|
263
|
+
*/
|
|
264
|
+
export type UnexpectedIdentityError = string;
|
|
263
265
|
|
|
264
266
|
/**
|
|
265
267
|
* A send access token which can be used to access a send.
|
|
@@ -276,24 +278,12 @@ export interface SendAccessTokenResponse {
|
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* connection reset, or JSON decode failure on a success response) or non-2xx response with an
|
|
282
|
-
* unexpected body or status. Used when decoding the server\'s error payload into
|
|
283
|
-
* `SendAccessTokenApiErrorResponse` fails, or for 5xx responses where no structured error is
|
|
284
|
-
* available.
|
|
285
|
-
*/
|
|
286
|
-
export type UnexpectedIdentityError = string;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Invalid request errors - typically due to missing parameters.
|
|
281
|
+
* Represents errors that can occur when requesting a send access token.
|
|
282
|
+
* It includes expected and unexpected API errors.
|
|
290
283
|
*/
|
|
291
|
-
export type
|
|
292
|
-
| "
|
|
293
|
-
| "
|
|
294
|
-
| "email_required"
|
|
295
|
-
| "email_and_otp_required_otp_sent"
|
|
296
|
-
| "unknown";
|
|
284
|
+
export type SendAccessTokenError =
|
|
285
|
+
| { kind: "unexpected"; data: UnexpectedIdentityError }
|
|
286
|
+
| { kind: "expected"; data: SendAccessTokenApiErrorResponse };
|
|
297
287
|
|
|
298
288
|
/**
|
|
299
289
|
* Invalid grant errors - typically due to invalid credentials.
|
|
@@ -327,38 +317,48 @@ export type SendAccessTokenApiErrorResponse =
|
|
|
327
317
|
| { error: "invalid_target"; error_description?: string };
|
|
328
318
|
|
|
329
319
|
/**
|
|
330
|
-
*
|
|
320
|
+
* Invalid request errors - typically due to missing parameters.
|
|
331
321
|
*/
|
|
332
|
-
export type
|
|
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";
|
|
333
328
|
|
|
334
|
-
export interface
|
|
329
|
+
export interface Collection {
|
|
335
330
|
id: CollectionId | undefined;
|
|
336
331
|
organizationId: OrganizationId;
|
|
337
|
-
name:
|
|
332
|
+
name: EncString;
|
|
338
333
|
externalId: string | undefined;
|
|
339
334
|
hidePasswords: boolean;
|
|
340
335
|
readOnly: boolean;
|
|
341
336
|
manage: boolean;
|
|
337
|
+
defaultUserCollectionEmail: string | undefined;
|
|
342
338
|
type: CollectionType;
|
|
343
339
|
}
|
|
344
340
|
|
|
345
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Type of collection
|
|
343
|
+
*/
|
|
344
|
+
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* NewType wrapper for `CollectionId`
|
|
348
|
+
*/
|
|
349
|
+
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
350
|
+
|
|
351
|
+
export interface CollectionView {
|
|
346
352
|
id: CollectionId | undefined;
|
|
347
353
|
organizationId: OrganizationId;
|
|
348
|
-
name:
|
|
354
|
+
name: string;
|
|
349
355
|
externalId: string | undefined;
|
|
350
356
|
hidePasswords: boolean;
|
|
351
357
|
readOnly: boolean;
|
|
352
358
|
manage: boolean;
|
|
353
|
-
defaultUserCollectionEmail: string | undefined;
|
|
354
359
|
type: CollectionType;
|
|
355
360
|
}
|
|
356
361
|
|
|
357
|
-
/**
|
|
358
|
-
* NewType wrapper for `CollectionId`
|
|
359
|
-
*/
|
|
360
|
-
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
361
|
-
|
|
362
362
|
export interface CollectionDecryptError extends Error {
|
|
363
363
|
name: "CollectionDecryptError";
|
|
364
364
|
variant: "Crypto";
|
|
@@ -368,6 +368,15 @@ export function isCollectionDecryptError(error: any): error is CollectionDecrypt
|
|
|
368
368
|
|
|
369
369
|
export type SignedSecurityState = string;
|
|
370
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Represents the data required to authenticate with the master password.
|
|
373
|
+
*/
|
|
374
|
+
export interface MasterPasswordAuthenticationData {
|
|
375
|
+
kdf: Kdf;
|
|
376
|
+
salt: string;
|
|
377
|
+
masterPasswordAuthenticationHash: B64;
|
|
378
|
+
}
|
|
379
|
+
|
|
371
380
|
/**
|
|
372
381
|
* Represents the data required to unlock with the master password.
|
|
373
382
|
*/
|
|
@@ -398,15 +407,6 @@ export interface MasterPasswordError extends Error {
|
|
|
398
407
|
|
|
399
408
|
export function isMasterPasswordError(error: any): error is MasterPasswordError;
|
|
400
409
|
|
|
401
|
-
/**
|
|
402
|
-
* Represents the data required to authenticate with the master password.
|
|
403
|
-
*/
|
|
404
|
-
export interface MasterPasswordAuthenticationData {
|
|
405
|
-
kdf: Kdf;
|
|
406
|
-
salt: string;
|
|
407
|
-
masterPasswordAuthenticationHash: B64;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
410
|
export interface AccountCryptographyInitializationError extends Error {
|
|
411
411
|
name: "AccountCryptographyInitializationError";
|
|
412
412
|
variant:
|
|
@@ -438,68 +438,39 @@ export type WrappedAccountCryptographicState =
|
|
|
438
438
|
};
|
|
439
439
|
|
|
440
440
|
/**
|
|
441
|
-
*
|
|
441
|
+
* Response for `verify_asymmetric_keys`.
|
|
442
442
|
*/
|
|
443
|
-
export interface
|
|
444
|
-
/**
|
|
445
|
-
* Encrypted user key, used to validate the master key
|
|
446
|
-
*/
|
|
447
|
-
userKeyEncrypted: EncString;
|
|
448
|
-
/**
|
|
449
|
-
* The user\'s master password
|
|
450
|
-
*/
|
|
451
|
-
password: string;
|
|
443
|
+
export interface VerifyAsymmetricKeysResponse {
|
|
452
444
|
/**
|
|
453
|
-
*
|
|
445
|
+
* Whether the user\'s private key was decryptable by the user key.
|
|
454
446
|
*/
|
|
455
|
-
|
|
447
|
+
privateKeyDecryptable: boolean;
|
|
456
448
|
/**
|
|
457
|
-
*
|
|
449
|
+
* Whether the user\'s private key was a valid RSA key and matched the public key provided.
|
|
458
450
|
*/
|
|
459
|
-
|
|
451
|
+
validPrivateKey: boolean;
|
|
460
452
|
}
|
|
461
453
|
|
|
462
454
|
/**
|
|
463
455
|
* Request for deriving a pin protected user key
|
|
464
456
|
*/
|
|
465
|
-
export interface
|
|
457
|
+
export interface EnrollPinResponse {
|
|
466
458
|
/**
|
|
467
459
|
* [UserKey] protected by PIN
|
|
468
460
|
*/
|
|
469
|
-
|
|
461
|
+
pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
|
|
470
462
|
/**
|
|
471
463
|
* PIN protected by [UserKey]
|
|
472
464
|
*/
|
|
473
|
-
|
|
465
|
+
userKeyEncryptedPin: EncString;
|
|
474
466
|
}
|
|
475
467
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
export interface MakeKeyPairResponse {
|
|
480
|
-
/**
|
|
481
|
-
* The user\'s public key
|
|
482
|
-
*/
|
|
483
|
-
userPublicKey: B64;
|
|
484
|
-
/**
|
|
485
|
-
* User\'s private key, encrypted with the user key
|
|
486
|
-
*/
|
|
487
|
-
userKeyEncryptedPrivateKey: EncString;
|
|
468
|
+
export interface DeriveKeyConnectorError extends Error {
|
|
469
|
+
name: "DeriveKeyConnectorError";
|
|
470
|
+
variant: "WrongPassword" | "Crypto";
|
|
488
471
|
}
|
|
489
472
|
|
|
490
|
-
|
|
491
|
-
* Response for `verify_asymmetric_keys`.
|
|
492
|
-
*/
|
|
493
|
-
export interface VerifyAsymmetricKeysResponse {
|
|
494
|
-
/**
|
|
495
|
-
* Whether the user\'s private key was decryptable by the user key.
|
|
496
|
-
*/
|
|
497
|
-
privateKeyDecryptable: boolean;
|
|
498
|
-
/**
|
|
499
|
-
* Whether the user\'s private key was a valid RSA key and matched the public key provided.
|
|
500
|
-
*/
|
|
501
|
-
validPrivateKey: boolean;
|
|
502
|
-
}
|
|
473
|
+
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
503
474
|
|
|
504
475
|
export interface EnrollAdminPasswordResetError extends Error {
|
|
505
476
|
name: "EnrollAdminPasswordResetError";
|
|
@@ -508,27 +479,6 @@ export interface EnrollAdminPasswordResetError extends Error {
|
|
|
508
479
|
|
|
509
480
|
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
510
481
|
|
|
511
|
-
export interface CryptoClientError extends Error {
|
|
512
|
-
name: "CryptoClientError";
|
|
513
|
-
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Request for deriving a pin protected user key
|
|
520
|
-
*/
|
|
521
|
-
export interface EnrollPinResponse {
|
|
522
|
-
/**
|
|
523
|
-
* [UserKey] protected by PIN
|
|
524
|
-
*/
|
|
525
|
-
pinProtectedUserKeyEnvelope: PasswordProtectedKeyEnvelope;
|
|
526
|
-
/**
|
|
527
|
-
* PIN protected by [UserKey]
|
|
528
|
-
*/
|
|
529
|
-
userKeyEncryptedPin: EncString;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
482
|
/**
|
|
533
483
|
* State used for initializing the user cryptographic state.
|
|
534
484
|
*/
|
|
@@ -557,53 +507,58 @@ export interface InitUserCryptoRequest {
|
|
|
557
507
|
}
|
|
558
508
|
|
|
559
509
|
/**
|
|
560
|
-
*
|
|
561
|
-
*/
|
|
562
|
-
export interface VerifyAsymmetricKeysRequest {
|
|
563
|
-
/**
|
|
564
|
-
* The user\'s user key
|
|
565
|
-
*/
|
|
566
|
-
userKey: B64;
|
|
567
|
-
/**
|
|
568
|
-
* The user\'s public key
|
|
569
|
-
*/
|
|
570
|
-
userPublicKey: B64;
|
|
571
|
-
/**
|
|
572
|
-
* User\'s private key, encrypted with the user key
|
|
573
|
-
*/
|
|
574
|
-
userKeyEncryptedPrivateKey: EncString;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Response from the `make_update_password` function
|
|
510
|
+
* The crypto method used to initialize the user cryptographic state.
|
|
579
511
|
*/
|
|
580
|
-
export
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
512
|
+
export type InitUserCryptoMethod =
|
|
513
|
+
| { password: { password: string; user_key: EncString } }
|
|
514
|
+
| { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
|
|
515
|
+
| { decryptedKey: { decrypted_user_key: string } }
|
|
516
|
+
| { pin: { pin: string; pin_protected_user_key: EncString } }
|
|
517
|
+
| { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
|
|
518
|
+
| { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
|
|
519
|
+
| {
|
|
520
|
+
deviceKey: {
|
|
521
|
+
device_key: string;
|
|
522
|
+
protected_device_private_key: EncString;
|
|
523
|
+
device_protected_user_key: UnsignedSharedKey;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
527
|
+
|
|
528
|
+
export interface CryptoClientError extends Error {
|
|
529
|
+
name: "CryptoClientError";
|
|
530
|
+
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
589
531
|
}
|
|
590
532
|
|
|
533
|
+
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
534
|
+
|
|
591
535
|
/**
|
|
592
|
-
*
|
|
536
|
+
* Response from the `make_key_pair` function
|
|
593
537
|
*/
|
|
594
|
-
export interface
|
|
538
|
+
export interface MakeKeyPairResponse {
|
|
595
539
|
/**
|
|
596
|
-
* The
|
|
540
|
+
* The user\'s public key
|
|
597
541
|
*/
|
|
598
|
-
|
|
542
|
+
userPublicKey: B64;
|
|
543
|
+
/**
|
|
544
|
+
* User\'s private key, encrypted with the user key
|
|
545
|
+
*/
|
|
546
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
599
547
|
}
|
|
600
548
|
|
|
601
549
|
/**
|
|
602
|
-
*
|
|
550
|
+
* Response from the `make_update_password` function
|
|
603
551
|
*/
|
|
604
|
-
export
|
|
605
|
-
|
|
606
|
-
|
|
552
|
+
export interface UpdatePasswordResponse {
|
|
553
|
+
/**
|
|
554
|
+
* Hash of the new password
|
|
555
|
+
*/
|
|
556
|
+
passwordHash: B64;
|
|
557
|
+
/**
|
|
558
|
+
* User key, encrypted with the new password
|
|
559
|
+
*/
|
|
560
|
+
newKey: EncString;
|
|
561
|
+
}
|
|
607
562
|
|
|
608
563
|
/**
|
|
609
564
|
* Response from the `update_kdf` function
|
|
@@ -623,32 +578,6 @@ export interface UpdateKdfResponse {
|
|
|
623
578
|
oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData;
|
|
624
579
|
}
|
|
625
580
|
|
|
626
|
-
export interface DeriveKeyConnectorError extends Error {
|
|
627
|
-
name: "DeriveKeyConnectorError";
|
|
628
|
-
variant: "WrongPassword" | "Crypto";
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* The crypto method used to initialize the user cryptographic state.
|
|
635
|
-
*/
|
|
636
|
-
export type InitUserCryptoMethod =
|
|
637
|
-
| { password: { password: string; user_key: EncString } }
|
|
638
|
-
| { masterPasswordUnlock: { password: string; master_password_unlock: MasterPasswordUnlockData } }
|
|
639
|
-
| { decryptedKey: { decrypted_user_key: string } }
|
|
640
|
-
| { pin: { pin: string; pin_protected_user_key: EncString } }
|
|
641
|
-
| { pinEnvelope: { pin: string; pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope } }
|
|
642
|
-
| { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
|
|
643
|
-
| {
|
|
644
|
-
deviceKey: {
|
|
645
|
-
device_key: string;
|
|
646
|
-
protected_device_private_key: EncString;
|
|
647
|
-
device_protected_user_key: UnsignedSharedKey;
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
651
|
-
|
|
652
581
|
/**
|
|
653
582
|
* Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
|
|
654
583
|
*/
|
|
@@ -687,6 +616,77 @@ export interface UserCryptoV2KeysResponse {
|
|
|
687
616
|
securityVersion: number;
|
|
688
617
|
}
|
|
689
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Auth requests supports multiple initialization methods.
|
|
621
|
+
*/
|
|
622
|
+
export type AuthRequestMethod =
|
|
623
|
+
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
624
|
+
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Request for deriving a pin protected user key
|
|
628
|
+
*/
|
|
629
|
+
export interface DerivePinKeyResponse {
|
|
630
|
+
/**
|
|
631
|
+
* [UserKey] protected by PIN
|
|
632
|
+
*/
|
|
633
|
+
pinProtectedUserKey: EncString;
|
|
634
|
+
/**
|
|
635
|
+
* PIN protected by [UserKey]
|
|
636
|
+
*/
|
|
637
|
+
encryptedPin: EncString;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Represents the request to initialize the user\'s organizational cryptographic state.
|
|
642
|
+
*/
|
|
643
|
+
export interface InitOrgCryptoRequest {
|
|
644
|
+
/**
|
|
645
|
+
* The encryption keys for all the organizations the user is a part of
|
|
646
|
+
*/
|
|
647
|
+
organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Request for migrating an account from password to key connector.
|
|
652
|
+
*/
|
|
653
|
+
export interface DeriveKeyConnectorRequest {
|
|
654
|
+
/**
|
|
655
|
+
* Encrypted user key, used to validate the master key
|
|
656
|
+
*/
|
|
657
|
+
userKeyEncrypted: EncString;
|
|
658
|
+
/**
|
|
659
|
+
* The user\'s master password
|
|
660
|
+
*/
|
|
661
|
+
password: string;
|
|
662
|
+
/**
|
|
663
|
+
* The KDF parameters used to derive the master key
|
|
664
|
+
*/
|
|
665
|
+
kdf: Kdf;
|
|
666
|
+
/**
|
|
667
|
+
* The user\'s email address
|
|
668
|
+
*/
|
|
669
|
+
email: string;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Request for `verify_asymmetric_keys`.
|
|
674
|
+
*/
|
|
675
|
+
export interface VerifyAsymmetricKeysRequest {
|
|
676
|
+
/**
|
|
677
|
+
* The user\'s user key
|
|
678
|
+
*/
|
|
679
|
+
userKey: B64;
|
|
680
|
+
/**
|
|
681
|
+
* The user\'s public key
|
|
682
|
+
*/
|
|
683
|
+
userPublicKey: B64;
|
|
684
|
+
/**
|
|
685
|
+
* User\'s private key, encrypted with the user key
|
|
686
|
+
*/
|
|
687
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
690
|
/**
|
|
691
691
|
* NewType wrapper for `OrganizationId`
|
|
692
692
|
*/
|
|
@@ -963,12 +963,7 @@ export interface PasswordGeneratorRequest {
|
|
|
963
963
|
minSpecial: number | undefined;
|
|
964
964
|
}
|
|
965
965
|
|
|
966
|
-
export
|
|
967
|
-
name: "UsernameError";
|
|
968
|
-
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
export function isUsernameError(error: any): error is UsernameError;
|
|
966
|
+
export type AppendType = "random" | { websiteName: { website: string } };
|
|
972
967
|
|
|
973
968
|
export type UsernameGeneratorRequest =
|
|
974
969
|
| { word: { capitalize: boolean; include_number: boolean } }
|
|
@@ -976,7 +971,12 @@ export type UsernameGeneratorRequest =
|
|
|
976
971
|
| { catchall: { type: AppendType; domain: string } }
|
|
977
972
|
| { forwarded: { service: ForwarderServiceType; website: string | undefined } };
|
|
978
973
|
|
|
979
|
-
export
|
|
974
|
+
export interface UsernameError extends Error {
|
|
975
|
+
name: "UsernameError";
|
|
976
|
+
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export function isUsernameError(error: any): error is UsernameError;
|
|
980
980
|
|
|
981
981
|
/**
|
|
982
982
|
* Configures the email forwarding service to use.
|
|
@@ -998,6 +998,13 @@ export interface RequestError extends Error {
|
|
|
998
998
|
|
|
999
999
|
export function isRequestError(error: any): error is RequestError;
|
|
1000
1000
|
|
|
1001
|
+
export interface TypedReceiveError extends Error {
|
|
1002
|
+
name: "TypedReceiveError";
|
|
1003
|
+
variant: "Channel" | "Timeout" | "Cancelled" | "Typing";
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
export function isTypedReceiveError(error: any): error is TypedReceiveError;
|
|
1007
|
+
|
|
1001
1008
|
export interface SubscribeError extends Error {
|
|
1002
1009
|
name: "SubscribeError";
|
|
1003
1010
|
variant: "NotStarted";
|
|
@@ -1012,29 +1019,22 @@ export interface ReceiveError extends Error {
|
|
|
1012
1019
|
|
|
1013
1020
|
export function isReceiveError(error: any): error is ReceiveError;
|
|
1014
1021
|
|
|
1015
|
-
export interface TypedReceiveError extends Error {
|
|
1016
|
-
name: "TypedReceiveError";
|
|
1017
|
-
variant: "Channel" | "Timeout" | "Cancelled" | "Typing";
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
export function isTypedReceiveError(error: any): error is TypedReceiveError;
|
|
1021
|
-
|
|
1022
1022
|
export interface IpcCommunicationBackendSender {
|
|
1023
1023
|
send(message: OutgoingMessage): Promise<void>;
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
|
-
export interface DeserializeError extends Error {
|
|
1027
|
-
name: "DeserializeError";
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
export function isDeserializeError(error: any): error is DeserializeError;
|
|
1031
|
-
|
|
1032
1026
|
export interface ChannelError extends Error {
|
|
1033
1027
|
name: "ChannelError";
|
|
1034
1028
|
}
|
|
1035
1029
|
|
|
1036
1030
|
export function isChannelError(error: any): error is ChannelError;
|
|
1037
1031
|
|
|
1032
|
+
export interface DeserializeError extends Error {
|
|
1033
|
+
name: "DeserializeError";
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export function isDeserializeError(error: any): error is DeserializeError;
|
|
1037
|
+
|
|
1038
1038
|
export interface IpcSessionRepository {
|
|
1039
1039
|
get(endpoint: Endpoint): Promise<any | undefined>;
|
|
1040
1040
|
save(endpoint: Endpoint, session: any): Promise<void>;
|
|
@@ -1103,31 +1103,17 @@ export interface CipherRiskError extends Error {
|
|
|
1103
1103
|
export function isCipherRiskError(error: any): error is CipherRiskError;
|
|
1104
1104
|
|
|
1105
1105
|
/**
|
|
1106
|
-
*
|
|
1106
|
+
* Result of checking password exposure via HIBP API.
|
|
1107
1107
|
*/
|
|
1108
|
-
export
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
password_strength: number;
|
|
1118
|
-
/**
|
|
1119
|
-
* Result of checking password exposure via HIBP API.
|
|
1120
|
-
* - `NotChecked`: check_exposed was false, or password was empty
|
|
1121
|
-
* - `Found(n)`: Successfully checked, found in n breaches
|
|
1122
|
-
* - `Error(msg)`: HIBP API request failed for this cipher with the given error message
|
|
1123
|
-
*/
|
|
1124
|
-
exposed_result: ExposedPasswordResult;
|
|
1125
|
-
/**
|
|
1126
|
-
* Number of times this password appears in the provided password_map.
|
|
1127
|
-
* None if not found or if no password_map was provided.
|
|
1128
|
-
*/
|
|
1129
|
-
reuse_count: number | undefined;
|
|
1130
|
-
}
|
|
1108
|
+
export type ExposedPasswordResult =
|
|
1109
|
+
| { type: "NotChecked" }
|
|
1110
|
+
| { type: "Found"; value: number }
|
|
1111
|
+
| { type: "Error"; value: string };
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* Password reuse map wrapper for WASM compatibility.
|
|
1115
|
+
*/
|
|
1116
|
+
export type PasswordReuseMap = Record<string, number>;
|
|
1131
1117
|
|
|
1132
1118
|
/**
|
|
1133
1119
|
* Options for configuring risk computation.
|
|
@@ -1169,42 +1155,56 @@ export interface CipherLoginDetails {
|
|
|
1169
1155
|
}
|
|
1170
1156
|
|
|
1171
1157
|
/**
|
|
1172
|
-
*
|
|
1173
|
-
*/
|
|
1174
|
-
export type PasswordReuseMap = Record<string, number>;
|
|
1175
|
-
|
|
1176
|
-
/**
|
|
1177
|
-
* Result of checking password exposure via HIBP API.
|
|
1158
|
+
* Risk evaluation result for a single cipher.
|
|
1178
1159
|
*/
|
|
1179
|
-
export
|
|
1180
|
-
| { type: "NotChecked" }
|
|
1181
|
-
| { type: "Found"; value: number }
|
|
1182
|
-
| { type: "Error"; value: string };
|
|
1183
|
-
|
|
1184
|
-
export interface PasswordHistory {
|
|
1185
|
-
password: EncString;
|
|
1186
|
-
lastUsedDate: DateTime<Utc>;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
export interface PasswordHistoryView {
|
|
1190
|
-
password: string;
|
|
1191
|
-
lastUsedDate: DateTime<Utc>;
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
export interface AncestorMap {
|
|
1195
|
-
ancestors: Map<CollectionId, string>;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
export interface TotpError extends Error {
|
|
1199
|
-
name: "TotpError";
|
|
1200
|
-
variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
export function isTotpError(error: any): error is TotpError;
|
|
1204
|
-
|
|
1205
|
-
export interface TotpResponse {
|
|
1160
|
+
export interface CipherRiskResult {
|
|
1206
1161
|
/**
|
|
1207
|
-
*
|
|
1162
|
+
* Cipher ID matching the input CipherLoginDetails.
|
|
1163
|
+
*/
|
|
1164
|
+
id: CipherId;
|
|
1165
|
+
/**
|
|
1166
|
+
* Password strength score from 0 (weakest) to 4 (strongest).
|
|
1167
|
+
* Calculated using zxcvbn with cipher-specific context.
|
|
1168
|
+
*/
|
|
1169
|
+
password_strength: number;
|
|
1170
|
+
/**
|
|
1171
|
+
* Result of checking password exposure via HIBP API.
|
|
1172
|
+
* - `NotChecked`: check_exposed was false, or password was empty
|
|
1173
|
+
* - `Found(n)`: Successfully checked, found in n breaches
|
|
1174
|
+
* - `Error(msg)`: HIBP API request failed for this cipher with the given error message
|
|
1175
|
+
*/
|
|
1176
|
+
exposed_result: ExposedPasswordResult;
|
|
1177
|
+
/**
|
|
1178
|
+
* Number of times this password appears in the provided password_map.
|
|
1179
|
+
* None if not found or if no password_map was provided.
|
|
1180
|
+
*/
|
|
1181
|
+
reuse_count: number | undefined;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
export interface PasswordHistoryView {
|
|
1185
|
+
password: string;
|
|
1186
|
+
lastUsedDate: DateTime<Utc>;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
export interface PasswordHistory {
|
|
1190
|
+
password: EncString;
|
|
1191
|
+
lastUsedDate: DateTime<Utc>;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export interface AncestorMap {
|
|
1195
|
+
ancestors: Map<CollectionId, string>;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
export interface TotpError extends Error {
|
|
1199
|
+
name: "TotpError";
|
|
1200
|
+
variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export function isTotpError(error: any): error is TotpError;
|
|
1204
|
+
|
|
1205
|
+
export interface TotpResponse {
|
|
1206
|
+
/**
|
|
1207
|
+
* Generated TOTP code
|
|
1208
1208
|
*/
|
|
1209
1209
|
code: string;
|
|
1210
1210
|
/**
|
|
@@ -1271,11 +1271,11 @@ export interface LocalDataView {
|
|
|
1271
1271
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
|
-
export interface
|
|
1274
|
+
export interface SecureNote {
|
|
1275
1275
|
type: SecureNoteType;
|
|
1276
1276
|
}
|
|
1277
1277
|
|
|
1278
|
-
export interface
|
|
1278
|
+
export interface SecureNoteView {
|
|
1279
1279
|
type: SecureNoteType;
|
|
1280
1280
|
}
|
|
1281
1281
|
|
|
@@ -1320,13 +1320,6 @@ export interface CipherEditRequest {
|
|
|
1320
1320
|
key: EncString | undefined;
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
|
-
export interface CreateCipherError extends Error {
|
|
1324
|
-
name: "CreateCipherError";
|
|
1325
|
-
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1329
|
-
|
|
1330
1323
|
/**
|
|
1331
1324
|
* Request to add a cipher.
|
|
1332
1325
|
*/
|
|
@@ -1341,6 +1334,13 @@ export interface CipherCreateRequest {
|
|
|
1341
1334
|
fields: FieldView[];
|
|
1342
1335
|
}
|
|
1343
1336
|
|
|
1337
|
+
export interface CreateCipherError extends Error {
|
|
1338
|
+
name: "CreateCipherError";
|
|
1339
|
+
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1343
|
+
|
|
1344
1344
|
/**
|
|
1345
1345
|
* Represents the inner data of a cipher view.
|
|
1346
1346
|
*/
|
|
@@ -1370,15 +1370,6 @@ export interface CipherPermissions {
|
|
|
1370
1370
|
restore: boolean;
|
|
1371
1371
|
}
|
|
1372
1372
|
|
|
1373
|
-
export interface CardView {
|
|
1374
|
-
cardholderName: string | undefined;
|
|
1375
|
-
expMonth: string | undefined;
|
|
1376
|
-
expYear: string | undefined;
|
|
1377
|
-
code: string | undefined;
|
|
1378
|
-
brand: string | undefined;
|
|
1379
|
-
number: string | undefined;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
1373
|
export interface Card {
|
|
1383
1374
|
cardholderName: EncString | undefined;
|
|
1384
1375
|
expMonth: EncString | undefined;
|
|
@@ -1398,6 +1389,15 @@ export interface CardListView {
|
|
|
1398
1389
|
brand: string | undefined;
|
|
1399
1390
|
}
|
|
1400
1391
|
|
|
1392
|
+
export interface CardView {
|
|
1393
|
+
cardholderName: string | undefined;
|
|
1394
|
+
expMonth: string | undefined;
|
|
1395
|
+
expYear: string | undefined;
|
|
1396
|
+
code: string | undefined;
|
|
1397
|
+
brand: string | undefined;
|
|
1398
|
+
number: string | undefined;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
1401
|
export interface FieldView {
|
|
1402
1402
|
name: string | undefined;
|
|
1403
1403
|
value: string | undefined;
|
|
@@ -1412,23 +1412,36 @@ export interface Field {
|
|
|
1412
1412
|
linkedId: LinkedIdType | undefined;
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
|
+
export interface LoginListView {
|
|
1416
|
+
fido2Credentials: Fido2CredentialListView[] | undefined;
|
|
1417
|
+
hasFido2: boolean;
|
|
1418
|
+
username: string | undefined;
|
|
1419
|
+
/**
|
|
1420
|
+
* The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
|
|
1421
|
+
*/
|
|
1422
|
+
totp: EncString | undefined;
|
|
1423
|
+
uris: LoginUriView[] | undefined;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1415
1426
|
export interface LoginUriView {
|
|
1416
1427
|
uri: string | undefined;
|
|
1417
1428
|
match: UriMatchType | undefined;
|
|
1418
1429
|
uriChecksum: string | undefined;
|
|
1419
1430
|
}
|
|
1420
1431
|
|
|
1421
|
-
export interface
|
|
1432
|
+
export interface Fido2CredentialFullView {
|
|
1422
1433
|
credentialId: string;
|
|
1423
1434
|
keyType: string;
|
|
1424
1435
|
keyAlgorithm: string;
|
|
1425
1436
|
keyCurve: string;
|
|
1437
|
+
keyValue: string;
|
|
1426
1438
|
rpId: string;
|
|
1427
1439
|
userHandle: string | undefined;
|
|
1428
1440
|
userName: string | undefined;
|
|
1429
1441
|
counter: string;
|
|
1430
1442
|
rpName: string | undefined;
|
|
1431
1443
|
userDisplayName: string | undefined;
|
|
1444
|
+
discoverable: string;
|
|
1432
1445
|
creationDate: DateTime<Utc>;
|
|
1433
1446
|
}
|
|
1434
1447
|
|
|
@@ -1442,38 +1455,6 @@ export interface Login {
|
|
|
1442
1455
|
fido2Credentials: Fido2Credential[] | undefined;
|
|
1443
1456
|
}
|
|
1444
1457
|
|
|
1445
|
-
export interface Fido2CredentialFullView {
|
|
1446
|
-
credentialId: string;
|
|
1447
|
-
keyType: string;
|
|
1448
|
-
keyAlgorithm: string;
|
|
1449
|
-
keyCurve: string;
|
|
1450
|
-
keyValue: string;
|
|
1451
|
-
rpId: string;
|
|
1452
|
-
userHandle: string | undefined;
|
|
1453
|
-
userName: string | undefined;
|
|
1454
|
-
counter: string;
|
|
1455
|
-
rpName: string | undefined;
|
|
1456
|
-
userDisplayName: string | undefined;
|
|
1457
|
-
discoverable: string;
|
|
1458
|
-
creationDate: DateTime<Utc>;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
export interface LoginView {
|
|
1462
|
-
username: string | undefined;
|
|
1463
|
-
password: string | undefined;
|
|
1464
|
-
passwordRevisionDate: DateTime<Utc> | undefined;
|
|
1465
|
-
uris: LoginUriView[] | undefined;
|
|
1466
|
-
totp: string | undefined;
|
|
1467
|
-
autofillOnPageLoad: boolean | undefined;
|
|
1468
|
-
fido2Credentials: Fido2Credential[] | undefined;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
export interface LoginUri {
|
|
1472
|
-
uri: EncString | undefined;
|
|
1473
|
-
match: UriMatchType | undefined;
|
|
1474
|
-
uriChecksum: EncString | undefined;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
1458
|
export interface Fido2Credential {
|
|
1478
1459
|
credentialId: EncString;
|
|
1479
1460
|
keyType: EncString;
|
|
@@ -1490,133 +1471,59 @@ export interface Fido2Credential {
|
|
|
1490
1471
|
creationDate: DateTime<Utc>;
|
|
1491
1472
|
}
|
|
1492
1473
|
|
|
1493
|
-
export interface
|
|
1494
|
-
|
|
1495
|
-
|
|
1474
|
+
export interface Fido2CredentialListView {
|
|
1475
|
+
credentialId: string;
|
|
1476
|
+
rpId: string;
|
|
1477
|
+
userHandle: string | undefined;
|
|
1478
|
+
userName: string | undefined;
|
|
1479
|
+
userDisplayName: string | undefined;
|
|
1480
|
+
counter: string;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
export interface LoginView {
|
|
1496
1484
|
username: string | undefined;
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
*/
|
|
1500
|
-
totp: EncString | undefined;
|
|
1485
|
+
password: string | undefined;
|
|
1486
|
+
passwordRevisionDate: DateTime<Utc> | undefined;
|
|
1501
1487
|
uris: LoginUriView[] | undefined;
|
|
1488
|
+
totp: string | undefined;
|
|
1489
|
+
autofillOnPageLoad: boolean | undefined;
|
|
1490
|
+
fido2Credentials: Fido2Credential[] | undefined;
|
|
1502
1491
|
}
|
|
1503
1492
|
|
|
1504
|
-
export interface
|
|
1493
|
+
export interface Fido2CredentialNewView {
|
|
1505
1494
|
credentialId: string;
|
|
1506
1495
|
keyType: string;
|
|
1507
1496
|
keyAlgorithm: string;
|
|
1508
1497
|
keyCurve: string;
|
|
1509
|
-
keyValue: EncString;
|
|
1510
1498
|
rpId: string;
|
|
1511
1499
|
userHandle: string | undefined;
|
|
1512
1500
|
userName: string | undefined;
|
|
1513
1501
|
counter: string;
|
|
1514
1502
|
rpName: string | undefined;
|
|
1515
1503
|
userDisplayName: string | undefined;
|
|
1516
|
-
discoverable: string;
|
|
1517
1504
|
creationDate: DateTime<Utc>;
|
|
1518
1505
|
}
|
|
1519
1506
|
|
|
1520
|
-
export interface
|
|
1507
|
+
export interface Fido2CredentialView {
|
|
1521
1508
|
credentialId: string;
|
|
1509
|
+
keyType: string;
|
|
1510
|
+
keyAlgorithm: string;
|
|
1511
|
+
keyCurve: string;
|
|
1512
|
+
keyValue: EncString;
|
|
1522
1513
|
rpId: string;
|
|
1523
1514
|
userHandle: string | undefined;
|
|
1524
1515
|
userName: string | undefined;
|
|
1525
|
-
userDisplayName: string | undefined;
|
|
1526
1516
|
counter: string;
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
id: CipherId | undefined;
|
|
1531
|
-
organizationId: OrganizationId | undefined;
|
|
1532
|
-
folderId: FolderId | undefined;
|
|
1533
|
-
collectionIds: CollectionId[];
|
|
1534
|
-
/**
|
|
1535
|
-
* Temporary, required to support calculating TOTP from CipherListView.
|
|
1536
|
-
*/
|
|
1537
|
-
key: EncString | undefined;
|
|
1538
|
-
name: string;
|
|
1539
|
-
subtitle: string;
|
|
1540
|
-
type: CipherListViewType;
|
|
1541
|
-
favorite: boolean;
|
|
1542
|
-
reprompt: CipherRepromptType;
|
|
1543
|
-
organizationUseTotp: boolean;
|
|
1544
|
-
edit: boolean;
|
|
1545
|
-
permissions: CipherPermissions | undefined;
|
|
1546
|
-
viewPassword: boolean;
|
|
1547
|
-
/**
|
|
1548
|
-
* The number of attachments
|
|
1549
|
-
*/
|
|
1550
|
-
attachments: number;
|
|
1551
|
-
/**
|
|
1552
|
-
* Indicates if the cipher has old attachments that need to be re-uploaded
|
|
1553
|
-
*/
|
|
1554
|
-
hasOldAttachments: boolean;
|
|
1555
|
-
creationDate: DateTime<Utc>;
|
|
1556
|
-
deletedDate: DateTime<Utc> | undefined;
|
|
1557
|
-
revisionDate: DateTime<Utc>;
|
|
1558
|
-
archivedDate: DateTime<Utc> | undefined;
|
|
1559
|
-
/**
|
|
1560
|
-
* Hints for the presentation layer for which fields can be copied.
|
|
1561
|
-
*/
|
|
1562
|
-
copyableFields: CopyableCipherFields[];
|
|
1563
|
-
localData: LocalDataView | undefined;
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
export interface CipherView {
|
|
1567
|
-
id: CipherId | undefined;
|
|
1568
|
-
organizationId: OrganizationId | undefined;
|
|
1569
|
-
folderId: FolderId | undefined;
|
|
1570
|
-
collectionIds: CollectionId[];
|
|
1571
|
-
/**
|
|
1572
|
-
* Temporary, required to support re-encrypting existing items.
|
|
1573
|
-
*/
|
|
1574
|
-
key: EncString | undefined;
|
|
1575
|
-
name: string;
|
|
1576
|
-
notes: string | undefined;
|
|
1577
|
-
type: CipherType;
|
|
1578
|
-
login: LoginView | undefined;
|
|
1579
|
-
identity: IdentityView | undefined;
|
|
1580
|
-
card: CardView | undefined;
|
|
1581
|
-
secureNote: SecureNoteView | undefined;
|
|
1582
|
-
sshKey: SshKeyView | undefined;
|
|
1583
|
-
favorite: boolean;
|
|
1584
|
-
reprompt: CipherRepromptType;
|
|
1585
|
-
organizationUseTotp: boolean;
|
|
1586
|
-
edit: boolean;
|
|
1587
|
-
permissions: CipherPermissions | undefined;
|
|
1588
|
-
viewPassword: boolean;
|
|
1589
|
-
localData: LocalDataView | undefined;
|
|
1590
|
-
attachments: AttachmentView[] | undefined;
|
|
1591
|
-
fields: FieldView[] | undefined;
|
|
1592
|
-
passwordHistory: PasswordHistoryView[] | undefined;
|
|
1517
|
+
rpName: string | undefined;
|
|
1518
|
+
userDisplayName: string | undefined;
|
|
1519
|
+
discoverable: string;
|
|
1593
1520
|
creationDate: DateTime<Utc>;
|
|
1594
|
-
deletedDate: DateTime<Utc> | undefined;
|
|
1595
|
-
revisionDate: DateTime<Utc>;
|
|
1596
|
-
archivedDate: DateTime<Utc> | undefined;
|
|
1597
1521
|
}
|
|
1598
1522
|
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* Represents the result of decrypting a list of ciphers.
|
|
1606
|
-
*
|
|
1607
|
-
* This struct contains two vectors: `successes` and `failures`.
|
|
1608
|
-
* `successes` contains the decrypted `CipherListView` objects,
|
|
1609
|
-
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1610
|
-
*/
|
|
1611
|
-
export interface DecryptCipherListResult {
|
|
1612
|
-
/**
|
|
1613
|
-
* The decrypted `CipherListView` objects.
|
|
1614
|
-
*/
|
|
1615
|
-
successes: CipherListView[];
|
|
1616
|
-
/**
|
|
1617
|
-
* The original `Cipher` objects that failed to decrypt.
|
|
1618
|
-
*/
|
|
1619
|
-
failures: Cipher[];
|
|
1523
|
+
export interface LoginUri {
|
|
1524
|
+
uri: EncString | undefined;
|
|
1525
|
+
match: UriMatchType | undefined;
|
|
1526
|
+
uriChecksum: EncString | undefined;
|
|
1620
1527
|
}
|
|
1621
1528
|
|
|
1622
1529
|
/**
|
|
@@ -1635,15 +1542,6 @@ export type CopyableCipherFields =
|
|
|
1635
1542
|
| "SshKey"
|
|
1636
1543
|
| "SecureNotes";
|
|
1637
1544
|
|
|
1638
|
-
export interface EncryptionContext {
|
|
1639
|
-
/**
|
|
1640
|
-
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1641
|
-
* Organization-owned ciphers
|
|
1642
|
-
*/
|
|
1643
|
-
encryptedFor: UserId;
|
|
1644
|
-
cipher: Cipher;
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
1545
|
export interface Cipher {
|
|
1648
1546
|
id: CipherId | undefined;
|
|
1649
1547
|
organizationId: OrganizationId | undefined;
|
|
@@ -1704,19 +1602,106 @@ export interface CipherError extends Error {
|
|
|
1704
1602
|
|
|
1705
1603
|
export function isCipherError(error: any): error is CipherError;
|
|
1706
1604
|
|
|
1707
|
-
export interface
|
|
1605
|
+
export interface EncryptionContext {
|
|
1708
1606
|
/**
|
|
1709
|
-
*
|
|
1607
|
+
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1608
|
+
* Organization-owned ciphers
|
|
1710
1609
|
*/
|
|
1711
|
-
|
|
1610
|
+
encryptedFor: UserId;
|
|
1611
|
+
cipher: Cipher;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
export interface CipherListView {
|
|
1615
|
+
id: CipherId | undefined;
|
|
1616
|
+
organizationId: OrganizationId | undefined;
|
|
1617
|
+
folderId: FolderId | undefined;
|
|
1618
|
+
collectionIds: CollectionId[];
|
|
1712
1619
|
/**
|
|
1713
|
-
*
|
|
1620
|
+
* Temporary, required to support calculating TOTP from CipherListView.
|
|
1714
1621
|
*/
|
|
1715
|
-
|
|
1622
|
+
key: EncString | undefined;
|
|
1623
|
+
name: string;
|
|
1624
|
+
subtitle: string;
|
|
1625
|
+
type: CipherListViewType;
|
|
1626
|
+
favorite: boolean;
|
|
1627
|
+
reprompt: CipherRepromptType;
|
|
1628
|
+
organizationUseTotp: boolean;
|
|
1629
|
+
edit: boolean;
|
|
1630
|
+
permissions: CipherPermissions | undefined;
|
|
1631
|
+
viewPassword: boolean;
|
|
1716
1632
|
/**
|
|
1717
|
-
*
|
|
1633
|
+
* The number of attachments
|
|
1718
1634
|
*/
|
|
1719
|
-
|
|
1635
|
+
attachments: number;
|
|
1636
|
+
/**
|
|
1637
|
+
* Indicates if the cipher has old attachments that need to be re-uploaded
|
|
1638
|
+
*/
|
|
1639
|
+
hasOldAttachments: boolean;
|
|
1640
|
+
creationDate: DateTime<Utc>;
|
|
1641
|
+
deletedDate: DateTime<Utc> | undefined;
|
|
1642
|
+
revisionDate: DateTime<Utc>;
|
|
1643
|
+
archivedDate: DateTime<Utc> | undefined;
|
|
1644
|
+
/**
|
|
1645
|
+
* Hints for the presentation layer for which fields can be copied.
|
|
1646
|
+
*/
|
|
1647
|
+
copyableFields: CopyableCipherFields[];
|
|
1648
|
+
localData: LocalDataView | undefined;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Represents the result of decrypting a list of ciphers.
|
|
1653
|
+
*
|
|
1654
|
+
* This struct contains two vectors: `successes` and `failures`.
|
|
1655
|
+
* `successes` contains the decrypted `CipherListView` objects,
|
|
1656
|
+
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1657
|
+
*/
|
|
1658
|
+
export interface DecryptCipherListResult {
|
|
1659
|
+
/**
|
|
1660
|
+
* The decrypted `CipherListView` objects.
|
|
1661
|
+
*/
|
|
1662
|
+
successes: CipherListView[];
|
|
1663
|
+
/**
|
|
1664
|
+
* The original `Cipher` objects that failed to decrypt.
|
|
1665
|
+
*/
|
|
1666
|
+
failures: Cipher[];
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* NewType wrapper for `CipherId`
|
|
1671
|
+
*/
|
|
1672
|
+
export type CipherId = Tagged<Uuid, "CipherId">;
|
|
1673
|
+
|
|
1674
|
+
export interface CipherView {
|
|
1675
|
+
id: CipherId | undefined;
|
|
1676
|
+
organizationId: OrganizationId | undefined;
|
|
1677
|
+
folderId: FolderId | undefined;
|
|
1678
|
+
collectionIds: CollectionId[];
|
|
1679
|
+
/**
|
|
1680
|
+
* Temporary, required to support re-encrypting existing items.
|
|
1681
|
+
*/
|
|
1682
|
+
key: EncString | undefined;
|
|
1683
|
+
name: string;
|
|
1684
|
+
notes: string | undefined;
|
|
1685
|
+
type: CipherType;
|
|
1686
|
+
login: LoginView | undefined;
|
|
1687
|
+
identity: IdentityView | undefined;
|
|
1688
|
+
card: CardView | undefined;
|
|
1689
|
+
secureNote: SecureNoteView | undefined;
|
|
1690
|
+
sshKey: SshKeyView | undefined;
|
|
1691
|
+
favorite: boolean;
|
|
1692
|
+
reprompt: CipherRepromptType;
|
|
1693
|
+
organizationUseTotp: boolean;
|
|
1694
|
+
edit: boolean;
|
|
1695
|
+
permissions: CipherPermissions | undefined;
|
|
1696
|
+
viewPassword: boolean;
|
|
1697
|
+
localData: LocalDataView | undefined;
|
|
1698
|
+
attachments: AttachmentView[] | undefined;
|
|
1699
|
+
fields: FieldView[] | undefined;
|
|
1700
|
+
passwordHistory: PasswordHistoryView[] | undefined;
|
|
1701
|
+
creationDate: DateTime<Utc>;
|
|
1702
|
+
deletedDate: DateTime<Utc> | undefined;
|
|
1703
|
+
revisionDate: DateTime<Utc>;
|
|
1704
|
+
archivedDate: DateTime<Utc> | undefined;
|
|
1720
1705
|
}
|
|
1721
1706
|
|
|
1722
1707
|
export interface SshKey {
|
|
@@ -1734,25 +1719,19 @@ export interface SshKey {
|
|
|
1734
1719
|
fingerprint: EncString;
|
|
1735
1720
|
}
|
|
1736
1721
|
|
|
1737
|
-
export interface
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
email: string | undefined;
|
|
1751
|
-
phone: string | undefined;
|
|
1752
|
-
ssn: string | undefined;
|
|
1753
|
-
username: string | undefined;
|
|
1754
|
-
passportNumber: string | undefined;
|
|
1755
|
-
licenseNumber: string | undefined;
|
|
1722
|
+
export interface SshKeyView {
|
|
1723
|
+
/**
|
|
1724
|
+
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
1725
|
+
*/
|
|
1726
|
+
privateKey: string;
|
|
1727
|
+
/**
|
|
1728
|
+
* SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6)
|
|
1729
|
+
*/
|
|
1730
|
+
publicKey: string;
|
|
1731
|
+
/**
|
|
1732
|
+
* SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT`
|
|
1733
|
+
*/
|
|
1734
|
+
fingerprint: string;
|
|
1756
1735
|
}
|
|
1757
1736
|
|
|
1758
1737
|
export interface Identity {
|
|
@@ -1776,8 +1755,35 @@ export interface Identity {
|
|
|
1776
1755
|
licenseNumber: EncString | undefined;
|
|
1777
1756
|
}
|
|
1778
1757
|
|
|
1758
|
+
export interface IdentityView {
|
|
1759
|
+
title: string | undefined;
|
|
1760
|
+
firstName: string | undefined;
|
|
1761
|
+
middleName: string | undefined;
|
|
1762
|
+
lastName: string | undefined;
|
|
1763
|
+
address1: string | undefined;
|
|
1764
|
+
address2: string | undefined;
|
|
1765
|
+
address3: string | undefined;
|
|
1766
|
+
city: string | undefined;
|
|
1767
|
+
state: string | undefined;
|
|
1768
|
+
postalCode: string | undefined;
|
|
1769
|
+
country: string | undefined;
|
|
1770
|
+
company: string | undefined;
|
|
1771
|
+
email: string | undefined;
|
|
1772
|
+
phone: string | undefined;
|
|
1773
|
+
ssn: string | undefined;
|
|
1774
|
+
username: string | undefined;
|
|
1775
|
+
passportNumber: string | undefined;
|
|
1776
|
+
licenseNumber: string | undefined;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
1779
|
export type LinkedIdType = LoginLinkedIdType | CardLinkedIdType | IdentityLinkedIdType;
|
|
1780
1780
|
|
|
1781
|
+
export interface FolderView {
|
|
1782
|
+
id: FolderId | undefined;
|
|
1783
|
+
name: string;
|
|
1784
|
+
revisionDate: DateTime<Utc>;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1781
1787
|
/**
|
|
1782
1788
|
* NewType wrapper for `FolderId`
|
|
1783
1789
|
*/
|
|
@@ -1789,12 +1795,6 @@ export interface Folder {
|
|
|
1789
1795
|
revisionDate: DateTime<Utc>;
|
|
1790
1796
|
}
|
|
1791
1797
|
|
|
1792
|
-
export interface FolderView {
|
|
1793
|
-
id: FolderId | undefined;
|
|
1794
|
-
name: string;
|
|
1795
|
-
revisionDate: DateTime<Utc>;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
1798
|
export interface EditFolderError extends Error {
|
|
1799
1799
|
name: "EditFolderError";
|
|
1800
1800
|
variant:
|