Add JSON response format for full SDK/CLI coverage

Merged
JE
8mo ago
+580-31

Summary

Add JSON response formats across the API surface so the SDK (fizzy-sdk#9) and CLI can call every operation.

  • Add JSON respond_to blocks to 14 void-response controller actions (involvements, entropies, column reordering, readings, publishes, roles, avatars, settings, join codes, push subscriptions)
  • Add steps index endpoint (GET /cards/:id/steps.json)
  • Add JSON views for paginated card lists (stream, not-now, closed columns)
  • Add JSON search with distinct-card pagination — paginates Card records via Card.mentioning + .distinct rather than deduping Search::Record objects after pagination
  • Add JSON views for settings/config endpoints (account settings, join codes, notification settings)
  • Add JSON response format to data exports with status polling (create returns 201 with id/status; show returns any-status export for JSON)
  • Extend access token JSON API (index view, destroy format, add id + created_at to create response)
  • Push subscriptions distinguish new (201) vs existing (200) via previously_new_record?

Test plan

  • bin/rails test — 1167 tests, 0 failures
  • Verify paginated endpoints return X-Total-Count and Link headers
  • Verify 422 for join code update with invalid data
  • Verify 404 for missing/expired export
  • Verify search dedup: query matching both card title and comment returns 1 card in JSON