@libp2p/webrtc 5.2.12 → 5.2.13-aa25d38ab

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 (58) hide show
  1. package/dist/index.min.js +14 -29
  2. package/dist/index.min.js.map +7 -0
  3. package/dist/src/index.d.ts +1 -1
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js.map +1 -1
  6. package/dist/src/muxer.d.ts +0 -1
  7. package/dist/src/muxer.d.ts.map +1 -1
  8. package/dist/src/muxer.js.map +1 -1
  9. package/dist/src/private-to-private/initiate-connection.d.ts +1 -1
  10. package/dist/src/private-to-private/initiate-connection.d.ts.map +1 -1
  11. package/dist/src/private-to-private/initiate-connection.js.map +1 -1
  12. package/dist/src/private-to-private/pb/message.d.ts +1 -1
  13. package/dist/src/private-to-private/pb/message.d.ts.map +1 -1
  14. package/dist/src/private-to-private/pb/message.js +0 -5
  15. package/dist/src/private-to-private/pb/message.js.map +1 -1
  16. package/dist/src/private-to-private/signaling-stream-handler.d.ts +2 -2
  17. package/dist/src/private-to-private/signaling-stream-handler.d.ts.map +1 -1
  18. package/dist/src/private-to-private/signaling-stream-handler.js.map +1 -1
  19. package/dist/src/private-to-private/transport.d.ts +1 -1
  20. package/dist/src/private-to-private/transport.d.ts.map +1 -1
  21. package/dist/src/private-to-private/transport.js.map +1 -1
  22. package/dist/src/private-to-private/util.d.ts.map +1 -1
  23. package/dist/src/private-to-public/listener.d.ts.map +1 -1
  24. package/dist/src/private-to-public/listener.js +2 -1
  25. package/dist/src/private-to-public/listener.js.map +1 -1
  26. package/dist/src/private-to-public/pb/message.d.ts +1 -1
  27. package/dist/src/private-to-public/pb/message.d.ts.map +1 -1
  28. package/dist/src/private-to-public/pb/message.js +0 -5
  29. package/dist/src/private-to-public/pb/message.js.map +1 -1
  30. package/dist/src/private-to-public/utils/generate-certificates.d.ts +1 -1
  31. package/dist/src/private-to-public/utils/generate-certificates.d.ts.map +1 -1
  32. package/dist/src/private-to-public/utils/pem.d.ts +0 -2
  33. package/dist/src/private-to-public/utils/pem.d.ts.map +1 -1
  34. package/dist/src/private-to-public/utils/stun-listener.d.ts +0 -1
  35. package/dist/src/private-to-public/utils/stun-listener.d.ts.map +1 -1
  36. package/dist/src/stream.d.ts +2 -2
  37. package/dist/src/stream.d.ts.map +1 -1
  38. package/dist/src/stream.js.map +1 -1
  39. package/dist/src/util.d.ts +0 -1
  40. package/dist/src/util.d.ts.map +1 -1
  41. package/dist/src/util.js.map +1 -1
  42. package/dist/src/webrtc/index.browser.d.ts +2 -2
  43. package/dist/src/webrtc/index.d.ts +0 -1
  44. package/dist/src/webrtc/index.d.ts.map +1 -1
  45. package/package.json +24 -31
  46. package/src/index.ts +2 -1
  47. package/src/muxer.ts +0 -1
  48. package/src/private-to-private/initiate-connection.ts +2 -1
  49. package/src/private-to-private/pb/message.ts +2 -7
  50. package/src/private-to-private/signaling-stream-handler.ts +4 -2
  51. package/src/private-to-private/transport.ts +2 -1
  52. package/src/private-to-public/listener.ts +2 -1
  53. package/src/private-to-public/pb/message.ts +2 -7
  54. package/src/private-to-public/utils/generate-certificates.ts +1 -1
  55. package/src/stream.ts +4 -3
  56. package/src/util.ts +0 -1
  57. package/src/webrtc/index.ts +0 -1
  58. package/dist/typedoc-urls.json +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/webrtc",
