Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: avadev/AvaTax-REST-V2-JS-SDK
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 21.12.0
Choose a base ref
...
head repository: avadev/AvaTax-REST-V2-JS-SDK
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 527 changed files with 64,760 additions and 17,224 deletions.
7 changes: 2 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -10,11 +10,8 @@
"jest": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
"ecmaVersion": 9,
"sourceType": "module"
},
"rules": {
"quotes": [2, "single", {
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish package to npm

on:
release:
types: [published]

jobs:
publish-npm:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run build-tsc
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm run npm-publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -27,13 +27,21 @@ var Avatax = require('avatax');
// es6/7 import
// import Avatax from 'avatax';

// resolve configuration and credentials
// resolve configuration, credentials and logOptions
const config = {
appName: 'your-app',
appVersion: '1.0',
environment: 'sandbox',
machineName: 'your-machine-name'
timeout: 5000 // optional, default 20 min
machineName: 'your-machine-name',
timeout: 5000, // optional, default 20 min
logOptions: {
logEnabled: true, // toggle logging on or off, by default its off.
logLevel: 3, // logLevel that will be used, Options are LogLevel.Error (0), LogLevel.Warn (1), LogLevel.Info (2), LogLevel.Debug (3)
logRequestAndResponseInfo: true, // Toggle logging of the request and response bodies on and off.
logger: myCustomLogger // (OPTIONAL) Custom logger can be passed in that implements the BaseLogger interface (e.g. debug, info, warn, error, and log functions) Otherwise console.log/error etc will be used by default.
},
customHttpAgent: new https.Agent({keepAlive: true}), // (OPTIONAL) Define a custom https agent, import https from node to use this constructor. See https://node.readthedocs.io/en/latest/api/https/#https_class_https_agent for more information.
enableStrictTypeConversion: true // Ensures that all responses returned by the API methods will be type-safe and match the Models explicitly, For Example, the enums will be returned as integer values instead of as Strings as previously were.
};

const creds = {
@@ -101,10 +109,16 @@ return client.resolveAddress(address)
```
## Release Notes

In the JS-SDK 21.2.1 release, the SDK can now return big integers from API responses.
Big integers in JavaScript are displayed in responses by appending an 'n' to the end of an integer literal. For example, 618368842515476464 -> 618368842515476464n.
Numbers are presented as before. For example, 8456123 -> 8456123.
For more information, refer to the following Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
Please see the [Github releases](https://github.com/avadev/AvaTax-REST-V2-JS-SDK/releases) for in-depth release notes.

## Typescript support
As of version 22.11.0, Typescript support is included in the SDK. Models and Enums included in addition to typing for all of the API methods and parameters. The team welcomes any feedback on this feature.

Models and Enums can be imported into Typescript projects as follows:
```typescript
import { AddressResolutionModel } from 'avatax/lib/models';
import { AddressCategoryId } from 'avatax/lib/enums';
```

## SDK Development

@@ -140,4 +154,3 @@ https://github.com/avadev/AvaTax-REST-V2-JS-SDK/blob/master/test/helpers/load_cr
# assuming a tag of v17.5.2 and a remote of 'upstream'
git push upstream v17.5.2
```

3 changes: 2 additions & 1 deletion index.js → index.ts
Original file line number Diff line number Diff line change
@@ -4,5 +4,6 @@
*/

import client from './lib/AvaTaxClient';
module.exports = client;
export default client;
module.exports = exports["default"];

Loading