Skip to content

Commit

Permalink
v19.1.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
contygm committed Feb 5, 2019
1 parent 32fd31c commit 0693d1c
Show file tree
Hide file tree
Showing 3 changed files with 6,216 additions and 6 deletions.
38 changes: 33 additions & 5 deletions lib/AvaTaxClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Ted Spence <ted.spence@avalara.com>
* @copyright 2004-2018 Avalara, Inc.
* @license https://www.apache.org/licenses/LICENSE-2.0
* @version 18.12.0
* @version 19.1.1
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
*/

Expand Down Expand Up @@ -41,7 +41,7 @@ export default class AvaTaxClient {
appName +
'; ' +
appVersion +
'; JavascriptSdk; 18.12.0; ' +
'; JavascriptSdk; 19.1.1; ' +
machineName;
}

Expand Down Expand Up @@ -84,9 +84,7 @@ export default class AvaTaxClient {
},
body: JSON.stringify(payload)
}).then(res => {
var contentType = res.headers._headers['content-type'][0];

if (contentType === 'application/vnd.ms-excel' || contentType === 'text/csv') {
if (res.headers._headers['content-type'][0] === 'application/vnd.ms-excel') {
return res;
}
return res.json();
Expand Down Expand Up @@ -5205,6 +5203,36 @@ This gets the basic information from the filings and doesn't include anything ex
return this.restCall({ url: path, verb: 'get', payload: null });
}

/**
* Retrieve a list of filings for the specified company in the year and month of a given filing period.
*
* This API is available by invitation only.
* A "filing period" is the year and month of the date of the latest customer transaction allowed to be reported on a filing,
* based on filing frequency of filing.
*
*
* @param int companyId The ID of the company that owns the filings.
* @param int year The year of the filing period.
* @param int month The two digit month of the filing period.
* @param string country The two-character ISO-3166 code for the country.
* @param string region The two or three character region code for the region.
* @param string formCode The unique code of the form.
* @return FetchResult
*/
getTaxFilings({ companyId, year, month, country, region, formCode } = {}) {
var path = this.buildUrl({
url: `/api/v2/companies/${companyId}/filings`,
parameters: {
year: year,
month: month,
country: country,
region: region,
formCode: formCode
}
});
return this.restCall({ url: path, verb: 'get', payload: null });
}

/**
* Rebuild a set of filings for the specified company in the given filing period.
*
Expand Down
Loading

0 comments on commit 0693d1c

Please sign in to comment.