@libp2p/interface 2.4.1-7a1665cd8 → 2.4.1-96f14e429
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/dist/index.min.js +1 -1
- package/dist/src/{connection.d.ts → connection/index.d.ts} +3 -3
- package/dist/src/connection/index.d.ts.map +1 -0
- package/dist/src/{connection.js → connection/index.js} +1 -1
- package/dist/src/connection/index.js.map +1 -0
- package/dist/src/{connection-encrypter.d.ts → connection-encrypter/index.d.ts} +4 -4
- package/dist/src/connection-encrypter/index.d.ts.map +1 -0
- package/dist/src/connection-encrypter/index.js +2 -0
- package/dist/src/connection-encrypter/index.js.map +1 -0
- package/dist/src/{connection-gater.d.ts → connection-gater/index.d.ts} +3 -3
- package/dist/src/{connection-gater.d.ts.map → connection-gater/index.d.ts.map} +1 -1
- package/dist/src/connection-gater/index.js +2 -0
- package/dist/src/connection-gater/index.js.map +1 -0
- package/dist/src/{content-routing.d.ts → content-routing/index.d.ts} +3 -3
- package/dist/src/content-routing/index.d.ts.map +1 -0
- package/dist/src/{content-routing.js → content-routing/index.js} +1 -1
- package/dist/src/content-routing/index.js.map +1 -0
- package/dist/src/events.d.ts +1 -1
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +1 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/index.d.ts +30 -30
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +18 -17
- package/dist/src/index.js.map +1 -1
- package/dist/src/{keys.d.ts → keys/index.d.ts} +1 -1
- package/dist/src/keys/index.d.ts.map +1 -0
- package/dist/src/{keys.js → keys/index.js} +1 -1
- package/dist/src/keys/index.js.map +1 -0
- package/dist/src/{metrics.d.ts → metrics/index.d.ts} +2 -2
- package/dist/src/metrics/index.d.ts.map +1 -0
- package/dist/src/metrics/index.js +2 -0
- package/dist/src/metrics/index.js.map +1 -0
- package/dist/src/{peer-discovery.d.ts → peer-discovery/index.d.ts} +3 -3
- package/dist/src/peer-discovery/index.d.ts.map +1 -0
- package/dist/src/{peer-discovery.js → peer-discovery/index.js} +1 -1
- package/dist/src/peer-discovery/index.js.map +1 -0
- package/dist/src/{peer-id.d.ts → peer-id/index.d.ts} +2 -2
- package/dist/src/peer-id/index.d.ts.map +1 -0
- package/dist/src/{peer-id.js → peer-id/index.js} +1 -1
- package/dist/src/peer-id/index.js.map +1 -0
- package/dist/src/{peer-info.d.ts → peer-info/index.d.ts} +2 -2
- package/dist/src/peer-info/index.d.ts.map +1 -0
- package/dist/src/peer-info/index.js +2 -0
- package/dist/src/peer-info/index.js.map +1 -0
- package/dist/src/{peer-routing.d.ts → peer-routing/index.d.ts} +4 -4
- package/dist/src/peer-routing/index.d.ts.map +1 -0
- package/dist/src/{peer-routing.js → peer-routing/index.js} +1 -1
- package/dist/src/peer-routing/index.js.map +1 -0
- package/dist/src/{peer-store.d.ts → peer-store/index.d.ts} +3 -12
- package/dist/src/peer-store/index.d.ts.map +1 -0
- package/dist/src/peer-store/index.js +2 -0
- package/dist/src/peer-store/index.js.map +1 -0
- package/dist/src/peer-store/tags.d.ts +10 -0
- package/dist/src/peer-store/tags.d.ts.map +1 -0
- package/dist/src/{peer-store.js → peer-store/tags.js} +1 -1
- package/dist/src/peer-store/tags.js.map +1 -0
- package/dist/src/{pubsub.d.ts → pubsub/index.d.ts} +5 -5
- package/dist/src/pubsub/index.d.ts.map +1 -0
- package/dist/src/{pubsub.js → pubsub/index.js} +1 -1
- package/dist/src/pubsub/index.js.map +1 -0
- package/dist/src/{record.d.ts → record/index.d.ts} +2 -2
- package/dist/src/record/index.d.ts.map +1 -0
- package/dist/src/record/index.js +2 -0
- package/dist/src/record/index.js.map +1 -0
- package/dist/src/{stream-handler.d.ts → stream-handler/index.d.ts} +2 -22
- package/dist/src/stream-handler/index.d.ts.map +1 -0
- package/dist/src/stream-handler/index.js +2 -0
- package/dist/src/stream-handler/index.js.map +1 -0
- package/dist/src/{stream-muxer.d.ts → stream-muxer/index.d.ts} +3 -3
- package/dist/src/stream-muxer/index.d.ts.map +1 -0
- package/dist/src/stream-muxer/index.js +2 -0
- package/dist/src/stream-muxer/index.js.map +1 -0
- package/dist/src/{topology.d.ts → topology/index.d.ts} +3 -3
- package/dist/src/topology/index.d.ts.map +1 -0
- package/dist/src/topology/index.js +2 -0
- package/dist/src/topology/index.js.map +1 -0
- package/dist/src/{transport.d.ts → transport/index.d.ts} +5 -5
- package/dist/src/transport/index.d.ts.map +1 -0
- package/dist/src/{transport.js → transport/index.js} +1 -1
- package/dist/src/transport/index.js.map +1 -0
- package/package.json +2 -2
- package/src/{connection.ts → connection/index.ts} +2 -2
- package/src/{connection-encrypter.ts → connection-encrypter/index.ts} +3 -3
- package/src/{connection-gater.ts → connection-gater/index.ts} +2 -2
- package/src/{content-routing.ts → content-routing/index.ts} +2 -2
- package/src/events.ts +1 -1
- package/src/index.ts +30 -30
- package/src/{metrics.ts → metrics/index.ts} +1 -1
- package/src/{peer-discovery.ts → peer-discovery/index.ts} +2 -2
- package/src/{peer-id.ts → peer-id/index.ts} +1 -1
- package/src/{peer-info.ts → peer-info/index.ts} +1 -1
- package/src/{peer-routing.ts → peer-routing/index.ts} +3 -3
- package/src/{peer-store.ts → peer-store/index.ts} +2 -12
- package/src/peer-store/tags.ts +9 -0
- package/src/{pubsub.ts → pubsub/index.ts} +4 -4
- package/src/{record.ts → record/index.ts} +1 -1
- package/src/{stream-handler.ts → stream-handler/index.ts} +1 -24
- package/src/{stream-muxer.ts → stream-muxer/index.ts} +2 -2
- package/src/{topology.ts → topology/index.ts} +2 -2
- package/src/{transport.ts → transport/index.ts} +4 -4
- package/dist/src/connection-encrypter.d.ts.map +0 -1
- package/dist/src/connection-encrypter.js +0 -2
- package/dist/src/connection-encrypter.js.map +0 -1
- package/dist/src/connection-gater.js +0 -2
- package/dist/src/connection-gater.js.map +0 -1
- package/dist/src/connection.d.ts.map +0 -1
- package/dist/src/connection.js.map +0 -1
- package/dist/src/content-routing.d.ts.map +0 -1
- package/dist/src/content-routing.js.map +0 -1
- package/dist/src/keys.d.ts.map +0 -1
- package/dist/src/keys.js.map +0 -1
- package/dist/src/metrics.d.ts.map +0 -1
- package/dist/src/metrics.js +0 -2
- package/dist/src/metrics.js.map +0 -1
- package/dist/src/peer-discovery.d.ts.map +0 -1
- package/dist/src/peer-discovery.js.map +0 -1
- package/dist/src/peer-id.d.ts.map +0 -1
- package/dist/src/peer-id.js.map +0 -1
- package/dist/src/peer-info.d.ts.map +0 -1
- package/dist/src/peer-info.js +0 -2
- package/dist/src/peer-info.js.map +0 -1
- package/dist/src/peer-routing.d.ts.map +0 -1
- package/dist/src/peer-routing.js.map +0 -1
- package/dist/src/peer-store.d.ts.map +0 -1
- package/dist/src/peer-store.js.map +0 -1
- package/dist/src/pubsub.d.ts.map +0 -1
- package/dist/src/pubsub.js.map +0 -1
- package/dist/src/record.d.ts.map +0 -1
- package/dist/src/record.js +0 -2
- package/dist/src/record.js.map +0 -1
- package/dist/src/stream-handler.d.ts.map +0 -1
- package/dist/src/stream-handler.js +0 -2
- package/dist/src/stream-handler.js.map +0 -1
- package/dist/src/stream-muxer.d.ts.map +0 -1
- package/dist/src/stream-muxer.js +0 -2
- package/dist/src/stream-muxer.js.map +0 -1
- package/dist/src/topology.d.ts.map +0 -1
- package/dist/src/topology.js +0 -2
- package/dist/src/topology.js.map +0 -1
- package/dist/src/transport.d.ts.map +0 -1
- package/dist/src/transport.js.map +0 -1
- /package/src/{keys.ts → keys/index.ts} +0 -0
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import type { PublicKey } from '
|
|
2
|
-
import type { PeerId } from '
|
|
1
|
+
import type { PublicKey } from '../keys/index.js';
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js';
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
4
|
-
/**
|
|
5
|
-
* When a peer that is tagged with this prefix disconnects, we will attempt to
|
|
6
|
-
* redial it, up to a limit.
|
|
7
|
-
*
|
|
8
|
-
* To allow multiple components to add/remove their own keep-alive tags without
|
|
9
|
-
* accidentally overwriting those of other components, attach a unique suffix to
|
|
10
|
-
* the tag, e.g. `keep-alive-circuit-relay` or `keep-alive-kad-dht`, etc.
|
|
11
|
-
*/
|
|
12
|
-
export declare const KEEP_ALIVE = "keep-alive";
|
|
13
4
|
/**
|
|
14
5
|
* A multiaddr with an optional flag that indicates if its trustworthy
|
|
15
6
|
*/
|
|
@@ -256,4 +247,4 @@ export interface PeerStore {
|
|
|
256
247
|
*/
|
|
257
248
|
consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise<boolean>;
|
|
258
249
|
}
|
|
259
|
-
//# sourceMappingURL=
|
|
250
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;;OAGG;IACH,SAAS,EAAE,OAAO,EAAE,CAAA;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;IAEnB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEjC;;OAEG;IACH,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAEtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,CAAA;CAChC;AAED;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+
* When a peer that is tagged with this prefix disconnects, we will attempt to
|
|
3
|
+
* redial it, up to a limit.
|
|
4
|
+
*
|
|
5
|
+
* To allow multiple components to add/remove their own keep-alive tags without
|
|
6
|
+
* accidentally overwriting those of other components, attach a unique suffix to
|
|
7
|
+
* the tag, e.g. `keep-alive-circuit-relay` or `keep-alive-kad-dht`, etc.
|
|
8
|
+
*/
|
|
9
|
+
export declare const KEEP_ALIVE = "keep-alive";
|
|
10
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/peer-store/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../src/peer-store/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Stream } from '
|
|
2
|
-
import type { TypedEventTarget } from '
|
|
3
|
-
import type { PublicKey } from '
|
|
4
|
-
import type { PeerId } from '
|
|
1
|
+
import type { Stream } from '../connection/index.js';
|
|
2
|
+
import type { TypedEventTarget } from '../event-target.js';
|
|
3
|
+
import type { PublicKey } from '../keys/index.js';
|
|
4
|
+
import type { PeerId } from '../peer-id/index.js';
|
|
5
5
|
import type { Pushable } from 'it-pushable';
|
|
6
6
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
7
7
|
/**
|
|
@@ -242,4 +242,4 @@ export declare const pubSubSymbol: unique symbol;
|
|
|
242
242
|
* Returns true if the passed argument is a PubSub implementation
|
|
243
243
|
*/
|
|
244
244
|
export declare function isPubSub(obj?: any): obj is PubSub;
|
|
245
|
-
//# sourceMappingURL=
|
|
245
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@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{ PublicKey } from '
|
|
1
|
+
import type { PublicKey } from '../keys/index.js';
|
|
2
2
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
3
3
|
/**
|
|
4
4
|
* Record is the base implementation of a record that can be used as the payload of a libp2p envelope.
|
|
@@ -30,4 +30,4 @@ export interface Envelope {
|
|
|
30
30
|
validate(domain: string): Promise<boolean>;
|
|
31
31
|
equals(other: Envelope): boolean;
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,IAAI,UAAU,CAAA;IACrB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,UAAU,GAAG,cAAc,CAAA;IACxC,OAAO,EAAE,UAAU,CAAA;IACnB,SAAS,EAAE,UAAU,GAAG,cAAc,CAAA;IAEtC,OAAO,IAAI,UAAU,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAA;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import type { Connection, Stream } from '
|
|
1
|
+
import type { Connection, Stream } from '../connection/index.js';
|
|
2
2
|
export interface IncomingStreamData {
|
|
3
|
-
/**
|
|
4
|
-
* The newly opened stream
|
|
5
|
-
*/
|
|
6
3
|
stream: Stream;
|
|
7
|
-
/**
|
|
8
|
-
* The connection the stream was opened on
|
|
9
|
-
*/
|
|
10
4
|
connection: Connection;
|
|
11
5
|
}
|
|
12
6
|
export interface StreamHandler {
|
|
13
|
-
/**
|
|
14
|
-
* A callback function that accepts the incoming stream data
|
|
15
|
-
*/
|
|
16
7
|
(data: IncomingStreamData): void;
|
|
17
8
|
}
|
|
18
9
|
export interface StreamHandlerOptions {
|
|
@@ -33,20 +24,9 @@ export interface StreamHandlerOptions {
|
|
|
33
24
|
* transferred or how long it can be open for.
|
|
34
25
|
*/
|
|
35
26
|
runOnLimitedConnection?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* If `true`, and a handler is already registered for the specified
|
|
38
|
-
* protocol(s), the existing handler will be discarded.
|
|
39
|
-
*/
|
|
40
|
-
force?: true;
|
|
41
27
|
}
|
|
42
28
|
export interface StreamHandlerRecord {
|
|
43
|
-
/**
|
|
44
|
-
* The handler that was registered to handle streams opened on the protocol
|
|
45
|
-
*/
|
|
46
29
|
handler: StreamHandler;
|
|
47
|
-
/**
|
|
48
|
-
* The options that were used to register the stream handler
|
|
49
|
-
*/
|
|
50
30
|
options: StreamHandlerOptions;
|
|
51
31
|
}
|
|
52
|
-
//# sourceMappingURL=
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream-handler/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,oBAAoB,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stream-handler/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Direction, Stream } from '
|
|
2
|
-
import type { AbortOptions } from '
|
|
1
|
+
import type { Direction, Stream } from '../connection/index.js';
|
|
2
|
+
import type { AbortOptions } from '../index.js';
|
|
3
3
|
import type { Duplex } from 'it-stream-types';
|
|
4
4
|
import type { Uint8ArrayList } from 'uint8arraylist';
|
|
5
5
|
export interface StreamMuxerFactory {
|
|
@@ -52,4 +52,4 @@ export interface StreamMuxerInit {
|
|
|
52
52
|
*/
|
|
53
53
|
direction?: Direction;
|
|
54
54
|
}
|
|
55
|
-
//# sourceMappingURL=
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream-muxer/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,iBAAiB,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,CAAA;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;IAC1B;;;OAGG;IACH,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAElD;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC;;OAEG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/stream-muxer/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Connection } from '
|
|
2
|
-
import type { PeerId } from '
|
|
1
|
+
import type { Connection } from '../connection/index.js';
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* A topology filter
|
|
5
5
|
*
|
|
@@ -42,4 +42,4 @@ export interface Topology {
|
|
|
42
42
|
*/
|
|
43
43
|
onDisconnect?(peerId: PeerId): void;
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;IAC7B,GAAG,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;IAEvB;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;IAEnC;;;OAGG;IACH,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IAElD;;;OAGG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Connection, ConnectionLimits, MultiaddrConnection } from '
|
|
2
|
-
import type { TypedEventTarget } from '
|
|
3
|
-
import type { AbortOptions } from '
|
|
4
|
-
import type { StreamMuxerFactory } from '
|
|
1
|
+
import type { Connection, ConnectionLimits, MultiaddrConnection } from '../connection/index.js';
|
|
2
|
+
import type { TypedEventTarget } from '../event-target.js';
|
|
3
|
+
import type { AbortOptions } from '../index.js';
|
|
4
|
+
import type { StreamMuxerFactory } from '../stream-muxer/index.js';
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
6
6
|
import type { ProgressOptions, ProgressEvent } from 'progress-events';
|
|
7
7
|
export interface ListenerEvents {
|
|
@@ -119,4 +119,4 @@ export interface Upgrader {
|
|
|
119
119
|
*/
|
|
120
120
|
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<void>;
|
|
121
121
|
}
|
|
122
|
-
//# sourceMappingURL=
|
|
122
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAErE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAA;IAExB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IAE3B;;;OAGG;IACH,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,QAAS,SAAQ,gBAAgB,CAAC,cAAc,CAAC;IAChE;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C;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6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "2.4.1-
|
|
3
|
+
"version": "2.4.1-96f14e429",
|
|
4
4
|
"description": "The interface implemented by a libp2p node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"aegir": "^45.0.5"
|
|
60
60
|
},
|
|
61
61
|
"browser": {
|
|
62
|
-
"
|
|
62
|
+
"events": "./dist/src/events.browser.js"
|
|
63
63
|
},
|
|
64
64
|
"react-native": {
|
|
65
65
|
"./dist/src/events.js": "./dist/src/events.browser.js"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AbortOptions, Logger } from '
|
|
2
|
-
import type { PeerId } from '
|
|
1
|
+
import type { AbortOptions, Logger } from '../index.js'
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
import type { Duplex, Source } from 'it-stream-types'
|
|
5
5
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { MultiaddrConnection } from '
|
|
2
|
-
import type { AbortOptions } from '
|
|
3
|
-
import type { PeerId } from '
|
|
1
|
+
import type { MultiaddrConnection } from '../connection/index.js'
|
|
2
|
+
import type { AbortOptions } from '../index.js'
|
|
3
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
4
4
|
import type { Duplex } from 'it-stream-types'
|
|
5
5
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MultiaddrConnection } from '
|
|
2
|
-
import type { PeerId } from '
|
|
1
|
+
import type { MultiaddrConnection } from '../connection/index.js'
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
5
5
|
export interface ConnectionGater {
|
package/src/events.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import type { Connection, NewStreamOptions, Stream } from './connection.js'
|
|
18
|
-
import type { ContentRouting } from './content-routing.js'
|
|
17
|
+
import type { Connection, NewStreamOptions, Stream } from './connection/index.js'
|
|
18
|
+
import type { ContentRouting } from './content-routing/index.js'
|
|
19
19
|
import type { TypedEventTarget } from './event-target.js'
|
|
20
|
-
import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.js'
|
|
21
|
-
import type { Metrics } from './metrics.js'
|
|
22
|
-
import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id.js'
|
|
23
|
-
import type { PeerInfo } from './peer-info.js'
|
|
24
|
-
import type { PeerRouting } from './peer-routing.js'
|
|
25
|
-
import type { Address, Peer, PeerStore } from './peer-store.js'
|
|
20
|
+
import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys/index.js'
|
|
21
|
+
import type { Metrics } from './metrics/index.js'
|
|
22
|
+
import type { Ed25519PeerId, PeerId, RSAPeerId, Secp256k1PeerId, URLPeerId } from './peer-id/index.js'
|
|
23
|
+
import type { PeerInfo } from './peer-info/index.js'
|
|
24
|
+
import type { PeerRouting } from './peer-routing/index.js'
|
|
25
|
+
import type { Address, Peer, PeerStore } from './peer-store/index.js'
|
|
26
26
|
import type { Startable } from './startable.js'
|
|
27
|
-
import type { StreamHandler, StreamHandlerOptions } from './stream-handler.js'
|
|
28
|
-
import type { Topology } from './topology.js'
|
|
29
|
-
import type { Listener, OutboundConnectionUpgradeEvents } from './transport.js'
|
|
27
|
+
import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index.js'
|
|
28
|
+
import type { Topology } from './topology/index.js'
|
|
29
|
+
import type { Listener, OutboundConnectionUpgradeEvents } from './transport/index.js'
|
|
30
30
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
31
31
|
import type { ProgressOptions, ProgressEvent } from 'progress-events'
|
|
32
32
|
|
|
@@ -620,8 +620,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
620
620
|
*
|
|
621
621
|
* `libp2p.handle(protocols, handler, options)`
|
|
622
622
|
*
|
|
623
|
-
* In the event of a new handler for the same protocol being added
|
|
624
|
-
* will be thrown. Pass `force: true` to override this.
|
|
623
|
+
* In the event of a new handler for the same protocol being added, the first one is discarded.
|
|
625
624
|
*
|
|
626
625
|
* @example
|
|
627
626
|
*
|
|
@@ -808,23 +807,24 @@ export const serviceCapabilities = Symbol.for('@libp2p/service-capabilities')
|
|
|
808
807
|
*/
|
|
809
808
|
export const serviceDependencies = Symbol.for('@libp2p/service-dependencies')
|
|
810
809
|
|
|
811
|
-
export * from './connection.js'
|
|
812
|
-
export * from './connection-encrypter.js'
|
|
813
|
-
export * from './connection-gater.js'
|
|
814
|
-
export * from './content-routing.js'
|
|
815
|
-
export * from './keys.js'
|
|
816
|
-
export * from './metrics.js'
|
|
817
|
-
export * from './peer-discovery.js'
|
|
818
|
-
export * from './peer-id.js'
|
|
819
|
-
export * from './peer-info.js'
|
|
820
|
-
export * from './peer-routing.js'
|
|
821
|
-
export * from './peer-store.js'
|
|
822
|
-
export * from './
|
|
823
|
-
export * from './
|
|
824
|
-
export * from './
|
|
825
|
-
export * from './stream-
|
|
826
|
-
export * from './
|
|
827
|
-
export * from './
|
|
810
|
+
export * from './connection/index.js'
|
|
811
|
+
export * from './connection-encrypter/index.js'
|
|
812
|
+
export * from './connection-gater/index.js'
|
|
813
|
+
export * from './content-routing/index.js'
|
|
814
|
+
export * from './keys/index.js'
|
|
815
|
+
export * from './metrics/index.js'
|
|
816
|
+
export * from './peer-discovery/index.js'
|
|
817
|
+
export * from './peer-id/index.js'
|
|
818
|
+
export * from './peer-info/index.js'
|
|
819
|
+
export * from './peer-routing/index.js'
|
|
820
|
+
export * from './peer-store/index.js'
|
|
821
|
+
export * from './peer-store/tags.js'
|
|
822
|
+
export * from './pubsub/index.js'
|
|
823
|
+
export * from './record/index.js'
|
|
824
|
+
export * from './stream-handler/index.js'
|
|
825
|
+
export * from './stream-muxer/index.js'
|
|
826
|
+
export * from './topology/index.js'
|
|
827
|
+
export * from './transport/index.js'
|
|
828
828
|
export * from './errors.js'
|
|
829
829
|
export * from './event-target.js'
|
|
830
830
|
export * from './events.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TypedEventTarget } from '
|
|
2
|
-
import type { PeerInfo } from '
|
|
1
|
+
import type { TypedEventTarget } from '../event-target.js'
|
|
2
|
+
import type { PeerInfo } from '../peer-info/index.js'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Any object that implements this Symbol as a property should return a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from '
|
|
1
|
+
import type { Ed25519PublicKey, KeyType, RSAPublicKey, Secp256k1PublicKey } from '../keys/index.js'
|
|
2
2
|
import type { CID } from 'multiformats/cid'
|
|
3
3
|
import type { MultihashDigest } from 'multiformats/hashes/interface'
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RoutingOptions } from '
|
|
2
|
-
import type { PeerId } from '
|
|
3
|
-
import type { PeerInfo } from '
|
|
1
|
+
import type { RoutingOptions } from '../index.js'
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
3
|
+
import type { PeerInfo } from '../peer-info/index.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Any object that implements this Symbol as a property should return a
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import type { PublicKey } from '
|
|
2
|
-
import type { PeerId } from '
|
|
1
|
+
import type { PublicKey } from '../keys/index.js'
|
|
2
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* When a peer that is tagged with this prefix disconnects, we will attempt to
|
|
7
|
-
* redial it, up to a limit.
|
|
8
|
-
*
|
|
9
|
-
* To allow multiple components to add/remove their own keep-alive tags without
|
|
10
|
-
* accidentally overwriting those of other components, attach a unique suffix to
|
|
11
|
-
* the tag, e.g. `keep-alive-circuit-relay` or `keep-alive-kad-dht`, etc.
|
|
12
|
-
*/
|
|
13
|
-
export const KEEP_ALIVE = 'keep-alive'
|
|
14
|
-
|
|
15
5
|
/**
|
|
16
6
|
* A multiaddr with an optional flag that indicates if its trustworthy
|
|
17
7
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When a peer that is tagged with this prefix disconnects, we will attempt to
|
|
3
|
+
* redial it, up to a limit.
|
|
4
|
+
*
|
|
5
|
+
* To allow multiple components to add/remove their own keep-alive tags without
|
|
6
|
+
* accidentally overwriting those of other components, attach a unique suffix to
|
|
7
|
+
* the tag, e.g. `keep-alive-circuit-relay` or `keep-alive-kad-dht`, etc.
|
|
8
|
+
*/
|
|
9
|
+
export const KEEP_ALIVE = 'keep-alive'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Stream } from '
|
|
2
|
-
import type { TypedEventTarget } from '
|
|
3
|
-
import type { PublicKey } from '
|
|
4
|
-
import type { PeerId } from '
|
|
1
|
+
import type { Stream } from '../connection/index.js'
|
|
2
|
+
import type { TypedEventTarget } from '../event-target.js'
|
|
3
|
+
import type { PublicKey } from '../keys/index.js'
|
|
4
|
+
import type { PeerId } from '../peer-id/index.js'
|
|
5
5
|
import type { Pushable } from 'it-pushable'
|
|
6
6
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
7
7
|
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import type { Connection, Stream } from '
|
|
1
|
+
import type { Connection, Stream } from '../connection/index.js'
|
|
2
2
|
|
|
3
3
|
export interface IncomingStreamData {
|
|
4
|
-
/**
|
|
5
|
-
* The newly opened stream
|
|
6
|
-
*/
|
|
7
4
|
stream: Stream
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The connection the stream was opened on
|
|
11
|
-
*/
|
|
12
5
|
connection: Connection
|
|
13
6
|
}
|
|
14
7
|
|
|
15
8
|
export interface StreamHandler {
|
|
16
|
-
/**
|
|
17
|
-
* A callback function that accepts the incoming stream data
|
|
18
|
-
*/
|
|
19
9
|
(data: IncomingStreamData): void
|
|
20
10
|
}
|
|
21
11
|
|
|
@@ -39,22 +29,9 @@ export interface StreamHandlerOptions {
|
|
|
39
29
|
* transferred or how long it can be open for.
|
|
40
30
|
*/
|
|
41
31
|
runOnLimitedConnection?: boolean
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* If `true`, and a handler is already registered for the specified
|
|
45
|
-
* protocol(s), the existing handler will be discarded.
|
|
46
|
-
*/
|
|
47
|
-
force?: true
|
|
48
32
|
}
|
|
49
33
|
|
|
50
34
|
export interface StreamHandlerRecord {
|
|
51
|
-
/**
|
|
52
|
-
* The handler that was registered to handle streams opened on the protocol
|
|
53
|
-
*/
|
|
54
35
|
handler: StreamHandler
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* The options that were used to register the stream handler
|
|
58
|
-
*/
|
|
59
36
|
options: StreamHandlerOptions
|
|
60
37
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Direction, Stream } from '
|
|
2
|
-
import type { AbortOptions } from '
|
|
1
|
+
import type { Direction, Stream } from '../connection/index.js'
|
|
2
|
+
import type { AbortOptions } from '../index.js'
|
|
3
3
|
import type { Duplex } from 'it-stream-types'
|
|
4
4
|
import type { Uint8ArrayList } from 'uint8arraylist'
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Connection, ConnectionLimits, MultiaddrConnection } from '
|
|
2
|
-
import type { TypedEventTarget } from '
|
|
3
|
-
import type { AbortOptions } from '
|
|
4
|
-
import type { StreamMuxerFactory } from '
|
|
1
|
+
import type { Connection, ConnectionLimits, MultiaddrConnection } from '../connection/index.js'
|
|
2
|
+
import type { TypedEventTarget } from '../event-target.js'
|
|
3
|
+
import type { AbortOptions } from '../index.js'
|
|
4
|
+
import type { StreamMuxerFactory } from '../stream-muxer/index.js'
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
6
6
|
import type { ProgressOptions, ProgressEvent } from 'progress-events'
|
|
7
7
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection-encrypter.d.ts","sourceRoot":"","sources":["../../src/connection-encrypter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,SAAS,GAAG,OAAO;IACtD,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,cAAc,CAAE,MAAM,SAAS,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,GAAG,mBAAmB,EAAG,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAEhN;;;;OAIG;IACH,aAAa,CAAE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