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

binder-protocol

v1.2.0

Published

API description for all Binder servers

Downloads

9

Readme

binder-protocol

A declarative specification of the Binder API that ensures consistency between BinderModules and the client module

Used by binder-client to auto-generate the client and CLI interfaces

install

npm install binder-protocol

usage

The protocol declaration is a single JS object, where each bottom-level key represents a Binder API endpoint and the value is a schema object. The endpoints currently defined are (see the API description for more detail):

  • build
    • start - start a build
    • status - query the status of a single build
    • statusAll - query the status of all builds
  • registry
    • fetch - get a single template
    • fetchAll - get all registered templates
  • deploy
    • deploy - launch an instance of a template on the deploy backend
    • status - get the status of a single deployment matching a template/id combo
    • statusAll - get the status of all deployments for a given template

schema

Each endpoint is defined by the following properties:

  1. path string - templated string describing the pathname and any request parameters
  2. params object - keys for every request parameter and values describing that parameter's properties:
  3. type string - request parameter type
  4. description string - request parameter description
  5. required boolean - is this parameter required?
  6. description string - description of the endpoint
  7. msg string - message that should be displayed when the endpoint request is sent
  8. request object - keys for all properties of the HTTP request
  9. method string - HTTP method
  10. authorized boolean - if the endpoint requires an API token
  11. body object - HTTP post body
  12. response object - contains a description of the possible response body and error/success handling info
  13. body object - response body type description
  14. error object - names and handlers for all possible errors that the endpoint can generate (keyed by error name)
  15. status number - HTTP response code for the error
  16. msg string - description of the error that occurred
  17. suggestions [string] - possible fixes for the error
  18. success object - handler for the single success outcome that the endpoint can generate

examples

Here's a simple example from the deploy API, but see index.js for many more examples.

deploy: {
    ...
    
    statusAll: {
      path: '/applications/{template-name}',
      params: {
        'template-name': {
          type: String,
          description: 'name of the template with existing deployments',
          required: false
        }
      },
      description: 'Get information associated with all deployment for a given template',
      msg: 'Getting information about all deployments for {template-name}',
      request: {
        method: 'GET',
        authorized: true
      },
      response: {
        body: [{
          id: String,
          location: String
        }],
        error: {
          badDatabase: {
            status: 500,
            msg: 'Querying the database for all deployments failed',
            suggestions: [
              'ensure that the database is accessible to the deploy server',
              'check the Binder Logstash logs for database-oriented messages'
            ]
          }
        },
        success: {
          status: 200,
          msg: '{results}'
        }
      }
    }
  }