@unboundcx/sdk 4.13.108 → 4.13.109
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 +1 -1
- package/services/workflows.js +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.109",
|
|
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",
|
package/services/workflows.js
CHANGED
|
@@ -519,4 +519,34 @@ export class WorkflowSessionsService {
|
|
|
519
519
|
);
|
|
520
520
|
return result;
|
|
521
521
|
}
|
|
522
|
+
|
|
523
|
+
// P10 click-to-filter: GET /workflows/:workflowVersionId/sessions ->
|
|
524
|
+
// {sessionIds}. filter is {workflowItemId?, fromItemId?, toItemId?,
|
|
525
|
+
// startDate?, endDate?} -- workflowItemId alone, or fromItemId+toItemId
|
|
526
|
+
// together, is required (validated server-side in sessionsByPath.js).
|
|
527
|
+
async sessionsByPath(workflowVersionId, filter = {}) {
|
|
528
|
+
this.sdk.validateParams(
|
|
529
|
+
{ workflowVersionId },
|
|
530
|
+
{
|
|
531
|
+
workflowVersionId: { type: 'string', required: true },
|
|
532
|
+
},
|
|
533
|
+
);
|
|
534
|
+
|
|
535
|
+
const { workflowItemId, fromItemId, toItemId, startDate, endDate } =
|
|
536
|
+
filter || {};
|
|
537
|
+
const query = {};
|
|
538
|
+
if (workflowItemId) query.workflowItemId = workflowItemId;
|
|
539
|
+
if (fromItemId) query.fromItemId = fromItemId;
|
|
540
|
+
if (toItemId) query.toItemId = toItemId;
|
|
541
|
+
if (startDate) query.startDate = startDate;
|
|
542
|
+
if (endDate) query.endDate = endDate;
|
|
543
|
+
|
|
544
|
+
const result = await internalRequest(
|
|
545
|
+
this.sdk,
|
|
546
|
+
`/workflows/${workflowVersionId}/sessions`,
|
|
547
|
+
'GET',
|
|
548
|
+
{ query },
|
|
549
|
+
);
|
|
550
|
+
return result;
|
|
551
|
+
}
|
|
522
552
|
}
|