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