lob 6.5.3 → 6.6.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ### 6.6.1 (2022-04-05)
2
+ ##### Maintinence
3
+ * **autocomplete** add query param for address casing
4
+ * Update dependency version
5
+ * Updates to CI process
6
+ * Updates to Repo branch naming
7
+
8
+ ### 6.5.5 (2022-01-14)
9
+ ##### Maintinence
10
+ * Removed Bluebird dependency and replaced with p-map
11
+ * Updated 4 out of date dev dependencies
12
+ * Updated min required version of NodeJS to 10
13
+ * Removed package-lock.json from gitignore - it is now included in the repo.
14
+
1
15
  ### 6.5.3 (2022-01-04)
2
16
 
3
17
  ##### Features
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const Bluebird = require('bluebird');
4
3
  const Request = require('request');
5
4
  const Stream = require('stream');
6
5
 
@@ -70,8 +69,9 @@ class ResourceBase {
70
69
  }
71
70
  }
72
71
 
73
- return new Bluebird((resolve, reject) => {
72
+ const promise = new Promise((resolve, reject) => {
74
73
  Request(opts, (err, resp, body) => {
74
+ /* istanbul ignore next */
75
75
  body = body || {};
76
76
 
77
77
  /* istanbul ignore next */
@@ -101,7 +101,13 @@ class ResourceBase {
101
101
 
102
102
  return resolve(body);
103
103
  });
104
- }).nodeify(callback);
104
+ })
105
+
106
+ if (callback) {
107
+ promise.then(body => callback(null, body), err => callback(err));
108
+ }
109
+
110
+ return promise
105
111
  }
106
112
 
107
113
  }
@@ -8,8 +8,12 @@ class USAutocompletions extends ResourceBase {
8
8
  super('us_autocompletions', config);
9
9
  }
10
10
 
11
- autocomplete (params, callback) {
12
- return this._transmit('POST', null, null, params, null, callback);
11
+ autocomplete (params, query_param, callback) {
12
+ if (typeof query_param === 'function') {
13
+ callback = query_param;
14
+ query_param = {};
15
+ }
16
+ return this._transmit('POST', null, query_param, params, null, callback);
13
17
  }
14
18
 
15
19
  }
package/package.json CHANGED
@@ -10,11 +10,10 @@
10
10
  "Lob.com",
11
11
  "printing"
12
12
  ],
13
- "version": "6.5.3",
13
+ "version": "6.6.1",
14
14
  "homepage": "https://github.com/lob/lob-node",
15
15
  "author": "Lob <support@lob.com> (https://lob.com/)",
16
16
  "dependencies": {
17
- "bluebird": "^3.0.6",
18
17
  "request": "^2.88.0"
19
18
  },
20
19
  "devDependencies": {
@@ -23,13 +22,14 @@
23
22
  "coveralls": "^3.0.5",
24
23
  "cross-env": "^5.2.0",
25
24
  "csv-parse": "^4.4.6",
26
- "eslint": "^5.16.0",
25
+ "eslint": "^8.6.0",
27
26
  "eslint-config-lob": "^1.0.1",
28
27
  "generate-changelog": "^1.0.0",
29
- "json-2-csv": "^1.3.0",
30
- "mocha": "~5.2.0",
28
+ "json-2-csv": "^3.15.1",
29
+ "mocha": "^9.1.3",
31
30
  "moment": "^2.22.1",
32
- "nyc": "^14.1.1",
31
+ "nyc": "^15.1.0",
32
+ "p-map": "^2.1.0",
33
33
  "uuid": "^3.1.0"
34
34
  },
35
35
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "bugs:": "https://github.com/lob/lob-node/issues",
40
40
  "main": "./lib/index",
41
41
  "engines": {
42
- "node": ">= 6.0.0"
42
+ "node": ">= 10.0.0"
43
43
  },
44
44
  "scripts": {
45
45
  "test": "cross-env NODE_ENV=test nyc mocha test --recursive --timeout 30000",