Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

refactor: files API #1720

Merged
merged 11 commits into from
Nov 20, 2018
Merged

refactor: files API #1720

merged 11 commits into from
Nov 20, 2018

Conversation

alanshaw
Copy link
Member

This is a merge of #1671 #1702 and #1719 allowing the files API changes to work with the ipld-dag-pb changes.

ipfs.addFrom* methods will be implemented in a separate PR.

BREAKING CHANGE: Files API methods add*, cat*, get* have moved from files to the root namespace.

Specifically, the following changes have been made:

  • ipfs.files.add => ipfs.add
  • ipfs.files.addPullStream => ipfs.addPullStream
  • ipfs.files.addReadableStream => ipfs.addReadableStream
  • ipfs.files.cat => ipfs.cat
  • ipfs.files.catPullStream => ipfs.catPullStream
  • ipfs.files.catReadableStream => ipfs.catReadableStream
  • ipfs.files.get => ipfs.get
  • ipfs.files.getPullStream => ipfs.getPullStream
  • ipfs.files.getReadableStream => ipfs.getReadableStream

closes #1671
closes #1702
closes #1719

@ghost ghost assigned alanshaw Nov 19, 2018
@ghost ghost added the status/in-progress In progress label Nov 19, 2018
Alan Shaw added 3 commits November 20, 2018 09:18
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
@alanshaw alanshaw merged commit a82a5dc into master Nov 20, 2018
@ghost ghost removed the status/in-progress In progress label Nov 20, 2018
@alanshaw alanshaw deleted the refactor/files-api branch November 20, 2018 14:30
@daviddias
Copy link
Member

@dsmith3210
Copy link

I agree that this is quite a breaking change. What do you think about a backwards-compatibility shim for a few versions with a DEPRECATED warning?

Also, there are a few missed references that I ran into while investigating an unrelated issue:

node.files.add([Buffer.from(stringToUse)], (err, filesAdded) => {

node.files.cat(hash, (err, data) => {

node.files.add(Buffer.from(toStore), (err, res) => {

node.files.cat(hash, (err, data) => {

@alanshaw
Copy link
Member Author

alanshaw commented Dec 4, 2018

@dsmith3210 missed refs fixed in #1740

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.

4 participants