@unboundcx/sdk 4.13.74 → 4.13.75

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.74",
3
+ "version": "4.13.75",
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",
@@ -89,7 +89,7 @@ export class CobrowseVisitorService {
89
89
  /**
90
90
  * Host-agnostic cobrowse surface (`sdk.cobrowse.*`). v1 adapter is
91
91
  * WebChat; Meet later uses the same method names with `source:'meet'`.
92
- * No `sdk.webchat.cobrowse`. No `getRecording` in this box.
92
+ * No `sdk.webchat.cobrowse`.
93
93
  */
94
94
  export class CobrowseService {
95
95
  constructor(sdk) {
@@ -208,4 +208,52 @@ export class CobrowseService {
208
208
  'GET',
209
209
  );
210
210
  }
211
+
212
+ /**
213
+ * Download the combined recording.ndjson for a finished cobrowse session.
214
+ * HTTP only (forceFetch) so the body is the event log, not JSON.
215
+ * @param {Object} params
216
+ * @param {'webchat'} params.source
217
+ * @param {string} params.widgetId
218
+ * @param {string} params.hostId
219
+ * @param {string} params.sid
220
+ * @param {string} [params.engagementSessionId]
221
+ */
222
+ async getRecording({
223
+ source,
224
+ widgetId,
225
+ hostId,
226
+ engagementSessionId,
227
+ sid,
228
+ } = {}) {
229
+ const ids = webchatHostIds(
230
+ { source, widgetId, hostId, engagementSessionId },
231
+ 'getRecording',
232
+ );
233
+ this.sdk.validateParams(
234
+ {
235
+ source,
236
+ widgetId,
237
+ hostId: ids.engagementSessionId,
238
+ sid,
239
+ },
240
+ {
241
+ source: { type: 'string', required: true },
242
+ widgetId: { type: 'string', required: true },
243
+ hostId: { type: 'string', required: true },
244
+ sid: { type: 'string', required: true },
245
+ },
246
+ );
247
+ return internalRequest(
248
+ this.sdk,
249
+ conversationCobrowsePath(
250
+ ids.widgetId,
251
+ ids.engagementSessionId,
252
+ `/${sid}/recording`,
253
+ ),
254
+ 'GET',
255
+ {},
256
+ true,
257
+ );
258
+ }
211
259
  }