@bitwarden/sdk-internal 0.2.0-main.16 → 0.2.0-main.160

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,2057 @@ 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__hbd39acb59da78aff(
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__h1fa3d18f05e030bb(
604
+ arg0,
605
+ arg1,
606
+ addHeapObject(arg2),
607
+ );
608
+ }
609
+
610
+ function __wbg_adapter_238(arg0, arg1, arg2, arg3) {
611
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h2a33b0877ef96682(
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
+ * Decrypts an attachment's encrypted content
796
+ * @param {Cipher} cipher
797
+ * @param {AttachmentView} attachment
798
+ * @param {Uint8Array} encrypted_buffer
799
+ * @returns {Uint8Array}
800
+ */
801
+ decrypt_buffer(cipher, attachment, encrypted_buffer) {
802
+ try {
803
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
804
+ const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
805
+ const len0 = WASM_VECTOR_LEN;
806
+ wasm.attachmentsclient_decrypt_buffer(
807
+ retptr,
808
+ this.__wbg_ptr,
809
+ addHeapObject(cipher),
810
+ addHeapObject(attachment),
811
+ ptr0,
812
+ len0,
813
+ );
814
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
815
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
816
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
817
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
818
+ if (r3) {
819
+ throw takeObject(r2);
820
+ }
821
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
822
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
823
+ return v2;
824
+ } finally {
825
+ wasm.__wbindgen_add_to_stack_pointer(16);
826
+ }
827
+ }
828
+ }
829
+ module.exports.AttachmentsClient = AttachmentsClient;
830
+
831
+ const BitwardenClientFinalization =
832
+ typeof FinalizationRegistry === "undefined"
833
+ ? { register: () => {}, unregister: () => {} }
834
+ : new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
835
+
836
+ class BitwardenClient {
837
+ __destroy_into_raw() {
838
+ const ptr = this.__wbg_ptr;
839
+ this.__wbg_ptr = 0;
840
+ BitwardenClientFinalization.unregister(this);
841
+ return ptr;
842
+ }
843
+
844
+ free() {
845
+ const ptr = this.__destroy_into_raw();
846
+ wasm.__wbg_bitwardenclient_free(ptr, 0);
847
+ }
848
+ /**
849
+ * @param {ClientSettings | null} [settings]
850
+ */
851
+ constructor(settings) {
852
+ const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addHeapObject(settings));
853
+ this.__wbg_ptr = ret >>> 0;
854
+ BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
855
+ return this;
856
+ }
857
+ /**
858
+ * Test method, echoes back the input
859
+ * @param {string} msg
860
+ * @returns {string}
861
+ */
862
+ echo(msg) {
863
+ let deferred2_0;
864
+ let deferred2_1;
865
+ try {
866
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
867
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
868
+ const len0 = WASM_VECTOR_LEN;
869
+ wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
870
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
871
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
872
+ deferred2_0 = r0;
873
+ deferred2_1 = r1;
874
+ return getStringFromWasm0(r0, r1);
875
+ } finally {
876
+ wasm.__wbindgen_add_to_stack_pointer(16);
877
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
878
+ }
879
+ }
880
+ /**
881
+ * @returns {string}
882
+ */
883
+ version() {
884
+ let deferred1_0;
885
+ let deferred1_1;
886
+ try {
887
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
888
+ wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
889
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
890
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
891
+ deferred1_0 = r0;
892
+ deferred1_1 = r1;
893
+ return getStringFromWasm0(r0, r1);
894
+ } finally {
895
+ wasm.__wbindgen_add_to_stack_pointer(16);
896
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
897
+ }
898
+ }
899
+ /**
900
+ * @param {string} msg
901
+ */
902
+ throw(msg) {
903
+ try {
904
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
905
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
906
+ const len0 = WASM_VECTOR_LEN;
907
+ wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
908
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
909
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
910
+ if (r1) {
911
+ throw takeObject(r0);
912
+ }
913
+ } finally {
914
+ wasm.__wbindgen_add_to_stack_pointer(16);
915
+ }
916
+ }
917
+ /**
918
+ * Test method, calls http endpoint
919
+ * @param {string} url
920
+ * @returns {Promise<string>}
921
+ */
922
+ http_get(url) {
923
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
924
+ const len0 = WASM_VECTOR_LEN;
925
+ const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
926
+ return takeObject(ret);
927
+ }
928
+ /**
929
+ * @returns {CryptoClient}
930
+ */
931
+ crypto() {
932
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
933
+ return CryptoClient.__wrap(ret);
934
+ }
935
+ /**
936
+ * @returns {VaultClient}
937
+ */
938
+ vault() {
939
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
940
+ return VaultClient.__wrap(ret);
941
+ }
942
+ /**
943
+ * Constructs a specific client for generating passwords and passphrases
944
+ * @returns {GeneratorClient}
945
+ */
946
+ generator() {
947
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
948
+ return GeneratorClient.__wrap(ret);
949
+ }
950
+ /**
951
+ * @returns {ExporterClient}
952
+ */
953
+ exporters() {
954
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
955
+ return ExporterClient.__wrap(ret);
956
+ }
957
+ }
958
+ module.exports.BitwardenClient = BitwardenClient;
959
+
960
+ const CiphersClientFinalization =
961
+ typeof FinalizationRegistry === "undefined"
962
+ ? { register: () => {}, unregister: () => {} }
963
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
964
+
965
+ class CiphersClient {
966
+ static __wrap(ptr) {
967
+ ptr = ptr >>> 0;
968
+ const obj = Object.create(CiphersClient.prototype);
969
+ obj.__wbg_ptr = ptr;
970
+ CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
971
+ return obj;
972
+ }
973
+
974
+ __destroy_into_raw() {
975
+ const ptr = this.__wbg_ptr;
976
+ this.__wbg_ptr = 0;
977
+ CiphersClientFinalization.unregister(this);
978
+ return ptr;
979
+ }
980
+
981
+ free() {
982
+ const ptr = this.__destroy_into_raw();
983
+ wasm.__wbg_ciphersclient_free(ptr, 0);
984
+ }
985
+ /**
986
+ * Encrypt cipher
987
+ *
988
+ * # Arguments
989
+ * - `cipher_view` - The decrypted cipher to encrypt
990
+ *
991
+ * # Returns
992
+ * - `Ok(Cipher)` containing the encrypted cipher
993
+ * - `Err(EncryptError)` if encryption fails
994
+ * @param {CipherView} cipher_view
995
+ * @returns {Cipher}
996
+ */
997
+ encrypt(cipher_view) {
998
+ try {
999
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1000
+ wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
1001
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1002
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1003
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1004
+ if (r2) {
1005
+ throw takeObject(r1);
1006
+ }
1007
+ return takeObject(r0);
1008
+ } finally {
1009
+ wasm.__wbindgen_add_to_stack_pointer(16);
1010
+ }
1011
+ }
1012
+ /**
1013
+ * Decrypt cipher
1014
+ *
1015
+ * # Arguments
1016
+ * - `cipher` - The encrypted cipher to decrypt
1017
+ *
1018
+ * # Returns
1019
+ * - `Ok(CipherView)` containing the decrypted cipher
1020
+ * - `Err(DecryptError)` if decryption fails
1021
+ * @param {Cipher} cipher
1022
+ * @returns {CipherView}
1023
+ */
1024
+ decrypt(cipher) {
1025
+ try {
1026
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1027
+ wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
1028
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1029
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1030
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1031
+ if (r2) {
1032
+ throw takeObject(r1);
1033
+ }
1034
+ return takeObject(r0);
1035
+ } finally {
1036
+ wasm.__wbindgen_add_to_stack_pointer(16);
1037
+ }
1038
+ }
1039
+ /**
1040
+ * Decrypt list of ciphers
1041
+ *
1042
+ * # Arguments
1043
+ * - `ciphers` - The list of encrypted ciphers to decrypt
1044
+ *
1045
+ * # Returns
1046
+ * - `Ok(Vec<CipherListView>)` containing the decrypted ciphers
1047
+ * - `Err(DecryptError)` if decryption fails
1048
+ * @param {Cipher[]} ciphers
1049
+ * @returns {CipherListView[]}
1050
+ */
1051
+ decrypt_list(ciphers) {
1052
+ try {
1053
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1054
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1055
+ const len0 = WASM_VECTOR_LEN;
1056
+ wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1057
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1058
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1059
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1060
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1061
+ if (r3) {
1062
+ throw takeObject(r2);
1063
+ }
1064
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1065
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1066
+ return v2;
1067
+ } finally {
1068
+ wasm.__wbindgen_add_to_stack_pointer(16);
1069
+ }
1070
+ }
1071
+ /**
1072
+ * Decrypt FIDO2 credentials
1073
+ *
1074
+ * # Arguments
1075
+ * - `cipher_view` - Cipher to encrypt containing the FIDO2 credential
1076
+ *
1077
+ * # Returns
1078
+ * - `Ok(Vec<Fido2CredentialView>)` containing the decrypted FIDO2 credentials
1079
+ * - `Err(DecryptError)` if decryption fails
1080
+ * @param {CipherView} cipher_view
1081
+ * @returns {Fido2CredentialView[]}
1082
+ */
1083
+ decrypt_fido2_credentials(cipher_view) {
1084
+ try {
1085
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1086
+ wasm.ciphersclient_decrypt_fido2_credentials(
1087
+ retptr,
1088
+ this.__wbg_ptr,
1089
+ addHeapObject(cipher_view),
1090
+ );
1091
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1092
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1093
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1094
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1095
+ if (r3) {
1096
+ throw takeObject(r2);
1097
+ }
1098
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1099
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1100
+ return v1;
1101
+ } finally {
1102
+ wasm.__wbindgen_add_to_stack_pointer(16);
1103
+ }
1104
+ }
1105
+ /**
1106
+ * Decrypt key
1107
+ *
1108
+ * This method is a temporary solution to allow typescript client access to decrypted key
1109
+ * values, particularly for FIDO2 credentials.
1110
+ *
1111
+ * # Arguments
1112
+ * - `cipher_view` - Decrypted cipher containing the key
1113
+ *
1114
+ * # Returns
1115
+ * - `Ok(String)` containing the decrypted key
1116
+ * - `Err(CipherError)`
1117
+ * @param {CipherView} cipher_view
1118
+ * @returns {string}
1119
+ */
1120
+ decrypt_fido2_private_key(cipher_view) {
1121
+ let deferred2_0;
1122
+ let deferred2_1;
1123
+ try {
1124
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1125
+ wasm.ciphersclient_decrypt_fido2_private_key(
1126
+ retptr,
1127
+ this.__wbg_ptr,
1128
+ addHeapObject(cipher_view),
1129
+ );
1130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1132
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1133
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1134
+ var ptr1 = r0;
1135
+ var len1 = r1;
1136
+ if (r3) {
1137
+ ptr1 = 0;
1138
+ len1 = 0;
1139
+ throw takeObject(r2);
1140
+ }
1141
+ deferred2_0 = ptr1;
1142
+ deferred2_1 = len1;
1143
+ return getStringFromWasm0(ptr1, len1);
1144
+ } finally {
1145
+ wasm.__wbindgen_add_to_stack_pointer(16);
1146
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1147
+ }
1148
+ }
1149
+ }
1150
+ module.exports.CiphersClient = CiphersClient;
1151
+
1152
+ const CryptoClientFinalization =
1153
+ typeof FinalizationRegistry === "undefined"
1154
+ ? { register: () => {}, unregister: () => {} }
1155
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
1156
+
1157
+ class CryptoClient {
1158
+ static __wrap(ptr) {
1159
+ ptr = ptr >>> 0;
1160
+ const obj = Object.create(CryptoClient.prototype);
1161
+ obj.__wbg_ptr = ptr;
1162
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
1163
+ return obj;
1164
+ }
1165
+
1166
+ __destroy_into_raw() {
1167
+ const ptr = this.__wbg_ptr;
1168
+ this.__wbg_ptr = 0;
1169
+ CryptoClientFinalization.unregister(this);
1170
+ return ptr;
1171
+ }
1172
+
1173
+ free() {
1174
+ const ptr = this.__destroy_into_raw();
1175
+ wasm.__wbg_cryptoclient_free(ptr, 0);
1176
+ }
1177
+ /**
1178
+ * Initialization method for the user crypto. Needs to be called before any other crypto
1179
+ * operations.
1180
+ * @param {InitUserCryptoRequest} req
1181
+ * @returns {Promise<void>}
1182
+ */
1183
+ initialize_user_crypto(req) {
1184
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
1185
+ return takeObject(ret);
1186
+ }
1187
+ /**
1188
+ * Initialization method for the organization crypto. Needs to be called after
1189
+ * `initialize_user_crypto` but before any other crypto operations.
1190
+ * @param {InitOrgCryptoRequest} req
1191
+ * @returns {Promise<void>}
1192
+ */
1193
+ initialize_org_crypto(req) {
1194
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
1195
+ return takeObject(ret);
1196
+ }
1197
+ /**
1198
+ * Generates a new key pair and encrypts the private key with the provided user key.
1199
+ * Crypto initialization not required.
1200
+ * @param {string} user_key
1201
+ * @returns {MakeKeyPairResponse}
1202
+ */
1203
+ make_key_pair(user_key) {
1204
+ try {
1205
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1206
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1207
+ const len0 = WASM_VECTOR_LEN;
1208
+ wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
1209
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1210
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1211
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1212
+ if (r2) {
1213
+ throw takeObject(r1);
1214
+ }
1215
+ return takeObject(r0);
1216
+ } finally {
1217
+ wasm.__wbindgen_add_to_stack_pointer(16);
1218
+ }
1219
+ }
1220
+ /**
1221
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
1222
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
1223
+ * Crypto initialization not required.
1224
+ * @param {VerifyAsymmetricKeysRequest} request
1225
+ * @returns {VerifyAsymmetricKeysResponse}
1226
+ */
1227
+ verify_asymmetric_keys(request) {
1228
+ try {
1229
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1230
+ wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
1231
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1232
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1233
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1234
+ if (r2) {
1235
+ throw takeObject(r1);
1236
+ }
1237
+ return takeObject(r0);
1238
+ } finally {
1239
+ wasm.__wbindgen_add_to_stack_pointer(16);
1240
+ }
1241
+ }
1242
+ }
1243
+ module.exports.CryptoClient = CryptoClient;
1244
+
1245
+ const ExporterClientFinalization =
1246
+ typeof FinalizationRegistry === "undefined"
1247
+ ? { register: () => {}, unregister: () => {} }
1248
+ : new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
1249
+
1250
+ class ExporterClient {
1251
+ static __wrap(ptr) {
1252
+ ptr = ptr >>> 0;
1253
+ const obj = Object.create(ExporterClient.prototype);
1254
+ obj.__wbg_ptr = ptr;
1255
+ ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
1256
+ return obj;
1257
+ }
1258
+
1259
+ __destroy_into_raw() {
1260
+ const ptr = this.__wbg_ptr;
1261
+ this.__wbg_ptr = 0;
1262
+ ExporterClientFinalization.unregister(this);
1263
+ return ptr;
1264
+ }
1265
+
1266
+ free() {
1267
+ const ptr = this.__destroy_into_raw();
1268
+ wasm.__wbg_exporterclient_free(ptr, 0);
1269
+ }
1270
+ /**
1271
+ * @param {Folder[]} folders
1272
+ * @param {Cipher[]} ciphers
1273
+ * @param {ExportFormat} format
1274
+ * @returns {string}
1275
+ */
1276
+ export_vault(folders, ciphers, format) {
1277
+ let deferred4_0;
1278
+ let deferred4_1;
1279
+ try {
1280
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1281
+ const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
1282
+ const len0 = WASM_VECTOR_LEN;
1283
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1284
+ const len1 = WASM_VECTOR_LEN;
1285
+ wasm.exporterclient_export_vault(
1286
+ retptr,
1287
+ this.__wbg_ptr,
1288
+ ptr0,
1289
+ len0,
1290
+ ptr1,
1291
+ len1,
1292
+ addHeapObject(format),
1293
+ );
1294
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1295
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1296
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1297
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1298
+ var ptr3 = r0;
1299
+ var len3 = r1;
1300
+ if (r3) {
1301
+ ptr3 = 0;
1302
+ len3 = 0;
1303
+ throw takeObject(r2);
1304
+ }
1305
+ deferred4_0 = ptr3;
1306
+ deferred4_1 = len3;
1307
+ return getStringFromWasm0(ptr3, len3);
1308
+ } finally {
1309
+ wasm.__wbindgen_add_to_stack_pointer(16);
1310
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1311
+ }
1312
+ }
1313
+ /**
1314
+ * @param {Collection[]} collections
1315
+ * @param {Cipher[]} ciphers
1316
+ * @param {ExportFormat} format
1317
+ * @returns {string}
1318
+ */
1319
+ export_organization_vault(collections, ciphers, format) {
1320
+ let deferred4_0;
1321
+ let deferred4_1;
1322
+ try {
1323
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1324
+ const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
1325
+ const len0 = WASM_VECTOR_LEN;
1326
+ const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1327
+ const len1 = WASM_VECTOR_LEN;
1328
+ wasm.exporterclient_export_organization_vault(
1329
+ retptr,
1330
+ this.__wbg_ptr,
1331
+ ptr0,
1332
+ len0,
1333
+ ptr1,
1334
+ len1,
1335
+ addHeapObject(format),
1336
+ );
1337
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1338
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1339
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1340
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1341
+ var ptr3 = r0;
1342
+ var len3 = r1;
1343
+ if (r3) {
1344
+ ptr3 = 0;
1345
+ len3 = 0;
1346
+ throw takeObject(r2);
1347
+ }
1348
+ deferred4_0 = ptr3;
1349
+ deferred4_1 = len3;
1350
+ return getStringFromWasm0(ptr3, len3);
1351
+ } finally {
1352
+ wasm.__wbindgen_add_to_stack_pointer(16);
1353
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1354
+ }
1355
+ }
1356
+ /**
1357
+ * Credential Exchange Format (CXF)
1358
+ *
1359
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1360
+ *
1361
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1362
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1363
+ * @param {Account} account
1364
+ * @param {Cipher[]} ciphers
1365
+ * @returns {string}
1366
+ */
1367
+ export_cxf(account, ciphers) {
1368
+ let deferred3_0;
1369
+ let deferred3_1;
1370
+ try {
1371
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1372
+ const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1373
+ const len0 = WASM_VECTOR_LEN;
1374
+ wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
1375
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1376
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1377
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1378
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1379
+ var ptr2 = r0;
1380
+ var len2 = r1;
1381
+ if (r3) {
1382
+ ptr2 = 0;
1383
+ len2 = 0;
1384
+ throw takeObject(r2);
1385
+ }
1386
+ deferred3_0 = ptr2;
1387
+ deferred3_1 = len2;
1388
+ return getStringFromWasm0(ptr2, len2);
1389
+ } finally {
1390
+ wasm.__wbindgen_add_to_stack_pointer(16);
1391
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
1392
+ }
1393
+ }
1394
+ /**
1395
+ * Credential Exchange Format (CXF)
1396
+ *
1397
+ * *Warning:* Expect this API to be unstable, and it will change in the future.
1398
+ *
1399
+ * For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
1400
+ * Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
1401
+ * @param {string} payload
1402
+ * @returns {Cipher[]}
1403
+ */
1404
+ import_cxf(payload) {
1405
+ try {
1406
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1407
+ const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1408
+ const len0 = WASM_VECTOR_LEN;
1409
+ wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
1410
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1411
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1412
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1413
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1414
+ if (r3) {
1415
+ throw takeObject(r2);
1416
+ }
1417
+ var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
1418
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1419
+ return v2;
1420
+ } finally {
1421
+ wasm.__wbindgen_add_to_stack_pointer(16);
1422
+ }
1423
+ }
1424
+ }
1425
+ module.exports.ExporterClient = ExporterClient;
1426
+
1427
+ const FoldersClientFinalization =
1428
+ typeof FinalizationRegistry === "undefined"
1429
+ ? { register: () => {}, unregister: () => {} }
1430
+ : new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
1431
+
1432
+ class FoldersClient {
1433
+ static __wrap(ptr) {
1434
+ ptr = ptr >>> 0;
1435
+ const obj = Object.create(FoldersClient.prototype);
1436
+ obj.__wbg_ptr = ptr;
1437
+ FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1438
+ return obj;
1439
+ }
1440
+
1441
+ __destroy_into_raw() {
1442
+ const ptr = this.__wbg_ptr;
1443
+ this.__wbg_ptr = 0;
1444
+ FoldersClientFinalization.unregister(this);
1445
+ return ptr;
1446
+ }
1447
+
1448
+ free() {
1449
+ const ptr = this.__destroy_into_raw();
1450
+ wasm.__wbg_foldersclient_free(ptr, 0);
1451
+ }
1452
+ /**
1453
+ * Decrypt folder
1454
+ * @param {Folder} folder
1455
+ * @returns {FolderView}
1456
+ */
1457
+ decrypt(folder) {
1458
+ try {
1459
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1460
+ wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1461
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1462
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1463
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1464
+ if (r2) {
1465
+ throw takeObject(r1);
1466
+ }
1467
+ return takeObject(r0);
1468
+ } finally {
1469
+ wasm.__wbindgen_add_to_stack_pointer(16);
1470
+ }
1471
+ }
1472
+ }
1473
+ module.exports.FoldersClient = FoldersClient;
1474
+
1475
+ const GeneratorClientFinalization =
1476
+ typeof FinalizationRegistry === "undefined"
1477
+ ? { register: () => {}, unregister: () => {} }
1478
+ : new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
1479
+
1480
+ class GeneratorClient {
1481
+ static __wrap(ptr) {
1482
+ ptr = ptr >>> 0;
1483
+ const obj = Object.create(GeneratorClient.prototype);
1484
+ obj.__wbg_ptr = ptr;
1485
+ GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
1486
+ return obj;
1487
+ }
1488
+
1489
+ __destroy_into_raw() {
1490
+ const ptr = this.__wbg_ptr;
1491
+ this.__wbg_ptr = 0;
1492
+ GeneratorClientFinalization.unregister(this);
1493
+ return ptr;
1494
+ }
1495
+
1496
+ free() {
1497
+ const ptr = this.__destroy_into_raw();
1498
+ wasm.__wbg_generatorclient_free(ptr, 0);
1499
+ }
1500
+ /**
1501
+ * Generates a random password.
1502
+ *
1503
+ * The character sets and password length can be customized using the `input` parameter.
1504
+ *
1505
+ * # Examples
1506
+ *
1507
+ * ```
1508
+ * use bitwarden_core::Client;
1509
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PasswordGeneratorRequest};
1510
+ *
1511
+ * async fn test() -> Result<(), PassphraseError> {
1512
+ * let input = PasswordGeneratorRequest {
1513
+ * lowercase: true,
1514
+ * uppercase: true,
1515
+ * numbers: true,
1516
+ * length: 20,
1517
+ * ..Default::default()
1518
+ * };
1519
+ * let password = Client::new(None).generator().password(input).unwrap();
1520
+ * println!("{}", password);
1521
+ * Ok(())
1522
+ * }
1523
+ * ```
1524
+ * @param {PasswordGeneratorRequest} input
1525
+ * @returns {string}
1526
+ */
1527
+ password(input) {
1528
+ let deferred2_0;
1529
+ let deferred2_1;
1530
+ try {
1531
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1532
+ wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(input));
1533
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1534
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1535
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1536
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1537
+ var ptr1 = r0;
1538
+ var len1 = r1;
1539
+ if (r3) {
1540
+ ptr1 = 0;
1541
+ len1 = 0;
1542
+ throw takeObject(r2);
1543
+ }
1544
+ deferred2_0 = ptr1;
1545
+ deferred2_1 = len1;
1546
+ return getStringFromWasm0(ptr1, len1);
1547
+ } finally {
1548
+ wasm.__wbindgen_add_to_stack_pointer(16);
1549
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1550
+ }
1551
+ }
1552
+ /**
1553
+ * Generates a random passphrase.
1554
+ * A passphrase is a combination of random words separated by a character.
1555
+ * An example of passphrase is `correct horse battery staple`.
1556
+ *
1557
+ * The number of words and their case, the word separator, and the inclusion of
1558
+ * a number in the passphrase can be customized using the `input` parameter.
1559
+ *
1560
+ * # Examples
1561
+ *
1562
+ * ```
1563
+ * use bitwarden_core::Client;
1564
+ * use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PassphraseGeneratorRequest};
1565
+ *
1566
+ * async fn test() -> Result<(), PassphraseError> {
1567
+ * let input = PassphraseGeneratorRequest {
1568
+ * num_words: 4,
1569
+ * ..Default::default()
1570
+ * };
1571
+ * let passphrase = Client::new(None).generator().passphrase(input).unwrap();
1572
+ * println!("{}", passphrase);
1573
+ * Ok(())
1574
+ * }
1575
+ * ```
1576
+ * @param {PassphraseGeneratorRequest} input
1577
+ * @returns {string}
1578
+ */
1579
+ passphrase(input) {
1580
+ let deferred2_0;
1581
+ let deferred2_1;
1582
+ try {
1583
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1584
+ wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(input));
1585
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1586
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1587
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1588
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
1589
+ var ptr1 = r0;
1590
+ var len1 = r1;
1591
+ if (r3) {
1592
+ ptr1 = 0;
1593
+ len1 = 0;
1594
+ throw takeObject(r2);
1595
+ }
1596
+ deferred2_0 = ptr1;
1597
+ deferred2_1 = len1;
1598
+ return getStringFromWasm0(ptr1, len1);
1599
+ } finally {
1600
+ wasm.__wbindgen_add_to_stack_pointer(16);
1601
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1602
+ }
1603
+ }
1604
+ }
1605
+ module.exports.GeneratorClient = GeneratorClient;
1606
+
1607
+ const IncomingMessageFinalization =
1608
+ typeof FinalizationRegistry === "undefined"
1609
+ ? { register: () => {}, unregister: () => {} }
1610
+ : new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
1611
+
1612
+ class IncomingMessage {
1613
+ static __wrap(ptr) {
1614
+ ptr = ptr >>> 0;
1615
+ const obj = Object.create(IncomingMessage.prototype);
1616
+ obj.__wbg_ptr = ptr;
1617
+ IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1618
+ return obj;
1619
+ }
1620
+
1621
+ __destroy_into_raw() {
1622
+ const ptr = this.__wbg_ptr;
1623
+ this.__wbg_ptr = 0;
1624
+ IncomingMessageFinalization.unregister(this);
1625
+ return ptr;
1626
+ }
1627
+
1628
+ free() {
1629
+ const ptr = this.__destroy_into_raw();
1630
+ wasm.__wbg_incomingmessage_free(ptr, 0);
1631
+ }
1632
+ /**
1633
+ * @returns {Uint8Array}
1634
+ */
1635
+ get payload() {
1636
+ try {
1637
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1638
+ wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
1639
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1640
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1641
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1642
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1643
+ return v1;
1644
+ } finally {
1645
+ wasm.__wbindgen_add_to_stack_pointer(16);
1646
+ }
1647
+ }
1648
+ /**
1649
+ * @param {Uint8Array} arg0
1650
+ */
1651
+ set payload(arg0) {
1652
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1653
+ const len0 = WASM_VECTOR_LEN;
1654
+ wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
1655
+ }
1656
+ /**
1657
+ * @returns {Endpoint}
1658
+ */
1659
+ get destination() {
1660
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1661
+ return takeObject(ret);
1662
+ }
1663
+ /**
1664
+ * @param {Endpoint} arg0
1665
+ */
1666
+ set destination(arg0) {
1667
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
1668
+ }
1669
+ /**
1670
+ * @returns {Endpoint}
1671
+ */
1672
+ get source() {
1673
+ const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
1674
+ return takeObject(ret);
1675
+ }
1676
+ /**
1677
+ * @param {Endpoint} arg0
1678
+ */
1679
+ set source(arg0) {
1680
+ wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
1681
+ }
1682
+ /**
1683
+ * @returns {string | undefined}
1684
+ */
1685
+ get topic() {
1686
+ try {
1687
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1688
+ wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
1689
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1690
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1691
+ let v1;
1692
+ if (r0 !== 0) {
1693
+ v1 = getStringFromWasm0(r0, r1).slice();
1694
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1695
+ }
1696
+ return v1;
1697
+ } finally {
1698
+ wasm.__wbindgen_add_to_stack_pointer(16);
1699
+ }
1700
+ }
1701
+ /**
1702
+ * @param {string | null} [arg0]
1703
+ */
1704
+ set topic(arg0) {
1705
+ var ptr0 = isLikeNone(arg0)
1706
+ ? 0
1707
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1708
+ var len0 = WASM_VECTOR_LEN;
1709
+ wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
1710
+ }
1711
+ /**
1712
+ * @param {Uint8Array} payload
1713
+ * @param {Endpoint} destination
1714
+ * @param {Endpoint} source
1715
+ * @param {string | null} [topic]
1716
+ */
1717
+ constructor(payload, destination, source, topic) {
1718
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1719
+ const len0 = WASM_VECTOR_LEN;
1720
+ var ptr1 = isLikeNone(topic)
1721
+ ? 0
1722
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1723
+ var len1 = WASM_VECTOR_LEN;
1724
+ const ret = wasm.incomingmessage_new(
1725
+ ptr0,
1726
+ len0,
1727
+ addHeapObject(destination),
1728
+ addHeapObject(source),
1729
+ ptr1,
1730
+ len1,
1731
+ );
1732
+ this.__wbg_ptr = ret >>> 0;
1733
+ IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
1734
+ return this;
1735
+ }
1736
+ /**
1737
+ * Try to parse the payload as JSON.
1738
+ * @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
1739
+ */
1740
+ parse_payload_as_json() {
1741
+ const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
1742
+ return takeObject(ret);
1743
+ }
1744
+ }
1745
+ module.exports.IncomingMessage = IncomingMessage;
1746
+
1747
+ const IpcClientFinalization =
1748
+ typeof FinalizationRegistry === "undefined"
1749
+ ? { register: () => {}, unregister: () => {} }
1750
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
1751
+
1752
+ class IpcClient {
1753
+ __destroy_into_raw() {
1754
+ const ptr = this.__wbg_ptr;
1755
+ this.__wbg_ptr = 0;
1756
+ IpcClientFinalization.unregister(this);
1757
+ return ptr;
1758
+ }
1759
+
1760
+ free() {
1761
+ const ptr = this.__destroy_into_raw();
1762
+ wasm.__wbg_ipcclient_free(ptr, 0);
1763
+ }
1764
+ /**
1765
+ * @param {IpcCommunicationBackend} communication_provider
1766
+ */
1767
+ constructor(communication_provider) {
1768
+ _assertClass(communication_provider, IpcCommunicationBackend);
1769
+ var ptr0 = communication_provider.__destroy_into_raw();
1770
+ const ret = wasm.ipcclient_new(ptr0);
1771
+ this.__wbg_ptr = ret >>> 0;
1772
+ IpcClientFinalization.register(this, this.__wbg_ptr, this);
1773
+ return this;
1774
+ }
1775
+ /**
1776
+ * @param {OutgoingMessage} message
1777
+ * @returns {Promise<void>}
1778
+ */
1779
+ send(message) {
1780
+ _assertClass(message, OutgoingMessage);
1781
+ var ptr0 = message.__destroy_into_raw();
1782
+ const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
1783
+ return takeObject(ret);
1784
+ }
1785
+ /**
1786
+ * @returns {Promise<IpcClientSubscription>}
1787
+ */
1788
+ subscribe() {
1789
+ const ret = wasm.ipcclient_subscribe(this.__wbg_ptr);
1790
+ return takeObject(ret);
1791
+ }
1792
+ }
1793
+ module.exports.IpcClient = IpcClient;
1794
+
1795
+ const IpcClientSubscriptionFinalization =
1796
+ typeof FinalizationRegistry === "undefined"
1797
+ ? { register: () => {}, unregister: () => {} }
1798
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipcclientsubscription_free(ptr >>> 0, 1));
1799
+
1800
+ class IpcClientSubscription {
1801
+ static __wrap(ptr) {
1802
+ ptr = ptr >>> 0;
1803
+ const obj = Object.create(IpcClientSubscription.prototype);
1804
+ obj.__wbg_ptr = ptr;
1805
+ IpcClientSubscriptionFinalization.register(obj, obj.__wbg_ptr, obj);
1806
+ return obj;
1807
+ }
1808
+
1809
+ __destroy_into_raw() {
1810
+ const ptr = this.__wbg_ptr;
1811
+ this.__wbg_ptr = 0;
1812
+ IpcClientSubscriptionFinalization.unregister(this);
1813
+ return ptr;
1814
+ }
1815
+
1816
+ free() {
1817
+ const ptr = this.__destroy_into_raw();
1818
+ wasm.__wbg_ipcclientsubscription_free(ptr, 0);
1819
+ }
1820
+ /**
1821
+ * @returns {Promise<IncomingMessage>}
1822
+ */
1823
+ receive() {
1824
+ const ret = wasm.ipcclientsubscription_receive(this.__wbg_ptr);
1825
+ return takeObject(ret);
1826
+ }
1827
+ }
1828
+ module.exports.IpcClientSubscription = IpcClientSubscription;
1829
+
1830
+ const IpcCommunicationBackendFinalization =
1831
+ typeof FinalizationRegistry === "undefined"
1832
+ ? { register: () => {}, unregister: () => {} }
1833
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ipccommunicationbackend_free(ptr >>> 0, 1));
1834
+
1835
+ class IpcCommunicationBackend {
1836
+ __destroy_into_raw() {
1837
+ const ptr = this.__wbg_ptr;
1838
+ this.__wbg_ptr = 0;
1839
+ IpcCommunicationBackendFinalization.unregister(this);
1840
+ return ptr;
1841
+ }
1842
+
1843
+ free() {
1844
+ const ptr = this.__destroy_into_raw();
1845
+ wasm.__wbg_ipccommunicationbackend_free(ptr, 0);
1846
+ }
1847
+ /**
1848
+ * @param {IpcCommunicationBackendSender} sender
1849
+ */
1850
+ constructor(sender) {
1851
+ const ret = wasm.ipccommunicationbackend_new(addHeapObject(sender));
1852
+ this.__wbg_ptr = ret >>> 0;
1853
+ IpcCommunicationBackendFinalization.register(this, this.__wbg_ptr, this);
1854
+ return this;
1855
+ }
1856
+ /**
1857
+ * JavaScript function to provide a received message to the backend/IPC framework.
1858
+ * @param {IncomingMessage} message
1859
+ */
1860
+ deliver_message(message) {
1861
+ try {
1862
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1863
+ _assertClass(message, IncomingMessage);
1864
+ var ptr0 = message.__destroy_into_raw();
1865
+ wasm.ipccommunicationbackend_deliver_message(retptr, this.__wbg_ptr, ptr0);
1866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1868
+ if (r1) {
1869
+ throw takeObject(r0);
1870
+ }
1871
+ } finally {
1872
+ wasm.__wbindgen_add_to_stack_pointer(16);
1873
+ }
1874
+ }
1875
+ }
1876
+ module.exports.IpcCommunicationBackend = IpcCommunicationBackend;
1877
+
1878
+ const OutgoingMessageFinalization =
1879
+ typeof FinalizationRegistry === "undefined"
1880
+ ? { register: () => {}, unregister: () => {} }
1881
+ : new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
1882
+
1883
+ class OutgoingMessage {
1884
+ static __wrap(ptr) {
1885
+ ptr = ptr >>> 0;
1886
+ const obj = Object.create(OutgoingMessage.prototype);
1887
+ obj.__wbg_ptr = ptr;
1888
+ OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1889
+ return obj;
1890
+ }
1891
+
1892
+ __destroy_into_raw() {
1893
+ const ptr = this.__wbg_ptr;
1894
+ this.__wbg_ptr = 0;
1895
+ OutgoingMessageFinalization.unregister(this);
1896
+ return ptr;
1897
+ }
1898
+
1899
+ free() {
1900
+ const ptr = this.__destroy_into_raw();
1901
+ wasm.__wbg_outgoingmessage_free(ptr, 0);
1902
+ }
1903
+ /**
1904
+ * @returns {Uint8Array}
1905
+ */
1906
+ get payload() {
1907
+ try {
1908
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1909
+ wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
1910
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1911
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1912
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
1913
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1914
+ return v1;
1915
+ } finally {
1916
+ wasm.__wbindgen_add_to_stack_pointer(16);
1917
+ }
1918
+ }
1919
+ /**
1920
+ * @param {Uint8Array} arg0
1921
+ */
1922
+ set payload(arg0) {
1923
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1924
+ const len0 = WASM_VECTOR_LEN;
1925
+ wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
1926
+ }
1927
+ /**
1928
+ * @returns {Endpoint}
1929
+ */
1930
+ get destination() {
1931
+ const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
1932
+ return takeObject(ret);
1933
+ }
1934
+ /**
1935
+ * @param {Endpoint} arg0
1936
+ */
1937
+ set destination(arg0) {
1938
+ wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
363
1939
  }
364
1940
  /**
365
- * @param {ClientSettings | undefined} [settings]
366
- * @param {LogLevel | undefined} [log_level]
1941
+ * @returns {string | undefined}
367
1942
  */
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
- );
1943
+ get topic() {
1944
+ try {
1945
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1946
+ wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
1947
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1948
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1949
+ let v1;
1950
+ if (r0 !== 0) {
1951
+ v1 = getStringFromWasm0(r0, r1).slice();
1952
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
1953
+ }
1954
+ return v1;
1955
+ } finally {
1956
+ wasm.__wbindgen_add_to_stack_pointer(16);
1957
+ }
1958
+ }
1959
+ /**
1960
+ * @param {string | null} [arg0]
1961
+ */
1962
+ set topic(arg0) {
1963
+ var ptr0 = isLikeNone(arg0)
1964
+ ? 0
1965
+ : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1966
+ var len0 = WASM_VECTOR_LEN;
1967
+ wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
1968
+ }
1969
+ /**
1970
+ * @param {Uint8Array} payload
1971
+ * @param {Endpoint} destination
1972
+ * @param {string | null} [topic]
1973
+ */
1974
+ constructor(payload, destination, topic) {
1975
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
1976
+ const len0 = WASM_VECTOR_LEN;
1977
+ var ptr1 = isLikeNone(topic)
1978
+ ? 0
1979
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1980
+ var len1 = WASM_VECTOR_LEN;
1981
+ const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
373
1982
  this.__wbg_ptr = ret >>> 0;
374
- BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
1983
+ OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
375
1984
  return this;
376
1985
  }
