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

smartystreets-javascript-sdk

Package Overview
Dependencies
Maintainers
3
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.7.2 to 1.8.0

3

examples/international_street.js

@@ -15,4 +15,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.internationalStreet(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withLicenses(["fake-license"]);
let client = clientBuilder.buildInternationalStreetClient();

@@ -19,0 +20,0 @@ // Documentation for input fields can be found at:

@@ -10,3 +10,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.usAutocompletePro(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withBaseUrl("");
let client = clientBuilder.buildUsAutocompleteProClient();

@@ -13,0 +15,0 @@ // Documentation for input fields can be found at:

@@ -15,3 +15,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.usAutocomplete(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withBaseUrl("");
let client = clientBuilder.buildUsAutocompleteClient();

@@ -18,0 +20,0 @@ // Documentation for input fields can be found at:

@@ -15,3 +15,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.usExtract(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withBaseUrl("");
let client = clientBuilder.buildUsExtractClient();

@@ -18,0 +20,0 @@ // Documentation for input fields can be found at:

@@ -15,3 +15,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.usReverseGeo(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withBaseUrl("");
let client = clientBuilder.buildUsReverseGeoClient();

@@ -18,0 +20,0 @@ let lookup1 = new Lookup(40.27644, -111.65747);

@@ -14,4 +14,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

// const credentials = new SmartyStreetsCore.SharedCredentials(key, hostname);
let client = SmartyStreetsCore.buildClient.usStreet(credentials);
// .withLicenses(["us-rooftop-geo-cloud"]);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials).withBaseUrl("https://us-street-pilot.api.smartystreets.me/status");
// .withLicenses(["us-rooftop-geocoding-cloud"]);
let client = clientBuilder.buildUsStreetApiClient();

@@ -18,0 +19,0 @@ // Documentation for input fields can be found at:

@@ -15,3 +15,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let client = SmartyStreetsCore.buildClient.usZipcode(credentials);
let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials);
// .withBaseUrl("");
let client = clientBuilder.buildUsZipcodeClient();

@@ -18,0 +20,0 @@ // Documentation for input fields can be found at:

{
"name": "smartystreets-javascript-sdk",
"version": "1.7.2",
"version": "1.8.0",
"description": "Quick and easy SmartyStreets address validation.",

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

@@ -8,3 +8,3 @@ class SharedCredentials {

sign(request) {
request.parameters["auth-id"] = this.authId;
request.parameters["key"] = this.authId;
if (this.hostName) request.headers["Referer"] = "https://" + this.hostName;

@@ -11,0 +11,0 @@ }

@@ -55,2 +55,10 @@ /**

this.metadata.longitude = responseData.metadata.longitude;
switch (responseData.metadata.coordinate_license)
{
case 1:
this.metadata.coordinateLicense = "Gateway Spatial, LLC";
break;
default:
this.metadata.coordinateLicense = "SmartyStreets";
}
this.metadata.precision = responseData.metadata.precision;

@@ -57,0 +65,0 @@ this.metadata.timeZone = responseData.metadata.time_zone;

@@ -40,4 +40,4 @@ const chai = require("chai");

expect(request.parameters.hasOwnProperty("auth-id")).to.equal(true);
expect(request.parameters["auth-id"]).to.equal(mockAuthId);
expect(request.parameters.hasOwnProperty("key")).to.equal(true);
expect(request.parameters["key"]).to.equal(mockAuthId);
expect(request.headers.hasOwnProperty("Referer")).to.equal(true);

@@ -44,0 +44,0 @@ expect(request.headers["Referer"]).to.equal("https://" + mockHostName);

@@ -49,2 +49,3 @@ const chai = require("chai");

longitude: 37.0,
coordinate_license: 1,
precision: "38",

@@ -111,2 +112,3 @@ time_zone: "39",

expect(candidate.metadata.longitude).to.equal(37.0);
expect(candidate.metadata.coordinateLicense).to.equal("Gateway Spatial, LLC");
expect(candidate.metadata.precision).to.equal('38');

@@ -113,0 +115,0 @@ expect(candidate.metadata.timeZone).to.equal('39');

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