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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v39.0.2
Choose a base ref
...
head repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 28,050 additions and 6,494 deletions.
  1. +13 −9 .aegir.js
  2. +14 −2 .travis.yml
  3. +245 −8 CHANGELOG.md
  4. +5 −0 COPYRIGHT
  5. +5 −0 LICENSE-APACHE
  6. 0 LICENSE → LICENSE-MIT
  7. +203 −129 README.md
  8. +1 −1 examples/browser-pubsub/README.md
  9. +1 −1 examples/browser-pubsub/index.html
  10. +7 −6 examples/browser-pubsub/package.json
  11. +0 −1 examples/bundle-browserify/.gitignore
  12. +0 −35 examples/bundle-browserify/README.md
  13. BIN examples/bundle-browserify/img/1.png
  14. BIN examples/bundle-browserify/img/2.png
  15. +0 −26 examples/bundle-browserify/index.html
  16. +0 −36 examples/bundle-browserify/index.js
  17. +0 −18 examples/bundle-browserify/package.json
  18. +1 −1 examples/bundle-webpack/README.md
  19. +1 −4 examples/bundle-webpack/package.json
  20. +20 −17 examples/bundle-webpack/src/App.js
  21. +17 −10 examples/files-api/files-api.js
  22. +1 −2 examples/name-api/index.html
  23. +28 −29 examples/name-api/index.js
  24. +24,406 −926 examples/name-api/package-lock.json
  25. +9 −4 examples/name-api/package.json
  26. +0 −3 examples/upload-file-via-browser/README.md
  27. +1 −1 examples/upload-file-via-browser/index.html
  28. +8 −19 examples/upload-file-via-browser/package.json
  29. +29 −25 examples/upload-file-via-browser/src/App.js
  30. +1 −0 examples/upload-file-via-browser/src/index.js
  31. +0 −37 examples/upload-file-via-browser/webpack.config.js
  32. +31 −63 package.json
  33. +0 −3 src/add-from-fs/index.browser.js
  34. +0 −8 src/add-from-fs/index.js
  35. +0 −21 src/add-from-url.js
  36. +22 −2 src/add/form-data.browser.js
  37. +20 −2 src/add/form-data.js
  38. +26 −6 src/add/index.js
  39. +5 −11 src/bitswap/index.js
  40. +22 −14 src/bitswap/stat.js
  41. +20 −18 src/bitswap/unwant.js
  42. +20 −21 src/bitswap/wantlist.js
  43. +17 −54 src/block/get.js
  44. +6 −22 src/block/index.js
  45. +52 −58 src/block/put.js
  46. +15 −4 src/block/{rm-async-iterator.js → rm.js}
  47. +18 −26 src/block/stat.js
  48. +21 −25 src/bootstrap/add.js
  49. +5 −11 src/bootstrap/index.js
  50. +15 −13 src/bootstrap/list.js
  51. +21 −25 src/bootstrap/rm.js
  52. +4 −4 src/cat.js
  53. +17 −12 src/commands.js
  54. +21 −33 src/config/get.js
  55. +6 −11 src/config/index.js
  56. +9 −12 src/config/profiles/apply.js
  57. +6 −0 src/config/profiles/index.js
  58. +7 −10 src/config/profiles/list.js
  59. +16 −20 src/config/replace.js
  60. +23 −22 src/config/set.js
  61. +23 −51 src/dag/get.js
  62. +5 −10 src/dag/index.js
  63. +37 −55 src/dag/put.js
  64. +31 −0 src/dag/resolve.js
  65. +49 −0 src/dht/find-peer.js
  66. +45 −0 src/dht/find-provs.js
  67. +0 −63 src/dht/findpeer.js
  68. +0 −63 src/dht/findprovs.js
  69. +31 −36 src/dht/get.js
  70. +9 −15 src/dht/index.js
  71. +40 −29 src/dht/provide.js
  72. +43 −20 src/dht/put.js
  73. +31 −37 src/dht/query.js
  74. +15 −13 src/diag/cmds.js
  75. +5 −11 src/diag/index.js
  76. +12 −13 src/diag/net.js
  77. +12 −13 src/diag/sys.js
  78. +16 −19 src/dns.js
  79. +0 −20 src/files-mfs/cp.js
  80. +0 −17 src/files-mfs/flush.js
  81. +0 −23 src/files-mfs/index.js
  82. +0 −12 src/files-mfs/ls-pull-stream.js
  83. +0 −62 src/files-mfs/ls-readable-stream.js
  84. +0 −37 src/files-mfs/ls.js
  85. +0 −18 src/files-mfs/mkdir.js
  86. +0 −20 src/files-mfs/mv.js
  87. +0 −26 src/files-mfs/read-pull-stream.js
  88. +0 −26 src/files-mfs/read-readable-stream.js
  89. +0 −19 src/files-mfs/read.js
  90. +0 −27 src/files-mfs/rm.js
  91. +0 −35 src/files-mfs/stat.js
  92. +0 −42 src/files-mfs/write.js
  93. +0 −100 src/files-regular/index.js
  94. +0 −81 src/files-regular/ls.js
  95. +0 −63 src/files-regular/refs.js
  96. +24 −0 src/files/chmod.js
  97. +25 −0 src/files/cp.js
  98. +27 −0 src/files/flush.js
  99. +15 −0 src/files/index.js
  100. +50 −0 src/files/ls.js
  101. +35 −0 src/files/mkdir.js
  102. +25 −0 src/files/mv.js
  103. +27 −0 src/files/read.js
  104. +22 −0 src/files/rm.js
  105. +39 −0 src/files/stat.js
  106. +28 −0 src/files/touch.js
  107. +6 −8 src/{utils/find-sources.js → files/utils.js}
  108. +47 −0 src/files/write.js
  109. +9 −6 src/get-endpoint-config.js
  110. +21 −15 src/{files-regular → }/get.js
  111. +20 −26 src/id.js
  112. +36 −61 src/index.js
  113. +22 −13 src/key/export.js
  114. +19 −20 src/key/gen.js
  115. +25 −19 src/key/import.js
  116. +8 −14 src/key/index.js
  117. +14 −21 src/key/list.js
  118. +20 −17 src/key/rename.js
  119. +18 −15 src/key/rm.js
  120. +8 −0 src/lib/buffer-to-form-data.browser.js
  121. +33 −0 src/lib/buffer-to-form-data.js
  122. +29 −10 src/lib/configure.js
  123. +0 −20 src/lib/converters.js
  124. +25 −0 src/lib/encode-buffer-uri-component.js
  125. +9 −3 src/lib/error-handler.js
  126. +13 −0 src/lib/mode-to-string.js
  127. +56 −0 src/lib/mtime-to-object.js
  128. +0 −18 src/lib/multiaddr.js
  129. +24 −0 src/lib/object-to-camel-with-metadata.js
  130. +0 −25 src/lib/stream-to-iterable.js
  131. +5 −11 src/log/index.js
  132. +18 −22 src/log/level.js
  133. +14 −13 src/log/ls.js
  134. +16 −16 src/log/tail.js
  135. +85 −0 src/ls.js
  136. +18 −25 src/mount.js
  137. +5 −11 src/name/index.js
  138. +23 −20 src/name/publish.js
  139. +17 −19 src/name/pubsub/cancel.js
  140. +4 −4 src/name/pubsub/index.js
  141. +14 −18 src/name/pubsub/state.js
  142. +13 −16 src/name/pubsub/subs.js
  143. +25 −17 src/name/resolve.js
  144. +0 −35 src/object/addLink.js
  145. +0 −35 src/object/appendData.js
  146. +16 −46 src/object/data.js
  147. +25 −54 src/object/get.js
  148. +9 −20 src/object/index.js
  149. +17 −46 src/object/links.js
  150. +21 −17 src/object/new.js
  151. +25 −0 src/object/patch/add-link.js
  152. +25 −0 src/object/patch/append-data.js
  153. +8 −0 src/object/patch/index.js
  154. +24 −0 src/object/patch/rm-link.js
  155. +25 −0 src/object/patch/set-data.js
  156. +23 −33 src/object/put.js
  157. +0 −35 src/object/rmLink.js
  158. +0 −34 src/object/setData.js
  159. +22 −19 src/object/stat.js
  160. +21 −19 src/pin/add.js
  161. +5 −11 src/pin/index.js
  162. +36 −28 src/pin/ls.js
  163. +20 −19 src/pin/rm.js
  164. +0 −34 src/ping-pull-stream.js
  165. +0 −30 src/ping-readable-stream.js
  166. +24 −57 src/ping.js
  167. +7 −48 src/pubsub/index.js
  168. +1 −1 src/pubsub/ls.js
  169. +1 −1 src/pubsub/peers.js
  170. +1 −23 src/pubsub/publish.js
  171. +3 −3 src/pubsub/subscribe.js
  172. +61 −0 src/refs/index.js
  173. +2 −2 src/{files-regular/refs-local.js → refs/local.js}
  174. +22 −26 src/repo/gc.js
  175. +5 −11 src/repo/index.js
  176. +22 −22 src/repo/stat.js
  177. +16 −16 src/repo/version.js
  178. +23 −52 src/resolve.js
  179. +0 −32 src/stats/bitswap.js
  180. +0 −31 src/stats/bw-pull-stream.js
  181. +0 −31 src/stats/bw-readable-stream.js
  182. +0 −12 src/stats/bw-util.js
  183. +28 −23 src/stats/bw.js
  184. +5 −13 src/stats/index.js
  185. +0 −28 src/stats/repo.js
  186. +12 −8 src/stop.js
  187. +16 −27 src/swarm/addrs.js
  188. +19 −14 src/swarm/connect.js
  189. +19 −14 src/swarm/disconnect.js
  190. +7 −13 src/swarm/index.js
  191. +18 −20 src/swarm/localAddrs.js
  192. +39 −66 src/swarm/peers.js
  193. +11 −36 src/update.js
  194. +0 −17 src/utils/clean-cid.js
  195. +0 −21 src/utils/clean-multihash.js
  196. +0 −13 src/utils/default-config.js
  197. +0 −57 src/utils/load-commands.js
  198. +0 −22 src/utils/module-config.js
  199. +0 −121 src/utils/multipart.js
  200. +0 −23 src/utils/ping-message-converter.js
  201. +0 −27 src/utils/ping-message-stream.js
  202. +0 −153 src/utils/prepare-file.js
  203. +0 −49 src/utils/progress-stream.js
  204. +0 −161 src/utils/send-files-stream.js
  205. +0 −18 src/utils/send-one-file-multiple-results.js
  206. +0 −15 src/utils/send-one-file.js
  207. +0 −239 src/utils/send-request.js
  208. +0 −34 src/utils/stream-to-json-value.js
  209. +0 −18 src/utils/stream-to-value-with-transformer.js
  210. +0 −18 src/utils/stream-to-value.js
  211. +0 −85 src/utils/tar-stream-to-objects.js
  212. +14 −25 src/version.js
  213. +3 −15 test/commands.spec.js
  214. +10 −25 test/constructor.spec.js
  215. +4 −19 test/custom-headers.spec.js
  216. +3 −15 test/dag.spec.js
  217. +3 −15 test/diag.spec.js
  218. +4 −31 test/endpoint-config.spec.js
  219. +0 −6 test/exports.spec.js
  220. +52 −75 test/files-mfs.spec.js
  221. +19 −28 test/get.spec.js
  222. +224 −88 test/interface.spec.js
  223. +3 −16 test/key.spec.js
  224. +10 −3 test/lib.configure.spec.js
  225. +2 −1 test/lib.error-handler.spec.js
  226. +0 −40 test/lib.stream-to-iterable.spec.js
  227. +12 −32 test/log.spec.js
  228. +2 −20 test/node/swarm.js
  229. +9 −111 test/ping.spec.js
  230. +3 −15 test/repo.spec.js
  231. +32 −42 test/request-api.spec.js
  232. +5 −16 test/stats.spec.js
  233. +30 −53 test/sub-modules.spec.js
  234. +0 −16 test/utils/expect-timeout.js
  235. +21 −2 test/utils/factory.js
  236. +0 −89 test/utils/interface-common-factory.js
