@bitwarden/sdk-internal 0.2.0-main.1 → 0.2.0-main.100

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.
@@ -3,14 +3,6 @@ export function __wbg_set_wasm(val) {
3
3
  wasm = val;
4
4
  }
5
5
 
6
- const heap = new Array(128).fill(undefined);
7
-
8
- heap.push(undefined, null, true, false);
9
-
10
- function getObject(idx) {
11
- return heap[idx];
12
- }
13
-
14
6
  let WASM_VECTOR_LEN = 0;
15
7
 
16
8
  let cachedUint8ArrayMemory0 = null;
@@ -81,10 +73,6 @@ function passStringToWasm0(arg, malloc, realloc) {
81
73
  return ptr;
82
74
  }
83
75
 
84
- function isLikeNone(x) {
85
- return x === undefined || x === null;
86
- }
87
-
88
76
  let cachedDataViewMemory0 = null;
89
77
 
90
78
  function getDataViewMemory0() {
@@ -99,29 +87,6 @@ function getDataViewMemory0() {
99
87
  return cachedDataViewMemory0;
100
88
  }
101
89
 
102
- let heap_next = heap.length;
103
-
104
- function dropObject(idx) {
105
- if (idx < 132) return;
106
- heap[idx] = heap_next;
107
- heap_next = idx;
108
- }
109
-
110
- function takeObject(idx) {
111
- const ret = getObject(idx);
112
- dropObject(idx);
113
- return ret;
114
- }
115
-
116
- function addHeapObject(obj) {
117
- if (heap_next === heap.length) heap.push(heap.length + 1);
118
- const idx = heap_next;
119
- heap_next = heap[idx];
120
-
121
- heap[idx] = obj;
122
- return idx;
123
- }
124
-
125
90
  const lTextDecoder =
126
91
  typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
127
92
 
@@ -134,6 +99,57 @@ function getStringFromWasm0(ptr, len) {
134
99
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
135
100
  }
136
101
 
102
+ function addToExternrefTable0(obj) {
103
+ const idx = wasm.__externref_table_alloc();
104
+ wasm.__wbindgen_export_4.set(idx, obj);
105
+ return idx;
106
+ }
107
+
108
+ function handleError(f, args) {
109
+ try {
110
+ return f.apply(this, args);
111
+ } catch (e) {
112
+ const idx = addToExternrefTable0(e);
113
+ wasm.__wbindgen_exn_store(idx);
114
+ }
115
+ }
116
+
117
+ function isLikeNone(x) {
118
+ return x === undefined || x === null;
119
+ }
120
+
121
+ const CLOSURE_DTORS =
122
+ typeof FinalizationRegistry === "undefined"
123
+ ? { register: () => {}, unregister: () => {} }
124
+ : new FinalizationRegistry((state) => {
125
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
126
+ });
127
+
128
+ function makeMutClosure(arg0, arg1, dtor, f) {
129
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
130
+ const real = (...args) => {
131
+ // First up with a closure we increment the internal reference
132
+ // count. This ensures that the Rust closure environment won't
133
+ // be deallocated while we're invoking it.
134
+ state.cnt++;
135
+ const a = state.a;
136
+ state.a = 0;
137
+ try {
138
+ return f(a, state.b, ...args);
139
+ } finally {
140
+ if (--state.cnt === 0) {
141
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
142
+ CLOSURE_DTORS.unregister(state);
143
+ } else {
144
+ state.a = a;
145
+ }
146
+ }
147
+ };
148
+ real.original = state;
149
+ CLOSURE_DTORS.register(real, state, state);
150
+ return real;
151
+ }
152
+
137
153
  function debugString(val) {
138
154
  // primitive types
139
155
  const type = typeof val;
@@ -175,7 +191,7 @@ function debugString(val) {
175
191
  // Test for built-in
176
192
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
177
193
  let className;
178
- if (builtInMatches.length > 1) {
194
+ if (builtInMatches && builtInMatches.length > 1) {
179
195
  className = builtInMatches[1];
180
196
  } else {
181
197
  // Failed to match the standard '[object ClassName]'
@@ -198,62 +214,173 @@ function debugString(val) {
198
214
  // TODO we could test for more things here, like `Set`s and `Map`s.
199
215
  return className;
200
216
  }
201
-
202
- const CLOSURE_DTORS =
203
- typeof FinalizationRegistry === "undefined"
204
- ? { register: () => {}, unregister: () => {} }
205
- : new FinalizationRegistry((state) => {
206
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
207
- });
208
-
209
- function makeMutClosure(arg0, arg1, dtor, f) {
210
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
211
- const real = (...args) => {
212
- // First up with a closure we increment the internal reference
213
- // count. This ensures that the Rust closure environment won't
214
- // be deallocated while we're invoking it.
215
- state.cnt++;
216
- const a = state.a;
217
- state.a = 0;
218
- try {
219
- return f(a, state.b, ...args);
220
- } finally {
221
- if (--state.cnt === 0) {
222
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
223
- CLOSURE_DTORS.unregister(state);
224
- } else {
225
- state.a = a;
226
- }
227
- }
228
- };
229
- real.original = state;
230
- CLOSURE_DTORS.register(real, state, state);
231
- return real;
217
+ /**
218
+ * @param {any} error
219
+ * @returns {boolean}
220
+ */
221
+ export function isEncryptionSettingsError(error) {
222
+ const ret = wasm.isEncryptionSettingsError(error);
223
+ return ret !== 0;
224
+ }
225
+
226
+ /**
227
+ * @param {any} error
228
+ * @returns {boolean}
229
+ */
230
+ export function isCryptoError(error) {
231
+ const ret = wasm.isCryptoError(error);
232
+ return ret !== 0;
233
+ }
234
+
235
+ /**
236
+ * @param {any} error
237
+ * @returns {boolean}
238
+ */
239
+ export function isSshKeyExportError(error) {
240
+ const ret = wasm.isSshKeyExportError(error);
241
+ return ret !== 0;
242
+ }
243
+
244
+ /**
245
+ * @param {any} error
246
+ * @returns {boolean}
247
+ */
248
+ export function isSshKeyImportError(error) {
249
+ const ret = wasm.isSshKeyImportError(error);
250
+ return ret !== 0;
251
+ }
252
+
253
+ /**
254
+ * @param {any} error
255
+ * @returns {boolean}
256
+ */
257
+ export function isKeyGenerationError(error) {
258
+ const ret = wasm.isKeyGenerationError(error);
259
+ return ret !== 0;
260
+ }
261
+
262
+ /**
263
+ * @param {any} error
264
+ * @returns {boolean}
265
+ */
266
+ export function isDecryptFileError(error) {
267
+ const ret = wasm.isDecryptFileError(error);
268
+ return ret !== 0;
269
+ }
270
+
271
+ /**
272
+ * @param {any} error
273
+ * @returns {boolean}
274
+ */
275
+ export function isEncryptFileError(error) {
276
+ const ret = wasm.isEncryptFileError(error);
277
+ return ret !== 0;
278
+ }
279
+
280
+ /**
281
+ * @param {any} error
282
+ * @returns {boolean}
283
+ */
284
+ export function isDecryptError(error) {
285
+ const ret = wasm.isDecryptError(error);
286
+ return ret !== 0;
287
+ }
288
+
289
+ /**
290
+ * @param {any} error
291
+ * @returns {boolean}
292
+ */
293
+ export function isEncryptError(error) {
294
+ const ret = wasm.isEncryptError(error);
295
+ return ret !== 0;
296
+ }
297
+
298
+ /**
299
+ * @param {any} error
300
+ * @returns {boolean}
301
+ */
302
+ export function isTotpError(error) {
303
+ const ret = wasm.isTotpError(error);
304
+ return ret !== 0;
305
+ }
306
+
307
+ function takeFromExternrefTable0(idx) {
308
+ const value = wasm.__wbindgen_export_4.get(idx);
309
+ wasm.__externref_table_dealloc(idx);
310
+ return value;
311
+ }
312
+ /**
313
+ * Generate a new SSH key pair
314
+ *
315
+ * # Arguments
316
+ * - `key_algorithm` - The algorithm to use for the key pair
317
+ *
318
+ * # Returns
319
+ * - `Ok(SshKey)` if the key was successfully generated
320
+ * - `Err(KeyGenerationError)` if the key could not be generated
321
+ * @param {KeyAlgorithm} key_algorithm
322
+ * @returns {SshKeyView}
323
+ */
324
+ export function generate_ssh_key(key_algorithm) {
325
+ const ret = wasm.generate_ssh_key(key_algorithm);
326
+ if (ret[2]) {
327
+ throw takeFromExternrefTable0(ret[1]);
328
+ }
329
+ return takeFromExternrefTable0(ret[0]);
330
+ }
331
+
332
+ /**
333
+ * Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
334
+ * to an OpenSSH private key with public key and fingerprint
335
+ *
336
+ * # Arguments
337
+ * - `imported_key` - The private key to convert
338
+ * - `password` - The password to use for decrypting the key
339
+ *
340
+ * # Returns
341
+ * - `Ok(SshKey)` if the key was successfully coneverted
342
+ * - `Err(PasswordRequired)` if the key is encrypted and no password was provided
343
+ * - `Err(WrongPassword)` if the password provided is incorrect
344
+ * - `Err(ParsingError)` if the key could not be parsed
345
+ * - `Err(UnsupportedKeyType)` if the key type is not supported
346
+ * @param {string} imported_key
347
+ * @param {string | null} [password]
348
+ * @returns {SshKeyView}
349
+ */
350
+ export function import_ssh_key(imported_key, password) {
351
+ const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
+ const len0 = WASM_VECTOR_LEN;
353
+ var ptr1 = isLikeNone(password)
354
+ ? 0
355
+ : passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ var len1 = WASM_VECTOR_LEN;
357
+ const ret = wasm.import_ssh_key(ptr0, len0, ptr1, len1);
358
+ if (ret[2]) {
359
+ throw takeFromExternrefTable0(ret[1]);
360
+ }
361
+ return takeFromExternrefTable0(ret[0]);
232
362
  }
233
- function __wbg_adapter_38(arg0, arg1, arg2) {
234
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hec6c9a85ed863308(
235
- arg0,
236
- arg1,
237
- addHeapObject(arg2),
238
- );
363
+
364
+ /**
365
+ * @param {any} error
366
+ * @returns {boolean}
367
+ */
368
+ export function isTestError(error) {
369
+ const ret = wasm.isTestError(error);
370
+ return ret !== 0;
239
371
  }
240
372
 
241
- function handleError(f, args) {
242
- try {
243
- return f.apply(this, args);
244
- } catch (e) {
245
- wasm.__wbindgen_exn_store(addHeapObject(e));
246
- }
373
+ function __wbg_adapter_42(arg0, arg1, arg2) {
374
+ wasm.closure605_externref_shim(arg0, arg1, arg2);
247
375
  }
248
- function __wbg_adapter_100(arg0, arg1, arg2, arg3) {
249
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h29c3505e35b3c82d(
250
- arg0,
251
- arg1,
252
- addHeapObject(arg2),
253
- addHeapObject(arg3),
254
- );
376
+
377
+ function __wbg_adapter_145(arg0, arg1, arg2, arg3) {
378
+ wasm.closure453_externref_shim(arg0, arg1, arg2, arg3);
255
379
  }
256
380
 
381
+ /**
382
+ * @enum {0 | 1 | 2 | 3 | 4}
383
+ */
257
384
  export const LogLevel = Object.freeze({
258
385
  Trace: 0,
259
386
  0: "Trace",
@@ -289,12 +416,12 @@ export class BitwardenClient {
289
416
  wasm.__wbg_bitwardenclient_free(ptr, 0);
290
417
  }
291
418
  /**
292
- * @param {ClientSettings | undefined} [settings]
293
- * @param {LogLevel | undefined} [log_level]
419
+ * @param {ClientSettings | null} [settings]
420
+ * @param {LogLevel | null} [log_level]
294
421
  */
295
422
  constructor(settings, log_level) {
296
423
  const ret = wasm.bitwardenclient_new(
297
- isLikeNone(settings) ? 0 : addHeapObject(settings),
424
+ isLikeNone(settings) ? 0 : addToExternrefTable0(settings),
298
425
  isLikeNone(log_level) ? 5 : log_level,
299
426
  );
300
427
  this.__wbg_ptr = ret >>> 0;
@@ -310,17 +437,13 @@ export class BitwardenClient {
310
437
  let deferred2_0;
311
438
  let deferred2_1;
312
439
  try {
313
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
314
440
  const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
315
441
  const len0 = WASM_VECTOR_LEN;
316
- wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
317
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
318
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
319
- deferred2_0 = r0;
320
- deferred2_1 = r1;
321
- return getStringFromWasm0(r0, r1);
442
+ const ret = wasm.bitwardenclient_echo(this.__wbg_ptr, ptr0, len0);
443
+ deferred2_0 = ret[0];
444
+ deferred2_1 = ret[1];
445
+ return getStringFromWasm0(ret[0], ret[1]);
322
446
  } finally {
323
- wasm.__wbindgen_add_to_stack_pointer(16);
324
447
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
325
448
  }
326
449
  }
@@ -331,15 +454,11 @@ export class BitwardenClient {
331
454
  let deferred1_0;
332
455
  let deferred1_1;
333
456
  try {
334
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
335
- wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
336
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
337
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
338
- deferred1_0 = r0;
339
- deferred1_1 = r1;
340
- return getStringFromWasm0(r0, r1);
457
+ const ret = wasm.bitwardenclient_version(this.__wbg_ptr);
458
+ deferred1_0 = ret[0];
459
+ deferred1_1 = ret[1];
460
+ return getStringFromWasm0(ret[0], ret[1]);
341
461
  } finally {
342
- wasm.__wbindgen_add_to_stack_pointer(16);
343
462
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
344
463
  }
345
464
  }
@@ -347,18 +466,11 @@ export class BitwardenClient {
347
466
  * @param {string} msg
348
467
  */
349
468
  throw(msg) {
350
- try {
351
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
352
- const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
353
- const len0 = WASM_VECTOR_LEN;
354
- wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
355
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
356
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
357
- if (r1) {
358
- throw takeObject(r0);
359
- }
360
- } finally {
361
- wasm.__wbindgen_add_to_stack_pointer(16);
469
+ const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
470
+ const len0 = WASM_VECTOR_LEN;
471
+ const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
472
+ if (ret[1]) {
473
+ throw takeFromExternrefTable0(ret[0]);
362
474
  }
363
475
  }
364
476
  /**
@@ -370,142 +482,222 @@ export class BitwardenClient {
370
482
  const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
483
  const len0 = WASM_VECTOR_LEN;
372
484
  const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
373
- return takeObject(ret);
485
+ return ret;
374
486
  }
375
487
  /**
376
- * @returns {ClientCrypto}
488
+ * @returns {CryptoClient}
377
489
  */
378
490
  crypto() {
379
491
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
380
- return ClientCrypto.__wrap(ret);
492
+ return CryptoClient.__wrap(ret);
381
493
  }
382
494
  /**
383
- * @returns {ClientVault}
495
+ * @returns {VaultClient}
384
496
  */
385
497
  vault() {
386
498
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
387
- return ClientVault.__wrap(ret);
499
+ return VaultClient.__wrap(ret);
388
500
  }
389
501
  }
390
502
 
391
- const ClientCryptoFinalization =
503
+ const ClientFoldersFinalization =
392
504
  typeof FinalizationRegistry === "undefined"
393
505
  ? { register: () => {}, unregister: () => {} }
394
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientcrypto_free(ptr >>> 0, 1));
506
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
395
507
 
396
- export class ClientCrypto {
508
+ export class ClientFolders {
397
509
  static __wrap(ptr) {
398
510
  ptr = ptr >>> 0;
399
- const obj = Object.create(ClientCrypto.prototype);
511
+ const obj = Object.create(ClientFolders.prototype);
400
512
  obj.__wbg_ptr = ptr;
401
- ClientCryptoFinalization.register(obj, obj.__wbg_ptr, obj);
513
+ ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
402
514
  return obj;
403
515
  }
404
516
 
405
517
  __destroy_into_raw() {
406
518
  const ptr = this.__wbg_ptr;
407
519
  this.__wbg_ptr = 0;
408
- ClientCryptoFinalization.unregister(this);
520
+ ClientFoldersFinalization.unregister(this);
409
521
  return ptr;
410
522
  }
411
523
 
412
524
  free() {
413
525
  const ptr = this.__destroy_into_raw();
414
- wasm.__wbg_clientcrypto_free(ptr, 0);
526
+ wasm.__wbg_clientfolders_free(ptr, 0);
415
527
  }
416
528
  /**
417
- * Initialization method for the user crypto. Needs to be called before any other crypto
418
- * operations.
419
- * @param {InitUserCryptoRequest} req
420
- * @returns {Promise<void>}
529
+ * Decrypt folder
530
+ * @param {Folder} folder
531
+ * @returns {FolderView}
421
532
  */
422
- initialize_user_crypto(req) {
423
- const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
424
- return takeObject(ret);
533
+ decrypt(folder) {
534
+ const ret = wasm.clientfolders_decrypt(this.__wbg_ptr, folder);
535
+ if (ret[2]) {
536
+ throw takeFromExternrefTable0(ret[1]);
537
+ }
538
+ return takeFromExternrefTable0(ret[0]);
539
+ }
540
+ }
541
+
542
+ const ClientTotpFinalization =
543
+ typeof FinalizationRegistry === "undefined"
544
+ ? { register: () => {}, unregister: () => {} }
545
+ : new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
546
+
547
+ export class ClientTotp {
548
+ static __wrap(ptr) {
549
+ ptr = ptr >>> 0;
550
+ const obj = Object.create(ClientTotp.prototype);
551
+ obj.__wbg_ptr = ptr;
552
+ ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
553
+ return obj;
554
+ }
555
+
556
+ __destroy_into_raw() {
557
+ const ptr = this.__wbg_ptr;
558
+ this.__wbg_ptr = 0;
559
+ ClientTotpFinalization.unregister(this);
560
+ return ptr;
561
+ }
562
+
563
+ free() {
564
+ const ptr = this.__destroy_into_raw();
565
+ wasm.__wbg_clienttotp_free(ptr, 0);
425
566
  }
426
567
  /**
427
- * Initialization method for the organization crypto. Needs to be called after
428
- * `initialize_user_crypto` but before any other crypto operations.
429
- * @param {InitOrgCryptoRequest} req
430
- * @returns {Promise<void>}
568
+ * Generates a TOTP code from a provided key
569
+ *
570
+ * # Arguments
571
+ * - `key` - Can be:
572
+ * - A base32 encoded string
573
+ * - OTP Auth URI
574
+ * - Steam URI
575
+ * - `time_ms` - Optional timestamp in milliseconds
576
+ *
577
+ * # Returns
578
+ * - `Ok(TotpResponse)` containing the generated code and period
579
+ * - `Err(TotpError)` if code generation fails
580
+ * @param {string} key
581
+ * @param {number | null} [time_ms]
582
+ * @returns {TotpResponse}
431
583
  */
432
- initialize_org_crypto(req) {
433
- const ret = wasm.clientcrypto_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
434
- return takeObject(ret);
584
+ generate_totp(key, time_ms) {
585
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
586
+ const len0 = WASM_VECTOR_LEN;
587
+ const ret = wasm.clienttotp_generate_totp(
588
+ this.__wbg_ptr,
589
+ ptr0,
590
+ len0,
591
+ !isLikeNone(time_ms),
592
+ isLikeNone(time_ms) ? 0 : time_ms,
593
+ );
594
+ if (ret[2]) {
595
+ throw takeFromExternrefTable0(ret[1]);
596
+ }
597
+ return takeFromExternrefTable0(ret[0]);
435
598
  }
436
599
  }
437
600
 
438
- const ClientFoldersFinalization =
601
+ const CryptoClientFinalization =
439
602
  typeof FinalizationRegistry === "undefined"
440
603
  ? { register: () => {}, unregister: () => {} }
441
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
604
+ : new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
442
605
 
443
- export class ClientFolders {
606
+ export class CryptoClient {
444
607
  static __wrap(ptr) {
445
608
  ptr = ptr >>> 0;
446
- const obj = Object.create(ClientFolders.prototype);
609
+ const obj = Object.create(CryptoClient.prototype);
447
610
  obj.__wbg_ptr = ptr;
448
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
611
+ CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
449
612
  return obj;
450
613
  }
451
614
 
452
615
  __destroy_into_raw() {
453
616
  const ptr = this.__wbg_ptr;
454
617
  this.__wbg_ptr = 0;
455
- ClientFoldersFinalization.unregister(this);
618
+ CryptoClientFinalization.unregister(this);
456
619
  return ptr;
457
620
  }
458
621
 
459
622
  free() {
460
623
  const ptr = this.__destroy_into_raw();
461
- wasm.__wbg_clientfolders_free(ptr, 0);
624
+ wasm.__wbg_cryptoclient_free(ptr, 0);
462
625
  }
463
626
  /**
464
- * Decrypt folder
465
- * @param {Folder} folder
466
- * @returns {FolderView}
627
+ * Initialization method for the user crypto. Needs to be called before any other crypto
628
+ * operations.
629
+ * @param {InitUserCryptoRequest} req
630
+ * @returns {Promise<void>}
467
631
  */
468
- decrypt(folder) {
469
- try {
470
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
471
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
472
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
473
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
474
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
475
- if (r2) {
476
- throw takeObject(r1);
477
- }
478
- return takeObject(r0);
479
- } finally {
480
- wasm.__wbindgen_add_to_stack_pointer(16);
632
+ initialize_user_crypto(req) {
633
+ const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, req);
634
+ return ret;
635
+ }
636
+ /**
637
+ * Initialization method for the organization crypto. Needs to be called after
638
+ * `initialize_user_crypto` but before any other crypto operations.
639
+ * @param {InitOrgCryptoRequest} req
640
+ * @returns {Promise<void>}
641
+ */
642
+ initialize_org_crypto(req) {
643
+ const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, req);
644
+ return ret;
645
+ }
646
+ /**
647
+ * Generates a new key pair and encrypts the private key with the provided user key.
648
+ * Crypto initialization not required.
649
+ * @param {string} user_key
650
+ * @returns {MakeKeyPairResponse}
651
+ */
652
+ make_key_pair(user_key) {
653
+ const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
654
+ const len0 = WASM_VECTOR_LEN;
655
+ const ret = wasm.cryptoclient_make_key_pair(this.__wbg_ptr, ptr0, len0);
656
+ if (ret[2]) {
657
+ throw takeFromExternrefTable0(ret[1]);
658
+ }
659
+ return takeFromExternrefTable0(ret[0]);
660
+ }
661
+ /**
662
+ * Verifies a user's asymmetric keys by decrypting the private key with the provided user
663
+ * key. Returns if the private key is decryptable and if it is a valid matching key.
664
+ * Crypto initialization not required.
665
+ * @param {VerifyAsymmetricKeysRequest} request
666
+ * @returns {VerifyAsymmetricKeysResponse}
667
+ */
668
+ verify_asymmetric_keys(request) {
669
+ const ret = wasm.cryptoclient_verify_asymmetric_keys(this.__wbg_ptr, request);
670
+ if (ret[2]) {
671
+ throw takeFromExternrefTable0(ret[1]);
481
672
  }
673
+ return takeFromExternrefTable0(ret[0]);
482
674
  }
483
675
  }
484
676
 
485
- const ClientVaultFinalization =
677
+ const VaultClientFinalization =
486
678
  typeof FinalizationRegistry === "undefined"
487
679
  ? { register: () => {}, unregister: () => {} }
488
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientvault_free(ptr >>> 0, 1));
680
+ : new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
489
681
 
490
- export class ClientVault {
682
+ export class VaultClient {
491
683
  static __wrap(ptr) {
492
684
  ptr = ptr >>> 0;
493
- const obj = Object.create(ClientVault.prototype);
685
+ const obj = Object.create(VaultClient.prototype);
494
686
  obj.__wbg_ptr = ptr;
495
- ClientVaultFinalization.register(obj, obj.__wbg_ptr, obj);
687
+ VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
496
688
  return obj;
497
689
  }
498
690
 
499
691
  __destroy_into_raw() {
500
692
  const ptr = this.__wbg_ptr;
501
693
  this.__wbg_ptr = 0;
502
- ClientVaultFinalization.unregister(this);
694
+ VaultClientFinalization.unregister(this);
503
695
  return ptr;
504
696
  }
505
697
 
506
698
  free() {
507
699
  const ptr = this.__destroy_into_raw();
508
- wasm.__wbg_clientvault_free(ptr, 0);
700
+ wasm.__wbg_vaultclient_free(ptr, 0);
509
701
  }
510
702
  /**
511
703
  * @returns {ClientFolders}
@@ -514,167 +706,163 @@ export class ClientVault {
514
706
  const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
515
707
  return ClientFolders.__wrap(ret);
516
708
  }
709
+ /**
710
+ * @returns {ClientTotp}
711
+ */
712
+ totp() {
713
+ const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
714
+ return ClientTotp.__wrap(ret);
715
+ }
517
716
  }
518
717
 
519
- export function __wbindgen_string_get(arg0, arg1) {
520
- const obj = getObject(arg1);
521
- const ret = typeof obj === "string" ? obj : undefined;
522
- var ptr1 = isLikeNone(ret)
523
- ? 0
524
- : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
525
- var len1 = WASM_VECTOR_LEN;
718
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
719
+ const ret = String(arg1);
720
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
721
+ const len1 = WASM_VECTOR_LEN;
526
722
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
527
723
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
528
724
  }
529
725
 
530
- export function __wbindgen_object_drop_ref(arg0) {
531
- takeObject(arg0);
726
+ export function __wbg_abort_775ef1d17fc65868(arg0) {
727
+ arg0.abort();
532
728
  }
533
729
 
534
- export function __wbindgen_is_object(arg0) {
535
- const val = getObject(arg0);
536
- const ret = typeof val === "object" && val !== null;
537
- return ret;
730
+ export function __wbg_append_299d5d48292c0495() {
731
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
732
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
733
+ }, arguments);
538
734
  }
539
735
 
540
- export function __wbg_getwithrefkey_edc2c8960f0f1191(arg0, arg1) {
541
- const ret = getObject(arg0)[getObject(arg1)];
542
- return addHeapObject(ret);
736
+ export function __wbg_append_8c7dd8d641a5f01b() {
737
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
738
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
739
+ }, arguments);
543
740
  }
544
741
 
545
- export function __wbindgen_is_undefined(arg0) {
546
- const ret = getObject(arg0) === undefined;
547
- return ret;
742
+ export function __wbg_append_b2d1fc16de2a0e81() {
743
+ return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
744
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5));
745
+ }, arguments);
548
746
  }
549
747
 
550
- export function __wbindgen_in(arg0, arg1) {
551
- const ret = getObject(arg0) in getObject(arg1);
552
- return ret;
748
+ export function __wbg_append_b44785ebeb668479() {
749
+ return handleError(function (arg0, arg1, arg2, arg3) {
750
+ arg0.append(getStringFromWasm0(arg1, arg2), arg3);
751
+ }, arguments);
553
752
  }
554
753
 
555
- export function __wbg_isSafeInteger_b9dff570f01a9100(arg0) {
556
- const ret = Number.isSafeInteger(getObject(arg0));
754
+ export function __wbg_buffer_609cc3eee51ed158(arg0) {
755
+ const ret = arg0.buffer;
557
756
  return ret;
558
757
  }
559
758
 
560
- export function __wbindgen_as_number(arg0) {
561
- const ret = +getObject(arg0);
562
- return ret;
563
- }
564
-
565
- export function __wbindgen_is_string(arg0) {
566
- const ret = typeof getObject(arg0) === "string";
567
- return ret;
759
+ export function __wbg_call_672a4d21634d4a24() {
760
+ return handleError(function (arg0, arg1) {
761
+ const ret = arg0.call(arg1);
762
+ return ret;
763
+ }, arguments);
568
764
  }
569
765
 
570
- export function __wbg_entries_c02034de337d3ee2(arg0) {
571
- const ret = Object.entries(getObject(arg0));
572
- return addHeapObject(ret);
766
+ export function __wbg_call_7cccdd69e0791ae2() {
767
+ return handleError(function (arg0, arg1, arg2) {
768
+ const ret = arg0.call(arg1, arg2);
769
+ return ret;
770
+ }, arguments);
573
771
  }
574
772
 
575
- export function __wbg_length_f217bbbf7e8e4df4(arg0) {
576
- const ret = getObject(arg0).length;
773
+ export function __wbg_crypto_ed58b8e10a292839(arg0) {
774
+ const ret = arg0.crypto;
577
775
  return ret;
578
776
  }
579
777
 
580
- export function __wbg_get_5419cf6b954aa11d(arg0, arg1) {
581
- const ret = getObject(arg0)[arg1 >>> 0];
582
- return addHeapObject(ret);
583
- }
584
-
585
- export function __wbindgen_object_clone_ref(arg0) {
586
- const ret = getObject(arg0);
587
- return addHeapObject(ret);
588
- }
589
-
590
- export function __wbg_next_b06e115d1b01e10b() {
591
- return handleError(function (arg0) {
592
- const ret = getObject(arg0).next();
593
- return addHeapObject(ret);
594
- }, arguments);
778
+ export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
779
+ console.debug(arg0, arg1, arg2, arg3);
595
780
  }
596
781
 
597
- export function __wbg_done_983b5ffcaec8c583(arg0) {
598
- const ret = getObject(arg0).done;
782
+ export function __wbg_done_769e5ede4b31c67b(arg0) {
783
+ const ret = arg0.done;
599
784
  return ret;
600
785
  }
601
786
 
602
- export function __wbg_value_2ab8a198c834c26a(arg0) {
603
- const ret = getObject(arg0).value;
604
- return addHeapObject(ret);
787
+ export function __wbg_entries_3265d4158b33e5dc(arg0) {
788
+ const ret = Object.entries(arg0);
789
+ return ret;
605
790
  }
606
791
 
607
- export function __wbg_new_b9ef247b18a93a97(arg0, arg1) {
792
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
608
793
  let deferred0_0;
609
794
  let deferred0_1;
610
795
  try {
611
796
  deferred0_0 = arg0;
612
797
  deferred0_1 = arg1;
613
- const ret = new Error(getStringFromWasm0(arg0, arg1));
614
- return addHeapObject(ret);
798
+ console.error(getStringFromWasm0(arg0, arg1));
615
799
  } finally {
616
800
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
617
801
  }
618
802
  }
619
803
 
620
- export function __wbg_call_3bfa248576352471() {
621
- return handleError(function (arg0, arg1, arg2) {
622
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
623
- return addHeapObject(ret);
624
- }, arguments);
804
+ export function __wbg_error_80de38b3f7cc3c3c(arg0, arg1, arg2, arg3) {
805
+ console.error(arg0, arg1, arg2, arg3);
625
806
  }
626
807
 
627
- export function __wbg_new_e69b5f66fda8f13c() {
628
- const ret = new Object();
629
- return addHeapObject(ret);
808
+ export function __wbg_fetch_4465c2b10f21a927(arg0) {
809
+ const ret = fetch(arg0);
810
+ return ret;
630
811
  }
631
812
 
632
- export function __wbg_setmethod_ce2da76000b02f6a(arg0, arg1, arg2) {
633
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
813
+ export function __wbg_fetch_509096533071c657(arg0, arg1) {
814
+ const ret = arg0.fetch(arg1);
815
+ return ret;
634
816
  }
635
817
 
636
- export function __wbg_new_a9ae04a5200606a5() {
637
- return handleError(function () {
638
- const ret = new Headers();
639
- return addHeapObject(ret);
818
+ export function __wbg_getRandomValues_bcb4912f16000dc4() {
819
+ return handleError(function (arg0, arg1) {
820
+ arg0.getRandomValues(arg1);
640
821
  }, arguments);
641
822
  }
642
823
 
643
- export function __wbg_setheaders_f5205d36e423a544(arg0, arg1) {
644
- getObject(arg0).headers = getObject(arg1);
824
+ export function __wbg_getTime_46267b1c24877e30(arg0) {
825
+ const ret = arg0.getTime();
826
+ return ret;
645
827
  }
646
828
 
647
- export function __wbg_setmode_4919fd636102c586(arg0, arg1) {
648
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
829
+ export function __wbg_get_67b2ba62fc30de12() {
830
+ return handleError(function (arg0, arg1) {
831
+ const ret = Reflect.get(arg0, arg1);
832
+ return ret;
833
+ }, arguments);
649
834
  }
650
835
 
651
- export function __wbg_setcredentials_a4e661320cdb9738(arg0, arg1) {
652
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
836
+ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
837
+ const ret = arg0[arg1 >>> 0];
838
+ return ret;
653
839
  }
654
840
 
655
- export function __wbg_setbody_aa8b691bec428bf4(arg0, arg1) {
656
- getObject(arg0).body = getObject(arg1);
841
+ export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
842
+ const ret = arg0[arg1];
843
+ return ret;
657
844
  }
658
845
 
659
- export function __wbg_signal_9acfcec9e7dffc22(arg0) {
660
- const ret = getObject(arg0).signal;
661
- return addHeapObject(ret);
846
+ export function __wbg_has_a5ea9117f258a0ec() {
847
+ return handleError(function (arg0, arg1) {
848
+ const ret = Reflect.has(arg0, arg1);
849
+ return ret;
850
+ }, arguments);
662
851
  }
663
852
 
664
- export function __wbg_setsignal_812ccb8269a7fd90(arg0, arg1) {
665
- getObject(arg0).signal = getObject(arg1);
853
+ export function __wbg_headers_9cb51cfd2ac780a4(arg0) {
854
+ const ret = arg0.headers;
855
+ return ret;
666
856
  }
667
857
 
668
- export function __wbg_append_8b3e7f74a47ea7d5() {
669
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
670
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
671
- }, arguments);
858
+ export function __wbg_info_033d8b8a0838f1d3(arg0, arg1, arg2, arg3) {
859
+ console.info(arg0, arg1, arg2, arg3);
672
860
  }
673
861
 
674
- export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
862
+ export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
675
863
  let result;
676
864
  try {
677
- result = getObject(arg0) instanceof Response;
865
+ result = arg0 instanceof ArrayBuffer;
678
866
  } catch (_) {
679
867
  result = false;
680
868
  }
@@ -682,392 +870,485 @@ export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
682
870
  return ret;
683
871
  }
684
872
 
685
- export function __wbg_status_5f4e900d22140a18(arg0) {
686
- const ret = getObject(arg0).status;
873
+ export function __wbg_instanceof_Response_f2cc20d9f7dfd644(arg0) {
874
+ let result;
875
+ try {
876
+ result = arg0 instanceof Response;
877
+ } catch (_) {
878
+ result = false;
879
+ }
880
+ const ret = result;
687
881
  return ret;
688
882
  }
689
883
 
690
- export function __wbg_url_58af972663531d16(arg0, arg1) {
691
- const ret = getObject(arg1).url;
692
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
693
- const len1 = WASM_VECTOR_LEN;
694
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
695
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
884
+ export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
885
+ let result;
886
+ try {
887
+ result = arg0 instanceof Uint8Array;
888
+ } catch (_) {
889
+ result = false;
890
+ }
891
+ const ret = result;
892
+ return ret;
696
893
  }
697
894
 
698
- export function __wbg_headers_1b9bf90c73fae600(arg0) {
699
- const ret = getObject(arg0).headers;
700
- return addHeapObject(ret);
895
+ export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
896
+ const ret = Number.isSafeInteger(arg0);
897
+ return ret;
701
898
  }
702
899
 
703
- export function __wbg_stringify_eead5648c09faaf8() {
704
- return handleError(function (arg0) {
705
- const ret = JSON.stringify(getObject(arg0));
706
- return addHeapObject(ret);
707
- }, arguments);
900
+ export function __wbg_iterator_9a24c88df860dc65() {
901
+ const ret = Symbol.iterator;
902
+ return ret;
708
903
  }
709
904
 
710
- export function __wbg_abort_c57daab47a6c1215(arg0) {
711
- getObject(arg0).abort();
905
+ export function __wbg_length_a446193dc22c12f8(arg0) {
906
+ const ret = arg0.length;
907
+ return ret;
712
908
  }
713
909
 
714
- export function __wbg_text_ebeee8b31af4c919() {
715
- return handleError(function (arg0) {
716
- const ret = getObject(arg0).text();
717
- return addHeapObject(ret);
718
- }, arguments);
910
+ export function __wbg_length_e2d2a49132c1b256(arg0) {
911
+ const ret = arg0.length;
912
+ return ret;
719
913
  }
720
914
 
721
- export function __wbindgen_string_new(arg0, arg1) {
722
- const ret = getStringFromWasm0(arg0, arg1);
723
- return addHeapObject(ret);
915
+ export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
916
+ console.log(arg0, arg1, arg2, arg3);
724
917
  }
725
918
 
726
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
727
- const ret = getObject(arg0) == getObject(arg1);
919
+ export function __wbg_msCrypto_0a36e2ec3a343d26(arg0) {
920
+ const ret = arg0.msCrypto;
728
921
  return ret;
729
922
  }
730
923
 
731
- export function __wbindgen_cb_drop(arg0) {
732
- const obj = takeObject(arg0).original;
733
- if (obj.cnt-- == 1) {
734
- obj.a = 0;
735
- return true;
736
- }
737
- const ret = false;
924
+ export function __wbg_new0_f788a2397c7ca929() {
925
+ const ret = new Date();
738
926
  return ret;
739
927
  }
740
928
 
741
- export function __wbindgen_error_new(arg0, arg1) {
742
- const ret = new Error(getStringFromWasm0(arg0, arg1));
743
- return addHeapObject(ret);
929
+ export function __wbg_new_018dcc2d6c8c2f6a() {
930
+ return handleError(function () {
931
+ const ret = new Headers();
932
+ return ret;
933
+ }, arguments);
744
934
  }
745
935
 
746
- export function __wbg_new_1073970097e5a420(arg0, arg1) {
936
+ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
747
937
  try {
748
938
  var state0 = { a: arg0, b: arg1 };
749
939
  var cb0 = (arg0, arg1) => {
750
940
  const a = state0.a;
751
941
  state0.a = 0;
752
942
  try {
753
- return __wbg_adapter_100(a, state0.b, arg0, arg1);
943
+ return __wbg_adapter_145(a, state0.b, arg0, arg1);
754
944
  } finally {
755
945
  state0.a = a;
756
946
  }
757
947
  };
758
948
  const ret = new Promise(cb0);
759
- return addHeapObject(ret);
949
+ return ret;
760
950
  } finally {
761
951
  state0.a = state0.b = 0;
762
952
  }
763
953
  }
764
954
 
765
- export function __wbg_set_f975102236d3c502(arg0, arg1, arg2) {
766
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
955
+ export function __wbg_new_405e22f390576ce2() {
956
+ const ret = new Object();
957
+ return ret;
958
+ }
959
+
960
+ export function __wbg_new_78feb108b6472713() {
961
+ const ret = new Array();
962
+ return ret;
767
963
  }
768
964
 
769
- export function __wbg_new_abda76e883ba8a5f() {
965
+ export function __wbg_new_8a6f238a6ece86ea() {
770
966
  const ret = new Error();
771
- return addHeapObject(ret);
967
+ return ret;
772
968
  }
773
969
 
774
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
775
- const ret = getObject(arg1).stack;
776
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
777
- const len1 = WASM_VECTOR_LEN;
778
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
779
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
970
+ export function __wbg_new_9fd39a253424609a() {
971
+ return handleError(function () {
972
+ const ret = new FormData();
973
+ return ret;
974
+ }, arguments);
975
+ }
976
+
977
+ export function __wbg_new_a12002a7f91c75be(arg0) {
978
+ const ret = new Uint8Array(arg0);
979
+ return ret;
980
+ }
981
+
982
+ export function __wbg_new_c68d7209be747379(arg0, arg1) {
983
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
984
+ return ret;
780
985
  }
781
986
 
782
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
987
+ export function __wbg_new_e25e5aab09ff45db() {
988
+ return handleError(function () {
989
+ const ret = new AbortController();
990
+ return ret;
991
+ }, arguments);
992
+ }
993
+
994
+ export function __wbg_new_f24b6d53abe5bc82(arg0, arg1) {
783
995
  let deferred0_0;
784
996
  let deferred0_1;
785
997
  try {
786
998
  deferred0_0 = arg0;
787
999
  deferred0_1 = arg1;
788
- console.error(getStringFromWasm0(arg0, arg1));
1000
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1001
+ return ret;
789
1002
  } finally {
790
1003
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
791
1004
  }
792
1005
  }
793
1006
 
794
- export function __wbg_self_bf91bf94d9e04084() {
795
- return handleError(function () {
796
- const ret = self.self;
797
- return addHeapObject(ret);
798
- }, arguments);
1007
+ export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
1008
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1009
+ return ret;
799
1010
  }
800
1011
 
801
- export function __wbg_window_52dd9f07d03fd5f8() {
802
- return handleError(function () {
803
- const ret = window.window;
804
- return addHeapObject(ret);
805
- }, arguments);
1012
+ export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
1013
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1014
+ return ret;
806
1015
  }
807
1016
 
808
- export function __wbg_globalThis_05c129bf37fcf1be() {
809
- return handleError(function () {
810
- const ret = globalThis.globalThis;
811
- return addHeapObject(ret);
812
- }, arguments);
1017
+ export function __wbg_newwithlength_a381634e90c276d4(arg0) {
1018
+ const ret = new Uint8Array(arg0 >>> 0);
1019
+ return ret;
813
1020
  }
814
1021
 
815
- export function __wbg_global_3eca19bb09e9c484() {
816
- return handleError(function () {
817
- const ret = global.global;
818
- return addHeapObject(ret);
1022
+ export function __wbg_newwithstrandinit_06c535e0a867c635() {
1023
+ return handleError(function (arg0, arg1, arg2) {
1024
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1025
+ return ret;
819
1026
  }, arguments);
820
1027
  }
821
1028
 
822
- export function __wbg_newnoargs_1ede4bf2ebbaaf43(arg0, arg1) {
823
- const ret = new Function(getStringFromWasm0(arg0, arg1));
824
- return addHeapObject(ret);
825
- }
826
-
827
- export function __wbg_call_a9ef466721e824f2() {
1029
+ export function __wbg_newwithu8arraysequenceandoptions_068570c487f69127() {
828
1030
  return handleError(function (arg0, arg1) {
829
- const ret = getObject(arg0).call(getObject(arg1));
830
- return addHeapObject(ret);
1031
+ const ret = new Blob(arg0, arg1);
1032
+ return ret;
831
1033
  }, arguments);
832
1034
  }
833
1035
 
834
- export function __wbg_iterator_695d699a44d6234c() {
835
- const ret = Symbol.iterator;
836
- return addHeapObject(ret);
1036
+ export function __wbg_next_25feadfc0913fea9(arg0) {
1037
+ const ret = arg0.next;
1038
+ return ret;
837
1039
  }
838
1040
 
839
- export function __wbg_get_ef828680c64da212() {
840
- return handleError(function (arg0, arg1) {
841
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
842
- return addHeapObject(ret);
1041
+ export function __wbg_next_6574e1a8a62d1055() {
1042
+ return handleError(function (arg0) {
1043
+ const ret = arg0.next();
1044
+ return ret;
843
1045
  }, arguments);
844
1046
  }
845
1047
 
846
- export function __wbindgen_is_function(arg0) {
847
- const ret = typeof getObject(arg0) === "function";
1048
+ export function __wbg_node_02999533c4ea02e3(arg0) {
1049
+ const ret = arg0.node;
848
1050
  return ret;
849
1051
  }
850
1052
 
851
- export function __wbg_next_13b477da1eaa3897(arg0) {
852
- const ret = getObject(arg0).next;
853
- return addHeapObject(ret);
1053
+ export function __wbg_process_5c1d670bc53614b8(arg0) {
1054
+ const ret = arg0.process;
1055
+ return ret;
854
1056
  }
855
1057
 
856
- export function __wbg_new_034f913e7636e987() {
857
- const ret = new Array();
858
- return addHeapObject(ret);
1058
+ export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
1059
+ const ret = arg0.push(arg1);
1060
+ return ret;
859
1061
  }
860
1062
 
861
- export function __wbg_push_36cf4d81d7da33d1(arg0, arg1) {
862
- const ret = getObject(arg0).push(getObject(arg1));
863
- return ret;
1063
+ export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
1064
+ queueMicrotask(arg0);
864
1065
  }
865
1066
 
866
- export function __wbg_instanceof_ArrayBuffer_74945570b4a62ec7(arg0) {
867
- let result;
868
- try {
869
- result = getObject(arg0) instanceof ArrayBuffer;
870
- } catch (_) {
871
- result = false;
872
- }
873
- const ret = result;
1067
+ export function __wbg_queueMicrotask_d3219def82552485(arg0) {
1068
+ const ret = arg0.queueMicrotask;
874
1069
  return ret;
875
1070
  }
876
1071
 
877
- export function __wbg_new_70a2f23d1565c04c(arg0, arg1) {
878
- const ret = new Error(getStringFromWasm0(arg0, arg1));
879
- return addHeapObject(ret);
1072
+ export function __wbg_randomFillSync_ab2cfe79ebbf2740() {
1073
+ return handleError(function (arg0, arg1) {
1074
+ arg0.randomFillSync(arg1);
1075
+ }, arguments);
880
1076
  }
881
1077
 
882
- export function __wbg_has_bd717f25f195f23d() {
883
- return handleError(function (arg0, arg1) {
884
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
1078
+ export function __wbg_require_79b1e9274cde3c87() {
1079
+ return handleError(function () {
1080
+ const ret = module.require;
885
1081
  return ret;
886
1082
  }, arguments);
887
1083
  }
888
1084
 
889
- export function __wbg_resolve_0aad7c1484731c99(arg0) {
890
- const ret = Promise.resolve(getObject(arg0));
891
- return addHeapObject(ret);
1085
+ export function __wbg_resolve_4851785c9c5f573d(arg0) {
1086
+ const ret = Promise.resolve(arg0);
1087
+ return ret;
892
1088
  }
893
1089
 
894
- export function __wbg_then_748f75edfb032440(arg0, arg1) {
895
- const ret = getObject(arg0).then(getObject(arg1));
896
- return addHeapObject(ret);
1090
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1091
+ arg0[arg1] = arg2;
897
1092
  }
898
1093
 
899
- export function __wbg_then_4866a7d9f55d8f3e(arg0, arg1, arg2) {
900
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
901
- return addHeapObject(ret);
1094
+ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
1095
+ arg0.set(arg1, arg2 >>> 0);
902
1096
  }
903
1097
 
904
- export function __wbindgen_memory() {
905
- const ret = wasm.memory;
906
- return addHeapObject(ret);
1098
+ export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
1099
+ arg0.body = arg1;
907
1100
  }
908
1101
 
909
- export function __wbg_buffer_ccaed51a635d8a2d(arg0) {
910
- const ret = getObject(arg0).buffer;
911
- return addHeapObject(ret);
1102
+ export function __wbg_setcredentials_c3a22f1cd105a2c6(arg0, arg1) {
1103
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
912
1104
  }
913
1105
 
914
- export function __wbg_newwithbyteoffsetandlength_7e3eb787208af730(arg0, arg1, arg2) {
915
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
916
- return addHeapObject(ret);
1106
+ export function __wbg_setheaders_834c0bdb6a8949ad(arg0, arg1) {
1107
+ arg0.headers = arg1;
917
1108
  }
918
1109
 
919
- export function __wbg_length_9254c4bd3b9f23c4(arg0) {
920
- const ret = getObject(arg0).length;
921
- return ret;
1110
+ export function __wbg_setmethod_3c5280fe5d890842(arg0, arg1, arg2) {
1111
+ arg0.method = getStringFromWasm0(arg1, arg2);
1112
+ }
1113
+
1114
+ export function __wbg_setmode_5dc300b865044b65(arg0, arg1) {
1115
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1116
+ }
1117
+
1118
+ export function __wbg_setname_c0e2d6f348c746f4(arg0, arg1, arg2) {
1119
+ let deferred0_0;
1120
+ let deferred0_1;
1121
+ try {
1122
+ deferred0_0 = arg1;
1123
+ deferred0_1 = arg2;
1124
+ arg0.name = getStringFromWasm0(arg1, arg2);
1125
+ } finally {
1126
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1127
+ }
922
1128
  }
923
1129
 
924
- export function __wbg_new_fec2611eb9180f95(arg0) {
925
- const ret = new Uint8Array(getObject(arg0));
926
- return addHeapObject(ret);
1130
+ export function __wbg_setsignal_75b21ef3a81de905(arg0, arg1) {
1131
+ arg0.signal = arg1;
927
1132
  }
928
1133
 
929
- export function __wbg_set_ec2fcf81bc573fd9(arg0, arg1, arg2) {
930
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1134
+ export function __wbg_settype_39ed370d3edd403c(arg0, arg1, arg2) {
1135
+ arg0.type = getStringFromWasm0(arg1, arg2);
931
1136
  }
932
1137
 
933
- export function __wbg_instanceof_Uint8Array_df0761410414ef36(arg0) {
934
- let result;
1138
+ export function __wbg_setvariant_d1d41b778dfe9c17(arg0, arg1, arg2) {
1139
+ let deferred0_0;
1140
+ let deferred0_1;
935
1141
  try {
936
- result = getObject(arg0) instanceof Uint8Array;
937
- } catch (_) {
938
- result = false;
1142
+ deferred0_0 = arg1;
1143
+ deferred0_1 = arg2;
1144
+ arg0.variant = getStringFromWasm0(arg1, arg2);
1145
+ } finally {
1146
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
939
1147
  }
940
- const ret = result;
1148
+ }
1149
+
1150
+ export function __wbg_signal_aaf9ad74119f20a4(arg0) {
1151
+ const ret = arg0.signal;
941
1152
  return ret;
942
1153
  }
943
1154
 
944
- export function __wbg_new_4e7308fbedde3997() {
945
- return handleError(function () {
946
- const ret = new FormData();
947
- return addHeapObject(ret);
948
- }, arguments);
1155
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
1156
+ const ret = arg1.stack;
1157
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1158
+ const len1 = WASM_VECTOR_LEN;
1159
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1160
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
949
1161
  }
950
1162
 
951
- export function __wbg_append_43a4b1c9d5df4168() {
952
- return handleError(function (arg0, arg1, arg2, arg3, arg4) {
953
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
954
- }, arguments);
1163
+ export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
1164
+ const ret = typeof global === "undefined" ? null : global;
1165
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
955
1166
  }
956
1167
 
957
- export function __wbg_settype_623d2ee701e6310a(arg0, arg1, arg2) {
958
- getObject(arg0).type = getStringFromWasm0(arg1, arg2);
1168
+ export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
1169
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
1170
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
959
1171
  }
960
1172
 
961
- export function __wbg_newwithu8arraysequenceandoptions_d41c0fdf78490206() {
962
- return handleError(function (arg0, arg1) {
963
- const ret = new Blob(getObject(arg0), getObject(arg1));
964
- return addHeapObject(ret);
965
- }, arguments);
1173
+ export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
1174
+ const ret = typeof self === "undefined" ? null : self;
1175
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
966
1176
  }
967
1177
 
968
- export function __wbg_append_7ee78799a92a9731() {
969
- return handleError(function (arg0, arg1, arg2, arg3) {
970
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
971
- }, arguments);
1178
+ export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
1179
+ const ret = typeof window === "undefined" ? null : window;
1180
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
972
1181
  }
973
1182
 
974
- export function __wbg_append_8135c71037096394() {
975
- return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
976
- getObject(arg0).append(
977
- getStringFromWasm0(arg1, arg2),
978
- getObject(arg3),
979
- getStringFromWasm0(arg4, arg5),
980
- );
981
- }, arguments);
1183
+ export function __wbg_status_f6360336ca686bf0(arg0) {
1184
+ const ret = arg0.status;
1185
+ return ret;
982
1186
  }
983
1187
 
984
- export function __wbg_fetch_f8d735ba6fe1b719(arg0) {
985
- const ret = fetch(getObject(arg0));
986
- return addHeapObject(ret);
1188
+ export function __wbg_stringify_f7ed6987935b4a24() {
1189
+ return handleError(function (arg0) {
1190
+ const ret = JSON.stringify(arg0);
1191
+ return ret;
1192
+ }, arguments);
987
1193
  }
988
1194
 
989
- export function __wbg_fetch_1fdc4448ed9eec00(arg0, arg1) {
990
- const ret = getObject(arg0).fetch(getObject(arg1));
991
- return addHeapObject(ret);
1195
+ export function __wbg_subarray_aa9065fa9dc5df96(arg0, arg1, arg2) {
1196
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1197
+ return ret;
992
1198
  }
993
1199
 
994
- export function __wbg_new_75169ae5a9683c55() {
995
- return handleError(function () {
996
- const ret = new AbortController();
997
- return addHeapObject(ret);
1200
+ export function __wbg_text_7805bea50de2af49() {
1201
+ return handleError(function (arg0) {
1202
+ const ret = arg0.text();
1203
+ return ret;
998
1204
  }, arguments);
999
1205
  }
1000
1206
 
1001
- export function __wbindgen_boolean_get(arg0) {
1002
- const v = getObject(arg0);
1003
- const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
1207
+ export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
1208
+ const ret = arg0.then(arg1);
1004
1209
  return ret;
1005
1210
  }
1006
1211
 
1007
- export function __wbindgen_number_get(arg0, arg1) {
1008
- const obj = getObject(arg1);
1009
- const ret = typeof obj === "number" ? obj : undefined;
1010
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1011
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1212
+ export function __wbg_then_48b406749878a531(arg0, arg1, arg2) {
1213
+ const ret = arg0.then(arg1, arg2);
1214
+ return ret;
1012
1215
  }
1013
1216
 
1014
- export function __wbg_String_b9412f8799faab3e(arg0, arg1) {
1015
- const ret = String(getObject(arg1));
1217
+ export function __wbg_url_ae10c34ca209681d(arg0, arg1) {
1218
+ const ret = arg1.url;
1016
1219
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1017
1220
  const len1 = WASM_VECTOR_LEN;
1018
1221
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1019
1222
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1020
1223
  }
1021
1224
 
1225
+ export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
1226
+ const ret = arg0.value;
1227
+ return ret;
1228
+ }
1229
+
1230
+ export function __wbg_versions_c71aa1626a93e0a1(arg0) {
1231
+ const ret = arg0.versions;
1232
+ return ret;
1233
+ }
1234
+
1235
+ export function __wbg_warn_aaf1f4664a035bd6(arg0, arg1, arg2, arg3) {
1236
+ console.warn(arg0, arg1, arg2, arg3);
1237
+ }
1238
+
1239
+ export function __wbindgen_as_number(arg0) {
1240
+ const ret = +arg0;
1241
+ return ret;
1242
+ }
1243
+
1244
+ export function __wbindgen_boolean_get(arg0) {
1245
+ const v = arg0;
1246
+ const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
1247
+ return ret;
1248
+ }
1249
+
1250
+ export function __wbindgen_cb_drop(arg0) {
1251
+ const obj = arg0.original;
1252
+ if (obj.cnt-- == 1) {
1253
+ obj.a = 0;
1254
+ return true;
1255
+ }
1256
+ const ret = false;
1257
+ return ret;
1258
+ }
1259
+
1260
+ export function __wbindgen_closure_wrapper2160(arg0, arg1, arg2) {
1261
+ const ret = makeMutClosure(arg0, arg1, 606, __wbg_adapter_42);
1262
+ return ret;
1263
+ }
1264
+
1022
1265
  export function __wbindgen_debug_string(arg0, arg1) {
1023
- const ret = debugString(getObject(arg1));
1266
+ const ret = debugString(arg1);
1024
1267
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1025
1268
  const len1 = WASM_VECTOR_LEN;
1026
1269
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1027
1270
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1028
1271
  }
1029
1272
 
1030
- export function __wbindgen_throw(arg0, arg1) {
1031
- throw new Error(getStringFromWasm0(arg0, arg1));
1273
+ export function __wbindgen_error_new(arg0, arg1) {
1274
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1275
+ return ret;
1032
1276
  }
1033
1277
 
1034
- export function __wbg_queueMicrotask_848aa4969108a57e(arg0) {
1035
- const ret = getObject(arg0).queueMicrotask;
1036
- return addHeapObject(ret);
1278
+ export function __wbindgen_in(arg0, arg1) {
1279
+ const ret = arg0 in arg1;
1280
+ return ret;
1037
1281
  }
1038
1282
 
1039
- export function __wbg_queueMicrotask_c5419c06eab41e73(arg0) {
1040
- queueMicrotask(getObject(arg0));
1283
+ export function __wbindgen_init_externref_table() {
1284
+ const table = wasm.__wbindgen_export_4;
1285
+ const offset = table.grow(4);
1286
+ table.set(0, undefined);
1287
+ table.set(offset + 0, undefined);
1288
+ table.set(offset + 1, null);
1289
+ table.set(offset + 2, true);
1290
+ table.set(offset + 3, false);
1041
1291
  }
1042
1292
 
1043
- export function __wbg_newwithstrandinit_4b92c89af0a8e383() {
1044
- return handleError(function (arg0, arg1, arg2) {
1045
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1046
- return addHeapObject(ret);
1047
- }, arguments);
1293
+ export function __wbindgen_is_function(arg0) {
1294
+ const ret = typeof arg0 === "function";
1295
+ return ret;
1048
1296
  }
1049
1297
 
1050
- export function __wbg_debug_a0b6c2c5ac9a4bfd(arg0, arg1, arg2, arg3) {
1051
- console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1298
+ export function __wbindgen_is_object(arg0) {
1299
+ const val = arg0;
1300
+ const ret = typeof val === "object" && val !== null;
1301
+ return ret;
1052
1302
  }
1053
1303
 
1054
- export function __wbg_error_4d17c5bb1ca90c94(arg0, arg1, arg2, arg3) {
1055
- console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1304
+ export function __wbindgen_is_string(arg0) {
1305
+ const ret = typeof arg0 === "string";
1306
+ return ret;
1056
1307
  }
1057
1308
 
1058
- export function __wbg_info_1c7fba7da21072d1(arg0, arg1, arg2, arg3) {
1059
- console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1309
+ export function __wbindgen_is_undefined(arg0) {
1310
+ const ret = arg0 === undefined;
1311
+ return ret;
1060
1312
  }
1061
1313
 
1062
- export function __wbg_log_4de37a0274d94769(arg0, arg1, arg2, arg3) {
1063
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1314
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
1315
+ const ret = arg0 == arg1;
1316
+ return ret;
1317
+ }
1318
+
1319
+ export function __wbindgen_memory() {
1320
+ const ret = wasm.memory;
1321
+ return ret;
1322
+ }
1323
+
1324
+ export function __wbindgen_number_get(arg0, arg1) {
1325
+ const obj = arg1;
1326
+ const ret = typeof obj === "number" ? obj : undefined;
1327
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1328
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1064
1329
  }
1065
1330
 
1066
- export function __wbg_warn_2e2787d40aad9a81(arg0, arg1, arg2, arg3) {
1067
- console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
1331
+ export function __wbindgen_number_new(arg0) {
1332
+ const ret = arg0;
1333
+ return ret;
1068
1334
  }
1069
1335
 
1070
- export function __wbindgen_closure_wrapper1610(arg0, arg1, arg2) {
1071
- const ret = makeMutClosure(arg0, arg1, 425, __wbg_adapter_38);
1072
- return addHeapObject(ret);
1336
+ export function __wbindgen_string_get(arg0, arg1) {
1337
+ const obj = arg1;
1338
+ const ret = typeof obj === "string" ? obj : undefined;
1339
+ var ptr1 = isLikeNone(ret)
1340
+ ? 0
1341
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1342
+ var len1 = WASM_VECTOR_LEN;
1343
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1344
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1345
+ }
1346
+
1347
+ export function __wbindgen_string_new(arg0, arg1) {
1348
+ const ret = getStringFromWasm0(arg0, arg1);
1349
+ return ret;
1350
+ }
1351
+
1352
+ export function __wbindgen_throw(arg0, arg1) {
1353
+ throw new Error(getStringFromWasm0(arg0, arg1));
1073
1354
  }