@waku/core 0.0.9 → 0.0.10
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/CHANGELOG.md +12 -1
- package/bundle/index.js +5 -5
- package/bundle/lib/message/topic_only_message.js +2 -2
- package/bundle/lib/message/version_0.js +2 -2
- package/bundle/{peer_exchange-53df2b11.js → peer_exchange-df95c3a7.js} +253 -276
- package/bundle/{topic_only_message-ece0fef9.js → topic_only_message-b1eddea1.js} +1 -1
- package/bundle/{version_0-b1fc527d.js → version_0-862a05e0.js} +1 -1
- package/dist/lib/waku.js +1 -1
- package/dist/lib/waku.js.map +1 -1
- package/package.json +3 -3
- package/src/lib/waku.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [@waku/core@0.0.10] - 2023-01-25
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Ping Relay messages are now set as ephemeral.
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Moved `@chai` and `@fast-check` to `devDependencies` list.
|
19
|
+
|
10
20
|
## [@waku/core@0.0.9] - 2023-01-18
|
11
21
|
|
12
22
|
### Changed
|
@@ -646,7 +656,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
646
656
|
- [ReactJS Chat App example](./examples/web-chat).
|
647
657
|
- [Typedoc Documentation](https://js-waku.wakuconnect.dev/).
|
648
658
|
|
649
|
-
[unreleased]: https://github.com/status-im/js-waku/compare/@waku/core@0.0.
|
659
|
+
[unreleased]: https://github.com/status-im/js-waku/compare/@waku/core@0.0.10...HEAD
|
660
|
+
[@waku/core@0.0.10]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.9...@waku/core@0.0.10
|
650
661
|
[@waku/core@0.0.9]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.8...@waku/core@0.0.9
|
651
662
|
[@waku/core@0.0.8]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.7...@waku/core@0.0.8
|
652
663
|
[@waku/core@0.0.7]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.6...@waku/core@0.0.7
|
package/bundle/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { c as commonjsGlobal, a as aspromise, b as base64$5, e as eventemitter, f as float, i as inquire_1, u as utf8$6, p as pool_1, g as getAugmentedNamespace, d as debug, F as FilterRPC$1, P as PushRPC$1, h as PushResponse, H as HistoryRPC$1, j as PagingInfo, k as HistoryResponse, l as getDefaultExportFromCjs } from './peer_exchange-
|
2
|
-
import { c as createEncoder, v as version_0 } from './version_0-
|
3
|
-
export { D as DecodedMessage, a as createDecoder, c as createEncoder } from './version_0-
|
4
|
-
import { t as topic_only_message, T as TopicOnlyDecoder } from './topic_only_message-
|
1
|
+
import { c as commonjsGlobal, a as aspromise, b as base64$5, e as eventemitter, f as float, i as inquire_1, u as utf8$6, p as pool_1, g as getAugmentedNamespace, d as debug, F as FilterRPC$1, P as PushRPC$1, h as PushResponse, H as HistoryRPC$1, j as PagingInfo, k as HistoryResponse, l as getDefaultExportFromCjs } from './peer_exchange-df95c3a7.js';
|
2
|
+
import { c as createEncoder, v as version_0 } from './version_0-862a05e0.js';
|
3
|
+
export { D as DecodedMessage, a as createDecoder, c as createEncoder } from './version_0-862a05e0.js';
|
4
|
+
import { t as topic_only_message, T as TopicOnlyDecoder } from './topic_only_message-b1eddea1.js';
|
5
5
|
|
6
6
|
/**
|
7
7
|
* DefaultPubSubTopic is the default gossipsub topic to use for Waku.
|
@@ -27614,7 +27614,7 @@ class WakuNode {
|
|
27614
27614
|
}
|
27615
27615
|
const relay = this.relay;
|
27616
27616
|
if (relay && relayPeriodSecs !== 0) {
|
27617
|
-
const encoder = createEncoder(RelayPingContentTopic);
|
27617
|
+
const encoder = createEncoder(RelayPingContentTopic, true);
|
27618
27618
|
this.relayKeepAliveTimers[peerIdStr] = setInterval(() => {
|
27619
27619
|
log$3("Sending Waku Relay ping message");
|
27620
27620
|
relay
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import '../../peer_exchange-
|
2
|
-
export { T as TopicOnlyDecoder, a as TopicOnlyMessage } from '../../topic_only_message-
|
1
|
+
import '../../peer_exchange-df95c3a7.js';
|
2
|
+
export { T as TopicOnlyDecoder, a as TopicOnlyMessage } from '../../topic_only_message-b1eddea1.js';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { m as proto } from '../../peer_exchange-
|
2
|
-
export { D as DecodedMessage, b as Decoder, E as Encoder, V as Version, a as createDecoder, c as createEncoder } from '../../version_0-
|
1
|
+
export { m as proto } from '../../peer_exchange-df95c3a7.js';
|
2
|
+
export { D as DecodedMessage, b as Decoder, E as Encoder, V as Version, a as createDecoder, c as createEncoder } from '../../version_0-862a05e0.js';
|
@@ -746,7 +746,7 @@ var common$1 = setup;
|
|
746
746
|
|
747
747
|
var debug = browser.exports;
|
748
748
|
|
749
|
-
var aspromise = asPromise;
|
749
|
+
var aspromise = asPromise$1;
|
750
750
|
|
751
751
|
/**
|
752
752
|
* Callback as used by {@link util.asPromise}.
|
@@ -765,7 +765,7 @@ var aspromise = asPromise;
|
|
765
765
|
* @param {...*} params Function arguments
|
766
766
|
* @returns {Promise<*>} Promisified function
|
767
767
|
*/
|
768
|
-
function asPromise(fn, ctx/*, varargs */) {
|
768
|
+
function asPromise$1(fn, ctx/*, varargs */) {
|
769
769
|
var params = new Array(arguments.length - 1),
|
770
770
|
offset = 0,
|
771
771
|
index = 2,
|
@@ -1351,7 +1351,7 @@ function readUintBE(buf, pos) {
|
|
1351
1351
|
| buf[pos + 3]) >>> 0;
|
1352
1352
|
}
|
1353
1353
|
|
1354
|
-
var inquire_1 = inquire;
|
1354
|
+
var inquire_1 = inquire$1;
|
1355
1355
|
|
1356
1356
|
/**
|
1357
1357
|
* Requires a module only if available.
|
@@ -1359,7 +1359,7 @@ var inquire_1 = inquire;
|
|
1359
1359
|
* @param {string} moduleName Module to require
|
1360
1360
|
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
1361
1361
|
*/
|
1362
|
-
function inquire(moduleName) {
|
1362
|
+
function inquire$1(moduleName) {
|
1363
1363
|
try {
|
1364
1364
|
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
1365
1365
|
if (mod && (mod.length || Object.keys(mod).length))
|
@@ -3426,311 +3426,288 @@ var roots = {};
|
|
3426
3426
|
|
3427
3427
|
var util$2 = {exports: {}};
|
3428
3428
|
|
3429
|
-
var codegen_1;
|
3430
|
-
var hasRequiredCodegen;
|
3431
|
-
|
3432
|
-
function requireCodegen () {
|
3433
|
-
if (hasRequiredCodegen) return codegen_1;
|
3434
|
-
hasRequiredCodegen = 1;
|
3435
|
-
codegen_1 = codegen;
|
3429
|
+
var codegen_1 = codegen;
|
3436
3430
|
|
3437
|
-
|
3438
|
-
|
3439
|
-
|
3440
|
-
|
3441
|
-
|
3442
|
-
|
3443
|
-
|
3444
|
-
|
3431
|
+
/**
|
3432
|
+
* Begins generating a function.
|
3433
|
+
* @memberof util
|
3434
|
+
* @param {string[]} functionParams Function parameter names
|
3435
|
+
* @param {string} [functionName] Function name if not anonymous
|
3436
|
+
* @returns {Codegen} Appender that appends code to the function's body
|
3437
|
+
*/
|
3438
|
+
function codegen(functionParams, functionName) {
|
3445
3439
|
|
3446
|
-
|
3447
|
-
|
3448
|
-
|
3449
|
-
|
3450
|
-
|
3440
|
+
/* istanbul ignore if */
|
3441
|
+
if (typeof functionParams === "string") {
|
3442
|
+
functionName = functionParams;
|
3443
|
+
functionParams = undefined;
|
3444
|
+
}
|
3451
3445
|
|
3452
|
-
|
3446
|
+
var body = [];
|
3453
3447
|
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3448
|
+
/**
|
3449
|
+
* Appends code to the function's body or finishes generation.
|
3450
|
+
* @typedef Codegen
|
3451
|
+
* @type {function}
|
3452
|
+
* @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
|
3453
|
+
* @param {...*} [formatParams] Format parameters
|
3454
|
+
* @returns {Codegen|Function} Itself or the generated function if finished
|
3455
|
+
* @throws {Error} If format parameter counts do not match
|
3456
|
+
*/
|
3463
3457
|
|
3464
|
-
|
3465
|
-
|
3458
|
+
function Codegen(formatStringOrScope) {
|
3459
|
+
// note that explicit array handling below makes this ~50% faster
|
3466
3460
|
|
3467
|
-
|
3468
|
-
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3476
|
-
|
3477
|
-
|
3478
|
-
|
3479
|
-
|
3480
|
-
|
3481
|
-
|
3482
|
-
|
3483
|
-
|
3484
|
-
|
3485
|
-
|
3486
|
-
|
3461
|
+
// finish the function
|
3462
|
+
if (typeof formatStringOrScope !== "string") {
|
3463
|
+
var source = toString();
|
3464
|
+
if (codegen.verbose)
|
3465
|
+
console.log("codegen: " + source); // eslint-disable-line no-console
|
3466
|
+
source = "return " + source;
|
3467
|
+
if (formatStringOrScope) {
|
3468
|
+
var scopeKeys = Object.keys(formatStringOrScope),
|
3469
|
+
scopeParams = new Array(scopeKeys.length + 1),
|
3470
|
+
scopeValues = new Array(scopeKeys.length),
|
3471
|
+
scopeOffset = 0;
|
3472
|
+
while (scopeOffset < scopeKeys.length) {
|
3473
|
+
scopeParams[scopeOffset] = scopeKeys[scopeOffset];
|
3474
|
+
scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
|
3475
|
+
}
|
3476
|
+
scopeParams[scopeOffset] = source;
|
3477
|
+
return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
|
3478
|
+
}
|
3479
|
+
return Function(source)(); // eslint-disable-line no-new-func
|
3480
|
+
}
|
3487
3481
|
|
3488
|
-
|
3489
|
-
|
3490
|
-
|
3491
|
-
|
3492
|
-
|
3493
|
-
|
3494
|
-
|
3495
|
-
|
3496
|
-
|
3497
|
-
|
3498
|
-
|
3499
|
-
|
3500
|
-
|
3501
|
-
|
3502
|
-
|
3503
|
-
|
3504
|
-
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
|
3482
|
+
// otherwise append to body
|
3483
|
+
var formatParams = new Array(arguments.length - 1),
|
3484
|
+
formatOffset = 0;
|
3485
|
+
while (formatOffset < formatParams.length)
|
3486
|
+
formatParams[formatOffset] = arguments[++formatOffset];
|
3487
|
+
formatOffset = 0;
|
3488
|
+
formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
|
3489
|
+
var value = formatParams[formatOffset++];
|
3490
|
+
switch ($1) {
|
3491
|
+
case "d": case "f": return String(Number(value));
|
3492
|
+
case "i": return String(Math.floor(value));
|
3493
|
+
case "j": return JSON.stringify(value);
|
3494
|
+
case "s": return String(value);
|
3495
|
+
}
|
3496
|
+
return "%";
|
3497
|
+
});
|
3498
|
+
if (formatOffset !== formatParams.length)
|
3499
|
+
throw Error("parameter count mismatch");
|
3500
|
+
body.push(formatStringOrScope);
|
3501
|
+
return Codegen;
|
3502
|
+
}
|
3509
3503
|
|
3510
|
-
|
3511
|
-
|
3512
|
-
|
3504
|
+
function toString(functionNameOverride) {
|
3505
|
+
return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
|
3506
|
+
}
|
3513
3507
|
|
3514
|
-
|
3515
|
-
|
3516
|
-
|
3508
|
+
Codegen.toString = toString;
|
3509
|
+
return Codegen;
|
3510
|
+
}
|
3517
3511
|
|
3518
|
-
|
3519
|
-
|
3520
|
-
|
3521
|
-
|
3522
|
-
|
3523
|
-
|
3524
|
-
|
3525
|
-
|
3512
|
+
/**
|
3513
|
+
* Begins generating a function.
|
3514
|
+
* @memberof util
|
3515
|
+
* @function codegen
|
3516
|
+
* @param {string} [functionName] Function name if not anonymous
|
3517
|
+
* @returns {Codegen} Appender that appends code to the function's body
|
3518
|
+
* @variation 2
|
3519
|
+
*/
|
3526
3520
|
|
3527
|
-
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3531
|
-
|
3532
|
-
|
3533
|
-
return codegen_1;
|
3534
|
-
}
|
3535
|
-
|
3536
|
-
var fetch_1;
|
3537
|
-
var hasRequiredFetch;
|
3521
|
+
/**
|
3522
|
+
* When set to `true`, codegen will log generated code to console. Useful for debugging.
|
3523
|
+
* @name util.codegen.verbose
|
3524
|
+
* @type {boolean}
|
3525
|
+
*/
|
3526
|
+
codegen.verbose = false;
|
3538
3527
|
|
3539
|
-
|
3540
|
-
if (hasRequiredFetch) return fetch_1;
|
3541
|
-
hasRequiredFetch = 1;
|
3542
|
-
fetch_1 = fetch;
|
3528
|
+
var fetch_1 = fetch;
|
3543
3529
|
|
3544
|
-
|
3545
|
-
|
3530
|
+
var asPromise = aspromise,
|
3531
|
+
inquire = inquire_1;
|
3546
3532
|
|
3547
|
-
|
3533
|
+
var fs = inquire("fs");
|
3548
3534
|
|
3549
|
-
|
3550
|
-
|
3551
|
-
|
3552
|
-
|
3553
|
-
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3535
|
+
/**
|
3536
|
+
* Node-style callback as used by {@link util.fetch}.
|
3537
|
+
* @typedef FetchCallback
|
3538
|
+
* @type {function}
|
3539
|
+
* @param {?Error} error Error, if any, otherwise `null`
|
3540
|
+
* @param {string} [contents] File contents, if there hasn't been an error
|
3541
|
+
* @returns {undefined}
|
3542
|
+
*/
|
3557
3543
|
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3544
|
+
/**
|
3545
|
+
* Options as used by {@link util.fetch}.
|
3546
|
+
* @typedef FetchOptions
|
3547
|
+
* @type {Object}
|
3548
|
+
* @property {boolean} [binary=false] Whether expecting a binary response
|
3549
|
+
* @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
|
3550
|
+
*/
|
3565
3551
|
|
3566
|
-
|
3567
|
-
|
3568
|
-
|
3569
|
-
|
3570
|
-
|
3571
|
-
|
3572
|
-
|
3573
|
-
|
3574
|
-
|
3575
|
-
|
3576
|
-
|
3577
|
-
|
3578
|
-
|
3579
|
-
|
3552
|
+
/**
|
3553
|
+
* Fetches the contents of a file.
|
3554
|
+
* @memberof util
|
3555
|
+
* @param {string} filename File path or url
|
3556
|
+
* @param {FetchOptions} options Fetch options
|
3557
|
+
* @param {FetchCallback} callback Callback function
|
3558
|
+
* @returns {undefined}
|
3559
|
+
*/
|
3560
|
+
function fetch(filename, options, callback) {
|
3561
|
+
if (typeof options === "function") {
|
3562
|
+
callback = options;
|
3563
|
+
options = {};
|
3564
|
+
} else if (!options)
|
3565
|
+
options = {};
|
3580
3566
|
|
3581
|
-
|
3582
|
-
|
3567
|
+
if (!callback)
|
3568
|
+
return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
|
3583
3569
|
|
3584
|
-
|
3585
|
-
|
3586
|
-
|
3587
|
-
|
3588
|
-
|
3589
|
-
|
3590
|
-
|
3591
|
-
|
3592
|
-
|
3570
|
+
// if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
|
3571
|
+
if (!options.xhr && fs && fs.readFile)
|
3572
|
+
return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
|
3573
|
+
return err && typeof XMLHttpRequest !== "undefined"
|
3574
|
+
? fetch.xhr(filename, options, callback)
|
3575
|
+
: err
|
3576
|
+
? callback(err)
|
3577
|
+
: callback(null, options.binary ? contents : contents.toString("utf8"));
|
3578
|
+
});
|
3593
3579
|
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3580
|
+
// use the XHR version otherwise.
|
3581
|
+
return fetch.xhr(filename, options, callback);
|
3582
|
+
}
|
3597
3583
|
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3601
|
-
|
3602
|
-
|
3603
|
-
|
3604
|
-
|
3605
|
-
|
3606
|
-
|
3584
|
+
/**
|
3585
|
+
* Fetches the contents of a file.
|
3586
|
+
* @name util.fetch
|
3587
|
+
* @function
|
3588
|
+
* @param {string} path File path or url
|
3589
|
+
* @param {FetchCallback} callback Callback function
|
3590
|
+
* @returns {undefined}
|
3591
|
+
* @variation 2
|
3592
|
+
*/
|
3607
3593
|
|
3608
|
-
|
3609
|
-
|
3610
|
-
|
3611
|
-
|
3612
|
-
|
3613
|
-
|
3614
|
-
|
3615
|
-
|
3616
|
-
|
3594
|
+
/**
|
3595
|
+
* Fetches the contents of a file.
|
3596
|
+
* @name util.fetch
|
3597
|
+
* @function
|
3598
|
+
* @param {string} path File path or url
|
3599
|
+
* @param {FetchOptions} [options] Fetch options
|
3600
|
+
* @returns {Promise<string|Uint8Array>} Promise
|
3601
|
+
* @variation 3
|
3602
|
+
*/
|
3617
3603
|
|
3618
|
-
|
3619
|
-
|
3620
|
-
|
3621
|
-
|
3604
|
+
/**/
|
3605
|
+
fetch.xhr = function fetch_xhr(filename, options, callback) {
|
3606
|
+
var xhr = new XMLHttpRequest();
|
3607
|
+
xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
|
3622
3608
|
|
3623
|
-
|
3624
|
-
|
3609
|
+
if (xhr.readyState !== 4)
|
3610
|
+
return undefined;
|
3625
3611
|
|
3626
|
-
|
3627
|
-
|
3628
|
-
|
3629
|
-
|
3630
|
-
|
3612
|
+
// local cors security errors return status 0 / empty string, too. afaik this cannot be
|
3613
|
+
// reliably distinguished from an actually empty file for security reasons. feel free
|
3614
|
+
// to send a pull request if you are aware of a solution.
|
3615
|
+
if (xhr.status !== 0 && xhr.status !== 200)
|
3616
|
+
return callback(Error("status " + xhr.status));
|
3631
3617
|
|
3632
|
-
|
3633
|
-
|
3634
|
-
|
3635
|
-
|
3636
|
-
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3618
|
+
// if binary data is expected, make sure that some sort of array is returned, even if
|
3619
|
+
// ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
|
3620
|
+
if (options.binary) {
|
3621
|
+
var buffer = xhr.response;
|
3622
|
+
if (!buffer) {
|
3623
|
+
buffer = [];
|
3624
|
+
for (var i = 0; i < xhr.responseText.length; ++i)
|
3625
|
+
buffer.push(xhr.responseText.charCodeAt(i) & 255);
|
3626
|
+
}
|
3627
|
+
return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
|
3628
|
+
}
|
3629
|
+
return callback(null, xhr.responseText);
|
3630
|
+
};
|
3645
3631
|
|
3646
|
-
|
3647
|
-
|
3648
|
-
|
3649
|
-
|
3650
|
-
|
3651
|
-
|
3632
|
+
if (options.binary) {
|
3633
|
+
// ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
|
3634
|
+
if ("overrideMimeType" in xhr)
|
3635
|
+
xhr.overrideMimeType("text/plain; charset=x-user-defined");
|
3636
|
+
xhr.responseType = "arraybuffer";
|
3637
|
+
}
|
3652
3638
|
|
3653
|
-
|
3654
|
-
|
3655
|
-
|
3656
|
-
return fetch_1;
|
3657
|
-
}
|
3639
|
+
xhr.open("GET", filename);
|
3640
|
+
xhr.send();
|
3641
|
+
};
|
3658
3642
|
|
3659
3643
|
var path = {};
|
3660
3644
|
|
3661
|
-
|
3662
|
-
|
3663
|
-
function requirePath () {
|
3664
|
-
if (hasRequiredPath) return path;
|
3665
|
-
hasRequiredPath = 1;
|
3666
|
-
(function (exports) {
|
3645
|
+
(function (exports) {
|
3667
3646
|
|
3668
|
-
|
3669
|
-
|
3670
|
-
|
3671
|
-
|
3672
|
-
|
3673
|
-
|
3647
|
+
/**
|
3648
|
+
* A minimal path module to resolve Unix, Windows and URL paths alike.
|
3649
|
+
* @memberof util
|
3650
|
+
* @namespace
|
3651
|
+
*/
|
3652
|
+
var path = exports;
|
3674
3653
|
|
3675
|
-
|
3676
|
-
|
3677
|
-
|
3678
|
-
|
3679
|
-
|
3680
|
-
|
3681
|
-
|
3682
|
-
|
3683
|
-
|
3654
|
+
var isAbsolute =
|
3655
|
+
/**
|
3656
|
+
* Tests if the specified path is absolute.
|
3657
|
+
* @param {string} path Path to test
|
3658
|
+
* @returns {boolean} `true` if path is absolute
|
3659
|
+
*/
|
3660
|
+
path.isAbsolute = function isAbsolute(path) {
|
3661
|
+
return /^(?:\/|\w+:)/.test(path);
|
3662
|
+
};
|
3684
3663
|
|
3685
|
-
|
3686
|
-
|
3687
|
-
|
3688
|
-
|
3689
|
-
|
3690
|
-
|
3691
|
-
|
3692
|
-
|
3693
|
-
|
3694
|
-
|
3695
|
-
|
3696
|
-
|
3697
|
-
|
3698
|
-
|
3699
|
-
|
3700
|
-
|
3701
|
-
|
3702
|
-
|
3703
|
-
|
3704
|
-
|
3705
|
-
|
3706
|
-
|
3707
|
-
|
3708
|
-
|
3709
|
-
|
3710
|
-
|
3711
|
-
|
3712
|
-
|
3713
|
-
|
3664
|
+
var normalize =
|
3665
|
+
/**
|
3666
|
+
* Normalizes the specified path.
|
3667
|
+
* @param {string} path Path to normalize
|
3668
|
+
* @returns {string} Normalized path
|
3669
|
+
*/
|
3670
|
+
path.normalize = function normalize(path) {
|
3671
|
+
path = path.replace(/\\/g, "/")
|
3672
|
+
.replace(/\/{2,}/g, "/");
|
3673
|
+
var parts = path.split("/"),
|
3674
|
+
absolute = isAbsolute(path),
|
3675
|
+
prefix = "";
|
3676
|
+
if (absolute)
|
3677
|
+
prefix = parts.shift() + "/";
|
3678
|
+
for (var i = 0; i < parts.length;) {
|
3679
|
+
if (parts[i] === "..") {
|
3680
|
+
if (i > 0 && parts[i - 1] !== "..")
|
3681
|
+
parts.splice(--i, 2);
|
3682
|
+
else if (absolute)
|
3683
|
+
parts.splice(i, 1);
|
3684
|
+
else
|
3685
|
+
++i;
|
3686
|
+
} else if (parts[i] === ".")
|
3687
|
+
parts.splice(i, 1);
|
3688
|
+
else
|
3689
|
+
++i;
|
3690
|
+
}
|
3691
|
+
return prefix + parts.join("/");
|
3692
|
+
};
|
3714
3693
|
|
3715
|
-
|
3716
|
-
|
3717
|
-
|
3718
|
-
|
3719
|
-
|
3720
|
-
|
3721
|
-
|
3722
|
-
|
3723
|
-
|
3724
|
-
|
3725
|
-
|
3726
|
-
|
3727
|
-
|
3728
|
-
|
3729
|
-
|
3730
|
-
|
3694
|
+
/**
|
3695
|
+
* Resolves the specified include path against the specified origin path.
|
3696
|
+
* @param {string} originPath Path to the origin file
|
3697
|
+
* @param {string} includePath Include path relative to origin path
|
3698
|
+
* @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
|
3699
|
+
* @returns {string} Path to the include file
|
3700
|
+
*/
|
3701
|
+
path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
|
3702
|
+
if (!alreadyNormalized)
|
3703
|
+
includePath = normalize(includePath);
|
3704
|
+
if (isAbsolute(includePath))
|
3705
|
+
return includePath;
|
3706
|
+
if (!alreadyNormalized)
|
3707
|
+
originPath = normalize(originPath);
|
3708
|
+
return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
|
3709
|
+
};
|
3731
3710
|
} (path));
|
3732
|
-
return path;
|
3733
|
-
}
|
3734
3711
|
|
3735
3712
|
var types$1 = {};
|
3736
3713
|
|
@@ -7316,9 +7293,9 @@ function requireUtil () {
|
|
7316
7293
|
var Type, // cyclic
|
7317
7294
|
Enum;
|
7318
7295
|
|
7319
|
-
util.codegen =
|
7320
|
-
util.fetch =
|
7321
|
-
util.path =
|
7296
|
+
util.codegen = codegen_1;
|
7297
|
+
util.fetch = fetch_1;
|
7298
|
+
util.path = path;
|
7322
7299
|
|
7323
7300
|
/**
|
7324
7301
|
* Node's fs module if available.
|
package/dist/lib/waku.js
CHANGED
@@ -137,7 +137,7 @@ export class WakuNode {
|
|
137
137
|
}
|
138
138
|
const relay = this.relay;
|
139
139
|
if (relay && relayPeriodSecs !== 0) {
|
140
|
-
const encoder = createEncoder(RelayPingContentTopic);
|
140
|
+
const encoder = createEncoder(RelayPingContentTopic, true);
|
141
141
|
this.relayKeepAliveTimers[peerIdStr] = setInterval(() => {
|
142
142
|
log("Sending Waku Relay ping message");
|
143
143
|
relay
|
package/dist/lib/waku.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"waku.js","sourceRoot":"","sources":["../../src/lib/waku.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAAG,EAAE,CAAC;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;AAwB/B,MAAM,OAAO,QAAQ;IAenB,YACE,OAAoB,EACpB,MAAc,EACd,KAA+C,EAC/C,SAA2D,EAC3D,MAAkD,EAClD,YAAoE;QAEpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,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AC,SAAS,CAAC,EAAE;YACvC,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;YACnD,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;SAC5C;QAED,IAAI,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,EAAE;YACxC,aAAa,CAAC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;SAC7C;IACH,CAAC;IAEO,iBAAiB;QACvB,KAAK,MAAM,KAAK,IAAI;YAClB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC;YAC1C,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC;SAC5C,EAAE;YACD,aAAa,CAAC,KAAK,CAAC,CAAC;SACtB;QAED,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAC;IACjC,CAAC;CACF;AAED,SAAS,OAAO,CAAC,MAAc;IAC7B,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,MAAM,CAAC,WAAW,CAAC,QAAQ,CAChC,cAAc,CAAC,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAClE,CAAC;YACF,qEAAqE;YACrE,oCAAoC;SACrC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@waku/core",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.10",
|
4
4
|
"description": "TypeScript implementation of the Waku v2 protocol",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"module": "./dist/index.js",
|
@@ -98,8 +98,6 @@
|
|
98
98
|
"it-length-prefixed": "^8.0.2",
|
99
99
|
"it-pipe": "^2.0.4",
|
100
100
|
"libp2p": "0.40.0",
|
101
|
-
"chai": "^4.3.4",
|
102
|
-
"fast-check": "^2.14.0",
|
103
101
|
"p-event": "^5.0.1",
|
104
102
|
"uint8arraylist": "^2.3.2",
|
105
103
|
"uint8arrays": "^4.0.2",
|
@@ -136,6 +134,8 @@
|
|
136
134
|
"karma-mocha": "^2.0.1",
|
137
135
|
"karma-webpack": "^5.0.0",
|
138
136
|
"mocha": "^9.1.3",
|
137
|
+
"chai": "^4.3.4",
|
138
|
+
"fast-check": "^2.14.0",
|
139
139
|
"npm-run-all": "^4.1.5",
|
140
140
|
"p-timeout": "^6.0.0",
|
141
141
|
"portfinder": "^1.0.28",
|
package/src/lib/waku.ts
CHANGED
@@ -234,7 +234,7 @@ export class WakuNode implements Waku {
|
|
234
234
|
|
235
235
|
const relay = this.relay;
|
236
236
|
if (relay && relayPeriodSecs !== 0) {
|
237
|
-
const encoder = createEncoder(RelayPingContentTopic);
|
237
|
+
const encoder = createEncoder(RelayPingContentTopic, true);
|
238
238
|
this.relayKeepAliveTimers[peerIdStr] = setInterval(() => {
|
239
239
|
log("Sending Waku Relay ping message");
|
240
240
|
relay
|