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

refactor: object APIs write methods now return CIDs #1730

Merged
merged 10 commits into from
Nov 28, 2018

Commits on Nov 26, 2018

  1. fix: better input validation for add

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 26, 2018
    Configuration menu
    Copy the full SHA
    c0bb784 View commit details
    Browse the repository at this point in the history
  2. chore: update interface-ipfs-core dependency

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 26, 2018
    Configuration menu
    Copy the full SHA
    f23eda9 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2018

  1. refactor: object APIs write methods now return CIDs

    For the back story on this change, please see: ipfs-inactive/interface-js-ipfs-core#388 (review)
    
    BREAKING CHANGE: Object API refactor.
    
    Object API methods that write DAG nodes now return a [CID](https://www.npmjs.com/package/cids) instead of a DAG node. Affected methods:
    
    * `ipfs.object.new`
    * `ipfs.object.patch.addLink`
    * `ipfs.object.patch.appendData`
    * `ipfs.object.patch.rmLink`
    * `ipfs.object.patch.setData`
    * `ipfs.object.put`
    
    Example:
    
    ```js
    // Before
    const dagNode = await ipfs.object.new()
    ```
    
    ```js
    // After
    const cid = await ipfs.object.new() // now returns a CID
    const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created
    ```
    
    IMPORTANT: `DAGNode` instances, which are part of the IPLD dag-pb format have been refactored.
    
    These instances no longer have `multihash`, `cid` or `serialized` properties.
    
    This effects the following API methods that return these types of objects:
    
    * `ipfs.object.get`
    * `ipfs.dag.get`
    
    See ipld/js-ipld-dag-pb#99 for more information.
    
    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 27, 2018
    Configuration menu
    Copy the full SHA
    bdc6f4d View commit details
    Browse the repository at this point in the history
  2. refactor: object API in CLI

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 27, 2018
    Configuration menu
    Copy the full SHA
    d6bc706 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2018

  1. chore: use latest ipfs-http-client

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    4a8cba2 View commit details
    Browse the repository at this point in the history
  2. chore: update ipfsd-ctl dependency

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    9fffa2f View commit details
    Browse the repository at this point in the history
  3. chore: update ipfsd-ctl dependency

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    2702aea View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    680ebc7 View commit details
    Browse the repository at this point in the history
  5. fix: tests

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    0fc03c3 View commit details
    Browse the repository at this point in the history
  6. fix: more test fix

    License: MIT
    Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
    Alan Shaw committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    a1bac03 View commit details
    Browse the repository at this point in the history