@unboundcx/sdk 4.13.53 → 4.13.54
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.54",
|
|
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,39 @@ 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. Creates a new task
|
|
1070
|
+
* in the target queue and re-points live channels to it; the old task is
|
|
1071
|
+
* completed (blind) or left connected pending completeTransfer/cancelTransfer
|
|
1072
|
+
* (attended).
|
|
1071
1073
|
*
|
|
1072
1074
|
* @param {Object} options - Parameters
|
|
1073
1075
|
* @param {string} options.taskId - The task ID to transfer (required)
|
|
1074
1076
|
* @param {string} [options.queueId] - Destination queue ID
|
|
1075
1077
|
* @param {string} [options.workerId] - Destination worker ID
|
|
1076
|
-
* @
|
|
1078
|
+
* @param {string} [options.mode='blind'] - 'blind' or 'attended'. Attended is only
|
|
1079
|
+
* meaningful when a live voice leg exists; otherwise treated as blind.
|
|
1080
|
+
* @param {string} [options.note] - Optional note for the receiving agent
|
|
1081
|
+
* @returns {Promise<Object>} { taskId, newTaskId, mode }
|
|
1077
1082
|
*/
|
|
1078
1083
|
async transfer(options = {}) {
|
|
1079
|
-
const { taskId, queueId, workerId } = options;
|
|
1084
|
+
const { taskId, queueId, workerId, mode, note } = options;
|
|
1080
1085
|
|
|
1081
1086
|
this.sdk.validateParams(
|
|
1082
|
-
{ taskId, queueId, workerId },
|
|
1087
|
+
{ taskId, queueId, workerId, mode, note },
|
|
1083
1088
|
{
|
|
1084
1089
|
taskId: { type: 'string', required: true },
|
|
1085
1090
|
queueId: { type: 'string', required: false },
|
|
1086
1091
|
workerId: { type: 'string', required: false },
|
|
1092
|
+
mode: { type: 'string', required: false },
|
|
1093
|
+
note: { type: 'string', required: false },
|
|
1087
1094
|
},
|
|
1088
1095
|
);
|
|
1089
1096
|
|
|
1090
1097
|
const params = { body: { taskId } };
|
|
1091
1098
|
if (queueId !== undefined) params.body.queueId = queueId;
|
|
1092
1099
|
if (workerId !== undefined) params.body.workerId = workerId;
|
|
1100
|
+
if (mode !== undefined) params.body.mode = mode;
|
|
1101
|
+
if (note !== undefined) params.body.note = note;
|
|
1093
1102
|
|
|
1094
1103
|
return await internalRequest(
|
|
1095
1104
|
this.sdk,
|
|
@@ -1099,6 +1108,59 @@ export class TaskService {
|
|
|
1099
1108
|
);
|
|
1100
1109
|
}
|
|
1101
1110
|
|
|
1111
|
+
/**
|
|
1112
|
+
* Complete an attended transfer: unhold the caller, hang up the old
|
|
1113
|
+
* agent's leg, and complete the old task.
|
|
1114
|
+
*
|
|
1115
|
+
* @param {Object} options - Parameters
|
|
1116
|
+
* @param {string} options.taskId - The old task ID (required)
|
|
1117
|
+
* @returns {Promise<Object>} { taskId }
|
|
1118
|
+
*/
|
|
1119
|
+
async transferComplete(options = {}) {
|
|
1120
|
+
const { taskId } = options;
|
|
1121
|
+
|
|
1122
|
+
this.sdk.validateParams(
|
|
1123
|
+
{ taskId },
|
|
1124
|
+
{ taskId: { type: 'string', required: true } },
|
|
1125
|
+
);
|
|
1126
|
+
|
|
1127
|
+
const params = { body: { taskId } };
|
|
1128
|
+
|
|
1129
|
+
return await internalRequest(
|
|
1130
|
+
this.sdk,
|
|
1131
|
+
'/taskRouter/tasks/transfer/complete',
|
|
1132
|
+
'PUT',
|
|
1133
|
+
params,
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Cancel an attended transfer: complete/hang up the new task, re-point
|
|
1139
|
+
* channels back to the old task, unhold the caller, and clear the old
|
|
1140
|
+
* task's transfer state.
|
|
1141
|
+
*
|
|
1142
|
+
* @param {Object} options - Parameters
|
|
1143
|
+
* @param {string} options.taskId - The old task ID (required)
|
|
1144
|
+
* @returns {Promise<Object>} { taskId }
|
|
1145
|
+
*/
|
|
1146
|
+
async transferCancel(options = {}) {
|
|
1147
|
+
const { taskId } = options;
|
|
1148
|
+
|
|
1149
|
+
this.sdk.validateParams(
|
|
1150
|
+
{ taskId },
|
|
1151
|
+
{ taskId: { type: 'string', required: true } },
|
|
1152
|
+
);
|
|
1153
|
+
|
|
1154
|
+
const params = { body: { taskId } };
|
|
1155
|
+
|
|
1156
|
+
return await internalRequest(
|
|
1157
|
+
this.sdk,
|
|
1158
|
+
'/taskRouter/tasks/transfer/cancel',
|
|
1159
|
+
'PUT',
|
|
1160
|
+
params,
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1102
1164
|
/**
|
|
1103
1165
|
* Get the voice transcript for a task, keyed by the media-manager
|
|
1104
1166
|
* bridgeId (not sipCallId) so it works across requeue/transfer.
|