smartystreets-javascript-sdk 1.13.2 → 1.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
@@ -186,7 +187,7 @@
186
187
  same "printed page" as the copyright notice for easier
187
188
  identification within third-party archives.
188
189
 
189
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2022 Smarty
190
191
 
191
192
  Licensed under the Apache License, Version 2.0 (the "License");
192
193
  you may not use this file except in compliance with the License.
package/Makefile CHANGED
@@ -4,16 +4,13 @@ VERSION := $(shell tagit -p --dry-run)
4
4
  VERSION_FILE1 := package.json
5
5
  VERSION_FILE2 := package-lock.json
6
6
 
7
- clean:
8
- rm -rf dist/
9
-
10
- test: clean node_modules
7
+ test: node_modules
11
8
  npm run test
12
9
 
13
10
  node_modules:
14
11
  npm install
15
12
 
16
- publish: clean test version upload unversion
13
+ publish: test version upload unversion
17
14
  tagit -p
18
15
  git push origin --tags
19
16
 
@@ -28,4 +25,4 @@ unversion:
28
25
  git checkout "$(VERSION_FILE1)" "$(VERSION_FILE2)"
29
26
 
30
27
  # node_modules is a real directory target
31
- .PHONY: clean test publish upload version unversion
28
+ .PHONY: test publish upload version unversion
package/Readme.md CHANGED
@@ -1,3 +1,5 @@
1
+ # SMARTY DISCLAIMER: Subject to the terms of the associated license agreement, this software is freely available for your use. This software is FREE, AS IN PUPPIES, and is a gift. Enjoy your new responsibility. This means that while we may consider enhancement requests, we may or may not choose to entertain requests at our sole and absolute discretion.
2
+
1
3
  # Smarty JavaScript SDK
2
4
 
3
5
  The official client libraries for accessing Smarty APIs with JavaScript.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartystreets-javascript-sdk",
3
- "version": "1.13.2",
3
+ "version": "1.13.5",
4
4
  "description": "Quick and easy Smarty address validation.",
5
5
  "keywords": [
6
6
  "smarty",
@@ -32,21 +32,11 @@
32
32
  "url": "github:smartystreets/smartystreets-javascript-sdk"
33
33
  },
34
34
  "devDependencies": {
35
- "aws-sdk": "^2.803.0",
36
- "babel-core": "^6.26.0",
37
- "babel-preset-env": "^1.6.1",
38
- "babelify": "^8.0.0",
39
- "browserify": "^16.5.2",
40
35
  "chai": "^4.2.0",
41
- "chai-as-promised": "^7.1.1",
42
- "mocha": "^9.2.1",
43
- "s3-upload-stream": "^1.0.7",
44
- "tinyify": "^2.5.2",
45
- "zlib": "^1.0.5"
36
+ "mocha": "^9.2.1"
46
37
  },
47
38
  "dependencies": {
48
39
  "axios": "^0.26.1",
49
- "axios-retry": "3.2.0",
50
- "promise": "^8.1.0"
40
+ "axios-retry": "3.2.0"
51
41
  }
52
42
  }
