@bitwarden/sdk-internal 0.2.0-main.14 → 0.2.0-main.141

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