@unboundcx/sdk 4.13.147 → 4.13.148

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.147",
3
+ "version": "4.13.148",
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",
@@ -219,12 +219,20 @@ export class ReportingService {
219
219
  }
220
220
 
221
221
  /**
222
+ * @param {Object} [params] - { reportKey?: string } -- analytics-expansion
223
+ * A0b: omit for Explore views only (unchanged default); pass
224
+ * 'callLog' for that report's saved views instead.
222
225
  * @returns {Promise<Object>} { results: [...] }
223
226
  * @example
224
227
  * const { results } = await sdk.reporting.views.list();
228
+ * const { results } = await sdk.reporting.views.list({ reportKey: 'callLog' });
225
229
  */
226
- async listViews() {
227
- return internalRequest(this.sdk, '/reporting/views', 'GET');
230
+ async listViews({ reportKey } = {}) {
231
+ return internalRequest(
232
+ this.sdk,
233
+ `/reporting/views${queryString({ reportKey })}`,
234
+ 'GET',
235
+ );
228
236
  }
229
237
 
230
238
  /**
@@ -111,4 +111,54 @@ export class ReportingCallLogService {
111
111
  { httpOnly: true },
112
112
  );
113
113
  }
114
+
115
+ /**
116
+ * Same filters as list() (no cursor/limit -- a series call always covers
117
+ * the whole window), bucketed answered/missed/voicemail/total over time.
118
+ * Bucket grain (hour vs day) and timezone are server-resolved, not
119
+ * caller-chosen (an explicit `tz` overrides the account default).
120
+ * @param {Object} params - { from, to, direction?: 'inbound'|'outbound',
121
+ * answered?: boolean, queueIds?: string[], ringGroupIds?: string[],
122
+ * userIds?: string[], phoneNumber?: string, recordingOnly?: boolean,
123
+ * tz?: string }
124
+ * @returns {Promise<Object>} { bucket: 'hour'|'day', timezone, series: [{ start, end, answered, missed, voicemail, total }] }
125
+ * @example
126
+ * await sdk.reporting.callLog.series({ from, to });
127
+ */
128
+ async series({
129
+ from,
130
+ to,
131
+ direction,
132
+ answered,
133
+ queueIds,
134
+ ringGroupIds,
135
+ userIds,
136
+ phoneNumber,
137
+ recordingOnly,
138
+ tz,
139
+ } = {}) {
140
+ this.sdk.validateParams(
141
+ { from, to },
142
+ {
143
+ from: { type: 'string', required: true },
144
+ to: { type: 'string', required: true },
145
+ },
146
+ );
147
+ return internalRequest(
148
+ this.sdk,
149
+ `/reporting/callLog/series${queryString({
150
+ from,
151
+ to,
152
+ direction,
153
+ answered,
154
+ queueIds,
155
+ ringGroupIds,
156
+ userIds,
157
+ phoneNumber,
158
+ recordingOnly,
159
+ tz,
160
+ })}`,
161
+ 'GET',
162
+ );
163
+ }
114
164
  }