@unboundcx/sdk 4.13.22 → 4.13.24
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.24",
|
|
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",
|
package/services/esign.js
CHANGED
|
@@ -188,6 +188,7 @@ export class EsignService {
|
|
|
188
188
|
* @param {string} [body.expiresAt]
|
|
189
189
|
* @param {boolean} [body.allowDrawn]
|
|
190
190
|
* @param {string} [body.postSignRedirectUrl]
|
|
191
|
+
* @param {string[]} [body.feedNotifyEvents] - Subset of `sent`|`opened`|`signed`; auto-posts a chat card to every linked record's feed on each selected event.
|
|
191
192
|
* @returns {Promise<Object>}
|
|
192
193
|
*/
|
|
193
194
|
async createPackage({
|
|
@@ -199,6 +200,7 @@ export class EsignService {
|
|
|
199
200
|
expiresAt,
|
|
200
201
|
allowDrawn,
|
|
201
202
|
postSignRedirectUrl,
|
|
203
|
+
feedNotifyEvents,
|
|
202
204
|
} = {}) {
|
|
203
205
|
this.sdk.validateParams(
|
|
204
206
|
{ generatedDocumentId, name, recipients },
|
|
@@ -211,6 +213,7 @@ export class EsignService {
|
|
|
211
213
|
expiresAt: { type: 'string', required: false },
|
|
212
214
|
allowDrawn: { type: 'boolean', required: false },
|
|
213
215
|
postSignRedirectUrl: { type: 'string', required: false },
|
|
216
|
+
feedNotifyEvents: { type: 'array', required: false },
|
|
214
217
|
},
|
|
215
218
|
);
|
|
216
219
|
|
|
@@ -222,6 +225,9 @@ export class EsignService {
|
|
|
222
225
|
if (postSignRedirectUrl !== undefined) {
|
|
223
226
|
body.postSignRedirectUrl = postSignRedirectUrl;
|
|
224
227
|
}
|
|
228
|
+
if (feedNotifyEvents !== undefined) {
|
|
229
|
+
body.feedNotifyEvents = feedNotifyEvents;
|
|
230
|
+
}
|
|
225
231
|
|
|
226
232
|
return internalRequest(this.sdk, '/esign/packages', 'POST', { body });
|
|
227
233
|
}
|
|
@@ -266,6 +272,7 @@ export class EsignService {
|
|
|
266
272
|
* @param {string} [body.expiresAt]
|
|
267
273
|
* @param {boolean} [body.allowDrawn]
|
|
268
274
|
* @param {string} [body.postSignRedirectUrl]
|
|
275
|
+
* @param {string[]} [body.feedNotifyEvents] - Subset of `sent`|`opened`|`signed`; auto-posts a chat card to every linked record's feed on each selected event.
|
|
269
276
|
* @returns {Promise<Object>}
|
|
270
277
|
*/
|
|
271
278
|
async updatePackage(
|
|
@@ -278,6 +285,7 @@ export class EsignService {
|
|
|
278
285
|
expiresAt,
|
|
279
286
|
allowDrawn,
|
|
280
287
|
postSignRedirectUrl,
|
|
288
|
+
feedNotifyEvents,
|
|
281
289
|
} = {},
|
|
282
290
|
) {
|
|
283
291
|
this.sdk.validateParams(
|
|
@@ -291,6 +299,7 @@ export class EsignService {
|
|
|
291
299
|
expiresAt: { type: 'string', required: false },
|
|
292
300
|
allowDrawn: { type: 'boolean', required: false },
|
|
293
301
|
postSignRedirectUrl: { type: 'string', required: false },
|
|
302
|
+
feedNotifyEvents: { type: 'array', required: false },
|
|
294
303
|
},
|
|
295
304
|
);
|
|
296
305
|
|
|
@@ -304,6 +313,9 @@ export class EsignService {
|
|
|
304
313
|
if (postSignRedirectUrl !== undefined) {
|
|
305
314
|
body.postSignRedirectUrl = postSignRedirectUrl;
|
|
306
315
|
}
|
|
316
|
+
if (feedNotifyEvents !== undefined) {
|
|
317
|
+
body.feedNotifyEvents = feedNotifyEvents;
|
|
318
|
+
}
|
|
307
319
|
|
|
308
320
|
return internalRequest(this.sdk, `/esign/packages/${id}`, 'PATCH', {
|
|
309
321
|
body,
|
|
@@ -63,6 +63,8 @@ export class EmailService {
|
|
|
63
63
|
* @param {boolean} [params.tracking=true] - Enable email tracking (opens, clicks)
|
|
64
64
|
* @param {string} [params.mailboxId] - Specific mailbox to send from
|
|
65
65
|
* @param {string} [params.draftId] - Convert existing draft to sent email
|
|
66
|
+
* @param {string} [params.engagementSessionId] - Engagement to attach this email to
|
|
67
|
+
* @param {string} [params.taskId] - Task the email was sent under (multi-channel-per-task attribution)
|
|
66
68
|
* @returns {Promise<Object>} Email send result with ID and threading info
|
|
67
69
|
*/
|
|
68
70
|
async send({
|
|
@@ -86,6 +88,7 @@ export class EmailService {
|
|
|
86
88
|
mailboxId,
|
|
87
89
|
draftId,
|
|
88
90
|
engagementSessionId,
|
|
91
|
+
taskId,
|
|
89
92
|
}) {
|
|
90
93
|
// Validate required params (relaxed when using draftId)
|
|
91
94
|
if (!draftId) {
|
|
@@ -118,6 +121,7 @@ export class EmailService {
|
|
|
118
121
|
mailboxId,
|
|
119
122
|
draftId,
|
|
120
123
|
engagementSessionId,
|
|
124
|
+
taskId,
|
|
121
125
|
},
|
|
122
126
|
{
|
|
123
127
|
html: { type: 'string', required: false },
|
|
@@ -135,6 +139,7 @@ export class EmailService {
|
|
|
135
139
|
mailboxId: { type: 'string', required: false },
|
|
136
140
|
draftId: { type: 'string', required: false },
|
|
137
141
|
engagementSessionId: { type: 'string', required: false },
|
|
142
|
+
taskId: { type: 'string', required: false },
|
|
138
143
|
},
|
|
139
144
|
);
|
|
140
145
|
|
|
@@ -161,6 +166,7 @@ export class EmailService {
|
|
|
161
166
|
if (draftId) emailData.draftId = draftId;
|
|
162
167
|
if (engagementSessionId)
|
|
163
168
|
emailData.engagementSessionId = engagementSessionId;
|
|
169
|
+
if (taskId) emailData.taskId = taskId;
|
|
164
170
|
|
|
165
171
|
const options = {
|
|
166
172
|
body: emailData,
|
|
@@ -19,6 +19,8 @@ export class SmsService {
|
|
|
19
19
|
* @param {string} [params.webhookUrl] - Webhook URL for delivery status
|
|
20
20
|
* @param {string} [params.relatedId] - Task/engagement (or other record) id
|
|
21
21
|
* to attach this message to, so it surfaces on that record's feed
|
|
22
|
+
* @param {string} [params.engagementSessionId] - Engagement to attach this message to
|
|
23
|
+
* @param {string} [params.taskId] - Task the message was sent under (multi-channel-per-task attribution)
|
|
22
24
|
* @returns {Promise<Object>} Message details
|
|
23
25
|
*/
|
|
24
26
|
async send({
|
|
@@ -30,6 +32,8 @@ export class SmsService {
|
|
|
30
32
|
mediaUrls,
|
|
31
33
|
webhookUrl,
|
|
32
34
|
relatedId,
|
|
35
|
+
engagementSessionId,
|
|
36
|
+
taskId,
|
|
33
37
|
}) {
|
|
34
38
|
const messageData = {};
|
|
35
39
|
if (from) messageData.from = from;
|
|
@@ -39,6 +43,8 @@ export class SmsService {
|
|
|
39
43
|
if (mediaUrls) messageData.mediaUrls = mediaUrls;
|
|
40
44
|
if (webhookUrl) messageData.webhookUrl = webhookUrl;
|
|
41
45
|
if (relatedId) messageData.relatedId = relatedId;
|
|
46
|
+
if (engagementSessionId) messageData.engagementSessionId = engagementSessionId;
|
|
47
|
+
if (taskId) messageData.taskId = taskId;
|
|
42
48
|
|
|
43
49
|
this.sdk.validateParams(
|
|
44
50
|
{ to, ...messageData },
|
|
@@ -51,6 +57,8 @@ export class SmsService {
|
|
|
51
57
|
mediaUrls: { type: 'array', required: false },
|
|
52
58
|
webhookUrl: { type: 'string', required: false },
|
|
53
59
|
relatedId: { type: 'string', required: false },
|
|
60
|
+
engagementSessionId: { type: 'string', required: false },
|
|
61
|
+
taskId: { type: 'string', required: false },
|
|
54
62
|
},
|
|
55
63
|
);
|
|
56
64
|
|
package/services/objects.js
CHANGED
|
@@ -372,6 +372,7 @@ export class ObjectsService {
|
|
|
372
372
|
* @param {string} args.object
|
|
373
373
|
* @param {object} args.where
|
|
374
374
|
* @param {boolean} [args.skipTriggers=false] - Do not run triggers for this write
|
|
375
|
+
* @param {object} [args.options] - Extra delete options (e.g. { deleteEmails: true })
|
|
375
376
|
* @returns {Promise} Delete result
|
|
376
377
|
*
|
|
377
378
|
* @example
|
|
@@ -379,15 +380,17 @@ export class ObjectsService {
|
|
|
379
380
|
* object: 'people',
|
|
380
381
|
* where: { id: '013…' },
|
|
381
382
|
* skipTriggers: true,
|
|
383
|
+
* options: { deleteEmails: true },
|
|
382
384
|
* });
|
|
383
385
|
*/
|
|
384
|
-
async delete({ object, where, skipTriggers = false }) {
|
|
386
|
+
async delete({ object, where, skipTriggers = false, options }) {
|
|
385
387
|
this.sdk.validateParams(
|
|
386
|
-
{ object, where, skipTriggers },
|
|
388
|
+
{ object, where, skipTriggers, options },
|
|
387
389
|
{
|
|
388
390
|
object: { type: 'string', required: true },
|
|
389
391
|
where: { type: 'object', required: true },
|
|
390
392
|
skipTriggers: { type: 'boolean', required: false },
|
|
393
|
+
options: { type: 'object', required: false },
|
|
391
394
|
},
|
|
392
395
|
);
|
|
393
396
|
|
|
@@ -396,6 +399,7 @@ export class ObjectsService {
|
|
|
396
399
|
where,
|
|
397
400
|
},
|
|
398
401
|
};
|
|
402
|
+
if (options) params.body.options = options;
|
|
399
403
|
if (skipTriggers) params.query = { skipTriggers: true };
|
|
400
404
|
|
|
401
405
|
const result = await internalRequest(this.sdk, `/object/${object}`, 'DELETE', params);
|
|
@@ -409,18 +413,25 @@ export class ObjectsService {
|
|
|
409
413
|
* @param {string} args.object
|
|
410
414
|
* @param {string} args.id
|
|
411
415
|
* @param {boolean} [args.skipTriggers=false] - Do not run triggers for this write
|
|
416
|
+
* @param {object} [args.options] - Extra delete options (e.g. { deleteEmails: true })
|
|
412
417
|
* @returns {Promise} Delete result
|
|
413
418
|
*
|
|
414
419
|
* @example
|
|
415
|
-
* await sdk.objects.deleteById({
|
|
420
|
+
* await sdk.objects.deleteById({
|
|
421
|
+
* object: 'people',
|
|
422
|
+
* id: '013…',
|
|
423
|
+
* skipTriggers: true,
|
|
424
|
+
* options: { deleteEmails: true },
|
|
425
|
+
* });
|
|
416
426
|
*/
|
|
417
|
-
async deleteById({ object, id, skipTriggers = false }) {
|
|
427
|
+
async deleteById({ object, id, skipTriggers = false, options }) {
|
|
418
428
|
this.sdk.validateParams(
|
|
419
|
-
{ object, id, skipTriggers },
|
|
429
|
+
{ object, id, skipTriggers, options },
|
|
420
430
|
{
|
|
421
431
|
object: { type: 'string', required: true },
|
|
422
432
|
id: { type: 'string', required: true },
|
|
423
433
|
skipTriggers: { type: 'boolean', required: false },
|
|
434
|
+
options: { type: 'object', required: false },
|
|
424
435
|
},
|
|
425
436
|
);
|
|
426
437
|
|
|
@@ -431,12 +442,84 @@ export class ObjectsService {
|
|
|
431
442
|
},
|
|
432
443
|
},
|
|
433
444
|
};
|
|
445
|
+
if (options) params.body.options = options;
|
|
434
446
|
if (skipTriggers) params.query = { skipTriggers: true };
|
|
435
447
|
|
|
436
448
|
const result = await internalRequest(this.sdk, `/object/${object}`, 'DELETE', params);
|
|
437
449
|
return result;
|
|
438
450
|
}
|
|
439
451
|
|
|
452
|
+
/**
|
|
453
|
+
* Merge 1–3 records into a survivor record. people|company only (v1 gate,
|
|
454
|
+
* enforced server-side). Related-record cleanup runs sync (owned child rows)
|
|
455
|
+
* + async (high-volume history) after the survivor is updated and the
|
|
456
|
+
* losers are deleted.
|
|
457
|
+
*
|
|
458
|
+
* @param {object} args
|
|
459
|
+
* @param {string} args.object
|
|
460
|
+
* @param {string} args.survivorId - Record that remains after the merge.
|
|
461
|
+
* @param {string[]} args.mergeIds - 1-3 ids to merge into the survivor (then deleted).
|
|
462
|
+
* @param {object} [args.fields] - Map of column -> the record id whose value wins.
|
|
463
|
+
* Omitted columns keep the survivor's value.
|
|
464
|
+
* @returns {Promise<{survivorId: string, queued: boolean}>}
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* await sdk.objects.merge({
|
|
468
|
+
* object: 'people',
|
|
469
|
+
* survivorId: '013…',
|
|
470
|
+
* mergeIds: ['014…', '015…'],
|
|
471
|
+
* fields: { firstName: '014…', email: '015…' },
|
|
472
|
+
* });
|
|
473
|
+
*/
|
|
474
|
+
async merge({ object, survivorId, mergeIds, fields }) {
|
|
475
|
+
this.sdk.validateParams(
|
|
476
|
+
{ object, survivorId, mergeIds, fields },
|
|
477
|
+
{
|
|
478
|
+
object: { type: 'string', required: true },
|
|
479
|
+
survivorId: { type: 'string', required: true },
|
|
480
|
+
mergeIds: { type: 'array', required: true },
|
|
481
|
+
fields: { type: 'object', required: false },
|
|
482
|
+
},
|
|
483
|
+
);
|
|
484
|
+
|
|
485
|
+
const body = { survivorId, mergeIds };
|
|
486
|
+
if (fields) body.fields = fields;
|
|
487
|
+
|
|
488
|
+
const params = { body };
|
|
489
|
+
|
|
490
|
+
const result = await internalRequest(this.sdk, `/object/${object}/merge`, 'POST', params);
|
|
491
|
+
return result;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Get merge backfill status for a record (pending Bucket B re-point count
|
|
496
|
+
* from the recordMerges ledger).
|
|
497
|
+
*
|
|
498
|
+
* @param {object} args
|
|
499
|
+
* @param {string} args.object
|
|
500
|
+
* @param {string} args.id
|
|
501
|
+
* @returns {Promise<{pending: number, lastMergedAt: string|null}>}
|
|
502
|
+
*
|
|
503
|
+
* @example
|
|
504
|
+
* await sdk.objects.mergeStatus({ object: 'people', id: '013…' });
|
|
505
|
+
*/
|
|
506
|
+
async mergeStatus({ object, id }) {
|
|
507
|
+
this.sdk.validateParams(
|
|
508
|
+
{ object, id },
|
|
509
|
+
{
|
|
510
|
+
object: { type: 'string', required: true },
|
|
511
|
+
id: { type: 'string', required: true },
|
|
512
|
+
},
|
|
513
|
+
);
|
|
514
|
+
|
|
515
|
+
const result = await internalRequest(
|
|
516
|
+
this.sdk,
|
|
517
|
+
`/object/${object}/merge-status/${id}`,
|
|
518
|
+
'GET',
|
|
519
|
+
);
|
|
520
|
+
return result;
|
|
521
|
+
}
|
|
522
|
+
|
|
440
523
|
/**
|
|
441
524
|
* List saved list-views for an object (system + shared + own).
|
|
442
525
|
* @param {Object} params
|