You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'importtype{PinsGetRequest,PinResults}from'@ipfs-shipyard/pinning-service-client'constconfig=newConfiguration({
endpointUrl,// the URI for your pinning provider, e.g. `https://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 NodeJS fetch by default.})constclient=newRemotePinningServiceClient(config)(async()=>{// Get 10 failed PinsconstpinsGetOptions: PinsGetRequest={limit: 10,status: [Status.Failed]}const{count, results}: PinResults=awaitclient.pinsGet(pinsGetOptions)console.log(count,results)})()
Developing
Building
To build and compile the typescript sources to javascript use:
npm install
npm run build
Updating the generated client
To update the client, you need to npm run gen npm script. This will fetch the latest version of the OpenAPI spec and generate the client. However, openapi-generator-cli does not currently generate the client code with proper import syntax. So you must modify the imports in generated/fetch/** directly, or just git checkout -p to remove the invalid import path changes.
It also uses Sets for all collection types though it cannot serialize or deserialize these types to/from JSON. They must be manually changed to be Arrays.
If you need to modify the generated code's import paths, you will have to run npm run postgen manually.
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.
About
An IPFS Pinning Service HTTP Client for TypeScript / Javascript