From 670816634b8e4e23ec033706ddbf1adbb1e2d2e2 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 10 Jan 2020 17:23:00 +0000 Subject: [PATCH 1/2] fix: return CIDs from files.flush --- package.json | 2 +- src/files/flush.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 901ca797f..e20a6b76c 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": "ipfs/interface-js-ipfs-core#update-mfs-flush", "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 ab2062387..34e725814 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) } }) From 26224d35039392964abb89d1c688b92e726a16df Mon Sep 17 00:00:00 2001 From: achingbrain Date: Sat, 11 Jan 2020 21:34:10 +0100 Subject: [PATCH 2/2] chore: remove gh url --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e20a6b76c..416066e32 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": "ipfs/interface-js-ipfs-core#update-mfs-flush", + "interface-ipfs-core": "^0.127.0", "ipfsd-ctl": "^1.0.0", "ndjson": "^1.5.0", "nock": "^11.4.0",