@waku/interfaces 0.0.16 → 0.0.17

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
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The file is maintained by [Release Please](https://github.com/googleapis/release-please) based on [Conventional Commits](https://www.conventionalcommits.org) specification,
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.17](https://github.com/waku-org/js-waku/compare/interfaces-v0.0.16...interfaces-v0.0.17) (2023-08-02)
9
+
10
+
11
+ ### Features
12
+
13
+ * ConnectionManager extends EventEmitter & exposed on the Waku interface (& minor improvements) ([#1447](https://github.com/waku-org/js-waku/issues/1447)) ([0b8936f](https://github.com/waku-org/js-waku/commit/0b8936f1f1ad33f6cb90eb88d027a19e787ae7a2))
14
+
8
15
  ## [0.0.16](https://github.com/waku-org/js-waku/compare/interfaces-v0.0.15...interfaces-v0.0.16) (2023-07-26)
9
16
 
10
17
 
@@ -1,5 +1,6 @@
1
1
  import type { PeerId } from "@libp2p/interface-peer-id";
2
2
  import type { Peer } from "@libp2p/interface-peer-store";
3
+ import type { EventEmitter } from "@libp2p/interfaces/events";
3
4
  export declare enum Tags {
4
5
  BOOTSTRAP = "bootstrap",
5
6
  PEER_EXCHANGE = "peer-exchange"
@@ -42,3 +43,7 @@ export interface PeersByDiscoveryResult {
42
43
  [Tags.PEER_EXCHANGE]: Peer[];
43
44
  };
44
45
  }
46
+ export interface IConnectionManager extends EventEmitter<IPeersByDiscoveryEvents> {
47
+ getPeersByDiscovery(): Promise<PeersByDiscoveryResult>;
48
+ stop(): void;
49
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"connection_manager.js","sourceRoot":"","sources":["../src/connection_manager.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,+BAAuB,CAAA;IACvB,uCAA+B,CAAA;AACjC,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf;AAmBD,MAAM,CAAN,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,gFAAqD,CAAA;IACrD,wFAA6D,CAAA;IAC7D,8EAAmD,CAAA;IACnD,sFAA2D,CAAA;AAC7D,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC"}
1
+ {"version":3,"file":"connection_manager.js","sourceRoot":"","sources":["../src/connection_manager.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,+BAAuB,CAAA;IACvB,uCAA+B,CAAA;AACjC,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf;AAmBD,MAAM,CAAN,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,gFAAqD,CAAA;IACrD,wFAA6D,CAAA;IAC7D,8EAAmD,CAAA;IACnD,sFAA2D,CAAA;AAC7D,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC"}
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from "./sender.js";
12
12
  export * from "./receiver.js";
13
13
  export * from "./misc.js";
14
14
  export * from "./libp2p.js";
15
+ export * from "./keep_alive_manager.js";
package/dist/index.js CHANGED
@@ -12,4 +12,5 @@ export * from "./sender.js";
12
12
  export * from "./receiver.js";
13
13
  export * from "./misc.js";
14
14
  export * from "./libp2p.js";
15
+ export * from "./keep_alive_manager.js";
15
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface KeepAliveOptions {
2
+ pingKeepAlive: number;
3
+ relayKeepAlive: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=keep_alive_manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keep_alive_manager.js","sourceRoot":"","sources":["../src/keep_alive_manager.ts"],"names":[],"mappings":""}
package/dist/waku.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Stream } from "@libp2p/interface-connection";
2
2
  import type { PeerId } from "@libp2p/interface-peer-id";
3
3
  import type { Multiaddr } from "@multiformats/multiaddr";
4
+ import { IConnectionManager } from "./connection_manager.js";
4
5
  import type { IFilter } from "./filter.js";
5
6
  import type { Libp2p } from "./libp2p.js";
6
7
  import type { ILightPush } from "./light_push.js";
@@ -13,6 +14,7 @@ export interface Waku {
13
14
  store?: IStore;
14
15
  filter?: IFilter;
15
16
  lightPush?: ILightPush;
17
+ connectionManager: IConnectionManager;
16
18
  dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise<Stream>;
17
19
  start(): Promise<void>;
18
20
  stop(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waku/interfaces",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Definition of Waku interfaces",
5
5
  "types": "./dist/index.d.ts",
6
6
  "module": "./dist/index.js",
@@ -1,5 +1,6 @@
1
1
  import type { PeerId } from "@libp2p/interface-peer-id";
2
2
  import type { Peer } from "@libp2p/interface-peer-store";
3
+ import type { EventEmitter } from "@libp2p/interfaces/events";
3
4
 
4
5
  export enum Tags {
5
6
  BOOTSTRAP = "bootstrap",
@@ -47,3 +48,9 @@ export interface PeersByDiscoveryResult {
47
48
  [Tags.PEER_EXCHANGE]: Peer[];
48
49
  };
49
50
  }
51
+
52
+ export interface IConnectionManager
53
+ extends EventEmitter<IPeersByDiscoveryEvents> {
54
+ getPeersByDiscovery(): Promise<PeersByDiscoveryResult>;
55
+ stop(): void;
56
+ }
package/src/index.ts CHANGED
@@ -12,3 +12,4 @@ export * from "./sender.js";
12
12
  export * from "./receiver.js";
13
13
  export * from "./misc.js";
14
14
  export * from "./libp2p.js";
15
+ export * from "./keep_alive_manager.js";
@@ -0,0 +1,4 @@
1
+ export interface KeepAliveOptions {
2
+ pingKeepAlive: number;
3
+ relayKeepAlive: number;
4
+ }
package/src/waku.ts CHANGED
@@ -2,6 +2,7 @@ import type { Stream } from "@libp2p/interface-connection";
2
2
  import type { PeerId } from "@libp2p/interface-peer-id";
3
3
  import type { Multiaddr } from "@multiformats/multiaddr";
4
4
 
5
+ import { IConnectionManager } from "./connection_manager.js";
5
6
  import type { IFilter } from "./filter.js";
6
7
  import type { Libp2p } from "./libp2p.js";
7
8
  import type { ILightPush } from "./light_push.js";
@@ -16,6 +17,8 @@ export interface Waku {
16
17
  filter?: IFilter;
17
18
  lightPush?: ILightPush;
18
19
 
20
+ connectionManager: IConnectionManager;
21
+
19
22
  dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise<Stream>;
20
23
 
21
24
  start(): Promise<void>;