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