Skip to content

Commit 127bcc0

Browse files
deps(dev): bump aegir from 39.0.13 to 40.0.8 (#8)
* deps(dev): bump aegir from 39.0.13 to 40.0.8 Bumps [aegir](https://github.com/ipfs/aegir) from 39.0.13 to 40.0.8. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v39.0.13...v40.0.8) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: fix up * chore: update config * chore: update docs --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: achingbrain <[email protected]>
1 parent b4f59b6 commit 127bcc0

File tree

10 files changed

+46
-42
lines changed

10 files changed

+46
-42
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"generate": "aegir run generate",
3030
"build": "aegir run build",
3131
"lint": "aegir run lint",
32-
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs",
32+
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs -- --exclude packages/interop",
3333
"docs:no-publish": "npm run docs -- --publish false",
3434
"dep-check": "aegir run dep-check",
35-
"release": "npm run docs:no-publish && aegir run release && npm run docs"
35+
"release": "npm run docs:no-publish && aegir run release && npm run docs -- --exclude packages/interop"
3636
},
3737
"devDependencies": {
38-
"aegir": "^39.0.4"
38+
"aegir": "^40.0.8"
3939
},
4040
"type": "module",
4141
"workspaces": [

packages/client/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@
144144
},
145145
"devDependencies": {
146146
"@libp2p/peer-id-factory": "^2.0.3",
147-
"aegir": "^39.0.4",
147+
"aegir": "^40.0.8",
148148
"body-parser": "^1.20.2"
149-
},
150-
"typedoc": {
151-
"entryPoint": "./src/index.ts"
152149
}
153150
}

packages/client/src/index.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
/**
22
* @packageDocumentation
33
*
4-
* Create a Helia node.
4+
* Create a client to use with a Routing V1 HTTP API server.
55
*
66
* @example
77
*
88
* ```typescript
9-
* import { MemoryDatastore } from 'datastore-core'
10-
* import { MemoryBlockstore } from 'blockstore-core'
11-
* import { createHelia } from 'helia'
12-
* import { unixfs } from '@helia/unixfs'
9+
* import { createRoutingV1HttpApiClient } from '@helia/routing-v1-http-api-client'
1310
* import { CID } from 'multiformats/cid'
1411
*
15-
* const node = await createHelia({
16-
* blockstore: new MemoryBlockstore(),
17-
* datastore: new MemoryDatastore()
18-
* })
19-
* const fs = unixfs(node)
20-
* fs.cat(CID.parse('bafyFoo'))
12+
* const client = createRoutingV1HttpApiClient(new URL('https://example.org'))
13+
*
14+
* for await (const prov of getProviders(CID.parse('QmFoo'))) {
15+
* // ...
16+
* }
2117
* ```
2218
*/
2319

@@ -41,12 +37,21 @@ export interface RoutingV1HttpApiClientInit {
4137
}
4238

4339
export interface RoutingV1HttpApiClient {
40+
/**
41+
* Returns an async generator of PeerInfos that can provide the content
42+
* for the passed CID
43+
*/
4444
getProviders: (cid: CID, options?: AbortOptions) => AsyncGenerator<PeerInfo>
45+
46+
/**
47+
* Shut down any currently running HTTP requests and clear up any resources
48+
* that are in use
49+
*/
4550
stop: () => void
4651
}
4752

4853
/**
49-
* Create and return a Helia node
54+
* Create and return a client to use with a Routing V1 HTTP API server
5055
*/
5156
export function createRoutingV1HttpApiClient (url: URL, init: RoutingV1HttpApiClientInit = {}): RoutingV1HttpApiClient {
5257
return new DefaultRoutingV1HttpApiClient(url, init)

packages/client/typedoc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"entryPoints": [
3+
"./src/index.ts"
4+
]
5+
}

packages/interop/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
## Table of contents <!-- omit in toc -->
1717

1818
- [Install](#install)
19-
- [API Docs](#api-docs)
2019
- [License](#license)
2120
- [Contribute](#contribute)
2221

@@ -26,10 +25,6 @@
2625
$ npm i @helia/routing-v1-http-api-interop
2726
```
2827

29-
## API Docs
30-
31-
- <https://ipfs.github.io/helia-routing-v1-http-api/modules/_helia_routing_v1_http_api_client_interop.html>
32-
3328
## License
3429

3530
Licensed under either of

packages/interop/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,10 @@
5151
"@helia/interface": "^1.1.1",
5252
"@libp2p/interface-libp2p": "^3.2.0",
5353
"@libp2p/kad-dht": "^9.3.6",
54-
"aegir": "^39.0.4",
54+
"aegir": "^40.0.8",
5555
"fastify": "^4.17.0",
5656
"libp2p": "^0.45.4",
5757
"multiformats": "^11.0.2"
5858
},
59-
"private": true,
60-
"typedoc": {
61-
"entryPoint": "./src/index.ts"
62-
}
59+
"private": true
6360
}

packages/server/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,8 @@
160160
"@libp2p/peer-id-factory": "^2.0.3",
161161
"@multiformats/multiaddr": "^12.1.3",
162162
"@types/sinon": "^10.0.15",
163-
"aegir": "^39.0.4",
163+
"aegir": "^40.0.8",
164164
"sinon": "^15.1.0",
165165
"sinon-ts": "^1.0.0"
166-
},
167-
"typedoc": {
168-
"entryPoint": "./src/index.ts"
169166
}
170167
}

packages/server/src/index.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
*
1212
* const helia = await createHelia()
1313
* const server = await createRoutingV1HttpApiServer(helia, {
14-
* fastify: {
15-
* // fastify options
16-
* },
1714
* listen: {
1815
* // fastify listen options
1916
* }
@@ -55,22 +52,23 @@
5552
*/
5653

5754
import cors from '@fastify/cors'
58-
import fastify, { type FastifyListenOptions, type FastifyHttpOptions, type FastifyHttpsOptions, type FastifyInstance } from 'fastify'
55+
import fastify, {
56+
type FastifyListenOptions,
57+
type FastifyInstance
58+
} from 'fastify'
5959
import routes from './routes/index.js'
6060
import type { Helia } from '@helia/interface'
61-
import type * as http from 'node:http'
62-
import type * as https from 'node:https'
6361

6462
export interface ServerInit {
65-
fastify?: FastifyHttpOptions<http.Server> | FastifyHttpsOptions<https.Server>
63+
fastify?: FastifyInstance
6664
listen?: FastifyListenOptions
6765
}
6866

6967
/**
70-
* Create and return a Helia node
68+
* Create and return a Routing V1 HTTP API server
7169
*/
7270
export async function createRoutingV1HttpApiServer (helia: Helia, init: ServerInit = {}): Promise<FastifyInstance> {
73-
const server = fastify(init.fastify)
71+
const server = init.fastify ?? fastify()
7472
await server.register(cors, {
7573
origin: '*',
7674
methods: ['GET', 'OPTIONS'],

packages/server/typedoc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"entryPoints": [
3+
"./src/index.ts",
4+
"./src/routes/index.ts"
5+
]
6+
}

typedoc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://typedoc.org/schema.json",
3+
"name": "Helia Routing V1 HTTP API"
4+
}

0 commit comments

Comments
 (0)