22 changes: 13 additions & 9 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
'use strict'

const promisify = require('promisify-es6')
const createServer = require('ipfsd-ctl').createServer
const EchoServer = require('interface-ipfs-core/src/utils/echo-http-server')
const server = createServer()
const server = createServer({
host: '127.0.0.1',
port: 43134
}, {
type: 'go',
ipfsHttpModule: require('./'),
ipfsBin: require('go-ipfs-dep').path()
})
const echoServer = EchoServer.createServer()

const echoServerStart = promisify(echoServer.start)
const echoServerStop = promisify(echoServer.stop)
module.exports = {
bundlesize: { maxSize: '246kB' },
bundlesize: { maxSize: '90kB' },
webpack: {
resolve: {
mainFields: ['browser', 'main']
@@ -27,20 +31,20 @@ module.exports = {
},
hooks: {
node: {
pre: () => echoServerStart(),
post: () => echoServerStop()
pre: () => echoServer.start(),
post: () => echoServer.stop()
},
browser: {
pre: () => {
return Promise.all([
server.start(),
echoServerStart()
echoServer.start()
])
},
post: () => {
return Promise.all([
server.stop(),
echoServerStop()
echoServer.stop()
])
}
}
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -35,13 +35,25 @@ jobs:
name: chrome
addons:
chrome: stable
script: npx aegir test -t browser -t webworker
script: npx aegir test -t browser

- stage: test
name: chrome webworker
addons:
chrome: stable
script: npx aegir test -t webworker

- stage: test
name: firefox
addons:
firefox: latest
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
script: npx aegir test -t browser -- --browsers FirefoxHeadless

- stage: test
name: firefox webworker
addons:
firefox: latest
script: npx aegir test -t webworker -- --browsers FirefoxHeadless

- stage: test
name: electron-main
253 changes: 245 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,239 @@
<a name="42.0.0"></a>
# [42.0.0](https://github.com/ipfs/js-ipfs-http-client/compare/v42.0.0-pre.2...v42.0.0) (2020-02-04)

There are significant and breaking API changes in this release. Please see the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26).

### Bug Fixes

* interface tests ([#1233](https://github.com/ipfs/js-ipfs-http-client/issues/1233)) ([d3eee0d](https://github.com/ipfs/js-ipfs-http-client/commit/d3eee0d))

### Features

* `add` results now include `mode` and `mtime` properties if they were set.

* `files.chmod` has been added. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#fileschmod) for info.

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

* `files.ls` results now include `mode` and `mtime` properties if they were set. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#ls) for more info.

* `files.mkdir` now accepts `mode` and `mtime` options to allow setting mode and mtime metadata. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#filesmkdir) for more info.

* `files.stat` result now includes `mode` and `mtime` properties if they were set. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#filesstat) for more info.

* `files.touch` has been added. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#filestouch) for info.

* `files.write` now accepts `mode` and `mtime` options to allow setting mode and mtime metadata. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#fileswrite) for more info.

* `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](https://www.npmjs.com/package/parse-duration).

* `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](https://www.npmjs.com/package/parse-duration).

* `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](https://www.npmjs.com/package/parse-duration).

### BREAKING CHANGES

* Callbacks are no longer supported on any API methods. Please use a utility such as [`callbackify`](https://www.npmjs.com/package/callbackify) on API methods that return Promises to emulate previous behaviour. See the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26#migrating-from-callbacks) 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](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#add) for more info.

* `add` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.

* `addReadableStream`, `addPullStream` have been removed. Please see the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26#migrating-to-async-iterables) 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](https://github.com/ipfs/js-ipfs-http-client#glob-source) 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](https://github.com/ipfs/js-ipfs-http-client#url-source) for more details and an example.

* `bitswap.stat` result has changed - `wantlist` and values are now an array of [CID](https://github.com/multiformats/js-cid) instances and `peers` is now a `string[]` of peer IDs.

* `bitswap.wantlist` now returns an array of [CID](https://github.com/multiformats/js-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](https://github.com/multiformats/js-cid)) 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.lsPullStream` and `files.lsReadableStream` have been removed. Please see the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26#migrating-to-async-iterables) for more info.

* `files.ls` now returns an async iterable.

* `files.ls` results now contain a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.

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

* `files.readPullStream` and `files.readReadableStream` have been removed. Please see the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26#migrating-to-async-iterables) for more info.

* `files.read` now returns an async iterable.

* `files.stat` result now contains a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.

* `get` now returns an async iterable. The `content` property value for objects yielded from the iterator is now an async iterable that yields [`BufferList`](https://github.com/rvagg/bl) 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:

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

* `ls` now returns an async iterable.

* `ls` results now contain a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.

* `ls` results now include `mode` and `mtime` properties if they were set. See the [core interface docs](https://github.com/ipfs/interface-js-ipfs-core/blob/master/SPEC/FILES.md#ls) for more info.

* `pin.add` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.

* `pin.ls` now returns an async iterable.

* `pin.ls` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.

* `pin.rm` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.

* `ping` now returns an async iterable.

* `refs` and `refs.local` now return an async iterable.

* `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.

* 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.



<a name="42.0.0-pre.0"></a>
# [42.0.0-pre.0](https://github.com/ipfs/js-ipfs-http-client/compare/v41.0.1...v42.0.0-pre.0) (2020-01-23)



<a name="41.0.1"></a>
## [41.0.1](https://github.com/ipfs/js-ipfs-http-client/compare/v41.0.0...v41.0.1) (2020-01-23)



<a name="41.0.0"></a>
# [41.0.0](https://github.com/ipfs/js-ipfs-http-client/compare/v40.2.1...v41.0.0) (2020-01-12)


### Bug Fixes

* return CIDs from files.flush ([#1216](https://github.com/ipfs/js-ipfs-http-client/issues/1216)) ([13f8d7a](https://github.com/ipfs/js-ipfs-http-client/commit/13f8d7a))


### Code Refactoring

* removes format option ([#1218](https://github.com/ipfs/js-ipfs-http-client/issues/1218)) ([4ef26cd](https://github.com/ipfs/js-ipfs-http-client/commit/4ef26cd))


### BREAKING CHANGES

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

Follows on from https://github.com/ipfs/js-ipfs-mfs/pull/69



<a name="40.2.1"></a>
## [40.2.1](https://github.com/ipfs/js-ipfs-http-client/compare/v40.2.0...v40.2.1) (2020-01-09)



<a name="40.2.0"></a>
# [40.2.0](https://github.com/ipfs/js-ipfs-http-client/compare/v40.1.0...v40.2.0) (2020-01-09)


### Features

* support UnixFSv1.5 metadata ([#1186](https://github.com/ipfs/js-ipfs-http-client/issues/1186)) ([da9d17a](https://github.com/ipfs/js-ipfs-http-client/commit/da9d17a))



<a name="40.1.0"></a>
# [40.1.0](https://github.com/ipfs/js-ipfs-http-client/compare/v40.0.1...v40.1.0) (2019-12-10)


### Features

* expose import concurrency controls ([#1187](https://github.com/ipfs/js-ipfs-http-client/issues/1187)) ([47093d5](https://github.com/ipfs/js-ipfs-http-client/commit/47093d5))



<a name="40.0.1"></a>
## [40.0.1](https://github.com/ipfs/js-ipfs-http-client/compare/v40.0.0...v40.0.1) (2019-11-27)


### Bug Fixes

* pin ls with multiple CIDs ([#1184](https://github.com/ipfs/js-ipfs-http-client/issues/1184)) ([2f3763f](https://github.com/ipfs/js-ipfs-http-client/commit/2f3763f))



<a name="40.0.0"></a>
# [40.0.0](https://github.com/ipfs/js-ipfs-http-client/compare/v39.0.2...v40.0.0) (2019-11-22)


### Code Refactoring

* async await roundup ([#1173](https://github.com/ipfs/js-ipfs-http-client/issues/1173)) ([3e5967a](https://github.com/ipfs/js-ipfs-http-client/commit/3e5967a)), closes [#1103](https://github.com/ipfs/js-ipfs-http-client/issues/1103)
* convert config API to async await ([#1155](https://github.com/ipfs/js-ipfs-http-client/issues/1155)) ([621973c](https://github.com/ipfs/js-ipfs-http-client/commit/621973c))
* move files to root level ([#1150](https://github.com/ipfs/js-ipfs-http-client/issues/1150)) ([559a97d](https://github.com/ipfs/js-ipfs-http-client/commit/559a97d))


### Features

* support name.resolve of peerid as cid ([#1145](https://github.com/ipfs/js-ipfs-http-client/issues/1145)) ([2d9afc8](https://github.com/ipfs/js-ipfs-http-client/commit/2d9afc8))


### Reverts

* chore: update multiaddr to version 7.2.0 ([#1136](https://github.com/ipfs/js-ipfs-http-client/issues/1136)) ([#1143](https://github.com/ipfs/js-ipfs-http-client/issues/1143)) ([4131d09](https://github.com/ipfs/js-ipfs-http-client/commit/4131d09))


### BREAKING CHANGES

* The `log.tail` method now returns an async iterator that yields log messages. Use it like:
```js
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 e.g. /ip4/127.0.0.1/tcp/5001
* URL e.g. http://127.0.0.1:5001
* [Multiaddr](https://www.npmjs.com/package/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 [`HTTPError`](https://github.com/sindresorhus/ky/blob/c0d9d2bb07e4c122a08f019b39e9c55a4c9324f3/index.js#L117-L123)s which carry a `response` property. This is a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/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`](https://github.com/ipfs/interface-js-ipfs-core/tree/master/SPEC) docs. e.g. the `allow-offline` option to `name.publish` should be passed as `allowOffline`.
* Note that you can pass [additional query string parameters](https://github.com/ipfs/js-ipfs-http-client#additional-options) in the `searchParams` option available to all API methods.



<a name="39.0.2"></a>
## [39.0.2](https://github.com/ipfs/js-ipfs-http-client/compare/v39.0.1...v39.0.2) (2019-10-23)

@@ -51,16 +287,15 @@

### BREAKING CHANGES

* ```javascript
Promise<{oldCfg, newCfg}> ipfs.config.profile(name, opts)

// is now
Promise<{old, new}> ipfs.config.profiles.apply(name, opts)
```
* Configuration profiles API has changed:
```javascript
Promise<{oldCfg, newCfg}> ipfs.config.profile(name, opts)

Possibly contentious;
// is now
Promise<{old, new}> ipfs.config.profiles.apply(name, opts)
```

Adds `callbackify` as a dependency, see https://github.com/ipfs/js-ipfs/issues/2506
* Possibly contentious; Adds `callbackify` as a dependency, see https://github.com/ipfs/js-ipfs/issues/2506
for discussion.


@@ -138,7 +373,9 @@ for discussion.
<a name="35.0.0"></a>
# [35.0.0](https://github.com/ipfs/js-ipfs-http-client/compare/v34.0.0...v35.0.0) (2019-09-04)

### BREAKING CHANGES

Kebab case options (e.g. `wrap-with-directory`) are no longer supported in `ipfs.add`. Use camel case instead (e.g. `wrapWithDirectory`).

<a name="34.0.0"></a>
# [34.0.0](https://github.com/ipfs/js-ipfs-http-client/compare/v33.1.1...v34.0.0) (2019-08-29)
5 changes: 5 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This project is transitioning from an MIT-only license to a dual MIT/Apache-2.0 license.
Unless otherwise noted, all code contributed prior to 2019-11-26 and not contributed by
a user listed in [this signoff issue](https://github.com/ipfs/js-ipfs-http-client/issues/1189) is
licensed under MIT-only. All new contributions (and past contributions since 2019-11-29)
are licensed under a dual MIT/Apache-2.0 license.
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
File renamed without changes.
Loading