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 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
- printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
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.PrintMail.ContactCreateParams = {
49
- addressLine1: 'addressLine1',
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 contact = await client.printMail.contacts
67
- .create({ addressLine1: 'addressLine1', countryCode: 'countryCode', firstName: 'firstName' })
68
- .catch(async (err) => {
69
- if (err instanceof PostGrid.APIError) {
70
- console.log(err.status); // 400
71
- console.log(err.name); // BadRequestError
72
- console.log(err.headers); // {server: 'nginx', ...}
73
- } else {
74
- throw err;
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.printMail.contacts.create({ addressLine1: 'addressLine1', countryCode: 'countryCode', firstName: 'firstName' }, {
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.printMail.contacts.create({ addressLine1: 'addressLine1', countryCode: 'countryCode', firstName: 'firstName' }, {
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.printMail.contacts
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: contact, response: raw } = await client.printMail.contacts
155
- .create({ addressLine1: 'addressLine1', countryCode: 'countryCode', firstName: 'firstName' })
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(contact.id);
150
+ console.log(response.data);
159
151
  ```
160
152
 
161
153
  ### Logging
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgrid-node",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "The official TypeScript library for the Post Grid API",
5
5
  "author": "Post Grid <support@postgrid.com>",
6
6
  "types": "./index.d.ts",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
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.2.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.2.0";
1
+ export declare const VERSION = "0.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.0'; // x-release-please-version
4
+ exports.VERSION = '0.3.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.0'; // x-release-please-version
1
+ export const VERSION = '0.3.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map