dispatch-client

0.1.6 • Public • Published

dispatch-client Build Status

Universal javascript client for the Dispatch API.

Installation

npm install dispatch-client

API Overview

Every resource is accessed via your dispatch instance:

const dispatch = new require('dispatch-client')({ clientId, clientSecret });
// dispatch.{ RESOURCE_NAME }.{ METHOD_NAME }

Every resource method returns a promise:

dispatch.events.get({ jobId: '123' }).then(events => {
  console.log('Job events', events);
});

Resources & methods

  • dispatch
  • attachments
    • get(selector, [options]) - dispatch.attachments.get({ jobId: '1' })
    • create(doc, [options]) - dispatch.attachments.create({ jobId: '1', fileToken: 'filetoken' })
  • events
    • get(selector, [options]) - dispatch.events.get({ jobId: '1'})
    • create(doc, [options]) - dispatch.events.create({ jobId: '1', message: 'Friendly dog at the house' })
  • files
    • url(token) - dispatch.files.url('filetoken')
  • fetch(path, [options]) - dispatch.fetch('v1/jobs')
  • getToken([options]) - dispatch.getToken()
  • momentTimezone(timezone) - dispatch.momentTimezone('Hawaii')

Readme

Keywords

none

Package Sidebar

Install

npm i dispatch-client

Weekly Downloads

8

Version

0.1.6

License

MIT

Last publish

Collaborators

  • aldeed
  • jraede
  • derekcaneja
  • jperl