taxjar / taxjar-node

Sales Tax API Client for Node
https://developers.taxjar.com/api/reference/?javascript
MIT License
54 stars 24 forks source link

Switch request to node-fetch and update dependencies #72

Closed strmer15 closed 1 year ago

strmer15 commented 1 year ago

The current implemenation of taxjar-node uses request under the hood, but the library has been deprecated for two years now. This change switches out usage of request and request-promise-native for the node-fetch library.

The main differences in the implementation are:

Additionally, I updated some types to use Record<string, string> which is what the URLSearchParams expects for query params, and I updated all the dev dependencies to the latest. The newest version of nock specifically checks for invalid URLs (e.g. without a protocol) and throws an error, so I put an http:// in front of the test invalidApiUrl. Lastly, the include check on one of the tests failed because the error message was longer but included the error string, so I changed to to call match on the err.message using a RegExp instead.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

strmer15 commented 1 year ago

@fastdivision @sethobey Not sure who can review this, can you point me in the right direction? Thanks!

meecect commented 1 year ago

There is a new advisory that affects the product now as well:

GHSA-p8p7-x288-28g6

neverbot commented 1 year ago

I created an issue (#76), just in case... maybe somebody sees it :)

akv-mshin commented 1 year ago

Also sent e-mail to taxjar support, hope that this will increase chances of this PR being merged

smolentzov-stripe commented 1 year ago

Hi @strmer15 - thank you so much for submitting this PR, and for the thorough description. We have reviewed it and are planning on merging/releasing it early next week! We really appreciate everyone's patience here.

strmer15 commented 1 year ago

Thanks for the update @smolentzov-stripe !