@bitwarden/sdk-internal 0.2.0-main.19 → 0.2.0-main.190

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.
@@ -1,58 +1,26 @@
1
1
  let imports = {};
2
2
  imports["__wbindgen_placeholder__"] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
5
-
6
- let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
9
-
10
- let cachedUint8ArrayMemory0 = null;
11
-
12
- function getUint8ArrayMemory0() {
13
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
14
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
15
- }
16
- return cachedUint8ArrayMemory0;
17
- }
18
-
19
- function getStringFromWasm0(ptr, len) {
20
- ptr = ptr >>> 0;
21
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
22
- }
4
+ const { TextEncoder, TextDecoder } = require(`util`);
23
5
 
24
6
  const heap = new Array(128).fill(undefined);
25
7
 
26
8
  heap.push(undefined, null, true, false);
27
9
 
28
- let heap_next = heap.length;
29
-
30
- function addHeapObject(obj) {
31
- if (heap_next === heap.length) heap.push(heap.length + 1);
32
- const idx = heap_next;
33
- heap_next = heap[idx];
34
-
35
- heap[idx] = obj;
36
- return idx;
37
- }
38
-
39
10
  function getObject(idx) {
40
11
  return heap[idx];
41
12
  }
42
13
 
43
- function dropObject(idx) {
44
- if (idx < 132) return;
45
- heap[idx] = heap_next;
46
- heap_next = idx;
47
- }
14
+ let WASM_VECTOR_LEN = 0;
48
15
 
49
- function takeObject(idx) {
50
- const ret = getObject(idx);
51
- dropObject(idx);
52
- return ret;
53
- }
16
+ let cachedUint8ArrayMemory0 = null;
54
17
 
55
- let WASM_VECTOR_LEN = 0;
18
+ function getUint8ArrayMemory0() {
19
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
20
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
21
+ }
22
+ return cachedUint8ArrayMemory0;
23
+ }
56
24
 
57
25
  let cachedTextEncoder = new TextEncoder("utf-8");
58
26
 
@@ -110,10 +78,6 @@ function passStringToWasm0(arg, malloc, realloc) {
110
78
  return ptr;
111
79
  }
112
80
 
113
- function isLikeNone(x) {
114
- return x === undefined || x === null;
115
- }
116
-
117
81
  let cachedDataViewMemory0 = null;
118
82
 
