@waku/core 0.0.7 → 0.0.8

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 CHANGED
@@ -7,6 +7,13 @@ 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.8] - 2022-12-19
11
+
12
+ ### Fixed
13
+
14
+ - Missing dependency declarations.
15
+ - Invalid re-export.
16
+
10
17
  ## [@waku/core@0.0.7] - 2022-12-15
11
18
 
12
19
  ### Added
@@ -627,7 +634,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
627
634
  - [ReactJS Chat App example](./examples/web-chat).
628
635
  - [Typedoc Documentation](https://js-waku.wakuconnect.dev/).
629
636
 
630
- [unreleased]: https://github.com/status-im/js-waku/compare/@waku/core@0.0.7...HEAD
637
+ [unreleased]: https://github.com/status-im/js-waku/compare/@waku/core@0.0.8...HEAD
638
+ [@waku/core@0.0.8]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.7...@waku/core@0.0.8
631
639
  [@waku/core@0.0.7]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.6...@waku/core@0.0.7
632
640
  [@waku/core@0.0.6]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.5...@waku/core@0.0.6
633
641
  [@waku/core@0.0.5]: https://github.com/waku-org/js-waku/compare/@waku/core@0.0.4...@waku/core@0.0.5
package/bundle/index.js CHANGED
@@ -1,5 +1,4 @@
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-53df2b11.js';
2
- export { h as PushResponse } from './peer_exchange-53df2b11.js';
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';
3
2
  import { createEncoder } from './lib/message/version_0.js';
4
3
  export { DecodedMessage, createDecoder, createEncoder } from './lib/message/version_0.js';
5
4
  import { TopicOnlyDecoder } from './lib/message/topic_only_message.js';
@@ -1,4 +1,4 @@
1
- import { d as debug, T as TopicOnlyMessage$1 } from '../../peer_exchange-53df2b11.js';
1
+ import { d as debug, T as TopicOnlyMessage$1 } from '../../peer_exchange-df95c3a7.js';
2
2
 
3
3
  const log = debug("waku:message:topic-only");
4
4
  class TopicOnlyMessage {
@@ -1,5 +1,5 @@
1
- import { d as debug, W as WakuMessage } from '../../peer_exchange-53df2b11.js';
2
- export { m as proto } from '../../peer_exchange-53df2b11.js';
1
+ import { d as debug, W as WakuMessage } from '../../peer_exchange-df95c3a7.js';
2
+ export { m as proto } from '../../peer_exchange-df95c3a7.js';
3
3
 
4
4
  const log = debug("waku:message:version-0");
5
5
  const OneMillion = BigInt(1000000);
@@ -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
- * Begins generating a function.
3439
- * @memberof util
3440
- * @param {string[]} functionParams Function parameter names
3441
- * @param {string} [functionName] Function name if not anonymous
3442
- * @returns {Codegen} Appender that appends code to the function's body
3443
- */
3444
- function codegen(functionParams, functionName) {
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
- /* istanbul ignore if */
3447
- if (typeof functionParams === "string") {
3448
- functionName = functionParams;
3449
- functionParams = undefined;
3450
- }
3440
+ /* istanbul ignore if */
3441
+ if (typeof functionParams === "string") {
3442
+ functionName = functionParams;
3443
+ functionParams = undefined;
3444
+ }
3451
3445
 
3452
- var body = [];
3446
+ var body = [];
3453
3447
 
3454
- /**
3455
- * Appends code to the function's body or finishes generation.
3456
- * @typedef Codegen
3457
- * @type {function}
3458
- * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
3459
- * @param {...*} [formatParams] Format parameters
3460
- * @returns {Codegen|Function} Itself or the generated function if finished
3461
- * @throws {Error} If format parameter counts do not match
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
- function Codegen(formatStringOrScope) {
3465
- // note that explicit array handling below makes this ~50% faster
3458
+ function Codegen(formatStringOrScope) {
3459
+ // note that explicit array handling below makes this ~50% faster
3466
3460
 
3467
- // finish the function
3468
- if (typeof formatStringOrScope !== "string") {
3469
- var source = toString();
3470
- if (codegen.verbose)
3471
- console.log("codegen: " + source); // eslint-disable-line no-console
3472
- source = "return " + source;
3473
- if (formatStringOrScope) {
3474
- var scopeKeys = Object.keys(formatStringOrScope),
3475
- scopeParams = new Array(scopeKeys.length + 1),
3476
- scopeValues = new Array(scopeKeys.length),
3477
- scopeOffset = 0;
3478
- while (scopeOffset < scopeKeys.length) {
3479
- scopeParams[scopeOffset] = scopeKeys[scopeOffset];
3480
- scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
3481
- }
3482
- scopeParams[scopeOffset] = source;
3483
- return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
3484
- }
3485
- return Function(source)(); // eslint-disable-line no-new-func
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
- // otherwise append to body
3489
- var formatParams = new Array(arguments.length - 1),
3490
- formatOffset = 0;
3491
- while (formatOffset < formatParams.length)
3492
- formatParams[formatOffset] = arguments[++formatOffset];
3493
- formatOffset = 0;
3494
- formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
3495
- var value = formatParams[formatOffset++];
3496
- switch ($1) {
3497
- case "d": case "f": return String(Number(value));
3498
- case "i": return String(Math.floor(value));
3499
- case "j": return JSON.stringify(value);
3500
- case "s": return String(value);
3501
- }
3502
- return "%";
3503
- });
3504
- if (formatOffset !== formatParams.length)
3505
- throw Error("parameter count mismatch");
3506
- body.push(formatStringOrScope);
3507
- return Codegen;
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
- function toString(functionNameOverride) {
3511
- return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
3512
- }
3504
+ function toString(functionNameOverride) {
3505
+ return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
3506
+ }
3513
3507
 
3514
- Codegen.toString = toString;
3515
- return Codegen;
3516
- }
3508
+ Codegen.toString = toString;
3509
+ return Codegen;
3510
+ }
3517
3511
 
3518
- /**
3519
- * Begins generating a function.
3520
- * @memberof util
3521
- * @function codegen
3522
- * @param {string} [functionName] Function name if not anonymous
3523
- * @returns {Codegen} Appender that appends code to the function's body
3524
- * @variation 2
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
- * When set to `true`, codegen will log generated code to console. Useful for debugging.
3529
- * @name util.codegen.verbose
3530
- * @type {boolean}
3531
- */
3532
- codegen.verbose = false;
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
- function requireFetch () {
3540
- if (hasRequiredFetch) return fetch_1;
3541
- hasRequiredFetch = 1;
3542
- fetch_1 = fetch;
3528
+ var fetch_1 = fetch;
3543
3529
 
3544
- var asPromise = aspromise,
3545
- inquire = inquire_1;
3530
+ var asPromise = aspromise,
3531
+ inquire = inquire_1;
3546
3532
 
3547
- var fs = inquire("fs");
3533
+ var fs = inquire("fs");
3548
3534
 
3549
- /**
3550
- * Node-style callback as used by {@link util.fetch}.
3551
- * @typedef FetchCallback
3552
- * @type {function}
3553
- * @param {?Error} error Error, if any, otherwise `null`
3554
- * @param {string} [contents] File contents, if there hasn't been an error
3555
- * @returns {undefined}
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
- * Options as used by {@link util.fetch}.
3560
- * @typedef FetchOptions
3561
- * @type {Object}
3562
- * @property {boolean} [binary=false] Whether expecting a binary response
3563
- * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
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
- * Fetches the contents of a file.
3568
- * @memberof util
3569
- * @param {string} filename File path or url
3570
- * @param {FetchOptions} options Fetch options
3571
- * @param {FetchCallback} callback Callback function
3572
- * @returns {undefined}
3573
- */
3574
- function fetch(filename, options, callback) {
3575
- if (typeof options === "function") {
3576
- callback = options;
3577
- options = {};
3578
- } else if (!options)
3579
- options = {};
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
- if (!callback)
3582
- return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
3567
+ if (!callback)
3568
+ return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
3583
3569
 
3584
- // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
3585
- if (!options.xhr && fs && fs.readFile)
3586
- return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
3587
- return err && typeof XMLHttpRequest !== "undefined"
3588
- ? fetch.xhr(filename, options, callback)
3589
- : err
3590
- ? callback(err)
3591
- : callback(null, options.binary ? contents : contents.toString("utf8"));
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
- // use the XHR version otherwise.
3595
- return fetch.xhr(filename, options, callback);
3596
- }
3580
+ // use the XHR version otherwise.
3581
+ return fetch.xhr(filename, options, callback);
3582
+ }
3597
3583
 
3598
- /**
3599
- * Fetches the contents of a file.
3600
- * @name util.fetch
3601
- * @function
3602
- * @param {string} path File path or url
3603
- * @param {FetchCallback} callback Callback function
3604
- * @returns {undefined}
3605
- * @variation 2
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
- * Fetches the contents of a file.
3610
- * @name util.fetch
3611
- * @function
3612
- * @param {string} path File path or url
3613
- * @param {FetchOptions} [options] Fetch options
3614
- * @returns {Promise<string|Uint8Array>} Promise
3615
- * @variation 3
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
- fetch.xhr = function fetch_xhr(filename, options, callback) {
3620
- var xhr = new XMLHttpRequest();
3621
- xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
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
- if (xhr.readyState !== 4)
3624
- return undefined;
3609
+ if (xhr.readyState !== 4)
3610
+ return undefined;
3625
3611
 
3626
- // local cors security errors return status 0 / empty string, too. afaik this cannot be
3627
- // reliably distinguished from an actually empty file for security reasons. feel free
3628
- // to send a pull request if you are aware of a solution.
3629
- if (xhr.status !== 0 && xhr.status !== 200)
3630
- return callback(Error("status " + xhr.status));
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
- // if binary data is expected, make sure that some sort of array is returned, even if
3633
- // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
3634
- if (options.binary) {
3635
- var buffer = xhr.response;
3636
- if (!buffer) {
3637
- buffer = [];
3638
- for (var i = 0; i < xhr.responseText.length; ++i)
3639
- buffer.push(xhr.responseText.charCodeAt(i) & 255);
3640
- }
3641
- return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
3642
- }
3643
- return callback(null, xhr.responseText);
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
- if (options.binary) {
3647
- // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
3648
- if ("overrideMimeType" in xhr)
3649
- xhr.overrideMimeType("text/plain; charset=x-user-defined");
3650
- xhr.responseType = "arraybuffer";
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
- xhr.open("GET", filename);
3654
- xhr.send();
3655
- };
3656
- return fetch_1;
3657
- }
3639
+ xhr.open("GET", filename);
3640
+ xhr.send();
3641
+ };
3658
3642
 
3659
3643
  var path = {};
3660
3644
 
3661
- var hasRequiredPath;
3662
-
3663
- function requirePath () {
3664
- if (hasRequiredPath) return path;
3665
- hasRequiredPath = 1;
3666
- (function (exports) {
3645
+ (function (exports) {
3667
3646
 
3668
- /**
3669
- * A minimal path module to resolve Unix, Windows and URL paths alike.
3670
- * @memberof util
3671
- * @namespace
3672
- */
3673
- var path = exports;
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
- var isAbsolute =
3676
- /**
3677
- * Tests if the specified path is absolute.
3678
- * @param {string} path Path to test
3679
- * @returns {boolean} `true` if path is absolute
3680
- */
3681
- path.isAbsolute = function isAbsolute(path) {
3682
- return /^(?:\/|\w+:)/.test(path);
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
- var normalize =
3686
- /**
3687
- * Normalizes the specified path.
3688
- * @param {string} path Path to normalize
3689
- * @returns {string} Normalized path
3690
- */
3691
- path.normalize = function normalize(path) {
3692
- path = path.replace(/\\/g, "/")
3693
- .replace(/\/{2,}/g, "/");
3694
- var parts = path.split("/"),
3695
- absolute = isAbsolute(path),
3696
- prefix = "";
3697
- if (absolute)
3698
- prefix = parts.shift() + "/";
3699
- for (var i = 0; i < parts.length;) {
3700
- if (parts[i] === "..") {
3701
- if (i > 0 && parts[i - 1] !== "..")
3702
- parts.splice(--i, 2);
3703
- else if (absolute)
3704
- parts.splice(i, 1);
3705
- else
3706
- ++i;
3707
- } else if (parts[i] === ".")
3708
- parts.splice(i, 1);
3709
- else
3710
- ++i;
3711
- }
3712
- return prefix + parts.join("/");
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
- * Resolves the specified include path against the specified origin path.
3717
- * @param {string} originPath Path to the origin file
3718
- * @param {string} includePath Include path relative to origin path
3719
- * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
3720
- * @returns {string} Path to the include file
3721
- */
3722
- path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
3723
- if (!alreadyNormalized)
3724
- includePath = normalize(includePath);
3725
- if (isAbsolute(includePath))
3726
- return includePath;
3727
- if (!alreadyNormalized)
3728
- originPath = normalize(originPath);
3729
- return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
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 = requireCodegen();
7320
- util.fetch = requireFetch();
7321
- util.path = requirePath();
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/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { WakuNode } from "./lib/waku.js";
6
6
  export * as waku_filter from "./lib/filter/index.js";
7
7
  export { wakuFilter } from "./lib/filter/index.js";
8
8
  export * as waku_light_push from "./lib/light_push/index.js";
9
- export { wakuLightPush, LightPushCodec, PushResponse, } from "./lib/light_push/index.js";
9
+ export { wakuLightPush, LightPushCodec } from "./lib/light_push/index.js";
10
10
  export * as waku_relay from "./lib/relay/index.js";
11
11
  export { wakuRelay } from "./lib/relay/index.js";
12
12
  export * as waku_store from "./lib/store/index.js";
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ export { WakuNode } from "./lib/waku.js";
6
6
  export * as waku_filter from "./lib/filter/index.js";
7
7
  export { wakuFilter } from "./lib/filter/index.js";
8
8
  export * as waku_light_push from "./lib/light_push/index.js";
9
- export { wakuLightPush, LightPushCodec, PushResponse, } from "./lib/light_push/index.js";
9
+ export { wakuLightPush, LightPushCodec } from "./lib/light_push/index.js";
10
10
  export * as waku_relay from "./lib/relay/index.js";
11
11
  export { wakuRelay } from "./lib/relay/index.js";
12
12
  export * as waku_store from "./lib/store/index.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,GACb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waku/core",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "TypeScript implementation of the Waku v2 protocol",
5
5
  "types": "./dist/index.d.ts",
6
6
  "module": "./dist/index.js",
@@ -90,6 +90,9 @@
90
90
  "@noble/hashes": "^1.1.3",
91
91
  "@waku/byte-utils": "*",
92
92
  "@waku/interfaces": "*",
93
+ "@waku/libp2p-utils": "*",
94
+ "@waku/peer-exchange": "*",
95
+ "@waku/proto": "*",
93
96
  "debug": "^4.3.4",
94
97
  "it-all": "^1.0.6",
95
98
  "it-length-prefixed": "^8.0.2",
package/src/index.ts CHANGED
@@ -14,11 +14,7 @@ export * as waku_filter from "./lib/filter/index.js";
14
14
  export { wakuFilter } from "./lib/filter/index.js";
15
15
 
16
16
  export * as waku_light_push from "./lib/light_push/index.js";
17
- export {
18
- wakuLightPush,
19
- LightPushCodec,
20
- PushResponse,
21
- } from "./lib/light_push/index.js";
17
+ export { wakuLightPush, LightPushCodec } from "./lib/light_push/index.js";
22
18
 
23
19
  export * as waku_relay from "./lib/relay/index.js";
24
20
  export { wakuRelay } from "./lib/relay/index.js";