@unboundcx/sdk 4.13.166 → 4.13.168
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/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import { SipEndpointsService } from './services/sipEndpoints.js';
|
|
|
25
25
|
import { RingGroupsService } from './services/ringGroups.js';
|
|
26
26
|
import { LineGroupsService } from './services/lineGroups.js';
|
|
27
27
|
import { ParkingService } from './services/parking.js';
|
|
28
|
+
import { CalendarService } from './services/calendar.js';
|
|
28
29
|
import { OperatorPanelsService } from './services/operatorPanels.js';
|
|
29
30
|
import { SchedulesService } from './services/schedules/SchedulesService.js';
|
|
30
31
|
import { JourneysService } from './services/journeys/JourneysService.js';
|
|
@@ -140,6 +141,7 @@ class UnboundSDK extends BaseSDK {
|
|
|
140
141
|
this.ringGroups = new RingGroupsService(this);
|
|
141
142
|
this.lineGroups = new LineGroupsService(this);
|
|
142
143
|
this.parking = new ParkingService(this);
|
|
144
|
+
this.calendar = new CalendarService(this);
|
|
143
145
|
this.operatorPanels = new OperatorPanelsService(this);
|
|
144
146
|
this.schedules = new SchedulesService(this);
|
|
145
147
|
this.journeys = new JourneysService(this);
|
|
@@ -355,6 +357,7 @@ export { SipEndpointsService } from './services/sipEndpoints.js';
|
|
|
355
357
|
export { RingGroupsService } from './services/ringGroups.js';
|
|
356
358
|
export { LineGroupsService } from './services/lineGroups.js';
|
|
357
359
|
export { ParkingService } from './services/parking.js';
|
|
360
|
+
export { CalendarService } from './services/calendar.js';
|
|
358
361
|
export { SchedulesService } from './services/schedules/SchedulesService.js';
|
|
359
362
|
export { TimeOffService } from './services/schedules/TimeOffService.js';
|
|
360
363
|
export { JourneysService } from './services/journeys/JourneysService.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.168",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -91,7 +91,7 @@ const KanbanSection = BaseSection.extend({
|
|
|
91
91
|
// the feed requests; default is every kind the API can produce.
|
|
92
92
|
export const TIMELINE_SOURCES = [
|
|
93
93
|
'web', 'ads', 'form', 'webchat', 'email', 'sms', 'call', 'ticket', 'note',
|
|
94
|
-
'score', 'program', 'file',
|
|
94
|
+
'score', 'program', 'file', 'calendar',
|
|
95
95
|
];
|
|
96
96
|
|
|
97
97
|
const TimelineSection = BaseSection.extend({
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { internalRequest } from '../base.js';
|
|
2
|
+
|
|
3
|
+
// Native calendar. Office 365 is a later provider on the same sync-link API.
|
|
4
|
+
export class CalendarService {
|
|
5
|
+
constructor(sdk) {
|
|
6
|
+
this.sdk = sdk;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
async listCalendars() {
|
|
10
|
+
return internalRequest(this.sdk, '/calendar/calendars', 'GET', {});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async createCalendar(body) {
|
|
14
|
+
this.sdk.validateParams(
|
|
15
|
+
{ body },
|
|
16
|
+
{ body: { type: 'object', required: true } },
|
|
17
|
+
);
|
|
18
|
+
return internalRequest(this.sdk, '/calendar/calendars', 'POST', { body });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async updateCalendar(id, body) {
|
|
22
|
+
this.sdk.validateParams(
|
|
23
|
+
{ id, body },
|
|
24
|
+
{
|
|
25
|
+
id: { type: 'string', required: true },
|
|
26
|
+
body: { type: 'object', required: true },
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
return internalRequest(this.sdk, `/calendar/calendars/${id}`, 'PUT', {
|
|
30
|
+
body,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async deleteCalendar(id) {
|
|
35
|
+
this.sdk.validateParams(
|
|
36
|
+
{ id },
|
|
37
|
+
{ id: { type: 'string', required: true } },
|
|
38
|
+
);
|
|
39
|
+
return internalRequest(this.sdk, `/calendar/calendars/${id}`, 'DELETE', {});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async listShares(id) {
|
|
43
|
+
this.sdk.validateParams(
|
|
44
|
+
{ id },
|
|
45
|
+
{ id: { type: 'string', required: true } },
|
|
46
|
+
);
|
|
47
|
+
return internalRequest(
|
|
48
|
+
this.sdk,
|
|
49
|
+
`/calendar/calendars/${id}/shares`,
|
|
50
|
+
'GET',
|
|
51
|
+
{},
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async replaceShares(id, shares) {
|
|
56
|
+
this.sdk.validateParams(
|
|
57
|
+
{ id, shares },
|
|
58
|
+
{
|
|
59
|
+
id: { type: 'string', required: true },
|
|
60
|
+
shares: { type: 'array', required: true },
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
return internalRequest(
|
|
64
|
+
this.sdk,
|
|
65
|
+
`/calendar/calendars/${id}/shares`,
|
|
66
|
+
'PUT',
|
|
67
|
+
{ body: { shares } },
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async mintFeed(id) {
|
|
72
|
+
this.sdk.validateParams(
|
|
73
|
+
{ id },
|
|
74
|
+
{ id: { type: 'string', required: true } },
|
|
75
|
+
);
|
|
76
|
+
return internalRequest(
|
|
77
|
+
this.sdk,
|
|
78
|
+
`/calendar/calendars/${id}/feed`,
|
|
79
|
+
'POST',
|
|
80
|
+
{},
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async revokeFeed(id) {
|
|
85
|
+
this.sdk.validateParams(
|
|
86
|
+
{ id },
|
|
87
|
+
{ id: { type: 'string', required: true } },
|
|
88
|
+
);
|
|
89
|
+
return internalRequest(
|
|
90
|
+
this.sdk,
|
|
91
|
+
`/calendar/calendars/${id}/feed`,
|
|
92
|
+
'DELETE',
|
|
93
|
+
{},
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async listEvents({ calendarIds, from, to, expand, q } = {}) {
|
|
98
|
+
const query = {};
|
|
99
|
+
if (calendarIds) {
|
|
100
|
+
query.calendarIds = Array.isArray(calendarIds)
|
|
101
|
+
? calendarIds.join(',')
|
|
102
|
+
: calendarIds;
|
|
103
|
+
}
|
|
104
|
+
if (from) query.from = from;
|
|
105
|
+
if (to) query.to = to;
|
|
106
|
+
if (expand != null) query.expand = expand ? '1' : '0';
|
|
107
|
+
if (q) query.q = q;
|
|
108
|
+
return internalRequest(this.sdk, '/calendar/events', 'GET', { query });
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async getEvent(id) {
|
|
112
|
+
this.sdk.validateParams(
|
|
113
|
+
{ id },
|
|
114
|
+
{ id: { type: 'string', required: true } },
|
|
115
|
+
);
|
|
116
|
+
return internalRequest(this.sdk, `/calendar/events/${id}`, 'GET', {});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async createEvent(body) {
|
|
120
|
+
this.sdk.validateParams(
|
|
121
|
+
{ body },
|
|
122
|
+
{ body: { type: 'object', required: true } },
|
|
123
|
+
);
|
|
124
|
+
return internalRequest(this.sdk, '/calendar/events', 'POST', { body });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async updateEvent(id, body) {
|
|
128
|
+
this.sdk.validateParams(
|
|
129
|
+
{ id, body },
|
|
130
|
+
{
|
|
131
|
+
id: { type: 'string', required: true },
|
|
132
|
+
body: { type: 'object', required: true },
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
return internalRequest(this.sdk, `/calendar/events/${id}`, 'PUT', { body });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async deleteEvent(id, scope, { occurrenceStart, recurrenceId } = {}) {
|
|
139
|
+
this.sdk.validateParams(
|
|
140
|
+
{ id },
|
|
141
|
+
{ id: { type: 'string', required: true } },
|
|
142
|
+
);
|
|
143
|
+
const query = {};
|
|
144
|
+
if (scope) query.scope = scope;
|
|
145
|
+
if (occurrenceStart) query.occurrenceStart = occurrenceStart;
|
|
146
|
+
if (recurrenceId) query.recurrenceId = recurrenceId;
|
|
147
|
+
return internalRequest(this.sdk, `/calendar/events/${id}`, 'DELETE', {
|
|
148
|
+
query,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async rsvp(id, { partstat, comment, scope } = {}) {
|
|
153
|
+
this.sdk.validateParams(
|
|
154
|
+
{ id, partstat },
|
|
155
|
+
{
|
|
156
|
+
id: { type: 'string', required: true },
|
|
157
|
+
partstat: { type: 'string', required: true },
|
|
158
|
+
},
|
|
159
|
+
);
|
|
160
|
+
return internalRequest(this.sdk, `/calendar/events/${id}/rsvp`, 'POST', {
|
|
161
|
+
body: { partstat, comment, scope },
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async proposeTime(id, body) {
|
|
166
|
+
this.sdk.validateParams(
|
|
167
|
+
{ id, body },
|
|
168
|
+
{
|
|
169
|
+
id: { type: 'string', required: true },
|
|
170
|
+
body: { type: 'object', required: true },
|
|
171
|
+
},
|
|
172
|
+
);
|
|
173
|
+
return internalRequest(
|
|
174
|
+
this.sdk,
|
|
175
|
+
`/calendar/events/${id}/propose-time`,
|
|
176
|
+
'POST',
|
|
177
|
+
{ body },
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async forwardEvent(id, { emails } = {}) {
|
|
182
|
+
this.sdk.validateParams(
|
|
183
|
+
{ id, emails },
|
|
184
|
+
{
|
|
185
|
+
id: { type: 'string', required: true },
|
|
186
|
+
emails: { type: 'array', required: true },
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
return internalRequest(this.sdk, `/calendar/events/${id}/forward`, 'POST', {
|
|
190
|
+
body: { emails },
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async freebusy(body) {
|
|
195
|
+
this.sdk.validateParams(
|
|
196
|
+
{ body },
|
|
197
|
+
{ body: { type: 'object', required: true } },
|
|
198
|
+
);
|
|
199
|
+
return internalRequest(this.sdk, '/calendar/freebusy', 'POST', { body });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async suggestTime(body) {
|
|
203
|
+
this.sdk.validateParams(
|
|
204
|
+
{ body },
|
|
205
|
+
{ body: { type: 'object', required: true } },
|
|
206
|
+
);
|
|
207
|
+
return internalRequest(this.sdk, '/calendar/suggest-time', 'POST', { body });
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async importIcs({ calendarId, ics } = {}) {
|
|
211
|
+
this.sdk.validateParams(
|
|
212
|
+
{ calendarId, ics },
|
|
213
|
+
{
|
|
214
|
+
calendarId: { type: 'string', required: true },
|
|
215
|
+
ics: { type: 'string', required: true },
|
|
216
|
+
},
|
|
217
|
+
);
|
|
218
|
+
return internalRequest(this.sdk, '/calendar/import', 'POST', {
|
|
219
|
+
body: { calendarId, ics },
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async exportIcs(calendarId) {
|
|
224
|
+
this.sdk.validateParams(
|
|
225
|
+
{ calendarId },
|
|
226
|
+
{ calendarId: { type: 'string', required: true } },
|
|
227
|
+
);
|
|
228
|
+
return internalRequest(
|
|
229
|
+
this.sdk,
|
|
230
|
+
`/calendar/calendars/${calendarId}/export.ics`,
|
|
231
|
+
'GET',
|
|
232
|
+
{},
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async getSettings() {
|
|
237
|
+
return internalRequest(this.sdk, '/calendar/settings', 'GET', {});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
async updateSettings(body) {
|
|
241
|
+
this.sdk.validateParams(
|
|
242
|
+
{ body },
|
|
243
|
+
{ body: { type: 'object', required: true } },
|
|
244
|
+
);
|
|
245
|
+
return internalRequest(this.sdk, '/calendar/settings', 'PUT', { body });
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
async getAdminSettings() {
|
|
249
|
+
return internalRequest(this.sdk, '/calendar/admin/settings', 'GET', {});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async updateAdminSettings(body) {
|
|
253
|
+
this.sdk.validateParams(
|
|
254
|
+
{ body },
|
|
255
|
+
{ body: { type: 'object', required: true } },
|
|
256
|
+
);
|
|
257
|
+
return internalRequest(this.sdk, '/calendar/admin/settings', 'PUT', { body });
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async listAppPasswords() {
|
|
261
|
+
return internalRequest(this.sdk, '/calendar/app-passwords', 'GET', {});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
async createAppPassword({ label } = {}) {
|
|
265
|
+
this.sdk.validateParams(
|
|
266
|
+
{ label },
|
|
267
|
+
{ label: { type: 'string', required: true } },
|
|
268
|
+
);
|
|
269
|
+
return internalRequest(this.sdk, '/calendar/app-passwords', 'POST', {
|
|
270
|
+
body: { label },
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async deleteAppPassword(id) {
|
|
275
|
+
this.sdk.validateParams(
|
|
276
|
+
{ id },
|
|
277
|
+
{ id: { type: 'string', required: true } },
|
|
278
|
+
);
|
|
279
|
+
return internalRequest(
|
|
280
|
+
this.sdk,
|
|
281
|
+
`/calendar/app-passwords/${id}`,
|
|
282
|
+
'DELETE',
|
|
283
|
+
{},
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async listSyncLinks() {
|
|
288
|
+
return internalRequest(this.sdk, '/calendar/sync-links', 'GET', {});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
async listGoogleCalendars(oauthConnectionId) {
|
|
292
|
+
this.sdk.validateParams(
|
|
293
|
+
{ oauthConnectionId },
|
|
294
|
+
{ oauthConnectionId: { type: 'string', required: true } },
|
|
295
|
+
);
|
|
296
|
+
return internalRequest(
|
|
297
|
+
this.sdk,
|
|
298
|
+
'/calendar/sync-links/google/calendars',
|
|
299
|
+
'GET',
|
|
300
|
+
{ query: { oauthConnectionId } },
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
async createSyncLink(body) {
|
|
305
|
+
this.sdk.validateParams(
|
|
306
|
+
{ body },
|
|
307
|
+
{ body: { type: 'object', required: true } },
|
|
308
|
+
);
|
|
309
|
+
return internalRequest(this.sdk, '/calendar/sync-links', 'POST', { body });
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
async updateSyncLink(id, body) {
|
|
313
|
+
this.sdk.validateParams(
|
|
314
|
+
{ id, body },
|
|
315
|
+
{
|
|
316
|
+
id: { type: 'string', required: true },
|
|
317
|
+
body: { type: 'object', required: true },
|
|
318
|
+
},
|
|
319
|
+
);
|
|
320
|
+
return internalRequest(this.sdk, `/calendar/sync-links/${id}`, 'PUT', {
|
|
321
|
+
body,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
async deleteSyncLink(id) {
|
|
326
|
+
this.sdk.validateParams(
|
|
327
|
+
{ id },
|
|
328
|
+
{ id: { type: 'string', required: true } },
|
|
329
|
+
);
|
|
330
|
+
return internalRequest(this.sdk, `/calendar/sync-links/${id}`, 'DELETE', {});
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async resync(id) {
|
|
334
|
+
this.sdk.validateParams(
|
|
335
|
+
{ id },
|
|
336
|
+
{ id: { type: 'string', required: true } },
|
|
337
|
+
);
|
|
338
|
+
return internalRequest(
|
|
339
|
+
this.sdk,
|
|
340
|
+
`/calendar/sync-links/${id}/resync`,
|
|
341
|
+
'POST',
|
|
342
|
+
{},
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
async inviteFromEmail(emailId, { action, partstat, ics } = {}) {
|
|
347
|
+
this.sdk.validateParams(
|
|
348
|
+
{ emailId, action },
|
|
349
|
+
{
|
|
350
|
+
emailId: { type: 'string', required: true },
|
|
351
|
+
action: { type: 'string', required: true },
|
|
352
|
+
},
|
|
353
|
+
);
|
|
354
|
+
const body = { action, partstat };
|
|
355
|
+
if (ics) body.ics = ics;
|
|
356
|
+
return internalRequest(
|
|
357
|
+
this.sdk,
|
|
358
|
+
`/calendar/invites/from-email/${emailId}`,
|
|
359
|
+
'POST',
|
|
360
|
+
{ body },
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
async listResources() {
|
|
365
|
+
return internalRequest(this.sdk, '/calendar/resources', 'GET', {});
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
async createResource(body) {
|
|
369
|
+
this.sdk.validateParams(
|
|
370
|
+
{ body },
|
|
371
|
+
{ body: { type: 'object', required: true } },
|
|
372
|
+
);
|
|
373
|
+
return internalRequest(this.sdk, '/calendar/resources', 'POST', { body });
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
async updateResource(id, body) {
|
|
377
|
+
this.sdk.validateParams(
|
|
378
|
+
{ id, body },
|
|
379
|
+
{
|
|
380
|
+
id: { type: 'string', required: true },
|
|
381
|
+
body: { type: 'object', required: true },
|
|
382
|
+
},
|
|
383
|
+
);
|
|
384
|
+
return internalRequest(this.sdk, `/calendar/resources/${id}`, 'PUT', {
|
|
385
|
+
body,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
async deleteResource(id) {
|
|
390
|
+
this.sdk.validateParams(
|
|
391
|
+
{ id },
|
|
392
|
+
{ id: { type: 'string', required: true } },
|
|
393
|
+
);
|
|
394
|
+
return internalRequest(this.sdk, `/calendar/resources/${id}`, 'DELETE', {});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
@@ -42,9 +42,12 @@ export class JourneyWorklistService {
|
|
|
42
42
|
* @param {'due'|'overdue'|'upcoming'} [opts.bucket]
|
|
43
43
|
* @param {string} [opts.stepType]
|
|
44
44
|
* @param {string} [opts.journeyId]
|
|
45
|
+
* @param {string} [opts.workerId] another rep's worker id. Allowed only
|
|
46
|
+
* for a manager of that task's sales queue. The response is then
|
|
47
|
+
* `{ readOnly: true }` and omits pool tasks.
|
|
45
48
|
* @param {number} [opts.page]
|
|
46
49
|
* @param {number} [opts.pageSize]
|
|
47
|
-
* @returns {Promise<{data: JourneyWorklistTask[]}>}
|
|
50
|
+
* @returns {Promise<{data: JourneyWorklistTask[], readOnly: boolean, reps: {workerId: string, userId: string, name: string, isSelf: boolean}[]}>}
|
|
48
51
|
*/
|
|
49
52
|
async list(opts = {}) {
|
|
50
53
|
return await internalRequest(this.sdk, '/journeys/worklist', 'GET', {
|
|
@@ -71,4 +74,19 @@ export class JourneyWorklistService {
|
|
|
71
74
|
{ body: pickDefined(filter) },
|
|
72
75
|
);
|
|
73
76
|
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Put a worklist touch back to pending when the rep closes it without
|
|
80
|
+
* sending or calling. Keeps the owner. Server refuses once an action
|
|
81
|
+
* was taken.
|
|
82
|
+
*
|
|
83
|
+
* @param {Object} body
|
|
84
|
+
* @param {string} body.taskId
|
|
85
|
+
* @returns {Promise<{data: JourneyWorklistTask}>}
|
|
86
|
+
*/
|
|
87
|
+
async release({ taskId } = {}) {
|
|
88
|
+
return await internalRequest(this.sdk, '/journeys/worklist/release', 'POST', {
|
|
89
|
+
body: { taskId },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
74
92
|
}
|