@unboundcx/sdk 4.13.143 → 4.13.145

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.143",
3
+ "version": "4.13.145",
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",
@@ -30,7 +30,7 @@ export class JourneyMembersService {
30
30
  * @param {number} [opts.pageSize]
31
31
  * @param {string} [opts.sort]
32
32
  * @param {string} [opts.sortDir]
33
- * @param {string[]} [opts.status]
33
+ * @param {string[]} [opts.status] active | paused | needsAttention | waiting (owner at capacity) | completed | converted | exited | removed
34
34
  * @param {string} [opts.stepKey]
35
35
  * @param {string} [opts.ownerUserId]
36
36
  * @param {string} [opts.statusReason]
@@ -110,7 +110,9 @@ export class JourneyMembersService {
110
110
  * @param {string[]} [body.peopleIds] - Either peopleIds or filter is required
111
111
  * @param {Object} [body.filter]
112
112
  * @param {Object} [body.overrides] - Per-member channel overrides
113
- * @param {string} [body.ownerUserId]
113
+ * @param {string} [body.ownerUserId] - used with ownerMode 'user'
114
+ * @param {'journeyDefault'|'recordOwner'|'user'|'pool'} [body.ownerMode] - journey/type default | each person's people.ownerId | one explicit user for all | no owner
115
+ * @param {{mode:'pool'}|{mode:'user', ownerUserId:string}} [body.ownerFallback] - with ownerMode 'recordOwner': what people WITHOUT a record owner get (default pool)
114
116
  * @param {string} [body.source]
115
117
  * @param {boolean} [body.dryRun]
116
118
  * @param {string} [body.primaryChannel]
@@ -21,6 +21,12 @@ export class JourneyTypesService {
21
21
  /**
22
22
  * @param {Object} body
23
23
  * @param {string} body.name
24
+ * @param {'firstTouchClaims'|'perTouch'} [body.poolClaimMode] - first rep to take a pool touch owns the member for the rest of the cadence (default) | no auto-claim
25
+ * @param {'never'|'ifEmpty'|'always'} [body.syncPersonOwner] - whether a member owner assignment also writes people.ownerId (default 'ifEmpty')
26
+ * @param {'person'|'company'} [body.ownerScope] - 'company': claims/reassigns fan out to every open member of the same company in this type (default 'person')
27
+ * @param {'reassign'|'needsAttention'} [body.ownerMissingPolicy] - owner deactivated / lost salesEnabled / left the queue: auto-reassign (backup user → round-robin → pool, default) or park with statusReason 'ownerMissing'
28
+ * @param {number|null} [body.maxActiveMembersPerOwner] - cap of active+needsAttention members per owner across the type; members over the cap wait (status 'waiting', statusReason 'ownerCapacity') and are admitted by people.score DESC, enteredAt ASC. null = unlimited
29
+ * All five are type defaults; a journey may override each with the same field (null = use type default).
24
30
  * @returns {Promise<Object>} Created journeyType
25
31
  */
26
32
  async create(body) {
@@ -142,6 +142,41 @@ export class JourneysService {
142
142
  );
143
143
  }
144
144
 
145
+ /**
146
+ * Bulk equivalent of `stats()` for the Journeys list page -- one request
147
+ * instead of N. Journeys not found (or with no members) still get an
148
+ * entry, zeroed.
149
+ *
150
+ * @param {string[]} ids
151
+ * @returns {Promise<Object<string, {byStatus: Object, needsAttentionByReason: Object, total: number}>>}
152
+ */
153
+ async listStats(ids) {
154
+ this.sdk.validateParams(
155
+ { ids },
156
+ { ids: { type: 'array', required: true } },
157
+ );
158
+ if (!ids.length) return {};
159
+ return await internalRequest(this.sdk, '/journeys/list-stats', 'GET', {
160
+ query: { ids: ids.join(',') },
161
+ });
162
+ }
163
+
164
+ /**
165
+ * REAL delete -- distinct from `archive()`. Only succeeds server-side
166
+ * when the journey is still a draft, or has zero members in any status;
167
+ * otherwise the API refuses with 409 `JOURNEY_HAS_MEMBERS` (archive it
168
+ * instead). Hard-deletes the journey row plus its companion workflow
169
+ * (and that workflow's versions/items/ports/connections) -- unlike
170
+ * `archive()`, this cannot be undone.
171
+ *
172
+ * @param {string} id
173
+ * @returns {Promise<Object>} { deleted: true, id, workflowId, memberCount }
174
+ */
175
+ async remove(id) {
176
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
177
+ return await internalRequest(this.sdk, `/journeys/${id}`, 'DELETE', {});
178
+ }
179
+
145
180
  /**
146
181
  * Diff of the current published journeyDoc vs the draft, by stepKey (P7).
147
182
  *