@unboundcx/sdk 4.13.130 → 4.13.132
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.132",
|
|
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",
|
|
@@ -35,6 +35,8 @@ export class JourneyMembersService {
|
|
|
35
35
|
* @param {string} [opts.ownerUserId]
|
|
36
36
|
* @param {string} [opts.statusReason]
|
|
37
37
|
* @param {string} [opts.search]
|
|
38
|
+
* @param {boolean} [opts.isTest] true = test-run members only, false = exclude them; omit = no filter
|
|
39
|
+
* @param {'company'} [opts.groupBy] server-grouped mode: { groups: [{ companyId, companyName, counts, members }] }
|
|
38
40
|
* @returns {Promise<Object>} Paged member rows
|
|
39
41
|
*/
|
|
40
42
|
async list(journeyId, opts = {}) {
|
|
@@ -142,6 +142,42 @@ export class JourneysService {
|
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Diff of the current published journeyDoc vs the draft, by stepKey (P7).
|
|
147
|
+
*
|
|
148
|
+
* @param {string} id
|
|
149
|
+
* @returns {Promise<Object>} { oldVersionId, newVersionId, added, removed, changed }
|
|
150
|
+
*/
|
|
151
|
+
async publishDiff(id) {
|
|
152
|
+
this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
|
|
153
|
+
return await internalRequest(
|
|
154
|
+
this.sdk,
|
|
155
|
+
`/journeys/${id}/publish-diff`,
|
|
156
|
+
'GET',
|
|
157
|
+
{},
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Publish the draft (runs publish-check; blocking items fail). Pass
|
|
163
|
+
* `{mode:'migrate', mapping}` to move open members on the old version to
|
|
164
|
+
* mapped landing steps at their next safe point (journeys-plan.md §7.5);
|
|
165
|
+
* omit for a plain publish (members stay on their version). Requires
|
|
166
|
+
* salesEnabled.
|
|
167
|
+
*
|
|
168
|
+
* @param {string} id
|
|
169
|
+
* @param {Object} [opts]
|
|
170
|
+
* @param {'migrate'|'leave'} [opts.mode]
|
|
171
|
+
* @param {Object<string,string>} [opts.mapping] removed stepKey -> landing stepKey | 'leave'
|
|
172
|
+
* @returns {Promise<Object>} { versionId, oldVersionId, migrationPlan }
|
|
173
|
+
*/
|
|
174
|
+
async publish(id, { mode, mapping } = {}) {
|
|
175
|
+
this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
|
|
176
|
+
return await internalRequest(this.sdk, `/journeys/${id}/publish`, 'POST', {
|
|
177
|
+
body: { migrate: pickDefined({ mode, mapping }) },
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
145
181
|
/**
|
|
146
182
|
* Per-step funnel (journeys-plan.md §9, P6): entered / outcome split /
|
|
147
183
|
* conversions from journeyMemberEvents. Test members are excluded.
|
|
@@ -60,6 +60,9 @@ export class MetricsService {
|
|
|
60
60
|
* limit: 50
|
|
61
61
|
* });
|
|
62
62
|
* console.log(queueMetrics.metrics.queue.avgWaitTime); // 45.3
|
|
63
|
+
* // Sales queues (queueType='sales') additionally carry metrics.sales:
|
|
64
|
+
* // { dueNow, overdue, takenOnTimePct, timeToActionMedianSeconds,
|
|
65
|
+
* // touchesCompletedToday, conversionsToday } (omitted for other queues)
|
|
63
66
|
*
|
|
64
67
|
* @example
|
|
65
68
|
* // Get worker metrics for last hour
|