From 06a689bbd3d2ccdc9fa45a9bc712f62e5a476c2d Mon Sep 17 00:00:00 2001 From: maaz519 Date: Thu, 23 Jul 2026 12:54:47 +0530 Subject: [PATCH] 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 --- package-lock.json | 8 ++++---- package.json | 2 +- src/lib/crm-messaging-adapter.ts | 14 +++++++++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84e4fdf..38baaf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@abe-kap/appshell-sdk": "^0.2.6", "@insignia/iios-kernel-client": "^0.1.4", - "@insignia/iios-messaging-ui": "^0.1.4", + "@insignia/iios-messaging-ui": "^0.1.5", "clsx": "^2.1.1", "lucide-react": "^1.21.0", "next": "16.2.9", @@ -1028,9 +1028,9 @@ } }, "node_modules/@insignia/iios-messaging-ui": { - "version": "0.1.4", - "resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.4/iios-messaging-ui-0.1.4.tgz", - "integrity": "sha512-xgwVPY//NFyCrGxuLpLlrXn89q2SMgQoKTiW46CWdLx6rkaaxSesVEijGEoYt25rVPVF9+RcDPbwIBQ2GDtHQw==", + "version": "0.1.5", + "resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.5/iios-messaging-ui-0.1.5.tgz", + "integrity": "sha512-3Ib72RsyyOEMIFl2MquAwdocbeYOMpg4XkSLaje8rmgche+QJSRnJd3hzZyhv89VBolxPxNZw+Sz6bN9J0gp9Q==", "peerDependencies": { "@insignia/iios-kernel-client": "*", "react": ">=18", diff --git a/package.json b/package.json index 443de9d..d6400e8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dependencies": { "@abe-kap/appshell-sdk": "^0.2.6", "@insignia/iios-kernel-client": "^0.1.4", - "@insignia/iios-messaging-ui": "^0.1.4", + "@insignia/iios-messaging-ui": "^0.1.5", "clsx": "^2.1.1", "lucide-react": "^1.21.0", "next": "16.2.9", diff --git a/src/lib/crm-messaging-adapter.ts b/src/lib/crm-messaging-adapter.ts index 6ea0b7e..c1f7f1e 100644 --- a/src/lib/crm-messaging-adapter.ts +++ b/src/lib/crm-messaging-adapter.ts @@ -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 { + await this.sdk.command("crm.messenger.participant.add", { threadId, userId }); + } + + async removeMember(threadId: string, userId: string): Promise { + await this.sdk.command("crm.messenger.participant.remove", { threadId, userId }); + } + + async renameConversation(threadId: string, subject: string): Promise { + await this.sdk.command("crm.messenger.group.rename", { threadId, subject }); + } + async listMembers(threadId: string): Promise { const rows = await this.sdk.query>("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) ───────────────────────────────