Skip to content

feat(board): port board (dashboard) commands from Go CLI#13

Draft
beengud wants to merge 1 commit into
mainfrom
feat/board-commands
Draft

feat(board): port board (dashboard) commands from Go CLI#13
beengud wants to merge 1 commit into
mainfrom
feat/board-commands

Conversation

@beengud

@beengud beengud commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Closes #2

Ports the board (dashboard) commands from the deprecated Go Observe CLI to the TypeScript CLI.

Ported surface — observe board

  • create <file.json>saveDashboard from a DashboardInput JSON (name, workspaceId, layout required; stages optional).
  • update <id> <file.json> — same mutation with id injected.
  • scaffold [--name NAME] — prints a starting board JSON template.
  • set-default <dataset-id> <board-id>setDefaultDashboard.
  • clear-default <dataset-id>clearDefaultDashboard.
  • list [--name --folder --workspace]dashboardSearch.
  • get <id>dashboard(id).
  • delete <id>deleteDashboard.

The new CLI has no generic object layer, so list/get/delete are added explicitly.

PR #9 parity

  • Board input/output carry visibility and folderId.
  • create/update print Created/Updated: <name> (id: <id>), Visibility: <v>, and the board VIEW URL (https://{customerId}.{domain}/workspace/{ws}/dashboard/{id}).

Board JSON normalization (for saveDashboard)

  • Rename deprecated stage stageID → StageQueryInput id (without it, the API ignores the label and layout card.stageId references break).
  • Default each stage input to [] when missing.
  • Default each InputDefinitionInput stageId: "" and inputRole: "Data" so read-back queries don't hit null on non-null fields.
  • Strip read-only updatedDate.

Field-name corrections vs the Go fork

  • dashboardSearch returns DashboardSearchResultWrapper { dashboards: [...] } in the published SDL — not results as the Go gqlSearchBoard used. Codegen rejected results; the operation uses dashboards.
  • DWSearchInput fields are lists (name: [String!], workspaceId: [ObjectId!], folderId: [ObjectId!]), so the list command wraps each filter value in an array.
  • Confirmed StageQueryInput uses id (not stageID/stageId), matching the normalization above.

Verification

  • Codegen against the published Observe SDL: ✔ Generate (all 6 board operations validated).
  • Scoped tsc --noEmit: no errors in any non-test src/commands/board or src/gql/board source (only the expected bun:test / import.meta.dir noise in test files, plus pre-existing unrelated errors elsewhere that depend on the not-generated src/rest/generated).
  • bun test src/commands/board/: 14 pass / 0 fail across 4 files.

🤖 Generated with Claude Code

Add `observe board` with create/update (DashboardInput JSON), scaffold,
set-default/clear-default, and explicit list/get/delete (the new CLI has no
generic object layer). Reproduces PR #9 behavior: visibility/folderId fields
and a printed board VIEW URL after create/update.

Normalizes board JSON for saveDashboard: renames deprecated stage `stageID`
to StageQueryInput `id`, defaults each stage `input` to [], and defaults
InputDefinitionInput `stageId`/`inputRole` so read-back queries don't hit
null non-null fields.

Closes #2

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Port board (dashboard) commands from the Go fork

2 participants