@bitwarden/sdk-internal 0.2.0-main.221 → 0.2.0-main.223
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 +27 -0
- package/bitwarden_wasm_internal_bg.js +58 -17
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +9 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +27 -0
- package/node/bitwarden_wasm_internal.js +58 -17
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +9 -0
- package/package.json +1 -1
|
@@ -835,6 +835,24 @@ export interface CipherListView {
|
|
|
835
835
|
localData: LocalDataView | undefined;
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
+
/**
|
|
839
|
+
* Represents the result of decrypting a list of ciphers.
|
|
840
|
+
*
|
|
841
|
+
* This struct contains two vectors: `successes` and `failures`.
|
|
842
|
+
* `successes` contains the decrypted `CipherListView` objects,
|
|
843
|
+
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
844
|
+
*/
|
|
845
|
+
export interface DecryptCipherListResult {
|
|
846
|
+
/**
|
|
847
|
+
* The decrypted `CipherListView` objects.
|
|
848
|
+
*/
|
|
849
|
+
successes: CipherListView[];
|
|
850
|
+
/**
|
|
851
|
+
* The original `Cipher` objects that failed to decrypt.
|
|
852
|
+
*/
|
|
853
|
+
failures: Cipher[];
|
|
854
|
+
}
|
|
855
|
+
|
|
838
856
|
export interface Field {
|
|
839
857
|
name: EncString | undefined;
|
|
840
858
|
value: EncString | undefined;
|
|
@@ -1262,6 +1280,11 @@ export class CiphersClient {
|
|
|
1262
1280
|
encrypt(cipher_view: CipherView): EncryptionContext;
|
|
1263
1281
|
decrypt(cipher: Cipher): CipherView;
|
|
1264
1282
|
decrypt_list(ciphers: Cipher[]): CipherListView[];
|
|
1283
|
+
/**
|
|
1284
|
+
* Decrypt cipher list with failures
|
|
1285
|
+
* Returns both successfully decrypted ciphers and any that failed to decrypt
|
|
1286
|
+
*/
|
|
1287
|
+
decrypt_list_with_failures(ciphers: Cipher[]): DecryptCipherListResult;
|
|
1265
1288
|
decrypt_fido2_credentials(cipher_view: CipherView): Fido2CredentialView[];
|
|
1266
1289
|
move_to_organization(cipher_view: CipherView, organization_id: OrganizationId): CipherView;
|
|
1267
1290
|
decrypt_fido2_private_key(cipher_view: CipherView): string;
|
|
@@ -1572,6 +1595,10 @@ export class PureCrypto {
|
|
|
1572
1595
|
signed_public_key: Uint8Array,
|
|
1573
1596
|
verifying_key: Uint8Array,
|
|
1574
1597
|
): Uint8Array;
|
|
1598
|
+
/**
|
|
1599
|
+
* Derive output of the KDF for a [bitwarden_crypto::Kdf] configuration.
|
|
1600
|
+
*/
|
|
1601
|
+
static derive_kdf_material(password: Uint8Array, salt: Uint8Array, kdf: Kdf): Uint8Array;
|
|
1575
1602
|
}
|
|
1576
1603
|
export class StateClient {
|
|
1577
1604
|
private constructor();
|
|
@@ -747,7 +747,7 @@ function __wbg_adapter_56(arg0, arg1, arg2) {
|
|
|
747
747
|
);
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
-
function
|
|
750
|
+
function __wbg_adapter_279(arg0, arg1, arg2, arg3) {
|
|
751
751
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
|
|
752
752
|
arg0,
|
|
753
753
|
arg1,
|
|
@@ -1195,6 +1195,18 @@ class CiphersClient {
|
|
|
1195
1195
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Decrypt cipher list with failures
|
|
1200
|
+
* Returns both successfully decrypted ciphers and any that failed to decrypt
|
|
1201
|
+
* @param {Cipher[]} ciphers
|
|
1202
|
+
* @returns {DecryptCipherListResult}
|
|
1203
|
+
*/
|
|
1204
|
+
decrypt_list_with_failures(ciphers) {
|
|
1205
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1207
|
+
const ret = wasm.ciphersclient_decrypt_list_with_failures(this.__wbg_ptr, ptr0, len0);
|
|
1208
|
+
return takeObject(ret);
|
|
1209
|
+
}
|
|
1198
1210
|
/**
|
|
1199
1211
|
* @param {CipherView} cipher_view
|
|
1200
1212
|
* @returns {Fido2CredentialView[]}
|
|
@@ -3050,6 +3062,35 @@ class PureCrypto {
|
|
|
3050
3062
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3051
3063
|
}
|
|
3052
3064
|
}
|
|
3065
|
+
/**
|
|
3066
|
+
* Derive output of the KDF for a [bitwarden_crypto::Kdf] configuration.
|
|
3067
|
+
* @param {Uint8Array} password
|
|
3068
|
+
* @param {Uint8Array} salt
|
|
3069
|
+
* @param {Kdf} kdf
|
|
3070
|
+
* @returns {Uint8Array}
|
|
3071
|
+
*/
|
|
3072
|
+
static derive_kdf_material(password, salt, kdf) {
|
|
3073
|
+
try {
|
|
3074
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3075
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
3076
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3077
|
+
const ptr1 = passArray8ToWasm0(salt, wasm.__wbindgen_malloc);
|
|
3078
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3079
|
+
wasm.purecrypto_derive_kdf_material(retptr, ptr0, len0, ptr1, len1, addHeapObject(kdf));
|
|
3080
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3081
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3082
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3083
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3084
|
+
if (r3) {
|
|
3085
|
+
throw takeObject(r2);
|
|
3086
|
+
}
|
|
3087
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3088
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3089
|
+
return v3;
|
|
3090
|
+
} finally {
|
|
3091
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3053
3094
|
}
|
|
3054
3095
|
module.exports.PureCrypto = PureCrypto;
|
|
3055
3096
|
|
|
@@ -3358,7 +3399,7 @@ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
|
|
|
3358
3399
|
return addHeapObject(ret);
|
|
3359
3400
|
};
|
|
3360
3401
|
|
|
3361
|
-
module.exports.
|
|
3402
|
+
module.exports.__wbg_get_d7e08493e14d3073 = function () {
|
|
3362
3403
|
return handleError(function (arg0, arg1, arg2) {
|
|
3363
3404
|
let deferred0_0;
|
|
3364
3405
|
let deferred0_1;
|
|
@@ -3373,7 +3414,7 @@ module.exports.__wbg_get_d74b07b1ba78be21 = function () {
|
|
|
3373
3414
|
}, arguments);
|
|
3374
3415
|
};
|
|
3375
3416
|
|
|
3376
|
-
module.exports.
|
|
3417
|
+
module.exports.__wbg_getaccesstoken_a6776220c768495c = function (arg0) {
|
|
3377
3418
|
const ret = getObject(arg0).get_access_token();
|
|
3378
3419
|
return addHeapObject(ret);
|
|
3379
3420
|
};
|
|
@@ -3478,7 +3519,7 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
|
|
|
3478
3519
|
return ret;
|
|
3479
3520
|
};
|
|
3480
3521
|
|
|
3481
|
-
module.exports.
|
|
3522
|
+
module.exports.__wbg_list_296175588665e03b = function () {
|
|
3482
3523
|
return handleError(function (arg0) {
|
|
3483
3524
|
const ret = getObject(arg0).list();
|
|
3484
3525
|
return addHeapObject(ret);
|
|
@@ -3513,7 +3554,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
|
|
|
3513
3554
|
const a = state0.a;
|
|
3514
3555
|
state0.a = 0;
|
|
3515
3556
|
try {
|
|
3516
|
-
return
|
|
3557
|
+
return __wbg_adapter_279(a, state0.b, arg0, arg1);
|
|
3517
3558
|
} finally {
|
|
3518
3559
|
state0.a = a;
|
|
3519
3560
|
}
|
|
@@ -3655,7 +3696,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
|
|
|
3655
3696
|
}, arguments);
|
|
3656
3697
|
};
|
|
3657
3698
|
|
|
3658
|
-
module.exports.
|
|
3699
|
+
module.exports.__wbg_remove_91062ef36398ce81 = function () {
|
|
3659
3700
|
return handleError(function (arg0, arg1, arg2) {
|
|
3660
3701
|
let deferred0_0;
|
|
3661
3702
|
let deferred0_1;
|
|
@@ -3702,7 +3743,11 @@ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
|
|
3702
3743
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
3703
3744
|
};
|
|
3704
3745
|
|
|
3705
|
-
module.exports.
|
|
3746
|
+
module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
|
3747
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
3748
|
+
};
|
|
3749
|
+
|
|
3750
|
+
module.exports.__wbg_set_e1312fa33b0e0bba = function () {
|
|
3706
3751
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3707
3752
|
let deferred0_0;
|
|
3708
3753
|
let deferred0_1;
|
|
@@ -3717,10 +3762,6 @@ module.exports.__wbg_set_616a519deee0d894 = function () {
|
|
|
3717
3762
|
}, arguments);
|
|
3718
3763
|
};
|
|
3719
3764
|
|
|
3720
|
-
module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
|
3721
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
3722
|
-
};
|
|
3723
|
-
|
|
3724
3765
|
module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
|
|
3725
3766
|
getObject(arg0).body = getObject(arg1);
|
|
3726
3767
|
};
|
|
@@ -3900,18 +3941,18 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
|
|
|
3900
3941
|
return ret;
|
|
3901
3942
|
};
|
|
3902
3943
|
|
|
3903
|
-
module.exports.
|
|
3904
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3944
|
+
module.exports.__wbindgen_closure_wrapper2908 = function (arg0, arg1, arg2) {
|
|
3945
|
+
const ret = makeMutClosure(arg0, arg1, 919, __wbg_adapter_50);
|
|
3905
3946
|
return addHeapObject(ret);
|
|
3906
3947
|
};
|
|
3907
3948
|
|
|
3908
|
-
module.exports.
|
|
3909
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3949
|
+
module.exports.__wbindgen_closure_wrapper3748 = function (arg0, arg1, arg2) {
|
|
3950
|
+
const ret = makeMutClosure(arg0, arg1, 1003, __wbg_adapter_53);
|
|
3910
3951
|
return addHeapObject(ret);
|
|
3911
3952
|
};
|
|
3912
3953
|
|
|
3913
|
-
module.exports.
|
|
3914
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3954
|
+
module.exports.__wbindgen_closure_wrapper4166 = function (arg0, arg1, arg2) {
|
|
3955
|
+
const ret = makeMutClosure(arg0, arg1, 1126, __wbg_adapter_56);
|
|
3915
3956
|
return addHeapObject(ret);
|
|
3916
3957
|
};
|
|
3917
3958
|
|
|
Binary file
|
|
@@ -120,6 +120,7 @@ export const attachmentsclient_decrypt_buffer: (
|
|
|
120
120
|
export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
|
|
121
121
|
export const ciphersclient_decrypt: (a: number, b: number, c: number) => void;
|
|
122
122
|
export const ciphersclient_decrypt_list: (a: number, b: number, c: number, d: number) => void;
|
|
123
|
+
export const ciphersclient_decrypt_list_with_failures: (a: number, b: number, c: number) => number;
|
|
123
124
|
export const ciphersclient_decrypt_fido2_credentials: (a: number, b: number, c: number) => void;
|
|
124
125
|
export const ciphersclient_move_to_organization: (
|
|
125
126
|
a: number,
|
|
@@ -307,6 +308,14 @@ export const purecrypto_verify_and_unwrap_signed_public_key: (
|
|
|
307
308
|
d: number,
|
|
308
309
|
e: number,
|
|
309
310
|
) => void;
|
|
311
|
+
export const purecrypto_derive_kdf_material: (
|
|
312
|
+
a: number,
|
|
313
|
+
b: number,
|
|
314
|
+
c: number,
|
|
315
|
+
d: number,
|
|
316
|
+
e: number,
|
|
317
|
+
f: number,
|
|
318
|
+
) => void;
|
|
310
319
|
export const generate_ssh_key: (a: number, b: number) => void;
|
|
311
320
|
export const import_ssh_key: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
312
321
|
export const isTestError: (a: number) => number;
|