node-xero
An API wrapper for xero (http://developer.xero.com).
Supports all three applications types:
-
Private
-
Public
-
Partner
This module will be completed to support ALL Core and Payroll operations by the end of February 2014.
Create an Issue for any suggestions, specifically how to tidily support Where in a simple fashion.
Features
Implemented/Planned
-
Support all API operations
-
Efficient paging
-
Support for Private, Public, and Partner applications (look at oauth_test/server.js for 3 stage support)
Installation
$ npm install node-xero
Private Usage
var PrivateApplication = PrivateApplication;var privateApp = consumerSecret: 'AAAAA' consumerKey: 'BBBBBB' privateKeyPath: './cert/privatekey.pem';
Pubic Usage
var PublicApplication = PublicApplication;var publicApp = consumerSecret: 'AAAAA' consumerKey: 'BBBBBB';
Partner Usage
var ParnetApplication = PartnerApplication;var partnerApp = consumerSecret: 'AAAAA' consumerKey: 'BBBBBB' privateKeyPath: './cert/privatekey.pem' sslCertPath: './cert/ssl.crt';
Examples
Efficient paging:
privateAppcorecontacts /* Called per page */{ var contacts = responsedata; if responsefinished // finished paging ... ; // Async support}
Filter support: Modified After
// No paging
publicApp.core.contacts.getContacts({ modifiedAfter: new Date(2013,1,1) })
.then(function(contacts)
{
_.each(contacts, function(contact)
{
// Do something with contact
})
})
Tests
npm test
Release History
- 0.0.2
- Added journals
- modifiedAfter support
- 0.0.1
- Initial Release