@unboundcx/sdk 4.13.7 → 4.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.9",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -53,4 +53,24 @@ export class EmailMailboxUserService {
|
|
|
53
53
|
{ body },
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* List every OTHER mailbox a user can reach — via a direct grant or via a
|
|
59
|
+
* group they belong to — excluding their own dedicated mailbox.
|
|
60
|
+
* @param {string} userId - User ID
|
|
61
|
+
* @returns {Promise<Object>} { mailboxes: [{ id, name, mailbox, type, systemAddress?, role, via: 'user'|'group', groupId?, groupName?, notifyMode, notifyPush, notifyBadge, notifySound }] }
|
|
62
|
+
* @example
|
|
63
|
+
* const { mailboxes } = await sdk.messaging.email.mailboxes.forUser.listAccess('user123');
|
|
64
|
+
*/
|
|
65
|
+
async listAccess(userId) {
|
|
66
|
+
this.sdk.validateParams(
|
|
67
|
+
{ userId },
|
|
68
|
+
{ userId: { type: 'string', required: true } },
|
|
69
|
+
);
|
|
70
|
+
return internalRequest(
|
|
71
|
+
this.sdk,
|
|
72
|
+
`/messaging/email/mailbox/for-user/${userId}/access`,
|
|
73
|
+
'GET',
|
|
74
|
+
);
|
|
75
|
+
}
|
|
56
76
|
}
|
|
@@ -532,6 +532,17 @@ export class EmailMailboxesService {
|
|
|
532
532
|
);
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
+
/**
|
|
536
|
+
* Unread counts across every mailbox the caller can access, for the nav
|
|
537
|
+
* bar badge.
|
|
538
|
+
* @returns {Promise<Object>} { count, mailboxes: [{ mailboxId, unread }] }
|
|
539
|
+
* @example
|
|
540
|
+
* const { count } = await sdk.messaging.email.mailboxes.badge();
|
|
541
|
+
*/
|
|
542
|
+
async badge() {
|
|
543
|
+
return internalRequest(this.sdk, '/messaging/email/mailbox/badge', 'GET');
|
|
544
|
+
}
|
|
545
|
+
|
|
535
546
|
async deleteFolder(mailboxId, { name } = {}) {
|
|
536
547
|
this.sdk.validateParams(
|
|
537
548
|
{ mailboxId, name },
|
|
@@ -709,10 +709,40 @@ export class EmailService {
|
|
|
709
709
|
},
|
|
710
710
|
);
|
|
711
711
|
|
|
712
|
-
const result = await internalRequest(this.sdk,
|
|
712
|
+
const result = await internalRequest(this.sdk,
|
|
713
713
|
`/messaging/email/message/${emailId}`,
|
|
714
714
|
'DELETE',
|
|
715
715
|
);
|
|
716
716
|
return result;
|
|
717
717
|
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Re-queue an email that failed to send (Errored folder) for another send attempt
|
|
721
|
+
* @param {string} messageId - Email message ID
|
|
722
|
+
* @returns {Promise<Object>} { id, folder, isError, message }
|
|
723
|
+
* @example
|
|
724
|
+
* await sdk.messaging.email.retry('emailId123');
|
|
725
|
+
*/
|
|
726
|
+
async retry(messageId) {
|
|
727
|
+
this.sdk.validateParams(
|
|
728
|
+
{ messageId },
|
|
729
|
+
{ messageId: { type: 'string', required: true } },
|
|
730
|
+
);
|
|
731
|
+
return internalRequest(this.sdk, `/messaging/email/${messageId}/retry`, 'POST');
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Cancel a queued/retrying outbound email send, moving it back to Drafts
|
|
736
|
+
* @param {string} messageId - Email message ID
|
|
737
|
+
* @returns {Promise<Object>} { id, folder: 'drafts' }
|
|
738
|
+
* @example
|
|
739
|
+
* await sdk.messaging.email.cancel('emailId123');
|
|
740
|
+
*/
|
|
741
|
+
async cancel(messageId) {
|
|
742
|
+
this.sdk.validateParams(
|
|
743
|
+
{ messageId },
|
|
744
|
+
{ messageId: { type: 'string', required: true } },
|
|
745
|
+
);
|
|
746
|
+
return internalRequest(this.sdk, `/messaging/email/${messageId}/cancel`, 'POST');
|
|
747
|
+
}
|
|
718
748
|
}
|