@bitwarden/sdk-internal 0.2.0-main.11 → 0.2.0-main.111
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 +218 -69
- package/bitwarden_wasm_internal.js +1 -0
- package/bitwarden_wasm_internal_bg.js +893 -606
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +88 -33
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +218 -69
- package/node/bitwarden_wasm_internal.js +904 -613
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +88 -33
- package/package.json +5 -4
|
@@ -3,12 +3,7 @@ export function __wbg_set_wasm(val) {
|
|
|
3
3
|
wasm = val;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
|
|
8
|
-
|
|
9
|
-
let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
10
|
-
|
|
11
|
-
cachedTextDecoder.decode();
|
|
6
|
+
let WASM_VECTOR_LEN = 0;
|
|
12
7
|
|
|
13
8
|
let cachedUint8ArrayMemory0 = null;
|
|
14
9
|
|
|
@@ -19,44 +14,6 @@ function getUint8ArrayMemory0() {
|
|
|
19
14
|
return cachedUint8ArrayMemory0;
|
|
20
15
|
}
|
|
21
16
|
|
|
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
17
|
const lTextEncoder =
|
|
61
18
|
typeof TextEncoder === "undefined" ? (0, module.require)("util").TextEncoder : TextEncoder;
|
|
62
19
|
|
|
@@ -116,10 +73,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
116
73
|
return ptr;
|
|
117
74
|
}
|
|
118
75
|
|
|
119
|
-
function isLikeNone(x) {
|
|
120
|
-
return x === undefined || x === null;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
76
|
let cachedDataViewMemory0 = null;
|
|
124
77
|
|
|
125
78
|
function getDataViewMemory0() {
|
|
@@ -134,6 +87,69 @@ function getDataViewMemory0() {
|
|
|
134
87
|
return cachedDataViewMemory0;
|
|
135
88
|
}
|
|
136
89
|
|
|
90
|
+
const lTextDecoder =
|
|
91
|
+
typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
|
|
92
|
+
|
|
93
|
+
let cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
94
|
+
|
|
95
|
+
cachedTextDecoder.decode();
|
|
96
|
+
|
|
97
|
+
function getStringFromWasm0(ptr, len) {
|
|
98
|
+
ptr = ptr >>> 0;
|
|
99
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function addToExternrefTable0(obj) {
|
|
103
|
+
const idx = wasm.__externref_table_alloc();
|
|
104
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
105
|
+
return idx;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function handleError(f, args) {
|
|
109
|
+
try {
|
|
110
|
+
return f.apply(this, args);
|
|
111
|
+
} catch (e) {
|
|
112
|
+
const idx = addToExternrefTable0(e);
|
|
113
|
+
wasm.__wbindgen_exn_store(idx);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function isLikeNone(x) {
|
|
118
|
+
return x === undefined || x === null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const CLOSURE_DTORS =
|
|
122
|
+
typeof FinalizationRegistry === "undefined"
|
|
123
|
+
? { register: () => {}, unregister: () => {} }
|
|
124
|
+
: new FinalizationRegistry((state) => {
|
|
125
|
+
wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
129
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
130
|
+
const real = (...args) => {
|
|
131
|
+
// First up with a closure we increment the internal reference
|
|
132
|
+
// count. This ensures that the Rust closure environment won't
|
|
133
|
+
// be deallocated while we're invoking it.
|
|
134
|
+
state.cnt++;
|
|
135
|
+
const a = state.a;
|
|
136
|
+
state.a = 0;
|
|
137
|
+
try {
|
|
138
|
+
return f(a, state.b, ...args);
|
|
139
|
+
} finally {
|
|
140
|
+
if (--state.cnt === 0) {
|
|
141
|
+
wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
|
|
142
|
+
CLOSURE_DTORS.unregister(state);
|
|
143
|
+
} else {
|
|
144
|
+
state.a = a;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
real.original = state;
|
|
149
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
150
|
+
return real;
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
function debugString(val) {
|
|
138
154
|
// primitive types
|
|
139
155
|
const type = typeof val;
|
|
@@ -175,7 +191,7 @@ function debugString(val) {
|
|
|
175
191
|
// Test for built-in
|
|
176
192
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
177
193
|
let className;
|
|
178
|
-
if (builtInMatches.length > 1) {
|
|
194
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
179
195
|
className = builtInMatches[1];
|
|
180
196
|
} else {
|
|
181
197
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -198,141 +214,198 @@ function debugString(val) {
|
|
|
198
214
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
199
215
|
return className;
|
|
200
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* @param {any} error
|
|
219
|
+
* @returns {boolean}
|
|
220
|
+
*/
|
|
221
|
+
export function isEncryptionSettingsError(error) {
|
|
222
|
+
const ret = wasm.isEncryptionSettingsError(error);
|
|
223
|
+
return ret !== 0;
|
|
224
|
+
}
|
|
201
225
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
226
|
+
/**
|
|
227
|
+
* @param {any} error
|
|
228
|
+
* @returns {boolean}
|
|
229
|
+
*/
|
|
230
|
+
export function isCryptoError(error) {
|
|
231
|
+
const ret = wasm.isCryptoError(error);
|
|
232
|
+
return ret !== 0;
|
|
233
|
+
}
|
|
208
234
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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;
|
|
235
|
+
/**
|
|
236
|
+
* @param {any} error
|
|
237
|
+
* @returns {boolean}
|
|
238
|
+
*/
|
|
239
|
+
export function isSshKeyExportError(error) {
|
|
240
|
+
const ret = wasm.isSshKeyExportError(error);
|
|
241
|
+
return ret !== 0;
|
|
232
242
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @param {any} error
|
|
246
|
+
* @returns {boolean}
|
|
247
|
+
*/
|
|
248
|
+
export function isSshKeyImportError(error) {
|
|
249
|
+
const ret = wasm.isSshKeyImportError(error);
|
|
250
|
+
return ret !== 0;
|
|
239
251
|
}
|
|
240
252
|
|
|
241
|
-
|
|
253
|
+
/**
|
|
254
|
+
* @param {any} error
|
|
255
|
+
* @returns {boolean}
|
|
256
|
+
*/
|
|
257
|
+
export function isKeyGenerationError(error) {
|
|
258
|
+
const ret = wasm.isKeyGenerationError(error);
|
|
259
|
+
return ret !== 0;
|
|
260
|
+
}
|
|
242
261
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
262
|
+
/**
|
|
263
|
+
* @param {any} error
|
|
264
|
+
* @returns {boolean}
|
|
265
|
+
*/
|
|
266
|
+
export function isDecryptFileError(error) {
|
|
267
|
+
const ret = wasm.isDecryptFileError(error);
|
|
268
|
+
return ret !== 0;
|
|
247
269
|
}
|
|
270
|
+
|
|
248
271
|
/**
|
|
249
272
|
* @param {any} error
|
|
250
273
|
* @returns {boolean}
|
|
251
274
|
*/
|
|
252
|
-
export function
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return ret !== 0;
|
|
256
|
-
} finally {
|
|
257
|
-
heap[stack_pointer++] = undefined;
|
|
258
|
-
}
|
|
275
|
+
export function isEncryptFileError(error) {
|
|
276
|
+
const ret = wasm.isEncryptFileError(error);
|
|
277
|
+
return ret !== 0;
|
|
259
278
|
}
|
|
260
279
|
|
|
261
280
|
/**
|
|
262
281
|
* @param {any} error
|
|
263
282
|
* @returns {boolean}
|
|
264
283
|
*/
|
|
265
|
-
export function
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return ret !== 0;
|
|
269
|
-
} finally {
|
|
270
|
-
heap[stack_pointer++] = undefined;
|
|
271
|
-
}
|
|
284
|
+
export function isDecryptError(error) {
|
|
285
|
+
const ret = wasm.isDecryptError(error);
|
|
286
|
+
return ret !== 0;
|
|
272
287
|
}
|
|
273
288
|
|
|
274
289
|
/**
|
|
275
290
|
* @param {any} error
|
|
276
291
|
* @returns {boolean}
|
|
277
292
|
*/
|
|
278
|
-
export function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return ret !== 0;
|
|
282
|
-
} finally {
|
|
283
|
-
heap[stack_pointer++] = undefined;
|
|
284
|
-
}
|
|
293
|
+
export function isEncryptError(error) {
|
|
294
|
+
const ret = wasm.isEncryptError(error);
|
|
295
|
+
return ret !== 0;
|
|
285
296
|
}
|
|
286
297
|
|
|
287
298
|
/**
|
|
288
299
|
* @param {any} error
|
|
289
300
|
* @returns {boolean}
|
|
290
301
|
*/
|
|
291
|
-
export function
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
302
|
+
export function isTotpError(error) {
|
|
303
|
+
const ret = wasm.isTotpError(error);
|
|
304
|
+
return ret !== 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function takeFromExternrefTable0(idx) {
|
|
308
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
309
|
+
wasm.__externref_table_dealloc(idx);
|
|
310
|
+
return value;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @param {LogLevel} level
|
|
314
|
+
*/
|
|
315
|
+
export function set_log_level(level) {
|
|
316
|
+
wasm.set_log_level(level);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @param {LogLevel | null} [log_level]
|
|
321
|
+
*/
|
|
322
|
+
export function init_sdk(log_level) {
|
|
323
|
+
wasm.init_sdk(isLikeNone(log_level) ? 5 : log_level);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
327
|
+
ptr = ptr >>> 0;
|
|
328
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
298
329
|
}
|
|
299
330
|
|
|
331
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
332
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
333
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
334
|
+
WASM_VECTOR_LEN = arg.length;
|
|
335
|
+
return ptr;
|
|
336
|
+
}
|
|
300
337
|
/**
|
|
338
|
+
* Generate a new SSH key pair
|
|
339
|
+
*
|
|
340
|
+
* # Arguments
|
|
341
|
+
* - `key_algorithm` - The algorithm to use for the key pair
|
|
342
|
+
*
|
|
343
|
+
* # Returns
|
|
344
|
+
* - `Ok(SshKey)` if the key was successfully generated
|
|
345
|
+
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
301
346
|
* @param {KeyAlgorithm} key_algorithm
|
|
302
|
-
* @returns {
|
|
347
|
+
* @returns {SshKeyView}
|
|
303
348
|
*/
|
|
304
349
|
export function generate_ssh_key(key_algorithm) {
|
|
305
|
-
|
|
306
|
-
|
|
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);
|
|
315
|
-
} finally {
|
|
316
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
350
|
+
const ret = wasm.generate_ssh_key(key_algorithm);
|
|
351
|
+
if (ret[2]) {
|
|
352
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
317
353
|
}
|
|
354
|
+
return takeFromExternrefTable0(ret[0]);
|
|
318
355
|
}
|
|
319
356
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
357
|
+
/**
|
|
358
|
+
* Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
|
|
359
|
+
* to an OpenSSH private key with public key and fingerprint
|
|
360
|
+
*
|
|
361
|
+
* # Arguments
|
|
362
|
+
* - `imported_key` - The private key to convert
|
|
363
|
+
* - `password` - The password to use for decrypting the key
|
|
364
|
+
*
|
|
365
|
+
* # Returns
|
|
366
|
+
* - `Ok(SshKey)` if the key was successfully coneverted
|
|
367
|
+
* - `Err(PasswordRequired)` if the key is encrypted and no password was provided
|
|
368
|
+
* - `Err(WrongPassword)` if the password provided is incorrect
|
|
369
|
+
* - `Err(ParsingError)` if the key could not be parsed
|
|
370
|
+
* - `Err(UnsupportedKeyType)` if the key type is not supported
|
|
371
|
+
* @param {string} imported_key
|
|
372
|
+
* @param {string | null} [password]
|
|
373
|
+
* @returns {SshKeyView}
|
|
374
|
+
*/
|
|
375
|
+
export function import_ssh_key(imported_key, password) {
|
|
376
|
+
const ptr0 = passStringToWasm0(imported_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
377
|
+
const len0 = WASM_VECTOR_LEN;
|
|
378
|
+
var ptr1 = isLikeNone(password)
|
|
379
|
+
? 0
|
|
380
|
+
: passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
381
|
+
var len1 = WASM_VECTOR_LEN;
|
|
382
|
+
const ret = wasm.import_ssh_key(ptr0, len0, ptr1, len1);
|
|
383
|
+
if (ret[2]) {
|
|
384
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
325
385
|
}
|
|
386
|
+
return takeFromExternrefTable0(ret[0]);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @param {any} error
|
|
391
|
+
* @returns {boolean}
|
|
392
|
+
*/
|
|
393
|
+
export function isTestError(error) {
|
|
394
|
+
const ret = wasm.isTestError(error);
|
|
395
|
+
return ret !== 0;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function __wbg_adapter_42(arg0, arg1, arg2) {
|
|
399
|
+
wasm.closure545_externref_shim(arg0, arg1, arg2);
|
|
326
400
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
arg1,
|
|
331
|
-
addHeapObject(arg2),
|
|
332
|
-
addHeapObject(arg3),
|
|
333
|
-
);
|
|
401
|
+
|
|
402
|
+
function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
|
|
403
|
+
wasm.closure403_externref_shim(arg0, arg1, arg2, arg3);
|
|
334
404
|
}
|
|
335
405
|
|
|
406
|
+
/**
|
|
407
|
+
* @enum {0 | 1 | 2 | 3 | 4}
|
|
408
|
+
*/
|
|
336
409
|
export const LogLevel = Object.freeze({
|
|
337
410
|
Trace: 0,
|
|
338
411
|
0: "Trace",
|
|
@@ -368,14 +441,10 @@ export class BitwardenClient {
|
|
|
368
441
|
wasm.__wbg_bitwardenclient_free(ptr, 0);
|
|
369
442
|
}
|
|
370
443
|
/**
|
|
371
|
-
* @param {ClientSettings |
|
|
372
|
-
* @param {LogLevel | undefined} [log_level]
|
|
444
|
+
* @param {ClientSettings | null} [settings]
|
|
373
445
|
*/
|
|
374
|
-
constructor(settings
|
|
375
|
-
const ret = wasm.bitwardenclient_new(
|
|
376
|
-
isLikeNone(settings) ? 0 : addHeapObject(settings),
|
|
377
|
-
isLikeNone(log_level) ? 5 : log_level,
|
|
378
|
-
);
|
|
446
|
+
constructor(settings) {
|
|
447
|
+
const ret = wasm.bitwardenclient_new(isLikeNone(settings) ? 0 : addToExternrefTable0(settings));
|
|
379
448
|
this.__wbg_ptr = ret >>> 0;
|
|
380
449
|
BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
|
|
381
450
|
return this;
|
|
@@ -389,17 +458,13 @@ export class BitwardenClient {
|
|
|
389
458
|
let deferred2_0;
|
|
390
459
|
let deferred2_1;
|
|
391
460
|
try {
|
|
392
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
393
461
|
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
394
462
|
const len0 = WASM_VECTOR_LEN;
|
|
395
|
-
wasm.bitwardenclient_echo(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
deferred2_1 = r1;
|
|
400
|
-
return getStringFromWasm0(r0, r1);
|
|
463
|
+
const ret = wasm.bitwardenclient_echo(this.__wbg_ptr, ptr0, len0);
|
|
464
|
+
deferred2_0 = ret[0];
|
|
465
|
+
deferred2_1 = ret[1];
|
|
466
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
401
467
|
} finally {
|
|
402
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
403
468
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
404
469
|
}
|
|
405
470
|
}
|
|
@@ -410,27 +475,24 @@ export class BitwardenClient {
|
|
|
410
475
|
let deferred1_0;
|
|
411
476
|
let deferred1_1;
|
|
412
477
|
try {
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
deferred1_0 = r0;
|
|
418
|
-
deferred1_1 = r1;
|
|
419
|
-
return getStringFromWasm0(r0, r1);
|
|
478
|
+
const ret = wasm.bitwardenclient_version(this.__wbg_ptr);
|
|
479
|
+
deferred1_0 = ret[0];
|
|
480
|
+
deferred1_1 = ret[1];
|
|
481
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
420
482
|
} finally {
|
|
421
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
422
483
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
423
484
|
}
|
|
424
485
|
}
|
|
425
486
|
/**
|
|
426
487
|
* @param {string} msg
|
|
427
|
-
* @returns {Promise<void>}
|
|
428
488
|
*/
|
|
429
489
|
throw(msg) {
|
|
430
490
|
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
431
491
|
const len0 = WASM_VECTOR_LEN;
|
|
432
492
|
const ret = wasm.bitwardenclient_throw(this.__wbg_ptr, ptr0, len0);
|
|
433
|
-
|
|
493
|
+
if (ret[1]) {
|
|
494
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
495
|
+
}
|
|
434
496
|
}
|
|
435
497
|
/**
|
|
436
498
|
* Test method, calls http endpoint
|
|
@@ -441,335 +503,521 @@ export class BitwardenClient {
|
|
|
441
503
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
504
|
const len0 = WASM_VECTOR_LEN;
|
|
443
505
|
const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
|
|
444
|
-
return
|
|
506
|
+
return ret;
|
|
445
507
|
}
|
|
446
508
|
/**
|
|
447
|
-
* @returns {
|
|
509
|
+
* @returns {CryptoClient}
|
|
448
510
|
*/
|
|
449
511
|
crypto() {
|
|
450
512
|
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
451
|
-
return
|
|
513
|
+
return CryptoClient.__wrap(ret);
|
|
452
514
|
}
|
|
453
515
|
/**
|
|
454
|
-
* @returns {
|
|
516
|
+
* @returns {VaultClient}
|
|
455
517
|
*/
|
|
456
518
|
vault() {
|
|
457
519
|
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
458
|
-
return
|
|
520
|
+
return VaultClient.__wrap(ret);
|
|
459
521
|
}
|
|
460
522
|
}
|
|
461
523
|
|
|
462
|
-
const
|
|
524
|
+
const ClientFoldersFinalization =
|
|
463
525
|
typeof FinalizationRegistry === "undefined"
|
|
464
526
|
? { register: () => {}, unregister: () => {} }
|
|
465
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
527
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
|
|
466
528
|
|
|
467
|
-
export class
|
|
529
|
+
export class ClientFolders {
|
|
468
530
|
static __wrap(ptr) {
|
|
469
531
|
ptr = ptr >>> 0;
|
|
470
|
-
const obj = Object.create(
|
|
532
|
+
const obj = Object.create(ClientFolders.prototype);
|
|
471
533
|
obj.__wbg_ptr = ptr;
|
|
472
|
-
|
|
534
|
+
ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
473
535
|
return obj;
|
|
474
536
|
}
|
|
475
537
|
|
|
476
538
|
__destroy_into_raw() {
|
|
477
539
|
const ptr = this.__wbg_ptr;
|
|
478
540
|
this.__wbg_ptr = 0;
|
|
479
|
-
|
|
541
|
+
ClientFoldersFinalization.unregister(this);
|
|
480
542
|
return ptr;
|
|
481
543
|
}
|
|
482
544
|
|
|
483
545
|
free() {
|
|
484
546
|
const ptr = this.__destroy_into_raw();
|
|
485
|
-
wasm.
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Initialization method for the user crypto. Needs to be called before any other crypto
|
|
489
|
-
* operations.
|
|
490
|
-
* @param {InitUserCryptoRequest} req
|
|
491
|
-
* @returns {Promise<void>}
|
|
492
|
-
*/
|
|
493
|
-
initialize_user_crypto(req) {
|
|
494
|
-
const ret = wasm.clientcrypto_initialize_user_crypto(this.__wbg_ptr, addHeapObject(req));
|
|
495
|
-
return takeObject(ret);
|
|
547
|
+
wasm.__wbg_clientfolders_free(ptr, 0);
|
|
496
548
|
}
|
|
497
549
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* @
|
|
501
|
-
* @returns {Promise<void>}
|
|
550
|
+
* Decrypt folder
|
|
551
|
+
* @param {Folder} folder
|
|
552
|
+
* @returns {FolderView}
|
|
502
553
|
*/
|
|
503
|
-
|
|
504
|
-
const ret = wasm.
|
|
505
|
-
|
|
554
|
+
decrypt(folder) {
|
|
555
|
+
const ret = wasm.clientfolders_decrypt(this.__wbg_ptr, folder);
|
|
556
|
+
if (ret[2]) {
|
|
557
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
558
|
+
}
|
|
559
|
+
return takeFromExternrefTable0(ret[0]);
|
|
506
560
|
}
|
|
507
561
|
}
|
|
508
562
|
|
|
509
|
-
const
|
|
563
|
+
const ClientTotpFinalization =
|
|
510
564
|
typeof FinalizationRegistry === "undefined"
|
|
511
565
|
? { register: () => {}, unregister: () => {} }
|
|
512
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
566
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
|
|
513
567
|
|
|
514
|
-
export class
|
|
568
|
+
export class ClientTotp {
|
|
515
569
|
static __wrap(ptr) {
|
|
516
570
|
ptr = ptr >>> 0;
|
|
517
|
-
const obj = Object.create(
|
|
571
|
+
const obj = Object.create(ClientTotp.prototype);
|
|
518
572
|
obj.__wbg_ptr = ptr;
|
|
519
|
-
|
|
573
|
+
ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
520
574
|
return obj;
|
|
521
575
|
}
|
|
522
576
|
|
|
523
577
|
__destroy_into_raw() {
|
|
524
578
|
const ptr = this.__wbg_ptr;
|
|
525
579
|
this.__wbg_ptr = 0;
|
|
526
|
-
|
|
580
|
+
ClientTotpFinalization.unregister(this);
|
|
527
581
|
return ptr;
|
|
528
582
|
}
|
|
529
583
|
|
|
530
584
|
free() {
|
|
531
585
|
const ptr = this.__destroy_into_raw();
|
|
532
|
-
wasm.
|
|
586
|
+
wasm.__wbg_clienttotp_free(ptr, 0);
|
|
533
587
|
}
|
|
534
588
|
/**
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*
|
|
589
|
+
* Generates a TOTP code from a provided key
|
|
590
|
+
*
|
|
591
|
+
* # Arguments
|
|
592
|
+
* - `key` - Can be:
|
|
593
|
+
* - A base32 encoded string
|
|
594
|
+
* - OTP Auth URI
|
|
595
|
+
* - Steam URI
|
|
596
|
+
* - `time_ms` - Optional timestamp in milliseconds
|
|
597
|
+
*
|
|
598
|
+
* # Returns
|
|
599
|
+
* - `Ok(TotpResponse)` containing the generated code and period
|
|
600
|
+
* - `Err(TotpError)` if code generation fails
|
|
601
|
+
* @param {string} key
|
|
602
|
+
* @param {number | null} [time_ms]
|
|
603
|
+
* @returns {TotpResponse}
|
|
538
604
|
*/
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
605
|
+
generate_totp(key, time_ms) {
|
|
606
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
607
|
+
const len0 = WASM_VECTOR_LEN;
|
|
608
|
+
const ret = wasm.clienttotp_generate_totp(
|
|
609
|
+
this.__wbg_ptr,
|
|
610
|
+
ptr0,
|
|
611
|
+
len0,
|
|
612
|
+
!isLikeNone(time_ms),
|
|
613
|
+
isLikeNone(time_ms) ? 0 : time_ms,
|
|
614
|
+
);
|
|
615
|
+
if (ret[2]) {
|
|
616
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
552
617
|
}
|
|
618
|
+
return takeFromExternrefTable0(ret[0]);
|
|
553
619
|
}
|
|
554
620
|
}
|
|
555
621
|
|
|
556
|
-
const
|
|
622
|
+
const CryptoClientFinalization =
|
|
557
623
|
typeof FinalizationRegistry === "undefined"
|
|
558
624
|
? { register: () => {}, unregister: () => {} }
|
|
559
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
625
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_cryptoclient_free(ptr >>> 0, 1));
|
|
560
626
|
|
|
561
|
-
export class
|
|
627
|
+
export class CryptoClient {
|
|
562
628
|
static __wrap(ptr) {
|
|
563
629
|
ptr = ptr >>> 0;
|
|
564
|
-
const obj = Object.create(
|
|
630
|
+
const obj = Object.create(CryptoClient.prototype);
|
|
565
631
|
obj.__wbg_ptr = ptr;
|
|
566
|
-
|
|
632
|
+
CryptoClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
567
633
|
return obj;
|
|
568
634
|
}
|
|
569
635
|
|
|
570
636
|
__destroy_into_raw() {
|
|
571
637
|
const ptr = this.__wbg_ptr;
|
|
572
638
|
this.__wbg_ptr = 0;
|
|
573
|
-
|
|
639
|
+
CryptoClientFinalization.unregister(this);
|
|
574
640
|
return ptr;
|
|
575
641
|
}
|
|
576
642
|
|
|
577
643
|
free() {
|
|
578
644
|
const ptr = this.__destroy_into_raw();
|
|
579
|
-
wasm.
|
|
645
|
+
wasm.__wbg_cryptoclient_free(ptr, 0);
|
|
580
646
|
}
|
|
581
647
|
/**
|
|
582
|
-
*
|
|
648
|
+
* Initialization method for the user crypto. Needs to be called before any other crypto
|
|
649
|
+
* operations.
|
|
650
|
+
* @param {InitUserCryptoRequest} req
|
|
651
|
+
* @returns {Promise<void>}
|
|
583
652
|
*/
|
|
584
|
-
|
|
585
|
-
const ret = wasm.
|
|
586
|
-
return
|
|
653
|
+
initialize_user_crypto(req) {
|
|
654
|
+
const ret = wasm.cryptoclient_initialize_user_crypto(this.__wbg_ptr, req);
|
|
655
|
+
return ret;
|
|
587
656
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
657
|
+
/**
|
|
658
|
+
* Initialization method for the organization crypto. Needs to be called after
|
|
659
|
+
* `initialize_user_crypto` but before any other crypto operations.
|
|
660
|
+
* @param {InitOrgCryptoRequest} req
|
|
661
|
+
* @returns {Promise<void>}
|
|
662
|
+
*/
|
|
663
|
+
initialize_org_crypto(req) {
|
|
664
|
+
const ret = wasm.cryptoclient_initialize_org_crypto(this.__wbg_ptr, req);
|
|
665
|
+
return ret;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Generates a new key pair and encrypts the private key with the provided user key.
|
|
669
|
+
* Crypto initialization not required.
|
|
670
|
+
* @param {string} user_key
|
|
671
|
+
* @returns {MakeKeyPairResponse}
|
|
672
|
+
*/
|
|
673
|
+
make_key_pair(user_key) {
|
|
674
|
+
const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
675
|
+
const len0 = WASM_VECTOR_LEN;
|
|
676
|
+
const ret = wasm.cryptoclient_make_key_pair(this.__wbg_ptr, ptr0, len0);
|
|
677
|
+
if (ret[2]) {
|
|
678
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
679
|
+
}
|
|
680
|
+
return takeFromExternrefTable0(ret[0]);
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Verifies a user's asymmetric keys by decrypting the private key with the provided user
|
|
684
|
+
* key. Returns if the private key is decryptable and if it is a valid matching key.
|
|
685
|
+
* Crypto initialization not required.
|
|
686
|
+
* @param {VerifyAsymmetricKeysRequest} request
|
|
687
|
+
* @returns {VerifyAsymmetricKeysResponse}
|
|
688
|
+
*/
|
|
689
|
+
verify_asymmetric_keys(request) {
|
|
690
|
+
const ret = wasm.cryptoclient_verify_asymmetric_keys(this.__wbg_ptr, request);
|
|
691
|
+
if (ret[2]) {
|
|
692
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
693
|
+
}
|
|
694
|
+
return takeFromExternrefTable0(ret[0]);
|
|
600
695
|
}
|
|
601
696
|
}
|
|
602
697
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
698
|
+
const PureCryptoFinalization =
|
|
699
|
+
typeof FinalizationRegistry === "undefined"
|
|
700
|
+
? { register: () => {}, unregister: () => {} }
|
|
701
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_purecrypto_free(ptr >>> 0, 1));
|
|
702
|
+
/**
|
|
703
|
+
* This module represents a stopgap solution to provide access to primitive crypto functions for JS
|
|
704
|
+
* clients. It is not intended to be used outside of the JS clients and this pattern should not be
|
|
705
|
+
* proliferated. It is necessary because we want to use SDK crypto prior to the SDK being fully
|
|
706
|
+
* responsible for state and keys.
|
|
707
|
+
*/
|
|
708
|
+
export class PureCrypto {
|
|
709
|
+
__destroy_into_raw() {
|
|
710
|
+
const ptr = this.__wbg_ptr;
|
|
711
|
+
this.__wbg_ptr = 0;
|
|
712
|
+
PureCryptoFinalization.unregister(this);
|
|
713
|
+
return ptr;
|
|
612
714
|
}
|
|
613
|
-
}
|
|
614
715
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
716
|
+
free() {
|
|
717
|
+
const ptr = this.__destroy_into_raw();
|
|
718
|
+
wasm.__wbg_purecrypto_free(ptr, 0);
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* @param {string} enc_string
|
|
722
|
+
* @param {string} key_b64
|
|
723
|
+
* @returns {string}
|
|
724
|
+
*/
|
|
725
|
+
static symmetric_decrypt(enc_string, key_b64) {
|
|
726
|
+
let deferred4_0;
|
|
727
|
+
let deferred4_1;
|
|
728
|
+
try {
|
|
729
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
730
|
+
const len0 = WASM_VECTOR_LEN;
|
|
731
|
+
const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
732
|
+
const len1 = WASM_VECTOR_LEN;
|
|
733
|
+
const ret = wasm.purecrypto_symmetric_decrypt(ptr0, len0, ptr1, len1);
|
|
734
|
+
var ptr3 = ret[0];
|
|
735
|
+
var len3 = ret[1];
|
|
736
|
+
if (ret[3]) {
|
|
737
|
+
ptr3 = 0;
|
|
738
|
+
len3 = 0;
|
|
739
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
740
|
+
}
|
|
741
|
+
deferred4_0 = ptr3;
|
|
742
|
+
deferred4_1 = len3;
|
|
743
|
+
return getStringFromWasm0(ptr3, len3);
|
|
744
|
+
} finally {
|
|
745
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* @param {string} enc_string
|
|
750
|
+
* @param {string} key_b64
|
|
751
|
+
* @returns {Uint8Array}
|
|
752
|
+
*/
|
|
753
|
+
static symmetric_decrypt_to_bytes(enc_string, key_b64) {
|
|
754
|
+
const ptr0 = passStringToWasm0(enc_string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
755
|
+
const len0 = WASM_VECTOR_LEN;
|
|
756
|
+
const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
757
|
+
const len1 = WASM_VECTOR_LEN;
|
|
758
|
+
const ret = wasm.purecrypto_symmetric_decrypt_to_bytes(ptr0, len0, ptr1, len1);
|
|
759
|
+
if (ret[3]) {
|
|
760
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
761
|
+
}
|
|
762
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
763
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
764
|
+
return v3;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* @param {Uint8Array} enc_bytes
|
|
768
|
+
* @param {string} key_b64
|
|
769
|
+
* @returns {Uint8Array}
|
|
770
|
+
*/
|
|
771
|
+
static symmetric_decrypt_array_buffer(enc_bytes, key_b64) {
|
|
772
|
+
const ptr0 = passArray8ToWasm0(enc_bytes, wasm.__wbindgen_malloc);
|
|
773
|
+
const len0 = WASM_VECTOR_LEN;
|
|
774
|
+
const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
775
|
+
const len1 = WASM_VECTOR_LEN;
|
|
776
|
+
const ret = wasm.purecrypto_symmetric_decrypt_array_buffer(ptr0, len0, ptr1, len1);
|
|
777
|
+
if (ret[3]) {
|
|
778
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
779
|
+
}
|
|
780
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
781
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
782
|
+
return v3;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* @param {string} plain
|
|
786
|
+
* @param {string} key_b64
|
|
787
|
+
* @returns {string}
|
|
788
|
+
*/
|
|
789
|
+
static symmetric_encrypt(plain, key_b64) {
|
|
790
|
+
let deferred4_0;
|
|
791
|
+
let deferred4_1;
|
|
792
|
+
try {
|
|
793
|
+
const ptr0 = passStringToWasm0(plain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
794
|
+
const len0 = WASM_VECTOR_LEN;
|
|
795
|
+
const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
796
|
+
const len1 = WASM_VECTOR_LEN;
|
|
797
|
+
const ret = wasm.purecrypto_symmetric_encrypt(ptr0, len0, ptr1, len1);
|
|
798
|
+
var ptr3 = ret[0];
|
|
799
|
+
var len3 = ret[1];
|
|
800
|
+
if (ret[3]) {
|
|
801
|
+
ptr3 = 0;
|
|
802
|
+
len3 = 0;
|
|
803
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
804
|
+
}
|
|
805
|
+
deferred4_0 = ptr3;
|
|
806
|
+
deferred4_1 = len3;
|
|
807
|
+
return getStringFromWasm0(ptr3, len3);
|
|
808
|
+
} finally {
|
|
809
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* @param {Uint8Array} plain
|
|
814
|
+
* @param {string} key_b64
|
|
815
|
+
* @returns {Uint8Array}
|
|
816
|
+
*/
|
|
817
|
+
static symmetric_encrypt_to_array_buffer(plain, key_b64) {
|
|
818
|
+
const ptr0 = passArray8ToWasm0(plain, wasm.__wbindgen_malloc);
|
|
819
|
+
const len0 = WASM_VECTOR_LEN;
|
|
820
|
+
const ptr1 = passStringToWasm0(key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
821
|
+
const len1 = WASM_VECTOR_LEN;
|
|
822
|
+
const ret = wasm.purecrypto_symmetric_encrypt_to_array_buffer(ptr0, len0, ptr1, len1);
|
|
823
|
+
if (ret[3]) {
|
|
824
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
825
|
+
}
|
|
826
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
827
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
828
|
+
return v3;
|
|
624
829
|
}
|
|
625
830
|
}
|
|
626
831
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
832
|
+
const VaultClientFinalization =
|
|
833
|
+
typeof FinalizationRegistry === "undefined"
|
|
834
|
+
? { register: () => {}, unregister: () => {} }
|
|
835
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_vaultclient_free(ptr >>> 0, 1));
|
|
631
836
|
|
|
632
|
-
export
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
837
|
+
export class VaultClient {
|
|
838
|
+
static __wrap(ptr) {
|
|
839
|
+
ptr = ptr >>> 0;
|
|
840
|
+
const obj = Object.create(VaultClient.prototype);
|
|
841
|
+
obj.__wbg_ptr = ptr;
|
|
842
|
+
VaultClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
843
|
+
return obj;
|
|
844
|
+
}
|
|
638
845
|
|
|
639
|
-
|
|
640
|
-
|
|
846
|
+
__destroy_into_raw() {
|
|
847
|
+
const ptr = this.__wbg_ptr;
|
|
848
|
+
this.__wbg_ptr = 0;
|
|
849
|
+
VaultClientFinalization.unregister(this);
|
|
850
|
+
return ptr;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
free() {
|
|
854
|
+
const ptr = this.__destroy_into_raw();
|
|
855
|
+
wasm.__wbg_vaultclient_free(ptr, 0);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* @returns {ClientFolders}
|
|
859
|
+
*/
|
|
860
|
+
folders() {
|
|
861
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
862
|
+
return ClientFolders.__wrap(ret);
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* @returns {ClientTotp}
|
|
866
|
+
*/
|
|
867
|
+
totp() {
|
|
868
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
869
|
+
return ClientTotp.__wrap(ret);
|
|
870
|
+
}
|
|
641
871
|
}
|
|
642
872
|
|
|
643
|
-
export function
|
|
644
|
-
const
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
? 0
|
|
648
|
-
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
649
|
-
var len1 = WASM_VECTOR_LEN;
|
|
873
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
874
|
+
const ret = String(arg1);
|
|
875
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
876
|
+
const len1 = WASM_VECTOR_LEN;
|
|
650
877
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
651
878
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
652
879
|
}
|
|
653
880
|
|
|
654
|
-
export function
|
|
655
|
-
|
|
656
|
-
return ret;
|
|
881
|
+
export function __wbg_abort_775ef1d17fc65868(arg0) {
|
|
882
|
+
arg0.abort();
|
|
657
883
|
}
|
|
658
884
|
|
|
659
|
-
export function
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
885
|
+
export function __wbg_append_299d5d48292c0495() {
|
|
886
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
887
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
888
|
+
}, arguments);
|
|
663
889
|
}
|
|
664
890
|
|
|
665
|
-
export function
|
|
666
|
-
|
|
667
|
-
|
|
891
|
+
export function __wbg_append_8c7dd8d641a5f01b() {
|
|
892
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
893
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
894
|
+
}, arguments);
|
|
668
895
|
}
|
|
669
896
|
|
|
670
|
-
export function
|
|
671
|
-
|
|
672
|
-
|
|
897
|
+
export function __wbg_append_b2d1fc16de2a0e81() {
|
|
898
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
899
|
+
arg0.append(getStringFromWasm0(arg1, arg2), arg3, getStringFromWasm0(arg4, arg5));
|
|
900
|
+
}, arguments);
|
|
673
901
|
}
|
|
674
902
|
|
|
675
|
-
export function
|
|
676
|
-
|
|
677
|
-
|
|
903
|
+
export function __wbg_append_b44785ebeb668479() {
|
|
904
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
905
|
+
arg0.append(getStringFromWasm0(arg1, arg2), arg3);
|
|
906
|
+
}, arguments);
|
|
678
907
|
}
|
|
679
908
|
|
|
680
|
-
export function
|
|
681
|
-
const ret =
|
|
909
|
+
export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
|
910
|
+
const ret = arg0.buffer;
|
|
682
911
|
return ret;
|
|
683
912
|
}
|
|
684
913
|
|
|
685
|
-
export function
|
|
686
|
-
|
|
687
|
-
|
|
914
|
+
export function __wbg_call_672a4d21634d4a24() {
|
|
915
|
+
return handleError(function (arg0, arg1) {
|
|
916
|
+
const ret = arg0.call(arg1);
|
|
917
|
+
return ret;
|
|
918
|
+
}, arguments);
|
|
688
919
|
}
|
|
689
920
|
|
|
690
|
-
export function
|
|
691
|
-
|
|
921
|
+
export function __wbg_call_7cccdd69e0791ae2() {
|
|
922
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
923
|
+
const ret = arg0.call(arg1, arg2);
|
|
924
|
+
return ret;
|
|
925
|
+
}, arguments);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
export function __wbg_crypto_ed58b8e10a292839(arg0) {
|
|
929
|
+
const ret = arg0.crypto;
|
|
692
930
|
return ret;
|
|
693
931
|
}
|
|
694
932
|
|
|
695
|
-
export function
|
|
696
|
-
|
|
697
|
-
return addHeapObject(ret);
|
|
933
|
+
export function __wbg_debug_e17b51583ca6a632(arg0, arg1, arg2, arg3) {
|
|
934
|
+
console.debug(arg0, arg1, arg2, arg3);
|
|
698
935
|
}
|
|
699
936
|
|
|
700
|
-
export function
|
|
701
|
-
const ret =
|
|
937
|
+
export function __wbg_done_769e5ede4b31c67b(arg0) {
|
|
938
|
+
const ret = arg0.done;
|
|
702
939
|
return ret;
|
|
703
940
|
}
|
|
704
941
|
|
|
705
|
-
export function
|
|
706
|
-
const ret =
|
|
707
|
-
return
|
|
942
|
+
export function __wbg_entries_3265d4158b33e5dc(arg0) {
|
|
943
|
+
const ret = Object.entries(arg0);
|
|
944
|
+
return ret;
|
|
708
945
|
}
|
|
709
946
|
|
|
710
|
-
export function
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
947
|
+
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
948
|
+
let deferred0_0;
|
|
949
|
+
let deferred0_1;
|
|
950
|
+
try {
|
|
951
|
+
deferred0_0 = arg0;
|
|
952
|
+
deferred0_1 = arg1;
|
|
953
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
954
|
+
} finally {
|
|
955
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
956
|
+
}
|
|
715
957
|
}
|
|
716
958
|
|
|
717
|
-
export function
|
|
718
|
-
|
|
719
|
-
return addHeapObject(ret);
|
|
959
|
+
export function __wbg_error_80de38b3f7cc3c3c(arg0, arg1, arg2, arg3) {
|
|
960
|
+
console.error(arg0, arg1, arg2, arg3);
|
|
720
961
|
}
|
|
721
962
|
|
|
722
|
-
export function
|
|
723
|
-
const ret =
|
|
724
|
-
return
|
|
963
|
+
export function __wbg_fetch_4465c2b10f21a927(arg0) {
|
|
964
|
+
const ret = fetch(arg0);
|
|
965
|
+
return ret;
|
|
725
966
|
}
|
|
726
967
|
|
|
727
|
-
export function
|
|
728
|
-
|
|
968
|
+
export function __wbg_fetch_509096533071c657(arg0, arg1) {
|
|
969
|
+
const ret = arg0.fetch(arg1);
|
|
970
|
+
return ret;
|
|
729
971
|
}
|
|
730
972
|
|
|
731
|
-
export function
|
|
732
|
-
return handleError(function () {
|
|
733
|
-
|
|
734
|
-
return addHeapObject(ret);
|
|
973
|
+
export function __wbg_getRandomValues_bcb4912f16000dc4() {
|
|
974
|
+
return handleError(function (arg0, arg1) {
|
|
975
|
+
arg0.getRandomValues(arg1);
|
|
735
976
|
}, arguments);
|
|
736
977
|
}
|
|
737
978
|
|
|
738
|
-
export function
|
|
739
|
-
|
|
979
|
+
export function __wbg_getTime_46267b1c24877e30(arg0) {
|
|
980
|
+
const ret = arg0.getTime();
|
|
981
|
+
return ret;
|
|
740
982
|
}
|
|
741
983
|
|
|
742
|
-
export function
|
|
743
|
-
|
|
984
|
+
export function __wbg_get_67b2ba62fc30de12() {
|
|
985
|
+
return handleError(function (arg0, arg1) {
|
|
986
|
+
const ret = Reflect.get(arg0, arg1);
|
|
987
|
+
return ret;
|
|
988
|
+
}, arguments);
|
|
744
989
|
}
|
|
745
990
|
|
|
746
|
-
export function
|
|
747
|
-
|
|
991
|
+
export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
992
|
+
const ret = arg0[arg1 >>> 0];
|
|
993
|
+
return ret;
|
|
748
994
|
}
|
|
749
995
|
|
|
750
|
-
export function
|
|
751
|
-
|
|
996
|
+
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
997
|
+
const ret = arg0[arg1];
|
|
998
|
+
return ret;
|
|
752
999
|
}
|
|
753
1000
|
|
|
754
|
-
export function
|
|
755
|
-
|
|
756
|
-
|
|
1001
|
+
export function __wbg_has_a5ea9117f258a0ec() {
|
|
1002
|
+
return handleError(function (arg0, arg1) {
|
|
1003
|
+
const ret = Reflect.has(arg0, arg1);
|
|
1004
|
+
return ret;
|
|
1005
|
+
}, arguments);
|
|
757
1006
|
}
|
|
758
1007
|
|
|
759
|
-
export function
|
|
760
|
-
|
|
1008
|
+
export function __wbg_headers_9cb51cfd2ac780a4(arg0) {
|
|
1009
|
+
const ret = arg0.headers;
|
|
1010
|
+
return ret;
|
|
761
1011
|
}
|
|
762
1012
|
|
|
763
|
-
export function
|
|
764
|
-
|
|
765
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
766
|
-
}, arguments);
|
|
1013
|
+
export function __wbg_info_033d8b8a0838f1d3(arg0, arg1, arg2, arg3) {
|
|
1014
|
+
console.info(arg0, arg1, arg2, arg3);
|
|
767
1015
|
}
|
|
768
1016
|
|
|
769
|
-
export function
|
|
1017
|
+
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
770
1018
|
let result;
|
|
771
1019
|
try {
|
|
772
|
-
result =
|
|
1020
|
+
result = arg0 instanceof ArrayBuffer;
|
|
773
1021
|
} catch (_) {
|
|
774
1022
|
result = false;
|
|
775
1023
|
}
|
|
@@ -777,446 +1025,485 @@ export function __wbg_instanceof_Response_3c0e210a57ff751d(arg0) {
|
|
|
777
1025
|
return ret;
|
|
778
1026
|
}
|
|
779
1027
|
|
|
780
|
-
export function
|
|
781
|
-
|
|
1028
|
+
export function __wbg_instanceof_Response_f2cc20d9f7dfd644(arg0) {
|
|
1029
|
+
let result;
|
|
1030
|
+
try {
|
|
1031
|
+
result = arg0 instanceof Response;
|
|
1032
|
+
} catch (_) {
|
|
1033
|
+
result = false;
|
|
1034
|
+
}
|
|
1035
|
+
const ret = result;
|
|
782
1036
|
return ret;
|
|
783
1037
|
}
|
|
784
1038
|
|
|
785
|
-
export function
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
const ret = getObject(arg0).headers;
|
|
795
|
-
return addHeapObject(ret);
|
|
1039
|
+
export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
|
|
1040
|
+
let result;
|
|
1041
|
+
try {
|
|
1042
|
+
result = arg0 instanceof Uint8Array;
|
|
1043
|
+
} catch (_) {
|
|
1044
|
+
result = false;
|
|
1045
|
+
}
|
|
1046
|
+
const ret = result;
|
|
1047
|
+
return ret;
|
|
796
1048
|
}
|
|
797
1049
|
|
|
798
|
-
export function
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return addHeapObject(ret);
|
|
802
|
-
}, arguments);
|
|
1050
|
+
export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
|
|
1051
|
+
const ret = Number.isSafeInteger(arg0);
|
|
1052
|
+
return ret;
|
|
803
1053
|
}
|
|
804
1054
|
|
|
805
|
-
export function
|
|
806
|
-
const ret =
|
|
1055
|
+
export function __wbg_iterator_9a24c88df860dc65() {
|
|
1056
|
+
const ret = Symbol.iterator;
|
|
807
1057
|
return ret;
|
|
808
1058
|
}
|
|
809
1059
|
|
|
810
|
-
export function
|
|
811
|
-
const ret =
|
|
812
|
-
return
|
|
1060
|
+
export function __wbg_length_a446193dc22c12f8(arg0) {
|
|
1061
|
+
const ret = arg0.length;
|
|
1062
|
+
return ret;
|
|
813
1063
|
}
|
|
814
1064
|
|
|
815
|
-
export function
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
return addHeapObject(ret);
|
|
819
|
-
}, arguments);
|
|
1065
|
+
export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
1066
|
+
const ret = arg0.length;
|
|
1067
|
+
return ret;
|
|
820
1068
|
}
|
|
821
1069
|
|
|
822
|
-
export function
|
|
823
|
-
|
|
1070
|
+
export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
|
|
1071
|
+
console.log(arg0, arg1, arg2, arg3);
|
|
824
1072
|
}
|
|
825
1073
|
|
|
826
|
-
export function
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return addHeapObject(ret);
|
|
830
|
-
}, arguments);
|
|
1074
|
+
export function __wbg_msCrypto_0a36e2ec3a343d26(arg0) {
|
|
1075
|
+
const ret = arg0.msCrypto;
|
|
1076
|
+
return ret;
|
|
831
1077
|
}
|
|
832
1078
|
|
|
833
|
-
export function
|
|
834
|
-
const
|
|
835
|
-
if (obj.cnt-- == 1) {
|
|
836
|
-
obj.a = 0;
|
|
837
|
-
return true;
|
|
838
|
-
}
|
|
839
|
-
const ret = false;
|
|
1079
|
+
export function __wbg_new0_f788a2397c7ca929() {
|
|
1080
|
+
const ret = new Date();
|
|
840
1081
|
return ret;
|
|
841
1082
|
}
|
|
842
1083
|
|
|
843
|
-
export function
|
|
844
|
-
|
|
845
|
-
|
|
1084
|
+
export function __wbg_new_018dcc2d6c8c2f6a() {
|
|
1085
|
+
return handleError(function () {
|
|
1086
|
+
const ret = new Headers();
|
|
1087
|
+
return ret;
|
|
1088
|
+
}, arguments);
|
|
846
1089
|
}
|
|
847
1090
|
|
|
848
|
-
export function
|
|
1091
|
+
export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
849
1092
|
try {
|
|
850
1093
|
var state0 = { a: arg0, b: arg1 };
|
|
851
1094
|
var cb0 = (arg0, arg1) => {
|
|
852
1095
|
const a = state0.a;
|
|
853
1096
|
state0.a = 0;
|
|
854
1097
|
try {
|
|
855
|
-
return
|
|
1098
|
+
return __wbg_adapter_152(a, state0.b, arg0, arg1);
|
|
856
1099
|
} finally {
|
|
857
1100
|
state0.a = a;
|
|
858
1101
|
}
|
|
859
1102
|
};
|
|
860
1103
|
const ret = new Promise(cb0);
|
|
861
|
-
return
|
|
1104
|
+
return ret;
|
|
862
1105
|
} finally {
|
|
863
1106
|
state0.a = state0.b = 0;
|
|
864
1107
|
}
|
|
865
1108
|
}
|
|
866
1109
|
|
|
867
|
-
export function
|
|
868
|
-
|
|
1110
|
+
export function __wbg_new_405e22f390576ce2() {
|
|
1111
|
+
const ret = new Object();
|
|
1112
|
+
return ret;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export function __wbg_new_78feb108b6472713() {
|
|
1116
|
+
const ret = new Array();
|
|
1117
|
+
return ret;
|
|
869
1118
|
}
|
|
870
1119
|
|
|
871
|
-
export function
|
|
1120
|
+
export function __wbg_new_8a6f238a6ece86ea() {
|
|
872
1121
|
const ret = new Error();
|
|
873
|
-
return
|
|
1122
|
+
return ret;
|
|
874
1123
|
}
|
|
875
1124
|
|
|
876
|
-
export function
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
1125
|
+
export function __wbg_new_9fd39a253424609a() {
|
|
1126
|
+
return handleError(function () {
|
|
1127
|
+
const ret = new FormData();
|
|
1128
|
+
return ret;
|
|
1129
|
+
}, arguments);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
export function __wbg_new_a12002a7f91c75be(arg0) {
|
|
1133
|
+
const ret = new Uint8Array(arg0);
|
|
1134
|
+
return ret;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
export function __wbg_new_c68d7209be747379(arg0, arg1) {
|
|
1138
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1139
|
+
return ret;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export function __wbg_new_e25e5aab09ff45db() {
|
|
1143
|
+
return handleError(function () {
|
|
1144
|
+
const ret = new AbortController();
|
|
1145
|
+
return ret;
|
|
1146
|
+
}, arguments);
|
|
882
1147
|
}
|
|
883
1148
|
|
|
884
|
-
export function
|
|
1149
|
+
export function __wbg_new_f24b6d53abe5bc82(arg0, arg1) {
|
|
885
1150
|
let deferred0_0;
|
|
886
1151
|
let deferred0_1;
|
|
887
1152
|
try {
|
|
888
1153
|
deferred0_0 = arg0;
|
|
889
1154
|
deferred0_1 = arg1;
|
|
890
|
-
|
|
1155
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1156
|
+
return ret;
|
|
891
1157
|
} finally {
|
|
892
1158
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
893
1159
|
}
|
|
894
1160
|
}
|
|
895
1161
|
|
|
896
|
-
export function
|
|
897
|
-
const ret =
|
|
898
|
-
return
|
|
1162
|
+
export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
|
|
1163
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1164
|
+
return ret;
|
|
899
1165
|
}
|
|
900
1166
|
|
|
901
|
-
export function
|
|
902
|
-
const ret =
|
|
903
|
-
return
|
|
1167
|
+
export function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
|
|
1168
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
1169
|
+
return ret;
|
|
904
1170
|
}
|
|
905
1171
|
|
|
906
|
-
export function
|
|
907
|
-
const ret =
|
|
908
|
-
return
|
|
1172
|
+
export function __wbg_newwithlength_a381634e90c276d4(arg0) {
|
|
1173
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1174
|
+
return ret;
|
|
909
1175
|
}
|
|
910
1176
|
|
|
911
|
-
export function
|
|
912
|
-
|
|
913
|
-
|
|
1177
|
+
export function __wbg_newwithstrandinit_06c535e0a867c635() {
|
|
1178
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
1179
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
1180
|
+
return ret;
|
|
1181
|
+
}, arguments);
|
|
914
1182
|
}
|
|
915
1183
|
|
|
916
|
-
export function
|
|
917
|
-
return handleError(function () {
|
|
918
|
-
const ret =
|
|
919
|
-
return
|
|
1184
|
+
export function __wbg_newwithu8arraysequenceandoptions_068570c487f69127() {
|
|
1185
|
+
return handleError(function (arg0, arg1) {
|
|
1186
|
+
const ret = new Blob(arg0, arg1);
|
|
1187
|
+
return ret;
|
|
920
1188
|
}, arguments);
|
|
921
1189
|
}
|
|
922
1190
|
|
|
923
|
-
export function
|
|
924
|
-
const ret =
|
|
1191
|
+
export function __wbg_next_25feadfc0913fea9(arg0) {
|
|
1192
|
+
const ret = arg0.next;
|
|
925
1193
|
return ret;
|
|
926
1194
|
}
|
|
927
1195
|
|
|
928
|
-
export function
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
export function __wbg_newwithlength_76462a666eca145f(arg0) {
|
|
934
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
935
|
-
return addHeapObject(ret);
|
|
1196
|
+
export function __wbg_next_6574e1a8a62d1055() {
|
|
1197
|
+
return handleError(function (arg0) {
|
|
1198
|
+
const ret = arg0.next();
|
|
1199
|
+
return ret;
|
|
1200
|
+
}, arguments);
|
|
936
1201
|
}
|
|
937
1202
|
|
|
938
|
-
export function
|
|
939
|
-
const ret =
|
|
940
|
-
return
|
|
1203
|
+
export function __wbg_node_02999533c4ea02e3(arg0) {
|
|
1204
|
+
const ret = arg0.node;
|
|
1205
|
+
return ret;
|
|
941
1206
|
}
|
|
942
1207
|
|
|
943
|
-
export function
|
|
944
|
-
const ret =
|
|
945
|
-
return
|
|
1208
|
+
export function __wbg_process_5c1d670bc53614b8(arg0) {
|
|
1209
|
+
const ret = arg0.process;
|
|
1210
|
+
return ret;
|
|
946
1211
|
}
|
|
947
1212
|
|
|
948
|
-
export function
|
|
949
|
-
const ret =
|
|
950
|
-
return
|
|
1213
|
+
export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
|
|
1214
|
+
const ret = arg0.push(arg1);
|
|
1215
|
+
return ret;
|
|
951
1216
|
}
|
|
952
1217
|
|
|
953
|
-
export function
|
|
954
|
-
|
|
955
|
-
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
956
|
-
}, arguments);
|
|
1218
|
+
export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
|
|
1219
|
+
queueMicrotask(arg0);
|
|
957
1220
|
}
|
|
958
1221
|
|
|
959
|
-
export function
|
|
960
|
-
const ret =
|
|
961
|
-
return
|
|
1222
|
+
export function __wbg_queueMicrotask_d3219def82552485(arg0) {
|
|
1223
|
+
const ret = arg0.queueMicrotask;
|
|
1224
|
+
return ret;
|
|
962
1225
|
}
|
|
963
1226
|
|
|
964
|
-
export function
|
|
1227
|
+
export function __wbg_randomFillSync_ab2cfe79ebbf2740() {
|
|
965
1228
|
return handleError(function (arg0, arg1) {
|
|
966
|
-
|
|
1229
|
+
arg0.randomFillSync(arg1);
|
|
967
1230
|
}, arguments);
|
|
968
1231
|
}
|
|
969
1232
|
|
|
970
|
-
export function
|
|
971
|
-
|
|
972
|
-
|
|
1233
|
+
export function __wbg_require_79b1e9274cde3c87() {
|
|
1234
|
+
return handleError(function () {
|
|
1235
|
+
const ret = module.require;
|
|
1236
|
+
return ret;
|
|
1237
|
+
}, arguments);
|
|
973
1238
|
}
|
|
974
1239
|
|
|
975
|
-
export function
|
|
976
|
-
|
|
1240
|
+
export function __wbg_resolve_4851785c9c5f573d(arg0) {
|
|
1241
|
+
const ret = Promise.resolve(arg0);
|
|
1242
|
+
return ret;
|
|
977
1243
|
}
|
|
978
1244
|
|
|
979
|
-
export function
|
|
980
|
-
|
|
981
|
-
const ret = self.self;
|
|
982
|
-
return addHeapObject(ret);
|
|
983
|
-
}, arguments);
|
|
1245
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
1246
|
+
arg0[arg1] = arg2;
|
|
984
1247
|
}
|
|
985
1248
|
|
|
986
|
-
export function
|
|
987
|
-
|
|
988
|
-
const ret = window.window;
|
|
989
|
-
return addHeapObject(ret);
|
|
990
|
-
}, arguments);
|
|
1249
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
1250
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
991
1251
|
}
|
|
992
1252
|
|
|
993
|
-
export function
|
|
994
|
-
|
|
995
|
-
const ret = globalThis.globalThis;
|
|
996
|
-
return addHeapObject(ret);
|
|
997
|
-
}, arguments);
|
|
1253
|
+
export function __wbg_setbody_5923b78a95eedf29(arg0, arg1) {
|
|
1254
|
+
arg0.body = arg1;
|
|
998
1255
|
}
|
|
999
1256
|
|
|
1000
|
-
export function
|
|
1001
|
-
|
|
1002
|
-
const ret = global.global;
|
|
1003
|
-
return addHeapObject(ret);
|
|
1004
|
-
}, arguments);
|
|
1257
|
+
export function __wbg_setcredentials_c3a22f1cd105a2c6(arg0, arg1) {
|
|
1258
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1005
1259
|
}
|
|
1006
1260
|
|
|
1007
|
-
export function
|
|
1008
|
-
|
|
1009
|
-
return addHeapObject(ret);
|
|
1261
|
+
export function __wbg_setheaders_834c0bdb6a8949ad(arg0, arg1) {
|
|
1262
|
+
arg0.headers = arg1;
|
|
1010
1263
|
}
|
|
1011
1264
|
|
|
1012
|
-
export function
|
|
1013
|
-
|
|
1014
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1015
|
-
return addHeapObject(ret);
|
|
1016
|
-
}, arguments);
|
|
1265
|
+
export function __wbg_setmethod_3c5280fe5d890842(arg0, arg1, arg2) {
|
|
1266
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
1017
1267
|
}
|
|
1018
1268
|
|
|
1019
|
-
export function
|
|
1020
|
-
|
|
1021
|
-
return addHeapObject(ret);
|
|
1269
|
+
export function __wbg_setmode_5dc300b865044b65(arg0, arg1) {
|
|
1270
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
1022
1271
|
}
|
|
1023
1272
|
|
|
1024
|
-
export function
|
|
1025
|
-
|
|
1026
|
-
|
|
1273
|
+
export function __wbg_setname_c0e2d6f348c746f4(arg0, arg1, arg2) {
|
|
1274
|
+
let deferred0_0;
|
|
1275
|
+
let deferred0_1;
|
|
1276
|
+
try {
|
|
1277
|
+
deferred0_0 = arg1;
|
|
1278
|
+
deferred0_1 = arg2;
|
|
1279
|
+
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
1280
|
+
} finally {
|
|
1281
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1282
|
+
}
|
|
1027
1283
|
}
|
|
1028
1284
|
|
|
1029
|
-
export function
|
|
1030
|
-
|
|
1031
|
-
return addHeapObject(ret);
|
|
1285
|
+
export function __wbg_setsignal_75b21ef3a81de905(arg0, arg1) {
|
|
1286
|
+
arg0.signal = arg1;
|
|
1032
1287
|
}
|
|
1033
1288
|
|
|
1034
|
-
export function
|
|
1035
|
-
|
|
1036
|
-
return ret;
|
|
1289
|
+
export function __wbg_settype_39ed370d3edd403c(arg0, arg1, arg2) {
|
|
1290
|
+
arg0.type = getStringFromWasm0(arg1, arg2);
|
|
1037
1291
|
}
|
|
1038
1292
|
|
|
1039
|
-
export function
|
|
1040
|
-
let
|
|
1293
|
+
export function __wbg_setvariant_d1d41b778dfe9c17(arg0, arg1, arg2) {
|
|
1294
|
+
let deferred0_0;
|
|
1295
|
+
let deferred0_1;
|
|
1041
1296
|
try {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1297
|
+
deferred0_0 = arg1;
|
|
1298
|
+
deferred0_1 = arg2;
|
|
1299
|
+
arg0.variant = getStringFromWasm0(arg1, arg2);
|
|
1300
|
+
} finally {
|
|
1301
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1045
1302
|
}
|
|
1046
|
-
const ret = result;
|
|
1047
|
-
return ret;
|
|
1048
1303
|
}
|
|
1049
1304
|
|
|
1050
|
-
export function
|
|
1051
|
-
const ret =
|
|
1052
|
-
return
|
|
1305
|
+
export function __wbg_signal_aaf9ad74119f20a4(arg0) {
|
|
1306
|
+
const ret = arg0.signal;
|
|
1307
|
+
return ret;
|
|
1053
1308
|
}
|
|
1054
1309
|
|
|
1055
|
-
export function
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1310
|
+
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
1311
|
+
const ret = arg1.stack;
|
|
1312
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1313
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1314
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1315
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1060
1316
|
}
|
|
1061
1317
|
|
|
1062
|
-
export function
|
|
1063
|
-
const ret =
|
|
1064
|
-
return
|
|
1318
|
+
export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
|
|
1319
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
1320
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1065
1321
|
}
|
|
1066
1322
|
|
|
1067
|
-
export function
|
|
1068
|
-
const ret =
|
|
1069
|
-
return
|
|
1323
|
+
export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
|
|
1324
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
1325
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1070
1326
|
}
|
|
1071
1327
|
|
|
1072
|
-
export function
|
|
1073
|
-
const ret =
|
|
1074
|
-
return
|
|
1328
|
+
export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
|
|
1329
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
1330
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1075
1331
|
}
|
|
1076
1332
|
|
|
1077
|
-
export function
|
|
1078
|
-
const ret =
|
|
1079
|
-
return ret;
|
|
1333
|
+
export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
|
|
1334
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
1335
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1080
1336
|
}
|
|
1081
1337
|
|
|
1082
|
-
export function
|
|
1083
|
-
|
|
1084
|
-
try {
|
|
1085
|
-
result = getObject(arg0) instanceof Uint8Array;
|
|
1086
|
-
} catch (_) {
|
|
1087
|
-
result = false;
|
|
1088
|
-
}
|
|
1089
|
-
const ret = result;
|
|
1338
|
+
export function __wbg_status_f6360336ca686bf0(arg0) {
|
|
1339
|
+
const ret = arg0.status;
|
|
1090
1340
|
return ret;
|
|
1091
1341
|
}
|
|
1092
1342
|
|
|
1093
|
-
export function
|
|
1094
|
-
return handleError(function () {
|
|
1095
|
-
const ret =
|
|
1096
|
-
return
|
|
1343
|
+
export function __wbg_stringify_f7ed6987935b4a24() {
|
|
1344
|
+
return handleError(function (arg0) {
|
|
1345
|
+
const ret = JSON.stringify(arg0);
|
|
1346
|
+
return ret;
|
|
1097
1347
|
}, arguments);
|
|
1098
1348
|
}
|
|
1099
1349
|
|
|
1100
|
-
export function
|
|
1101
|
-
|
|
1102
|
-
|
|
1350
|
+
export function __wbg_subarray_aa9065fa9dc5df96(arg0, arg1, arg2) {
|
|
1351
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1352
|
+
return ret;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
export function __wbg_text_7805bea50de2af49() {
|
|
1356
|
+
return handleError(function (arg0) {
|
|
1357
|
+
const ret = arg0.text();
|
|
1358
|
+
return ret;
|
|
1103
1359
|
}, arguments);
|
|
1104
1360
|
}
|
|
1105
1361
|
|
|
1106
|
-
export function
|
|
1107
|
-
|
|
1362
|
+
export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
|
|
1363
|
+
const ret = arg0.then(arg1);
|
|
1364
|
+
return ret;
|
|
1108
1365
|
}
|
|
1109
1366
|
|
|
1110
|
-
export function
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
return addHeapObject(ret);
|
|
1114
|
-
}, arguments);
|
|
1367
|
+
export function __wbg_then_48b406749878a531(arg0, arg1, arg2) {
|
|
1368
|
+
const ret = arg0.then(arg1, arg2);
|
|
1369
|
+
return ret;
|
|
1115
1370
|
}
|
|
1116
1371
|
|
|
1117
|
-
export function
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1372
|
+
export function __wbg_url_ae10c34ca209681d(arg0, arg1) {
|
|
1373
|
+
const ret = arg1.url;
|
|
1374
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1375
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1376
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1377
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1121
1378
|
}
|
|
1122
1379
|
|
|
1123
|
-
export function
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
getStringFromWasm0(arg1, arg2),
|
|
1127
|
-
getObject(arg3),
|
|
1128
|
-
getStringFromWasm0(arg4, arg5),
|
|
1129
|
-
);
|
|
1130
|
-
}, arguments);
|
|
1380
|
+
export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
|
|
1381
|
+
const ret = arg0.value;
|
|
1382
|
+
return ret;
|
|
1131
1383
|
}
|
|
1132
1384
|
|
|
1133
|
-
export function
|
|
1134
|
-
const ret =
|
|
1135
|
-
return
|
|
1385
|
+
export function __wbg_versions_c71aa1626a93e0a1(arg0) {
|
|
1386
|
+
const ret = arg0.versions;
|
|
1387
|
+
return ret;
|
|
1136
1388
|
}
|
|
1137
1389
|
|
|
1138
|
-
export function
|
|
1139
|
-
|
|
1140
|
-
return addHeapObject(ret);
|
|
1390
|
+
export function __wbg_warn_aaf1f4664a035bd6(arg0, arg1, arg2, arg3) {
|
|
1391
|
+
console.warn(arg0, arg1, arg2, arg3);
|
|
1141
1392
|
}
|
|
1142
1393
|
|
|
1143
|
-
export function
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
return addHeapObject(ret);
|
|
1147
|
-
}, arguments);
|
|
1394
|
+
export function __wbindgen_as_number(arg0) {
|
|
1395
|
+
const ret = +arg0;
|
|
1396
|
+
return ret;
|
|
1148
1397
|
}
|
|
1149
1398
|
|
|
1150
1399
|
export function __wbindgen_boolean_get(arg0) {
|
|
1151
|
-
const v =
|
|
1400
|
+
const v = arg0;
|
|
1152
1401
|
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
|
1153
1402
|
return ret;
|
|
1154
1403
|
}
|
|
1155
1404
|
|
|
1156
|
-
export function
|
|
1157
|
-
const obj =
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1405
|
+
export function __wbindgen_cb_drop(arg0) {
|
|
1406
|
+
const obj = arg0.original;
|
|
1407
|
+
if (obj.cnt-- == 1) {
|
|
1408
|
+
obj.a = 0;
|
|
1409
|
+
return true;
|
|
1410
|
+
}
|
|
1411
|
+
const ret = false;
|
|
1412
|
+
return ret;
|
|
1161
1413
|
}
|
|
1162
1414
|
|
|
1163
|
-
export function
|
|
1164
|
-
const ret =
|
|
1165
|
-
|
|
1166
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1167
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1168
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1415
|
+
export function __wbindgen_closure_wrapper2146(arg0, arg1, arg2) {
|
|
1416
|
+
const ret = makeMutClosure(arg0, arg1, 546, __wbg_adapter_42);
|
|
1417
|
+
return ret;
|
|
1169
1418
|
}
|
|
1170
1419
|
|
|
1171
1420
|
export function __wbindgen_debug_string(arg0, arg1) {
|
|
1172
|
-
const ret = debugString(
|
|
1421
|
+
const ret = debugString(arg1);
|
|
1173
1422
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1174
1423
|
const len1 = WASM_VECTOR_LEN;
|
|
1175
1424
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1176
1425
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1177
1426
|
}
|
|
1178
1427
|
|
|
1179
|
-
export function
|
|
1180
|
-
|
|
1428
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
1429
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1430
|
+
return ret;
|
|
1181
1431
|
}
|
|
1182
1432
|
|
|
1183
|
-
export function
|
|
1184
|
-
const ret =
|
|
1185
|
-
return
|
|
1433
|
+
export function __wbindgen_in(arg0, arg1) {
|
|
1434
|
+
const ret = arg0 in arg1;
|
|
1435
|
+
return ret;
|
|
1186
1436
|
}
|
|
1187
1437
|
|
|
1188
|
-
export function
|
|
1189
|
-
|
|
1438
|
+
export function __wbindgen_init_externref_table() {
|
|
1439
|
+
const table = wasm.__wbindgen_export_4;
|
|
1440
|
+
const offset = table.grow(4);
|
|
1441
|
+
table.set(0, undefined);
|
|
1442
|
+
table.set(offset + 0, undefined);
|
|
1443
|
+
table.set(offset + 1, null);
|
|
1444
|
+
table.set(offset + 2, true);
|
|
1445
|
+
table.set(offset + 3, false);
|
|
1190
1446
|
}
|
|
1191
1447
|
|
|
1192
|
-
export function
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
return addHeapObject(ret);
|
|
1196
|
-
}, arguments);
|
|
1448
|
+
export function __wbindgen_is_function(arg0) {
|
|
1449
|
+
const ret = typeof arg0 === "function";
|
|
1450
|
+
return ret;
|
|
1197
1451
|
}
|
|
1198
1452
|
|
|
1199
|
-
export function
|
|
1200
|
-
|
|
1453
|
+
export function __wbindgen_is_object(arg0) {
|
|
1454
|
+
const val = arg0;
|
|
1455
|
+
const ret = typeof val === "object" && val !== null;
|
|
1456
|
+
return ret;
|
|
1201
1457
|
}
|
|
1202
1458
|
|
|
1203
|
-
export function
|
|
1204
|
-
|
|
1459
|
+
export function __wbindgen_is_string(arg0) {
|
|
1460
|
+
const ret = typeof arg0 === "string";
|
|
1461
|
+
return ret;
|
|
1205
1462
|
}
|
|
1206
1463
|
|
|
1207
|
-
export function
|
|
1208
|
-
|
|
1464
|
+
export function __wbindgen_is_undefined(arg0) {
|
|
1465
|
+
const ret = arg0 === undefined;
|
|
1466
|
+
return ret;
|
|
1209
1467
|
}
|
|
1210
1468
|
|
|
1211
|
-
export function
|
|
1212
|
-
|
|
1469
|
+
export function __wbindgen_jsval_loose_eq(arg0, arg1) {
|
|
1470
|
+
const ret = arg0 == arg1;
|
|
1471
|
+
return ret;
|
|
1213
1472
|
}
|
|
1214
1473
|
|
|
1215
|
-
export function
|
|
1216
|
-
|
|
1474
|
+
export function __wbindgen_memory() {
|
|
1475
|
+
const ret = wasm.memory;
|
|
1476
|
+
return ret;
|
|
1217
1477
|
}
|
|
1218
1478
|
|
|
1219
|
-
export function
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1479
|
+
export function __wbindgen_number_get(arg0, arg1) {
|
|
1480
|
+
const obj = arg1;
|
|
1481
|
+
const ret = typeof obj === "number" ? obj : undefined;
|
|
1482
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1483
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
export function __wbindgen_number_new(arg0) {
|
|
1487
|
+
const ret = arg0;
|
|
1488
|
+
return ret;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
export function __wbindgen_string_get(arg0, arg1) {
|
|
1492
|
+
const obj = arg1;
|
|
1493
|
+
const ret = typeof obj === "string" ? obj : undefined;
|
|
1494
|
+
var ptr1 = isLikeNone(ret)
|
|
1495
|
+
? 0
|
|
1496
|
+
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1497
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1498
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1499
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
1503
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1504
|
+
return ret;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
export function __wbindgen_throw(arg0, arg1) {
|
|
1508
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1222
1509
|
}
|