377
1986
  /**
378
- * Test method, echoes back the input
379
- * @param {string} msg
1987
+ * Create a new message and encode the payload as JSON.
1988
+ * @param {any} payload
1989
+ * @param {Endpoint} destination
1990
+ * @param {string | null} [topic]
1991
+ * @returns {OutgoingMessage}
1992
+ */
1993
+ static new_json_payload(payload, destination, topic) {
1994
+ try {
1995
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1996
+ var ptr0 = isLikeNone(topic)
1997
+ ? 0
1998
+ : passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1999
+ var len0 = WASM_VECTOR_LEN;
2000
+ wasm.outgoingmessage_new_json_payload(
2001
+ retptr,
2002
+ addHeapObject(payload),
2003
+ addHeapObject(destination),
2004
+ ptr0,
2005
+ len0,
2006
+ );
2007
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2008
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2009
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2010
+ if (r2) {
2011
+ throw takeObject(r1);
2012
+ }
2013
+ return OutgoingMessage.__wrap(r0);
2014
+ } finally {
2015
+ wasm.__wbindgen_add_to_stack_pointer(16);
2016
+ }
2017
+ }
2018
+ }
2019
+ module.exports.OutgoingMessage = OutgoingMessage;
2020
+
2021
+ const PureCryptoFinalization =
2022
+ typeof FinalizationRegistry === "undefined"
2023
+ ? { register: () => {}, unregister: () => {} }
2024
+ : new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
2025
+ /**
2026
+ * This module represents a stopgap solution to provide access to primitive crypto functions for JS
2027
+ * clients. It is not intended to be used outside of the JS clients and this pattern should not be
2028
+ * proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
2029
+ * responsible for state and keys.
2030
+ */
2031
+ class PureCrypto {
2032
+ __destroy_into_raw() {
2033
+ const ptr = this.__wbg_ptr;
2034
+ this.__wbg_ptr = 0;
2035
+ PureCryptoFinalization.unregister(this);
2036
+ return ptr;
2037
+ }
2038
+
2039
+ free() {
2040
+ const ptr = this.__destroy_into_raw();
2041
+ wasm.__wbg_purecrypto_free(ptr, 0);
2042
+ }
2043
+ /**
2044
+ * @param {string} enc_string
2045
+ * @param {Uint8Array} key
380
2046
  * @returns {string}
381
2047
  */
382
- echo(msg) {
383
- let deferred2_0;
384
- let deferred2_1;
2048
+ static symmetric_decrypt(enc_string, key) {
2049
+ let deferred4_0;
2050
+ let deferred4_1;
385
2051
  try {
386
2052
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
387
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2053
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
388
2054
  const len0 = WASM_VECTOR_LEN;
389
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
2055
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2056
+ const len1 = WASM_VECTOR_LEN;
2057
+ wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
390
2058
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
391
2059
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
392
- deferred2_0 = r0;
393
- deferred2_1 = r1;
394
- return getStringFromWasm0(r0, r1);
2060
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2061
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2062
+ var ptr3 = r0;
2063
+ var len3 = r1;
2064
+ if (r3) {
2065
+ ptr3 = 0;
2066
+ len3 = 0;
2067
+ throw takeObject(r2);
2068
+ }
2069
+ deferred4_0 = ptr3;
2070
+ deferred4_1 = len3;
2071
+ return getStringFromWasm0(ptr3, len3);
2072
+ } finally {
2073
+ wasm.__wbindgen_add_to_stack_pointer(16);
2074
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
2075
+ }
2076
+ }
2077
+ /**
2078
+ * @param {string} enc_string
2079
+ * @param {Uint8Array} key
2080
+ * @returns {Uint8Array}
2081
+ */
2082
+ static symmetric_decrypt_to_bytes(enc_string, key) {
2083
+ try {
2084
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2085
+ const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2086
+ const len0 = WASM_VECTOR_LEN;
2087
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2088
+ const len1 = WASM_VECTOR_LEN;
2089
+ wasm.purecrypto_symmetric_decrypt_to_bytes(retptr, ptr0, len0, ptr1, len1);
2090
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2091
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2092
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2093
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2094
+ if (r3) {
2095
+ throw takeObject(r2);
2096
+ }
2097
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2098
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2099
+ return v3;
2100
+ } finally {
2101
+ wasm.__wbindgen_add_to_stack_pointer(16);
2102
+ }
2103
+ }
2104
+ /**
2105
+ * @param {Uint8Array} enc_bytes
2106
+ * @param {Uint8Array} key
2107
+ * @returns {Uint8Array}
2108
+ */
2109
+ static symmetric_decrypt_array_buffer(enc_bytes, key) {
2110
+ try {
2111
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2112
+ const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
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_array_buffer(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
+ if (r3) {
2122
+ throw takeObject(r2);
2123
+ }
2124
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
2125
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
2126
+ return v3;
395
2127
  } finally {
396
2128
  wasm.__wbindgen_add_to_stack_pointer(16);
397
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
398
2129
  }
399
2130
  }
400
2131
  /**
2132
+ * @param {string} plain
2133
+ * @param {Uint8Array} key
401
2134
  * @returns {string}
402
2135
  */
403
- version() {
404
- let deferred1_0;
405
- let deferred1_1;
2136
+ static symmetric_encrypt(plain, key) {
2137
+ let deferred4_0;
2138
+ let deferred4_1;
406
2139
  try {
407
2140
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
2141
+ const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2142
+ const len0 = WASM_VECTOR_LEN;
2143
+ const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
2144
+ const len1 = WASM_VECTOR_LEN;
2145
+ wasm.purecrypto_symmetric_encrypt(retptr, ptr0, len0, ptr1, len1);
409
2146
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
410
2147
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
411
- deferred1_0 = r0;
412
- deferred1_1 = r1;
413
- return getStringFromWasm0(r0, r1);
2148
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2149
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
2150
+ var ptr3 = r0;
2151
+ var len3 = r1;
2152
+ if (r3) {
2153
+ ptr3 = 0;
2154
+ len3 = 0;
2155
+ throw takeObject(r2);
2156
+ }
2157
+ deferred4_0 = ptr3;
2158
+ deferred4_1 = len3;
2159
+ return getStringFromWasm0(ptr3, len3);
414
2160
  } finally {
415
2161
  wasm.__wbindgen_add_to_stack_pointer(16);
416
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2162
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
417
2163
  }
418
2164
  }
419
2165
  /**
420
- * @param {string} msg
421
- * @returns {Promise<void>}
2166
+ * @param {Uint8Array} plain
2167
+ * @param {Uint8Array} key
2168
+ * @returns {Uint8Array}
422
2169
  */
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);
2170
+ static symmetric_encrypt_to_array_buffer(plain, key) {
2171
+ try {
2172
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2173
+ const ptr0 = passArray8ToWasm0(plain, 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_encrypt_to_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
+ module.exports.PureCrypto = PureCrypto;
2194
+
2195
+ const ReceiveErrorFinalization =
2196
+ typeof FinalizationRegistry === "undefined"
2197
+ ? { register: () => {}, unregister: () => {} }
2198
+ : new FinalizationRegistry((ptr) => wasm.__wbg_receiveerror_free(ptr >>> 0, 1));
2199
+
2200
+ class ReceiveError {
2201
+ static __wrap(ptr) {
2202
+ ptr = ptr >>> 0;
2203
+ const obj = Object.create(ReceiveError.prototype);
2204
+ obj.__wbg_ptr = ptr;
2205
+ ReceiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
2206
+ return obj;
2207
+ }
2208
+
2209
+ __destroy_into_raw() {
2210
+ const ptr = this.__wbg_ptr;
2211
+ this.__wbg_ptr = 0;
2212
+ ReceiveErrorFinalization.unregister(this);
2213
+ return ptr;
2214
+ }
2215
+
2216
+ free() {
2217
+ const ptr = this.__destroy_into_raw();
2218
+ wasm.__wbg_receiveerror_free(ptr, 0);
428
2219
  }
429
2220
  /**
430
- * Test method, calls http endpoint
431
- * @param {string} url
432
- * @returns {Promise<string>}
2221
+ * @returns {boolean}
433
2222
  */
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);
2223
+ get timeout() {
2224
+ const ret = wasm.__wbg_get_receiveerror_timeout(this.__wbg_ptr);
2225
+ return ret !== 0;
2226
+ }
2227
+ /**
2228
+ * @param {boolean} arg0
2229
+ */
2230
+ set timeout(arg0) {
2231
+ wasm.__wbg_set_receiveerror_timeout(this.__wbg_ptr, arg0);
2232
+ }
2233
+ /**
2234
+ * @returns {any}
2235
+ */
2236
+ get crypto() {
2237
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
438
2238
  return takeObject(ret);
439
2239
  }
440
2240
  /**
441
- * @returns {ClientCrypto}
2241
+ * @param {any} arg0
442
2242
  */
443
- crypto() {
444
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
445
- return ClientCrypto.__wrap(ret);
2243
+ set crypto(arg0) {
2244
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
446
2245
  }
447
2246
  /**
448
- * @returns {ClientVault}
2247
+ * @returns {any}
449
2248
  */
450
- vault() {
451
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
452
- return ClientVault.__wrap(ret);
2249
+ get communication() {
2250
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
2251
+ return takeObject(ret);
2252
+ }
2253
+ /**
2254
+ * @param {any} arg0
2255
+ */
2256
+ set communication(arg0) {
2257
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
453
2258
  }
454
2259
  }
455
- module.exports.BitwardenClient = BitwardenClient;
2260
+ module.exports.ReceiveError = ReceiveError;
456
2261
 
457
- const ClientCryptoFinalization =
2262
+ const SendErrorFinalization =
458
2263
  typeof FinalizationRegistry === "undefined"
459
2264
  ? { register: () => {}, unregister: () => {} }
460
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
2265
+ : new FinalizationRegistry((ptr) => wasm.__wbg_senderror_free(ptr >>> 0, 1));
461
2266
 
462
- class ClientCrypto {
2267
+ class SendError {
463
2268
  static __wrap(ptr) {
464
2269
  ptr = ptr >>> 0;
465
- const obj = Object.create(ClientCrypto.prototype);
2270
+ const obj = Object.create(SendError.prototype);
466
2271
  obj.__wbg_ptr = ptr;
467
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
2272
+ SendErrorFinalization.register(obj, obj.__wbg_ptr, obj);
468
2273
  return obj;
469
2274
  }
470
2275
 
471
2276
  __destroy_into_raw() {
472
2277
  const ptr = this.__wbg_ptr;
473
2278
  this.__wbg_ptr = 0;
474
- ClientCryptoFinalization.unregister(this);
2279
+ SendErrorFinalization.unregister(this);
475
2280
  return ptr;
476
2281
  }
477
2282
 
478
2283
  free() {
479
2284
  const ptr = this.__destroy_into_raw();
480
- wasm.__wbg_clientcrypto_free(ptr, 0);
2285
+ wasm.__wbg_senderror_free(ptr, 0);
481
2286
  }
482
2287
  /**
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>}
2288
+ * @returns {any}
487
2289
  */
488
- initialize_user_crypto(req) {
489
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
2290
+ get crypto() {
2291
+ const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
490
2292
  return takeObject(ret);
491
2293
  }
492
2294
  /**
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>}
2295
+ * @param {any} arg0
497
2296
  */
498
- initialize_org_crypto(req) {
499
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
2297
+ set crypto(arg0) {
2298
+ wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
2299
+ }
2300
+ /**
2301
+ * @returns {any}
2302
+ */
2303
+ get communication() {
2304
+ const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
500
2305
  return takeObject(ret);
501
2306
  }
2307
+ /**
2308
+ * @param {any} arg0
2309
+ */
2310
+ set communication(arg0) {
2311
+ wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
2312
+ }
502
2313
  }
503
- module.exports.ClientCrypto = ClientCrypto;
2314
+ module.exports.SendError = SendError;
504
2315
 
505
- const ClientFoldersFinalization =
2316
+ const TotpClientFinalization =
506
2317
  typeof FinalizationRegistry === "undefined"
507
2318
  ? { register: () => {}, unregister: () => {} }
508
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
2319
+ : new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
509
2320
 
510
- class ClientFolders {
2321
+ class TotpClient {
511
2322
  static __wrap(ptr) {
512
2323
  ptr = ptr >>> 0;
513
- const obj = Object.create(ClientFolders.prototype);
2324
+ const obj = Object.create(TotpClient.prototype);
514
2325
  obj.__wbg_ptr = ptr;
515
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
2326
+ TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
516
2327
  return obj;
517
2328
  }
518
2329
 
519
2330
  __destroy_into_raw() {
520
2331
  const ptr = this.__wbg_ptr;
521
2332
  this.__wbg_ptr = 0;
522
- ClientFoldersFinalization.unregister(this);
2333
+ TotpClientFinalization.unregister(this);
523
2334
  return ptr;
524
2335
  }
525
2336
 
526
2337
  free() {
527
2338
  const ptr = this.__destroy_into_raw();
528
- wasm.__wbg_clientfolders_free(ptr, 0);
2339
+ wasm.__wbg_totpclient_free(ptr, 0);
529
2340
  }
530
2341
  /**
531
- * Decrypt folder
532
- * @param {Folder} folder
533
- * @returns {FolderView}
2342
+ * Generates a TOTP code from a provided key
2343
+ *
2344
+ * # Arguments
2345
+ * - `key` - Can be:
2346
+ * - A base32 encoded string
2347
+ * - OTP Auth URI
2348
+ * - Steam URI
2349
+ * - `time_ms` - Optional timestamp in milliseconds
2350
+ *
2351
+ * # Returns
2352
+ * - `Ok(TotpResponse)` containing the generated code and period
2353
+ * - `Err(TotpError)` if code generation fails
2354
+ * @param {string} key
2355
+ * @param {number | null} [time_ms]
2356
+ * @returns {TotpResponse}
534
2357
  */
535
- decrypt(folder) {
2358
+ generate_totp(key, time_ms) {
536
2359
  try {
537
2360
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
2361
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2362
+ const len0 = WASM_VECTOR_LEN;
2363
+ wasm.totpclient_generate_totp(
2364
+ retptr,
2365
+ this.__wbg_ptr,
2366
+ ptr0,
2367
+ len0,
2368
+ !isLikeNone(time_ms),
2369
+ isLikeNone(time_ms) ? 0 : time_ms,
2370
+ );
539
2371
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
540
2372
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
541
2373
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -548,226 +2380,247 @@ class ClientFolders {
548
2380
  }
549
2381
  }
550
2382
  }
551
- module.exports.ClientFolders = ClientFolders;
2383
+ module.exports.TotpClient = TotpClient;
552
2384
 
553
- const ClientVaultFinalization =
2385
+ const VaultClientFinalization =
554
2386
  typeof FinalizationRegistry === "undefined"
555
2387
  ? { register: () => {}, unregister: () => {} }
556
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
2388
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
557
2389
 
558
- class ClientVault {
2390
+ class VaultClient {
559
2391
  static __wrap(ptr) {
560
2392
  ptr = ptr >>> 0;
561
- const obj = Object.create(ClientVault.prototype);
2393
+ const obj = Object.create(VaultClient.prototype);
562
2394
  obj.__wbg_ptr = ptr;
563
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
2395
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
564
2396
  return obj;
565
2397
  }
566
2398
 
567
2399
  __destroy_into_raw() {
568
2400
  const ptr = this.__wbg_ptr;
569
2401
  this.__wbg_ptr = 0;
570
- ClientVaultFinalization.unregister(this);
2402
+ VaultClientFinalization.unregister(this);
571
2403
  return ptr;
572
2404
  }
573
2405
 
574
2406
  free() {
575
2407
  const ptr = this.__destroy_into_raw();
576
- wasm.__wbg_clientvault_free(ptr, 0);
2408
+ wasm.__wbg_vaultclient_free(ptr, 0);
2409
+ }
2410
+ /**
2411
+ * @returns {AttachmentsClient}
2412
+ */
2413
+ attachments() {
2414
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2415
+ return AttachmentsClient.__wrap(ret);
577
2416
  }
578
2417
  /**
579
- * @returns {ClientFolders}
2418
+ * @returns {CiphersClient}
2419
+ */
2420
+ ciphers() {
2421
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2422
+ return CiphersClient.__wrap(ret);
2423
+ }
2424
+ /**
2425
+ * @returns {FoldersClient}
580
2426
  */
581
2427
  folders() {
582
- const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
583
- return ClientFolders.__wrap(ret);
2428
+ const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2429
+ return FoldersClient.__wrap(ret);
584
2430
  }
585
- }
586
- module.exports.ClientVault = ClientVault;
587
-
588
- module.exports.__wbg_new_fe19e4f3db5c3999 = function (arg0, arg1) {
589
- let deferred0_0;
590
- let deferred0_1;
591
- try {
592
- deferred0_0 = arg0;
593
- deferred0_1 = arg1;
594
- const ret = new Error(getStringFromWasm0(arg0, arg1));
595
- return addHeapObject(ret);
596
- } finally {
597
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2431
+ /**
2432
+ * @returns {TotpClient}
2433
+ */
2434
+ totp() {
2435
+ const ret = wasm.vaultclient_totp(this.__wbg_ptr);
2436
+ return TotpClient.__wrap(ret);
598
2437
  }
599
- };
2438
+ }
2439
+ module.exports.VaultClient = VaultClient;
600
2440
 
601
- module.exports.__wbg_setname_46d623c31ae39910 = function (arg0, arg1, arg2) {
602
- let deferred0_0;
603
- let deferred0_1;
604
- try {
605
- deferred0_0 = arg1;
606
- deferred0_1 = arg2;
607
- getObject(arg0).name = getStringFromWasm0(arg1, arg2);
608
- } finally {
609
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
610
- }
2441
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
2442
+ const ret = String(getObject(arg1));
2443
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2444
+ const len1 = WASM_VECTOR_LEN;
2445
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2446
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
611
2447
  };
612
2448
 
613
- module.exports.__wbg_setvariant_262a12673324f71b = function (arg0, arg1, arg2) {
614
- let deferred0_0;
615
- let deferred0_1;
616
- try {
617
- deferred0_0 = arg1;
618
- deferred0_1 = arg2;
619
- getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
620
- } finally {
621
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
622
- }
2449
+ module.exports.__wbg_abort_410ec47a64ac6117 = function (arg0, arg1) {
2450
+ getObject(arg0).abort(getObject(arg1));
623
2451
  };
624
2452
 
625
- module.exports.__wbindgen_string_new = function (arg0, arg1) {
626
- const ret = getStringFromWasm0(arg0, arg1);
627
- return addHeapObject(ret);
2453
+ module.exports.__wbg_abort_775ef1d17fc65868 = function (arg0) {
2454
+ getObject(arg0).abort();
628
2455
  };
629
2456
 
630
- module.exports.__wbg_get_ef828680c64da212 = function () {
631
- return handleError(function (arg0, arg1) {
632
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
633
- return addHeapObject(ret);
2457
+ module.exports.__wbg_append_299d5d48292c0495 = function () {
2458
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2459
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
634
2460
  }, arguments);
635
2461
  };
636
2462
 
637
- module.exports.__wbindgen_object_drop_ref = function (arg0) {
638
- takeObject(arg0);
639
- };
640
-
641
- module.exports.__wbindgen_string_get = function (arg0, arg1) {
642
- const obj = getObject(arg1);
643
- const ret = typeof obj === "string" ? obj : undefined;
644
- var ptr1 = isLikeNone(ret)
645
- ? 0
646
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
647
- var len1 = WASM_VECTOR_LEN;
648
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
649
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2463
+ module.exports.__wbg_append_8c7dd8d641a5f01b = function () {
2464
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
2465
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2466
+ }, arguments);
650
2467
  };
651
2468
 
652
- module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
653
- const ret = getObject(arg0) == getObject(arg1);
654
- return ret;
2469
+ module.exports.__wbg_append_b2d1fc16de2a0e81 = function () {
2470
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
2471
+ getObject(arg0).append(
2472
+ getStringFromWasm0(arg1, arg2),
2473
+ getObject(arg3),
2474
+ getStringFromWasm0(arg4, arg5),
2475
+ );
2476
+ }, arguments);
655
2477
  };
656
2478
 
657
- module.exports.__wbindgen_is_object = function (arg0) {
658
- const val = getObject(arg0);
659
- const ret = typeof val === "object" && val !== null;
660
- return ret;
2479
+ module.exports.__wbg_append_b44785ebeb668479 = function () {
2480
+ return handleError(function (arg0, arg1, arg2, arg3) {
2481
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
2482
+ }, arguments);
661
2483
  };
662
2484
 
663
- module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
664
- const ret = getObject(arg0)[getObject(arg1)];
2485
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
2486
+ const ret = getObject(arg0).buffer;
665
2487
  return addHeapObject(ret);
666
2488
  };
667
2489
 
668
- module.exports.__wbindgen_is_undefined = function (arg0) {
669
- const ret = getObject(arg0) === undefined;
670
- return ret;
2490
+ module.exports.__wbg_call_672a4d21634d4a24 = function () {
2491
+ return handleError(function (arg0, arg1) {
2492
+ const ret = getObject(arg0).call(getObject(arg1));
2493
+ return addHeapObject(ret);
2494
+ }, arguments);
671
2495
  };
672
2496
 
673
- module.exports.__wbindgen_in = function (arg0, arg1) {
674
- const ret = getObject(arg0) in getObject(arg1);
675
- return ret;
2497
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
2498
+ return handleError(function (arg0, arg1, arg2) {
2499
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2500
+ return addHeapObject(ret);
2501
+ }, arguments);
676
2502
  };
677
2503
 
678
- module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function (arg0) {
679
- const ret = Number.isSafeInteger(getObject(arg0));
680
- return ret;
2504
+ module.exports.__wbg_clearTimeout_86721db0036bea98 = function (arg0) {
2505
+ const ret = clearTimeout(takeObject(arg0));
2506
+ return addHeapObject(ret);
681
2507
  };
682
2508
 
683
- module.exports.__wbindgen_as_number = function (arg0) {
684
- const ret = +getObject(arg0);
685
- return ret;
2509
+ module.exports.__wbg_crypto_574e78ad8b13b65f = function (arg0) {
2510
+ const ret = getObject(arg0).crypto;
2511
+ return addHeapObject(ret);
686
2512
  };
687
2513
 
688
- module.exports.__wbindgen_is_string = function (arg0) {
689
- const ret = typeof getObject(arg0) === "string";
2514
+ module.exports.__wbg_debug_e17b51583ca6a632 = function (arg0, arg1, arg2, arg3) {
2515
+ console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
2516
+ };
2517
+
2518
+ module.exports.__wbg_done_769e5ede4b31c67b = function (arg0) {
2519
+ const ret = getObject(arg0).done;
690
2520
  return ret;
691
2521
  };
692
2522
 
693
- module.exports.__wbg_entries_c02034de337d3ee2 = function (arg0) {
2523
+ module.exports.__wbg_entries_3265d4158b33e5dc = function (arg0) {
694
2524
  const ret = Object.entries(getObject(arg0));
695
2525
  return addHeapObject(ret);
696
2526
  };
697
2527
 
698
- module.exports.__wbg_length_f217bbbf7e8e4df4 = function (arg0) {
699
- const ret = getObject(arg0).length;
700
- return ret;
2528
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
2529
+ let deferred0_0;
2530
+ let deferred0_1;
2531
+ try {
2532
+ deferred0_0 = arg0;
2533
+ deferred0_1 = arg1;
2534
+ console.error(getStringFromWasm0(arg0, arg1));
2535
+ } finally {
2536
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2537
+ }
701
2538
  };
702
2539
 
703
- module.exports.__wbg_get_5419cf6b954aa11d = function (arg0, arg1) {
704
- const ret = getObject(arg0)[arg1 >>> 0];
705
- return addHeapObject(ret);
2540
+ module.exports.__wbg_error_80de38b3f7cc3c3c = function (arg0, arg1, arg2, arg3) {
2541
+ console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
706
2542
  };
707
2543
 
708
- module.exports.__wbg_call_3bfa248576352471 = function () {
709
- return handleError(function (arg0, arg1, arg2) {
710
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
711
- return addHeapObject(ret);
712
- }, arguments);
2544
+ module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
2545
+ const ret = getObject(arg0).fetch(getObject(arg1));
2546
+ return addHeapObject(ret);
713
2547
  };
714
2548
 
715
- module.exports.__wbindgen_object_clone_ref = function (arg0) {
716
- const ret = getObject(arg0);
2549
+ module.exports.__wbg_fetch_d36a73832f0a45e8 = function (arg0) {
2550
+ const ret = fetch(getObject(arg0));
717
2551
  return addHeapObject(ret);
718
2552
  };
719
2553
 
720
- module.exports.__wbg_new_e69b5f66fda8f13c = function () {
721
- const ret = new Object();
722
- return addHeapObject(ret);
2554
+ module.exports.__wbg_getRandomValues_3d90134a348e46b3 = function () {
2555
+ return handleError(function (arg0, arg1) {
2556
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
2557
+ }, arguments);
723
2558
  };
724
2559
 
725
- module.exports.__wbg_setmethod_ce2da76000b02f6a = function (arg0, arg1, arg2) {
726
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2560
+ module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function () {
2561
+ return handleError(function (arg0, arg1) {
2562
+ getObject(arg0).getRandomValues(getObject(arg1));
2563
+ }, arguments);
727
2564
  };
728
2565
 
729
- module.exports.__wbg_new_a9ae04a5200606a5 = function () {
730
- return handleError(function () {
731
- const ret = new Headers();
2566
+ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
2567
+ const ret = getObject(arg0).getTime();
2568
+ return ret;
2569
+ };
2570
+
2571
+ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
2572
+ return handleError(function (arg0, arg1) {
2573
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
732
2574
  return addHeapObject(ret);
733
2575
  }, arguments);
734
2576
  };
735
2577
 
736
- module.exports.__wbg_setheaders_f5205d36e423a544 = function (arg0, arg1) {
737
- getObject(arg0).headers = getObject(arg1);
2578
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
2579
+ const ret = getObject(arg0)[arg1 >>> 0];
2580
+ return addHeapObject(ret);
738
2581
  };
739
2582
 
740
- module.exports.__wbg_setmode_4919fd636102c586 = function (arg0, arg1) {
741
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
2583
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
2584
+ const ret = getObject(arg0)[getObject(arg1)];
2585
+ return addHeapObject(ret);
742
2586
  };
743
2587
 
744
- module.exports.__wbg_setcredentials_a4e661320cdb9738 = function (arg0, arg1) {
745
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
2588
+ module.exports.__wbg_has_a5ea9117f258a0ec = function () {
2589
+ return handleError(function (arg0, arg1) {
2590
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
2591
+ return ret;
2592
+ }, arguments);
746
2593
  };
747
2594
 
748
- module.exports.__wbg_setbody_aa8b691bec428bf4 = function (arg0, arg1) {
749
- getObject(arg0).body = getObject(arg1);
2595
+ module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
2596
+ const ret = getObject(arg0).headers;
2597
+ return addHeapObject(ret);
750
2598
  };
751
2599
 
752
- module.exports.__wbg_signal_9acfcec9e7dffc22 = function (arg0) {
753
- const ret = getObject(arg0).signal;
2600
+ module.exports.__wbg_incomingmessage_new = function (arg0) {
2601
+ const ret = IncomingMessage.__wrap(arg0);
754
2602
  return addHeapObject(ret);
755
2603
  };
756
2604
 
757
- module.exports.__wbg_setsignal_812ccb8269a7fd90 = function (arg0, arg1) {
758
- getObject(arg0).signal = getObject(arg1);
2605
+ module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
2606
+ console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
759
2607
  };
760
2608
 
761
- module.exports.__wbg_append_8b3e7f74a47ea7d5 = function () {
762
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
763
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
764
- }, arguments);
2609
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
2610
+ let result;
2611
+ try {
2612
+ result = getObject(arg0) instanceof ArrayBuffer;
2613
+ } catch (_) {
2614
+ result = false;
2615
+ }
2616
+ const ret = result;
2617
+ return ret;
765
2618
  };
766
2619
 
767
- module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
2620
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function (arg0) {
768
2621
  let result;
769
2622
  try {
770
- result = getObject(arg0) instanceof Response;
2623
+ result = getObject(arg0) instanceof Map;
771
2624
  } catch (_) {
772
2625
  result = false;
773
2626
  }
@@ -775,82 +2628,87 @@ module.exports.__wbg_instanceof_Response_3c0e210a57ff751d = function (arg0) {
775
2628
  return ret;
776
2629
  };
777
2630
 
778
- module.exports.__wbg_status_5f4e900d22140a18 = function (arg0) {
779
- const ret = getObject(arg0).status;
2631
+ module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
2632
+ let result;
2633
+ try {
2634
+ result = getObject(arg0) instanceof Response;
2635
+ } catch (_) {
2636
+ result = false;
2637
+ }
2638
+ const ret = result;
780
2639
  return ret;
781
2640
  };
782
2641
 
783
- module.exports.__wbg_url_58af972663531d16 = function (arg0, arg1) {
784
- const ret = getObject(arg1).url;
785
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
786
- const len1 = WASM_VECTOR_LEN;
787
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
788
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2642
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
2643
+ let result;
2644
+ try {
2645
+ result = getObject(arg0) instanceof Uint8Array;
2646
+ } catch (_) {
2647
+ result = false;
2648
+ }
2649
+ const ret = result;
2650
+ return ret;
789
2651
  };
790
2652
 
791
- module.exports.__wbg_headers_1b9bf90c73fae600 = function (arg0) {
792
- const ret = getObject(arg0).headers;
2653
+ module.exports.__wbg_ipcclientsubscription_new = function (arg0) {
2654
+ const ret = IpcClientSubscription.__wrap(arg0);
793
2655
  return addHeapObject(ret);
794
2656
  };
795
2657
 
796
- module.exports.__wbg_next_b06e115d1b01e10b = function () {
797
- return handleError(function (arg0) {
798
- const ret = getObject(arg0).next();
799
- return addHeapObject(ret);
800
- }, arguments);
2658
+ module.exports.__wbg_isArray_a1eab7e0d067391b = function (arg0) {
2659
+ const ret = Array.isArray(getObject(arg0));
2660
+ return ret;
801
2661
  };
802
2662
 
803
- module.exports.__wbg_done_983b5ffcaec8c583 = function (arg0) {
804
- const ret = getObject(arg0).done;
2663
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
2664
+ const ret = Number.isSafeInteger(getObject(arg0));
805
2665
  return ret;
806
2666
  };
807
2667
 
808
- module.exports.__wbg_value_2ab8a198c834c26a = function (arg0) {
809
- const ret = getObject(arg0).value;
2668
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function () {
2669
+ const ret = Symbol.iterator;
810
2670
  return addHeapObject(ret);
811
2671
  };
812
2672
 
813
- module.exports.__wbg_stringify_eead5648c09faaf8 = function () {
814
- return handleError(function (arg0) {
815
- const ret = JSON.stringify(getObject(arg0));
816
- return addHeapObject(ret);
817
- }, arguments);
2673
+ module.exports.__wbg_length_a446193dc22c12f8 = function (arg0) {
2674
+ const ret = getObject(arg0).length;
2675
+ return ret;
818
2676
  };
819
2677
 
820
- module.exports.__wbg_abort_c57daab47a6c1215 = function (arg0) {
821
- getObject(arg0).abort();
2678
+ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
2679
+ const ret = getObject(arg0).length;
2680
+ return ret;
822
2681
  };
823
2682
 
824
- module.exports.__wbg_text_ebeee8b31af4c919 = function () {
825
- return handleError(function (arg0) {
826
- const ret = getObject(arg0).text();
827
- return addHeapObject(ret);
828
- }, arguments);
2683
+ module.exports.__wbg_log_cad59bb680daec67 = function (arg0, arg1, arg2, arg3) {
2684
+ console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
829
2685
  };
830
2686
 
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;
2687
+ module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function (arg0) {
2688
+ const ret = getObject(arg0).msCrypto;
2689
+ return addHeapObject(ret);
839
2690
  };
840
2691
 
841
- module.exports.__wbindgen_error_new = function (arg0, arg1) {
842
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2692
+ module.exports.__wbg_new0_f788a2397c7ca929 = function () {
2693
+ const ret = new Date();
843
2694
  return addHeapObject(ret);
844
2695
  };
845
2696
 
846
- module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
2697
+ module.exports.__wbg_new_018dcc2d6c8c2f6a = function () {
2698
+ return handleError(function () {
2699
+ const ret = new Headers();
2700
+ return addHeapObject(ret);
2701
+ }, arguments);
2702
+ };
2703
+
2704
+ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
847
2705
  try {
848
2706
  var state0 = { a: arg0, b: arg1 };
849
2707
  var cb0 = (arg0, arg1) => {
850
2708
  const a = state0.a;
851
2709
  state0.a = 0;
852
2710
  try {
853
- return __wbg_adapter_125(a, state0.b, arg0, arg1);
2711
+ return __wbg_adapter_238(a, state0.b, arg0, arg1);
854
2712
  } finally {
855
2713
  state0.a = a;
856
2714
  }
@@ -862,287 +2720,343 @@ module.exports.__wbg_new_1073970097e5a420 = function (arg0, arg1) {
862
2720
  }
863
2721
  };
864
2722
 
865
- module.exports.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
866
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2723
+ module.exports.__wbg_new_405e22f390576ce2 = function () {
2724
+ const ret = new Object();
2725
+ return addHeapObject(ret);
2726
+ };
2727
+
2728
+ module.exports.__wbg_new_78feb108b6472713 = function () {
2729
+ const ret = new Array();
2730
+ return addHeapObject(ret);
867
2731
  };
868
2732
 
869
- module.exports.__wbg_new_abda76e883ba8a5f = function () {
2733
+ module.exports.__wbg_new_8a6f238a6ece86ea = function () {
870
2734
  const ret = new Error();
871
2735
  return addHeapObject(ret);
872
2736
  };
873
2737
 
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);
2738
+ module.exports.__wbg_new_9fd39a253424609a = function () {
2739
+ return handleError(function () {
2740
+ const ret = new FormData();
2741
+ return addHeapObject(ret);
2742
+ }, arguments);
2743
+ };
2744
+
2745
+ module.exports.__wbg_new_a12002a7f91c75be = function (arg0) {
2746
+ const ret = new Uint8Array(getObject(arg0));
2747
+ return addHeapObject(ret);
2748
+ };
2749
+
2750
+ module.exports.__wbg_new_c68d7209be747379 = function (arg0, arg1) {
2751
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2752
+ return addHeapObject(ret);
880
2753
  };
881
2754
 
882
- module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
2755
+ module.exports.__wbg_new_e25e5aab09ff45db = function () {
2756
+ return handleError(function () {
2757
+ const ret = new AbortController();
2758
+ return addHeapObject(ret);
2759
+ }, arguments);
2760
+ };
2761
+
2762
+ module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
883
2763
  let deferred0_0;
884
2764
  let deferred0_1;
885
2765
  try {
886
2766
  deferred0_0 = arg0;
887
2767
  deferred0_1 = arg1;
888
- console.error(getStringFromWasm0(arg0, arg1));
2768
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2769
+ return addHeapObject(ret);
889
2770
  } finally {
890
2771
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
891
2772
  }
892
2773
  };
893
2774
 
894
- module.exports.__wbg_crypto_1d1f22824a6a080c = function (arg0) {
895
- const ret = getObject(arg0).crypto;
2775
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) {
2776
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
896
2777
  return addHeapObject(ret);
897
2778
  };
898
2779
 
899
- module.exports.__wbg_process_4a72847cc503995b = function (arg0) {
900
- const ret = getObject(arg0).process;
2780
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
2781
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
901
2782
  return addHeapObject(ret);
902
2783
  };
903
2784
 
904
- module.exports.__wbg_versions_f686565e586dd935 = function (arg0) {
905
- const ret = getObject(arg0).versions;
2785
+ module.exports.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
2786
+ const ret = new Uint8Array(arg0 >>> 0);
2787
+ return addHeapObject(ret);
2788
+ };
2789
+
2790
+ module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function () {
2791
+ return handleError(function (arg0, arg1, arg2) {
2792
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
2793
+ return addHeapObject(ret);
2794
+ }, arguments);
2795
+ };
2796
+
2797
+ module.exports.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function () {
2798
+ return handleError(function (arg0, arg1) {
2799
+ const ret = new Blob(getObject(arg0), getObject(arg1));
2800
+ return addHeapObject(ret);
2801
+ }, arguments);
2802
+ };
2803
+
2804
+ module.exports.__wbg_next_25feadfc0913fea9 = function (arg0) {
2805
+ const ret = getObject(arg0).next;
906
2806
  return addHeapObject(ret);
907
2807
  };
908
2808
 
909
- module.exports.__wbg_node_104a2ff8d6ea03a2 = function (arg0) {
2809
+ module.exports.__wbg_next_6574e1a8a62d1055 = function () {
2810
+ return handleError(function (arg0) {
2811
+ const ret = getObject(arg0).next();
2812
+ return addHeapObject(ret);
2813
+ }, arguments);
2814
+ };
2815
+
2816
+ module.exports.__wbg_node_905d3e251edff8a2 = function (arg0) {
910
2817
  const ret = getObject(arg0).node;
911
2818
  return addHeapObject(ret);
912
2819
  };
913
2820
 
914
- module.exports.__wbg_require_cca90b1a94a0255b = function () {
915
- return handleError(function () {
916
- const ret = module.require;
2821
+ module.exports.__wbg_parse_def2e24ef1252aff = function () {
2822
+ return handleError(function (arg0, arg1) {
2823
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
917
2824
  return addHeapObject(ret);
918
2825
  }, arguments);
919
2826
  };
920
2827
 
921
- module.exports.__wbindgen_is_function = function (arg0) {
922
- const ret = typeof getObject(arg0) === "function";
2828
+ module.exports.__wbg_process_dc0fbacc7c1c06f7 = function (arg0) {
2829
+ const ret = getObject(arg0).process;
2830
+ return addHeapObject(ret);
2831
+ };
2832
+
2833
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function (arg0, arg1) {
2834
+ const ret = getObject(arg0).push(getObject(arg1));
923
2835
  return ret;
924
2836
  };
925
2837
 
926
- module.exports.__wbg_msCrypto_eb05e62b530a1508 = function (arg0) {
927
- const ret = getObject(arg0).msCrypto;
928
- return addHeapObject(ret);
2838
+ module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function (arg0) {
2839
+ queueMicrotask(getObject(arg0));
929
2840
  };
930
2841
 
931
- module.exports.__wbg_newwithlength_76462a666eca145f = function (arg0) {
932
- const ret = new Uint8Array(arg0 >>> 0);
2842
+ module.exports.__wbg_queueMicrotask_d3219def82552485 = function (arg0) {
2843
+ const ret = getObject(arg0).queueMicrotask;
933
2844
  return addHeapObject(ret);
934
2845
  };
935
2846
 
936
- module.exports.__wbindgen_memory = function () {
937
- const ret = wasm.memory;
938
- return addHeapObject(ret);
2847
+ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
2848
+ return handleError(function (arg0, arg1) {
2849
+ getObject(arg0).randomFillSync(takeObject(arg1));
2850
+ }, arguments);
939
2851
  };
940
2852
 
941
- module.exports.__wbg_buffer_ccaed51a635d8a2d = function (arg0) {
942
- const ret = getObject(arg0).buffer;
2853
+ module.exports.__wbg_receiveerror_new = function (arg0) {
2854
+ const ret = ReceiveError.__wrap(arg0);
943
2855
  return addHeapObject(ret);
944
2856
  };
945
2857
 
946
- module.exports.__wbg_newwithbyteoffsetandlength_7e3eb787208af730 = function (arg0, arg1, arg2) {
947
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2858
+ module.exports.__wbg_require_60cc747a6bc5215a = function () {
2859
+ return handleError(function () {
2860
+ const ret = module.require;
2861
+ return addHeapObject(ret);
2862
+ }, arguments);
2863
+ };
2864
+
2865
+ module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
2866
+ const ret = Promise.resolve(getObject(arg0));
948
2867
  return addHeapObject(ret);
949
2868
  };
950
2869
 
951
- module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function () {
2870
+ module.exports.__wbg_send_9b8fc6bb517867dd = function () {
952
2871
  return handleError(function (arg0, arg1) {
953
- getObject(arg0).randomFillSync(takeObject(arg1));
2872
+ const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
2873
+ return addHeapObject(ret);
954
2874
  }, arguments);
955
2875
  };
956
2876
 
957
- module.exports.__wbg_subarray_975a06f9dbd16995 = function (arg0, arg1, arg2) {
958
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2877
+ module.exports.__wbg_senderror_new = function (arg0) {
2878
+ const ret = SendError.__wrap(arg0);
959
2879
  return addHeapObject(ret);
960
2880
  };
961
2881
 
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));
2882
+ module.exports.__wbg_setTimeout_2e707715f8cc9497 = function (arg0, arg1) {
2883
+ const ret = setTimeout(getObject(arg0), arg1);
970
2884
  return addHeapObject(ret);
971
2885
  };
972
2886
 
973
- module.exports.__wbg_set_ec2fcf81bc573fd9 = function (arg0, arg1, arg2) {
974
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
2887
+ module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
2888
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
975
2889
  };
976
2890
 
977
- module.exports.__wbg_self_bf91bf94d9e04084 = function () {
978
- return handleError(function () {
979
- const ret = self.self;
980
- return addHeapObject(ret);
981
- }, arguments);
2891
+ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
2892
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
982
2893
  };
983
2894
 
984
- module.exports.__wbg_window_52dd9f07d03fd5f8 = function () {
985
- return handleError(function () {
986
- const ret = window.window;
987
- return addHeapObject(ret);
988
- }, arguments);
2895
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
2896
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
989
2897
  };
990
2898
 
991
- module.exports.__wbg_globalThis_05c129bf37fcf1be = function () {
992
- return handleError(function () {
993
- const ret = globalThis.globalThis;
994
- return addHeapObject(ret);
995
- }, arguments);
2899
+ module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
2900
+ getObject(arg0).body = getObject(arg1);
996
2901
  };
997
2902
 
998
- module.exports.__wbg_global_3eca19bb09e9c484 = function () {
999
- return handleError(function () {
1000
- const ret = global.global;
1001
- return addHeapObject(ret);
1002
- }, arguments);
2903
+ module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function (arg0, arg1) {
2904
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1003
2905
  };
1004
2906
 
1005
- module.exports.__wbg_newnoargs_1ede4bf2ebbaaf43 = function (arg0, arg1) {
1006
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1007
- return addHeapObject(ret);
2907
+ module.exports.__wbg_setheaders_834c0bdb6a8949ad = function (arg0, arg1) {
2908
+ getObject(arg0).headers = getObject(arg1);
1008
2909
  };
1009
2910
 
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);
2911
+ module.exports.__wbg_setmethod_3c5280fe5d890842 = function (arg0, arg1, arg2) {
2912
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1015
2913
  };
1016
2914
 
1017
- module.exports.__wbg_iterator_695d699a44d6234c = function () {
1018
- const ret = Symbol.iterator;
1019
- return addHeapObject(ret);
2915
+ module.exports.__wbg_setmode_5dc300b865044b65 = function (arg0, arg1) {
2916
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1020
2917
  };
1021
2918
 
1022
- module.exports.__wbg_next_13b477da1eaa3897 = function (arg0) {
1023
- const ret = getObject(arg0).next;
1024
- return addHeapObject(ret);
2919
+ module.exports.__wbg_setname_c0e2d6f348c746f4 = function (arg0, arg1, arg2) {
2920
+ let deferred0_0;
2921
+ let deferred0_1;
2922
+ try {
2923
+ deferred0_0 = arg1;
2924
+ deferred0_1 = arg2;
2925
+ getObject(arg0).name = getStringFromWasm0(arg1, arg2);
2926
+ } finally {
2927
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
2928
+ }
1025
2929
  };
1026
2930
 
1027
- module.exports.__wbg_new_034f913e7636e987 = function () {
1028
- const ret = new Array();
1029
- return addHeapObject(ret);
2931
+ module.exports.__wbg_setsignal_75b21ef3a81de905 = function (arg0, arg1) {
2932
+ getObject(arg0).signal = getObject(arg1);
1030
2933
  };
1031
2934
 
1032
- module.exports.__wbg_push_36cf4d81d7da33d1 = function (arg0, arg1) {
1033
- const ret = getObject(arg0).push(getObject(arg1));
1034
- return ret;
2935
+ module.exports.__wbg_settype_39ed370d3edd403c = function (arg0, arg1, arg2) {
2936
+ getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1035
2937
  };
1036
2938
 
1037
- module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function (arg0) {
1038
- let result;
2939
+ module.exports.__wbg_setvariant_d1d41b778dfe9c17 = function (arg0, arg1, arg2) {
2940
+ let deferred0_0;
2941
+ let deferred0_1;
1039
2942
  try {
1040
- result = getObject(arg0) instanceof ArrayBuffer;
1041
- } catch (_) {
1042
- result = false;
2943
+ deferred0_0 = arg1;
2944
+ deferred0_1 = arg2;
2945
+ getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
2946
+ } finally {
2947
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1043
2948
  }
1044
- const ret = result;
1045
- return ret;
1046
2949
  };
1047
2950
 
1048
- module.exports.__wbg_new_70a2f23d1565c04c = function (arg0, arg1) {
1049
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2951
+ module.exports.__wbg_signal_aaf9ad74119f20a4 = function (arg0) {
2952
+ const ret = getObject(arg0).signal;
1050
2953
  return addHeapObject(ret);
1051
2954
  };
1052
2955
 
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);
2956
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
2957
+ const ret = getObject(arg1).stack;
2958
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2959
+ const len1 = WASM_VECTOR_LEN;
2960
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2961
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1058
2962
  };
1059
2963
 
1060
- module.exports.__wbg_resolve_0aad7c1484731c99 = function (arg0) {
1061
- const ret = Promise.resolve(getObject(arg0));
1062
- return addHeapObject(ret);
2964
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () {
2965
+ const ret = typeof global === "undefined" ? null : global;
2966
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1063
2967
  };
1064
2968
 
1065
- module.exports.__wbg_then_748f75edfb032440 = function (arg0, arg1) {
1066
- const ret = getObject(arg0).then(getObject(arg1));
1067
- return addHeapObject(ret);
2969
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () {
2970
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
2971
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1068
2972
  };
1069
2973
 
1070
- module.exports.__wbg_then_4866a7d9f55d8f3e = function (arg0, arg1, arg2) {
1071
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1072
- return addHeapObject(ret);
2974
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () {
2975
+ const ret = typeof self === "undefined" ? null : self;
2976
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1073
2977
  };
1074
2978
 
1075
- module.exports.__wbg_length_9254c4bd3b9f23c4 = function (arg0) {
1076
- const ret = getObject(arg0).length;
1077
- return ret;
2979
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () {
2980
+ const ret = typeof window === "undefined" ? null : window;
2981
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
1078
2982
  };
1079
2983
 
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;
2984
+ module.exports.__wbg_status_f6360336ca686bf0 = function (arg0) {
2985
+ const ret = getObject(arg0).status;
1088
2986
  return ret;
1089
2987
  };
1090
2988
 
1091
- module.exports.__wbg_new_4e7308fbedde3997 = function () {
1092
- return handleError(function () {
1093
- const ret = new FormData();
2989
+ module.exports.__wbg_stringify_f7ed6987935b4a24 = function () {
2990
+ return handleError(function (arg0) {
2991
+ const ret = JSON.stringify(getObject(arg0));
1094
2992
  return addHeapObject(ret);
1095
2993
  }, arguments);
1096
2994
  };
1097
2995
 
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));
2996
+ module.exports.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) {
2997
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2998
+ return addHeapObject(ret);
2999
+ };
3000
+
3001
+ module.exports.__wbg_text_7805bea50de2af49 = function () {
3002
+ return handleError(function (arg0) {
3003
+ const ret = getObject(arg0).text();
3004
+ return addHeapObject(ret);
1101
3005
  }, arguments);
1102
3006
  };
1103
3007
 
1104
- module.exports.__wbg_settype_623d2ee701e6310a = function (arg0, arg1, arg2) {
1105
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
3008
+ module.exports.__wbg_then_44b73946d2fb3e7d = function (arg0, arg1) {
3009
+ const ret = getObject(arg0).then(getObject(arg1));
3010
+ return addHeapObject(ret);
1106
3011
  };
1107
3012
 
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);
3013
+ module.exports.__wbg_then_48b406749878a531 = function (arg0, arg1, arg2) {
3014
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
3015
+ return addHeapObject(ret);
1113
3016
  };
1114
3017
 
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);
3018
+ module.exports.__wbg_url_ae10c34ca209681d = function (arg0, arg1) {
3019
+ const ret = getObject(arg1).url;
3020
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3021
+ const len1 = WASM_VECTOR_LEN;
3022
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3023
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1119
3024
  };
1120
3025
 
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);
3026
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
3027
+ const ret = getObject(arg0).value;
3028
+ return addHeapObject(ret);
1129
3029
  };
1130
3030
 
1131
- module.exports.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) {
1132
- const ret = fetch(getObject(arg0));
3031
+ module.exports.__wbg_versions_c01dfd4722a88165 = function (arg0) {
3032
+ const ret = getObject(arg0).versions;
1133
3033
  return addHeapObject(ret);
1134
3034
  };
1135
3035
 
1136
- module.exports.__wbg_fetch_1fdc4448ed9eec00 = function (arg0, arg1) {
1137
- const ret = getObject(arg0).fetch(getObject(arg1));
3036
+ module.exports.__wbg_warn_aaf1f4664a035bd6 = function (arg0, arg1, arg2, arg3) {
3037
+ console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3038
+ };
3039
+
3040
+ module.exports.__wbindgen_as_number = function (arg0) {
3041
+ const ret = +getObject(arg0);
3042
+ return ret;
3043
+ };
3044
+
3045
+ module.exports.__wbindgen_bigint_from_i64 = function (arg0) {
3046
+ const ret = arg0;
1138
3047
  return addHeapObject(ret);
1139
3048
  };
1140
3049
 
1141
- module.exports.__wbg_new_75169ae5a9683c55 = function () {
1142
- return handleError(function () {
1143
- const ret = new AbortController();
1144
- return addHeapObject(ret);
1145
- }, arguments);
3050
+ module.exports.__wbindgen_bigint_from_u64 = function (arg0) {
3051
+ const ret = BigInt.asUintN(64, arg0);
3052
+ return addHeapObject(ret);
3053
+ };
3054
+
3055
+ module.exports.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
3056
+ const v = getObject(arg1);
3057
+ const ret = typeof v === "bigint" ? v : undefined;
3058
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
3059
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1146
3060
  };
1147
3061
 
1148
3062
  module.exports.__wbindgen_boolean_get = function (arg0) {
@@ -1151,19 +3065,24 @@ module.exports.__wbindgen_boolean_get = function (arg0) {
1151
3065
  return ret;
1152
3066
  };
1153
3067
 
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);
3068
+ module.exports.__wbindgen_cb_drop = function (arg0) {
3069
+ const obj = takeObject(arg0).original;
3070
+ if (obj.cnt-- == 1) {
3071
+ obj.a = 0;
3072
+ return true;
3073
+ }
3074
+ const ret = false;
3075
+ return ret;
1159
3076
  };
1160
3077
 
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);
3078
+ module.exports.__wbindgen_closure_wrapper2889 = function (arg0, arg1, arg2) {
3079
+ const ret = makeMutClosure(arg0, arg1, 669, __wbg_adapter_50);
3080
+ return addHeapObject(ret);
3081
+ };
3082
+
3083
+ module.exports.__wbindgen_closure_wrapper3282 = function (arg0, arg1, arg2) {
3084
+ const ret = makeMutClosure(arg0, arg1, 791, __wbg_adapter_53);
3085
+ return addHeapObject(ret);
1167
3086
  };
1168
3087
 
1169
3088
  module.exports.__wbindgen_debug_string = function (arg0, arg1) {
@@ -1174,51 +3093,98 @@ module.exports.__wbindgen_debug_string = function (arg0, arg1) {
1174
3093
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1175
3094
  };
1176
3095
 
1177
- module.exports.__wbindgen_throw = function (arg0, arg1) {
1178
- throw new Error(getStringFromWasm0(arg0, arg1));
3096
+ module.exports.__wbindgen_error_new = function (arg0, arg1) {
3097
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
3098
+ return addHeapObject(ret);
1179
3099
  };
1180
3100
 
1181
- module.exports.__wbg_queueMicrotask_848aa4969108a57e = function (arg0) {
1182
- const ret = getObject(arg0).queueMicrotask;
1183
- return addHeapObject(ret);
3101
+ module.exports.__wbindgen_in = function (arg0, arg1) {
3102
+ const ret = getObject(arg0) in getObject(arg1);
3103
+ return ret;
1184
3104
  };
1185
3105
 
1186
- module.exports.__wbg_queueMicrotask_c5419c06eab41e73 = function (arg0) {
1187
- queueMicrotask(getObject(arg0));
3106
+ module.exports.__wbindgen_is_bigint = function (arg0) {
3107
+ const ret = typeof getObject(arg0) === "bigint";
3108
+ return ret;
1188
3109
  };
1189
3110
 
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);
3111
+ module.exports.__wbindgen_is_function = function (arg0) {
3112
+ const ret = typeof getObject(arg0) === "function";
3113
+ return ret;
1195
3114
  };
1196
3115
 
1197
- module.exports.__wbg_debug_a0b6c2c5ac9a4bfd = function (arg0, arg1, arg2, arg3) {
1198
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3116
+ module.exports.__wbindgen_is_object = function (arg0) {
3117
+ const val = getObject(arg0);
3118
+ const ret = typeof val === "object" && val !== null;
3119
+ return ret;
1199
3120
  };
1200
3121
 
1201
- module.exports.__wbg_error_4d17c5bb1ca90c94 = function (arg0, arg1, arg2, arg3) {
1202
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3122
+ module.exports.__wbindgen_is_string = function (arg0) {
3123
+ const ret = typeof getObject(arg0) === "string";
3124
+ return ret;
1203
3125
  };
1204
3126
 
1205
- module.exports.__wbg_info_1c7fba7da21072d1 = function (arg0, arg1, arg2, arg3) {
1206
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3127
+ module.exports.__wbindgen_is_undefined = function (arg0) {
3128
+ const ret = getObject(arg0) === undefined;
3129
+ return ret;
1207
3130
  };
1208
3131
 
1209
- module.exports.__wbg_log_4de37a0274d94769 = function (arg0, arg1, arg2, arg3) {
1210
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3132
+ module.exports.__wbindgen_jsval_eq = function (arg0, arg1) {
3133
+ const ret = getObject(arg0) === getObject(arg1);
3134
+ return ret;
1211
3135
  };
1212
3136
 
1213
- module.exports.__wbg_warn_2e2787d40aad9a81 = function (arg0, arg1, arg2, arg3) {
1214
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
3137
+ module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
3138
+ const ret = getObject(arg0) == getObject(arg1);
3139
+ return ret;
3140
+ };
3141
+
3142
+ module.exports.__wbindgen_memory = function () {
3143
+ const ret = wasm.memory;
3144
+ return addHeapObject(ret);
3145
+ };
3146
+
3147
+ module.exports.__wbindgen_number_get = function (arg0, arg1) {
3148
+ const obj = getObject(arg1);
3149
+ const ret = typeof obj === "number" ? obj : undefined;
3150
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
3151
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
3152
+ };
3153
+
3154
+ module.exports.__wbindgen_number_new = function (arg0) {
3155
+ const ret = arg0;
3156
+ return addHeapObject(ret);
3157
+ };
3158
+
3159
+ module.exports.__wbindgen_object_clone_ref = function (arg0) {
3160
+ const ret = getObject(arg0);
3161
+ return addHeapObject(ret);
3162
+ };
3163
+
3164
+ module.exports.__wbindgen_object_drop_ref = function (arg0) {
3165
+ takeObject(arg0);
3166
+ };
3167
+
3168
+ module.exports.__wbindgen_string_get = function (arg0, arg1) {
3169
+ const obj = getObject(arg1);
3170
+ const ret = typeof obj === "string" ? obj : undefined;
3171
+ var ptr1 = isLikeNone(ret)
3172
+ ? 0
3173
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3174
+ var len1 = WASM_VECTOR_LEN;
3175
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
3176
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1215
3177
  };
1216
3178
 
1217
- module.exports.__wbindgen_closure_wrapper1799 = function (arg0, arg1, arg2) {
1218
- const ret = makeMutClosure(arg0, arg1, 491, __wbg_adapter_38);
3179
+ module.exports.__wbindgen_string_new = function (arg0, arg1) {
3180
+ const ret = getStringFromWasm0(arg0, arg1);
1219
3181
  return addHeapObject(ret);
1220
3182
  };
1221
3183
 
3184
+ module.exports.__wbindgen_throw = function (arg0, arg1) {
3185
+ throw new Error(getStringFromWasm0(arg0, arg1));
3186
+ };
3187
+
1222
3188
  const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
1223
3189
  const bytes = require("fs").readFileSync(path);
1224
3190