@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 TaskService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -180,7 +181,7 @@ export class TaskService {
180
181
  params.body.aiChatSessionId = aiChatSessionId;
181
182
  }
182
183
 
183
- const result = await this.sdk._fetch('/taskRouter/tasks', 'POST', params);
184
+ const result = await internalRequest(this.sdk, '/taskRouter/tasks', 'POST', params);
184
185
  return result;
185
186
  }
186
187
 
@@ -235,7 +236,7 @@ export class TaskService {
235
236
  params.body.userId = userId;
236
237
  }
237
238
 
238
- const result = await this.sdk._fetch(
239
+ const result = await internalRequest(this.sdk,
239
240
  '/taskRouter/tasks/callWorker',
240
241
  'PUT',
241
242
  params,
@@ -306,7 +307,7 @@ export class TaskService {
306
307
  params.body.workerSipCallId = workerSipCallId;
307
308
  }
308
309
 
309
- const result = await this.sdk._fetch(
310
+ const result = await internalRequest(this.sdk,
310
311
  '/taskRouter/tasks/accept',
311
312
  'PUT',
312
313
  params,
@@ -360,7 +361,7 @@ export class TaskService {
360
361
  params.body.userId = userId;
361
362
  }
362
363
 
363
- const result = await this.sdk._fetch(
364
+ const result = await internalRequest(this.sdk,
364
365
  '/taskRouter/tasks/reject',
365
366
  'PUT',
366
367
  params,
@@ -426,7 +427,7 @@ export class TaskService {
426
427
  },
427
428
  };
428
429
 
429
- const result = await this.sdk._fetch(
430
+ const result = await internalRequest(this.sdk,
430
431
  '/taskRouter/tasks/priority',
431
432
  'PUT',
432
433
  params,
@@ -472,7 +473,7 @@ export class TaskService {
472
473
  },
473
474
  };
474
475
 
475
- const result = await this.sdk._fetch(
476
+ const result = await internalRequest(this.sdk,
476
477
  '/taskRouter/tasks/hold',
477
478
  'PUT',
478
479
  params,
@@ -542,7 +543,7 @@ export class TaskService {
542
543
  },
543
544
  };
544
545
 
545
- const result = await this.sdk._fetch(
546
+ const result = await internalRequest(this.sdk,
546
547
  '/taskRouter/tasks/skills',
547
548
  'PUT',
548
549
  params,
@@ -587,7 +588,7 @@ export class TaskService {
587
588
  },
588
589
  };
589
590
 
590
- const result = await this.sdk._fetch(
591
+ const result = await internalRequest(this.sdk,
591
592
  '/taskRouter/tasks/wrapUp',
592
593
  'PUT',
593
594
  params,
@@ -650,7 +651,7 @@ export class TaskService {
650
651
  params.body.extend = extend;
651
652
  }
652
653
 
653
- const result = await this.sdk._fetch(
654
+ const result = await internalRequest(this.sdk,
654
655
  '/taskRouter/tasks/wrapUp/extend',
655
656
  'PUT',
656
657
  params,
@@ -695,7 +696,7 @@ export class TaskService {
695
696
  },
696
697
  };
697
698
 
698
- const result = await this.sdk._fetch(
699
+ const result = await internalRequest(this.sdk,
699
700
  '/taskRouter/tasks/complete',
700
701
  'PUT',
701
702
  params,
@@ -739,7 +740,7 @@ export class TaskService {
739
740
  },
740
741
  };
741
742
 
742
- const result = await this.sdk._fetch(
743
+ const result = await internalRequest(this.sdk,
743
744
  '/taskRouter/tasks/statusEvent',
744
745
  'PUT',
745
746
  params,
@@ -840,7 +841,7 @@ export class TaskService {
840
841
  params.body.sentiment = sentiment;
841
842
  }
842
843
 
843
- const result = await this.sdk._fetch('/taskRouter/tasks/', 'PUT', params);
844
+ const result = await internalRequest(this.sdk, '/taskRouter/tasks/', 'PUT', params);
844
845
  return result;
845
846
  }
846
847
  }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../../base.js';
1
2
  export class WorkerService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -41,7 +42,7 @@ export class WorkerService {
41
42
  params.body.userId = userId;
42
43
  }
43
44
 
44
- const result = await this.sdk._fetch('/taskRouter/worker', 'POST', params);
45
+ const result = await internalRequest(this.sdk, '/taskRouter/worker', 'POST', params);
45
46
  return result;
46
47
  }
47
48
 
@@ -80,7 +81,7 @@ export class WorkerService {
80
81
  params.query = { userId };
81
82
  }
82
83
 
83
- const result = await this.sdk._fetch('/taskRouter/worker', 'GET', params);
84
+ const result = await internalRequest(this.sdk, '/taskRouter/worker', 'GET', params);
84
85
  return result;
85
86
  }
86
87
 
@@ -131,7 +132,7 @@ export class WorkerService {
131
132
  params.body.userId = userId;
132
133
  }
133
134
 
134
- const result = await this.sdk._fetch(
135
+ const result = await internalRequest(this.sdk,
135
136
  '/taskRouter/worker/avaliable',
136
137
  'PUT',
137
138
  params,
@@ -186,7 +187,7 @@ export class WorkerService {
186
187
  params.body.userId = userId;
187
188
  }
188
189
 
189
- const result = await this.sdk._fetch(
190
+ const result = await internalRequest(this.sdk,
190
191
  '/taskRouter/worker/offline',
191
192
  'PUT',
192
193
  params,
@@ -232,7 +233,7 @@ export class WorkerService {
232
233
  params.body.userId = userId;
233
234
  }
234
235
 
235
- const result = await this.sdk._fetch(
236
+ const result = await internalRequest(this.sdk,
236
237
  '/taskRouter/worker/queueAutoLogin',
237
238
  'PUT',
238
239
  params,
@@ -278,7 +279,7 @@ export class WorkerService {
278
279
  params.body.userId = userId;
279
280
  }
280
281
 
281
- const result = await this.sdk._fetch(
282
+ const result = await internalRequest(this.sdk,
282
283
  '/taskRouter/worker/queueLogoutAll',
283
284
  'PUT',
284
285
  params,
@@ -331,7 +332,7 @@ export class WorkerService {
331
332
  params.body.userId = userId;
332
333
  }
333
334
 
334
- const result = await this.sdk._fetch(
335
+ const result = await internalRequest(this.sdk,
335
336
  '/taskRouter/worker/queueLogin',
336
337
  'PUT',
337
338
  params,
@@ -384,7 +385,7 @@ export class WorkerService {
384
385
  params.body.userId = userId;
385
386
  }
386
387
 
387
- const result = await this.sdk._fetch(
388
+ const result = await internalRequest(this.sdk,
388
389
  '/taskRouter/worker/queueLogout',
389
390
  'PUT',
390
391
  params,
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  /**
2
3
  * Triggers Service — object-change automations (workflow or outbound webhook).
3
4
  *
@@ -37,7 +38,7 @@ export class TriggersService {
37
38
  * const { results } = await sdk.triggers.listObjects();
38
39
  */
39
40
  async listObjects() {
40
- return this.sdk._fetch('/triggers/objects', 'GET', {});
41
+ return internalRequest(this.sdk, '/triggers/objects', 'GET', {});
41
42
  }
42
43
 
43
44
  /**
@@ -57,7 +58,7 @@ export class TriggersService {
57
58
  if (objectName) query.objectName = objectName;
58
59
  if (status) query.status = status;
59
60
  if (limit) query.limit = limit;
60
- return this.sdk._fetch('/triggers/', 'GET', { query });
61
+ return internalRequest(this.sdk, '/triggers/', 'GET', { query });
61
62
  }
62
63
 
63
64
  /**
@@ -71,7 +72,7 @@ export class TriggersService {
71
72
  */
72
73
  async get(id) {
73
74
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
74
- return this.sdk._fetch(`/triggers/${id}`, 'GET', {});
75
+ return internalRequest(this.sdk, `/triggers/${id}`, 'GET', {});
75
76
  }
76
77
 
77
78
  /**
@@ -152,7 +153,7 @@ export class TriggersService {
152
153
  },
153
154
  );
154
155
 
155
- return this.sdk._fetch('/triggers/', 'POST', { body });
156
+ return internalRequest(this.sdk, '/triggers/', 'POST', { body });
156
157
  }
157
158
 
158
159
  /**
@@ -173,7 +174,7 @@ export class TriggersService {
173
174
  args: { type: 'object', required: true },
174
175
  },
175
176
  );
176
- return this.sdk._fetch(`/triggers/${id}`, 'PUT', { body: args });
177
+ return internalRequest(this.sdk, `/triggers/${id}`, 'PUT', { body: args });
177
178
  }
178
179
 
179
180
  /**
@@ -187,7 +188,7 @@ export class TriggersService {
187
188
  */
188
189
  async delete(id) {
189
190
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
190
- return this.sdk._fetch(`/triggers/${id}`, 'DELETE', {});
191
+ return internalRequest(this.sdk, `/triggers/${id}`, 'DELETE', {});
191
192
  }
192
193
 
193
194
  /**
@@ -220,7 +221,7 @@ export class TriggersService {
220
221
  status: { type: 'string', required: true },
221
222
  },
222
223
  );
223
- return this.sdk._fetch(`/triggers/${id}/status`, 'POST', {
224
+ return internalRequest(this.sdk, `/triggers/${id}/status`, 'POST', {
224
225
  body: { status, pausedReason },
225
226
  });
226
227
  }
@@ -240,6 +241,6 @@ export class TriggersService {
240
241
  this.sdk.validateParams({ id }, { id: { type: 'string', required: true } });
241
242
  const query = {};
242
243
  if (limit) query.limit = limit;
243
- return this.sdk._fetch(`/triggers/${id}/fires`, 'GET', { query });
244
+ return internalRequest(this.sdk, `/triggers/${id}/fires`, 'GET', { query });
244
245
  }
245
246
  }
@@ -1,3 +1,4 @@
1
+ import { internalRequest } from '../base.js';
1
2
  export class VerificationService {
2
3
  constructor(sdk) {
3
4
  this.sdk = sdk;
@@ -23,7 +24,7 @@ export class VerificationService {
23
24
  body: verificationData,
24
25
  };
25
26
 
26
- const result = await this.sdk._fetch('/verification/sms', 'POST', params);
27
+ const result = await internalRequest(this.sdk, '/verification/sms', 'POST', params);
27
28
  return result;
28
29
  }
29
30
 
@@ -40,7 +41,7 @@ export class VerificationService {
40
41
  body: { phoneNumber, code },
41
42
  };
42
43
 
43
- const result = await this.sdk._fetch(
44
+ const result = await internalRequest(this.sdk,
44
45
  '/verification/sms/validate',
45
46
  'POST',
46
47
  params,
@@ -68,7 +69,7 @@ export class VerificationService {
68
69
  body: verificationData,
69
70
  };
70
71
 
71
- const result = await this.sdk._fetch('/verification/email', 'POST', params);
72
+ const result = await internalRequest(this.sdk, '/verification/email', 'POST', params);
72
73
  return result;
73
74
  }
74
75
 
@@ -85,7 +86,7 @@ export class VerificationService {
85
86
  body: { email, code },
86
87
  };
87
88
 
88
- const result = await this.sdk._fetch(
89
+ const result = await internalRequest(this.sdk,
89
90
  '/verification/email/validate',
90
91
  'POST',
91
92
  params,