@unboundcx/sdk 4.13.32 → 4.13.35
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/package.json +1 -1
- package/schemas/layouts/section.js +2 -2
- package/services/ai/playbooks.js +55 -6
- package/services/dealRegistrations.js +23 -0
- package/services/messaging/TenDlcCampaignManagementService.js +30 -0
- package/services/messaging/TenDlcCampaignsService.js +38 -1
- package/services/video.js +25 -0
- package/services/webchat.js +33 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.35",
|
|
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",
|
|
@@ -90,8 +90,8 @@ const KanbanSection = BaseSection.extend({
|
|
|
90
90
|
// timeline, not a table/kanban query. `sources` filters which item kinds
|
|
91
91
|
// the feed requests; default is every kind the API can produce.
|
|
92
92
|
export const TIMELINE_SOURCES = [
|
|
93
|
-
'web', 'ads', 'form', 'email', 'sms', 'call', 'ticket', 'note',
|
|
94
|
-
'program', 'file',
|
|
93
|
+
'web', 'ads', 'form', 'webchat', 'email', 'sms', 'call', 'ticket', 'note',
|
|
94
|
+
'score', 'program', 'file',
|
|
95
95
|
];
|
|
96
96
|
|
|
97
97
|
const TimelineSection = BaseSection.extend({
|
package/services/ai/playbooks.js
CHANGED
|
@@ -114,7 +114,13 @@ export class PlaybooksService {
|
|
|
114
114
|
* isPublished: true
|
|
115
115
|
* });
|
|
116
116
|
*/
|
|
117
|
-
async updatePlaybook({
|
|
117
|
+
async updatePlaybook({
|
|
118
|
+
playbookId,
|
|
119
|
+
name,
|
|
120
|
+
isPublished,
|
|
121
|
+
recordTypeId,
|
|
122
|
+
passScore,
|
|
123
|
+
}) {
|
|
118
124
|
this.sdk.validateParams(
|
|
119
125
|
{ playbookId },
|
|
120
126
|
{
|
|
@@ -122,11 +128,12 @@ export class PlaybooksService {
|
|
|
122
128
|
name: { type: 'string', required: false },
|
|
123
129
|
isPublished: { type: 'boolean', required: false },
|
|
124
130
|
recordTypeId: { type: 'string', required: false },
|
|
131
|
+
passScore: { type: 'number', required: false },
|
|
125
132
|
},
|
|
126
133
|
);
|
|
127
134
|
|
|
128
135
|
const params = {
|
|
129
|
-
body: { name, isPublished, recordTypeId },
|
|
136
|
+
body: { name, isPublished, recordTypeId, passScore },
|
|
130
137
|
};
|
|
131
138
|
|
|
132
139
|
const result = await internalRequest(this.sdk,
|
|
@@ -202,6 +209,8 @@ export class PlaybooksService {
|
|
|
202
209
|
requiredForPass,
|
|
203
210
|
role,
|
|
204
211
|
signal,
|
|
212
|
+
window,
|
|
213
|
+
windowTurns,
|
|
205
214
|
recordTypeId,
|
|
206
215
|
}) {
|
|
207
216
|
this.sdk.validateParams(
|
|
@@ -229,6 +238,8 @@ export class PlaybooksService {
|
|
|
229
238
|
requiredForPass: { type: 'boolean', required: false },
|
|
230
239
|
role: { type: 'string', required: false },
|
|
231
240
|
signal: { type: 'string', required: false },
|
|
241
|
+
window: { type: 'string', required: false },
|
|
242
|
+
windowTurns: { type: 'number', required: false },
|
|
232
243
|
recordTypeId: { type: 'string', required: false },
|
|
233
244
|
},
|
|
234
245
|
);
|
|
@@ -244,6 +255,8 @@ export class PlaybooksService {
|
|
|
244
255
|
requiredForPass,
|
|
245
256
|
role,
|
|
246
257
|
signal,
|
|
258
|
+
window,
|
|
259
|
+
windowTurns,
|
|
247
260
|
recordTypeId,
|
|
248
261
|
},
|
|
249
262
|
};
|
|
@@ -345,6 +358,8 @@ export class PlaybooksService {
|
|
|
345
358
|
requiredForPass,
|
|
346
359
|
role,
|
|
347
360
|
signal,
|
|
361
|
+
window,
|
|
362
|
+
windowTurns,
|
|
348
363
|
recordTypeId,
|
|
349
364
|
}) {
|
|
350
365
|
this.sdk.validateParams(
|
|
@@ -372,6 +387,8 @@ export class PlaybooksService {
|
|
|
372
387
|
requiredForPass: { type: 'boolean', required: false },
|
|
373
388
|
role: { type: 'string', required: false },
|
|
374
389
|
signal: { type: 'string', required: false },
|
|
390
|
+
window: { type: 'string', required: false },
|
|
391
|
+
windowTurns: { type: 'number', required: false },
|
|
375
392
|
recordTypeId: { type: 'string', required: false },
|
|
376
393
|
},
|
|
377
394
|
);
|
|
@@ -387,6 +404,8 @@ export class PlaybooksService {
|
|
|
387
404
|
requiredForPass,
|
|
388
405
|
role,
|
|
389
406
|
signal,
|
|
407
|
+
window,
|
|
408
|
+
windowTurns,
|
|
390
409
|
recordTypeId,
|
|
391
410
|
},
|
|
392
411
|
};
|
|
@@ -491,6 +510,8 @@ export class PlaybooksService {
|
|
|
491
510
|
description,
|
|
492
511
|
keywords,
|
|
493
512
|
recommendedPhase,
|
|
513
|
+
window,
|
|
514
|
+
windowTurns,
|
|
494
515
|
role,
|
|
495
516
|
signal,
|
|
496
517
|
recordTypeId,
|
|
@@ -502,6 +523,8 @@ export class PlaybooksService {
|
|
|
502
523
|
description: { type: 'string', required: false },
|
|
503
524
|
keywords: { type: 'array', required: false },
|
|
504
525
|
recommendedPhase: { type: 'string', required: false },
|
|
526
|
+
window: { type: 'string', required: false },
|
|
527
|
+
windowTurns: { type: 'number', required: false },
|
|
505
528
|
role: { type: 'string', required: false },
|
|
506
529
|
signal: { type: 'string', required: false },
|
|
507
530
|
recordTypeId: { type: 'string', required: false },
|
|
@@ -509,7 +532,17 @@ export class PlaybooksService {
|
|
|
509
532
|
);
|
|
510
533
|
|
|
511
534
|
const params = {
|
|
512
|
-
body: {
|
|
535
|
+
body: {
|
|
536
|
+
name,
|
|
537
|
+
description,
|
|
538
|
+
keywords,
|
|
539
|
+
recommendedPhase,
|
|
540
|
+
window,
|
|
541
|
+
windowTurns,
|
|
542
|
+
role,
|
|
543
|
+
signal,
|
|
544
|
+
recordTypeId,
|
|
545
|
+
},
|
|
513
546
|
};
|
|
514
547
|
|
|
515
548
|
const result = await internalRequest(this.sdk,
|
|
@@ -604,22 +637,28 @@ export class PlaybooksService {
|
|
|
604
637
|
*/
|
|
605
638
|
async updatePlaybookGoalType({
|
|
606
639
|
goalTypeId,
|
|
640
|
+
playbookGoalTypeId,
|
|
607
641
|
name,
|
|
608
642
|
description,
|
|
609
643
|
keywords,
|
|
610
644
|
recommendedPhase,
|
|
645
|
+
window,
|
|
646
|
+
windowTurns,
|
|
611
647
|
role,
|
|
612
648
|
signal,
|
|
613
649
|
recordTypeId,
|
|
614
650
|
}) {
|
|
651
|
+
const id = goalTypeId || playbookGoalTypeId;
|
|
615
652
|
this.sdk.validateParams(
|
|
616
|
-
{ goalTypeId },
|
|
653
|
+
{ goalTypeId: id },
|
|
617
654
|
{
|
|
618
655
|
goalTypeId: { type: 'string', required: true },
|
|
619
656
|
name: { type: 'string', required: false },
|
|
620
657
|
description: { type: 'string', required: false },
|
|
621
658
|
keywords: { type: 'array', required: false },
|
|
622
659
|
recommendedPhase: { type: 'string', required: false },
|
|
660
|
+
window: { type: 'string', required: false },
|
|
661
|
+
windowTurns: { type: 'number', required: false },
|
|
623
662
|
role: { type: 'string', required: false },
|
|
624
663
|
signal: { type: 'string', required: false },
|
|
625
664
|
recordTypeId: { type: 'string', required: false },
|
|
@@ -627,11 +666,21 @@ export class PlaybooksService {
|
|
|
627
666
|
);
|
|
628
667
|
|
|
629
668
|
const params = {
|
|
630
|
-
body: {
|
|
669
|
+
body: {
|
|
670
|
+
name,
|
|
671
|
+
description,
|
|
672
|
+
keywords,
|
|
673
|
+
recommendedPhase,
|
|
674
|
+
window,
|
|
675
|
+
windowTurns,
|
|
676
|
+
role,
|
|
677
|
+
signal,
|
|
678
|
+
recordTypeId,
|
|
679
|
+
},
|
|
631
680
|
};
|
|
632
681
|
|
|
633
682
|
const result = await internalRequest(this.sdk,
|
|
634
|
-
`/ai/playbooks/goalTypes/${
|
|
683
|
+
`/ai/playbooks/goalTypes/${id}`,
|
|
635
684
|
'PUT',
|
|
636
685
|
params,
|
|
637
686
|
);
|
|
@@ -44,4 +44,27 @@ export class DealRegistrationsService {
|
|
|
44
44
|
body: { reason },
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Immediate staff-side conflict check against a prospect company, used by
|
|
50
|
+
* the create-mode form's Company lookup field to warn before submit —
|
|
51
|
+
* runs the same conflict engine the create handler stamps onto the
|
|
52
|
+
* record at save time, without creating anything. Session-less staff
|
|
53
|
+
* endpoint (checkApiAuth), not part of the portal registration flow.
|
|
54
|
+
* @param {string} companyId - company record id (the prospect, not the
|
|
55
|
+
* partner)
|
|
56
|
+
* @returns {Promise<Object>} { conflict: boolean, reasons: string[] }
|
|
57
|
+
*/
|
|
58
|
+
async conflictCheck(companyId) {
|
|
59
|
+
this.sdk.validateParams(
|
|
60
|
+
{ companyId },
|
|
61
|
+
{ companyId: { type: 'string', required: true } },
|
|
62
|
+
);
|
|
63
|
+
return internalRequest(
|
|
64
|
+
this.sdk,
|
|
65
|
+
'/deal-registrations/conflict-check',
|
|
66
|
+
'GET',
|
|
67
|
+
{ query: { companyId } },
|
|
68
|
+
);
|
|
69
|
+
}
|
|
47
70
|
}
|
|
@@ -447,6 +447,36 @@ export class TenDlcCampaignManagementService {
|
|
|
447
447
|
return result;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
/**
|
|
451
|
+
* Bulk-add/move phone numbers onto a campaign
|
|
452
|
+
* @param {string} campaignId - Campaign ID
|
|
453
|
+
* @param {Object} options
|
|
454
|
+
* @param {string[]} options.phoneNumbers - Phone numbers in E.164 format (1-200)
|
|
455
|
+
* @param {boolean} [options.force] - Move numbers off another campaign instead
|
|
456
|
+
* of returning a 409 conflict
|
|
457
|
+
* @returns {Promise<Object>} `{ id, results: [{ phoneNumber, status, ... }] }`
|
|
458
|
+
*/
|
|
459
|
+
async addPhoneNumbers(campaignId, { phoneNumbers, force } = {}) {
|
|
460
|
+
this.sdk.validateParams(
|
|
461
|
+
{ campaignId, phoneNumbers },
|
|
462
|
+
{
|
|
463
|
+
campaignId: { type: 'string', required: true },
|
|
464
|
+
phoneNumbers: { type: 'array', required: true },
|
|
465
|
+
},
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
const options = {
|
|
469
|
+
body: { phoneNumbers, force },
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
const result = await internalRequest(this.sdk,
|
|
473
|
+
`/messaging/campaigns/10dlc/campaign/${campaignId}/phoneNumbers`,
|
|
474
|
+
'POST',
|
|
475
|
+
options,
|
|
476
|
+
);
|
|
477
|
+
return result;
|
|
478
|
+
}
|
|
479
|
+
|
|
450
480
|
/**
|
|
451
481
|
* Remove phone number from campaign
|
|
452
482
|
*/
|
|
@@ -22,7 +22,7 @@ export class TenDlcCampaignsService {
|
|
|
22
22
|
},
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
const result = await internalRequest(this.sdk,
|
|
25
|
+
const result = await internalRequest(this.sdk,
|
|
26
26
|
`/messaging/campaigns/10dlc/phoneNumber/${encodeURIComponent(
|
|
27
27
|
phoneNumber,
|
|
28
28
|
)}/campaignStatus`,
|
|
@@ -30,4 +30,41 @@ export class TenDlcCampaignsService {
|
|
|
30
30
|
);
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* List every account phone number with its 10DLC campaign link (if any)
|
|
36
|
+
* @returns {Promise<Array>} `[{ id, phoneNumber, name, city, state, country,
|
|
37
|
+
* campaignId, campaignName, campaignLinkingStatus, linkedAt }]`
|
|
38
|
+
*/
|
|
39
|
+
async listPhoneNumberAssignments() {
|
|
40
|
+
const result = await internalRequest(this.sdk,
|
|
41
|
+
`/messaging/campaigns/10dlc/phoneNumbers/assignments`,
|
|
42
|
+
'GET',
|
|
43
|
+
);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the current 10DLC campaign link for one phone number
|
|
49
|
+
* @param {string} phoneNumber - Phone number to check
|
|
50
|
+
* @returns {Promise<Object>} `{ phoneNumber, campaignId, campaignName,
|
|
51
|
+
* campaignStatus, campaignLinkingStatus, linkedAt }` (campaignId is null
|
|
52
|
+
* when the number is unassigned)
|
|
53
|
+
*/
|
|
54
|
+
async getPhoneNumberCampaign(phoneNumber) {
|
|
55
|
+
this.sdk.validateParams(
|
|
56
|
+
{ phoneNumber },
|
|
57
|
+
{
|
|
58
|
+
phoneNumber: { type: 'string', required: true },
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const result = await internalRequest(this.sdk,
|
|
63
|
+
`/messaging/campaigns/10dlc/phoneNumber/${encodeURIComponent(
|
|
64
|
+
phoneNumber,
|
|
65
|
+
)}/campaign`,
|
|
66
|
+
'GET',
|
|
67
|
+
);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
33
70
|
}
|
package/services/video.js
CHANGED
|
@@ -413,6 +413,31 @@ export class VideoService {
|
|
|
413
413
|
return result;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Send the brand-level Meet invite email to one or more addresses.
|
|
418
|
+
*
|
|
419
|
+
* @param {string} roomId
|
|
420
|
+
* @param {Object} input
|
|
421
|
+
* @param {string[]} input.to
|
|
422
|
+
* @param {string} [input.peopleId]
|
|
423
|
+
* @param {string} [input.engagementSessionId]
|
|
424
|
+
*/
|
|
425
|
+
async inviteByEmail(roomId, { to, peopleId, engagementSessionId } = {}) {
|
|
426
|
+
this.sdk.validateParams(
|
|
427
|
+
{ roomId, to },
|
|
428
|
+
{
|
|
429
|
+
roomId: { type: 'string', required: true },
|
|
430
|
+
to: { type: 'array', required: true },
|
|
431
|
+
},
|
|
432
|
+
);
|
|
433
|
+
const body = { to };
|
|
434
|
+
if (peopleId) body.peopleId = peopleId;
|
|
435
|
+
if (engagementSessionId) body.engagementSessionId = engagementSessionId;
|
|
436
|
+
return internalRequest(this.sdk, `/video/${roomId}/invite`, 'POST', {
|
|
437
|
+
body,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
|
|
416
441
|
async placeCall(roomId, phoneNumber, callerIdNumber) {
|
|
417
442
|
this.sdk.validateParams(
|
|
418
443
|
{ roomId, phoneNumber, callerIdNumber },
|
package/services/webchat.js
CHANGED
|
@@ -133,8 +133,9 @@ export class WebchatConversationMessagesService {
|
|
|
133
133
|
* @param {string} widgetId
|
|
134
134
|
* @param {string} engagementSessionId
|
|
135
135
|
* @param {Object} options
|
|
136
|
-
* @param {string} options.message
|
|
136
|
+
* @param {string} [options.message]
|
|
137
137
|
* @param {Object} [options.media]
|
|
138
|
+
* @param {Object|Array} [options.card] - v1 chat card `{schemaVersion, blocks}` or a blocks array
|
|
138
139
|
* @returns {Promise<Object>}
|
|
139
140
|
*/
|
|
140
141
|
async send(widgetId, engagementSessionId, options) {
|
|
@@ -143,11 +144,15 @@ export class WebchatConversationMessagesService {
|
|
|
143
144
|
widgetId,
|
|
144
145
|
engagementSessionId,
|
|
145
146
|
message: options?.message,
|
|
147
|
+
media: options?.media,
|
|
148
|
+
card: options?.card,
|
|
146
149
|
},
|
|
147
150
|
{
|
|
148
151
|
widgetId: { type: 'string', required: true },
|
|
149
152
|
engagementSessionId: { type: 'string', required: true },
|
|
150
|
-
message: { type: 'string', required:
|
|
153
|
+
message: { type: 'string', required: false },
|
|
154
|
+
media: { type: 'object', required: false },
|
|
155
|
+
card: { type: 'object', required: false },
|
|
151
156
|
},
|
|
152
157
|
);
|
|
153
158
|
|
|
@@ -160,6 +165,32 @@ export class WebchatConversationMessagesService {
|
|
|
160
165
|
params,
|
|
161
166
|
);
|
|
162
167
|
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Hide a link preview on a webchat message (same as chat.hideUnfurl).
|
|
171
|
+
* @param {string} widgetId
|
|
172
|
+
* @param {string} engagementSessionId
|
|
173
|
+
* @param {string} messageId
|
|
174
|
+
* @param {Object} options
|
|
175
|
+
* @param {string} options.url
|
|
176
|
+
*/
|
|
177
|
+
async hideUnfurl(widgetId, engagementSessionId, messageId, { url } = {}) {
|
|
178
|
+
this.sdk.validateParams(
|
|
179
|
+
{ widgetId, engagementSessionId, messageId, url },
|
|
180
|
+
{
|
|
181
|
+
widgetId: { type: 'string', required: true },
|
|
182
|
+
engagementSessionId: { type: 'string', required: true },
|
|
183
|
+
messageId: { type: 'string', required: true },
|
|
184
|
+
url: { type: 'string', required: true },
|
|
185
|
+
},
|
|
186
|
+
);
|
|
187
|
+
return internalRequest(
|
|
188
|
+
this.sdk,
|
|
189
|
+
`/webchat/widgets/${widgetId}/conversations/${engagementSessionId}/messages/${messageId}/unfurls/hide`,
|
|
190
|
+
'POST',
|
|
191
|
+
{ body: { url } },
|
|
192
|
+
);
|
|
193
|
+
}
|
|
163
194
|
}
|
|
164
195
|
|
|
165
196
|
export class WebchatConversationsService {
|