smartystreets-javascript-sdk
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -6,9 +6,9 @@ const SmartySDK = require("smartystreets-javascript-sdk"); | ||
// for Server-to-server requests, use this code: | ||
// let authId = process.env.SMARTY_AUTH_ID; | ||
// let authToken = process.env.SMARTY_AUTH_TOKEN; | ||
// const credentials = new SmartyCore.StaticCredentials(authId, authToken); | ||
let authId = "f0fd813a-2c37-2afe-a322-1a46794d6c91"; | ||
let authToken = "sPDMxTLaMh8BCp6YWSNW"; | ||
const credentials = new SmartyCore.StaticCredentials(authId, authToken); | ||
// for client-side requests (browser/mobile), use this code: | ||
let key = process.env.SMARTY_EMBEDDED_KEY; | ||
const credentials = new SmartyCore.SharedCredentials(key); | ||
// let key = process.env.SMARTY_EMBEDDED_KEY; | ||
// const credentials = new SmartyCore.SharedCredentials(key); | ||
@@ -27,23 +27,8 @@ // The appropriate license values to be used for your subscriptions | ||
let lookup = new Lookup("4770 Lincoln"); | ||
lookup.excludeStates = ["CA"]; | ||
await handleRequest(lookup, "Simple Lookup"); | ||
(async () => { | ||
await handleRequest(lookup, "Simple Lookup"); | ||
})() | ||
// *** Using Filter and Prefer *** | ||
lookup = new Lookup("4770 Lincoln"); | ||
lookup.maxResults = 10; | ||
lookup.includeOnlyCities = ["Chicago,La Grange,IL", "Blaine,WA"]; | ||
lookup.preferStates = ["IL"]; | ||
lookup.preferRatio = 33; | ||
lookup.source = "all"; | ||
await handleRequest(lookup, "Using Filter and Prefer"); | ||
// *** Using 'selected' to Expand Secondaries *** | ||
lookup = new Lookup("4770 Lincoln"); | ||
lookup.selected = "4770 N Lincoln Ave Ste 2 (3) Chicago, IL 60625"; | ||
await handleRequest(lookup, "Using 'selected' to Expand Secondaries") | ||
// ************************************************ | ||
@@ -50,0 +35,0 @@ |
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Quick and easy Smarty address validation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,1 @@ | ||
const Response = require("./Response"); | ||
const Axios = require("axios"); | ||
@@ -7,2 +6,3 @@ const {buildSmartyResponse} = require("../src/util/buildSmartyResponse"); | ||
constructor(timeout = 10000, proxyConfig, debug = false) { | ||
this.axiosInstance = Axios.create(); | ||
this.timeout = timeout; | ||
@@ -38,3 +38,3 @@ this.proxyConfig = proxyConfig; | ||
Axios(requestConfig) | ||
this.axiosInstance(requestConfig) | ||
.then(response => { | ||
@@ -52,3 +52,3 @@ let smartyResponse = buildSmartyResponse(response); | ||
enableDebug() { | ||
Axios.interceptors.request.use(request => { | ||
this.axiosInstance.interceptors.request.use(request => { | ||
console.log('Request:\r\n', request); | ||
@@ -59,3 +59,3 @@ console.log('\r\n*******************************************\r\n'); | ||
Axios.interceptors.response.use(response => { | ||
this.axiosInstance.interceptors.response.use(response => { | ||
console.log('Response:\r\n'); | ||
@@ -62,0 +62,0 @@ console.log('Status:', response.status, response.statusText); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
172010
3940
1