Skip to content

Bad/wrong/non-existent? typescript types not congruent with docs #2697

@rbbydotdev

Description

@rbbydotdev

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

From what I can tell from https://developers.cloudflare.com/api/node/resources/pages/subresources/projects/subresources/deployments/methods/create/#(params)%20default

The following is correct, and running it seems to be so as I get a 200,

      const deployment = await this.cloudflare.pages.projects.deployments.create(projectName, {
        account_id: accountId,
        branch: "main",
        manifest: JSON.stringify(manifest),
      });

I get the error Object literal may only specify known properties, and 'manifest' does not exist in type 'DeploymentCreateParams'.ts(2353)

Further investigation shows the type for DeploymentCreateParams as

export interface DeploymentCreateParams {
  /**
   * Path param: Identifier
   */
  account_id: string;

  /**
   * Body param: The branch to build the new deployment from. The `HEAD` of the
   * branch will be used. If omitted, the production branch will be used by default.
   */
  branch?: string;
}

SO it is obviously missing the type data, but this type data appears to be present in the documentation

Package Info:

cloudflare@5.2.0 | Apache-2.0 | deps: 7 | versions: 57
The official TypeScript library for the Cloudflare API

dist
.tarball: https://registry.npmjs.org/cloudflare/-/cloudflare-5.2.0.tgz
.shasum: f2d386b2d6e128c5d98d9c8fc401e64b7ecff77a
.integrity: sha512-dVzqDpPFYR9ApEC9e+JJshFJZXcw4HzM8W+3DHzO5oy9+8rLC53G7x6fEf9A7/gSuSCxuvndzui5qJKftfIM9A==
.unpackedSize: 26.4 MB

To Reproduce

npm install cloudflare@5.2.0 and create your client with new Cloudflare({...})

Code snippets

OS

macos

Runtime version

5.9.3

Library version

5.2.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