Giter VIP home page Giter VIP logo

js-pinning-service-http-client's Introduction

IPFS Pinning Service API Client for JS

This client was generated using OpenAPI Generator from the IPFS Pinning Service API spec.

You can see the commands used to generate the client in the gen:fetch npm script.

Usage

npm install @ipfs-shipyard/pinning-service-client --save

This client only has a programmatic API at the moment (no CLI). You use it like so:

import { Configuration, RemotePinningServiceClient, Status } from '@ipfs-shipyard/pinning-service-client'
import type { PinsGetRequest, PinResults } from '@ipfs-shipyard/pinning-service-client'

const config = new Configuration({
  endpointUrl, // the URI for your pinning provider, e.g. `http://localhost:3000`
  accessToken, // the secret token/key given to you by your pinning provider
  // fetchApi: fetch, // You can pass your own fetchApi implementation, but we use fetch-ponyfill by default.
})

const client = new RemotePinningServiceClient(config)

(async () => {
  // Get 10 failed Pins
  const pinsGetOptions: PinsGetRequest = {
    limit: 10,
    status: new Set([Status.Failed]) // requires a set, and not an array
  }
  const {count, results}: PinResults = await client.pinsGet(pinsGetOptions)

  console.log(count, results)

})()

Developing

Building

To build and compile the typescript sources to javascript use:

npm install
npm run build

Contributing

See CONTRIBUTING.md.

Publishing

First build the package then run npm publish

License

Licensed under either of

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

js-pinning-service-http-client's People

Contributors

dependabot[bot] avatar lidel avatar semantic-release-bot avatar sgtpooki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

woss parajbs

js-pinning-service-http-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.