3
- "version": "5.2.12",
3
+ "version": "5.2.13-aa25d38ab",
4
4
  "description": "A libp2p transport using WebRTC connections",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/transport-webrtc#readme",
@@ -29,15 +29,8 @@
29
29
  "import": "./dist/src/index.js"
30
30
  }
31
31
  },
32
- "eslintConfig": {
33
- "extends": "ipfs",
34
- "parserOptions": {
35
- "project": true,
36
- "sourceType": "module"
37
- }
38
- },
39
32
  "scripts": {
40
- "generate": "protons src/private-to-private/pb/message.proto src/pb/message.proto",
33
+ "generate": "protons src/private-to-private/pb/message.proto",
41
34
  "build": "aegir build",
42
35
  "test": "aegir test -t node -t browser",
43
36
  "test:node": "aegir test -t node --cov",
@@ -51,52 +44,52 @@
51
44
  "doc-check": "aegir doc-check"
52
45
  },
53
46
  "dependencies": {
54
- "@chainsafe/is-ip": "^2.0.2",
55
- "@chainsafe/libp2p-noise": "^16.0.0",
56
- "@ipshipyard/node-datachannel": "^0.26.4",
57
- "@libp2p/crypto": "^5.1.1",
58
- "@libp2p/interface": "^2.9.0",
59
- "@libp2p/interface-internal": "^2.3.11",
60
- "@libp2p/keychain": "^5.2.1",
61
- "@libp2p/peer-id": "^5.1.2",
62
- "@libp2p/utils": "^6.6.2",
47
+ "@chainsafe/is-ip": "^2.1.0",
48
+ "@chainsafe/libp2p-noise": "^16.1.3",
49
+ "@ipshipyard/node-datachannel": "^0.26.6",
50
+ "@libp2p/crypto": "5.1.2-aa25d38ab",
51
+ "@libp2p/interface": "2.10.0-aa25d38ab",
52
+ "@libp2p/interface-internal": "2.3.12-aa25d38ab",
53
+ "@libp2p/keychain": "5.2.2-aa25d38ab",
54
+ "@libp2p/peer-id": "5.1.3-aa25d38ab",
55
+ "@libp2p/utils": "6.6.3-aa25d38ab",
63
56
  "@multiformats/multiaddr": "^12.4.0",
64
- "@multiformats/multiaddr-matcher": "^1.6.0",
57
+ "@multiformats/multiaddr-matcher": "^1.7.2",
65
58
  "@peculiar/webcrypto": "^1.5.0",
66
- "@peculiar/x509": "^1.11.0",
59
+ "@peculiar/x509": "^1.12.3",
67
60
  "any-signal": "^4.1.1",
68
61
  "detect-browser": "^5.3.0",
69
62
  "get-port": "^7.1.0",
70
63
  "interface-datastore": "^8.3.1",
71
64
  "it-length-prefixed": "^10.0.1",
72
- "it-protobuf-stream": "^2.0.1",
65
+ "it-protobuf-stream": "^2.0.2",
73
66
  "it-pushable": "^3.2.3",
74
67
  "it-stream-types": "^2.0.2",
75
- "multiformats": "^13.3.1",
68
+ "multiformats": "^13.3.4",
76
69
  "p-defer": "^4.0.1",
77
- "p-timeout": "^6.1.3",
70
+ "p-timeout": "^6.1.4",
78
71
  "p-wait-for": "^5.0.2",
79
72
  "progress-events": "^1.0.1",
80
73
  "protons-runtime": "^5.5.0",
81
74
  "race-event": "^1.3.0",
82
- "race-signal": "^1.1.2",
83
- "react-native-webrtc": "^124.0.4",
75
+ "race-signal": "^1.1.3",
76
+ "react-native-webrtc": "^124.0.5",
84
77
  "uint8-varint": "^2.0.4",
85
78
  "uint8arraylist": "^2.4.8",
86
79
  "uint8arrays": "^5.1.0"
87
80
  },
