npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zeeve-zdfs-sdk

v1.0.2

Published

NodeJS SDK for intracting with Zeeve's ZDFS service.

Downloads

3

Readme

Zeeve ZDFS SDK

Offical ZDFS NodeJS SDK from Zeeve.

Overview

NodeJS based rapid development kit to allow you to build applications faster with seamless integration available without the need of writing the bloatware code repeatedly. Hence, saving a lot of precious time and cost.

Installation

npm install --save zeeve-zdfs-sdk

Setup

You need to create Pinning Service and Data APIs SDK instances with your endpoint and access token. Configure endpoint based on the gateway. Please read how to create access key.

  • Shared Gatway Endpoint: https://app.zeeve.io/zdfs-api
  • Dedicated Gatway Endpoint: https://app.zeeve.io/zdfs-api/YOUR_DEDICATED_GATEWAY_KEY
/** import zeeve zdfs sdk */
import { PSAV1Api, DataV1Api } from 'zeeve-zdfs-sdk';
/** create instance of pinning service api version 1 */
const psaApi = new PSAV1Api(YOUR_ENDPOINT, YOUR_ACCESS_TOKEN);
/** create instance of data api version 1 */
const dataApi = new DataV1Api(YOUR_ENDPOINT, YOUR_ACCESS_TOKEN);

Usage

Once you done with the setup part, now it becomes so easy to integrate ZDFS service. Now you just need to call any of the following functions to perform desired operations.

addPinObject

Add a new pin object for the current access token. User can add name, origions and meta data associated to the CID object using this function.

psaApi.addPinObject(cid, name, origins, meta, headers)
Params
  • cid - A string of valid IPFS Content Identifier (CID).
  • name (optional) - A name that ZDFS will associate with this particular CID hash.
  • origins (optional) - A list of multiaddrs known to provide the data.
  • meta (optional)- A JSON object with the updated keyvalues you want associated with the CID hash provided.
  • headers (optional)- An extra http request headers.

getPinObject

Get a pin object details and it's status using the current access token.

psaApi.getPinObject(requestID, headers)
Params
  • requestID - A string of valid UUID or you can say fileID provided by ZDFS.
  • headers (optional)- An extra http request headers.

listPinObjects

List all the pin objects associated to the access token, matching optionall filters when no filter is provided, only successful pins are returned.

psaApi.listPinObjects(cid, name, match, status, before, after, limit, headers)
Params
  • cid (optional) - Return pin object of specified valid IPFS CID.
  • name (optional)- Return pin objects of the specified name (by default a case-sensitive, exact match).
  • match (optional)- To customize the text matching strategy applied when the name filter is present. Default: "exact". Options: "exact" "iexact" "partial" "ipartial".
  • status (optional) - Return pin objects of the specified status array string. Default: "pinned", Options: "queued" "pinning" "pinned" "failed".
  • before (optional) - Return pin objects created before the provided timestamp. Example: "2022-09-29T00:00:00.000Z".
  • after (optional) - Return pin objects created after the provided timestamp. Example: "2022-09-29T00:00:00.000Z".
  • limit (optional) - Number of records limit. Default: 10.
  • headers (optional)- An extra http request headers.

replacePinObject

Replace an existing pin object associated with the access token (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins).

psaApi.replacePinObject(requestID, cid, name, origins, meta, headers)
Params
  • requestID - A string of valid UUID or you can say fileID provided by ZDFS.
  • cid - A string of valid IPFS Content Identifier (CID) of object by which you want to replace the current pinned object.
  • name (optional) - A name that ZDFS will associate with this particular CID hash.
  • origins (optional) - A list of multiaddrs known to provide the data.
  • meta (optional)- A JSON object with the updated keyvalues you want associated with the CID hash provided.
  • headers (optional)- An extra http request headers.

removePinObject

Remove a pin object associated to the access token.

psaApi.removePinObject(requestID, headers)
Params
  • requestID - A string of valid UUID or you can say fileID provided by ZDFS.
  • headers (optional)- An extra http request headers.

uploadFile

Upload a file to the IPFS gateway.

dataApi.uploadFile(path, name, headers)
Params
  • path - An absolute path of the file.
  • name - A name that ZDFS will associate with this particular file.
  • headers (optional)- An extra http request headers.

uploadDirectory

Upload a directory/folder to the IPFS gateway.

dataApi.uploadDirectory(path, name, headers)
Params
  • path - An absolute path of the directory/folder.
  • name - A name that ZDFS will associate with this particular directory/folder.
  • headers (optional)- An extra http request headers.

uploadCID

Upload a file/folder using IPFS hash CID to the IPFS gateway.

dataApi.uploadCID(fileCID, fileName, headers)
Params
  • fileCID - A string of valid IPFS Content Identifier (CID).
  • fileName - A name that ZDFS will associate with this particular directory/folder.
  • headers (optional)- An extra http request headers.

viewFileByFileID

View the file detail of the already upload content on ZDFS.

dataApi.viewFileByFileID(fileID, headers)
Params
  • fileID - A string of valid UUID or requestID provided by ZDFS by using its fileID(or you can say requestID provided by ZDFS).
  • headers (optional)- An extra http request headers.

editFileByFileID

Edit the file detail of the already upload content on ZDFS by using its fileID(or you can say requestID provided by ZDFS).

dataApi.editFileByFileID(fileID, fileName, fileMetadata, headers)
Params
  • fileID - A string of valid UUID or requestID provided by ZDFS.
  • fileName - A name that ZDFS will associate with this particular file.
  • fileMetadata - An array of keyvalues you want associated with the the fileID.
  • headers (optional)- An extra http request headers.

fileList

List all the uploaded files on ZDFS based on the optional parameters.

dataApi.fileList(page, size, fileCIDs, fileName, match, status, before, after, headers)
Params
  • page (optional) - Return records for a particular page. Default: 1
  • size (optional) - Return specified number of records per page. Default: 10
  • fileCIDs (optional) - Return files of the specified array of valid IFPS CID.
  • fileName - Return files of the specified name (by default a case-sensitive, exact match).
  • match - To customize the text matching strategy applied when the name filter is present. Default: "exact". Options: "exact" "iexact" "partial" "ipartial"
  • status (optional) - Return files of the specified status array string. Options: "queued" "pinning" "pinned" "unpinning" "unpinned" "failed". Default: All Status.
  • before (optional) - Return files created before the provided timestamp. Example: "2022-09-29T00:00:00.000Z".
  • after (optional) - Return files created after the provided timestamp. Example: "2022-09-29T00:00:00.000Z".
  • headers (optional)- An extra http request headers.

pinByFileID

Pin the already uploaded content on ZDFS by using its fileID(or you can say requestID provided by ZDFS).

dataApi.pinByFileID(fileID, headers)
Params
  • fileID - A string of valid UUID or requestID provided by ZDFS.
  • headers (optional)- An extra http request headers.

unpinByFileID

Unpin the already uploaded content on ZDFS by using its fileID(or you can say requestID provided by ZDFS).

dataApi.unpinByFileID(fileID, headers)
Params
  • fileID - A string of valid UUID or requestID provided by ZDFS.
  • headers (optional)- An extra http request headers.

deleteByFileIDs

Delete multiple files from ZDFS by using its fileID(or you can say requestID provided by ZDFS).

dataApi.deleteByFileIDs(fileIDs, headers)
Params
  • fileIDs - An array of string of valid UUID or requestID provided by ZDFS.
  • headers (optional)- An extra http request headers.