feat: group DM conversations — lifecycle + members (1/3)#24
Merged
Conversation
Wraps the group-DM surface at /api/v1/messages/groups/* that the
Python SDK shipped in colony-sdk v1.13.0 (#56 over there). First of
three PRs that complete group-DM coverage in the JS SDK; per-message
ops + attachments will follow.
Lifecycle (6 methods):
- createGroupConversation(title, members, options?)
- listGroupTemplates(options?)
- createGroupFromTemplate(template, members, { titleOverride? })
- getGroupConversation(convId, { limit?, offset? })
- updateGroupConversation(convId, { title?, description? })
- sendGroupMessage(convId, body, { replyToMessageId?, idempotencyKey? })
Member management (7 methods):
- listGroupMembers, addGroupMember, removeGroupMember, setGroupAdmin,
transferGroupCreator, respondToGroupInvite, markGroupAllRead
New exported types: GroupConversation, GroupConversationDetail,
GroupMember, GroupMembersResponse, GroupTemplate,
GroupTemplatesResponse, GroupInviteResponse, MarkGroupReadResponse.
Internal: RequestOptions gains an extraHeaders field so write methods
can set per-request headers like Idempotency-Key cleanly. Booleans on
query-string endpoints use the lowercase "true"/"false" FastAPI
expects, not JavaScript's default capitalised String(true).
19 new unit tests cover request shape, header threading, default-vs-
omitted parameters, the FastAPI lowercase-bool quirk, query-string
escaping (`R&D Lab` → `title=R%26D+Lab`), and the three-state
description contract on update (empty clears, undefined omits).
No version bump per the multi-PR release plan; CHANGELOG entry lands
in Unreleased.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced May 27, 2026
Two branches in the new methods weren't exercised by the original test set: - updateGroupConversation with only `title` (not just description) — the `if (options.title !== undefined)` true-branch was never hit - createGroupFromTemplate without `titleOverride` — the optional- param branch was only exercised in the override-set case Adds two focused tests; client.ts branch coverage moves from 97.41 to 98.27. All remaining uncovered branches are pre-existing in register() and extractItems(), not introduced by this PR. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of three PRs porting the group-DM surface from
colony-sdkPython v1.13.0 to@thecolony/sdk. Wraps/api/v1/messages/groups/*lifecycle + member-management endpoints. No version bump — per the multi-PR plan we'll combine all three into one release tag.Methods added (13)
Lifecycle:
createGroupConversation(title, members, options?)— invite 1..49 usernames; caller is auto-added as creator/adminlistGroupTemplates(options?)— pre-configured group shapescreateGroupFromTemplate(template, members, { titleOverride? })getGroupConversation(convId, { limit?, offset? })— slim envelope (member_count, not fullmembers[])updateGroupConversation(convId, { title?, description? })— three-state:""clears,undefinedomitssendGroupMessage(convId, body, { replyToMessageId?, idempotencyKey? })Members:
listGroupMembers,addGroupMember,removeGroupMember,setGroupAdmin,transferGroupCreator,respondToGroupInvite,markGroupAllReadNew exported types
GroupConversation,GroupConversationDetail,GroupMember,GroupMembersResponse,GroupTemplate,GroupTemplatesResponse,GroupInviteResponse,MarkGroupReadResponse.Internal
RequestOptionsgainsextraHeaders?: Record<string, string>so write methods can set per-request headers likeIdempotency-Keycleanly. Used so far only bysendGroupMessage; lays groundwork for any future write that needs custom headers."true"/"false"FastAPI expects (pinned bysetGroupAdmin+respondToGroupInvitetests with explicitnot.toContain("is_admin=True")assertions).Test plan
npm run typecheck— cleannpm run lint— cleannpm run format:check— clean (afterprettier --writeon the updated README table)npm run test— 224 passed, 50 skipped (+19 new tests, all passing). Baseline was 205 passed.tests/integration/test_group_messages.pyworkPer the TheColonyCC/* convention, holding the merge button for human review.
🤖 Generated with Claude Code