@bitwarden/sdk-internal 0.2.0-main.15 → 0.2.0-main.151
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 +975 -69
- package/bitwarden_wasm_internal_bg.js +2376 -586
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +198 -37
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +975 -69
- package/node/bitwarden_wasm_internal.js +2397 -596
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +198 -37
- package/package.json +5 -4
|
@@ -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 getArrayU8FromWasm0(ptr, len) {
|
|
130
|
+
ptr = ptr >>> 0;
|
|
131
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function dropObject(idx) {
|
|
135
|
+
if (idx < 132) return;
|
|
136
|
+
heap[idx] = heap_next;
|
|
137
|
+
heap_next = idx;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function takeObject(idx) {
|
|
141
|
+
const ret = getObject(idx);
|
|
142
|
+
dropObject(idx);
|
|
143
|
+
return ret;
|
|
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__hcab43b83560065d8(
|
|
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,9 @@ function addBorrowedObject(obj) {
|
|
|
249
255
|
* @param {any} error
|
|
250
256
|
* @returns {boolean}
|
|
251
257
|
*/
|
|
252
|
-
export function
|
|
258
|
+
export function isEncryptionSettingsError(error) {
|
|
253
259
|
try {
|
|
254
|
-
const ret = wasm.
|
|
260
|
+
const ret = wasm.isEncryptionSettingsError(addBorrowedObject(error));
|
|
255
261
|
return ret !== 0;
|
|
256
262
|
} finally {
|
|
257
263
|
heap[stack_pointer++] = undefined;
|
|
@@ -262,22 +268,41 @@ export function isCoreError(error) {
|
|
|
262
268
|
* @param {any} error
|
|
263
269
|
* @returns {boolean}
|
|
264
270
|
*/
|
|
265
|
-
export function
|
|
271
|
+
export function isCryptoError(error) {
|
|
266
272
|
try {
|
|
267
|
-
const ret = wasm.
|
|
273
|
+
const ret = wasm.isCryptoError(addBorrowedObject(error));
|
|
268
274
|
return ret !== 0;
|
|
269
275
|
} finally {
|
|
270
276
|
heap[stack_pointer++] = undefined;
|
|
271
277
|
}
|
|
272
278
|
}
|
|
273
279
|
|
|
280
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
281
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
282
|
+
const mem = getDataViewMemory0();
|
|
283
|
+
for (let i = 0; i < array.length; i++) {
|
|
284
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
285
|
+
}
|
|
286
|
+
WASM_VECTOR_LEN = array.length;
|
|
287
|
+
return ptr;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
291
|
+
ptr = ptr >>> 0;
|
|
292
|
+
const mem = getDataViewMemory0();
|
|
293
|
+
const result = [];
|
|
294
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
295
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
296
|
+
}
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
274
299
|
/**
|
|
275
300
|
* @param {any} error
|
|
276
301
|
* @returns {boolean}
|
|
277
302
|
*/
|
|
278
|
-
export function
|
|
303
|
+
export function isExportError(error) {
|
|
279
304
|
try {
|
|
280
|
-
const ret = wasm.
|
|
305
|
+
const ret = wasm.isExportError(addBorrowedObject(error));
|
|
281
306
|
return ret !== 0;
|
|
282
307
|
} finally {
|
|
283
308
|
heap[stack_pointer++] = undefined;
|
|
@@ -288,9 +313,9 @@ export function isKeyGenerationError(error) {
|
|
|
288
313
|
* @param {any} error
|
|
289
314
|
* @returns {boolean}
|
|
290
315
|
*/
|
|
291
|
-
export function
|
|
316
|
+
export function isPasswordError(error) {
|
|
292
317
|
try {
|
|
293
|
-
const ret = wasm.
|
|
318
|
+
const ret = wasm.isPasswordError(addBorrowedObject(error));
|
|
294
319
|
return ret !== 0;
|
|
295
320
|
} finally {
|
|
296
321
|
heap[stack_pointer++] = undefined;
|
|
@@ -298,248 +323,1896 @@ export function isTestError(error) {
|
|
|
298
323
|
}
|
|
299
324
|
|
|
300
325
|
/**
|
|
301
|
-
* @param {
|
|
302
|
-
* @returns {
|
|
326
|
+
* @param {any} error
|
|
327
|
+
* @returns {boolean}
|
|
303
328
|
*/
|
|
304
|
-
export function
|
|
329
|
+
export function isPassphraseError(error) {
|
|
305
330
|
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);
|
|
331
|
+
const ret = wasm.isPassphraseError(addBorrowedObject(error));
|
|
332
|
+
return ret !== 0;
|
|
315
333
|
} finally {
|
|
316
|
-
|
|
334
|
+
heap[stack_pointer++] = undefined;
|
|
317
335
|
}
|
|
318
336
|
}
|
|
319
337
|
|
|
320
|
-
function
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
338
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
339
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
340
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
341
|
+
WASM_VECTOR_LEN = arg.length;
|
|
342
|
+
return ptr;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function _assertClass(instance, klass) {
|
|
346
|
+
if (!(instance instanceof klass)) {
|
|
347
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
325
348
|
}
|
|
326
349
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
350
|
+
/**
|
|
351
|
+
* @param {any} error
|
|
352
|
+
* @returns {boolean}
|
|
353
|
+
*/
|
|
354
|
+
export function isDeserializeError(error) {
|
|
355
|
+
try {
|
|
356
|
+
const ret = wasm.isDeserializeError(addBorrowedObject(error));
|
|
357
|
+
return ret !== 0;
|
|
358
|
+
} finally {
|
|
359
|
+
heap[stack_pointer++] = undefined;
|
|
360
|
+
}
|
|
334
361
|
}
|
|
335
362
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
363
|
+
/**
|
|
364
|
+
* @param {any} error
|
|
365
|
+
* @returns {boolean}
|
|
366
|
+
*/
|
|
367
|
+
export function isSshKeyExportError(error) {
|
|
368
|
+
try {
|
|
369
|
+
const ret = wasm.isSshKeyExportError(addBorrowedObject(error));
|
|
370
|
+
return ret !== 0;
|
|
371
|
+
} finally {
|
|
372
|
+
heap[stack_pointer++] = undefined;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
350
375
|
|
|
351
|
-
|
|
376
|
+
/**
|
|
377
|
+
* @param {any} error
|
|
378
|
+
* @returns {boolean}
|
|
379
|
+
*/
|
|
380
|
+
export function isSshKeyImportError(error) {
|
|
381
|
+
try {
|
|
382
|
+
const ret = wasm.isSshKeyImportError(addBorrowedObject(error));
|
|
383
|
+
return ret !== 0;
|
|
384
|
+
} finally {
|
|
385
|
+
heap[stack_pointer++] = undefined;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @param {any} error
|
|
391
|
+
* @returns {boolean}
|
|
392
|
+
*/
|
|
393
|
+
export function isKeyGenerationError(error) {
|
|
394
|
+
try {
|
|
395
|
+
const ret = wasm.isKeyGenerationError(addBorrowedObject(error));
|
|
396
|
+
return ret !== 0;
|
|
397
|
+
} finally {
|
|
398
|
+
heap[stack_pointer++] = undefined;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @param {any} error
|
|
404
|
+
* @returns {boolean}
|
|
405
|
+
*/
|
|
406
|
+
export function isDecryptError(error) {
|
|
407
|
+
try {
|
|
408
|
+
const ret = wasm.isDecryptError(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 isEncryptError(error) {
|
|
420
|
+
try {
|
|
421
|
+
const ret = wasm.isEncryptError(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 isTotpError(error) {
|
|
433
|
+
try {
|
|
434
|
+
const ret = wasm.isTotpError(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 isCipherError(error) {
|
|
446
|
+
try {
|
|
447
|
+
const ret = wasm.isCipherError(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 isDecryptFileError(error) {
|
|
459
|
+
try {
|
|
460
|
+
const ret = wasm.isDecryptFileError(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 isEncryptFileError(error) {
|
|
472
|
+
try {
|
|
473
|
+
const ret = wasm.isEncryptFileError(addBorrowedObject(error));
|
|
474
|
+
return ret !== 0;
|
|
475
|
+
} finally {
|
|
476
|
+
heap[stack_pointer++] = undefined;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @param {LogLevel} level
|
|
482
|
+
*/
|
|
483
|
+
export function set_log_level(level) {
|
|
484
|
+
wasm.set_log_level(level);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @param {LogLevel | null} [log_level]
|
|
489
|
+
*/
|
|
490
|
+
export function init_sdk(log_level) {
|
|
491
|
+
wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Generate a new SSH key pair
|
|
496
|
+
*
|
|
497
|
+
* # Arguments
|
|
498
|
+
* - `key_algorithm` - The algorithm to use for the key pair
|
|
499
|
+
*
|
|
500
|
+
* # Returns
|
|
501
|
+
* - `Ok(SshKey)` if the key was successfully generated
|
|
502
|
+
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
503
|
+
* @param {KeyAlgorithm} key_algorithm
|
|
504
|
+
* @returns {SshKeyView}
|
|
505
|
+
*/
|
|
506
|
+
export function generate_ssh_key(key_algorithm) {
|
|
507
|
+
try {
|
|
508
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
509
|
+
wasm.generate_ssh_key(retptr, addHeapObject(key_algorithm));
|
|
510
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
511
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
512
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
513
|
+
if (r2) {
|
|
514
|
+
throw takeObject(r1);
|
|
515
|
+
}
|
|
516
|
+
return takeObject(r0);
|
|
517
|
+
} finally {
|
|
518
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
|
|
524
|
+
* to an OpenSSH private key with public key and fingerprint
|
|
525
|
+
*
|
|
526
|
+
* # Arguments
|
|
527
|
+
* - `imported_key` - The private key to convert
|
|
528
|
+
* - `password` - The password to use for decrypting the key
|
|
529
|
+
*
|
|
530
|
+
* # Returns
|
|
531
|
+
* - `Ok(SshKey)` if the key was successfully coneverted
|
|
532
|
+
* - `Err(PasswordRequired)` if the key is encrypted and no password was provided
|
|
533
|
+
* - `Err(WrongPassword)` if the password provided is incorrect
|
|
534
|
+
* - `Err(ParsingError)` if the key could not be parsed
|
|
535
|
+
* - `Err(UnsupportedKeyType)` if the key type is not supported
|
|
536
|
+
* @param {string} imported_key
|
|
537
|
+
* @param {string | null} [password]
|
|
538
|
+
* @returns {SshKeyView}
|
|
539
|
+
*/
|
|
540
|
+
export function import_ssh_key(imported_key, password) {
|
|
541
|
+
try {
|
|
542
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
543
|
+
const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
544
|
+
const len0 = WASM_VECTOR_LEN;
|
|
545
|
+
var ptr1 = isLikeNone(password)
|
|
546
|
+
? 0
|
|
547
|
+
: passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
548
|
+
var len1 = WASM_VECTOR_LEN;
|
|
549
|
+
wasm.import_ssh_key(retptr, ptr0, len0, ptr1, len1);
|
|
550
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
551
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
552
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
553
|
+
if (r2) {
|
|
554
|
+
throw takeObject(r1);
|
|
555
|
+
}
|
|
556
|
+
return takeObject(r0);
|
|
557
|
+
} finally {
|
|
558
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* @param {any} error
|
|
564
|
+
* @returns {boolean}
|
|
565
|
+
*/
|
|
566
|
+
export function isTestError(error) {
|
|
567
|
+
try {
|
|
568
|
+
const ret = wasm.isTestError(addBorrowedObject(error));
|
|
569
|
+
return ret !== 0;
|
|
570
|
+
} finally {
|
|
571
|
+
heap[stack_pointer++] = undefined;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function __wbg_adapter_50(arg0, arg1, arg2) {
|
|
576
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h365c00e76c805d42(
|
|
577
|
+
arg0,
|
|
578
|
+
arg1,
|
|
579
|
+
addHeapObject(arg2),
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
function __wbg_adapter_230(arg0, arg1, arg2, arg3) {
|
|
584
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h7df9ebaef0b1c102(
|
|
585
|
+
arg0,
|
|
586
|
+
arg1,
|
|
587
|
+
addHeapObject(arg2),
|
|
588
|
+
addHeapObject(arg3),
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* @enum {300 | 301 | 302 | 303 | 304 | 305}
|
|
594
|
+
*/
|
|
595
|
+
export const CardLinkedIdType = Object.freeze({
|
|
596
|
+
CardholderName: 300,
|
|
597
|
+
300: "CardholderName",
|
|
598
|
+
ExpMonth: 301,
|
|
599
|
+
301: "ExpMonth",
|
|
600
|
+
ExpYear: 302,
|
|
601
|
+
302: "ExpYear",
|
|
602
|
+
Code: 303,
|
|
603
|
+
303: "Code",
|
|
604
|
+
Brand: 304,
|
|
605
|
+
304: "Brand",
|
|
606
|
+
Number: 305,
|
|
607
|
+
305: "Number",
|
|
608
|
+
});
|
|
609
|
+
/**
|
|
610
|
+
* @enum {0 | 1}
|
|
611
|
+
*/
|
|
612
|
+
export const CipherRepromptType = Object.freeze({
|
|
613
|
+
None: 0,
|
|
614
|
+
0: "None",
|
|
615
|
+
Password: 1,
|
|
616
|
+
1: "Password",
|
|
617
|
+
});
|
|
618
|
+
/**
|
|
619
|
+
* @enum {1 | 2 | 3 | 4 | 5}
|
|
620
|
+
*/
|
|
621
|
+
export const CipherType = Object.freeze({
|
|
622
|
+
Login: 1,
|
|
623
|
+
1: "Login",
|
|
624
|
+
SecureNote: 2,
|
|
625
|
+
2: "SecureNote",
|
|
626
|
+
Card: 3,
|
|
627
|
+
3: "Card",
|
|
628
|
+
Identity: 4,
|
|
629
|
+
4: "Identity",
|
|
630
|
+
SshKey: 5,
|
|
631
|
+
5: "SshKey",
|
|
632
|
+
});
|
|
633
|
+
/**
|
|
634
|
+
* @enum {0 | 1 | 2 | 3}
|
|
635
|
+
*/
|
|
636
|
+
export const FieldType = Object.freeze({
|
|
637
|
+
Text: 0,
|
|
638
|
+
0: "Text",
|
|
639
|
+
Hidden: 1,
|
|
640
|
+
1: "Hidden",
|
|
641
|
+
Boolean: 2,
|
|
642
|
+
2: "Boolean",
|
|
643
|
+
Linked: 3,
|
|
644
|
+
3: "Linked",
|
|
645
|
+
});
|
|
646
|
+
/**
|
|
647
|
+
* @enum {400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418}
|
|
648
|
+
*/
|
|
649
|
+
export const IdentityLinkedIdType = Object.freeze({
|
|
650
|
+
Title: 400,
|
|
651
|
+
400: "Title",
|
|
652
|
+
MiddleName: 401,
|
|
653
|
+
401: "MiddleName",
|
|
654
|
+
Address1: 402,
|
|
655
|
+
402: "Address1",
|
|
656
|
+
Address2: 403,
|
|
657
|
+
403: "Address2",
|
|
658
|
+
Address3: 404,
|
|
659
|
+
404: "Address3",
|
|
660
|
+
City: 405,
|
|
661
|
+
405: "City",
|
|
662
|
+
State: 406,
|
|
663
|
+
406: "State",
|
|
664
|
+
PostalCode: 407,
|
|
665
|
+
407: "PostalCode",
|
|
666
|
+
Country: 408,
|
|
667
|
+
408: "Country",
|
|
668
|
+
Company: 409,
|
|
669
|
+
409: "Company",
|
|
670
|
+
Email: 410,
|
|
671
|
+
410: "Email",
|
|
672
|
+
Phone: 411,
|
|
673
|
+
411: "Phone",
|
|
674
|
+
Ssn: 412,
|
|
675
|
+
412: "Ssn",
|
|
676
|
+
Username: 413,
|
|
677
|
+
413: "Username",
|
|
678
|
+
PassportNumber: 414,
|
|
679
|
+
414: "PassportNumber",
|
|
680
|
+
LicenseNumber: 415,
|
|
681
|
+
415: "LicenseNumber",
|
|
682
|
+
FirstName: 416,
|
|
683
|
+
416: "FirstName",
|
|
684
|
+
LastName: 417,
|
|
685
|
+
417: "LastName",
|
|
686
|
+
FullName: 418,
|
|
687
|
+
418: "FullName",
|
|
688
|
+
});
|
|
689
|
+
/**
|
|
690
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
691
|
+
*/
|
|
692
|
+
export const LogLevel = Object.freeze({
|
|
693
|
+
Trace: 0,
|
|
694
|
+
0: "Trace",
|
|
695
|
+
Debug: 1,
|
|
696
|
+
1: "Debug",
|
|
697
|
+
Info: 2,
|
|
698
|
+
2: "Info",
|
|
699
|
+
Warn: 3,
|
|
700
|
+
3: "Warn",
|
|
701
|
+
Error: 4,
|
|
702
|
+
4: "Error",
|
|
703
|
+
});
|
|
704
|
+
/**
|
|
705
|
+
* @enum {100 | 101}
|
|
706
|
+
*/
|
|
707
|
+
export const LoginLinkedIdType = Object.freeze({
|
|
708
|
+
Username: 100,
|
|
709
|
+
100: "Username",
|
|
710
|
+
Password: 101,
|
|
711
|
+
101: "Password",
|
|
712
|
+
});
|
|
713
|
+
/**
|
|
714
|
+
* @enum {0}
|
|
715
|
+
*/
|
|
716
|
+
export const SecureNoteType = Object.freeze({
|
|
717
|
+
Generic: 0,
|
|
718
|
+
0: "Generic",
|
|
719
|
+
});
|
|
720
|
+
/**
|
|
721
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
722
|
+
*/
|
|
723
|
+
export const UriMatchType = Object.freeze({
|
|
724
|
+
Domain: 0,
|
|
725
|
+
0: "Domain",
|
|
726
|
+
Host: 1,
|
|
727
|
+
1: "Host",
|
|
728
|
+
StartsWith: 2,
|
|
729
|
+
2: "StartsWith",
|
|
730
|
+
Exact: 3,
|
|
731
|
+
3: "Exact",
|
|
732
|
+
RegularExpression: 4,
|
|
733
|
+
4: "RegularExpression",
|
|
734
|
+
Never: 5,
|
|
735
|
+
5: "Never",
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
739
|
+
|
|
740
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
741
|
+
|
|
742
|
+
const AttachmentsClientFinalization =
|
|
743
|
+
typeof FinalizationRegistry === "undefined"
|
|
744
|
+
? { register: () => {}, unregister: () => {} }
|
|
745
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
|
|
746
|
+
|
|
747
|
+
export class AttachmentsClient {
|
|
748
|
+
static __wrap(ptr) {
|
|
749
|
+
ptr = ptr >>> 0;
|
|
750
|
+
const obj = Object.create(AttachmentsClient.prototype);
|
|
751
|
+
obj.__wbg_ptr = ptr;
|
|
752
|
+
AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
753
|
+
return obj;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
__destroy_into_raw() {
|
|
757
|
+
const ptr = this.__wbg_ptr;
|
|
758
|
+
this.__wbg_ptr = 0;
|
|
759
|
+
AttachmentsClientFinalization.unregister(this);
|
|
760
|
+
return ptr;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
free() {
|
|
764
|
+
const ptr = this.__destroy_into_raw();
|
|
765
|
+
wasm.__wbg_attachmentsclient_free(ptr, 0);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Decrypts an attachment's encrypted content
|
|
769
|
+
* @param {Cipher} cipher
|
|
770
|
+
* @param {Attachment} attachment
|
|
771
|
+
* @param {Uint8Array} encrypted_buffer
|
|
772
|
+
* @returns {Uint8Array}
|
|
773
|
+
*/
|
|
774
|
+
decrypt_buffer(cipher, attachment, encrypted_buffer) {
|
|
775
|
+
try {
|
|
776
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
777
|
+
const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
|
|
778
|
+
const len0 = WASM_VECTOR_LEN;
|
|
779
|
+
wasm.attachmentsclient_decrypt_buffer(
|
|
780
|
+
retptr,
|
|
781
|
+
this.__wbg_ptr,
|
|
782
|
+
addHeapObject(cipher),
|
|
783
|
+
addHeapObject(attachment),
|
|
784
|
+
ptr0,
|
|
785
|
+
len0,
|
|
786
|
+
);
|
|
787
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
788
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
789
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
790
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
791
|
+
if (r3) {
|
|
792
|
+
throw takeObject(r2);
|
|
793
|
+
}
|
|
794
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
795
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
796
|
+
return v2;
|
|
797
|
+
} finally {
|
|
798
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
352
802
|
|
|
353
803
|
const BitwardenClientFinalization =
|
|
354
804
|
typeof FinalizationRegistry === "undefined"
|
|
355
805
|
? { register: () => {}, unregister: () => {} }
|
|
356
|
-
: new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
|
|
357
|
-
|
|
358
|
-
export class BitwardenClient {
|
|
806
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
|
|
807
|
+
|
|
808
|
+
export class BitwardenClient {
|
|
809
|
+
__destroy_into_raw() {
|
|
810
|
+
const ptr = this.__wbg_ptr;
|
|
811
|
+
this.__wbg_ptr = 0;
|
|
812
|
+
BitwardenClientFinalization.unregister(this);
|
|
813
|
+
return ptr;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
free() {
|
|
817
|
+
const ptr = this.__destroy_into_raw();
|
|
818
|
+
wasm.__wbg_bitwardenclient_free(ptr, 0);
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* @param {ClientSettings | null} [settings]
|
|
822
|
+
*/
|
|
823
|
+
constructor(settings) {
|
|
824
|
+
const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addHeapObject(settings));
|
|
825
|
+
this.__wbg_ptr = ret >>> 0;
|
|
826
|
+
BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
|
|
827
|
+
return this;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Test method, echoes back the input
|
|
831
|
+
* @param {string} msg
|
|
832
|
+
* @returns {string}
|
|
833
|
+
*/
|
|
834
|
+
echo(msg) {
|
|
835
|
+
let deferred2_0;
|
|
836
|
+
let deferred2_1;
|
|
837
|
+
try {
|
|
838
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
839
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
840
|
+
const len0 = WASM_VECTOR_LEN;
|
|
841
|
+
wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
|
|
842
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
843
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
844
|
+
deferred2_0 = r0;
|
|
845
|
+
deferred2_1 = r1;
|
|
846
|
+
return getStringFromWasm0(r0, r1);
|
|
847
|
+
} finally {
|
|
848
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
849
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* @returns {string}
|
|
854
|
+
*/
|
|
855
|
+
version() {
|
|
856
|
+
let deferred1_0;
|
|
857
|
+
let deferred1_1;
|
|
858
|
+
try {
|
|
859
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
860
|
+
wasm.bitwardenclient_version(retptr, this.__wbg_ptr);
|
|
861
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
862
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
863
|
+
deferred1_0 = r0;
|
|
864
|
+
deferred1_1 = r1;
|
|
865
|
+
return getStringFromWasm0(r0, r1);
|
|
866
|
+
} finally {
|
|
867
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
868
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* @param {string} msg
|
|
873
|
+
*/
|
|
874
|
+
throw(msg) {
|
|
875
|
+
try {
|
|
876
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
877
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
878
|
+
const len0 = WASM_VECTOR_LEN;
|
|
879
|
+
wasm.bitwardenclient_throw(retptr, this.__wbg_ptr, ptr0, len0);
|
|
880
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
881
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
882
|
+
if (r1) {
|
|
883
|
+
throw takeObject(r0);
|
|
884
|
+
}
|
|
885
|
+
} finally {
|
|
886
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Test method, calls http endpoint
|
|
891
|
+
* @param {string} url
|
|
892
|
+
* @returns {Promise<string>}
|
|
893
|
+
*/
|
|
894
|
+
http_get(url) {
|
|
895
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
896
|
+
const len0 = WASM_VECTOR_LEN;
|
|
897
|
+
const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
|
|
898
|
+
return takeObject(ret);
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* @returns {CryptoClient}
|
|
902
|
+
*/
|
|
903
|
+
crypto() {
|
|
904
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
905
|
+
return CryptoClient.__wrap(ret);
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* @returns {VaultClient}
|
|
909
|
+
*/
|
|
910
|
+
vault() {
|
|
911
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
912
|
+
return VaultClient.__wrap(ret);
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Constructs a specific client for generating passwords and passphrases
|
|
916
|
+
* @returns {GeneratorClient}
|
|
917
|
+
*/
|
|
918
|
+
generator() {
|
|
919
|
+
const ret = wasm.bitwardenclient_generator(this.__wbg_ptr);
|
|
920
|
+
return GeneratorClient.__wrap(ret);
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @returns {ExporterClient}
|
|
924
|
+
*/
|
|
925
|
+
exporters() {
|
|
926
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
927
|
+
return ExporterClient.__wrap(ret);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const CiphersClientFinalization =
|
|
932
|
+
typeof FinalizationRegistry === "undefined"
|
|
933
|
+
? { register: () => {}, unregister: () => {} }
|
|
934
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
|
|
935
|
+
|
|
936
|
+
export class CiphersClient {
|
|
937
|
+
static __wrap(ptr) {
|
|
938
|
+
ptr = ptr >>> 0;
|
|
939
|
+
const obj = Object.create(CiphersClient.prototype);
|
|
940
|
+
obj.__wbg_ptr = ptr;
|
|
941
|
+
CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
942
|
+
return obj;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
__destroy_into_raw() {
|
|
946
|
+
const ptr = this.__wbg_ptr;
|
|
947
|
+
this.__wbg_ptr = 0;
|
|
948
|
+
CiphersClientFinalization.unregister(this);
|
|
949
|
+
return ptr;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
free() {
|
|
953
|
+
const ptr = this.__destroy_into_raw();
|
|
954
|
+
wasm.__wbg_ciphersclient_free(ptr, 0);
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Encrypt cipher
|
|
958
|
+
*
|
|
959
|
+
* # Arguments
|
|
960
|
+
* - `cipher_view` - The decrypted cipher to encrypt
|
|
961
|
+
*
|
|
962
|
+
* # Returns
|
|
963
|
+
* - `Ok(Cipher)` containing the encrypted cipher
|
|
964
|
+
* - `Err(EncryptError)` if encryption fails
|
|
965
|
+
* @param {CipherView} cipher_view
|
|
966
|
+
* @returns {Cipher}
|
|
967
|
+
*/
|
|
968
|
+
encrypt(cipher_view) {
|
|
969
|
+
try {
|
|
970
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
971
|
+
wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
|
|
972
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
973
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
974
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
975
|
+
if (r2) {
|
|
976
|
+
throw takeObject(r1);
|
|
977
|
+
}
|
|
978
|
+
return takeObject(r0);
|
|
979
|
+
} finally {
|
|
980
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Decrypt cipher
|
|
985
|
+
*
|
|
986
|
+
* # Arguments
|
|
987
|
+
* - `cipher` - The encrypted cipher to decrypt
|
|
988
|
+
*
|
|
989
|
+
* # Returns
|
|
990
|
+
* - `Ok(CipherView)` containing the decrypted cipher
|
|
991
|
+
* - `Err(DecryptError)` if decryption fails
|
|
992
|
+
* @param {Cipher} cipher
|
|
993
|
+
* @returns {CipherView}
|
|
994
|
+
*/
|
|
995
|
+
decrypt(cipher) {
|
|
996
|
+
try {
|
|
997
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
998
|
+
wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
|
|
999
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1000
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1001
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1002
|
+
if (r2) {
|
|
1003
|
+
throw takeObject(r1);
|
|
1004
|
+
}
|
|
1005
|
+
return takeObject(r0);
|
|
1006
|
+
} finally {
|
|
1007
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Decrypt list of ciphers
|
|
1012
|
+
*
|
|
1013
|
+
* # Arguments
|
|
1014
|
+
* - `ciphers` - The list of encrypted ciphers to decrypt
|
|
1015
|
+
*
|
|
1016
|
+
* # Returns
|
|
1017
|
+
* - `Ok(Vec<CipherListView>)` containing the decrypted ciphers
|
|
1018
|
+
* - `Err(DecryptError)` if decryption fails
|
|
1019
|
+
* @param {Cipher[]} ciphers
|
|
1020
|
+
* @returns {CipherListView[]}
|
|
1021
|
+
*/
|
|
1022
|
+
decrypt_list(ciphers) {
|
|
1023
|
+
try {
|
|
1024
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1025
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1026
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1027
|
+
wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1028
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1029
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1030
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1031
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1032
|
+
if (r3) {
|
|
1033
|
+
throw takeObject(r2);
|
|
1034
|
+
}
|
|
1035
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1036
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1037
|
+
return v2;
|
|
1038
|
+
} finally {
|
|
1039
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Decrypt FIDO2 credentials
|
|
1044
|
+
*
|
|
1045
|
+
* # Arguments
|
|
1046
|
+
* - `cipher_view` - Cipher to encrypt containing the FIDO2 credential
|
|
1047
|
+
*
|
|
1048
|
+
* # Returns
|
|
1049
|
+
* - `Ok(Vec<Fido2CredentialView>)` containing the decrypted FIDO2 credentials
|
|
1050
|
+
* - `Err(DecryptError)` if decryption fails
|
|
1051
|
+
* @param {CipherView} cipher_view
|
|
1052
|
+
* @returns {Fido2CredentialView[]}
|
|
1053
|
+
*/
|
|
1054
|
+
decrypt_fido2_credentials(cipher_view) {
|
|
1055
|
+
try {
|
|
1056
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1057
|
+
wasm.ciphersclient_decrypt_fido2_credentials(
|
|
1058
|
+
retptr,
|
|
1059
|
+
this.__wbg_ptr,
|
|
1060
|
+
addHeapObject(cipher_view),
|
|
1061
|
+
);
|
|
1062
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1063
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1064
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1065
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1066
|
+
if (r3) {
|
|
1067
|
+
throw takeObject(r2);
|
|
1068
|
+
}
|
|
1069
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1070
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1071
|
+
return v1;
|
|
1072
|
+
} finally {
|
|
1073
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Decrypt key
|
|
1078
|
+
*
|
|
1079
|
+
* This method is a temporary solution to allow typescript client access to decrypted key
|
|
1080
|
+
* values, particularly for FIDO2 credentials.
|
|
1081
|
+
*
|
|
1082
|
+
* # Arguments
|
|
1083
|
+
* - `cipher_view` - Decrypted cipher containing the key
|
|
1084
|
+
*
|
|
1085
|
+
* # Returns
|
|
1086
|
+
* - `Ok(String)` containing the decrypted key
|
|
1087
|
+
* - `Err(CipherError)`
|
|
1088
|
+
* @param {CipherView} cipher_view
|
|
1089
|
+
* @returns {string}
|
|
1090
|
+
*/
|
|
1091
|
+
decrypt_fido2_private_key(cipher_view) {
|
|
1092
|
+
let deferred2_0;
|
|
1093
|
+
let deferred2_1;
|
|
1094
|
+
try {
|
|
1095
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1096
|
+
wasm.ciphersclient_decrypt_fido2_private_key(
|
|
1097
|
+
retptr,
|
|
1098
|
+
this.__wbg_ptr,
|
|
1099
|
+
addHeapObject(cipher_view),
|
|
1100
|
+
);
|
|
1101
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1102
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1103
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1104
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1105
|
+
var ptr1 = r0;
|
|
1106
|
+
var len1 = r1;
|
|
1107
|
+
if (r3) {
|
|
1108
|
+
ptr1 = 0;
|
|
1109
|
+
len1 = 0;
|
|
1110
|
+
throw takeObject(r2);
|
|
1111
|
+
}
|
|
1112
|
+
deferred2_0 = ptr1;
|
|
1113
|
+
deferred2_1 = len1;
|
|
1114
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1115
|
+
} finally {
|
|
1116
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1117
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
const CryptoClientFinalization =
|
|
1123
|
+
typeof FinalizationRegistry === "undefined"
|
|
1124
|
+
? { register: () => {}, unregister: () => {} }
|
|
1125
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
|
|
1126
|
+
|
|
1127
|
+
export class CryptoClient {
|
|
1128
|
+
static __wrap(ptr) {
|
|
1129
|
+
ptr = ptr >>> 0;
|
|
1130
|
+
const obj = Object.create(CryptoClient.prototype);
|
|
1131
|
+
obj.__wbg_ptr = ptr;
|
|
1132
|
+
CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1133
|
+
return obj;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
__destroy_into_raw() {
|
|
1137
|
+
const ptr = this.__wbg_ptr;
|
|
1138
|
+
this.__wbg_ptr = 0;
|
|
1139
|
+
CryptoClientFinalization.unregister(this);
|
|
1140
|
+
return ptr;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
free() {
|
|
1144
|
+
const ptr = this.__destroy_into_raw();
|
|
1145
|
+
wasm.__wbg_cryptoclient_free(ptr, 0);
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Initialization method for the user crypto. Needs to be called before any other crypto
|
|
1149
|
+
* operations.
|
|
1150
|
+
* @param {InitUserCryptoRequest} req
|
|
1151
|
+
* @returns {Promise<void>}
|
|
1152
|
+
*/
|
|
1153
|
+
initialize_user_crypto(req) {
|
|
1154
|
+
const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
|
|
1155
|
+
return takeObject(ret);
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Initialization method for the organization crypto. Needs to be called after
|
|
1159
|
+
* `initialize_user_crypto` but before any other crypto operations.
|
|
1160
|
+
* @param {InitOrgCryptoRequest} req
|
|
1161
|
+
* @returns {Promise<void>}
|
|
1162
|
+
*/
|
|
1163
|
+
initialize_org_crypto(req) {
|
|
1164
|
+
const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, addHeapObject(req));
|
|
1165
|
+
return takeObject(ret);
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* Generates a new key pair and encrypts the private key with the provided user key.
|
|
1169
|
+
* Crypto initialization not required.
|
|
1170
|
+
* @param {string} user_key
|
|
1171
|
+
* @returns {MakeKeyPairResponse}
|
|
1172
|
+
*/
|
|
1173
|
+
make_key_pair(user_key) {
|
|
1174
|
+
try {
|
|
1175
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1176
|
+
const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1177
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1178
|
+
wasm.cryptoclient_make_key_pair(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1179
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1180
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1181
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1182
|
+
if (r2) {
|
|
1183
|
+
throw takeObject(r1);
|
|
1184
|
+
}
|
|
1185
|
+
return takeObject(r0);
|
|
1186
|
+
} finally {
|
|
1187
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Verifies a user's asymmetric keys by decrypting the private key with the provided user
|
|
1192
|
+
* key. Returns if the private key is decryptable and if it is a valid matching key.
|
|
1193
|
+
* Crypto initialization not required.
|
|
1194
|
+
* @param {VerifyAsymmetricKeysRequest} request
|
|
1195
|
+
* @returns {VerifyAsymmetricKeysResponse}
|
|
1196
|
+
*/
|
|
1197
|
+
verify_asymmetric_keys(request) {
|
|
1198
|
+
try {
|
|
1199
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1200
|
+
wasm.cryptoclient_verify_asymmetric_keys(retptr, this.__wbg_ptr, addHeapObject(request));
|
|
1201
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1202
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1203
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1204
|
+
if (r2) {
|
|
1205
|
+
throw takeObject(r1);
|
|
1206
|
+
}
|
|
1207
|
+
return takeObject(r0);
|
|
1208
|
+
} finally {
|
|
1209
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
const ExporterClientFinalization =
|
|
1215
|
+
typeof FinalizationRegistry === "undefined"
|
|
1216
|
+
? { register: () => {}, unregister: () => {} }
|
|
1217
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
|
|
1218
|
+
|
|
1219
|
+
export class ExporterClient {
|
|
1220
|
+
static __wrap(ptr) {
|
|
1221
|
+
ptr = ptr >>> 0;
|
|
1222
|
+
const obj = Object.create(ExporterClient.prototype);
|
|
1223
|
+
obj.__wbg_ptr = ptr;
|
|
1224
|
+
ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1225
|
+
return obj;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
__destroy_into_raw() {
|
|
1229
|
+
const ptr = this.__wbg_ptr;
|
|
1230
|
+
this.__wbg_ptr = 0;
|
|
1231
|
+
ExporterClientFinalization.unregister(this);
|
|
1232
|
+
return ptr;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
free() {
|
|
1236
|
+
const ptr = this.__destroy_into_raw();
|
|
1237
|
+
wasm.__wbg_exporterclient_free(ptr, 0);
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* @param {Folder[]} folders
|
|
1241
|
+
* @param {Cipher[]} ciphers
|
|
1242
|
+
* @param {ExportFormat} format
|
|
1243
|
+
* @returns {string}
|
|
1244
|
+
*/
|
|
1245
|
+
export_vault(folders, ciphers, format) {
|
|
1246
|
+
let deferred4_0;
|
|
1247
|
+
let deferred4_1;
|
|
1248
|
+
try {
|
|
1249
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1250
|
+
const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
|
|
1251
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1252
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1253
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1254
|
+
wasm.exporterclient_export_vault(
|
|
1255
|
+
retptr,
|
|
1256
|
+
this.__wbg_ptr,
|
|
1257
|
+
ptr0,
|
|
1258
|
+
len0,
|
|
1259
|
+
ptr1,
|
|
1260
|
+
len1,
|
|
1261
|
+
addHeapObject(format),
|
|
1262
|
+
);
|
|
1263
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1264
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1265
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1266
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1267
|
+
var ptr3 = r0;
|
|
1268
|
+
var len3 = r1;
|
|
1269
|
+
if (r3) {
|
|
1270
|
+
ptr3 = 0;
|
|
1271
|
+
len3 = 0;
|
|
1272
|
+
throw takeObject(r2);
|
|
1273
|
+
}
|
|
1274
|
+
deferred4_0 = ptr3;
|
|
1275
|
+
deferred4_1 = len3;
|
|
1276
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1277
|
+
} finally {
|
|
1278
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1279
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* @param {Collection[]} collections
|
|
1284
|
+
* @param {Cipher[]} ciphers
|
|
1285
|
+
* @param {ExportFormat} format
|
|
1286
|
+
* @returns {string}
|
|
1287
|
+
*/
|
|
1288
|
+
export_organization_vault(collections, ciphers, format) {
|
|
1289
|
+
let deferred4_0;
|
|
1290
|
+
let deferred4_1;
|
|
1291
|
+
try {
|
|
1292
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1293
|
+
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
1294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1295
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1296
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1297
|
+
wasm.exporterclient_export_organization_vault(
|
|
1298
|
+
retptr,
|
|
1299
|
+
this.__wbg_ptr,
|
|
1300
|
+
ptr0,
|
|
1301
|
+
len0,
|
|
1302
|
+
ptr1,
|
|
1303
|
+
len1,
|
|
1304
|
+
addHeapObject(format),
|
|
1305
|
+
);
|
|
1306
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1307
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1308
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1309
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1310
|
+
var ptr3 = r0;
|
|
1311
|
+
var len3 = r1;
|
|
1312
|
+
if (r3) {
|
|
1313
|
+
ptr3 = 0;
|
|
1314
|
+
len3 = 0;
|
|
1315
|
+
throw takeObject(r2);
|
|
1316
|
+
}
|
|
1317
|
+
deferred4_0 = ptr3;
|
|
1318
|
+
deferred4_1 = len3;
|
|
1319
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1320
|
+
} finally {
|
|
1321
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1322
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Credential Exchange Format (CXF)
|
|
1327
|
+
*
|
|
1328
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1329
|
+
*
|
|
1330
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1331
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1332
|
+
* @param {Account} account
|
|
1333
|
+
* @param {Cipher[]} ciphers
|
|
1334
|
+
* @returns {string}
|
|
1335
|
+
*/
|
|
1336
|
+
export_cxf(account, ciphers) {
|
|
1337
|
+
let deferred3_0;
|
|
1338
|
+
let deferred3_1;
|
|
1339
|
+
try {
|
|
1340
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1341
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1342
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1343
|
+
wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
|
|
1344
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1345
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1346
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1347
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1348
|
+
var ptr2 = r0;
|
|
1349
|
+
var len2 = r1;
|
|
1350
|
+
if (r3) {
|
|
1351
|
+
ptr2 = 0;
|
|
1352
|
+
len2 = 0;
|
|
1353
|
+
throw takeObject(r2);
|
|
1354
|
+
}
|
|
1355
|
+
deferred3_0 = ptr2;
|
|
1356
|
+
deferred3_1 = len2;
|
|
1357
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1358
|
+
} finally {
|
|
1359
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1360
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Credential Exchange Format (CXF)
|
|
1365
|
+
*
|
|
1366
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1367
|
+
*
|
|
1368
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1369
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1370
|
+
* @param {string} payload
|
|
1371
|
+
* @returns {Cipher[]}
|
|
1372
|
+
*/
|
|
1373
|
+
import_cxf(payload) {
|
|
1374
|
+
try {
|
|
1375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1376
|
+
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1377
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1378
|
+
wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1379
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1380
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1381
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1382
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1383
|
+
if (r3) {
|
|
1384
|
+
throw takeObject(r2);
|
|
1385
|
+
}
|
|
1386
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1387
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1388
|
+
return v2;
|
|
1389
|
+
} finally {
|
|
1390
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
const FoldersClientFinalization =
|
|
1396
|
+
typeof FinalizationRegistry === "undefined"
|
|
1397
|
+
? { register: () => {}, unregister: () => {} }
|
|
1398
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
|
|
1399
|
+
|
|
1400
|
+
export class FoldersClient {
|
|
1401
|
+
static __wrap(ptr) {
|
|
1402
|
+
ptr = ptr >>> 0;
|
|
1403
|
+
const obj = Object.create(FoldersClient.prototype);
|
|
1404
|
+
obj.__wbg_ptr = ptr;
|
|
1405
|
+
FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1406
|
+
return obj;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
__destroy_into_raw() {
|
|
1410
|
+
const ptr = this.__wbg_ptr;
|
|
1411
|
+
this.__wbg_ptr = 0;
|
|
1412
|
+
FoldersClientFinalization.unregister(this);
|
|
1413
|
+
return ptr;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
free() {
|
|
1417
|
+
const ptr = this.__destroy_into_raw();
|
|
1418
|
+
wasm.__wbg_foldersclient_free(ptr, 0);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Decrypt folder
|
|
1422
|
+
* @param {Folder} folder
|
|
1423
|
+
* @returns {FolderView}
|
|
1424
|
+
*/
|
|
1425
|
+
decrypt(folder) {
|
|
1426
|
+
try {
|
|
1427
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1428
|
+
wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
|
1429
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1430
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1431
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1432
|
+
if (r2) {
|
|
1433
|
+
throw takeObject(r1);
|
|
1434
|
+
}
|
|
1435
|
+
return takeObject(r0);
|
|
1436
|
+
} finally {
|
|
1437
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
const GeneratorClientFinalization =
|
|
1443
|
+
typeof FinalizationRegistry === "undefined"
|
|
1444
|
+
? { register: () => {}, unregister: () => {} }
|
|
1445
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_generatorclient_free(ptr >>> 0, 1));
|
|
1446
|
+
|
|
1447
|
+
export class GeneratorClient {
|
|
1448
|
+
static __wrap(ptr) {
|
|
1449
|
+
ptr = ptr >>> 0;
|
|
1450
|
+
const obj = Object.create(GeneratorClient.prototype);
|
|
1451
|
+
obj.__wbg_ptr = ptr;
|
|
1452
|
+
GeneratorClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1453
|
+
return obj;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
__destroy_into_raw() {
|
|
1457
|
+
const ptr = this.__wbg_ptr;
|
|
1458
|
+
this.__wbg_ptr = 0;
|
|
1459
|
+
GeneratorClientFinalization.unregister(this);
|
|
1460
|
+
return ptr;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
free() {
|
|
1464
|
+
const ptr = this.__destroy_into_raw();
|
|
1465
|
+
wasm.__wbg_generatorclient_free(ptr, 0);
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* Generates a password from a provided request
|
|
1469
|
+
*
|
|
1470
|
+
* # Arguments
|
|
1471
|
+
* - `request` - Settings for the character sets and password length
|
|
1472
|
+
*
|
|
1473
|
+
* # Returns
|
|
1474
|
+
* - `Ok(String)` containing the generated password
|
|
1475
|
+
* - `Err(PasswordError)` if password generation fails
|
|
1476
|
+
* @param {PasswordGeneratorRequest} request
|
|
1477
|
+
* @returns {string}
|
|
1478
|
+
*/
|
|
1479
|
+
password(request) {
|
|
1480
|
+
let deferred2_0;
|
|
1481
|
+
let deferred2_1;
|
|
1482
|
+
try {
|
|
1483
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1484
|
+
wasm.generatorclient_password(retptr, this.__wbg_ptr, addHeapObject(request));
|
|
1485
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1486
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1487
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1488
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1489
|
+
var ptr1 = r0;
|
|
1490
|
+
var len1 = r1;
|
|
1491
|
+
if (r3) {
|
|
1492
|
+
ptr1 = 0;
|
|
1493
|
+
len1 = 0;
|
|
1494
|
+
throw takeObject(r2);
|
|
1495
|
+
}
|
|
1496
|
+
deferred2_0 = ptr1;
|
|
1497
|
+
deferred2_1 = len1;
|
|
1498
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1499
|
+
} finally {
|
|
1500
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1501
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Generates a passphrase from a provided request
|
|
1506
|
+
*
|
|
1507
|
+
* # Arguments
|
|
1508
|
+
* - `request` - Settings for the word count, word separators character sets
|
|
1509
|
+
*
|
|
1510
|
+
* # Returns
|
|
1511
|
+
* - `Ok(String)` containing the generated passphrase
|
|
1512
|
+
* - `Err(PassphraseError)` if passphrase generation fails
|
|
1513
|
+
* @param {PassphraseGeneratorRequest} request
|
|
1514
|
+
* @returns {string}
|
|
1515
|
+
*/
|
|
1516
|
+
passphrase(request) {
|
|
1517
|
+
let deferred2_0;
|
|
1518
|
+
let deferred2_1;
|
|
1519
|
+
try {
|
|
1520
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1521
|
+
wasm.generatorclient_passphrase(retptr, this.__wbg_ptr, addHeapObject(request));
|
|
1522
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1523
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1524
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1525
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1526
|
+
var ptr1 = r0;
|
|
1527
|
+
var len1 = r1;
|
|
1528
|
+
if (r3) {
|
|
1529
|
+
ptr1 = 0;
|
|
1530
|
+
len1 = 0;
|
|
1531
|
+
throw takeObject(r2);
|
|
1532
|
+
}
|
|
1533
|
+
deferred2_0 = ptr1;
|
|
1534
|
+
deferred2_1 = len1;
|
|
1535
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1536
|
+
} finally {
|
|
1537
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1538
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
const IncomingMessageFinalization =
|
|
1544
|
+
typeof FinalizationRegistry === "undefined"
|
|
1545
|
+
? { register: () => {}, unregister: () => {} }
|
|
1546
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_incomingmessage_free(ptr >>> 0, 1));
|
|
1547
|
+
|
|
1548
|
+
export class IncomingMessage {
|
|
1549
|
+
static __wrap(ptr) {
|
|
1550
|
+
ptr = ptr >>> 0;
|
|
1551
|
+
const obj = Object.create(IncomingMessage.prototype);
|
|
1552
|
+
obj.__wbg_ptr = ptr;
|
|
1553
|
+
IncomingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1554
|
+
return obj;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
__destroy_into_raw() {
|
|
1558
|
+
const ptr = this.__wbg_ptr;
|
|
1559
|
+
this.__wbg_ptr = 0;
|
|
1560
|
+
IncomingMessageFinalization.unregister(this);
|
|
1561
|
+
return ptr;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
free() {
|
|
1565
|
+
const ptr = this.__destroy_into_raw();
|
|
1566
|
+
wasm.__wbg_incomingmessage_free(ptr, 0);
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* @returns {Uint8Array}
|
|
1570
|
+
*/
|
|
1571
|
+
get payload() {
|
|
1572
|
+
try {
|
|
1573
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1574
|
+
wasm.__wbg_get_incomingmessage_payload(retptr, this.__wbg_ptr);
|
|
1575
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1576
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1577
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1578
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1579
|
+
return v1;
|
|
1580
|
+
} finally {
|
|
1581
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* @param {Uint8Array} arg0
|
|
1586
|
+
*/
|
|
1587
|
+
set payload(arg0) {
|
|
1588
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1589
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1590
|
+
wasm.__wbg_set_incomingmessage_payload(this.__wbg_ptr, ptr0, len0);
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* @returns {Endpoint}
|
|
1594
|
+
*/
|
|
1595
|
+
get destination() {
|
|
1596
|
+
const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
|
|
1597
|
+
return takeObject(ret);
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @param {Endpoint} arg0
|
|
1601
|
+
*/
|
|
1602
|
+
set destination(arg0) {
|
|
1603
|
+
wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* @returns {Endpoint}
|
|
1607
|
+
*/
|
|
1608
|
+
get source() {
|
|
1609
|
+
const ret = wasm.__wbg_get_incomingmessage_source(this.__wbg_ptr);
|
|
1610
|
+
return takeObject(ret);
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* @param {Endpoint} arg0
|
|
1614
|
+
*/
|
|
1615
|
+
set source(arg0) {
|
|
1616
|
+
wasm.__wbg_set_incomingmessage_source(this.__wbg_ptr, addHeapObject(arg0));
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* @returns {string | undefined}
|
|
1620
|
+
*/
|
|
1621
|
+
get topic() {
|
|
1622
|
+
try {
|
|
1623
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1624
|
+
wasm.__wbg_get_incomingmessage_topic(retptr, this.__wbg_ptr);
|
|
1625
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1626
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1627
|
+
let v1;
|
|
1628
|
+
if (r0 !== 0) {
|
|
1629
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1630
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1631
|
+
}
|
|
1632
|
+
return v1;
|
|
1633
|
+
} finally {
|
|
1634
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* @param {string | null} [arg0]
|
|
1639
|
+
*/
|
|
1640
|
+
set topic(arg0) {
|
|
1641
|
+
var ptr0 = isLikeNone(arg0)
|
|
1642
|
+
? 0
|
|
1643
|
+
: passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1644
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1645
|
+
wasm.__wbg_set_incomingmessage_topic(this.__wbg_ptr, ptr0, len0);
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* @param {Uint8Array} payload
|
|
1649
|
+
* @param {Endpoint} destination
|
|
1650
|
+
* @param {Endpoint} source
|
|
1651
|
+
* @param {string | null} [topic]
|
|
1652
|
+
*/
|
|
1653
|
+
constructor(payload, destination, source, topic) {
|
|
1654
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
|
|
1655
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1656
|
+
var ptr1 = isLikeNone(topic)
|
|
1657
|
+
? 0
|
|
1658
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1659
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1660
|
+
const ret = wasm.incomingmessage_new(
|
|
1661
|
+
ptr0,
|
|
1662
|
+
len0,
|
|
1663
|
+
addHeapObject(destination),
|
|
1664
|
+
addHeapObject(source),
|
|
1665
|
+
ptr1,
|
|
1666
|
+
len1,
|
|
1667
|
+
);
|
|
1668
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1669
|
+
IncomingMessageFinalization.register(this, this.__wbg_ptr, this);
|
|
1670
|
+
return this;
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Try to parse the payload as JSON.
|
|
1674
|
+
* @returns {any} The parsed JSON value, or undefined if the payload is not valid JSON.
|
|
1675
|
+
*/
|
|
1676
|
+
parse_payload_as_json() {
|
|
1677
|
+
const ret = wasm.incomingmessage_parse_payload_as_json(this.__wbg_ptr);
|
|
1678
|
+
return takeObject(ret);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
const IpcClientFinalization =
|
|
1683
|
+
typeof FinalizationRegistry === "undefined"
|
|
1684
|
+
? { register: () => {}, unregister: () => {} }
|
|
1685
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ipcclient_free(ptr >>> 0, 1));
|
|
1686
|
+
|
|
1687
|
+
export class IpcClient {
|
|
1688
|
+
__destroy_into_raw() {
|
|
1689
|
+
const ptr = this.__wbg_ptr;
|
|
1690
|
+
this.__wbg_ptr = 0;
|
|
1691
|
+
IpcClientFinalization.unregister(this);
|
|
1692
|
+
return ptr;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
free() {
|
|
1696
|
+
const ptr = this.__destroy_into_raw();
|
|
1697
|
+
wasm.__wbg_ipcclient_free(ptr, 0);
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* @param {CommunicationBackend} communication_provider
|
|
1701
|
+
*/
|
|
1702
|
+
constructor(communication_provider) {
|
|
1703
|
+
const ret = wasm.ipcclient_new(addHeapObject(communication_provider));
|
|
1704
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1705
|
+
IpcClientFinalization.register(this, this.__wbg_ptr, this);
|
|
1706
|
+
return this;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* @param {OutgoingMessage} message
|
|
1710
|
+
* @returns {Promise<void>}
|
|
1711
|
+
*/
|
|
1712
|
+
send(message) {
|
|
1713
|
+
_assertClass(message, OutgoingMessage);
|
|
1714
|
+
var ptr0 = message.__destroy_into_raw();
|
|
1715
|
+
const ret = wasm.ipcclient_send(this.__wbg_ptr, ptr0);
|
|
1716
|
+
return takeObject(ret);
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* @returns {Promise<IncomingMessage>}
|
|
1720
|
+
*/
|
|
1721
|
+
receive() {
|
|
1722
|
+
const ret = wasm.ipcclient_receive(this.__wbg_ptr);
|
|
1723
|
+
return takeObject(ret);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
const OutgoingMessageFinalization =
|
|
1728
|
+
typeof FinalizationRegistry === "undefined"
|
|
1729
|
+
? { register: () => {}, unregister: () => {} }
|
|
1730
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_outgoingmessage_free(ptr >>> 0, 1));
|
|
1731
|
+
|
|
1732
|
+
export class OutgoingMessage {
|
|
1733
|
+
static __wrap(ptr) {
|
|
1734
|
+
ptr = ptr >>> 0;
|
|
1735
|
+
const obj = Object.create(OutgoingMessage.prototype);
|
|
1736
|
+
obj.__wbg_ptr = ptr;
|
|
1737
|
+
OutgoingMessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1738
|
+
return obj;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
__destroy_into_raw() {
|
|
1742
|
+
const ptr = this.__wbg_ptr;
|
|
1743
|
+
this.__wbg_ptr = 0;
|
|
1744
|
+
OutgoingMessageFinalization.unregister(this);
|
|
1745
|
+
return ptr;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
free() {
|
|
1749
|
+
const ptr = this.__destroy_into_raw();
|
|
1750
|
+
wasm.__wbg_outgoingmessage_free(ptr, 0);
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* @returns {Uint8Array}
|
|
1754
|
+
*/
|
|
1755
|
+
get payload() {
|
|
1756
|
+
try {
|
|
1757
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1758
|
+
wasm.__wbg_get_outgoingmessage_payload(retptr, this.__wbg_ptr);
|
|
1759
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1760
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1761
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1762
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1763
|
+
return v1;
|
|
1764
|
+
} finally {
|
|
1765
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* @param {Uint8Array} arg0
|
|
1770
|
+
*/
|
|
1771
|
+
set payload(arg0) {
|
|
1772
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
1773
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1774
|
+
wasm.__wbg_set_outgoingmessage_payload(this.__wbg_ptr, ptr0, len0);
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* @returns {Endpoint}
|
|
1778
|
+
*/
|
|
1779
|
+
get destination() {
|
|
1780
|
+
const ret = wasm.__wbg_get_incomingmessage_destination(this.__wbg_ptr);
|
|
1781
|
+
return takeObject(ret);
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* @param {Endpoint} arg0
|
|
1785
|
+
*/
|
|
1786
|
+
set destination(arg0) {
|
|
1787
|
+
wasm.__wbg_set_incomingmessage_destination(this.__wbg_ptr, addHeapObject(arg0));
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* @returns {string | undefined}
|
|
1791
|
+
*/
|
|
1792
|
+
get topic() {
|
|
1793
|
+
try {
|
|
1794
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1795
|
+
wasm.__wbg_get_outgoingmessage_topic(retptr, this.__wbg_ptr);
|
|
1796
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1797
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1798
|
+
let v1;
|
|
1799
|
+
if (r0 !== 0) {
|
|
1800
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1801
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1802
|
+
}
|
|
1803
|
+
return v1;
|
|
1804
|
+
} finally {
|
|
1805
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* @param {string | null} [arg0]
|
|
1810
|
+
*/
|
|
1811
|
+
set topic(arg0) {
|
|
1812
|
+
var ptr0 = isLikeNone(arg0)
|
|
1813
|
+
? 0
|
|
1814
|
+
: passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1815
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1816
|
+
wasm.__wbg_set_outgoingmessage_topic(this.__wbg_ptr, ptr0, len0);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* @param {Uint8Array} payload
|
|
1820
|
+
* @param {Endpoint} destination
|
|
1821
|
+
* @param {string | null} [topic]
|
|
1822
|
+
*/
|
|
1823
|
+
constructor(payload, destination, topic) {
|
|
1824
|
+
const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
|
|
1825
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1826
|
+
var ptr1 = isLikeNone(topic)
|
|
1827
|
+
? 0
|
|
1828
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1829
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1830
|
+
const ret = wasm.outgoingmessage_new(ptr0, len0, addHeapObject(destination), ptr1, len1);
|
|
1831
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1832
|
+
OutgoingMessageFinalization.register(this, this.__wbg_ptr, this);
|
|
1833
|
+
return this;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Create a new message and encode the payload as JSON.
|
|
1837
|
+
* @param {any} payload
|
|
1838
|
+
* @param {Endpoint} destination
|
|
1839
|
+
* @param {string | null} [topic]
|
|
1840
|
+
* @returns {OutgoingMessage}
|
|
1841
|
+
*/
|
|
1842
|
+
static new_json_payload(payload, destination, topic) {
|
|
1843
|
+
try {
|
|
1844
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1845
|
+
var ptr0 = isLikeNone(topic)
|
|
1846
|
+
? 0
|
|
1847
|
+
: passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1848
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1849
|
+
wasm.outgoingmessage_new_json_payload(
|
|
1850
|
+
retptr,
|
|
1851
|
+
addHeapObject(payload),
|
|
1852
|
+
addHeapObject(destination),
|
|
1853
|
+
ptr0,
|
|
1854
|
+
len0,
|
|
1855
|
+
);
|
|
1856
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1857
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1858
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1859
|
+
if (r2) {
|
|
1860
|
+
throw takeObject(r1);
|
|
1861
|
+
}
|
|
1862
|
+
return OutgoingMessage.__wrap(r0);
|
|
1863
|
+
} finally {
|
|
1864
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
const PureCryptoFinalization =
|
|
1870
|
+
typeof FinalizationRegistry === "undefined"
|
|
1871
|
+
? { register: () => {}, unregister: () => {} }
|
|
1872
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
|
|
1873
|
+
/**
|
|
1874
|
+
* This module represents a stopgap solution to provide access to primitive crypto functions for JS
|
|
1875
|
+
* clients. It is not intended to be used outside of the JS clients and this pattern should not be
|
|
1876
|
+
* proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
|
|
1877
|
+
* responsible for state and keys.
|
|
1878
|
+
*/
|
|
1879
|
+
export class PureCrypto {
|
|
359
1880
|
__destroy_into_raw() {
|
|
360
1881
|
const ptr = this.__wbg_ptr;
|
|
361
1882
|
this.__wbg_ptr = 0;
|
|
362
|
-
|
|
1883
|
+
PureCryptoFinalization.unregister(this);
|
|
363
1884
|
return ptr;
|
|
364
1885
|
}
|
|
365
1886
|
|
|
366
1887
|
free() {
|
|
367
1888
|
const ptr = this.__destroy_into_raw();
|
|
368
|
-
wasm.
|
|
1889
|
+
wasm.__wbg_purecrypto_free(ptr, 0);
|
|
369
1890
|
}
|
|
370
1891
|
/**
|
|
371
|
-
* @param {
|
|
372
|
-
* @param {
|
|
1892
|
+
* @param {string} enc_string
|
|
1893
|
+
* @param {Uint8Array} key
|
|
1894
|
+
* @returns {string}
|
|
373
1895
|
*/
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
1896
|
+
static symmetric_decrypt(enc_string, key) {
|
|
1897
|
+
let deferred4_0;
|
|
1898
|
+
let deferred4_1;
|
|
1899
|
+
try {
|
|
1900
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1901
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1902
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1903
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1904
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1905
|
+
wasm.purecrypto_symmetric_decrypt(retptr, ptr0, len0, ptr1, len1);
|
|
1906
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1907
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1908
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1909
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1910
|
+
var ptr3 = r0;
|
|
1911
|
+
var len3 = r1;
|
|
1912
|
+
if (r3) {
|
|
1913
|
+
ptr3 = 0;
|
|
1914
|
+
len3 = 0;
|
|
1915
|
+
throw takeObject(r2);
|
|
1916
|
+
}
|
|
1917
|
+
deferred4_0 = ptr3;
|
|
1918
|
+
deferred4_1 = len3;
|
|
1919
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1920
|
+
} finally {
|
|
1921
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1922
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1923
|
+
}
|
|
382
1924
|
}
|
|
383
1925
|
/**
|
|
384
|
-
*
|
|
385
|
-
* @param {
|
|
386
|
-
* @returns {
|
|
1926
|
+
* @param {string} enc_string
|
|
1927
|
+
* @param {Uint8Array} key
|
|
1928
|
+
* @returns {Uint8Array}
|
|
387
1929
|
*/
|
|
388
|
-
|
|
389
|
-
let deferred2_0;
|
|
390
|
-
let deferred2_1;
|
|
1930
|
+
static symmetric_decrypt_to_bytes(enc_string, key) {
|
|
391
1931
|
try {
|
|
392
1932
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
393
|
-
const ptr0 = passStringToWasm0(
|
|
1933
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
394
1934
|
const len0 = WASM_VECTOR_LEN;
|
|
395
|
-
|
|
1935
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1936
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1937
|
+
wasm.purecrypto_symmetric_decrypt_to_bytes(retptr, ptr0, len0, ptr1, len1);
|
|
396
1938
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
397
1939
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
1940
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1941
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1942
|
+
if (r3) {
|
|
1943
|
+
throw takeObject(r2);
|
|
1944
|
+
}
|
|
1945
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1946
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1947
|
+
return v3;
|
|
1948
|
+
} finally {
|
|
1949
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* @param {Uint8Array} enc_bytes
|
|
1954
|
+
* @param {Uint8Array} key
|
|
1955
|
+
* @returns {Uint8Array}
|
|
1956
|
+
*/
|
|
1957
|
+
static symmetric_decrypt_array_buffer(enc_bytes, key) {
|
|
1958
|
+
try {
|
|
1959
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1960
|
+
const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
|
|
1961
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1962
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1963
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1964
|
+
wasm.purecrypto_symmetric_decrypt_array_buffer(retptr, ptr0, len0, ptr1, len1);
|
|
1965
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1966
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1967
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1968
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1969
|
+
if (r3) {
|
|
1970
|
+
throw takeObject(r2);
|
|
1971
|
+
}
|
|
1972
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1973
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
1974
|
+
return v3;
|
|
401
1975
|
} finally {
|
|
402
1976
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
403
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
404
1977
|
}
|
|
405
1978
|
}
|
|
406
1979
|
/**
|
|
1980
|
+
* @param {string} plain
|
|
1981
|
+
* @param {Uint8Array} key
|
|
407
1982
|
* @returns {string}
|
|
408
1983
|
*/
|
|
409
|
-
|
|
410
|
-
let
|
|
411
|
-
let
|
|
1984
|
+
static symmetric_encrypt(plain, key) {
|
|
1985
|
+
let deferred4_0;
|
|
1986
|
+
let deferred4_1;
|
|
412
1987
|
try {
|
|
413
1988
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
414
|
-
wasm.
|
|
1989
|
+
const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1990
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1991
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
1992
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1993
|
+
wasm.purecrypto_symmetric_encrypt(retptr, ptr0, len0, ptr1, len1);
|
|
415
1994
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
416
1995
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
1996
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1997
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1998
|
+
var ptr3 = r0;
|
|
1999
|
+
var len3 = r1;
|
|
2000
|
+
if (r3) {
|
|
2001
|
+
ptr3 = 0;
|
|
2002
|
+
len3 = 0;
|
|
2003
|
+
throw takeObject(r2);
|
|
2004
|
+
}
|
|
2005
|
+
deferred4_0 = ptr3;
|
|
2006
|
+
deferred4_1 = len3;
|
|
2007
|
+
return getStringFromWasm0(ptr3, len3);
|
|
420
2008
|
} finally {
|
|
421
2009
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
422
|
-
wasm.__wbindgen_free(
|
|
2010
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
423
2011
|
}
|
|
424
2012
|
}
|
|
425
2013
|
/**
|
|
426
|
-
* @param {
|
|
427
|
-
* @
|
|
2014
|
+
* @param {Uint8Array} plain
|
|
2015
|
+
* @param {Uint8Array} key
|
|
2016
|
+
* @returns {Uint8Array}
|
|
428
2017
|
*/
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
2018
|
+
static symmetric_encrypt_to_array_buffer(plain, key) {
|
|
2019
|
+
try {
|
|
2020
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2021
|
+
const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
|
|
2022
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2023
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
|
|
2024
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2025
|
+
wasm.purecrypto_symmetric_encrypt_to_array_buffer(retptr, ptr0, len0, ptr1, len1);
|
|
2026
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2027
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2028
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2029
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2030
|
+
if (r3) {
|
|
2031
|
+
throw takeObject(r2);
|
|
2032
|
+
}
|
|
2033
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2034
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
2035
|
+
return v3;
|
|
2036
|
+
} finally {
|
|
2037
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
const ReceiveErrorFinalization =
|
|
2043
|
+
typeof FinalizationRegistry === "undefined"
|
|
2044
|
+
? { register: () => {}, unregister: () => {} }
|
|
2045
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_receiveerror_free(ptr >>> 0, 1));
|
|
2046
|
+
|
|
2047
|
+
export class ReceiveError {
|
|
2048
|
+
static __wrap(ptr) {
|
|
2049
|
+
ptr = ptr >>> 0;
|
|
2050
|
+
const obj = Object.create(ReceiveError.prototype);
|
|
2051
|
+
obj.__wbg_ptr = ptr;
|
|
2052
|
+
ReceiveErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2053
|
+
return obj;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
__destroy_into_raw() {
|
|
2057
|
+
const ptr = this.__wbg_ptr;
|
|
2058
|
+
this.__wbg_ptr = 0;
|
|
2059
|
+
ReceiveErrorFinalization.unregister(this);
|
|
2060
|
+
return ptr;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
free() {
|
|
2064
|
+
const ptr = this.__destroy_into_raw();
|
|
2065
|
+
wasm.__wbg_receiveerror_free(ptr, 0);
|
|
434
2066
|
}
|
|
435
2067
|
/**
|
|
436
|
-
*
|
|
437
|
-
* @param {string} url
|
|
438
|
-
* @returns {Promise<string>}
|
|
2068
|
+
* @returns {boolean}
|
|
439
2069
|
*/
|
|
440
|
-
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
2070
|
+
get timeout() {
|
|
2071
|
+
const ret = wasm.__wbg_get_receiveerror_timeout(this.__wbg_ptr);
|
|
2072
|
+
return ret !== 0;
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* @param {boolean} arg0
|
|
2076
|
+
*/
|
|
2077
|
+
set timeout(arg0) {
|
|
2078
|
+
wasm.__wbg_set_receiveerror_timeout(this.__wbg_ptr, arg0);
|
|
2079
|
+
}
|
|
2080
|
+
/**
|
|
2081
|
+
* @returns {any}
|
|
2082
|
+
*/
|
|
2083
|
+
get crypto() {
|
|
2084
|
+
const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
|
|
444
2085
|
return takeObject(ret);
|
|
445
2086
|
}
|
|
446
2087
|
/**
|
|
447
|
-
* @
|
|
2088
|
+
* @param {any} arg0
|
|
448
2089
|
*/
|
|
449
|
-
crypto() {
|
|
450
|
-
|
|
451
|
-
return ClientCrypto.__wrap(ret);
|
|
2090
|
+
set crypto(arg0) {
|
|
2091
|
+
wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
|
|
452
2092
|
}
|
|
453
2093
|
/**
|
|
454
|
-
* @returns {
|
|
2094
|
+
* @returns {any}
|
|
455
2095
|
*/
|
|
456
|
-
|
|
457
|
-
const ret = wasm.
|
|
458
|
-
return
|
|
2096
|
+
get communication() {
|
|
2097
|
+
const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
|
|
2098
|
+
return takeObject(ret);
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* @param {any} arg0
|
|
2102
|
+
*/
|
|
2103
|
+
set communication(arg0) {
|
|
2104
|
+
wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
|
|
459
2105
|
}
|
|
460
2106
|
}
|
|
461
2107
|
|
|
462
|
-
const
|
|
2108
|
+
const SendErrorFinalization =
|
|
463
2109
|
typeof FinalizationRegistry === "undefined"
|
|
464
2110
|
? { register: () => {}, unregister: () => {} }
|
|
465
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
2111
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_senderror_free(ptr >>> 0, 1));
|
|
466
2112
|
|
|
467
|
-
export class
|
|
2113
|
+
export class SendError {
|
|
468
2114
|
static __wrap(ptr) {
|
|
469
2115
|
ptr = ptr >>> 0;
|
|
470
|
-
const obj = Object.create(
|
|
2116
|
+
const obj = Object.create(SendError.prototype);
|
|
471
2117
|
obj.__wbg_ptr = ptr;
|
|
472
|
-
|
|
2118
|
+
SendErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
473
2119
|
return obj;
|
|
474
2120
|
}
|
|
475
2121
|
|
|
476
2122
|
__destroy_into_raw() {
|
|
477
2123
|
const ptr = this.__wbg_ptr;
|
|
478
2124
|
this.__wbg_ptr = 0;
|
|
479
|
-
|
|
2125
|
+
SendErrorFinalization.unregister(this);
|
|
480
2126
|
return ptr;
|
|
481
2127
|
}
|
|
482
2128
|
|
|
483
2129
|
free() {
|
|
484
2130
|
const ptr = this.__destroy_into_raw();
|
|
485
|
-
wasm.
|
|
2131
|
+
wasm.__wbg_senderror_free(ptr, 0);
|
|
486
2132
|
}
|
|
487
2133
|
/**
|
|
488
|
-
*
|
|
489
|
-
* operations.
|
|
490
|
-
* @param {InitUserCryptoRequest} req
|
|
491
|
-
* @returns {Promise<void>}
|
|
2134
|
+
* @returns {any}
|
|
492
2135
|
*/
|
|
493
|
-
|
|
494
|
-
const ret = wasm.
|
|
2136
|
+
get crypto() {
|
|
2137
|
+
const ret = wasm.__wbg_get_receiveerror_crypto(this.__wbg_ptr);
|
|
495
2138
|
return takeObject(ret);
|
|
496
2139
|
}
|
|
497
2140
|
/**
|
|
498
|
-
*
|
|
499
|
-
* `initialize_user_crypto` but before any other crypto operations.
|
|
500
|
-
* @param {InitOrgCryptoRequest} req
|
|
501
|
-
* @returns {Promise<void>}
|
|
2141
|
+
* @param {any} arg0
|
|
502
2142
|
*/
|
|
503
|
-
|
|
504
|
-
|
|
2143
|
+
set crypto(arg0) {
|
|
2144
|
+
wasm.__wbg_set_receiveerror_crypto(this.__wbg_ptr, addHeapObject(arg0));
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* @returns {any}
|
|
2148
|
+
*/
|
|
2149
|
+
get communication() {
|
|
2150
|
+
const ret = wasm.__wbg_get_receiveerror_communication(this.__wbg_ptr);
|
|
505
2151
|
return takeObject(ret);
|
|
506
2152
|
}
|
|
2153
|
+
/**
|
|
2154
|
+
* @param {any} arg0
|
|
2155
|
+
*/
|
|
2156
|
+
set communication(arg0) {
|
|
2157
|
+
wasm.__wbg_set_receiveerror_communication(this.__wbg_ptr, addHeapObject(arg0));
|
|
2158
|
+
}
|
|
507
2159
|
}
|
|
508
2160
|
|
|
509
|
-
const
|
|
2161
|
+
const TotpClientFinalization =
|
|
510
2162
|
typeof FinalizationRegistry === "undefined"
|
|
511
2163
|
? { register: () => {}, unregister: () => {} }
|
|
512
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
2164
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
|
|
513
2165
|
|
|
514
|
-
export class
|
|
2166
|
+
export class TotpClient {
|
|
515
2167
|
static __wrap(ptr) {
|
|
516
2168
|
ptr = ptr >>> 0;
|
|
517
|
-
const obj = Object.create(
|
|
2169
|
+
const obj = Object.create(TotpClient.prototype);
|
|
518
2170
|
obj.__wbg_ptr = ptr;
|
|
519
|
-
|
|
2171
|
+
TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
520
2172
|
return obj;
|
|
521
2173
|
}
|
|
522
2174
|
|
|
523
2175
|
__destroy_into_raw() {
|
|
524
2176
|
const ptr = this.__wbg_ptr;
|
|
525
2177
|
this.__wbg_ptr = 0;
|
|
526
|
-
|
|
2178
|
+
TotpClientFinalization.unregister(this);
|
|
527
2179
|
return ptr;
|
|
528
2180
|
}
|
|
529
2181
|
|
|
530
2182
|
free() {
|
|
531
2183
|
const ptr = this.__destroy_into_raw();
|
|
532
|
-
wasm.
|
|
2184
|
+
wasm.__wbg_totpclient_free(ptr, 0);
|
|
533
2185
|
}
|
|
534
2186
|
/**
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*
|
|
2187
|
+
* Generates a TOTP code from a provided key
|
|
2188
|
+
*
|
|
2189
|
+
* # Arguments
|
|
2190
|
+
* - `key` - Can be:
|
|
2191
|
+
* - A base32 encoded string
|
|
2192
|
+
* - OTP Auth URI
|
|
2193
|
+
* - Steam URI
|
|
2194
|
+
* - `time_ms` - Optional timestamp in milliseconds
|
|
2195
|
+
*
|
|
2196
|
+
* # Returns
|
|
2197
|
+
* - `Ok(TotpResponse)` containing the generated code and period
|
|
2198
|
+
* - `Err(TotpError)` if code generation fails
|
|
2199
|
+
* @param {string} key
|
|
2200
|
+
* @param {number | null} [time_ms]
|
|
2201
|
+
* @returns {TotpResponse}
|
|
538
2202
|
*/
|
|
539
|
-
|
|
2203
|
+
generate_totp(key, time_ms) {
|
|
540
2204
|
try {
|
|
541
2205
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
542
|
-
|
|
2206
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2208
|
+
wasm.totpclient_generate_totp(
|
|
2209
|
+
retptr,
|
|
2210
|
+
this.__wbg_ptr,
|
|
2211
|
+
ptr0,
|
|
2212
|
+
len0,
|
|
2213
|
+
!isLikeNone(time_ms),
|
|
2214
|
+
isLikeNone(time_ms) ? 0 : time_ms,
|
|
2215
|
+
);
|
|
543
2216
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
544
2217
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
545
2218
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -553,223 +2226,224 @@ export class ClientFolders {
|
|
|
553
2226
|
}
|
|
554
2227
|
}
|
|
555
2228
|
|
|
556
|
-
const
|
|
2229
|
+
const VaultClientFinalization =
|
|
557
2230
|
typeof FinalizationRegistry === "undefined"
|
|
558
2231
|
? { register: () => {}, unregister: () => {} }
|
|
559
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
2232
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
|
|
560
2233
|
|
|
561
|
-
export class
|
|
2234
|
+
export class VaultClient {
|
|
562
2235
|
static __wrap(ptr) {
|
|
563
2236
|
ptr = ptr >>> 0;
|
|
564
|
-
const obj = Object.create(
|
|
2237
|
+
const obj = Object.create(VaultClient.prototype);
|
|
565
2238
|
obj.__wbg_ptr = ptr;
|
|
566
|
-
|
|
2239
|
+
VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
567
2240
|
return obj;
|
|
568
2241
|
}
|
|
569
2242
|
|
|
570
2243
|
__destroy_into_raw() {
|
|
571
2244
|
const ptr = this.__wbg_ptr;
|
|
572
2245
|
this.__wbg_ptr = 0;
|
|
573
|
-
|
|
2246
|
+
VaultClientFinalization.unregister(this);
|
|
574
2247
|
return ptr;
|
|
575
2248
|
}
|
|
576
2249
|
|
|
577
2250
|
free() {
|
|
578
2251
|
const ptr = this.__destroy_into_raw();
|
|
579
|
-
wasm.
|
|
2252
|
+
wasm.__wbg_vaultclient_free(ptr, 0);
|
|
580
2253
|
}
|
|
581
2254
|
/**
|
|
582
|
-
* @returns {
|
|
2255
|
+
* @returns {AttachmentsClient}
|
|
583
2256
|
*/
|
|
584
|
-
|
|
585
|
-
const ret = wasm.
|
|
586
|
-
return
|
|
2257
|
+
attachments() {
|
|
2258
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2259
|
+
return AttachmentsClient.__wrap(ret);
|
|
587
2260
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
deferred0_0 = arg0;
|
|
595
|
-
deferred0_1 = arg1;
|
|
596
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
597
|
-
return addHeapObject(ret);
|
|
598
|
-
} finally {
|
|
599
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2261
|
+
/**
|
|
2262
|
+
* @returns {CiphersClient}
|
|
2263
|
+
*/
|
|
2264
|
+
ciphers() {
|
|
2265
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2266
|
+
return CiphersClient.__wrap(ret);
|
|
600
2267
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
deferred0_0 = arg1;
|
|
608
|
-
deferred0_1 = arg2;
|
|
609
|
-
getObject(arg0).name = getStringFromWasm0(arg1, arg2);
|
|
610
|
-
} finally {
|
|
611
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2268
|
+
/**
|
|
2269
|
+
* @returns {FoldersClient}
|
|
2270
|
+
*/
|
|
2271
|
+
folders() {
|
|
2272
|
+
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2273
|
+
return FoldersClient.__wrap(ret);
|
|
612
2274
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
deferred0_0 = arg1;
|
|
620
|
-
deferred0_1 = arg2;
|
|
621
|
-
getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
|
|
622
|
-
} finally {
|
|
623
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2275
|
+
/**
|
|
2276
|
+
* @returns {TotpClient}
|
|
2277
|
+
*/
|
|
2278
|
+
totp() {
|
|
2279
|
+
const ret = wasm.vaultclient_totp(this.__wbg_ptr);
|
|
2280
|
+
return TotpClient.__wrap(ret);
|
|
624
2281
|
}
|
|
625
2282
|
}
|
|
626
2283
|
|
|
627
|
-
export function
|
|
628
|
-
const ret =
|
|
629
|
-
|
|
2284
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
2285
|
+
const ret = String(getObject(arg1));
|
|
2286
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2287
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2288
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2289
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
630
2290
|
}
|
|
631
2291
|
|
|
632
|
-
export function
|
|
633
|
-
|
|
634
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
635
|
-
return addHeapObject(ret);
|
|
636
|
-
}, arguments);
|
|
2292
|
+
export function __wbg_abort_775ef1d17fc65868(arg0) {
|
|
2293
|
+
getObject(arg0).abort();
|
|
637
2294
|
}
|
|
638
2295
|
|
|
639
|
-
export function
|
|
640
|
-
|
|
2296
|
+
export function __wbg_append_299d5d48292c0495() {
|
|
2297
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2298
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2299
|
+
}, arguments);
|
|
641
2300
|
}
|
|
642
2301
|
|
|
643
|
-
export function
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
? 0
|
|
648
|
-
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
649
|
-
var len1 = WASM_VECTOR_LEN;
|
|
650
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
651
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2302
|
+
export function __wbg_append_8c7dd8d641a5f01b() {
|
|
2303
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
2304
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2305
|
+
}, arguments);
|
|
652
2306
|
}
|
|
653
2307
|
|
|
654
|
-
export function
|
|
655
|
-
|
|
656
|
-
|
|
2308
|
+
export function __wbg_append_b2d1fc16de2a0e81() {
|
|
2309
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2310
|
+
getObject(arg0).append(
|
|
2311
|
+
getStringFromWasm0(arg1, arg2),
|
|
2312
|
+
getObject(arg3),
|
|
2313
|
+
getStringFromWasm0(arg4, arg5),
|
|
2314
|
+
);
|
|
2315
|
+
}, arguments);
|
|
657
2316
|
}
|
|
658
2317
|
|
|
659
|
-
export function
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
2318
|
+
export function __wbg_append_b44785ebeb668479() {
|
|
2319
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2320
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
2321
|
+
}, arguments);
|
|
663
2322
|
}
|
|
664
2323
|
|
|
665
|
-
export function
|
|
666
|
-
const ret = getObject(arg0)
|
|
2324
|
+
export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
|
2325
|
+
const ret = getObject(arg0).buffer;
|
|
667
2326
|
return addHeapObject(ret);
|
|
668
2327
|
}
|
|
669
2328
|
|
|
670
|
-
export function
|
|
671
|
-
|
|
672
|
-
|
|
2329
|
+
export function __wbg_call_672a4d21634d4a24() {
|
|
2330
|
+
return handleError(function (arg0, arg1) {
|
|
2331
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
2332
|
+
return addHeapObject(ret);
|
|
2333
|
+
}, arguments);
|
|
673
2334
|
}
|
|
674
2335
|
|
|
675
|
-
export function
|
|
676
|
-
|
|
677
|
-
|
|
2336
|
+
export function __wbg_call_7cccdd69e0791ae2() {
|
|
2337
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
2338
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
2339
|
+
return addHeapObject(ret);
|
|
2340
|
+
}, arguments);
|
|
678
2341
|
}
|
|
679
2342
|
|
|
680
|
-
export function
|
|
681
|
-
const ret =
|
|
682
|
-
return ret;
|
|
2343
|
+
export function __wbg_crypto_ed58b8e10a292839(arg0) {
|
|
2344
|
+
const ret = getObject(arg0).crypto;
|
|
2345
|
+
return addHeapObject(ret);
|
|
683
2346
|
}
|
|
684
2347
|
|
|
685
|
-
export function
|
|
686
|
-
|
|
687
|
-
return ret;
|
|
2348
|
+
export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
|
|
2349
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
688
2350
|
}
|
|
689
2351
|
|
|
690
|
-
export function
|
|
691
|
-
const ret =
|
|
2352
|
+
export function __wbg_done_769e5ede4b31c67b(arg0) {
|
|
2353
|
+
const ret = getObject(arg0).done;
|
|
692
2354
|
return ret;
|
|
693
2355
|
}
|
|
694
2356
|
|
|
695
|
-
export function
|
|
2357
|
+
export function __wbg_entries_3265d4158b33e5dc(arg0) {
|
|
696
2358
|
const ret = Object.entries(getObject(arg0));
|
|
697
2359
|
return addHeapObject(ret);
|
|
698
2360
|
}
|
|
699
2361
|
|
|
700
|
-
export function
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
2362
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
2363
|
+
let deferred0_0;
|
|
2364
|
+
let deferred0_1;
|
|
2365
|
+
try {
|
|
2366
|
+
deferred0_0 = arg0;
|
|
2367
|
+
deferred0_1 = arg1;
|
|
2368
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
2369
|
+
} finally {
|
|
2370
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2371
|
+
}
|
|
708
2372
|
}
|
|
709
2373
|
|
|
710
|
-
export function
|
|
711
|
-
|
|
712
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
713
|
-
return addHeapObject(ret);
|
|
714
|
-
}, arguments);
|
|
2374
|
+
export function __wbg_error_80de38b3f7cc3c3c(arg0, arg1, arg2, arg3) {
|
|
2375
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
715
2376
|
}
|
|
716
2377
|
|
|
717
|
-
export function
|
|
718
|
-
const ret = getObject(arg0);
|
|
2378
|
+
export function __wbg_fetch_4465c2b10f21a927(arg0) {
|
|
2379
|
+
const ret = fetch(getObject(arg0));
|
|
719
2380
|
return addHeapObject(ret);
|
|
720
2381
|
}
|
|
721
2382
|
|
|
722
|
-
export function
|
|
723
|
-
const ret =
|
|
2383
|
+
export function __wbg_fetch_509096533071c657(arg0, arg1) {
|
|
2384
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
724
2385
|
return addHeapObject(ret);
|
|
725
2386
|
}
|
|
726
2387
|
|
|
727
|
-
export function
|
|
728
|
-
|
|
2388
|
+
export function __wbg_getRandomValues_7dd14472e5bb087d() {
|
|
2389
|
+
return handleError(function (arg0, arg1) {
|
|
2390
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2391
|
+
}, arguments);
|
|
729
2392
|
}
|
|
730
2393
|
|
|
731
|
-
export function
|
|
732
|
-
return handleError(function () {
|
|
733
|
-
|
|
734
|
-
return addHeapObject(ret);
|
|
2394
|
+
export function __wbg_getRandomValues_bcb4912f16000dc4() {
|
|
2395
|
+
return handleError(function (arg0, arg1) {
|
|
2396
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
735
2397
|
}, arguments);
|
|
736
2398
|
}
|
|
737
2399
|
|
|
738
|
-
export function
|
|
739
|
-
getObject(arg0).
|
|
2400
|
+
export function __wbg_getTime_46267b1c24877e30(arg0) {
|
|
2401
|
+
const ret = getObject(arg0).getTime();
|
|
2402
|
+
return ret;
|
|
740
2403
|
}
|
|
741
2404
|
|
|
742
|
-
export function
|
|
743
|
-
|
|
2405
|
+
export function __wbg_get_67b2ba62fc30de12() {
|
|
2406
|
+
return handleError(function (arg0, arg1) {
|
|
2407
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2408
|
+
return addHeapObject(ret);
|
|
2409
|
+
}, arguments);
|
|
744
2410
|
}
|
|
745
2411
|
|
|
746
|
-
export function
|
|
747
|
-
getObject(arg0)
|
|
2412
|
+
export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
2413
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2414
|
+
return addHeapObject(ret);
|
|
748
2415
|
}
|
|
749
2416
|
|
|
750
|
-
export function
|
|
751
|
-
getObject(arg0)
|
|
2417
|
+
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
2418
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
2419
|
+
return addHeapObject(ret);
|
|
752
2420
|
}
|
|
753
2421
|
|
|
754
|
-
export function
|
|
755
|
-
|
|
2422
|
+
export function __wbg_has_a5ea9117f258a0ec() {
|
|
2423
|
+
return handleError(function (arg0, arg1) {
|
|
2424
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
2425
|
+
return ret;
|
|
2426
|
+
}, arguments);
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
export function __wbg_headers_9cb51cfd2ac780a4(arg0) {
|
|
2430
|
+
const ret = getObject(arg0).headers;
|
|
756
2431
|
return addHeapObject(ret);
|
|
757
2432
|
}
|
|
758
2433
|
|
|
759
|
-
export function
|
|
760
|
-
|
|
2434
|
+
export function __wbg_incomingmessage_new(arg0) {
|
|
2435
|
+
const ret = IncomingMessage.__wrap(arg0);
|
|
2436
|
+
return addHeapObject(ret);
|
|
761
2437
|
}
|
|
762
2438
|
|
|
763
|
-
export function
|
|
764
|
-
|
|
765
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
766
|
-
}, arguments);
|
|
2439
|
+
export function __wbg_info_033d8b8a0838f1d3(arg0, arg1, arg2, arg3) {
|
|
2440
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
767
2441
|
}
|
|
768
2442
|
|
|
769
|
-
export function
|
|
2443
|
+
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
770
2444
|
let result;
|
|
771
2445
|
try {
|
|
772
|
-
result = getObject(arg0) instanceof
|
|
2446
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
773
2447
|
} catch (_) {
|
|
774
2448
|
result = false;
|
|
775
2449
|
}
|
|
@@ -777,82 +2451,93 @@ export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
|
|
|
777
2451
|
return ret;
|
|
778
2452
|
}
|
|
779
2453
|
|
|
780
|
-
export function
|
|
781
|
-
|
|
2454
|
+
export function __wbg_instanceof_Map_f3469ce2244d2430(arg0) {
|
|
2455
|
+
let result;
|
|
2456
|
+
try {
|
|
2457
|
+
result = getObject(arg0) instanceof Map;
|
|
2458
|
+
} catch (_) {
|
|
2459
|
+
result = false;
|
|
2460
|
+
}
|
|
2461
|
+
const ret = result;
|
|
782
2462
|
return ret;
|
|
783
2463
|
}
|
|
784
2464
|
|
|
785
|
-
export function
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
2465
|
+
export function __wbg_instanceof_Response_f2cc20d9f7dfd644(arg0) {
|
|
2466
|
+
let result;
|
|
2467
|
+
try {
|
|
2468
|
+
result = getObject(arg0) instanceof Response;
|
|
2469
|
+
} catch (_) {
|
|
2470
|
+
result = false;
|
|
2471
|
+
}
|
|
2472
|
+
const ret = result;
|
|
2473
|
+
return ret;
|
|
791
2474
|
}
|
|
792
2475
|
|
|
793
|
-
export function
|
|
794
|
-
|
|
795
|
-
|
|
2476
|
+
export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
|
|
2477
|
+
let result;
|
|
2478
|
+
try {
|
|
2479
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
2480
|
+
} catch (_) {
|
|
2481
|
+
result = false;
|
|
2482
|
+
}
|
|
2483
|
+
const ret = result;
|
|
2484
|
+
return ret;
|
|
796
2485
|
}
|
|
797
2486
|
|
|
798
|
-
export function
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return addHeapObject(ret);
|
|
802
|
-
}, arguments);
|
|
2487
|
+
export function __wbg_isArray_a1eab7e0d067391b(arg0) {
|
|
2488
|
+
const ret = Array.isArray(getObject(arg0));
|
|
2489
|
+
return ret;
|
|
803
2490
|
}
|
|
804
2491
|
|
|
805
|
-
export function
|
|
806
|
-
const ret = getObject(arg0)
|
|
2492
|
+
export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
|
|
2493
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
807
2494
|
return ret;
|
|
808
2495
|
}
|
|
809
2496
|
|
|
810
|
-
export function
|
|
811
|
-
const ret =
|
|
2497
|
+
export function __wbg_iterator_9a24c88df860dc65() {
|
|
2498
|
+
const ret = Symbol.iterator;
|
|
812
2499
|
return addHeapObject(ret);
|
|
813
2500
|
}
|
|
814
2501
|
|
|
815
|
-
export function
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
return addHeapObject(ret);
|
|
819
|
-
}, arguments);
|
|
2502
|
+
export function __wbg_length_a446193dc22c12f8(arg0) {
|
|
2503
|
+
const ret = getObject(arg0).length;
|
|
2504
|
+
return ret;
|
|
820
2505
|
}
|
|
821
2506
|
|
|
822
|
-
export function
|
|
823
|
-
getObject(arg0).
|
|
2507
|
+
export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
2508
|
+
const ret = getObject(arg0).length;
|
|
2509
|
+
return ret;
|
|
824
2510
|
}
|
|
825
2511
|
|
|
826
|
-
export function
|
|
827
|
-
|
|
828
|
-
const ret = getObject(arg0).text();
|
|
829
|
-
return addHeapObject(ret);
|
|
830
|
-
}, arguments);
|
|
2512
|
+
export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
|
|
2513
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
831
2514
|
}
|
|
832
2515
|
|
|
833
|
-
export function
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
obj.a = 0;
|
|
837
|
-
return true;
|
|
838
|
-
}
|
|
839
|
-
const ret = false;
|
|
840
|
-
return ret;
|
|
2516
|
+
export function __wbg_msCrypto_0a36e2ec3a343d26(arg0) {
|
|
2517
|
+
const ret = getObject(arg0).msCrypto;
|
|
2518
|
+
return addHeapObject(ret);
|
|
841
2519
|
}
|
|
842
2520
|
|
|
843
|
-
export function
|
|
844
|
-
const ret = new
|
|
2521
|
+
export function __wbg_new0_f788a2397c7ca929() {
|
|
2522
|
+
const ret = new Date();
|
|
845
2523
|
return addHeapObject(ret);
|
|
846
2524
|
}
|
|
847
2525
|
|
|
848
|
-
export function
|
|
2526
|
+
export function __wbg_new_018dcc2d6c8c2f6a() {
|
|
2527
|
+
return handleError(function () {
|
|
2528
|
+
const ret = new Headers();
|
|
2529
|
+
return addHeapObject(ret);
|
|
2530
|
+
}, arguments);
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
849
2534
|
try {
|
|
850
2535
|
var state0 = { a: arg0, b: arg1 };
|
|
851
2536
|
var cb0 = (arg0, arg1) => {
|
|
852
2537
|
const a = state0.a;
|
|
853
2538
|
state0.a = 0;
|
|
854
2539
|
try {
|
|
855
|
-
return
|
|
2540
|
+
return __wbg_adapter_230(a, state0.b, arg0, arg1);
|
|
856
2541
|
} finally {
|
|
857
2542
|
state0.a = a;
|
|
858
2543
|
}
|
|
@@ -864,287 +2549,345 @@ export function __wbg_new_1073970097e5a420(arg0, arg1) {
|
|
|
864
2549
|
}
|
|
865
2550
|
}
|
|
866
2551
|
|
|
867
|
-
export function
|
|
868
|
-
|
|
2552
|
+
export function __wbg_new_405e22f390576ce2() {
|
|
2553
|
+
const ret = new Object();
|
|
2554
|
+
return addHeapObject(ret);
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
export function __wbg_new_78feb108b6472713() {
|
|
2558
|
+
const ret = new Array();
|
|
2559
|
+
return addHeapObject(ret);
|
|
869
2560
|
}
|
|
870
2561
|
|
|
871
|
-
export function
|
|
2562
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
872
2563
|
const ret = new Error();
|
|
873
2564
|
return addHeapObject(ret);
|
|
874
2565
|
}
|
|
875
2566
|
|
|
876
|
-
export function
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
2567
|
+
export function __wbg_new_9fd39a253424609a() {
|
|
2568
|
+
return handleError(function () {
|
|
2569
|
+
const ret = new FormData();
|
|
2570
|
+
return addHeapObject(ret);
|
|
2571
|
+
}, arguments);
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
export function __wbg_new_a12002a7f91c75be(arg0) {
|
|
2575
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
2576
|
+
return addHeapObject(ret);
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
export function __wbg_new_c68d7209be747379(arg0, arg1) {
|
|
2580
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2581
|
+
return addHeapObject(ret);
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
export function __wbg_new_e25e5aab09ff45db() {
|
|
2585
|
+
return handleError(function () {
|
|
2586
|
+
const ret = new AbortController();
|
|
2587
|
+
return addHeapObject(ret);
|
|
2588
|
+
}, arguments);
|
|
882
2589
|
}
|
|
883
2590
|
|
|
884
|
-
export function
|
|
2591
|
+
export function __wbg_new_f24b6d53abe5bc82(arg0, arg1) {
|
|
885
2592
|
let deferred0_0;
|
|
886
2593
|
let deferred0_1;
|
|
887
2594
|
try {
|
|
888
2595
|
deferred0_0 = arg0;
|
|
889
2596
|
deferred0_1 = arg1;
|
|
890
|
-
|
|
2597
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2598
|
+
return addHeapObject(ret);
|
|
891
2599
|
} finally {
|
|
892
2600
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
893
2601
|
}
|
|
894
2602
|
}
|
|
895
2603
|
|
|
896
|
-
export function
|
|
897
|
-
const ret =
|
|
2604
|
+
export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
|
|
2605
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
898
2606
|
return addHeapObject(ret);
|
|
899
2607
|
}
|
|
900
2608
|
|
|
901
|
-
export function
|
|
902
|
-
const ret = getObject(arg0)
|
|
2609
|
+
export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
|
|
2610
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
903
2611
|
return addHeapObject(ret);
|
|
904
2612
|
}
|
|
905
2613
|
|
|
906
|
-
export function
|
|
907
|
-
const ret =
|
|
2614
|
+
export function __wbg_newwithlength_a381634e90c276d4(arg0) {
|
|
2615
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
908
2616
|
return addHeapObject(ret);
|
|
909
2617
|
}
|
|
910
2618
|
|
|
911
|
-
export function
|
|
912
|
-
|
|
913
|
-
|
|
2619
|
+
export function __wbg_newwithstrandinit_06c535e0a867c635() {
|
|
2620
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
2621
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
2622
|
+
return addHeapObject(ret);
|
|
2623
|
+
}, arguments);
|
|
914
2624
|
}
|
|
915
2625
|
|
|
916
|
-
export function
|
|
917
|
-
return handleError(function () {
|
|
918
|
-
const ret =
|
|
2626
|
+
export function __wbg_newwithu8arraysequenceandoptions_068570c487f69127() {
|
|
2627
|
+
return handleError(function (arg0, arg1) {
|
|
2628
|
+
const ret = new Blob(getObject(arg0), getObject(arg1));
|
|
919
2629
|
return addHeapObject(ret);
|
|
920
2630
|
}, arguments);
|
|
921
2631
|
}
|
|
922
2632
|
|
|
923
|
-
export function
|
|
924
|
-
const ret =
|
|
925
|
-
return ret;
|
|
2633
|
+
export function __wbg_next_25feadfc0913fea9(arg0) {
|
|
2634
|
+
const ret = getObject(arg0).next;
|
|
2635
|
+
return addHeapObject(ret);
|
|
926
2636
|
}
|
|
927
2637
|
|
|
928
|
-
export function
|
|
929
|
-
|
|
930
|
-
|
|
2638
|
+
export function __wbg_next_6574e1a8a62d1055() {
|
|
2639
|
+
return handleError(function (arg0) {
|
|
2640
|
+
const ret = getObject(arg0).next();
|
|
2641
|
+
return addHeapObject(ret);
|
|
2642
|
+
}, arguments);
|
|
931
2643
|
}
|
|
932
2644
|
|
|
933
|
-
export function
|
|
934
|
-
const ret =
|
|
2645
|
+
export function __wbg_node_02999533c4ea02e3(arg0) {
|
|
2646
|
+
const ret = getObject(arg0).node;
|
|
935
2647
|
return addHeapObject(ret);
|
|
936
2648
|
}
|
|
937
2649
|
|
|
938
|
-
export function
|
|
939
|
-
|
|
2650
|
+
export function __wbg_parse_def2e24ef1252aff() {
|
|
2651
|
+
return handleError(function (arg0, arg1) {
|
|
2652
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
2653
|
+
return addHeapObject(ret);
|
|
2654
|
+
}, arguments);
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
export function __wbg_process_5c1d670bc53614b8(arg0) {
|
|
2658
|
+
const ret = getObject(arg0).process;
|
|
940
2659
|
return addHeapObject(ret);
|
|
941
2660
|
}
|
|
942
2661
|
|
|
943
|
-
export function
|
|
944
|
-
const ret = getObject(arg0).
|
|
2662
|
+
export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
|
|
2663
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
2664
|
+
return ret;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
|
|
2668
|
+
queueMicrotask(getObject(arg0));
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
export function __wbg_queueMicrotask_d3219def82552485(arg0) {
|
|
2672
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
945
2673
|
return addHeapObject(ret);
|
|
946
2674
|
}
|
|
947
2675
|
|
|
948
|
-
export function
|
|
949
|
-
|
|
2676
|
+
export function __wbg_randomFillSync_ab2cfe79ebbf2740() {
|
|
2677
|
+
return handleError(function (arg0, arg1) {
|
|
2678
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
2679
|
+
}, arguments);
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
export function __wbg_receive_9512d555fb8b5130() {
|
|
2683
|
+
return handleError(function (arg0) {
|
|
2684
|
+
const ret = getObject(arg0).receive();
|
|
2685
|
+
return addHeapObject(ret);
|
|
2686
|
+
}, arguments);
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
export function __wbg_receiveerror_new(arg0) {
|
|
2690
|
+
const ret = ReceiveError.__wrap(arg0);
|
|
950
2691
|
return addHeapObject(ret);
|
|
951
2692
|
}
|
|
952
2693
|
|
|
953
|
-
export function
|
|
954
|
-
return handleError(function (
|
|
955
|
-
|
|
2694
|
+
export function __wbg_require_79b1e9274cde3c87() {
|
|
2695
|
+
return handleError(function () {
|
|
2696
|
+
const ret = module.require;
|
|
2697
|
+
return addHeapObject(ret);
|
|
956
2698
|
}, arguments);
|
|
957
2699
|
}
|
|
958
2700
|
|
|
959
|
-
export function
|
|
960
|
-
const ret = getObject(arg0)
|
|
2701
|
+
export function __wbg_resolve_4851785c9c5f573d(arg0) {
|
|
2702
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
961
2703
|
return addHeapObject(ret);
|
|
962
2704
|
}
|
|
963
2705
|
|
|
964
|
-
export function
|
|
2706
|
+
export function __wbg_send_c9eacaae08065b18() {
|
|
965
2707
|
return handleError(function (arg0, arg1) {
|
|
966
|
-
getObject(arg0).
|
|
2708
|
+
const ret = getObject(arg0).send(OutgoingMessage.__wrap(arg1));
|
|
2709
|
+
return addHeapObject(ret);
|
|
967
2710
|
}, arguments);
|
|
968
2711
|
}
|
|
969
2712
|
|
|
970
|
-
export function
|
|
971
|
-
const ret =
|
|
2713
|
+
export function __wbg_senderror_new(arg0) {
|
|
2714
|
+
const ret = SendError.__wrap(arg0);
|
|
972
2715
|
return addHeapObject(ret);
|
|
973
2716
|
}
|
|
974
2717
|
|
|
975
|
-
export function
|
|
976
|
-
getObject(arg0)
|
|
2718
|
+
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
2719
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
977
2720
|
}
|
|
978
2721
|
|
|
979
|
-
export function
|
|
980
|
-
|
|
981
|
-
const ret = self.self;
|
|
982
|
-
return addHeapObject(ret);
|
|
983
|
-
}, arguments);
|
|
2722
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
2723
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
984
2724
|
}
|
|
985
2725
|
|
|
986
|
-
export function
|
|
987
|
-
|
|
988
|
-
const ret = window.window;
|
|
989
|
-
return addHeapObject(ret);
|
|
990
|
-
}, arguments);
|
|
2726
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
2727
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
991
2728
|
}
|
|
992
2729
|
|
|
993
|
-
export function
|
|
994
|
-
|
|
995
|
-
const ret = globalThis.globalThis;
|
|
996
|
-
return addHeapObject(ret);
|
|
997
|
-
}, arguments);
|
|
2730
|
+
export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
|
|
2731
|
+
getObject(arg0).body = getObject(arg1);
|
|
998
2732
|
}
|
|
999
2733
|
|
|
1000
|
-
export function
|
|
1001
|
-
|
|
1002
|
-
const ret = global.global;
|
|
1003
|
-
return addHeapObject(ret);
|
|
1004
|
-
}, arguments);
|
|
2734
|
+
export function __wbg_setcredentials_c3a22f1cd105a2c6(arg0, arg1) {
|
|
2735
|
+
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1005
2736
|
}
|
|
1006
2737
|
|
|
1007
|
-
export function
|
|
1008
|
-
|
|
1009
|
-
return addHeapObject(ret);
|
|
2738
|
+
export function __wbg_setheaders_834c0bdb6a8949ad(arg0, arg1) {
|
|
2739
|
+
getObject(arg0).headers = getObject(arg1);
|
|
1010
2740
|
}
|
|
1011
2741
|
|
|
1012
|
-
export function
|
|
1013
|
-
|
|
1014
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1015
|
-
return addHeapObject(ret);
|
|
1016
|
-
}, arguments);
|
|
2742
|
+
export function __wbg_setmethod_3c5280fe5d890842(arg0, arg1, arg2) {
|
|
2743
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
1017
2744
|
}
|
|
1018
2745
|
|
|
1019
|
-
export function
|
|
1020
|
-
|
|
1021
|
-
return addHeapObject(ret);
|
|
2746
|
+
export function __wbg_setmode_5dc300b865044b65(arg0, arg1) {
|
|
2747
|
+
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
1022
2748
|
}
|
|
1023
2749
|
|
|
1024
|
-
export function
|
|
1025
|
-
|
|
1026
|
-
|
|
2750
|
+
export function __wbg_setname_c0e2d6f348c746f4(arg0, arg1, arg2) {
|
|
2751
|
+
let deferred0_0;
|
|
2752
|
+
let deferred0_1;
|
|
2753
|
+
try {
|
|
2754
|
+
deferred0_0 = arg1;
|
|
2755
|
+
deferred0_1 = arg2;
|
|
2756
|
+
getObject(arg0).name = getStringFromWasm0(arg1, arg2);
|
|
2757
|
+
} finally {
|
|
2758
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2759
|
+
}
|
|
1027
2760
|
}
|
|
1028
2761
|
|
|
1029
|
-
export function
|
|
1030
|
-
|
|
1031
|
-
return addHeapObject(ret);
|
|
2762
|
+
export function __wbg_setsignal_75b21ef3a81de905(arg0, arg1) {
|
|
2763
|
+
getObject(arg0).signal = getObject(arg1);
|
|
1032
2764
|
}
|
|
1033
2765
|
|
|
1034
|
-
export function
|
|
1035
|
-
|
|
1036
|
-
return ret;
|
|
2766
|
+
export function __wbg_settype_39ed370d3edd403c(arg0, arg1, arg2) {
|
|
2767
|
+
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
|
1037
2768
|
}
|
|
1038
2769
|
|
|
1039
|
-
export function
|
|
1040
|
-
let
|
|
2770
|
+
export function __wbg_setvariant_d1d41b778dfe9c17(arg0, arg1, arg2) {
|
|
2771
|
+
let deferred0_0;
|
|
2772
|
+
let deferred0_1;
|
|
1041
2773
|
try {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
2774
|
+
deferred0_0 = arg1;
|
|
2775
|
+
deferred0_1 = arg2;
|
|
2776
|
+
getObject(arg0).variant = getStringFromWasm0(arg1, arg2);
|
|
2777
|
+
} finally {
|
|
2778
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1045
2779
|
}
|
|
1046
|
-
const ret = result;
|
|
1047
|
-
return ret;
|
|
1048
2780
|
}
|
|
1049
2781
|
|
|
1050
|
-
export function
|
|
1051
|
-
const ret =
|
|
2782
|
+
export function __wbg_signal_aaf9ad74119f20a4(arg0) {
|
|
2783
|
+
const ret = getObject(arg0).signal;
|
|
1052
2784
|
return addHeapObject(ret);
|
|
1053
2785
|
}
|
|
1054
2786
|
|
|
1055
|
-
export function
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
2787
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
2788
|
+
const ret = getObject(arg1).stack;
|
|
2789
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2790
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2791
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2792
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1060
2793
|
}
|
|
1061
2794
|
|
|
1062
|
-
export function
|
|
1063
|
-
const ret =
|
|
1064
|
-
return addHeapObject(ret);
|
|
2795
|
+
export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
|
|
2796
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
2797
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1065
2798
|
}
|
|
1066
2799
|
|
|
1067
|
-
export function
|
|
1068
|
-
const ret =
|
|
1069
|
-
return addHeapObject(ret);
|
|
2800
|
+
export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
|
|
2801
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
2802
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1070
2803
|
}
|
|
1071
2804
|
|
|
1072
|
-
export function
|
|
1073
|
-
const ret =
|
|
1074
|
-
return addHeapObject(ret);
|
|
2805
|
+
export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
|
|
2806
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
2807
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1075
2808
|
}
|
|
1076
2809
|
|
|
1077
|
-
export function
|
|
1078
|
-
const ret =
|
|
1079
|
-
return ret;
|
|
2810
|
+
export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
|
|
2811
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
2812
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1080
2813
|
}
|
|
1081
2814
|
|
|
1082
|
-
export function
|
|
1083
|
-
|
|
1084
|
-
try {
|
|
1085
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
1086
|
-
} catch (_) {
|
|
1087
|
-
result = false;
|
|
1088
|
-
}
|
|
1089
|
-
const ret = result;
|
|
2815
|
+
export function __wbg_status_f6360336ca686bf0(arg0) {
|
|
2816
|
+
const ret = getObject(arg0).status;
|
|
1090
2817
|
return ret;
|
|
1091
2818
|
}
|
|
1092
2819
|
|
|
1093
|
-
export function
|
|
1094
|
-
return handleError(function () {
|
|
1095
|
-
const ret =
|
|
2820
|
+
export function __wbg_stringify_f7ed6987935b4a24() {
|
|
2821
|
+
return handleError(function (arg0) {
|
|
2822
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
1096
2823
|
return addHeapObject(ret);
|
|
1097
2824
|
}, arguments);
|
|
1098
2825
|
}
|
|
1099
2826
|
|
|
1100
|
-
export function
|
|
1101
|
-
|
|
1102
|
-
|
|
2827
|
+
export function __wbg_subarray_aa9065fa9dc5df96(arg0, arg1, arg2) {
|
|
2828
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2829
|
+
return addHeapObject(ret);
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
export function __wbg_text_7805bea50de2af49() {
|
|
2833
|
+
return handleError(function (arg0) {
|
|
2834
|
+
const ret = getObject(arg0).text();
|
|
2835
|
+
return addHeapObject(ret);
|
|
1103
2836
|
}, arguments);
|
|
1104
2837
|
}
|
|
1105
2838
|
|
|
1106
|
-
export function
|
|
1107
|
-
getObject(arg0).
|
|
2839
|
+
export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
|
|
2840
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
2841
|
+
return addHeapObject(ret);
|
|
1108
2842
|
}
|
|
1109
2843
|
|
|
1110
|
-
export function
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
return addHeapObject(ret);
|
|
1114
|
-
}, arguments);
|
|
2844
|
+
export function __wbg_then_48b406749878a531(arg0, arg1, arg2) {
|
|
2845
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
2846
|
+
return addHeapObject(ret);
|
|
1115
2847
|
}
|
|
1116
2848
|
|
|
1117
|
-
export function
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
2849
|
+
export function __wbg_url_ae10c34ca209681d(arg0, arg1) {
|
|
2850
|
+
const ret = getObject(arg1).url;
|
|
2851
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2852
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2853
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2854
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1121
2855
|
}
|
|
1122
2856
|
|
|
1123
|
-
export function
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
getStringFromWasm0(arg1, arg2),
|
|
1127
|
-
getObject(arg3),
|
|
1128
|
-
getStringFromWasm0(arg4, arg5),
|
|
1129
|
-
);
|
|
1130
|
-
}, arguments);
|
|
2857
|
+
export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
|
|
2858
|
+
const ret = getObject(arg0).value;
|
|
2859
|
+
return addHeapObject(ret);
|
|
1131
2860
|
}
|
|
1132
2861
|
|
|
1133
|
-
export function
|
|
1134
|
-
const ret =
|
|
2862
|
+
export function __wbg_versions_c71aa1626a93e0a1(arg0) {
|
|
2863
|
+
const ret = getObject(arg0).versions;
|
|
1135
2864
|
return addHeapObject(ret);
|
|
1136
2865
|
}
|
|
1137
2866
|
|
|
1138
|
-
export function
|
|
1139
|
-
|
|
2867
|
+
export function __wbg_warn_aaf1f4664a035bd6(arg0, arg1, arg2, arg3) {
|
|
2868
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
export function __wbindgen_as_number(arg0) {
|
|
2872
|
+
const ret = +getObject(arg0);
|
|
2873
|
+
return ret;
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
export function __wbindgen_bigint_from_i64(arg0) {
|
|
2877
|
+
const ret = arg0;
|
|
1140
2878
|
return addHeapObject(ret);
|
|
1141
2879
|
}
|
|
1142
2880
|
|
|
1143
|
-
export function
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
2881
|
+
export function __wbindgen_bigint_from_u64(arg0) {
|
|
2882
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
2883
|
+
return addHeapObject(ret);
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
|
|
2887
|
+
const v = getObject(arg1);
|
|
2888
|
+
const ret = typeof v === "bigint" ? v : undefined;
|
|
2889
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2890
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1148
2891
|
}
|
|
1149
2892
|
|
|
1150
2893
|
export function __wbindgen_boolean_get(arg0) {
|
|
@@ -1153,19 +2896,19 @@ export function __wbindgen_boolean_get(arg0) {
|
|
|
1153
2896
|
return ret;
|
|
1154
2897
|
}
|
|
1155
2898
|
|
|
1156
|
-
export function
|
|
1157
|
-
const obj =
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
2899
|
+
export function __wbindgen_cb_drop(arg0) {
|
|
2900
|
+
const obj = takeObject(arg0).original;
|
|
2901
|
+
if (obj.cnt-- == 1) {
|
|
2902
|
+
obj.a = 0;
|
|
2903
|
+
return true;
|
|
2904
|
+
}
|
|
2905
|
+
const ret = false;
|
|
2906
|
+
return ret;
|
|
1161
2907
|
}
|
|
1162
2908
|
|
|
1163
|
-
export function
|
|
1164
|
-
const ret =
|
|
1165
|
-
|
|
1166
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1167
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1168
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2909
|
+
export function __wbindgen_closure_wrapper3216(arg0, arg1, arg2) {
|
|
2910
|
+
const ret = makeMutClosure(arg0, arg1, 772, __wbg_adapter_50);
|
|
2911
|
+
return addHeapObject(ret);
|
|
1169
2912
|
}
|
|
1170
2913
|
|
|
1171
2914
|
export function __wbindgen_debug_string(arg0, arg1) {
|
|
@@ -1176,47 +2919,94 @@ export function __wbindgen_debug_string(arg0, arg1) {
|
|
|
1176
2919
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1177
2920
|
}
|
|
1178
2921
|
|
|
1179
|
-
export function
|
|
1180
|
-
|
|
2922
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
2923
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2924
|
+
return addHeapObject(ret);
|
|
1181
2925
|
}
|
|
1182
2926
|
|
|
1183
|
-
export function
|
|
1184
|
-
const ret = getObject(arg0)
|
|
1185
|
-
return
|
|
2927
|
+
export function __wbindgen_in(arg0, arg1) {
|
|
2928
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
2929
|
+
return ret;
|
|
1186
2930
|
}
|
|
1187
2931
|
|
|
1188
|
-
export function
|
|
1189
|
-
|
|
2932
|
+
export function __wbindgen_is_bigint(arg0) {
|
|
2933
|
+
const ret = typeof getObject(arg0) === "bigint";
|
|
2934
|
+
return ret;
|
|
1190
2935
|
}
|
|
1191
2936
|
|
|
1192
|
-
export function
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
return addHeapObject(ret);
|
|
1196
|
-
}, arguments);
|
|
2937
|
+
export function __wbindgen_is_function(arg0) {
|
|
2938
|
+
const ret = typeof getObject(arg0) === "function";
|
|
2939
|
+
return ret;
|
|
1197
2940
|
}
|
|
1198
2941
|
|
|
1199
|
-
export function
|
|
1200
|
-
|
|
2942
|
+
export function __wbindgen_is_object(arg0) {
|
|
2943
|
+
const val = getObject(arg0);
|
|
2944
|
+
const ret = typeof val === "object" && val !== null;
|
|
2945
|
+
return ret;
|
|
1201
2946
|
}
|
|
1202
2947
|
|
|
1203
|
-
export function
|
|
1204
|
-
|
|
2948
|
+
export function __wbindgen_is_string(arg0) {
|
|
2949
|
+
const ret = typeof getObject(arg0) === "string";
|
|
2950
|
+
return ret;
|
|
1205
2951
|
}
|
|
1206
2952
|
|
|
1207
|
-
export function
|
|
1208
|
-
|
|
2953
|
+
export function __wbindgen_is_undefined(arg0) {
|
|
2954
|
+
const ret = getObject(arg0) === undefined;
|
|
2955
|
+
return ret;
|
|
1209
2956
|
}
|
|
1210
2957
|
|
|
1211
|
-
export function
|
|
1212
|
-
|
|
2958
|
+
export function __wbindgen_jsval_eq(arg0, arg1) {
|
|
2959
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
2960
|
+
return ret;
|
|
1213
2961
|
}
|
|
1214
2962
|
|
|
1215
|
-
export function
|
|
1216
|
-
|
|
2963
|
+
export function __wbindgen_jsval_loose_eq(arg0, arg1) {
|
|
2964
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
2965
|
+
return ret;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
export function __wbindgen_memory() {
|
|
2969
|
+
const ret = wasm.memory;
|
|
2970
|
+
return addHeapObject(ret);
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
export function __wbindgen_number_get(arg0, arg1) {
|
|
2974
|
+
const obj = getObject(arg1);
|
|
2975
|
+
const ret = typeof obj === "number" ? obj : undefined;
|
|
2976
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2977
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
export function __wbindgen_number_new(arg0) {
|
|
2981
|
+
const ret = arg0;
|
|
2982
|
+
return addHeapObject(ret);
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
2986
|
+
const ret = getObject(arg0);
|
|
2987
|
+
return addHeapObject(ret);
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
2991
|
+
takeObject(arg0);
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
export function __wbindgen_string_get(arg0, arg1) {
|
|
2995
|
+
const obj = getObject(arg1);
|
|
2996
|
+
const ret = typeof obj === "string" ? obj : undefined;
|
|
2997
|
+
var ptr1 = isLikeNone(ret)
|
|
2998
|
+
? 0
|
|
2999
|
+
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3000
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3001
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3002
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1217
3003
|
}
|
|
1218
3004
|
|
|
1219
|
-
export function
|
|
1220
|
-
const ret =
|
|
3005
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
3006
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1221
3007
|
return addHeapObject(ret);
|
|
1222
3008
|
}
|
|
3009
|
+
|
|
3010
|
+
export function __wbindgen_throw(arg0, arg1) {
|
|
3011
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3012
|
+
}
|