libp2p 3.3.4 → 3.3.5-4bb8fbe8d

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 +1 @@
1
- {"version":3,"file":"dnsaddr.d.ts","sourceRoot":"","sources":["../../../../src/connection-manager/resolvers/dnsaddr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,cAAM,eAAgB,YAAW,iBAAiB;IAChD,OAAO,CAAC,GAAG,CAAC,CAAK;IAEjB,UAAU,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IAI7B,OAAO,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA0CrF,OAAO,CAAC,MAAM;CAWf;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
1
+ {"version":3,"file":"dnsaddr.d.ts","sourceRoot":"","sources":["../../../../src/connection-manager/resolvers/dnsaddr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,cAAM,eAAgB,YAAW,iBAAiB;IAChD,OAAO,CAAC,GAAG,CAAC,CAAK;IAEjB,UAAU,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IAI7B,OAAO,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IA0DrF,OAAO,CAAC,MAAM;CAWf;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
@@ -13,12 +13,25 @@ class DNSAddrResolver {
13
13
  return [ma];
14
14
  }
15
15
  const resolver = this.getDNS(options);
16
- const result = await resolver.query(`_dnsaddr.${hostname}`, {
17
- signal: options?.signal,
18
- types: [
19
- RecordType.TXT
20
- ]
21
- });
16
+ let result;
17
+ try {
18
+ result = await resolver.query(`_dnsaddr.${hostname}`, {
19
+ signal: options?.signal,
20
+ types: [
21
+ RecordType.TXT
22
+ ]
23
+ });
24
+ }
25
+ catch (err) {
26
+ const noAnswers = err.name === 'DNSQueryFailedError' &&
27
+ Array.isArray(err.errors) &&
28
+ err.errors.length > 0 &&
29
+ err.errors.every((e) => e.name === 'EmptyDNSAnswerError');
30
+ if (noAnswers) {
31
+ return [];
32
+ }
33
+ throw err;
34
+ }
22
35
  const peerId = ma.getComponents()
23
36
  .find(component => component.name === 'p2p')
24
37
  ?.value;
@@ -1 +1 @@
1
- {"version":3,"file":"dnsaddr.js","sourceRoot":"","sources":["../../../../src/connection-manager/resolvers/dnsaddr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAKnD,MAAM,eAAe;IACX,GAAG,CAAM;IAEjB,UAAU,CAAE,EAAa;QACvB,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;IAClE,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,EAAa,EAAE,OAAgC;QAC5D,MAAM,QAAQ,GAAG,EAAE,CAAC,aAAa,EAAE;aAChC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC;YAChD,EAAE,KAAK,CAAA;QAET,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,OAAO,CAAC,EAAE,CAAC,CAAA;QACb,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAA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Ae,EAAE,CAAA"}
@@ -1,3 +1,3 @@
1
- export declare const version = "3.3.4";
1
+ export declare const version = "3.3.5-4bb8fbe8d";
2
2
  export declare const name = "js-libp2p";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA;AAC9B,eAAO,MAAM,IAAI,cAAc,CAAA"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAoB,CAAA;AACxC,eAAO,MAAM,IAAI,cAAc,CAAA"}
@@ -1,3 +1,3 @@
1
- export const version = '3.3.4';
1
+ export const version = '3.3.5-4bb8fbe8d';
2
2
  export const name = 'js-libp2p';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAC9B,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAA"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAA;AACxC,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libp2p",
3
- "version": "3.3.4",
3
+ "version": "3.3.5-4bb8fbe8d",
4
4
  "description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/libp2p#readme",
@@ -83,15 +83,15 @@
83
83
  "dependencies": {
84
84
  "@chainsafe/is-ip": "^2.1.0",
85
85
  "@chainsafe/netmask": "^2.0.0",
86
- "@libp2p/crypto": "^5.1.20",
87
- "@libp2p/interface": "^3.2.4",
88
- "@libp2p/interface-internal": "^3.1.7",
89
- "@libp2p/logger": "^6.2.9",
90
- "@libp2p/multistream-select": "^7.0.22",
91
- "@libp2p/peer-collections": "^7.0.22",
92
- "@libp2p/peer-id": "^6.0.11",
93
- "@libp2p/peer-store": "^12.0.22",
94
- "@libp2p/utils": "^7.2.3",
86
+ "@libp2p/crypto": "5.1.21-4bb8fbe8d",
87
+ "@libp2p/interface": "3.2.5-4bb8fbe8d",
88
+ "@libp2p/interface-internal": "3.1.8-4bb8fbe8d",
89
+ "@libp2p/logger": "6.2.10-4bb8fbe8d",
90
+ "@libp2p/multistream-select": "7.0.23-4bb8fbe8d",
91
+ "@libp2p/peer-collections": "7.0.23-4bb8fbe8d",
92
+ "@libp2p/peer-id": "6.0.12-4bb8fbe8d",
93
+ "@libp2p/peer-store": "12.0.23-4bb8fbe8d",
94
+ "@libp2p/utils": "7.2.4-4bb8fbe8d",
95
95
  "@multiformats/dns": "^1.0.6",
96
96
  "@multiformats/multiaddr": "^13.0.3",
97
97
  "@multiformats/multiaddr-matcher": "^3.0.2",
@@ -110,7 +110,7 @@
110
110
  "uint8arrays": "^6.1.1"
111
111
  },
112
112
  "devDependencies": {
113
- "aegir": "^48.0.11",
113
+ "aegir": "^48.1.1",
114
114
  "delay": "^7.0.0",
115
115
  "it-all": "^3.0.9",
116
116
  "it-drain": "^3.0.10",
@@ -1,7 +1,7 @@
1
1
  import { dns, RecordType } from '@multiformats/dns'
2
2
  import { multiaddr } from '@multiformats/multiaddr'
3
3
  import type { MultiaddrResolver, MultiaddrResolveOptions } from '@libp2p/interface'
4
- import type { DNS } from '@multiformats/dns'
4
+ import type { DNS, DNSResponse } from '@multiformats/dns'
5
5
  import type { Multiaddr } from '@multiformats/multiaddr'
6
6
 
7
7
  class DNSAddrResolver implements MultiaddrResolver {
@@ -21,12 +21,28 @@ class DNSAddrResolver implements MultiaddrResolver {
21
21
  }
22
22
 
23
23
  const resolver = this.getDNS(options)
24
- const result = await resolver.query(`_dnsaddr.${hostname}`, {
25
- signal: options?.signal,
26
- types: [
27
- RecordType.TXT
28
- ]
29
- })
24
+
25
+ let result: DNSResponse
26
+
27
+ try {
28
+ result = await resolver.query(`_dnsaddr.${hostname}`, {
29
+ signal: options?.signal,
30
+ types: [
31
+ RecordType.TXT
32
+ ]
33
+ })
34
+ } catch (err: any) {
35
+ const noAnswers = err.name === 'DNSQueryFailedError' &&
36
+ Array.isArray(err.errors) &&
37
+ err.errors.length > 0 &&
38
+ err.errors.every((e: Error) => e.name === 'EmptyDNSAnswerError')
39
+
40
+ if (noAnswers) {
41
+ return []
42
+ }
43
+
44
+ throw err
45
+ }
30
46
 
31
47
  const peerId = ma.getComponents()
32
48
  .find(component => component.name === 'p2p')
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '3.3.4'
1
+ export const version = '3.3.5-4bb8fbe8d'
2
2
  export const name = 'js-libp2p'
@@ -1,24 +0,0 @@
1
- {
2
- "AddressFilter": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressFilter.html",
3
- "AddressManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressManagerInit.html",
4
- "ConnectionManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionManagerInit.html",
5
- "ConnectionMonitorInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionMonitorInit.html",
6
- "Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
7
- ".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
8
- "TransportManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.TransportManagerInit.html",
9
- "Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
10
- ".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
11
- "ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
12
- ".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
13
- "dnsaddrResolver": "https://libp2p.github.io/js-libp2p/variables/libp2p.index.dnsaddrResolver.html",
14
- "createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
15
- ".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
16
- "isLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.isLibp2p.html",
17
- ".:isLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.isLibp2p.html",
18
- "userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user-agent.userAgent.html",
19
- "./user-agent:userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user-agent.userAgent.html",
20
- "name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
21
- "./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
22
- "version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
23
- "./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
24
- }