@unboundcx/sdk 4.8.9 → 4.8.11

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.
Files changed (57) hide show
  1. package/base.js +71 -29
  2. package/index.js +6 -3
  3. package/package.json +1 -4
  4. package/services/ai/playbooks.js +22 -21
  5. package/services/ai/settings.js +4 -2
  6. package/services/ai/translate.js +3 -1
  7. package/services/ai/vocabulary.js +4 -3
  8. package/services/ai.js +21 -20
  9. package/services/chat.js +124 -48
  10. package/services/developerApis.js +174 -0
  11. package/services/directory.js +109 -12
  12. package/services/documents.js +11 -10
  13. package/services/engagementMetrics.js +2 -1
  14. package/services/enroll.js +16 -15
  15. package/services/externalOAuth.js +12 -11
  16. package/services/fax.js +4 -3
  17. package/services/generateId.js +3 -2
  18. package/services/googleCalendar.js +7 -6
  19. package/services/inbox.js +59 -11
  20. package/services/knowledgeBase.js +9 -8
  21. package/services/layouts.js +15 -14
  22. package/services/login.js +8 -7
  23. package/services/lookup.js +4 -3
  24. package/services/messaging/EmailAddressesService.js +5 -4
  25. package/services/messaging/EmailAnalyticsService.js +5 -4
  26. package/services/messaging/EmailDomainsService.js +8 -7
  27. package/services/messaging/EmailMailboxesService.js +59 -9
  28. package/services/messaging/EmailQueueService.js +2 -1
  29. package/services/messaging/EmailService.js +12 -11
  30. package/services/messaging/EmailSuppressionService.js +5 -4
  31. package/services/messaging/EmailTemplatesService.js +6 -5
  32. package/services/messaging/SmsService.js +3 -2
  33. package/services/messaging/SmsTemplatesService.js +6 -5
  34. package/services/messaging/TenDlcBrandsService.js +11 -10
  35. package/services/messaging/TenDlcCampaignManagementService.js +14 -13
  36. package/services/messaging/TenDlcCampaignsService.js +2 -1
  37. package/services/messaging/TollFreeCampaignsService.js +13 -12
  38. package/services/notes.js +7 -6
  39. package/services/objects.js +97 -36
  40. package/services/permissions.js +34 -33
  41. package/services/phoneNumbers.js +28 -27
  42. package/services/portals.js +8 -7
  43. package/services/recordTypes.js +12 -11
  44. package/services/search.js +2 -1
  45. package/services/sipEndpoints.js +8 -7
  46. package/services/storage.js +16 -15
  47. package/services/subscriptions.js +4 -3
  48. package/services/taskRouter/CCService.js +303 -0
  49. package/services/taskRouter/MetricsService.js +56 -1
  50. package/services/taskRouter/TaskRouterService.js +2 -0
  51. package/services/taskRouter/TaskService.js +13 -12
  52. package/services/taskRouter/WorkerService.js +9 -8
  53. package/services/triggers.js +9 -8
  54. package/services/verification.js +5 -4
  55. package/services/video.js +230 -45
  56. package/services/voice.js +40 -11
  57. package/services/workflows.js +22 -21
