feat(cli): reach the four inbox routes the generic factory cannot - #28
Draft
yvoolab wants to merge 1 commit into
Draft
feat(cli): reach the four inbox routes the generic factory cannot#28yvoolab wants to merge 1 commit into
yvoolab wants to merge 1 commit into
Conversation
The public v2 schema declares five inbox routes; the CLI reached one of them.
`inbox list` calls the summary endpoint, which returns counts rather than items,
and the two detail routes take a required type discriminator that the generic
`get` cannot send.
Adds commands/inbox.py, wired as two sub-groups under the existing inbox group
following the commands/accounts.py precedent:
inbox transactions list|get <id> --transaction-type <type>
inbox records list|get <id> --record-type <type>
Filter flags are the ones the two list routes declare in the schema, minus the
by-id lookups; repeatable ones are sent as repeated query params, and --status
maps to approval_status.
Two smaller fixes ride along because these commands are the first to need them:
_resume_all_command repeats a flag for a list-valued filter instead of printing
the Python list, so the --all resume hint stays copy-pasteable; and get reports
"This record is not in the inbox." rather than an empty table when the API
answers with an empty object, while --format json still prints {}.
inbox get stays unregistered, so tests/test_stale_commands.py keeps its lock.
No dependency changes.
Contributor
|
Thanks for your contributions! |
Contributor
Reproducible proof requiredThis PR description has no reproducible-proof artifact — no image, screenshot, screen recording, Please edit the PR description to include evidence the change works, then mark the PR ready for review. Recommended for this PR: reproduction steps plus the command output (test run, Any of these count as proof:
Moved to draft until proof is added. |
Warkanlock
marked this pull request as draft
September 2, 2026 12:43
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.
The public v2 schema declares five inbox routes. The CLI reaches one of them.
main.pyregistersinboxagainst pathinbox, sodualentry inbox listcalls thesummary route. That response carries no
items/count, soformat_outputsends it to_print_detailand the command prints a two-row table of counts. With--all,paginatefinds no
itemskey, stops on the first page and the command prints "No results."The two detail routes cannot be served by the generic factory at all: both take a required
type discriminator as a query parameter, and the factory's
getsends only the path. #24notes this in its description.
What this adds
New
commands/inbox.py, wired as two sub-groups under the existinginboxgroup(hand-written module, following the
commands/accounts.pyprecedent):Filter flags are the ones the two list routes declare in the schema, minus the by-id
lookups (
record_id,transaction_id); repeatable ones are sent as repeated queryparams.
--statusmaps toapproval_status, which is what these routes call it.Two smaller things ride along because the new commands are the first to need them:
_resume_all_commandnow repeats a flag for a list-valued filter instead of printingthe Python list, so the
--allresume hint stays copy-pasteable.getprints "This record is not in the inbox." instead of an empty table when the APIanswers with an empty object, which the schema documents as the not-in-inbox case.
--format jsonstill prints{}so scripts are unaffected.Happy to drop either of those into a separate PR if you would rather keep this to the four
commands.
Not touched
inbox getstays unregistered —tests/test_stale_commands.pylocks that, and the lockstill passes (sub-groups land in
registered_groups, notregistered_commands).inbox liststill calls the summary route, unchanged.uv.lockis untouched.Verification
Ten new tests in
tests/test_commands.py::TestInboxCommands, mock-based like the rest ofthat file: route and params for each of the four commands, the required discriminator
(exit code 2 without it), the empty-object path in both output formats, the resume-hint
repeat, and a regression guard that
inbox liststill hits/inbox/.One limitation worth stating plainly: I have no credentials for the API, so every test is
mocked and none of this has been run against a live inbox response.