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