Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ipfs-shipyard/pinning-service-client

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipfs-shipyard/pinning-service-client

A lightweight client generated from the ipfs-pinning-service-spec defined at https://raw.githubusercontent.com/ipfs/pinning-services-api-spec/main/ipfs-pinning-service.yaml

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67
increased by17.54%
Maintainers
2
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 15 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc