Repository navigation
feat(accounts): add accounts get and profile on list rows - #289
Merged
Merged
Conversation
- Add `accounts get <app-user-id> --app-id <id>`: there is no GET-by-id route for app users, so it runs the same read-only POST /api/v1/search/app_users `accounts list` does, filtered to the one id, and prints the app user unwrapped through writeResource (profile included). Zero matches, or a result whose id doesn't match the one asked for, exits 4; more than one row claiming that id exits 6. - `accounts list` rows gain `profile` (its real JSON object, or null), so `--fields profile.<key>` reaches a specific attribute. - Document both in README.md and cmd/agents.md; CHANGELOG [Unreleased].
- `accounts get`'s help said `profile` was a field `accounts list` rows "drop", but this branch adds it to those rows, so say they carry it too. - Pin the list-row `profile` column: the decoded object keeps its JSON types (a number stays a number), and `--fields profile.<key>` projects it. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
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.
What
c1i accounts get <app-user-id> --app-id <app-id>reads one app user, unwrapped like other typedgets, including itsprofilemap. There is no GET route for a single app user, so it uses a read-onlyPOST /api/v1/search/app_usersfiltered toappUserIdsand matches onappUser.id(it never trustslist[0]).4nullor non-arraylist: exit6, the same contract asresourceAt6accounts listrows gainprofilewith real JSON types, ornullwhen absent, so--fields display_name,profile.departmentworks.Why
Reading an HRIS app user's profile (department, start date, manager email) to design an automation took a raw
c1i apisearch call;accounts listrows droppedprofile.Verified
TestTypedGet*,TestGetRefusesMissingObject,TestGetCommandsFailOnOutputWriteError), adapted to the per-get payload declaration from fix: every typed get refuses a 200 without the object it reads #287.--fieldsprojection, and exit4for an unknown id and for a cross-app id. A malformed id is the server's 400 regex rejection (exit2, the CLI's usage-error mapping), not a not-found.Follow-ups in this branch
accounts gethelp and its test saidprofilewas a fieldaccounts listrows "drop", which stopped being true in this same PR; both now say the rows carry it.profilecolumn: the decoded object keeps its JSON types (a number stays a number), and--fields profile.<key>projects it.