@unboundcx/sdk 4.13.106 → 4.13.108

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.106",
3
+ "version": "4.13.108",
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",
@@ -1416,4 +1416,44 @@ export class ObjectsService {
1416
1416
  { body: {} },
1417
1417
  );
1418
1418
  }
1419
+
1420
+ /**
1421
+ * P7 (workflows-v2-plan.md W10/W11/W23) -- runs an immediate full
1422
+ * enter+exit sweep for a journey program. Same diff-and-enqueue path a
1423
+ * scheduled tick runs, so this can never 429.
1424
+ * @param {string} programId
1425
+ * @returns {Promise<{queued: true, enterEnqueued: number, exitEnqueued: number}>}
1426
+ */
1427
+ async runMarketingProgramNow(programId) {
1428
+ this.sdk.validateParams(
1429
+ { programId },
1430
+ { programId: { type: 'string', required: true } },
1431
+ );
1432
+ return internalRequest(
1433
+ this.sdk,
1434
+ `/object/marketing-programs/${programId}/run`,
1435
+ 'POST',
1436
+ { body: {} },
1437
+ );
1438
+ }
1439
+
1440
+ /**
1441
+ * P7 -- paginated member list for a journey program (joined to people
1442
+ * for display name; never raw peopleId).
1443
+ * @param {string} programId
1444
+ * @param {{nextId?: string, limit?: number}} [opts]
1445
+ * @returns {Promise<{results: object[], pagination: object}>}
1446
+ */
1447
+ async listMarketingProgramMembers(programId, opts = {}) {
1448
+ this.sdk.validateParams(
1449
+ { programId },
1450
+ { programId: { type: 'string', required: true } },
1451
+ );
1452
+ return internalRequest(
1453
+ this.sdk,
1454
+ `/object/marketing-programs/${programId}/members`,
1455
+ 'GET',
1456
+ { query: opts },
1457
+ );
1458
+ }
1419
1459
  }
@@ -96,6 +96,24 @@ export class WorkflowsService {
96
96
  );
97
97
  return result;
98
98
  }
99
+
100
+ // P6 §6 — variable catalogue (inputs/system/context/module outputs) for
101
+ // the designer's `{{` autocomplete + variables panel.
102
+ async variables(versionId) {
103
+ this.sdk.validateParams(
104
+ { versionId },
105
+ {
106
+ versionId: { type: 'string', required: true },
107
+ },
108
+ );
109
+
110
+ const result = await internalRequest(
111
+ this.sdk,
112
+ `/workflows/${versionId}/variables`,
113
+ 'GET',
114
+ );
115
+ return result;
116
+ }
99
117
  }
100
118
 
101
119
  export class WorkflowItemsService {
@@ -419,17 +437,25 @@ export class WorkflowSessionsService {
419
437
  return result;
420
438
  }
421
439
 
422
- async complete(sessionId) {
440
+ /**
441
+ * @param {string} sessionId
442
+ * @param {string} [reason] - passed through as body.reason -- the
443
+ * sessionComplete.js controller already accepts this (defaults to
444
+ * 'completed' server-side); P7's exitProgramMember.js passes
445
+ * 'programExit'. Backward compatible -- omitting it is unchanged.
446
+ */
447
+ async complete(sessionId, reason) {
423
448
  this.sdk.validateParams(
424
- { sessionId },
449
+ { sessionId, reason },
425
450
  {
426
451
  sessionId: { type: 'string', required: true },
452
+ reason: { type: 'string', required: false },
427
453
  },
428
454
  );
429
455
 
430
- const params = {};
456
+ const params = reason ? { body: { reason } } : {};
431
457
 
432
- const result = await internalRequest(this.sdk,
458
+ const result = await internalRequest(this.sdk,
433
459
  `/workflows/session/${sessionId}/complete`,
434
460
  'PUT',
435
461
  params,
@@ -486,7 +512,7 @@ export class WorkflowSessionsService {
486
512
  query: { startDate, endDate },
487
513
  };
488
514
 
489
- const result = await internalRequest(this.sdk,
515
+ const result = await internalRequest(this.sdk,
490
516
  `/workflows/${workflowVersionId}/analytics`,
491
517
  'GET',
492
518
  params,