js-ipfs icon indicating copy to clipboard operation
js-ipfs copied to clipboard

ipfs-core-types doesn't match ipfs-http-client

Open ple1n opened this issue 3 years ago • 1 comments

Severity:

Very Low

Description:

Typing doesn't match HTTP API return values

Steps to reproduce the error:

commands of ipfs-http-client

import {CID, create} from 'ipfs-http-client'


const ipfs = create()

async function a() {
    console.log(await ipfs.commands())
}

a()

It returns

{
  Name: 'ipfs',
  Subcommands: [
    { Name: 'block', Subcommands: [Array], Options: [] },
    { Name: 'key', Subcommands: [Array], Options: [] },
    { Name: 'refs', Subcommands: [Array], Options: [Array] },
    { Name: 'filestore', Subcommands: [Array], Options: [] },
    { Name: 'config', Subcommands: [Array], Options: [Array] },
    { Name: 'p2p', Subcommands: [Array], Options: [] },
    { Name: 'cat', Subcommands: [], Options: [Array] },
    { Name: 'dns', Subcommands: [], Options: [Array] },
    { Name: 'ls', Subcommands: [], Options: [Array] },
    { Name: 'mount', Subcommands: [], Options: [Array] },
    { Name: 'swarm', Subcommands: [Array], Options: [] },
    { Name: 'tar', Subcommands: [Array], Options: [] },
    { Name: 'version', Subcommands: [Array], Options: [Array] },
    { Name: 'multibase', Subcommands: [Array], Options: [] },
    { Name: 'add', Subcommands: [], Options: [Array] },
    { Name: 'id', Subcommands: [], Options: [Array] },
    { Name: 'resolve', Subcommands: [], Options: [Array] },
    { Name: 'shutdown', Subcommands: [], Options: [] },
    { Name: 'repo', Subcommands: [Array], Options: [] },
    { Name: 'dht', Subcommands: [Array], Options: [] },
    { Name: 'name', Subcommands: [Array], Options: [] },
    { Name: 'update', Subcommands: [], Options: [] },
    { Name: 'pubsub', Subcommands: [Array], Options: [] },
    { Name: 'stats', Subcommands: [Array], Options: [] },
    { Name: 'diag', Subcommands: [Array], Options: [] },
    { Name: 'pin', Subcommands: [Array], Options: [] },
    { Name: 'file', Subcommands: [Array], Options: [] },
    { Name: 'bitswap', Subcommands: [Array], Options: [] },
    { Name: 'dag', Subcommands: [Array], Options: [] },
    { Name: 'log', Subcommands: [Array], Options: [] },
    { Name: 'commands', Subcommands: [Array], Options: [Array] },
    { Name: 'files', Subcommands: [Array], Options: [Array] },
    { Name: 'get', Subcommands: [], Options: [Array] },
    { Name: 'bootstrap', Subcommands: [Array], Options: [] },
    { Name: 'object', Subcommands: [Array], Options: [] },
    { Name: 'ping', Subcommands: [], Options: [Array] },
    { Name: 'urlstore', Subcommands: [Array], Options: [] },
    { Name: 'cid', Subcommands: [Array], Options: [] }
  ],
  Options: [
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] },
    { Names: [Array] }
  ]
}

but the typing is

  commands: (options?: AbortOptions & OptionExtension) => Promise<string[]>

ple1n avatar Mar 24 '22 02:03 ple1n

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

welcome[bot] avatar Mar 24 '22 02:03 welcome[bot]

js-ipfs is being deprecated in favor of Helia. You can https://github.com/ipfs/js-ipfs/issues/4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see https://github.com/ipfs/js-ipfs/issues/4336).

There is no ipfs-http-client in Helia, but you can use kubo-rpc-client if you're trying to talk to Kubo nodes!

SgtPooki avatar May 26 '23 19:05 SgtPooki