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: v35.0.0
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: v35.1.0
Choose a head ref
  • 3 commits
  • 6 files changed
  • 2 contributors

Commits on Sep 4, 2019

  1. feat: add config profile endpoint (#1030)

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    dirkmc authored and Alan Shaw committed Sep 4, 2019
    Copy the full SHA
    3aaa3ee View commit details
  2. chore: update contributors

    Alan Shaw committed Sep 4, 2019

    Unverified

    No user is associated with the committer email.
    Copy the full SHA
    832022b View commit details
  3. chore: release version v35.1.0

    Alan Shaw committed Sep 4, 2019

    Unverified

    No user is associated with the committer email.
    Copy the full SHA
    fadc601 View commit details
Showing with 55 additions and 7 deletions.
  1. +10 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +2 −1 src/config/index.js
  4. +41 −0 src/config/profile.js
  5. +0 −5 test/interface.spec.js
  6. +1 −0 test/sub-modules.spec.js
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="35.1.0"></a>
# [35.1.0](https://github.com/ipfs/js-ipfs-http-client/compare/v35.0.0...v35.1.0) (2019-09-04)


### Features

* add config profile endpoint ([#1030](https://github.com/ipfs/js-ipfs-http-client/issues/1030)) ([3aaa3ee](https://github.com/ipfs/js-ipfs-http-client/commit/3aaa3ee))



<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)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipfs-http-client",
"version": "35.0.0",
"version": "35.1.0",
"description": "A client library for the IPFS HTTP API",
"keywords": [
"ipfs"
3 changes: 2 additions & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ module.exports = (arg) => {
return {
get: require('./get')(send),
set: require('./set')(send),
replace: require('./replace')(send)
replace: require('./replace')(send),
profile: require('./profile')(send)
}
}
41 changes: 41 additions & 0 deletions src/config/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict'

const promisify = require('promisify-es6')

const toObject = function (res, callback) {
if (Buffer.isBuffer(res)) {
callback(null, JSON.parse(res.toString()))
} else {
callback(null, res)
}
}

module.exports = (send) => {
return promisify((profile, opts, callback) => {
if (typeof opts === 'function') {
callback = opts
opts = {}
}

opts = normalizeOpts(opts)

send.andTransform({
path: 'config/profile/apply',
args: profile,
qs: opts
}, toObject, (err, response) => {
if (err) {
return callback(err)
}
callback(null, { oldCfg: response.OldCfg, newCfg: response.NewCfg })
})
})
}

function normalizeOpts (opts) {
opts = opts || {}
if (typeof opts.dryRun !== 'undefined') {
opts['dry-run'] = opts.dryRun
}
return opts
}
5 changes: 0 additions & 5 deletions test/interface.spec.js
Original file line number Diff line number Diff line change
@@ -49,11 +49,6 @@ describe('interface-ipfs-core tests', () => {
{
name: 'replace',
reason: 'FIXME Waiting for fix on go-ipfs https://github.com/ipfs/js-ipfs-http-client/pull/307#discussion_r69281789 and https://github.com/ipfs/go-ipfs/issues/2927'
},
// config.profile
{
name: 'profile',
reason: 'TODO not yet implemented https://github.com/ipfs/js-ipfs-http-client/pull/1030'
}
]
})
1 change: 1 addition & 0 deletions test/sub-modules.spec.js
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ describe('submodules', () => {
expect(cfg.get).to.be.a('function')
expect(cfg.set).to.be.a('function')
expect(cfg.replace).to.be.a('function')
expect(cfg.profile).to.be.a('function')
})

it('dht', () => {