Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smartystreets-javascript-sdk

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smartystreets-javascript-sdk - npm Package Compare versions

Comparing version 1.0.6 to 1.1.0

2

package.json
{
"name": "smartystreets-javascript-sdk",
"version": "1.0.6",
"version": "1.1.0",
"description": "Quick and easy SmartyStreets address validation.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -40,2 +40,3 @@ const HttpSender = require("./HttpSender");

this.customHeaders = {};
this.debug = undefined;

@@ -120,6 +121,17 @@ function noCredentialsProvided() {

/**
* Enables debug mode, which will print information about the HTTP request and response to console.log
* @return Returns <b>this</b> to accommodate method chaining.
*/
withDebug() {
this.debug = true;
return this;
}
buildSender() {
if (this.httpSender) return this.httpSender;
const httpSender = new HttpSender(this.maxTimeout, this.maxRetries, this.proxy);
const httpSender = new HttpSender(this.maxTimeout, this.maxRetries, this.proxy, this.debug);
const statusCodeSender = new StatusCodeSender(httpSender);

@@ -126,0 +138,0 @@ const signingSender = new SigningSender(statusCodeSender, this.signer);

@@ -7,3 +7,3 @@ const Response = require("./Response");

class HttpSender {
constructor(timeout = 10000, retries = 5, proxyConfig) {
constructor(timeout = 10000, retries = 5, proxyConfig, debug = false) {
axiosRetry(Axios, {

@@ -14,2 +14,3 @@ retries: retries,

this.proxyConfig = proxyConfig;
if (debug) this.enableDebug();
}

@@ -58,4 +59,20 @@

}
enableDebug() {
Axios.interceptors.request.use(request => {
console.log('Request:\r\n', request);
console.log('\r\n*******************************************\r\n');
return request
});
Axios.interceptors.response.use(response => {
console.log('Response:\r\n');
console.log('Status:', response.status, response.statusText);
console.log('Headers:', response.headers);
console.log('Data:', response.data);
return response
})
}
}
module.exports = HttpSender;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc