Background
In #784 the action's Cloudflare REST calls moved to a typed openapi-fetch client (src/common/cloudflare/api/client.ts), with the {success, result, errors} envelope unwrapped by unwrap/unwrapSuccess in src/common/cloudflare/api/fetch-result.ts.
The deployments:delete dev utility (bin/deployments/index.ts) was left out of that migration. It still:
- hand-builds the API URL (
/client/v4/accounts/${...}/pages/projects/${...}/deployments) and the ?force=true delete URL,
- sets the
Authorization / Content-Type headers manually,
- casts raw
fetch(...).json() to FetchResult<Array<PagesDeployment>> / FetchResult<null> (the same drift-prone assertion the rest of the codebase no longer does).
Task
Why it's deferred
bin/deployments/index.ts is a maintainer-only utility, not part of the bundled action, so it was out of scope for #784. Consistency-only, no behavior change expected.
Background
In #784 the action's Cloudflare REST calls moved to a typed
openapi-fetchclient (src/common/cloudflare/api/client.ts), with the{success, result, errors}envelope unwrapped byunwrap/unwrapSuccessinsrc/common/cloudflare/api/fetch-result.ts.The
deployments:deletedev utility (bin/deployments/index.ts) was left out of that migration. It still:/client/v4/accounts/${...}/pages/projects/${...}/deployments) and the?force=truedelete URL,Authorization/Content-Typeheaders manually,fetch(...).json()toFetchResult<Array<PagesDeployment>>/FetchResult<null>(the same drift-prone assertion the rest of the codebase no longer does).Task
bin/deployments/index.tstocloudflareClient.GET/DELETE+unwrap/unwrapSuccess, so its request paths, params, and response types are inferred from the generated schema.node bin/deployments/index.ts, no@actions/corecontext) — confirmuseCommonInputs()-based auth in the client middleware works here, or parameterize the token, since this path readsCLOUDFLARE_API_TOKENdirectly fromprocess.env.FetchResultimport here and re-check whetherFetchResultis still needed elsewhere (it's also used byfetch-error.ts).MOCK_API_PATHreference in__tests__/deploy/main.test.ts:38(the symbol was renamed toMOCK_API_PATH_PROJECT).Why it's deferred
bin/deployments/index.tsis a maintainer-only utility, not part of the bundled action, so it was out of scope for #784. Consistency-only, no behavior change expected.