@unboundcx/sdk 4.13.45 → 4.13.48
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.48",
|
|
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",
|
|
@@ -300,4 +300,29 @@ export class CCService {
|
|
|
300
300
|
);
|
|
301
301
|
return result;
|
|
302
302
|
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Recover a worker stuck out of routing (ghost Redis capacity, leftover
|
|
306
|
+
* lock, expired wrap-up). Self or manager. Does not force offline.
|
|
307
|
+
*
|
|
308
|
+
* @param {Object} options
|
|
309
|
+
* @param {string} options.workerId
|
|
310
|
+
* @returns {Promise<Object>}
|
|
311
|
+
*/
|
|
312
|
+
async unlockWorker(options = {}) {
|
|
313
|
+
const { workerId } = options;
|
|
314
|
+
|
|
315
|
+
this.sdk.validateParams(
|
|
316
|
+
{ workerId },
|
|
317
|
+
{ workerId: { type: 'string', required: true } },
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
const result = await internalRequest(
|
|
321
|
+
this.sdk,
|
|
322
|
+
`/taskRouter/cc/workers/${workerId}/unlock`,
|
|
323
|
+
'POST',
|
|
324
|
+
{},
|
|
325
|
+
);
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
303
328
|
}
|
|
@@ -880,6 +880,65 @@ export class TaskService {
|
|
|
880
880
|
);
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
+
/**
|
|
884
|
+
* Mark a task's inbound messages as read for one channel (or all).
|
|
885
|
+
* Channel ids: sms | webchat | email | whatsApp | rcs | all.
|
|
886
|
+
* Clearing SMS also clears whatsApp/rcs until those get their own
|
|
887
|
+
* timeline threads (`channel` may also be the group name `sms`).
|
|
888
|
+
*
|
|
889
|
+
* @param {Object} options
|
|
890
|
+
* @param {string} options.taskId
|
|
891
|
+
* @param {string} [options.channel='all']
|
|
892
|
+
* @returns {Promise<{taskId:string, unreadByChannel:object, unreadTotal:number}>}
|
|
893
|
+
*/
|
|
894
|
+
async markChannelRead(options = {}) {
|
|
895
|
+
const { taskId, channel } = options;
|
|
896
|
+
|
|
897
|
+
this.sdk.validateParams(
|
|
898
|
+
{ taskId, channel },
|
|
899
|
+
{
|
|
900
|
+
taskId: { type: 'string', required: true },
|
|
901
|
+
channel: { type: 'string', required: false },
|
|
902
|
+
},
|
|
903
|
+
);
|
|
904
|
+
|
|
905
|
+
const params = { body: { taskId } };
|
|
906
|
+
if (channel !== undefined) params.body.channel = channel;
|
|
907
|
+
|
|
908
|
+
return await internalRequest(
|
|
909
|
+
this.sdk,
|
|
910
|
+
'/taskRouter/tasks/unread/read',
|
|
911
|
+
'PUT',
|
|
912
|
+
params,
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Read a task's live channel mix -- whether it has an open text
|
|
918
|
+
* conversation, a live webchat session, or an active call, and whether
|
|
919
|
+
* it's currently eligible to be parked (`canPark`). Used to show/hide
|
|
920
|
+
* Park and webchat "End chat" without polling (task-park-webchat-endchat
|
|
921
|
+
* decisions, 2026-09-04).
|
|
922
|
+
*
|
|
923
|
+
* @param {Object} options
|
|
924
|
+
* @param {string} options.taskId
|
|
925
|
+
* @returns {Promise<{channelState:{hasOpenText:boolean, webchatLive:boolean, callLive:boolean, canPark:boolean}}>}
|
|
926
|
+
*/
|
|
927
|
+
async channelState(options = {}) {
|
|
928
|
+
const { taskId } = options;
|
|
929
|
+
|
|
930
|
+
this.sdk.validateParams(
|
|
931
|
+
{ taskId },
|
|
932
|
+
{ taskId: { type: 'string', required: true } },
|
|
933
|
+
);
|
|
934
|
+
|
|
935
|
+
return await internalRequest(
|
|
936
|
+
this.sdk,
|
|
937
|
+
`/taskRouter/tasks/${taskId}/channelState`,
|
|
938
|
+
'GET',
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
|
|
883
942
|
/**
|
|
884
943
|
* Transfer a task to a different queue and/or worker. Passing queueId
|
|
885
944
|
* moves the task back to 'pending' status for re-distribution.
|
package/services/webchat.js
CHANGED
|
@@ -243,6 +243,32 @@ export class WebchatConversationsService {
|
|
|
243
243
|
'GET',
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Agent-initiated "End chat" -- ends the webchat session only (same
|
|
249
|
+
* completeConversation() path as visitor end / idle timeout, reason
|
|
250
|
+
* 'agentEnded'). Only offered client-side when another channel (open
|
|
251
|
+
* text conversation or a live call) is still open on the task; the task
|
|
252
|
+
* itself keeps running (task-park-webchat-endchat-plan.md R2).
|
|
253
|
+
* @param {string} widgetId
|
|
254
|
+
* @param {string} engagementSessionId
|
|
255
|
+
* @returns {Promise<Object>}
|
|
256
|
+
*/
|
|
257
|
+
async end(widgetId, engagementSessionId) {
|
|
258
|
+
this.sdk.validateParams(
|
|
259
|
+
{ widgetId, engagementSessionId },
|
|
260
|
+
{
|
|
261
|
+
widgetId: { type: 'string', required: true },
|
|
262
|
+
engagementSessionId: { type: 'string', required: true },
|
|
263
|
+
},
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
return internalRequest(
|
|
267
|
+
this.sdk,
|
|
268
|
+
`/webchat/widgets/${widgetId}/conversations/${engagementSessionId}/end`,
|
|
269
|
+
'POST',
|
|
270
|
+
);
|
|
271
|
+
}
|
|
246
272
|
}
|
|
247
273
|
|
|
248
274
|
export class WebchatService {
|