@@ -1,5 +1,3 @@
1
- const Promise = require("promise");
2
-
3
1
  class AgentSender {
4
2
  constructor(innerSender) {
5
3
  this.sender = innerSender;
@@ -1,5 +1,3 @@
1
- const Promise = require("promise");
2
-
3
1
  class BaseUrlSender {
4
2
  constructor(innerSender, urlOverride) {
5
3
  this.urlOverride = urlOverride;
@@ -1,5 +1,3 @@
1
- const Promise = require("promise");
2
-
3
1
  class CustomHeaderSender {
4
2
  constructor(innerSender, customHeaders) {
5
3
  this.sender = innerSender;
package/src/HttpSender.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const Response = require("./Response");
2
2
  const Axios = require("axios");
3
3
  const axiosRetry = require("axios-retry");
4
- const Promise = require("promise");
5
4
 
6
5
  class HttpSender {
7
6
  constructor(timeout = 10000, retries = 5, proxyConfig, debug = false) {
@@ -1,5 +1,3 @@
1
- const Promise = require("promise");
2
-
3
1
  class LicenseSender {
4
2
  constructor(innerSender, licenses) {
5
3
  this.sender = innerSender;
@@ -1,4 +1,3 @@
1
- const Promise = require("promise");
2
1
  const UnprocessableEntityError = require("./Errors").UnprocessableEntityError;
3
2
  const SharedCredentials = require("./SharedCredentials");
4
3
 
@@ -1,4 +1,3 @@
1
- const Promise = require("promise");
2
1
  const Errors = require("./Errors");
3
2
 
4
3
  class StatusCodeSender {
@@ -1,6 +1,5 @@
1
1
  const Errors = require("../Errors");
2
2
  const Request = require("../Request");
3
- const Promise = require("promise");
4
3
  const Suggestion = require("./Suggestion");
5
4
 
6
5
  class Client {
@@ -1,7 +1,6 @@
1
1
  const Request = require("../Request");
2
2
  const Errors = require("../Errors");
3
3
  const Candidate = require("./Candidate");
4
- const Promise = require("promise");
5
4
  const buildInputData = require("../util/buildInputData");
6
5
  const keyTranslationFormat = require("../util/apiToSDKKeyMap").internationalStreet;
7
6
 
@@ -1,7 +1,6 @@
1
1
  const Errors = require("../Errors");
2
2
  const Request = require("../Request");
3
3
  const Suggestion = require("./Suggestion");
4
- const Promise = require("promise");
5
4
 
6
5
  /**
7
6
  * This client sends lookups to the Smarty US Autocomplete API, <br>
@@ -1,7 +1,6 @@
1
1
  const Errors = require("../Errors");
2
2
  const Request = require("../Request");
3
3
  const Suggestion = require("./Suggestion");
4
- const Promise = require("promise");
5
4
 
6
5
  /**
7
6
  * This client sends lookups to the Smarty US Autocomplete Pro API, <br>
@@ -1,5 +1,4 @@
1
1
  const Errors = require("../Errors");
2
- const Promise = require("promise");
3
2
  const Request = require("../Request");
4
3
  const Result = require("./Result");
5
4
 
@@ -1,5 +1,4 @@
1
1
  const Request = require("../Request");
2
- const Promise = require("promise");
3
2
  const Errors = require("../Errors");
4
3
  const buildInputData = require("../util/buildInputData");
5
4
 
@@ -1,4 +1,3 @@
1
- const Promise = require("promise");
2
1
  const Response = require("../../src/Response");
3
2
 
4
3
  module.exports = {
@@ -1,7 +1,5 @@
1
1
  const chai = require("chai");
2
2
  const expect = chai.expect;
3
- const chaiAsPromised = require("chai-as-promised");
4
- chai.use(chaiAsPromised);
5
3
  const Client = require("../../src/international_address_autocomplete/Client");
6
4
  const Lookup = require("../../src/international_address_autocomplete/Lookup");
7
5
  const Suggestion = require("../../src/international_address_autocomplete/Suggestion");
@@ -2,7 +2,6 @@ const chai = require("chai");
2
2
  const expect = chai.expect;
3
3
  const BaseUrlSender = require("../src/BaseUrlSender");
4
4
  const Request = require("../src/Request");
5
- const Promise = require("promise");
6
5
 
7
6
  describe("A base url sender", function () {
8
7
  let innerSender;
@@ -2,7 +2,6 @@ const chai = require("chai");
2
2
  const expect = chai.expect;
3
3
  const CustomHeaderSender = require("../src/CustomHeaderSender");
4
4
  const Request = require("../src/Request");
5
- const Promise = require("promise");
6
5
 
7
6
  describe("A custom header sender", function () {
8
7
  it ("adds custom headers to the request.", function () {
@@ -2,7 +2,6 @@ const chai = require("chai");
2
2
  const expect = chai.expect;
3
3
  const LicenseSender = require("../src/LicenseSender");
4
4
  const Request = require("../src/Request");
5
- const Promise = require("promise");
6
5
 
7
6
  describe("A license sender", function () {
8
7
  let innerSender;
@@ -1,7 +1,5 @@
1
1
  const chai = require("chai");
2
2
  const expect = chai.expect;
3
- const chaiAsPromised = require("chai-as-promised");
4
- chai.use(chaiAsPromised);
5
3
  const Client = require("../../src/us_autocomplete/Client");
6
4
  const Lookup = require("../../src/us_autocomplete/Lookup");
7
5
  const Suggestion = require("../../src/us_autocomplete/Suggestion");
@@ -72,7 +70,7 @@ describe("A US Autocomplete Client", function () {
72
70
  let client = new Client(mockSender);
73
71
  let lookup = new Lookup("¯\\_(ツ)_/¯");
74
72
 
75
- return expect(client.send(lookup)).to.eventually.be.rejectedWith(expectedError);
73
+ return client.send(lookup).catch((e) => {expect(e).to.equal(expectedError);});
76
74
  });
77
75
 
78
76
  it("returns an empty array when no suggestions are returned.", () => {
@@ -1,7 +1,5 @@
1
1
  const chai = require("chai");
2
2
  const expect = chai.expect;
3
- const chaiAsPromised = require("chai-as-promised");
4
- chai.use(chaiAsPromised);
5
3
  const Client = require("../../src/us_autocomplete_pro/Client");
6
4
  const Lookup = require("../../src/us_autocomplete_pro/Lookup");
7
5
  const Suggestion = require("../../src/us_autocomplete_pro/Suggestion");
@@ -86,7 +84,7 @@ describe("A US Autocomplete Pro Client", function () {
86
84
  let client = new Client(mockSender);
87
85
  let lookup = new Lookup("¯\\_(ツ)_/¯");
88
86
 
89
- return expect(client.send(lookup)).to.eventually.be.rejectedWith(expectedError);
87
+ return client.send(lookup).catch((e) => {expect(e).to.equal(expectedError);});
90
88
  });
91
89
 
92
90
  it("returns an empty array when no suggestions are returned.", () => {
@@ -1,7 +1,5 @@
1
1
  const chai = require("chai");
2
2
  const expect = chai.expect;
3
- const chaiAsPromised = require("chai-as-promised");
4
- chai.use(chaiAsPromised);
5
3
  const Client = require("../../src/us_extract/Client");
6
4
  const Lookup = require("../../src/us_extract/Lookup");
7
5
  const Result = require("../../src/us_extract/Result");
@@ -69,7 +67,7 @@ describe("A US Extract Client", function () {
69
67
  let client = new Client(mockSender);
70
68
  let lookup = new Lookup("Shine on you crazy diamond.");
71
69
 
72
- return expect(client.send(lookup)).to.eventually.be.rejectedWith(expectedError);
70
+ return client.send(lookup).catch((e) => {expect(e).to.equal(expectedError);});
73
71
  });
74
72
 
75
73
  it("attaches result from a response to a lookup.", function () {
@@ -1,6 +1,4 @@
1
1
  const chai = require("chai");
2
- const chaiAsPromised = require("chai-as-promised");
3
- chai.use(chaiAsPromised);
4
2
  const expect = chai.expect;
5
3
  const Client = require("../../src/us_reverse_geo/Client");
6
4
  const Lookup = require("../../src/us_reverse_geo/Lookup");
@@ -1,6 +1,4 @@
1
1
  const chai = require("chai");
2
- const chaiAsPromised = require("chai-as-promised");
3
- chai.use(chaiAsPromised);
4
2
  const expect = chai.expect;
5
3
  const Client = require("../../src/us_street/Client");
6
4
  const ClientBuilder = require("../../src/ClientBuilder");
@@ -122,7 +120,7 @@ describe("A US Street client", function () {
122
120
  let client = new Client(mockSender);
123
121
  let lookup = new Lookup();
124
122
 
125
- return expect(client.send(lookup)).to.eventually.be.rejectedWith(expectedMockError);
123
+ return client.send(lookup).catch((e) => {expect(e).to.equal(expectedMockError);});
126
124
  });
127
125
 
128
126
  it("throws an exception if a lookup is undefined.", function () {
@@ -1,13 +1,10 @@
1
1
  let chai = require("chai");
2
- const chaiAsPromised = require("chai-as-promised");
3
- chai.use(chaiAsPromised);
4
2
  const expect = chai.expect;
5
3
  const Client = require("../../src/us_zipcode/Client");
6
4
  const Lookup = require("../../src/us_zipcode/Lookup");
7
5
  const Result = require("../../src/us_zipcode/Result");
8
6
  const Batch = require("../../src/Batch");
9
7
  const errors = require("../../src/Errors");
10
- const Promise = require("promise");
11
8
  const MockSender = require("../fixtures/mock_senders").MockSender;
12
9
  const MockSenderWithResponse = require("../fixtures/mock_senders").MockSenderWithResponse;
13
10
 
@@ -126,7 +123,7 @@ describe("A US Zipcode client", function () {
126
123
  let client = new Client(mockSender);
127
124
  let lookup = new Lookup();
128
125
 
129
- return expect(client.send(lookup)).to.eventually.be.rejectedWith(expectedMockError);
126
+ return client.send(lookup).catch((e) => {expect(e).to.equal(expectedMockError);});
130
127
  });
131
128
 
132
129
  it("throws an exception if a lookup is undefined.", function () {