@unboundcx/sdk 4.13.142 → 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.142",
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
  *
@@ -12,10 +12,22 @@ export class VoicemailDropTypesService {
12
12
 
13
13
  /**
14
14
  * List voicemail drop types.
15
+ * @param {Object} [params]
16
+ * @param {boolean} [params.includeInactive]
15
17
  * @returns {Promise<{results: Object[]}>}
16
18
  */
17
- async list() {
18
- return internalRequest(this.sdk, '/voicemailDrops/types', 'GET');
19
+ async list(params = {}) {
20
+ return internalRequest(this.sdk, '/voicemailDrops/types', 'GET', { query: { ...params } });
21
+ }
22
+
23
+ /**
24
+ * Get a single voicemail drop type.
25
+ * @param {string} id
26
+ * @returns {Promise<Object>}
27
+ */
28
+ async get(id) {
29
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
30
+ return internalRequest(this.sdk, `/voicemailDrops/types/${id}`, 'GET');
19
31
  }
20
32
 
21
33
  /**
@@ -58,6 +70,31 @@ export class VoicemailDropTypesService {
58
70
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
59
71
  return internalRequest(this.sdk, `/voicemailDrops/types/${id}`, 'DELETE');
60
72
  }
73
+
74
+ /**
75
+ * Set which users/groups can see a voicemail drop type.
76
+ * @param {string} id
77
+ * @param {Object} options
78
+ * @param {string[]} [options.userIds]
79
+ * @param {string[]} [options.groupIds]
80
+ * @returns {Promise<Object>}
81
+ */
82
+ async setAccess(id, { userIds, groupIds } = {}) {
83
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
84
+ return internalRequest(this.sdk, `/voicemailDrops/types/${id}/access`, 'PUT', {
85
+ body: { userIds, groupIds },
86
+ });
87
+ }
88
+
89
+ /**
90
+ * List users who have recorded a voicemail drop message for this type.
91
+ * @param {string} id
92
+ * @returns {Promise<{results: Object[]}>}
93
+ */
94
+ async recordings(id) {
95
+ this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
96
+ return internalRequest(this.sdk, `/voicemailDrops/types/${id}/recordings`, 'GET');
97
+ }
61
98
  }
62
99
 
63
100
  // Build a multipart body for a single audio file + scalar fields. Mirrors