@unboundcx/sdk 4.13.175 → 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.
- package/package.json +1 -1
- package/services/esign.js +60 -1
- package/services/licenses.js +56 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
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({
|
|
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,
|
package/services/licenses.js
CHANGED
|
@@ -156,13 +156,15 @@ export class LicensesService {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
* Set a user's
|
|
160
|
-
*
|
|
159
|
+
* Set a user's account-link status. `suspended` blocks sign-in and
|
|
160
|
+
* keeps the seat and assignments. `active` resumes a suspension or
|
|
161
|
+
* enables an offboarded user (sign-in only). `disabled` is the legacy
|
|
162
|
+
* thin disable; a real offboard is `offboardUser`, not this method.
|
|
161
163
|
* @param {string} userId
|
|
162
|
-
* @param {'active'|'disabled'} status
|
|
164
|
+
* @param {'active'|'suspended'|'disabled'} status
|
|
163
165
|
* @returns {Promise<Object>}
|
|
164
166
|
* @example
|
|
165
|
-
* await sdk.licenses.setUserStatus('user-123', '
|
|
167
|
+
* await sdk.licenses.setUserStatus('user-123', 'suspended');
|
|
166
168
|
*/
|
|
167
169
|
async setUserStatus(userId, status) {
|
|
168
170
|
this.sdk.validateParams(
|
|
@@ -185,7 +187,7 @@ export class LicensesService {
|
|
|
185
187
|
* W1-3). Allowed for the caller's own userId with no scope, or for any
|
|
186
188
|
* userId in the account when holding admin:user:manage.
|
|
187
189
|
* @param {string} userId
|
|
188
|
-
* @returns {Promise<Object>} `{ userId, status, updatedAt? }`
|
|
190
|
+
* @returns {Promise<Object>} `{ userId, status, updatedAt?, offboarded? }`
|
|
189
191
|
* @example
|
|
190
192
|
* await sdk.licenses.getUserStatus('user-123');
|
|
191
193
|
*/
|
|
@@ -201,6 +203,55 @@ export class LicensesService {
|
|
|
201
203
|
);
|
|
202
204
|
}
|
|
203
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Preview what Disable would detach. Empty classes are omitted.
|
|
208
|
+
* Phone numbers and mailboxes include `items` when the count is 10
|
|
209
|
+
* or fewer.
|
|
210
|
+
* @param {string} userId
|
|
211
|
+
* @returns {Promise<Object>} `{ userId, status, offboarded, licenseSeatHeld, sections[] }`
|
|
212
|
+
* @example
|
|
213
|
+
* const { sections } = await sdk.licenses.previewUserOffboard('user-123');
|
|
214
|
+
*/
|
|
215
|
+
async previewUserOffboard(userId) {
|
|
216
|
+
this.sdk.validateParams(
|
|
217
|
+
{ userId },
|
|
218
|
+
{ userId: { type: 'string', required: true } },
|
|
219
|
+
);
|
|
220
|
+
return internalRequest(
|
|
221
|
+
this.sdk,
|
|
222
|
+
`/permissions/users/${userId}/offboard/preview`,
|
|
223
|
+
'GET',
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Offboard a user in one call. Each assignment is
|
|
229
|
+
* `{ mode: 'unassign' }` or `{ mode: 'reassign', userId }`.
|
|
230
|
+
* @param {string} userId
|
|
231
|
+
* @param {Object} assignments
|
|
232
|
+
* @returns {Promise<Object>} `{ status: 'disabled', warnings?: [], idempotent?: true }`
|
|
233
|
+
* @example
|
|
234
|
+
* await sdk.licenses.offboardUser('user-123', {
|
|
235
|
+
* people: { mode: 'unassign' },
|
|
236
|
+
* mailboxes: { mode: 'reassign', userId: 'user-456' },
|
|
237
|
+
* });
|
|
238
|
+
*/
|
|
239
|
+
async offboardUser(userId, assignments) {
|
|
240
|
+
this.sdk.validateParams(
|
|
241
|
+
{ userId, assignments },
|
|
242
|
+
{
|
|
243
|
+
userId: { type: 'string', required: true },
|
|
244
|
+
assignments: { type: 'object', required: true },
|
|
245
|
+
},
|
|
246
|
+
);
|
|
247
|
+
return internalRequest(
|
|
248
|
+
this.sdk,
|
|
249
|
+
`/permissions/users/${userId}/offboard`,
|
|
250
|
+
'POST',
|
|
251
|
+
{ body: { assignments } },
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
204
255
|
// -- Brand-owner methods (requireBrandOwner; 2D api routes) --------------
|
|
205
256
|
|
|
206
257
|
/**
|