From dc58f136b80552ebe0aef3ad59533c46cb2dbe43 Mon Sep 17 00:00:00 2001 From: contygm Date: Wed, 13 Nov 2019 17:51:54 -0800 Subject: [PATCH 1/3] 19.10 update --- lib/AvaTaxClient.js | 94 +++++++++++---------------------------------- package.json | 2 +- 2 files changed, 23 insertions(+), 73 deletions(-) diff --git a/lib/AvaTaxClient.js b/lib/AvaTaxClient.js index 9d2c64c2..884dba51 100644 --- a/lib/AvaTaxClient.js +++ b/lib/AvaTaxClient.js @@ -10,7 +10,7 @@ * @author Ted Spence * @copyright 2004-2018 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 19.9.2 + * @version 19.11.0 * @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK */ @@ -41,7 +41,7 @@ export default class AvaTaxClient { appName + '; ' + appVersion + - '; JavascriptSdk; 19.9.2; ' + + '; JavascriptSdk; 19.11.0; ' + machineName; } @@ -84,13 +84,13 @@ export default class AvaTaxClient { }, body: JSON.stringify(payload) }).then(res => { - var contentType = res.headers._headers['content-type'][0]; + var contentType = res.headers._headers['content-type'][0]; if (contentType === 'application/vnd.ms-excel' || contentType === 'text/csv') { - return res; - }else{ - return res.json(); + { + return res; } + return res.json(); }) .then(json => { // handle error @@ -589,6 +589,11 @@ export default class AvaTaxClient { * predict when a batch will complete. If high performance processing is * required, please use the * [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/). + * + * The maximum content length of the request body is limited to 28.6 MB. If this limit + * is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if + * the API is called from a browser). In this situation, please split the request into + * smaller batches. * * ### Security Policies * @@ -1606,6 +1611,8 @@ export default class AvaTaxClient { * Create one or more new company objects. * A 'company' represents a single corporation or individual that is registered to handle transactional taxes. * You may attach nested data objects such as contacts, locations, and nexus with this CREATE call, and those objects will be created with the company. + * + * NOTE: Please do not use these blacklisted characters in company name and code: ';', '\', '|'. * * ### Security Policies * @@ -1870,7 +1877,7 @@ export default class AvaTaxClient { * * @return FetchResult */ - listMrsCompanies({ } = {}) { + listMrsCompanies({ } = {}) { var path = this.buildUrl({ url: `/api/v2/companies/mrs`, parameters: {} @@ -1969,6 +1976,8 @@ export default class AvaTaxClient { * such as contacts, locations, or settings are not permitted. To update the nested objects * * To set a field's value to `null`, you may either set its value to `null` or omit that field from the object you PUT. + * + * NOTE: Please do not use these blacklisted characters in company name and code: ';', '\', '|'. * * ### Security Policies * @@ -2230,7 +2239,7 @@ export default class AvaTaxClient { * * @param int companyId The unique ID number of the company that recorded this customer * @param string customerCode The unique code representing this customer - * @return object + * @return object[] */ deleteCustomer({ companyId, customerCode } = {}) { var path = this.buildUrl({ @@ -3200,7 +3209,7 @@ export default class AvaTaxClient { * * @return FetchResult */ - listCrossBorderSections({ } = {}) { + listCrossBorderSections({ } = {}) { var path = this.buildUrl({ url: `/api/v2/definitions/crossborder/sections`, parameters: {} @@ -3298,6 +3307,8 @@ export default class AvaTaxClient { * * This API allows you to examine all Avalara-supported jurisdictions. You can filter your search by supplying * SQL-like query for fetching only the ones you concerned about. For example: effectiveDate > '2016-01-01' + * + * The rate, salesRate, and useRate fields are not available on the JurisdictionModels returned by this API. * * * @param string filter A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* rate, salesRate, signatureCode, useRate @@ -4638,67 +4649,6 @@ export default class AvaTaxClient { return this.restCall({ url: path, verb: 'put', payload: model }); } - /** - * Delete a batch of error transactions - * - * Delete a batch of error transactions attached to a company. - * - * If any of the provided error transaction isn't found then it'll be treated as a success. - * - * ### Security Policies - * - * * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * * This API depends on the following active services
*Required* (all): AvaTaxPro. - * - * - * @param object model The request that contains error transactions to be deleted - * @return object - */ - deleteErrorTransactions({ model } = {}) { - var path = this.buildUrl({ - url: `/api/v2/errortransactions`, - parameters: {} - }); - return this.restCall({ url: path, verb: 'delete', payload: model }); - } - - /** - * Retrieve list of error transactions - * - * List error transactions attached to this company. Results are dependent on `$filter` if provided. - * - * This endpoint is limited to returning 250 error transactions at a time maximum. - * - * Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) . - * Paginate your results using the `$top`, `$skip`, and `$orderby` parameters. - * - * ### Security Policies - * - * * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser. - * * This API depends on the following active services
*Required* (all): AvaTaxPro. - * - * - * @param string companyCode The company code to filter on. This query parameter is required. - * @param string filter A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
*Not filterable:* companyId, avataxErrorJson, avataxCreateTransactionJson - * @param int top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. - * @param int skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets. - * @param string orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`. - * @return FetchResult - */ - listErrorTransactions({ companyCode, filter, top, skip, orderBy } = {}) { - var path = this.buildUrl({ - url: `/api/v2/errortransactions`, - parameters: { - companyCode: companyCode, - $filter: filter, - $top: top, - $skip: skip, - $orderBy: orderBy - } - }); - return this.restCall({ url: path, verb: 'get', payload: null }); - } - /** * Approves linkage to a firm for a client account * @@ -9745,7 +9695,7 @@ export default class AvaTaxClient { * * @return FetchResult */ - listMySubscriptions({ } = {}) { + listMySubscriptions({ } = {}) { var path = this.buildUrl({ url: `/api/v2/utilities/subscriptions`, parameters: {} @@ -9780,7 +9730,7 @@ export default class AvaTaxClient { * * @return object */ - ping({ } = {}) { + ping({ } = {}) { var path = this.buildUrl({ url: `/api/v2/utilities/ping`, parameters: {} diff --git a/package.json b/package.json index a0937e23..243c1965 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "avatax", - "version": "19.9.2", + "version": "19.11.0", "description": "AvaTax v2 SDK for languages using JavaScript", "main": "index.js", "homepage": "https://github.com/avadev/AvaTax-REST-V2-JS-SDK", From 220aa93d323b8b52b7b758a3f0feb09551702d63 Mon Sep 17 00:00:00 2001 From: contygm Date: Thu, 14 Nov 2019 11:40:25 -0800 Subject: [PATCH 2/3] 19.10 update --- lib/AvaTaxClient.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/AvaTaxClient.js b/lib/AvaTaxClient.js index 884dba51..f24c49a2 100644 --- a/lib/AvaTaxClient.js +++ b/lib/AvaTaxClient.js @@ -10,7 +10,7 @@ * @author Ted Spence * @copyright 2004-2018 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version 19.11.0 + * @version 19.10.0 * @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK */ @@ -41,7 +41,7 @@ export default class AvaTaxClient { appName + '; ' + appVersion + - '; JavascriptSdk; 19.11.0; ' + + '; JavascriptSdk; 19.10.0; ' + machineName; } diff --git a/package.json b/package.json index 243c1965..fe2cfe65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "avatax", - "version": "19.11.0", + "version": "19.10.0", "description": "AvaTax v2 SDK for languages using JavaScript", "main": "index.js", "homepage": "https://github.com/avadev/AvaTax-REST-V2-JS-SDK", From 7a19a5dc9d626ac27910678d73b9baeb2f9a2fc4 Mon Sep 17 00:00:00 2001 From: "genevieve.conty" Date: Fri, 15 Nov 2019 12:38:16 -0800 Subject: [PATCH 3/3] 19-oct: fixed generation error --- lib/AvaTaxClient.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/AvaTaxClient.js b/lib/AvaTaxClient.js index f24c49a2..a4ce4b01 100644 --- a/lib/AvaTaxClient.js +++ b/lib/AvaTaxClient.js @@ -87,12 +87,11 @@ export default class AvaTaxClient { var contentType = res.headers._headers['content-type'][0]; if (contentType === 'application/vnd.ms-excel' || contentType === 'text/csv') { - { return res; } return res.json(); }) - .then(json => { + .then(json => { // handle error if (json.error) { let ex = new Error(json.error.message);