smartystreets-javascript-sdk
Advanced tools
Comparing version 5.1.0 to 5.1.1
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "Quick and easy Smarty address validation.", | ||
@@ -40,4 +40,5 @@ "keywords": [ | ||
"axios": "^1.6.2", | ||
"axios-retry": "4.0.0" | ||
"axios-retry": "4.0.0", | ||
"smartystreets-javascript-sdk": "^5.1.1" | ||
} | ||
} |
@@ -17,8 +17,4 @@ const Errors = require("../Errors"); | ||
if (lookup.smartyKey) { | ||
request.baseUrlParam = lookup.smartyKey; | ||
} | ||
request.baseUrlParam = lookup.smartyKey + "/property/principal"; | ||
request.baseUrlParam = "property/principal"; | ||
return new Promise((resolve, reject) => { | ||
@@ -42,8 +38,4 @@ this.sender.send(request) | ||
if (lookup.smartyKey) { | ||
request.baseUrlParam = lookup.smartyKey; | ||
} | ||
request.baseUrlParam = lookup.smartyKey + "/property/financial"; | ||
request.baseUrlParam = "property/financial"; | ||
return new Promise((resolve, reject) => { | ||
@@ -67,8 +59,4 @@ this.sender.send(request) | ||
if (lookup.smartyKey) { | ||
request.baseUrlParam = lookup.smartyKey; | ||
} | ||
request.baseUrlParam = lookup.smartyKey + "/geo-reference"; | ||
request.baseUrlParam = "geo-reference"; | ||
return new Promise((resolve, reject) => { | ||
@@ -75,0 +63,0 @@ this.sender.send(request) |
@@ -9,2 +9,3 @@ const {buildSmartyResponse} = require("../../src/util/buildSmartyResponse.js"); | ||
parameters: undefined, | ||
baseUrlParam: undefined, | ||
}; | ||
@@ -16,2 +17,3 @@ this.request = request; | ||
request.parameters = clientRequest.parameters; | ||
request.baseUrlParam = clientRequest.baseUrlParam; | ||
} | ||
@@ -18,0 +20,0 @@ }, |
@@ -11,2 +11,35 @@ const chai = require("chai"); | ||
describe("A US Enrichment Client", function () { | ||
it("composes principal url path properly", function () { | ||
let mockSender = new MockSender(); | ||
let client = new Client(mockSender); | ||
let smartyKey = "0"; | ||
let lookup = new Lookup(smartyKey); | ||
client.sendPrincipal(lookup); | ||
expect(mockSender.request.baseUrlParam).to.deep.equal("0/property/principal"); | ||
}) | ||
it("composes financial url path properly", function () { | ||
let mockSender = new MockSender(); | ||
let client = new Client(mockSender); | ||
let smartyKey = "0"; | ||
let lookup = new Lookup(smartyKey); | ||
client.sendFinancial(lookup); | ||
expect(mockSender.request.baseUrlParam).to.deep.equal("0/property/financial"); | ||
}) | ||
it("composes geo url path properly", function () { | ||
let mockSender = new MockSender(); | ||
let client = new Client(mockSender); | ||
let smartyKey = "0"; | ||
let lookup = new Lookup(smartyKey); | ||
client.sendGeo(lookup); | ||
expect(mockSender.request.baseUrlParam).to.deep.equal("0/geo-reference"); | ||
}) | ||
it("correctly builds parameters for a smartyKey only principal lookup.", function () { | ||
@@ -13,0 +46,0 @@ let mockSender = new MockSender(); |
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
270084
99
5532
3
8