Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Releases: ipfs-inactive/js-ipfs-http-client

v42.0.0

04 Feb 12:03
Compare
Choose a tag to compare

🏗 API Changes

There are significant and breaking API changes in this release. Please see the migration guide.

  • Callbacks are no longer supported on any API methods. Please use a utility such as callbackify on API methods that return Promises to emulate previous behaviour. See the migration guide for more info.

  • add now returns an async iterable.

  • add now accepts mode and mtime options on inputs to allow setting mode and mtime metadata for added files. See the core interface docs for more info.

  • add results now contain a cid property (a CID instance) instead of a string hash property.

  • 🆕 add results now include mode and mtime properties if they were set.

  • addReadableStream, addPullStream have been removed. Please see the migration guide for more info.

  • addFromStream has been removed. Use add instead.

  • addFromFs has been removed. Please use the exported globSource utility and pass the result to add. See the glob source documentation for more details and an example.

  • addFromURL has been removed. Please use the exported urlSource utility and pass the result to add. See the URL source documentation for more details and an example.

  • bitswap.stat result has changed - wantlist and values are now an array of CID instances and peers is now a string[] of peer IDs.

  • bitswap.wantlist now returns an array of CID instances.

  • block.rm now returns an async iterable.

  • block.rm now yields objects of { cid: CID, error: Error }.

  • block.stat result now contains a cid property (whose value is a CID instance) instead of a key property.

  • dht.findProvs, dht.provide, dht.put and dht.query now all return an async iterable.

  • dht.findPeer, dht.findProvs, dht.provide, dht.put and dht.query now yield/return an object { id: string, addrs: Multiaddr[] } instead of a PeerInfo instance(s).

  • 🆕 files.chmod has been added. See the core interface docs for info.

  • 🆕 files.flush now returns the root CID for the path that was flushed (/ by default)

  • files.lsPullStream and files.lsReadableStream have been removed. Please see the migration guide for more info.

  • files.ls now returns an async iterable.

  • files.ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

  • 🆕 files.ls results now include mode and mtime properties if they were set. See the core interface docs for more info.

  • files.ls no longer takes a long option (in core) - you will receive all data by default.

  • 🆕 files.mkdir now accepts mode and mtime options to allow setting mode and mtime metadata. See the core interface docs for more info.

  • files.readPullStream and files.readReadableStream have been removed. Please see the migration guide for more info.

  • files.read now returns an async iterable.

  • files.stat result now contains a cid property (whose value is a CID instance) instead of a hash property.

  • 🆕 files.stat result now includes mode and mtime properties if they were set. See the core interface docs for more info.

  • 🆕 files.touch has been added. See the core interface docs for info.

  • 🆕 files.write now accepts mode and mtime options to allow setting mode and mtime metadata. See the core interface docs for more info.

  • get now returns an async iterable. The content property value for objects yielded from the iterator is now an async iterable that yields BufferList objects.

  • id result has changed, the addresses property is now a Multiaddr[]

  • name.resolve now returns an async iterable. It yields increasingly more accurate resolved values as they are discovered until the best value is selected from the quorum of 16. The "best" resolved value is the last item yielded from the iterator. If you are interested only in this best value you could use it-last to extract it like so:

    const last = require('it-last')
    await last(ipfs.name.resolve('/ipns/QmHash'))
  • 🆕 object.get now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

  • ls now returns an async iterable.

  • ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

  • ls results now include mode and mtime properties if they were set. See the core interface docs for more info.

  • pin.add results now contain a cid property (a CID instance) instead of a string hash property.

  • 🆕 pin.add now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

  • pin.ls now returns an async iterable.

  • pin.ls results now contain a cid property (a CID instance) instead of a string hash property.

  • pin.rm results now contain a cid property (a CID instance) instead of a string hash property.

  • ping now returns an async iterable.

  • refs and refs.local now return an async iterable.

  • 🆕 refs now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

  • repo.gc now returns an async iterable.

  • stats.bw now returns an async iterable.

  • swarm.peers now returns an array of objects with a peer property that is a string, instead of a PeerId instance.

  • swarm.addrs now returns an array of objects { id: string, addrs: Multiaddr[] } instead of PeerInfo instances.

