@bitwarden/sdk-internal 0.2.0-main.15 → 0.2.0-main.151

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