Skip to content

dev-api: add create-draft to DevApiActions and contract types - #6

Draft
charlesberret wants to merge 1 commit into
mainfrom
cursor/add-create-draft-contract-f9a4
Draft

charlesberret wants to merge 1 commit into
mainfrom
cursor/add-create-draft-contract-f9a4

Conversation

@charlesberret

Copy link
Copy Markdown
Owner

Summary

  • Adds create-draft to DevApiActions with DevApiCreateDraftRequest / DevApiCreateDraftResponse in packages/dev-api/src/contract.ts.
  • Updates the contract header to describe createDevContentHandler as the HTTP implementation (site injects gating, editor, look).
  • Adds parseCreateDraftBody for shape, kind, and path-escape checks; wires it in the handler.
  • Adds four handler tests: valid work draft, invalid shape, path escape in draftTitle, and id collision (kettle → kettle-2).
  • Documents the action in packages/dev-api/README.md.

Checks

npm run build -w @shellside/edit-protocol && npm run build -w @shellside/dev-api && npm run test -w @shellside/dev-api

(edit-protocol build is a workspace dependency for dev-api compile.)

Last lines of test output:

# tests 20
# suites 3
# pass 20
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 268.795976
Open in Web Open in Cursor 

Fixes LAB-2358

Extend DevApiActions and document request/response types for create-draft.
Validate draft POST bodies in parseCreateDraftBody; add four handler tests.

Co-authored-by: Charles Berret <charlesberret@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants