feat: expand ContentResponse type to include additional API fields#3865
feat: expand ContentResponse type to include additional API fields#3865
Conversation
…3855) Expand ContentResponse and Revision types to match the actual Connect Cloud API response shape as revealed by the golden test fixtures. - Add Author interface for embedded user info in responses - Add ContentUserRole interface for user roles on content - Expand Revision with source, runtime, and publish state fields - Expand ContentResponse with author, timestamps, access control, etc. - Update test mocks to include new required fields Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @m--'s task in 1m 4s —— View job Code Review
Overall: Looks good! ✅ This PR properly expands the Positive Aspects
Minor Observations
VerificationThe golden test fixtures (
No issues found. Ready to merge. |
| publish_error_args?: Record<string, unknown> | null; | ||
| publish_error_details?: string | null; | ||
|
|
||
| // Other |
There was a problem hiding this comment.
do we care overly much about how this is organized? Other seems like kind of a weird category given that we have some uncategorized things hanging out at the top, too.
There was a problem hiding this comment.
I don't really care about the organization, and would find it a bit frustrating to maintain.
I typically fallback to alphabetical, but that isn't as important either.
| access: ContentAccess; | ||
| account_id: string; | ||
| title: string; | ||
| access: ContentAccess | string; // API may return "public" instead of enum value |
There was a problem hiding this comment.
this makes me wonder if ContentAccess is the right type, if we're seeing public in the golden fixture.
There was a problem hiding this comment.
If public is a valid value we should access it to ContentAccess
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The API may return "private" or "public" shorthand values instead of the longer form equivalents. This removes the need for the string fallback type on ContentResponse.access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
We're going to close this — we should add these types as we use and need them. |
Summary
ContentResponseandRevisiontypes inpackages/connect-cloud-api/src/types.tsto match the actual Connect Cloud API response shapeAuthorinterface for embedded user info in responsesContentUserRoleinterface for user roles on contentCloses #3855
Test plan
npx tsc --noEmit)npm test)🤖 Generated with Claude Code