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