Other changes

  • The protocol name for peer IDs in multiaddrs has changed from 'ipfs' to 'p2p'. There's no changes to data on the wire but this change is seen when multiaddrs are converted to strings.

v42.0.0-pre.0

23 Jan 20:25
Compare
Choose a tag to compare
v42.0.0-pre.0 Pre-release
Pre-release

BREAKING CHANGE: Callbacks are no longer supported on any API methods. Please use a utility such as callbackify on API methods that return Promises to emulate previous behaviour.

BREAKING CHANGE: PeerId and PeerInfo classes are no longer statically exported from ipfs-http-client since they are no longer used internally.

BREAKING CHANGE: pin.add results now contain a cid property (a CID instance) instead of a string hash property.

BREAKING CHANGE: pin.ls now returns an async iterable.

BREAKING CHANGE: pin.ls results now contain a cid property (a CID instance) instead of a string hash property.

BREAKING CHANGE: pin.rm results now contain a cid property (a CID instance) instead of a string hash property.

BREAKING CHANGE: add now returns an async iterable.

BREAKING CHANGE: add results now contain a cid property (a CID instance) instead of a string hash property.

BREAKING CHANGE: addReadableStream, addPullStream have been removed.

BREAKING CHANGE: ls now returns an async iterable.

BREAKING CHANGE: ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

BREAKING CHANGE: files.ls now returns an async iterable.

BREAKING CHANGE: files.readPullStream and files.readReadableStream have been removed.

BREAKING CHANGE: files.read now returns an async iterable.

BREAKING CHANGE: files.lsPullStream and files.lsReadableStream have been removed.

BREAKING CHANGE: files.ls now returns an async iterable.

BREAKING CHANGE: files.ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

BREAKING CHANGE: files.ls no longer takes a long option (in core) - you will receive all data by default.

BREAKING CHANGE: files.stat result now contains a cid property (whose value is a CID instance) instead of a hash property.

BREAKING CHANGE: get now returns an async iterable. The content property value for objects yielded from the iterator is now an async iterable that yields BufferList objects.

BREAKING CHANGE: stats.bw now returns an async iterable.

BREAKING CHANGE: addFromStream has been removed. Use add instead.

BREAKING CHANGE: isIPFS is no longer exported from the client, please npm i is-ipfs or include the CDN script tag <script src="https://unpkg.com/is-ipfs/dist/index.min.js"></script> to use this utility in your applications.

BREAKING CHANGE: addFromFs has been removed. Please use the exported globSource utility and pass the result to add. See the glob source documentation for more details and an example.

BREAKING CHANGE: addFromURL has been removed. Please use the exported urlSource utility and pass the result to add. See the URL source documentation for more details and an example.

BREAKING CHANGE: name.resolve now returns an async iterable. It yields increasingly more accurate resolved values as they are discovered until the best value is selected from the quorum of 16. The "best" resolved value is the last item yielded from the iterator. If you are interested only in this best value you could use it-last to extract it like so:

const last = require('it-last')
await last(ipfs.name.resolve('/ipns/QmHash'))

BREAKING CHANGE: block.rm now returns an async iterable.

BREAKING CHANGE: block.rm now yields objects of { cid: CID, error: Error }.

BREAKING CHANGE: dht.findProvs, dht.provide, dht.put and dht.query now all return an async iterable.

BREAKING CHANGE: dht.findPeer, dht.findProvs, dht.provide, dht.put and dht.query now yield/return an object { id: CID, addrs: Multiaddr[] } instead of a PeerInfo instance(s).

