feat(messenger): wire member management (add/remove/rename) + pull SDK 0.1.5

CrmMessagingAdapter implements addMember/removeMember/renameConversation over
crm.messenger.participant.add/remove + group.rename, powering the SDK's new
group/channel settings panel. listMembers maps customer role too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 12:54:47 +05:30
parent 2c38ce811f
commit 06a689bbd3
3 changed files with 18 additions and 6 deletions
+13 -1
View File
@@ -207,9 +207,21 @@ export class CrmMessagingAdapter implements MessagingAdapter {
await this.sdk.command("crm.messenger.channel.leave", { threadId });
}
async addMember(threadId: string, userId: string): Promise<void> {
await this.sdk.command("crm.messenger.participant.add", { threadId, userId });
}
async removeMember(threadId: string, userId: string): Promise<void> {
await this.sdk.command("crm.messenger.participant.remove", { threadId, userId });
}
async renameConversation(threadId: string, subject: string): Promise<void> {
await this.sdk.command("crm.messenger.group.rename", { threadId, subject });
}
async listMembers(threadId: string): Promise<Person[]> {
const rows = await this.sdk.query<Array<{ userId: string; displayName: string; role: string }>>("crm.messenger.members", { threadId });
return rows.map((r) => ({ id: r.userId, name: r.displayName, kind: "staff" as const }));
return rows.map((r) => ({ id: r.userId, name: r.displayName, kind: r.role === "CUSTOMER" ? "customer" : "staff" }));
}
// ── polling fallback (no socket) ───────────────────────────────