@unboundcx/sdk 4.13.53 → 4.13.55
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.55",
|
|
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",
|
|
@@ -1066,30 +1066,33 @@ export class TaskService {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
1068
|
/**
|
|
1069
|
-
* Transfer a task to a different queue and/or worker.
|
|
1070
|
-
*
|
|
1069
|
+
* Transfer a task to a different queue and/or worker. Every transfer
|
|
1070
|
+
* creates a new task in the target queue and re-points live channels to
|
|
1071
|
+
* it; the old task is completed with the target queue's transfer
|
|
1072
|
+
* disposition.
|
|
1071
1073
|
*
|
|
1072
1074
|
* @param {Object} options - Parameters
|
|
1073
1075
|
* @param {string} options.taskId - The task ID to transfer (required)
|
|
1074
|
-
* @param {
|
|
1075
|
-
* @param {string} [options.
|
|
1076
|
-
* @
|
|
1076
|
+
* @param {Object} options.target - Transfer target (required)
|
|
1077
|
+
* @param {string} [options.target.queueId] - Destination queue ID
|
|
1078
|
+
* @param {string} [options.target.workerId] - Destination worker ID
|
|
1079
|
+
* @param {string} [options.note] - Optional note for the receiving agent
|
|
1080
|
+
* @returns {Promise<Object>} { taskId, newTaskId }
|
|
1077
1081
|
*/
|
|
1078
1082
|
async transfer(options = {}) {
|
|
1079
|
-
const { taskId,
|
|
1083
|
+
const { taskId, target, note } = options;
|
|
1080
1084
|
|
|
1081
1085
|
this.sdk.validateParams(
|
|
1082
|
-
{ taskId,
|
|
1086
|
+
{ taskId, target, note },
|
|
1083
1087
|
{
|
|
1084
1088
|
taskId: { type: 'string', required: true },
|
|
1085
|
-
|
|
1086
|
-
|
|
1089
|
+
target: { type: 'object', required: true },
|
|
1090
|
+
note: { type: 'string', required: false },
|
|
1087
1091
|
},
|
|
1088
1092
|
);
|
|
1089
1093
|
|
|
1090
|
-
const params = { body: { taskId } };
|
|
1091
|
-
if (
|
|
1092
|
-
if (workerId !== undefined) params.body.workerId = workerId;
|
|
1094
|
+
const params = { body: { taskId, target } };
|
|
1095
|
+
if (note !== undefined) params.body.note = note;
|
|
1093
1096
|
|
|
1094
1097
|
return await internalRequest(
|
|
1095
1098
|
this.sdk,
|