feat(messenger): expose adapter directory() for DM/group picker + pull SDK build

CrmMessagingAdapter.directory() now returns the org people list (Person[]) for the
new 'New message' picker; internal name-resolution uses directoryMap(). The DM/group
create path rides the existing crm.messenger.conversation.open door (dedupe + group).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-22 19:23:57 +05:30
parent eb7e1f7995
commit 7a312a1ace
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -1030,7 +1030,7 @@
"node_modules/@insignia/iios-messaging-ui": { "node_modules/@insignia/iios-messaging-ui": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "file:../iios/packages/iios-messaging-ui/insignia-iios-messaging-ui-0.1.0.tgz", "resolved": "file:../iios/packages/iios-messaging-ui/insignia-iios-messaging-ui-0.1.0.tgz",
"integrity": "sha512-Ks+tTnNBw3QqNpBlggEnbmfRrDnCSq9jq3b5TOsc/XEEgzdebtFDuQziVW/G6oRp4ysTQ6Fci/XRm1z1yLf4Wg==", "integrity": "sha512-sfNRRJQgbq3FCvwUtn4H7ojHnhQZnM5bd2MQmq3XFmTZNsj0BGNh/dcKvR9/7vbLaXP10kuOHZGXrCi/1LsJYA==",
"peerDependencies": { "peerDependencies": {
"@insignia/iios-kernel-client": "*", "@insignia/iios-kernel-client": "*",
"react": ">=18", "react": ">=18",
+10 -5
View File
@@ -81,7 +81,7 @@ export class CrmMessagingAdapter implements MessagingAdapter {
async listConversations(): Promise<Conversation[]> { async listConversations(): Promise<Conversation[]> {
const [convs, names] = await Promise.all([ const [convs, names] = await Promise.all([
this.sdk.query<ConversationDTO[]>("crm.messenger.conversation.list", {}), this.sdk.query<ConversationDTO[]>("crm.messenger.conversation.list", {}),
this.directory(), this.directoryMap(),
]); ]);
return convs.map((c) => this.toConversation(c, names)); return convs.map((c) => this.toConversation(c, names));
} }
@@ -219,11 +219,16 @@ export class CrmMessagingAdapter implements MessagingAdapter {
poll.timer = setInterval(tick, POLL_MS); poll.timer = setInterval(tick, POLL_MS);
} }
// ── mapping ──────────────────────────────────────────────────── /** The org directory — people you can start a DM/group with. Drives the "New message" picker. */
private async directory(): Promise<Map<string, string>> { async directory(): Promise<Person[]> {
if (!this.names) {
const dir = await this.sdk.query<DirectoryDTO[]>("crm.messenger.directory", { kind: "all", limit: 200 }); const dir = await this.sdk.query<DirectoryDTO[]>("crm.messenger.directory", { kind: "all", limit: 200 });
this.names = new Map(dir.map((d) => [d.id, d.displayName])); return dir.map((d) => ({ id: d.id, name: d.displayName, kind: d.kind }));
}
// ── mapping ────────────────────────────────────────────────────
private async directoryMap(): Promise<Map<string, string>> {
if (!this.names) {
this.names = new Map((await this.directory()).map((p) => [p.id, p.name]));
} }
return this.names; return this.names;
} }