88
81
  "devDependencies": {
89
- "@libp2p/interface-compliance-tests": "^6.4.5",
90
- "@libp2p/logger": "^5.1.15",
91
- "@types/sinon": "^17.0.3",
92
- "aegir": "^45.1.1",
82
+ "@libp2p/interface-compliance-tests": "6.4.6-aa25d38ab",
83
+ "@libp2p/logger": "5.1.16-aa25d38ab",
84
+ "@types/sinon": "^17.0.4",
85
+ "aegir": "^47.0.6",
93
86
  "datastore-core": "^10.0.2",
94
87
  "delay": "^6.0.0",
95
- "it-length": "^3.0.6",
88
+ "it-length": "^3.0.8",
96
89
  "it-pair": "^2.0.6",
97
90
  "p-retry": "^6.2.1",
98
91
  "protons": "^7.6.0",
99
- "sinon": "^19.0.2",
92
+ "sinon": "^20.0.0",
100
93
  "sinon-ts": "^2.0.0",
101
94
  "wherearewe": "^2.0.1"
102
95
  },
package/src/index.ts CHANGED
@@ -263,8 +263,9 @@
263
263
  */
264
264
 
265
265
  import { WebRTCTransport } from './private-to-private/transport.js'
266
- import { WebRTCDirectTransport, type WebRTCTransportDirectInit, type WebRTCDirectTransportComponents } from './private-to-public/transport.js'
266
+ import { WebRTCDirectTransport } from './private-to-public/transport.js'
267
267
  import type { WebRTCTransportComponents, WebRTCTransportInit } from './private-to-private/transport.js'
268
+ import type { WebRTCTransportDirectInit, WebRTCDirectTransportComponents } from './private-to-public/transport.js'
268
269
  import type { Transport } from '@libp2p/interface'
269
270
 
