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

zenkitsdk

v1.0.3

Published

An unofficial NodeJs client for Zenkit's API

Downloads

9

Readme

ZenkitSDK

Actions Status codecov

An unofficial NodeJs client to interact with the Zenkit api. It's functionality is limited to what I needed for the Zenkit-Alexa skill, but I'll be expanding it as I find more usecases - and I accept pull requests!

It should be fully working otherwise - please open an issue if you have any questions or run into any problems!

Note that this documentation is specific to the SDK - read through the api documentation to learn more about the underlying datastructures (not all of that info is replecated here.

How to use it:

  const zenkitSDK = new ZenkitSDK('key', { keyType: 'Authorization' });

This initializes the Zenkit object. Key = your api key (either Zenkit-API-Key or Authorization/Oauth) options: keyType = Can be either Zenkit-API-Key or Authorization. Authorization is for Oauth projects, Zenkit API key can be retrieved from the zenkit website. Defaults to Zenkit-API-Key. appType = Can be todo, base, project, or hypernotes. Results will be limited to entries in the workspaces in that app (or shared with them). Defaults to todo. Note that Base, Project, and Hypernotes are still and may not work as expected for all functions. apiScope = defaults to api/v1. You shouldn't need to change this.

Functions:

    const workspaces = zenkitSDK.getWorkspaces()  
  retreives all workspaces in the appType (or shared with it). Returns a promise.
    const workspace = setDefaultWorkspace(workspaceId) - workspaceID is required.
  Sets the default workspace to a workplaceID you chose. Returns that workspace (as a promise). Will run getWorkspaces() if that hasn't been done already - otherwise it uses cached values.
    const lists = zenkitSDK.getListsInWorkspace(workspaceId) - workspaceID is optional
  Retrieves an object with each list in the workspace, with the listId as the key. If workspaceID is ommited, then it uses the default workspace. Will run getWorkspaces() if that hasn't been done already - otherwise it uses cached values. See ListsInWorkspace variable for the keys in each list object.
    const list = zenkitSDK.getListDetails(listId) - listId is required (you can use shortID as a substitute if you want).
  Makes an api call to get elements and items for the list. See ListsInWorkspace variable for specific values. These values are used by functions below, but likely won't need to be accessd by you. Most (all) of these valuses are specific to the todo appType. Returns a list object (as a promise).
    const list = updateListDetails(listId, listMetaData)
  Updates list details from cached data. listMetaData is an object can can include the following keys: titleUuid, uncompleteId, completeId, stageUuid
  Returns a list object (as a promise).

(Functions below this line require that you run getListDetails function and only work for the todo appType, unless noted otherwise)
    const list = createList(listName, workspaceId) - listName is required. workspaceId is optional (defaults to defaultWorkspace).
  creates a list and returns it as a promise. list object will include all list details (see getListDetails). Works for all appTypes, but not all list details will be available. Rejects promise on failure.
    deleteList(listId) - listId is required. Works for all appTypes.
  Deletes the list. Returns empty object (as a promise) and rejects the promise if list delete fails (or bad list ID is provided).
    const item = addItem(listId, itemName) - both params are required.
  Creates a new item in the list. Returns that item as a promise.
    deleteItem(listId, itemId) - both params are required. Works for all appTypes.
  Deletes an item from the list. Returns empty object (as a promise) and rejects the promise if list delete fails (or bad list ID is provided).
    const item = completeItem(listId, itemId) - both params are required.
  Completes an item (eg checks it off the list). Returns the updated item object as a promise.
    const item = uncompleteItem(listId, entryId) - both params are required.
  Uncompletes an item (eg moves it back to todo from checked off/done). Returns the updated item object as a promise.
    const item = updateItemTitle(listId, entryId, value) - all three params are required
  Updates an items title - Returns the updated item object as a promise.

Variables: zenkitSDK.workspaces = if getWorkspaces() has been run, then returns an array with metadata about all workspaces (see api documentation for complete list). zenkitSDK.defaultWorkspace = if getWorkspaces() has been run, then it returns the default workpspace for that appType. Works for todo and base. zenkitSDK.defaultWorkspaceId = if getWorkspaces() has been run, then it returns the ID of the default workpspace for that appType. Works for todo and base. zenkitSDK.ListsInWorkspace = if getListsInWorkspace() has been run, then returns an object with each list in the workspace, with the listId as the key. Note that this object is constructed incrementally and each list includes the following keys: id - the list id name - the list title shortId - the shortId for the list workspaceId - the workspace ID the list is in inbox - if appType is todo and the list is your inbox, then this is true, otherwise false if getListDetails(listId) has been run on the list, then the object includes these key/values (note that only the id is redundant, so if you run getListDetails but not getListsInWorkspace, then it won't include all of the keys above). You won't need to directly access these for the most part, but the are available if you want to cache them (for example): titleUuid - the element id for the title. This is used by the function to change the title of the list. todo appType uncompleteId - the element id for a uncompleted item in the list. This is used by the uncomplete function. todo appType completeId - the element id for a completed item in the list. This is used by the complete function. todo appType stageUuid - this element is by the complete and uncomplete functions. todo appType items - array with an object for each item in the list. Includes metatdata from api documentation + a key "completed" with a bolean value (false if it's uncomplete.