@bitwarden/sdk-internal 0.1.5 → 0.1.6

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.
@@ -172,6 +172,10 @@ export class BitwardenClient {
172
172
  * @returns {string}
173
173
  */
174
174
  echo(msg: string): string;
175
+ /**
176
+ * @param {string} msg
177
+ */
178
+ throw(msg: string): void;
175
179
  /**
176
180
  * Test method, calls http endpoint
177
181
  * @param {string} url
@@ -1,5 +1,3 @@
1
- import { WasmError } from "./snippets/bitwarden-wasm-internal-4c2122daf2564d19/src/error.js";
2
-
3
1
  let wasm;
4
2
  export function __wbg_set_wasm(val) {
5
3
  wasm = val;
@@ -247,7 +245,7 @@ function handleError(f, args) {
247
245
  wasm.__wbindgen_exn_store(addHeapObject(e));
248
246
  }
249
247
  }
250
- function __wbg_adapter_98(arg0, arg1, arg2, arg3) {
248
+ function __wbg_adapter_99(arg0, arg1, arg2, arg3) {
251
249
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h6a4d43ef1f8d92b4(
252
250
  arg0,
253
251
  arg1,
@@ -326,6 +324,24 @@ export class BitwardenClient {
326
324
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
327
325
  }
328
326
  }
327
+ /**
328
+ * @param {string} msg
329
+ */
330
+ throw(msg) {
331
+ try {
332
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
+ const len0 = WASM_VECTOR_LEN;
335
+ wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
336
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
337
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
338
+ if (r1) {
339
+ throw takeObject(r0);
340
+ }
341
+ } finally {
342
+ wasm.__wbindgen_add_to_stack_pointer(16);
343
+ }
344
+ }
329
345
  /**
330
346
  * Test method, calls http endpoint
331
347
  * @param {string} url
@@ -552,13 +568,13 @@ export function __wbindgen_object_clone_ref(arg0) {
552
568
  return addHeapObject(ret);
553
569
  }
554
570
 
555
- export function __wbg_new_4f56b64fd4b2f633(arg0, arg1) {
571
+ export function __wbg_new_9e4189bc41732bbc(arg0, arg1) {
556
572
  let deferred0_0;
557
573
  let deferred0_1;
558
574
  try {
559
575
  deferred0_0 = arg0;
560
576
  deferred0_1 = arg1;
561
- const ret = new WasmError(getStringFromWasm0(arg0, arg1));
577
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
562
578
  return addHeapObject(ret);
563
579
  } finally {
564
580
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
@@ -715,7 +731,7 @@ export function __wbg_new_1073970097e5a420(arg0, arg1) {
715
731
  const a = state0.a;
716
732
  state0.a = 0;
717
733
  try {
718
- return __wbg_adapter_98(a, state0.b, arg0, arg1);
734
+ return __wbg_adapter_99(a, state0.b, arg0, arg1);
719
735
  } finally {
720
736
  state0.a = a;
721
737
  }
@@ -1032,7 +1048,7 @@ export function __wbg_warn_2e2787d40aad9a81(arg0, arg1, arg2, arg3) {
1032
1048
  console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1033
1049
  }
1034
1050
 
1035
- export function __wbindgen_closure_wrapper1606(arg0, arg1, arg2) {
1051
+ export function __wbindgen_closure_wrapper1608(arg0, arg1, arg2) {
1036
1052
  const ret = makeMutClosure(arg0, arg1, 425, __wbg_adapter_38);
1037
1053
  return addHeapObject(ret);
1038
1054
  }
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export function __wbg_bitwardenclient_free(a: number, b: number): void;
5
5
  export function bitwardenclient_new(a: number, b: number): number;
6
6
  export function bitwardenclient_echo(a: number, b: number, c: number, d: number): void;
7
+ export function bitwardenclient_throw(a: number, b: number, c: number, d: number): void;
7
8
  export function bitwardenclient_http_get(a: number, b: number, c: number): number;
8
9
  export function bitwardenclient_crypto(a: number): number;
9
10
  export function clientcrypto_initialize_user_crypto(a: number, b: number): number;