basecamp-client 1.0.3 → 1.0.5
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/README.md +13 -0
- package/dist/index.d.mts +21559 -8072
- package/dist/index.d.ts +21559 -8072
- package/dist/index.js +974 -688
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +973 -688
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,19 @@ const projects = await client.projects.list({ query: {} });
|
|
|
27
27
|
console.log(projects.body);
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
### Iterate through paginated endpoints
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
for await (const project of asyncPagedIterator({
|
|
34
|
+
fetchPage: client.projects.list,
|
|
35
|
+
request: { query: {} },
|
|
36
|
+
})) {
|
|
37
|
+
console.log(project.name);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`asyncPagedIterator` follows the `Link` response headers emitted by Basecamp collection routes, automatically fetching `page=2`, `page=3`, and beyond until the API signals the final page. The helper yields each item returned by the underlying endpoint or lets you define a custom `extractItems` function for non-array responses.
|
|
42
|
+
|
|
30
43
|
### Refresh OAuth tokens
|
|
31
44
|
|
|
32
45
|
```ts
|