@unboundcx/sdk 4.13.143 → 4.13.144

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.144",
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",
@@ -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
  *