postgrid-node 0.2.0 → 0.3.0
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 +8 -0
- package/README.md +18 -26
- package/package.json +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2025-11-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/postgrid/postgrid-node/compare/v0.2.0...v0.3.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([abcab58](https://github.com/postgrid/postgrid-node/commit/abcab5822d2a5c0d33df26fe3b900f86f8c796e1))
|
|
10
|
+
|
|
3
11
|
## 0.2.0 (2025-11-06)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.1.0-alpha.7...v0.2.0](https://github.com/postgrid/postgrid-node/compare/v0.1.0-alpha.7...v0.2.0)
|
package/README.md
CHANGED
|
@@ -42,15 +42,11 @@ This library includes TypeScript definitions for all request params and response
|
|
|
42
42
|
import PostGrid from 'postgrid-node';
|
|
43
43
|
|
|
44
44
|
const client = new PostGrid({
|
|
45
|
-
|
|
45
|
+
addressVerificationAPIKey: process.env['POSTGRID_ADDRESS_VERIFICATION_API_KEY'], // This is the default and can be omitted
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
const params: PostGrid.
|
|
49
|
-
|
|
50
|
-
countryCode: 'countryCode',
|
|
51
|
-
firstName: 'firstName',
|
|
52
|
-
};
|
|
53
|
-
const contact: PostGrid.PrintMail.Contact = await client.printMail.contacts.create(params);
|
|
48
|
+
const params: PostGrid.AddressVerificationVerifyParams = { address: 'address' };
|
|
49
|
+
const response: PostGrid.AddressVerificationVerifyResponse = await client.addressVerification.verify(params);
|
|
54
50
|
```
|
|
55
51
|
|
|
56
52
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -63,17 +59,15 @@ a subclass of `APIError` will be thrown:
|
|
|
63
59
|
|
|
64
60
|
<!-- prettier-ignore -->
|
|
65
61
|
```ts
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
});
|
|
62
|
+
const response = await client.addressVerification.verify({ address: 'address' }).catch(async (err) => {
|
|
63
|
+
if (err instanceof PostGrid.APIError) {
|
|
64
|
+
console.log(err.status); // 400
|
|
65
|
+
console.log(err.name); // BadRequestError
|
|
66
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
67
|
+
} else {
|
|
68
|
+
throw err;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
77
71
|
```
|
|
78
72
|
|
|
79
73
|
Error codes are as follows:
|
|
@@ -105,7 +99,7 @@ const client = new PostGrid({
|
|
|
105
99
|
});
|
|
106
100
|
|
|
107
101
|
// Or, configure per-request:
|
|
108
|
-
await client.
|
|
102
|
+
await client.addressVerification.verify({ address: 'address' }, {
|
|
109
103
|
maxRetries: 5,
|
|
110
104
|
});
|
|
111
105
|
```
|
|
@@ -122,7 +116,7 @@ const client = new PostGrid({
|
|
|
122
116
|
});
|
|
123
117
|
|
|
124
118
|
// Override per-request:
|
|
125
|
-
await client.
|
|
119
|
+
await client.addressVerification.verify({ address: 'address' }, {
|
|
126
120
|
timeout: 5 * 1000,
|
|
127
121
|
});
|
|
128
122
|
```
|
|
@@ -145,17 +139,15 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
145
139
|
```ts
|
|
146
140
|
const client = new PostGrid();
|
|
147
141
|
|
|
148
|
-
const response = await client.
|
|
149
|
-
.create({ addressLine1: 'addressLine1', countryCode: 'countryCode', firstName: 'firstName' })
|
|
150
|
-
.asResponse();
|
|
142
|
+
const response = await client.addressVerification.verify({ address: 'address' }).asResponse();
|
|
151
143
|
console.log(response.headers.get('X-My-Header'));
|
|
152
144
|
console.log(response.statusText); // access the underlying Response object
|
|
153
145
|
|
|
154
|
-
const { data:
|
|
155
|
-
.
|
|
146
|
+
const { data: response, response: raw } = await client.addressVerification
|
|
147
|
+
.verify({ address: 'address' })
|
|
156
148
|
.withResponse();
|
|
157
149
|
console.log(raw.headers.get('X-My-Header'));
|
|
158
|
-
console.log(
|
|
150
|
+
console.log(response.data);
|
|
159
151
|
```
|
|
160
152
|
|
|
161
153
|
### Logging
|
package/package.json
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.3.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.3.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.3.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|