-
Notifications
You must be signed in to change notification settings - Fork 83
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
Requesting a D1 .sql export via the Cloudflare API returns status: 'active'
while it's exporting, but the library is missing this option:
status?: 'complete' | 'error'; |
To Reproduce
- Request a database export
- Try to check for
response.status == "active"
- Observe TypeScript error
This comparison appears to be unintentional because the types '"complete" | "error" | undefined' and '"active"' have no overlap.
Code snippets
const client = new Cloudflare({
apiToken: env.CLOUDFLARE_TOKEN,
});
let response = await client.d1.database.export(env.CLOUDFLARE_DB, {
account_id: env.CLOUDFLARE_ACCOUNT,
output_format: "polling",
});
while (response.status == "active") {
// ↑ typescript error
}
OS
Windows
Runtime version
Typescript 5.7.3
Library version
v4.5.0
Metadata
Metadata
Assignees
Labels
No labels