mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #48] [CLOSED] feat: add asset deletion #57
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-typescript-sdk#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/48
Author: @wei-hai
Created: 8/13/2026
Status: ❌ Closed
Base:
main← Head:wei/asset-delete📝 Commits (1)
01552f0feat: add asset deletion📊 Changes
5 files changed (+128 additions, -1 deletions)
View changed files
📝
src/low/transport.test.ts(+24 -0)📝
src/low/transport.ts(+16 -0)📝
src/sdk/assets.test.ts(+29 -1)📝
src/sdk/assets.ts(+19 -0)📝
test/support/stub-server.ts(+40 -0)📄 Description
DELETE /api/v2/assets/{id}is live server-side and the Python SDK is adding support, but this SDK had none — a gap between two clients kept deliberately in lockstep.Surface, mirroring Python
ComfyLow.deleteAsset(id, { signal })Asset.delete(signal?)assets.delete(id, signal?)The
sdk-layer methods takesignalpositionally, matching the existingcommit(signal?)/asReference(signal?)convention rather than the low layer's options object. Deleting an uncommitted handle throws without touching the network, and a successful delete clears the handle's id.Error mapping — existing types only
Checked the canonical contract rather than guessing:
204on success,404 asset_not_foundfor an unknown or repeat delete,409 asset_in_usewhen a workflow version still references it.404already maps toNotFound.409has no dedicated class, and I didn't add one — it surfaces through the existingBY_CODE[code] ?? ApiErrorfallback as a typedApiErrorwithcode === "asset_in_use"andhttpStatus === 409, which is inspectable without inventing a class for a single status.Why hand-written
This repo's vendored
spec/openapi.yamldoesn't describe the operation yet — the sync carrying it is open as #47. RegisteringdeleteAssetinOPERATION_IDSnow would breakspec-coverage.test.ts, which asserts exact parity with the current vendored spec. So the call is hand-written,spec/is untouched, and a comment marks it to move onto the generated client on the next sync — same shape as the job-workflow call.Verification
oxlint,oxfmt --check,tsc --noEmit, spec-drift, public-repo hygiene, and build all clean; 159 tests pass.Tests use the repo's stub server rather than mocking the transport, and cover a successful delete (with the follow-up
GETthen 404ing), a repeat delete surfacingNotFound, an in-use delete surfacing the typed 409, deleting by id without fetching, and the uncommitted-handle guard.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.