@unboundcx/sdk 4.13.61 → 4.13.62

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.61",
3
+ "version": "4.13.62",
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",
@@ -211,28 +211,38 @@ export class ParticipantService {
211
211
  }
212
212
 
213
213
  /**
214
- * Swap task ownership between the current owner and a joined helper.
214
+ * Swap task ownership between the current owner and a joined helper. When
215
+ * the helper has no access to the task's queue, this chains: it creates a
216
+ * new task in the helper's queue and makes them its owner. If `queueId` is
217
+ * omitted and the helper has access to more than one queue, the server
218
+ * responds 409 with `{ needsQueue: true, queues }` — retry with a chosen
219
+ * `queueId`.
215
220
  *
216
221
  * @param {Object} options - Options
217
222
  * @param {string} options.taskId - Task ID
218
223
  * @param {string} options.participantId - The helper participant taking/giving control
219
224
  * @param {string} options.action - 'give' | 'take'
220
- * @returns {Promise<Object>} { taskId, workerId }
225
+ * @param {string} [options.queueId] - Target queue for a cross-queue control chain (only relevant when the helper lacks access to the task's own queue)
226
+ * @returns {Promise<Object>} { taskId, workerId } for a same-queue swap; { taskId, newTaskId, workerId } for a cross-queue chain
221
227
  *
222
228
  * @example
223
229
  * await sdk.taskRouter.participants.control({ taskId: 'task_123', participantId: 'tp_456', action: 'give' });
230
+ * @example
231
+ * await sdk.taskRouter.participants.control({ taskId: 'task_123', participantId: 'tp_456', action: 'take', queueId: 'queue_789' });
224
232
  */
225
- async control({ taskId, participantId, action }) {
233
+ async control({ taskId, participantId, action, queueId }) {
226
234
  this.sdk.validateParams(
227
- { taskId, participantId, action },
235
+ { taskId, participantId, action, queueId },
228
236
  {
229
237
  taskId: { type: 'string', required: true },
230
238
  participantId: { type: 'string', required: true },
231
239
  action: { type: 'string', required: true },
240
+ queueId: { type: 'string', required: false },
232
241
  },
233
242
  );
234
243
 
235
244
  const params = { body: { action } };
245
+ if (queueId !== undefined) params.body.queueId = queueId;
236
246
 
237
247
  return await internalRequest(
238
248
  this.sdk,