forked from Goutam/lynkeduppro-crm
fix(inbox/messenger): directory limit 100 (was 400ing) + attachment download
- crm.messenger.directory limit 200 -> 100 (be-crm caps at 100, was 400 Bad Request) in both the inbox + messaging adapters. - CrmInboxAdapter.downloadAttachment via crm.media.presignDownload, so mail attachments are downloadable. Pull SDK 0.1.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Generated
+4
-4
@@ -10,7 +10,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@abe-kap/appshell-sdk": "^0.2.6",
|
"@abe-kap/appshell-sdk": "^0.2.6",
|
||||||
"@insignia/iios-kernel-client": "^0.1.4",
|
"@insignia/iios-kernel-client": "^0.1.4",
|
||||||
"@insignia/iios-messaging-ui": "^0.1.0",
|
"@insignia/iios-messaging-ui": "^0.1.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^1.21.0",
|
"lucide-react": "^1.21.0",
|
||||||
"next": "16.2.9",
|
"next": "16.2.9",
|
||||||
@@ -1028,9 +1028,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@insignia/iios-messaging-ui": {
|
"node_modules/@insignia/iios-messaging-ui": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.0/iios-messaging-ui-0.1.0.tgz",
|
"resolved": "https://git.lynkedup.cloud/api/packages/insignia/npm/%40insignia%2Fiios-messaging-ui/-/0.1.1/iios-messaging-ui-0.1.1.tgz",
|
||||||
"integrity": "sha512-iGOh/lwJJm+QG2u5YP1Kj4gZyShRWO1o7/dxnl+DE1m/WbE0PDO+baTJ7NFhremubSB7Wc/KSLhf9yLdLbivAQ==",
|
"integrity": "sha512-ZFhnrXvJfhXICYKB+htU5joa5S/jg55cSB/R6dtcILV3wSRbdeXiPzaWRBnicV2Y84arYrH/CXUZmBm89ERTyg==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@insignia/iios-kernel-client": "*",
|
"@insignia/iios-kernel-client": "*",
|
||||||
"react": ">=18",
|
"react": ">=18",
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@abe-kap/appshell-sdk": "^0.2.6",
|
"@abe-kap/appshell-sdk": "^0.2.6",
|
||||||
"@insignia/iios-kernel-client": "^0.1.4",
|
"@insignia/iios-kernel-client": "^0.1.4",
|
||||||
"@insignia/iios-messaging-ui": "^0.1.0",
|
"@insignia/iios-messaging-ui": "^0.1.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^1.21.0",
|
"lucide-react": "^1.21.0",
|
||||||
"next": "16.2.9",
|
"next": "16.2.9",
|
||||||
|
|||||||
@@ -93,8 +93,16 @@ export class CrmInboxAdapter implements InboxAdapter {
|
|||||||
return { contentRef: objectKey, mimeType: mime, sizeBytes: file.size, filename: file.name };
|
return { contentRef: objectKey, mimeType: mime, sizeBytes: file.size, filename: file.name };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async downloadAttachment(attachment: MailAttachment): Promise<string> {
|
||||||
|
const { url } = await this.sdk.command<{ url: string }>("crm.media.presignDownload", {
|
||||||
|
contentRef: attachment.contentRef,
|
||||||
|
...(attachment.mimeType ? { mime: attachment.mimeType } : {}),
|
||||||
|
});
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
async directory(): Promise<MailPerson[]> {
|
async directory(): Promise<MailPerson[]> {
|
||||||
const rows = await this.sdk.query<DirectoryDTO[]>("crm.messenger.directory", { kind: "all", limit: 200 });
|
const rows = await this.sdk.query<DirectoryDTO[]>("crm.messenger.directory", { kind: "all", limit: 100 });
|
||||||
return rows.map((d) => ({ id: d.id, name: d.displayName, kind: d.kind }));
|
return rows.map((d) => ({ id: d.id, name: d.displayName, kind: d.kind }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ export class CrmMessagingAdapter implements MessagingAdapter {
|
|||||||
|
|
||||||
/** The org directory — people you can start a DM/group with. Drives the "New message" picker. */
|
/** The org directory — people you can start a DM/group with. Drives the "New message" picker. */
|
||||||
async directory(): Promise<Person[]> {
|
async directory(): Promise<Person[]> {
|
||||||
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: 100 });
|
||||||
return dir.map((d) => ({ id: d.id, name: d.displayName, kind: d.kind }));
|
return dir.map((d) => ({ id: d.id, name: d.displayName, kind: d.kind }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user