Skip to content

feat(accounts): add accounts get and profile on list rows - #289

Merged
leet-c1 merged 2 commits into
mainfrom
feat/accounts-get
Nov 19, 2026
Merged

leet-c1 merged 2 commits into
mainfrom
feat/accounts-get

Conversation

@cvkramer

@cvkramer cvkramer commented Nov 19, 2026 •

Copy link
Copy Markdown

What

  • c1i accounts get <app-user-id> --app-id <app-id> reads one app user, unwrapped like other typed gets, including its profile map. There is no GET route for a single app user, so it uses a read-only POST /api/v1/search/app_users filtered to appUserIds and matches on appUser.id (it never trusts list[0]).
    • zero matches, or an id from another app: exit 4
    • an absent, null or non-array list: exit 6, the same contract as resourceAt
    • more than one row claiming the id: exit 6
  • accounts list rows gain profile with real JSON types, or null when absent, so --fields display_name,profile.department works.

Why

Reading an HRIS app user's profile (department, start date, manager email) to design an automation took a raw c1i api search call; accounts list rows dropped profile.

Verified

Follow-ups in this branch

  • The accounts get help and its test said profile was a field accounts list rows "drop", which stopped being true in this same PR; both now say the rows carry it.
  • Pinned the list-row profile column: the decoded object keeps its JSON types (a number stays a number), and --fields profile.<key> projects it.

c1-charleskramer and others added 2 commits November 18, 2026 19:03
- 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>
@leet-c1
leet-c1 marked this pull request as ready for review November 19, 2026 21:16
@leet-c1
leet-c1 merged commit 07b63df into main Nov 19, 2026
2 checks passed
@leet-c1
leet-c1 deleted the feat/accounts-get branch November 19, 2026 21:38
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.

3 participants