@unboundcx/sdk 4.13.176 → 4.13.177

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/services/esign.js +60 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.176",
3
+ "version": "4.13.177",
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
@@ -165,6 +165,30 @@ export class EsignPublicService {
165
165
  true,
166
166
  );
167
167
  }
168
+
169
+ /**
170
+ * Record that this signer downloaded or printed the document.
171
+ * @param {Object} params
172
+ * @param {string} params.token
173
+ * @param {string} params.action downloaded or printed
174
+ * @returns {Promise<Object>}
175
+ */
176
+ async activity({ token, action }) {
177
+ this.sdk.validateParams(
178
+ { token, action },
179
+ {
180
+ token: { type: 'string', required: true },
181
+ action: { type: 'string', required: true },
182
+ },
183
+ );
184
+ return internalRequest(
185
+ this.sdk,
186
+ `/esign/public/${token}/activity`,
187
+ 'POST',
188
+ { body: { action } },
189
+ true,
190
+ );
191
+ }
168
192
  }
169
193
 
170
194
  /**
@@ -189,6 +213,7 @@ export class EsignService {
189
213
  * @param {boolean} [body.allowDrawn]
190
214
  * @param {string} [body.postSignRedirectUrl]
191
215
  * @param {string[]} [body.feedNotifyEvents] - Subset of `sent`|`opened`|`signed`; auto-posts a chat card to every linked record's feed on each selected event.
216
+ * @param {number} [body.reminderIntervalHours] - `0` off. Any whole number of hours. The first reminder must land before `expiresAt`. Stored only; no sender yet.
192
217
  * @returns {Promise<Object>}
193
218
  */
194
219
  async createPackage({
@@ -201,6 +226,7 @@ export class EsignService {
201
226
  allowDrawn,
202
227
  postSignRedirectUrl,
203
228
  feedNotifyEvents,
229
+ reminderIntervalHours,
204
230
  } = {}) {
205
231
  this.sdk.validateParams(
206
232
  { generatedDocumentId, name, recipients },
@@ -214,6 +240,7 @@ export class EsignService {
214
240
  allowDrawn: { type: 'boolean', required: false },
215
241
  postSignRedirectUrl: { type: 'string', required: false },
216
242
  feedNotifyEvents: { type: 'array', required: false },
243
+ reminderIntervalHours: { type: 'number', required: false },
217
244
  },
218
245
  );
219
246
 
@@ -228,6 +255,9 @@ export class EsignService {
228
255
  if (feedNotifyEvents !== undefined) {
229
256
  body.feedNotifyEvents = feedNotifyEvents;
230
257
  }
258
+ if (reminderIntervalHours !== undefined) {
259
+ body.reminderIntervalHours = reminderIntervalHours;
260
+ }
231
261
 
232
262
  return internalRequest(this.sdk, '/esign/packages', 'POST', { body });
233
263
  }
@@ -239,14 +269,37 @@ export class EsignService {
239
269
  * @param {string} [query.recordId] - Requires `objectName`
240
270
  * @param {string} [query.objectName] - Requires `recordId`
241
271
  * @param {string} [query.status]
272
+ * @param {string} [query.statusGroup] - `open` is sent + in_progress
273
+ * @param {string} [query.createdBy]
274
+ * @param {string} [query.sentFrom]
275
+ * @param {string} [query.sentTo]
276
+ * @param {string} [query.q] - agreement name contains
277
+ * @param {boolean} [query.includeSigners] - explicit; omit on the limit:1 probe
242
278
  * @param {number} [query.limit]
243
279
  * @returns {Promise<{results: Object[]}>}
244
280
  */
245
- async listPackages({ recordId, objectName, status, limit } = {}) {
281
+ async listPackages({
282
+ recordId,
283
+ objectName,
284
+ status,
285
+ statusGroup,
286
+ createdBy,
287
+ sentFrom,
288
+ sentTo,
289
+ q,
290
+ includeSigners,
291
+ limit,
292
+ } = {}) {
246
293
  const query = {};
247
294
  if (recordId) query.recordId = recordId;
248
295
  if (objectName) query.objectName = objectName;
249
296
  if (status) query.status = status;
297
+ if (statusGroup) query.statusGroup = statusGroup;
298
+ if (createdBy) query.createdBy = createdBy;
299
+ if (sentFrom) query.sentFrom = sentFrom;
300
+ if (sentTo) query.sentTo = sentTo;
301
+ if (q) query.q = q;
302
+ if (includeSigners) query.includeSigners = '1';
250
303
  if (limit) query.limit = limit;
251
304
  return internalRequest(this.sdk, '/esign/packages', 'GET', { query });
252
305
  }
@@ -273,6 +326,7 @@ export class EsignService {
273
326
  * @param {boolean} [body.allowDrawn]
274
327
  * @param {string} [body.postSignRedirectUrl]
275
328
  * @param {string[]} [body.feedNotifyEvents] - Subset of `sent`|`opened`|`signed`; auto-posts a chat card to every linked record's feed on each selected event.
329
+ * @param {number} [body.reminderIntervalHours] - `0` off. Any whole number of hours. The first reminder must land before `expiresAt`. Stored only; no sender yet.
276
330
  * @returns {Promise<Object>}
277
331
  */
278
332
  async updatePackage(
@@ -286,6 +340,7 @@ export class EsignService {
286
340
  allowDrawn,
287
341
  postSignRedirectUrl,
288
342
  feedNotifyEvents,
343
+ reminderIntervalHours,
289
344
  } = {},
290
345
  ) {
291
346
  this.sdk.validateParams(
@@ -300,6 +355,7 @@ export class EsignService {
300
355
  allowDrawn: { type: 'boolean', required: false },
301
356
  postSignRedirectUrl: { type: 'string', required: false },
302
357
  feedNotifyEvents: { type: 'array', required: false },
358
+ reminderIntervalHours: { type: 'number', required: false },
303
359
  },
304
360
  );
305
361
 
@@ -316,6 +372,9 @@ export class EsignService {
316
372
  if (feedNotifyEvents !== undefined) {
317
373
  body.feedNotifyEvents = feedNotifyEvents;
318
374
  }
375
+ if (reminderIntervalHours !== undefined) {
376
+ body.reminderIntervalHours = reminderIntervalHours;
377
+ }
319
378
 
320
379
  return internalRequest(this.sdk, `/esign/packages/${id}`, 'PATCH', {
321
380
  body,