@bitwarden/sdk-internal 0.1.1 → 0.1.3
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/bitwarden_wasm_internal.d.ts +97 -0
- package/bitwarden_wasm_internal.js +4 -0
- package/bitwarden_wasm_internal_bg.js +866 -0
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +24 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -0
- package/node/bitwarden_wasm_internal.d.ts +97 -0
- package/node/bitwarden_wasm_internal.js +869 -0
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +24 -0
- package/package.json +7 -2
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
let imports = {};
|
|
2
|
+
imports["__wbindgen_placeholder__"] = module.exports;
|
|
3
|
+
let wasm;
|
|
4
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
5
|
+
|
|
6
|
+
const heap = new Array(128).fill(undefined);
|
|
7
|
+
|
|
8
|
+
heap.push(undefined, null, true, false);
|
|
9
|
+
|
|
10
|
+
function getObject(idx) {
|
|
11
|
+
return heap[idx];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let heap_next = heap.length;
|
|
15
|
+
|
|
16
|
+
function dropObject(idx) {
|
|
17
|
+
if (idx < 132) return;
|
|
18
|
+
heap[idx] = heap_next;
|
|
19
|
+
heap_next = idx;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function takeObject(idx) {
|
|
23
|
+
const ret = getObject(idx);
|
|
24
|
+
dropObject(idx);
|
|
25
|
+
return ret;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let WASM_VECTOR_LEN = 0;
|
|
29
|
+
|
|
30
|
+
let cachedUint8ArrayMemory0 = null;
|
|
31
|
+
|
|
32
|
+
function getUint8ArrayMemory0() {
|
|
33
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
34
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
35
|
+
}
|
|
36
|
+
return cachedUint8ArrayMemory0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let cachedTextEncoder = new TextEncoder("utf-8");
|
|
40
|
+
|
|
41
|
+
const encodeString =
|
|
42
|
+
typeof cachedTextEncoder.encodeInto === "function"
|
|
43
|
+
? function (arg, view) {
|
|
44
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
45
|
+
}
|
|
46
|
+
: function (arg, view) {
|
|
47
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
48
|
+
view.set(buf);
|
|
49
|
+
return {
|
|
50
|
+
read: arg.length,
|
|
51
|
+
written: buf.length,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
56
|
+
if (realloc === undefined) {
|
|
57
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
58
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
59
|
+
getUint8ArrayMemory0()
|
|
60
|
+
.subarray(ptr, ptr + buf.length)
|
|
61
|
+
.set(buf);
|
|
62
|
+
WASM_VECTOR_LEN = buf.length;
|
|
63
|
+
return ptr;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let len = arg.length;
|
|
67
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
68
|
+
|
|
69
|
+
const mem = getUint8ArrayMemory0();
|
|
70
|
+
|
|
71
|
+
let offset = 0;
|
|
72
|
+
|
|
73
|
+
for (; offset < len; offset++) {
|
|
74
|
+
const code = arg.charCodeAt(offset);
|
|
75
|
+
if (code > 0x7f) break;
|
|
76
|
+
mem[ptr + offset] = code;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (offset !== len) {
|
|
80
|
+
if (offset !== 0) {
|
|
81
|
+
arg = arg.slice(offset);
|
|
82
|
+
}
|
|
83
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
84
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
85
|
+
const ret = encodeString(arg, view);
|
|
86
|
+
|
|
87
|
+
offset += ret.written;
|
|
88
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
WASM_VECTOR_LEN = offset;
|
|
92
|
+
return ptr;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function isLikeNone(x) {
|
|
96
|
+
return x === undefined || x === null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let cachedDataViewMemory0 = null;
|
|
100
|
+
|
|
101
|
+
function getDataViewMemory0() {
|
|
102
|
+
if (
|
|
103
|
+
cachedDataViewMemory0 === null ||
|
|
104
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
105
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
106
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
107
|
+
) {
|
|
108
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
109
|
+
}
|
|
110
|
+
return cachedDataViewMemory0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
114
|
+
|
|
115
|
+
cachedTextDecoder.decode();
|
|
116
|
+
|
|
117
|
+
function getStringFromWasm0(ptr, len) {
|
|
118
|
+
ptr = ptr >>> 0;
|
|
119
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function addHeapObject(obj) {
|
|
123
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
124
|
+
const idx = heap_next;
|
|
125
|
+
heap_next = heap[idx];
|
|
126
|
+
|
|
127
|
+
heap[idx] = obj;
|
|
128
|
+
return idx;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function debugString(val) {
|
|
132
|
+
// primitive types
|
|
133
|
+
const type = typeof val;
|
|
134
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
135
|
+
return `${val}`;
|
|
136
|
+
}
|
|
137
|
+
if (type == "string") {
|
|
138
|
+
return `"${val}"`;
|
|
139
|
+
}
|
|
140
|
+
if (type == "symbol") {
|
|
141
|
+
const description = val.description;
|
|
142
|
+
if (description == null) {
|
|
143
|
+
return "Symbol";
|
|
144
|
+
} else {
|
|
145
|
+
return `Symbol(${description})`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (type == "function") {
|
|
149
|
+
const name = val.name;
|
|
150
|
+
if (typeof name == "string" && name.length > 0) {
|
|
151
|
+
return `Function(${name})`;
|
|
152
|
+
} else {
|
|
153
|
+
return "Function";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// objects
|
|
157
|
+
if (Array.isArray(val)) {
|
|
158
|
+
const length = val.length;
|
|
159
|
+
let debug = "[";
|
|
160
|
+
if (length > 0) {
|
|
161
|
+
debug += debugString(val[0]);
|
|
162
|
+
}
|
|
163
|
+
for (let i = 1; i < length; i++) {
|
|
164
|
+
debug += ", " + debugString(val[i]);
|
|
165
|
+
}
|
|
166
|
+
debug += "]";
|
|
167
|
+
return debug;
|
|
168
|
+
}
|
|
169
|
+
// Test for built-in
|
|
170
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
171
|
+
let className;
|
|
172
|
+
if (builtInMatches.length > 1) {
|
|
173
|
+
className = builtInMatches[1];
|
|
174
|
+
} else {
|
|
175
|
+
// Failed to match the standard '[object ClassName]'
|
|
176
|
+
return toString.call(val);
|
|
177
|
+
}
|
|
178
|
+
if (className == "Object") {
|
|
179
|
+
// we're a user defined class or Object
|
|
180
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
181
|
+
// easier than looping through ownProperties of `val`.
|
|
182
|
+
try {
|
|
183
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
184
|
+
} catch (_) {
|
|
185
|
+
return "Object";
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// errors
|
|
189
|
+
if (val instanceof Error) {
|
|
190
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
191
|
+
}
|
|
192
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
193
|
+
return className;
|
|
194
|
+
}
|
|
195
|
+
|
|
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_36(arg0, arg1, arg2) {
|
|
228
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h974cc3e4e3fc8e18(
|
|
229
|
+
arg0,
|
|
230
|
+
arg1,
|
|
231
|
+
addHeapObject(arg2),
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function handleError(f, args) {
|
|
236
|
+
try {
|
|
237
|
+
return f.apply(this, args);
|
|
238
|
+
} catch (e) {
|
|
239
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function __wbg_adapter_86(arg0, arg1, arg2, arg3) {
|
|
243
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h0b740609e8693551(
|
|
244
|
+
arg0,
|
|
245
|
+
arg1,
|
|
246
|
+
addHeapObject(arg2),
|
|
247
|
+
addHeapObject(arg3),
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
*/
|
|
253
|
+
module.exports.LogLevel = Object.freeze({
|
|
254
|
+
Trace: 0,
|
|
255
|
+
0: "Trace",
|
|
256
|
+
Debug: 1,
|
|
257
|
+
1: "Debug",
|
|
258
|
+
Info: 2,
|
|
259
|
+
2: "Info",
|
|
260
|
+
Warn: 3,
|
|
261
|
+
3: "Warn",
|
|
262
|
+
Error: 4,
|
|
263
|
+
4: "Error",
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const BitwardenClientFinalization =
|
|
267
|
+
typeof FinalizationRegistry === "undefined"
|
|
268
|
+
? { register: () => {}, unregister: () => {} }
|
|
269
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_bitwardenclient_free(ptr >>> 0, 1));
|
|
270
|
+
/**
|
|
271
|
+
*/
|
|
272
|
+
class BitwardenClient {
|
|
273
|
+
__destroy_into_raw() {
|
|
274
|
+
const ptr = this.__wbg_ptr;
|
|
275
|
+
this.__wbg_ptr = 0;
|
|
276
|
+
BitwardenClientFinalization.unregister(this);
|
|
277
|
+
return ptr;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
free() {
|
|
281
|
+
const ptr = this.__destroy_into_raw();
|
|
282
|
+
wasm.__wbg_bitwardenclient_free(ptr, 0);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @param {ClientSettings | undefined} [settings]
|
|
286
|
+
* @param {LogLevel | undefined} [log_level]
|
|
287
|
+
*/
|
|
288
|
+
constructor(settings, log_level) {
|
|
289
|
+
const ret = wasm.bitwardenclient_new(
|
|
290
|
+
isLikeNone(settings) ? 0 : addHeapObject(settings),
|
|
291
|
+
isLikeNone(log_level) ? 5 : log_level,
|
|
292
|
+
);
|
|
293
|
+
this.__wbg_ptr = ret >>> 0;
|
|
294
|
+
BitwardenClientFinalization.register(this, this.__wbg_ptr, this);
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Test method, echoes back the input
|
|
299
|
+
* @param {string} msg
|
|
300
|
+
* @returns {string}
|
|
301
|
+
*/
|
|
302
|
+
echo(msg) {
|
|
303
|
+
let deferred2_0;
|
|
304
|
+
let deferred2_1;
|
|
305
|
+
try {
|
|
306
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
307
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
wasm.bitwardenclient_echo(retptr, this.__wbg_ptr, ptr0, len0);
|
|
310
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
311
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
312
|
+
deferred2_0 = r0;
|
|
313
|
+
deferred2_1 = r1;
|
|
314
|
+
return getStringFromWasm0(r0, r1);
|
|
315
|
+
} finally {
|
|
316
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
317
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Test method, calls http endpoint
|
|
322
|
+
* @param {string} url
|
|
323
|
+
* @returns {Promise<string>}
|
|
324
|
+
*/
|
|
325
|
+
http_get(url) {
|
|
326
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
328
|
+
const ret = wasm.bitwardenclient_http_get(this.__wbg_ptr, ptr0, len0);
|
|
329
|
+
return takeObject(ret);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
module.exports.BitwardenClient = BitwardenClient;
|
|
333
|
+
|
|
334
|
+
module.exports.__wbg_new_525245e2b9901204 = function () {
|
|
335
|
+
const ret = new Object();
|
|
336
|
+
return addHeapObject(ret);
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
module.exports.__wbg_setmethod_dc68a742c2db5c6a = function (arg0, arg1, arg2) {
|
|
340
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
module.exports.__wbg_new_e27c93803e1acc42 = function () {
|
|
344
|
+
return handleError(function () {
|
|
345
|
+
const ret = new Headers();
|
|
346
|
+
return addHeapObject(ret);
|
|
347
|
+
}, arguments);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
module.exports.__wbindgen_object_drop_ref = function (arg0) {
|
|
351
|
+
takeObject(arg0);
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
module.exports.__wbg_setheaders_be10a5ab566fd06f = function (arg0, arg1) {
|
|
355
|
+
getObject(arg0).headers = getObject(arg1);
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
module.exports.__wbg_setmode_a781aae2bd3df202 = function (arg0, arg1) {
|
|
359
|
+
getObject(arg0).mode = ["same-origin", "no-cors", "cors", "navigate"][arg1];
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
module.exports.__wbg_setcredentials_2b67800db3f7b621 = function (arg0, arg1) {
|
|
363
|
+
getObject(arg0).credentials = ["omit", "same-origin", "include"][arg1];
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
module.exports.__wbg_setbody_734cb3d7ee8e6e96 = function (arg0, arg1) {
|
|
367
|
+
getObject(arg0).body = getObject(arg1);
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
module.exports.__wbg_signal_41e46ccad44bb5e2 = function (arg0) {
|
|
371
|
+
const ret = getObject(arg0).signal;
|
|
372
|
+
return addHeapObject(ret);
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
module.exports.__wbg_setsignal_91c4e8ebd04eb935 = function (arg0, arg1) {
|
|
376
|
+
getObject(arg0).signal = getObject(arg1);
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
module.exports.__wbg_append_f3a4426bb50622c5 = function () {
|
|
380
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
381
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
382
|
+
}, arguments);
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
module.exports.__wbg_instanceof_Response_e91b7eb7c611a9ae = function (arg0) {
|
|
386
|
+
let result;
|
|
387
|
+
try {
|
|
388
|
+
result = getObject(arg0) instanceof Response;
|
|
389
|
+
} catch (_) {
|
|
390
|
+
result = false;
|
|
391
|
+
}
|
|
392
|
+
const ret = result;
|
|
393
|
+
return ret;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
module.exports.__wbg_status_ae8de515694c5c7c = function (arg0) {
|
|
397
|
+
const ret = getObject(arg0).status;
|
|
398
|
+
return ret;
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
module.exports.__wbg_url_1bf85c8abeb8c92d = function (arg0, arg1) {
|
|
402
|
+
const ret = getObject(arg1).url;
|
|
403
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
404
|
+
const len1 = WASM_VECTOR_LEN;
|
|
405
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
406
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
module.exports.__wbg_headers_5e283e8345689121 = function (arg0) {
|
|
410
|
+
const ret = getObject(arg0).headers;
|
|
411
|
+
return addHeapObject(ret);
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
module.exports.__wbg_next_f9cb570345655b9a = function () {
|
|
415
|
+
return handleError(function (arg0) {
|
|
416
|
+
const ret = getObject(arg0).next();
|
|
417
|
+
return addHeapObject(ret);
|
|
418
|
+
}, arguments);
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
module.exports.__wbg_done_bfda7aa8f252b39f = function (arg0) {
|
|
422
|
+
const ret = getObject(arg0).done;
|
|
423
|
+
return ret;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
module.exports.__wbg_value_6d39332ab4788d86 = function (arg0) {
|
|
427
|
+
const ret = getObject(arg0).value;
|
|
428
|
+
return addHeapObject(ret);
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
module.exports.__wbg_stringify_bbf45426c92a6bf5 = function () {
|
|
432
|
+
return handleError(function (arg0) {
|
|
433
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
434
|
+
return addHeapObject(ret);
|
|
435
|
+
}, arguments);
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
module.exports.__wbindgen_string_get = function (arg0, arg1) {
|
|
439
|
+
const obj = getObject(arg1);
|
|
440
|
+
const ret = typeof obj === "string" ? obj : undefined;
|
|
441
|
+
var ptr1 = isLikeNone(ret)
|
|
442
|
+
? 0
|
|
443
|
+
: passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
444
|
+
var len1 = WASM_VECTOR_LEN;
|
|
445
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
446
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
module.exports.__wbg_abort_8659d889a7877ae3 = function (arg0) {
|
|
450
|
+
getObject(arg0).abort();
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
module.exports.__wbg_text_a94b91ea8700357a = function () {
|
|
454
|
+
return handleError(function (arg0) {
|
|
455
|
+
const ret = getObject(arg0).text();
|
|
456
|
+
return addHeapObject(ret);
|
|
457
|
+
}, arguments);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
module.exports.__wbindgen_string_new = function (arg0, arg1) {
|
|
461
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
462
|
+
return addHeapObject(ret);
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
module.exports.__wbg_call_89af060b4e1523f2 = function () {
|
|
466
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
467
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
468
|
+
return addHeapObject(ret);
|
|
469
|
+
}, arguments);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
module.exports.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
|
473
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
474
|
+
return ret;
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
module.exports.__wbindgen_cb_drop = function (arg0) {
|
|
478
|
+
const obj = takeObject(arg0).original;
|
|
479
|
+
if (obj.cnt-- == 1) {
|
|
480
|
+
obj.a = 0;
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
const ret = false;
|
|
484
|
+
return ret;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
module.exports.__wbindgen_error_new = function (arg0, arg1) {
|
|
488
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
489
|
+
return addHeapObject(ret);
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
module.exports.__wbindgen_object_clone_ref = function (arg0) {
|
|
493
|
+
const ret = getObject(arg0);
|
|
494
|
+
return addHeapObject(ret);
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
module.exports.__wbindgen_is_object = function (arg0) {
|
|
498
|
+
const val = getObject(arg0);
|
|
499
|
+
const ret = typeof val === "object" && val !== null;
|
|
500
|
+
return ret;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
|
|
504
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
505
|
+
return addHeapObject(ret);
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
module.exports.__wbindgen_is_undefined = function (arg0) {
|
|
509
|
+
const ret = getObject(arg0) === undefined;
|
|
510
|
+
return ret;
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
module.exports.__wbindgen_in = function (arg0, arg1) {
|
|
514
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
515
|
+
return ret;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
module.exports.__wbindgen_is_string = function (arg0) {
|
|
519
|
+
const ret = typeof getObject(arg0) === "string";
|
|
520
|
+
return ret;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
module.exports.__wbg_entries_7a0e06255456ebcd = function (arg0) {
|
|
524
|
+
const ret = Object.entries(getObject(arg0));
|
|
525
|
+
return addHeapObject(ret);
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
module.exports.__wbg_length_ae22078168b726f5 = function (arg0) {
|
|
529
|
+
const ret = getObject(arg0).length;
|
|
530
|
+
return ret;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
module.exports.__wbg_get_3baa728f9d58d3f6 = function (arg0, arg1) {
|
|
534
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
535
|
+
return addHeapObject(ret);
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
module.exports.__wbg_new_b85e72ed1bfd57f9 = function (arg0, arg1) {
|
|
539
|
+
try {
|
|
540
|
+
var state0 = { a: arg0, b: arg1 };
|
|
541
|
+
var cb0 = (arg0, arg1) => {
|
|
542
|
+
const a = state0.a;
|
|
543
|
+
state0.a = 0;
|
|
544
|
+
try {
|
|
545
|
+
return __wbg_adapter_86(a, state0.b, arg0, arg1);
|
|
546
|
+
} finally {
|
|
547
|
+
state0.a = a;
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
const ret = new Promise(cb0);
|
|
551
|
+
return addHeapObject(ret);
|
|
552
|
+
} finally {
|
|
553
|
+
state0.a = state0.b = 0;
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
module.exports.__wbg_new_abda76e883ba8a5f = function () {
|
|
558
|
+
const ret = new Error();
|
|
559
|
+
return addHeapObject(ret);
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
module.exports.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
|
|
563
|
+
const ret = getObject(arg1).stack;
|
|
564
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
565
|
+
const len1 = WASM_VECTOR_LEN;
|
|
566
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
567
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
module.exports.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
|
|
571
|
+
let deferred0_0;
|
|
572
|
+
let deferred0_1;
|
|
573
|
+
try {
|
|
574
|
+
deferred0_0 = arg0;
|
|
575
|
+
deferred0_1 = arg1;
|
|
576
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
577
|
+
} finally {
|
|
578
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
module.exports.__wbg_self_3093d5d1f7bcb682 = function () {
|
|
583
|
+
return handleError(function () {
|
|
584
|
+
const ret = self.self;
|
|
585
|
+
return addHeapObject(ret);
|
|
586
|
+
}, arguments);
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
module.exports.__wbg_window_3bcfc4d31bc012f8 = function () {
|
|
590
|
+
return handleError(function () {
|
|
591
|
+
const ret = window.window;
|
|
592
|
+
return addHeapObject(ret);
|
|
593
|
+
}, arguments);
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
module.exports.__wbg_globalThis_86b222e13bdf32ed = function () {
|
|
597
|
+
return handleError(function () {
|
|
598
|
+
const ret = globalThis.globalThis;
|
|
599
|
+
return addHeapObject(ret);
|
|
600
|
+
}, arguments);
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
module.exports.__wbg_global_e5a3fe56f8be9485 = function () {
|
|
604
|
+
return handleError(function () {
|
|
605
|
+
const ret = global.global;
|
|
606
|
+
return addHeapObject(ret);
|
|
607
|
+
}, arguments);
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
module.exports.__wbg_newnoargs_76313bd6ff35d0f2 = function (arg0, arg1) {
|
|
611
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
612
|
+
return addHeapObject(ret);
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
module.exports.__wbg_call_1084a111329e68ce = function () {
|
|
616
|
+
return handleError(function (arg0, arg1) {
|
|
617
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
618
|
+
return addHeapObject(ret);
|
|
619
|
+
}, arguments);
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
module.exports.__wbg_iterator_888179a48810a9fe = function () {
|
|
623
|
+
const ret = Symbol.iterator;
|
|
624
|
+
return addHeapObject(ret);
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
module.exports.__wbg_get_224d16597dbbfd96 = function () {
|
|
628
|
+
return handleError(function (arg0, arg1) {
|
|
629
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
630
|
+
return addHeapObject(ret);
|
|
631
|
+
}, arguments);
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
module.exports.__wbindgen_is_function = function (arg0) {
|
|
635
|
+
const ret = typeof getObject(arg0) === "function";
|
|
636
|
+
return ret;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
module.exports.__wbg_next_de3e9db4440638b2 = function (arg0) {
|
|
640
|
+
const ret = getObject(arg0).next;
|
|
641
|
+
return addHeapObject(ret);
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
module.exports.__wbg_new_a220cf903aa02ca2 = function () {
|
|
645
|
+
const ret = new Array();
|
|
646
|
+
return addHeapObject(ret);
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
module.exports.__wbg_push_37c89022f34c01ca = function (arg0, arg1) {
|
|
650
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
651
|
+
return ret;
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function (arg0) {
|
|
655
|
+
let result;
|
|
656
|
+
try {
|
|
657
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
658
|
+
} catch (_) {
|
|
659
|
+
result = false;
|
|
660
|
+
}
|
|
661
|
+
const ret = result;
|
|
662
|
+
return ret;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
module.exports.__wbg_new_796382978dfd4fb0 = function (arg0, arg1) {
|
|
666
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
667
|
+
return addHeapObject(ret);
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
module.exports.__wbg_has_4bfbc01db38743f7 = function () {
|
|
671
|
+
return handleError(function (arg0, arg1) {
|
|
672
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
673
|
+
return ret;
|
|
674
|
+
}, arguments);
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
module.exports.__wbg_resolve_570458cb99d56a43 = function (arg0) {
|
|
678
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
679
|
+
return addHeapObject(ret);
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
module.exports.__wbg_then_95e6edc0f89b73b1 = function (arg0, arg1) {
|
|
683
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
684
|
+
return addHeapObject(ret);
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
module.exports.__wbg_then_876bb3c633745cc6 = function (arg0, arg1, arg2) {
|
|
688
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
689
|
+
return addHeapObject(ret);
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
module.exports.__wbindgen_memory = function () {
|
|
693
|
+
const ret = wasm.memory;
|
|
694
|
+
return addHeapObject(ret);
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
module.exports.__wbg_buffer_b7b08af79b0b0974 = function (arg0) {
|
|
698
|
+
const ret = getObject(arg0).buffer;
|
|
699
|
+
return addHeapObject(ret);
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function (arg0, arg1, arg2) {
|
|
703
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
704
|
+
return addHeapObject(ret);
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
module.exports.__wbg_length_8339fcf5d8ecd12e = function (arg0) {
|
|
708
|
+
const ret = getObject(arg0).length;
|
|
709
|
+
return ret;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
module.exports.__wbg_new_ea1883e1e5e86686 = function (arg0) {
|
|
713
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
714
|
+
return addHeapObject(ret);
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
module.exports.__wbg_set_d1e79e2388520f18 = function (arg0, arg1, arg2) {
|
|
718
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function (arg0) {
|
|
722
|
+
let result;
|
|
723
|
+
try {
|
|
724
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
725
|
+
} catch (_) {
|
|
726
|
+
result = false;
|
|
727
|
+
}
|
|
728
|
+
const ret = result;
|
|
729
|
+
return ret;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
module.exports.__wbg_new_f9f1d655d855a601 = function () {
|
|
733
|
+
return handleError(function () {
|
|
734
|
+
const ret = new FormData();
|
|
735
|
+
return addHeapObject(ret);
|
|
736
|
+
}, arguments);
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
module.exports.__wbg_append_b10805b72af15312 = function () {
|
|
740
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
741
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
742
|
+
}, arguments);
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
module.exports.__wbg_settype_b6ab7b74bd1908a1 = function (arg0, arg1, arg2) {
|
|
746
|
+
getObject(arg0).type = getStringFromWasm0(arg1, arg2);
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
module.exports.__wbg_newwithu8arraysequenceandoptions_c8bc456a23f02fca = function () {
|
|
750
|
+
return handleError(function (arg0, arg1) {
|
|
751
|
+
const ret = new Blob(getObject(arg0), getObject(arg1));
|
|
752
|
+
return addHeapObject(ret);
|
|
753
|
+
}, arguments);
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
module.exports.__wbg_append_876bddfd2c8b42fb = function () {
|
|
757
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
758
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getObject(arg3));
|
|
759
|
+
}, arguments);
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
module.exports.__wbg_append_fc486ec9757bf1c1 = function () {
|
|
763
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
764
|
+
getObject(arg0).append(
|
|
765
|
+
getStringFromWasm0(arg1, arg2),
|
|
766
|
+
getObject(arg3),
|
|
767
|
+
getStringFromWasm0(arg4, arg5),
|
|
768
|
+
);
|
|
769
|
+
}, arguments);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
module.exports.__wbg_fetch_25e3a297f7b04639 = function (arg0) {
|
|
773
|
+
const ret = fetch(getObject(arg0));
|
|
774
|
+
return addHeapObject(ret);
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
module.exports.__wbg_fetch_ba7fe179e527d942 = function (arg0, arg1) {
|
|
778
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
779
|
+
return addHeapObject(ret);
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
module.exports.__wbg_new_ebf2727385ee825c = function () {
|
|
783
|
+
return handleError(function () {
|
|
784
|
+
const ret = new AbortController();
|
|
785
|
+
return addHeapObject(ret);
|
|
786
|
+
}, arguments);
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
module.exports.__wbindgen_boolean_get = function (arg0) {
|
|
790
|
+
const v = getObject(arg0);
|
|
791
|
+
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
|
792
|
+
return ret;
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
module.exports.__wbindgen_number_get = function (arg0, arg1) {
|
|
796
|
+
const obj = getObject(arg1);
|
|
797
|
+
const ret = typeof obj === "number" ? obj : undefined;
|
|
798
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
799
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
module.exports.__wbg_String_b9412f8799faab3e = function (arg0, arg1) {
|
|
803
|
+
const ret = String(getObject(arg1));
|
|
804
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
805
|
+
const len1 = WASM_VECTOR_LEN;
|
|
806
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
807
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
module.exports.__wbindgen_debug_string = function (arg0, arg1) {
|
|
811
|
+
const ret = debugString(getObject(arg1));
|
|
812
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
813
|
+
const len1 = WASM_VECTOR_LEN;
|
|
814
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
815
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
module.exports.__wbindgen_throw = function (arg0, arg1) {
|
|
819
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
module.exports.__wbg_queueMicrotask_48421b3cc9052b68 = function (arg0) {
|
|
823
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
824
|
+
return addHeapObject(ret);
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
module.exports.__wbg_queueMicrotask_12a30234db4045d3 = function (arg0) {
|
|
828
|
+
queueMicrotask(getObject(arg0));
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
module.exports.__wbg_newwithstrandinit_a31c69e4cc337183 = function () {
|
|
832
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
833
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
834
|
+
return addHeapObject(ret);
|
|
835
|
+
}, arguments);
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
module.exports.__wbg_debug_d7780810b3a93632 = function (arg0, arg1, arg2, arg3) {
|
|
839
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
module.exports.__wbg_error_f02f3d66b42c6251 = function (arg0, arg1, arg2, arg3) {
|
|
843
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
module.exports.__wbg_info_123d8c35ec14384a = function (arg0, arg1, arg2, arg3) {
|
|
847
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
module.exports.__wbg_log_22aecf4cc2edc319 = function (arg0, arg1, arg2, arg3) {
|
|
851
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
module.exports.__wbg_warn_60924fcf321399f0 = function (arg0, arg1, arg2, arg3) {
|
|
855
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
module.exports.__wbindgen_closure_wrapper1154 = function (arg0, arg1, arg2) {
|
|
859
|
+
const ret = makeMutClosure(arg0, arg1, 243, __wbg_adapter_36);
|
|
860
|
+
return addHeapObject(ret);
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const path = require("path").join(__dirname, "bitwarden_wasm_internal_bg.wasm");
|
|
864
|
+
const bytes = require("fs").readFileSync(path);
|
|
865
|
+
|
|
866
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
867
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
868
|
+
wasm = wasmInstance.exports;
|
|
869
|
+
module.exports.__wasm = wasm;
|