Skip to content

Commit 3994ab4

Browse files
release: 0.4.1 (#21)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0f5c7e7 commit 3994ab4

6 files changed

Lines changed: 43 additions & 4 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.4.0"
2+
".": "0.4.1"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 91
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/postgrid%2Fpostgrid-be6a47768faf3612d1dc9c8a108edb10a6c5a4e52b78cc7f4768e1d497e11e08.yml
33
openapi_spec_hash: a3ed2b74031c834a724b67db9ab6b23d
4-
config_hash: 976efc54edcbbcdb2281d74f6d9f2c98
4+
config_hash: fd861cd701dc9f34c859bd7a19269d99

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.4.1 (2025-11-12)
4+
5+
Full Changelog: [v0.4.0...v0.4.1](https://github.com/postgrid/postgrid-node/compare/v0.4.0...v0.4.1)
6+
7+
### Bug Fixes
8+
9+
* **api:** small readme updates ([2a166c7](https://github.com/postgrid/postgrid-node/commit/2a166c7e2577102958777f3e9b921f5772a7ad12))
10+
311
## 0.4.0 (2025-11-12)
412

513
Full Changelog: [v0.3.0...v0.4.0](https://github.com/postgrid/postgrid-node/compare/v0.3.0...v0.4.0)

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,37 @@ On timeout, an `APIConnectionTimeoutError` is thrown.
125125

126126
Note that requests which time out will be [retried twice by default](#retries).
127127

128+
## Auto-pagination
129+
130+
List methods in the PostGrid API are paginated.
131+
You can use the `for await … of` syntax to iterate through items across all pages:
132+
133+
```ts
134+
async function fetchAllLetters(params) {
135+
const allLetters = [];
136+
// Automatically fetches more pages as needed.
137+
for await (const letter of client.printMail.letters.list({ limit: 100 })) {
138+
allLetters.push(letter);
139+
}
140+
return allLetters;
141+
}
142+
```
143+
144+
Alternatively, you can request a single page at a time:
145+
146+
```ts
147+
let page = await client.printMail.letters.list({ limit: 100 });
148+
for (const letter of page.data) {
149+
console.log(letter);
150+
}
151+
152+
// Convenience methods are provided for manually paginating:
153+
while (page.hasNextPage()) {
154+
page = await page.getNextPage();
155+
// ...
156+
}
157+
```
158+
128159
## Advanced Usage
129160

130161
### Accessing raw Response data (e.g., headers)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postgrid-node",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "The official TypeScript library for the Post Grid API",
55
"author": "Post Grid <support@postgrid.com>",
66
"types": "dist/index.d.ts",

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.4.0'; // x-release-please-version
1+
export const VERSION = '0.4.1'; // x-release-please-version

0 commit comments

Comments
 (0)