@unboundcx/sdk 2.7.6 → 2.8.0

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/services/video.js CHANGED
@@ -31,7 +31,12 @@ export class VideoService {
31
31
  tokenType: 'cookie',
32
32
  },
33
33
  };
34
- const result = await this.sdk._fetch(`/video/${room}/join`, 'POST', params);
34
+ const result = await this.sdk._fetch(
35
+ `/video/${room}/join`,
36
+ 'POST',
37
+ params,
38
+ true,
39
+ );
35
40
  return result;
36
41
  }
37
42
 
@@ -143,6 +148,7 @@ export class VideoService {
143
148
  startCameraMutedAfter,
144
149
  startMicrophoneMuted,
145
150
  startMicrophoneMutedAfter,
151
+ engagementSessionId,
146
152
  }) {
147
153
  this.sdk.validateParams(
148
154
  {
@@ -160,6 +166,7 @@ export class VideoService {
160
166
  startCameraMutedAfter,
161
167
  startMicrophoneMuted,
162
168
  startMicrophoneMutedAfter,
169
+ engagementSessionId,
163
170
  },
164
171
  {
165
172
  name: { type: 'string', required: false },
@@ -176,6 +183,7 @@ export class VideoService {
176
183
  startCameraMutedAfter: { type: 'number', required: false },
177
184
  startMicrophoneMuted: { type: 'boolean', required: false },
178
185
  startMicrophoneMutedAfter: { type: 'number', required: false },
186
+ engagementSessionId: { type: 'string', required: false },
179
187
  },
180
188
  );
181
189
  const params = {
@@ -194,6 +202,7 @@ export class VideoService {
194
202
  startCameraMutedAfter,
195
203
  startMicrophoneMuted,
196
204
  startMicrophoneMutedAfter,
205
+ engagementSessionId,
197
206
  },
198
207
  };
199
208
  const result = await this.sdk._fetch(`/video`, 'POST', params);
@@ -410,4 +419,53 @@ export class VideoService {
410
419
  );
411
420
  return result;
412
421
  }
422
+
423
+ async submitSurvey({
424
+ videoRoomId,
425
+ participantId,
426
+ email,
427
+ videoQuality,
428
+ audioQuality,
429
+ feedback,
430
+ }) {
431
+ this.sdk.validateParams(
432
+ { videoRoomId },
433
+ {
434
+ videoRoomId: { type: 'string', required: true },
435
+ },
436
+ );
437
+
438
+ // Validate optional parameters
439
+ const validationSchema = {};
440
+ if (participantId !== undefined)
441
+ validationSchema.participantId = { type: 'string' };
442
+ if (email !== undefined) validationSchema.email = { type: 'string' };
443
+ if (videoQuality !== undefined)
444
+ validationSchema.videoQuality = { type: 'number' };
445
+ if (audioQuality !== undefined)
446
+ validationSchema.audioQuality = { type: 'number' };
447
+ if (feedback !== undefined) validationSchema.feedback = { type: 'string' };
448
+
449
+ const surveyData = {
450
+ participantId,
451
+ email,
452
+ videoQuality,
453
+ audioQuality,
454
+ feedback,
455
+ };
456
+
457
+ if (Object.keys(validationSchema).length > 0) {
458
+ this.sdk.validateParams(surveyData, validationSchema);
459
+ }
460
+
461
+ const params = {
462
+ body: {
463
+ videoRoomId,
464
+ ...surveyData,
465
+ },
466
+ };
467
+
468
+ const result = await this.sdk._fetch('/video/survey', 'POST', params);
469
+ return result;
470
+ }
413
471
  }