diff --git a/package.json b/package.json index 901ca797f9..416066e328 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "cross-env": "^6.0.0", "detect-node": "^2.0.4", "go-ipfs-dep": "^0.4.22", - "interface-ipfs-core": "^0.126.0", + "interface-ipfs-core": "^0.127.0", "ipfsd-ctl": "^1.0.0", "ndjson": "^1.5.0", "nock": "^11.4.0", diff --git a/src/files/flush.js b/src/files/flush.js index ab20623878..34e7258146 100644 --- a/src/files/flush.js +++ b/src/files/flush.js @@ -1,6 +1,7 @@ 'use strict' const configure = require('../lib/configure') +const CID = require('cids') module.exports = configure(({ ky }) => { return async (path, options) => { @@ -14,11 +15,13 @@ module.exports = configure(({ ky }) => { const searchParams = new URLSearchParams(options.searchParams) searchParams.set('arg', path) - await ky.post('files/flush', { + const res = await ky.post('files/flush', { timeout: options.timeout, signal: options.signal, headers: options.headers, searchParams - }).text() + }).json() + + return new CID(res.Cid) } })