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.
- package/{LICENSE → LICENSE.md} +2 -1
- package/Makefile +3 -6
- package/Readme.md +2 -0
- package/package.json +3 -13
- package/src/AgentSender.js +0 -2
- package/src/BaseUrlSender.js +0 -2
- package/src/CustomHeaderSender.js +0 -2
- package/src/HttpSender.js +0 -1
- package/src/LicenseSender.js +0 -2
- package/src/SigningSender.js +0 -1
- package/src/StatusCodeSender.js +0 -1
- package/src/international_address_autocomplete/Client.js +0 -1
- package/src/international_street/Client.js +0 -1
- package/src/us_autocomplete/Client.js +0 -1
- package/src/us_autocomplete_pro/Client.js +0 -1
- package/src/us_extract/Client.js +0 -1
- package/src/util/sendBatch.js +0 -1
- package/tests/fixtures/mock_senders.js +0 -1
- package/tests/international_address_autocomplete/test_Client.js +0 -2
- package/tests/test_BaseUrlSender.js +0 -1
- package/tests/test_CustomHeaderSender.js +0 -1
- package/tests/test_LicenseSender.js +0 -1
- package/tests/us_autocomplete/test_Client.js +1 -3
- package/tests/us_autocomplete_pro/test_Client.js +1 -3
- package/tests/us_extract/test_client.js +1 -3
- package/tests/us_reverse_geo/test_Client.js +0 -2
- package/tests/us_street/test_Client.js +1 -3
- package/tests/us_zipcode/test_Client.js +1 -4
package/{LICENSE → LICENSE.md}
RENAMED
|
@@ -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
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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.
|
|
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
|
-
"
|
|
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
|
}
|
package/src/AgentSender.js
CHANGED
package/src/BaseUrlSender.js
CHANGED
package/src/HttpSender.js
CHANGED
package/src/LicenseSender.js
CHANGED
package/src/SigningSender.js
CHANGED
package/src/StatusCodeSender.js
CHANGED
|
@@ -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
|
|
package/src/us_extract/Client.js
CHANGED
package/src/util/sendBatch.js
CHANGED
|
@@ -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 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 () {
|
|
@@ -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
|
|
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
|
|
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
|
|
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_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
|
|
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
|
|
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 () {
|