@estoc/didcomm-node 0.4.1-estoc.1
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/LICENSE +176 -0
- package/README.md +282 -0
- package/index.d.ts +950 -0
- package/index.js +743 -0
- package/index_bg.wasm +0 -0
- package/package.json +21 -0
package/index.js
ADDED
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
/* @ts-self-types="./index.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Allows building of `from_prior` message header according
|
|
5
|
+
* to DIDComm DID Rotation procedure
|
|
6
|
+
* https://identity.foundation/didcomm-messaging/spec/#did-rotation.
|
|
7
|
+
*/
|
|
8
|
+
class FromPrior {
|
|
9
|
+
static __wrap(ptr) {
|
|
10
|
+
const obj = Object.create(FromPrior.prototype);
|
|
11
|
+
obj.__wbg_ptr = ptr;
|
|
12
|
+
FromPriorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
__destroy_into_raw() {
|
|
16
|
+
const ptr = this.__wbg_ptr;
|
|
17
|
+
this.__wbg_ptr = 0;
|
|
18
|
+
FromPriorFinalization.unregister(this);
|
|
19
|
+
return ptr;
|
|
20
|
+
}
|
|
21
|
+
free() {
|
|
22
|
+
const ptr = this.__destroy_into_raw();
|
|
23
|
+
wasm.__wbg_fromprior_free(ptr, 0);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @returns {any}
|
|
27
|
+
*/
|
|
28
|
+
as_value() {
|
|
29
|
+
const ret = wasm.fromprior_as_value(this.__wbg_ptr);
|
|
30
|
+
if (ret[2]) {
|
|
31
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
32
|
+
}
|
|
33
|
+
return takeFromExternrefTable0(ret[0]);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Instantiates FromPrior from plain object
|
|
37
|
+
* @param {IFromPrior} value
|
|
38
|
+
*/
|
|
39
|
+
constructor(value) {
|
|
40
|
+
const ret = wasm.fromprior_new(value);
|
|
41
|
+
if (ret[2]) {
|
|
42
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
43
|
+
}
|
|
44
|
+
this.__wbg_ptr = ret[0];
|
|
45
|
+
FromPriorFinalization.register(this, this.__wbg_ptr, this);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @param {string | null | undefined} issuer_kid
|
|
50
|
+
* @param {any} did_resolver
|
|
51
|
+
* @param {any} secrets_resolver
|
|
52
|
+
* @returns {Promise<any>}
|
|
53
|
+
*/
|
|
54
|
+
pack(issuer_kid, did_resolver, secrets_resolver) {
|
|
55
|
+
var ptr0 = isLikeNone(issuer_kid) ? 0 : passStringToWasm0(issuer_kid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
56
|
+
var len0 = WASM_VECTOR_LEN;
|
|
57
|
+
const ret = wasm.fromprior_pack(this.__wbg_ptr, ptr0, len0, did_resolver, secrets_resolver);
|
|
58
|
+
return ret;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @param {string} from_prior
|
|
62
|
+
* @param {any} did_resolver
|
|
63
|
+
* @returns {Promise<any>}
|
|
64
|
+
*/
|
|
65
|
+
static unpack(from_prior, did_resolver) {
|
|
66
|
+
const ptr0 = passStringToWasm0(from_prior, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
67
|
+
const len0 = WASM_VECTOR_LEN;
|
|
68
|
+
const ret = wasm.fromprior_unpack(ptr0, len0, did_resolver);
|
|
69
|
+
return ret;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (Symbol.dispose) FromPrior.prototype[Symbol.dispose] = FromPrior.prototype.free;
|
|
73
|
+
exports.FromPrior = FromPrior;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Wrapper for plain message. Provides helpers for message building and packing/unpacking.
|
|
77
|
+
*/
|
|
78
|
+
class Message {
|
|
79
|
+
static __wrap(ptr) {
|
|
80
|
+
const obj = Object.create(Message.prototype);
|
|
81
|
+
obj.__wbg_ptr = ptr;
|
|
82
|
+
MessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
83
|
+
return obj;
|
|
84
|
+
}
|
|
85
|
+
__destroy_into_raw() {
|
|
86
|
+
const ptr = this.__wbg_ptr;
|
|
87
|
+
this.__wbg_ptr = 0;
|
|
88
|
+
MessageFinalization.unregister(this);
|
|
89
|
+
return ptr;
|
|
90
|
+
}
|
|
91
|
+
free() {
|
|
92
|
+
const ptr = this.__destroy_into_raw();
|
|
93
|
+
wasm.__wbg_message_free(ptr, 0);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @returns {any}
|
|
97
|
+
*/
|
|
98
|
+
as_value() {
|
|
99
|
+
const ret = wasm.message_as_value(this.__wbg_ptr);
|
|
100
|
+
if (ret[2]) {
|
|
101
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
102
|
+
}
|
|
103
|
+
return takeFromExternrefTable0(ret[0]);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Instantiates message from plain object
|
|
107
|
+
* @param {IMessage} value
|
|
108
|
+
*/
|
|
109
|
+
constructor(value) {
|
|
110
|
+
const ret = wasm.message_new(value);
|
|
111
|
+
if (ret[2]) {
|
|
112
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
113
|
+
}
|
|
114
|
+
this.__wbg_ptr = ret[0];
|
|
115
|
+
MessageFinalization.register(this, this.__wbg_ptr, this);
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @param {string} to
|
|
120
|
+
* @param {string | null | undefined} from
|
|
121
|
+
* @param {string | null | undefined} sign_by
|
|
122
|
+
* @param {any} did_resolver
|
|
123
|
+
* @param {any} secrets_resolver
|
|
124
|
+
* @param {any} options
|
|
125
|
+
* @returns {Promise<any>}
|
|
126
|
+
*/
|
|
127
|
+
pack_encrypted(to, from, sign_by, did_resolver, secrets_resolver, options) {
|
|
128
|
+
const ptr0 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
130
|
+
var ptr1 = isLikeNone(from) ? 0 : passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
131
|
+
var len1 = WASM_VECTOR_LEN;
|
|
132
|
+
var ptr2 = isLikeNone(sign_by) ? 0 : passStringToWasm0(sign_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
133
|
+
var len2 = WASM_VECTOR_LEN;
|
|
134
|
+
const ret = wasm.message_pack_encrypted(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, did_resolver, secrets_resolver, options);
|
|
135
|
+
return ret;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @param {any} did_resolver
|
|
139
|
+
* @returns {Promise<any>}
|
|
140
|
+
*/
|
|
141
|
+
pack_plaintext(did_resolver) {
|
|
142
|
+
const ret = wasm.message_pack_plaintext(this.__wbg_ptr, did_resolver);
|
|
143
|
+
return ret;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @param {string} sign_by
|
|
147
|
+
* @param {any} did_resolver
|
|
148
|
+
* @param {any} secrets_resolver
|
|
149
|
+
* @returns {Promise<any>}
|
|
150
|
+
*/
|
|
151
|
+
pack_signed(sign_by, did_resolver, secrets_resolver) {
|
|
152
|
+
const ptr0 = passStringToWasm0(sign_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
153
|
+
const len0 = WASM_VECTOR_LEN;
|
|
154
|
+
const ret = wasm.message_pack_signed(this.__wbg_ptr, ptr0, len0, did_resolver, secrets_resolver);
|
|
155
|
+
return ret;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @returns {any}
|
|
159
|
+
*/
|
|
160
|
+
try_parse_forward() {
|
|
161
|
+
const ret = wasm.message_try_parse_forward(this.__wbg_ptr);
|
|
162
|
+
if (ret[2]) {
|
|
163
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
164
|
+
}
|
|
165
|
+
return takeFromExternrefTable0(ret[0]);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} msg
|
|
169
|
+
* @param {any} did_resolver
|
|
170
|
+
* @param {any} secrets_resolver
|
|
171
|
+
* @param {any} options
|
|
172
|
+
* @returns {Promise<any>}
|
|
173
|
+
*/
|
|
174
|
+
static unpack(msg, did_resolver, secrets_resolver, options) {
|
|
175
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
176
|
+
const len0 = WASM_VECTOR_LEN;
|
|
177
|
+
const ret = wasm.message_unpack(ptr0, len0, did_resolver, secrets_resolver, options);
|
|
178
|
+
return ret;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @param {string} msg
|
|
182
|
+
* @param {any} headers
|
|
183
|
+
* @param {string} to
|
|
184
|
+
* @param {any} routing_keys
|
|
185
|
+
* @param {any} enc_alg_anon
|
|
186
|
+
* @param {any} did_resolver
|
|
187
|
+
* @returns {Promise<any>}
|
|
188
|
+
*/
|
|
189
|
+
static wrap_in_forward(msg, headers, to, routing_keys, enc_alg_anon, did_resolver) {
|
|
190
|
+
const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
191
|
+
const len0 = WASM_VECTOR_LEN;
|
|
192
|
+
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
193
|
+
const len1 = WASM_VECTOR_LEN;
|
|
194
|
+
const ret = wasm.message_wrap_in_forward(ptr0, len0, headers, ptr1, len1, routing_keys, enc_alg_anon, did_resolver);
|
|
195
|
+
return ret;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (Symbol.dispose) Message.prototype[Symbol.dispose] = Message.prototype.free;
|
|
199
|
+
exports.Message = Message;
|
|
200
|
+
|
|
201
|
+
class ParsedForward {
|
|
202
|
+
__destroy_into_raw() {
|
|
203
|
+
const ptr = this.__wbg_ptr;
|
|
204
|
+
this.__wbg_ptr = 0;
|
|
205
|
+
ParsedForwardFinalization.unregister(this);
|
|
206
|
+
return ptr;
|
|
207
|
+
}
|
|
208
|
+
free() {
|
|
209
|
+
const ptr = this.__destroy_into_raw();
|
|
210
|
+
wasm.__wbg_parsedforward_free(ptr, 0);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @returns {any}
|
|
214
|
+
*/
|
|
215
|
+
as_value() {
|
|
216
|
+
const ret = wasm.parsedforward_as_value(this.__wbg_ptr);
|
|
217
|
+
if (ret[2]) {
|
|
218
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
219
|
+
}
|
|
220
|
+
return takeFromExternrefTable0(ret[0]);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (Symbol.dispose) ParsedForward.prototype[Symbol.dispose] = ParsedForward.prototype.free;
|
|
224
|
+
exports.ParsedForward = ParsedForward;
|
|
225
|
+
function __wbg_get_imports() {
|
|
226
|
+
const import0 = {
|
|
227
|
+
__proto__: null,
|
|
228
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
229
|
+
const ret = debugString(arg1);
|
|
230
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
const len1 = WASM_VECTOR_LEN;
|
|
232
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
233
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
234
|
+
},
|
|
235
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
236
|
+
const ret = typeof(arg0) === 'function';
|
|
237
|
+
return ret;
|
|
238
|
+
},
|
|
239
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
240
|
+
const val = arg0;
|
|
241
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
242
|
+
return ret;
|
|
243
|
+
},
|
|
244
|
+
__wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
|
|
245
|
+
const ret = typeof(arg0) === 'string';
|
|
246
|
+
return ret;
|
|
247
|
+
},
|
|
248
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
249
|
+
const ret = arg0 === undefined;
|
|
250
|
+
return ret;
|
|
251
|
+
},
|
|
252
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
253
|
+
const obj = arg1;
|
|
254
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
255
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
var len1 = WASM_VECTOR_LEN;
|
|
257
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
258
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
259
|
+
},
|
|
260
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
261
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
262
|
+
},
|
|
263
|
+
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
264
|
+
arg0._wbg_cb_unref();
|
|
265
|
+
},
|
|
266
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
267
|
+
const ret = arg0.call(arg1, arg2);
|
|
268
|
+
return ret;
|
|
269
|
+
}, arguments); },
|
|
270
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
271
|
+
const ret = arg0.crypto;
|
|
272
|
+
return ret;
|
|
273
|
+
},
|
|
274
|
+
__wbg_error_757e9472f8410341: function(arg0, arg1) {
|
|
275
|
+
let deferred0_0;
|
|
276
|
+
let deferred0_1;
|
|
277
|
+
try {
|
|
278
|
+
deferred0_0 = arg0;
|
|
279
|
+
deferred0_1 = arg1;
|
|
280
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
281
|
+
} finally {
|
|
282
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
__wbg_find_secrets_ac7fdc1159604883: function() { return handleError(function (arg0, arg1) {
|
|
286
|
+
const ret = arg0.find_secrets(arg1);
|
|
287
|
+
return ret;
|
|
288
|
+
}, arguments); },
|
|
289
|
+
__wbg_fromprior_new: function(arg0) {
|
|
290
|
+
const ret = FromPrior.__wrap(arg0);
|
|
291
|
+
return ret;
|
|
292
|
+
},
|
|
293
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
294
|
+
arg0.getRandomValues(arg1);
|
|
295
|
+
}, arguments); },
|
|
296
|
+
__wbg_get_secret_4feafe5a1d1ffa81: function() { return handleError(function (arg0, arg1, arg2) {
|
|
297
|
+
const ret = arg0.get_secret(getStringFromWasm0(arg1, arg2));
|
|
298
|
+
return ret;
|
|
299
|
+
}, arguments); },
|
|
300
|
+
__wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
|
|
301
|
+
const ret = arg0[arg1 >>> 0];
|
|
302
|
+
return ret;
|
|
303
|
+
},
|
|
304
|
+
__wbg_instanceof_Error_fe6fa771c78ee4cf: function(arg0) {
|
|
305
|
+
let result;
|
|
306
|
+
try {
|
|
307
|
+
result = arg0 instanceof Error;
|
|
308
|
+
} catch (_) {
|
|
309
|
+
result = false;
|
|
310
|
+
}
|
|
311
|
+
const ret = result;
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbg_isArray_5674713bb7b79043: function(arg0) {
|
|
315
|
+
const ret = Array.isArray(arg0);
|
|
316
|
+
return ret;
|
|
317
|
+
},
|
|
318
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
319
|
+
const ret = arg0.length;
|
|
320
|
+
return ret;
|
|
321
|
+
},
|
|
322
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
323
|
+
const ret = arg0.length;
|
|
324
|
+
return ret;
|
|
325
|
+
},
|
|
326
|
+
__wbg_message_1cbc5bc03dcf1dee: function(arg0) {
|
|
327
|
+
const ret = arg0.message;
|
|
328
|
+
return ret;
|
|
329
|
+
},
|
|
330
|
+
__wbg_message_new: function(arg0) {
|
|
331
|
+
const ret = Message.__wrap(arg0);
|
|
332
|
+
return ret;
|
|
333
|
+
},
|
|
334
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
335
|
+
const ret = arg0.msCrypto;
|
|
336
|
+
return ret;
|
|
337
|
+
},
|
|
338
|
+
__wbg_name_b9d8f2ea16b22045: function(arg0) {
|
|
339
|
+
const ret = arg0.name;
|
|
340
|
+
return ret;
|
|
341
|
+
},
|
|
342
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
343
|
+
const ret = new Error();
|
|
344
|
+
return ret;
|
|
345
|
+
},
|
|
346
|
+
__wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
|
|
347
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
348
|
+
return ret;
|
|
349
|
+
},
|
|
350
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
351
|
+
const ret = new Array();
|
|
352
|
+
return ret;
|
|
353
|
+
},
|
|
354
|
+
__wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
|
|
355
|
+
try {
|
|
356
|
+
var state0 = {a: arg0, b: arg1};
|
|
357
|
+
var cb0 = (arg0, arg1) => {
|
|
358
|
+
const a = state0.a;
|
|
359
|
+
state0.a = 0;
|
|
360
|
+
try {
|
|
361
|
+
return wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
362
|
+
} finally {
|
|
363
|
+
state0.a = a;
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
const ret = new Promise(cb0);
|
|
367
|
+
return ret;
|
|
368
|
+
} finally {
|
|
369
|
+
state0.a = 0;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
__wbg_new_with_length_5ffeddb9d9fbb96f: function(arg0) {
|
|
373
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
374
|
+
return ret;
|
|
375
|
+
},
|
|
376
|
+
__wbg_new_with_length_6a9fc3631737ef8c: function(arg0) {
|
|
377
|
+
const ret = new Array(arg0 >>> 0);
|
|
378
|
+
return ret;
|
|
379
|
+
},
|
|
380
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
381
|
+
const ret = arg0.node;
|
|
382
|
+
return ret;
|
|
383
|
+
},
|
|
384
|
+
__wbg_parse_23539455d6f8d64a: function(arg0, arg1) {
|
|
385
|
+
let deferred0_0;
|
|
386
|
+
let deferred0_1;
|
|
387
|
+
try {
|
|
388
|
+
deferred0_0 = arg0;
|
|
389
|
+
deferred0_1 = arg1;
|
|
390
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
391
|
+
return ret;
|
|
392
|
+
} finally {
|
|
393
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
397
|
+
const ret = arg0.process;
|
|
398
|
+
return ret;
|
|
399
|
+
},
|
|
400
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
401
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
402
|
+
},
|
|
403
|
+
__wbg_push_bfdf956ba476f65b: function(arg0, arg1) {
|
|
404
|
+
const ret = arg0.push(arg1);
|
|
405
|
+
return ret;
|
|
406
|
+
},
|
|
407
|
+
__wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
|
|
408
|
+
const ret = arg0.queueMicrotask;
|
|
409
|
+
return ret;
|
|
410
|
+
},
|
|
411
|
+
__wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
|
|
412
|
+
queueMicrotask(arg0);
|
|
413
|
+
},
|
|
414
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
415
|
+
arg0.randomFillSync(arg1);
|
|
416
|
+
}, arguments); },
|
|
417
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
418
|
+
const ret = module.require;
|
|
419
|
+
return ret;
|
|
420
|
+
}, arguments); },
|
|
421
|
+
__wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
|
|
422
|
+
const ret = Promise.resolve(arg0);
|
|
423
|
+
return ret;
|
|
424
|
+
},
|
|
425
|
+
__wbg_resolve_e22be98c10d787e4: function() { return handleError(function (arg0, arg1, arg2) {
|
|
426
|
+
const ret = arg0.resolve(getStringFromWasm0(arg1, arg2));
|
|
427
|
+
return ret;
|
|
428
|
+
}, arguments); },
|
|
429
|
+
__wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
|
|
430
|
+
arg0[arg1 >>> 0] = arg2;
|
|
431
|
+
},
|
|
432
|
+
__wbg_set_name_6e2a5da46a9ae1e7: function(arg0, arg1, arg2) {
|
|
433
|
+
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
434
|
+
},
|
|
435
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
436
|
+
const ret = arg1.stack;
|
|
437
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
438
|
+
const len1 = WASM_VECTOR_LEN;
|
|
439
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
440
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
441
|
+
},
|
|
442
|
+
__wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
|
|
443
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
444
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
445
|
+
},
|
|
446
|
+
__wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
|
|
447
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
448
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
449
|
+
},
|
|
450
|
+
__wbg_static_accessor_SELF_d8b50611246a6d92: function() {
|
|
451
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
452
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
453
|
+
},
|
|
454
|
+
__wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
|
|
455
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
456
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
457
|
+
},
|
|
458
|
+
__wbg_stringify_708233af042413e0: function(arg0, arg1) {
|
|
459
|
+
const ret = JSON.stringify(arg1);
|
|
460
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
461
|
+
var len1 = WASM_VECTOR_LEN;
|
|
462
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
463
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
464
|
+
},
|
|
465
|
+
__wbg_subarray_1daff70dde20c145: function(arg0, arg1, arg2) {
|
|
466
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
467
|
+
return ret;
|
|
468
|
+
},
|
|
469
|
+
__wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
|
|
470
|
+
const ret = arg0.then(arg1, arg2);
|
|
471
|
+
return ret;
|
|
472
|
+
},
|
|
473
|
+
__wbg_then_b830475380919203: function(arg0, arg1) {
|
|
474
|
+
const ret = arg0.then(arg1);
|
|
475
|
+
return ret;
|
|
476
|
+
},
|
|
477
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
478
|
+
const ret = arg0.versions;
|
|
479
|
+
return ret;
|
|
480
|
+
},
|
|
481
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
482
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 435, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
483
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_);
|
|
484
|
+
return ret;
|
|
485
|
+
},
|
|
486
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
487
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
488
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
489
|
+
return ret;
|
|
490
|
+
},
|
|
491
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
492
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
493
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
494
|
+
return ret;
|
|
495
|
+
},
|
|
496
|
+
__wbindgen_init_externref_table: function() {
|
|
497
|
+
const table = wasm.__wbindgen_externrefs;
|
|
498
|
+
const offset = table.grow(4);
|
|
499
|
+
table.set(0, undefined);
|
|
500
|
+
table.set(offset + 0, undefined);
|
|
501
|
+
table.set(offset + 1, null);
|
|
502
|
+
table.set(offset + 2, true);
|
|
503
|
+
table.set(offset + 3, false);
|
|
504
|
+
},
|
|
505
|
+
};
|
|
506
|
+
return {
|
|
507
|
+
__proto__: null,
|
|
508
|
+
"./index_bg.js": import0,
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_(arg0, arg1, arg2) {
|
|
513
|
+
const ret = wasm.wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___wasm_bindgen_648b4352b10fe6c___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_648b4352b10fe6c___JsError___true_(arg0, arg1, arg2);
|
|
514
|
+
if (ret[1]) {
|
|
515
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
520
|
+
wasm.wasm_bindgen_648b4352b10fe6c___convert__closures_____invoke___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined___js_sys_63cb12eb7c55ef4___Function_fn_wasm_bindgen_648b4352b10fe6c___JsValue_____wasm_bindgen_648b4352b10fe6c___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const FromPriorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
524
|
+
? { register: () => {}, unregister: () => {} }
|
|
525
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fromprior_free(ptr, 1));
|
|
526
|
+
const MessageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
527
|
+
? { register: () => {}, unregister: () => {} }
|
|
528
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_message_free(ptr, 1));
|
|
529
|
+
const ParsedForwardFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
530
|
+
? { register: () => {}, unregister: () => {} }
|
|
531
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedforward_free(ptr, 1));
|
|
532
|
+
|
|
533
|
+
function addToExternrefTable0(obj) {
|
|
534
|
+
const idx = wasm.__externref_table_alloc();
|
|
535
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
536
|
+
return idx;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
540
|
+
? { register: () => {}, unregister: () => {} }
|
|
541
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
542
|
+
|
|
543
|
+
function debugString(val) {
|
|
544
|
+
// primitive types
|
|
545
|
+
const type = typeof val;
|
|
546
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
547
|
+
return `${val}`;
|
|
548
|
+
}
|
|
549
|
+
if (type == 'string') {
|
|
550
|
+
return `"${val}"`;
|
|
551
|
+
}
|
|
552
|
+
if (type == 'symbol') {
|
|
553
|
+
const description = val.description;
|
|
554
|
+
if (description == null) {
|
|
555
|
+
return 'Symbol';
|
|
556
|
+
} else {
|
|
557
|
+
return `Symbol(${description})`;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (type == 'function') {
|
|
561
|
+
const name = val.name;
|
|
562
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
563
|
+
return `Function(${name})`;
|
|
564
|
+
} else {
|
|
565
|
+
return 'Function';
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
// objects
|
|
569
|
+
if (Array.isArray(val)) {
|
|
570
|
+
const length = val.length;
|
|
571
|
+
let debug = '[';
|
|
572
|
+
if (length > 0) {
|
|
573
|
+
debug += debugString(val[0]);
|
|
574
|
+
}
|
|
575
|
+
for(let i = 1; i < length; i++) {
|
|
576
|
+
debug += ', ' + debugString(val[i]);
|
|
577
|
+
}
|
|
578
|
+
debug += ']';
|
|
579
|
+
return debug;
|
|
580
|
+
}
|
|
581
|
+
// Test for built-in
|
|
582
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
583
|
+
let className;
|
|
584
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
585
|
+
className = builtInMatches[1];
|
|
586
|
+
} else {
|
|
587
|
+
// Failed to match the standard '[object ClassName]'
|
|
588
|
+
return toString.call(val);
|
|
589
|
+
}
|
|
590
|
+
if (className == 'Object') {
|
|
591
|
+
// we're a user defined class or Object
|
|
592
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
593
|
+
// easier than looping through ownProperties of `val`.
|
|
594
|
+
try {
|
|
595
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
596
|
+
} catch (_) {
|
|
597
|
+
return 'Object';
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
// errors
|
|
601
|
+
if (val instanceof Error) {
|
|
602
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
603
|
+
}
|
|
604
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
605
|
+
return className;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
609
|
+
ptr = ptr >>> 0;
|
|
610
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
let cachedDataViewMemory0 = null;
|
|
614
|
+
function getDataViewMemory0() {
|
|
615
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
616
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
617
|
+
}
|
|
618
|
+
return cachedDataViewMemory0;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
function getStringFromWasm0(ptr, len) {
|
|
622
|
+
return decodeText(ptr >>> 0, len);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
let cachedUint8ArrayMemory0 = null;
|
|
626
|
+
function getUint8ArrayMemory0() {
|
|
627
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
628
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
629
|
+
}
|
|
630
|
+
return cachedUint8ArrayMemory0;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function handleError(f, args) {
|
|
634
|
+
try {
|
|
635
|
+
return f.apply(this, args);
|
|
636
|
+
} catch (e) {
|
|
637
|
+
const idx = addToExternrefTable0(e);
|
|
638
|
+
wasm.__wbindgen_exn_store(idx);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
function isLikeNone(x) {
|
|
643
|
+
return x === undefined || x === null;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
647
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
648
|
+
const real = (...args) => {
|
|
649
|
+
|
|
650
|
+
// First up with a closure we increment the internal reference
|
|
651
|
+
// count. This ensures that the Rust closure environment won't
|
|
652
|
+
// be deallocated while we're invoking it.
|
|
653
|
+
state.cnt++;
|
|
654
|
+
const a = state.a;
|
|
655
|
+
state.a = 0;
|
|
656
|
+
try {
|
|
657
|
+
return f(a, state.b, ...args);
|
|
658
|
+
} finally {
|
|
659
|
+
state.a = a;
|
|
660
|
+
real._wbg_cb_unref();
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
real._wbg_cb_unref = () => {
|
|
664
|
+
if (--state.cnt === 0) {
|
|
665
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
666
|
+
state.a = 0;
|
|
667
|
+
CLOSURE_DTORS.unregister(state);
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
671
|
+
return real;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
675
|
+
if (realloc === undefined) {
|
|
676
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
677
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
678
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
679
|
+
WASM_VECTOR_LEN = buf.length;
|
|
680
|
+
return ptr;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
let len = arg.length;
|
|
684
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
685
|
+
|
|
686
|
+
const mem = getUint8ArrayMemory0();
|
|
687
|
+
|
|
688
|
+
let offset = 0;
|
|
689
|
+
|
|
690
|
+
for (; offset < len; offset++) {
|
|
691
|
+
const code = arg.charCodeAt(offset);
|
|
692
|
+
if (code > 0x7F) break;
|
|
693
|
+
mem[ptr + offset] = code;
|
|
694
|
+
}
|
|
695
|
+
if (offset !== len) {
|
|
696
|
+
if (offset !== 0) {
|
|
697
|
+
arg = arg.slice(offset);
|
|
698
|
+
}
|
|
699
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
700
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
701
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
702
|
+
|
|
703
|
+
offset += ret.written;
|
|
704
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
WASM_VECTOR_LEN = offset;
|
|
708
|
+
return ptr;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
function takeFromExternrefTable0(idx) {
|
|
712
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
713
|
+
wasm.__externref_table_dealloc(idx);
|
|
714
|
+
return value;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
718
|
+
cachedTextDecoder.decode();
|
|
719
|
+
function decodeText(ptr, len) {
|
|
720
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
const cachedTextEncoder = new TextEncoder();
|
|
724
|
+
|
|
725
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
726
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
727
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
728
|
+
view.set(buf);
|
|
729
|
+
return {
|
|
730
|
+
read: arg.length,
|
|
731
|
+
written: buf.length
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
let WASM_VECTOR_LEN = 0;
|
|
737
|
+
|
|
738
|
+
const wasmPath = `${__dirname}/index_bg.wasm`;
|
|
739
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
740
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
741
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
742
|
+
let wasm = wasmInstance.exports;
|
|
743
|
+
wasm.__wbindgen_start();
|