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