1.0.2 • Published 7 years ago

dizzydata v1.0.2

Weekly downloads
14
License
ISC
Repository
github
Last release
7 years ago

Dizzydata API Client

Warning This package is still under development and the exposed methods are likely to change.

Installation

npm install --save dizzydata

Usage

var DizzydataClient = require('dizzydata')

var dizzydata = DizzydataClient({
	server: 'https://api.dizzydata.com/',
	credentials: {
		username: '<YOUR USERNAME>',
		password: '<YOUR PASSWORD>',
	}
})

dizzydata.request({ method: 'GET', url: 'v1/jobs' })
.then(response => {
	console.log('Received jobs', response.body)
}, error => {
	console.error('Failed to load jobs')
})

Testing

You'll need to create a configuration file to run the tests. Some tests might fail for normal user accounts.

config/test-config.js

module.exports = {
    dizzydata: {
        URL: 'https://api.dizzydata.com/',
        USERNAME: '<YOUR USERNAME>',
        PASSWORD: '<YOUR PASSWORD>'
    },
    test: {
    	CLIENT_ID: '<YOUR CLIENT ID>'
    }
};

Run the tests with:

NODE_ENV=test npm test

Changelog

0.4.0 -. 1.0.0

  • The options have changed. url became server, username and password are now under the credentials property.
  • clients(options), updateClients(options), invoiceCount(options) and administrationCount(options) have been removed. They were essentially light wrappers. You can do a better job wrapping Dizzydata requests because you know what information you need and how you want it.
  • The oldrequest.authorized(options)is nowrequest(options)`.
  • The oldrequest(options)is nowunauthorizedRequest(options)`.
  • request(options) now uses authorization by default and attempts to re-authorize automatically using the provided credentials.
  • Certificates have been removed. Our new certificates work out of the box.
  • Much simpler implementation.

0.2.2 -> 0.3.1

The request wrapper was split from the lib/client.js to its own file. This caused some properties on the client to be located.

  • The properties username, password, baseUrl, token and responseToJSON are no longer available on the client objects.
  • The function _request(options) is now available through request(options)
  • The function _authorizedRequest(options) is now available through request.authorized(options)
  • The function _requestToken() is now available through request._token() but should for normal use not be called by you.
1.0.2

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago