vikunja/veans/internal/client
kolaente 6cee626383 refactor(veans): migrate API client from v1 to v2
veans is unreleased and targets bleeding-edge Vikunja, so the CLI now
speaks the Huma-backed /api/v2 exclusively (v1 is frozen and the kanban
bucket CRUD veans relies on only exists on v2).

- Transport: base path /api/v1 -> /api/v2 in Do/DoRaw; add a
  content-type-aware path (DoMerge for application/merge-patch+json).
- Pagination: drop the x-pagination-total-pages header reader; every v2
  list returns the {items,total,page,per_page,total_pages} envelope.
  Decode it with a generic Paginated[T]/doList[T] and page until
  page >= total_pages. Previously-single-GET lists (views, buckets,
  comments, bots) are enveloped too — unwrap .items.
- Verbs: creates flip PUT -> POST (projects, labels, tokens, bot users,
  shares, task create, comments, relations, assignees, label-attach,
  bucket create); the bucket-task move flips POST -> PUT with a bare
  {"task_id":N} body (URL owns project/view/bucket); task update moves
  to PATCH merge-patch with a partial body.
- Errors: parse the RFC 9457 problem+json body (detail/title/code)
  instead of v1's {code,message}; the status -> output.Code mapping is
  unchanged.
- Discovery probes /api/v2/info, which doubles as the "new enough" check.
- Label search param s -> q; add views_buckets_tasks_put to the bot's
  projects scope so the move is authorized regardless of route-init order.

Tests and the veans agent guide are updated for the new paths, verbs and
envelope. Verified end-to-end against a local v2 server: init, create,
show, list, claim, update and prime all work.
2026-06-26 11:23:14 +00:00
..
assignees.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
auth.go chore(veans): apply veans golangci pass across sources 2026-05-27 08:21:57 +00:00
buckets.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
client.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
client_test.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
comments.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
discover.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
discover_test.go feat(veans): URL discovery on init, port of the frontend's heuristic 2026-05-27 08:21:57 +00:00
info.go chore(veans): apply veans golangci pass across sources 2026-05-27 08:21:57 +00:00
labels.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
projects.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
relations.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
routes.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
routes_test.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
tasks.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
tokens.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
types.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00
users.go refactor(veans): migrate API client from v1 to v2 2026-06-26 11:23:14 +00:00