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