@libp2p/interface-internal 2.3.19-8484de8a2 → 2.3.19-87bc8d4fb

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.
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, PendingDial, Connection, MultiaddrConnection, PeerId, IsDialableOptions, OpenConnectionProgressEvents, Stream, NewStreamOptions } from '@libp2p/interface';
1
+ import type { AbortOptions, PendingDial, Connection, MultiaddrConnection, PeerId, IsDialableOptions, OpenConnectionProgressEvents } from '@libp2p/interface';
2
2
  import type { PeerMap } from '@libp2p/peer-collections';
3
3
  import type { Multiaddr } from '@multiformats/multiaddr';
4
4
  import type { ProgressOptions } from 'progress-events';
@@ -73,21 +73,6 @@ export interface ConnectionManager {
73
73
  * @returns A promise that resolves to a `Connection` object.
74
74
  */
75
75
  openConnection(peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise<Connection>;
76
- /**
77
- * Open a protocol stream with a remote peer. If the peer is already connected
78
- * an existing connection will be used to open the stream, otherwise they will
79
- * be dialed first.
80
- *
81
- * This is preferable to opening a connection manually as it allows libp2p to
82
- * decide what the "best" connection is, and in future, migrate streams across
83
- * connections as better connections become available.
84
- *
85
- * @param peer - The target `PeerId`, `Multiaddr`, or an array of `Multiaddr`s.
86
- * @param protocol - The protocol string or strings
87
- * @param options - Optional parameters for connection handling.
88
- * @returns A promise that resolves to a `Connection` object.
89
- */
90
- openStream(peer: PeerId | Multiaddr | Multiaddr[], protocol: string | string[], options?: OpenConnectionOptions & NewStreamOptions): Promise<Stream>;
91
76
  /**
92
77
  * Close our connections to a peer
93
78
  *
@@ -103,9 +88,9 @@ export interface ConnectionManager {
103
88
  * otherwise it will return false.
104
89
  *
105
90
  * @param maConn - The multiaddr connection to evaluate.
106
- * @returns `true` if the connection can be accepted, `false` otherwise.
91
+ * @returns A promise that resolves to `true` if the connection can be accepted, `false` otherwise.
107
92
  */
108
- acceptIncomingConnection(maConn: MultiaddrConnection): boolean;
93
+ acceptIncomingConnection(maConn: MultiaddrConnection): Promise<boolean>;
109
94
  /**
110
95
  * Invoked after upgrading an inbound multiaddr connection has finished
111
96
  */
@@ -1 +1 @@
1
- {"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../src/connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACtL,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,eAAe,CAAC,4BAA4B,CAAC;IACxG;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,CAAA;IAE7C;;;;OAIG;IACH,iBAAiB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAE1C;;;;;OAKG;IACH,iBAAiB,IAAI,MAAM,CAAA;IAE3B;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO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;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,CAAA;IAE7C;;;;OAIG;IACH,iBAAiB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAE1C;;;;;OAKG;IACH,iBAAiB,IAAI,MAAM,CAAA;IAE3B;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAE/C;;;;;;OAMG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE5G;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErE;;;;;;;;OAQG;IACH,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvE;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAA;IAE3B;;;;OAIG;IACH,YAAY,IAAI,WAAW,EAAE,CAAA;IAE7B;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9F"}
@@ -1,5 +1,10 @@
1
- import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, AbortOptions } from '@libp2p/interface';
1
+ import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, IncomingStreamData } from '@libp2p/interface';
2
+ import type { AbortOptions } from '@multiformats/multiaddr';
2
3
  export type {
4
+ /**
5
+ * @deprecated This type should be imported from @libp2p/interface directly
6
+ */
7
+ IncomingStreamData,
3
8
  /**
4
9
  * @deprecated This type should be imported from @libp2p/interface directly
5
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEzH,YAAY;AACV;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,mBAAmB,EACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,YAAY,IAAI,MAAM,EAAE,CAAA;IAExB;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/F;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjE;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;IAEjD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvF;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B;;;;;;OAMG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAC5C"}
1
+ {"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC/H,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,YAAY;AACV;;GAEG;AACH,kBAAkB;AAElB;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,mBAAmB,EACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,YAAY,IAAI,MAAM,EAAE,CAAA;IAExB;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/F;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjE;;;;;OAKG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;IAEjD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvF;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B;;;;;;OAMG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAC5C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-internal",
3
- "version": "2.3.19-8484de8a2",
3
+ "version": "2.3.19-87bc8d4fb",
4
4
  "description": "Interfaces implemented by internal libp2p components",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme",
@@ -41,13 +41,13 @@
41
41
  "build": "aegir build"
42
42
  },
43
43
  "dependencies": {
44
- "@libp2p/interface": "2.11.0-8484de8a2",
45
- "@libp2p/peer-collections": "6.0.35-8484de8a2",
46
- "@multiformats/multiaddr": "^13.0.1",
44
+ "@libp2p/interface": "2.11.0-87bc8d4fb",
45
+ "@libp2p/peer-collections": "6.0.35-87bc8d4fb",
46
+ "@multiformats/multiaddr": "^12.4.4",
47
47
  "progress-events": "^1.0.1"
48
48
  },
49
49
  "devDependencies": {
50
- "aegir": "^47.0.21"
50
+ "aegir": "^47.0.14"
51
51
  },
52
52
  "sideEffects": false
53
53
  }
@@ -1,4 +1,4 @@
1
- import type { AbortOptions, PendingDial, Connection, MultiaddrConnection, PeerId, IsDialableOptions, OpenConnectionProgressEvents, Stream, NewStreamOptions } from '@libp2p/interface'
1
+ import type { AbortOptions, PendingDial, Connection, MultiaddrConnection, PeerId, IsDialableOptions, OpenConnectionProgressEvents } from '@libp2p/interface'
2
2
  import type { PeerMap } from '@libp2p/peer-collections'
3
3
  import type { Multiaddr } from '@multiformats/multiaddr'
4
4
  import type { ProgressOptions } from 'progress-events'
@@ -82,22 +82,6 @@ export interface ConnectionManager {
82
82
  */
83
83
  openConnection(peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise<Connection>
84
84
 
85
- /**
86
- * Open a protocol stream with a remote peer. If the peer is already connected
87
- * an existing connection will be used to open the stream, otherwise they will
88
- * be dialed first.
89
- *
90
- * This is preferable to opening a connection manually as it allows libp2p to
91
- * decide what the "best" connection is, and in future, migrate streams across
92
- * connections as better connections become available.
93
- *
94
- * @param peer - The target `PeerId`, `Multiaddr`, or an array of `Multiaddr`s.
95
- * @param protocol - The protocol string or strings
96
- * @param options - Optional parameters for connection handling.
97
- * @returns A promise that resolves to a `Connection` object.
98
- */
99
- openStream(peer: PeerId | Multiaddr | Multiaddr[], protocol: string | string[], options?: OpenConnectionOptions & NewStreamOptions): Promise<Stream>
100
-
101
85
  /**
102
86
  * Close our connections to a peer
103
87
  *
@@ -114,9 +98,9 @@ export interface ConnectionManager {
114
98
  * otherwise it will return false.
115
99
  *
116
100
  * @param maConn - The multiaddr connection to evaluate.
117
- * @returns `true` if the connection can be accepted, `false` otherwise.
101
+ * @returns A promise that resolves to `true` if the connection can be accepted, `false` otherwise.
118
102
  */
119
- acceptIncomingConnection(maConn: MultiaddrConnection): boolean
103
+ acceptIncomingConnection(maConn: MultiaddrConnection): Promise<boolean>
120
104
 
121
105
  /**
122
106
  * Invoked after upgrading an inbound multiaddr connection has finished
package/src/registrar.ts CHANGED
@@ -1,6 +1,12 @@
1
- import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, AbortOptions } from '@libp2p/interface'
1
+ import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, IncomingStreamData } from '@libp2p/interface'
2
+ import type { AbortOptions } from '@multiformats/multiaddr'
2
3
 
3
4
  export type {
5
+ /**
6
+ * @deprecated This type should be imported from @libp2p/interface directly
7
+ */
8
+ IncomingStreamData,
9
+
4
10
  /**
5
11
  * @deprecated This type should be imported from @libp2p/interface directly
6
12
  */