Skip to content

Commit 23e3039

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/update-libp2p-deps
2 parents 1afd68d + b4f1f52 commit 23e3039

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
# kubo-rpc-client
23

34
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
@@ -55,6 +56,8 @@ Loading this module through a script tag will make its exports available as `Kub
5556
- [License](#license)
5657
- [Contribute](#contribute)
5758

59+
=======
60+
>>>>>>> origin/main
5861
## Kubo RPC Client
5962

6063
<h3 align="center">JavaScript client library for the Kubo RPC API</h3>
@@ -78,22 +81,34 @@ Loading this module through a script tag will make its exports available as `Kub
7881
<br>
7982
</p>
8083

81-
## Getting Started
84+
# kubo-rpc-client
8285

83-
We've come a long way, but this project is still in Alpha, lots of development is happening, APIs might change, beware of 🐉..
86+
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
87+
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
88+
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-kubo-rpc-client.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-kubo-rpc-client)
89+
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-kubo-rpc-client/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/js-kubo-rpc-client/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
8490

85-
```bash
86-
npm install --save kubo-rpc-client
91+
> A client library for the Kubo RPC API
92+
93+
# Install
94+
95+
```console
96+
$ npm i kubo-rpc-client
97+
```
98+
99+
## Browser `<script>` tag
100+
101+
Loading this module through a script tag will make its exports available as `KuboRpcClient` in the global namespace.
102+
103+
```html
104+
<script src="https://unpkg.com/kubo-rpc-client/dist/index.min.js"></script>
87105
```
88106

89107
Both the Current and Active LTS versions of Node.js are supported. Please see [nodejs.org](https://nodejs.org/) for what these currently are.
90108

91109
### Next Steps
92110

93-
<!-- TODO: currently useless
94111
- Read the [docs](https://ipfs.github.io/js-kubo-rpc-client)
95-
-->
96-
97112
- Look into the [examples](https://github.com/ipfs-examples/js-ipfs-examples) to learn how to spawn an RPC client or a full IPFS node in Node.js and in the Browser
98113
- Consult the [Core API docs](https://github.com/ipfs/js-ipfs/tree/master/docs/core-api) to see what you can do with an IPFS node
99114
- Check out <https://docs.ipfs.tech> for tips, how-tos and more

src/lib/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class HTTP {
143143
log.trace('outgoing headers', opts.headers)
144144
log.trace('%s %s', opts.method, url)
145145

146-
// @ts-expect-error extra properties are added later
146+
// @ts-expect-error extra fields are added later
147147
const response: ExtendedResponse = await fetch(url.toString(), {
148148
...opts,
149149
signal: opts.signal,
@@ -239,7 +239,7 @@ const ndjson = async function * (source: AsyncIterable<Uint8Array>): AsyncIterab
239239
* @param {ReadableStream<TChunk> | NodeReadableStream | null} source
240240
* @returns {AsyncIterable<TChunk>}
241241
*/
242-
const fromStream = <TChunk> (source?: any | null): AsyncIterable<TChunk> => {
242+
const fromStream = <TChunk> (source: any | null): AsyncIterable<TChunk> => {
243243
if (isAsyncIterable<TChunk>(source)) {
244244
return source
245245
}

test/interface-tests/src/pin/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export const pinTypes: Record<string, PinType> = {
2323
export const fixtures = Object.freeze({
2424
// NOTE: files under 'directory' need to be different than standalone ones in 'files'
2525
directory: Object.freeze({
26-
cid: CID.parse('QmSjnCov8q2oU54bGE4n9B3BoaBv8ALVZUUkzLjqAN9Roj'),
26+
cid: CID.parse('QmVfR81gGg1a5pLFybBF1dvFY8fVcvdan2oT9WT4Git6XH'),
2727
files: Object.freeze([Object.freeze({
2828
path: 'test-folder/ipfs-add.js',
2929
data: loadFixture('test/interface-tests/fixtures/test-folder/ipfs-add.js'),
30-
cid: CID.parse('QmdWJndBCczwPQeiKiSBzef8TyWigApDqY3q8p7jg9CiQK')
30+
cid: CID.parse('QmabGLRzzSFDwsh7rfLfib2U2Xk2x4XiCgpWwZfcUx4dtq')
3131
}), Object.freeze({
3232
path: 'test-folder/files/ipfs.txt',
3333
data: loadFixture('test/interface-tests/fixtures/test-folder/files/ipfs.txt'),

test/lib.error-handler.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-env mocha */
22

33
import { expect } from 'aegir/chai'
4-
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
54
import { errorHandler, HTTPError } from '../src/lib/core.js'
65
import { throwsAsync } from './utils/throws-async.js'
76

@@ -18,7 +17,7 @@ describe('lib/error-handler', function () {
1817
Code: 0,
1918
Type: 'error'
2019
}),
21-
bytes: async () => uint8ArrayFromString('boom'),
20+
bytes: async () => Promise.reject(new Error('boom')),
2221
status: 500,
2322
redirected: false,
2423
url: '',
@@ -49,7 +48,7 @@ describe('lib/error-handler', function () {
4948
'Content-Type': 'application/json'
5049
}),
5150
json: async () => 'boom', // not valid json!
52-
bytes: async () => uint8ArrayFromString('boom'),
51+
bytes: async () => Promise.reject(new Error('boom')),
5352
status: 500,
5453
redirected: false,
5554
url: '',
@@ -77,7 +76,7 @@ describe('lib/error-handler', function () {
7776
text: async () => Promise.reject(new Error('boom')),
7877
status: 500,
7978
json: async () => 'boom', // not valid json!
80-
bytes: async () => uint8ArrayFromString('boom'),
79+
bytes: async () => Promise.reject(new Error('boom')),
8180
redirected: false,
8281
url: '',
8382
type: 'basic',

0 commit comments

Comments
 (0)