@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.
@@ -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(): ClientCrypto;
267
- vault(): ClientVault;
266
+ crypto(): CryptoClient;
267
+ vault(): VaultClient;
268
268
  }
269
- export class ClientCrypto {
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 ClientFolders {
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;
@@ -457,45 +457,92 @@ export class BitwardenClient {
457
457
  return takeObject(ret);
458
458
  }
459
459
  /**
460
- * @returns {ClientCrypto}
460
+ * @returns {CryptoClient}
461
461
  */
462
462
  crypto() {
463
463
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
464
- return ClientCrypto.__wrap(ret);
464
+ return CryptoClient.__wrap(ret);
465
465
  }
466
466
  /**
467
- * @returns {ClientVault}
467
+ * @returns {VaultClient}
468
468
  */
469
469
  vault() {
470
470
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
471
- return ClientVault.__wrap(ret);
471
+ return VaultClient.__wrap(ret);
472
472
  }
473
473
  }
474
474
 
475
- const ClientCryptoFinalization =
475
+ const ClientFoldersFinalization =
476
+ typeof FinalizationRegistry === "undefined"
477
+ ? { register: () => {}, unregister: () => {} }
478
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
479
+
480
+ export class ClientFolders {
481
+ static __wrap(ptr) {
482
+ ptr = ptr >>> 0;
483
+ const obj = Object.create(ClientFolders.prototype);
484
+ obj.__wbg_ptr = ptr;
485
+ ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
486
+ return obj;
487
+ }
488
+
489
+ __destroy_into_raw() {
490
+ const ptr = this.__wbg_ptr;
491
+ this.__wbg_ptr = 0;
492
+ ClientFoldersFinalization.unregister(this);
493
+ return ptr;
494
+ }
495
+
496
+ free() {
497
+ const ptr = this.__destroy_into_raw();
498
+ wasm.__wbg_clientfolders_free(ptr, 0);
499
+ }
500
+ /**
501
+ * Decrypt folder
502
+ * @param {Folder} folder
503
+ * @returns {FolderView}
504
+ */
505
+ decrypt(folder) {
506
+ try {
507
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
508
+ wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
509
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
510
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
511
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
512
+ if (r2) {
513
+ throw takeObject(r1);
514
+ }
515
+ return takeObject(r0);
516
+ } finally {
517
+ wasm.__wbindgen_add_to_stack_pointer(16);
518
+ }
519
+ }
520
+ }
521
+
522
+ const CryptoClientFinalization =
476
523
  typeof FinalizationRegistry === "undefined"
477
524
  ? { register: () => {}, unregister: () => {} }
478
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
525
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
479
526
 
480
- export class ClientCrypto {
527
+ export class CryptoClient {
481
528
  static __wrap(ptr) {
482
529
  ptr = ptr >>> 0;
483
- const obj = Object.create(ClientCrypto.prototype);
530
+ const obj = Object.create(CryptoClient.prototype);
484
531
  obj.__wbg_ptr = ptr;
485
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
532
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
486
533
  return obj;
487
534
  }
488
535
 
489
536
  __destroy_into_raw() {
490
537
  const ptr = this.__wbg_ptr;
491
538
  this.__wbg_ptr = 0;
492
- ClientCryptoFinalization.unregister(this);
539
+ CryptoClientFinalization.unregister(this);
493
540
  return ptr;
494
541
  }
495
542
 
496
543
  free() {
497
544
  const ptr = this.__destroy_into_raw();
498
- wasm.__wbg_clientcrypto_free(ptr, 0);
545
+ wasm.__wbg_cryptoclient_free(ptr, 0);
499
546
  }
500
547
  /**
501
548
  * Initialization method for the user crypto. Needs to be called before any other crypto
@@ -504,7 +551,7 @@ export class ClientCrypto {
504
551
  * @returns {Promise<void>}
505
552
  */
506
553
  initialize_user_crypto(req) {
507
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
554
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
508
555
  return takeObject(ret);
509
556
  }
510
557
  /**
@@ -514,7 +561,7 @@ export class ClientCrypto {
514
561
  * @returns {Promise<void>}
515
562
  */
516
563
  initialize_org_crypto(req) {
517
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
564
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
518
565
  return takeObject(ret);
519
566
  }
520
567
  /**
@@ -528,7 +575,7 @@ export class ClientCrypto {
528
575
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
529
576
  const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
530
577
  const len0 = WASM_VECTOR_LEN;
531
- wasm.clientcrypto_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
578
+ wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
532
579
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
533
580
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
534
581
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -550,54 +597,7 @@ export class ClientCrypto {
550
597
  verify_asymmetric_keys(request) {
551
598
  try {
552
599
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
553
- wasm.clientcrypto_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
554
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
555
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
556
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
557
- if (r2) {
558
- throw takeObject(r1);
559
- }
560
- return takeObject(r0);
561
- } finally {
562
- wasm.__wbindgen_add_to_stack_pointer(16);
563
- }
564
- }
565
- }
566
-
567
- const ClientFoldersFinalization =
568
- typeof FinalizationRegistry === "undefined"
569
- ? { register: () => {}, unregister: () => {} }
570
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
571
-
572
- export class ClientFolders {
573
- static __wrap(ptr) {
574
- ptr = ptr >>> 0;
575
- const obj = Object.create(ClientFolders.prototype);
576
- obj.__wbg_ptr = ptr;
577
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
578
- return obj;
579
- }
580
-
581
- __destroy_into_raw() {
582
- const ptr = this.__wbg_ptr;
583
- this.__wbg_ptr = 0;
584
- ClientFoldersFinalization.unregister(this);
585
- return ptr;
586
- }
587
-
588
- free() {
589
- const ptr = this.__destroy_into_raw();
590
- wasm.__wbg_clientfolders_free(ptr, 0);
591
- }
592
- /**
593
- * Decrypt folder
594
- * @param {Folder} folder
595
- * @returns {FolderView}
596
- */
597
- decrypt(folder) {
598
- try {
599
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
600
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
600
+ wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
601
601
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
602
602
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
603
603
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -611,30 +611,30 @@ export class ClientFolders {
611
611
  }
612
612
  }
613
613
 
614
- const ClientVaultFinalization =
614
+ const VaultClientFinalization =
615
615
  typeof FinalizationRegistry === "undefined"
616
616
  ? { register: () => {}, unregister: () => {} }
617
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
617
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
618
618
 
619
- export class ClientVault {
619
+ export class VaultClient {
620
620
  static __wrap(ptr) {
621
621
  ptr = ptr >>> 0;
622
- const obj = Object.create(ClientVault.prototype);
622
+ const obj = Object.create(VaultClient.prototype);
623
623
  obj.__wbg_ptr = ptr;
624
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
624
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
625
625
  return obj;
626
626
  }
627
627
 
628
628
  __destroy_into_raw() {
629
629
  const ptr = this.__wbg_ptr;
630
630
  this.__wbg_ptr = 0;
631
- ClientVaultFinalization.unregister(this);
631
+ VaultClientFinalization.unregister(this);
632
632
  return ptr;
633
633
  }
634
634
 
635
635
  free() {
636
636
  const ptr = this.__destroy_into_raw();
637
- wasm.__wbg_clientvault_free(ptr, 0);
637
+ wasm.__wbg_vaultclient_free(ptr, 0);
638
638
  }
639
639
  /**
640
640
  * @returns {ClientFolders}
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 clientcrypto_initialize_user_crypto: (a: number, b: number) => number;
16
- export const clientcrypto_initialize_org_crypto: (a: number, b: number) => number;
17
- export const clientcrypto_make_key_pair: (a: number, b: number, c: number, d: number) => void;
18
- export const clientcrypto_verify_asymmetric_keys: (a: number, b: number, c: number) => void;
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 __wbg_clientcrypto_free: (a: number, b: number) => void;
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 __wbg_clientvault_free: (a: number, b: number) => void;
23
+ export const __wbg_vaultclient_free: (a: number, b: number) => void;
24
24
  export const bitwardenclient_vault: (a: number) => number;
25
- export const clientvault_folders: (a: number) => number;
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;