270
271
  export interface DataChannelOptions {
package/src/muxer.ts CHANGED
@@ -2,7 +2,6 @@ import { MUXER_PROTOCOL } from './constants.js'
2
2
  import { createStream } from './stream.js'
3
3
  import { drainAndClose, nopSink, nopSource } from './util.js'
4
4
  import type { DataChannelOptions } from './index.js'
5
- import type { RTCPeerConnection, RTCDataChannel } from './webrtc/index.js'
6
5
  import type { ComponentLogger, Logger, Stream, CounterGroup, StreamMuxer, StreamMuxerFactory, StreamMuxerInit } from '@libp2p/interface'
7
6
  import type { AbortOptions } from '@multiformats/multiaddr'
8
7
  import type { Source, Sink } from 'it-stream-types'
@@ -7,8 +7,9 @@ import { SDPHandshakeFailedError } from '../error.js'
7
7
  import { DataChannelMuxerFactory } from '../muxer.js'
8
8
  import { RTCPeerConnection, RTCSessionDescription } from '../webrtc/index.js'
9
9
  import { Message } from './pb/message.js'
10
- import { splitAddr, type WebRTCDialEvents, type WebRTCTransportMetrics } from './transport.js'
10
+ import { splitAddr } from './transport.js'
11
11
  import { readCandidatesUntilConnected } from './util.js'
12
+ import type { WebRTCDialEvents, WebRTCTransportMetrics } from './transport.js'
12
13
  import type { DataChannelOptions } from '../index.js'
13
14
  import type { LoggerOptions, Connection, ComponentLogger, IncomingStreamData } from '@libp2p/interface'
14
15
  import type { ConnectionManager, TransportManager } from '@libp2p/interface-internal'
@@ -1,10 +1,5 @@
1
- /* eslint-disable import/export */
2
- /* eslint-disable complexity */
3
- /* eslint-disable @typescript-eslint/no-namespace */
4
- /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
5
- /* eslint-disable @typescript-eslint/no-empty-interface */
6
-
7
- import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, enumeration, message } from 'protons-runtime'
1
+ import { decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
2
+ import type { Codec, DecodeOptions } from 'protons-runtime'
8
3
  import type { Uint8ArrayList } from 'uint8arraylist'
9
4
 
10
5
  export interface Message {
@@ -1,10 +1,12 @@
1
- import { multiaddr, type Multiaddr } from '@multiformats/multiaddr'
1
+ import { multiaddr } from '@multiformats/multiaddr'
2
2
  import { pbStream } from 'it-protobuf-stream'
3
3
  import { SDPHandshakeFailedError } from '../error.js'
4
- import { type RTCPeerConnection, RTCSessionDescription } from '../webrtc/index.js'
4
+ import { RTCSessionDescription } from '../webrtc/index.js'
5
5
  import { Message } from './pb/message.js'
6
6
  import { getConnectionState, readCandidatesUntilConnected } from './util.js'
7
+ import type { RTCPeerConnection } from '../webrtc/index.js'
7
8
  import type { Logger, IncomingStreamData } from '@libp2p/interface'
9
+ import type { Multiaddr } from '@multiformats/multiaddr'
8
10
 
9
11
  export interface IncomingStreamOpts extends IncomingStreamData {
10
12
  peerConnection: RTCPeerConnection
@@ -1,6 +1,6 @@
1
1
  import { InvalidParametersError, serviceCapabilities, serviceDependencies, setMaxListeners, transportSymbol } from '@libp2p/interface'
2
2
  import { peerIdFromString } from '@libp2p/peer-id'
3
- import { multiaddr, type Multiaddr } from '@multiformats/multiaddr'
3
+ import { multiaddr } from '@multiformats/multiaddr'
4
4
  import { WebRTC } from '@multiformats/multiaddr-matcher'
5
5
  import { SIGNALING_PROTOCOL } from '../constants.js'
6
6
  import { WebRTCMultiaddrConnection } from '../maconn.js'
@@ -13,6 +13,7 @@ import { handleIncomingStream } from './signaling-stream-handler.js'
13
13
  import type { DataChannelOptions } from '../index.js'
14
14
  import type { OutboundConnectionUpgradeEvents, CreateListenerOptions, DialTransportOptions, Transport, Listener, Upgrader, ComponentLogger, Logger, Connection, PeerId, CounterGroup, Metrics, Startable, OpenConnectionProgressEvents, IncomingStreamData, Libp2pEvents, TypedEventTarget } from '@libp2p/interface'
15
15
  import type { Registrar, ConnectionManager, TransportManager } from '@libp2p/interface-internal'
16
+ import type { Multiaddr } from '@multiformats/multiaddr'
16
17
  import type { ProgressEvent } from 'progress-events'
17
18
 
18
19
  export interface WebRTCTransportInit {
@@ -1,5 +1,5 @@
1
1
  import { isIPv4 } from '@chainsafe/is-ip'
2
- import { InvalidParametersError, TypedEventEmitter } from '@libp2p/interface'
2
+ import { InvalidParametersError, TypedEventEmitter, setMaxListeners } from '@libp2p/interface'
3
3
  import { getThinWaistAddresses } from '@libp2p/utils/get-thin-waist-addresses'
4
4
  import { multiaddr, fromStringTuples } from '@multiformats/multiaddr'
5
5
  import { WebRTCDirect } from '@multiformats/multiaddr-matcher'
@@ -71,6 +71,7 @@ export class WebRTCDirectListener extends TypedEventEmitter<ListenerEvents> impl
71
71
  this.connections = new Map()
72
72
  this.log = components.logger.forComponent('libp2p:webrtc-direct:listener')
73
73
  this.shutdownController = new AbortController()
74
+ setMaxListeners(Infinity, this.shutdownController.signal)
74
75
  this.certificate = init.certificate
75
76
 
76
77
  if (components.metrics != null) {
@@ -1,10 +1,5 @@
1
- /* eslint-disable import/export */
2
- /* eslint-disable complexity */
3
- /* eslint-disable @typescript-eslint/no-namespace */
4
- /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
5
- /* eslint-disable @typescript-eslint/no-empty-interface */
6
-
7
- import { type Codec, decodeMessage, type DecodeOptions, encodeMessage, enumeration, message } from 'protons-runtime'
1
+ import { decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
2
+ import type { Codec, DecodeOptions } from 'protons-runtime'
8
3
  import type { Uint8ArrayList } from 'uint8arraylist'
9
4
 
10
5
  export interface Message {
@@ -3,7 +3,7 @@ import * as x509 from '@peculiar/x509'
3
3
  import { base64url } from 'multiformats/bases/base64'
4
4
  import { sha256 } from 'multiformats/hashes/sha2'
5
5
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
6
- import type { TransportCertificate } from '../..'
6
+ import type { TransportCertificate } from '../../index.js'
7
7
 
8
8
  const crypto = new Crypto()
9
9
  x509.cryptoProvider.set(crypto)
package/src/stream.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { StreamStateError, TimeoutError } from '@libp2p/interface'
2
- import { AbstractStream, type AbstractStreamInit } from '@libp2p/utils/abstract-stream'
2
+ import { AbstractStream } from '@libp2p/utils/abstract-stream'
3
3
  import { anySignal } from 'any-signal'
4
4
  import * as lengthPrefixed from 'it-length-prefixed'
5
- import { type Pushable, pushable } from 'it-pushable'
5
+ import { pushable } from 'it-pushable'
6
6
  import pDefer from 'p-defer'
7
7
  import pTimeout from 'p-timeout'
8
8
  import { raceEvent } from 'race-event'
@@ -11,8 +11,9 @@ import { Uint8ArrayList } from 'uint8arraylist'
11
11
  import { BUFFERED_AMOUNT_LOW_TIMEOUT, FIN_ACK_TIMEOUT, MAX_BUFFERED_AMOUNT, MAX_MESSAGE_SIZE, OPEN_TIMEOUT, PROTOBUF_OVERHEAD } from './constants.js'
12
12
  import { Message } from './private-to-public/pb/message.js'
13
13
  import type { DataChannelOptions } from './index.js'
14
- import type { RTCDataChannel } from './webrtc/index.js'
15
14
  import type { AbortOptions, ComponentLogger, Direction } from '@libp2p/interface'
15
+ import type { AbstractStreamInit } from '@libp2p/utils/abstract-stream'
16
+ import type { Pushable } from 'it-pushable'
16
17
  import type { DeferredPromise } from 'p-defer'
17
18
 
18
19
  export interface WebRTCStreamInit extends AbstractStreamInit, DataChannelOptions {
package/src/util.ts CHANGED
@@ -2,7 +2,6 @@ import { detect } from 'detect-browser'
2
2
  import pDefer from 'p-defer'
3
3
  import pTimeout from 'p-timeout'
4
4
  import { DATA_CHANNEL_DRAIN_TIMEOUT, DEFAULT_ICE_SERVERS, UFRAG_ALPHABET, UFRAG_PREFIX } from './constants.js'
5
- import type { RTCDataChannel } from './webrtc/index.js'
6
5
  import type { PeerConnection } from '@ipshipyard/node-datachannel'
7
6
  import type { LoggerOptions } from '@libp2p/interface'
8
7
 
@@ -1,2 +1 @@
1
1
  export { RTCSessionDescription, RTCIceCandidate, RTCPeerConnection } from '@ipshipyard/node-datachannel/polyfill'
2
- export type { RTCDataChannel, RTCDataChannelEvent } from '@ipshipyard/node-datachannel/polyfill'
@@ -1,14 +0,0 @@
1
- {
2
- "DataChannelOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.DataChannelOptions.html",
3
- ".:DataChannelOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.DataChannelOptions.html",
4
- "TransportCertificate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.TransportCertificate.html",
5
- ".:TransportCertificate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.TransportCertificate.html",
6
- "WebRTCDirectTransportComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCDirectTransportComponents.html",
7
- "WebRTCTransportComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportComponents.html",
8
- "WebRTCTransportDirectInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportDirectInit.html",
9
- "WebRTCTransportInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_webrtc.WebRTCTransportInit.html",
10
- "webRTC": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTC.html",
11
- ".:webRTC": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTC.html",
12
- "webRTCDirect": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTCDirect.html",
13
- ".:webRTCDirect": "https://libp2p.github.io/js-libp2p/functions/_libp2p_webrtc.webRTCDirect.html"
14
- }