@unboundcx/sdk 4.13.21 → 4.13.23

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.21",
3
+ "version": "4.13.23",
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,
@@ -17,6 +17,8 @@ export class SmsService {
17
17
  * @param {Object} [params.variables] - Template variables
18
18
  * @param {Array<string>} [params.mediaUrls] - Media URLs for MMS
19
19
  * @param {string} [params.webhookUrl] - Webhook URL for delivery status
20
+ * @param {string} [params.relatedId] - Task/engagement (or other record) id
21
+ * to attach this message to, so it surfaces on that record's feed
20
22
  * @returns {Promise<Object>} Message details
21
23
  */
22
24
  async send({
@@ -27,6 +29,7 @@ export class SmsService {
27
29
  variables,
28
30
  mediaUrls,
29
31
  webhookUrl,
32
+ relatedId,
30
33
  }) {
31
34
  const messageData = {};
32
35
  if (from) messageData.from = from;
@@ -35,6 +38,7 @@ export class SmsService {
35
38
  if (variables) messageData.variables = variables;
36
39
  if (mediaUrls) messageData.mediaUrls = mediaUrls;
37
40
  if (webhookUrl) messageData.webhookUrl = webhookUrl;
41
+ if (relatedId) messageData.relatedId = relatedId;
38
42
 
39
43
  this.sdk.validateParams(
40
44
  { to, ...messageData },
@@ -46,6 +50,7 @@ export class SmsService {
46
50
  variables: { type: 'object', required: false },
47
51
  mediaUrls: { type: 'array', required: false },
48
52
  webhookUrl: { type: 'string', required: false },
53
+ relatedId: { type: 'string', required: false },
49
54
  },
50
55
  );
51
56
 
@@ -73,4 +78,26 @@ export class SmsService {
73
78
  const result = await internalRequest(this.sdk, `/messaging/sms/${id}`, 'GET');
74
79
  return result;
75
80
  }
81
+
82
+ /**
83
+ * List SMS/MMS messages tied to a task/engagement (or other record) id —
84
+ * feed read path for the contact-center interaction timeline.
85
+ * @param {string} relatedId - Related record id
86
+ * @returns {Promise<Object>} { messages: [...] }
87
+ */
88
+ async getByRelated(relatedId) {
89
+ this.sdk.validateParams(
90
+ { relatedId },
91
+ {
92
+ relatedId: { type: 'string', required: true },
93
+ },
94
+ );
95
+
96
+ const result = await internalRequest(
97
+ this.sdk,
98
+ `/messaging/sms/related/${relatedId}`,
99
+ 'GET',
100
+ );
101
+ return result;
102
+ }
76
103
  }