package/services/video.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class VideoService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -5,7 +6,7 @@ export class VideoService {
5
6
 
6
7
  async clearToken() {
7
8
  const params = {};
8
- const result = await this.sdk._fetch(
9
+ const result = await internalRequest(this.sdk,
9
10
  `/video/clearVideoToken`,
10
11
  'POST',
11
12
  params,
@@ -50,7 +51,7 @@ export class VideoService {
50
51
  token,
51
52
  },
52
53
  };
53
- const result = await this.sdk._fetch(
54
+ const result = await internalRequest(this.sdk,
54
55
  `/video/${room}/join`,
55
56
  'POST',
56
57
  params,
@@ -101,7 +102,7 @@ export class VideoService {
101
102
  isSip: true,
102
103
  },
103
104
  };
104
- const result = await this.sdk._fetch(
105
+ const result = await internalRequest(this.sdk,
105
106
  `/video/${room}/join`,
106
107
  'POST',
107
108
  params,
@@ -124,7 +125,7 @@ export class VideoService {
124
125
  ...update,
125
126
  },
126
127
  };
127
- const result = await this.sdk._fetch(
128
+ const result = await internalRequest(this.sdk,
128
129
  `/video/${roomId}/${participantId}`,
129
130
  'PUT',
130
131
  params,
@@ -145,7 +146,7 @@ export class VideoService {
145
146
  participantId,
146
147
  },
147
148
  };
148
- const result = await this.sdk._fetch(
149
+ const result = await internalRequest(this.sdk,
149
150
  `/video/${roomId}/leave`,
150
151
  'DELETE',
151
152
  params,
@@ -161,7 +162,7 @@ export class VideoService {
161
162
  },
162
163
  );
163
164
  const params = {};
164
- const result = await this.sdk._fetch(
165
+ const result = await internalRequest(this.sdk,
165
166
  `/video/${roomId}/leave`,
166
167
  'DELETE',
167
168
  params,
@@ -195,7 +196,7 @@ export class VideoService {
195
196
  streamCreation,
196
197
  },
197
198
  };
198
- const result = await this.sdk._fetch(
199
+ const result = await internalRequest(this.sdk,
199
200
  `/video/${roomId}/${participantId}/mute/${mediaType}`,
200
201
  'PUT',
201
202
  params,
@@ -230,6 +231,7 @@ export class VideoService {
230
231
  calendarProvider,
231
232
  vocabularyTerms,
232
233
  shareOcrEnabled,
234
+ earlyJoinMinutes,
233
235
  }) {
234
236
  this.sdk.validateParams(
235
237
  {
@@ -259,6 +261,7 @@ export class VideoService {
259
261
  calendarProvider,
260
262
  vocabularyTerms,
261
263
  shareOcrEnabled,
264
+ earlyJoinMinutes,
262
265
  },
263
266
  {
264
267
  name: { type: 'string', required: false },
@@ -287,6 +290,9 @@ export class VideoService {
287
290
  calendarProvider: { type: 'string', required: false },
288
291
  vocabularyTerms: { type: 'array', required: false },
289
292
  shareOcrEnabled: { type: 'boolean', required: false },
293
+ // 0 = strict at startTime, 5 = 5-min early window (api rejects
294
+ // other values); omit for no schedule-window enforcement.
295
+ earlyJoinMinutes: { type: 'number', required: false },
290
296
  },
291
297
  );
292
298
  const params = {
@@ -317,9 +323,10 @@ export class VideoService {
317
323
  calendarProvider,
318
324
  vocabularyTerms,
319
325
  shareOcrEnabled,
326
+ earlyJoinMinutes,
320
327
  },
321
328
  };
322
- const result = await this.sdk._fetch(`/video`, 'POST', params);
329
+ const result = await internalRequest(this.sdk, `/video`, 'POST', params);
323
330
  return result;
324
331
  }
325
332
 
@@ -362,6 +369,8 @@ export class VideoService {
362
369
  validationSchema.vocabularyTerms = { type: 'array' };
363
370
  if ('shareOcrEnabled' in update)
364
371
  validationSchema.shareOcrEnabled = { type: 'boolean' };
372
+ if ('earlyJoinMinutes' in update)
373
+ validationSchema.earlyJoinMinutes = { type: 'number' };
365
374
 
366
375
  if (Object.keys(validationSchema).length > 0) {
367
376
  this.sdk.validateParams(update, validationSchema);
@@ -372,7 +381,7 @@ export class VideoService {
372
381
  ...update,
373
382
  },
374
383
  };
375
- const result = await this.sdk._fetch(`/video/${roomId}`, 'PUT', params);
384
+ const result = await internalRequest(this.sdk, `/video/${roomId}`, 'PUT', params);
376
385
  return result;
377
386
  }
378
387
 
@@ -400,7 +409,7 @@ export class VideoService {
400
409
  ...update,
401
410
  },
402
411
  };
403
- const result = await this.sdk._fetch(`/video/${roomId}/bot`, 'PUT', params);
412
+ const result = await internalRequest(this.sdk, `/video/${roomId}/bot`, 'PUT', params);
404
413
  return result;
405
414
  }
406
415
 
@@ -420,7 +429,7 @@ export class VideoService {
420
429
  callerIdNumber,
421
430
  },
422
431
  };
423
- const result = await this.sdk._fetch(
432
+ const result = await internalRequest(this.sdk,
424
433
  `/video/${roomId}/placeOutboundCall`,
425
434
  'POST',
426
435
  params,
@@ -443,7 +452,7 @@ export class VideoService {
443
452
  },
444
453
  };
445
454
 
446
- return await this.sdk._fetch(`/video/${roomId}`, 'GET', params);
455
+ return await internalRequest(this.sdk, `/video/${roomId}`, 'GET', params);
447
456
  }
448
457
 
449
458
  async listMeetings(options = {}) {
@@ -462,7 +471,7 @@ export class VideoService {
462
471
  query: options,
463
472
  };
464
473
 
465
- const result = await this.sdk._fetch('/video/meetings', 'GET', params);
474
+ const result = await internalRequest(this.sdk, '/video/meetings', 'GET', params);
466
475
  return result;
467
476
  }
468
477
 
@@ -491,7 +500,7 @@ export class VideoService {
491
500
  query: params,
492
501
  };
493
502
 
494
- const result = await this.sdk._fetch(
503
+ const result = await internalRequest(this.sdk,
495
504
  `/video/meetings/${roomId}/analytics`,
496
505
  'GET',
497
506
  options,
@@ -510,7 +519,7 @@ export class VideoService {
510
519
  if (options && options.deleteCalendarEvent === true) {
511
520
  params.body = { deleteCalendarEvent: true };
512
521
  }
513
- const result = await this.sdk._fetch(`/video/${roomId}`, 'DELETE', params);
522
+ const result = await internalRequest(this.sdk, `/video/${roomId}`, 'DELETE', params);
514
523
  return result;
515
524
  }
516
525
 
@@ -527,7 +536,7 @@ export class VideoService {
527
536
  body: participant,
528
537
  };
529
538
 
530
- const result = await this.sdk._fetch(
539
+ const result = await internalRequest(this.sdk,
531
540
  `/video/${roomId}/participants`,
532
541
  'POST',
533
542
  params,
@@ -544,7 +553,7 @@ export class VideoService {
544
553
  );
545
554
 
546
555
  const params = {};
547
- const result = await this.sdk._fetch(
556
+ const result = await internalRequest(this.sdk,
548
557
  `/video/${roomId}/close`,
549
558
  'POST',
550
559
  params,
@@ -586,7 +595,7 @@ export class VideoService {
586
595
  body: { token },
587
596
  };
588
597
 
589
- const result = await this.sdk._fetch(
598
+ const result = await internalRequest(this.sdk,
590
599
  `/video/${id}/validate`,
591
600
  'POST',
592
601
  params,
@@ -631,7 +640,7 @@ export class VideoService {
631
640
  { roomId },
632
641
  { roomId: { type: 'string', required: true } },
633
642
  );
634
- const result = await this.sdk._fetch(
643
+ const result = await internalRequest(this.sdk,
635
644
  `/video/session/end`,
636
645
  'POST',
637
646
  { body: { roomId } },
@@ -653,7 +662,7 @@ export class VideoService {
653
662
  body: stats,
654
663
  };
655
664
 
656
- const result = await this.sdk._fetch(
665
+ const result = await internalRequest(this.sdk,
657
666
  `/video/${roomId}/stats`,
658
667
  'POST',
659
668
  params,
@@ -674,7 +683,7 @@ export class VideoService {
674
683
  summary: { type: 'object', required: true },
675
684
  },
676
685
  );
677
- return this.sdk._fetch(
686
+ return internalRequest(this.sdk,
678
687
  `/internal/video/${roomId}/participants/${participantId}/summary`,
679
688
  'POST',
680
689
  { body: summary },
@@ -726,7 +735,7 @@ export class VideoService {
726
735
  },
727
736
  };
728
737
 
729
- const result = await this.sdk._fetch('/video/survey', 'POST', params);
738
+ const result = await internalRequest(this.sdk, '/video/survey', 'POST', params);
730
739
  return result;
731
740
  }
732
741
 
@@ -756,7 +765,7 @@ export class VideoService {
756
765
 
757
766
  const params = { body };
758
767
 
759
- const result = await this.sdk._fetch(
768
+ const result = await internalRequest(this.sdk,
760
769
  `/video/${roomId}/chat`,
761
770
  'POST',
762
771
  params,
@@ -804,7 +813,7 @@ export class VideoService {
804
813
  query: options,
805
814
  };
806
815
 
807
- const result = await this.sdk._fetch(
816
+ const result = await internalRequest(this.sdk,
808
817
  `/video/${roomId}/chat`,
809
818
  'GET',
810
819
  params,
@@ -840,7 +849,7 @@ export class VideoService {
840
849
  query: options,
841
850
  };
842
851
 
843
- const result = await this.sdk._fetch(
852
+ const result = await internalRequest(this.sdk,
844
853
  `/video/${roomId}/transcript`,
845
854
  'GET',
846
855
  params,
@@ -877,7 +886,7 @@ export class VideoService {
877
886
 
878
887
  const params = { body };
879
888
 
880
- const result = await this.sdk._fetch(
889
+ const result = await internalRequest(this.sdk,
881
890
  `/video/${roomId}/chat/${messageId}`,
882
891
  'PUT',
883
892
  params,
@@ -903,7 +912,7 @@ export class VideoService {
903
912
 
904
913
  const params = {};
905
914
 
906
- const result = await this.sdk._fetch(
915
+ const result = await internalRequest(this.sdk,
907
916
  `/video/${roomId}/chat/${messageId}`,
908
917
  'DELETE',
909
918
  params,
@@ -965,7 +974,7 @@ export class VideoService {
965
974
  body: settings,
966
975
  };
967
976
 
968
- const result = await this.sdk._fetch(
977
+ const result = await internalRequest(this.sdk,
969
978
  '/video/settings/user',
970
979
  'POST',
971
980
  params,
@@ -1015,7 +1024,7 @@ export class VideoService {
1015
1024
  body: settings,
1016
1025
  };
1017
1026
 
1018
- const result = await this.sdk._fetch('/video/settings/user', 'PUT', params);
1027
+ const result = await internalRequest(this.sdk, '/video/settings/user', 'PUT', params);
1019
1028
  return result;
1020
1029
  }
1021
1030
 
@@ -1039,7 +1048,7 @@ export class VideoService {
1039
1048
  params.query.userId = userId;
1040
1049
  }
1041
1050
 
1042
- const result = await this.sdk._fetch('/video/settings/user', 'GET', params);
1051
+ const result = await internalRequest(this.sdk, '/video/settings/user', 'GET', params);
1043
1052
  return result;
1044
1053
  }
1045
1054
 
@@ -1057,7 +1066,10 @@ export class VideoService {
1057
1066
  },
1058
1067
  );
1059
1068
 
1060
- const result = await this.sdk._fetch(`/video/${roomId}/livePresence`, 'GET');
1069
+ const result = await internalRequest(this.sdk,
1070
+ `/video/${roomId}/livePresence`,
1071
+ 'GET',
1072
+ );
1061
1073
  return result;
1062
1074
  }
1063
1075
 
@@ -1074,7 +1086,7 @@ export class VideoService {
1074
1086
  },
1075
1087
  );
1076
1088
 
1077
- const result = await this.sdk._fetch(`/video/${roomId}/summary`, 'GET');
1089
+ const result = await internalRequest(this.sdk, `/video/${roomId}/summary`, 'GET');
1078
1090
  return result;
1079
1091
  }
1080
1092
 
@@ -1098,7 +1110,7 @@ export class VideoService {
1098
1110
  body: { summaryJson },
1099
1111
  };
1100
1112
 
1101
- const result = await this.sdk._fetch(
1113
+ const result = await internalRequest(this.sdk,
1102
1114
  `/video/${roomId}/summary`,
1103
1115
  'PATCH',
1104
1116
  params,
@@ -1119,7 +1131,7 @@ export class VideoService {
1119
1131
  },
1120
1132
  );
1121
1133
 
1122
- const result = await this.sdk._fetch(
1134
+ const result = await internalRequest(this.sdk,
1123
1135
  `/video/${roomId}/catch-me-up`,
1124
1136
  'POST',
1125
1137
  {},
@@ -1150,7 +1162,7 @@ export class VideoService {
1150
1162
  body.history = history;
1151
1163
  }
1152
1164
 
1153
- const result = await this.sdk._fetch(`/video/${roomId}/assistant`, 'POST', {
1165
+ const result = await internalRequest(this.sdk, `/video/${roomId}/assistant`, 'POST', {
1154
1166
  body,
1155
1167
  });
1156
1168
  return result;
@@ -1178,7 +1190,7 @@ export class VideoService {
1178
1190
  body: { text },
1179
1191
  };
1180
1192
 
1181
- const result = await this.sdk._fetch(
1193
+ const result = await internalRequest(this.sdk,
1182
1194
  `/video/${roomId}/transcript/${messageId}`,
1183
1195
  'PATCH',
1184
1196
  params,
@@ -1201,7 +1213,7 @@ export class VideoService {
1201
1213
  },
1202
1214
  );
1203
1215
 
1204
- const result = await this.sdk._fetch(
1216
+ const result = await internalRequest(this.sdk,
1205
1217
  `/video/${roomId}/transcript/${messageId}/redact`,
1206
1218
  'POST',
1207
1219
  {},
@@ -1231,7 +1243,7 @@ export class VideoService {
1231
1243
  body: { participantId, displayName },
1232
1244
  };
1233
1245
 
1234
- const result = await this.sdk._fetch(
1246
+ const result = await internalRequest(this.sdk,
1235
1247
  `/video/${roomId}/transcript-speakers`,
1236
1248
  'PATCH',
1237
1249
  params,
@@ -1252,7 +1264,7 @@ export class VideoService {
1252
1264
  },
1253
1265
  );
1254
1266
 
1255
- const result = await this.sdk._fetch(
1267
+ const result = await internalRequest(this.sdk,
1256
1268
  `/video/${roomId}/recording-convert-retry`,
1257
1269
  'POST',
1258
1270
  {},
@@ -1274,7 +1286,11 @@ export class VideoService {
1274
1286
  },
1275
1287
  );
1276
1288
 
1277
- const result = await this.sdk._fetch(`/video/${roomId}/auto-name`, 'POST', {});
1289
+ const result = await internalRequest(this.sdk,
1290
+ `/video/${roomId}/auto-name`,
1291
+ 'POST',
1292
+ {},
1293
+ );
1278
1294
  return result;
1279
1295
  }
1280
1296
 
@@ -1297,7 +1313,7 @@ export class VideoService {
1297
1313
  body: { action },
1298
1314
  };
1299
1315
 
1300
- const result = await this.sdk._fetch(
1316
+ const result = await internalRequest(this.sdk,
1301
1317
  `/video/${roomId}/transcription`,
1302
1318
  'POST',
1303
1319
  params,
@@ -1325,7 +1341,7 @@ export class VideoService {
1325
1341
  body: { language },
1326
1342
  };
1327
1343
 
1328
- const result = await this.sdk._fetch(
1344
+ const result = await internalRequest(this.sdk,
1329
1345
  `/video/${roomId}/caption-language`,
1330
1346
  'POST',
1331
1347
  params,
@@ -1354,7 +1370,7 @@ export class VideoService {
1354
1370
  body: { targetLanguage },
1355
1371
  };
1356
1372
 
1357
- const result = await this.sdk._fetch(
1373
+ const result = await internalRequest(this.sdk,
1358
1374
  `/video/${roomId}/transcript/translate`,
1359
1375
  'POST',
1360
1376
  params,
@@ -1384,7 +1400,7 @@ export class VideoService {
1384
1400
  body: { image, title },
1385
1401
  };
1386
1402
 
1387
- const result = await this.sdk._fetch(
1403
+ const result = await internalRequest(this.sdk,
1388
1404
  `/video/${roomId}/content-frame`,
1389
1405
  'POST',
1390
1406
  params,
@@ -1405,10 +1421,179 @@ export class VideoService {
1405
1421
  },
1406
1422
  );
1407
1423
 
1408
- const result = await this.sdk._fetch(
1424
+ const result = await internalRequest(this.sdk,
1409
1425
  `/video/${roomId}/content-events`,
1410
1426
  'GET',
1411
1427
  );
1412
1428
  return result;
1413
1429
  }
1430
+
1431
+ /**
1432
+ * Get (or lazily create) the calling user's personal meeting room for this
1433
+ * account. Every account user has exactly one; the first call provisions
1434
+ * it server-side.
1435
+ *
1436
+ * NOTE: implemented flat (`getPersonalRoom`/`updatePersonalRoom`/
1437
+ * `regeneratePersonalRoomPin`/`resolvePersonalRoom`) rather than the
1438
+ * `sdk.video.personalRoom.{get,update,regeneratePin}` namespace named in
1439
+ * the meet-hub plan — this file has no existing nested-namespace
1440
+ * precedent, so flat matches every other method here.
1441
+ *
1442
+ * @param {string} [userId] - Optional target userId (admin viewing another user's room, e.g. Setup -> Users -> Meet). Defaults to the calling user.
1443
+ * @returns {Promise<{personalRoom: {id: string, slug: string, url: string|null, dialInPin: string, guestsCanStart: boolean}}>}
1444
+ */
1445
+ async getPersonalRoom(userId = null) {
1446
+ const params = { query: {} };
1447
+ if (userId) {
1448
+ this.sdk.validateParams(
1449
+ { userId },
1450
+ { userId: { type: 'string', required: true } },
1451
+ );
1452
+ params.query.userId = userId;
1453
+ }
1454
+ const result = await internalRequest(this.sdk, '/video/personal-room', 'GET', params);
1455
+ return result;
1456
+ }
1457
+
1458
+ /**
1459
+ * Update the calling user's personal meeting room (slug and/or
1460
+ * guests-can-start). Omit a field to leave it unchanged.
1461
+ *
1462
+ * @param {Object} [update]
1463
+ * @param {string} [update.slug] - New slug (3-32 chars, lowercase/numbers/hyphens, not reserved). 409-equivalent BadRequestError on collision.
1464
+ * @param {boolean} [update.guestsCanStart] - Whether guests can start the room without the host present.
1465
+ * @param {string} [update.password] - New static room passcode.
1466
+ * @param {string} [update.userId] - Optional target userId (admin editing another user's room). Defaults to the calling user.
1467
+ * @returns {Promise<{personalRoom: {id: string, slug: string, url: string|null, dialInPin: string, guestsCanStart: boolean}}>}
1468
+ */
1469
+ async updatePersonalRoom({ slug, guestsCanStart, password, userId } = {}) {
1470
+ const validationSchema = {};
1471
+ if (slug !== undefined) validationSchema.slug = { type: 'string' };
1472
+ if (guestsCanStart !== undefined)
1473
+ validationSchema.guestsCanStart = { type: 'boolean' };
1474
+ // Static room passcode — 4-6 digits (api-enforced); applied to every
1475
+ // session the room link mints.
1476
+ if (password !== undefined) validationSchema.password = { type: 'string' };
1477
+ if (userId !== undefined) validationSchema.userId = { type: 'string' };
1478
+
1479
+ if (Object.keys(validationSchema).length > 0) {
1480
+ this.sdk.validateParams(
1481
+ { slug, guestsCanStart, password, userId },
1482
+ validationSchema,
1483
+ );
1484
+ }
1485
+
1486
+ const body = {};
1487
+ if (slug !== undefined) body.slug = slug;
1488
+ if (guestsCanStart !== undefined) body.guestsCanStart = guestsCanStart;
1489
+ if (password !== undefined) body.password = password;
1490
+ if (userId !== undefined) body.userId = userId;
1491
+
1492
+ const params = { body };
1493
+ const result = await internalRequest(this.sdk, '/video/personal-room', 'PUT', params);
1494
+ return result;
1495
+ }
1496
+
1497
+ /**
1498
+ * Regenerate the dial-in PIN for the calling user's personal meeting room.
1499
+ *
1500
+ * @param {string} [userId] - Optional target userId (admin action). Defaults to the calling user.
1501
+ * @returns {Promise<{personalRoom: {id: string, dialInPin: string}}>}
1502
+ */
1503
+ async regeneratePersonalRoomPin(userId = null) {
1504
+ const body = {};
1505
+ if (userId) {
1506
+ this.sdk.validateParams(
1507
+ { userId },
1508
+ { userId: { type: 'string', required: true } },
1509
+ );
1510
+ body.userId = userId;
1511
+ }
1512
+ const result = await internalRequest(this.sdk,
1513
+ '/video/personal-room/regenerate-pin',
1514
+ 'POST',
1515
+ { body },
1516
+ );
1517
+ return result;
1518
+ }
1519
+
1520
+ /**
1521
+ * Live availability dry-run for a personal-room slug (settings editor).
1522
+ *
1523
+ * @param {string} slug - Candidate slug.
1524
+ * @param {string} [userId] - Optional target userId (admin action). Defaults to the calling user.
1525
+ * @returns {Promise<{slug: string, available: boolean, reason?: 'invalid'|'taken'}>}
1526
+ */
1527
+ async checkPersonalRoomSlug(slug, userId = null) {
1528
+ this.sdk.validateParams(
1529
+ { slug, userId },
1530
+ {
1531
+ slug: { type: 'string', required: true },
1532
+ userId: { type: 'string', required: false },
1533
+ },
1534
+ );
1535
+ const query = { slug };
1536
+ if (userId) query.userId = userId;
1537
+ const result = await internalRequest(this.sdk,
1538
+ '/video/personal-room/slug-available',
1539
+ 'GET',
1540
+ { query },
1541
+ );
1542
+ return result;
1543
+ }
1544
+
1545
+ /**
1546
+ * Regenerate the static web passcode for the calling user's personal
1547
+ * meeting room (a separate secret from the dial-in PIN). Sessions minted
1548
+ * after this use the new value.
1549
+ *
1550
+ * @param {string} [userId] - Optional target userId (admin action). Defaults to the calling user.
1551
+ * @returns {Promise<{personalRoom: {id: string, password: string}}>}
1552
+ */
1553
+ async regeneratePersonalRoomPassword(userId = null) {
1554
+ const body = {};
1555
+ if (userId) {
1556
+ this.sdk.validateParams(
1557
+ { userId },
1558
+ { userId: { type: 'string', required: true } },
1559
+ );
1560
+ body.userId = userId;
1561
+ }
1562
+ const result = await internalRequest(this.sdk,
1563
+ '/video/personal-room/regenerate-password',
1564
+ 'POST',
1565
+ { body },
1566
+ );
1567
+ return result;
1568
+ }
1569
+
1570
+ /**
1571
+ * Resolve a personal-room slug to a live session (join page). Guest-capable
1572
+ * — mints/claims a fresh meeting if none is live, or returns the already
1573
+ * -claimed session; if the caller is an unauthenticated guest and the room
1574
+ * doesn't allow guests to start, returns `waitingForHost: true` instead.
1575
+ * Guests only receive `password` when they supply the room's static
1576
+ * passcode; otherwise `passwordRequired: true` is returned and the join
1577
+ * page should prompt.
1578
+ *
1579
+ * @param {string} slug - The personal room's slug.
1580
+ * @param {{password?: string}} [options] - The room's static passcode, when known.
1581
+ * @returns {Promise<{claimed: boolean, meetingId?: string, friendlyName?: string, password?: string, passwordRequired?: boolean, waitingForHost?: boolean}>}
1582
+ */
1583
+ async resolvePersonalRoom(slug, { password } = {}) {
1584
+ this.sdk.validateParams(
1585
+ { slug, password },
1586
+ {
1587
+ slug: { type: 'string', required: true },
1588
+ password: { type: 'string', required: false },
1589
+ },
1590
+ );
1591
+
1592
+ const result = await internalRequest(this.sdk,
1593
+ `/video/personal-room/resolve/${slug}`,
1594
+ 'POST',
1595
+ { body: { password } },
1596
+ );
1597
+ return result;
1598
+ }
1414
1599
  }