libp2p 1.2.0 → 1.2.1-6f323de7d

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 isPrivate from 'private-ip';
1
+ import { isPrivateIp } from '@libp2p/utils/private-ip';
2
2
  /**
3
3
  * Returns a connection gater that disallows dialling private addresses by
4
4
  * default. Browsers are severely limited in their resource usage so don't
@@ -10,7 +10,7 @@ export function connectionGater(gater = {}) {
10
10
  denyDialMultiaddr: async (multiaddr) => {
11
11
  const tuples = multiaddr.stringTuples();
12
12
  if (tuples[0][0] === 4 || tuples[0][0] === 41) {
13
- return Boolean(isPrivate(`${tuples[0][1]}`));
13
+ return Boolean(isPrivateIp(`${tuples[0][1]}`));
14
14
  }
15
15
  return false;
16
16
  },
@@ -1 +1 @@
1
- {"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC9C,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC9C,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"connection-gater.browser.js","sourceRoot":"","sources":["../../../src/config/connection-gater.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAE,QAAyB,EAAE;IAC1D,OAAO;QACL,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAC/B,iBAAiB,EAAE,KAAK,EAAE,SAAoB,EAAE,EAAE;YAChD,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAA;YAEvC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC9C,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAChD,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC;QACD,qBAAqB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACxC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACzC,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,+BAA+B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAClD,6BAA6B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QAChD,8BAA8B,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;QACjD,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI;QACxC,GAAG,KAAK;KACT,CAAA;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const version = "1.2.0";
1
+ export declare const version = "1.2.1-6f323de7d";
2
2
  export declare const name = "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,WAAW,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,WAAW,CAAA"}
@@ -1,3 +1,3 @@
1
- export const version = '1.2.0';
1
+ export const version = '1.2.1-6f323de7d';
2
2
  export const name = '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,QAAQ,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,QAAQ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libp2p",
3
- "version": "1.2.0",
3
+ "version": "1.2.1-6f323de7d",
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",
@@ -84,16 +84,16 @@
84
84
  "test:webkit": "aegir test -t browser -f \"./dist/test/**/*.spec.js\" -- --browser webkit"
85
85
  },
86
86
  "dependencies": {
87
- "@libp2p/crypto": "^4.0.1",
88
- "@libp2p/interface": "^1.1.2",
89
- "@libp2p/interface-internal": "^1.0.7",
90
- "@libp2p/logger": "^4.0.5",
91
- "@libp2p/multistream-select": "^5.1.2",
92
- "@libp2p/peer-collections": "^5.1.5",
93
- "@libp2p/peer-id": "^4.0.5",
94
- "@libp2p/peer-id-factory": "^4.0.5",
95
- "@libp2p/peer-store": "^10.0.7",
96
- "@libp2p/utils": "^5.2.2",
87
+ "@libp2p/crypto": "4.0.1-6f323de7d",
88
+ "@libp2p/interface": "1.1.2-6f323de7d",
89
+ "@libp2p/interface-internal": "1.0.7-6f323de7d",
90
+ "@libp2p/logger": "4.0.5-6f323de7d",
91
+ "@libp2p/multistream-select": "5.1.2-6f323de7d",
92
+ "@libp2p/peer-collections": "5.1.5-6f323de7d",
93
+ "@libp2p/peer-id": "4.0.5-6f323de7d",
94
+ "@libp2p/peer-id-factory": "4.0.5-6f323de7d",
95
+ "@libp2p/peer-store": "10.0.8-6f323de7d",
96
+ "@libp2p/utils": "5.2.3-6f323de7d",
97
97
  "@multiformats/multiaddr": "^12.1.10",
98
98
  "any-signal": "^4.1.1",
99
99
  "datastore-core": "^9.0.1",
@@ -102,18 +102,17 @@
102
102
  "it-parallel": "^3.0.6",
103
103
  "merge-options": "^3.0.4",
104
104
  "multiformats": "^13.0.0",
105
- "private-ip": "^3.0.1",
106
105
  "uint8arrays": "^5.0.0"
107
106
  },
108
107
  "devDependencies": {
109
108
  "@chainsafe/libp2p-yamux": "^6.0.1",
110
- "@libp2p/circuit-relay-v2": "^1.0.12",
111
- "@libp2p/identify": "^1.0.11",
112
- "@libp2p/interface-compliance-tests": "^5.1.3",
113
- "@libp2p/mplex": "^10.0.12",
114
- "@libp2p/plaintext": "^1.0.12",
115
- "@libp2p/tcp": "^9.0.12",
116
- "@libp2p/websockets": "^8.0.12",
109
+ "@libp2p/circuit-relay-v2": "1.0.13-6f323de7d",
110
+ "@libp2p/identify": "1.0.12-6f323de7d",
111
+ "@libp2p/interface-compliance-tests": "5.2.0-6f323de7d",
112
+ "@libp2p/mplex": "10.0.13-6f323de7d",
113
+ "@libp2p/plaintext": "1.0.13-6f323de7d",
114
+ "@libp2p/tcp": "9.0.13-6f323de7d",
115
+ "@libp2p/websockets": "8.0.13-6f323de7d",
117
116
  "@multiformats/mafmt": "^12.1.6",
118
117
  "@multiformats/multiaddr-matcher": "^1.1.0",
119
118
  "aegir": "^42.0.0",
@@ -1,4 +1,4 @@
1
- import isPrivate from 'private-ip'
1
+ import { isPrivateIp } from '@libp2p/utils/private-ip'
2
2
  import type { ConnectionGater } from '@libp2p/interface'
3
3
  import type { Multiaddr } from '@multiformats/multiaddr'
4
4
 
@@ -14,7 +14,7 @@ export function connectionGater (gater: ConnectionGater = {}): ConnectionGater {
14
14
  const tuples = multiaddr.stringTuples()
15
15
 
16
16
  if (tuples[0][0] === 4 || tuples[0][0] === 41) {
17
- return Boolean(isPrivate(`${tuples[0][1]}`))
17
+ return Boolean(isPrivateIp(`${tuples[0][1]}`))
18
18
  }
19
19
 
20
20
  return false
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '1.2.0'
1
+ export const version = '1.2.1-6f323de7d'
2
2
  export const name = 'libp2p'
@@ -1,14 +0,0 @@
1
- {
2
- "Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
3
- ".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
4
- "Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
5
- ".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
6
- "ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
7
- ".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
8
- "createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
9
- ".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
10
- "name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
11
- "./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
12
- "version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
13
- "./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
14
- }