Add per-endpoint methods#11
Open
damonmcminn wants to merge 5 commits intothallium205:masterfrom
Open
Conversation
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Endpoint methods
Xero[endpoint].findXero[endpoint].findOnefindoptionally accepts a plain filter string e.g.AmountDue > 1000 AND DueDate > DateTime(1970-1-1)and handles encoding and appending to Xero API path.findOneaccepts a Xero ID e.g.xero.Invoices.findOne('foobar, callback)executesXero.callwith a path of/Invoices/foobarHelper methods
Xero.helpers. Have initially implementeddateToXeroDateTimeString(date)which accepts a Date object and returns a string as expected by the Xero API e.g.DateTime(2015-5-26)What is not included
More work is required for conditional endpoint methods i.e. there is no check for whether an endpoint accepts an id in GET requests so all endpoints receive the
findOnemethod regardless.Need to implement
savemethod.Tests
npm testvalidates that the methods forward API calls toXero.callnpm run test-xero-apivalidates method integration with Xero API. Requires keys as outlined in L7-8 oftest/xero-api.jsCheers!