feat(comment): add 'comment update' and 'comment delete'#44
Merged
Conversation
Wraps two endpoints added in Notion's 2025 API that the CLI didn't yet expose: - PATCH /v1/comments/:id → 'notion comment update <id> --text ...' - DELETE /v1/comments/:id → 'notion comment delete <id> [<id> ...]' 'update' reuses the existing buildCommentRichText helper so the --mention-user flag works the same way as 'comment add'. 'delete' follows the 'block delete' pattern: variadic args, per-id error isolation, and a summary line (N comment(s) deleted). When the target id is the anchor of a discussion, Notion removes the whole thread; deleting a reply removes just that one comment — this is documented in the Long help. Two new client methods (UpdateComment, DeleteComment) keep the API plumbing in internal/client alongside AddComment. Smoke-tested against a real workspace: create comment → update text → verify new text via 'comment get' → delete → raw DELETE on the same id returns object_not_found as expected (the synchronous GET path is eventually consistent server-side, which is a Notion behavior, not a CLI issue). Closes #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33. Wraps
PATCH /v1/comments/:idandDELETE /v1/comments/:id(both added in Notion's 2025 API).updatereusesbuildCommentRichText→--mention-userworks the same ascomment add.deletefollowsblock deletepattern: variadic, per-id error isolation, summary count.Smoke-tested end-to-end against a real workspace.