-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Confirm this is a Typescript library issue and not an underlying Cloudflare API issue
- This is an issue with the Typescript library
Describe the bug
I am attempting to paginate all pages of my cloudflare pages deployment items in cloudflare, but pages.projects.deployments.list
never returns all results:
const client = new Cloudflare({
apiToken: cloudflareApiToken
});
for await (const project of await client.pages.projects.list({
account_id
// The typescript assertion is required due to https://github.com/cloudflare/cloudflare-typescript/issues/2489
})
5E2C
as AsyncIterable<Cloudflare.Pages.Project>) {
for await (const deployment of await client.pages.projects.deployments.list(project.name, {
account_id,
per_page: 1 // intentionally using a very small `per_page` to re-produce the issue
})) {
// this loop only run 1 time and no more
}
}
And hasNextPage()
always returns false
.
To Reproduce
- Use
cloudflare
version 5.1.0 - Run the above code snippets
Code snippets
// See above
OS
macOS
Runtime version
TypeScript 5.9.2, Node.js v22.19.0
Library version
v5.1.0
Metadata
Metadata
Assignees
Labels
No labels