@bitwarden/sdk-internal 0.2.0-main.35 → 0.2.0-main.351
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 +2079 -140
- package/bitwarden_wasm_internal_bg.js +4084 -277
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +406 -15
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +2079 -140
- package/node/bitwarden_wasm_internal.js +4102 -277
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +406 -15
- package/package.json +16 -5
|
@@ -92,15 +92,6 @@ function getDataViewMemory0() {
|
|
|
92
92
|
return cachedDataViewMemory0;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
96
|
-
|
|
97
|
-
cachedTextDecoder.decode();
|
|
98
|
-
|
|
99
|
-
function getStringFromWasm0(ptr, len) {
|
|
100
|
-
ptr = ptr >>> 0;
|
|
101
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
95
|
let heap_next = heap.length;
|
|
105
96
|
|
|
106
97
|
function addHeapObject(obj) {
|
|
@@ -120,6 +111,19 @@ function handleError(f, args) {
|
|
|
120
111
|
}
|
|
121
112
|
}
|
|
122
113
|
|
|
114
|
+
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
115
|
+
|
|
116
|
+
cachedTextDecoder.decode();
|
|
117
|
+
|
|
118
|
+
function getStringFromWasm0(ptr, len) {
|
|
119
|
+
ptr = ptr >>> 0;
|
|
120
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function isLikeNone(x) {
|
|
124
|
+
return x === undefined || x === null;
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
function dropObject(idx) {
|
|
124
128
|
if (idx < 132) return;
|
|
125
129
|
heap[idx] = heap_next;
|
|
@@ -132,8 +136,9 @@ function takeObject(idx) {
|
|
|
132
136
|
return ret;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
|
-
function
|
|
136
|
-
|
|
139
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
140
|
+
ptr = ptr >>> 0;
|
|
141
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
const CLOSURE_DTORS =
|
|
@@ -232,6 +237,93 @@ function debugString(val) {
|
|
|
232
237
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
233
238
|
return className;
|
|
234
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* @param {LogLevel} level
|
|
242
|
+
*/
|
|
243
|
+
module.exports.set_log_level = function (level) {
|
|
244
|
+
wasm.set_log_level(level);
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @param {LogLevel | null} [log_level]
|
|
249
|
+
*/
|
|
250
|
+
module.exports.init_sdk = function (log_level) {
|
|
251
|
+
wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
255
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
256
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
257
|
+
WASM_VECTOR_LEN = arg.length;
|
|
258
|
+
return ptr;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Generate a new SSH key pair
|
|
262
|
+
*
|
|
263
|
+
* # Arguments
|
|
264
|
+
* - `key_algorithm` - The algorithm to use for the key pair
|
|
265
|
+
*
|
|
266
|
+
* # Returns
|
|
267
|
+
* - `Ok(SshKey)` if the key was successfully generated
|
|
268
|
+
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
269
|
+
* @param {KeyAlgorithm} key_algorithm
|
|
270
|
+
* @returns {SshKeyView}
|
|
271
|
+
*/
|
|
272
|
+
module.exports.generate_ssh_key = function (key_algorithm) {
|
|
273
|
+
try {
|
|
274
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
275
|
+
wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
|
|
276
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
277
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
278
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
279
|
+
if (r2) {
|
|
280
|
+
throw takeObject(r1);
|
|
281
|
+
}
|
|
282
|
+
return takeObject(r0);
|
|
283
|
+
} finally {
|
|
284
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
|
|
290
|
+
* to an OpenSSH private key with public key and fingerprint
|
|
291
|
+
*
|
|
292
|
+
* # Arguments
|
|
293
|
+
* - `imported_key` - The private key to convert
|
|
294
|
+
* - `password` - The password to use for decrypting the key
|
|
295
|
+
*
|
|
296
|
+
* # Returns
|
|
297
|
+
* - `Ok(SshKey)` if the key was successfully coneverted
|
|
298
|
+
* - `Err(PasswordRequired)` if the key is encrypted and no password was provided
|
|
299
|
+
* - `Err(WrongPassword)` if the password provided is incorrect
|
|
300
|
+
* - `Err(ParsingError)` if the key could not be parsed
|
|
301
|
+
* - `Err(UnsupportedKeyType)` if the key type is not supported
|
|
302
|
+
* @param {string} imported_key
|
|
303
|
+
* @param {string | null} [password]
|
|
304
|
+
* @returns {SshKeyView}
|
|
305
|
+
*/
|
|
306
|
+
module.exports.import_ssh_key = function (imported_key, password) {
|
|
307
|
+
try {
|
|
308
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
309
|
+
const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
311
|
+
var ptr1 = isLikeNone(password)
|
|
312
|
+
? 0
|
|
313
|
+
: passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
|
+
var len1 = WASM_VECTOR_LEN;
|
|
315
|
+
wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1);
|
|
316
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
317
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
318
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
319
|
+
if (r2) {
|
|
320
|
+
throw takeObject(r1);
|
|
321
|
+
}
|
|
322
|
+
return takeObject(r0);
|
|
323
|
+
} finally {
|
|
324
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
235
327
|
|
|
236
328
|
let stack_pointer = 128;
|
|
237
329
|
|
|
@@ -244,9 +336,87 @@ function addBorrowedObject(obj) {
|
|
|
244
336
|
* @param {any} error
|
|
245
337
|
* @returns {boolean}
|
|
246
338
|
*/
|
|
247
|
-
module.exports.
|
|
339
|
+
module.exports.isTestError = function (error) {
|
|
340
|
+
try {
|
|
341
|
+
const ret = wasm.isTestError(addBorrowedObject(error));
|
|
342
|
+
return ret !== 0;
|
|
343
|
+
} finally {
|
|
344
|
+
heap[stack_pointer++] = undefined;
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* @param {any} error
|
|
350
|
+
* @returns {boolean}
|
|
351
|
+
*/
|
|
352
|
+
module.exports.isCollectionDecryptError = function (error) {
|
|
353
|
+
try {
|
|
354
|
+
const ret = wasm.isCollectionDecryptError(addBorrowedObject(error));
|
|
355
|
+
return ret !== 0;
|
|
356
|
+
} finally {
|
|
357
|
+
heap[stack_pointer++] = undefined;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* @param {any} error
|
|
363
|
+
* @returns {boolean}
|
|
364
|
+
*/
|
|
365
|
+
module.exports.isMasterPasswordError = function (error) {
|
|
366
|
+
try {
|
|
367
|
+
const ret = wasm.isMasterPasswordError(addBorrowedObject(error));
|
|
368
|
+
return ret !== 0;
|
|
369
|
+
} finally {
|
|
370
|
+
heap[stack_pointer++] = undefined;
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* @param {any} error
|
|
376
|
+
* @returns {boolean}
|
|
377
|
+
*/
|
|
378
|
+
module.exports.isDeriveKeyConnectorError = function (error) {
|
|
379
|
+
try {
|
|
380
|
+
const ret = wasm.isDeriveKeyConnectorError(addBorrowedObject(error));
|
|
381
|
+
return ret !== 0;
|
|
382
|
+
} finally {
|
|
383
|
+
heap[stack_pointer++] = undefined;
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @param {any} error
|
|
389
|
+
* @returns {boolean}
|
|
390
|
+
*/
|
|
391
|
+
module.exports.isEnrollAdminPasswordResetError = function (error) {
|
|
392
|
+
try {
|
|
393
|
+
const ret = wasm.isEnrollAdminPasswordResetError(addBorrowedObject(error));
|
|
394
|
+
return ret !== 0;
|
|
395
|
+
} finally {
|
|
396
|
+
heap[stack_pointer++] = undefined;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* @param {any} error
|
|
402
|
+
* @returns {boolean}
|
|
403
|
+
*/
|
|
404
|
+
module.exports.isCryptoClientError = function (error) {
|
|
405
|
+
try {
|
|
406
|
+
const ret = wasm.isCryptoClientError(addBorrowedObject(error));
|
|
407
|
+
return ret !== 0;
|
|
408
|
+
} finally {
|
|
409
|
+
heap[stack_pointer++] = undefined;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* @param {any} error
|
|
415
|
+
* @returns {boolean}
|
|
416
|
+
*/
|
|
417
|
+
module.exports.isStatefulCryptoError = function (error) {
|
|
248
418
|
try {
|
|
249
|
-
const ret = wasm.
|
|
419
|
+
const ret = wasm.isStatefulCryptoError(addBorrowedObject(error));
|
|
250
420
|
return ret !== 0;
|
|
251
421
|
} finally {
|
|
252
422
|
heap[stack_pointer++] = undefined;
|
|
@@ -270,22 +440,41 @@ module.exports.isEncryptionSettingsError = function (error) {
|
|
|
270
440
|
* @param {any} error
|
|
271
441
|
* @returns {boolean}
|
|
272
442
|
*/
|
|
273
|
-
module.exports.
|
|
443
|
+
module.exports.isCryptoError = function (error) {
|
|
274
444
|
try {
|
|
275
|
-
const ret = wasm.
|
|
445
|
+
const ret = wasm.isCryptoError(addBorrowedObject(error));
|
|
276
446
|
return ret !== 0;
|
|
277
447
|
} finally {
|
|
278
448
|
heap[stack_pointer++] = undefined;
|
|
279
449
|
}
|
|
280
450
|
};
|
|
281
451
|
|
|
452
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
453
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
454
|
+
const mem = getDataViewMemory0();
|
|
455
|
+
for (let i = 0; i < array.length; i++) {
|
|
456
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
457
|
+
}
|
|
458
|
+
WASM_VECTOR_LEN = array.length;
|
|
459
|
+
return ptr;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
463
|
+
ptr = ptr >>> 0;
|
|
464
|
+
const mem = getDataViewMemory0();
|
|
465
|
+
const result = [];
|
|
466
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
467
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
468
|
+
}
|
|
469
|
+
return result;
|
|
470
|
+
}
|
|
282
471
|
/**
|
|
283
472
|
* @param {any} error
|
|
284
473
|
* @returns {boolean}
|
|
285
474
|
*/
|
|
286
|
-
module.exports.
|
|
475
|
+
module.exports.isExportError = function (error) {
|
|
287
476
|
try {
|
|
288
|
-
const ret = wasm.
|
|
477
|
+
const ret = wasm.isExportError(addBorrowedObject(error));
|
|
289
478
|
return ret !== 0;
|
|
290
479
|
} finally {
|
|
291
480
|
heap[stack_pointer++] = undefined;
|
|
@@ -293,254 +482,3423 @@ module.exports.isTestError = function (error) {
|
|
|
293
482
|
};
|
|
294
483
|
|
|
295
484
|
/**
|
|
296
|
-
* @param {
|
|
297
|
-
* @returns {
|
|
485
|
+
* @param {any} error
|
|
486
|
+
* @returns {boolean}
|
|
298
487
|
*/
|
|
299
|
-
module.exports.
|
|
488
|
+
module.exports.isUsernameError = function (error) {
|
|
300
489
|
try {
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
304
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
305
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
306
|
-
if (r2) {
|
|
307
|
-
throw takeObject(r1);
|
|
308
|
-
}
|
|
309
|
-
return takeObject(r0);
|
|
490
|
+
const ret = wasm.isUsernameError(addBorrowedObject(error));
|
|
491
|
+
return ret !== 0;
|
|
310
492
|
} finally {
|
|
311
|
-
|
|
493
|
+
heap[stack_pointer++] = undefined;
|
|
312
494
|
}
|
|
313
495
|
};
|
|
314
496
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
497
|
+
/**
|
|
498
|
+
* @param {any} error
|
|
499
|
+
* @returns {boolean}
|
|
500
|
+
*/
|
|
501
|
+
module.exports.isPasswordError = function (error) {
|
|
502
|
+
try {
|
|
503
|
+
const ret = wasm.isPasswordError(addBorrowedObject(error));
|
|
504
|
+
return ret !== 0;
|
|
505
|
+
} finally {
|
|
506
|
+
heap[stack_pointer++] = undefined;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
322
509
|
|
|
323
|
-
function
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
addHeapObject(arg2),
|
|
328
|
-
addHeapObject(arg3),
|
|
329
|
-
);
|
|
510
|
+
function _assertClass(instance, klass) {
|
|
511
|
+
if (!(instance instanceof klass)) {
|
|
512
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
513
|
+
}
|
|
330
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* Registers a DiscoverHandler so that the client can respond to DiscoverRequests.
|
|
517
|
+
* @param {IpcClient} ipc_client
|
|
518
|
+
* @param {DiscoverResponse} response
|
|
519
|
+
* @returns {Promise<void>}
|
|
520
|
+
*/
|
|
521
|
+
module.exports.ipcRegisterDiscoverHandler = function (ipc_client, response) {
|
|
522
|
+
_assertClass(ipc_client, IpcClient);
|
|
523
|
+
const ret = wasm.ipcRegisterDiscoverHandler(ipc_client.__wbg_ptr, addHeapObject(response));
|
|
524
|
+
return takeObject(ret);
|
|
525
|
+
};
|
|
331
526
|
|
|
332
527
|
/**
|
|
333
|
-
*
|
|
528
|
+
* Sends a DiscoverRequest to the specified destination and returns the response.
|
|
529
|
+
* @param {IpcClient} ipc_client
|
|
530
|
+
* @param {Endpoint} destination
|
|
531
|
+
* @param {AbortSignal | null} [abort_signal]
|
|
532
|
+
* @returns {Promise<DiscoverResponse>}
|
|
334
533
|
*/
|
|
335
|
-
module.exports.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
Error: 4,
|
|
345
|
-
4: "Error",
|
|
346
|
-
});
|
|
534
|
+
module.exports.ipcRequestDiscover = function (ipc_client, destination, abort_signal) {
|
|
535
|
+
_assertClass(ipc_client, IpcClient);
|
|
536
|
+
const ret = wasm.ipcRequestDiscover(
|
|
537
|
+
ipc_client.__wbg_ptr,
|
|
538
|
+
addHeapObject(destination),
|
|
539
|
+
isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal),
|
|
540
|
+
);
|
|
541
|
+
return takeObject(ret);
|
|
542
|
+
};
|
|
347
543
|
|
|
348
|
-
|
|
544
|
+
/**
|
|
545
|
+
* @param {any} error
|
|
546
|
+
* @returns {boolean}
|
|
547
|
+
*/
|
|
548
|
+
module.exports.isChannelError = function (error) {
|
|
549
|
+
try {
|
|
550
|
+
const ret = wasm.isChannelError(addBorrowedObject(error));
|
|
551
|
+
return ret !== 0;
|
|
552
|
+
} finally {
|
|
553
|
+
heap[stack_pointer++] = undefined;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
349
556
|
|
|
350
|
-
|
|
557
|
+
/**
|
|
558
|
+
* @param {any} error
|
|
559
|
+
* @returns {boolean}
|
|
560
|
+
*/
|
|
561
|
+
module.exports.isDeserializeError = function (error) {
|
|
562
|
+
try {
|
|
563
|
+
const ret = wasm.isDeserializeError(addBorrowedObject(error));
|
|
564
|
+
return ret !== 0;
|
|
565
|
+
} finally {
|
|
566
|
+
heap[stack_pointer++] = undefined;
|
|
567
|
+
}
|
|
568
|
+
};
|
|
351
569
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
570
|
+
/**
|
|
571
|
+
* @param {any} error
|
|
572
|
+
* @returns {boolean}
|
|
573
|
+
*/
|
|
574
|
+
module.exports.isRequestError = function (error) {
|
|
575
|
+
try {
|
|
576
|
+
const ret = wasm.isRequestError(addBorrowedObject(error));
|
|
577
|
+
return ret !== 0;
|
|
578
|
+
} finally {
|
|
579
|
+
heap[stack_pointer++] = undefined;
|
|
580
|
+
}
|
|
581
|
+
};
|
|
356
582
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
583
|
+
/**
|
|
584
|
+
* @param {any} error
|
|
585
|
+
* @returns {boolean}
|
|
586
|
+
*/
|
|
587
|
+
module.exports.isTypedReceiveError = function (error) {
|
|
588
|
+
try {
|
|
589
|
+
const ret = wasm.isTypedReceiveError(addBorrowedObject(error));
|
|
590
|
+
return ret !== 0;
|
|
591
|
+
} finally {
|
|
592
|
+
heap[stack_pointer++] = undefined;
|
|
363
593
|
}
|
|
594
|
+
};
|
|
364
595
|
|
|
365
|
-
|
|
596
|
+
/**
|
|
597
|
+
* @param {any} error
|
|
598
|
+
* @returns {boolean}
|
|
599
|
+
*/
|
|
600
|
+
module.exports.isReceiveError = function (error) {
|
|
601
|
+
try {
|
|
602
|
+
const ret = wasm.isReceiveError(addBorrowedObject(error));
|
|
603
|
+
return ret !== 0;
|
|
604
|
+
} finally {
|
|
605
|
+
heap[stack_pointer++] = undefined;
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* @param {any} error
|
|
611
|
+
* @returns {boolean}
|
|
612
|
+
*/
|
|
613
|
+
module.exports.isSubscribeError = function (error) {
|
|
614
|
+
try {
|
|
615
|
+
const ret = wasm.isSubscribeError(addBorrowedObject(error));
|
|
616
|
+
return ret !== 0;
|
|
617
|
+
} finally {
|
|
618
|
+
heap[stack_pointer++] = undefined;
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* @param {any} error
|
|
624
|
+
* @returns {boolean}
|
|
625
|
+
*/
|
|
626
|
+
module.exports.isSshKeyExportError = function (error) {
|
|
627
|
+
try {
|
|
628
|
+
const ret = wasm.isSshKeyExportError(addBorrowedObject(error));
|
|
629
|
+
return ret !== 0;
|
|
630
|
+
} finally {
|
|
631
|
+
heap[stack_pointer++] = undefined;
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* @param {any} error
|
|
637
|
+
* @returns {boolean}
|
|
638
|
+
*/
|
|
639
|
+
module.exports.isSshKeyImportError = function (error) {
|
|
640
|
+
try {
|
|
641
|
+
const ret = wasm.isSshKeyImportError(addBorrowedObject(error));
|
|
642
|
+
return ret !== 0;
|
|
643
|
+
} finally {
|
|
644
|
+
heap[stack_pointer++] = undefined;
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* @param {any} error
|
|
650
|
+
* @returns {boolean}
|
|
651
|
+
*/
|
|
652
|
+
module.exports.isKeyGenerationError = function (error) {
|
|
653
|
+
try {
|
|
654
|
+
const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
|
|
655
|
+
return ret !== 0;
|
|
656
|
+
} finally {
|
|
657
|
+
heap[stack_pointer++] = undefined;
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* @param {any} error
|
|
663
|
+
* @returns {boolean}
|
|
664
|
+
*/
|
|
665
|
+
module.exports.isDatabaseError = function (error) {
|
|
666
|
+
try {
|
|
667
|
+
const ret = wasm.isDatabaseError(addBorrowedObject(error));
|
|
668
|
+
return ret !== 0;
|
|
669
|
+
} finally {
|
|
670
|
+
heap[stack_pointer++] = undefined;
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* @param {any} error
|
|
676
|
+
* @returns {boolean}
|
|
677
|
+
*/
|
|
678
|
+
module.exports.isStateRegistryError = function (error) {
|
|
679
|
+
try {
|
|
680
|
+
const ret = wasm.isStateRegistryError(addBorrowedObject(error));
|
|
681
|
+
return ret !== 0;
|
|
682
|
+
} finally {
|
|
683
|
+
heap[stack_pointer++] = undefined;
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* @param {any} error
|
|
689
|
+
* @returns {boolean}
|
|
690
|
+
*/
|
|
691
|
+
module.exports.isCallError = function (error) {
|
|
692
|
+
try {
|
|
693
|
+
const ret = wasm.isCallError(addBorrowedObject(error));
|
|
694
|
+
return ret !== 0;
|
|
695
|
+
} finally {
|
|
696
|
+
heap[stack_pointer++] = undefined;
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* @param {any} error
|
|
702
|
+
* @returns {boolean}
|
|
703
|
+
*/
|
|
704
|
+
module.exports.isDecryptError = function (error) {
|
|
705
|
+
try {
|
|
706
|
+
const ret = wasm.isDecryptError(addBorrowedObject(error));
|
|
707
|
+
return ret !== 0;
|
|
708
|
+
} finally {
|
|
709
|
+
heap[stack_pointer++] = undefined;
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* @param {any} error
|
|
715
|
+
* @returns {boolean}
|
|
716
|
+
*/
|
|
717
|
+
module.exports.isEncryptError = function (error) {
|
|
718
|
+
try {
|
|
719
|
+
const ret = wasm.isEncryptError(addBorrowedObject(error));
|
|
720
|
+
return ret !== 0;
|
|
721
|
+
} finally {
|
|
722
|
+
heap[stack_pointer++] = undefined;
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* @param {any} error
|
|
728
|
+
* @returns {boolean}
|
|
729
|
+
*/
|
|
730
|
+
module.exports.isTotpError = function (error) {
|
|
731
|
+
try {
|
|
732
|
+
const ret = wasm.isTotpError(addBorrowedObject(error));
|
|
733
|
+
return ret !== 0;
|
|
734
|
+
} finally {
|
|
735
|
+
heap[stack_pointer++] = undefined;
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* @param {any} error
|
|
741
|
+
* @returns {boolean}
|
|
742
|
+
*/
|
|
743
|
+
module.exports.isGetFolderError = function (error) {
|
|
744
|
+
try {
|
|
745
|
+
const ret = wasm.isGetFolderError(addBorrowedObject(error));
|
|
746
|
+
return ret !== 0;
|
|
747
|
+
} finally {
|
|
748
|
+
heap[stack_pointer++] = undefined;
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* @param {any} error
|
|
754
|
+
* @returns {boolean}
|
|
755
|
+
*/
|
|
756
|
+
module.exports.isEditFolderError = function (error) {
|
|
757
|
+
try {
|
|
758
|
+
const ret = wasm.isEditFolderError(addBorrowedObject(error));
|
|
759
|
+
return ret !== 0;
|
|
760
|
+
} finally {
|
|
761
|
+
heap[stack_pointer++] = undefined;
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* @param {any} error
|
|
767
|
+
* @returns {boolean}
|
|
768
|
+
*/
|
|
769
|
+
module.exports.isCreateFolderError = function (error) {
|
|
770
|
+
try {
|
|
771
|
+
const ret = wasm.isCreateFolderError(addBorrowedObject(error));
|
|
772
|
+
return ret !== 0;
|
|
773
|
+
} finally {
|
|
774
|
+
heap[stack_pointer++] = undefined;
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @param {any} error
|
|
780
|
+
* @returns {boolean}
|
|
781
|
+
*/
|
|
782
|
+
module.exports.isCipherError = function (error) {
|
|
783
|
+
try {
|
|
784
|
+
const ret = wasm.isCipherError(addBorrowedObject(error));
|
|
785
|
+
return ret !== 0;
|
|
786
|
+
} finally {
|
|
787
|
+
heap[stack_pointer++] = undefined;
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* @param {any} error
|
|
793
|
+
* @returns {boolean}
|
|
794
|
+
*/
|
|
795
|
+
module.exports.isDecryptFileError = function (error) {
|
|
796
|
+
try {
|
|
797
|
+
const ret = wasm.isDecryptFileError(addBorrowedObject(error));
|
|
798
|
+
return ret !== 0;
|
|
799
|
+
} finally {
|
|
800
|
+
heap[stack_pointer++] = undefined;
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* @param {any} error
|
|
806
|
+
* @returns {boolean}
|
|
807
|
+
*/
|
|
808
|
+
module.exports.isEncryptFileError = function (error) {
|
|
809
|
+
try {
|
|
810
|
+
const ret = wasm.isEncryptFileError(addBorrowedObject(error));
|
|
811
|
+
return ret !== 0;
|
|
812
|
+
} finally {
|
|
813
|
+
heap[stack_pointer++] = undefined;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
818
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h73da98aaeb1dd73e(
|
|
819
|
+
arg0,
|
|
820
|
+
arg1,
|
|
821
|
+
addHeapObject(arg2),
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
826
|
+
try {
|
|
827
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
828
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8ea2596275819f2b(
|
|
829
|
+
retptr,
|
|
830
|
+
arg0,
|
|
831
|
+
arg1,
|
|
832
|
+
addHeapObject(arg2),
|
|
833
|
+
);
|
|
834
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
835
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
836
|
+
if (r1) {
|
|
837
|
+
throw takeObject(r0);
|
|
838
|
+
}
|
|
839
|
+
} finally {
|
|
840
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
function __wbg_adapter_60(arg0, arg1) {
|
|
845
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h091423ccfc08366e(
|
|
846
|
+
arg0,
|
|
847
|
+
arg1,
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
function __wbg_adapter_341(arg0, arg1, arg2, arg3) {
|
|
852
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h54a8613170fef18e(
|
|
853
|
+
arg0,
|
|
854
|
+
arg1,
|
|
855
|
+
addHeapObject(arg2),
|
|
856
|
+
addHeapObject(arg3),
|
|
857
|
+
);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* @enum {300 | 301 | 302 | 303 | 304 | 305}
|
|
862
|
+
*/
|
|
863
|
+
module.exports.CardLinkedIdType = Object.freeze({
|
|
864
|
+
CardholderName: 300,
|
|
865
|
+
300: "CardholderName",
|
|
866
|
+
ExpMonth: 301,
|
|
867
|
+
301: "ExpMonth",
|
|
868
|
+
ExpYear: 302,
|
|
869
|
+
302: "ExpYear",
|
|
870
|
+
Code: 303,
|
|
871
|
+
303: "Code",
|
|
872
|
+
Brand: 304,
|
|
873
|
+
304: "Brand",
|
|
874
|
+
Number: 305,
|
|
875
|
+
305: "Number",
|
|
876
|
+
});
|
|
877
|
+
/**
|
|
878
|
+
* @enum {0 | 1}
|
|
879
|
+
*/
|
|
880
|
+
module.exports.CipherRepromptType = Object.freeze({
|
|
881
|
+
None: 0,
|
|
882
|
+
0: "None",
|
|
883
|
+
Password: 1,
|
|
884
|
+
1: "Password",
|
|
885
|
+
});
|
|
886
|
+
/**
|
|
887
|
+
* @enum {1 | 2 | 3 | 4 | 5}
|
|
888
|
+
*/
|
|
889
|
+
module.exports.CipherType = Object.freeze({
|
|
890
|
+
Login: 1,
|
|
891
|
+
1: "Login",
|
|
892
|
+
SecureNote: 2,
|
|
893
|
+
2: "SecureNote",
|
|
894
|
+
Card: 3,
|
|
895
|
+
3: "Card",
|
|
896
|
+
Identity: 4,
|
|
897
|
+
4: "Identity",
|
|
898
|
+
SshKey: 5,
|
|
899
|
+
5: "SshKey",
|
|
900
|
+
});
|
|
901
|
+
/**
|
|
902
|
+
* Represents the type of a [FieldView].
|
|
903
|
+
* @enum {0 | 1 | 2 | 3}
|
|
904
|
+
*/
|
|
905
|
+
module.exports.FieldType = Object.freeze({
|
|
906
|
+
/**
|
|
907
|
+
* Text field
|
|
908
|
+
*/
|
|
909
|
+
Text: 0,
|
|
910
|
+
0: "Text",
|
|
911
|
+
/**
|
|
912
|
+
* Hidden text field
|
|
913
|
+
*/
|
|
914
|
+
Hidden: 1,
|
|
915
|
+
1: "Hidden",
|
|
916
|
+
/**
|
|
917
|
+
* Boolean field
|
|
918
|
+
*/
|
|
919
|
+
Boolean: 2,
|
|
920
|
+
2: "Boolean",
|
|
921
|
+
/**
|
|
922
|
+
* Linked field
|
|
923
|
+
*/
|
|
924
|
+
Linked: 3,
|
|
925
|
+
3: "Linked",
|
|
926
|
+
});
|
|
927
|
+
/**
|
|
928
|
+
* @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
|
|
929
|
+
*/
|
|
930
|
+
module.exports.IdentityLinkedIdType = Object.freeze({
|
|
931
|
+
Title: 400,
|
|
932
|
+
400: "Title",
|
|
933
|
+
MiddleName: 401,
|
|
934
|
+
401: "MiddleName",
|
|
935
|
+
Address1: 402,
|
|
936
|
+
402: "Address1",
|
|
937
|
+
Address2: 403,
|
|
938
|
+
403: "Address2",
|
|
939
|
+
Address3: 404,
|
|
940
|
+
404: "Address3",
|
|
941
|
+
City: 405,
|
|
942
|
+
405: "City",
|
|
943
|
+
State: 406,
|
|
944
|
+
406: "State",
|
|
945
|
+
PostalCode: 407,
|
|
946
|
+
407: "PostalCode",
|
|
947
|
+
Country: 408,
|
|
948
|
+
408: "Country",
|
|
949
|
+
Company: 409,
|
|
950
|
+
409: "Company",
|
|
951
|
+
Email: 410,
|
|
952
|
+
410: "Email",
|
|
953
|
+
Phone: 411,
|
|
954
|
+
411: "Phone",
|
|
955
|
+
Ssn: 412,
|
|
956
|
+
412: "Ssn",
|
|
957
|
+
Username: 413,
|
|
958
|
+
413: "Username",
|
|
959
|
+
PassportNumber: 414,
|
|
960
|
+
414: "PassportNumber",
|
|
961
|
+
LicenseNumber: 415,
|
|
962
|
+
415: "LicenseNumber",
|
|
963
|
+
FirstName: 416,
|
|
964
|
+
416: "FirstName",
|
|
965
|
+
LastName: 417,
|
|
966
|
+
417: "LastName",
|
|
967
|
+
FullName: 418,
|
|
968
|
+
418: "FullName",
|
|
969
|
+
});
|
|
970
|
+
/**
|
|
971
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
972
|
+
*/
|
|
973
|
+
module.exports.LogLevel = Object.freeze({
|
|
974
|
+
Trace: 0,
|
|
975
|
+
0: "Trace",
|
|
976
|
+
Debug: 1,
|
|
977
|
+
1: "Debug",
|
|
978
|
+
Info: 2,
|
|
979
|
+
2: "Info",
|
|
980
|
+
Warn: 3,
|
|
981
|
+
3: "Warn",
|
|
982
|
+
Error: 4,
|
|
983
|
+
4: "Error",
|
|
984
|
+
});
|
|
985
|
+
/**
|
|
986
|
+
* @enum {100 | 101}
|
|
987
|
+
*/
|
|
988
|
+
module.exports.LoginLinkedIdType = Object.freeze({
|
|
989
|
+
Username: 100,
|
|
990
|
+
100: "Username",
|
|
991
|
+
Password: 101,
|
|
992
|
+
101: "Password",
|
|
993
|
+
});
|
|
994
|
+
/**
|
|
995
|
+
* @enum {0}
|
|
996
|
+
*/
|
|
997
|
+
module.exports.SecureNoteType = Object.freeze({
|
|
998
|
+
Generic: 0,
|
|
999
|
+
0: "Generic",
|
|
1000
|
+
});
|
|
1001
|
+
/**
|
|
1002
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
1003
|
+
*/
|
|
1004
|
+
module.exports.UriMatchType = Object.freeze({
|
|
1005
|
+
Domain: 0,
|
|
1006
|
+
0: "Domain",
|
|
1007
|
+
Host: 1,
|
|
1008
|
+
1: "Host",
|
|
1009
|
+
StartsWith: 2,
|
|
1010
|
+
2: "StartsWith",
|
|
1011
|
+
Exact: 3,
|
|
1012
|
+
3: "Exact",
|
|
1013
|
+
RegularExpression: 4,
|
|
1014
|
+
4: "RegularExpression",
|
|
1015
|
+
Never: 5,
|
|
1016
|
+
5: "Never",
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
1020
|
+
|
|
1021
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
1022
|
+
|
|
1023
|
+
const AttachmentsClientFinalization =
|
|
1024
|
+
typeof FinalizationRegistry === "undefined"
|
|
1025
|
+
? { register: () => {}, unregister: () => {} }
|
|
1026
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
|
|
1027
|
+
|
|
1028
|
+
class AttachmentsClient {
|
|
1029
|
+
static __wrap(ptr) {
|
|
1030
|
+
ptr = ptr >>> 0;
|
|
1031
|
+
const obj = Object.create(AttachmentsClient.prototype);
|
|
1032
|
+
obj.__wbg_ptr = ptr;
|
|
1033
|
+
AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1034
|
+
return obj;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
__destroy_into_raw() {
|
|
1038
|
+
const ptr = this.__wbg_ptr;
|
|
1039
|
+
this.__wbg_ptr = 0;
|
|
1040
|
+
AttachmentsClientFinalization.unregister(this);
|
|
1041
|
+
return ptr;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
free() {
|
|
1045
|
+
const ptr = this.__destroy_into_raw();
|
|
1046
|
+
wasm.__wbg_attachmentsclient_free(ptr, 0);
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* @param {Cipher} cipher
|
|
1050
|
+
* @param {AttachmentView} attachment
|
|
1051
|
+
* @param {Uint8Array} encrypted_buffer
|
|
1052
|
+
* @returns {Uint8Array}
|
|
1053
|
+
*/
|
|
1054
|
+
decrypt_buffer(cipher, attachment, encrypted_buffer) {
|
|
1055
|
+
try {
|
|
1056
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1057
|
+
const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
|
|
1058
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1059
|
+
wasm.attachmentsclient_decrypt_buffer(
|
|
1060
|
+
retptr,
|
|
1061
|
+
this.__wbg_ptr,
|
|
1062
|
+
addHeapObject(cipher),
|
|
1063
|
+
addHeapObject(attachment),
|
|
1064
|
+
ptr0,
|
|
1065
|
+
len0,
|
|
1066
|
+
);
|
|
1067
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1068
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1069
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1070
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1071
|
+
if (r3) {
|
|
1072
|
+
throw takeObject(r2);
|
|
1073
|
+
}
|
|
1074
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1075
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1076
|
+
return v2;
|
|
1077
|
+
} finally {
|
|
1078
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
module.exports.AttachmentsClient = AttachmentsClient;
|
|
1083
|
+
|
|
1084
|
+
const AuthClientFinalization =
|
|
1085
|
+
typeof FinalizationRegistry === "undefined"
|
|
1086
|
+
? { register: () => {}, unregister: () => {} }
|
|
1087
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_authclient_free(ptr >>> 0, 1));
|
|
1088
|
+
/**
|
|
1089
|
+
* Subclient containing auth functionality.
|
|
1090
|
+
*/
|
|
1091
|
+
class AuthClient {
|
|
1092
|
+
static __wrap(ptr) {
|
|
1093
|
+
ptr = ptr >>> 0;
|
|
1094
|
+
const obj = Object.create(AuthClient.prototype);
|
|
1095
|
+
obj.__wbg_ptr = ptr;
|
|
1096
|
+
AuthClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1097
|
+
return obj;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
__destroy_into_raw() {
|
|
1101
|
+
const ptr = this.__wbg_ptr;
|
|
1102
|
+
this.__wbg_ptr = 0;
|
|
1103
|
+
AuthClientFinalization.unregister(this);
|
|
1104
|
+
return ptr;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
free() {
|
|
1108
|
+
const ptr = this.__destroy_into_raw();
|
|
1109
|
+
wasm.__wbg_authclient_free(ptr, 0);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Client for send access functionality
|
|
1113
|
+
* @returns {SendAccessClient}
|
|
1114
|
+
*/
|
|
1115
|
+
send_access() {
|
|
1116
|
+
const ret = wasm.authclient_send_access(this.__wbg_ptr);
|
|
1117
|
+
return SendAccessClient.__wrap(ret);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
module.exports.AuthClient = AuthClient;
|
|
1121
|
+
|
|
1122
|
+
const BitwardenClientFinalization =
|
|
1123
|
+
typeof FinalizationRegistry === "undefined"
|
|
1124
|
+
? { register: () => {}, unregister: () => {} }
|
|
1125
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
|
|
1126
|
+
/**
|
|
1127
|
+
* The main entry point for the Bitwarden SDK in WebAssembly environments
|
|
1128
|
+
*/
|
|
1129
|
+
class BitwardenClient {
|
|
1130
|
+
__destroy_into_raw() {
|
|
1131
|
+
const ptr = this.__wbg_ptr;
|
|
1132
|
+
this.__wbg_ptr = 0;
|
|
1133
|
+
BitwardenClientFinalization.unregister(this);
|
|
1134
|
+
return ptr;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
free() {
|
|
1138
|
+
const ptr = this.__destroy_into_raw();
|
|
1139
|
+
wasm.__wbg_bitwardenclient_free(ptr, 0);
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Initialize a new instance of the SDK client
|
|
1143
|
+
* @param {any} token_provider
|
|
1144
|
+
* @param {ClientSettings | null} [settings]
|
|
1145
|
+
*/
|
|
1146
|
+
constructor(token_provider, settings) {
|
|
1147
|
+
const ret = wasm.bitwardenclient_new(
|
|
1148
|
+
addHeapObject(token_provider),
|
|
1149
|
+
isLikeNone(settings) ? 0 : addHeapObject(settings),
|
|
1150
|
+
);
|
|
1151
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1152
|
+
BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
|
|
1153
|
+
return this;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* Test method, echoes back the input
|
|
1157
|
+
* @param {string} msg
|
|
1158
|
+
* @returns {string}
|
|
1159
|
+
*/
|
|
1160
|
+
echo(msg) {
|
|
1161
|
+
let deferred2_0;
|
|
1162
|
+
let deferred2_1;
|
|
1163
|
+
try {
|
|
1164
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1165
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1167
|
+
wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1168
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1169
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1170
|
+
deferred2_0 = r0;
|
|
1171
|
+
deferred2_1 = r1;
|
|
1172
|
+
return getStringFromWasm0(r0, r1);
|
|
1173
|
+
} finally {
|
|
1174
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1175
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Returns the current SDK version
|
|
1180
|
+
* @returns {string}
|
|
1181
|
+
*/
|
|
1182
|
+
version() {
|
|
1183
|
+
let deferred1_0;
|
|
1184
|
+
let deferred1_1;
|
|
1185
|
+
try {
|
|
1186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1187
|
+
wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
|
|
1188
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1189
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1190
|
+
deferred1_0 = r0;
|
|
1191
|
+
deferred1_1 = r1;
|
|
1192
|
+
return getStringFromWasm0(r0, r1);
|
|
1193
|
+
} finally {
|
|
1194
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1195
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Test method, always throws an error
|
|
1200
|
+
* @param {string} msg
|
|
1201
|
+
*/
|
|
1202
|
+
throw(msg) {
|
|
1203
|
+
try {
|
|
1204
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1205
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1206
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1207
|
+
wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1208
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1209
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1210
|
+
if (r1) {
|
|
1211
|
+
throw takeObject(r0);
|
|
1212
|
+
}
|
|
1213
|
+
} finally {
|
|
1214
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Test method, calls http endpoint
|
|
1219
|
+
* @param {string} url
|
|
1220
|
+
* @returns {Promise<string>}
|
|
1221
|
+
*/
|
|
1222
|
+
http_get(url) {
|
|
1223
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1224
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1225
|
+
const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
|
|
1226
|
+
return takeObject(ret);
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Auth related operations.
|
|
1230
|
+
* @returns {AuthClient}
|
|
1231
|
+
*/
|
|
1232
|
+
auth() {
|
|
1233
|
+
const ret = wasm.bitwardenclient_auth(this.__wbg_ptr);
|
|
1234
|
+
return AuthClient.__wrap(ret);
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Crypto related operations.
|
|
1238
|
+
* @returns {CryptoClient}
|
|
1239
|
+
*/
|
|
1240
|
+
crypto() {
|
|
1241
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
1242
|
+
return CryptoClient.__wrap(ret);
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Vault item related operations.
|
|
1246
|
+
* @returns {VaultClient}
|
|
1247
|
+
*/
|
|
1248
|
+
vault() {
|
|
1249
|
+
const ret = wasm.bitwardenclient_vault(this.__wbg_ptr);
|
|
1250
|
+
return VaultClient.__wrap(ret);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Constructs a specific client for platform-specific functionality
|
|
1254
|
+
* @returns {PlatformClient}
|
|
1255
|
+
*/
|
|
1256
|
+
platform() {
|
|
1257
|
+
const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
|
|
1258
|
+
return PlatformClient.__wrap(ret);
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Constructs a specific client for generating passwords and passphrases
|
|
1262
|
+
* @returns {GeneratorClient}
|
|
1263
|
+
*/
|
|
1264
|
+
generator() {
|
|
1265
|
+
const ret = wasm.bitwardenclient_generator(this.__wbg_ptr);
|
|
1266
|
+
return GeneratorClient.__wrap(ret);
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Exporter related operations.
|
|
1270
|
+
* @returns {ExporterClient}
|
|
1271
|
+
*/
|
|
1272
|
+
exporters() {
|
|
1273
|
+
const ret = wasm.bitwardenclient_exporters(this.__wbg_ptr);
|
|
1274
|
+
return ExporterClient.__wrap(ret);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
module.exports.BitwardenClient = BitwardenClient;
|
|
1278
|
+
|
|
1279
|
+
const CiphersClientFinalization =
|
|
1280
|
+
typeof FinalizationRegistry === "undefined"
|
|
1281
|
+
? { register: () => {}, unregister: () => {} }
|
|
1282
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
|
|
1283
|
+
|
|
1284
|
+
class CiphersClient {
|
|
1285
|
+
static __wrap(ptr) {
|
|
1286
|
+
ptr = ptr >>> 0;
|
|
1287
|
+
const obj = Object.create(CiphersClient.prototype);
|
|
1288
|
+
obj.__wbg_ptr = ptr;
|
|
1289
|
+
CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1290
|
+
return obj;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
__destroy_into_raw() {
|
|
1294
|
+
const ptr = this.__wbg_ptr;
|
|
1295
|
+
this.__wbg_ptr = 0;
|
|
1296
|
+
CiphersClientFinalization.unregister(this);
|
|
1297
|
+
return ptr;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
free() {
|
|
1301
|
+
const ptr = this.__destroy_into_raw();
|
|
1302
|
+
wasm.__wbg_ciphersclient_free(ptr, 0);
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* @param {CipherView} cipher_view
|
|
1306
|
+
* @returns {EncryptionContext}
|
|
1307
|
+
*/
|
|
1308
|
+
encrypt(cipher_view) {
|
|
1309
|
+
try {
|
|
1310
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1311
|
+
wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
|
|
1312
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1313
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1314
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1315
|
+
if (r2) {
|
|
1316
|
+
throw takeObject(r1);
|
|
1317
|
+
}
|
|
1318
|
+
return takeObject(r0);
|
|
1319
|
+
} finally {
|
|
1320
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* Encrypt a cipher with the provided key. This should only be used when rotating encryption
|
|
1325
|
+
* keys in the Web client.
|
|
1326
|
+
*
|
|
1327
|
+
* Until key rotation is fully implemented in the SDK, this method must be provided the new
|
|
1328
|
+
* symmetric key in base64 format. See PM-23084
|
|
1329
|
+
*
|
|
1330
|
+
* If the cipher has a CipherKey, it will be re-encrypted with the new key.
|
|
1331
|
+
* If the cipher does not have a CipherKey and CipherKeyEncryption is enabled, one will be
|
|
1332
|
+
* generated using the new key. Otherwise, the cipher's data will be encrypted with the new
|
|
1333
|
+
* key directly.
|
|
1334
|
+
* @param {CipherView} cipher_view
|
|
1335
|
+
* @param {B64} new_key
|
|
1336
|
+
* @returns {EncryptionContext}
|
|
1337
|
+
*/
|
|
1338
|
+
encrypt_cipher_for_rotation(cipher_view, new_key) {
|
|
1339
|
+
try {
|
|
1340
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1341
|
+
wasm.ciphersclient_encrypt_cipher_for_rotation(
|
|
1342
|
+
retptr,
|
|
1343
|
+
this.__wbg_ptr,
|
|
1344
|
+
addHeapObject(cipher_view),
|
|
1345
|
+
addHeapObject(new_key),
|
|
1346
|
+
);
|
|
1347
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1348
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1349
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1350
|
+
if (r2) {
|
|
1351
|
+
throw takeObject(r1);
|
|
1352
|
+
}
|
|
1353
|
+
return takeObject(r0);
|
|
1354
|
+
} finally {
|
|
1355
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* @param {Cipher} cipher
|
|
1360
|
+
* @returns {CipherView}
|
|
1361
|
+
*/
|
|
1362
|
+
decrypt(cipher) {
|
|
1363
|
+
try {
|
|
1364
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1365
|
+
wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
|
|
1366
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1367
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1368
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1369
|
+
if (r2) {
|
|
1370
|
+
throw takeObject(r1);
|
|
1371
|
+
}
|
|
1372
|
+
return takeObject(r0);
|
|
1373
|
+
} finally {
|
|
1374
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* @param {Cipher[]} ciphers
|
|
1379
|
+
* @returns {CipherListView[]}
|
|
1380
|
+
*/
|
|
1381
|
+
decrypt_list(ciphers) {
|
|
1382
|
+
try {
|
|
1383
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1384
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1385
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1386
|
+
wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1387
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1388
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1389
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1390
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1391
|
+
if (r3) {
|
|
1392
|
+
throw takeObject(r2);
|
|
1393
|
+
}
|
|
1394
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1395
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1396
|
+
return v2;
|
|
1397
|
+
} finally {
|
|
1398
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Decrypt cipher list with failures
|
|
1403
|
+
* Returns both successfully decrypted ciphers and any that failed to decrypt
|
|
1404
|
+
* @param {Cipher[]} ciphers
|
|
1405
|
+
* @returns {DecryptCipherListResult}
|
|
1406
|
+
*/
|
|
1407
|
+
decrypt_list_with_failures(ciphers) {
|
|
1408
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1410
|
+
const ret = wasm.ciphersclient_decrypt_list_with_failures(this.__wbg_ptr, ptr0, len0);
|
|
1411
|
+
return takeObject(ret);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* @param {CipherView} cipher_view
|
|
1415
|
+
* @returns {Fido2CredentialView[]}
|
|
1416
|
+
*/
|
|
1417
|
+
decrypt_fido2_credentials(cipher_view) {
|
|
1418
|
+
try {
|
|
1419
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1420
|
+
wasm.ciphersclient_decrypt_fido2_credentials(
|
|
1421
|
+
retptr,
|
|
1422
|
+
this.__wbg_ptr,
|
|
1423
|
+
addHeapObject(cipher_view),
|
|
1424
|
+
);
|
|
1425
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1426
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1427
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1428
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1429
|
+
if (r3) {
|
|
1430
|
+
throw takeObject(r2);
|
|
1431
|
+
}
|
|
1432
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1433
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1434
|
+
return v1;
|
|
1435
|
+
} finally {
|
|
1436
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Temporary method used to re-encrypt FIDO2 credentials for a cipher view.
|
|
1441
|
+
* Necessary until the TS clients utilize the SDK entirely for FIDO2 credentials management.
|
|
1442
|
+
* TS clients create decrypted FIDO2 credentials that need to be encrypted manually when
|
|
1443
|
+
* encrypting the rest of the CipherView.
|
|
1444
|
+
* TODO: Remove once TS passkey provider implementation uses SDK - PM-8313
|
|
1445
|
+
* @param {CipherView} cipher_view
|
|
1446
|
+
* @param {Fido2CredentialFullView[]} fido2_credentials
|
|
1447
|
+
* @returns {CipherView}
|
|
1448
|
+
*/
|
|
1449
|
+
set_fido2_credentials(cipher_view, fido2_credentials) {
|
|
1450
|
+
try {
|
|
1451
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1452
|
+
const ptr0 = passArrayJsValueToWasm0(fido2_credentials, wasm.__wbindgen_malloc);
|
|
1453
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1454
|
+
wasm.ciphersclient_set_fido2_credentials(
|
|
1455
|
+
retptr,
|
|
1456
|
+
this.__wbg_ptr,
|
|
1457
|
+
addHeapObject(cipher_view),
|
|
1458
|
+
ptr0,
|
|
1459
|
+
len0,
|
|
1460
|
+
);
|
|
1461
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1462
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1463
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1464
|
+
if (r2) {
|
|
1465
|
+
throw takeObject(r1);
|
|
1466
|
+
}
|
|
1467
|
+
return takeObject(r0);
|
|
1468
|
+
} finally {
|
|
1469
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* @param {CipherView} cipher_view
|
|
1474
|
+
* @param {OrganizationId} organization_id
|
|
1475
|
+
* @returns {CipherView}
|
|
1476
|
+
*/
|
|
1477
|
+
move_to_organization(cipher_view, organization_id) {
|
|
1478
|
+
try {
|
|
1479
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1480
|
+
wasm.ciphersclient_move_to_organization(
|
|
1481
|
+
retptr,
|
|
1482
|
+
this.__wbg_ptr,
|
|
1483
|
+
addHeapObject(cipher_view),
|
|
1484
|
+
addHeapObject(organization_id),
|
|
1485
|
+
);
|
|
1486
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1487
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1488
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1489
|
+
if (r2) {
|
|
1490
|
+
throw takeObject(r1);
|
|
1491
|
+
}
|
|
1492
|
+
return takeObject(r0);
|
|
1493
|
+
} finally {
|
|
1494
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* @param {CipherView} cipher_view
|
|
1499
|
+
* @returns {string}
|
|
1500
|
+
*/
|
|
1501
|
+
decrypt_fido2_private_key(cipher_view) {
|
|
1502
|
+
let deferred2_0;
|
|
1503
|
+
let deferred2_1;
|
|
1504
|
+
try {
|
|
1505
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1506
|
+
wasm.ciphersclient_decrypt_fido2_private_key(
|
|
1507
|
+
retptr,
|
|
1508
|
+
this.__wbg_ptr,
|
|
1509
|
+
addHeapObject(cipher_view),
|
|
1510
|
+
);
|
|
1511
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1512
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1513
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1514
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1515
|
+
var ptr1 = r0;
|
|
1516
|
+
var len1 = r1;
|
|
1517
|
+
if (r3) {
|
|
1518
|
+
ptr1 = 0;
|
|
1519
|
+
len1 = 0;
|
|
1520
|
+
throw takeObject(r2);
|
|
1521
|
+
}
|
|
1522
|
+
deferred2_0 = ptr1;
|
|
1523
|
+
deferred2_1 = len1;
|
|
1524
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1525
|
+
} finally {
|
|
1526
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1527
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
module.exports.CiphersClient = CiphersClient;
|
|
1532
|
+
|
|
1533
|
+
const CollectionViewNodeItemFinalization =
|
|
1534
|
+
typeof FinalizationRegistry === "undefined"
|
|
1535
|
+
? { register: () => {}, unregister: () => {} }
|
|
1536
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_collectionviewnodeitem_free(ptr >>> 0, 1));
|
|
1537
|
+
|
|
1538
|
+
class CollectionViewNodeItem {
|
|
1539
|
+
static __wrap(ptr) {
|
|
1540
|
+
ptr = ptr >>> 0;
|
|
1541
|
+
const obj = Object.create(CollectionViewNodeItem.prototype);
|
|
1542
|
+
obj.__wbg_ptr = ptr;
|
|
1543
|
+
CollectionViewNodeItemFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1544
|
+
return obj;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
__destroy_into_raw() {
|
|
1548
|
+
const ptr = this.__wbg_ptr;
|
|
1549
|
+
this.__wbg_ptr = 0;
|
|
1550
|
+
CollectionViewNodeItemFinalization.unregister(this);
|
|
1551
|
+
return ptr;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
free() {
|
|
1555
|
+
const ptr = this.__destroy_into_raw();
|
|
1556
|
+
wasm.__wbg_collectionviewnodeitem_free(ptr, 0);
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* @returns {CollectionView}
|
|
1560
|
+
*/
|
|
1561
|
+
get_item() {
|
|
1562
|
+
const ret = wasm.collectionviewnodeitem_get_item(this.__wbg_ptr);
|
|
1563
|
+
return takeObject(ret);
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* @returns {CollectionView | undefined}
|
|
1567
|
+
*/
|
|
1568
|
+
get_parent() {
|
|
1569
|
+
const ret = wasm.collectionviewnodeitem_get_parent(this.__wbg_ptr);
|
|
1570
|
+
return takeObject(ret);
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* @returns {CollectionView[]}
|
|
1574
|
+
*/
|
|
1575
|
+
get_children() {
|
|
1576
|
+
try {
|
|
1577
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1578
|
+
wasm.collectionviewnodeitem_get_children(retptr, this.__wbg_ptr);
|
|
1579
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1580
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1581
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1582
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1583
|
+
return v1;
|
|
1584
|
+
} finally {
|
|
1585
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
/**
|
|
1589
|
+
* @returns {AncestorMap}
|
|
1590
|
+
*/
|
|
1591
|
+
get_ancestors() {
|
|
1592
|
+
const ret = wasm.collectionviewnodeitem_get_ancestors(this.__wbg_ptr);
|
|
1593
|
+
return takeObject(ret);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
module.exports.CollectionViewNodeItem = CollectionViewNodeItem;
|
|
1597
|
+
|
|
1598
|
+
const CollectionViewTreeFinalization =
|
|
1599
|
+
typeof FinalizationRegistry === "undefined"
|
|
1600
|
+
? { register: () => {}, unregister: () => {} }
|
|
1601
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_collectionviewtree_free(ptr >>> 0, 1));
|
|
1602
|
+
|
|
1603
|
+
class CollectionViewTree {
|
|
1604
|
+
static __wrap(ptr) {
|
|
1605
|
+
ptr = ptr >>> 0;
|
|
1606
|
+
const obj = Object.create(CollectionViewTree.prototype);
|
|
1607
|
+
obj.__wbg_ptr = ptr;
|
|
1608
|
+
CollectionViewTreeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1609
|
+
return obj;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
__destroy_into_raw() {
|
|
1613
|
+
const ptr = this.__wbg_ptr;
|
|
1614
|
+
this.__wbg_ptr = 0;
|
|
1615
|
+
CollectionViewTreeFinalization.unregister(this);
|
|
1616
|
+
return ptr;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
free() {
|
|
1620
|
+
const ptr = this.__destroy_into_raw();
|
|
1621
|
+
wasm.__wbg_collectionviewtree_free(ptr, 0);
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* @param {CollectionView} collection_view
|
|
1625
|
+
* @returns {CollectionViewNodeItem | undefined}
|
|
1626
|
+
*/
|
|
1627
|
+
get_item_for_view(collection_view) {
|
|
1628
|
+
const ret = wasm.collectionviewtree_get_item_for_view(
|
|
1629
|
+
this.__wbg_ptr,
|
|
1630
|
+
addHeapObject(collection_view),
|
|
1631
|
+
);
|
|
1632
|
+
return ret === 0 ? undefined : CollectionViewNodeItem.__wrap(ret);
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* @returns {CollectionViewNodeItem[]}
|
|
1636
|
+
*/
|
|
1637
|
+
get_root_items() {
|
|
1638
|
+
try {
|
|
1639
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1640
|
+
wasm.collectionviewtree_get_root_items(retptr, this.__wbg_ptr);
|
|
1641
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1642
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1643
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1644
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1645
|
+
return v1;
|
|
1646
|
+
} finally {
|
|
1647
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
/**
|
|
1651
|
+
* @returns {CollectionViewNodeItem[]}
|
|
1652
|
+
*/
|
|
1653
|
+
get_flat_items() {
|
|
1654
|
+
try {
|
|
1655
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1656
|
+
wasm.collectionviewtree_get_flat_items(retptr, this.__wbg_ptr);
|
|
1657
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1658
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1659
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1660
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1661
|
+
return v1;
|
|
1662
|
+
} finally {
|
|
1663
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
module.exports.CollectionViewTree = CollectionViewTree;
|
|
1668
|
+
|
|
1669
|
+
const CollectionsClientFinalization =
|
|
1670
|
+
typeof FinalizationRegistry === "undefined"
|
|
1671
|
+
? { register: () => {}, unregister: () => {} }
|
|
1672
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_collectionsclient_free(ptr >>> 0, 1));
|
|
1673
|
+
|
|
1674
|
+
class CollectionsClient {
|
|
1675
|
+
static __wrap(ptr) {
|
|
1676
|
+
ptr = ptr >>> 0;
|
|
1677
|
+
const obj = Object.create(CollectionsClient.prototype);
|
|
1678
|
+
obj.__wbg_ptr = ptr;
|
|
1679
|
+
CollectionsClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1680
|
+
return obj;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
__destroy_into_raw() {
|
|
1684
|
+
const ptr = this.__wbg_ptr;
|
|
1685
|
+
this.__wbg_ptr = 0;
|
|
1686
|
+
CollectionsClientFinalization.unregister(this);
|
|
1687
|
+
return ptr;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
free() {
|
|
1691
|
+
const ptr = this.__destroy_into_raw();
|
|
1692
|
+
wasm.__wbg_collectionsclient_free(ptr, 0);
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* @param {Collection} collection
|
|
1696
|
+
* @returns {CollectionView}
|
|
1697
|
+
*/
|
|
1698
|
+
decrypt(collection) {
|
|
1699
|
+
try {
|
|
1700
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1701
|
+
wasm.collectionsclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(collection));
|
|
1702
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1703
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1704
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1705
|
+
if (r2) {
|
|
1706
|
+
throw takeObject(r1);
|
|
1707
|
+
}
|
|
1708
|
+
return takeObject(r0);
|
|
1709
|
+
} finally {
|
|
1710
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* @param {Collection[]} collections
|
|
1715
|
+
* @returns {CollectionView[]}
|
|
1716
|
+
*/
|
|
1717
|
+
decrypt_list(collections) {
|
|
1718
|
+
try {
|
|
1719
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1720
|
+
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
1721
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1722
|
+
wasm.collectionsclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1723
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1724
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1725
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1726
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1727
|
+
if (r3) {
|
|
1728
|
+
throw takeObject(r2);
|
|
1729
|
+
}
|
|
1730
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1731
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1732
|
+
return v2;
|
|
1733
|
+
} finally {
|
|
1734
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
*
|
|
1739
|
+
* Returns the vector of CollectionView objects in a tree structure based on its implemented
|
|
1740
|
+
* path().
|
|
1741
|
+
* @param {CollectionView[]} collections
|
|
1742
|
+
* @returns {CollectionViewTree}
|
|
1743
|
+
*/
|
|
1744
|
+
get_collection_tree(collections) {
|
|
1745
|
+
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
1746
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1747
|
+
const ret = wasm.collectionsclient_get_collection_tree(this.__wbg_ptr, ptr0, len0);
|
|
1748
|
+
return CollectionViewTree.__wrap(ret);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
module.exports.CollectionsClient = CollectionsClient;
|
|
1752
|
+
|
|
1753
|
+
const CryptoClientFinalization =
|
|
1754
|
+
typeof FinalizationRegistry === "undefined"
|
|
1755
|
+
? { register: () => {}, unregister: () => {} }
|
|
1756
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
|
|
1757
|
+
/**
|
|
1758
|
+
* A client for the crypto operations.
|
|
1759
|
+
*/
|
|
1760
|
+
class CryptoClient {
|
|
1761
|
+
static __wrap(ptr) {
|
|
1762
|
+
ptr = ptr >>> 0;
|
|
1763
|
+
const obj = Object.create(CryptoClient.prototype);
|
|
1764
|
+
obj.__wbg_ptr = ptr;
|
|
1765
|
+
CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1766
|
+
return obj;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
__destroy_into_raw() {
|
|
1770
|
+
const ptr = this.__wbg_ptr;
|
|
1771
|
+
this.__wbg_ptr = 0;
|
|
1772
|
+
CryptoClientFinalization.unregister(this);
|
|
1773
|
+
return ptr;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
free() {
|
|
1777
|
+
const ptr = this.__destroy_into_raw();
|
|
1778
|
+
wasm.__wbg_cryptoclient_free(ptr, 0);
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Initialization method for the user crypto. Needs to be called before any other crypto
|
|
1782
|
+
* operations.
|
|
1783
|
+
* @param {InitUserCryptoRequest} req
|
|
1784
|
+
* @returns {Promise<void>}
|
|
1785
|
+
*/
|
|
1786
|
+
initialize_user_crypto(req) {
|
|
1787
|
+
const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
|
|
1788
|
+
return takeObject(ret);
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Initialization method for the organization crypto. Needs to be called after
|
|
1792
|
+
* `initialize_user_crypto` but before any other crypto operations.
|
|
1793
|
+
* @param {InitOrgCryptoRequest} req
|
|
1794
|
+
* @returns {Promise<void>}
|
|
1795
|
+
*/
|
|
1796
|
+
initialize_org_crypto(req) {
|
|
1797
|
+
const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
|
|
1798
|
+
return takeObject(ret);
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Generates a new key pair and encrypts the private key with the provided user key.
|
|
1802
|
+
* Crypto initialization not required.
|
|
1803
|
+
* @param {B64} user_key
|
|
1804
|
+
* @returns {MakeKeyPairResponse}
|
|
1805
|
+
*/
|
|
1806
|
+
make_key_pair(user_key) {
|
|
1807
|
+
try {
|
|
1808
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1809
|
+
wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, addHeapObject(user_key));
|
|
1810
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1811
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1812
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1813
|
+
if (r2) {
|
|
1814
|
+
throw takeObject(r1);
|
|
1815
|
+
}
|
|
1816
|
+
return takeObject(r0);
|
|
1817
|
+
} finally {
|
|
1818
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Verifies a user's asymmetric keys by decrypting the private key with the provided user
|
|
1823
|
+
* key. Returns if the private key is decryptable and if it is a valid matching key.
|
|
1824
|
+
* Crypto initialization not required.
|
|
1825
|
+
* @param {VerifyAsymmetricKeysRequest} request
|
|
1826
|
+
* @returns {VerifyAsymmetricKeysResponse}
|
|
1827
|
+
*/
|
|
1828
|
+
verify_asymmetric_keys(request) {
|
|
1829
|
+
try {
|
|
1830
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1831
|
+
wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
|
|
1832
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1833
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1834
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1835
|
+
if (r2) {
|
|
1836
|
+
throw takeObject(r1);
|
|
1837
|
+
}
|
|
1838
|
+
return takeObject(r0);
|
|
1839
|
+
} finally {
|
|
1840
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Makes a new signing key pair and signs the public key for the user
|
|
1845
|
+
* @returns {UserCryptoV2KeysResponse}
|
|
1846
|
+
*/
|
|
1847
|
+
make_keys_for_user_crypto_v2() {
|
|
1848
|
+
try {
|
|
1849
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1850
|
+
wasm.cryptoclient_make_keys_for_user_crypto_v2(retptr, this.__wbg_ptr);
|
|
1851
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1852
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1853
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1854
|
+
if (r2) {
|
|
1855
|
+
throw takeObject(r1);
|
|
1856
|
+
}
|
|
1857
|
+
return takeObject(r0);
|
|
1858
|
+
} finally {
|
|
1859
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Creates a rotated set of account keys for the current state
|
|
1864
|
+
* @returns {UserCryptoV2KeysResponse}
|
|
1865
|
+
*/
|
|
1866
|
+
get_v2_rotated_account_keys() {
|
|
1867
|
+
try {
|
|
1868
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1869
|
+
wasm.cryptoclient_get_v2_rotated_account_keys(retptr, this.__wbg_ptr);
|
|
1870
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1871
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1872
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1873
|
+
if (r2) {
|
|
1874
|
+
throw takeObject(r1);
|
|
1875
|
+
}
|
|
1876
|
+
return takeObject(r0);
|
|
1877
|
+
} finally {
|
|
1878
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Create the data necessary to update the user's kdf settings. The user's encryption key is
|
|
1883
|
+
* re-encrypted for the password under the new kdf settings. This returns the re-encrypted
|
|
1884
|
+
* user key and the new password hash but does not update sdk state.
|
|
1885
|
+
* @param {string} password
|
|
1886
|
+
* @param {Kdf} kdf
|
|
1887
|
+
* @returns {UpdateKdfResponse}
|
|
1888
|
+
*/
|
|
1889
|
+
make_update_kdf(password, kdf) {
|
|
1890
|
+
try {
|
|
1891
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1892
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1893
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1894
|
+
wasm.cryptoclient_make_update_kdf(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(kdf));
|
|
1895
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1896
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1897
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1898
|
+
if (r2) {
|
|
1899
|
+
throw takeObject(r1);
|
|
1900
|
+
}
|
|
1901
|
+
return takeObject(r0);
|
|
1902
|
+
} finally {
|
|
1903
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* Protects the current user key with the provided PIN. The result can be stored and later
|
|
1908
|
+
* used to initialize another client instance by using the PIN and the PIN key with
|
|
1909
|
+
* `initialize_user_crypto`.
|
|
1910
|
+
* @param {string} pin
|
|
1911
|
+
* @returns {EnrollPinResponse}
|
|
1912
|
+
*/
|
|
1913
|
+
enroll_pin(pin) {
|
|
1914
|
+
try {
|
|
1915
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1916
|
+
const ptr0 = passStringToWasm0(pin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1917
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1918
|
+
wasm.cryptoclient_enroll_pin(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1919
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1920
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1921
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1922
|
+
if (r2) {
|
|
1923
|
+
throw takeObject(r1);
|
|
1924
|
+
}
|
|
1925
|
+
return takeObject(r0);
|
|
1926
|
+
} finally {
|
|
1927
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Protects the current user key with the provided PIN. The result can be stored and later
|
|
1932
|
+
* used to initialize another client instance by using the PIN and the PIN key with
|
|
1933
|
+
* `initialize_user_crypto`. The provided pin is encrypted with the user key.
|
|
1934
|
+
* @param {string} encrypted_pin
|
|
1935
|
+
* @returns {EnrollPinResponse}
|
|
1936
|
+
*/
|
|
1937
|
+
enroll_pin_with_encrypted_pin(encrypted_pin) {
|
|
1938
|
+
try {
|
|
1939
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1940
|
+
const ptr0 = passStringToWasm0(
|
|
1941
|
+
encrypted_pin,
|
|
1942
|
+
wasm.__wbindgen_malloc,
|
|
1943
|
+
wasm.__wbindgen_realloc,
|
|
1944
|
+
);
|
|
1945
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1946
|
+
wasm.cryptoclient_enroll_pin_with_encrypted_pin(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1947
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1948
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1949
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1950
|
+
if (r2) {
|
|
1951
|
+
throw takeObject(r1);
|
|
1952
|
+
}
|
|
1953
|
+
return takeObject(r0);
|
|
1954
|
+
} finally {
|
|
1955
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1959
|
+
* Decrypts a `PasswordProtectedKeyEnvelope`, returning the user key, if successful.
|
|
1960
|
+
* This is a stop-gap solution, until initialization of the SDK is used.
|
|
1961
|
+
* @param {string} pin
|
|
1962
|
+
* @param {PasswordProtectedKeyEnvelope} envelope
|
|
1963
|
+
* @returns {Uint8Array}
|
|
1964
|
+
*/
|
|
1965
|
+
unseal_password_protected_key_envelope(pin, envelope) {
|
|
1966
|
+
try {
|
|
1967
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1968
|
+
const ptr0 = passStringToWasm0(pin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1969
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1970
|
+
wasm.cryptoclient_unseal_password_protected_key_envelope(
|
|
1971
|
+
retptr,
|
|
1972
|
+
this.__wbg_ptr,
|
|
1973
|
+
ptr0,
|
|
1974
|
+
len0,
|
|
1975
|
+
addHeapObject(envelope),
|
|
1976
|
+
);
|
|
1977
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1978
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1979
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1980
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1981
|
+
if (r3) {
|
|
1982
|
+
throw takeObject(r2);
|
|
1983
|
+
}
|
|
1984
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1985
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1986
|
+
return v2;
|
|
1987
|
+
} finally {
|
|
1988
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
module.exports.CryptoClient = CryptoClient;
|
|
1993
|
+
|
|
1994
|
+
const ExporterClientFinalization =
|
|
1995
|
+
typeof FinalizationRegistry === "undefined"
|
|
1996
|
+
? { register: () => {}, unregister: () => {} }
|
|
1997
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
|
|
1998
|
+
|
|
1999
|
+
class ExporterClient {
|
|
2000
|
+
static __wrap(ptr) {
|
|
2001
|
+
ptr = ptr >>> 0;
|
|
2002
|
+
const obj = Object.create(ExporterClient.prototype);
|
|
2003
|
+
obj.__wbg_ptr = ptr;
|
|
2004
|
+
ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2005
|
+
return obj;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
__destroy_into_raw() {
|
|
2009
|
+
const ptr = this.__wbg_ptr;
|
|
2010
|
+
this.__wbg_ptr = 0;
|
|
2011
|
+
ExporterClientFinalization.unregister(this);
|
|
2012
|
+
return ptr;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
free() {
|
|
2016
|
+
const ptr = this.__destroy_into_raw();
|
|
2017
|
+
wasm.__wbg_exporterclient_free(ptr, 0);
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* @param {Folder[]} folders
|
|
2021
|
+
* @param {Cipher[]} ciphers
|
|
2022
|
+
* @param {ExportFormat} format
|
|
2023
|
+
* @returns {string}
|
|
2024
|
+
*/
|
|
2025
|
+
export_vault(folders, ciphers, format) {
|
|
2026
|
+
let deferred4_0;
|
|
2027
|
+
let deferred4_1;
|
|
2028
|
+
try {
|
|
2029
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2030
|
+
const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
|
|
2031
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2032
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
2033
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2034
|
+
wasm.exporterclient_export_vault(
|
|
2035
|
+
retptr,
|
|
2036
|
+
this.__wbg_ptr,
|
|
2037
|
+
ptr0,
|
|
2038
|
+
len0,
|
|
2039
|
+
ptr1,
|
|
2040
|
+
len1,
|
|
2041
|
+
addHeapObject(format),
|
|
2042
|
+
);
|
|
2043
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2044
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2045
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2046
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2047
|
+
var ptr3 = r0;
|
|
2048
|
+
var len3 = r1;
|
|
2049
|
+
if (r3) {
|
|
2050
|
+
ptr3 = 0;
|
|
2051
|
+
len3 = 0;
|
|
2052
|
+
throw takeObject(r2);
|
|
2053
|
+
}
|
|
2054
|
+
deferred4_0 = ptr3;
|
|
2055
|
+
deferred4_1 = len3;
|
|
2056
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2057
|
+
} finally {
|
|
2058
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2059
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* @param {Collection[]} collections
|
|
2064
|
+
* @param {Cipher[]} ciphers
|
|
2065
|
+
* @param {ExportFormat} format
|
|
2066
|
+
* @returns {string}
|
|
2067
|
+
*/
|
|
2068
|
+
export_organization_vault(collections, ciphers, format) {
|
|
2069
|
+
let deferred4_0;
|
|
2070
|
+
let deferred4_1;
|
|
2071
|
+
try {
|
|
2072
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2073
|
+
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
2074
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2075
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
2076
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2077
|
+
wasm.exporterclient_export_organization_vault(
|
|
2078
|
+
retptr,
|
|
2079
|
+
this.__wbg_ptr,
|
|
2080
|
+
ptr0,
|
|
2081
|
+
len0,
|
|
2082
|
+
ptr1,
|
|
2083
|
+
len1,
|
|
2084
|
+
addHeapObject(format),
|
|
2085
|
+
);
|
|
2086
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2087
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2088
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2089
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2090
|
+
var ptr3 = r0;
|
|
2091
|
+
var len3 = r1;
|
|
2092
|
+
if (r3) {
|
|
2093
|
+
ptr3 = 0;
|
|
2094
|
+
len3 = 0;
|
|
2095
|
+
throw takeObject(r2);
|
|
2096
|
+
}
|
|
2097
|
+
deferred4_0 = ptr3;
|
|
2098
|
+
deferred4_1 = len3;
|
|
2099
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2100
|
+
} finally {
|
|
2101
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2102
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
/**
|
|
2106
|
+
* Credential Exchange Format (CXF)
|
|
2107
|
+
*
|
|
2108
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
2109
|
+
*
|
|
2110
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
2111
|
+
* Ideally, the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
2112
|
+
* @param {Account} account
|
|
2113
|
+
* @param {Cipher[]} ciphers
|
|
2114
|
+
* @returns {string}
|
|
2115
|
+
*/
|
|
2116
|
+
export_cxf(account, ciphers) {
|
|
2117
|
+
let deferred3_0;
|
|
2118
|
+
let deferred3_1;
|
|
2119
|
+
try {
|
|
2120
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2121
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
2122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2123
|
+
wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
|
|
2124
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2125
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2126
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2127
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2128
|
+
var ptr2 = r0;
|
|
2129
|
+
var len2 = r1;
|
|
2130
|
+
if (r3) {
|
|
2131
|
+
ptr2 = 0;
|
|
2132
|
+
len2 = 0;
|
|
2133
|
+
throw takeObject(r2);
|
|
2134
|
+
}
|
|
2135
|
+
deferred3_0 = ptr2;
|
|
2136
|
+
deferred3_1 = len2;
|
|
2137
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2138
|
+
} finally {
|
|
2139
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2140
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Credential Exchange Format (CXF)
|
|
2145
|
+
*
|
|
2146
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
2147
|
+
*
|
|
2148
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
2149
|
+
* Ideally, the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
2150
|
+
* @param {string} payload
|
|
2151
|
+
* @returns {Cipher[]}
|
|
2152
|
+
*/
|
|
2153
|
+
import_cxf(payload) {
|
|
2154
|
+
try {
|
|
2155
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2156
|
+
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2157
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2158
|
+
wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2159
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2160
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2161
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2162
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2163
|
+
if (r3) {
|
|
2164
|
+
throw takeObject(r2);
|
|
2165
|
+
}
|
|
2166
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2167
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
2168
|
+
return v2;
|
|
2169
|
+
} finally {
|
|
2170
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
module.exports.ExporterClient = ExporterClient;
|
|
2175
|
+
|
|
2176
|
+
const FoldersClientFinalization =
|
|
2177
|
+
typeof FinalizationRegistry === "undefined"
|
|
2178
|
+
? { register: () => {}, unregister: () => {} }
|
|
2179
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
|
|
2180
|
+
/**
|
|
2181
|
+
* Wrapper for folder specific functionality.
|
|
2182
|
+
*/
|
|
2183
|
+
class FoldersClient {
|
|
2184
|
+
static __wrap(ptr) {
|
|
2185
|
+
ptr = ptr >>> 0;
|
|
2186
|
+
const obj = Object.create(FoldersClient.prototype);
|
|
2187
|
+
obj.__wbg_ptr = ptr;
|
|
2188
|
+
FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2189
|
+
return obj;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
__destroy_into_raw() {
|
|
2193
|
+
const ptr = this.__wbg_ptr;
|
|
2194
|
+
this.__wbg_ptr = 0;
|
|
2195
|
+
FoldersClientFinalization.unregister(this);
|
|
2196
|
+
return ptr;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
free() {
|
|
2200
|
+
const ptr = this.__destroy_into_raw();
|
|
2201
|
+
wasm.__wbg_foldersclient_free(ptr, 0);
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Encrypt a [FolderView] to a [Folder].
|
|
2205
|
+
* @param {FolderView} folder_view
|
|
2206
|
+
* @returns {Folder}
|
|
2207
|
+
*/
|
|
2208
|
+
encrypt(folder_view) {
|
|
2209
|
+
try {
|
|
2210
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2211
|
+
wasm.foldersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(folder_view));
|
|
2212
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2213
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2214
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2215
|
+
if (r2) {
|
|
2216
|
+
throw takeObject(r1);
|
|
2217
|
+
}
|
|
2218
|
+
return takeObject(r0);
|
|
2219
|
+
} finally {
|
|
2220
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Encrypt a [Folder] to [FolderView].
|
|
2225
|
+
* @param {Folder} folder
|
|
2226
|
+
* @returns {FolderView}
|
|
2227
|
+
*/
|
|
2228
|
+
decrypt(folder) {
|
|
2229
|
+
try {
|
|
2230
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2231
|
+
wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
|
2232
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2233
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2234
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2235
|
+
if (r2) {
|
|
2236
|
+
throw takeObject(r1);
|
|
2237
|
+
}
|
|
2238
|
+
return takeObject(r0);
|
|
2239
|
+
} finally {
|
|
2240
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
/**
|
|
2244
|
+
* Decrypt a list of [Folder]s to a list of [FolderView]s.
|
|
2245
|
+
* @param {Folder[]} folders
|
|
2246
|
+
* @returns {FolderView[]}
|
|
2247
|
+
*/
|
|
2248
|
+
decrypt_list(folders) {
|
|
2249
|
+
try {
|
|
2250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2251
|
+
const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
|
|
2252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2253
|
+
wasm.foldersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2254
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2255
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2256
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2257
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2258
|
+
if (r3) {
|
|
2259
|
+
throw takeObject(r2);
|
|
2260
|
+
}
|
|
2261
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
2262
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
2263
|
+
return v2;
|
|
2264
|
+
} finally {
|
|
2265
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Get all folders from state and decrypt them to a list of [FolderView].
|
|
2270
|
+
* @returns {Promise<FolderView[]>}
|
|
2271
|
+
*/
|
|
2272
|
+
list() {
|
|
2273
|
+
const ret = wasm.foldersclient_list(this.__wbg_ptr);
|
|
2274
|
+
return takeObject(ret);
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* Get a specific [Folder] by its ID from state and decrypt it to a [FolderView].
|
|
2278
|
+
* @param {FolderId} folder_id
|
|
2279
|
+
* @returns {Promise<FolderView>}
|
|
2280
|
+
*/
|
|
2281
|
+
get(folder_id) {
|
|
2282
|
+
const ret = wasm.foldersclient_get(this.__wbg_ptr, addHeapObject(folder_id));
|
|
2283
|
+
return takeObject(ret);
|
|
2284
|
+
}
|
|
2285
|
+
/**
|
|
2286
|
+
* Create a new [Folder] and save it to the server.
|
|
2287
|
+
* @param {FolderAddEditRequest} request
|
|
2288
|
+
* @returns {Promise<FolderView>}
|
|
2289
|
+
*/
|
|
2290
|
+
create(request) {
|
|
2291
|
+
const ret = wasm.foldersclient_create(this.__wbg_ptr, addHeapObject(request));
|
|
2292
|
+
return takeObject(ret);
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2295
|
+
* Edit the [Folder] and save it to the server.
|
|
2296
|
+
* @param {FolderId} folder_id
|
|
2297
|
+
* @param {FolderAddEditRequest} request
|
|
2298
|
+
* @returns {Promise<FolderView>}
|
|
2299
|
+
*/
|
|
2300
|
+
edit(folder_id, request) {
|
|
2301
|
+
const ret = wasm.foldersclient_edit(
|
|
2302
|
+
this.__wbg_ptr,
|
|
2303
|
+
addHeapObject(folder_id),
|
|
2304
|
+
addHeapObject(request),
|
|
2305
|
+
);
|
|
2306
|
+
return takeObject(ret);
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
module.exports.FoldersClient = FoldersClient;
|
|
2310
|
+
|
|
2311
|
+
const GeneratorClientFinalization =
|
|
2312
|
+
typeof FinalizationRegistry === "undefined"
|
|
2313
|
+
? { register: () => {}, unregister: () => {} }
|
|
2314
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
|
|
2315
|
+
|
|
2316
|
+
class GeneratorClient {
|
|
2317
|
+
static __wrap(ptr) {
|
|
2318
|
+
ptr = ptr >>> 0;
|
|
2319
|
+
const obj = Object.create(GeneratorClient.prototype);
|
|
2320
|
+
obj.__wbg_ptr = ptr;
|
|
2321
|
+
GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2322
|
+
return obj;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
__destroy_into_raw() {
|
|
2326
|
+
const ptr = this.__wbg_ptr;
|
|
2327
|
+
this.__wbg_ptr = 0;
|
|
2328
|
+
GeneratorClientFinalization.unregister(this);
|
|
2329
|
+
return ptr;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
free() {
|
|
2333
|
+
const ptr = this.__destroy_into_raw();
|
|
2334
|
+
wasm.__wbg_generatorclient_free(ptr, 0);
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* Generates a random password.
|
|
2338
|
+
*
|
|
2339
|
+
* The character sets and password length can be customized using the `input` parameter.
|
|
2340
|
+
*
|
|
2341
|
+
* # Examples
|
|
2342
|
+
*
|
|
2343
|
+
* ```
|
|
2344
|
+
* use bitwarden_core::Client;
|
|
2345
|
+
* use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PasswordGeneratorRequest};
|
|
2346
|
+
*
|
|
2347
|
+
* async fn test() -> Result<(), PassphraseError> {
|
|
2348
|
+
* let input = PasswordGeneratorRequest {
|
|
2349
|
+
* lowercase: true,
|
|
2350
|
+
* uppercase: true,
|
|
2351
|
+
* numbers: true,
|
|
2352
|
+
* length: 20,
|
|
2353
|
+
* ..Default::default()
|
|
2354
|
+
* };
|
|
2355
|
+
* let password = Client::new(None).generator().password(input).unwrap();
|
|
2356
|
+
* println!("{}", password);
|
|
2357
|
+
* Ok(())
|
|
2358
|
+
* }
|
|
2359
|
+
* ```
|
|
2360
|
+
* @param {PasswordGeneratorRequest} input
|
|
2361
|
+
* @returns {string}
|
|
2362
|
+
*/
|
|
2363
|
+
password(input) {
|
|
2364
|
+
let deferred2_0;
|
|
2365
|
+
let deferred2_1;
|
|
2366
|
+
try {
|
|
2367
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2368
|
+
wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(input));
|
|
2369
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2370
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2371
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2372
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2373
|
+
var ptr1 = r0;
|
|
2374
|
+
var len1 = r1;
|
|
2375
|
+
if (r3) {
|
|
2376
|
+
ptr1 = 0;
|
|
2377
|
+
len1 = 0;
|
|
2378
|
+
throw takeObject(r2);
|
|
2379
|
+
}
|
|
2380
|
+
deferred2_0 = ptr1;
|
|
2381
|
+
deferred2_1 = len1;
|
|
2382
|
+
return getStringFromWasm0(ptr1, len1);
|
|
2383
|
+
} finally {
|
|
2384
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2385
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Generates a random passphrase.
|
|
2390
|
+
* A passphrase is a combination of random words separated by a character.
|
|
2391
|
+
* An example of passphrase is `correct horse battery staple`.
|
|
2392
|
+
*
|
|
2393
|
+
* The number of words and their case, the word separator, and the inclusion of
|
|
2394
|
+
* a number in the passphrase can be customized using the `input` parameter.
|
|
2395
|
+
*
|
|
2396
|
+
* # Examples
|
|
2397
|
+
*
|
|
2398
|
+
* ```
|
|
2399
|
+
* use bitwarden_core::Client;
|
|
2400
|
+
* use bitwarden_generators::{GeneratorClientsExt, PassphraseError, PassphraseGeneratorRequest};
|
|
2401
|
+
*
|
|
2402
|
+
* async fn test() -> Result<(), PassphraseError> {
|
|
2403
|
+
* let input = PassphraseGeneratorRequest {
|
|
2404
|
+
* num_words: 4,
|
|
2405
|
+
* ..Default::default()
|
|
2406
|
+
* };
|
|
2407
|
+
* let passphrase = Client::new(None).generator().passphrase(input).unwrap();
|
|
2408
|
+
* println!("{}", passphrase);
|
|
2409
|
+
* Ok(())
|
|
2410
|
+
* }
|
|
2411
|
+
* ```
|
|
2412
|
+
* @param {PassphraseGeneratorRequest} input
|
|
2413
|
+
* @returns {string}
|
|
2414
|
+
*/
|
|
2415
|
+
passphrase(input) {
|
|
2416
|
+
let deferred2_0;
|
|
2417
|
+
let deferred2_1;
|
|
2418
|
+
try {
|
|
2419
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2420
|
+
wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(input));
|
|
2421
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2422
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2423
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2424
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2425
|
+
var ptr1 = r0;
|
|
2426
|
+
var len1 = r1;
|
|
2427
|
+
if (r3) {
|
|
2428
|
+
ptr1 = 0;
|
|
2429
|
+
len1 = 0;
|
|
2430
|
+
throw takeObject(r2);
|
|
2431
|
+
}
|
|
2432
|
+
deferred2_0 = ptr1;
|
|
2433
|
+
deferred2_1 = len1;
|
|
2434
|
+
return getStringFromWasm0(ptr1, len1);
|
|
2435
|
+
} finally {
|
|
2436
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2437
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
module.exports.GeneratorClient = GeneratorClient;
|
|
2442
|
+
|
|
2443
|
+
const IncomingMessageFinalization =
|
|
2444
|
+
typeof FinalizationRegistry === "undefined"
|
|
2445
|
+
? { register: () => {}, unregister: () => {} }
|
|
2446
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
|
|
2447
|
+
|
|
2448
|
+
class IncomingMessage {
|
|
2449
|
+
static __wrap(ptr) {
|
|
2450
|
+
ptr = ptr >>> 0;
|
|
2451
|
+
const obj = Object.create(IncomingMessage.prototype);
|
|
2452
|
+
obj.__wbg_ptr = ptr;
|
|
2453
|
+
IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2454
|
+
return obj;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
__destroy_into_raw() {
|
|
2458
|
+
const ptr = this.__wbg_ptr;
|
|
2459
|
+
this.__wbg_ptr = 0;
|
|
2460
|
+
IncomingMessageFinalization.unregister(this);
|
|
2461
|
+
return ptr;
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
free() {
|
|
2465
|
+
const ptr = this.__destroy_into_raw();
|
|
2466
|
+
wasm.__wbg_incomingmessage_free(ptr, 0);
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* @returns {Uint8Array}
|
|
2470
|
+
*/
|
|
2471
|
+
get payload() {
|
|
2472
|
+
try {
|
|
2473
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2474
|
+
wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
|
|
2475
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2476
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2477
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2478
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
2479
|
+
return v1;
|
|
2480
|
+
} finally {
|
|
2481
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* @param {Uint8Array} arg0
|
|
2486
|
+
*/
|
|
2487
|
+
set payload(arg0) {
|
|
2488
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
2489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2490
|
+
wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* @returns {Endpoint}
|
|
2494
|
+
*/
|
|
2495
|
+
get destination() {
|
|
2496
|
+
const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
|
|
2497
|
+
return takeObject(ret);
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* @param {Endpoint} arg0
|
|
2501
|
+
*/
|
|
2502
|
+
set destination(arg0) {
|
|
2503
|
+
wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* @returns {Endpoint}
|
|
2507
|
+
*/
|
|
2508
|
+
get source() {
|
|
2509
|
+
const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
|
|
2510
|
+
return takeObject(ret);
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* @param {Endpoint} arg0
|
|
2514
|
+
*/
|
|
2515
|
+
set source(arg0) {
|
|
2516
|
+
wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
|
|
2517
|
+
}
|
|
2518
|
+
/**
|
|
2519
|
+
* @returns {string | undefined}
|
|
2520
|
+
*/
|
|
2521
|
+
get topic() {
|
|
2522
|
+
try {
|
|
2523
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2524
|
+
wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
|
|
2525
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2526
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2527
|
+
let v1;
|
|
2528
|
+
if (r0 !== 0) {
|
|
2529
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2530
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
2531
|
+
}
|
|
2532
|
+
return v1;
|
|
2533
|
+
} finally {
|
|
2534
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
/**
|
|
2538
|
+
* @param {string | null} [arg0]
|
|
2539
|
+
*/
|
|
2540
|
+
set topic(arg0) {
|
|
2541
|
+
var ptr0 = isLikeNone(arg0)
|
|
2542
|
+
? 0
|
|
2543
|
+
: passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2544
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2545
|
+
wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* @param {Uint8Array} payload
|
|
2549
|
+
* @param {Endpoint} destination
|
|
2550
|
+
* @param {Endpoint} source
|
|
2551
|
+
* @param {string | null} [topic]
|
|
2552
|
+
*/
|
|
2553
|
+
constructor(payload, destination, source, topic) {
|
|
2554
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
|
|
2555
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2556
|
+
var ptr1 = isLikeNone(topic)
|
|
2557
|
+
? 0
|
|
2558
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2559
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2560
|
+
const ret = wasm.incomingmessage_new(
|
|
2561
|
+
ptr0,
|
|
2562
|
+
len0,
|
|
2563
|
+
addHeapObject(destination),
|
|
2564
|
+
addHeapObject(source),
|
|
2565
|
+
ptr1,
|
|
2566
|
+
len1,
|
|
2567
|
+
);
|
|
2568
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2569
|
+
IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
|
|
2570
|
+
return this;
|
|
2571
|
+
}
|
|
2572
|
+
/**
|
|
2573
|
+
* Try to parse the payload as JSON.
|
|
2574
|
+
* @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
|
|
2575
|
+
*/
|
|
2576
|
+
parse_payload_as_json() {
|
|
2577
|
+
const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
|
|
2578
|
+
return takeObject(ret);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
module.exports.IncomingMessage = IncomingMessage;
|
|
2582
|
+
|
|
2583
|
+
const IpcClientFinalization =
|
|
2584
|
+
typeof FinalizationRegistry === "undefined"
|
|
2585
|
+
? { register: () => {}, unregister: () => {} }
|
|
2586
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
|
|
2587
|
+
/**
|
|
2588
|
+
* JavaScript wrapper around the IPC client. For more information, see the
|
|
2589
|
+
* [IpcClient] documentation.
|
|
2590
|
+
*/
|
|
2591
|
+
class IpcClient {
|
|
2592
|
+
__destroy_into_raw() {
|
|
2593
|
+
const ptr = this.__wbg_ptr;
|
|
2594
|
+
this.__wbg_ptr = 0;
|
|
2595
|
+
IpcClientFinalization.unregister(this);
|
|
2596
|
+
return ptr;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
free() {
|
|
2600
|
+
const ptr = this.__destroy_into_raw();
|
|
2601
|
+
wasm.__wbg_ipcclient_free(ptr, 0);
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* @param {IpcCommunicationBackend} communication_provider
|
|
2605
|
+
*/
|
|
2606
|
+
constructor(communication_provider) {
|
|
2607
|
+
_assertClass(communication_provider, IpcCommunicationBackend);
|
|
2608
|
+
const ret = wasm.ipcclient_new(communication_provider.__wbg_ptr);
|
|
2609
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2610
|
+
IpcClientFinalization.register(this, this.__wbg_ptr, this);
|
|
2611
|
+
return this;
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* @returns {Promise<void>}
|
|
2615
|
+
*/
|
|
2616
|
+
start() {
|
|
2617
|
+
const ret = wasm.ipcclient_start(this.__wbg_ptr);
|
|
2618
|
+
return takeObject(ret);
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* @returns {Promise<boolean>}
|
|
2622
|
+
*/
|
|
2623
|
+
isRunning() {
|
|
2624
|
+
const ret = wasm.ipcclient_isRunning(this.__wbg_ptr);
|
|
2625
|
+
return takeObject(ret);
|
|
2626
|
+
}
|
|
2627
|
+
/**
|
|
2628
|
+
* @param {OutgoingMessage} message
|
|
2629
|
+
* @returns {Promise<void>}
|
|
2630
|
+
*/
|
|
2631
|
+
send(message) {
|
|
2632
|
+
_assertClass(message, OutgoingMessage);
|
|
2633
|
+
var ptr0 = message.__destroy_into_raw();
|
|
2634
|
+
const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
|
|
2635
|
+
return takeObject(ret);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* @returns {Promise<IpcClientSubscription>}
|
|
2639
|
+
*/
|
|
2640
|
+
subscribe() {
|
|
2641
|
+
const ret = wasm.ipcclient_subscribe(this.__wbg_ptr);
|
|
2642
|
+
return takeObject(ret);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
module.exports.IpcClient = IpcClient;
|
|
2646
|
+
|
|
2647
|
+
const IpcClientSubscriptionFinalization =
|
|
2648
|
+
typeof FinalizationRegistry === "undefined"
|
|
2649
|
+
? { register: () => {}, unregister: () => {} }
|
|
2650
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ipcclientsubscription_free(ptr >>> 0, 1));
|
|
2651
|
+
/**
|
|
2652
|
+
* JavaScript wrapper around the IPC client subscription. For more information, see the
|
|
2653
|
+
* [IpcClientSubscription](crate::IpcClientSubscription) documentation.
|
|
2654
|
+
*/
|
|
2655
|
+
class IpcClientSubscription {
|
|
2656
|
+
static __wrap(ptr) {
|
|
2657
|
+
ptr = ptr >>> 0;
|
|
2658
|
+
const obj = Object.create(IpcClientSubscription.prototype);
|
|
2659
|
+
obj.__wbg_ptr = ptr;
|
|
2660
|
+
IpcClientSubscriptionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2661
|
+
return obj;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
2664
|
+
__destroy_into_raw() {
|
|
2665
|
+
const ptr = this.__wbg_ptr;
|
|
2666
|
+
this.__wbg_ptr = 0;
|
|
2667
|
+
IpcClientSubscriptionFinalization.unregister(this);
|
|
2668
|
+
return ptr;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
free() {
|
|
2672
|
+
const ptr = this.__destroy_into_raw();
|
|
2673
|
+
wasm.__wbg_ipcclientsubscription_free(ptr, 0);
|
|
2674
|
+
}
|
|
2675
|
+
/**
|
|
2676
|
+
* @param {AbortSignal | null} [abort_signal]
|
|
2677
|
+
* @returns {Promise<IncomingMessage>}
|
|
2678
|
+
*/
|
|
2679
|
+
receive(abort_signal) {
|
|
2680
|
+
const ret = wasm.ipcclientsubscription_receive(
|
|
2681
|
+
this.__wbg_ptr,
|
|
2682
|
+
isLikeNone(abort_signal) ? 0 : addHeapObject(abort_signal),
|
|
2683
|
+
);
|
|
2684
|
+
return takeObject(ret);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
module.exports.IpcClientSubscription = IpcClientSubscription;
|
|
2688
|
+
|
|
2689
|
+
const IpcCommunicationBackendFinalization =
|
|
2690
|
+
typeof FinalizationRegistry === "undefined"
|
|
2691
|
+
? { register: () => {}, unregister: () => {} }
|
|
2692
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ipccommunicationbackend_free(ptr >>> 0, 1));
|
|
2693
|
+
/**
|
|
2694
|
+
* JavaScript implementation of the `CommunicationBackend` trait for IPC communication.
|
|
2695
|
+
*/
|
|
2696
|
+
class IpcCommunicationBackend {
|
|
2697
|
+
__destroy_into_raw() {
|
|
2698
|
+
const ptr = this.__wbg_ptr;
|
|
2699
|
+
this.__wbg_ptr = 0;
|
|
2700
|
+
IpcCommunicationBackendFinalization.unregister(this);
|
|
2701
|
+
return ptr;
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
free() {
|
|
2705
|
+
const ptr = this.__destroy_into_raw();
|
|
2706
|
+
wasm.__wbg_ipccommunicationbackend_free(ptr, 0);
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* Creates a new instance of the JavaScript communication backend.
|
|
2710
|
+
* @param {IpcCommunicationBackendSender} sender
|
|
2711
|
+
*/
|
|
2712
|
+
constructor(sender) {
|
|
2713
|
+
const ret = wasm.ipccommunicationbackend_new(addHeapObject(sender));
|
|
2714
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2715
|
+
IpcCommunicationBackendFinalization.register(this, this.__wbg_ptr, this);
|
|
2716
|
+
return this;
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Used by JavaScript to provide an incoming message to the IPC framework.
|
|
2720
|
+
* @param {IncomingMessage} message
|
|
2721
|
+
*/
|
|
2722
|
+
receive(message) {
|
|
2723
|
+
try {
|
|
2724
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2725
|
+
_assertClass(message, IncomingMessage);
|
|
2726
|
+
var ptr0 = message.__destroy_into_raw();
|
|
2727
|
+
wasm.ipccommunicationbackend_receive(retptr, this.__wbg_ptr, ptr0);
|
|
2728
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2729
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2730
|
+
if (r1) {
|
|
2731
|
+
throw takeObject(r0);
|
|
2732
|
+
}
|
|
2733
|
+
} finally {
|
|
2734
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
module.exports.IpcCommunicationBackend = IpcCommunicationBackend;
|
|
2739
|
+
|
|
2740
|
+
const OutgoingMessageFinalization =
|
|
2741
|
+
typeof FinalizationRegistry === "undefined"
|
|
2742
|
+
? { register: () => {}, unregister: () => {} }
|
|
2743
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
|
|
2744
|
+
|
|
2745
|
+
class OutgoingMessage {
|
|
2746
|
+
static __wrap(ptr) {
|
|
2747
|
+
ptr = ptr >>> 0;
|
|
2748
|
+
const obj = Object.create(OutgoingMessage.prototype);
|
|
2749
|
+
obj.__wbg_ptr = ptr;
|
|
2750
|
+
OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2751
|
+
return obj;
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
__destroy_into_raw() {
|
|
2755
|
+
const ptr = this.__wbg_ptr;
|
|
2756
|
+
this.__wbg_ptr = 0;
|
|
2757
|
+
OutgoingMessageFinalization.unregister(this);
|
|
2758
|
+
return ptr;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
free() {
|
|
2762
|
+
const ptr = this.__destroy_into_raw();
|
|
2763
|
+
wasm.__wbg_outgoingmessage_free(ptr, 0);
|
|
2764
|
+
}
|
|
2765
|
+
/**
|
|
2766
|
+
* @returns {Uint8Array}
|
|
2767
|
+
*/
|
|
2768
|
+
get payload() {
|
|
2769
|
+
try {
|
|
2770
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2771
|
+
wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
|
|
2772
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2773
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2774
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2775
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
2776
|
+
return v1;
|
|
2777
|
+
} finally {
|
|
2778
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* @param {Uint8Array} arg0
|
|
2783
|
+
*/
|
|
2784
|
+
set payload(arg0) {
|
|
2785
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
2786
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2787
|
+
wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
|
|
2788
|
+
}
|
|
2789
|
+
/**
|
|
2790
|
+
* @returns {Endpoint}
|
|
2791
|
+
*/
|
|
2792
|
+
get destination() {
|
|
2793
|
+
const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
|
|
2794
|
+
return takeObject(ret);
|
|
2795
|
+
}
|
|
2796
|
+
/**
|
|
2797
|
+
* @param {Endpoint} arg0
|
|
2798
|
+
*/
|
|
2799
|
+
set destination(arg0) {
|
|
2800
|
+
wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
|
|
2801
|
+
}
|
|
2802
|
+
/**
|
|
2803
|
+
* @returns {string | undefined}
|
|
2804
|
+
*/
|
|
2805
|
+
get topic() {
|
|
2806
|
+
try {
|
|
2807
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2808
|
+
wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
|
|
2809
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2810
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2811
|
+
let v1;
|
|
2812
|
+
if (r0 !== 0) {
|
|
2813
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
2814
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
2815
|
+
}
|
|
2816
|
+
return v1;
|
|
2817
|
+
} finally {
|
|
2818
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
/**
|
|
2822
|
+
* @param {string | null} [arg0]
|
|
2823
|
+
*/
|
|
2824
|
+
set topic(arg0) {
|
|
2825
|
+
var ptr0 = isLikeNone(arg0)
|
|
2826
|
+
? 0
|
|
2827
|
+
: passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2828
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2829
|
+
wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
|
|
2830
|
+
}
|
|
2831
|
+
/**
|
|
2832
|
+
* @param {Uint8Array} payload
|
|
2833
|
+
* @param {Endpoint} destination
|
|
2834
|
+
* @param {string | null} [topic]
|
|
2835
|
+
*/
|
|
2836
|
+
constructor(payload, destination, topic) {
|
|
2837
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
|
|
2838
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2839
|
+
var ptr1 = isLikeNone(topic)
|
|
2840
|
+
? 0
|
|
2841
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2842
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2843
|
+
const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
|
|
2844
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2845
|
+
OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
|
|
2846
|
+
return this;
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Create a new message and encode the payload as JSON.
|
|
2850
|
+
* @param {any} payload
|
|
2851
|
+
* @param {Endpoint} destination
|
|
2852
|
+
* @param {string | null} [topic]
|
|
2853
|
+
* @returns {OutgoingMessage}
|
|
2854
|
+
*/
|
|
2855
|
+
static new_json_payload(payload, destination, topic) {
|
|
2856
|
+
try {
|
|
2857
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2858
|
+
var ptr0 = isLikeNone(topic)
|
|
2859
|
+
? 0
|
|
2860
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2861
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2862
|
+
wasm.outgoingmessage_new_json_payload(
|
|
2863
|
+
retptr,
|
|
2864
|
+
addHeapObject(payload),
|
|
2865
|
+
addHeapObject(destination),
|
|
2866
|
+
ptr0,
|
|
2867
|
+
len0,
|
|
2868
|
+
);
|
|
2869
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2870
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2871
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2872
|
+
if (r2) {
|
|
2873
|
+
throw takeObject(r1);
|
|
2874
|
+
}
|
|
2875
|
+
return OutgoingMessage.__wrap(r0);
|
|
2876
|
+
} finally {
|
|
2877
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
module.exports.OutgoingMessage = OutgoingMessage;
|
|
2882
|
+
|
|
2883
|
+
const PlatformClientFinalization =
|
|
2884
|
+
typeof FinalizationRegistry === "undefined"
|
|
2885
|
+
? { register: () => {}, unregister: () => {} }
|
|
2886
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_platformclient_free(ptr >>> 0, 1));
|
|
2887
|
+
|
|
2888
|
+
class PlatformClient {
|
|
2889
|
+
static __wrap(ptr) {
|
|
2890
|
+
ptr = ptr >>> 0;
|
|
2891
|
+
const obj = Object.create(PlatformClient.prototype);
|
|
2892
|
+
obj.__wbg_ptr = ptr;
|
|
2893
|
+
PlatformClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2894
|
+
return obj;
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
__destroy_into_raw() {
|
|
2898
|
+
const ptr = this.__wbg_ptr;
|
|
2899
|
+
this.__wbg_ptr = 0;
|
|
2900
|
+
PlatformClientFinalization.unregister(this);
|
|
2901
|
+
return ptr;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
free() {
|
|
366
2905
|
const ptr = this.__destroy_into_raw();
|
|
367
|
-
wasm.
|
|
2906
|
+
wasm.__wbg_platformclient_free(ptr, 0);
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* @returns {StateClient}
|
|
2910
|
+
*/
|
|
2911
|
+
state() {
|
|
2912
|
+
const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
|
|
2913
|
+
return StateClient.__wrap(ret);
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
* Load feature flags into the client
|
|
2917
|
+
* @param {FeatureFlags} flags
|
|
2918
|
+
*/
|
|
2919
|
+
load_flags(flags) {
|
|
2920
|
+
try {
|
|
2921
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2922
|
+
wasm.platformclient_load_flags(retptr, this.__wbg_ptr, addHeapObject(flags));
|
|
2923
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2924
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2925
|
+
if (r1) {
|
|
2926
|
+
throw takeObject(r0);
|
|
2927
|
+
}
|
|
2928
|
+
} finally {
|
|
2929
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
module.exports.PlatformClient = PlatformClient;
|
|
2934
|
+
|
|
2935
|
+
const PureCryptoFinalization =
|
|
2936
|
+
typeof FinalizationRegistry === "undefined"
|
|
2937
|
+
? { register: () => {}, unregister: () => {} }
|
|
2938
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
|
|
2939
|
+
/**
|
|
2940
|
+
* This module represents a stopgap solution to provide access to primitive crypto functions for JS
|
|
2941
|
+
* clients. It is not intended to be used outside of the JS clients and this pattern should not be
|
|
2942
|
+
* proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
|
|
2943
|
+
* responsible for state and keys.
|
|
2944
|
+
*/
|
|
2945
|
+
class PureCrypto {
|
|
2946
|
+
__destroy_into_raw() {
|
|
2947
|
+
const ptr = this.__wbg_ptr;
|
|
2948
|
+
this.__wbg_ptr = 0;
|
|
2949
|
+
PureCryptoFinalization.unregister(this);
|
|
2950
|
+
return ptr;
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
free() {
|
|
2954
|
+
const ptr = this.__destroy_into_raw();
|
|
2955
|
+
wasm.__wbg_purecrypto_free(ptr, 0);
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* DEPRECATED: Use `symmetric_decrypt_string` instead.
|
|
2959
|
+
* Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
|
|
2960
|
+
* @param {string} enc_string
|
|
2961
|
+
* @param {Uint8Array} key
|
|
2962
|
+
* @returns {string}
|
|
2963
|
+
*/
|
|
2964
|
+
static symmetric_decrypt(enc_string, key) {
|
|
2965
|
+
let deferred4_0;
|
|
2966
|
+
let deferred4_1;
|
|
2967
|
+
try {
|
|
2968
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2969
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2970
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2971
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2972
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2973
|
+
wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
|
|
2974
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2975
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2976
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2977
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2978
|
+
var ptr3 = r0;
|
|
2979
|
+
var len3 = r1;
|
|
2980
|
+
if (r3) {
|
|
2981
|
+
ptr3 = 0;
|
|
2982
|
+
len3 = 0;
|
|
2983
|
+
throw takeObject(r2);
|
|
2984
|
+
}
|
|
2985
|
+
deferred4_0 = ptr3;
|
|
2986
|
+
deferred4_1 = len3;
|
|
2987
|
+
return getStringFromWasm0(ptr3, len3);
|
|
2988
|
+
} finally {
|
|
2989
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2990
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* @param {string} enc_string
|
|
2995
|
+
* @param {Uint8Array} key
|
|
2996
|
+
* @returns {string}
|
|
2997
|
+
*/
|
|
2998
|
+
static symmetric_decrypt_string(enc_string, key) {
|
|
2999
|
+
let deferred4_0;
|
|
3000
|
+
let deferred4_1;
|
|
3001
|
+
try {
|
|
3002
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3003
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3004
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3005
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3006
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3007
|
+
wasm.purecrypto_symmetric_decrypt_string(retptr, ptr0, len0, ptr1, len1);
|
|
3008
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3009
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3010
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3011
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3012
|
+
var ptr3 = r0;
|
|
3013
|
+
var len3 = r1;
|
|
3014
|
+
if (r3) {
|
|
3015
|
+
ptr3 = 0;
|
|
3016
|
+
len3 = 0;
|
|
3017
|
+
throw takeObject(r2);
|
|
3018
|
+
}
|
|
3019
|
+
deferred4_0 = ptr3;
|
|
3020
|
+
deferred4_1 = len3;
|
|
3021
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3022
|
+
} finally {
|
|
3023
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3024
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
/**
|
|
3028
|
+
* @param {string} enc_string
|
|
3029
|
+
* @param {Uint8Array} key
|
|
3030
|
+
* @returns {Uint8Array}
|
|
3031
|
+
*/
|
|
3032
|
+
static symmetric_decrypt_bytes(enc_string, key) {
|
|
3033
|
+
try {
|
|
3034
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3035
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3036
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3037
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3038
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3039
|
+
wasm.purecrypto_symmetric_decrypt_bytes(retptr, ptr0, len0, ptr1, len1);
|
|
3040
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3041
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3042
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3043
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3044
|
+
if (r3) {
|
|
3045
|
+
throw takeObject(r2);
|
|
3046
|
+
}
|
|
3047
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3048
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3049
|
+
return v3;
|
|
3050
|
+
} finally {
|
|
3051
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* DEPRECATED: Use `symmetric_decrypt_filedata` instead.
|
|
3056
|
+
* Cleanup ticket: <https://bitwarden.atlassian.net/browse/PM-21247>
|
|
3057
|
+
* @param {Uint8Array} enc_bytes
|
|
3058
|
+
* @param {Uint8Array} key
|
|
3059
|
+
* @returns {Uint8Array}
|
|
3060
|
+
*/
|
|
3061
|
+
static symmetric_decrypt_array_buffer(enc_bytes, key) {
|
|
3062
|
+
try {
|
|
3063
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3064
|
+
const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
|
|
3065
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3066
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3067
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3068
|
+
wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
|
|
3069
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3070
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3071
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3072
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3073
|
+
if (r3) {
|
|
3074
|
+
throw takeObject(r2);
|
|
3075
|
+
}
|
|
3076
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3077
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3078
|
+
return v3;
|
|
3079
|
+
} finally {
|
|
3080
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
/**
|
|
3084
|
+
* @param {Uint8Array} enc_bytes
|
|
3085
|
+
* @param {Uint8Array} key
|
|
3086
|
+
* @returns {Uint8Array}
|
|
3087
|
+
*/
|
|
3088
|
+
static symmetric_decrypt_filedata(enc_bytes, key) {
|
|
3089
|
+
try {
|
|
3090
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3091
|
+
const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
|
|
3092
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3093
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3094
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3095
|
+
wasm.purecrypto_symmetric_decrypt_filedata(retptr, ptr0, len0, ptr1, len1);
|
|
3096
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3097
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3098
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3099
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3100
|
+
if (r3) {
|
|
3101
|
+
throw takeObject(r2);
|
|
3102
|
+
}
|
|
3103
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3104
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3105
|
+
return v3;
|
|
3106
|
+
} finally {
|
|
3107
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
/**
|
|
3111
|
+
* @param {string} plain
|
|
3112
|
+
* @param {Uint8Array} key
|
|
3113
|
+
* @returns {string}
|
|
3114
|
+
*/
|
|
3115
|
+
static symmetric_encrypt_string(plain, key) {
|
|
3116
|
+
let deferred4_0;
|
|
3117
|
+
let deferred4_1;
|
|
3118
|
+
try {
|
|
3119
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3120
|
+
const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3121
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3122
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3123
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3124
|
+
wasm.purecrypto_symmetric_encrypt_string(retptr, ptr0, len0, ptr1, len1);
|
|
3125
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3126
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3127
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3128
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3129
|
+
var ptr3 = r0;
|
|
3130
|
+
var len3 = r1;
|
|
3131
|
+
if (r3) {
|
|
3132
|
+
ptr3 = 0;
|
|
3133
|
+
len3 = 0;
|
|
3134
|
+
throw takeObject(r2);
|
|
3135
|
+
}
|
|
3136
|
+
deferred4_0 = ptr3;
|
|
3137
|
+
deferred4_1 = len3;
|
|
3138
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3139
|
+
} finally {
|
|
3140
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3141
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
/**
|
|
3145
|
+
* DEPRECATED: Only used by send keys
|
|
3146
|
+
* @param {Uint8Array} plain
|
|
3147
|
+
* @param {Uint8Array} key
|
|
3148
|
+
* @returns {string}
|
|
3149
|
+
*/
|
|
3150
|
+
static symmetric_encrypt_bytes(plain, key) {
|
|
3151
|
+
let deferred4_0;
|
|
3152
|
+
let deferred4_1;
|
|
3153
|
+
try {
|
|
3154
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3155
|
+
const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
|
|
3156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3157
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3158
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3159
|
+
wasm.purecrypto_symmetric_encrypt_bytes(retptr, ptr0, len0, ptr1, len1);
|
|
3160
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3161
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3162
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3163
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3164
|
+
var ptr3 = r0;
|
|
3165
|
+
var len3 = r1;
|
|
3166
|
+
if (r3) {
|
|
3167
|
+
ptr3 = 0;
|
|
3168
|
+
len3 = 0;
|
|
3169
|
+
throw takeObject(r2);
|
|
3170
|
+
}
|
|
3171
|
+
deferred4_0 = ptr3;
|
|
3172
|
+
deferred4_1 = len3;
|
|
3173
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3174
|
+
} finally {
|
|
3175
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3176
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
/**
|
|
3180
|
+
* @param {Uint8Array} plain
|
|
3181
|
+
* @param {Uint8Array} key
|
|
3182
|
+
* @returns {Uint8Array}
|
|
3183
|
+
*/
|
|
3184
|
+
static symmetric_encrypt_filedata(plain, key) {
|
|
3185
|
+
try {
|
|
3186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3187
|
+
const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
|
|
3188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3189
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
3190
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3191
|
+
wasm.purecrypto_symmetric_encrypt_filedata(retptr, ptr0, len0, ptr1, len1);
|
|
3192
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3193
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3194
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3195
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3196
|
+
if (r3) {
|
|
3197
|
+
throw takeObject(r2);
|
|
3198
|
+
}
|
|
3199
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3200
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3201
|
+
return v3;
|
|
3202
|
+
} finally {
|
|
3203
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
/**
|
|
3207
|
+
* @param {string} encrypted_user_key
|
|
3208
|
+
* @param {string} master_password
|
|
3209
|
+
* @param {string} email
|
|
3210
|
+
* @param {Kdf} kdf
|
|
3211
|
+
* @returns {Uint8Array}
|
|
3212
|
+
*/
|
|
3213
|
+
static decrypt_user_key_with_master_password(encrypted_user_key, master_password, email, kdf) {
|
|
3214
|
+
try {
|
|
3215
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3216
|
+
const ptr0 = passStringToWasm0(
|
|
3217
|
+
encrypted_user_key,
|
|
3218
|
+
wasm.__wbindgen_malloc,
|
|
3219
|
+
wasm.__wbindgen_realloc,
|
|
3220
|
+
);
|
|
3221
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3222
|
+
const ptr1 = passStringToWasm0(
|
|
3223
|
+
master_password,
|
|
3224
|
+
wasm.__wbindgen_malloc,
|
|
3225
|
+
wasm.__wbindgen_realloc,
|
|
3226
|
+
);
|
|
3227
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3228
|
+
const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3229
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3230
|
+
wasm.purecrypto_decrypt_user_key_with_master_password(
|
|
3231
|
+
retptr,
|
|
3232
|
+
ptr0,
|
|
3233
|
+
len0,
|
|
3234
|
+
ptr1,
|
|
3235
|
+
len1,
|
|
3236
|
+
ptr2,
|
|
3237
|
+
len2,
|
|
3238
|
+
addHeapObject(kdf),
|
|
3239
|
+
);
|
|
3240
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3241
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3242
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3243
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3244
|
+
if (r3) {
|
|
3245
|
+
throw takeObject(r2);
|
|
3246
|
+
}
|
|
3247
|
+
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3248
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3249
|
+
return v4;
|
|
3250
|
+
} finally {
|
|
3251
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
/**
|
|
3255
|
+
* @param {Uint8Array} user_key
|
|
3256
|
+
* @param {string} master_password
|
|
3257
|
+
* @param {string} email
|
|
3258
|
+
* @param {Kdf} kdf
|
|
3259
|
+
* @returns {string}
|
|
3260
|
+
*/
|
|
3261
|
+
static encrypt_user_key_with_master_password(user_key, master_password, email, kdf) {
|
|
3262
|
+
let deferred5_0;
|
|
3263
|
+
let deferred5_1;
|
|
3264
|
+
try {
|
|
3265
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3266
|
+
const ptr0 = passArray8ToWasm0(user_key, wasm.__wbindgen_malloc);
|
|
3267
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3268
|
+
const ptr1 = passStringToWasm0(
|
|
3269
|
+
master_password,
|
|
3270
|
+
wasm.__wbindgen_malloc,
|
|
3271
|
+
wasm.__wbindgen_realloc,
|
|
3272
|
+
);
|
|
3273
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3274
|
+
const ptr2 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3275
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3276
|
+
wasm.purecrypto_encrypt_user_key_with_master_password(
|
|
3277
|
+
retptr,
|
|
3278
|
+
ptr0,
|
|
3279
|
+
len0,
|
|
3280
|
+
ptr1,
|
|
3281
|
+
len1,
|
|
3282
|
+
ptr2,
|
|
3283
|
+
len2,
|
|
3284
|
+
addHeapObject(kdf),
|
|
3285
|
+
);
|
|
3286
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3287
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3288
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3289
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3290
|
+
var ptr4 = r0;
|
|
3291
|
+
var len4 = r1;
|
|
3292
|
+
if (r3) {
|
|
3293
|
+
ptr4 = 0;
|
|
3294
|
+
len4 = 0;
|
|
3295
|
+
throw takeObject(r2);
|
|
3296
|
+
}
|
|
3297
|
+
deferred5_0 = ptr4;
|
|
3298
|
+
deferred5_1 = len4;
|
|
3299
|
+
return getStringFromWasm0(ptr4, len4);
|
|
3300
|
+
} finally {
|
|
3301
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3302
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
/**
|
|
3306
|
+
* @returns {Uint8Array}
|
|
3307
|
+
*/
|
|
3308
|
+
static make_user_key_aes256_cbc_hmac() {
|
|
3309
|
+
try {
|
|
3310
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3311
|
+
wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
|
|
3312
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3313
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3314
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3315
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3316
|
+
return v1;
|
|
3317
|
+
} finally {
|
|
3318
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* @returns {Uint8Array}
|
|
3323
|
+
*/
|
|
3324
|
+
static make_user_key_xchacha20_poly1305() {
|
|
3325
|
+
try {
|
|
3326
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3327
|
+
wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
|
|
3328
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3329
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3330
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3331
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3332
|
+
return v1;
|
|
3333
|
+
} finally {
|
|
3334
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3335
|
+
}
|
|
3336
|
+
}
|
|
3337
|
+
/**
|
|
3338
|
+
* Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
|
|
3339
|
+
* as an EncString.
|
|
3340
|
+
* @param {Uint8Array} key_to_be_wrapped
|
|
3341
|
+
* @param {Uint8Array} wrapping_key
|
|
3342
|
+
* @returns {string}
|
|
3343
|
+
*/
|
|
3344
|
+
static wrap_symmetric_key(key_to_be_wrapped, wrapping_key) {
|
|
3345
|
+
let deferred4_0;
|
|
3346
|
+
let deferred4_1;
|
|
3347
|
+
try {
|
|
3348
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3349
|
+
const ptr0 = passArray8ToWasm0(key_to_be_wrapped, wasm.__wbindgen_malloc);
|
|
3350
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3351
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3352
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3353
|
+
wasm.purecrypto_wrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
|
|
3354
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3355
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3356
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3357
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3358
|
+
var ptr3 = r0;
|
|
3359
|
+
var len3 = r1;
|
|
3360
|
+
if (r3) {
|
|
3361
|
+
ptr3 = 0;
|
|
3362
|
+
len3 = 0;
|
|
3363
|
+
throw takeObject(r2);
|
|
3364
|
+
}
|
|
3365
|
+
deferred4_0 = ptr3;
|
|
3366
|
+
deferred4_1 = len3;
|
|
3367
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3368
|
+
} finally {
|
|
3369
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3370
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
/**
|
|
3374
|
+
* Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
|
|
3375
|
+
* unwrapped key as a serialized byte array.
|
|
3376
|
+
* @param {string} wrapped_key
|
|
3377
|
+
* @param {Uint8Array} wrapping_key
|
|
3378
|
+
* @returns {Uint8Array}
|
|
3379
|
+
*/
|
|
3380
|
+
static unwrap_symmetric_key(wrapped_key, wrapping_key) {
|
|
3381
|
+
try {
|
|
3382
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3383
|
+
const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3385
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3386
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3387
|
+
wasm.purecrypto_unwrap_symmetric_key(retptr, ptr0, len0, ptr1, len1);
|
|
3388
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3389
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3390
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3391
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3392
|
+
if (r3) {
|
|
3393
|
+
throw takeObject(r2);
|
|
3394
|
+
}
|
|
3395
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3396
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3397
|
+
return v3;
|
|
3398
|
+
} finally {
|
|
3399
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
/**
|
|
3403
|
+
* Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
|
|
3404
|
+
* key. Note: Usually, a public key is - by definition - public, so this should not be
|
|
3405
|
+
* used. The specific use-case for this function is to enable rotateable key sets, where
|
|
3406
|
+
* the "public key" is not public, with the intent of preventing the server from being able
|
|
3407
|
+
* to overwrite the user key unlocked by the rotateable keyset.
|
|
3408
|
+
* @param {Uint8Array} encapsulation_key
|
|
3409
|
+
* @param {Uint8Array} wrapping_key
|
|
3410
|
+
* @returns {string}
|
|
3411
|
+
*/
|
|
3412
|
+
static wrap_encapsulation_key(encapsulation_key, wrapping_key) {
|
|
3413
|
+
let deferred4_0;
|
|
3414
|
+
let deferred4_1;
|
|
3415
|
+
try {
|
|
3416
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3417
|
+
const ptr0 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
|
|
3418
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3419
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3420
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3421
|
+
wasm.purecrypto_wrap_encapsulation_key(retptr, ptr0, len0, ptr1, len1);
|
|
3422
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3423
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3424
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3425
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3426
|
+
var ptr3 = r0;
|
|
3427
|
+
var len3 = r1;
|
|
3428
|
+
if (r3) {
|
|
3429
|
+
ptr3 = 0;
|
|
3430
|
+
len3 = 0;
|
|
3431
|
+
throw takeObject(r2);
|
|
3432
|
+
}
|
|
3433
|
+
deferred4_0 = ptr3;
|
|
3434
|
+
deferred4_1 = len3;
|
|
3435
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3436
|
+
} finally {
|
|
3437
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3438
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
|
|
3443
|
+
* wrapping key.
|
|
3444
|
+
* @param {string} wrapped_key
|
|
3445
|
+
* @param {Uint8Array} wrapping_key
|
|
3446
|
+
* @returns {Uint8Array}
|
|
3447
|
+
*/
|
|
3448
|
+
static unwrap_encapsulation_key(wrapped_key, wrapping_key) {
|
|
3449
|
+
try {
|
|
3450
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3451
|
+
const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3452
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3453
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3454
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3455
|
+
wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
|
|
3456
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3457
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3458
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3459
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3460
|
+
if (r3) {
|
|
3461
|
+
throw takeObject(r2);
|
|
3462
|
+
}
|
|
3463
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3464
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3465
|
+
return v3;
|
|
3466
|
+
} finally {
|
|
3467
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
|
|
3472
|
+
* key,
|
|
3473
|
+
* @param {Uint8Array} decapsulation_key
|
|
3474
|
+
* @param {Uint8Array} wrapping_key
|
|
3475
|
+
* @returns {string}
|
|
3476
|
+
*/
|
|
3477
|
+
static wrap_decapsulation_key(decapsulation_key, wrapping_key) {
|
|
3478
|
+
let deferred4_0;
|
|
3479
|
+
let deferred4_1;
|
|
3480
|
+
try {
|
|
3481
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3482
|
+
const ptr0 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
|
|
3483
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3484
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3485
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3486
|
+
wasm.purecrypto_wrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
|
|
3487
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3488
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3489
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3490
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3491
|
+
var ptr3 = r0;
|
|
3492
|
+
var len3 = r1;
|
|
3493
|
+
if (r3) {
|
|
3494
|
+
ptr3 = 0;
|
|
3495
|
+
len3 = 0;
|
|
3496
|
+
throw takeObject(r2);
|
|
3497
|
+
}
|
|
3498
|
+
deferred4_0 = ptr3;
|
|
3499
|
+
deferred4_1 = len3;
|
|
3500
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3501
|
+
} finally {
|
|
3502
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3503
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3504
|
+
}
|
|
368
3505
|
}
|
|
369
3506
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
3507
|
+
* Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
|
|
3508
|
+
* wrapping key.
|
|
3509
|
+
* @param {string} wrapped_key
|
|
3510
|
+
* @param {Uint8Array} wrapping_key
|
|
3511
|
+
* @returns {Uint8Array}
|
|
372
3512
|
*/
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
3513
|
+
static unwrap_decapsulation_key(wrapped_key, wrapping_key) {
|
|
3514
|
+
try {
|
|
3515
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3516
|
+
const ptr0 = passStringToWasm0(wrapped_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3517
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3518
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3519
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3520
|
+
wasm.purecrypto_unwrap_decapsulation_key(retptr, ptr0, len0, ptr1, len1);
|
|
3521
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3522
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3523
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3524
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3525
|
+
if (r3) {
|
|
3526
|
+
throw takeObject(r2);
|
|
3527
|
+
}
|
|
3528
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3529
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3530
|
+
return v3;
|
|
3531
|
+
} finally {
|
|
3532
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3533
|
+
}
|
|
381
3534
|
}
|
|
382
3535
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
3536
|
+
* Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
|
|
3537
|
+
* in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
|
|
3538
|
+
* the sender's authenticity cannot be verified by the recipient.
|
|
3539
|
+
* @param {Uint8Array} shared_key
|
|
3540
|
+
* @param {Uint8Array} encapsulation_key
|
|
385
3541
|
* @returns {string}
|
|
386
3542
|
*/
|
|
387
|
-
|
|
388
|
-
let
|
|
389
|
-
let
|
|
3543
|
+
static encapsulate_key_unsigned(shared_key, encapsulation_key) {
|
|
3544
|
+
let deferred4_0;
|
|
3545
|
+
let deferred4_1;
|
|
390
3546
|
try {
|
|
391
3547
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
392
|
-
const ptr0 =
|
|
3548
|
+
const ptr0 = passArray8ToWasm0(shared_key, wasm.__wbindgen_malloc);
|
|
393
3549
|
const len0 = WASM_VECTOR_LEN;
|
|
394
|
-
|
|
3550
|
+
const ptr1 = passArray8ToWasm0(encapsulation_key, wasm.__wbindgen_malloc);
|
|
3551
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3552
|
+
wasm.purecrypto_encapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
|
|
395
3553
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
396
3554
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
3555
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3556
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3557
|
+
var ptr3 = r0;
|
|
3558
|
+
var len3 = r1;
|
|
3559
|
+
if (r3) {
|
|
3560
|
+
ptr3 = 0;
|
|
3561
|
+
len3 = 0;
|
|
3562
|
+
throw takeObject(r2);
|
|
3563
|
+
}
|
|
3564
|
+
deferred4_0 = ptr3;
|
|
3565
|
+
deferred4_1 = len3;
|
|
3566
|
+
return getStringFromWasm0(ptr3, len3);
|
|
400
3567
|
} finally {
|
|
401
3568
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
402
|
-
wasm.__wbindgen_free(
|
|
3569
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
403
3570
|
}
|
|
404
3571
|
}
|
|
405
3572
|
/**
|
|
406
|
-
*
|
|
3573
|
+
* Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
|
|
3574
|
+
* DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
|
|
3575
|
+
* recipient.
|
|
3576
|
+
* @param {string} encapsulated_key
|
|
3577
|
+
* @param {Uint8Array} decapsulation_key
|
|
3578
|
+
* @returns {Uint8Array}
|
|
407
3579
|
*/
|
|
408
|
-
|
|
409
|
-
let deferred1_0;
|
|
410
|
-
let deferred1_1;
|
|
3580
|
+
static decapsulate_key_unsigned(encapsulated_key, decapsulation_key) {
|
|
411
3581
|
try {
|
|
412
3582
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
413
|
-
|
|
3583
|
+
const ptr0 = passStringToWasm0(
|
|
3584
|
+
encapsulated_key,
|
|
3585
|
+
wasm.__wbindgen_malloc,
|
|
3586
|
+
wasm.__wbindgen_realloc,
|
|
3587
|
+
);
|
|
3588
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3589
|
+
const ptr1 = passArray8ToWasm0(decapsulation_key, wasm.__wbindgen_malloc);
|
|
3590
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3591
|
+
wasm.purecrypto_decapsulate_key_unsigned(retptr, ptr0, len0, ptr1, len1);
|
|
414
3592
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
415
3593
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
3594
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3595
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3596
|
+
if (r3) {
|
|
3597
|
+
throw takeObject(r2);
|
|
3598
|
+
}
|
|
3599
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3600
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3601
|
+
return v3;
|
|
419
3602
|
} finally {
|
|
420
3603
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
421
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
422
3604
|
}
|
|
423
3605
|
}
|
|
424
3606
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
3607
|
+
* Given a wrapped signing key and the symmetric key it is wrapped with, this returns
|
|
3608
|
+
* the corresponding verifying key.
|
|
3609
|
+
* @param {string} signing_key
|
|
3610
|
+
* @param {Uint8Array} wrapping_key
|
|
3611
|
+
* @returns {Uint8Array}
|
|
427
3612
|
*/
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
3613
|
+
static verifying_key_for_signing_key(signing_key, wrapping_key) {
|
|
3614
|
+
try {
|
|
3615
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3616
|
+
const ptr0 = passStringToWasm0(signing_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3617
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3618
|
+
const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
|
|
3619
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3620
|
+
wasm.purecrypto_verifying_key_for_signing_key(retptr, ptr0, len0, ptr1, len1);
|
|
3621
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3622
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3623
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3624
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3625
|
+
if (r3) {
|
|
3626
|
+
throw takeObject(r2);
|
|
3627
|
+
}
|
|
3628
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3629
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3630
|
+
return v3;
|
|
3631
|
+
} finally {
|
|
3632
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3633
|
+
}
|
|
433
3634
|
}
|
|
434
3635
|
/**
|
|
435
|
-
*
|
|
436
|
-
* @param {
|
|
437
|
-
* @returns {
|
|
3636
|
+
* Returns the algorithm used for the given verifying key.
|
|
3637
|
+
* @param {Uint8Array} verifying_key
|
|
3638
|
+
* @returns {SignatureAlgorithm}
|
|
438
3639
|
*/
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
3640
|
+
static key_algorithm_for_verifying_key(verifying_key) {
|
|
3641
|
+
try {
|
|
3642
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3643
|
+
const ptr0 = passArray8ToWasm0(verifying_key, wasm.__wbindgen_malloc);
|
|
3644
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3645
|
+
wasm.purecrypto_key_algorithm_for_verifying_key(retptr, ptr0, len0);
|
|
3646
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3647
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3648
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3649
|
+
if (r2) {
|
|
3650
|
+
throw takeObject(r1);
|
|
3651
|
+
}
|
|
3652
|
+
return takeObject(r0);
|
|
3653
|
+
} finally {
|
|
3654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3655
|
+
}
|
|
444
3656
|
}
|
|
445
3657
|
/**
|
|
446
|
-
*
|
|
3658
|
+
* For a given signing identity (verifying key), this function verifies that the signing
|
|
3659
|
+
* identity claimed ownership of the public key. This is a one-sided claim and merely shows
|
|
3660
|
+
* that the signing identity has the intent to receive messages encrypted to the public
|
|
3661
|
+
* key.
|
|
3662
|
+
* @param {Uint8Array} signed_public_key
|
|
3663
|
+
* @param {Uint8Array} verifying_key
|
|
3664
|
+
* @returns {Uint8Array}
|
|
447
3665
|
*/
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
3666
|
+
static verify_and_unwrap_signed_public_key(signed_public_key, verifying_key) {
|
|
3667
|
+
try {
|
|
3668
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3669
|
+
const ptr0 = passArray8ToWasm0(signed_public_key, wasm.__wbindgen_malloc);
|
|
3670
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3671
|
+
const ptr1 = passArray8ToWasm0(verifying_key, wasm.__wbindgen_malloc);
|
|
3672
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3673
|
+
wasm.purecrypto_verify_and_unwrap_signed_public_key(retptr, ptr0, len0, ptr1, len1);
|
|
3674
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3675
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3676
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3677
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3678
|
+
if (r3) {
|
|
3679
|
+
throw takeObject(r2);
|
|
3680
|
+
}
|
|
3681
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3682
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3683
|
+
return v3;
|
|
3684
|
+
} finally {
|
|
3685
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3686
|
+
}
|
|
451
3687
|
}
|
|
452
3688
|
/**
|
|
453
|
-
*
|
|
3689
|
+
* Derive output of the KDF for a [bitwarden_crypto::Kdf] configuration.
|
|
3690
|
+
* @param {Uint8Array} password
|
|
3691
|
+
* @param {Uint8Array} salt
|
|
3692
|
+
* @param {Kdf} kdf
|
|
3693
|
+
* @returns {Uint8Array}
|
|
454
3694
|
*/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
3695
|
+
static derive_kdf_material(password, salt, kdf) {
|
|
3696
|
+
try {
|
|
3697
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3698
|
+
const ptr0 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
3699
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3700
|
+
const ptr1 = passArray8ToWasm0(salt, wasm.__wbindgen_malloc);
|
|
3701
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3702
|
+
wasm.purecrypto_derive_kdf_material(retptr, ptr0, len0, ptr1, len1, addHeapObject(kdf));
|
|
3703
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3704
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3705
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3706
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3707
|
+
if (r3) {
|
|
3708
|
+
throw takeObject(r2);
|
|
3709
|
+
}
|
|
3710
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3711
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3712
|
+
return v3;
|
|
3713
|
+
} finally {
|
|
3714
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
/**
|
|
3718
|
+
* @param {string} encrypted_user_key
|
|
3719
|
+
* @param {Uint8Array} master_key
|
|
3720
|
+
* @returns {Uint8Array}
|
|
3721
|
+
*/
|
|
3722
|
+
static decrypt_user_key_with_master_key(encrypted_user_key, master_key) {
|
|
3723
|
+
try {
|
|
3724
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3725
|
+
const ptr0 = passStringToWasm0(
|
|
3726
|
+
encrypted_user_key,
|
|
3727
|
+
wasm.__wbindgen_malloc,
|
|
3728
|
+
wasm.__wbindgen_realloc,
|
|
3729
|
+
);
|
|
3730
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3731
|
+
const ptr1 = passArray8ToWasm0(master_key, wasm.__wbindgen_malloc);
|
|
3732
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3733
|
+
wasm.purecrypto_decrypt_user_key_with_master_key(retptr, ptr0, len0, ptr1, len1);
|
|
3734
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3735
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3736
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3737
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3738
|
+
if (r3) {
|
|
3739
|
+
throw takeObject(r2);
|
|
3740
|
+
}
|
|
3741
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3742
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
3743
|
+
return v3;
|
|
3744
|
+
} finally {
|
|
3745
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3746
|
+
}
|
|
458
3747
|
}
|
|
459
3748
|
}
|
|
460
|
-
module.exports.
|
|
3749
|
+
module.exports.PureCrypto = PureCrypto;
|
|
461
3750
|
|
|
462
|
-
const
|
|
3751
|
+
const SendAccessClientFinalization =
|
|
463
3752
|
typeof FinalizationRegistry === "undefined"
|
|
464
3753
|
? { register: () => {}, unregister: () => {} }
|
|
465
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
466
|
-
|
|
467
|
-
|
|
3754
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_sendaccessclient_free(ptr >>> 0, 1));
|
|
3755
|
+
/**
|
|
3756
|
+
* The `SendAccessClient` is used to interact with the Bitwarden API to get send access tokens.
|
|
3757
|
+
*/
|
|
3758
|
+
class SendAccessClient {
|
|
468
3759
|
static __wrap(ptr) {
|
|
469
3760
|
ptr = ptr >>> 0;
|
|
470
|
-
const obj = Object.create(
|
|
3761
|
+
const obj = Object.create(SendAccessClient.prototype);
|
|
471
3762
|
obj.__wbg_ptr = ptr;
|
|
472
|
-
|
|
3763
|
+
SendAccessClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
473
3764
|
return obj;
|
|
474
3765
|
}
|
|
475
3766
|
|
|
476
3767
|
__destroy_into_raw() {
|
|
477
3768
|
const ptr = this.__wbg_ptr;
|
|
478
3769
|
this.__wbg_ptr = 0;
|
|
479
|
-
|
|
3770
|
+
SendAccessClientFinalization.unregister(this);
|
|
480
3771
|
return ptr;
|
|
481
3772
|
}
|
|
482
3773
|
|
|
483
3774
|
free() {
|
|
484
3775
|
const ptr = this.__destroy_into_raw();
|
|
485
|
-
wasm.
|
|
3776
|
+
wasm.__wbg_sendaccessclient_free(ptr, 0);
|
|
486
3777
|
}
|
|
487
3778
|
/**
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
* @
|
|
491
|
-
* @returns {Promise<void>}
|
|
3779
|
+
* Requests a new send access token.
|
|
3780
|
+
* @param {SendAccessTokenRequest} request
|
|
3781
|
+
* @returns {Promise<SendAccessTokenResponse>}
|
|
492
3782
|
*/
|
|
493
|
-
|
|
494
|
-
const ret = wasm.
|
|
3783
|
+
request_send_access_token(request) {
|
|
3784
|
+
const ret = wasm.sendaccessclient_request_send_access_token(
|
|
3785
|
+
this.__wbg_ptr,
|
|
3786
|
+
addHeapObject(request),
|
|
3787
|
+
);
|
|
495
3788
|
return takeObject(ret);
|
|
496
3789
|
}
|
|
3790
|
+
}
|
|
3791
|
+
module.exports.SendAccessClient = SendAccessClient;
|
|
3792
|
+
|
|
3793
|
+
const StateClientFinalization =
|
|
3794
|
+
typeof FinalizationRegistry === "undefined"
|
|
3795
|
+
? { register: () => {}, unregister: () => {} }
|
|
3796
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_stateclient_free(ptr >>> 0, 1));
|
|
3797
|
+
|
|
3798
|
+
class StateClient {
|
|
3799
|
+
static __wrap(ptr) {
|
|
3800
|
+
ptr = ptr >>> 0;
|
|
3801
|
+
const obj = Object.create(StateClient.prototype);
|
|
3802
|
+
obj.__wbg_ptr = ptr;
|
|
3803
|
+
StateClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3804
|
+
return obj;
|
|
3805
|
+
}
|
|
3806
|
+
|
|
3807
|
+
__destroy_into_raw() {
|
|
3808
|
+
const ptr = this.__wbg_ptr;
|
|
3809
|
+
this.__wbg_ptr = 0;
|
|
3810
|
+
StateClientFinalization.unregister(this);
|
|
3811
|
+
return ptr;
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
free() {
|
|
3815
|
+
const ptr = this.__destroy_into_raw();
|
|
3816
|
+
wasm.__wbg_stateclient_free(ptr, 0);
|
|
3817
|
+
}
|
|
497
3818
|
/**
|
|
498
|
-
*
|
|
499
|
-
|
|
500
|
-
|
|
3819
|
+
* @param {any} cipher_repository
|
|
3820
|
+
*/
|
|
3821
|
+
register_cipher_repository(cipher_repository) {
|
|
3822
|
+
wasm.stateclient_register_cipher_repository(this.__wbg_ptr, addHeapObject(cipher_repository));
|
|
3823
|
+
}
|
|
3824
|
+
/**
|
|
3825
|
+
* @param {any} store
|
|
3826
|
+
*/
|
|
3827
|
+
register_folder_repository(store) {
|
|
3828
|
+
wasm.stateclient_register_folder_repository(this.__wbg_ptr, addHeapObject(store));
|
|
3829
|
+
}
|
|
3830
|
+
/**
|
|
3831
|
+
* @param {Repositories} repositories
|
|
3832
|
+
*/
|
|
3833
|
+
register_client_managed_repositories(repositories) {
|
|
3834
|
+
wasm.stateclient_register_client_managed_repositories(
|
|
3835
|
+
this.__wbg_ptr,
|
|
3836
|
+
addHeapObject(repositories),
|
|
3837
|
+
);
|
|
3838
|
+
}
|
|
3839
|
+
/**
|
|
3840
|
+
* Initialize the database for SDK managed repositories.
|
|
3841
|
+
* @param {IndexedDbConfiguration} configuration
|
|
501
3842
|
* @returns {Promise<void>}
|
|
502
3843
|
*/
|
|
503
|
-
|
|
504
|
-
const ret = wasm.
|
|
3844
|
+
initialize_state(configuration) {
|
|
3845
|
+
const ret = wasm.stateclient_initialize_state(this.__wbg_ptr, addHeapObject(configuration));
|
|
505
3846
|
return takeObject(ret);
|
|
506
3847
|
}
|
|
507
3848
|
}
|
|
508
|
-
module.exports.
|
|
3849
|
+
module.exports.StateClient = StateClient;
|
|
509
3850
|
|
|
510
|
-
const
|
|
3851
|
+
const TotpClientFinalization =
|
|
511
3852
|
typeof FinalizationRegistry === "undefined"
|
|
512
3853
|
? { register: () => {}, unregister: () => {} }
|
|
513
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
3854
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
|
|
514
3855
|
|
|
515
|
-
class
|
|
3856
|
+
class TotpClient {
|
|
516
3857
|
static __wrap(ptr) {
|
|
517
3858
|
ptr = ptr >>> 0;
|
|
518
|
-
const obj = Object.create(
|
|
3859
|
+
const obj = Object.create(TotpClient.prototype);
|
|
519
3860
|
obj.__wbg_ptr = ptr;
|
|
520
|
-
|
|
3861
|
+
TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
521
3862
|
return obj;
|
|
522
3863
|
}
|
|
523
3864
|
|
|
524
3865
|
__destroy_into_raw() {
|
|
525
3866
|
const ptr = this.__wbg_ptr;
|
|
526
3867
|
this.__wbg_ptr = 0;
|
|
527
|
-
|
|
3868
|
+
TotpClientFinalization.unregister(this);
|
|
528
3869
|
return ptr;
|
|
529
3870
|
}
|
|
530
3871
|
|
|
531
3872
|
free() {
|
|
532
3873
|
const ptr = this.__destroy_into_raw();
|
|
533
|
-
wasm.
|
|
3874
|
+
wasm.__wbg_totpclient_free(ptr, 0);
|
|
534
3875
|
}
|
|
535
3876
|
/**
|
|
536
|
-
*
|
|
537
|
-
*
|
|
538
|
-
*
|
|
3877
|
+
* Generates a TOTP code from a provided key
|
|
3878
|
+
*
|
|
3879
|
+
* # Arguments
|
|
3880
|
+
* - `key` - Can be:
|
|
3881
|
+
* - A base32 encoded string
|
|
3882
|
+
* - OTP Auth URI
|
|
3883
|
+
* - Steam URI
|
|
3884
|
+
* - `time_ms` - Optional timestamp in milliseconds
|
|
3885
|
+
* @param {string} key
|
|
3886
|
+
* @param {number | null} [time_ms]
|
|
3887
|
+
* @returns {TotpResponse}
|
|
539
3888
|
*/
|
|
540
|
-
|
|
3889
|
+
generate_totp(key, time_ms) {
|
|
541
3890
|
try {
|
|
542
3891
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
543
|
-
|
|
3892
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3893
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3894
|
+
wasm.totpclient_generate_totp(
|
|
3895
|
+
retptr,
|
|
3896
|
+
this.__wbg_ptr,
|
|
3897
|
+
ptr0,
|
|
3898
|
+
len0,
|
|
3899
|
+
!isLikeNone(time_ms),
|
|
3900
|
+
isLikeNone(time_ms) ? 0 : time_ms,
|
|
3901
|
+
);
|
|
544
3902
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
545
3903
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
546
3904
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -553,42 +3911,75 @@ class ClientFolders {
|
|
|
553
3911
|
}
|
|
554
3912
|
}
|
|
555
3913
|
}
|
|
556
|
-
module.exports.
|
|
3914
|
+
module.exports.TotpClient = TotpClient;
|
|
557
3915
|
|
|
558
|
-
const
|
|
3916
|
+
const VaultClientFinalization =
|
|
559
3917
|
typeof FinalizationRegistry === "undefined"
|
|
560
3918
|
? { register: () => {}, unregister: () => {} }
|
|
561
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
3919
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
|
|
562
3920
|
|
|
563
|
-
class
|
|
3921
|
+
class VaultClient {
|
|
564
3922
|
static __wrap(ptr) {
|
|
565
3923
|
ptr = ptr >>> 0;
|
|
566
|
-
const obj = Object.create(
|
|
3924
|
+
const obj = Object.create(VaultClient.prototype);
|
|
567
3925
|
obj.__wbg_ptr = ptr;
|
|
568
|
-
|
|
3926
|
+
VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
569
3927
|
return obj;
|
|
570
3928
|
}
|
|
571
3929
|
|
|
572
3930
|
__destroy_into_raw() {
|
|
573
3931
|
const ptr = this.__wbg_ptr;
|
|
574
3932
|
this.__wbg_ptr = 0;
|
|
575
|
-
|
|
3933
|
+
VaultClientFinalization.unregister(this);
|
|
576
3934
|
return ptr;
|
|
577
3935
|
}
|
|
578
3936
|
|
|
579
3937
|
free() {
|
|
580
3938
|
const ptr = this.__destroy_into_raw();
|
|
581
|
-
wasm.
|
|
3939
|
+
wasm.__wbg_vaultclient_free(ptr, 0);
|
|
3940
|
+
}
|
|
3941
|
+
/**
|
|
3942
|
+
* Attachment related operations.
|
|
3943
|
+
* @returns {AttachmentsClient}
|
|
3944
|
+
*/
|
|
3945
|
+
attachments() {
|
|
3946
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
3947
|
+
return AttachmentsClient.__wrap(ret);
|
|
3948
|
+
}
|
|
3949
|
+
/**
|
|
3950
|
+
* Cipher related operations.
|
|
3951
|
+
* @returns {CiphersClient}
|
|
3952
|
+
*/
|
|
3953
|
+
ciphers() {
|
|
3954
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
3955
|
+
return CiphersClient.__wrap(ret);
|
|
582
3956
|
}
|
|
583
3957
|
/**
|
|
584
|
-
*
|
|
3958
|
+
* Folder related operations.
|
|
3959
|
+
* @returns {FoldersClient}
|
|
585
3960
|
*/
|
|
586
3961
|
folders() {
|
|
587
|
-
const ret = wasm.
|
|
588
|
-
return
|
|
3962
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
3963
|
+
return FoldersClient.__wrap(ret);
|
|
3964
|
+
}
|
|
3965
|
+
/**
|
|
3966
|
+
* TOTP related operations.
|
|
3967
|
+
* @returns {TotpClient}
|
|
3968
|
+
*/
|
|
3969
|
+
totp() {
|
|
3970
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
3971
|
+
return TotpClient.__wrap(ret);
|
|
3972
|
+
}
|
|
3973
|
+
/**
|
|
3974
|
+
* Collection related operations.
|
|
3975
|
+
* @returns {CollectionsClient}
|
|
3976
|
+
*/
|
|
3977
|
+
collections() {
|
|
3978
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
3979
|
+
return CollectionsClient.__wrap(ret);
|
|
589
3980
|
}
|
|
590
3981
|
}
|
|
591
|
-
module.exports.
|
|
3982
|
+
module.exports.VaultClient = VaultClient;
|
|
592
3983
|
|
|
593
3984
|
module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
|
|
594
3985
|
const ret = String(getObject(arg1));
|
|
@@ -598,23 +3989,37 @@ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function (arg0, arg1) {
|
|
|
598
3989
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
599
3990
|
};
|
|
600
3991
|
|
|
601
|
-
module.exports.
|
|
3992
|
+
module.exports.__wbg_abort_410ec47a64ac6117 = function (arg0, arg1) {
|
|
3993
|
+
getObject(arg0).abort(getObject(arg1));
|
|
3994
|
+
};
|
|
3995
|
+
|
|
3996
|
+
module.exports.__wbg_abort_775ef1d17fc65868 = function (arg0) {
|
|
602
3997
|
getObject(arg0).abort();
|
|
603
3998
|
};
|
|
604
3999
|
|
|
605
|
-
module.exports.
|
|
4000
|
+
module.exports.__wbg_abort_99fc644e2c79c9fb = function () {
|
|
4001
|
+
return handleError(function (arg0) {
|
|
4002
|
+
getObject(arg0).abort();
|
|
4003
|
+
}, arguments);
|
|
4004
|
+
};
|
|
4005
|
+
|
|
4006
|
+
module.exports.__wbg_addEventListener_dc3da056b615f634 = function (arg0, arg1, arg2, arg3) {
|
|
4007
|
+
getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
4008
|
+
};
|
|
4009
|
+
|
|
4010
|
+
module.exports.__wbg_append_299d5d48292c0495 = function () {
|
|
606
4011
|
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
607
4012
|
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
608
4013
|
}, arguments);
|
|
609
4014
|
};
|
|
610
4015
|
|
|
611
|
-
module.exports.
|
|
4016
|
+
module.exports.__wbg_append_8c7dd8d641a5f01b = function () {
|
|
612
4017
|
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
613
4018
|
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
614
4019
|
}, arguments);
|
|
615
4020
|
};
|
|
616
4021
|
|
|
617
|
-
module.exports.
|
|
4022
|
+
module.exports.__wbg_append_b2d1fc16de2a0e81 = function () {
|
|
618
4023
|
return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
619
4024
|
getObject(arg0).append(
|
|
620
4025
|
getStringFromWasm0(arg1, arg2),
|
|
@@ -624,54 +4029,85 @@ module.exports.__wbg_append_7606a4b52c36db7b = function () {
|
|
|
624
4029
|
}, arguments);
|
|
625
4030
|
};
|
|
626
4031
|
|
|
627
|
-
module.exports.
|
|
4032
|
+
module.exports.__wbg_append_b44785ebeb668479 = function () {
|
|
628
4033
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
629
4034
|
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
630
4035
|
}, arguments);
|
|
631
4036
|
};
|
|
632
4037
|
|
|
633
|
-
module.exports.
|
|
4038
|
+
module.exports.__wbg_arrayBuffer_d1b44c4390db422f = function () {
|
|
4039
|
+
return handleError(function (arg0) {
|
|
4040
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
4041
|
+
return addHeapObject(ret);
|
|
4042
|
+
}, arguments);
|
|
4043
|
+
};
|
|
4044
|
+
|
|
4045
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
|
|
634
4046
|
const ret = getObject(arg0).buffer;
|
|
635
4047
|
return addHeapObject(ret);
|
|
636
4048
|
};
|
|
637
4049
|
|
|
638
|
-
module.exports.
|
|
4050
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function () {
|
|
4051
|
+
return handleError(function (arg0, arg1) {
|
|
4052
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
4053
|
+
return addHeapObject(ret);
|
|
4054
|
+
}, arguments);
|
|
4055
|
+
};
|
|
4056
|
+
|
|
4057
|
+
module.exports.__wbg_call_7cccdd69e0791ae2 = function () {
|
|
639
4058
|
return handleError(function (arg0, arg1, arg2) {
|
|
640
4059
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
641
4060
|
return addHeapObject(ret);
|
|
642
4061
|
}, arguments);
|
|
643
4062
|
};
|
|
644
4063
|
|
|
645
|
-
module.exports.
|
|
646
|
-
|
|
647
|
-
|
|
4064
|
+
module.exports.__wbg_cipher_f5c54e62df3607df = function (arg0) {
|
|
4065
|
+
const ret = getObject(arg0).cipher;
|
|
4066
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4067
|
+
};
|
|
4068
|
+
|
|
4069
|
+
module.exports.__wbg_clearTimeout_b1115618e821c3b2 = function (arg0) {
|
|
4070
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
4071
|
+
return addHeapObject(ret);
|
|
4072
|
+
};
|
|
4073
|
+
|
|
4074
|
+
module.exports.__wbg_collectionviewnodeitem_new = function (arg0) {
|
|
4075
|
+
const ret = CollectionViewNodeItem.__wrap(arg0);
|
|
4076
|
+
return addHeapObject(ret);
|
|
4077
|
+
};
|
|
4078
|
+
|
|
4079
|
+
module.exports.__wbg_createObjectStore_d2f9e1016f4d81b9 = function () {
|
|
4080
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4081
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
648
4082
|
return addHeapObject(ret);
|
|
649
4083
|
}, arguments);
|
|
650
4084
|
};
|
|
651
4085
|
|
|
652
|
-
module.exports.
|
|
4086
|
+
module.exports.__wbg_crypto_574e78ad8b13b65f = function (arg0) {
|
|
653
4087
|
const ret = getObject(arg0).crypto;
|
|
654
4088
|
return addHeapObject(ret);
|
|
655
4089
|
};
|
|
656
4090
|
|
|
657
|
-
module.exports.
|
|
4091
|
+
module.exports.__wbg_debug_e17b51583ca6a632 = function (arg0, arg1, arg2, arg3) {
|
|
658
4092
|
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
659
4093
|
};
|
|
660
4094
|
|
|
661
|
-
module.exports.
|
|
4095
|
+
module.exports.__wbg_deleteObjectStore_3f08ae00cd288224 = function () {
|
|
4096
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4097
|
+
getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
|
|
4098
|
+
}, arguments);
|
|
4099
|
+
};
|
|
4100
|
+
|
|
4101
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function (arg0) {
|
|
662
4102
|
const ret = getObject(arg0).done;
|
|
663
4103
|
return ret;
|
|
664
4104
|
};
|
|
665
4105
|
|
|
666
|
-
module.exports.
|
|
4106
|
+
module.exports.__wbg_entries_3265d4158b33e5dc = function (arg0) {
|
|
667
4107
|
const ret = Object.entries(getObject(arg0));
|
|
668
4108
|
return addHeapObject(ret);
|
|
669
4109
|
};
|
|
670
4110
|
|
|
671
|
-
module.exports.__wbg_error_483d659117b6f3f6 = function (arg0, arg1, arg2, arg3) {
|
|
672
|
-
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
673
|
-
};
|
|
674
|
-
|
|
675
4111
|
module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
|
|
676
4112
|
let deferred0_0;
|
|
677
4113
|
let deferred0_1;
|
|
@@ -684,32 +4120,94 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
|
|
|
684
4120
|
}
|
|
685
4121
|
};
|
|
686
4122
|
|
|
687
|
-
module.exports.
|
|
4123
|
+
module.exports.__wbg_error_80de38b3f7cc3c3c = function (arg0, arg1, arg2, arg3) {
|
|
4124
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
4125
|
+
};
|
|
4126
|
+
|
|
4127
|
+
module.exports.__wbg_error_ff4ddaabdfc5dbb3 = function () {
|
|
4128
|
+
return handleError(function (arg0) {
|
|
4129
|
+
const ret = getObject(arg0).error;
|
|
4130
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4131
|
+
}, arguments);
|
|
4132
|
+
};
|
|
4133
|
+
|
|
4134
|
+
module.exports.__wbg_fetch_3afbdcc7ddbf16fe = function (arg0) {
|
|
4135
|
+
const ret = fetch(getObject(arg0));
|
|
4136
|
+
return addHeapObject(ret);
|
|
4137
|
+
};
|
|
4138
|
+
|
|
4139
|
+
module.exports.__wbg_fetch_509096533071c657 = function (arg0, arg1) {
|
|
688
4140
|
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
689
4141
|
return addHeapObject(ret);
|
|
690
4142
|
};
|
|
691
4143
|
|
|
692
|
-
module.exports.
|
|
693
|
-
const ret =
|
|
694
|
-
return addHeapObject(ret);
|
|
4144
|
+
module.exports.__wbg_folder_d84cb3984b067e4c = function (arg0) {
|
|
4145
|
+
const ret = getObject(arg0).folder;
|
|
4146
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4147
|
+
};
|
|
4148
|
+
|
|
4149
|
+
module.exports.__wbg_getRandomValues_38097e921c2494c3 = function () {
|
|
4150
|
+
return handleError(function (arg0, arg1) {
|
|
4151
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
4152
|
+
}, arguments);
|
|
4153
|
+
};
|
|
4154
|
+
|
|
4155
|
+
module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function () {
|
|
4156
|
+
return handleError(function (arg0, arg1) {
|
|
4157
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
4158
|
+
}, arguments);
|
|
4159
|
+
};
|
|
4160
|
+
|
|
4161
|
+
module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
|
|
4162
|
+
const ret = getObject(arg0).getTime();
|
|
4163
|
+
return ret;
|
|
4164
|
+
};
|
|
4165
|
+
|
|
4166
|
+
module.exports.__wbg_get_3c28aecfc1d6f178 = function () {
|
|
4167
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4168
|
+
let deferred0_0;
|
|
4169
|
+
let deferred0_1;
|
|
4170
|
+
try {
|
|
4171
|
+
deferred0_0 = arg1;
|
|
4172
|
+
deferred0_1 = arg2;
|
|
4173
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2));
|
|
4174
|
+
return addHeapObject(ret);
|
|
4175
|
+
} finally {
|
|
4176
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4177
|
+
}
|
|
4178
|
+
}, arguments);
|
|
4179
|
+
};
|
|
4180
|
+
|
|
4181
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function () {
|
|
4182
|
+
return handleError(function (arg0, arg1) {
|
|
4183
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4184
|
+
return addHeapObject(ret);
|
|
4185
|
+
}, arguments);
|
|
695
4186
|
};
|
|
696
4187
|
|
|
697
|
-
module.exports.
|
|
698
|
-
return handleError(function (arg0, arg1) {
|
|
699
|
-
|
|
4188
|
+
module.exports.__wbg_get_a1af30b8cea488e5 = function () {
|
|
4189
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4190
|
+
let deferred0_0;
|
|
4191
|
+
let deferred0_1;
|
|
4192
|
+
try {
|
|
4193
|
+
deferred0_0 = arg1;
|
|
4194
|
+
deferred0_1 = arg2;
|
|
4195
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2));
|
|
4196
|
+
return addHeapObject(ret);
|
|
4197
|
+
} finally {
|
|
4198
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4199
|
+
}
|
|
700
4200
|
}, arguments);
|
|
701
4201
|
};
|
|
702
4202
|
|
|
703
|
-
module.exports.
|
|
4203
|
+
module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
|
|
704
4204
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
705
4205
|
return addHeapObject(ret);
|
|
706
4206
|
};
|
|
707
4207
|
|
|
708
|
-
module.exports.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
return addHeapObject(ret);
|
|
712
|
-
}, arguments);
|
|
4208
|
+
module.exports.__wbg_getaccesstoken_edd1e9099b97b214 = function (arg0) {
|
|
4209
|
+
const ret = getObject(arg0).get_access_token();
|
|
4210
|
+
return addHeapObject(ret);
|
|
713
4211
|
};
|
|
714
4212
|
|
|
715
4213
|
module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
|
|
@@ -717,23 +4215,42 @@ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
|
|
|
717
4215
|
return addHeapObject(ret);
|
|
718
4216
|
};
|
|
719
4217
|
|
|
720
|
-
module.exports.
|
|
4218
|
+
module.exports.__wbg_has_a5ea9117f258a0ec = function () {
|
|
721
4219
|
return handleError(function (arg0, arg1) {
|
|
722
4220
|
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
723
4221
|
return ret;
|
|
724
4222
|
}, arguments);
|
|
725
4223
|
};
|
|
726
4224
|
|
|
727
|
-
module.exports.
|
|
4225
|
+
module.exports.__wbg_headers_9cb51cfd2ac780a4 = function (arg0) {
|
|
728
4226
|
const ret = getObject(arg0).headers;
|
|
729
4227
|
return addHeapObject(ret);
|
|
730
4228
|
};
|
|
731
4229
|
|
|
732
|
-
module.exports.
|
|
4230
|
+
module.exports.__wbg_incomingmessage_new = function (arg0) {
|
|
4231
|
+
const ret = IncomingMessage.__wrap(arg0);
|
|
4232
|
+
return addHeapObject(ret);
|
|
4233
|
+
};
|
|
4234
|
+
|
|
4235
|
+
module.exports.__wbg_indexedDB_b1f49280282046f8 = function () {
|
|
4236
|
+
return handleError(function (arg0) {
|
|
4237
|
+
const ret = getObject(arg0).indexedDB;
|
|
4238
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4239
|
+
}, arguments);
|
|
4240
|
+
};
|
|
4241
|
+
|
|
4242
|
+
module.exports.__wbg_indexedDB_f6b47b0dc333fd2f = function () {
|
|
4243
|
+
return handleError(function (arg0) {
|
|
4244
|
+
const ret = getObject(arg0).indexedDB;
|
|
4245
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4246
|
+
}, arguments);
|
|
4247
|
+
};
|
|
4248
|
+
|
|
4249
|
+
module.exports.__wbg_info_033d8b8a0838f1d3 = function (arg0, arg1, arg2, arg3) {
|
|
733
4250
|
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
734
4251
|
};
|
|
735
4252
|
|
|
736
|
-
module.exports.
|
|
4253
|
+
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
|
|
737
4254
|
let result;
|
|
738
4255
|
try {
|
|
739
4256
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -744,7 +4261,62 @@ module.exports.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function (arg0) {
|
|
|
744
4261
|
return ret;
|
|
745
4262
|
};
|
|
746
4263
|
|
|
747
|
-
module.exports.
|
|
4264
|
+
module.exports.__wbg_instanceof_DomException_ed1ccb7aaf39034c = function (arg0) {
|
|
4265
|
+
let result;
|
|
4266
|
+
try {
|
|
4267
|
+
result = getObject(arg0) instanceof DOMException;
|
|
4268
|
+
} catch (_) {
|
|
4269
|
+
result = false;
|
|
4270
|
+
}
|
|
4271
|
+
const ret = result;
|
|
4272
|
+
return ret;
|
|
4273
|
+
};
|
|
4274
|
+
|
|
4275
|
+
module.exports.__wbg_instanceof_IdbDatabase_a3ef009ca00059f9 = function (arg0) {
|
|
4276
|
+
let result;
|
|
4277
|
+
try {
|
|
4278
|
+
result = getObject(arg0) instanceof IDBDatabase;
|
|
4279
|
+
} catch (_) {
|
|
4280
|
+
result = false;
|
|
4281
|
+
}
|
|
4282
|
+
const ret = result;
|
|
4283
|
+
return ret;
|
|
4284
|
+
};
|
|
4285
|
+
|
|
4286
|
+
module.exports.__wbg_instanceof_IdbOpenDbRequest_a3416e156c9db893 = function (arg0) {
|
|
4287
|
+
let result;
|
|
4288
|
+
try {
|
|
4289
|
+
result = getObject(arg0) instanceof IDBOpenDBRequest;
|
|
4290
|
+
} catch (_) {
|
|
4291
|
+
result = false;
|
|
4292
|
+
}
|
|
4293
|
+
const ret = result;
|
|
4294
|
+
return ret;
|
|
4295
|
+
};
|
|
4296
|
+
|
|
4297
|
+
module.exports.__wbg_instanceof_IdbRequest_4813c3f207666aa4 = function (arg0) {
|
|
4298
|
+
let result;
|
|
4299
|
+
try {
|
|
4300
|
+
result = getObject(arg0) instanceof IDBRequest;
|
|
4301
|
+
} catch (_) {
|
|
4302
|
+
result = false;
|
|
4303
|
+
}
|
|
4304
|
+
const ret = result;
|
|
4305
|
+
return ret;
|
|
4306
|
+
};
|
|
4307
|
+
|
|
4308
|
+
module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function (arg0) {
|
|
4309
|
+
let result;
|
|
4310
|
+
try {
|
|
4311
|
+
result = getObject(arg0) instanceof Map;
|
|
4312
|
+
} catch (_) {
|
|
4313
|
+
result = false;
|
|
4314
|
+
}
|
|
4315
|
+
const ret = result;
|
|
4316
|
+
return ret;
|
|
4317
|
+
};
|
|
4318
|
+
|
|
4319
|
+
module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function (arg0) {
|
|
748
4320
|
let result;
|
|
749
4321
|
try {
|
|
750
4322
|
result = getObject(arg0) instanceof Response;
|
|
@@ -755,7 +4327,7 @@ module.exports.__wbg_instanceof_Response_d3453657e10c4300 = function (arg0) {
|
|
|
755
4327
|
return ret;
|
|
756
4328
|
};
|
|
757
4329
|
|
|
758
|
-
module.exports.
|
|
4330
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
|
|
759
4331
|
let result;
|
|
760
4332
|
try {
|
|
761
4333
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -766,62 +4338,109 @@ module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function (arg0) {
|
|
|
766
4338
|
return ret;
|
|
767
4339
|
};
|
|
768
4340
|
|
|
769
|
-
module.exports.
|
|
4341
|
+
module.exports.__wbg_instanceof_Window_def73ea0955fc569 = function (arg0) {
|
|
4342
|
+
let result;
|
|
4343
|
+
try {
|
|
4344
|
+
result = getObject(arg0) instanceof Window;
|
|
4345
|
+
} catch (_) {
|
|
4346
|
+
result = false;
|
|
4347
|
+
}
|
|
4348
|
+
const ret = result;
|
|
4349
|
+
return ret;
|
|
4350
|
+
};
|
|
4351
|
+
|
|
4352
|
+
module.exports.__wbg_instanceof_WorkerGlobalScope_dbdbdea7e3b56493 = function (arg0) {
|
|
4353
|
+
let result;
|
|
4354
|
+
try {
|
|
4355
|
+
result = getObject(arg0) instanceof WorkerGlobalScope;
|
|
4356
|
+
} catch (_) {
|
|
4357
|
+
result = false;
|
|
4358
|
+
}
|
|
4359
|
+
const ret = result;
|
|
4360
|
+
return ret;
|
|
4361
|
+
};
|
|
4362
|
+
|
|
4363
|
+
module.exports.__wbg_ipcclientsubscription_new = function (arg0) {
|
|
4364
|
+
const ret = IpcClientSubscription.__wrap(arg0);
|
|
4365
|
+
return addHeapObject(ret);
|
|
4366
|
+
};
|
|
4367
|
+
|
|
4368
|
+
module.exports.__wbg_isArray_a1eab7e0d067391b = function (arg0) {
|
|
4369
|
+
const ret = Array.isArray(getObject(arg0));
|
|
4370
|
+
return ret;
|
|
4371
|
+
};
|
|
4372
|
+
|
|
4373
|
+
module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
|
|
770
4374
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
771
4375
|
return ret;
|
|
772
4376
|
};
|
|
773
4377
|
|
|
774
|
-
module.exports.
|
|
4378
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function () {
|
|
775
4379
|
const ret = Symbol.iterator;
|
|
776
4380
|
return addHeapObject(ret);
|
|
777
4381
|
};
|
|
778
4382
|
|
|
779
|
-
module.exports.
|
|
4383
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function (arg0) {
|
|
780
4384
|
const ret = getObject(arg0).length;
|
|
781
4385
|
return ret;
|
|
782
4386
|
};
|
|
783
4387
|
|
|
784
|
-
module.exports.
|
|
4388
|
+
module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
|
|
785
4389
|
const ret = getObject(arg0).length;
|
|
786
4390
|
return ret;
|
|
787
4391
|
};
|
|
788
4392
|
|
|
789
|
-
module.exports.
|
|
4393
|
+
module.exports.__wbg_list_321650497e6f3ac4 = function () {
|
|
4394
|
+
return handleError(function (arg0) {
|
|
4395
|
+
const ret = getObject(arg0).list();
|
|
4396
|
+
return addHeapObject(ret);
|
|
4397
|
+
}, arguments);
|
|
4398
|
+
};
|
|
4399
|
+
|
|
4400
|
+
module.exports.__wbg_list_96a4e44300ac8e85 = function () {
|
|
4401
|
+
return handleError(function (arg0) {
|
|
4402
|
+
const ret = getObject(arg0).list();
|
|
4403
|
+
return addHeapObject(ret);
|
|
4404
|
+
}, arguments);
|
|
4405
|
+
};
|
|
4406
|
+
|
|
4407
|
+
module.exports.__wbg_log_cad59bb680daec67 = function (arg0, arg1, arg2, arg3) {
|
|
790
4408
|
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
791
4409
|
};
|
|
792
4410
|
|
|
793
|
-
module.exports.
|
|
4411
|
+
module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function (arg0) {
|
|
794
4412
|
const ret = getObject(arg0).msCrypto;
|
|
795
4413
|
return addHeapObject(ret);
|
|
796
4414
|
};
|
|
797
4415
|
|
|
798
|
-
module.exports.
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
4416
|
+
module.exports.__wbg_name_f2d27098bfd843e7 = function (arg0, arg1) {
|
|
4417
|
+
const ret = getObject(arg1).name;
|
|
4418
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4419
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4420
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4421
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
803
4422
|
};
|
|
804
4423
|
|
|
805
|
-
module.exports.
|
|
806
|
-
const ret = new
|
|
4424
|
+
module.exports.__wbg_new0_f788a2397c7ca929 = function () {
|
|
4425
|
+
const ret = new Date();
|
|
807
4426
|
return addHeapObject(ret);
|
|
808
4427
|
};
|
|
809
4428
|
|
|
810
|
-
module.exports.
|
|
4429
|
+
module.exports.__wbg_new_018dcc2d6c8c2f6a = function () {
|
|
811
4430
|
return handleError(function () {
|
|
812
4431
|
const ret = new Headers();
|
|
813
4432
|
return addHeapObject(ret);
|
|
814
4433
|
}, arguments);
|
|
815
4434
|
};
|
|
816
4435
|
|
|
817
|
-
module.exports.
|
|
4436
|
+
module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
|
|
818
4437
|
try {
|
|
819
4438
|
var state0 = { a: arg0, b: arg1 };
|
|
820
4439
|
var cb0 = (arg0, arg1) => {
|
|
821
4440
|
const a = state0.a;
|
|
822
4441
|
state0.a = 0;
|
|
823
4442
|
try {
|
|
824
|
-
return
|
|
4443
|
+
return __wbg_adapter_341(a, state0.b, arg0, arg1);
|
|
825
4444
|
} finally {
|
|
826
4445
|
state0.a = a;
|
|
827
4446
|
}
|
|
@@ -833,31 +4452,48 @@ module.exports.__wbg_new_3d446df9155128ef = function (arg0, arg1) {
|
|
|
833
4452
|
}
|
|
834
4453
|
};
|
|
835
4454
|
|
|
836
|
-
module.exports.
|
|
837
|
-
const ret = new
|
|
4455
|
+
module.exports.__wbg_new_405e22f390576ce2 = function () {
|
|
4456
|
+
const ret = new Object();
|
|
4457
|
+
return addHeapObject(ret);
|
|
4458
|
+
};
|
|
4459
|
+
|
|
4460
|
+
module.exports.__wbg_new_5e0be73521bc8c17 = function () {
|
|
4461
|
+
const ret = new Map();
|
|
4462
|
+
return addHeapObject(ret);
|
|
4463
|
+
};
|
|
4464
|
+
|
|
4465
|
+
module.exports.__wbg_new_78feb108b6472713 = function () {
|
|
4466
|
+
const ret = new Array();
|
|
4467
|
+
return addHeapObject(ret);
|
|
4468
|
+
};
|
|
4469
|
+
|
|
4470
|
+
module.exports.__wbg_new_8a6f238a6ece86ea = function () {
|
|
4471
|
+
const ret = new Error();
|
|
838
4472
|
return addHeapObject(ret);
|
|
839
4473
|
};
|
|
840
4474
|
|
|
841
|
-
module.exports.
|
|
4475
|
+
module.exports.__wbg_new_9fd39a253424609a = function () {
|
|
842
4476
|
return handleError(function () {
|
|
843
|
-
const ret = new
|
|
4477
|
+
const ret = new FormData();
|
|
844
4478
|
return addHeapObject(ret);
|
|
845
4479
|
}, arguments);
|
|
846
4480
|
};
|
|
847
4481
|
|
|
848
|
-
module.exports.
|
|
849
|
-
const ret = new
|
|
4482
|
+
module.exports.__wbg_new_a12002a7f91c75be = function (arg0) {
|
|
4483
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
850
4484
|
return addHeapObject(ret);
|
|
851
4485
|
};
|
|
852
4486
|
|
|
853
|
-
module.exports.
|
|
854
|
-
const ret = new
|
|
4487
|
+
module.exports.__wbg_new_c68d7209be747379 = function (arg0, arg1) {
|
|
4488
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
855
4489
|
return addHeapObject(ret);
|
|
856
4490
|
};
|
|
857
4491
|
|
|
858
|
-
module.exports.
|
|
859
|
-
|
|
860
|
-
|
|
4492
|
+
module.exports.__wbg_new_e25e5aab09ff45db = function () {
|
|
4493
|
+
return handleError(function () {
|
|
4494
|
+
const ret = new AbortController();
|
|
4495
|
+
return addHeapObject(ret);
|
|
4496
|
+
}, arguments);
|
|
861
4497
|
};
|
|
862
4498
|
|
|
863
4499
|
module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
|
|
@@ -873,114 +4509,220 @@ module.exports.__wbg_new_f24b6d53abe5bc82 = function (arg0, arg1) {
|
|
|
873
4509
|
}
|
|
874
4510
|
};
|
|
875
4511
|
|
|
876
|
-
module.exports.
|
|
4512
|
+
module.exports.__wbg_newnoargs_105ed471475aaf50 = function (arg0, arg1) {
|
|
877
4513
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
878
4514
|
return addHeapObject(ret);
|
|
879
4515
|
};
|
|
880
4516
|
|
|
881
|
-
module.exports.
|
|
4517
|
+
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function (arg0, arg1, arg2) {
|
|
882
4518
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
883
4519
|
return addHeapObject(ret);
|
|
884
4520
|
};
|
|
885
4521
|
|
|
886
|
-
module.exports.
|
|
4522
|
+
module.exports.__wbg_newwithlength_a381634e90c276d4 = function (arg0) {
|
|
887
4523
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
888
4524
|
return addHeapObject(ret);
|
|
889
4525
|
};
|
|
890
4526
|
|
|
891
|
-
module.exports.
|
|
4527
|
+
module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function () {
|
|
892
4528
|
return handleError(function (arg0, arg1, arg2) {
|
|
893
4529
|
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
894
4530
|
return addHeapObject(ret);
|
|
895
4531
|
}, arguments);
|
|
896
4532
|
};
|
|
897
4533
|
|
|
898
|
-
module.exports.
|
|
4534
|
+
module.exports.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function () {
|
|
899
4535
|
return handleError(function (arg0, arg1) {
|
|
900
4536
|
const ret = new Blob(getObject(arg0), getObject(arg1));
|
|
901
4537
|
return addHeapObject(ret);
|
|
902
4538
|
}, arguments);
|
|
903
4539
|
};
|
|
904
4540
|
|
|
905
|
-
module.exports.
|
|
4541
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function (arg0) {
|
|
4542
|
+
const ret = getObject(arg0).next;
|
|
4543
|
+
return addHeapObject(ret);
|
|
4544
|
+
};
|
|
4545
|
+
|
|
4546
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function () {
|
|
906
4547
|
return handleError(function (arg0) {
|
|
907
4548
|
const ret = getObject(arg0).next();
|
|
908
4549
|
return addHeapObject(ret);
|
|
909
4550
|
}, arguments);
|
|
910
4551
|
};
|
|
911
4552
|
|
|
912
|
-
module.exports.
|
|
913
|
-
const ret = getObject(arg0).
|
|
4553
|
+
module.exports.__wbg_node_905d3e251edff8a2 = function (arg0) {
|
|
4554
|
+
const ret = getObject(arg0).node;
|
|
914
4555
|
return addHeapObject(ret);
|
|
915
4556
|
};
|
|
916
4557
|
|
|
917
|
-
module.exports.
|
|
918
|
-
|
|
919
|
-
|
|
4558
|
+
module.exports.__wbg_open_e0c0b2993eb596e1 = function () {
|
|
4559
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4560
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
4561
|
+
return addHeapObject(ret);
|
|
4562
|
+
}, arguments);
|
|
4563
|
+
};
|
|
4564
|
+
|
|
4565
|
+
module.exports.__wbg_parse_def2e24ef1252aff = function () {
|
|
4566
|
+
return handleError(function (arg0, arg1) {
|
|
4567
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
4568
|
+
return addHeapObject(ret);
|
|
4569
|
+
}, arguments);
|
|
4570
|
+
};
|
|
4571
|
+
|
|
4572
|
+
module.exports.__wbg_preventDefault_c2314fd813c02b3c = function (arg0) {
|
|
4573
|
+
getObject(arg0).preventDefault();
|
|
920
4574
|
};
|
|
921
4575
|
|
|
922
|
-
module.exports.
|
|
4576
|
+
module.exports.__wbg_process_dc0fbacc7c1c06f7 = function (arg0) {
|
|
923
4577
|
const ret = getObject(arg0).process;
|
|
924
4578
|
return addHeapObject(ret);
|
|
925
4579
|
};
|
|
926
4580
|
|
|
927
|
-
module.exports.
|
|
4581
|
+
module.exports.__wbg_push_737cfc8c1432c2c6 = function (arg0, arg1) {
|
|
928
4582
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
929
4583
|
return ret;
|
|
930
4584
|
};
|
|
931
4585
|
|
|
932
|
-
module.exports.
|
|
4586
|
+
module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function (arg0) {
|
|
933
4587
|
queueMicrotask(getObject(arg0));
|
|
934
4588
|
};
|
|
935
4589
|
|
|
936
|
-
module.exports.
|
|
4590
|
+
module.exports.__wbg_queueMicrotask_d3219def82552485 = function (arg0) {
|
|
937
4591
|
const ret = getObject(arg0).queueMicrotask;
|
|
938
4592
|
return addHeapObject(ret);
|
|
939
4593
|
};
|
|
940
4594
|
|
|
941
|
-
module.exports.
|
|
4595
|
+
module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
|
|
942
4596
|
return handleError(function (arg0, arg1) {
|
|
943
4597
|
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
944
4598
|
}, arguments);
|
|
945
4599
|
};
|
|
946
4600
|
|
|
947
|
-
module.exports.
|
|
4601
|
+
module.exports.__wbg_remove_33ad5f6731f425e3 = function () {
|
|
4602
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4603
|
+
let deferred0_0;
|
|
4604
|
+
let deferred0_1;
|
|
4605
|
+
try {
|
|
4606
|
+
deferred0_0 = arg1;
|
|
4607
|
+
deferred0_1 = arg2;
|
|
4608
|
+
const ret = getObject(arg0).remove(getStringFromWasm0(arg1, arg2));
|
|
4609
|
+
return addHeapObject(ret);
|
|
4610
|
+
} finally {
|
|
4611
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4612
|
+
}
|
|
4613
|
+
}, arguments);
|
|
4614
|
+
};
|
|
4615
|
+
|
|
4616
|
+
module.exports.__wbg_remove_53bbf5803d384d0f = function () {
|
|
4617
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4618
|
+
let deferred0_0;
|
|
4619
|
+
let deferred0_1;
|
|
4620
|
+
try {
|
|
4621
|
+
deferred0_0 = arg1;
|
|
4622
|
+
deferred0_1 = arg2;
|
|
4623
|
+
const ret = getObject(arg0).remove(getStringFromWasm0(arg1, arg2));
|
|
4624
|
+
return addHeapObject(ret);
|
|
4625
|
+
} finally {
|
|
4626
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4627
|
+
}
|
|
4628
|
+
}, arguments);
|
|
4629
|
+
};
|
|
4630
|
+
|
|
4631
|
+
module.exports.__wbg_require_60cc747a6bc5215a = function () {
|
|
948
4632
|
return handleError(function () {
|
|
949
4633
|
const ret = module.require;
|
|
950
4634
|
return addHeapObject(ret);
|
|
951
4635
|
}, arguments);
|
|
952
4636
|
};
|
|
953
4637
|
|
|
954
|
-
module.exports.
|
|
4638
|
+
module.exports.__wbg_resolve_4851785c9c5f573d = function (arg0) {
|
|
955
4639
|
const ret = Promise.resolve(getObject(arg0));
|
|
956
4640
|
return addHeapObject(ret);
|
|
957
4641
|
};
|
|
958
4642
|
|
|
959
|
-
module.exports.
|
|
960
|
-
|
|
4643
|
+
module.exports.__wbg_result_f29afabdf2c05826 = function () {
|
|
4644
|
+
return handleError(function (arg0) {
|
|
4645
|
+
const ret = getObject(arg0).result;
|
|
4646
|
+
return addHeapObject(ret);
|
|
4647
|
+
}, arguments);
|
|
4648
|
+
};
|
|
4649
|
+
|
|
4650
|
+
module.exports.__wbg_send_9b8fc6bb517867dd = function () {
|
|
4651
|
+
return handleError(function (arg0, arg1) {
|
|
4652
|
+
const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
|
|
4653
|
+
return addHeapObject(ret);
|
|
4654
|
+
}, arguments);
|
|
4655
|
+
};
|
|
4656
|
+
|
|
4657
|
+
module.exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
|
|
4658
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
4659
|
+
return addHeapObject(ret);
|
|
4660
|
+
};
|
|
4661
|
+
|
|
4662
|
+
module.exports.__wbg_set_056dde6de7d0d58a = function () {
|
|
4663
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4664
|
+
let deferred0_0;
|
|
4665
|
+
let deferred0_1;
|
|
4666
|
+
try {
|
|
4667
|
+
deferred0_0 = arg1;
|
|
4668
|
+
deferred0_1 = arg2;
|
|
4669
|
+
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
4670
|
+
return addHeapObject(ret);
|
|
4671
|
+
} finally {
|
|
4672
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4673
|
+
}
|
|
4674
|
+
}, arguments);
|
|
4675
|
+
};
|
|
4676
|
+
|
|
4677
|
+
module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
|
|
4678
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
961
4679
|
};
|
|
962
4680
|
|
|
963
4681
|
module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
|
964
4682
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
965
4683
|
};
|
|
966
4684
|
|
|
967
|
-
module.exports.
|
|
4685
|
+
module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
|
4686
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
4687
|
+
};
|
|
4688
|
+
|
|
4689
|
+
module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
|
|
4690
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
4691
|
+
return addHeapObject(ret);
|
|
4692
|
+
};
|
|
4693
|
+
|
|
4694
|
+
module.exports.__wbg_set_ba35213970ae6762 = function () {
|
|
4695
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4696
|
+
let deferred0_0;
|
|
4697
|
+
let deferred0_1;
|
|
4698
|
+
try {
|
|
4699
|
+
deferred0_0 = arg1;
|
|
4700
|
+
deferred0_1 = arg2;
|
|
4701
|
+
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
4702
|
+
return addHeapObject(ret);
|
|
4703
|
+
} finally {
|
|
4704
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4705
|
+
}
|
|
4706
|
+
}, arguments);
|
|
4707
|
+
};
|
|
4708
|
+
|
|
4709
|
+
module.exports.__wbg_setbody_5923b78a95eedf29 = function (arg0, arg1) {
|
|
968
4710
|
getObject(arg0).body = getObject(arg1);
|
|
969
4711
|
};
|
|
970
4712
|
|
|
971
|
-
module.exports.
|
|
4713
|
+
module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function (arg0, arg1) {
|
|
972
4714
|
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
973
4715
|
};
|
|
974
4716
|
|
|
975
|
-
module.exports.
|
|
4717
|
+
module.exports.__wbg_setheaders_834c0bdb6a8949ad = function (arg0, arg1) {
|
|
976
4718
|
getObject(arg0).headers = getObject(arg1);
|
|
977
4719
|
};
|
|
978
4720
|
|
|
979
|
-
module.exports.
|
|
4721
|
+
module.exports.__wbg_setmethod_3c5280fe5d890842 = function (arg0, arg1, arg2) {
|
|
980
4722
|
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
981
4723
|
};
|
|
982
4724
|
|
|
983
|
-
module.exports.
|
|
4725
|
+
module.exports.__wbg_setmode_5dc300b865044b65 = function (arg0, arg1) {
|
|
984
4726
|
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
985
4727
|
};
|
|
986
4728
|
|
|
@@ -996,11 +4738,23 @@ module.exports.__wbg_setname_c0e2d6f348c746f4 = function (arg0, arg1, arg2) {
|
|
|
996
4738
|
}
|
|
997
4739
|
};
|
|
998
4740
|
|
|
999
|
-
module.exports.
|
|
4741
|
+
module.exports.__wbg_setonerror_d7e3056cc6e56085 = function (arg0, arg1) {
|
|
4742
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
4743
|
+
};
|
|
4744
|
+
|
|
4745
|
+
module.exports.__wbg_setonsuccess_afa464ee777a396d = function (arg0, arg1) {
|
|
4746
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
|
4747
|
+
};
|
|
4748
|
+
|
|
4749
|
+
module.exports.__wbg_setonupgradeneeded_fcf7ce4f2eb0cb5f = function (arg0, arg1) {
|
|
4750
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
|
4751
|
+
};
|
|
4752
|
+
|
|
4753
|
+
module.exports.__wbg_setsignal_75b21ef3a81de905 = function (arg0, arg1) {
|
|
1000
4754
|
getObject(arg0).signal = getObject(arg1);
|
|
1001
4755
|
};
|
|
1002
4756
|
|
|
1003
|
-
module.exports.
|
|
4757
|
+
module.exports.__wbg_settype_39ed370d3edd403c = function (arg0, arg1, arg2) {
|
|
1004
4758
|
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
|
1005
4759
|
};
|
|
1006
4760
|
|
|
@@ -1016,7 +4770,7 @@ module.exports.__wbg_setvariant_d1d41b778dfe9c17 = function (arg0, arg1, arg2) {
|
|
|
1016
4770
|
}
|
|
1017
4771
|
};
|
|
1018
4772
|
|
|
1019
|
-
module.exports.
|
|
4773
|
+
module.exports.__wbg_signal_aaf9ad74119f20a4 = function (arg0) {
|
|
1020
4774
|
const ret = getObject(arg0).signal;
|
|
1021
4775
|
return addHeapObject(ret);
|
|
1022
4776
|
};
|
|
@@ -1029,61 +4783,71 @@ module.exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
|
|
|
1029
4783
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1030
4784
|
};
|
|
1031
4785
|
|
|
1032
|
-
module.exports.
|
|
4786
|
+
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function () {
|
|
1033
4787
|
const ret = typeof global === "undefined" ? null : global;
|
|
1034
4788
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1035
4789
|
};
|
|
1036
4790
|
|
|
1037
|
-
module.exports.
|
|
4791
|
+
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function () {
|
|
1038
4792
|
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
1039
4793
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1040
4794
|
};
|
|
1041
4795
|
|
|
1042
|
-
module.exports.
|
|
4796
|
+
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function () {
|
|
1043
4797
|
const ret = typeof self === "undefined" ? null : self;
|
|
1044
4798
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1045
4799
|
};
|
|
1046
4800
|
|
|
1047
|
-
module.exports.
|
|
4801
|
+
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function () {
|
|
1048
4802
|
const ret = typeof window === "undefined" ? null : window;
|
|
1049
4803
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1050
4804
|
};
|
|
1051
4805
|
|
|
1052
|
-
module.exports.
|
|
4806
|
+
module.exports.__wbg_status_f6360336ca686bf0 = function (arg0) {
|
|
1053
4807
|
const ret = getObject(arg0).status;
|
|
1054
4808
|
return ret;
|
|
1055
4809
|
};
|
|
1056
4810
|
|
|
1057
|
-
module.exports.
|
|
4811
|
+
module.exports.__wbg_stringify_f7ed6987935b4a24 = function () {
|
|
1058
4812
|
return handleError(function (arg0) {
|
|
1059
4813
|
const ret = JSON.stringify(getObject(arg0));
|
|
1060
4814
|
return addHeapObject(ret);
|
|
1061
4815
|
}, arguments);
|
|
1062
4816
|
};
|
|
1063
4817
|
|
|
1064
|
-
module.exports.
|
|
4818
|
+
module.exports.__wbg_subarray_aa9065fa9dc5df96 = function (arg0, arg1, arg2) {
|
|
1065
4819
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1066
4820
|
return addHeapObject(ret);
|
|
1067
4821
|
};
|
|
1068
4822
|
|
|
1069
|
-
module.exports.
|
|
4823
|
+
module.exports.__wbg_target_0a62d9d79a2a1ede = function (arg0) {
|
|
4824
|
+
const ret = getObject(arg0).target;
|
|
4825
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4826
|
+
};
|
|
4827
|
+
|
|
4828
|
+
module.exports.__wbg_text_7805bea50de2af49 = function () {
|
|
1070
4829
|
return handleError(function (arg0) {
|
|
1071
4830
|
const ret = getObject(arg0).text();
|
|
1072
4831
|
return addHeapObject(ret);
|
|
1073
4832
|
}, arguments);
|
|
1074
4833
|
};
|
|
1075
4834
|
|
|
1076
|
-
module.exports.
|
|
4835
|
+
module.exports.__wbg_then_44b73946d2fb3e7d = function (arg0, arg1) {
|
|
1077
4836
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
1078
4837
|
return addHeapObject(ret);
|
|
1079
4838
|
};
|
|
1080
4839
|
|
|
1081
|
-
module.exports.
|
|
4840
|
+
module.exports.__wbg_then_48b406749878a531 = function (arg0, arg1, arg2) {
|
|
1082
4841
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1083
4842
|
return addHeapObject(ret);
|
|
1084
4843
|
};
|
|
1085
4844
|
|
|
1086
|
-
module.exports.
|
|
4845
|
+
module.exports.__wbg_transaction_e713aa7b07ccaedd = function (arg0) {
|
|
4846
|
+
const ret = getObject(arg0).transaction;
|
|
4847
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4848
|
+
};
|
|
4849
|
+
|
|
4850
|
+
module.exports.__wbg_url_ae10c34ca209681d = function (arg0, arg1) {
|
|
1087
4851
|
const ret = getObject(arg1).url;
|
|
1088
4852
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1089
4853
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -1091,25 +4855,51 @@ module.exports.__wbg_url_5327bc0a41a9b085 = function (arg0, arg1) {
|
|
|
1091
4855
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1092
4856
|
};
|
|
1093
4857
|
|
|
1094
|
-
module.exports.
|
|
4858
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
|
|
1095
4859
|
const ret = getObject(arg0).value;
|
|
1096
4860
|
return addHeapObject(ret);
|
|
1097
4861
|
};
|
|
1098
4862
|
|
|
1099
|
-
module.exports.
|
|
4863
|
+
module.exports.__wbg_versions_c01dfd4722a88165 = function (arg0) {
|
|
1100
4864
|
const ret = getObject(arg0).versions;
|
|
1101
4865
|
return addHeapObject(ret);
|
|
1102
4866
|
};
|
|
1103
4867
|
|
|
1104
|
-
module.exports.
|
|
4868
|
+
module.exports.__wbg_warn_aaf1f4664a035bd6 = function (arg0, arg1, arg2, arg3) {
|
|
1105
4869
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1106
4870
|
};
|
|
1107
4871
|
|
|
4872
|
+
module.exports.__wbindgen_array_new = function () {
|
|
4873
|
+
const ret = [];
|
|
4874
|
+
return addHeapObject(ret);
|
|
4875
|
+
};
|
|
4876
|
+
|
|
4877
|
+
module.exports.__wbindgen_array_push = function (arg0, arg1) {
|
|
4878
|
+
getObject(arg0).push(takeObject(arg1));
|
|
4879
|
+
};
|
|
4880
|
+
|
|
1108
4881
|
module.exports.__wbindgen_as_number = function (arg0) {
|
|
1109
4882
|
const ret = +getObject(arg0);
|
|
1110
4883
|
return ret;
|
|
1111
4884
|
};
|
|
1112
4885
|
|
|
4886
|
+
module.exports.__wbindgen_bigint_from_i64 = function (arg0) {
|
|
4887
|
+
const ret = arg0;
|
|
4888
|
+
return addHeapObject(ret);
|
|
4889
|
+
};
|
|
4890
|
+
|
|
4891
|
+
module.exports.__wbindgen_bigint_from_u64 = function (arg0) {
|
|
4892
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
4893
|
+
return addHeapObject(ret);
|
|
4894
|
+
};
|
|
4895
|
+
|
|
4896
|
+
module.exports.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
|
4897
|
+
const v = getObject(arg1);
|
|
4898
|
+
const ret = typeof v === "bigint" ? v : undefined;
|
|
4899
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
4900
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
4901
|
+
};
|
|
4902
|
+
|
|
1113
4903
|
module.exports.__wbindgen_boolean_get = function (arg0) {
|
|
1114
4904
|
const v = getObject(arg0);
|
|
1115
4905
|
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
|
@@ -1126,8 +4916,28 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
|
|
|
1126
4916
|
return ret;
|
|
1127
4917
|
};
|
|
1128
4918
|
|
|
1129
|
-
module.exports.
|
|
1130
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
4919
|
+
module.exports.__wbindgen_closure_wrapper193 = function (arg0, arg1, arg2) {
|
|
4920
|
+
const ret = makeMutClosure(arg0, arg1, 7, __wbg_adapter_54);
|
|
4921
|
+
return addHeapObject(ret);
|
|
4922
|
+
};
|
|
4923
|
+
|
|
4924
|
+
module.exports.__wbindgen_closure_wrapper195 = function (arg0, arg1, arg2) {
|
|
4925
|
+
const ret = makeMutClosure(arg0, arg1, 7, __wbg_adapter_57);
|
|
4926
|
+
return addHeapObject(ret);
|
|
4927
|
+
};
|
|
4928
|
+
|
|
4929
|
+
module.exports.__wbindgen_closure_wrapper3849 = function (arg0, arg1, arg2) {
|
|
4930
|
+
const ret = makeMutClosure(arg0, arg1, 293, __wbg_adapter_60);
|
|
4931
|
+
return addHeapObject(ret);
|
|
4932
|
+
};
|
|
4933
|
+
|
|
4934
|
+
module.exports.__wbindgen_closure_wrapper6181 = function (arg0, arg1, arg2) {
|
|
4935
|
+
const ret = makeMutClosure(arg0, arg1, 319, __wbg_adapter_60);
|
|
4936
|
+
return addHeapObject(ret);
|
|
4937
|
+
};
|
|
4938
|
+
|
|
4939
|
+
module.exports.__wbindgen_closure_wrapper6561 = function (arg0, arg1, arg2) {
|
|
4940
|
+
const ret = makeMutClosure(arg0, arg1, 342, __wbg_adapter_54);
|
|
1131
4941
|
return addHeapObject(ret);
|
|
1132
4942
|
};
|
|
1133
4943
|
|
|
@@ -1149,6 +4959,11 @@ module.exports.__wbindgen_in = function (arg0, arg1) {
|
|
|
1149
4959
|
return ret;
|
|
1150
4960
|
};
|
|
1151
4961
|
|
|
4962
|
+
module.exports.__wbindgen_is_bigint = function (arg0) {
|
|
4963
|
+
const ret = typeof getObject(arg0) === "bigint";
|
|
4964
|
+
return ret;
|
|
4965
|
+
};
|
|
4966
|
+
|
|
1152
4967
|
module.exports.__wbindgen_is_function = function (arg0) {
|
|
1153
4968
|
const ret = typeof getObject(arg0) === "function";
|
|
1154
4969
|
return ret;
|
|
@@ -1170,6 +4985,11 @@ module.exports.__wbindgen_is_undefined = function (arg0) {
|
|
|
1170
4985
|
return ret;
|
|
1171
4986
|
};
|
|
1172
4987
|
|
|
4988
|
+
module.exports.__wbindgen_jsval_eq = function (arg0, arg1) {
|
|
4989
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
4990
|
+
return ret;
|
|
4991
|
+
};
|
|
4992
|
+
|
|
1173
4993
|
module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
|
1174
4994
|
const ret = getObject(arg0) == getObject(arg1);
|
|
1175
4995
|
return ret;
|
|
@@ -1187,6 +5007,11 @@ module.exports.__wbindgen_number_get = function (arg0, arg1) {
|
|
|
1187
5007
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1188
5008
|
};
|
|
1189
5009
|
|
|
5010
|
+
module.exports.__wbindgen_number_new = function (arg0) {
|
|
5011
|
+
const ret = arg0;
|
|
5012
|
+
return addHeapObject(ret);
|
|
5013
|
+
};
|
|
5014
|
+
|
|
1190
5015
|
module.exports.__wbindgen_object_clone_ref = function (arg0) {
|
|
1191
5016
|
const ret = getObject(arg0);
|
|
1192
5017
|
return addHeapObject(ret);
|