@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.
- package/base.js +41 -1
- package/index.js +9 -6
- package/package.json +1 -4
- package/services/ai/playbooks.js +22 -21
- package/services/ai/settings.js +4 -2
- package/services/ai/translate.js +3 -1
- package/services/ai/vocabulary.js +4 -3
- package/services/ai.js +21 -20
- package/services/chat.js +267 -52
- package/services/developerApis.js +174 -0
- package/services/directory.js +40 -9
- package/services/documents.js +11 -10
- package/services/engagementMetrics.js +2 -1
- package/services/enroll.js +16 -15
- package/services/externalOAuth.js +12 -11
- package/services/fax.js +4 -3
- package/services/generateId.js +3 -2
- package/services/googleCalendar.js +7 -6
- package/services/knowledgeBase.js +9 -8
- package/services/layouts.js +15 -14
- package/services/login.js +8 -7
- package/services/lookup.js +4 -3
- package/services/messaging/EmailAddressesService.js +5 -4
- package/services/messaging/EmailAnalyticsService.js +5 -4
- package/services/messaging/EmailDomainsService.js +8 -7
- package/services/messaging/EmailMailboxesService.js +13 -12
- package/services/messaging/EmailQueueService.js +2 -1
- package/services/messaging/EmailService.js +12 -11
- package/services/messaging/EmailSuppressionService.js +5 -4
- package/services/messaging/EmailTemplatesService.js +6 -5
- package/services/messaging/SmsService.js +3 -2
- package/services/messaging/SmsTemplatesService.js +6 -5
- package/services/messaging/TenDlcBrandsService.js +11 -10
- package/services/messaging/TenDlcCampaignManagementService.js +14 -13
- package/services/messaging/TenDlcCampaignsService.js +2 -1
- package/services/messaging/TollFreeCampaignsService.js +13 -12
- package/services/notes.js +7 -6
- package/services/objects.js +97 -36
- package/services/permissions.js +34 -33
- package/services/phoneNumbers.js +28 -27
- package/services/portals.js +8 -7
- package/services/{inbox.js → recents.js} +9 -8
- package/services/recordTypes.js +12 -11
- package/services/search.js +2 -1
- package/services/sipEndpoints.js +8 -7
- package/services/storage.js +16 -15
- package/services/subscriptions.js +4 -3
- package/services/taskRouter/CCService.js +9 -8
- package/services/taskRouter/MetricsService.js +3 -2
- package/services/taskRouter/TaskService.js +13 -12
- package/services/taskRouter/WorkerService.js +9 -8
- package/services/triggers.js +9 -8
- package/services/verification.js +5 -4
- package/services/video.js +52 -51
- package/services/voice.js +13 -12
- package/services/workflows.js +22 -21
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { internalRequest } from '../base.js';
|
|
1
2
|
export class SubscriptionsService {
|
|
2
3
|
constructor(sdk) {
|
|
3
4
|
this.sdk = sdk;
|
|
@@ -24,7 +25,7 @@ export class SocketSubscriptionsService {
|
|
|
24
25
|
},
|
|
25
26
|
};
|
|
26
27
|
|
|
27
|
-
const result = await this.sdk
|
|
28
|
+
const result = await internalRequest(this.sdk,
|
|
28
29
|
'/subscriptions/socket/connection',
|
|
29
30
|
'GET',
|
|
30
31
|
params,
|
|
@@ -52,7 +53,7 @@ export class SocketSubscriptionsService {
|
|
|
52
53
|
if (subscriptionParams?.id) {
|
|
53
54
|
uri = `/subscriptions/socket/${subscriptionParams.id}`;
|
|
54
55
|
}
|
|
55
|
-
const result = await this.sdk
|
|
56
|
+
const result = await internalRequest(this.sdk, uri, 'POST', params);
|
|
56
57
|
return result;
|
|
57
58
|
}
|
|
58
59
|
|
|
@@ -71,7 +72,7 @@ export class SocketSubscriptionsService {
|
|
|
71
72
|
},
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
const result = await this.sdk
|
|
75
|
+
const result = await internalRequest(this.sdk,
|
|
75
76
|
`/subscriptions/socket/${id}`,
|
|
76
77
|
'DELETE',
|
|
77
78
|
params,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { internalRequest } from '../../base.js';
|
|
1
2
|
export class CCService {
|
|
2
3
|
constructor(sdk) {
|
|
3
4
|
this.sdk = sdk;
|
|
@@ -18,7 +19,7 @@ export class CCService {
|
|
|
18
19
|
* console.log(scope.isManager, scope.queues.length);
|
|
19
20
|
*/
|
|
20
21
|
async getScope() {
|
|
21
|
-
const result = await this.sdk
|
|
22
|
+
const result = await internalRequest(this.sdk, '/taskRouter/cc/scope', 'GET', {});
|
|
22
23
|
return result;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -52,7 +53,7 @@ export class CCService {
|
|
|
52
53
|
params.query = { queueIds: queueIds.join(',') };
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
const result = await this.sdk
|
|
56
|
+
const result = await internalRequest(this.sdk,
|
|
56
57
|
'/taskRouter/cc/snapshot',
|
|
57
58
|
'GET',
|
|
58
59
|
params,
|
|
@@ -91,7 +92,7 @@ export class CCService {
|
|
|
91
92
|
if (from) query.from = from;
|
|
92
93
|
if (to) query.to = to;
|
|
93
94
|
|
|
94
|
-
const result = await this.sdk
|
|
95
|
+
const result = await internalRequest(this.sdk, '/taskRouter/cc/sessions', 'GET', {
|
|
95
96
|
query,
|
|
96
97
|
});
|
|
97
98
|
return result;
|
|
@@ -137,7 +138,7 @@ export class CCService {
|
|
|
137
138
|
query.queueIds = queueIds.join(',');
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
const result = await this.sdk
|
|
141
|
+
const result = await internalRequest(this.sdk, '/taskRouter/cc/rankings', 'GET', {
|
|
141
142
|
query,
|
|
142
143
|
});
|
|
143
144
|
return result;
|
|
@@ -172,7 +173,7 @@ export class CCService {
|
|
|
172
173
|
},
|
|
173
174
|
);
|
|
174
175
|
|
|
175
|
-
const result = await this.sdk
|
|
176
|
+
const result = await internalRequest(this.sdk,
|
|
176
177
|
`/taskRouter/cc/queues/${queueId}/rankingWeights`,
|
|
177
178
|
'PUT',
|
|
178
179
|
{ body: weights },
|
|
@@ -225,7 +226,7 @@ export class CCService {
|
|
|
225
226
|
if (compareFrom) query.compareFrom = compareFrom;
|
|
226
227
|
if (compareTo) query.compareTo = compareTo;
|
|
227
228
|
|
|
228
|
-
const result = await this.sdk
|
|
229
|
+
const result = await internalRequest(this.sdk,
|
|
229
230
|
`/taskRouter/cc/agents/${workerId}/summary`,
|
|
230
231
|
'GET',
|
|
231
232
|
{ query },
|
|
@@ -262,7 +263,7 @@ export class CCService {
|
|
|
262
263
|
},
|
|
263
264
|
);
|
|
264
265
|
|
|
265
|
-
const result = await this.sdk
|
|
266
|
+
const result = await internalRequest(this.sdk,
|
|
266
267
|
`/taskRouter/cc/workers/${workerId}/queues`,
|
|
267
268
|
'PUT',
|
|
268
269
|
{ body: { queueId, action } },
|
|
@@ -292,7 +293,7 @@ export class CCService {
|
|
|
292
293
|
{ workerId: { type: 'string', required: true } },
|
|
293
294
|
);
|
|
294
295
|
|
|
295
|
-
const result = await this.sdk
|
|
296
|
+
const result = await internalRequest(this.sdk,
|
|
296
297
|
`/taskRouter/cc/workers/${workerId}/forceLogout`,
|
|
297
298
|
'POST',
|
|
298
299
|
{},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { internalRequest } from '../../base.js';
|
|
1
2
|
export class MetricsService {
|
|
2
3
|
constructor(sdk) {
|
|
3
4
|
this.sdk = sdk;
|
|
@@ -101,7 +102,7 @@ export class MetricsService {
|
|
|
101
102
|
requestParams.body.metricType = metricType;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
const result = await this.sdk
|
|
105
|
+
const result = await internalRequest(this.sdk,
|
|
105
106
|
'/taskRouter/metrics/current',
|
|
106
107
|
'GET',
|
|
107
108
|
requestParams,
|
|
@@ -155,7 +156,7 @@ export class MetricsService {
|
|
|
155
156
|
if (compareFrom) query.compareFrom = compareFrom;
|
|
156
157
|
if (compareTo) query.compareTo = compareTo;
|
|
157
158
|
|
|
158
|
-
const result = await this.sdk
|
|
159
|
+
const result = await internalRequest(this.sdk,
|
|
159
160
|
'/taskRouter/metrics/window',
|
|
160
161
|
'GET',
|
|
161
162
|
{ query },
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
388
|
+
const result = await internalRequest(this.sdk,
|
|
388
389
|
'/taskRouter/worker/queueLogout',
|
|
389
390
|
'PUT',
|
|
390
391
|
params,
|
package/services/triggers.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
244
|
+
return internalRequest(this.sdk, `/triggers/${id}/fires`, 'GET', { query });
|
|
244
245
|
}
|
|
245
246
|
}
|
package/services/verification.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
89
|
+
const result = await internalRequest(this.sdk,
|
|
89
90
|
'/verification/email/validate',
|
|
90
91
|
'POST',
|
|
91
92
|
params,
|