@unboundcx/sdk 4.0.1 → 4.0.4

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.0.1",
3
+ "version": "4.0.4",
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",
@@ -3,19 +3,38 @@ export class GoogleCalendarService {
3
3
  this.sdk = sdk;
4
4
  }
5
5
 
6
- async setupWebhook({ calendarId, eventTypes, webhookUrl, expirationTime }) {
6
+ async setupWebhook({
7
+ calendarId,
8
+ eventTypes,
9
+ webhookUrl,
10
+ expirationTime,
11
+ recordTypeId,
12
+ } = {}) {
13
+ // Only calendarId is required. The server derives the webhook URL itself
14
+ // (per-environment: https://login.<API_BASE_URL>/webhooks/google/...) and
15
+ // watches all event types, so eventTypes/webhookUrl are optional. They
16
+ // were previously marked required, which broke the common
17
+ // setupWebhook({ calendarId }) call site (createRoom) with
18
+ // "Missing required parameter eventTypes".
19
+ // recordTypeId is optional: callers (e.g. createRoom) pass the meeting's
20
+ // already-resolved recordTypeId so the webhook row inherits it; if omitted
21
+ // the server resolves a fallback via findRecordTypeId.
7
22
  this.sdk.validateParams(
8
- { calendarId, eventTypes, webhookUrl },
23
+ { calendarId, eventTypes, webhookUrl, recordTypeId },
9
24
  {
10
25
  calendarId: { type: 'string', required: true },
11
- eventTypes: { type: 'array', required: true },
12
- webhookUrl: { type: 'string', required: true },
26
+ eventTypes: { type: 'array', required: false },
27
+ webhookUrl: { type: 'string', required: false },
13
28
  expirationTime: { type: 'number', required: false },
29
+ recordTypeId: { type: 'string', required: false },
14
30
  },
15
31
  );
16
32
 
17
- const webhookData = { calendarId, eventTypes, webhookUrl };
33
+ const webhookData = { calendarId };
34
+ if (eventTypes) webhookData.eventTypes = eventTypes;
35
+ if (webhookUrl) webhookData.webhookUrl = webhookUrl;
18
36
  if (expirationTime) webhookData.expirationTime = expirationTime;
37
+ if (recordTypeId) webhookData.recordTypeId = recordTypeId;
19
38
 
20
39
  const params = {
21
40
  body: webhookData,
package/services/video.js CHANGED
@@ -221,6 +221,13 @@ export class VideoService {
221
221
  startMicrophoneMutedAfter,
222
222
  enableChat,
223
223
  engagementSessionId,
224
+ startRecordingOn,
225
+ startTranscribingOn,
226
+ syncToCalendar,
227
+ source,
228
+ calendarId,
229
+ eventId,
230
+ calendarProvider,
224
231
  }) {
225
232
  this.sdk.validateParams(
226
233
  {
@@ -241,6 +248,13 @@ export class VideoService {
241
248
  startMicrophoneMutedAfter,
242
249
  enableChat,
243
250
  engagementSessionId,
251
+ startRecordingOn,
252
+ startTranscribingOn,
253
+ syncToCalendar,
254
+ source,
255
+ calendarId,
256
+ eventId,
257
+ calendarProvider,
244
258
  },
245
259
  {
246
260
  name: { type: 'string', required: false },
@@ -260,6 +274,13 @@ export class VideoService {
260
274
  startMicrophoneMutedAfter: { type: 'number', required: false },
261
275
  enableChat: { type: 'boolean', required: false },
262
276
  engagementSessionId: { type: 'string', required: false },
277
+ startRecordingOn: { type: 'boolean', required: false },
278
+ startTranscribingOn: { type: 'boolean', required: false },
279
+ syncToCalendar: { type: 'boolean', required: false },
280
+ source: { type: 'string', required: false },
281
+ calendarId: { type: 'string', required: false },
282
+ eventId: { type: 'string', required: false },
283
+ calendarProvider: { type: 'string', required: false },
263
284
  },
264
285
  );
265
286
  const params = {
@@ -281,6 +302,13 @@ export class VideoService {
281
302
  startMicrophoneMutedAfter,
282
303
  enableChat,
283
304
  engagementSessionId,
305
+ startRecordingOn,
306
+ startTranscribingOn,
307
+ syncToCalendar,
308
+ source,
309
+ calendarId,
310
+ eventId,
311
+ calendarProvider,
284
312
  },
285
313
  };
286
314
  const result = await this.sdk._fetch(`/video`, 'POST', params);
@@ -453,7 +481,7 @@ export class VideoService {
453
481
  return result;
454
482
  }
455
483
 
456
- async deleteRoom(roomId) {
484
+ async deleteRoom(roomId, options = {}) {
457
485
  this.sdk.validateParams(
458
486
  { roomId },
459
487
  {
@@ -461,6 +489,9 @@ export class VideoService {
461
489
  },
462
490
  );
463
491
  const params = {};
492
+ if (options && options.deleteCalendarEvent === true) {
493
+ params.body = { deleteCalendarEvent: true };
494
+ }
464
495
  const result = await this.sdk._fetch(`/video/${roomId}`, 'DELETE', params);
465
496
  return result;
466
497
  }
@@ -612,6 +643,26 @@ export class VideoService {
612
643
  return result;
613
644
  }
614
645
 
646
+ // Persist a rolled-up quality summary to MySQL (one row per participant
647
+ // per meeting). Internal endpoint, called by app1-video-server on
648
+ // participant.leave. Long-term home for billing (bytes) and "was this
649
+ // meeting good?" support lookups, surviving ClickHouse TTL expiry.
650
+ async submitParticipantSummary(roomId, participantId, summary) {
651
+ this.sdk.validateParams(
652
+ { roomId, participantId, summary },
653
+ {
654
+ roomId: { type: 'string', required: true },
655
+ participantId: { type: 'string', required: true },
656
+ summary: { type: 'object', required: true },
657
+ },
658
+ );
659
+ return this.sdk._fetch(
660
+ `/internal/video/${roomId}/participants/${participantId}/summary`,
661
+ 'POST',
662
+ { body: summary },
663
+ );
664
+ }
665
+
615
666
  async submitSurvey({
616
667
  videoRoomId,
617
668
  participantId,