@bitwarden/commercial-sdk-internal 0.2.0-main.408 → 0.2.0-main.410
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 +36 -14
- package/bitwarden_wasm_internal_bg.js +47 -34
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +1 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +36 -14
- package/node/bitwarden_wasm_internal.js +55 -42
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +8 -7
- package/package.json +1 -1
|
@@ -383,19 +383,12 @@ export interface InitUserCryptoRequest {
|
|
|
383
383
|
*/
|
|
384
384
|
email: string;
|
|
385
385
|
/**
|
|
386
|
-
* The user\'s
|
|
386
|
+
* The user\'s account cryptographic state, containing their signature and
|
|
387
|
+
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
387
388
|
*/
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* The user\'s signing key
|
|
391
|
-
*/
|
|
392
|
-
signingKey: EncString | undefined;
|
|
389
|
+
accountCryptographicState: WrappedAccountCryptographicState;
|
|
393
390
|
/**
|
|
394
|
-
* The user\'s
|
|
395
|
-
*/
|
|
396
|
-
securityState: SignedSecurityState | undefined;
|
|
397
|
-
/**
|
|
398
|
-
* The initialization method to use
|
|
391
|
+
* The method to decrypt the user\'s account symmetric key (user key)
|
|
399
392
|
*/
|
|
400
393
|
method: InitUserCryptoMethod;
|
|
401
394
|
}
|
|
@@ -674,6 +667,36 @@ export interface CryptoClientError extends Error {
|
|
|
674
667
|
|
|
675
668
|
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
676
669
|
|
|
670
|
+
/**
|
|
671
|
+
* Any keys / cryptographic protection \"downstream\" from the account symmetric key (user key).
|
|
672
|
+
* Private keys are protected by the user key.
|
|
673
|
+
*/
|
|
674
|
+
export type WrappedAccountCryptographicState =
|
|
675
|
+
| { V1: { private_key: EncString } }
|
|
676
|
+
| {
|
|
677
|
+
V2: {
|
|
678
|
+
private_key: EncString;
|
|
679
|
+
signed_public_key: SignedPublicKey | undefined;
|
|
680
|
+
signing_key: EncString;
|
|
681
|
+
security_state: SignedSecurityState;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
export interface AccountCryptographyInitializationError extends Error {
|
|
686
|
+
name: "AccountCryptographyInitializationError";
|
|
687
|
+
variant:
|
|
688
|
+
| "WrongUserKeyType"
|
|
689
|
+
| "WrongUserKey"
|
|
690
|
+
| "CorruptData"
|
|
691
|
+
| "TamperedData"
|
|
692
|
+
| "KeyStoreAlreadyInitialized"
|
|
693
|
+
| "GenericCrypto";
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export function isAccountCryptographyInitializationError(
|
|
697
|
+
error: any,
|
|
698
|
+
): error is AccountCryptographyInitializationError;
|
|
699
|
+
|
|
677
700
|
export interface StatefulCryptoError extends Error {
|
|
678
701
|
name: "StatefulCryptoError";
|
|
679
702
|
variant: "MissingSecurityState" | "WrongAccountCryptoVersion" | "Crypto";
|
|
@@ -685,9 +708,7 @@ export interface EncryptionSettingsError extends Error {
|
|
|
685
708
|
name: "EncryptionSettingsError";
|
|
686
709
|
variant:
|
|
687
710
|
| "Crypto"
|
|
688
|
-
| "
|
|
689
|
-
| "InvalidSigningKey"
|
|
690
|
-
| "InvalidSecurityState"
|
|
711
|
+
| "CryptoInitialization"
|
|
691
712
|
| "MissingPrivateKey"
|
|
692
713
|
| "UserIdAlreadySet"
|
|
693
714
|
| "WrongPin";
|
|
@@ -804,6 +825,7 @@ export interface CryptoError extends Error {
|
|
|
804
825
|
| "MissingKeyId"
|
|
805
826
|
| "KeyOperationNotSupported"
|
|
806
827
|
| "ReadOnlyKeyStore"
|
|
828
|
+
| "InvalidKeyStoreOperation"
|
|
807
829
|
| "InsufficientKdfParameters"
|
|
808
830
|
| "EncString"
|
|
809
831
|
| "Rsa"
|
|
@@ -412,6 +412,19 @@ exports.isCryptoClientError = function (error) {
|
|
|
412
412
|
}
|
|
413
413
|
};
|
|
414
414
|
|
|
415
|
+
/**
|
|
416
|
+
* @param {any} error
|
|
417
|
+
* @returns {boolean}
|
|
418
|
+
*/
|
|
419
|
+
exports.isAccountCryptographyInitializationError = function (error) {
|
|
420
|
+
try {
|
|
421
|
+
const ret = wasm.isAccountCryptographyInitializationError(addBorrowedObject(error));
|
|
422
|
+
return ret !== 0;
|
|
423
|
+
} finally {
|
|
424
|
+
heap[stack_pointer++] = undefined;
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
|
|
415
428
|
/**
|
|
416
429
|
* @param {any} error
|
|
417
430
|
* @returns {boolean}
|
|
@@ -858,14 +871,6 @@ exports.isEncryptFileError = function (error) {
|
|
|
858
871
|
}
|
|
859
872
|
};
|
|
860
873
|
|
|
861
|
-
function wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff(arg0, arg1, arg2) {
|
|
862
|
-
wasm.wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff(
|
|
863
|
-
arg0,
|
|
864
|
-
arg1,
|
|
865
|
-
addHeapObject(arg2),
|
|
866
|
-
);
|
|
867
|
-
}
|
|
868
|
-
|
|
869
874
|
function wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1) {
|
|
870
875
|
wasm.wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1);
|
|
871
876
|
}
|
|
@@ -889,6 +894,14 @@ function wasm_bindgen__convert__closures_____invoke__h35a8188fc7e541fe(arg0, arg
|
|
|
889
894
|
}
|
|
890
895
|
}
|
|
891
896
|
|
|
897
|
+
function wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff(arg0, arg1, arg2) {
|
|
898
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff(
|
|
899
|
+
arg0,
|
|
900
|
+
arg1,
|
|
901
|
+
addHeapObject(arg2),
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
|
|
892
905
|
function wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f(arg0, arg1, arg2, arg3) {
|
|
893
906
|
wasm.wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f(
|
|
894
907
|
arg0,
|
|
@@ -4711,7 +4724,7 @@ exports.__wbg_call_e762c39fa8ea36bf = function () {
|
|
|
4711
4724
|
}, arguments);
|
|
4712
4725
|
};
|
|
4713
4726
|
|
|
4714
|
-
exports.
|
|
4727
|
+
exports.__wbg_cipher_f01ad37fe153c74a = function (arg0) {
|
|
4715
4728
|
const ret = getObject(arg0).cipher;
|
|
4716
4729
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4717
4730
|
};
|
|
@@ -4804,7 +4817,7 @@ exports.__wbg_fetch_f8ba0e29a9d6de0d = function (arg0, arg1) {
|
|
|
4804
4817
|
return addHeapObject(ret);
|
|
4805
4818
|
};
|
|
4806
4819
|
|
|
4807
|
-
exports.
|
|
4820
|
+
exports.__wbg_folder_b2f27ca5801406fe = function (arg0) {
|
|
4808
4821
|
const ret = getObject(arg0).folder;
|
|
4809
4822
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4810
4823
|
};
|
|
@@ -4837,7 +4850,12 @@ exports.__wbg_getTime_14776bfb48a1bff9 = function (arg0) {
|
|
|
4837
4850
|
return ret;
|
|
4838
4851
|
};
|
|
4839
4852
|
|
|
4840
|
-
exports.
|
|
4853
|
+
exports.__wbg_get_7bed016f185add81 = function (arg0, arg1) {
|
|
4854
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
4855
|
+
return addHeapObject(ret);
|
|
4856
|
+
};
|
|
4857
|
+
|
|
4858
|
+
exports.__wbg_get_7d24a56df19d62f6 = function () {
|
|
4841
4859
|
return handleError(function (arg0, arg1, arg2) {
|
|
4842
4860
|
let deferred0_0;
|
|
4843
4861
|
let deferred0_1;
|
|
@@ -4852,7 +4870,12 @@ exports.__wbg_get_4e3650385d7407c5 = function () {
|
|
|
4852
4870
|
}, arguments);
|
|
4853
4871
|
};
|
|
4854
4872
|
|
|
4855
|
-
exports.
|
|
4873
|
+
exports.__wbg_get_access_token_f4e462d38899439f = function (arg0) {
|
|
4874
|
+
const ret = getObject(arg0).get_access_token();
|
|
4875
|
+
return addHeapObject(ret);
|
|
4876
|
+
};
|
|
4877
|
+
|
|
4878
|
+
exports.__wbg_get_cf7a5a169adcb6d4 = function () {
|
|
4856
4879
|
return handleError(function (arg0, arg1, arg2) {
|
|
4857
4880
|
let deferred0_0;
|
|
4858
4881
|
let deferred0_1;
|
|
@@ -4867,16 +4890,6 @@ exports.__wbg_get_5d348cd2322d9dcb = function () {
|
|
|
4867
4890
|
}, arguments);
|
|
4868
4891
|
};
|
|
4869
4892
|
|
|
4870
|
-
exports.__wbg_get_7bed016f185add81 = function (arg0, arg1) {
|
|
4871
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
4872
|
-
return addHeapObject(ret);
|
|
4873
|
-
};
|
|
4874
|
-
|
|
4875
|
-
exports.__wbg_get_access_token_e1ae00959dff169c = function (arg0) {
|
|
4876
|
-
const ret = getObject(arg0).get_access_token();
|
|
4877
|
-
return addHeapObject(ret);
|
|
4878
|
-
};
|
|
4879
|
-
|
|
4880
4893
|
exports.__wbg_get_efcb449f58ec27c2 = function () {
|
|
4881
4894
|
return handleError(function (arg0, arg1) {
|
|
4882
4895
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
@@ -5068,14 +5081,14 @@ exports.__wbg_length_cdd215e10d9dd507 = function (arg0) {
|
|
|
5068
5081
|
return ret;
|
|
5069
5082
|
};
|
|
5070
5083
|
|
|
5071
|
-
exports.
|
|
5084
|
+
exports.__wbg_list_9632da36688eb013 = function () {
|
|
5072
5085
|
return handleError(function (arg0) {
|
|
5073
5086
|
const ret = getObject(arg0).list();
|
|
5074
5087
|
return addHeapObject(ret);
|
|
5075
5088
|
}, arguments);
|
|
5076
5089
|
};
|
|
5077
5090
|
|
|
5078
|
-
exports.
|
|
5091
|
+
exports.__wbg_list_971afaee385941da = function () {
|
|
5079
5092
|
return handleError(function (arg0) {
|
|
5080
5093
|
const ret = getObject(arg0).list();
|
|
5081
5094
|
return addHeapObject(ret);
|
|
@@ -5319,7 +5332,7 @@ exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
|
|
|
5319
5332
|
}, arguments);
|
|
5320
5333
|
};
|
|
5321
5334
|
|
|
5322
|
-
exports.
|
|
5335
|
+
exports.__wbg_remove_0c50f1a372592522 = function () {
|
|
5323
5336
|
return handleError(function (arg0, arg1, arg2) {
|
|
5324
5337
|
let deferred0_0;
|
|
5325
5338
|
let deferred0_1;
|
|
@@ -5334,7 +5347,7 @@ exports.__wbg_remove_1dda6b5d117a41ab = function () {
|
|
|
5334
5347
|
}, arguments);
|
|
5335
5348
|
};
|
|
5336
5349
|
|
|
5337
|
-
exports.
|
|
5350
|
+
exports.__wbg_remove_d52ba16f05c98799 = function () {
|
|
5338
5351
|
return handleError(function (arg0, arg1, arg2) {
|
|
5339
5352
|
let deferred0_0;
|
|
5340
5353
|
let deferred0_1;
|
|
@@ -5384,21 +5397,6 @@ exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
|
|
5384
5397
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
5385
5398
|
};
|
|
5386
5399
|
|
|
5387
|
-
exports.__wbg_set_8f4bd39d6e8b06c1 = function () {
|
|
5388
|
-
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
5389
|
-
let deferred0_0;
|
|
5390
|
-
let deferred0_1;
|
|
5391
|
-
try {
|
|
5392
|
-
deferred0_0 = arg1;
|
|
5393
|
-
deferred0_1 = arg2;
|
|
5394
|
-
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
5395
|
-
return addHeapObject(ret);
|
|
5396
|
-
} finally {
|
|
5397
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
5398
|
-
}
|
|
5399
|
-
}, arguments);
|
|
5400
|
-
};
|
|
5401
|
-
|
|
5402
5400
|
exports.__wbg_set_907fb406c34a251d = function (arg0, arg1, arg2) {
|
|
5403
5401
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
5404
5402
|
return addHeapObject(ret);
|
|
@@ -5419,7 +5417,7 @@ exports.__wbg_set_c2abbebe8b9ebee1 = function () {
|
|
|
5419
5417
|
}, arguments);
|
|
5420
5418
|
};
|
|
5421
5419
|
|
|
5422
|
-
exports.
|
|
5420
|
+
exports.__wbg_set_cf238f02b0469517 = function () {
|
|
5423
5421
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
5424
5422
|
let deferred0_0;
|
|
5425
5423
|
let deferred0_1;
|
|
@@ -5438,6 +5436,21 @@ exports.__wbg_set_credentials_f621cd2d85c0c228 = function (arg0, arg1) {
|
|
|
5438
5436
|
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
5439
5437
|
};
|
|
5440
5438
|
|
|
5439
|
+
exports.__wbg_set_e87a8a3d69deff6e = function () {
|
|
5440
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
5441
|
+
let deferred0_0;
|
|
5442
|
+
let deferred0_1;
|
|
5443
|
+
try {
|
|
5444
|
+
deferred0_0 = arg1;
|
|
5445
|
+
deferred0_1 = arg2;
|
|
5446
|
+
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
5447
|
+
return addHeapObject(ret);
|
|
5448
|
+
} finally {
|
|
5449
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
5450
|
+
}
|
|
5451
|
+
}, arguments);
|
|
5452
|
+
};
|
|
5453
|
+
|
|
5441
5454
|
exports.__wbg_set_headers_6926da238cd32ee4 = function (arg0, arg1) {
|
|
5442
5455
|
getObject(arg0).headers = getObject(arg1);
|
|
5443
5456
|
};
|
|
Binary file
|
|
@@ -235,6 +235,7 @@ export const isMasterPasswordError: (a: number) => number;
|
|
|
235
235
|
export const isDeriveKeyConnectorError: (a: number) => number;
|
|
236
236
|
export const isEnrollAdminPasswordResetError: (a: number) => number;
|
|
237
237
|
export const isCryptoClientError: (a: number) => number;
|
|
238
|
+
export const isAccountCryptographyInitializationError: (a: number) => number;
|
|
238
239
|
export const isStatefulCryptoError: (a: number) => number;
|
|
239
240
|
export const isEncryptionSettingsError: (a: number) => number;
|
|
240
241
|
export const isCryptoError: (a: number) => number;
|
|
@@ -453,24 +454,24 @@ export const __wbg_totpclient_free: (a: number, b: number) => void;
|
|
|
453
454
|
export const __wbg_get_outgoingmessage_destination: (a: number) => number;
|
|
454
455
|
export const __wbg_set_outgoingmessage_destination: (a: number, b: number) => void;
|
|
455
456
|
export const __wbg_cryptoclient_free: (a: number, b: number) => void;
|
|
456
|
-
export const wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff: (
|
|
457
|
-
a: number,
|
|
458
|
-
b: number,
|
|
459
|
-
c: number,
|
|
460
|
-
) => void;
|
|
461
|
-
export const wasm_bindgen__closure__destroy__hba496874d56e8206: (a: number, b: number) => void;
|
|
462
457
|
export const wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e: (
|
|
463
458
|
a: number,
|
|
464
459
|
b: number,
|
|
465
460
|
) => void;
|
|
466
461
|
export const wasm_bindgen__closure__destroy__hfcb631b72e5e985c: (a: number, b: number) => void;
|
|
467
|
-
export const wasm_bindgen__closure__destroy__h5bf455f3385c4f71: (a: number, b: number) => void;
|
|
468
462
|
export const wasm_bindgen__convert__closures_____invoke__h35a8188fc7e541fe: (
|
|
469
463
|
a: number,
|
|
470
464
|
b: number,
|
|
471
465
|
c: number,
|
|
472
466
|
d: number,
|
|
473
467
|
) => void;
|
|
468
|
+
export const wasm_bindgen__closure__destroy__hba496874d56e8206: (a: number, b: number) => void;
|
|
469
|
+
export const wasm_bindgen__convert__closures_____invoke__h3f3903322ff045ff: (
|
|
470
|
+
a: number,
|
|
471
|
+
b: number,
|
|
472
|
+
c: number,
|
|
473
|
+
) => void;
|
|
474
|
+
export const wasm_bindgen__closure__destroy__h5bf455f3385c4f71: (a: number, b: number) => void;
|
|
474
475
|
export const wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f: (
|
|
475
476
|
a: number,
|
|
476
477
|
b: number,
|