@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
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class PermissionsService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -10,7 +11,7 @@ export class PermissionsService {
10
11
  * const { results } = await sdk.permissions.listGroups();
11
12
  */
12
13
  async listGroups() {
13
- const result = await this.sdk._fetch('/permissions/groups', 'GET');
14
+ const result = await internalRequest(this.sdk, '/permissions/groups', 'GET');
14
15
  return result;
15
16
  }
16
17
 
@@ -42,7 +43,7 @@ export class PermissionsService {
42
43
  body: groupData,
43
44
  };
44
45
 
45
- const result = await this.sdk._fetch('/permissions/groups', 'POST', params);
46
+ const result = await internalRequest(this.sdk, '/permissions/groups', 'POST', params);
46
47
  return result;
47
48
  }
48
49
 
@@ -67,7 +68,7 @@ export class PermissionsService {
67
68
  body: data,
68
69
  };
69
70
 
70
- const result = await this.sdk._fetch(
71
+ const result = await internalRequest(this.sdk,
71
72
  `/permissions/groups/${groupId}`,
72
73
  'PUT',
73
74
  params,
@@ -91,7 +92,7 @@ export class PermissionsService {
91
92
  },
92
93
  );
93
94
 
94
- const result = await this.sdk._fetch(
95
+ const result = await internalRequest(this.sdk,
95
96
  `/permissions/groups/${groupId}`,
96
97
  'DELETE',
97
98
  );
@@ -121,7 +122,7 @@ export class PermissionsService {
121
122
  body: { userId },
122
123
  };
123
124
 
124
- const result = await this.sdk._fetch(
125
+ const result = await internalRequest(this.sdk,
125
126
  `/permissions/groups/${groupId}/members`,
126
127
  'POST',
127
128
  params,
@@ -148,7 +149,7 @@ export class PermissionsService {
148
149
  },
149
150
  );
150
151
 
151
- const result = await this.sdk._fetch(
152
+ const result = await internalRequest(this.sdk,
152
153
  `/permissions/groups/${groupId}/members/${userId}`,
153
154
  'DELETE',
154
155
  );
@@ -162,7 +163,7 @@ export class PermissionsService {
162
163
  * const { results } = await sdk.permissions.listPermissionSets();
163
164
  */
164
165
  async listPermissionSets() {
165
- const result = await this.sdk._fetch('/permissions/sets', 'GET');
166
+ const result = await internalRequest(this.sdk, '/permissions/sets', 'GET');
166
167
  return result;
167
168
  }
168
169
 
@@ -191,7 +192,7 @@ export class PermissionsService {
191
192
  body: { name, scopes },
192
193
  };
193
194
 
194
- const result = await this.sdk._fetch('/permissions/sets', 'POST', params);
195
+ const result = await internalRequest(this.sdk, '/permissions/sets', 'POST', params);
195
196
  return result;
196
197
  }
197
198
 
@@ -216,7 +217,7 @@ export class PermissionsService {
216
217
  body: data,
217
218
  };
218
219
 
219
- const result = await this.sdk._fetch(
220
+ const result = await internalRequest(this.sdk,
220
221
  `/permissions/sets/${setId}`,
221
222
  'PUT',
222
223
  params,
@@ -240,7 +241,7 @@ export class PermissionsService {
240
241
  },
241
242
  );
242
243
 
243
- const result = await this.sdk._fetch(
244
+ const result = await internalRequest(this.sdk,
244
245
  `/permissions/sets/${setId}`,
245
246
  'DELETE',
246
247
  );
@@ -285,7 +286,7 @@ export class PermissionsService {
285
286
  body: { permissionSetId, principalType, principalId, grantType },
286
287
  };
287
288
 
288
- const result = await this.sdk._fetch(
289
+ const result = await internalRequest(this.sdk,
289
290
  '/permissions/assignments',
290
291
  'POST',
291
292
  params,
@@ -314,7 +315,7 @@ export class PermissionsService {
314
315
  },
315
316
  );
316
317
 
317
- const result = await this.sdk._fetch(
318
+ const result = await internalRequest(this.sdk,
318
319
  `/permissions/assignments/${permissionSetId}/${principalType}/${principalId}`,
319
320
  'DELETE',
320
321
  );
@@ -341,7 +342,7 @@ export class PermissionsService {
341
342
  groupId: { type: 'string', required: true },
342
343
  },
343
344
  );
344
- const result = await this.sdk._fetch(
345
+ const result = await internalRequest(this.sdk,
345
346
  `/permissions/groups/${groupId}/effective-scopes`,
346
347
  'GET',
347
348
  );
@@ -357,7 +358,7 @@ export class PermissionsService {
357
358
  },
358
359
  );
359
360
 
360
- const result = await this.sdk._fetch(
361
+ const result = await internalRequest(this.sdk,
361
362
  `/permissions/users/${userId}/effective-scopes`,
362
363
  'GET',
363
364
  );
@@ -371,7 +372,7 @@ export class PermissionsService {
371
372
  * const { pillars } = await sdk.permissions.getScopeCatalog();
372
373
  */
373
374
  async getScopeCatalog() {
374
- const result = await this.sdk._fetch('/permissions/scope-catalog', 'GET');
375
+ const result = await internalRequest(this.sdk, '/permissions/scope-catalog', 'GET');
375
376
  return result;
376
377
  }
377
378
 
@@ -380,7 +381,7 @@ export class PermissionsService {
380
381
  * @returns {Promise<Object>} { groupSettable: [{key,label,type,pillar,...}], neverSettable: [] }
381
382
  */
382
383
  async getSettingsCatalog() {
383
- return this.sdk._fetch('/permissions/settings/catalog', 'GET');
384
+ return internalRequest(this.sdk, '/permissions/settings/catalog', 'GET');
384
385
  }
385
386
 
386
387
  /**
@@ -391,7 +392,7 @@ export class PermissionsService {
391
392
  async listGroupSettings(groupId) {
392
393
  groupId = String(groupId);
393
394
  this.sdk.validateParams({ groupId }, { groupId: { type: 'string', required: true } });
394
- return this.sdk._fetch(`/permissions/groups/${groupId}/settings`, 'GET');
395
+ return internalRequest(this.sdk, `/permissions/groups/${groupId}/settings`, 'GET');
395
396
  }
396
397
 
397
398
  /** Set one configuration value on a group. */
@@ -405,7 +406,7 @@ export class PermissionsService {
405
406
  settingKey: { type: 'string', required: true },
406
407
  },
407
408
  );
408
- return this.sdk._fetch(
409
+ return internalRequest(this.sdk,
409
410
  `/permissions/groups/${groupId}/settings/${settingKey}`,
410
411
  'PUT',
411
412
  { body: { value } },
@@ -423,7 +424,7 @@ export class PermissionsService {
423
424
  settingKey: { type: 'string', required: true },
424
425
  },
425
426
  );
426
- return this.sdk._fetch(
427
+ return internalRequest(this.sdk,
427
428
  `/permissions/groups/${groupId}/settings/${settingKey}`,
428
429
  'DELETE',
429
430
  );
@@ -435,7 +436,7 @@ export class PermissionsService {
435
436
  */
436
437
  async setGroupPriority(order) {
437
438
  this.sdk.validateParams({ order }, { order: { type: 'array', required: true } });
438
- return this.sdk._fetch('/permissions/groups/priority', 'PUT', {
439
+ return internalRequest(this.sdk, '/permissions/groups/priority', 'PUT', {
439
440
  body: { order: order.map(String) },
440
441
  });
441
442
  }
@@ -448,7 +449,7 @@ export class PermissionsService {
448
449
  async getUserSettings(userId) {
449
450
  userId = String(userId);
450
451
  this.sdk.validateParams({ userId }, { userId: { type: 'string', required: true } });
451
- return this.sdk._fetch(`/permissions/users/${userId}/settings`, 'GET');
452
+ return internalRequest(this.sdk, `/permissions/users/${userId}/settings`, 'GET');
452
453
  }
453
454
 
454
455
  /** Override one configuration value for a single user. */
@@ -462,7 +463,7 @@ export class PermissionsService {
462
463
  settingKey: { type: 'string', required: true },
463
464
  },
464
465
  );
465
- return this.sdk._fetch(
466
+ return internalRequest(this.sdk,
466
467
  `/permissions/users/${userId}/settings/${settingKey}`,
467
468
  'PUT',
468
469
  { body: { value } },
@@ -480,7 +481,7 @@ export class PermissionsService {
480
481
  settingKey: { type: 'string', required: true },
481
482
  },
482
483
  );
483
- return this.sdk._fetch(
484
+ return internalRequest(this.sdk,
484
485
  `/permissions/users/${userId}/settings/${settingKey}`,
485
486
  'DELETE',
486
487
  );
@@ -503,7 +504,7 @@ export class PermissionsService {
503
504
  stateKey: { type: 'string', required: true },
504
505
  },
505
506
  );
506
- return this.sdk._fetch(
507
+ return internalRequest(this.sdk,
507
508
  `/permissions/users/${userId}/app-state/${stateKey}`,
508
509
  'GET',
509
510
  );
@@ -523,7 +524,7 @@ export class PermissionsService {
523
524
  stateKey: { type: 'string', required: true },
524
525
  },
525
526
  );
526
- return this.sdk._fetch(
527
+ return internalRequest(this.sdk,
527
528
  `/permissions/users/${userId}/app-state/${stateKey}`,
528
529
  'PUT',
529
530
  { body: { value } },
@@ -541,7 +542,7 @@ export class PermissionsService {
541
542
 
542
543
  /** Skill + queue vocabulary for the group assignment pickers. */
543
544
  async getTaskRoutingCatalog() {
544
- return this.sdk._fetch('/permissions/task-routing/catalog', 'GET');
545
+ return internalRequest(this.sdk, '/permissions/task-routing/catalog', 'GET');
545
546
  }
546
547
 
547
548
  /** Skills this group grants. @returns {Promise<{results: Array<{skillId}>}>} */
@@ -551,7 +552,7 @@ export class PermissionsService {
551
552
  { groupId },
552
553
  { groupId: { type: 'string', required: true } },
553
554
  );
554
- return this.sdk._fetch(`/permissions/groups/${groupId}/skills`, 'GET');
555
+ return internalRequest(this.sdk, `/permissions/groups/${groupId}/skills`, 'GET');
555
556
  }
556
557
 
557
558
  /** Replace the group's full skill list. */
@@ -564,7 +565,7 @@ export class PermissionsService {
564
565
  skillIds: { type: 'array', required: true },
565
566
  },
566
567
  );
567
- return this.sdk._fetch(`/permissions/groups/${groupId}/skills`, 'PUT', {
568
+ return internalRequest(this.sdk, `/permissions/groups/${groupId}/skills`, 'PUT', {
568
569
  body: { skillIds: skillIds.map(String) },
569
570
  });
570
571
  }
@@ -576,7 +577,7 @@ export class PermissionsService {
576
577
  { groupId },
577
578
  { groupId: { type: 'string', required: true } },
578
579
  );
579
- return this.sdk._fetch(`/permissions/groups/${groupId}/queues`, 'GET');
580
+ return internalRequest(this.sdk, `/permissions/groups/${groupId}/queues`, 'GET');
580
581
  }
581
582
 
582
583
  /**
@@ -595,7 +596,7 @@ export class PermissionsService {
595
596
  queues: { type: 'array', required: true },
596
597
  },
597
598
  );
598
- return this.sdk._fetch(`/permissions/groups/${groupId}/queues`, 'PUT', {
599
+ return internalRequest(this.sdk, `/permissions/groups/${groupId}/queues`, 'PUT', {
599
600
  body: {
600
601
  queues: queues.map((q) => ({
601
602
  queueId: String(q.queueId),
@@ -617,7 +618,7 @@ export class PermissionsService {
617
618
  { userId },
618
619
  { userId: { type: 'string', required: true } },
619
620
  );
620
- return this.sdk._fetch(`/permissions/users/${userId}/task-routing`, 'GET');
621
+ return internalRequest(this.sdk, `/permissions/users/${userId}/task-routing`, 'GET');
621
622
  }
622
623
 
623
624
  /** Exclude one group-granted skill/queue from this user ("in Sales but not queue X"). */
@@ -633,7 +634,7 @@ export class PermissionsService {
633
634
  value: { type: 'string', required: true },
634
635
  },
635
636
  );
636
- return this.sdk._fetch(
637
+ return internalRequest(this.sdk,
637
638
  `/permissions/users/${userId}/task-routing/exclusions/${settingKey}/${value}`,
638
639
  'PUT',
639
640
  );
@@ -652,7 +653,7 @@ export class PermissionsService {
652
653
  value: { type: 'string', required: true },
653
654
  },
654
655
  );
655
- return this.sdk._fetch(
656
+ return internalRequest(this.sdk,
656
657
  `/permissions/users/${userId}/task-routing/exclusions/${settingKey}/${value}`,
657
658
  'DELETE',
658
659
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class PhoneNumbersService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -59,7 +60,7 @@ export class PhoneNumbersService {
59
60
  },
60
61
  };
61
62
 
62
- const result = await this.sdk._fetch('/phoneNumbers/search', 'GET', params);
63
+ const result = await internalRequest(this.sdk, '/phoneNumbers/search', 'GET', params);
63
64
  return result;
64
65
  }
65
66
 
@@ -79,7 +80,7 @@ export class PhoneNumbersService {
79
80
  body: orderData,
80
81
  };
81
82
 
82
- const result = await this.sdk._fetch('/phoneNumbers/order', 'POST', params);
83
+ const result = await internalRequest(this.sdk, '/phoneNumbers/order', 'POST', params);
83
84
  return result;
84
85
  }
85
86
 
@@ -91,7 +92,7 @@ export class PhoneNumbersService {
91
92
  },
92
93
  );
93
94
 
94
- const result = await this.sdk._fetch(
95
+ const result = await internalRequest(this.sdk,
95
96
  `/phoneNumbers/${phoneNumber}`,
96
97
  'DELETE',
97
98
  );
@@ -159,7 +160,7 @@ export class PhoneNumbersService {
159
160
  body: updateData,
160
161
  };
161
162
 
162
- const result = await this.sdk._fetch(`/phoneNumbers/${id}`, 'PUT', params);
163
+ const result = await internalRequest(this.sdk, `/phoneNumbers/${id}`, 'PUT', params);
163
164
  return result;
164
165
  }
165
166
 
@@ -176,7 +177,7 @@ export class PhoneNumbersService {
176
177
  body: { cnam },
177
178
  };
178
179
 
179
- const result = await this.sdk._fetch(
180
+ const result = await internalRequest(this.sdk,
180
181
  `/phoneNumbers/cnam/${phoneNumber}`,
181
182
  'PUT',
182
183
  params,
@@ -192,7 +193,7 @@ export class PhoneNumbersService {
192
193
  },
193
194
  );
194
195
 
195
- const result = await this.sdk._fetch(
196
+ const result = await internalRequest(this.sdk,
196
197
  `/phoneNumbers/format/${number}`,
197
198
  'GET',
198
199
  );
@@ -272,7 +273,7 @@ export class PhoneNumbersService {
272
273
  },
273
274
  };
274
275
 
275
- const result = await this.sdk._fetch(
276
+ const result = await internalRequest(this.sdk,
276
277
  '/phoneNumbers/routing-options',
277
278
  'GET',
278
279
  params,
@@ -281,7 +282,7 @@ export class PhoneNumbersService {
281
282
  }
282
283
 
283
284
  async getSupportedCountries() {
284
- const result = await this.sdk._fetch(
285
+ const result = await internalRequest(this.sdk,
285
286
  '/phoneNumbers/supported-countries',
286
287
  'GET',
287
288
  );
@@ -323,7 +324,7 @@ export class PhoneNumbersService {
323
324
  const body = { phoneNumbers, runPortabilityCheck };
324
325
  if (portingOrderId) body.portingOrderId = portingOrderId;
325
326
 
326
- const result = await this.sdk._fetch(
327
+ const result = await internalRequest(this.sdk,
327
328
  '/phoneNumbers/porting/portability-check',
328
329
  'POST',
329
330
  {
@@ -394,7 +395,7 @@ export class PhoneNumbersService {
394
395
  if (portOrderType) body.portOrderType = portOrderType;
395
396
  if (tags) body.tags = tags;
396
397
 
397
- const result = await this.sdk._fetch(
398
+ const result = await internalRequest(this.sdk,
398
399
  '/phoneNumbers/porting/orders',
399
400
  'POST',
400
401
  {
@@ -429,7 +430,7 @@ export class PhoneNumbersService {
429
430
  query,
430
431
  };
431
432
 
432
- const result = await this.sdk._fetch(url, 'GET', params);
433
+ const result = await internalRequest(this.sdk, url, 'GET', params);
433
434
  return result;
434
435
  }
435
436
 
@@ -470,7 +471,7 @@ export class PhoneNumbersService {
470
471
  ? `/phoneNumbers/porting/orders/${id}?${queryString}`
471
472
  : `/phoneNumbers/porting/orders/${id}`;
472
473
 
473
- const result = await this.sdk._fetch(url, 'GET');
474
+ const result = await internalRequest(this.sdk, url, 'GET');
474
475
  return result;
475
476
  }
476
477
 
@@ -510,7 +511,7 @@ export class PhoneNumbersService {
510
511
  if (portOrderType) body.portOrderType = portOrderType;
511
512
  if (tags) body.tags = tags;
512
513
 
513
- const result = await this.sdk._fetch(
514
+ const result = await internalRequest(this.sdk,
514
515
  `/phoneNumbers/porting/orders/${id}`,
515
516
  'PUT',
516
517
  {
@@ -538,7 +539,7 @@ export class PhoneNumbersService {
538
539
  status: 'submit',
539
540
  };
540
541
 
541
- const result = await this.sdk._fetch(
542
+ const result = await internalRequest(this.sdk,
542
543
  `/phoneNumbers/porting/orders/${id}`,
543
544
  'PUT',
544
545
  {
@@ -565,7 +566,7 @@ export class PhoneNumbersService {
565
566
  },
566
567
  );
567
568
 
568
- const result = await this.sdk._fetch(
569
+ const result = await internalRequest(this.sdk,
569
570
  `/phoneNumbers/porting/orders/${id}`,
570
571
  'DELETE',
571
572
  );
@@ -595,7 +596,7 @@ export class PhoneNumbersService {
595
596
  },
596
597
  );
597
598
 
598
- const result = await this.sdk._fetch(
599
+ const result = await internalRequest(this.sdk,
599
600
  `/phoneNumbers/porting/orders/${encodeURIComponent(
600
601
  portingOrderId,
601
602
  )}/numbers/${encodeURIComponent(phoneNumber)}`,
@@ -639,7 +640,7 @@ export class PhoneNumbersService {
639
640
 
640
641
  if (documentId) body.documentId = documentId;
641
642
 
642
- const result = await this.sdk._fetch(
643
+ const result = await internalRequest(this.sdk,
643
644
  '/phoneNumbers/porting/documents',
644
645
  'POST',
645
646
  {
@@ -671,7 +672,7 @@ export class PhoneNumbersService {
671
672
  },
672
673
  );
673
674
 
674
- const result = await this.sdk._fetch(
675
+ const result = await internalRequest(this.sdk,
675
676
  `/phoneNumbers/porting/orders/${encodeURIComponent(
676
677
  portingOrderId,
677
678
  )}/generate-loa`,
@@ -700,7 +701,7 @@ export class PhoneNumbersService {
700
701
  ? `/phoneNumbers/porting/orders/${id}/events?${queryString}`
701
702
  : `/phoneNumbers/porting/orders/${id}/events`;
702
703
 
703
- const result = await this.sdk._fetch(url, 'GET');
704
+ const result = await internalRequest(this.sdk, url, 'GET');
704
705
  return result;
705
706
  }
706
707
 
@@ -734,7 +735,7 @@ export class PhoneNumbersService {
734
735
  },
735
736
  );
736
737
 
737
- const result = await this.sdk._fetch(
738
+ const result = await internalRequest(this.sdk,
738
739
  `/phoneNumbers/porting/orders/${id}/foc-windows`,
739
740
  'GET',
740
741
  );
@@ -765,7 +766,7 @@ export class PhoneNumbersService {
765
766
  },
766
767
  );
767
768
 
768
- const result = await this.sdk._fetch(
769
+ const result = await internalRequest(this.sdk,
769
770
  `/phoneNumbers/porting/orders/${id}/sync`,
770
771
  'POST',
771
772
  );
@@ -806,7 +807,7 @@ export class PhoneNumbersService {
806
807
  queryString ? '?' + queryString : ''
807
808
  }`;
808
809
 
809
- const result = await this.sdk._fetch(url, 'GET');
810
+ const result = await internalRequest(this.sdk, url, 'GET');
810
811
  return result;
811
812
  }
812
813
 
@@ -840,7 +841,7 @@ export class PhoneNumbersService {
840
841
  },
841
842
  );
842
843
 
843
- const result = await this.sdk._fetch(
844
+ const result = await internalRequest(this.sdk,
844
845
  `/phoneNumbers/porting/orders/${id}/comments`,
845
846
  'POST',
846
847
  {
@@ -889,7 +890,7 @@ export class PhoneNumbersService {
889
890
  },
890
891
  );
891
892
 
892
- const result = await this.sdk._fetch(
893
+ const result = await internalRequest(this.sdk,
893
894
  '/phoneNumbers/porting/auto-create-orders',
894
895
  'POST',
895
896
  {
@@ -919,7 +920,7 @@ export class PhoneNumberCarrierService {
919
920
  query: { updateVoiceConnection, updateMessagingConnection },
920
921
  };
921
922
 
922
- const result = await this.sdk._fetch(
923
+ const result = await internalRequest(this.sdk,
923
924
  `/phoneNumbers/carrier/syncPhoneNumbers/${carrier}`,
924
925
  'POST',
925
926
  params,
@@ -935,7 +936,7 @@ export class PhoneNumberCarrierService {
935
936
  },
936
937
  );
937
938
 
938
- const result = await this.sdk._fetch(
939
+ const result = await internalRequest(this.sdk,
939
940
  `/phoneNumbers/carrier/${phoneNumber}`,
940
941
  'GET',
941
942
  );
@@ -950,7 +951,7 @@ export class PhoneNumberCarrierService {
950
951
  },
951
952
  );
952
953
 
953
- const result = await this.sdk._fetch(
954
+ const result = await internalRequest(this.sdk,
954
955
  `/phoneNumbers/carrier/${phoneNumber}`,
955
956
  'DELETE',
956
957
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class PortalsService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -61,7 +62,7 @@ export class PortalsService {
61
62
  body: portalData,
62
63
  };
63
64
 
64
- const result = await this.sdk._fetch('/portals', 'POST', params);
65
+ const result = await internalRequest(this.sdk, '/portals', 'POST', params);
65
66
  return result;
66
67
  }
67
68
 
@@ -121,7 +122,7 @@ export class PortalsService {
121
122
  body: updateData,
122
123
  };
123
124
 
124
- const result = await this.sdk._fetch(`/portals/${portalId}`, 'PUT', params);
125
+ const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'PUT', params);
125
126
  return result;
126
127
  }
127
128
 
@@ -139,7 +140,7 @@ export class PortalsService {
139
140
  },
140
141
  );
141
142
 
142
- const result = await this.sdk._fetch(`/portals/${portalId}`, 'DELETE');
143
+ const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'DELETE');
143
144
  return result;
144
145
  }
145
146
 
@@ -157,7 +158,7 @@ export class PortalsService {
157
158
  },
158
159
  );
159
160
 
160
- const result = await this.sdk._fetch(`/portals/${portalId}`, 'GET');
161
+ const result = await internalRequest(this.sdk, `/portals/${portalId}`, 'GET');
161
162
  return result;
162
163
  }
163
164
 
@@ -184,7 +185,7 @@ export class PortalsService {
184
185
  query: { domain },
185
186
  };
186
187
 
187
- const result = await this.sdk._fetch('/portals/public', 'GET', params);
188
+ const result = await internalRequest(this.sdk, '/portals/public', 'GET', params);
188
189
  return result;
189
190
  }
190
191
 
@@ -194,7 +195,7 @@ export class PortalsService {
194
195
  * @returns {Promise<{ portals: object[] }>} An object containing an array of portal records.
195
196
  */
196
197
  async list() {
197
- const result = await this.sdk._fetch('/portals', 'GET');
198
+ const result = await internalRequest(this.sdk, '/portals', 'GET');
198
199
  return result;
199
200
  }
200
201
 
@@ -222,7 +223,7 @@ export class PortalsService {
222
223
  },
223
224
  );
224
225
 
225
- const result = await this.sdk._fetch(
226
+ const result = await internalRequest(this.sdk,
226
227
  `/portals/${portalId}/verify-dns`,
227
228
  'POST',
228
229
  );
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class RecordTypesService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -55,7 +56,7 @@ export class RecordTypesService {
55
56
  body: recordTypeData,
56
57
  };
57
58
 
58
- const result = await this.sdk._fetch('/recordTypes/', 'POST', params);
59
+ const result = await internalRequest(this.sdk, '/recordTypes/', 'POST', params);
59
60
  return result;
60
61
  }
61
62
 
@@ -110,7 +111,7 @@ export class RecordTypesService {
110
111
  body: updateData,
111
112
  };
112
113
 
113
- const result = await this.sdk._fetch(`/recordTypes/${id}`, 'PUT', params);
114
+ const result = await internalRequest(this.sdk, `/recordTypes/${id}`, 'PUT', params);
114
115
  return result;
115
116
  }
116
117
 
@@ -129,7 +130,7 @@ export class RecordTypesService {
129
130
  },
130
131
  );
131
132
 
132
- const result = await this.sdk._fetch(`/recordTypes/${id}`, 'DELETE');
133
+ const result = await internalRequest(this.sdk, `/recordTypes/${id}`, 'DELETE');
133
134
  return result;
134
135
  }
135
136
 
@@ -173,7 +174,7 @@ export class RecordTypesService {
173
174
  query: options,
174
175
  };
175
176
 
176
- const result = await this.sdk._fetch(`/recordTypes/${id}`, 'GET', params);
177
+ const result = await internalRequest(this.sdk, `/recordTypes/${id}`, 'GET', params);
177
178
  return result;
178
179
  }
179
180
 
@@ -225,7 +226,7 @@ export class RecordTypesService {
225
226
  query: options,
226
227
  };
227
228
 
228
- const result = await this.sdk._fetch('/recordTypes/', 'GET', params);
229
+ const result = await internalRequest(this.sdk, '/recordTypes/', 'GET', params);
229
230
  return result;
230
231
  }
231
232
  }
@@ -252,7 +253,7 @@ export class UserRecordTypeDefaultsService {
252
253
  body: defaultData,
253
254
  };
254
255
 
255
- const result = await this.sdk._fetch('/recordTypes/user/', 'POST', params);
256
+ const result = await internalRequest(this.sdk, '/recordTypes/user/', 'POST', params);
256
257
  return result;
257
258
  }
258
259
 
@@ -273,7 +274,7 @@ export class UserRecordTypeDefaultsService {
273
274
  body: updateData,
274
275
  };
275
276
 
276
- const result = await this.sdk._fetch('/recordTypes/user/', 'PUT', params);
277
+ const result = await internalRequest(this.sdk, '/recordTypes/user/', 'PUT', params);
277
278
  return result;
278
279
  }
279
280
 
@@ -293,7 +294,7 @@ export class UserRecordTypeDefaultsService {
293
294
  body: deleteData,
294
295
  };
295
296
 
296
- const result = await this.sdk._fetch(
297
+ const result = await internalRequest(this.sdk,
297
298
  '/recordTypes/user/',
298
299
  'DELETE',
299
300
  params,
@@ -314,7 +315,7 @@ export class UserRecordTypeDefaultsService {
314
315
  query: { object, userId },
315
316
  };
316
317
 
317
- const result = await this.sdk._fetch('/recordTypes/user/', 'GET', params);
318
+ const result = await internalRequest(this.sdk, '/recordTypes/user/', 'GET', params);
318
319
  return result;
319
320
  }
320
321
 
@@ -356,7 +357,7 @@ export class UserRecordTypeDefaultsService {
356
357
  ? `/recordTypes/user/defaults/${userId}`
357
358
  : '/recordTypes/user/defaults';
358
359
 
359
- const result = await this.sdk._fetch(url, 'GET', params);
360
+ const result = await internalRequest(this.sdk, url, 'GET', params);
360
361
  return result;
361
362
  }
362
363
 
@@ -397,7 +398,7 @@ export class UserRecordTypeDefaultsService {
397
398
  query: options,
398
399
  };
399
400
 
400
- const result = await this.sdk._fetch(
401
+ const result = await internalRequest(this.sdk,
401
402
  `/recordTypes/${recordTypeId}/users`,
402
403
  'GET',
403
404
  params,