119
83
  function getDataViewMemory0() {
@@ -128,6 +92,87 @@ function getDataViewMemory0() {
128
92
  return cachedDataViewMemory0;
129
93
  }
130
94
 
95
+ let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
96
+
97
+ cachedTextDecoder.decode();
98
+
99
+ function getStringFromWasm0(ptr, len) {
100
+ ptr = ptr >>> 0;
101
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
102
+ }
103
+
104
+ let heap_next = heap.length;
105
+
106
+ function addHeapObject(obj) {
107
+ if (heap_next === heap.length) heap.push(heap.length + 1);
108
+ const idx = heap_next;
109
+ heap_next = heap[idx];
110
+
111
+ heap[idx] = obj;
112
+ return idx;
113
+ }
114
+
115
+ function handleError(f, args) {
116
+ try {
117
+ return f.apply(this, args);
118
+ } catch (e) {
119
+ wasm.__wbindgen_exn_store(addHeapObject(e));
120
+ }
121
+ }
122
+
123
+ function dropObject(idx) {
124
+ if (idx < 132) return;
125
+ heap[idx] = heap_next;
126
+ heap_next = idx;
127
+ }
128
+
129
+ function takeObject(idx) {
130
+ const ret = getObject(idx);
131
+ dropObject(idx);
132
+ return ret;
133
+ }
134
+
135
+ function getArrayU8FromWasm0(ptr, len) {
136
+ ptr = ptr >>> 0;
137
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
138
+ }
139
+
140
+ function isLikeNone(x) {
141
+ return x === undefined || x === null;
142
+ }
143
+
144
+ const CLOSURE_DTORS =
145
+ typeof FinalizationRegistry === "undefined"
146
+ ? { register: () => {}, unregister: () => {} }
147
+ : new FinalizationRegistry((state) => {
148
+ wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
149
+ });
150
+
151
+ function makeMutClosure(arg0, arg1, dtor, f) {
152
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
153
+ const real = (...args) => {
154
+ // First up with a closure we increment the internal reference
155
+ // count. This ensures that the Rust closure environment won't
156
+ // be deallocated while we're invoking it.
157
+ state.cnt++;
158
+ const a = state.a;
159
+ state.a = 0;
160
+ try {
161
+ return f(a, state.b, ...args);
162
+ } finally {
163
+ if (--state.cnt === 0) {
164
+ wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
165
+ CLOSURE_DTORS.unregister(state);
166
+ } else {
167
+ state.a = a;
168
+ }
169
+ }
170
+ };
171
+ real.original = state;
172
+ CLOSURE_DTORS.register(real, state, state);
173
+ return real;
174
+ }
175
+
131
176
  function debugString(val) {
132
177
  // primitive types
133
178
  const type = typeof val;
@@ -169,7 +214,7 @@ function debugString(val) {
169
214
  // Test for built-in
170
215
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
171
216
  let className;
172
- if (builtInMatches.length > 1) {
217
+ if (builtInMatches && builtInMatches.length > 1) {
173
218
  className = builtInMatches[1];
174
219
  } else {
175
220
  // Failed to match the standard '[object ClassName]'
@@ -193,45 +238,6 @@ function debugString(val) {
193
238
  return className;
194
239
  }
195
240
 
196
- const CLOSURE_DTORS =
197
- typeof FinalizationRegistry === "undefined"
198
- ? { register: () => {}, unregister: () => {} }
199
- : new FinalizationRegistry((state) => {
200
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
201
- });
202
-
203
- function makeMutClosure(arg0, arg1, dtor, f) {
204
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
205
- const real = (...args) => {
206
- // First up with a closure we increment the internal reference
207
- // count. This ensures that the Rust closure environment won't
208
- // be deallocated while we're invoking it.
209
- state.cnt++;
210
- const a = state.a;
211
- state.a = 0;
212
- try {
213
- return f(a, state.b, ...args);
214
- } finally {
215
- if (--state.cnt === 0) {
216
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
217
- CLOSURE_DTORS.unregister(state);
218
- } else {
219
- state.a = a;
220
- }
221
- }
222
- };
223
- real.original = state;
224
- CLOSURE_DTORS.register(real, state, state);
225
- return real;
226
- }
227
- function __wbg_adapter_38(arg0, arg1, arg2) {
228
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcab43b83560065d8(
229
- arg0,
230
- arg1,
231
- addHeapObject(arg2),
232
- );
233
- }
234
-
235
241
  let stack_pointer = 128;
236
242
 
237
243
  function addBorrowedObject(obj) {
@@ -243,9 +249,9 @@ function addBorrowedObject(obj) {
243
249
  * @param {any} error
244
250
  * @returns {boolean}
245
251
  */
246
- module.exports.isCoreError = function (error) {
252
+ module.exports.isEncryptionSettingsError = function (error) {
247
253
  try {
248
- const ret = wasm.isCoreError(addBorrowedObject(error));
254
+ const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
249
255
  return ret !== 0;
250
256
  } finally {
251
257
  heap[stack_pointer++] = undefined;
@@ -256,22 +262,41 @@ module.exports.isCoreError = function (error) {
256
262
  * @param {any} error
257
263
  * @returns {boolean}
258
264
  */
259
- module.exports.isEncryptionSettingsError = function (error) {
265
+ module.exports.isCryptoError = function (error) {
260
266
  try {
261
- const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
267
+ const ret = wasm.isCryptoError(addBorrowedObject(error));
262
268
  return ret !== 0;
263
269
  } finally {
264
270
  heap[stack_pointer++] = undefined;
265
271
  }
266
272
  };
267
273
 
274
+ function passArrayJsValueToWasm0(array, malloc) {
275
+ const ptr = malloc(array.length * 4, 4) >>> 0;
276
+ const mem = getDataViewMemory0();
277
+ for (let i = 0; i < array.length; i++) {
278
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
279
+ }
280
+ WASM_VECTOR_LEN = array.length;
281
+ return ptr;
282
+ }
283
+
284
+ function getArrayJsValueFromWasm0(ptr, len) {
285
+ ptr = ptr >>> 0;
286
+ const mem = getDataViewMemory0();
287
+ const result = [];
288
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
289
+ result.push(takeObject(mem.getUint32(i, true)));
290
+ }
291
+ return result;
292
+ }
268
293
  /**
269
294
  * @param {any} error
270
295
  * @returns {boolean}
271
296
  */
272
- module.exports.isKeyGenerationError = function (error) {
297
+ module.exports.isExportError = function (error) {
273
298
  try {
274
- const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
299
+ const ret = wasm.isExportError(addBorrowedObject(error));
275
300
  return ret !== 0;
276
301
  } finally {
277
302
  heap[stack_pointer++] = undefined;
@@ -282,9 +307,9 @@ module.exports.isKeyGenerationError = function (error) {
282
307
  * @param {any} error
283
308
  * @returns {boolean}
284
309
  */
285
- module.exports.isTestError = function (error) {
310
+ module.exports.isUsernameError = function (error) {
286
311
  try {
287
- const ret = wasm.isTestError(addBorrowedObject(error));
312
+ const ret = wasm.isUsernameError(addBorrowedObject(error));
288
313
  return ret !== 0;
289
314
  } finally {
290
315
  heap[stack_pointer++] = undefined;
@@ -292,250 +317,2575 @@ module.exports.isTestError = function (error) {
292
317
  };
293
318
 
294
319
  /**
295
- * @param {KeyAlgorithm} key_algorithm
296
- * @returns {GenerateSshKeyResult}
320
+ * @param {any} error
321
+ * @returns {boolean}
297
322
  */
298
- module.exports.generate_ssh_key = function (key_algorithm) {
323
+ module.exports.isPasswordError = function (error) {
299
324
  try {
300
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
301
- wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
302
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
303
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
304
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
305
- if (r2) {
306
- throw takeObject(r1);
307
- }
308
- return takeObject(r0);
325
+ const ret = wasm.isPasswordError(addBorrowedObject(error));
326
+ return ret !== 0;
309
327
  } finally {
310
- wasm.__wbindgen_add_to_stack_pointer(16);
328
+ heap[stack_pointer++] = undefined;
311
329
  }
312
330
  };
313
331
 
314
- function handleError(f, args) {
332
+ /**
333
+ * @param {any} error
334
+ * @returns {boolean}
335
+ */
336
+ module.exports.isPassphraseError = function (error) {
315
337
  try {
316
- return f.apply(this, args);
317
- } catch (e) {
318
- wasm.__wbindgen_exn_store(addHeapObject(e));
338
+ const ret = wasm.isPassphraseError(addBorrowedObject(error));
339
+ return ret !== 0;
340
+ } finally {
341
+ heap[stack_pointer++] = undefined;
319
342
  }
320
- }
321
- function __wbg_adapter_125(arg0, arg1, arg2, arg3) {
322
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h7363c1bfa226a55d(
323
- arg0,
324
- arg1,
325
- addHeapObject(arg2),
326
- addHeapObject(arg3),
327
- );
328
- }
329
-
330
- module.exports.LogLevel = Object.freeze({
331
- Trace: 0,
332
- 0: "Trace",
333
- Debug: 1,
334
- 1: "Debug",
335
- Info: 2,
336
- 2: "Info",
337
- Warn: 3,
338
- 3: "Warn",
339
- Error: 4,
340
- 4: "Error",
341
- });
342
-
343
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
344
-
345
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
343
+ };
346
344
 
347
- const BitwardenClientFinalization =
348
- typeof FinalizationRegistry === "undefined"
349
- ? { register: () => {}, unregister: () => {} }
350
- : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
345
+ function passArray8ToWasm0(arg, malloc) {
346
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
347
+ getUint8ArrayMemory0().set(arg, ptr / 1);
348
+ WASM_VECTOR_LEN = arg.length;
349
+ return ptr;
350
+ }
351
351
 
352
- class BitwardenClient {
353
- __destroy_into_raw() {
354
- const ptr = this.__wbg_ptr;
355
- this.__wbg_ptr = 0;
356
- BitwardenClientFinalization.unregister(this);
357
- return ptr;
352
+ function _assertClass(instance, klass) {
353
+ if (!(instance instanceof klass)) {
354
+ throw new Error(`expected instance of ${klass.name}`);
358
355
  }
359
-
360
- free() {
361
- const ptr = this.__destroy_into_raw();
362
- wasm.__wbg_bitwardenclient_free(ptr, 0);
356
+ }
357
+ /**
358
+ * @param {any} error
359
+ * @returns {boolean}
360
+ */
361
+ module.exports.isChannelError = function (error) {
362
+ try {
363
+ const ret = wasm.isChannelError(addBorrowedObject(error));
364
+ return ret !== 0;
365
+ } finally {
366
+ heap[stack_pointer++] = undefined;
367
+ }
368
+ };
369
+
370
+ /**
371
+ * @param {any} error
372
+ * @returns {boolean}
373
+ */
374
+ module.exports.isDeserializeError = function (error) {
375
+ try {
376
+ const ret = wasm.isDeserializeError(addBorrowedObject(error));
377
+ return ret !== 0;
378
+ } finally {
379
+ heap[stack_pointer++] = undefined;
380
+ }
381
+ };
382
+
383
+ /**
384
+ * @param {any} error
385
+ * @returns {boolean}
386
+ */
387
+ module.exports.isSshKeyExportError = function (error) {
388
+ try {
389
+ const ret = wasm.isSshKeyExportError(addBorrowedObject(error));
390
+ return ret !== 0;
391
+ } finally {
392
+ heap[stack_pointer++] = undefined;
393
+ }
394
+ };
395
+
396
+ /**
397
+ * @param {any} error
398
+ * @returns {boolean}
399
+ */
400
+ module.exports.isSshKeyImportError = function (error) {
401
+ try {
402
+ const ret = wasm.isSshKeyImportError(addBorrowedObject(error));
403
+ return ret !== 0;
404
+ } finally {
405
+ heap[stack_pointer++] = undefined;
406
+ }
407
+ };
408
+
409
+ /**
410
+ * @param {any} error
411
+ * @returns {boolean}
412
+ */
413
+ module.exports.isKeyGenerationError = function (error) {
414
+ try {
415
+ const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
416
+ return ret !== 0;
417
+ } finally {
418
+ heap[stack_pointer++] = undefined;
419
+ }
420
+ };
421
+
422
+ /**
423
+ * @param {any} error
424
+ * @returns {boolean}
425
+ */
426
+ module.exports.isDecryptError = function (error) {
427
+ try {
428
+ const ret = wasm.isDecryptError(addBorrowedObject(error));
429
+ return ret !== 0;
430
+ } finally {
431
+ heap[stack_pointer++] = undefined;
432
+ }
433
+ };
434
+
435
+ /**
436
+ * @param {any} error
437
+ * @returns {boolean}
438
+ */
439
+ module.exports.isEncryptError = function (error) {
440
+ try {
441
+ const ret = wasm.isEncryptError(addBorrowedObject(error));
442
+ return ret !== 0;
443
+ } finally {
444
+ heap[stack_pointer++] = undefined;
445
+ }
446
+ };
447
+
448
+ /**
449
+ * @param {any} error
450
+ * @returns {boolean}
451
+ */
452
+ module.exports.isTotpError = function (error) {
453
+ try {
454
+ const ret = wasm.isTotpError(addBorrowedObject(error));
455
+ return ret !== 0;
456
+ } finally {
457
+ heap[stack_pointer++] = undefined;
458
+ }
459
+ };
460
+
461
+ /**
462
+ * @param {any} error
463
+ * @returns {boolean}
464
+ */
465
+ module.exports.isCipherError = function (error) {
466
+ try {
467
+ const ret = wasm.isCipherError(addBorrowedObject(error));
468
+ return ret !== 0;
469
+ } finally {
470
+ heap[stack_pointer++] = undefined;
471
+ }
472
+ };
473
+
474
+ /**
475
+ * @param {any} error
476
+ * @returns {boolean}
477
+ */
478
+ module.exports.isDecryptFileError = function (error) {
479
+ try {
480
+ const ret = wasm.isDecryptFileError(addBorrowedObject(error));
481
+ return ret !== 0;
482
+ } finally {
483
+ heap[stack_pointer++] = undefined;
484
+ }
485
+ };
486
+
487
+ /**
488
+ * @param {any} error
489
+ * @returns {boolean}
490
+ */
491
+ module.exports.isEncryptFileError = function (error) {
492
+ try {
493
+ const ret = wasm.isEncryptFileError(addBorrowedObject(error));
494
+ return ret !== 0;
495
+ } finally {
496
+ heap[stack_pointer++] = undefined;
497
+ }
498
+ };
499
+
500
+ /**
501
+ * @param {LogLevel} level
502
+ */
503
+ module.exports.set_log_level = function (level) {
504
+ wasm.set_log_level(level);
505
+ };
506
+
507
+ /**
508
+ * @param {LogLevel | null} [log_level]
509
+ */
510
+ module.exports.init_sdk = function (log_level) {
511
+ wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
512
+ };
513
+
514
+ /**
515
+ * Generate a new SSH key pair
516
+ *
517
+ * # Arguments
518
+ * - `key_algorithm` - The algorithm to use for the key pair
519
+ *
520
+ * # Returns
521
+ * - `Ok(SshKey)` if the key was successfully generated
522
+ * - `Err(KeyGenerationError)` if the key could not be generated
523
+ * @param {KeyAlgorithm} key_algorithm
524
+ * @returns {SshKeyView}
525
+ */
526
+ module.exports.generate_ssh_key = function (key_algorithm) {
527
+ try {
528
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
529
+ wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
532
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
533
+ if (r2) {
534
+ throw takeObject(r1);
535
+ }
536
+ return takeObject(r0);
537
+ } finally {
538
+ wasm.__wbindgen_add_to_stack_pointer(16);
539
+ }
540
+ };
541
+
542
+ /**
543
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
544
+ * to an OpenSSH private key with public key and fingerprint
545
+ *
546
+ * # Arguments
547
+ * - `imported_key` - The private key to convert
548
+ * - `password` - The password to use for decrypting the key
549
+ *
550
+ * # Returns
551
+ * - `Ok(SshKey)` if the key was successfully coneverted
552
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
553
+ * - `Err(WrongPassword)` if the password provided is incorrect
554
+ * - `Err(ParsingError)` if the key could not be parsed
555
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
556
+ * @param {string} imported_key
557
+ * @param {string | null} [password]
558
+ * @returns {SshKeyView}
559
+ */
560
+ module.exports.import_ssh_key = function (imported_key, password) {
561
+ try {
562
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
563
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
564
+ const len0 = WASM_VECTOR_LEN;
565
+ var ptr1 = isLikeNone(password)
566
+ ? 0
567
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
568
+ var len1 = WASM_VECTOR_LEN;
569
+ wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1);
570
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
571
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
572
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
573
+ if (r2) {
574
+ throw takeObject(r1);
575
+ }
576
+ return takeObject(r0);
577
+ } finally {
578
+ wasm.__wbindgen_add_to_stack_pointer(16);
579
+ }
580
+ };
581
+
582
+ /**
583
+ * @param {any} error
584
+ * @returns {boolean}
585
+ */
586
+ module.exports.isTestError = function (error) {
587
+ try {
588
+ const ret = wasm.isTestError(addBorrowedObject(error));
589
+ return ret !== 0;
590
+ } finally {
591
+ heap[stack_pointer++] = undefined;
592
+ }
593
+ };
594
+
595
+ function __wbg_adapter_50(arg0, arg1) {
596
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha35b9bda8efb3006(
597
+ arg0,
598
+ arg1,
599
+ );
600
+ }
601
+
602
+ function __wbg_adapter_53(arg0, arg1, arg2) {
603
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9af0b195ec309e58(
604
+ arg0,
605
+ arg1,
606
+ addHeapObject(arg2),
607
+ );
608
+ }
609
+
610
+ function __wbg_adapter_256(arg0, arg1, arg2, arg3) {
611
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h08b1d375eb2ae73e(
612
+ arg0,
613
+ arg1,
614
+ addHeapObject(arg2),
615
+ addHeapObject(arg3),
616
+ );
617
+ }
618
+
619
+ /**
620
+ * @enum {300 | 301 | 302 | 303 | 304 | 305}
621
+ */
622
+ module.exports.CardLinkedIdType = Object.freeze({
623
+ CardholderName: 300,
624
+ 300: "CardholderName",
625
+ ExpMonth: 301,
626
+ 301: "ExpMonth",
627
+ ExpYear: 302,
628
+ 302: "ExpYear",
629
+ Code: 303,
630
+ 303: "Code",
631
+ Brand: 304,
632
+ 304: "Brand",
633
+ Number: 305,
634
+ 305: "Number",
635
+ });
636
+ /**
637
+ * @enum {0 | 1}
638
+ */
639
+ module.exports.CipherRepromptType = Object.freeze({
640
+ None: 0,
641
+ 0: "None",
642
+ Password: 1,
643
+ 1: "Password",
644
+ });
645
+ /**
646
+ * @enum {1 | 2 | 3 | 4 | 5}
647
+ */
648
+ module.exports.CipherType = Object.freeze({
649
+ Login: 1,
650
+ 1: "Login",
651
+ SecureNote: 2,
652
+ 2: "SecureNote",
653
+ Card: 3,
654
+ 3: "Card",
655
+ Identity: 4,
656
+ 4: "Identity",
657
+ SshKey: 5,
658
+ 5: "SshKey",
659
+ });
660
+ /**
661
+ * @enum {0 | 1 | 2 | 3}
662
+ */
663
+ module.exports.FieldType = Object.freeze({
664
+ Text: 0,
665
+ 0: "Text",
666
+ Hidden: 1,
667
+ 1: "Hidden",
668
+ Boolean: 2,
669
+ 2: "Boolean",
670
+ Linked: 3,
671
+ 3: "Linked",
672
+ });
673
+ /**
674
+ * @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
675
+ */
676
+ module.exports.IdentityLinkedIdType = Object.freeze({
677
+ Title: 400,
678
+ 400: "Title",
679
+ MiddleName: 401,
680
+ 401: "MiddleName",
681
+ Address1: 402,
682
+ 402: "Address1",
683
+ Address2: 403,
684
+ 403: "Address2",
685
+ Address3: 404,
686
+ 404: "Address3",
687
+ City: 405,
688
+ 405: "City",
689
+ State: 406,
690
+ 406: "State",
691
+ PostalCode: 407,
692
+ 407: "PostalCode",
693
+ Country: 408,
694
+ 408: "Country",
695
+ Company: 409,
696
+ 409: "Company",
697
+ Email: 410,
698
+ 410: "Email",
699
+ Phone: 411,
700
+ 411: "Phone",
701
+ Ssn: 412,
702
+ 412: "Ssn",
703
+ Username: 413,
704
+ 413: "Username",
705
+ PassportNumber: 414,
706
+ 414: "PassportNumber",
707
+ LicenseNumber: 415,
708
+ 415: "LicenseNumber",
709
+ FirstName: 416,
710
+ 416: "FirstName",
711
+ LastName: 417,
712
+ 417: "LastName",
713
+ FullName: 418,
714
+ 418: "FullName",
715
+ });
716
+ /**
717
+ * @enum {0 | 1 | 2 | 3 | 4}
718
+ */
719
+ module.exports.LogLevel = Object.freeze({
720
+ Trace: 0,
721
+ 0: "Trace",
722
+ Debug: 1,
723
+ 1: "Debug",
724
+ Info: 2,
725
+ 2: "Info",
726
+ Warn: 3,
727
+ 3: "Warn",
728
+ Error: 4,
729
+ 4: "Error",
730
+ });
731
+ /**
732
+ * @enum {100 | 101}
733
+ */
734
+ module.exports.LoginLinkedIdType = Object.freeze({
735
+ Username: 100,
736
+ 100: "Username",
737
+ Password: 101,
738
+ 101: "Password",
739
+ });
740
+ /**
741
+ * @enum {0}
742
+ */
743
+ module.exports.SecureNoteType = Object.freeze({
744
+ Generic: 0,
745
+ 0: "Generic",
746
+ });
747
+ /**
748
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
749
+ */
750
+ module.exports.UriMatchType = Object.freeze({
751
+ Domain: 0,
752
+ 0: "Domain",
753
+ Host: 1,
754
+ 1: "Host",
755
+ StartsWith: 2,
756
+ 2: "StartsWith",
757
+ Exact: 3,
758
+ 3: "Exact",
759
+ RegularExpression: 4,
760
+ 4: "RegularExpression",
761
+ Never: 5,
762
+ 5: "Never",
763
+ });
764
+
765
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
766
+
767
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
768
+
769
+ const AttachmentsClientFinalization =
770
+ typeof FinalizationRegistry === "undefined"
771
+ ? { register: () => {}, unregister: () => {} }
772
+ : new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
773
+
774
+ class AttachmentsClient {
775
+ static __wrap(ptr) {
776
+ ptr = ptr >>> 0;
777
+ const obj = Object.create(AttachmentsClient.prototype);
778
+ obj.__wbg_ptr = ptr;
779
+ AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
780
+ return obj;
781
+ }
782
+
783
+ __destroy_into_raw() {
784
+ const ptr = this.__wbg_ptr;
785
+ this.__wbg_ptr = 0;
786
+ AttachmentsClientFinalization.unregister(this);
787
+ return ptr;
788
+ }
789
+
790
+ free() {
791
+ const ptr = this.__destroy_into_raw();
792
+ wasm.__wbg_attachmentsclient_free(ptr, 0);
793
+ }
794
+ /**
795
+ * @param {Cipher} cipher
796
+ * @param {AttachmentView} attachment
797
+ * @param {Uint8Array} encrypted_buffer
798
+ * @returns {Uint8Array}
799
+ */
800
+ decrypt_buffer(cipher, attachment, encrypted_buffer) {
801
+ try {
802
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
803
+ const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
804
+ const len0 = WASM_VECTOR_LEN;
805
+ wasm.attachmentsclient_decrypt_buffer(
806
+ retptr,
807
+ this.__wbg_ptr,
808
+ addHeapObject(cipher),
809
+ addHeapObject(attachment),
810
+ ptr0,
811
+ len0,
812
+ );
813
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
814
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
815
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
816
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
817
+ if (r3) {
818
+ throw takeObject(r2);
819
+ }
820
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
821
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
822
+ return v2;
823
+ } finally {
824
+ wasm.__wbindgen_add_to_stack_pointer(16);
825
+ }
826
+ }
827
+ }
828
+ module.exports.AttachmentsClient = AttachmentsClient;
829
+
830
+ const BitwardenClientFinalization =
831
+ typeof FinalizationRegistry === "undefined"
832
+ ? { register: () => {}, unregister: () => {} }
833
+ : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
834
+
835
+ class BitwardenClient {
836
+ __destroy_into_raw() {
837
+ const ptr = this.__wbg_ptr;
838
+ this.__wbg_ptr = 0;
839
+ BitwardenClientFinalization.unregister(this);
840
+ return ptr;
841
+ }
842
+
843
+ free() {
844
+ const ptr = this.__destroy_into_raw();
845
+ wasm.__wbg_bitwardenclient_free(ptr, 0);
846
+ }
847
+ /**
848
+ * @param {ClientSettings | null} [settings]
849
+ */
850
+ constructor(settings) {
851
+ const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addHeapObject(settings));
852
+ this.__wbg_ptr = ret >>> 0;
853
+ BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
854
+ return this;
855
+ }
856
+ /**
857
+ * Test method, echoes back the input
858
+ * @param {string} msg
859
+ * @returns {string}
860
+ */
861
+ echo(msg) {
862
+ let deferred2_0;
863
+ let deferred2_1;
864
+ try {
865
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
866
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
867
+ const len0 = WASM_VECTOR_LEN;
868
+ wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
869
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
870
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
871
+ deferred2_0 = r0;
872
+ deferred2_1 = r1;
873
+ return getStringFromWasm0(r0, r1);
874
+ } finally {
875
+ wasm.__wbindgen_add_to_stack_pointer(16);
876
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
877
+ }
878
+ }
879
+ /**
880
+ * @returns {string}
881
+ */
882
+ version() {
883
+ let deferred1_0;
884
+ let deferred1_1;
885
+ try {
886
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
887
+ wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
888
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
889
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
890
+ deferred1_0 = r0;
891
+ deferred1_1 = r1;
892
+ return getStringFromWasm0(r0, r1);
893
+ } finally {
894
+ wasm.__wbindgen_add_to_stack_pointer(16);
895
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
896
+ }
897
+ }
898
+ /**
899
+ * @param {string} msg
900
+ */
901
+ throw(msg) {
902
+ try {
903
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
904
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
905
+ const len0 = WASM_VECTOR_LEN;
906
+ wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
907
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
908
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
909
+ if (r1) {
910
+ throw takeObject(r0);
911
+ }
912
+ } finally {
913
+ wasm.__wbindgen_add_to_stack_pointer(16);
914
+ }
915
+ }
916
+ /**
917
+ * Test method, calls http endpoint
918
+ * @param {string} url
919
+ * @returns {Promise<string>}
920
+ */
921
+ http_get(url) {
922
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
923
+ const len0 = WASM_VECTOR_LEN;
924
+ const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
925
+ return takeObject(ret);
926
+ }
927
+ /**
928
+ * @returns {CryptoClient}
929
+ */
930
+ crypto() {
931
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
932
+ return CryptoClient.__wrap(ret);
933
+ }
934
+ /**
935
+ * @returns {VaultClient}
936
+ */
937
+ vault() {
938
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
939
+ return VaultClient.__wrap(ret);
940
+ }
941
+ /**
942
+ * Constructs a specific client for generating passwords and passphrases
943
+ * @returns {GeneratorClient}
944
+ */
945
+ generator() {
946
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
947
+ return GeneratorClient.__wrap(ret);
948
+ }
949
+ /**
950
+ * @returns {ExporterClient}
951
+ */
952
+ exporters() {
953
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
954
+ return ExporterClient.__wrap(ret);
955
+ }
956
+ }
957
+ module.exports.BitwardenClient = BitwardenClient;
958
+
959
+ const CiphersClientFinalization =
960
+ typeof FinalizationRegistry === "undefined"
961
+ ? { register: () => {}, unregister: () => {} }
962
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
963
+
964
+ class CiphersClient {
965
+ static __wrap(ptr) {
966
+ ptr = ptr >>> 0;
967
+ const obj = Object.create(CiphersClient.prototype);
968
+ obj.__wbg_ptr = ptr;
969
+ CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
970
+ return obj;
971
+ }
972
+
973
+ __destroy_into_raw() {
974
+ const ptr = this.__wbg_ptr;
975
+ this.__wbg_ptr = 0;
976
+ CiphersClientFinalization.unregister(this);
977
+ return ptr;
978
+ }
979
+
980
+ free() {
981
+ const ptr = this.__destroy_into_raw();
982
+ wasm.__wbg_ciphersclient_free(ptr, 0);
983
+ }
984
+ /**
985
+ * @param {CipherView} cipher_view
986
+ * @returns {EncryptionContext}
987
+ */
988
+ encrypt(cipher_view) {
989
+ try {
990
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
991
+ wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
992
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
993
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
994
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
995
+ if (r2) {
996
+ throw takeObject(r1);
997
+ }
998
+ return takeObject(r0);
999
+ } finally {
1000
+ wasm.__wbindgen_add_to_stack_pointer(16);
1001
+ }
1002
+ }
1003
+ /**
1004
+ * @param {Cipher} cipher
1005
+ * @returns {CipherView}
1006
+ */
1007
+ decrypt(cipher) {
1008
+ try {
1009
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1010
+ wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
1011
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1012
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1013
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1014
+ if (r2) {
1015
+ throw takeObject(r1);
1016
+ }
1017
+ return takeObject(r0);
1018
+ } finally {
1019
+ wasm.__wbindgen_add_to_stack_pointer(16);
1020
+ }
1021
+ }
1022
+ /**
1023
+ * @param {Cipher[]} ciphers
1024
+ * @returns {CipherListView[]}
1025
+ */
1026
+ decrypt_list(ciphers) {
1027
+ try {
1028
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1029
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1030
+ const len0 = WASM_VECTOR_LEN;
1031
+ wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1032
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1033
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1034
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1035
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1036
+ if (r3) {
1037
+ throw takeObject(r2);
1038
+ }
1039
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1040
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1041
+ return v2;
1042
+ } finally {
1043
+ wasm.__wbindgen_add_to_stack_pointer(16);
1044
+ }
1045
+ }
1046
+ /**
1047
+ * @param {CipherView} cipher_view
1048
+ * @returns {Fido2CredentialView[]}
1049
+ */
1050
+ decrypt_fido2_credentials(cipher_view) {
1051
+ try {
1052
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1053
+ wasm.ciphersclient_decrypt_fido2_credentials(
1054
+ retptr,
1055
+ this.__wbg_ptr,
1056
+ addHeapObject(cipher_view),
1057
+ );
1058
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1059
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1060
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1061
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1062
+ if (r3) {
1063
+ throw takeObject(r2);
1064
+ }
1065
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1066
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1067
+ return v1;
1068
+ } finally {
1069
+ wasm.__wbindgen_add_to_stack_pointer(16);
1070
+ }
1071
+ }
1072
+ /**
1073
+ * @param {CipherView} cipher_view
1074
+ * @param {OrganizationId} organization_id
1075
+ * @returns {CipherView}
1076
+ */
1077
+ move_to_organization(cipher_view, organization_id) {
1078
+ try {
1079
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1080
+ wasm.ciphersclient_move_to_organization(
1081
+ retptr,
1082
+ this.__wbg_ptr,
1083
+ addHeapObject(cipher_view),
1084
+ addHeapObject(organization_id),
1085
+ );
1086
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1087
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1088
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1089
+ if (r2) {
1090
+ throw takeObject(r1);
1091
+ }
1092
+ return takeObject(r0);
1093
+ } finally {
1094
+ wasm.__wbindgen_add_to_stack_pointer(16);
1095
+ }
1096
+ }
1097
+ /**
1098
+ * @param {CipherView} cipher_view
1099
+ * @returns {string}
1100
+ */
1101
+ decrypt_fido2_private_key(cipher_view) {
1102
+ let deferred2_0;
1103
+ let deferred2_1;
1104
+ try {
1105
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1106
+ wasm.ciphersclient_decrypt_fido2_private_key(
1107
+ retptr,
1108
+ this.__wbg_ptr,
1109
+ addHeapObject(cipher_view),
1110
+ );
1111
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1112
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1113
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1114
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1115
+ var ptr1 = r0;
1116
+ var len1 = r1;
1117
+ if (r3) {
1118
+ ptr1 = 0;
1119
+ len1 = 0;
1120
+ throw takeObject(r2);
1121
+ }
1122
+ deferred2_0 = ptr1;
1123
+ deferred2_1 = len1;
1124
+ return getStringFromWasm0(ptr1, len1);
1125
+ } finally {
1126
+ wasm.__wbindgen_add_to_stack_pointer(16);
1127
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1128
+ }
1129
+ }
1130
+ }
1131
+ module.exports.CiphersClient = CiphersClient;
1132
+
1133
+ const CryptoClientFinalization =
1134
+ typeof FinalizationRegistry === "undefined"
1135
+ ? { register: () => {}, unregister: () => {} }
1136
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
1137
+
1138
+ class CryptoClient {
1139
+ static __wrap(ptr) {
1140
+ ptr = ptr >>> 0;
1141
+ const obj = Object.create(CryptoClient.prototype);
1142
+ obj.__wbg_ptr = ptr;
1143
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
1144
+ return obj;
1145
+ }
1146
+
1147
+ __destroy_into_raw() {
1148
+ const ptr = this.__wbg_ptr;
1149
+ this.__wbg_ptr = 0;
1150
+ CryptoClientFinalization.unregister(this);
1151
+ return ptr;
1152
+ }
1153
+
1154
+ free() {
1155
+ const ptr = this.__destroy_into_raw();
1156
+ wasm.__wbg_cryptoclient_free(ptr, 0);
1157
+ }
1158
+ /**
1159
+ * Initialization method for the user crypto. Needs to be called before any other crypto
1160
+ * operations.
1161
+ * @param {InitUserCryptoRequest} req
1162
+ * @returns {Promise<void>}
1163
+ */
1164
+ initialize_user_crypto(req) {
1165
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
1166
+ return takeObject(ret);
1167
+ }
1168
+ /**
1169
+ * Initialization method for the organization crypto. Needs to be called after
1170
+ * `initialize_user_crypto` but before any other crypto operations.
1171
+ * @param {InitOrgCryptoRequest} req
1172
+ * @returns {Promise<void>}
1173
+ */
1174
+ initialize_org_crypto(req) {
1175
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
1176
+ return takeObject(ret);
1177
+ }
1178
+ /**
1179
+ * Generates a new key pair and encrypts the private key with the provided user key.
1180
+ * Crypto initialization not required.
1181
+ * @param {string} user_key
1182
+ * @returns {MakeKeyPairResponse}
1183
+ */
1184
+ make_key_pair(user_key) {
1185
+ try {
1186
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1187
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ const len0 = WASM_VECTOR_LEN;
1189
+ wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
1190
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1191
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1192
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1193
+ if (r2) {
1194
+ throw takeObject(r1);
1195
+ }
1196
+ return takeObject(r0);
1197
+ } finally {
1198
+ wasm.__wbindgen_add_to_stack_pointer(16);
1199
+ }
1200
+ }
1201
+ /**
1202
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
1203
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
1204
+ * Crypto initialization not required.
1205
+ * @param {VerifyAsymmetricKeysRequest} request
1206
+ * @returns {VerifyAsymmetricKeysResponse}
1207
+ */
1208
+ verify_asymmetric_keys(request) {
1209
+ try {
1210
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1211
+ wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
1212
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1213
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1214
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1215
+ if (r2) {
1216
+ throw takeObject(r1);
1217
+ }
1218
+ return takeObject(r0);
1219
+ } finally {
1220
+ wasm.__wbindgen_add_to_stack_pointer(16);
1221
+ }
1222
+ }
1223
+ }
1224
+ module.exports.CryptoClient = CryptoClient;
1225
+
1226
+ const ExporterClientFinalization =
1227
+ typeof FinalizationRegistry === "undefined"
1228
+ ? { register: () => {}, unregister: () => {} }
1229
+ : new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
1230
+
1231
+ class ExporterClient {
1232
+ static __wrap(ptr) {
1233
+ ptr = ptr >>> 0;
1234
+ const obj = Object.create(ExporterClient.prototype);
1235
+ obj.__wbg_ptr = ptr;
1236
+ ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
1237
+ return obj;
1238
+ }
1239
+
1240
+ __destroy_into_raw() {
1241
+ const ptr = this.__wbg_ptr;
1242
+ this.__wbg_ptr = 0;
1243
+ ExporterClientFinalization.unregister(this);
1244
+ return ptr;
1245
+ }
1246
+
1247
+ free() {
1248
+ const ptr = this.__destroy_into_raw();
1249
+ wasm.__wbg_exporterclient_free(ptr, 0);
1250
+ }
1251
+ /**
1252
+ * @param {Folder[]} folders
1253
+ * @param {Cipher[]} ciphers
1254
+ * @param {ExportFormat} format
1255
+ * @returns {string}
1256
+ */
1257
+ export_vault(folders, ciphers, format) {
1258
+ let deferred4_0;
1259
+ let deferred4_1;
1260
+ try {
1261
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1262
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1263
+ const len0 = WASM_VECTOR_LEN;
1264
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1265
+ const len1 = WASM_VECTOR_LEN;
1266
+ wasm.exporterclient_export_vault(
1267
+ retptr,
1268
+ this.__wbg_ptr,
1269
+ ptr0,
1270
+ len0,
1271
+ ptr1,
1272
+ len1,
1273
+ addHeapObject(format),
1274
+ );
1275
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1276
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1277
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1278
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1279
+ var ptr3 = r0;
1280
+ var len3 = r1;
1281
+ if (r3) {
1282
+ ptr3 = 0;
1283
+ len3 = 0;
1284
+ throw takeObject(r2);
1285
+ }
1286
+ deferred4_0 = ptr3;
1287
+ deferred4_1 = len3;
1288
+ return getStringFromWasm0(ptr3, len3);
1289
+ } finally {
1290
+ wasm.__wbindgen_add_to_stack_pointer(16);
1291
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1292
+ }
1293
+ }
1294
+ /**
1295
+ * @param {Collection[]} collections
1296
+ * @param {Cipher[]} ciphers
1297
+ * @param {ExportFormat} format
1298
+ * @returns {string}
1299
+ */
1300
+ export_organization_vault(collections, ciphers, format) {
1301
+ let deferred4_0;
1302
+ let deferred4_1;
1303
+ try {
1304
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1305
+ const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
1306
+ const len0 = WASM_VECTOR_LEN;
1307
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1308
+ const len1 = WASM_VECTOR_LEN;
1309
+ wasm.exporterclient_export_organization_vault(
1310
+ retptr,
1311
+ this.__wbg_ptr,
1312
+ ptr0,
1313
+ len0,
1314
+ ptr1,
1315
+ len1,
1316
+ addHeapObject(format),
1317
+ );
1318
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1319
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1320
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1321
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1322
+ var ptr3 = r0;
1323
+ var len3 = r1;
1324
+ if (r3) {
1325
+ ptr3 = 0;
1326
+ len3 = 0;
1327
+ throw takeObject(r2);
1328
+ }
1329
+ deferred4_0 = ptr3;
1330
+ deferred4_1 = len3;
1331
+ return getStringFromWasm0(ptr3, len3);
1332
+ } finally {
1333
+ wasm.__wbindgen_add_to_stack_pointer(16);
1334
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1335
+ }
1336
+ }
1337
+ /**
1338
+ * Credential Exchange Format (CXF)
1339
+ *
1340
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1341
+ *
1342
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1343
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1344
+ * @param {Account} account
1345
+ * @param {Cipher[]} ciphers
1346
+ * @returns {string}
1347
+ */
1348
+ export_cxf(account, ciphers) {
1349
+ let deferred3_0;
1350
+ let deferred3_1;
1351
+ try {
1352
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1353
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1354
+ const len0 = WASM_VECTOR_LEN;
1355
+ wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
1356
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1357
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1358
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1359
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1360
+ var ptr2 = r0;
1361
+ var len2 = r1;
1362
+ if (r3) {
1363
+ ptr2 = 0;
1364
+ len2 = 0;
1365
+ throw takeObject(r2);
1366
+ }
1367
+ deferred3_0 = ptr2;
1368
+ deferred3_1 = len2;
1369
+ return getStringFromWasm0(ptr2, len2);
1370
+ } finally {
1371
+ wasm.__wbindgen_add_to_stack_pointer(16);
1372
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1373
+ }
1374
+ }
1375
+ /**
1376
+ * Credential Exchange Format (CXF)
1377
+ *
1378
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1379
+ *
1380
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1381
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1382
+ * @param {string} payload
1383
+ * @returns {Cipher[]}
1384
+ */
1385
+ import_cxf(payload) {
1386
+ try {
1387
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1388
+ const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1389
+ const len0 = WASM_VECTOR_LEN;
1390
+ wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
1391
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1392
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1393
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1394
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1395
+ if (r3) {
1396
+ throw takeObject(r2);
1397
+ }
1398
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1399
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1400
+ return v2;
1401
+ } finally {
1402
+ wasm.__wbindgen_add_to_stack_pointer(16);
1403
+ }
1404
+ }
1405
+ }
1406
+ module.exports.ExporterClient = ExporterClient;
1407
+
1408
+ const FoldersClientFinalization =
1409
+ typeof FinalizationRegistry === "undefined"
1410
+ ? { register: () => {}, unregister: () => {} }
1411
+ : new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
1412
+
1413
+ class FoldersClient {
1414
+ static __wrap(ptr) {
1415
+ ptr = ptr >>> 0;
1416
+ const obj = Object.create(FoldersClient.prototype);
1417
+ obj.__wbg_ptr = ptr;
1418
+ FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1419
+ return obj;
1420
+ }
1421
+
1422
+ __destroy_into_raw() {
1423
+ const ptr = this.__wbg_ptr;
1424
+ this.__wbg_ptr = 0;
1425
+ FoldersClientFinalization.unregister(this);
1426
+ return ptr;
1427
+ }
1428
+
1429
+ free() {
1430
+ const ptr = this.__destroy_into_raw();
1431
+ wasm.__wbg_foldersclient_free(ptr, 0);
1432
+ }
1433
+ /**
1434
+ * @param {FolderView} folder_view
1435
+ * @returns {Folder}
1436
+ */
1437
+ encrypt(folder_view) {
1438
+ try {
1439
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1440
+ wasm.foldersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(folder_view));
1441
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1442
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1443
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1444
+ if (r2) {
1445
+ throw takeObject(r1);
1446
+ }
1447
+ return takeObject(r0);
1448
+ } finally {
1449
+ wasm.__wbindgen_add_to_stack_pointer(16);
1450
+ }
1451
+ }
1452
+ /**
1453
+ * @param {Folder} folder
1454
+ * @returns {FolderView}
1455
+ */
1456
+ decrypt(folder) {
1457
+ try {
1458
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1459
+ wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1460
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1461
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1462
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1463
+ if (r2) {
1464
+ throw takeObject(r1);
1465
+ }
1466
+ return takeObject(r0);
1467
+ } finally {
1468
+ wasm.__wbindgen_add_to_stack_pointer(16);
1469
+ }
1470
+ }
1471
+ /**
1472
+ * @param {Folder[]} folders
1473
+ * @returns {FolderView[]}
1474
+ */
1475
+ decrypt_list(folders) {
1476
+ try {
1477
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1478
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1479
+ const len0 = WASM_VECTOR_LEN;
1480
+ wasm.foldersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1481
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1482
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1483
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1484
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1485
+ if (r3) {
1486
+ throw takeObject(r2);
1487
+ }
1488
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1489
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1490
+ return v2;
1491
+ } finally {
1492
+ wasm.__wbindgen_add_to_stack_pointer(16);
1493
+ }
1494
+ }
1495
+ }
1496
+ module.exports.FoldersClient = FoldersClient;
1497
+
1498
+ const GeneratorClientFinalization =
1499
+ typeof FinalizationRegistry === "undefined"
1500
+ ? { register: () => {}, unregister: () => {} }
1501
+ : new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
1502
+
1503
+ class GeneratorClient {
1504
+ static __wrap(ptr) {
1505
+ ptr = ptr >>> 0;
1506
+ const obj = Object.create(GeneratorClient.prototype);
1507
+ obj.__wbg_ptr = ptr;
1508
+ GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
1509
+ return obj;
1510
+ }
1511
+
1512
+ __destroy_into_raw() {
1513
+ const ptr = this.__wbg_ptr;
1514
+ this.__wbg_ptr = 0;
1515
+ GeneratorClientFinalization.unregister(this);
1516
+ return ptr;
1517
+ }
1518
+
1519
+ free() {
1520
+ const ptr = this.__destroy_into_raw();
1521
+ wasm.__wbg_generatorclient_free(ptr, 0);
1522
+ }
1523
+ /**
1524
+ * Generates a random password.
1525
+ *
1526
+ * The character sets and password length can be customized using the `input` parameter.
1527
+ *
1528
+ * # Examples
1529
+ *
1530
+ * ```
1531
+ * use bitwarden_core::Client;
1532
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PasswordGeneratorRequest};
1533
+ *
1534
+ * async fn test() -> Result<(), PassphraseError> {
1535
+ * let input = PasswordGeneratorRequest {
1536
+ * lowercase: true,
1537
+ * uppercase: true,
1538
+ * numbers: true,
1539
+ * length: 20,
1540
+ * ..Default::default()
1541
+ * };
1542
+ * let password = Client::new(None).generator().password(input).unwrap();
1543
+ * println!("{}", password);
1544
+ * Ok(())
1545
+ * }
1546
+ * ```
1547
+ * @param {PasswordGeneratorRequest} input
1548
+ * @returns {string}
1549
+ */
1550
+ password(input) {
1551
+ let deferred2_0;
1552
+ let deferred2_1;
1553
+ try {
1554
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1555
+ wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(input));
1556
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1557
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1558
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1559
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1560
+ var ptr1 = r0;
1561
+ var len1 = r1;
1562
+ if (r3) {
1563
+ ptr1 = 0;
1564
+ len1 = 0;
1565
+ throw takeObject(r2);
1566
+ }
1567
+ deferred2_0 = ptr1;
1568
+ deferred2_1 = len1;
1569
+ return getStringFromWasm0(ptr1, len1);
1570
+ } finally {
1571
+ wasm.__wbindgen_add_to_stack_pointer(16);
1572
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1573
+ }
1574
+ }
1575
+ /**
1576
+ * Generates a random passphrase.
1577
+ * A passphrase is a combination of random words separated by a character.
1578
+ * An example of passphrase is `correct horse battery staple`.
1579
+ *
1580
+ * The number of words and their case, the word separator, and the inclusion of
1581
+ * a number in the passphrase can be customized using the `input` parameter.
1582
+ *
1583
+ * # Examples
1584
+ *
1585
+ * ```
1586
+ * use bitwarden_core::Client;
1587
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PassphraseGeneratorRequest};
1588
+ *
1589
+ * async fn test() -> Result<(), PassphraseError> {
1590
+ * let input = PassphraseGeneratorRequest {
1591
+ * num_words: 4,
1592
+ * ..Default::default()
1593
+ * };
1594
+ * let passphrase = Client::new(None).generator().passphrase(input).unwrap();
1595
+ * println!("{}", passphrase);
1596
+ * Ok(())
1597
+ * }
1598
+ * ```
1599
+ * @param {PassphraseGeneratorRequest} input
1600
+ * @returns {string}
1601
+ */
1602
+ passphrase(input) {
1603
+ let deferred2_0;
1604
+ let deferred2_1;
1605
+ try {
1606
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1607
+ wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(input));
1608
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1609
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1610
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1611
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1612
+ var ptr1 = r0;
1613
+ var len1 = r1;
1614
+ if (r3) {
1615
+ ptr1 = 0;
1616
+ len1 = 0;
1617
+ throw takeObject(r2);
1618
+ }
1619
+ deferred2_0 = ptr1;
1620
+ deferred2_1 = len1;
1621
+ return getStringFromWasm0(ptr1, len1);
1622
+ } finally {
1623
+ wasm.__wbindgen_add_to_stack_pointer(16);
1624
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1625
+ }
1626
+ }
1627
+ }
1628
+ module.exports.GeneratorClient = GeneratorClient;
1629
+
1630
+ const IncomingMessageFinalization =
1631
+ typeof FinalizationRegistry === "undefined"
1632
+ ? { register: () => {}, unregister: () => {} }
1633
+ : new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
1634
+
1635
+ class IncomingMessage {
1636
+ static __wrap(ptr) {
1637
+ ptr = ptr >>> 0;
1638
+ const obj = Object.create(IncomingMessage.prototype);
1639
+ obj.__wbg_ptr = ptr;
1640
+ IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1641
+ return obj;
1642
+ }
1643
+
1644
+ __destroy_into_raw() {
1645
+ const ptr = this.__wbg_ptr;
1646
+ this.__wbg_ptr = 0;
1647
+ IncomingMessageFinalization.unregister(this);
1648
+ return ptr;
1649
+ }
1650
+
1651
+ free() {
1652
+ const ptr = this.__destroy_into_raw();
1653
+ wasm.__wbg_incomingmessage_free(ptr, 0);
1654
+ }
1655
+ /**
1656
+ * @returns {Uint8Array}
1657
+ */
1658
+ get payload() {
1659
+ try {
1660
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1661
+ wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
1662
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1663
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1664
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1665
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1666
+ return v1;
1667
+ } finally {
1668
+ wasm.__wbindgen_add_to_stack_pointer(16);
1669
+ }
1670
+ }
1671
+ /**
1672
+ * @param {Uint8Array} arg0
1673
+ */
1674
+ set payload(arg0) {
1675
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1676
+ const len0 = WASM_VECTOR_LEN;
1677
+ wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
1678
+ }
1679
+ /**
1680
+ * @returns {Endpoint}
1681
+ */
1682
+ get destination() {
1683
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1684
+ return takeObject(ret);
1685
+ }
1686
+ /**
1687
+ * @param {Endpoint} arg0
1688
+ */
1689
+ set destination(arg0) {
1690
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1691
+ }
1692
+ /**
1693
+ * @returns {Endpoint}
1694
+ */
1695
+ get source() {
1696
+ const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
1697
+ return takeObject(ret);
1698
+ }
1699
+ /**
1700
+ * @param {Endpoint} arg0
1701
+ */
1702
+ set source(arg0) {
1703
+ wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
1704
+ }
1705
+ /**
1706
+ * @returns {string | undefined}
1707
+ */
1708
+ get topic() {
1709
+ try {
1710
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1711
+ wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
1712
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1713
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1714
+ let v1;
1715
+ if (r0 !== 0) {
1716
+ v1 = getStringFromWasm0(r0, r1).slice();
1717
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1718
+ }
1719
+ return v1;
1720
+ } finally {
1721
+ wasm.__wbindgen_add_to_stack_pointer(16);
1722
+ }
1723
+ }
1724
+ /**
1725
+ * @param {string | null} [arg0]
1726
+ */
1727
+ set topic(arg0) {
1728
+ var ptr0 = isLikeNone(arg0)
1729
+ ? 0
1730
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1731
+ var len0 = WASM_VECTOR_LEN;
1732
+ wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
1733
+ }
1734
+ /**
1735
+ * @param {Uint8Array} payload
1736
+ * @param {Endpoint} destination
1737
+ * @param {Endpoint} source
1738
+ * @param {string | null} [topic]
1739
+ */
1740
+ constructor(payload, destination, source, topic) {
1741
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1742
+ const len0 = WASM_VECTOR_LEN;
1743
+ var ptr1 = isLikeNone(topic)
1744
+ ? 0
1745
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1746
+ var len1 = WASM_VECTOR_LEN;
1747
+ const ret = wasm.incomingmessage_new(
1748
+ ptr0,
1749
+ len0,
1750
+ addHeapObject(destination),
1751
+ addHeapObject(source),
1752
+ ptr1,
1753
+ len1,
1754
+ );
1755
+ this.__wbg_ptr = ret >>> 0;
1756
+ IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
1757
+ return this;
1758
+ }
1759
+ /**
1760
+ * Try to parse the payload as JSON.
1761
+ * @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
1762
+ */
1763
+ parse_payload_as_json() {
1764
+ const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
1765
+ return takeObject(ret);
1766
+ }
1767
+ }
1768
+ module.exports.IncomingMessage = IncomingMessage;
1769
+
1770
+ const IpcClientFinalization =
1771
+ typeof FinalizationRegistry === "undefined"
1772
+ ? { register: () => {}, unregister: () => {} }
1773
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
1774
+
1775
+ class IpcClient {
1776
+ __destroy_into_raw() {
1777
+ const ptr = this.__wbg_ptr;
1778
+ this.__wbg_ptr = 0;
1779
+ IpcClientFinalization.unregister(this);
1780
+ return ptr;
1781
+ }
1782
+
1783
+ free() {
1784
+ const ptr = this.__destroy_into_raw();
1785
+ wasm.__wbg_ipcclient_free(ptr, 0);
1786
+ }
1787
+ /**
1788
+ * @param {IpcCommunicationBackend} communication_provider
1789
+ */
1790
+ constructor(communication_provider) {
1791
+ _assertClass(communication_provider, IpcCommunicationBackend);
1792
+ var ptr0 = communication_provider.__destroy_into_raw();
1793
+ const ret = wasm.ipcclient_new(ptr0);
1794
+ this.__wbg_ptr = ret >>> 0;
1795
+ IpcClientFinalization.register(this, this.__wbg_ptr, this);
1796
+ return this;
1797
+ }
1798
+ /**
1799
+ * @param {OutgoingMessage} message
1800
+ * @returns {Promise<void>}
1801
+ */
1802
+ send(message) {
1803
+ _assertClass(message, OutgoingMessage);
1804
+ var ptr0 = message.__destroy_into_raw();
1805
+ const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
1806
+ return takeObject(ret);
1807
+ }
1808
+ /**
1809
+ * @returns {Promise<IpcClientSubscription>}
1810
+ */
1811
+ subscribe() {
1812
+ const ret = wasm.ipcclient_subscribe(this.__wbg_ptr);
1813
+ return takeObject(ret);
1814
+ }
1815
+ }
1816
+ module.exports.IpcClient = IpcClient;
1817
+
1818
+ const IpcClientSubscriptionFinalization =
1819
+ typeof FinalizationRegistry === "undefined"
1820
+ ? { register: () => {}, unregister: () => {} }
1821
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclientsubscription_free(ptr >>> 0, 1));
1822
+
1823
+ class IpcClientSubscription {
1824
+ static __wrap(ptr) {
1825
+ ptr = ptr >>> 0;
1826
+ const obj = Object.create(IpcClientSubscription.prototype);
1827
+ obj.__wbg_ptr = ptr;
1828
+ IpcClientSubscriptionFinalization.register(obj, obj.__wbg_ptr, obj);
1829
+ return obj;
1830
+ }
1831
+
1832
+ __destroy_into_raw() {
1833
+ const ptr = this.__wbg_ptr;
1834
+ this.__wbg_ptr = 0;
1835
+ IpcClientSubscriptionFinalization.unregister(this);
1836
+ return ptr;
1837
+ }
1838
+
1839
+ free() {
1840
+ const ptr = this.__destroy_into_raw();
1841
+ wasm.__wbg_ipcclientsubscription_free(ptr, 0);
1842
+ }
1843
+ /**
1844
+ * @returns {Promise<IncomingMessage>}
1845
+ */
1846
+ receive() {
1847
+ const ret = wasm.ipcclientsubscription_receive(this.__wbg_ptr);
1848
+ return takeObject(ret);
1849
+ }
1850
+ }
1851
+ module.exports.IpcClientSubscription = IpcClientSubscription;
1852
+
1853
+ const IpcCommunicationBackendFinalization =
1854
+ typeof FinalizationRegistry === "undefined"
1855
+ ? { register: () => {}, unregister: () => {} }
1856
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipccommunicationbackend_free(ptr >>> 0, 1));
1857
+
1858
+ class IpcCommunicationBackend {
1859
+ __destroy_into_raw() {
1860
+ const ptr = this.__wbg_ptr;
1861
+ this.__wbg_ptr = 0;
1862
+ IpcCommunicationBackendFinalization.unregister(this);
1863
+ return ptr;
1864
+ }
1865
+
1866
+ free() {
1867
+ const ptr = this.__destroy_into_raw();
1868
+ wasm.__wbg_ipccommunicationbackend_free(ptr, 0);
1869
+ }
1870
+ /**
1871
+ * @param {IpcCommunicationBackendSender} sender
1872
+ */
1873
+ constructor(sender) {
1874
+ const ret = wasm.ipccommunicationbackend_new(addHeapObject(sender));
1875
+ this.__wbg_ptr = ret >>> 0;
1876
+ IpcCommunicationBackendFinalization.register(this, this.__wbg_ptr, this);
1877
+ return this;
1878
+ }
1879
+ /**
1880
+ * JavaScript function to provide a received message to the backend/IPC framework.
1881
+ * @param {IncomingMessage} message
1882
+ */
1883
+ deliver_message(message) {
1884
+ try {
1885
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1886
+ _assertClass(message, IncomingMessage);
1887
+ var ptr0 = message.__destroy_into_raw();
1888
+ wasm.ipccommunicationbackend_deliver_message(retptr, this.__wbg_ptr, ptr0);
1889
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1890
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1891
+ if (r1) {
1892
+ throw takeObject(r0);
1893
+ }
1894
+ } finally {
1895
+ wasm.__wbindgen_add_to_stack_pointer(16);
1896
+ }
1897
+ }
1898
+ }
1899
+ module.exports.IpcCommunicationBackend = IpcCommunicationBackend;
1900
+
1901
+ const OutgoingMessageFinalization =
1902
+ typeof FinalizationRegistry === "undefined"
1903
+ ? { register: () => {}, unregister: () => {} }
1904
+ : new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
1905
+
1906
+ class OutgoingMessage {
1907
+ static __wrap(ptr) {
1908
+ ptr = ptr >>> 0;
1909
+ const obj = Object.create(OutgoingMessage.prototype);
1910
+ obj.__wbg_ptr = ptr;
1911
+ OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1912
+ return obj;
1913
+ }
1914
+
1915
+ __destroy_into_raw() {
1916
+ const ptr = this.__wbg_ptr;
1917
+ this.__wbg_ptr = 0;
1918
+ OutgoingMessageFinalization.unregister(this);
1919
+ return ptr;
1920
+ }
1921
+
1922
+ free() {
1923
+ const ptr = this.__destroy_into_raw();
1924
+ wasm.__wbg_outgoingmessage_free(ptr, 0);
1925
+ }
1926
+ /**
1927
+ * @returns {Uint8Array}
1928
+ */
1929
+ get payload() {
1930
+ try {
1931
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1932
+ wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
1933
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1934
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1935
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1936
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1937
+ return v1;
1938
+ } finally {
1939
+ wasm.__wbindgen_add_to_stack_pointer(16);
1940
+ }
1941
+ }
1942
+ /**
1943
+ * @param {Uint8Array} arg0
1944
+ */
1945
+ set payload(arg0) {
1946
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1947
+ const len0 = WASM_VECTOR_LEN;
1948
+ wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
1949
+ }
1950
+ /**
1951
+ * @returns {Endpoint}
1952
+ */
1953
+ get destination() {
1954
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1955
+ return takeObject(ret);
1956
+ }
1957
+ /**
1958
+ * @param {Endpoint} arg0
1959
+ */
1960
+ set destination(arg0) {
1961
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1962
+ }
1963
+ /**
1964
+ * @returns {string | undefined}
1965
+ */
1966
+ get topic() {
1967
+ try {
1968
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1969
+ wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
1970
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1971
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1972
+ let v1;
1973
+ if (r0 !== 0) {
1974
+ v1 = getStringFromWasm0(r0, r1).slice();
1975
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1976
+ }
1977
+ return v1;
1978
+ } finally {
1979
+ wasm.__wbindgen_add_to_stack_pointer(16);
1980
+ }
1981
+ }
1982
+ /**
1983
+ * @param {string | null} [arg0]
1984
+ */
1985
+ set topic(arg0) {
1986
+ var ptr0 = isLikeNone(arg0)
1987
+ ? 0
1988
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1989
+ var len0 = WASM_VECTOR_LEN;
1990
+ wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
1991
+ }
1992
+ /**
1993
+ * @param {Uint8Array} payload
1994
+ * @param {Endpoint} destination
1995
+ * @param {string | null} [topic]
1996
+ */
1997
+ constructor(payload, destination, topic) {
1998
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1999
+ const len0 = WASM_VECTOR_LEN;
2000
+ var ptr1 = isLikeNone(topic)
2001
+ ? 0
2002
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2003
+ var len1 = WASM_VECTOR_LEN;
2004
+ const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
2005
+ this.__wbg_ptr = ret >>> 0;
2006
+ OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
2007
+ return this;
2008
+ }
2009
+ /**
2010
+ * Create a new message and encode the payload as JSON.
2011
+ * @param {any} payload
2012
+ * @param {Endpoint} destination
2013
+ * @param {string | null} [topic]
2014
+ * @returns {OutgoingMessage}
2015
+ */
2016
+ static new_json_payload(payload, destination, topic) {
2017
+ try {
2018
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2019
+ var ptr0 = isLikeNone(topic)
2020
+ ? 0
2021
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2022
+ var len0 = WASM_VECTOR_LEN;
2023
+ wasm.outgoingmessage_new_json_payload(
2024
+ retptr,
2025
+ addHeapObject(payload),
2026
+ addHeapObject(destination),
2027
+ ptr0,
2028
+ len0,
2029
+ );
2030
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2031
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2032
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2033
+ if (r2) {
2034
+ throw takeObject(r1);
2035
+ }
2036
+ return OutgoingMessage.__wrap(r0);
2037
+ } finally {
2038
+ wasm.__wbindgen_add_to_stack_pointer(16);
2039
+ }
2040
+ }
2041
+ }
2042
+ module.exports.OutgoingMessage = OutgoingMessage;
2043
+
2044
+ const PureCryptoFinalization =
2045
+ typeof FinalizationRegistry === "undefined"
2046
+ ? { register: () => {}, unregister: () => {} }
2047
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
2048
+ /**
2049
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
2050
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
2051
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
2052
+ * responsible for state and keys.
2053
+ */
2054
+ class PureCrypto {
2055
+ __destroy_into_raw() {
2056
+ const ptr = this.__wbg_ptr;
2057
+ this.__wbg_ptr = 0;
2058
+ PureCryptoFinalization.unregister(this);
2059
+ return ptr;
2060
+ }
2061
+
2062
+ free() {
2063
+ const ptr = this.__destroy_into_raw();
2064
+ wasm.__wbg_purecrypto_free(ptr, 0);
2065
+ }
2066
+ /**
2067
+ * DEPRECATED: Use `symmetric_decrypt_string` instead.
2068
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2069
+ * @param {string} enc_string
2070
+ * @param {Uint8Array} key
2071
+ * @returns {string}
2072
+ */
2073
+ static symmetric_decrypt(enc_string, key) {
2074
+ let deferred4_0;
2075
+ let deferred4_1;
2076
+ try {
2077
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2078
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2079
+ const len0 = WASM_VECTOR_LEN;
2080
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2081
+ const len1 = WASM_VECTOR_LEN;
2082
+ wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
2083
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2084
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2085
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2086
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2087
+ var ptr3 = r0;
2088
+ var len3 = r1;
2089
+ if (r3) {
2090
+ ptr3 = 0;
2091
+ len3 = 0;
2092
+ throw takeObject(r2);
2093
+ }
2094
+ deferred4_0 = ptr3;
2095
+ deferred4_1 = len3;
2096
+ return getStringFromWasm0(ptr3, len3);
2097
+ } finally {
2098
+ wasm.__wbindgen_add_to_stack_pointer(16);
2099
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2100
+ }
2101
+ }
2102
+ /**
2103
+ * @param {string} enc_string
2104
+ * @param {Uint8Array} key
2105
+ * @returns {string}
2106
+ */
2107
+ static symmetric_decrypt_string(enc_string, key) {
2108
+ let deferred4_0;
2109
+ let deferred4_1;
2110
+ try {
2111
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2112
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2113
+ const len0 = WASM_VECTOR_LEN;
2114
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2115
+ const len1 = WASM_VECTOR_LEN;
2116
+ wasm.purecrypto_symmetric_decrypt_string(retptr, ptr0, len0, ptr1, len1);
2117
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2118
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2119
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2120
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2121
+ var ptr3 = r0;
2122
+ var len3 = r1;
2123
+ if (r3) {
2124
+ ptr3 = 0;
2125
+ len3 = 0;
2126
+ throw takeObject(r2);
2127
+ }
2128
+ deferred4_0 = ptr3;
2129
+ deferred4_1 = len3;
2130
+ return getStringFromWasm0(ptr3, len3);
2131
+ } finally {
2132
+ wasm.__wbindgen_add_to_stack_pointer(16);
2133
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2134
+ }
2135
+ }
2136
+ /**
2137
+ * @param {string} enc_string
2138
+ * @param {Uint8Array} key
2139
+ * @returns {Uint8Array}
2140
+ */
2141
+ static symmetric_decrypt_bytes(enc_string, key) {
2142
+ try {
2143
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2144
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2145
+ const len0 = WASM_VECTOR_LEN;
2146
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2147
+ const len1 = WASM_VECTOR_LEN;
2148
+ wasm.purecrypto_symmetric_decrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2149
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2150
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2151
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2152
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2153
+ if (r3) {
2154
+ throw takeObject(r2);
2155
+ }
2156
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2157
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2158
+ return v3;
2159
+ } finally {
2160
+ wasm.__wbindgen_add_to_stack_pointer(16);
2161
+ }
2162
+ }
2163
+ /**
2164
+ * DEPRECATED: Use `symmetric_decrypt_filedata` instead.
2165
+ * Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
2166
+ * @param {Uint8Array} enc_bytes
2167
+ * @param {Uint8Array} key
2168
+ * @returns {Uint8Array}
2169
+ */
2170
+ static symmetric_decrypt_array_buffer(enc_bytes, key) {
2171
+ try {
2172
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2173
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2174
+ const len0 = WASM_VECTOR_LEN;
2175
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2176
+ const len1 = WASM_VECTOR_LEN;
2177
+ wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
2178
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2179
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2180
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2181
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2182
+ if (r3) {
2183
+ throw takeObject(r2);
2184
+ }
2185
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2186
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2187
+ return v3;
2188
+ } finally {
2189
+ wasm.__wbindgen_add_to_stack_pointer(16);
2190
+ }
2191
+ }
2192
+ /**
2193
+ * @param {Uint8Array} enc_bytes
2194
+ * @param {Uint8Array} key
2195
+ * @returns {Uint8Array}
2196
+ */
2197
+ static symmetric_decrypt_filedata(enc_bytes, key) {
2198
+ try {
2199
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2200
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
2201
+ const len0 = WASM_VECTOR_LEN;
2202
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2203
+ const len1 = WASM_VECTOR_LEN;
2204
+ wasm.purecrypto_symmetric_decrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2205
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2206
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2207
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2208
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2209
+ if (r3) {
2210
+ throw takeObject(r2);
2211
+ }
2212
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2213
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2214
+ return v3;
2215
+ } finally {
2216
+ wasm.__wbindgen_add_to_stack_pointer(16);
2217
+ }
2218
+ }
2219
+ /**
2220
+ * @param {string} plain
2221
+ * @param {Uint8Array} key
2222
+ * @returns {string}
2223
+ */
2224
+ static symmetric_encrypt_string(plain, key) {
2225
+ let deferred4_0;
2226
+ let deferred4_1;
2227
+ try {
2228
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2229
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2230
+ const len0 = WASM_VECTOR_LEN;
2231
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2232
+ const len1 = WASM_VECTOR_LEN;
2233
+ wasm.purecrypto_symmetric_encrypt_string(retptr, ptr0, len0, ptr1, len1);
2234
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2235
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2236
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2237
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2238
+ var ptr3 = r0;
2239
+ var len3 = r1;
2240
+ if (r3) {
2241
+ ptr3 = 0;
2242
+ len3 = 0;
2243
+ throw takeObject(r2);
2244
+ }
2245
+ deferred4_0 = ptr3;
2246
+ deferred4_1 = len3;
2247
+ return getStringFromWasm0(ptr3, len3);
2248
+ } finally {
2249
+ wasm.__wbindgen_add_to_stack_pointer(16);
2250
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2251
+ }
2252
+ }
2253
+ /**
2254
+ * @param {Uint8Array} plain
2255
+ * @param {Uint8Array} key
2256
+ * @returns {string}
2257
+ */
2258
+ static symmetric_encrypt_bytes(plain, key) {
2259
+ let deferred4_0;
2260
+ let deferred4_1;
2261
+ try {
2262
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2263
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2264
+ const len0 = WASM_VECTOR_LEN;
2265
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2266
+ const len1 = WASM_VECTOR_LEN;
2267
+ wasm.purecrypto_symmetric_encrypt_bytes(retptr, ptr0, len0, ptr1, len1);
2268
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2269
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2270
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2271
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2272
+ var ptr3 = r0;
2273
+ var len3 = r1;
2274
+ if (r3) {
2275
+ ptr3 = 0;
2276
+ len3 = 0;
2277
+ throw takeObject(r2);
2278
+ }
2279
+ deferred4_0 = ptr3;
2280
+ deferred4_1 = len3;
2281
+ return getStringFromWasm0(ptr3, len3);
2282
+ } finally {
2283
+ wasm.__wbindgen_add_to_stack_pointer(16);
2284
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2285
+ }
2286
+ }
2287
+ /**
2288
+ * @param {Uint8Array} plain
2289
+ * @param {Uint8Array} key
2290
+ * @returns {Uint8Array}
2291
+ */
2292
+ static symmetric_encrypt_filedata(plain, key) {
2293
+ try {
2294
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2295
+ const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
2296
+ const len0 = WASM_VECTOR_LEN;
2297
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2298
+ const len1 = WASM_VECTOR_LEN;
2299
+ wasm.purecrypto_symmetric_encrypt_filedata(retptr, ptr0, len0, ptr1, len1);
2300
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2301
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2302
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2303
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2304
+ if (r3) {
2305
+ throw takeObject(r2);
2306
+ }
2307
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2308
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2309
+ return v3;
2310
+ } finally {
2311
+ wasm.__wbindgen_add_to_stack_pointer(16);
2312
+ }
2313
+ }
2314
+ /**
2315
+ * @param {string} encrypted_user_key
2316
+ * @param {string} master_password
2317
+ * @param {string} email
2318
+ * @param {Kdf} kdf
2319
+ * @returns {Uint8Array}
2320
+ */
2321
+ static decrypt_user_key_with_master_password(encrypted_user_key, master_password, email, kdf) {
2322
+ try {
2323
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2324
+ const ptr0 = passStringToWasm0(
2325
+ encrypted_user_key,
2326
+ wasm.__wbindgen_malloc,
2327
+ wasm.__wbindgen_realloc,
2328
+ );
2329
+ const len0 = WASM_VECTOR_LEN;
2330
+ const ptr1 = passStringToWasm0(
2331
+ master_password,
2332
+ wasm.__wbindgen_malloc,
2333
+ wasm.__wbindgen_realloc,
2334
+ );
2335
+ const len1 = WASM_VECTOR_LEN;
2336
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2337
+ const len2 = WASM_VECTOR_LEN;
2338
+ wasm.purecrypto_decrypt_user_key_with_master_password(
2339
+ retptr,
2340
+ ptr0,
2341
+ len0,
2342
+ ptr1,
2343
+ len1,
2344
+ ptr2,
2345
+ len2,
2346
+ addHeapObject(kdf),
2347
+ );
2348
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2349
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2350
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2351
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2352
+ if (r3) {
2353
+ throw takeObject(r2);
2354
+ }
2355
+ var v4 = getArrayU8FromWasm0(r0, r1).slice();
2356
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2357
+ return v4;
2358
+ } finally {
2359
+ wasm.__wbindgen_add_to_stack_pointer(16);
2360
+ }
2361
+ }
2362
+ /**
2363
+ * @param {Uint8Array} user_key
2364
+ * @param {string} master_password
2365
+ * @param {string} email
2366
+ * @param {Kdf} kdf
2367
+ * @returns {string}
2368
+ */
2369
+ static encrypt_user_key_with_master_password(user_key, master_password, email, kdf) {
2370
+ let deferred5_0;
2371
+ let deferred5_1;
2372
+ try {
2373
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2374
+ const ptr0 = passArray8ToWasm0(user_key, wasm.__wbindgen_malloc);
2375
+ const len0 = WASM_VECTOR_LEN;
2376
+ const ptr1 = passStringToWasm0(
2377
+ master_password,
2378
+ wasm.__wbindgen_malloc,
2379
+ wasm.__wbindgen_realloc,
2380
+ );
2381
+ const len1 = WASM_VECTOR_LEN;
2382
+ const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2383
+ const len2 = WASM_VECTOR_LEN;
2384
+ wasm.purecrypto_encrypt_user_key_with_master_password(
2385
+ retptr,
2386
+ ptr0,
2387
+ len0,
2388
+ ptr1,
2389
+ len1,
2390
+ ptr2,
2391
+ len2,
2392
+ addHeapObject(kdf),
2393
+ );
2394
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2395
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2396
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2397
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2398
+ var ptr4 = r0;
2399
+ var len4 = r1;
2400
+ if (r3) {
2401
+ ptr4 = 0;
2402
+ len4 = 0;
2403
+ throw takeObject(r2);
2404
+ }
2405
+ deferred5_0 = ptr4;
2406
+ deferred5_1 = len4;
2407
+ return getStringFromWasm0(ptr4, len4);
2408
+ } finally {
2409
+ wasm.__wbindgen_add_to_stack_pointer(16);
2410
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
2411
+ }
2412
+ }
2413
+ /**
2414
+ * @returns {Uint8Array}
2415
+ */
2416
+ static make_user_key_aes256_cbc_hmac() {
2417
+ try {
2418
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2419
+ wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
2420
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2421
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2422
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2423
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2424
+ return v1;
2425
+ } finally {
2426
+ wasm.__wbindgen_add_to_stack_pointer(16);
2427
+ }
2428
+ }
2429
+ /**
2430
+ * @returns {Uint8Array}
2431
+ */
2432
+ static make_user_key_xchacha20_poly1305() {
2433
+ try {
2434
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2435
+ wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
2436
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2437
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2438
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2439
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2440
+ return v1;
2441
+ } finally {
2442
+ wasm.__wbindgen_add_to_stack_pointer(16);
2443
+ }
363
2444
  }
364
2445
  /**
365
- * @param {ClientSettings | undefined} [settings]
366
- * @param {LogLevel | undefined} [log_level]
2446
+ * Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
2447
+ * as an EncString.
2448
+ * @param {Uint8Array} key_to_be_wrapped
2449
+ * @param {Uint8Array} wrapping_key
2450
+ * @returns {string}
367
2451
  */
368
- constructor(settings, log_level) {
369
- const ret = wasm.bitwardenclient_new(
370
- isLikeNone(settings) ? 0 : addHeapObject(settings),
371
- isLikeNone(log_level) ? 5 : log_level,
372
- );
373
- this.__wbg_ptr = ret >>> 0;
374
- BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
375
- return this;
2452
+ static wrap_symmetric_key(key_to_be_wrapped, wrapping_key) {
2453
+ let deferred4_0;
2454
+ let deferred4_1;
2455
+ try {
2456
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2457
+ const ptr0 = passArray8ToWasm0(key_to_be_wrapped, wasm.__wbindgen_malloc);
2458
+ const len0 = WASM_VECTOR_LEN;
2459
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2460
+ const len1 = WASM_VECTOR_LEN;
2461
+ wasm.purecrypto_wrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2462
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2463
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2464
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2465
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2466
+ var ptr3 = r0;
2467
+ var len3 = r1;
2468
+ if (r3) {
2469
+ ptr3 = 0;
2470
+ len3 = 0;
2471
+ throw takeObject(r2);
2472
+ }
2473
+ deferred4_0 = ptr3;
2474
+ deferred4_1 = len3;
2475
+ return getStringFromWasm0(ptr3, len3);
2476
+ } finally {
2477
+ wasm.__wbindgen_add_to_stack_pointer(16);
2478
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2479
+ }
376
2480
  }
377
2481
  /**
378
- * Test method, echoes back the input
379
- * @param {string} msg
2482
+ * Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
2483
+ * unwrapped key as a serialized byte array.
2484
+ * @param {string} wrapped_key
2485
+ * @param {Uint8Array} wrapping_key
2486
+ * @returns {Uint8Array}
2487
+ */
2488
+ static unwrap_symmetric_key(wrapped_key, wrapping_key) {
2489
+ try {
2490
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2491
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2492
+ const len0 = WASM_VECTOR_LEN;
2493
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2494
+ const len1 = WASM_VECTOR_LEN;
2495
+ wasm.purecrypto_unwrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
2496
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2497
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2498
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2499
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2500
+ if (r3) {
2501
+ throw takeObject(r2);
2502
+ }
2503
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2504
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2505
+ return v3;
2506
+ } finally {
2507
+ wasm.__wbindgen_add_to_stack_pointer(16);
2508
+ }
2509
+ }
2510
+ /**
2511
+ * Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
2512
+ * key. Note: Usually, a public key is - by definition - public, so this should not be
2513
+ * used. The specific use-case for this function is to enable rotateable key sets, where
2514
+ * the "public key" is not public, with the intent of preventing the server from being able
2515
+ * to overwrite the user key unlocked by the rotateable keyset.
2516
+ * @param {Uint8Array} encapsulation_key
2517
+ * @param {Uint8Array} wrapping_key
380
2518
  * @returns {string}
381
2519
  */
382
- echo(msg) {
383
- let deferred2_0;
384
- let deferred2_1;
2520
+ static wrap_encapsulation_key(encapsulation_key, wrapping_key) {
2521
+ let deferred4_0;
2522
+ let deferred4_1;
385
2523
  try {
386
2524
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
387
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2525
+ const ptr0 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
388
2526
  const len0 = WASM_VECTOR_LEN;
389
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
2527
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2528
+ const len1 = WASM_VECTOR_LEN;
2529
+ wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
390
2530
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
2531
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
- deferred2_0 = r0;
393
- deferred2_1 = r1;
394
- return getStringFromWasm0(r0, r1);
2532
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2533
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2534
+ var ptr3 = r0;
2535
+ var len3 = r1;
2536
+ if (r3) {
2537
+ ptr3 = 0;
2538
+ len3 = 0;
2539
+ throw takeObject(r2);
2540
+ }
2541
+ deferred4_0 = ptr3;
2542
+ deferred4_1 = len3;
2543
+ return getStringFromWasm0(ptr3, len3);
2544
+ } finally {
2545
+ wasm.__wbindgen_add_to_stack_pointer(16);
2546
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2547
+ }
2548
+ }
2549
+ /**
2550
+ * Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
2551
+ * wrapping key.
2552
+ * @param {string} wrapped_key
2553
+ * @param {Uint8Array} wrapping_key
2554
+ * @returns {Uint8Array}
2555
+ */
2556
+ static unwrap_encapsulation_key(wrapped_key, wrapping_key) {
2557
+ try {
2558
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2559
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2560
+ const len0 = WASM_VECTOR_LEN;
2561
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2562
+ const len1 = WASM_VECTOR_LEN;
2563
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2564
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2565
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2566
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2567
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2568
+ if (r3) {
2569
+ throw takeObject(r2);
2570
+ }
2571
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2572
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2573
+ return v3;
395
2574
  } finally {
396
2575
  wasm.__wbindgen_add_to_stack_pointer(16);
397
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
398
2576
  }
399
2577
  }
400
2578
  /**
2579
+ * Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
2580
+ * key,
2581
+ * @param {Uint8Array} decapsulation_key
2582
+ * @param {Uint8Array} wrapping_key
401
2583
  * @returns {string}
402
2584
  */
403
- version() {
404
- let deferred1_0;
405
- let deferred1_1;
2585
+ static wrap_decapsulation_key(decapsulation_key, wrapping_key) {
2586
+ let deferred4_0;
2587
+ let deferred4_1;
406
2588
  try {
407
2589
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
2590
+ const ptr0 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2591
+ const len0 = WASM_VECTOR_LEN;
2592
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2593
+ const len1 = WASM_VECTOR_LEN;
2594
+ wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
409
2595
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
410
2596
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
411
- deferred1_0 = r0;
412
- deferred1_1 = r1;
413
- return getStringFromWasm0(r0, r1);
2597
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2598
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2599
+ var ptr3 = r0;
2600
+ var len3 = r1;
2601
+ if (r3) {
2602
+ ptr3 = 0;
2603
+ len3 = 0;
2604
+ throw takeObject(r2);
2605
+ }
2606
+ deferred4_0 = ptr3;
2607
+ deferred4_1 = len3;
2608
+ return getStringFromWasm0(ptr3, len3);
414
2609
  } finally {
415
2610
  wasm.__wbindgen_add_to_stack_pointer(16);
416
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2611
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
417
2612
  }
418
2613
  }
419
2614
  /**
420
- * @param {string} msg
421
- * @returns {Promise<void>}
2615
+ * Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
2616
+ * wrapping key.
2617
+ * @param {string} wrapped_key
2618
+ * @param {Uint8Array} wrapping_key
2619
+ * @returns {Uint8Array}
422
2620
  */
423
- throw(msg) {
424
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
425
- const len0 = WASM_VECTOR_LEN;
426
- const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
427
- return takeObject(ret);
2621
+ static unwrap_decapsulation_key(wrapped_key, wrapping_key) {
2622
+ try {
2623
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2624
+ const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2625
+ const len0 = WASM_VECTOR_LEN;
2626
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
2627
+ const len1 = WASM_VECTOR_LEN;
2628
+ wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
2629
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2630
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2631
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2632
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2633
+ if (r3) {
2634
+ throw takeObject(r2);
2635
+ }
2636
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2637
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2638
+ return v3;
2639
+ } finally {
2640
+ wasm.__wbindgen_add_to_stack_pointer(16);
2641
+ }
428
2642
  }
429
2643
  /**
430
- * Test method, calls http endpoint
431
- * @param {string} url
432
- * @returns {Promise<string>}
2644
+ * Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
2645
+ * in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
2646
+ * the sender's authenticity cannot be verified by the recipient.
2647
+ * @param {Uint8Array} shared_key
2648
+ * @param {Uint8Array} encapsulation_key
2649
+ * @returns {string}
433
2650
  */
434
- http_get(url) {
435
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
436
- const len0 = WASM_VECTOR_LEN;
437
- const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
2651
+ static encapsulate_key_unsigned(shared_key, encapsulation_key) {
2652
+ let deferred4_0;
2653
+ let deferred4_1;
2654
+ try {
2655
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2656
+ const ptr0 = passArray8ToWasm0(shared_key, wasm.__wbindgen_malloc);
2657
+ const len0 = WASM_VECTOR_LEN;
2658
+ const ptr1 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
2659
+ const len1 = WASM_VECTOR_LEN;
2660
+ wasm.purecrypto_encapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
2661
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2662
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2663
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2664
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2665
+ var ptr3 = r0;
2666
+ var len3 = r1;
2667
+ if (r3) {
2668
+ ptr3 = 0;
2669
+ len3 = 0;
2670
+ throw takeObject(r2);
2671
+ }
2672
+ deferred4_0 = ptr3;
2673
+ deferred4_1 = len3;
2674
+ return getStringFromWasm0(ptr3, len3);
2675
+ } finally {
2676
+ wasm.__wbindgen_add_to_stack_pointer(16);
2677
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2678
+ }
2679
+ }
2680
+ /**
2681
+ * Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
2682
+ * DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
2683
+ * recipient.
2684
+ * @param {string} encapsulated_key
2685
+ * @param {Uint8Array} decapsulation_key
2686
+ * @returns {Uint8Array}
2687
+ */
2688
+ static decapsulate_key_unsigned(encapsulated_key, decapsulation_key) {
2689
+ try {
2690
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2691
+ const ptr0 = passStringToWasm0(
2692
+ encapsulated_key,
2693
+ wasm.__wbindgen_malloc,
2694
+ wasm.__wbindgen_realloc,
2695
+ );
2696
+ const len0 = WASM_VECTOR_LEN;
2697
+ const ptr1 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
2698
+ const len1 = WASM_VECTOR_LEN;
2699
+ wasm.purecrypto_decapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
2700
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2701
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2702
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2703
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2704
+ if (r3) {
2705
+ throw takeObject(r2);
2706
+ }
2707
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2708
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2709
+ return v3;
2710
+ } finally {
2711
+ wasm.__wbindgen_add_to_stack_pointer(16);
2712
+ }
2713
+ }
2714
+ }
2715
+ module.exports.PureCrypto = PureCrypto;
2716
+
2717
+ const ReceiveErrorFinalization =
2718
+ typeof FinalizationRegistry === "undefined"
2719
+ ? { register: () => {}, unregister: () => {} }
2720
+ : new FinalizationRegistry((ptr) => wasm.__wbg_receiveerror_free(ptr >>> 0, 1));
2721
+
2722
+ class ReceiveError {
2723
+ static __wrap(ptr) {
2724
+ ptr = ptr >>> 0;
2725
+ const obj = Object.create(ReceiveError.prototype);
2726
+ obj.__wbg_ptr = ptr;
2727
+ ReceiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2728
+ return obj;
2729
+ }
2730
+
2731
+ __destroy_into_raw() {
2732
+ const ptr = this.__wbg_ptr;
2733
+ this.__wbg_ptr = 0;
2734
+ ReceiveErrorFinalization.unregister(this);
2735
+ return ptr;
2736
+ }
2737
+
2738
+ free() {
2739
+ const ptr = this.__destroy_into_raw();
2740
+ wasm.__wbg_receiveerror_free(ptr, 0);
2741
+ }
2742
+ /**
2743
+ * @returns {boolean}
2744
+ */
2745
+ get timeout() {
2746
+ const ret = wasm.__wbg_get_receiveerror_timeout(this.__wbg_ptr);
2747
+ return ret !== 0;
2748
+ }
2749
+ /**
2750
+ * @param {boolean} arg0
2751
+ */
2752
+ set timeout(arg0) {
2753
+ wasm.__wbg_set_receiveerror_timeout(this.__wbg_ptr, arg0);
2754
+ }
2755
+ /**
2756
+ * @returns {any}
2757
+ */
2758
+ get crypto() {
2759
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
438
2760
  return takeObject(ret);
439
2761
  }
440
2762
  /**
441
- * @returns {ClientCrypto}
2763
+ * @param {any} arg0
442
2764
  */
443
- crypto() {
444
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
445
- return ClientCrypto.__wrap(ret);
2765
+ set crypto(arg0) {
2766
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
446
2767
  }
447
2768
  /**
448
- * @returns {ClientVault}
2769
+ * @returns {any}
449
2770
  */
450
- vault() {
451
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
452
- return ClientVault.__wrap(ret);
2771
+ get communication() {
2772
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
2773
+ return takeObject(ret);
2774
+ }
2775
+ /**
2776
+ * @param {any} arg0
2777
+ */
2778
+ set communication(arg0) {
2779
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
453
2780
  }
454
2781
  }
455
- module.exports.BitwardenClient = BitwardenClient;
2782
+ module.exports.ReceiveError = ReceiveError;
456
2783
 
457
- const ClientCryptoFinalization =
2784
+ const SendErrorFinalization =
458
2785
  typeof FinalizationRegistry === "undefined"
459
2786
  ? { register: () => {}, unregister: () => {} }
460
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
2787
+ : new FinalizationRegistry((ptr) => wasm.__wbg_senderror_free(ptr >>> 0, 1));
461
2788
 
462
- class ClientCrypto {
2789
+ class SendError {
463
2790
  static __wrap(ptr) {
464
2791
  ptr = ptr >>> 0;
465
- const obj = Object.create(ClientCrypto.prototype);
2792
+ const obj = Object.create(SendError.prototype);
466
2793
  obj.__wbg_ptr = ptr;
467
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
2794
+ SendErrorFinalization.register(obj, obj.__wbg_ptr, obj);
468
2795
  return obj;
469
2796
  }
470
2797
 
471
2798
  __destroy_into_raw() {
472
2799
  const ptr = this.__wbg_ptr;
473
2800
  this.__wbg_ptr = 0;
474
- ClientCryptoFinalization.unregister(this);
2801
+ SendErrorFinalization.unregister(this);
475
2802
  return ptr;
476
2803
  }
477
2804
 
478
2805
  free() {
479
2806
  const ptr = this.__destroy_into_raw();
480
- wasm.__wbg_clientcrypto_free(ptr, 0);
2807
+ wasm.__wbg_senderror_free(ptr, 0);
481
2808
  }
482
2809
  /**
483
- * Initialization method for the user crypto. Needs to be called before any other crypto
484
- * operations.
485
- * @param {InitUserCryptoRequest} req
486
- * @returns {Promise<void>}
2810
+ * @returns {any}
487
2811
  */
488
- initialize_user_crypto(req) {
489
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
2812
+ get crypto() {
2813
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
490
2814
  return takeObject(ret);
491
2815
  }
492
2816
  /**
493
- * Initialization method for the organization crypto. Needs to be called after
494
- * `initialize_user_crypto` but before any other crypto operations.
495
- * @param {InitOrgCryptoRequest} req
496
- * @returns {Promise<void>}
2817
+ * @param {any} arg0
497
2818
  */
498
- initialize_org_crypto(req) {
499
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
2819
+ set crypto(arg0) {
2820
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
2821
+ }
2822
+ /**
2823
+ * @returns {any}
2824
+ */
2825
+ get communication() {
2826
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
500
2827
  return takeObject(ret);
501
2828
  }
2829
+ /**
2830
+ * @param {any} arg0
2831
+ */
2832
+ set communication(arg0) {
2833
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
2834
+ }
502
2835
  }
503
- module.exports.ClientCrypto = ClientCrypto;
2836
+ module.exports.SendError = SendError;
504
2837
 
505
- const ClientFoldersFinalization =
2838
+ const TotpClientFinalization =
506
2839
  typeof FinalizationRegistry === "undefined"
507
2840
  ? { register: () => {}, unregister: () => {} }
508
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
2841
+ : new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
509
2842
 
510
- class ClientFolders {
2843
+ class TotpClient {
511
2844
  static __wrap(ptr) {
512
2845
  ptr = ptr >>> 0;
513
- const obj = Object.create(ClientFolders.prototype);
2846
+ const obj = Object.create(TotpClient.prototype);
514
2847
  obj.__wbg_ptr = ptr;
515
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
2848
+ TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
516
2849
  return obj;
517
2850
  }
518
2851
 
519
2852
  __destroy_into_raw() {
520
2853
  const ptr = this.__wbg_ptr;
521
2854
  this.__wbg_ptr = 0;
522
- ClientFoldersFinalization.unregister(this);
2855
+ TotpClientFinalization.unregister(this);
523
2856
  return ptr;
524
2857
  }
525
2858
 
526
2859
  free() {
527
2860
  const ptr = this.__destroy_into_raw();
528
- wasm.__wbg_clientfolders_free(ptr, 0);
2861
+ wasm.__wbg_totpclient_free(ptr, 0);
529
2862
  }
530
2863
  /**
531
- * Decrypt folder
532
- * @param {Folder} folder
533
- * @returns {FolderView}
2864
+ * Generates a TOTP code from a provided key
2865
+ *
2866
+ * # Arguments
2867
+ * - `key` - Can be:
2868
+ * - A base32 encoded string
2869
+ * - OTP Auth URI
2870
+ * - Steam URI
2871
+ * - `time_ms` - Optional timestamp in milliseconds
2872
+ * @param {string} key
2873
+ * @param {number | null} [time_ms]
2874
+ * @returns {TotpResponse}
534
2875
  */
535
- decrypt(folder) {
2876
+ generate_totp(key, time_ms) {
536
2877
  try {
537
2878
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
2879
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2880
+ const len0 = WASM_VECTOR_LEN;
2881
+ wasm.totpclient_generate_totp(
2882
+ retptr,
2883
+ this.__wbg_ptr,
2884
+ ptr0,
2885
+ len0,
2886
+ !isLikeNone(time_ms),
2887
+ isLikeNone(time_ms) ? 0 : time_ms,
2888
+ );
539
2889
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
540
2890
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
541
2891
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -548,214 +2898,251 @@ class ClientFolders {
548
2898
  }
549
2899
  }
550
2900
  }
551
- module.exports.ClientFolders = ClientFolders;
2901
+ module.exports.TotpClient = TotpClient;
552
2902
 
553
- const ClientVaultFinalization =
2903
+ const VaultClientFinalization =
554
2904
  typeof FinalizationRegistry === "undefined"
555
2905
  ? { register: () => {}, unregister: () => {} }
556
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
2906
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
557
2907
 
558
- class ClientVault {
2908
+ class VaultClient {
559
2909
  static __wrap(ptr) {
560
2910
  ptr = ptr >>> 0;
561
- const obj = Object.create(ClientVault.prototype);
2911
+ const obj = Object.create(VaultClient.prototype);
562
2912
  obj.__wbg_ptr = ptr;
563
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
2913
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
564
2914
  return obj;
565
2915
  }
566
2916
 
567
2917
  __destroy_into_raw() {
568
2918
  const ptr = this.__wbg_ptr;
569
2919
  this.__wbg_ptr = 0;
570
- ClientVaultFinalization.unregister(this);
2920
+ VaultClientFinalization.unregister(this);
571
2921
  return ptr;
572
2922
  }
573
2923
 
574
2924
  free() {
575
2925
  const ptr = this.__destroy_into_raw();
576
- wasm.__wbg_clientvault_free(ptr, 0);
2926
+ wasm.__wbg_vaultclient_free(ptr, 0);
2927
+ }
2928
+ /**
2929
+ * Attachment related operations.
2930
+ * @returns {AttachmentsClient}
2931
+ */
2932
+ attachments() {
2933
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2934
+ return AttachmentsClient.__wrap(ret);
2935
+ }
2936
+ /**
2937
+ * Cipher related operations.
2938
+ * @returns {CiphersClient}
2939
+ */
2940
+ ciphers() {
2941
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2942
+ return CiphersClient.__wrap(ret);
577
2943
  }
578
2944
  /**
579
- * @returns {ClientFolders}
2945
+ * Folder related operations.
2946
+ * @returns {FoldersClient}
580
2947
  */
581
2948
  folders() {
582
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
583
- return ClientFolders.__wrap(ret);
2949
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2950
+ return FoldersClient.__wrap(ret);
2951
+ }
2952
+ /**
2953
+ * TOTP related operations.
2954
+ * @returns {TotpClient}
2955
+ */
2956
+ totp() {
2957
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2958
+ return TotpClient.__wrap(ret);
584
2959
  }
585
2960
  }
586
- module.exports.ClientVault = ClientVault;
587
-
588
- module.exports.__wbindgen_string_new = function (arg0, arg1) {
589
- const ret = getStringFromWasm0(arg0, arg1);
590
- return addHeapObject(ret);
591
- };
2961
+ module.exports.VaultClient = VaultClient;
592
2962
 
593
- module.exports.__wbg_get_ef828680c64da212 = function () {
594
- return handleError(function (arg0, arg1) {
595
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
596
- return addHeapObject(ret);
597
- }, arguments);
2963
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
2964
+ const ret = String(getObject(arg1));
2965
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2966
+ const len1 = WASM_VECTOR_LEN;
2967
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2968
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
598
2969
  };
599
2970
 
600
- module.exports.__wbindgen_object_drop_ref = function (arg0) {
601
- takeObject(arg0);
2971
+ module.exports.__wbg_abort_410ec47a64ac6117 = function (arg0, arg1) {
2972
+ getObject(arg0).abort(getObject(arg1));
602
2973
  };
603
2974
 
604
- module.exports.__wbindgen_string_get = function (arg0, arg1) {
605
- const obj = getObject(arg1);
606
- const ret = typeof obj === "string" ? obj : undefined;
607
- var ptr1 = isLikeNone(ret)
608
- ? 0
609
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
610
- var len1 = WASM_VECTOR_LEN;
611
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
612
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2975
+ module.exports.__wbg_abort_775ef1d17fc65868 = function (arg0) {
2976
+ getObject(arg0).abort();
613
2977
  };
614
2978
 
615
- module.exports.__wbg_new_fe19e4f3db5c3999 = function (arg0, arg1) {
616
- let deferred0_0;
617
- let deferred0_1;
618
- try {
619
- deferred0_0 = arg0;
620
- deferred0_1 = arg1;
621
- const ret = new Error(getStringFromWasm0(arg0, arg1));
622
- return addHeapObject(ret);
623
- } finally {
624
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
625
- }
2979
+ module.exports.__wbg_append_299d5d48292c0495 = function () {
2980
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2981
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2982
+ }, arguments);
626
2983
  };
627
2984
 
628
- module.exports.__wbg_setname_46d623c31ae39910 = function (arg0, arg1, arg2) {
629
- let deferred0_0;
630
- let deferred0_1;
631
- try {
632
- deferred0_0 = arg1;
633
- deferred0_1 = arg2;
634
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
635
- } finally {
636
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
637
- }
2985
+ module.exports.__wbg_append_8c7dd8d641a5f01b = function () {
2986
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2987
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2988
+ }, arguments);
638
2989
  };
639
2990
 
640
- module.exports.__wbg_setvariant_262a12673324f71b = function (arg0, arg1, arg2) {
641
- let deferred0_0;
642
- let deferred0_1;
643
- try {
644
- deferred0_0 = arg1;
645
- deferred0_1 = arg2;
646
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
647
- } finally {
648
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
649
- }
2991
+ module.exports.__wbg_append_b2d1fc16de2a0e81 = function () {
2992
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
2993
+ getObject(arg0).append(
2994
+ getStringFromWasm0(arg1, arg2),
2995
+ getObject(arg3),
2996
+ getStringFromWasm0(arg4, arg5),
2997
+ );
2998
+ }, arguments);
650
2999
  };
651
3000
 
652
- module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
653
- const ret = getObject(arg0) == getObject(arg1);
654
- return ret;
3001
+ module.exports.__wbg_append_b44785ebeb668479 = function () {
3002
+ return handleError(function (arg0, arg1, arg2, arg3) {
3003
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
3004
+ }, arguments);
655
3005
  };
656
3006
 
657
- module.exports.__wbindgen_is_object = function (arg0) {
658
- const val = getObject(arg0);
659
- const ret = typeof val === "object" && val !== null;
660
- return ret;
3007
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
3008
+ const ret = getObject(arg0).buffer;
3009
+ return addHeapObject(ret);
661
3010
  };
662
3011
 
663
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
664
- const ret = getObject(arg0)[getObject(arg1)];
665
- return addHeapObject(ret);
3012
+ module.exports.__wbg_call_672a4d21634d4a24 = function () {
3013
+ return handleError(function (arg0, arg1) {
3014
+ const ret = getObject(arg0).call(getObject(arg1));
3015
+ return addHeapObject(ret);
3016
+ }, arguments);
666
3017
  };
667
3018
 
668
- module.exports.__wbindgen_is_undefined = function (arg0) {
669
- const ret = getObject(arg0) === undefined;
670
- return ret;
3019
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
3020
+ return handleError(function (arg0, arg1, arg2) {
3021
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
3022
+ return addHeapObject(ret);
3023
+ }, arguments);
671
3024
  };
672
3025
 
673
- module.exports.__wbindgen_in = function (arg0, arg1) {
674
- const ret = getObject(arg0) in getObject(arg1);
675
- return ret;
3026
+ module.exports.__wbg_clearTimeout_86721db0036bea98 = function (arg0) {
3027
+ const ret = clearTimeout(takeObject(arg0));
3028
+ return addHeapObject(ret);
676
3029
  };
677
3030
 
678
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function (arg0) {
679
- const ret = Number.isSafeInteger(getObject(arg0));
680
- return ret;
3031
+ module.exports.__wbg_crypto_574e78ad8b13b65f = function (arg0) {
3032
+ const ret = getObject(arg0).crypto;
3033
+ return addHeapObject(ret);
681
3034
  };
682
3035
 
683
- module.exports.__wbindgen_as_number = function (arg0) {
684
- const ret = +getObject(arg0);
685
- return ret;
3036
+ module.exports.__wbg_debug_e17b51583ca6a632 = function (arg0, arg1, arg2, arg3) {
3037
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
686
3038
  };
687
3039
 
688
- module.exports.__wbindgen_is_string = function (arg0) {
689
- const ret = typeof getObject(arg0) === "string";
3040
+ module.exports.__wbg_done_769e5ede4b31c67b = function (arg0) {
3041
+ const ret = getObject(arg0).done;
690
3042
  return ret;
691
3043
  };
692
3044
 
693
- module.exports.__wbg_entries_c02034de337d3ee2 = function (arg0) {
3045
+ module.exports.__wbg_entries_3265d4158b33e5dc = function (arg0) {
694
3046
  const ret = Object.entries(getObject(arg0));
695
3047
  return addHeapObject(ret);
696
3048
  };
697
3049
 
698
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function (arg0) {
699
- const ret = getObject(arg0).length;
700
- return ret;
3050
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
3051
+ let deferred0_0;
3052
+ let deferred0_1;
3053
+ try {
3054
+ deferred0_0 = arg0;
3055
+ deferred0_1 = arg1;
3056
+ console.error(getStringFromWasm0(arg0, arg1));
3057
+ } finally {
3058
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3059
+ }
701
3060
  };
702
3061
 
703
- module.exports.__wbg_get_5419cf6b954aa11d = function (arg0, arg1) {
704
- const ret = getObject(arg0)[arg1 >>> 0];
3062
+ module.exports.__wbg_error_80de38b3f7cc3c3c = function (arg0, arg1, arg2, arg3) {
3063
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3064
+ };
3065
+
3066
+ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
3067
+ const ret = getObject(arg0).fetch(getObject(arg1));
705
3068
  return addHeapObject(ret);
706
3069
  };
707
3070
 
708
- module.exports.__wbg_new_e69b5f66fda8f13c = function () {
709
- const ret = new Object();
3071
+ module.exports.__wbg_fetch_d36a73832f0a45e8 = function (arg0) {
3072
+ const ret = fetch(getObject(arg0));
710
3073
  return addHeapObject(ret);
711
3074
  };
712
3075
 
713
- module.exports.__wbg_setmethod_ce2da76000b02f6a = function (arg0, arg1, arg2) {
714
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
3076
+ module.exports.__wbg_getRandomValues_3d90134a348e46b3 = function () {
3077
+ return handleError(function (arg0, arg1) {
3078
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
3079
+ }, arguments);
715
3080
  };
716
3081
 
717
- module.exports.__wbg_new_a9ae04a5200606a5 = function () {
718
- return handleError(function () {
719
- const ret = new Headers();
3082
+ module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function () {
3083
+ return handleError(function (arg0, arg1) {
3084
+ getObject(arg0).getRandomValues(getObject(arg1));
3085
+ }, arguments);
3086
+ };
3087
+
3088
+ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
3089
+ const ret = getObject(arg0).getTime();
3090
+ return ret;
3091
+ };
3092
+
3093
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
3094
+ return handleError(function (arg0, arg1) {
3095
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
720
3096
  return addHeapObject(ret);
721
3097
  }, arguments);
722
3098
  };
723
3099
 
724
- module.exports.__wbg_setheaders_f5205d36e423a544 = function (arg0, arg1) {
725
- getObject(arg0).headers = getObject(arg1);
3100
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
3101
+ const ret = getObject(arg0)[arg1 >>> 0];
3102
+ return addHeapObject(ret);
726
3103
  };
727
3104
 
728
- module.exports.__wbg_setmode_4919fd636102c586 = function (arg0, arg1) {
729
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
3105
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
3106
+ const ret = getObject(arg0)[getObject(arg1)];
3107
+ return addHeapObject(ret);
730
3108
  };
731
3109
 
732
- module.exports.__wbg_setcredentials_a4e661320cdb9738 = function (arg0, arg1) {
733
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
3110
+ module.exports.__wbg_has_a5ea9117f258a0ec = function () {
3111
+ return handleError(function (arg0, arg1) {
3112
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
3113
+ return ret;
3114
+ }, arguments);
734
3115
  };
735
3116
 
736
- module.exports.__wbg_setbody_aa8b691bec428bf4 = function (arg0, arg1) {
737
- getObject(arg0).body = getObject(arg1);
3117
+ module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
3118
+ const ret = getObject(arg0).headers;
3119
+ return addHeapObject(ret);
738
3120
  };
739
3121
 
740
- module.exports.__wbg_signal_9acfcec9e7dffc22 = function (arg0) {
741
- const ret = getObject(arg0).signal;
3122
+ module.exports.__wbg_incomingmessage_new = function (arg0) {
3123
+ const ret = IncomingMessage.__wrap(arg0);
742
3124
  return addHeapObject(ret);
743
3125
  };
744
3126
 
745
- module.exports.__wbg_setsignal_812ccb8269a7fd90 = function (arg0, arg1) {
746
- getObject(arg0).signal = getObject(arg1);
3127
+ module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
3128
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
747
3129
  };
748
3130
 
749
- module.exports.__wbg_append_8b3e7f74a47ea7d5 = function () {
750
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
751
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
752
- }, arguments);
3131
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
3132
+ let result;
3133
+ try {
3134
+ result = getObject(arg0) instanceof ArrayBuffer;
3135
+ } catch (_) {
3136
+ result = false;
3137
+ }
3138
+ const ret = result;
3139
+ return ret;
753
3140
  };
754
3141
 
755
- module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
3142
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function (arg0) {
756
3143
  let result;
757
3144
  try {
758
- result = getObject(arg0) instanceof Response;
3145
+ result = getObject(arg0) instanceof Map;
759
3146
  } catch (_) {
760
3147
  result = false;
761
3148
  }
@@ -763,94 +3150,87 @@ module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
763
3150
  return ret;
764
3151
  };
765
3152
 
766
- module.exports.__wbg_status_5f4e900d22140a18 = function (arg0) {
767
- const ret = getObject(arg0).status;
3153
+ module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
3154
+ let result;
3155
+ try {
3156
+ result = getObject(arg0) instanceof Response;
3157
+ } catch (_) {
3158
+ result = false;
3159
+ }
3160
+ const ret = result;
768
3161
  return ret;
769
3162
  };
770
3163
 
771
- module.exports.__wbg_url_58af972663531d16 = function (arg0, arg1) {
772
- const ret = getObject(arg1).url;
773
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
- const len1 = WASM_VECTOR_LEN;
775
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
776
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3164
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
3165
+ let result;
3166
+ try {
3167
+ result = getObject(arg0) instanceof Uint8Array;
3168
+ } catch (_) {
3169
+ result = false;
3170
+ }
3171
+ const ret = result;
3172
+ return ret;
777
3173
  };
778
3174
 
779
- module.exports.__wbg_headers_1b9bf90c73fae600 = function (arg0) {
780
- const ret = getObject(arg0).headers;
3175
+ module.exports.__wbg_ipcclientsubscription_new = function (arg0) {
3176
+ const ret = IpcClientSubscription.__wrap(arg0);
781
3177
  return addHeapObject(ret);
782
3178
  };
783
3179
 
784
- module.exports.__wbg_next_b06e115d1b01e10b = function () {
785
- return handleError(function (arg0) {
786
- const ret = getObject(arg0).next();
787
- return addHeapObject(ret);
788
- }, arguments);
3180
+ module.exports.__wbg_isArray_a1eab7e0d067391b = function (arg0) {
3181
+ const ret = Array.isArray(getObject(arg0));
3182
+ return ret;
789
3183
  };
790
3184
 
791
- module.exports.__wbg_done_983b5ffcaec8c583 = function (arg0) {
792
- const ret = getObject(arg0).done;
3185
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
3186
+ const ret = Number.isSafeInteger(getObject(arg0));
793
3187
  return ret;
794
3188
  };
795
3189
 
796
- module.exports.__wbg_value_2ab8a198c834c26a = function (arg0) {
797
- const ret = getObject(arg0).value;
3190
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function () {
3191
+ const ret = Symbol.iterator;
798
3192
  return addHeapObject(ret);
799
3193
  };
800
3194
 
801
- module.exports.__wbg_stringify_eead5648c09faaf8 = function () {
802
- return handleError(function (arg0) {
803
- const ret = JSON.stringify(getObject(arg0));
804
- return addHeapObject(ret);
805
- }, arguments);
806
- };
807
-
808
- module.exports.__wbg_abort_c57daab47a6c1215 = function (arg0) {
809
- getObject(arg0).abort();
3195
+ module.exports.__wbg_length_a446193dc22c12f8 = function (arg0) {
3196
+ const ret = getObject(arg0).length;
3197
+ return ret;
810
3198
  };
811
3199
 
812
- module.exports.__wbg_text_ebeee8b31af4c919 = function () {
813
- return handleError(function (arg0) {
814
- const ret = getObject(arg0).text();
815
- return addHeapObject(ret);
816
- }, arguments);
3200
+ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
3201
+ const ret = getObject(arg0).length;
3202
+ return ret;
817
3203
  };
818
3204
 
819
- module.exports.__wbg_call_3bfa248576352471 = function () {
820
- return handleError(function (arg0, arg1, arg2) {
821
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
822
- return addHeapObject(ret);
823
- }, arguments);
3205
+ module.exports.__wbg_log_cad59bb680daec67 = function (arg0, arg1, arg2, arg3) {
3206
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
824
3207
  };
825
3208
 
826
- module.exports.__wbindgen_object_clone_ref = function (arg0) {
827
- const ret = getObject(arg0);
3209
+ module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function (arg0) {
3210
+ const ret = getObject(arg0).msCrypto;
828
3211
  return addHeapObject(ret);
829
3212
  };
830
3213
 
831
- module.exports.__wbindgen_cb_drop = function (arg0) {
832
- const obj = takeObject(arg0).original;
833
- if (obj.cnt-- == 1) {
834
- obj.a = 0;
835
- return true;
836
- }
837
- const ret = false;
838
- return ret;
3214
+ module.exports.__wbg_new0_f788a2397c7ca929 = function () {
3215
+ const ret = new Date();
3216
+ return addHeapObject(ret);
839
3217
  };
840
3218
 
841
- module.exports.__wbindgen_error_new = function (arg0, arg1) {
842
- const ret = new Error(getStringFromWasm0(arg0, arg1));
843
- return addHeapObject(ret);
3219
+ module.exports.__wbg_new_018dcc2d6c8c2f6a = function () {
3220
+ return handleError(function () {
3221
+ const ret = new Headers();
3222
+ return addHeapObject(ret);
3223
+ }, arguments);
844
3224
  };
845
3225
 
846
- module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
3226
+ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
847
3227
  try {
848
3228
  var state0 = { a: arg0, b: arg1 };
849
3229
  var cb0 = (arg0, arg1) => {
850
3230
  const a = state0.a;
851
3231
  state0.a = 0;
852
3232
  try {
853
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
3233
+ return __wbg_adapter_256(a, state0.b, arg0, arg1);
854
3234
  } finally {
855
3235
  state0.a = a;
856
3236
  }
@@ -862,287 +3242,343 @@ module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
862
3242
  }
863
3243
  };
864
3244
 
865
- module.exports.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
866
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3245
+ module.exports.__wbg_new_405e22f390576ce2 = function () {
3246
+ const ret = new Object();
3247
+ return addHeapObject(ret);
3248
+ };
3249
+
3250
+ module.exports.__wbg_new_78feb108b6472713 = function () {
3251
+ const ret = new Array();
3252
+ return addHeapObject(ret);
867
3253
  };
868
3254
 
869
- module.exports.__wbg_new_abda76e883ba8a5f = function () {
3255
+ module.exports.__wbg_new_8a6f238a6ece86ea = function () {
870
3256
  const ret = new Error();
871
3257
  return addHeapObject(ret);
872
3258
  };
873
3259
 
874
- module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
875
- const ret = getObject(arg1).stack;
876
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
877
- const len1 = WASM_VECTOR_LEN;
878
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
879
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3260
+ module.exports.__wbg_new_9fd39a253424609a = function () {
3261
+ return handleError(function () {
3262
+ const ret = new FormData();
3263
+ return addHeapObject(ret);
3264
+ }, arguments);
3265
+ };
3266
+
3267
+ module.exports.__wbg_new_a12002a7f91c75be = function (arg0) {
3268
+ const ret = new Uint8Array(getObject(arg0));
3269
+ return addHeapObject(ret);
3270
+ };
3271
+
3272
+ module.exports.__wbg_new_c68d7209be747379 = function (arg0, arg1) {
3273
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3274
+ return addHeapObject(ret);
880
3275
  };
881
3276
 
882
- module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
3277
+ module.exports.__wbg_new_e25e5aab09ff45db = function () {
3278
+ return handleError(function () {
3279
+ const ret = new AbortController();
3280
+ return addHeapObject(ret);
3281
+ }, arguments);
3282
+ };
3283
+
3284
+ module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
883
3285
  let deferred0_0;
884
3286
  let deferred0_1;
885
3287
  try {
886
3288
  deferred0_0 = arg0;
887
3289
  deferred0_1 = arg1;
888
- console.error(getStringFromWasm0(arg0, arg1));
3290
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3291
+ return addHeapObject(ret);
889
3292
  } finally {
890
3293
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
891
3294
  }
892
3295
  };
893
3296
 
894
- module.exports.__wbg_crypto_1d1f22824a6a080c = function (arg0) {
895
- const ret = getObject(arg0).crypto;
3297
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) {
3298
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
896
3299
  return addHeapObject(ret);
897
3300
  };
898
3301
 
899
- module.exports.__wbg_process_4a72847cc503995b = function (arg0) {
900
- const ret = getObject(arg0).process;
3302
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
3303
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
901
3304
  return addHeapObject(ret);
902
3305
  };
903
3306
 
904
- module.exports.__wbg_versions_f686565e586dd935 = function (arg0) {
905
- const ret = getObject(arg0).versions;
3307
+ module.exports.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
3308
+ const ret = new Uint8Array(arg0 >>> 0);
3309
+ return addHeapObject(ret);
3310
+ };
3311
+
3312
+ module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function () {
3313
+ return handleError(function (arg0, arg1, arg2) {
3314
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
3315
+ return addHeapObject(ret);
3316
+ }, arguments);
3317
+ };
3318
+
3319
+ module.exports.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function () {
3320
+ return handleError(function (arg0, arg1) {
3321
+ const ret = new Blob(getObject(arg0), getObject(arg1));
3322
+ return addHeapObject(ret);
3323
+ }, arguments);
3324
+ };
3325
+
3326
+ module.exports.__wbg_next_25feadfc0913fea9 = function (arg0) {
3327
+ const ret = getObject(arg0).next;
906
3328
  return addHeapObject(ret);
907
3329
  };
908
3330
 
909
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function (arg0) {
3331
+ module.exports.__wbg_next_6574e1a8a62d1055 = function () {
3332
+ return handleError(function (arg0) {
3333
+ const ret = getObject(arg0).next();
3334
+ return addHeapObject(ret);
3335
+ }, arguments);
3336
+ };
3337
+
3338
+ module.exports.__wbg_node_905d3e251edff8a2 = function (arg0) {
910
3339
  const ret = getObject(arg0).node;
911
3340
  return addHeapObject(ret);
912
3341
  };
913
3342
 
914
- module.exports.__wbg_require_cca90b1a94a0255b = function () {
915
- return handleError(function () {
916
- const ret = module.require;
3343
+ module.exports.__wbg_parse_def2e24ef1252aff = function () {
3344
+ return handleError(function (arg0, arg1) {
3345
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
917
3346
  return addHeapObject(ret);
918
3347
  }, arguments);
919
3348
  };
920
3349
 
921
- module.exports.__wbindgen_is_function = function (arg0) {
922
- const ret = typeof getObject(arg0) === "function";
3350
+ module.exports.__wbg_process_dc0fbacc7c1c06f7 = function (arg0) {
3351
+ const ret = getObject(arg0).process;
3352
+ return addHeapObject(ret);
3353
+ };
3354
+
3355
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function (arg0, arg1) {
3356
+ const ret = getObject(arg0).push(getObject(arg1));
923
3357
  return ret;
924
3358
  };
925
3359
 
926
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function (arg0) {
927
- const ret = getObject(arg0).msCrypto;
928
- return addHeapObject(ret);
3360
+ module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function (arg0) {
3361
+ queueMicrotask(getObject(arg0));
929
3362
  };
930
3363
 
931
- module.exports.__wbg_newwithlength_76462a666eca145f = function (arg0) {
932
- const ret = new Uint8Array(arg0 >>> 0);
3364
+ module.exports.__wbg_queueMicrotask_d3219def82552485 = function (arg0) {
3365
+ const ret = getObject(arg0).queueMicrotask;
933
3366
  return addHeapObject(ret);
934
3367
  };
935
3368
 
936
- module.exports.__wbindgen_memory = function () {
937
- const ret = wasm.memory;
938
- return addHeapObject(ret);
3369
+ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
3370
+ return handleError(function (arg0, arg1) {
3371
+ getObject(arg0).randomFillSync(takeObject(arg1));
3372
+ }, arguments);
939
3373
  };
940
3374
 
941
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
942
- const ret = getObject(arg0).buffer;
3375
+ module.exports.__wbg_receiveerror_new = function (arg0) {
3376
+ const ret = ReceiveError.__wrap(arg0);
943
3377
  return addHeapObject(ret);
944
3378
  };
945
3379
 
946
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (arg0, arg1, arg2) {
947
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
3380
+ module.exports.__wbg_require_60cc747a6bc5215a = function () {
3381
+ return handleError(function () {
3382
+ const ret = module.require;
3383
+ return addHeapObject(ret);
3384
+ }, arguments);
3385
+ };
3386
+
3387
+ module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
3388
+ const ret = Promise.resolve(getObject(arg0));
948
3389
  return addHeapObject(ret);
949
3390
  };
950
3391
 
951
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function () {
3392
+ module.exports.__wbg_send_9b8fc6bb517867dd = function () {
952
3393
  return handleError(function (arg0, arg1) {
953
- getObject(arg0).randomFillSync(takeObject(arg1));
3394
+ const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
3395
+ return addHeapObject(ret);
954
3396
  }, arguments);
955
3397
  };
956
3398
 
957
- module.exports.__wbg_subarray_975a06f9dbd16995 = function (arg0, arg1, arg2) {
958
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3399
+ module.exports.__wbg_senderror_new = function (arg0) {
3400
+ const ret = SendError.__wrap(arg0);
959
3401
  return addHeapObject(ret);
960
3402
  };
961
3403
 
962
- module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function () {
963
- return handleError(function (arg0, arg1) {
964
- getObject(arg0).getRandomValues(getObject(arg1));
965
- }, arguments);
966
- };
967
-
968
- module.exports.__wbg_new_fec2611eb9180f95 = function (arg0) {
969
- const ret = new Uint8Array(getObject(arg0));
3404
+ module.exports.__wbg_setTimeout_2e707715f8cc9497 = function (arg0, arg1) {
3405
+ const ret = setTimeout(getObject(arg0), arg1);
970
3406
  return addHeapObject(ret);
971
3407
  };
972
3408
 
973
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function (arg0, arg1, arg2) {
974
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3409
+ module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
3410
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
975
3411
  };
976
3412
 
977
- module.exports.__wbg_self_bf91bf94d9e04084 = function () {
978
- return handleError(function () {
979
- const ret = self.self;
980
- return addHeapObject(ret);
981
- }, arguments);
3413
+ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
3414
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
982
3415
  };
983
3416
 
984
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function () {
985
- return handleError(function () {
986
- const ret = window.window;
987
- return addHeapObject(ret);
988
- }, arguments);
3417
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
3418
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
989
3419
  };
990
3420
 
991
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function () {
992
- return handleError(function () {
993
- const ret = globalThis.globalThis;
994
- return addHeapObject(ret);
995
- }, arguments);
3421
+ module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
3422
+ getObject(arg0).body = getObject(arg1);
996
3423
  };
997
3424
 
998
- module.exports.__wbg_global_3eca19bb09e9c484 = function () {
999
- return handleError(function () {
1000
- const ret = global.global;
1001
- return addHeapObject(ret);
1002
- }, arguments);
3425
+ module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function (arg0, arg1) {
3426
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1003
3427
  };
1004
3428
 
1005
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function (arg0, arg1) {
1006
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1007
- return addHeapObject(ret);
3429
+ module.exports.__wbg_setheaders_834c0bdb6a8949ad = function (arg0, arg1) {
3430
+ getObject(arg0).headers = getObject(arg1);
1008
3431
  };
1009
3432
 
1010
- module.exports.__wbg_call_a9ef466721e824f2 = function () {
1011
- return handleError(function (arg0, arg1) {
1012
- const ret = getObject(arg0).call(getObject(arg1));
1013
- return addHeapObject(ret);
1014
- }, arguments);
3433
+ module.exports.__wbg_setmethod_3c5280fe5d890842 = function (arg0, arg1, arg2) {
3434
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1015
3435
  };
1016
3436
 
1017
- module.exports.__wbg_iterator_695d699a44d6234c = function () {
1018
- const ret = Symbol.iterator;
1019
- return addHeapObject(ret);
3437
+ module.exports.__wbg_setmode_5dc300b865044b65 = function (arg0, arg1) {
3438
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1020
3439
  };
1021
3440
 
1022
- module.exports.__wbg_next_13b477da1eaa3897 = function (arg0) {
1023
- const ret = getObject(arg0).next;
1024
- return addHeapObject(ret);
3441
+ module.exports.__wbg_setname_c0e2d6f348c746f4 = function (arg0, arg1, arg2) {
3442
+ let deferred0_0;
3443
+ let deferred0_1;
3444
+ try {
3445
+ deferred0_0 = arg1;
3446
+ deferred0_1 = arg2;
3447
+ getObject(arg0).name = getStringFromWasm0(arg1, arg2);
3448
+ } finally {
3449
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3450
+ }
1025
3451
  };
1026
3452
 
1027
- module.exports.__wbg_new_034f913e7636e987 = function () {
1028
- const ret = new Array();
1029
- return addHeapObject(ret);
3453
+ module.exports.__wbg_setsignal_75b21ef3a81de905 = function (arg0, arg1) {
3454
+ getObject(arg0).signal = getObject(arg1);
1030
3455
  };
1031
3456
 
1032
- module.exports.__wbg_push_36cf4d81d7da33d1 = function (arg0, arg1) {
1033
- const ret = getObject(arg0).push(getObject(arg1));
1034
- return ret;
3457
+ module.exports.__wbg_settype_39ed370d3edd403c = function (arg0, arg1, arg2) {
3458
+ getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1035
3459
  };
1036
3460
 
1037
- module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function (arg0) {
1038
- let result;
3461
+ module.exports.__wbg_setvariant_d1d41b778dfe9c17 = function (arg0, arg1, arg2) {
3462
+ let deferred0_0;
3463
+ let deferred0_1;
1039
3464
  try {
1040
- result = getObject(arg0) instanceof ArrayBuffer;
1041
- } catch (_) {
1042
- result = false;
3465
+ deferred0_0 = arg1;
3466
+ deferred0_1 = arg2;
3467
+ getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
3468
+ } finally {
3469
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1043
3470
  }
1044
- const ret = result;
1045
- return ret;
1046
3471
  };
1047
3472
 
1048
- module.exports.__wbg_new_70a2f23d1565c04c = function (arg0, arg1) {
1049
- const ret = new Error(getStringFromWasm0(arg0, arg1));
3473
+ module.exports.__wbg_signal_aaf9ad74119f20a4 = function (arg0) {
3474
+ const ret = getObject(arg0).signal;
1050
3475
  return addHeapObject(ret);
1051
3476
  };
1052
3477
 
1053
- module.exports.__wbg_has_bd717f25f195f23d = function () {
1054
- return handleError(function (arg0, arg1) {
1055
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
1056
- return ret;
1057
- }, arguments);
3478
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
3479
+ const ret = getObject(arg1).stack;
3480
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3481
+ const len1 = WASM_VECTOR_LEN;
3482
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3483
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1058
3484
  };
1059
3485
 
1060
- module.exports.__wbg_resolve_0aad7c1484731c99 = function (arg0) {
1061
- const ret = Promise.resolve(getObject(arg0));
1062
- return addHeapObject(ret);
3486
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () {
3487
+ const ret = typeof global === "undefined" ? null : global;
3488
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1063
3489
  };
1064
3490
 
1065
- module.exports.__wbg_then_748f75edfb032440 = function (arg0, arg1) {
1066
- const ret = getObject(arg0).then(getObject(arg1));
1067
- return addHeapObject(ret);
3491
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () {
3492
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
3493
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1068
3494
  };
1069
3495
 
1070
- module.exports.__wbg_then_4866a7d9f55d8f3e = function (arg0, arg1, arg2) {
1071
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1072
- return addHeapObject(ret);
3496
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () {
3497
+ const ret = typeof self === "undefined" ? null : self;
3498
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1073
3499
  };
1074
3500
 
1075
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function (arg0) {
1076
- const ret = getObject(arg0).length;
1077
- return ret;
3501
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () {
3502
+ const ret = typeof window === "undefined" ? null : window;
3503
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1078
3504
  };
1079
3505
 
1080
- module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function (arg0) {
1081
- let result;
1082
- try {
1083
- result = getObject(arg0) instanceof Uint8Array;
1084
- } catch (_) {
1085
- result = false;
1086
- }
1087
- const ret = result;
3506
+ module.exports.__wbg_status_f6360336ca686bf0 = function (arg0) {
3507
+ const ret = getObject(arg0).status;
1088
3508
  return ret;
1089
3509
  };
1090
3510
 
1091
- module.exports.__wbg_new_4e7308fbedde3997 = function () {
1092
- return handleError(function () {
1093
- const ret = new FormData();
3511
+ module.exports.__wbg_stringify_f7ed6987935b4a24 = function () {
3512
+ return handleError(function (arg0) {
3513
+ const ret = JSON.stringify(getObject(arg0));
1094
3514
  return addHeapObject(ret);
1095
3515
  }, arguments);
1096
3516
  };
1097
3517
 
1098
- module.exports.__wbg_append_43a4b1c9d5df4168 = function () {
1099
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1100
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
3518
+ module.exports.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) {
3519
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3520
+ return addHeapObject(ret);
3521
+ };
3522
+
3523
+ module.exports.__wbg_text_7805bea50de2af49 = function () {
3524
+ return handleError(function (arg0) {
3525
+ const ret = getObject(arg0).text();
3526
+ return addHeapObject(ret);
1101
3527
  }, arguments);
1102
3528
  };
1103
3529
 
1104
- module.exports.__wbg_settype_623d2ee701e6310a = function (arg0, arg1, arg2) {
1105
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
3530
+ module.exports.__wbg_then_44b73946d2fb3e7d = function (arg0, arg1) {
3531
+ const ret = getObject(arg0).then(getObject(arg1));
3532
+ return addHeapObject(ret);
1106
3533
  };
1107
3534
 
1108
- module.exports.__wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206 = function () {
1109
- return handleError(function (arg0, arg1) {
1110
- const ret = new Blob(getObject(arg0), getObject(arg1));
1111
- return addHeapObject(ret);
1112
- }, arguments);
3535
+ module.exports.__wbg_then_48b406749878a531 = function (arg0, arg1, arg2) {
3536
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
3537
+ return addHeapObject(ret);
1113
3538
  };
1114
3539
 
1115
- module.exports.__wbg_append_7ee78799a92a9731 = function () {
1116
- return handleError(function (arg0, arg1, arg2, arg3) {
1117
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
1118
- }, arguments);
3540
+ module.exports.__wbg_url_ae10c34ca209681d = function (arg0, arg1) {
3541
+ const ret = getObject(arg1).url;
3542
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3543
+ const len1 = WASM_VECTOR_LEN;
3544
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3545
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1119
3546
  };
1120
3547
 
1121
- module.exports.__wbg_append_8135c71037096394 = function () {
1122
- return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1123
- getObject(arg0).append(
1124
- getStringFromWasm0(arg1, arg2),
1125
- getObject(arg3),
1126
- getStringFromWasm0(arg4, arg5),
1127
- );
1128
- }, arguments);
3548
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
3549
+ const ret = getObject(arg0).value;
3550
+ return addHeapObject(ret);
1129
3551
  };
1130
3552
 
1131
- module.exports.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) {
1132
- const ret = fetch(getObject(arg0));
3553
+ module.exports.__wbg_versions_c01dfd4722a88165 = function (arg0) {
3554
+ const ret = getObject(arg0).versions;
1133
3555
  return addHeapObject(ret);
1134
3556
  };
1135
3557
 
1136
- module.exports.__wbg_fetch_1fdc4448ed9eec00 = function (arg0, arg1) {
1137
- const ret = getObject(arg0).fetch(getObject(arg1));
3558
+ module.exports.__wbg_warn_aaf1f4664a035bd6 = function (arg0, arg1, arg2, arg3) {
3559
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3560
+ };
3561
+
3562
+ module.exports.__wbindgen_as_number = function (arg0) {
3563
+ const ret = +getObject(arg0);
3564
+ return ret;
3565
+ };
3566
+
3567
+ module.exports.__wbindgen_bigint_from_i64 = function (arg0) {
3568
+ const ret = arg0;
1138
3569
  return addHeapObject(ret);
1139
3570
  };
1140
3571
 
1141
- module.exports.__wbg_new_75169ae5a9683c55 = function () {
1142
- return handleError(function () {
1143
- const ret = new AbortController();
1144
- return addHeapObject(ret);
1145
- }, arguments);
3572
+ module.exports.__wbindgen_bigint_from_u64 = function (arg0) {
3573
+ const ret = BigInt.asUintN(64, arg0);
3574
+ return addHeapObject(ret);
3575
+ };
3576
+
3577
+ module.exports.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
3578
+ const v = getObject(arg1);
3579
+ const ret = typeof v === "bigint" ? v : undefined;
3580
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3581
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1146
3582
  };
1147
3583
 
1148
3584
  module.exports.__wbindgen_boolean_get = function (arg0) {
@@ -1151,19 +3587,24 @@ module.exports.__wbindgen_boolean_get = function (arg0) {
1151
3587
  return ret;
1152
3588
  };
1153
3589
 
1154
- module.exports.__wbindgen_number_get = function (arg0, arg1) {
1155
- const obj = getObject(arg1);
1156
- const ret = typeof obj === "number" ? obj : undefined;
1157
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1158
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3590
+ module.exports.__wbindgen_cb_drop = function (arg0) {
3591
+ const obj = takeObject(arg0).original;
3592
+ if (obj.cnt-- == 1) {
3593
+ obj.a = 0;
3594
+ return true;
3595
+ }
3596
+ const ret = false;
3597
+ return ret;
1159
3598
  };
1160
3599
 
1161
- module.exports.__wbg_String_b9412f8799faab3e = function (arg0, arg1) {
1162
- const ret = String(getObject(arg1));
1163
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1164
- const len1 = WASM_VECTOR_LEN;
1165
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1166
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
3600
+ module.exports.__wbindgen_closure_wrapper3149 = function (arg0, arg1, arg2) {
3601
+ const ret = makeMutClosure(arg0, arg1, 727, __wbg_adapter_50);
3602
+ return addHeapObject(ret);
3603
+ };
3604
+
3605
+ module.exports.__wbindgen_closure_wrapper3544 = function (arg0, arg1, arg2) {
3606
+ const ret = makeMutClosure(arg0, arg1, 849, __wbg_adapter_53);
3607
+ return addHeapObject(ret);
1167
3608
  };
1168
3609
 
1169
3610
  module.exports.__wbindgen_debug_string = function (arg0, arg1) {
@@ -1174,51 +3615,98 @@ module.exports.__wbindgen_debug_string = function (arg0, arg1) {
1174
3615
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1175
3616
  };
1176
3617
 
1177
- module.exports.__wbindgen_throw = function (arg0, arg1) {
1178
- throw new Error(getStringFromWasm0(arg0, arg1));
3618
+ module.exports.__wbindgen_error_new = function (arg0, arg1) {
3619
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3620
+ return addHeapObject(ret);
1179
3621
  };
1180
3622
 
1181
- module.exports.__wbg_queueMicrotask_848aa4969108a57e = function (arg0) {
1182
- const ret = getObject(arg0).queueMicrotask;
1183
- return addHeapObject(ret);
3623
+ module.exports.__wbindgen_in = function (arg0, arg1) {
3624
+ const ret = getObject(arg0) in getObject(arg1);
3625
+ return ret;
1184
3626
  };
1185
3627
 
1186
- module.exports.__wbg_queueMicrotask_c5419c06eab41e73 = function (arg0) {
1187
- queueMicrotask(getObject(arg0));
3628
+ module.exports.__wbindgen_is_bigint = function (arg0) {
3629
+ const ret = typeof getObject(arg0) === "bigint";
3630
+ return ret;
1188
3631
  };
1189
3632
 
1190
- module.exports.__wbg_newwithstrandinit_4b92c89af0a8e383 = function () {
1191
- return handleError(function (arg0, arg1, arg2) {
1192
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1193
- return addHeapObject(ret);
1194
- }, arguments);
3633
+ module.exports.__wbindgen_is_function = function (arg0) {
3634
+ const ret = typeof getObject(arg0) === "function";
3635
+ return ret;
1195
3636
  };
1196
3637
 
1197
- module.exports.__wbg_debug_a0b6c2c5ac9a4bfd = function (arg0, arg1, arg2, arg3) {
1198
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3638
+ module.exports.__wbindgen_is_object = function (arg0) {
3639
+ const val = getObject(arg0);
3640
+ const ret = typeof val === "object" && val !== null;
3641
+ return ret;
1199
3642
  };
1200
3643
 
1201
- module.exports.__wbg_error_4d17c5bb1ca90c94 = function (arg0, arg1, arg2, arg3) {
1202
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3644
+ module.exports.__wbindgen_is_string = function (arg0) {
3645
+ const ret = typeof getObject(arg0) === "string";
3646
+ return ret;
1203
3647
  };
1204
3648
 
1205
- module.exports.__wbg_info_1c7fba7da21072d1 = function (arg0, arg1, arg2, arg3) {
1206
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3649
+ module.exports.__wbindgen_is_undefined = function (arg0) {
3650
+ const ret = getObject(arg0) === undefined;
3651
+ return ret;
1207
3652
  };
1208
3653
 
1209
- module.exports.__wbg_log_4de37a0274d94769 = function (arg0, arg1, arg2, arg3) {
1210
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3654
+ module.exports.__wbindgen_jsval_eq = function (arg0, arg1) {
3655
+ const ret = getObject(arg0) === getObject(arg1);
3656
+ return ret;
1211
3657
  };
1212
3658
 
1213
- module.exports.__wbg_warn_2e2787d40aad9a81 = function (arg0, arg1, arg2, arg3) {
1214
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3659
+ module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
3660
+ const ret = getObject(arg0) == getObject(arg1);
3661
+ return ret;
3662
+ };
3663
+
3664
+ module.exports.__wbindgen_memory = function () {
3665
+ const ret = wasm.memory;
3666
+ return addHeapObject(ret);
3667
+ };
3668
+
3669
+ module.exports.__wbindgen_number_get = function (arg0, arg1) {
3670
+ const obj = getObject(arg1);
3671
+ const ret = typeof obj === "number" ? obj : undefined;
3672
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3673
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3674
+ };
3675
+
3676
+ module.exports.__wbindgen_number_new = function (arg0) {
3677
+ const ret = arg0;
3678
+ return addHeapObject(ret);
3679
+ };
3680
+
3681
+ module.exports.__wbindgen_object_clone_ref = function (arg0) {
3682
+ const ret = getObject(arg0);
3683
+ return addHeapObject(ret);
3684
+ };
3685
+
3686
+ module.exports.__wbindgen_object_drop_ref = function (arg0) {
3687
+ takeObject(arg0);
3688
+ };
3689
+
3690
+ module.exports.__wbindgen_string_get = function (arg0, arg1) {
3691
+ const obj = getObject(arg1);
3692
+ const ret = typeof obj === "string" ? obj : undefined;
3693
+ var ptr1 = isLikeNone(ret)
3694
+ ? 0
3695
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3696
+ var len1 = WASM_VECTOR_LEN;
3697
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3698
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1215
3699
  };
1216
3700
 
1217
- module.exports.__wbindgen_closure_wrapper1820 = function (arg0, arg1, arg2) {
1218
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
3701
+ module.exports.__wbindgen_string_new = function (arg0, arg1) {
3702
+ const ret = getStringFromWasm0(arg0, arg1);
1219
3703
  return addHeapObject(ret);
1220
3704
  };
1221
3705
 
3706
+ module.exports.__wbindgen_throw = function (arg0, arg1) {
3707
+ throw new Error(getStringFromWasm0(arg0, arg1));
3708
+ };
3709
+
1222
3710
  const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
1223
3711
  const bytes = require("fs").readFileSync(path);
1224
3712