@unboundcx/sdk 4.8.10 → 4.8.12

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 (56) hide show
  1. package/base.js +41 -1
  2. package/index.js +9 -6
  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 +267 -52
  10. package/services/developerApis.js +174 -0
  11. package/services/directory.js +40 -9
  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/knowledgeBase.js +9 -8
  20. package/services/layouts.js +15 -14
  21. package/services/login.js +8 -7
  22. package/services/lookup.js +4 -3
  23. package/services/messaging/EmailAddressesService.js +5 -4
  24. package/services/messaging/EmailAnalyticsService.js +5 -4
  25. package/services/messaging/EmailDomainsService.js +8 -7
  26. package/services/messaging/EmailMailboxesService.js +13 -12
  27. package/services/messaging/EmailQueueService.js +2 -1
  28. package/services/messaging/EmailService.js +12 -11
  29. package/services/messaging/EmailSuppressionService.js +5 -4
  30. package/services/messaging/EmailTemplatesService.js +6 -5
  31. package/services/messaging/SmsService.js +3 -2
  32. package/services/messaging/SmsTemplatesService.js +6 -5
  33. package/services/messaging/TenDlcBrandsService.js +11 -10
  34. package/services/messaging/TenDlcCampaignManagementService.js +14 -13
  35. package/services/messaging/TenDlcCampaignsService.js +2 -1
  36. package/services/messaging/TollFreeCampaignsService.js +13 -12
  37. package/services/notes.js +7 -6
  38. package/services/objects.js +97 -36
  39. package/services/permissions.js +34 -33
  40. package/services/phoneNumbers.js +28 -27
  41. package/services/portals.js +8 -7
  42. package/services/{inbox.js → recents.js} +9 -8
  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 +9 -8
  49. package/services/taskRouter/MetricsService.js +3 -2
  50. package/services/taskRouter/TaskService.js +13 -12
  51. package/services/taskRouter/WorkerService.js +9 -8
  52. package/services/triggers.js +9 -8
  53. package/services/verification.js +5 -4
  54. package/services/video.js +52 -51
  55. package/services/voice.js +13 -12
  56. package/services/workflows.js +22 -21
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  /**
2
3
  * Objects Service - Manage data objects in the Unbound platform
3
4
  *
@@ -84,7 +85,7 @@ export class ObjectsService {
84
85
 
85
86
  const params = { query };
86
87
 
87
- const result = await this.sdk._fetch(`/object/${id}`, 'GET', params);
88
+ const result = await internalRequest(this.sdk, `/object/${id}`, 'GET', params);
88
89
  // console.log(`sdk.objects.byId :: params :: `, params, result);
89
90
  return result;
90
91
  }
@@ -157,7 +158,7 @@ export class ObjectsService {
157
158
  if (expandDetails) query.expandDetails = expandDetails;
158
159
 
159
160
  const params = { query };
160
- return await this.sdk._fetch(`/object/query/${object}`, 'GET', params);
161
+ return await internalRequest(this.sdk, `/object/query/${object}`, 'GET', params);
161
162
  }
162
163
 
163
164
  // Old signature: query(objectName, queryParams)
@@ -172,7 +173,7 @@ export class ObjectsService {
172
173
  );
173
174
 
174
175
  const params = { query: queryParams };
175
- return await this.sdk._fetch(
176
+ return await internalRequest(this.sdk,
176
177
  `/object/query/${objectName}`,
177
178
  'GET',
178
179
  params,
@@ -204,7 +205,7 @@ export class ObjectsService {
204
205
  const body = { query, expandDetails };
205
206
  if (isPublic) body.isPublic = isPublic;
206
207
  const params = { body };
207
- return await this.sdk._fetch('/object/query/v2', 'POST', params);
208
+ return await internalRequest(this.sdk, '/object/query/v2', 'POST', params);
208
209
  }
209
210
 
210
211
  /**
@@ -243,7 +244,7 @@ export class ObjectsService {
243
244
  };
244
245
  if (skipTriggers) params.query = { skipTriggers: true };
245
246
 
246
- return await this.sdk._fetch(`/object/${object}`, 'PUT', params);
247
+ return await internalRequest(this.sdk, `/object/${object}`, 'PUT', params);
247
248
  }
248
249
 
249
250
  // Old signature: updateById(object, id, update)
@@ -266,7 +267,7 @@ export class ObjectsService {
266
267
  },
267
268
  };
268
269
 
269
- return await this.sdk._fetch(`/object/${object}`, 'PUT', params);
270
+ return await internalRequest(this.sdk, `/object/${object}`, 'PUT', params);
270
271
  }
271
272
 
272
273
  throw new Error('Invalid arguments for updateById method');
@@ -309,7 +310,7 @@ export class ObjectsService {
309
310
  };
310
311
  if (skipTriggers) params.query = { skipTriggers: true };
311
312
 
312
- const result = await this.sdk._fetch(`/object/${object}`, 'PUT', params);
313
+ const result = await internalRequest(this.sdk, `/object/${object}`, 'PUT', params);
313
314
  return result;
314
315
  }
315
316
 
@@ -342,7 +343,7 @@ export class ObjectsService {
342
343
 
343
344
  const params = { body };
344
345
  if (skipTriggers) params.query = { skipTriggers: true };
345
- return await this.sdk._fetch(`/object/${object}`, 'POST', params);
346
+ return await internalRequest(this.sdk, `/object/${object}`, 'POST', params);
346
347
  }
347
348
 
348
349
  // Old signature: create(object, body)
@@ -358,7 +359,7 @@ export class ObjectsService {
358
359
  );
359
360
 
360
361
  const params = { body };
361
- return await this.sdk._fetch(`/object/${object}`, 'POST', params);
362
+ return await internalRequest(this.sdk, `/object/${object}`, 'POST', params);
362
363
  }
363
364
 
364
365
  throw new Error('Invalid arguments for create method');
@@ -397,7 +398,7 @@ export class ObjectsService {
397
398
  };
398
399
  if (skipTriggers) params.query = { skipTriggers: true };
399
400
 
400
- const result = await this.sdk._fetch(`/object/${object}`, 'DELETE', params);
401
+ const result = await internalRequest(this.sdk, `/object/${object}`, 'DELETE', params);
401
402
  return result;
402
403
  }
403
404
 
@@ -432,7 +433,7 @@ export class ObjectsService {
432
433
  };
433
434
  if (skipTriggers) params.query = { skipTriggers: true };
434
435
 
435
- const result = await this.sdk._fetch(`/object/${object}`, 'DELETE', params);
436
+ const result = await internalRequest(this.sdk, `/object/${object}`, 'DELETE', params);
436
437
  return result;
437
438
  }
438
439
 
@@ -447,7 +448,7 @@ export class ObjectsService {
447
448
  { objectName },
448
449
  { objectName: { type: 'string', required: true } },
449
450
  );
450
- return await this.sdk._fetch('/object/views', 'GET', {
451
+ return await internalRequest(this.sdk, '/object/views', 'GET', {
451
452
  query: { objectName },
452
453
  });
453
454
  }
@@ -472,7 +473,7 @@ export class ObjectsService {
472
473
  );
473
474
  const body = { objectName, name, filters };
474
475
  if (visibility !== undefined) body.visibility = visibility;
475
- return await this.sdk._fetch('/object/views', 'POST', { body });
476
+ return await internalRequest(this.sdk, '/object/views', 'POST', { body });
476
477
  }
477
478
 
478
479
  /**
@@ -485,11 +486,11 @@ export class ObjectsService {
485
486
  { viewId },
486
487
  { viewId: { type: 'string', required: true } },
487
488
  );
488
- return await this.sdk._fetch(`/object/views/${viewId}`, 'DELETE');
489
+ return await internalRequest(this.sdk, `/object/views/${viewId}`, 'DELETE');
489
490
  }
490
491
 
491
492
  async botSchema() {
492
- const result = await this.sdk._fetch(
493
+ const result = await internalRequest(this.sdk,
493
494
  '/object/manage/bot-schema',
494
495
  'GET',
495
496
  );
@@ -506,7 +507,7 @@ export class ObjectsService {
506
507
 
507
508
  const params = {};
508
509
 
509
- const result = await this.sdk._fetch(
510
+ const result = await internalRequest(this.sdk,
510
511
  `/object/describe/${object}`,
511
512
  'GET',
512
513
  params,
@@ -517,7 +518,7 @@ export class ObjectsService {
517
518
  async list() {
518
519
  const params = {};
519
520
 
520
- const result = await this.sdk._fetch(`/object/`, 'GET', params);
521
+ const result = await internalRequest(this.sdk, `/object/`, 'GET', params);
521
522
  return result;
522
523
  }
523
524
 
@@ -567,7 +568,7 @@ export class ObjectsService {
567
568
  };
568
569
  const params = { body };
569
570
 
570
- const result = await this.sdk._fetch(
571
+ const result = await internalRequest(this.sdk,
571
572
  `/object/expandDetails`,
572
573
  'POST',
573
574
  params,
@@ -616,7 +617,7 @@ export class ObjectsService {
616
617
 
617
618
  const params = { query };
618
619
 
619
- const result = await this.sdk._fetch(
620
+ const result = await internalRequest(this.sdk,
620
621
  `/object/expandDetails`,
621
622
  'GET',
622
623
  params,
@@ -632,7 +633,7 @@ export class ObjectsService {
632
633
  },
633
634
  );
634
635
 
635
- const result = await this.sdk._fetch(`/object/expandDetails/${id}`, 'GET');
636
+ const result = await internalRequest(this.sdk, `/object/expandDetails/${id}`, 'GET');
636
637
  return result;
637
638
  }
638
639
 
@@ -680,7 +681,7 @@ export class ObjectsService {
680
681
 
681
682
  const params = { body };
682
683
 
683
- const result = await this.sdk._fetch(
684
+ const result = await internalRequest(this.sdk,
684
685
  `/object/expandDetails/${id}`,
685
686
  'PUT',
686
687
  params,
@@ -696,7 +697,7 @@ export class ObjectsService {
696
697
  },
697
698
  );
698
699
 
699
- const result = await this.sdk._fetch(
700
+ const result = await internalRequest(this.sdk,
700
701
  `/object/expandDetails/${id}`,
701
702
  'DELETE',
702
703
  );
@@ -749,7 +750,7 @@ export class ObjectsService {
749
750
  };
750
751
  const params = { body };
751
752
 
752
- const result = await this.sdk._fetch(
753
+ const result = await internalRequest(this.sdk,
753
754
  `/object/generatedColumns`,
754
755
  'POST',
755
756
  params,
@@ -787,7 +788,7 @@ export class ObjectsService {
787
788
 
788
789
  const params = { query };
789
790
 
790
- const result = await this.sdk._fetch(
791
+ const result = await internalRequest(this.sdk,
791
792
  `/object/generatedColumns`,
792
793
  'GET',
793
794
  params,
@@ -803,7 +804,7 @@ export class ObjectsService {
803
804
  },
804
805
  );
805
806
 
806
- const result = await this.sdk._fetch(
807
+ const result = await internalRequest(this.sdk,
807
808
  `/object/generatedColumns/${id}`,
808
809
  'GET',
809
810
  );
@@ -845,7 +846,7 @@ export class ObjectsService {
845
846
 
846
847
  const params = { body };
847
848
 
848
- const result = await this.sdk._fetch(
849
+ const result = await internalRequest(this.sdk,
849
850
  `/object/generatedColumns/${id}`,
850
851
  'PUT',
851
852
  params,
@@ -861,7 +862,7 @@ export class ObjectsService {
861
862
  },
862
863
  );
863
864
 
864
- const result = await this.sdk._fetch(
865
+ const result = await internalRequest(this.sdk,
865
866
  `/object/generatedColumns/${id}`,
866
867
  'DELETE',
867
868
  );
@@ -880,7 +881,7 @@ export class ObjectsService {
880
881
  const body = { name };
881
882
  const params = { body };
882
883
 
883
- const result = await this.sdk._fetch(`/object/manage`, 'POST', params);
884
+ const result = await internalRequest(this.sdk, `/object/manage`, 'POST', params);
884
885
  return result;
885
886
  }
886
887
 
@@ -935,7 +936,7 @@ export class ObjectsService {
935
936
 
936
937
  const params = { body };
937
938
 
938
- const result = await this.sdk._fetch(
939
+ const result = await internalRequest(this.sdk,
939
940
  `/object/manage/${objectName}`,
940
941
  'POST',
941
942
  params,
@@ -966,7 +967,7 @@ export class ObjectsService {
966
967
 
967
968
  const params = { body };
968
969
 
969
- const result = await this.sdk._fetch(
970
+ const result = await internalRequest(this.sdk,
970
971
  `/object/manage/${objectName}`,
971
972
  'PUT',
972
973
  params,
@@ -1029,7 +1030,7 @@ export class ObjectsService {
1029
1030
 
1030
1031
  const params = { body };
1031
1032
 
1032
- const result = await this.sdk._fetch(
1033
+ const result = await internalRequest(this.sdk,
1033
1034
  `/object/manage/${objectName}/${columnName}`,
1034
1035
  'PUT',
1035
1036
  params,
@@ -1046,7 +1047,7 @@ export class ObjectsService {
1046
1047
  },
1047
1048
  );
1048
1049
 
1049
- const result = await this.sdk._fetch(
1050
+ const result = await internalRequest(this.sdk,
1050
1051
  `/object/manage/${objectName}/${columnName}`,
1051
1052
  'DELETE',
1052
1053
  );
@@ -1065,7 +1066,7 @@ export class ObjectsService {
1065
1066
  { connectionId },
1066
1067
  { connectionId: { type: 'string', required: true } },
1067
1068
  );
1068
- return this.sdk._fetch('/object/ad-catalog/google/accounts', 'GET', {
1069
+ return internalRequest(this.sdk, '/object/ad-catalog/google/accounts', 'GET', {
1069
1070
  query: { connectionId },
1070
1071
  });
1071
1072
  }
@@ -1089,7 +1090,7 @@ export class ObjectsService {
1089
1090
  );
1090
1091
  const query = { connectionId, customerId };
1091
1092
  if (loginCustomerId) query.loginCustomerId = loginCustomerId;
1092
- return this.sdk._fetch('/object/ad-catalog/google/campaigns', 'GET', {
1093
+ return internalRequest(this.sdk, '/object/ad-catalog/google/campaigns', 'GET', {
1093
1094
  query,
1094
1095
  });
1095
1096
  }
@@ -1106,7 +1107,7 @@ export class ObjectsService {
1106
1107
  { connectionId },
1107
1108
  { connectionId: { type: 'string', required: true } },
1108
1109
  );
1109
- return this.sdk._fetch('/object/ad-catalog/meta/accounts', 'GET', {
1110
+ return internalRequest(this.sdk, '/object/ad-catalog/meta/accounts', 'GET', {
1110
1111
  query: { connectionId },
1111
1112
  });
1112
1113
  }
@@ -1127,8 +1128,68 @@ export class ObjectsService {
1127
1128
  adAccountId: { type: 'string', required: true },
1128
1129
  },
1129
1130
  );
1130
- return this.sdk._fetch('/object/ad-catalog/meta/campaigns', 'GET', {
1131
+ return internalRequest(this.sdk, '/object/ad-catalog/meta/campaigns', 'GET', {
1131
1132
  query: { connectionId, adAccountId },
1132
1133
  });
1133
1134
  }
1135
+
1136
+ /**
1137
+ * Record activity feed for a single record.
1138
+ * @param {string} recordId
1139
+ * @returns {Promise<{results: object[]}>}
1140
+ */
1141
+ async getActivity(recordId) {
1142
+ this.sdk.validateParams(
1143
+ { recordId },
1144
+ { recordId: { type: 'string', required: true } },
1145
+ );
1146
+ return internalRequest(this.sdk, `/object/${recordId}/activity`, 'GET');
1147
+ }
1148
+
1149
+ /**
1150
+ * Marketing programs dashboard (programs + totals).
1151
+ * @returns {Promise<object>}
1152
+ */
1153
+ async getMarketingProgramsDashboard() {
1154
+ return internalRequest(
1155
+ this.sdk,
1156
+ '/object/marketing-programs/dashboard',
1157
+ 'GET',
1158
+ );
1159
+ }
1160
+
1161
+ /**
1162
+ * Metrics for one marketing program.
1163
+ * @param {string} programId
1164
+ * @returns {Promise<object>}
1165
+ */
1166
+ async getMarketingProgramMetrics(programId) {
1167
+ this.sdk.validateParams(
1168
+ { programId },
1169
+ { programId: { type: 'string', required: true } },
1170
+ );
1171
+ return internalRequest(
1172
+ this.sdk,
1173
+ `/object/marketing-programs/${programId}/metrics`,
1174
+ 'GET',
1175
+ );
1176
+ }
1177
+
1178
+ /**
1179
+ * Pull latest ad spend for a marketing program.
1180
+ * @param {string} programId
1181
+ * @returns {Promise<object>}
1182
+ */
1183
+ async pullMarketingProgramSpend(programId) {
1184
+ this.sdk.validateParams(
1185
+ { programId },
1186
+ { programId: { type: 'string', required: true } },
1187
+ );
1188
+ return internalRequest(
1189
+ this.sdk,
1190
+ `/object/marketing-programs/${programId}/pull-spend`,
1191
+ 'POST',
1192
+ { body: {} },
1193
+ );
1194
+ }
1134
1195
  }
@@ -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
  );