@waku/core 0.0.36-f7c290d.0 → 0.0.36

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/bundle/index.js +1008 -594
  3. package/bundle/lib/message/version_0.js +1 -2
  4. package/bundle/{version_0-CyeTW0Vr.js → version_0-9DPFjcJG.js} +1570 -6
  5. package/dist/.tsbuildinfo +1 -1
  6. package/dist/lib/connection_manager/connection_manager.d.ts +2 -1
  7. package/dist/lib/connection_manager/connection_manager.js +16 -8
  8. package/dist/lib/connection_manager/connection_manager.js.map +1 -1
  9. package/dist/lib/filter/filter.d.ts +4 -3
  10. package/dist/lib/filter/filter.js +9 -7
  11. package/dist/lib/filter/filter.js.map +1 -1
  12. package/dist/lib/light_push/light_push.d.ts +4 -3
  13. package/dist/lib/light_push/light_push.js +6 -4
  14. package/dist/lib/light_push/light_push.js.map +1 -1
  15. package/dist/lib/message/version_0.d.ts +1 -1
  16. package/dist/lib/metadata/metadata.js +6 -4
  17. package/dist/lib/metadata/metadata.js.map +1 -1
  18. package/dist/lib/store/store.d.ts +4 -3
  19. package/dist/lib/store/store.js +6 -4
  20. package/dist/lib/store/store.js.map +1 -1
  21. package/dist/lib/stream_manager/stream_manager.d.ts +3 -4
  22. package/dist/lib/stream_manager/stream_manager.js +6 -8
  23. package/dist/lib/stream_manager/stream_manager.js.map +1 -1
  24. package/package.json +125 -1
  25. package/src/lib/connection_manager/connection_manager.ts +24 -16
  26. package/src/lib/filter/filter.ts +13 -8
  27. package/src/lib/light_push/light_push.ts +8 -5
  28. package/src/lib/metadata/metadata.ts +8 -5
  29. package/src/lib/store/store.ts +8 -5
  30. package/src/lib/stream_manager/stream_manager.ts +8 -6
  31. package/bundle/base_protocol-DvQrudwy.js +0 -152
  32. package/bundle/index-CTo1my9M.js +0 -1543
  33. package/bundle/lib/base_protocol.js +0 -2
  34. package/dist/lib/base_protocol.d.ts +0 -18
  35. package/dist/lib/base_protocol.js +0 -25
  36. package/dist/lib/base_protocol.js.map +0 -1
  37. package/src/lib/base_protocol.ts +0 -44
@@ -1,2 +0,0 @@
1
- export { B as BaseProtocol } from '../base_protocol-DvQrudwy.js';
2
- import '../index-CTo1my9M.js';
@@ -1,18 +0,0 @@
1
- import type { Libp2p } from "@libp2p/interface";
2
- import type { PeerId, Stream } from "@libp2p/interface";
3
- import type { IBaseProtocolCore, Libp2pComponents, PubsubTopic } from "@waku/interfaces";
4
- import { StreamManager } from "./stream_manager/index.js";
5
- /**
6
- * A class with predefined helpers, to be used as a base to implement Waku
7
- * Protocols.
8
- */
9
- export declare class BaseProtocol implements IBaseProtocolCore {
10
- multicodec: string;
11
- protected components: Libp2pComponents;
12
- readonly pubsubTopics: PubsubTopic[];
13
- readonly addLibp2pEventListener: Libp2p["addEventListener"];
14
- readonly removeLibp2pEventListener: Libp2p["removeEventListener"];
15
- protected streamManager: StreamManager;
16
- protected constructor(multicodec: string, components: Libp2pComponents, pubsubTopics: PubsubTopic[]);
17
- protected getStream(peerId: PeerId): Promise<Stream>;
18
- }
@@ -1,25 +0,0 @@
1
- import { StreamManager } from "./stream_manager/index.js";
2
- /**
3
- * A class with predefined helpers, to be used as a base to implement Waku
4
- * Protocols.
5
- */
6
- export class BaseProtocol {
7
- multicodec;
8
- components;
9
- pubsubTopics;
10
- addLibp2pEventListener;
11
- removeLibp2pEventListener;
12
- streamManager;
13
- constructor(multicodec, components, pubsubTopics) {
14
- this.multicodec = multicodec;
15
- this.components = components;
16
- this.pubsubTopics = pubsubTopics;
17
- this.addLibp2pEventListener = components.events.addEventListener.bind(components.events);
18
- this.removeLibp2pEventListener = components.events.removeEventListener.bind(components.events);
19
- this.streamManager = new StreamManager(multicodec, components.connectionManager.getConnections.bind(components.connectionManager), this.addLibp2pEventListener);
20
- }
21
- async getStream(peerId) {
22
- return this.streamManager.getStream(peerId);
23
- }
24
- }
25
- //# sourceMappingURL=base_protocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base_protocol.js","sourceRoot":"","sources":["../../src/lib/base_protocol.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,YAAY;IAMd;IACG;IACM;IAPF,sBAAsB,CAA6B;IACnD,yBAAyB,CAAgC;IAC/D,aAAa,CAAgB;IAEvC,YACS,UAAkB,EACf,UAA4B,EACtB,YAA2B;QAFpC,eAAU,GAAV,UAAU,CAAQ;QACf,eAAU,GAAV,UAAU,CAAkB;QACtB,iBAAY,GAAZ,YAAY,CAAe;QAE3C,IAAI,CAAC,sBAAsB,GAAG,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CACnE,UAAU,CAAC,MAAM,CAClB,CAAC;QACF,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CACzE,UAAU,CAAC,MAAM,CAClB,CAAC;QAEF,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CACpC,UAAU,EACV,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAC9C,UAAU,CAAC,iBAAiB,CAC7B,EACD,IAAI,CAAC,sBAAsB,CAC5B,CAAC;IACJ,CAAC;IAES,KAAK,CAAC,SAAS,CAAC,MAAc;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -1,44 +0,0 @@
1
- import type { Libp2p } from "@libp2p/interface";
2
- import type { PeerId, Stream } from "@libp2p/interface";
3
- import type {
4
- IBaseProtocolCore,
5
- Libp2pComponents,
6
- PubsubTopic
7
- } from "@waku/interfaces";
8
-
9
- import { StreamManager } from "./stream_manager/index.js";
10
-
11
- /**
12
- * A class with predefined helpers, to be used as a base to implement Waku
13
- * Protocols.
14
- */
15
- export class BaseProtocol implements IBaseProtocolCore {
16
- public readonly addLibp2pEventListener: Libp2p["addEventListener"];
17
- public readonly removeLibp2pEventListener: Libp2p["removeEventListener"];
18
- protected streamManager: StreamManager;
19
-
20
- protected constructor(
21
- public multicodec: string,
22
- protected components: Libp2pComponents,
23
- public readonly pubsubTopics: PubsubTopic[]
24
- ) {
25
- this.addLibp2pEventListener = components.events.addEventListener.bind(
26
- components.events
27
- );
28
- this.removeLibp2pEventListener = components.events.removeEventListener.bind(
29
- components.events
30
- );
31
-
32
- this.streamManager = new StreamManager(
33
- multicodec,
34
- components.connectionManager.getConnections.bind(
35
- components.connectionManager
36
- ),
37
- this.addLibp2pEventListener
38
- );
39
- }
40
-
41
- protected async getStream(peerId: PeerId): Promise<Stream> {
42
- return this.streamManager.getStream(peerId);
43
- }
44
- }