@synonymdev/pubky 0.4.0 → 0.4.2-rc1
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/README.md +66 -27
- package/index.cjs +291 -329
- package/index.js +295 -334
- package/package.json +1 -1
- package/pubky.d.ts +39 -24
- package/pubky_bg.wasm +0 -0
package/index.cjs
CHANGED
|
@@ -9,12 +9,6 @@ imports['__wbindgen_placeholder__'] = module.exports;
|
|
|
9
9
|
let wasm;
|
|
10
10
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
11
11
|
|
|
12
|
-
const heap = new Array(128).fill(undefined);
|
|
13
|
-
|
|
14
|
-
heap.push(undefined, null, true, false);
|
|
15
|
-
|
|
16
|
-
function getObject(idx) { return heap[idx]; }
|
|
17
|
-
|
|
18
12
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
19
13
|
|
|
20
14
|
cachedTextDecoder.decode();
|
|
@@ -33,14 +27,9 @@ function getStringFromWasm0(ptr, len) {
|
|
|
33
27
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
40
|
-
const idx = heap_next;
|
|
41
|
-
heap_next = heap[idx];
|
|
42
|
-
|
|
43
|
-
heap[idx] = obj;
|
|
30
|
+
function addToExternrefTable0(obj) {
|
|
31
|
+
const idx = wasm.__externref_table_alloc();
|
|
32
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
44
33
|
return idx;
|
|
45
34
|
}
|
|
46
35
|
|
|
@@ -48,7 +37,8 @@ function handleError(f, args) {
|
|
|
48
37
|
try {
|
|
49
38
|
return f.apply(this, args);
|
|
50
39
|
} catch (e) {
|
|
51
|
-
|
|
40
|
+
const idx = addToExternrefTable0(e);
|
|
41
|
+
wasm.__wbindgen_exn_store(idx);
|
|
52
42
|
}
|
|
53
43
|
}
|
|
54
44
|
|
|
@@ -57,18 +47,6 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
57
47
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
58
48
|
}
|
|
59
49
|
|
|
60
|
-
function dropObject(idx) {
|
|
61
|
-
if (idx < 132) return;
|
|
62
|
-
heap[idx] = heap_next;
|
|
63
|
-
heap_next = idx;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function takeObject(idx) {
|
|
67
|
-
const ret = getObject(idx);
|
|
68
|
-
dropObject(idx);
|
|
69
|
-
return ret;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
50
|
function isLikeNone(x) {
|
|
73
51
|
return x === undefined || x === null;
|
|
74
52
|
}
|
|
@@ -141,7 +119,7 @@ function getDataViewMemory0() {
|
|
|
141
119
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
142
120
|
? { register: () => {}, unregister: () => {} }
|
|
143
121
|
: new FinalizationRegistry(state => {
|
|
144
|
-
wasm.
|
|
122
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b)
|
|
145
123
|
});
|
|
146
124
|
|
|
147
125
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
@@ -157,7 +135,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
157
135
|
return f(a, state.b, ...args);
|
|
158
136
|
} finally {
|
|
159
137
|
if (--state.cnt === 0) {
|
|
160
|
-
wasm.
|
|
138
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
161
139
|
CLOSURE_DTORS.unregister(state);
|
|
162
140
|
} else {
|
|
163
141
|
state.a = a;
|
|
@@ -234,38 +212,38 @@ function debugString(val) {
|
|
|
234
212
|
return className;
|
|
235
213
|
}
|
|
236
214
|
|
|
237
|
-
function
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const result = [];
|
|
241
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
242
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
215
|
+
function _assertClass(instance, klass) {
|
|
216
|
+
if (!(instance instanceof klass)) {
|
|
217
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
243
218
|
}
|
|
244
|
-
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function takeFromExternrefTable0(idx) {
|
|
222
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
223
|
+
wasm.__externref_table_dealloc(idx);
|
|
224
|
+
return value;
|
|
245
225
|
}
|
|
246
226
|
/**
|
|
247
227
|
* @param {string} level
|
|
248
228
|
*/
|
|
249
229
|
module.exports.setLogLevel = function(level) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
256
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
257
|
-
if (r1) {
|
|
258
|
-
throw takeObject(r0);
|
|
259
|
-
}
|
|
260
|
-
} finally {
|
|
261
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
230
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
232
|
+
const ret = wasm.setLogLevel(ptr0, len0);
|
|
233
|
+
if (ret[1]) {
|
|
234
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
262
235
|
}
|
|
263
236
|
};
|
|
264
237
|
|
|
265
|
-
function
|
|
266
|
-
|
|
267
|
-
|
|
238
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
239
|
+
ptr = ptr >>> 0;
|
|
240
|
+
const mem = getDataViewMemory0();
|
|
241
|
+
const result = [];
|
|
242
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
243
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
268
244
|
}
|
|
245
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
246
|
+
return result;
|
|
269
247
|
}
|
|
270
248
|
/**
|
|
271
249
|
* Create a recovery file of the `keypair`, containing the secret key encrypted
|
|
@@ -279,7 +257,7 @@ module.exports.createRecoveryFile = function(keypair, passphrase) {
|
|
|
279
257
|
const ptr0 = passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
258
|
const len0 = WASM_VECTOR_LEN;
|
|
281
259
|
const ret = wasm.createRecoveryFile(keypair.__wbg_ptr, ptr0, len0);
|
|
282
|
-
return
|
|
260
|
+
return ret;
|
|
283
261
|
};
|
|
284
262
|
|
|
285
263
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -296,31 +274,23 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
296
274
|
* @returns {Keypair}
|
|
297
275
|
*/
|
|
298
276
|
module.exports.decryptRecoveryFile = function(recovery_file, passphrase) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
307
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
308
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
309
|
-
if (r2) {
|
|
310
|
-
throw takeObject(r1);
|
|
311
|
-
}
|
|
312
|
-
return Keypair.__wrap(r0);
|
|
313
|
-
} finally {
|
|
314
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
277
|
+
const ptr0 = passArray8ToWasm0(recovery_file, wasm.__wbindgen_malloc);
|
|
278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
279
|
+
const ptr1 = passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
|
+
const len1 = WASM_VECTOR_LEN;
|
|
281
|
+
const ret = wasm.decryptRecoveryFile(ptr0, len0, ptr1, len1);
|
|
282
|
+
if (ret[2]) {
|
|
283
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
315
284
|
}
|
|
285
|
+
return Keypair.__wrap(ret[0]);
|
|
316
286
|
};
|
|
317
287
|
|
|
318
|
-
function
|
|
319
|
-
wasm.
|
|
288
|
+
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
289
|
+
wasm.closure486_externref_shim(arg0, arg1, arg2);
|
|
320
290
|
}
|
|
321
291
|
|
|
322
|
-
function
|
|
323
|
-
wasm.
|
|
292
|
+
function __wbg_adapter_160(arg0, arg1, arg2, arg3) {
|
|
293
|
+
wasm.closure555_externref_shim(arg0, arg1, arg2, arg3);
|
|
324
294
|
}
|
|
325
295
|
|
|
326
296
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -363,15 +333,11 @@ class AuthRequest {
|
|
|
363
333
|
let deferred1_0;
|
|
364
334
|
let deferred1_1;
|
|
365
335
|
try {
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
deferred1_0 = r0;
|
|
371
|
-
deferred1_1 = r1;
|
|
372
|
-
return getStringFromWasm0(r0, r1);
|
|
336
|
+
const ret = wasm.authrequest_url(this.__wbg_ptr);
|
|
337
|
+
deferred1_0 = ret[0];
|
|
338
|
+
deferred1_1 = ret[1];
|
|
339
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
373
340
|
} finally {
|
|
374
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
375
341
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
376
342
|
}
|
|
377
343
|
}
|
|
@@ -385,7 +351,7 @@ class AuthRequest {
|
|
|
385
351
|
*/
|
|
386
352
|
response() {
|
|
387
353
|
const ret = wasm.authrequest_response(this.__wbg_ptr);
|
|
388
|
-
return
|
|
354
|
+
return ret;
|
|
389
355
|
}
|
|
390
356
|
}
|
|
391
357
|
module.exports.AuthRequest = AuthRequest;
|
|
@@ -415,61 +381,6 @@ class Client {
|
|
|
415
381
|
const ptr = this.__destroy_into_raw();
|
|
416
382
|
wasm.__wbg_client_free(ptr, 0);
|
|
417
383
|
}
|
|
418
|
-
/**
|
|
419
|
-
* Create Client with default Settings including default relays
|
|
420
|
-
*/
|
|
421
|
-
constructor() {
|
|
422
|
-
const ret = wasm.client_new();
|
|
423
|
-
this.__wbg_ptr = ret >>> 0;
|
|
424
|
-
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
425
|
-
return this;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Create a client with with configurations appropriate for local testing:
|
|
429
|
-
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
430
|
-
* - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
|
|
431
|
-
* and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
|
|
432
|
-
* @returns {Client}
|
|
433
|
-
*/
|
|
434
|
-
static testnet() {
|
|
435
|
-
const ret = wasm.client_testnet();
|
|
436
|
-
return Client.__wrap(ret);
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* @param {string} url
|
|
440
|
-
* @param {any | null} [request_init]
|
|
441
|
-
* @returns {Promise<Promise<any>>}
|
|
442
|
-
*/
|
|
443
|
-
fetch(url, request_init) {
|
|
444
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
|
-
const len0 = WASM_VECTOR_LEN;
|
|
446
|
-
const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(request_init) ? 0 : addHeapObject(request_init));
|
|
447
|
-
return takeObject(ret);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Returns a list of Pubky urls (as strings).
|
|
451
|
-
*
|
|
452
|
-
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
453
|
-
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
454
|
-
* or a path (to a file or directory) relative to the `url`
|
|
455
|
-
* - `reverse`: List in reverse order
|
|
456
|
-
* - `limit` Limit the number of urls in the response
|
|
457
|
-
* - `shallow`: List directories and files, instead of flat list of files.
|
|
458
|
-
* @param {string} url
|
|
459
|
-
* @param {string | null} [cursor]
|
|
460
|
-
* @param {boolean | null} [reverse]
|
|
461
|
-
* @param {number | null} [limit]
|
|
462
|
-
* @param {boolean | null} [shallow]
|
|
463
|
-
* @returns {Promise<Array<any>>}
|
|
464
|
-
*/
|
|
465
|
-
list(url, cursor, reverse, limit, shallow) {
|
|
466
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
467
|
-
const len0 = WASM_VECTOR_LEN;
|
|
468
|
-
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
469
|
-
var len1 = WASM_VECTOR_LEN;
|
|
470
|
-
const ret = wasm.client_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
471
|
-
return takeObject(ret);
|
|
472
|
-
}
|
|
473
384
|
/**
|
|
474
385
|
* Signup to a homeserver and update Pkarr accordingly.
|
|
475
386
|
*
|
|
@@ -477,13 +388,16 @@ class Client {
|
|
|
477
388
|
* for example "pubky.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy"
|
|
478
389
|
* @param {Keypair} keypair
|
|
479
390
|
* @param {PublicKey} homeserver
|
|
391
|
+
* @param {string | null} [signup_token]
|
|
480
392
|
* @returns {Promise<Session>}
|
|
481
393
|
*/
|
|
482
|
-
signup(keypair, homeserver) {
|
|
394
|
+
signup(keypair, homeserver, signup_token) {
|
|
483
395
|
_assertClass(keypair, Keypair);
|
|
484
396
|
_assertClass(homeserver, PublicKey);
|
|
485
|
-
|
|
486
|
-
|
|
397
|
+
var ptr0 = isLikeNone(signup_token) ? 0 : passStringToWasm0(signup_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
398
|
+
var len0 = WASM_VECTOR_LEN;
|
|
399
|
+
const ret = wasm.client_signup(this.__wbg_ptr, keypair.__wbg_ptr, homeserver.__wbg_ptr, ptr0, len0);
|
|
400
|
+
return ret;
|
|
487
401
|
}
|
|
488
402
|
/**
|
|
489
403
|
* Check the current session for a given Pubky in its homeserver.
|
|
@@ -496,7 +410,7 @@ class Client {
|
|
|
496
410
|
session(pubky) {
|
|
497
411
|
_assertClass(pubky, PublicKey);
|
|
498
412
|
const ret = wasm.client_session(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
499
|
-
return
|
|
413
|
+
return ret;
|
|
500
414
|
}
|
|
501
415
|
/**
|
|
502
416
|
* Signout from a homeserver.
|
|
@@ -506,7 +420,7 @@ class Client {
|
|
|
506
420
|
signout(pubky) {
|
|
507
421
|
_assertClass(pubky, PublicKey);
|
|
508
422
|
const ret = wasm.client_signout(this.__wbg_ptr, pubky.__wbg_ptr);
|
|
509
|
-
return
|
|
423
|
+
return ret;
|
|
510
424
|
}
|
|
511
425
|
/**
|
|
512
426
|
* Signin to a homeserver using the root Keypair.
|
|
@@ -516,7 +430,7 @@ class Client {
|
|
|
516
430
|
signin(keypair) {
|
|
517
431
|
_assertClass(keypair, Keypair);
|
|
518
432
|
const ret = wasm.client_signin(this.__wbg_ptr, keypair.__wbg_ptr);
|
|
519
|
-
return
|
|
433
|
+
return ret;
|
|
520
434
|
}
|
|
521
435
|
/**
|
|
522
436
|
* Return `pubkyauth://` url and wait for the incoming [AuthToken]
|
|
@@ -529,23 +443,15 @@ class Client {
|
|
|
529
443
|
* @returns {AuthRequest}
|
|
530
444
|
*/
|
|
531
445
|
authRequest(relay, capabilities) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
540
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
541
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
542
|
-
if (r2) {
|
|
543
|
-
throw takeObject(r1);
|
|
544
|
-
}
|
|
545
|
-
return AuthRequest.__wrap(r0);
|
|
546
|
-
} finally {
|
|
547
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
446
|
+
const ptr0 = passStringToWasm0(relay, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
|
+
const len0 = WASM_VECTOR_LEN;
|
|
448
|
+
const ptr1 = passStringToWasm0(capabilities, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
449
|
+
const len1 = WASM_VECTOR_LEN;
|
|
450
|
+
const ret = wasm.client_authRequest(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
451
|
+
if (ret[2]) {
|
|
452
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
548
453
|
}
|
|
454
|
+
return AuthRequest.__wrap(ret[0]);
|
|
549
455
|
}
|
|
550
456
|
/**
|
|
551
457
|
* Sign an [pubky_common::auth::AuthToken], encrypt it and send it to the
|
|
@@ -559,7 +465,86 @@ class Client {
|
|
|
559
465
|
const ptr0 = passStringToWasm0(pubkyauth_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
466
|
const len0 = WASM_VECTOR_LEN;
|
|
561
467
|
const ret = wasm.client_sendAuthToken(this.__wbg_ptr, keypair.__wbg_ptr, ptr0, len0);
|
|
562
|
-
return
|
|
468
|
+
return ret;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Republish the user's PKarr record pointing to their homeserver.
|
|
472
|
+
*
|
|
473
|
+
* This method will republish the record if no record exists or if the existing record
|
|
474
|
+
* is older than 6 hours.
|
|
475
|
+
*
|
|
476
|
+
* The method is intended for clients and key managers (e.g., pubky-ring) to
|
|
477
|
+
* keep the records of active users fresh and available in the DHT and relays.
|
|
478
|
+
* It is intended to be used only after failed signin due to homeserver resolution
|
|
479
|
+
* failure. This method is lighter than performing a re-signup into the last known
|
|
480
|
+
* homeserver, but does not return a session token, so a signin must be done after
|
|
481
|
+
* republishing. On a failed signin due to homeserver resolution failure, a key
|
|
482
|
+
* manager should always attempt to republish the last known homeserver.
|
|
483
|
+
* @param {Keypair} keypair
|
|
484
|
+
* @param {string} host
|
|
485
|
+
* @returns {Promise<void>}
|
|
486
|
+
*/
|
|
487
|
+
republishHomeserver(keypair, host) {
|
|
488
|
+
_assertClass(keypair, Keypair);
|
|
489
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
490
|
+
const len0 = WASM_VECTOR_LEN;
|
|
491
|
+
const ret = wasm.client_republishHomeserver(this.__wbg_ptr, keypair.__wbg_ptr, ptr0, len0);
|
|
492
|
+
return ret;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Create Client with default Settings including default relays
|
|
496
|
+
*/
|
|
497
|
+
constructor() {
|
|
498
|
+
const ret = wasm.client_new();
|
|
499
|
+
this.__wbg_ptr = ret >>> 0;
|
|
500
|
+
ClientFinalization.register(this, this.__wbg_ptr, this);
|
|
501
|
+
return this;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Create a client with with configurations appropriate for local testing:
|
|
505
|
+
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
506
|
+
* - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
|
|
507
|
+
* and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
|
|
508
|
+
* @returns {Client}
|
|
509
|
+
*/
|
|
510
|
+
static testnet() {
|
|
511
|
+
const ret = wasm.client_testnet();
|
|
512
|
+
return Client.__wrap(ret);
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* @param {string} url
|
|
516
|
+
* @param {any | null} [request_init]
|
|
517
|
+
* @returns {Promise<Promise<any>>}
|
|
518
|
+
*/
|
|
519
|
+
fetch(url, request_init) {
|
|
520
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
521
|
+
const len0 = WASM_VECTOR_LEN;
|
|
522
|
+
const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(request_init) ? 0 : addToExternrefTable0(request_init));
|
|
523
|
+
return ret;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Returns a list of Pubky urls (as strings).
|
|
527
|
+
*
|
|
528
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
529
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
530
|
+
* or a path (to a file or directory) relative to the `url`
|
|
531
|
+
* - `reverse`: List in reverse order
|
|
532
|
+
* - `limit` Limit the number of urls in the response
|
|
533
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
534
|
+
* @param {string} url
|
|
535
|
+
* @param {string | null} [cursor]
|
|
536
|
+
* @param {boolean | null} [reverse]
|
|
537
|
+
* @param {number | null} [limit]
|
|
538
|
+
* @param {boolean | null} [shallow]
|
|
539
|
+
* @returns {Promise<Array<any>>}
|
|
540
|
+
*/
|
|
541
|
+
list(url, cursor, reverse, limit, shallow) {
|
|
542
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
543
|
+
const len0 = WASM_VECTOR_LEN;
|
|
544
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
|
+
var len1 = WASM_VECTOR_LEN;
|
|
546
|
+
const ret = wasm.client_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
547
|
+
return ret;
|
|
563
548
|
}
|
|
564
549
|
}
|
|
565
550
|
module.exports.Client = Client;
|
|
@@ -603,19 +588,11 @@ class Keypair {
|
|
|
603
588
|
* @returns {Keypair}
|
|
604
589
|
*/
|
|
605
590
|
static fromSecretKey(secret_key) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
610
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
611
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
612
|
-
if (r2) {
|
|
613
|
-
throw takeObject(r1);
|
|
614
|
-
}
|
|
615
|
-
return Keypair.__wrap(r0);
|
|
616
|
-
} finally {
|
|
617
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
591
|
+
const ret = wasm.keypair_fromSecretKey(secret_key);
|
|
592
|
+
if (ret[2]) {
|
|
593
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
618
594
|
}
|
|
595
|
+
return Keypair.__wrap(ret[0]);
|
|
619
596
|
}
|
|
620
597
|
/**
|
|
621
598
|
* Returns the secret key of this keypair.
|
|
@@ -623,7 +600,7 @@ class Keypair {
|
|
|
623
600
|
*/
|
|
624
601
|
secretKey() {
|
|
625
602
|
const ret = wasm.keypair_secretKey(this.__wbg_ptr);
|
|
626
|
-
return
|
|
603
|
+
return ret;
|
|
627
604
|
}
|
|
628
605
|
/**
|
|
629
606
|
* Returns the [PublicKey] of this keypair.
|
|
@@ -667,7 +644,7 @@ class PublicKey {
|
|
|
667
644
|
*/
|
|
668
645
|
to_uint8array() {
|
|
669
646
|
const ret = wasm.publickey_to_uint8array(this.__wbg_ptr);
|
|
670
|
-
return
|
|
647
|
+
return ret;
|
|
671
648
|
}
|
|
672
649
|
/**
|
|
673
650
|
* Returns the z-base32 encoding of this public key
|
|
@@ -677,15 +654,11 @@ class PublicKey {
|
|
|
677
654
|
let deferred1_0;
|
|
678
655
|
let deferred1_1;
|
|
679
656
|
try {
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
deferred1_0 = r0;
|
|
685
|
-
deferred1_1 = r1;
|
|
686
|
-
return getStringFromWasm0(r0, r1);
|
|
657
|
+
const ret = wasm.publickey_z32(this.__wbg_ptr);
|
|
658
|
+
deferred1_0 = ret[0];
|
|
659
|
+
deferred1_1 = ret[1];
|
|
660
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
687
661
|
} finally {
|
|
688
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
689
662
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
690
663
|
}
|
|
691
664
|
}
|
|
@@ -695,19 +668,11 @@ class PublicKey {
|
|
|
695
668
|
* @returns {PublicKey}
|
|
696
669
|
*/
|
|
697
670
|
static from(value) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
702
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
703
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
704
|
-
if (r2) {
|
|
705
|
-
throw takeObject(r1);
|
|
706
|
-
}
|
|
707
|
-
return PublicKey.__wrap(r0);
|
|
708
|
-
} finally {
|
|
709
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
671
|
+
const ret = wasm.publickey_from(value);
|
|
672
|
+
if (ret[2]) {
|
|
673
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
710
674
|
}
|
|
675
|
+
return PublicKey.__wrap(ret[0]);
|
|
711
676
|
}
|
|
712
677
|
}
|
|
713
678
|
module.exports.PublicKey = PublicKey;
|
|
@@ -750,85 +715,78 @@ class Session {
|
|
|
750
715
|
* @returns {string[]}
|
|
751
716
|
*/
|
|
752
717
|
capabilities() {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
758
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
759
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
760
|
-
return v1;
|
|
761
|
-
} finally {
|
|
762
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
763
|
-
}
|
|
718
|
+
const ret = wasm.session_capabilities(this.__wbg_ptr);
|
|
719
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
720
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
721
|
+
return v1;
|
|
764
722
|
}
|
|
765
723
|
}
|
|
766
724
|
module.exports.Session = Session;
|
|
767
725
|
|
|
768
726
|
module.exports.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
769
|
-
|
|
727
|
+
arg0.abort();
|
|
770
728
|
};
|
|
771
729
|
|
|
772
730
|
module.exports.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
773
|
-
|
|
731
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
774
732
|
}, arguments) };
|
|
775
733
|
|
|
776
734
|
module.exports.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
|
|
777
|
-
const ret =
|
|
778
|
-
return
|
|
735
|
+
const ret = arg0.arrayBuffer();
|
|
736
|
+
return ret;
|
|
779
737
|
}, arguments) };
|
|
780
738
|
|
|
781
739
|
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
782
|
-
const ret =
|
|
783
|
-
return
|
|
740
|
+
const ret = arg0.buffer;
|
|
741
|
+
return ret;
|
|
784
742
|
};
|
|
785
743
|
|
|
786
744
|
module.exports.__wbg_byteLength_e674b853d9c77e1d = function(arg0) {
|
|
787
|
-
const ret =
|
|
745
|
+
const ret = arg0.byteLength;
|
|
788
746
|
return ret;
|
|
789
747
|
};
|
|
790
748
|
|
|
791
749
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
792
|
-
const ret =
|
|
793
|
-
return
|
|
750
|
+
const ret = arg0.call(arg1);
|
|
751
|
+
return ret;
|
|
794
752
|
}, arguments) };
|
|
795
753
|
|
|
796
754
|
module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
797
|
-
const ret =
|
|
798
|
-
return
|
|
755
|
+
const ret = arg0.call(arg1, arg2);
|
|
756
|
+
return ret;
|
|
799
757
|
}, arguments) };
|
|
800
758
|
|
|
801
759
|
module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
802
|
-
const ret =
|
|
803
|
-
return
|
|
760
|
+
const ret = arg0.crypto;
|
|
761
|
+
return ret;
|
|
804
762
|
};
|
|
805
763
|
|
|
806
764
|
module.exports.__wbg_debug_e17b51583ca6a632 = function(arg0, arg1, arg2, arg3) {
|
|
807
|
-
console.debug(
|
|
765
|
+
console.debug(arg0, arg1, arg2, arg3);
|
|
808
766
|
};
|
|
809
767
|
|
|
810
768
|
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
811
|
-
const ret =
|
|
769
|
+
const ret = arg0.done;
|
|
812
770
|
return ret;
|
|
813
771
|
};
|
|
814
772
|
|
|
815
773
|
module.exports.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
|
|
816
|
-
console.error(
|
|
774
|
+
console.error(arg0, arg1, arg2, arg3);
|
|
817
775
|
};
|
|
818
776
|
|
|
819
|
-
module.exports.
|
|
820
|
-
const ret = fetch(
|
|
821
|
-
return
|
|
777
|
+
module.exports.__wbg_fetch_2025f815912fe9d0 = function(arg0) {
|
|
778
|
+
const ret = fetch(arg0);
|
|
779
|
+
return ret;
|
|
822
780
|
};
|
|
823
781
|
|
|
824
|
-
module.exports.
|
|
825
|
-
const ret =
|
|
826
|
-
return
|
|
782
|
+
module.exports.__wbg_fetch_4465c2b10f21a927 = function(arg0) {
|
|
783
|
+
const ret = fetch(arg0);
|
|
784
|
+
return ret;
|
|
827
785
|
};
|
|
828
786
|
|
|
829
|
-
module.exports.
|
|
830
|
-
const ret = fetch(
|
|
831
|
-
return
|
|
787
|
+
module.exports.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
|
|
788
|
+
const ret = arg0.fetch(arg1);
|
|
789
|
+
return ret;
|
|
832
790
|
};
|
|
833
791
|
|
|
834
792
|
module.exports.__wbg_getRandomValues_78e016fdd1d721cf = function() { return handleError(function (arg0, arg1) {
|
|
@@ -836,37 +794,37 @@ module.exports.__wbg_getRandomValues_78e016fdd1d721cf = function() { return hand
|
|
|
836
794
|
}, arguments) };
|
|
837
795
|
|
|
838
796
|
module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
839
|
-
|
|
797
|
+
arg0.getRandomValues(arg1);
|
|
840
798
|
}, arguments) };
|
|
841
799
|
|
|
842
800
|
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
843
|
-
const ret = Reflect.get(
|
|
844
|
-
return
|
|
801
|
+
const ret = Reflect.get(arg0, arg1);
|
|
802
|
+
return ret;
|
|
845
803
|
}, arguments) };
|
|
846
804
|
|
|
847
805
|
module.exports.__wbg_getheaders_8326221cf02f205d = function(arg0) {
|
|
848
|
-
const ret =
|
|
849
|
-
return
|
|
806
|
+
const ret = arg0.headers;
|
|
807
|
+
return ret;
|
|
850
808
|
};
|
|
851
809
|
|
|
852
810
|
module.exports.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
|
|
853
|
-
const ret = Reflect.has(
|
|
811
|
+
const ret = Reflect.has(arg0, arg1);
|
|
854
812
|
return ret;
|
|
855
813
|
}, arguments) };
|
|
856
814
|
|
|
857
815
|
module.exports.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
|
|
858
|
-
const ret =
|
|
859
|
-
return
|
|
816
|
+
const ret = arg0.headers;
|
|
817
|
+
return ret;
|
|
860
818
|
};
|
|
861
819
|
|
|
862
820
|
module.exports.__wbg_info_033d8b8a0838f1d3 = function(arg0, arg1, arg2, arg3) {
|
|
863
|
-
console.info(
|
|
821
|
+
console.info(arg0, arg1, arg2, arg3);
|
|
864
822
|
};
|
|
865
823
|
|
|
866
824
|
module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
|
|
867
825
|
let result;
|
|
868
826
|
try {
|
|
869
|
-
result =
|
|
827
|
+
result = arg0 instanceof Response;
|
|
870
828
|
} catch (_) {
|
|
871
829
|
result = false;
|
|
872
830
|
}
|
|
@@ -877,7 +835,7 @@ module.exports.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
|
|
|
877
835
|
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
878
836
|
let result;
|
|
879
837
|
try {
|
|
880
|
-
result =
|
|
838
|
+
result = arg0 instanceof Uint8Array;
|
|
881
839
|
} catch (_) {
|
|
882
840
|
result = false;
|
|
883
841
|
}
|
|
@@ -887,26 +845,26 @@ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
|
887
845
|
|
|
888
846
|
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
889
847
|
const ret = Symbol.iterator;
|
|
890
|
-
return
|
|
848
|
+
return ret;
|
|
891
849
|
};
|
|
892
850
|
|
|
893
851
|
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
894
|
-
const ret =
|
|
852
|
+
const ret = arg0.length;
|
|
895
853
|
return ret;
|
|
896
854
|
};
|
|
897
855
|
|
|
898
856
|
module.exports.__wbg_log_cad59bb680daec67 = function(arg0, arg1, arg2, arg3) {
|
|
899
|
-
console.log(
|
|
857
|
+
console.log(arg0, arg1, arg2, arg3);
|
|
900
858
|
};
|
|
901
859
|
|
|
902
860
|
module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
903
|
-
const ret =
|
|
904
|
-
return
|
|
861
|
+
const ret = arg0.msCrypto;
|
|
862
|
+
return ret;
|
|
905
863
|
};
|
|
906
864
|
|
|
907
865
|
module.exports.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
|
|
908
866
|
const ret = new Headers();
|
|
909
|
-
return
|
|
867
|
+
return ret;
|
|
910
868
|
}, arguments) };
|
|
911
869
|
|
|
912
870
|
module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
@@ -916,13 +874,13 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
916
874
|
const a = state0.a;
|
|
917
875
|
state0.a = 0;
|
|
918
876
|
try {
|
|
919
|
-
return
|
|
877
|
+
return __wbg_adapter_160(a, state0.b, arg0, arg1);
|
|
920
878
|
} finally {
|
|
921
879
|
state0.a = a;
|
|
922
880
|
}
|
|
923
881
|
};
|
|
924
882
|
const ret = new Promise(cb0);
|
|
925
|
-
return
|
|
883
|
+
return ret;
|
|
926
884
|
} finally {
|
|
927
885
|
state0.a = state0.b = 0;
|
|
928
886
|
}
|
|
@@ -930,57 +888,57 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
930
888
|
|
|
931
889
|
module.exports.__wbg_new_405e22f390576ce2 = function() {
|
|
932
890
|
const ret = new Object();
|
|
933
|
-
return
|
|
891
|
+
return ret;
|
|
934
892
|
};
|
|
935
893
|
|
|
936
894
|
module.exports.__wbg_new_78feb108b6472713 = function() {
|
|
937
895
|
const ret = new Array();
|
|
938
|
-
return
|
|
896
|
+
return ret;
|
|
939
897
|
};
|
|
940
898
|
|
|
941
899
|
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
942
|
-
const ret = new Uint8Array(
|
|
943
|
-
return
|
|
900
|
+
const ret = new Uint8Array(arg0);
|
|
901
|
+
return ret;
|
|
944
902
|
};
|
|
945
903
|
|
|
946
904
|
module.exports.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
|
|
947
905
|
const ret = new AbortController();
|
|
948
|
-
return
|
|
906
|
+
return ret;
|
|
949
907
|
}, arguments) };
|
|
950
908
|
|
|
951
909
|
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
952
910
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
953
|
-
return
|
|
911
|
+
return ret;
|
|
954
912
|
};
|
|
955
913
|
|
|
956
914
|
module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
957
|
-
const ret = new Uint8Array(
|
|
958
|
-
return
|
|
915
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
916
|
+
return ret;
|
|
959
917
|
};
|
|
960
918
|
|
|
961
919
|
module.exports.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
962
920
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
963
|
-
return
|
|
921
|
+
return ret;
|
|
964
922
|
};
|
|
965
923
|
|
|
966
924
|
module.exports.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
967
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1),
|
|
968
|
-
return
|
|
925
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
926
|
+
return ret;
|
|
969
927
|
}, arguments) };
|
|
970
928
|
|
|
971
929
|
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
972
|
-
const ret =
|
|
973
|
-
return
|
|
930
|
+
const ret = arg0.next;
|
|
931
|
+
return ret;
|
|
974
932
|
};
|
|
975
933
|
|
|
976
934
|
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
977
|
-
const ret =
|
|
978
|
-
return
|
|
935
|
+
const ret = arg0.next();
|
|
936
|
+
return ret;
|
|
979
937
|
}, arguments) };
|
|
980
938
|
|
|
981
939
|
module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
982
|
-
const ret =
|
|
983
|
-
return
|
|
940
|
+
const ret = arg0.node;
|
|
941
|
+
return ret;
|
|
984
942
|
};
|
|
985
943
|
|
|
986
944
|
module.exports.__wbg_now_807e54c39636c349 = function() {
|
|
@@ -989,133 +947,133 @@ module.exports.__wbg_now_807e54c39636c349 = function() {
|
|
|
989
947
|
};
|
|
990
948
|
|
|
991
949
|
module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
992
|
-
const ret =
|
|
993
|
-
return
|
|
950
|
+
const ret = arg0.process;
|
|
951
|
+
return ret;
|
|
994
952
|
};
|
|
995
953
|
|
|
996
954
|
module.exports.__wbg_publickey_new = function(arg0) {
|
|
997
955
|
const ret = PublicKey.__wrap(arg0);
|
|
998
|
-
return
|
|
956
|
+
return ret;
|
|
999
957
|
};
|
|
1000
958
|
|
|
1001
959
|
module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
1002
|
-
const ret =
|
|
960
|
+
const ret = arg0.push(arg1);
|
|
1003
961
|
return ret;
|
|
1004
962
|
};
|
|
1005
963
|
|
|
1006
964
|
module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
|
1007
|
-
queueMicrotask(
|
|
965
|
+
queueMicrotask(arg0);
|
|
1008
966
|
};
|
|
1009
967
|
|
|
1010
968
|
module.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
|
1011
|
-
const ret =
|
|
1012
|
-
return
|
|
969
|
+
const ret = arg0.queueMicrotask;
|
|
970
|
+
return ret;
|
|
1013
971
|
};
|
|
1014
972
|
|
|
1015
973
|
module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
1016
|
-
|
|
974
|
+
arg0.randomFillSync(arg1);
|
|
1017
975
|
}, arguments) };
|
|
1018
976
|
|
|
1019
977
|
module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
1020
978
|
const ret = module.require;
|
|
1021
|
-
return
|
|
979
|
+
return ret;
|
|
1022
980
|
}, arguments) };
|
|
1023
981
|
|
|
1024
982
|
module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
1025
|
-
const ret = Promise.resolve(
|
|
1026
|
-
return
|
|
983
|
+
const ret = Promise.resolve(arg0);
|
|
984
|
+
return ret;
|
|
1027
985
|
};
|
|
1028
986
|
|
|
1029
987
|
module.exports.__wbg_session_new = function(arg0) {
|
|
1030
988
|
const ret = Session.__wrap(arg0);
|
|
1031
|
-
return
|
|
989
|
+
return ret;
|
|
1032
990
|
};
|
|
1033
991
|
|
|
1034
992
|
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
1035
|
-
|
|
993
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
1036
994
|
};
|
|
1037
995
|
|
|
1038
996
|
module.exports.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
|
|
1039
|
-
|
|
997
|
+
arg0.body = arg1;
|
|
1040
998
|
};
|
|
1041
999
|
|
|
1042
1000
|
module.exports.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
|
|
1043
|
-
|
|
1001
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1044
1002
|
};
|
|
1045
1003
|
|
|
1046
1004
|
module.exports.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
|
|
1047
|
-
|
|
1005
|
+
arg0.headers = arg1;
|
|
1048
1006
|
};
|
|
1049
1007
|
|
|
1050
1008
|
module.exports.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
|
|
1051
|
-
|
|
1009
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
1052
1010
|
};
|
|
1053
1011
|
|
|
1054
1012
|
module.exports.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
|
|
1055
|
-
|
|
1013
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
1056
1014
|
};
|
|
1057
1015
|
|
|
1058
1016
|
module.exports.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
|
|
1059
|
-
|
|
1017
|
+
arg0.signal = arg1;
|
|
1060
1018
|
};
|
|
1061
1019
|
|
|
1062
1020
|
module.exports.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
|
|
1063
|
-
const ret =
|
|
1064
|
-
return
|
|
1021
|
+
const ret = arg0.signal;
|
|
1022
|
+
return ret;
|
|
1065
1023
|
};
|
|
1066
1024
|
|
|
1067
1025
|
module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
1068
1026
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1069
|
-
return isLikeNone(ret) ? 0 :
|
|
1027
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1070
1028
|
};
|
|
1071
1029
|
|
|
1072
1030
|
module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
1073
1031
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1074
|
-
return isLikeNone(ret) ? 0 :
|
|
1032
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1075
1033
|
};
|
|
1076
1034
|
|
|
1077
1035
|
module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
1078
1036
|
const ret = typeof self === 'undefined' ? null : self;
|
|
1079
|
-
return isLikeNone(ret) ? 0 :
|
|
1037
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1080
1038
|
};
|
|
1081
1039
|
|
|
1082
1040
|
module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
1083
1041
|
const ret = typeof window === 'undefined' ? null : window;
|
|
1084
|
-
return isLikeNone(ret) ? 0 :
|
|
1042
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1085
1043
|
};
|
|
1086
1044
|
|
|
1087
1045
|
module.exports.__wbg_status_f6360336ca686bf0 = function(arg0) {
|
|
1088
|
-
const ret =
|
|
1046
|
+
const ret = arg0.status;
|
|
1089
1047
|
return ret;
|
|
1090
1048
|
};
|
|
1091
1049
|
|
|
1092
1050
|
module.exports.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
|
|
1093
|
-
const ret = JSON.stringify(
|
|
1094
|
-
return
|
|
1051
|
+
const ret = JSON.stringify(arg0);
|
|
1052
|
+
return ret;
|
|
1095
1053
|
}, arguments) };
|
|
1096
1054
|
|
|
1097
1055
|
module.exports.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
1098
|
-
const ret =
|
|
1099
|
-
return
|
|
1056
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1057
|
+
return ret;
|
|
1100
1058
|
};
|
|
1101
1059
|
|
|
1102
1060
|
module.exports.__wbg_text_7805bea50de2af49 = function() { return handleError(function (arg0) {
|
|
1103
|
-
const ret =
|
|
1104
|
-
return
|
|
1061
|
+
const ret = arg0.text();
|
|
1062
|
+
return ret;
|
|
1105
1063
|
}, arguments) };
|
|
1106
1064
|
|
|
1107
1065
|
module.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
|
1108
|
-
const ret =
|
|
1109
|
-
return
|
|
1066
|
+
const ret = arg0.then(arg1);
|
|
1067
|
+
return ret;
|
|
1110
1068
|
};
|
|
1111
1069
|
|
|
1112
1070
|
module.exports.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
|
|
1113
|
-
const ret =
|
|
1114
|
-
return
|
|
1071
|
+
const ret = arg0.then(arg1, arg2);
|
|
1072
|
+
return ret;
|
|
1115
1073
|
};
|
|
1116
1074
|
|
|
1117
1075
|
module.exports.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
|
|
1118
|
-
const ret =
|
|
1076
|
+
const ret = arg1.url;
|
|
1119
1077
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1120
1078
|
const len1 = WASM_VECTOR_LEN;
|
|
1121
1079
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
@@ -1123,21 +1081,21 @@ module.exports.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
|
|
|
1123
1081
|
};
|
|
1124
1082
|
|
|
1125
1083
|
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
1126
|
-
const ret =
|
|
1127
|
-
return
|
|
1084
|
+
const ret = arg0.value;
|
|
1085
|
+
return ret;
|
|
1128
1086
|
};
|
|
1129
1087
|
|
|
1130
1088
|
module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
1131
|
-
const ret =
|
|
1132
|
-
return
|
|
1089
|
+
const ret = arg0.versions;
|
|
1090
|
+
return ret;
|
|
1133
1091
|
};
|
|
1134
1092
|
|
|
1135
1093
|
module.exports.__wbg_warn_aaf1f4664a035bd6 = function(arg0, arg1, arg2, arg3) {
|
|
1136
|
-
console.warn(
|
|
1094
|
+
console.warn(arg0, arg1, arg2, arg3);
|
|
1137
1095
|
};
|
|
1138
1096
|
|
|
1139
1097
|
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
1140
|
-
const obj =
|
|
1098
|
+
const obj = arg0.original;
|
|
1141
1099
|
if (obj.cnt-- == 1) {
|
|
1142
1100
|
obj.a = 0;
|
|
1143
1101
|
return true;
|
|
@@ -1146,61 +1104,63 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
1146
1104
|
return ret;
|
|
1147
1105
|
};
|
|
1148
1106
|
|
|
1149
|
-
module.exports.
|
|
1150
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1151
|
-
return
|
|
1107
|
+
module.exports.__wbindgen_closure_wrapper2699 = function(arg0, arg1, arg2) {
|
|
1108
|
+
const ret = makeMutClosure(arg0, arg1, 487, __wbg_adapter_30);
|
|
1109
|
+
return ret;
|
|
1152
1110
|
};
|
|
1153
1111
|
|
|
1154
1112
|
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1155
|
-
const ret = debugString(
|
|
1113
|
+
const ret = debugString(arg1);
|
|
1156
1114
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1157
1115
|
const len1 = WASM_VECTOR_LEN;
|
|
1158
1116
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1159
1117
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1160
1118
|
};
|
|
1161
1119
|
|
|
1120
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
1121
|
+
const table = wasm.__wbindgen_export_2;
|
|
1122
|
+
const offset = table.grow(4);
|
|
1123
|
+
table.set(0, undefined);
|
|
1124
|
+
table.set(offset + 0, undefined);
|
|
1125
|
+
table.set(offset + 1, null);
|
|
1126
|
+
table.set(offset + 2, true);
|
|
1127
|
+
table.set(offset + 3, false);
|
|
1128
|
+
;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1162
1131
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1163
|
-
const ret = typeof(
|
|
1132
|
+
const ret = typeof(arg0) === 'function';
|
|
1164
1133
|
return ret;
|
|
1165
1134
|
};
|
|
1166
1135
|
|
|
1167
1136
|
module.exports.__wbindgen_is_null = function(arg0) {
|
|
1168
|
-
const ret =
|
|
1137
|
+
const ret = arg0 === null;
|
|
1169
1138
|
return ret;
|
|
1170
1139
|
};
|
|
1171
1140
|
|
|
1172
1141
|
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1173
|
-
const val =
|
|
1142
|
+
const val = arg0;
|
|
1174
1143
|
const ret = typeof(val) === 'object' && val !== null;
|
|
1175
1144
|
return ret;
|
|
1176
1145
|
};
|
|
1177
1146
|
|
|
1178
1147
|
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1179
|
-
const ret = typeof(
|
|
1148
|
+
const ret = typeof(arg0) === 'string';
|
|
1180
1149
|
return ret;
|
|
1181
1150
|
};
|
|
1182
1151
|
|
|
1183
1152
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1184
|
-
const ret =
|
|
1153
|
+
const ret = arg0 === undefined;
|
|
1185
1154
|
return ret;
|
|
1186
1155
|
};
|
|
1187
1156
|
|
|
1188
1157
|
module.exports.__wbindgen_memory = function() {
|
|
1189
1158
|
const ret = wasm.memory;
|
|
1190
|
-
return
|
|
1191
|
-
};
|
|
1192
|
-
|
|
1193
|
-
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1194
|
-
const ret = getObject(arg0);
|
|
1195
|
-
return addHeapObject(ret);
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
|
-
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1199
|
-
takeObject(arg0);
|
|
1159
|
+
return ret;
|
|
1200
1160
|
};
|
|
1201
1161
|
|
|
1202
1162
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1203
|
-
const obj =
|
|
1163
|
+
const obj = arg1;
|
|
1204
1164
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1205
1165
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1206
1166
|
var len1 = WASM_VECTOR_LEN;
|
|
@@ -1210,7 +1170,7 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
1210
1170
|
|
|
1211
1171
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1212
1172
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1213
|
-
return
|
|
1173
|
+
return ret;
|
|
1214
1174
|
};
|
|
1215
1175
|
|
|
1216
1176
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
@@ -1225,3 +1185,5 @@ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
|
1225
1185
|
wasm = wasmInstance.exports;
|
|
1226
1186
|
module.exports.__wasm = wasm;
|
|
1227
1187
|
|
|
1188
|
+
wasm.__wbindgen_start();
|
|
1189
|
+
|