@helia/routers 4.0.2 → 4.0.3
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":"libp2p-routing.d.ts","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"libp2p-routing.d.ts","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,OAAO,EAAkB,MAAM,kBAAkB,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,mBAAmB,CAAA;AAuCjE,wBAAgB,aAAa,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import map from 'it-map';
|
|
2
1
|
class Libp2pRouter {
|
|
3
2
|
libp2p;
|
|
4
3
|
constructor(libp2p) {
|
|
@@ -11,12 +10,7 @@ class Libp2pRouter {
|
|
|
11
10
|
await this.libp2p.contentRouting.cancelReprovide(key, options);
|
|
12
11
|
}
|
|
13
12
|
async *findProviders(cid, options) {
|
|
14
|
-
yield*
|
|
15
|
-
return {
|
|
16
|
-
...info,
|
|
17
|
-
routing: 'libp2p'
|
|
18
|
-
};
|
|
19
|
-
});
|
|
13
|
+
yield* this.libp2p.contentRouting.findProviders(cid, options);
|
|
20
14
|
}
|
|
21
15
|
async put(key, value, options) {
|
|
22
16
|
await this.libp2p.contentRouting.put(key, value, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libp2p-routing.js","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"libp2p-routing.js","sourceRoot":"","sources":["../../src/libp2p-routing.ts"],"names":[],"mappings":"AAIA,MAAM,YAAY;IACC,MAAM,CAAQ;IAE/B,YAAa,MAAc;QACzB,IAAI,CAAC,MAA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M,CAAC,CAAA;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/routers",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "Routers for Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/routers#readme",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@helia/delegated-routing-v1-http-api-client": "^5.0.0",
|
|
51
|
-
"@helia/interface": "^6.0.
|
|
52
|
-
"@libp2p/interface": "^3.0
|
|
51
|
+
"@helia/interface": "^6.0.2",
|
|
52
|
+
"@libp2p/interface": "^3.1.0",
|
|
53
53
|
"@libp2p/peer-id": "^6.0.3",
|
|
54
54
|
"@multiformats/uri-to-multiaddr": "^10.0.0",
|
|
55
55
|
"ipns": "^10.1.2",
|
package/src/libp2p-routing.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import map from 'it-map'
|
|
2
1
|
import type { Provider, Routing, RoutingOptions } from '@helia/interface'
|
|
3
2
|
import type { Libp2p, PeerId, PeerInfo } from '@libp2p/interface'
|
|
4
3
|
import type { CID } from 'multiformats'
|
|
@@ -19,12 +18,7 @@ class Libp2pRouter implements Routing {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
async * findProviders (cid: CID, options?: RoutingOptions): AsyncIterable<Provider> {
|
|
22
|
-
yield *
|
|
23
|
-
return {
|
|
24
|
-
...info,
|
|
25
|
-
routing: 'libp2p'
|
|
26
|
-
}
|
|
27
|
-
})
|
|
21
|
+
yield * this.libp2p.contentRouting.findProviders(cid, options)
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
async put (key: Uint8Array, value: Uint8Array, options?: RoutingOptions): Promise<void> {
|