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