@unboundcx/sdk 4.13.113 → 4.13.115

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/index.js CHANGED
@@ -21,6 +21,7 @@ import { VerificationService } from './services/verification.js';
21
21
  import { PortalsService } from './services/portals.js';
22
22
  import { DealRegistrationsService } from './services/dealRegistrations.js';
23
23
  import { SipEndpointsService } from './services/sipEndpoints.js';
24
+ import { RingGroupsService } from './services/ringGroups.js';
24
25
  import { WebchatService } from './services/webchat.js';
25
26
  import { CobrowseService } from './services/cobrowse.js';
26
27
  import { MessageTemplatesService } from './services/messageTemplates.js';
@@ -120,6 +121,7 @@ class UnboundSDK extends BaseSDK {
120
121
  this.portals = new PortalsService(this);
121
122
  this.dealRegistrations = new DealRegistrationsService(this);
122
123
  this.sipEndpoints = new SipEndpointsService(this);
124
+ this.ringGroups = new RingGroupsService(this);
123
125
  this.webchat = new WebchatService(this);
124
126
  this.cobrowse = new CobrowseService(this);
125
127
  this.messageTemplates = new MessageTemplatesService(this);
@@ -320,6 +322,7 @@ export { VerificationService } from './services/verification.js';
320
322
  export { PortalsService } from './services/portals.js';
321
323
  export { DealRegistrationsService } from './services/dealRegistrations.js';
322
324
  export { SipEndpointsService } from './services/sipEndpoints.js';
325
+ export { RingGroupsService } from './services/ringGroups.js';
323
326
  export { WebchatService, WebchatWidgetsService } from './services/webchat.js';
324
327
  export { CobrowseService, CobrowseVisitorService } from './services/cobrowse.js';
325
328
  export { MessageTemplatesService } from './services/messageTemplates.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.113",
3
+ "version": "4.13.115",
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",
@@ -24,6 +24,10 @@ export class SmsService {
24
24
  * @param {string} [params.taskId] - Task the message was sent under (multi-channel-per-task attribution)
25
25
  * @param {boolean} [params.force] - Force-send past a busy-conversation
26
26
  * (409 TEXT_CONVERSATION_BUSY) collision
27
+ * @param {boolean} [params.system] - Internal/master-auth-only: skip
28
+ * people/company auto-link and conversation open/bump, tag the row
29
+ * isSystem=1 (P15, verification-code sends). Ignored unless the caller
30
+ * holds internal/master auth.
27
31
  * @returns {Promise<Object>} Message details
28
32
  */
29
33
  async send({
@@ -38,6 +42,7 @@ export class SmsService {
38
42
  engagementSessionId,
39
43
  taskId,
40
44
  force,
45
+ system,
41
46
  }) {
42
47
  const messageData = {};
43
48
  if (from) messageData.from = from;
@@ -50,6 +55,7 @@ export class SmsService {
50
55
  if (engagementSessionId) messageData.engagementSessionId = engagementSessionId;
51
56
  if (taskId) messageData.taskId = taskId;
52
57
  if (force !== undefined) messageData.force = force;
58
+ if (system !== undefined) messageData.system = system;
53
59
 
54
60
  // `to` is string | string[] (group MMS, up to 8 recipients) --
55
61
  // validated by hand since sdk.validateParams has no multi-type support
@@ -79,6 +85,7 @@ export class SmsService {
79
85
  engagementSessionId: { type: 'string', required: false },
80
86
  taskId: { type: 'string', required: false },
81
87
  force: { type: 'boolean', required: false },
88
+ system: { type: 'boolean', required: false },
82
89
  },
83
90
  );
84
91
 
@@ -115,6 +115,8 @@ export class PhoneNumbersService {
115
115
  textApp,
116
116
  textAppMetaData,
117
117
  textChatVisibility,
118
+ shakenBlockUnsigned,
119
+ shakenMinAttestation,
118
120
  },
119
121
  ) {
120
122
  this.sdk.validateParams(
@@ -131,6 +133,8 @@ export class PhoneNumbersService {
131
133
  textApp,
132
134
  textAppMetaData,
133
135
  textChatVisibility,
136
+ shakenBlockUnsigned,
137
+ shakenMinAttestation,
134
138
  },
135
139
  {
136
140
  id: { type: 'string', required: true },
@@ -146,6 +150,8 @@ export class PhoneNumbersService {
146
150
  textApp: { type: 'string', required: false },
147
151
  textAppMetaData: { type: 'string', required: false },
148
152
  textChatVisibility: { type: 'string', required: false },
153
+ shakenBlockUnsigned: { type: 'boolean', required: false },
154
+ shakenMinAttestation: { type: 'string', required: false },
149
155
  },
150
156
  );
151
157
 
@@ -169,6 +175,11 @@ export class PhoneNumbersService {
169
175
  updateData.textAppMetaData = textAppMetaData;
170
176
  if (textChatVisibility !== undefined)
171
177
  updateData.textChatVisibility = textChatVisibility;
178
+ if (shakenBlockUnsigned !== undefined)
179
+ updateData.shakenBlockUnsigned = shakenBlockUnsigned;
180
+ // null clears the floor when the gate is turned off.
181
+ if (shakenMinAttestation !== undefined)
182
+ updateData.shakenMinAttestation = shakenMinAttestation;
172
183
 
173
184
  const params = {
174
185
  body: updateData,
@@ -0,0 +1,91 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ // Ring groups CRUD goes through sdk.objects.* ('ringGroups' /
4
+ // 'ringGroupMembers') -- this service only carries the 3 helper endpoints
5
+ // that don't fit the generic objects shape (ring-groups-plan.md §4.5).
6
+ export class RingGroupsService {
7
+ constructor(sdk) {
8
+ this.sdk = sdk;
9
+ }
10
+
11
+ /**
12
+ * Check whether an extension number is free, with a suggested next free
13
+ * number when it isn't.
14
+ *
15
+ * @param {string|number} extension - Extension number to check
16
+ * @param {string} [excludeId] - An extensions row id to ignore (the
17
+ * group's own extension, when re-checking its current number while
18
+ * editing it)
19
+ * @returns {Promise<Object>} result
20
+ * @returns {boolean} result.available
21
+ * @returns {number|null} result.suggestion - Next free extension when
22
+ * `available` is false
23
+ *
24
+ * @example
25
+ * const { available, suggestion } = await sdk.ringGroups.extensionAvailable(305);
26
+ */
27
+ async extensionAvailable(extension, excludeId) {
28
+ this.sdk.validateParams(
29
+ { extension },
30
+ { extension: { type: 'string', required: true } },
31
+ );
32
+
33
+ const params = {
34
+ query: {
35
+ extension,
36
+ ...(excludeId ? { excludeId } : {}),
37
+ },
38
+ };
39
+
40
+ return await internalRequest(
41
+ this.sdk,
42
+ '/ringGroups/extensions/available',
43
+ 'GET',
44
+ params,
45
+ );
46
+ }
47
+
48
+ /**
49
+ * Rewrites a ring group's hunt-order sortOrder to 1..n in the given
50
+ * order. 400s if `memberIds` isn't exactly the group's current
51
+ * (non-deleted) member set.
52
+ *
53
+ * @param {string} id - Ring group id
54
+ * @param {string[]} memberIds - Member ids in the desired hunt order
55
+ * @returns {Promise<Object>} result with the applied memberIds
56
+ *
57
+ * @example
58
+ * await sdk.ringGroups.reorderMembers('290...', ['291...a', '291...b']);
59
+ */
60
+ async reorderMembers(id, memberIds) {
61
+ this.sdk.validateParams(
62
+ { id, memberIds },
63
+ {
64
+ id: { type: 'string', required: true },
65
+ memberIds: { type: 'array', required: true },
66
+ },
67
+ );
68
+
69
+ const params = { body: { memberIds } };
70
+
71
+ return await internalRequest(
72
+ this.sdk,
73
+ `/ringGroups/${id}/members/reorder`,
74
+ 'POST',
75
+ params,
76
+ );
77
+ }
78
+
79
+ /**
80
+ * Lists ring groups as routing-picker targets: `{ id, name, extension }`
81
+ * per group, for phone-number and final-destination pickers.
82
+ *
83
+ * @returns {Promise<Array<Object>>} targets
84
+ *
85
+ * @example
86
+ * const targets = await sdk.ringGroups.routingTargets();
87
+ */
88
+ async routingTargets() {
89
+ return await internalRequest(this.sdk, '/ringGroups/routingTargets', 'GET', {});
90
+ }
91
+ }
@@ -1338,6 +1338,52 @@ export class TaskService {
1338
1338
  { body: { channel, isTyping } },
1339
1339
  );
1340
1340
  }
1341
+
1342
+ /**
1343
+ * Voice-join offer on an open non-voice task the caller already owns.
1344
+ * @param {string} taskId
1345
+ * @returns {Promise<{taskId: string, expiresAt: string|null, canAccept: boolean}>}
1346
+ */
1347
+ async voiceJoinState(taskId) {
1348
+ this.sdk.validateParams(
1349
+ { taskId },
1350
+ { taskId: { type: 'string', required: true } },
1351
+ );
1352
+ return await internalRequest(
1353
+ this.sdk,
1354
+ `/taskRouter/tasks/${taskId}/voice-join`,
1355
+ 'GET',
1356
+ {},
1357
+ );
1358
+ }
1359
+
1360
+ /** Bridge this worker's phone onto the waiting caller. Sets voiceJoin first. */
1361
+ async voiceJoinAccept(taskId) {
1362
+ this.sdk.validateParams(
1363
+ { taskId },
1364
+ { taskId: { type: 'string', required: true } },
1365
+ );
1366
+ return await internalRequest(
1367
+ this.sdk,
1368
+ `/taskRouter/tasks/${taskId}/voice-join/accept`,
1369
+ 'POST',
1370
+ {},
1371
+ );
1372
+ }
1373
+
1374
+ /** Release the task so a voice-capable worker can be found. */
1375
+ async voiceJoinRelease(taskId) {
1376
+ this.sdk.validateParams(
1377
+ { taskId },
1378
+ { taskId: { type: 'string', required: true } },
1379
+ );
1380
+ return await internalRequest(
1381
+ this.sdk,
1382
+ `/taskRouter/tasks/${taskId}/voice-join/release`,
1383
+ 'POST',
1384
+ {},
1385
+ );
1386
+ }
1341
1387
  }
1342
1388
 
1343
1389
  // CC task-workspace methods (claim/observe/unobserve/observers/take/access)
@@ -599,6 +599,7 @@ export class WorkflowSessionsService {
599
599
  endDate,
600
600
  limit,
601
601
  before,
602
+ activeOnly,
602
603
  } = {}) {
603
604
  this.sdk.validateParams(
604
605
  { workflowId, workflowVersionId },
@@ -622,6 +623,7 @@ export class WorkflowSessionsService {
622
623
  if (endDate) query.endDate = endDate;
623
624
  if (limit) query.limit = limit;
624
625
  if (before) query.before = before;
626
+ if (activeOnly) query.activeOnly = true;
625
627
 
626
628
  const result = await internalRequest(this.sdk, '/workflows/sessions/list', 'GET', {
627
629
  query,