@bitwarden/sdk-internal 0.2.0-main.267 → 0.2.0-main.269
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 +19 -13
- package/bitwarden_wasm_internal_bg.js +44 -49
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +1 -2
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +19 -13
- package/node/bitwarden_wasm_internal.js +44 -49
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +1 -2
- package/package.json +1 -1
package/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
bc66e3d0901f37c44ec9babff78b085c6576809a
|
@@ -256,7 +256,7 @@ export type InitUserCryptoMethod =
|
|
256
256
|
| { password: { password: string; user_key: EncString } }
|
257
257
|
| { decryptedKey: { decrypted_user_key: string } }
|
258
258
|
| { pin: { pin: string; pin_protected_user_key: EncString } }
|
259
|
-
| { authRequest: { request_private_key:
|
259
|
+
| { authRequest: { request_private_key: B64; method: AuthRequestMethod } }
|
260
260
|
| {
|
261
261
|
deviceKey: {
|
262
262
|
device_key: string;
|
@@ -264,7 +264,7 @@ export type InitUserCryptoMethod =
|
|
264
264
|
device_protected_user_key: UnsignedSharedKey;
|
265
265
|
};
|
266
266
|
}
|
267
|
-
| { keyConnector: { master_key:
|
267
|
+
| { keyConnector: { master_key: B64; user_key: EncString } };
|
268
268
|
|
269
269
|
/**
|
270
270
|
* Auth requests supports multiple initialization methods.
|
@@ -290,7 +290,7 @@ export interface UpdatePasswordResponse {
|
|
290
290
|
/**
|
291
291
|
* Hash of the new password
|
292
292
|
*/
|
293
|
-
passwordHash:
|
293
|
+
passwordHash: B64;
|
294
294
|
/**
|
295
295
|
* User key, encrypted with the new password
|
296
296
|
*/
|
@@ -340,7 +340,7 @@ export interface MakeKeyPairResponse {
|
|
340
340
|
/**
|
341
341
|
* The user\'s public key
|
342
342
|
*/
|
343
|
-
userPublicKey:
|
343
|
+
userPublicKey: B64;
|
344
344
|
/**
|
345
345
|
* User\'s private key, encrypted with the user key
|
346
346
|
*/
|
@@ -354,11 +354,11 @@ export interface VerifyAsymmetricKeysRequest {
|
|
354
354
|
/**
|
355
355
|
* The user\'s user key
|
356
356
|
*/
|
357
|
-
userKey:
|
357
|
+
userKey: B64;
|
358
358
|
/**
|
359
359
|
* The user\'s public key
|
360
360
|
*/
|
361
|
-
userPublicKey:
|
361
|
+
userPublicKey: B64;
|
362
362
|
/**
|
363
363
|
* User\'s private key, encrypted with the user key
|
364
364
|
*/
|
@@ -386,7 +386,7 @@ export interface UserCryptoV2KeysResponse {
|
|
386
386
|
/**
|
387
387
|
* User key
|
388
388
|
*/
|
389
|
-
userKey:
|
389
|
+
userKey: B64;
|
390
390
|
/**
|
391
391
|
* Wrapped private key
|
392
392
|
*/
|
@@ -394,7 +394,7 @@ export interface UserCryptoV2KeysResponse {
|
|
394
394
|
/**
|
395
395
|
* Public key
|
396
396
|
*/
|
397
|
-
publicKey:
|
397
|
+
publicKey: B64;
|
398
398
|
/**
|
399
399
|
* The user\'s public key, signed by the signing key
|
400
400
|
*/
|
@@ -406,7 +406,7 @@ export interface UserCryptoV2KeysResponse {
|
|
406
406
|
/**
|
407
407
|
* Base64 encoded verifying key
|
408
408
|
*/
|
409
|
-
verifyingKey:
|
409
|
+
verifyingKey: B64;
|
410
410
|
/**
|
411
411
|
* The user\'s signed security state
|
412
412
|
*/
|
@@ -443,7 +443,7 @@ export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnect
|
|
443
443
|
|
444
444
|
export interface EnrollAdminPasswordResetError extends Error {
|
445
445
|
name: "EnrollAdminPasswordResetError";
|
446
|
-
variant: "VaultLocked" | "Crypto"
|
446
|
+
variant: "VaultLocked" | "Crypto";
|
447
447
|
}
|
448
448
|
|
449
449
|
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
@@ -466,7 +466,6 @@ export interface EncryptionSettingsError extends Error {
|
|
466
466
|
name: "EncryptionSettingsError";
|
467
467
|
variant:
|
468
468
|
| "Crypto"
|
469
|
-
| "InvalidBase64"
|
470
469
|
| "VaultLocked"
|
471
470
|
| "InvalidPrivateKey"
|
472
471
|
| "InvalidSigningKey"
|
@@ -592,6 +591,13 @@ export interface CryptoError extends Error {
|
|
592
591
|
|
593
592
|
export function isCryptoError(error: any): error is CryptoError;
|
594
593
|
|
594
|
+
/**
|
595
|
+
* Base64 encoded data
|
596
|
+
*
|
597
|
+
* Is indifferent about padding when decoding, but always produces padding when encoding.
|
598
|
+
*/
|
599
|
+
export type B64 = String;
|
600
|
+
|
595
601
|
/**
|
596
602
|
* Temporary struct to hold metadata related to current account
|
597
603
|
*
|
@@ -1453,7 +1459,7 @@ export class CiphersClient {
|
|
1453
1459
|
* generated using the new key. Otherwise, the cipher's data will be encrypted with the new
|
1454
1460
|
* key directly.
|
1455
1461
|
*/
|
1456
|
-
encrypt_cipher_for_rotation(cipher_view: CipherView,
|
1462
|
+
encrypt_cipher_for_rotation(cipher_view: CipherView, new_key: B64): EncryptionContext;
|
1457
1463
|
decrypt(cipher: Cipher): CipherView;
|
1458
1464
|
decrypt_list(ciphers: Cipher[]): CipherListView[];
|
1459
1465
|
/**
|
@@ -1523,7 +1529,7 @@ export class CryptoClient {
|
|
1523
1529
|
* Generates a new key pair and encrypts the private key with the provided user key.
|
1524
1530
|
* Crypto initialization not required.
|
1525
1531
|
*/
|
1526
|
-
make_key_pair(user_key:
|
1532
|
+
make_key_pair(user_key: B64): MakeKeyPairResponse;
|
1527
1533
|
/**
|
1528
1534
|
* Verifies a user's asymmetric keys by decrypting the private key with the provided user
|
1529
1535
|
* key. Returns if the private key is decryptable and if it is a valid matching key.
|
@@ -1282,20 +1282,17 @@ export class CiphersClient {
|
|
1282
1282
|
* generated using the new key. Otherwise, the cipher's data will be encrypted with the new
|
1283
1283
|
* key directly.
|
1284
1284
|
* @param {CipherView} cipher_view
|
1285
|
-
* @param {
|
1285
|
+
* @param {B64} new_key
|
1286
1286
|
* @returns {EncryptionContext}
|
1287
1287
|
*/
|
1288
|
-
encrypt_cipher_for_rotation(cipher_view,
|
1288
|
+
encrypt_cipher_for_rotation(cipher_view, new_key) {
|
1289
1289
|
try {
|
1290
1290
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
1291
|
-
const ptr0 = passStringToWasm0(new_key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
1292
|
-
const len0 = WASM_VECTOR_LEN;
|
1293
1291
|
wasm.ciphersclient_encrypt_cipher_for_rotation(
|
1294
1292
|
retptr,
|
1295
1293
|
this.__wbg_ptr,
|
1296
1294
|
addHeapObject(cipher_view),
|
1297
|
-
|
1298
|
-
len0,
|
1295
|
+
addHeapObject(new_key),
|
1299
1296
|
);
|
1300
1297
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
1301
1298
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
@@ -1749,15 +1746,13 @@ export class CryptoClient {
|
|
1749
1746
|
/**
|
1750
1747
|
* Generates a new key pair and encrypts the private key with the provided user key.
|
1751
1748
|
* Crypto initialization not required.
|
1752
|
-
* @param {
|
1749
|
+
* @param {B64} user_key
|
1753
1750
|
* @returns {MakeKeyPairResponse}
|
1754
1751
|
*/
|
1755
1752
|
make_key_pair(user_key) {
|
1756
1753
|
try {
|
1757
1754
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
1758
|
-
|
1759
|
-
const len0 = WASM_VECTOR_LEN;
|
1760
|
-
wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
|
1755
|
+
wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, addHeapObject(user_key));
|
1761
1756
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
1762
1757
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
1763
1758
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
@@ -3894,14 +3889,7 @@ export function __wbg_getTime_46267b1c24877e30(arg0) {
|
|
3894
3889
|
return ret;
|
3895
3890
|
}
|
3896
3891
|
|
3897
|
-
export function
|
3898
|
-
return handleError(function (arg0, arg1) {
|
3899
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
3900
|
-
return addHeapObject(ret);
|
3901
|
-
}, arguments);
|
3902
|
-
}
|
3903
|
-
|
3904
|
-
export function __wbg_get_716835f67e08995b() {
|
3892
|
+
export function __wbg_get_31aa32a26748ec8a() {
|
3905
3893
|
return handleError(function (arg0, arg1, arg2) {
|
3906
3894
|
let deferred0_0;
|
3907
3895
|
let deferred0_1;
|
@@ -3916,7 +3904,7 @@ export function __wbg_get_716835f67e08995b() {
|
|
3916
3904
|
}, arguments);
|
3917
3905
|
}
|
3918
3906
|
|
3919
|
-
export function
|
3907
|
+
export function __wbg_get_47834f608c28e2ef() {
|
3920
3908
|
return handleError(function (arg0, arg1, arg2) {
|
3921
3909
|
let deferred0_0;
|
3922
3910
|
let deferred0_1;
|
@@ -3931,12 +3919,19 @@ export function __wbg_get_9b6b832abffc55ee() {
|
|
3931
3919
|
}, arguments);
|
3932
3920
|
}
|
3933
3921
|
|
3922
|
+
export function __wbg_get_67b2ba62fc30de12() {
|
3923
|
+
return handleError(function (arg0, arg1) {
|
3924
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
3925
|
+
return addHeapObject(ret);
|
3926
|
+
}, arguments);
|
3927
|
+
}
|
3928
|
+
|
3934
3929
|
export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
3935
3930
|
const ret = getObject(arg0)[arg1 >>> 0];
|
3936
3931
|
return addHeapObject(ret);
|
3937
3932
|
}
|
3938
3933
|
|
3939
|
-
export function
|
3934
|
+
export function __wbg_getaccesstoken_4bbc1b6cb72b38e5(arg0) {
|
3940
3935
|
const ret = getObject(arg0).get_access_token();
|
3941
3936
|
return addHeapObject(ret);
|
3942
3937
|
}
|
@@ -4041,14 +4036,14 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
4041
4036
|
return ret;
|
4042
4037
|
}
|
4043
4038
|
|
4044
|
-
export function
|
4039
|
+
export function __wbg_list_796c7a27b66bb10d() {
|
4045
4040
|
return handleError(function (arg0) {
|
4046
4041
|
const ret = getObject(arg0).list();
|
4047
4042
|
return addHeapObject(ret);
|
4048
4043
|
}, arguments);
|
4049
4044
|
}
|
4050
4045
|
|
4051
|
-
export function
|
4046
|
+
export function __wbg_list_da710ca964173491() {
|
4052
4047
|
return handleError(function (arg0) {
|
4053
4048
|
const ret = getObject(arg0).list();
|
4054
4049
|
return addHeapObject(ret);
|
@@ -4230,7 +4225,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
|
|
4230
4225
|
}, arguments);
|
4231
4226
|
}
|
4232
4227
|
|
4233
|
-
export function
|
4228
|
+
export function __wbg_remove_3129bda82100f0a2() {
|
4234
4229
|
return handleError(function (arg0, arg1, arg2) {
|
4235
4230
|
let deferred0_0;
|
4236
4231
|
let deferred0_1;
|
@@ -4245,7 +4240,7 @@ export function __wbg_remove_7ca6fad44c0d6ac7() {
|
|
4245
4240
|
}, arguments);
|
4246
4241
|
}
|
4247
4242
|
|
4248
|
-
export function
|
4243
|
+
export function __wbg_remove_4975ed78d2562376() {
|
4249
4244
|
return handleError(function (arg0, arg1, arg2) {
|
4250
4245
|
let deferred0_0;
|
4251
4246
|
let deferred0_1;
|
@@ -4284,7 +4279,19 @@ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
|
|
4284
4279
|
return addHeapObject(ret);
|
4285
4280
|
}
|
4286
4281
|
|
4287
|
-
export function
|
4282
|
+
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
4283
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
4284
|
+
}
|
4285
|
+
|
4286
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
4287
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
4288
|
+
}
|
4289
|
+
|
4290
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
4291
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
4292
|
+
}
|
4293
|
+
|
4294
|
+
export function __wbg_set_8394acfd3cac67a4() {
|
4288
4295
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
4289
4296
|
let deferred0_0;
|
4290
4297
|
let deferred0_1;
|
@@ -4299,7 +4306,12 @@ export function __wbg_set_0d31c656c2e3f24c() {
|
|
4299
4306
|
}, arguments);
|
4300
4307
|
}
|
4301
4308
|
|
4302
|
-
export function
|
4309
|
+
export function __wbg_set_8fc6bf8a5b1071d1(arg0, arg1, arg2) {
|
4310
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
4311
|
+
return addHeapObject(ret);
|
4312
|
+
}
|
4313
|
+
|
4314
|
+
export function __wbg_set_9397834d5293a974() {
|
4303
4315
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
4304
4316
|
let deferred0_0;
|
4305
4317
|
let deferred0_1;
|
@@ -4314,23 +4326,6 @@ export function __wbg_set_1c069c9cfdb8d2bb() {
|
|
4314
4326
|
}, arguments);
|
4315
4327
|
}
|
4316
4328
|
|
4317
|
-
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
4318
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
4319
|
-
}
|
4320
|
-
|
4321
|
-
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
4322
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
4323
|
-
}
|
4324
|
-
|
4325
|
-
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
4326
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
4327
|
-
}
|
4328
|
-
|
4329
|
-
export function __wbg_set_8fc6bf8a5b1071d1(arg0, arg1, arg2) {
|
4330
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
4331
|
-
return addHeapObject(ret);
|
4332
|
-
}
|
4333
|
-
|
4334
4329
|
export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
|
4335
4330
|
getObject(arg0).body = getObject(arg1);
|
4336
4331
|
}
|
@@ -4519,18 +4514,18 @@ export function __wbindgen_cb_drop(arg0) {
|
|
4519
4514
|
return ret;
|
4520
4515
|
}
|
4521
4516
|
|
4522
|
-
export function
|
4523
|
-
const ret = makeMutClosure(arg0, arg1,
|
4517
|
+
export function __wbindgen_closure_wrapper3336(arg0, arg1, arg2) {
|
4518
|
+
const ret = makeMutClosure(arg0, arg1, 276, __wbg_adapter_54);
|
4524
4519
|
return addHeapObject(ret);
|
4525
4520
|
}
|
4526
4521
|
|
4527
|
-
export function
|
4528
|
-
const ret = makeMutClosure(arg0, arg1,
|
4522
|
+
export function __wbindgen_closure_wrapper5710(arg0, arg1, arg2) {
|
4523
|
+
const ret = makeMutClosure(arg0, arg1, 301, __wbg_adapter_54);
|
4529
4524
|
return addHeapObject(ret);
|
4530
4525
|
}
|
4531
4526
|
|
4532
|
-
export function
|
4533
|
-
const ret = makeMutClosure(arg0, arg1,
|
4527
|
+
export function __wbindgen_closure_wrapper6065(arg0, arg1, arg2) {
|
4528
|
+
const ret = makeMutClosure(arg0, arg1, 326, __wbg_adapter_59);
|
4534
4529
|
return addHeapObject(ret);
|
4535
4530
|
}
|
4536
4531
|
|
Binary file
|
@@ -182,7 +182,7 @@ export const sendaccessclient_request_send_access_token: (
|
|
182
182
|
export const isCollectionDecryptError: (a: number) => number;
|
183
183
|
export const cryptoclient_initialize_user_crypto: (a: number, b: number) => number;
|
184
184
|
export const cryptoclient_initialize_org_crypto: (a: number, b: number) => number;
|
185
|
-
export const cryptoclient_make_key_pair: (a: number, b: number, c: number
|
185
|
+
export const cryptoclient_make_key_pair: (a: number, b: number, c: number) => void;
|
186
186
|
export const cryptoclient_verify_asymmetric_keys: (a: number, b: number, c: number) => void;
|
187
187
|
export const cryptoclient_make_keys_for_user_crypto_v2: (a: number, b: number) => void;
|
188
188
|
export const cryptoclient_get_v2_rotated_account_keys: (a: number, b: number) => void;
|
@@ -295,7 +295,6 @@ export const ciphersclient_encrypt_cipher_for_rotation: (
|
|
295
295
|
b: number,
|
296
296
|
c: number,
|
297
297
|
d: number,
|
298
|
-
e: number,
|
299
298
|
) => void;
|
300
299
|
export const ciphersclient_decrypt: (a: number, b: number, c: number) => void;
|
301
300
|
export const ciphersclient_decrypt_list: (a: number, b: number, c: number, d: number) => void;
|