smartystreets-javascript-sdk
Advanced tools
Comparing version 1.4.5 to 1.5.0
@@ -12,5 +12,6 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk"); | ||
let key = process.env.SMARTY_WEBSITE_KEY; | ||
const credentials = new SmartyStreetsCore.SharedCredentials(key); | ||
const credentials = new SmartyStreetsCore.SharedCredentials(key); | ||
let client = SmartyStreetsCore.buildClient.internationalStreet(credentials); | ||
// .withLicenses(["international-select-plus-gbr-cloud"]); | ||
@@ -17,0 +18,0 @@ // Documentation for input fields can be found at: |
@@ -12,4 +12,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk"); | ||
let key = process.env.SMARTY_WEBSITE_KEY; | ||
const credentials = new SmartyStreetsCore.SharedCredentials(key); | ||
const credentials = new SmartyStreetsCore.SharedCredentials(key); | ||
let client = SmartyStreetsCore.buildClient.usStreet(credentials); | ||
// .withLicenses(["us-core-cloud"]); | ||
@@ -31,4 +32,4 @@ // Documentation for input fields can be found at: | ||
lookup1.match = "invalid"; // "invalid" is the most permissive match, | ||
// this will always return at least one result even if the address is invalid. | ||
// Refer to the documentation for additional MatchStrategy options. | ||
// this will always return at least one result even if the address is invalid. | ||
// Refer to the documentation for additional MatchStrategy options. | ||
@@ -35,0 +36,0 @@ let lookup2 = new Lookup(); |
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "1.4.5", | ||
"version": "1.5.0", | ||
"description": "Quick and easy SmartyStreets address validation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -9,2 +9,3 @@ const HttpSender = require("./HttpSender"); | ||
const StatusCodeSender = require("./StatusCodeSender"); | ||
const LicenseSender = require("./LicenseSender"); | ||
const BadCredentialsError = require("./Errors").BadCredentialsError; | ||
@@ -44,2 +45,3 @@ | ||
this.debug = undefined; | ||
this.licenses = []; | ||
@@ -134,3 +136,16 @@ function noCredentialsProvided() { | ||
/** | ||
* Allows the caller to specify the subscription license (aka "track") they wish to use. | ||
* @param licenses A String Array of licenses. | ||
* @returns Returns <b>this</b> to accommodate method chaining. | ||
*/ | ||
withLicenses(licenses) { | ||
for (const license in licenses) { | ||
this.licenses.push(license); | ||
} | ||
return this; | ||
} | ||
buildSender() { | ||
@@ -145,4 +160,5 @@ if (this.httpSender) return this.httpSender; | ||
const baseUrlSender = new BaseUrlSender(customHeaderSender, this.baseUrl); | ||
const licenseSender = new LicenseSender(baseUrlSender, this.licenses); | ||
return baseUrlSender; | ||
return licenseSender; | ||
} | ||
@@ -149,0 +165,0 @@ |
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
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
148894
80
3347