From c6c4c19b954db9c0899887220d4ec8d267f74001 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Feb 2020 04:43:22 -0500 Subject: [PATCH 1/5] fix: return iterables from pin add and pin rm --- package.json | 2 +- src/pin/add.js | 4 ++-- src/pin/rm.js | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a7a635e9a..e189a5214 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "async": "^3.1.0", "browser-process-platform": "~0.1.1", "go-ipfs-dep": "^0.4.23-3", - "interface-ipfs-core": "^0.131.7", + "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..b2a041f4d 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 * (path, 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) })) } }) From 56a1705f55e6717e857d2550a9ed51bfe55af70d Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Feb 2020 06:17:18 -0500 Subject: [PATCH 2/5] fix: rename arg --- src/pin/rm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pin/rm.js b/src/pin/rm.js index b2a041f4d..0a2d46a22 100644 --- a/src/pin/rm.js +++ b/src/pin/rm.js @@ -4,7 +4,7 @@ const CID = require('cids') const configure = require('../lib/configure') module.exports = configure(({ ky }) => { - return async function * (path, options) { + return async function * (paths, options) { paths = Array.isArray(paths) ? paths : [paths] options = options || {} From 97c44841254b16a330dfd0c74617984f943780fe Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Feb 2020 12:49:34 -0500 Subject: [PATCH 3/5] chore: pin go dep version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e189a5214..6d8b4fac4 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "aegir": "^20.4.1", "async": "^3.1.0", "browser-process-platform": "~0.1.1", - "go-ipfs-dep": "^0.4.23-3", + "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", From 88b659b32c4c46127d966a0a4071c8138708467e Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Feb 2020 13:14:14 -0500 Subject: [PATCH 4/5] chore: use specific commit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d8b4fac4..54fa60864 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": "github:ipfs/interface-js-ipfs-core#store-pins-in-datastore", + "go-ipfs-dep": " 0.4.23-3", + "interface-ipfs-core": "github:ipfs/interface-js-ipfs-core#5b15bc12c1c2ddb3276949436f31906a5e247d03", "ipfsd-ctl": "^3.0.0", "it-all": "^1.0.1", "it-concat": "^1.0.0", From 277585ba0b2740434d377a7a821fa71b9210d1cb Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Feb 2020 15:49:55 -0500 Subject: [PATCH 5/5] chore: remove whitespace --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 54fa60864..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": "github:ipfs/interface-js-ipfs-core#5b15bc12c1c2ddb3276949436f31906a5e247d03", + "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",