8000 DatabaseExportResponse `status` property is missing "active" option · Issue #2669 · cloudflare/cloudflare-typescript · GitHub
[go: up one dir, main page]

Skip to content

DatabaseExportResponse status property is missing "active" option #2669

@SimonDMC

Description

@SimonDMC

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

  1. Request a database export
  2. Try to check for response.status == "active"
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0