Skip to content

Conversation

@scottlovegrove
Copy link
Collaborator

Summary

  • Adds a computed url: string property to 6 entity schemas (Channel, Thread, Comment, Conversation, ConversationMessage, InboxThread) via Zod .transform(), giving consumers a ready-to-use Twist URL on every parsed entity
  • Fixes CommentSchema and ConversationMessageSchema to mark workspaceId/channelId as required, matching actual API response behavior
  • Zero changes to client code — transforms run automatically at parse time in existing Schema.parse() calls

BREAKING CHANGE

  • Comment and ConversationMessage types now require workspaceId (and channelId for Comment) to be present
  • All 6 entity types gain a non-optional url property

Test plan

  • npm run build passes
  • All 166 existing tests pass
  • Verify url property appears on entity types in consuming code (e.g. thread.url)

🤖 Generated with Claude Code

Adds a `url: string` property (via Zod `.transform()`) to Channel, Thread,
Comment, Conversation, ConversationMessage, and InboxThread schemas. The URL
is computed at parse time using `getFullTwistURL`, so consumers get a
ready-to-use Twist URL on every entity object with zero client code changes.

Also fixes CommentSchema and ConversationMessageSchema to mark `workspaceId`
and `channelId` as required (matching actual API responses).

BREAKING CHANGE: Comment and ConversationMessage types now require
`workspaceId` (and `channelId` for Comment) to be present. All entity
types gain a non-optional `url` property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scottlovegrove scottlovegrove merged commit 1713fb9 into main Feb 8, 2026
3 checks passed
@scottlovegrove scottlovegrove deleted the scottl/object-url branch February 8, 2026 20:34
gnapse added a commit that referenced this pull request Feb 9, 2026
Regression from 1713fb9 (#76) which added `.transform()` to entity
schemas but didn't update the batch descriptors for list endpoints.
Single-entity endpoints (getThread, getComment, etc.) already included
`schema` in their descriptors, but list endpoints (getInbox, getComments,
getMessages, getConversations, getThreads, getChannels) returned
`{ method, url, params }` without it — so the batch executor skipped
the Zod parse and computed `url` properties were missing.

Co-Authored-By: Claude Opus 4.6 <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.

1 participant