@bitwarden/sdk-internal 0.2.0-main.44 → 0.2.0-main.46
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 +12 -12
- package/bitwarden_wasm_internal_bg.js +69 -69
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +7 -7
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +12 -12
- package/node/bitwarden_wasm_internal.js +72 -72
- 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
@@ -263,10 +263,18 @@ export class BitwardenClient {
|
|
263
263
|
* Test method, calls http endpoint
|
264
264
|
*/
|
265
265
|
http_get(url: string): Promise<string>;
|
266
|
-
crypto():
|
267
|
-
vault():
|
266
|
+
crypto(): CryptoClient;
|
267
|
+
vault(): VaultClient;
|
268
268
|
}
|
269
|
-
export class
|
269
|
+
export class ClientFolders {
|
270
|
+
private constructor();
|
271
|
+
free(): void;
|
272
|
+
/**
|
273
|
+
* Decrypt folder
|
274
|
+
*/
|
275
|
+
decrypt(folder: Folder): FolderView;
|
276
|
+
}
|
277
|
+
export class CryptoClient {
|
270
278
|
private constructor();
|
271
279
|
free(): void;
|
272
280
|
/**
|
@@ -291,15 +299,7 @@ export class ClientCrypto {
|
|
291
299
|
*/
|
292
300
|
verify_asymmetric_keys(request: VerifyAsymmetricKeysRequest): VerifyAsymmetricKeysResponse;
|
293
301
|
}
|
294
|
-
export class
|
295
|
-
private constructor();
|
296
|
-
free(): void;
|
297
|
-
/**
|
298
|
-
* Decrypt folder
|
299
|
-
*/
|
300
|
-
decrypt(folder: Folder): FolderView;
|
301
|
-
}
|
302
|
-
export class ClientVault {
|
302
|
+
export class VaultClient {
|
303
303
|
private constructor();
|
304
304
|
free(): void;
|
305
305
|
folders(): ClientFolders;
|
@@ -451,46 +451,94 @@ class BitwardenClient {
|
|
451
451
|
return takeObject(ret);
|
452
452
|
}
|
453
453
|
/**
|
454
|
-
* @returns {
|
454
|
+
* @returns {CryptoClient}
|
455
455
|
*/
|
456
456
|
crypto() {
|
457
457
|
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
458
|
-
return
|
458
|
+
return CryptoClient.__wrap(ret);
|
459
459
|
}
|
460
460
|
/**
|
461
|
-
* @returns {
|
461
|
+
* @returns {VaultClient}
|
462
462
|
*/
|
463
463
|
vault() {
|
464
464
|
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
465
|
-
return
|
465
|
+
return VaultClient.__wrap(ret);
|
466
466
|
}
|
467
467
|
}
|
468
468
|
module.exports.BitwardenClient = BitwardenClient;
|
469
469
|
|
470
|
-
const
|
470
|
+
const ClientFoldersFinalization =
|
471
|
+
typeof FinalizationRegistry === "undefined"
|
472
|
+
? { register: () => {}, unregister: () => {} }
|
473
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
|
474
|
+
|
475
|
+
class ClientFolders {
|
476
|
+
static __wrap(ptr) {
|
477
|
+
ptr = ptr >>> 0;
|
478
|
+
const obj = Object.create(ClientFolders.prototype);
|
479
|
+
obj.__wbg_ptr = ptr;
|
480
|
+
ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
|
481
|
+
return obj;
|
482
|
+
}
|
483
|
+
|
484
|
+
__destroy_into_raw() {
|
485
|
+
const ptr = this.__wbg_ptr;
|
486
|
+
this.__wbg_ptr = 0;
|
487
|
+
ClientFoldersFinalization.unregister(this);
|
488
|
+
return ptr;
|
489
|
+
}
|
490
|
+
|
491
|
+
free() {
|
492
|
+
const ptr = this.__destroy_into_raw();
|
493
|
+
wasm.__wbg_clientfolders_free(ptr, 0);
|
494
|
+
}
|
495
|
+
/**
|
496
|
+
* Decrypt folder
|
497
|
+
* @param {Folder} folder
|
498
|
+
* @returns {FolderView}
|
499
|
+
*/
|
500
|
+
decrypt(folder) {
|
501
|
+
try {
|
502
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
503
|
+
wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
504
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
505
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
506
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
507
|
+
if (r2) {
|
508
|
+
throw takeObject(r1);
|
509
|
+
}
|
510
|
+
return takeObject(r0);
|
511
|
+
} finally {
|
512
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
513
|
+
}
|
514
|
+
}
|
515
|
+
}
|
516
|
+
module.exports.ClientFolders = ClientFolders;
|
517
|
+
|
518
|
+
const CryptoClientFinalization =
|
471
519
|
typeof FinalizationRegistry === "undefined"
|
472
520
|
? { register: () => {}, unregister: () => {} }
|
473
|
-
: new FinalizationRegistry((ptr) => wasm.
|
521
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
|
474
522
|
|
475
|
-
class
|
523
|
+
class CryptoClient {
|
476
524
|
static __wrap(ptr) {
|
477
525
|
ptr = ptr >>> 0;
|
478
|
-
const obj = Object.create(
|
526
|
+
const obj = Object.create(CryptoClient.prototype);
|
479
527
|
obj.__wbg_ptr = ptr;
|
480
|
-
|
528
|
+
CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
481
529
|
return obj;
|
482
530
|
}
|
483
531
|
|
484
532
|
__destroy_into_raw() {
|
485
533
|
const ptr = this.__wbg_ptr;
|
486
534
|
this.__wbg_ptr = 0;
|
487
|
-
|
535
|
+
CryptoClientFinalization.unregister(this);
|
488
536
|
return ptr;
|
489
537
|
}
|
490
538
|
|
491
539
|
free() {
|
492
540
|
const ptr = this.__destroy_into_raw();
|
493
|
-
wasm.
|
541
|
+
wasm.__wbg_cryptoclient_free(ptr, 0);
|
494
542
|
}
|
495
543
|
/**
|
496
544
|
* Initialization method for the user crypto. Needs to be called before any other crypto
|
@@ -499,7 +547,7 @@ class ClientCrypto {
|
|
499
547
|
* @returns {Promise<void>}
|
500
548
|
*/
|
501
549
|
initialize_user_crypto(req) {
|
502
|
-
const ret = wasm.
|
550
|
+
const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
|
503
551
|
return takeObject(ret);
|
504
552
|
}
|
505
553
|
/**
|
@@ -509,7 +557,7 @@ class ClientCrypto {
|
|
509
557
|
* @returns {Promise<void>}
|
510
558
|
*/
|
511
559
|
initialize_org_crypto(req) {
|
512
|
-
const ret = wasm.
|
560
|
+
const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
|
513
561
|
return takeObject(ret);
|
514
562
|
}
|
515
563
|
/**
|
@@ -523,7 +571,7 @@ class ClientCrypto {
|
|
523
571
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
524
572
|
const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
525
573
|
const len0 = WASM_VECTOR_LEN;
|
526
|
-
wasm.
|
574
|
+
wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
|
527
575
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
528
576
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
529
577
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
@@ -545,7 +593,7 @@ class ClientCrypto {
|
|
545
593
|
verify_asymmetric_keys(request) {
|
546
594
|
try {
|
547
595
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
548
|
-
wasm.
|
596
|
+
wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
|
549
597
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
550
598
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
551
599
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
@@ -558,80 +606,32 @@ class ClientCrypto {
|
|
558
606
|
}
|
559
607
|
}
|
560
608
|
}
|
561
|
-
module.exports.
|
562
|
-
|
563
|
-
const ClientFoldersFinalization =
|
564
|
-
typeof FinalizationRegistry === "undefined"
|
565
|
-
? { register: () => {}, unregister: () => {} }
|
566
|
-
: new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
|
567
|
-
|
568
|
-
class ClientFolders {
|
569
|
-
static __wrap(ptr) {
|
570
|
-
ptr = ptr >>> 0;
|
571
|
-
const obj = Object.create(ClientFolders.prototype);
|
572
|
-
obj.__wbg_ptr = ptr;
|
573
|
-
ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
|
574
|
-
return obj;
|
575
|
-
}
|
576
|
-
|
577
|
-
__destroy_into_raw() {
|
578
|
-
const ptr = this.__wbg_ptr;
|
579
|
-
this.__wbg_ptr = 0;
|
580
|
-
ClientFoldersFinalization.unregister(this);
|
581
|
-
return ptr;
|
582
|
-
}
|
583
|
-
|
584
|
-
free() {
|
585
|
-
const ptr = this.__destroy_into_raw();
|
586
|
-
wasm.__wbg_clientfolders_free(ptr, 0);
|
587
|
-
}
|
588
|
-
/**
|
589
|
-
* Decrypt folder
|
590
|
-
* @param {Folder} folder
|
591
|
-
* @returns {FolderView}
|
592
|
-
*/
|
593
|
-
decrypt(folder) {
|
594
|
-
try {
|
595
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
596
|
-
wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
597
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
598
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
599
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
600
|
-
if (r2) {
|
601
|
-
throw takeObject(r1);
|
602
|
-
}
|
603
|
-
return takeObject(r0);
|
604
|
-
} finally {
|
605
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
606
|
-
}
|
607
|
-
}
|
608
|
-
}
|
609
|
-
module.exports.ClientFolders = ClientFolders;
|
609
|
+
module.exports.CryptoClient = CryptoClient;
|
610
610
|
|
611
|
-
const
|
611
|
+
const VaultClientFinalization =
|
612
612
|
typeof FinalizationRegistry === "undefined"
|
613
613
|
? { register: () => {}, unregister: () => {} }
|
614
|
-
: new FinalizationRegistry((ptr) => wasm.
|
614
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
|
615
615
|
|
616
|
-
class
|
616
|
+
class VaultClient {
|
617
617
|
static __wrap(ptr) {
|
618
618
|
ptr = ptr >>> 0;
|
619
|
-
const obj = Object.create(
|
619
|
+
const obj = Object.create(VaultClient.prototype);
|
620
620
|
obj.__wbg_ptr = ptr;
|
621
|
-
|
621
|
+
VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
622
622
|
return obj;
|
623
623
|
}
|
624
624
|
|
625
625
|
__destroy_into_raw() {
|
626
626
|
const ptr = this.__wbg_ptr;
|
627
627
|
this.__wbg_ptr = 0;
|
628
|
-
|
628
|
+
VaultClientFinalization.unregister(this);
|
629
629
|
return ptr;
|
630
630
|
}
|
631
631
|
|
632
632
|
free() {
|
633
633
|
const ptr = this.__destroy_into_raw();
|
634
|
-
wasm.
|
634
|
+
wasm.__wbg_vaultclient_free(ptr, 0);
|
635
635
|
}
|
636
636
|
/**
|
637
637
|
* @returns {ClientFolders}
|
@@ -641,7 +641,7 @@ class ClientVault {
|
|
641
641
|
return ClientFolders.__wrap(ret);
|
642
642
|
}
|
643
643
|
}
|
644
|
-
module.exports.
|
644
|
+
module.exports.VaultClient = VaultClient;
|
645
645
|
|
646
646
|
module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
|
647
647
|
const ret = String(getObject(arg1));
|
Binary file
|
@@ -12,17 +12,17 @@ export const bitwardenclient_throw: (a: number, b: number, c: number, d: number)
|
|
12
12
|
export const bitwardenclient_http_get: (a: number, b: number, c: number) => number;
|
13
13
|
export const bitwardenclient_crypto: (a: number) => number;
|
14
14
|
export const isTestError: (a: number) => number;
|
15
|
-
export const
|
16
|
-
export const
|
17
|
-
export const
|
18
|
-
export const
|
15
|
+
export const cryptoclient_initialize_user_crypto: (a: number, b: number) => number;
|
16
|
+
export const cryptoclient_initialize_org_crypto: (a: number, b: number) => number;
|
17
|
+
export const cryptoclient_make_key_pair: (a: number, b: number, c: number, d: number) => void;
|
18
|
+
export const cryptoclient_verify_asymmetric_keys: (a: number, b: number, c: number) => void;
|
19
19
|
export const generate_ssh_key: (a: number, b: number) => void;
|
20
20
|
export const clientfolders_decrypt: (a: number, b: number, c: number) => void;
|
21
|
-
export const
|
21
|
+
export const __wbg_cryptoclient_free: (a: number, b: number) => void;
|
22
22
|
export const __wbg_clientfolders_free: (a: number, b: number) => void;
|
23
|
-
export const
|
23
|
+
export const __wbg_vaultclient_free: (a: number, b: number) => void;
|
24
24
|
export const bitwardenclient_vault: (a: number) => number;
|
25
|
-
export const
|
25
|
+
export const vaultclient_folders: (a: number) => number;
|
26
26
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
28
28
|
export const __wbindgen_exn_store: (a: number) => void;
|