lob 6.4.0 → 6.5.3
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 +22 -0
- package/README.md +3 -75
- package/lib/resources/cardOrders.js +21 -0
- package/lib/resources/cards.js +80 -0
- package/lib/resources/index.js +4 -1
- package/lib/resources/templates.js +32 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
### 6.5.3 (2022-01-04)
|
|
2
|
+
|
|
3
|
+
##### Features
|
|
4
|
+
* **templates** add support for HTML templates endpoint ([PR_258](https://github.com/lob/lob-node/pull/258))
|
|
5
|
+
|
|
6
|
+
### 6.5.2 (2021-10-18)
|
|
7
|
+
|
|
8
|
+
##### Bug Fix
|
|
9
|
+
* **cards:** adds card update route to expose cards update endpoint in SDK. ([PR_256](https://github.com/lob/lob-node/pull/256)) ([6870842](https://github.com/lob/lob-node/pull/256/commits/68708423b03c40c277a183285920b1408d234e4b))
|
|
10
|
+
|
|
11
|
+
### 6.5.1 (2021-10-14)
|
|
12
|
+
|
|
13
|
+
##### Bug Fix
|
|
14
|
+
* **card orders:** updates the card orders "quantity_ordered" field to "quantity" in the integration test & example to reflect the recent change in Lob API endpoint for creating card orders. ([PR_254](https://github.com/lob/lob-node/pull/254)) ([9d3a261](https://github.com/lob/lob-node/commit/9d3a261ea3e9dace1e5cd79f43c5cdb40568f6c2))
|
|
15
|
+
|
|
16
|
+
### 6.5.0 (2021-10-13)
|
|
17
|
+
|
|
18
|
+
##### Features
|
|
19
|
+
* **cards:** add support for cards endpoint ([PR_252](https://github.com/lob/lob-node/pull/252)) ([e744da5](https://github.com/lob/lob-node/pull/252/commits/e744da5a96543ef4df8245a554e2cf325b79bdfd))
|
|
20
|
+
* **card_orders:** add support for card orders endpoint ([PR_252](https://github.com/lob/lob-node/pull/252)) ([35bc050](https://github.com/lob/lob-node/pull/252/commits/35bc05046e2cd06029dec6e8799f82481cd2078a))
|
|
21
|
+
* **examples:** add examples for creating a card and card order ([PR_252](https://github.com/lob/lob-node/pull/252)) ([1c41494](https://github.com/lob/lob-node/pull/252/commits/1c41494d6a46414f2f9bd5bcd26ed589cff39a06))
|
|
22
|
+
|
|
1
23
|
### 6.4.0 (2021-09-21)
|
|
2
24
|
|
|
3
25
|
##### New Features
|
package/README.md
CHANGED
|
@@ -14,12 +14,14 @@ Node.js wrapper for the [Lob.com](https://lob.com) API. See full Lob.com documen
|
|
|
14
14
|
|
|
15
15
|
## Table of Contents
|
|
16
16
|
|
|
17
|
+
- [Table of Contents](#table-of-contents)
|
|
17
18
|
- [Getting Started](#getting-started)
|
|
18
19
|
- [Registration](#registration)
|
|
19
20
|
- [Installation](#installation)
|
|
20
21
|
- [Usage](#usage)
|
|
21
22
|
- [Options](#options)
|
|
22
23
|
- [Examples](#examples)
|
|
24
|
+
- [Accessing Response Headers](#accessing-response-headers)
|
|
23
25
|
- [API Documentation](#api-documentation)
|
|
24
26
|
- [Contributing](#contributing)
|
|
25
27
|
- [Testing](#testing)
|
|
@@ -131,81 +133,7 @@ Lob.addresses.retrieve('adr_bad_id')
|
|
|
131
133
|
|
|
132
134
|
## API Documentation
|
|
133
135
|
|
|
134
|
-
|
|
135
|
-
- [Versioning](https://lob.com/docs/node#version)
|
|
136
|
-
- [Errors](https://lob.com/docs/node#errors)
|
|
137
|
-
- [Rate Limiting](https://lob.com/docs/node#rate-limits)
|
|
138
|
-
- [Webhooks](https://lob.com/docs/node#webhooks)
|
|
139
|
-
- [Cancellation Windows](https://lob.com/docs/node#cancellation)
|
|
140
|
-
- [Scheduled Mailings](https://lob.com/docs/node#scheduled)
|
|
141
|
-
- [Metadata](https://lob.com/docs/node#metadata)
|
|
142
|
-
- [HTML Templates](https://lob.com/docs/node#templates)
|
|
143
|
-
- [Asset URLs](https://lob.com/docs/node#urls)
|
|
144
|
-
- **Addresses**
|
|
145
|
-
- [Address Book](https://lob.com/docs/node#addresses)
|
|
146
|
-
- [The Address Object](https://lob.com/docs/node#addresses_object)
|
|
147
|
-
- [Create an Address](https://lob.com/docs/node#addresses_create)
|
|
148
|
-
- [Retrieve an Address](https://lob.com/docs/node#addresses_retrieve)
|
|
149
|
-
- [Delete an Address](https://lob.com/docs/node#addresses_delete)
|
|
150
|
-
- [List all Addresses](https://lob.com/docs/node#addresses_list)
|
|
151
|
-
- **US Verification API**
|
|
152
|
-
- [US Verification API](https://lob.com/docs/node#us_verifications)
|
|
153
|
-
- [The US Verification Object](https://lob.com/docs/node#us_verifications_object)
|
|
154
|
-
- [Verify a US Address](https://lob.com/docs/node#us_verifications_create)
|
|
155
|
-
- [Bulk Verify US Addresses](https://lob.com/docs/node#us_verifications_bulk_create)
|
|
156
|
-
- [The US ZIP Lookup Object](https://lob.com/docs/node#us_zip_lookups_object)
|
|
157
|
-
- [Lookup a US ZIP Code](https://lob.com/docs/node#us_zip_lookups_create)
|
|
158
|
-
- [Reverse Lookup a Geocode Location](https://lob.com/docs/node#us_zip_lookups_create)
|
|
159
|
-
- [US Autocompletion API](https://lob.com/docs/node#us_autocompletions)
|
|
160
|
-
- [The US Autocompletion Object](https://lob.com/docs/node#us_autocompletions_object)
|
|
161
|
-
- [Autocomplete a US Address](https://lob.com/docs/node#us_autocompletions_create)
|
|
162
|
-
- [The US Autocompletion Test Environment](https://lob.com/docs/node#us-autocompletions-test-environment)
|
|
163
|
-
- **Int'l Verification API**
|
|
164
|
-
- [International Verifications](https://lob.com/docs/node#intl_verifications)
|
|
165
|
-
- [Verify an International Address](https://lob.com/docs/node#intl_verifications_create)
|
|
166
|
-
- [Bulk Verify International Addresses](https://lob.com/docs/node#intl_verifications_bulk_create)
|
|
167
|
-
- **Postcards API**
|
|
168
|
-
- [Postcards](https://lob.com/docs/node#postcards)
|
|
169
|
-
- [The Postcard Object](https://lob.com/docs/node#postcards_object)
|
|
170
|
-
- [Create a Postcard](https://lob.com/docs/node#postcards_create)
|
|
171
|
-
- [Retrieve a Postcard](https://lob.com/docs/node#postcards_retrieve)
|
|
172
|
-
- [Cancel a Postcard](https://lob.com/docs/node#postcards_delete)
|
|
173
|
-
- [List all Postcards](https://lob.com/docs/node#postcards_list)
|
|
174
|
-
- **Self Mailers API**
|
|
175
|
-
- [Self Mailers](https://lob.com/docs/node#self_mailers)
|
|
176
|
-
- [The Self Mailer Object](https://lob.com/docs/node#self_mailers_object)
|
|
177
|
-
- [Create a Self Mailer](https://lob.com/docs/node#self_mailers_create)
|
|
178
|
-
- [Retrieve a Self Mailer](https://lob.com/docs/node#self_mailers_retrieve)
|
|
179
|
-
- [Cancel a Self Mailer](https://lob.com/docs/node#self_mailers_delete)
|
|
180
|
-
- [List all Self Mailers](https://lob.com/docs/node#self_mailers_list)
|
|
181
|
-
- **Letters API**
|
|
182
|
-
- [Letters](https://lob.com/docs/node#letters)
|
|
183
|
-
- [The Letter Object](https://lob.com/docs/node#letters_object)
|
|
184
|
-
- [Create a Letter](https://lob.com/docs/node#letters_create)
|
|
185
|
-
- [Retrieve a Letter](https://lob.com/docs/node#letters_retrieve)
|
|
186
|
-
- [Cancel a Letter](https://lob.com/docs/node#letters_delete)
|
|
187
|
-
- [List all Letters](https://lob.com/docs/node#letters_list)
|
|
188
|
-
- **Checks API**
|
|
189
|
-
- [Checks](https://lob.com/docs/node#checks)
|
|
190
|
-
- [The Check Object](https://lob.com/docs/node#checks_object)
|
|
191
|
-
- [Create a Check](https://lob.com/docs/node#checks_create)
|
|
192
|
-
- [Retrieve a Check](https://lob.com/docs/node#checks_retrieve)
|
|
193
|
-
- [Cancel a Check](https://lob.com/docs/node#checks_delete)
|
|
194
|
-
- [List all Checks](https://lob.com/docs/node#checks_list)
|
|
195
|
-
- [Bank Accounts](https://lob.com/docs/node#bankaccounts)
|
|
196
|
-
- [The Bank Account Object](https://lob.com/docs/node#bankaccounts_object)
|
|
197
|
-
- [Create a Bank Account](https://lob.com/docs/node#bankaccounts_create)
|
|
198
|
-
- [Retrieve a Bank Account](https://lob.com/docs/node#bankaccounts_retrieve)
|
|
199
|
-
- [Delete a Bank Account](https://lob.com/docs/node#bankaccounts_delete)
|
|
200
|
-
- [Verify a Bank Account](https://lob.com/docs/node#bankaccounts_verify)
|
|
201
|
-
- [List all Bank Accounts](https://lob.com/docs/node#bankaccounts_list)
|
|
202
|
-
- **Appendix**
|
|
203
|
-
- [API Changelog](https://lob.com/docs/node#changelog)
|
|
204
|
-
- [The Tracking Event Object](https://lob.com/docs/node#tracking_event_object)
|
|
205
|
-
- [Events](https://lob.com/docs/node#events)
|
|
206
|
-
- [HTML Examples](https://lob.com/docs/node#html-examples)
|
|
207
|
-
- [Image Prepping](https://lob.com/docs/node#prepping)
|
|
208
|
-
- [US Verification Details](https://lob.com/docs/node#us_verification_details)
|
|
136
|
+
The full and comprehensive documentation of Lob's APIs is available [here](https://docs.lob.com/).
|
|
209
137
|
|
|
210
138
|
## Contributing
|
|
211
139
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ResourceBase = require('./resourceBase');
|
|
4
|
+
|
|
5
|
+
class CardOrders extends ResourceBase {
|
|
6
|
+
|
|
7
|
+
constructor (config) {
|
|
8
|
+
super('cards', config);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
list (cardId, params, callback) {
|
|
12
|
+
return this._transmit('GET', `${encodeURIComponent(cardId)}/orders`, null, params, null, callback);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
create (cardId, params, headers, callback) {
|
|
16
|
+
return this._transmit('POST', `${encodeURIComponent(cardId)}/orders`, null, params, headers, callback);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = CardOrders;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ResourceBase = require('./resourceBase');
|
|
4
|
+
|
|
5
|
+
class Cards extends ResourceBase {
|
|
6
|
+
|
|
7
|
+
constructor (config) {
|
|
8
|
+
super('cards', config);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
list (options, callback) {
|
|
12
|
+
|
|
13
|
+
if (typeof options === 'function') {
|
|
14
|
+
callback = options;
|
|
15
|
+
options = {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return this._transmit('GET', null, options, null, callback);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
retrieve (id, callback) {
|
|
22
|
+
return this._transmit('GET', id, null, null, callback);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
update (id, params, callback) {
|
|
26
|
+
return this._transmit('POST', id, null, params, callback);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
delete (id, callback) {
|
|
30
|
+
return this._transmit('DELETE', id, null, null, callback);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
create (params, headers, callback) {
|
|
34
|
+
let isBuffer;
|
|
35
|
+
|
|
36
|
+
if (params.front) {
|
|
37
|
+
isBuffer = Buffer.isBuffer(params.front);
|
|
38
|
+
|
|
39
|
+
if (isBuffer) {
|
|
40
|
+
params.front = {
|
|
41
|
+
value: params.front,
|
|
42
|
+
options: { filename: 'front.pdf' }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (params.back) {
|
|
48
|
+
isBuffer = Buffer.isBuffer(params.back);
|
|
49
|
+
|
|
50
|
+
if (isBuffer) {
|
|
51
|
+
params.back = {
|
|
52
|
+
value: params.back,
|
|
53
|
+
options: { filename: 'back.pdf' }
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
for (const p in params) {
|
|
59
|
+
|
|
60
|
+
if (p === 'merge_variables' && params[p] instanceof Object) {
|
|
61
|
+
params[p] = JSON.stringify(params[p]);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (p === 'front' || p === 'back' || !(params[p] instanceof Object)) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
for (const key in params[p]) {
|
|
69
|
+
params[`${p}[${key}]`] = params[p][key];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
delete params[p];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return this._transmit('POST', null, null, params, headers, callback);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
module.exports = Cards;
|
package/lib/resources/index.js
CHANGED
|
@@ -5,6 +5,8 @@ module.exports = {
|
|
|
5
5
|
bankAccounts: require('./bankAccounts'),
|
|
6
6
|
bulkIntlVerifications: require('./bulkIntlVerifications'),
|
|
7
7
|
bulkUSVerifications: require('./bulkUSVerifications'),
|
|
8
|
+
cards: require('./cards'),
|
|
9
|
+
cardOrders: require('./cardOrders'),
|
|
8
10
|
checks: require('./checks'),
|
|
9
11
|
intlVerifications: require('./intlVerifications'),
|
|
10
12
|
letters: require('./letters'),
|
|
@@ -13,5 +15,6 @@ module.exports = {
|
|
|
13
15
|
usAutocompletions: require('./usAutocompletions'),
|
|
14
16
|
usReverseGeocodeLookups: require('./usReverseGeocodeLookups'),
|
|
15
17
|
usVerifications: require('./usVerifications'),
|
|
16
|
-
usZipLookups: require('./usZipLookups')
|
|
18
|
+
usZipLookups: require('./usZipLookups'),
|
|
19
|
+
templates: require('./templates')
|
|
17
20
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ResourceBase = require('./resourceBase');
|
|
4
|
+
|
|
5
|
+
class Template extends ResourceBase {
|
|
6
|
+
constructor (config) {
|
|
7
|
+
super('templates', config);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
list (options, callback) {
|
|
11
|
+
if (typeof options === 'function') {
|
|
12
|
+
callback = options;
|
|
13
|
+
options = {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return this._transmit('GET', null, options, null, callback);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
create (options, callback) {
|
|
20
|
+
return this._transmit('POST', null, null, options, callback);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
retrieve (id, callback) {
|
|
24
|
+
return this._transmit('GET', id, null, null, callback);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
delete (id, callback) {
|
|
28
|
+
return this._transmit('DELETE', id, null, null, callback);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = Template;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"Lob.com",
|
|
11
11
|
"printing"
|
|
12
12
|
],
|
|
13
|
-
"version": "6.
|
|
13
|
+
"version": "6.5.3",
|
|
14
14
|
"homepage": "https://github.com/lob/lob-node",
|
|
15
15
|
"author": "Lob <support@lob.com> (https://lob.com/)",
|
|
16
16
|
"dependencies": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"test-no-cover": "cross-env NODE_ENV=test mocha test --recursive --timeout 30000",
|
|
47
47
|
"coverage": "nyc report --reporter=text",
|
|
48
48
|
"enforce": "nyc check-coverage --statements 100 --lines 100 --functions 100 --branches 100",
|
|
49
|
-
"
|
|
49
|
+
"test-lcov": "nyc report --reporter=lcov",
|
|
50
50
|
"lint": "eslint .",
|
|
51
51
|
"lint:fix": "eslint . --fix",
|
|
52
52
|
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags",
|