xero-node
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -54,3 +54,3 @@ "use strict"; | ||
function AccountingAPIClient(options, authState, _oAuth1HttpClient) { | ||
var _this = _super.call(this, options, authState, {}, _oAuth1HttpClient) || this; | ||
var _this = _super.call(this, options, authState, { apiBasePath: '/api.xro/2.0/' }, _oAuth1HttpClient) || this; | ||
_this.accounts = { | ||
@@ -467,3 +467,3 @@ get: function (args) { return __awaiter(_this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
endpoint = "invoices"; | ||
endpoint = 'invoices'; | ||
if (args && args.InvoiceID) { | ||
@@ -470,0 +470,0 @@ endpoint = endpoint + '/' + args.InvoiceID; |
@@ -24,5 +24,5 @@ "use strict"; | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
apiBaseUrl: 'https://api.xero.com', | ||
apiBasePath: '', | ||
oauthAccessTokenPath: '/oauth/AccessToken', | ||
@@ -55,4 +55,4 @@ oauthRequestTokenPath: '/oauth/RequestToken', | ||
tenantType: null, | ||
apiBasePath: '', | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
@@ -88,4 +88,4 @@ apiBaseUrl: 'https://api.xero.com', | ||
tenantType: null, | ||
apiBasePath: '', | ||
signatureMethod: 'HMAC-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
@@ -118,4 +118,4 @@ apiBaseUrl: 'https://api.xero.com', | ||
tenantType: null, | ||
apiBasePath: '', | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
@@ -147,4 +147,4 @@ apiBaseUrl: 'https://api.xero.com', | ||
tenantType: null, | ||
apiBasePath: '', | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
@@ -171,3 +171,4 @@ apiBaseUrl: 'https://api.xero.com', | ||
var apiConfig = { | ||
tenantType: 'PRACTICE' | ||
tenantType: 'PRACTICE', | ||
apiBasePath: '/s/s', | ||
}; | ||
@@ -182,4 +183,4 @@ it('maps config correctly', function () { | ||
tenantType: 'PRACTICE', | ||
apiBasePath: '/s/s', | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
@@ -211,4 +212,4 @@ apiBaseUrl: 'https://api.xero.com', | ||
signatureMethod: 'RSA-SHA1', | ||
apiBasePath: '/api.xro/2.0/', | ||
callbackUrl: null, | ||
apiBasePath: '', | ||
apiBaseUrl: 'https://api.xero.com', | ||
@@ -215,0 +216,0 @@ oauthAccessTokenPath: '/oauth/AccessToken', |
@@ -24,2 +24,3 @@ /// <reference types="node" /> | ||
tenantType?: string; | ||
apiBasePath?: string; | ||
} | ||
@@ -45,5 +46,5 @@ /** @private */ | ||
/** @private */ | ||
export declare abstract class BaseAPIClient { | ||
export declare class BaseAPIClient { | ||
readonly oauth1Client: IOAuth1HttpClient; | ||
constructor(xeroConfig: XeroClientConfiguration, authState?: AccessToken, apiConfig?: ApiConfiguration, oauth1Client?: IOAuth1HttpClient); | ||
} |
@@ -34,3 +34,2 @@ "use strict"; | ||
var API_BASE = process.env.XERO_API_BASE ? process.env.XERO_API_BASE : 'https://api.xero.com'; | ||
var API_BASE_PATH = '/api.xro/2.0/'; | ||
var OAUTH_REQUEST_TOKEN_PATH = '/oauth/RequestToken'; | ||
@@ -44,3 +43,3 @@ var OAUTH_ACCESS_TOKEN_PATH = '/oauth/AccessToken'; | ||
apiBaseUrl: API_BASE, | ||
apiBasePath: API_BASE_PATH, | ||
apiBasePath: apiConfig.apiBasePath || '', | ||
oauthRequestTokenPath: OAUTH_REQUEST_TOKEN_PATH, | ||
@@ -47,0 +46,0 @@ oauthAccessTokenPath: OAUTH_ACCESS_TOKEN_PATH, |
{ | ||
"name": "xero-node", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "NodeJS Client for the Xero API, supporting Public, Private and Partner Apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
[![npm version](https://badge.fury.io/js/xero-node.svg)](https://badge.fury.io/js/xero-node) | ||
[![CircleCI](https://circleci.com/gh/XeroAPI/xero-node/tree/v3.svg?style=svg)](https://circleci.com/gh/XeroAPI/xero-node/tree/v3) | ||
[![CircleCI](https://circleci.com/gh/XeroAPI/xero-node/tree/master.svg?style=svg)](https://circleci.com/gh/XeroAPI/xero-node/tree/master) | ||
@@ -8,2 +8,4 @@ # xero-node | ||
[API Reference](https://xeroapi.github.io/xero-node/v3) | ||
Supports all application types: | ||
@@ -18,9 +20,8 @@ | ||
<!-- [API Reference](https://xeroapi.github.io/xero-node/). --> | ||
# Features/Change Log | ||
# Features | ||
- v3.0.1 | ||
- Reimplmented how to make generic API calls in BaseAPI layer. See examples below | ||
- v3.0.0 | ||
- all [accounting endpoints](https://developer.xero.com/documentation/api/api-overview) | ||
- generic methods (`get`, `put`, `post`, `delete`) for calling any unsupported endpoints | ||
- almost all [accounting endpoints](https://developer.xero.com/documentation/api/api-overview) | ||
@@ -144,2 +145,4 @@ # Installation | ||
- [Sample app](https://github.com/XeroAPI/xero-node-sample-app) | ||
- [Generic API calls private](https://github.com/XeroAPI/xero-node/blob/master/src/__integration_tests__/generic-endpoint.integration.tests.ts) | ||
- [Generic API calls public/partner](https://github.com/XeroAPI/xero-node/blob/master/src/__integration_tests__/partner-example-callbackUrl.tests.ts) | ||
@@ -146,0 +149,0 @@ ## Migration from V2 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193364
3910
212