@unboundcx/sdk 4.13.8 → 4.13.10

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.8",
3
+ "version": "4.13.10",
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",
@@ -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
  }
@@ -844,4 +844,25 @@ export class TaskService {
844
844
  const result = await internalRequest(this.sdk, '/taskRouter/tasks/', 'PUT', params);
845
845
  return result;
846
846
  }
847
+
848
+ /**
849
+ * Get the voice transcript for a task, keyed by the media-manager
850
+ * bridgeId (not sipCallId) so it works across requeue/transfer.
851
+ *
852
+ * @param {string} taskId - The task ID to fetch a transcript for
853
+ * @returns {Promise<Object>} { bridgeId, messages } — bridgeId is null
854
+ * and messages is [] for chat/email tasks or tasks with no bridge yet.
855
+ */
856
+ async getTranscript(taskId) {
857
+ this.sdk.validateParams(
858
+ { taskId },
859
+ { taskId: { type: 'string', required: true } },
860
+ );
861
+ return await internalRequest(
862
+ this.sdk,
863
+ `/taskRouter/tasks/${taskId}/transcript`,
864
+ 'GET',
865
+ {},
866
+ );
867
+ }
847
868
  }