feat: add directory history, restore, and test commands#59
Merged
Conversation
Closes coverage gaps for three directory_member spec endpoints:
- GET /api/v1/directory_members/{id}/history
- PUT /api/v1/directory_members/{id}/restore
- GET /api/v1/directory_members/{id}/test
Each subcommand mirrors the existing directoryGetCmd shape with stubbed-HTTP tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Apr 30, 2026
Self-review of PR #59 caught two real bugs the test stubs didn't surface: 1. directory test missing required timestamp query param. Spec defines GET /api/v1/directory_members/{id}/test with timestamp (required, ISO 8601). Live API would 422 the prior request. Added --timestamp (defaults to time.Now().UTC()) and --language-code (optional). 2. directory restore sent nil body. Spec defines PUT /restore with requestBody.required=true (DirectoryMemberRestore schema; only field is optional comments with default "Restored"). nil body on apiClient.Put skips Content-Type, so the API would reject it. Send {} by default; added --comments flag for the optional override. 3. directory history now exposes optional --page, --limit, --order-by-direction, --response-format flags so users can paginate like every other list command. Tests now assert query params and body presence/Content-Type, closing the gap that hid these bugs originally. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
directorysubcommands matching spec endpoints:history,restore,testdirectoryGetCmdshape; no client-helper changesPR 1 of 5 in the 100% coverage initiative.
Test plan
go test ./...passes (3 new tests: TestDirectoryHistory, TestDirectoryRestore, TestDirectoryTest)go buildclean./syllable directory --helpshows the three new subcommands./syllable directory history --helprenders🤖 Generated with Claude Code