diff --git a/package.json b/package.json index a7a635e9a..6d8b4fac4 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "aegir": "^20.4.1", "async": "^3.1.0", "browser-process-platform": "~0.1.1", - "go-ipfs-dep": "^0.4.23-3", - "interface-ipfs-core": "^0.131.7", + "go-ipfs-dep": "0.4.23-3", + "interface-ipfs-core": "github:ipfs/interface-js-ipfs-core#store-pins-in-datastore", "ipfsd-ctl": "^3.0.0", "it-all": "^1.0.1", "it-concat": "^1.0.0", diff --git a/src/pin/add.js b/src/pin/add.js index 41b119fe8..b42cbb03f 100644 --- a/src/pin/add.js +++ b/src/pin/add.js @@ -4,7 +4,7 @@ const CID = require('cids') const configure = require('../lib/configure') module.exports = configure(({ ky }) => { - return async (paths, options) => { + return async function * (paths, options) { paths = Array.isArray(paths) ? paths : [paths] options = options || {} @@ -19,6 +19,6 @@ module.exports = configure(({ ky }) => { searchParams }).json() - return (res.Pins || []).map(cid => ({ cid: new CID(cid) })) + yield * (res.Pins || []).map(cid => ({ cid: new CID(cid) })) } }) diff --git a/src/pin/rm.js b/src/pin/rm.js index 83fbca93c..0a2d46a22 100644 --- a/src/pin/rm.js +++ b/src/pin/rm.js @@ -4,11 +4,12 @@ const CID = require('cids') const configure = require('../lib/configure') module.exports = configure(({ ky }) => { - return async (path, options) => { + return async function * (paths, options) { + paths = Array.isArray(paths) ? paths : [paths] options = options || {} const searchParams = new URLSearchParams(options.searchParams) - searchParams.set('arg', `${path}`) + paths.forEach(path => searchParams.append('arg', `${path}`)) if (options.recursive != null) searchParams.set('recursive', options.recursive) const res = await ky.post('pin/rm', { @@ -18,6 +19,6 @@ module.exports = configure(({ ky }) => { searchParams }).json() - return (res.Pins || []).map(cid => ({ cid: new CID(cid) })) + yield * (res.Pins || []).map(cid => ({ cid: new CID(cid) })) } })