BREAKING CHANGE: refs and refs.local now return an async iterable.

BREAKING CHANGE: object.data now returns an async iterable that yields Buffer objects.

BREAKING CHANGE: ping now returns an async iterable.

BREAKING CHANGE: repo.gc now returns an async iterable.

BREAKING CHANGE: swarm.peers now returns an array of objects with a peer property that is a CID, instead of a PeerId instance.

BREAKING CHANGE: swarm.addrs now returns an array of objects { id: CID, addrs: Multiaddr[] } instead of PeerInfo instances.

BREAKING CHANGE: block.stat result now contains a cid property (whose value is a CID instance) instead of a key property.

BREAKING CHANGE: bitswap.wantlist now returns an array of CID instances.

BREAKING CHANGE: bitswap.stat result has changed - wantlist and peers values are now an array of CID instances.

v41.0.1

23 Jan 09:35
Compare
Choose a tag to compare
chore: release version v41.0.1

v41.0.0

12 Jan 08:31
Compare
Choose a tag to compare

Bug Fixes

Code Refactoring

BREAKING CHANGES

  • format option is no longer supported as everything is dag-pb all
    of the time.

Follows on from ipfs-inactive/js-ipfs-mfs#69

v40.2.1

09 Jan 17:56
Compare
Choose a tag to compare
chore: release version v40.2.1

v40.2.0

09 Jan 11:42
Compare
Choose a tag to compare

Features

v40.1.0

10 Dec 16:30
Compare
Choose a tag to compare

Features

v40.0.1

27 Nov 15:54
Compare
Choose a tag to compare

Bug Fixes

v40.0.0

22 Nov 14:37
Compare
Choose a tag to compare

Code Refactoring

Features

Reverts

BREAKING CHANGES

  • The log.tail method now returns an async iterator that yields log messages. Use it like:
    for await (const message of ipfs.log.tail()) {
      console.log(message)
    }
  • The response to a call to log.level now returns an object that has camel cased keys. i.e. Message and Error properties have changed to message and error.
  • Dropped support for go-ipfs <= 0.4.4 in swarm.peers response.
  • The signature for ipfs.mount has changed from ipfs.mount([ipfsPath], [ipnsPath]) to ipfs.mount([options]). Where options is an optional object that may contain two boolean properties ipfsPath and ipnsPath. The response object has also changed to be camel case. See https://docs.ipfs.io/reference/api/http/#api-v0-mount.
  • Default ping count of 1 in client has been removed. The default ping count is now whatever the IPFS node defaults it to (currently 10). If you specifically need 1 ping message then please pass count: 1 in options for ipfs.ping().
  • Multi parameter constructor options are no longer supported. To create a new IPFS HTTP client, pass a single parameter to the constructor. The parameter can be one of:
    • String, formatted as one of:
    • Multiaddr instance
    • Object, in format of either:
      • Address and path e.g. { apiAddr: '/ip4/127.0.0.1/tcp/5001': apiPath: '/api/v0' } (Note: apiAddr can also be a string in URL form or a Multiaddr instance)
      • Node.js style address e.g. { host: '127.0.0.1', port: 5001, protocol: 'http' }
  • Errors returned from request failures are now all HTTPErrors which carry a response property. This is a Response that can be used to inspect all information relating to the HTTP response. This means that the err.status or err.statusCode property should now be accessed via err.response.status.
  • files in src/files-regular have moved to src. The src/files-mfs directory has been renamed to src/files. If you were previously requiring files from these directories e.g. require('ipfs-http-client/src/files-regular/add') then please be aware that they have moved.
  • Kebab case options are no longer supported. Please use camel case option names as defined in the interface-ipfs-core docs. e.g. the allow-offline option to name.publish should be passed as allowOffline.

v39.0.2

23 Oct 06:22
Compare
Choose a tag to compare

Bug Fixes

  • use non-strict equivalence for options.preload (#1134) (432e1e8)