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