Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

feat: add methods for listing config profiles #1119

Merged
merged 5 commits into from
Oct 4, 2019

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Oct 3, 2019

New method:

Promise<Array<{ name, description }>> ipfs.config.profiles.list()

BREAKING CHANGE:

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.

Depends on:

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.
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
searchParams
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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 ky@0.16.0

@achingbrain achingbrain merged commit 333c575 into master Oct 4, 2019
@achingbrain achingbrain deleted the add-listing-config-profiles branch October 4, 2019 14:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants