-
Notifications
You must be signed in to change notification settings - Fork 297
feat: add methods for listing config profiles #1119
Conversation
New method: ```javascript Promise<Array<{ name, description }>> ipfs.config.profiles.list() ``` BREAKING CHANGE: ```javascript Promise<{oldCfg, newCfg}> ipfs.config.profile(name, opts) // is now Promise<{old, new}> ipfs.config.profiles.apply(name, opts) ``` Possibly contentious; Adds `callbackify` as a dependency, see ipfs/js-ipfs#2506 for discussion.
src/config/profiles/list.js
Outdated
timeout: options.timeout, | ||
signal: options.signal, | ||
headers: options.headers, | ||
searchParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just pass an object { 'stream-channels': true } ky will do the rest, no need to manually instantiate URLSearchParams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I just copy/pasted that from ipfs.add
..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, you can only set strings or numbers as values if you use a plain object (e.g. no booleans), otherwise you get:
Error: The `searchParams` option must be either a string, `URLSearchParams` instance or an object with string and number values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like they're going to fix this in [email protected]
New method:
BREAKING CHANGE:
Possibly contentious:
Adds
callbackify
as a dependency, see ipfs/js-ipfs#2506 for discussion.Depends on: