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