@unboundcx/sdk 4.13.133 → 4.13.134

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
@@ -23,6 +23,8 @@ import { DealRegistrationsService } from './services/dealRegistrations.js';
23
23
  import { SipEndpointsService } from './services/sipEndpoints.js';
24
24
  import { RingGroupsService } from './services/ringGroups.js';
25
25
  import { LineGroupsService } from './services/lineGroups.js';
26
+ import { ParkingService } from './services/parking.js';
27
+ import { OperatorPanelsService } from './services/operatorPanels.js';
26
28
  import { SchedulesService } from './services/schedules/SchedulesService.js';
27
29
  import { JourneysService } from './services/journeys/JourneysService.js';
28
30
  import { WorkflowTemplatesService } from './services/workflowTemplates/WorkflowTemplatesService.js';
@@ -128,6 +130,8 @@ class UnboundSDK extends BaseSDK {
128
130
  this.sipEndpoints = new SipEndpointsService(this);
129
131
  this.ringGroups = new RingGroupsService(this);
130
132
  this.lineGroups = new LineGroupsService(this);
133
+ this.parking = new ParkingService(this);
134
+ this.operatorPanels = new OperatorPanelsService(this);
131
135
  this.schedules = new SchedulesService(this);
132
136
  this.journeys = new JourneysService(this);
133
137
  this.workflowTemplates = new WorkflowTemplatesService(this);
@@ -334,6 +338,7 @@ export { DealRegistrationsService } from './services/dealRegistrations.js';
334
338
  export { SipEndpointsService } from './services/sipEndpoints.js';
335
339
  export { RingGroupsService } from './services/ringGroups.js';
336
340
  export { LineGroupsService } from './services/lineGroups.js';
341
+ export { ParkingService } from './services/parking.js';
337
342
  export { SchedulesService } from './services/schedules/SchedulesService.js';
338
343
  export { TimeOffService } from './services/schedules/TimeOffService.js';
339
344
  export { JourneysService } from './services/journeys/JourneysService.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.13.133",
3
+ "version": "4.13.134",
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",
@@ -0,0 +1,209 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ // Operator (receptionist) panels (plans/operator-panel-plan.md §4/§4.1).
4
+ export class OperatorPanelsService {
5
+ constructor(sdk) {
6
+ this.sdk = sdk;
7
+ }
8
+
9
+ /**
10
+ * Non-deleted panels the caller can see, each with `isMyDefault`, plus
11
+ * `prefs`.
12
+ */
13
+ async listMine() {
14
+ return await internalRequest(this.sdk, '/operatorPanels/mine', 'GET', {});
15
+ }
16
+
17
+ /**
18
+ * @param {string} id - panel id
19
+ * @returns {Promise<Object>} render payload: ordered sections → items
20
+ */
21
+ async getResolved(id) {
22
+ this.sdk.validateParams(
23
+ { id },
24
+ { id: { type: 'string', required: true } },
25
+ );
26
+ return await internalRequest(
27
+ this.sdk,
28
+ `/operatorPanels/${id}/resolved`,
29
+ 'GET',
30
+ {},
31
+ );
32
+ }
33
+
34
+ /**
35
+ * @param {Object} body - { defaultPanelId?, viewMode? }
36
+ */
37
+ async setPrefs(body) {
38
+ this.sdk.validateParams(
39
+ { body },
40
+ { body: { type: 'object', required: true } },
41
+ );
42
+ return await internalRequest(this.sdk, '/operatorPanels/me/prefs', 'PUT', {
43
+ body,
44
+ });
45
+ }
46
+
47
+ /**
48
+ * @param {Object} params - { panelId }
49
+ */
50
+ async listMessages({ panelId }) {
51
+ this.sdk.validateParams(
52
+ { panelId },
53
+ { panelId: { type: 'string', required: true } },
54
+ );
55
+ return await internalRequest(this.sdk, '/operatorPanels/messages', 'GET', {
56
+ query: { panelId },
57
+ });
58
+ }
59
+
60
+ async list() {
61
+ return await internalRequest(this.sdk, '/operatorPanels', 'GET', {});
62
+ }
63
+
64
+ /**
65
+ * @param {Object} body - panel fields
66
+ */
67
+ async create(body) {
68
+ this.sdk.validateParams(
69
+ { body },
70
+ { body: { type: 'object', required: true } },
71
+ );
72
+ return await internalRequest(this.sdk, '/operatorPanels', 'POST', {
73
+ body,
74
+ });
75
+ }
76
+
77
+ /**
78
+ * @param {string} id - panel id
79
+ * @param {Object} body - panel fields to update
80
+ */
81
+ async update(id, body) {
82
+ this.sdk.validateParams(
83
+ { id, body },
84
+ {
85
+ id: { type: 'string', required: true },
86
+ body: { type: 'object', required: true },
87
+ },
88
+ );
89
+ return await internalRequest(this.sdk, `/operatorPanels/${id}`, 'PUT', {
90
+ body,
91
+ });
92
+ }
93
+
94
+ /**
95
+ * @param {string} id - panel id
96
+ */
97
+ async remove(id) {
98
+ this.sdk.validateParams(
99
+ { id },
100
+ { id: { type: 'string', required: true } },
101
+ );
102
+ return await internalRequest(this.sdk, `/operatorPanels/${id}`, 'DELETE', {});
103
+ }
104
+
105
+ /**
106
+ * Replace a panel's full ordered item list.
107
+ *
108
+ * @param {string} id - panel id
109
+ * @param {Array<Object>} items
110
+ */
111
+ async setItems(id, items) {
112
+ this.sdk.validateParams(
113
+ { id, items },
114
+ {
115
+ id: { type: 'string', required: true },
116
+ items: { type: 'array', required: true },
117
+ },
118
+ );
119
+ return await internalRequest(
120
+ this.sdk,
121
+ `/operatorPanels/${id}/items`,
122
+ 'PUT',
123
+ { body: { items } },
124
+ );
125
+ }
126
+
127
+ /**
128
+ * @param {string} id - panel id
129
+ * @param {Array<{principalType: 'user'|'group', principalId: string}>} access
130
+ */
131
+ async setAccess(id, access) {
132
+ this.sdk.validateParams(
133
+ { id },
134
+ { id: { type: 'string', required: true } },
135
+ );
136
+ return await internalRequest(
137
+ this.sdk,
138
+ `/operatorPanels/${id}/access`,
139
+ 'PUT',
140
+ { body: { access } },
141
+ );
142
+ }
143
+
144
+ /**
145
+ * @param {string} kind - users | groups | queues | ringGroups | workflows | records
146
+ * @param {string} [q] - search text
147
+ */
148
+ async search(kind, q) {
149
+ this.sdk.validateParams(
150
+ { kind },
151
+ { kind: { type: 'string', required: true } },
152
+ );
153
+ return await internalRequest(
154
+ this.sdk,
155
+ `/operatorPanels/pickers/${kind}`,
156
+ 'GET',
157
+ { query: q ? { q } : {} },
158
+ );
159
+ }
160
+
161
+ /**
162
+ * @param {Object} body - message template fields
163
+ */
164
+ async createMessage(body) {
165
+ this.sdk.validateParams(
166
+ { body },
167
+ { body: { type: 'object', required: true } },
168
+ );
169
+ return await internalRequest(this.sdk, '/operatorPanels/messages', 'POST', {
170
+ body,
171
+ });
172
+ }
173
+
174
+ /**
175
+ * @param {string} id - message id
176
+ * @param {Object} body - message fields to update
177
+ */
178
+ async updateMessage(id, body) {
179
+ this.sdk.validateParams(
180
+ { id, body },
181
+ {
182
+ id: { type: 'string', required: true },
183
+ body: { type: 'object', required: true },
184
+ },
185
+ );
186
+ return await internalRequest(
187
+ this.sdk,
188
+ `/operatorPanels/messages/${id}`,
189
+ 'PUT',
190
+ { body },
191
+ );
192
+ }
193
+
194
+ /**
195
+ * @param {string} id - message id
196
+ */
197
+ async deleteMessage(id) {
198
+ this.sdk.validateParams(
199
+ { id },
200
+ { id: { type: 'string', required: true } },
201
+ );
202
+ return await internalRequest(
203
+ this.sdk,
204
+ `/operatorPanels/messages/${id}`,
205
+ 'DELETE',
206
+ {},
207
+ );
208
+ }
209
+ }
@@ -0,0 +1,121 @@
1
+ import { internalRequest } from '../base.js';
2
+
3
+ // Call parking (plans/call-parking-plan.md). P0: pools + slots CRUD only.
4
+ // park/retrieve/listActive are P1/P3 -- stubs below, no routes yet.
5
+ export class ParkingService {
6
+ constructor(sdk) {
7
+ this.sdk = sdk;
8
+ }
9
+
10
+ async listPools() {
11
+ return await internalRequest(this.sdk, '/parking/pools', 'GET', {});
12
+ }
13
+
14
+ /**
15
+ * @param {Object} body - name, rangeStart?, slotCount?, recordTypeId?,
16
+ * accessMode?, access?: [{principalType, principalId}]
17
+ */
18
+ async createPool(body) {
19
+ this.sdk.validateParams(
20
+ { body },
21
+ { body: { type: 'object', required: true } },
22
+ );
23
+ return await internalRequest(this.sdk, '/parking/pools', 'POST', { body });
24
+ }
25
+
26
+ async updatePool(id, body) {
27
+ this.sdk.validateParams(
28
+ { id, body },
29
+ {
30
+ id: { type: 'string', required: true },
31
+ body: { type: 'object', required: true },
32
+ },
33
+ );
34
+ return await internalRequest(this.sdk, `/parking/pools/${id}`, 'PATCH', {
35
+ body,
36
+ });
37
+ }
38
+
39
+ /**
40
+ * @param {string} id
41
+ * @param {Array<{principalType: 'user'|'group', principalId: string}>} access
42
+ */
43
+ async setPoolAccess(id, access) {
44
+ this.sdk.validateParams(
45
+ { id },
46
+ { id: { type: 'string', required: true } },
47
+ );
48
+ return await internalRequest(
49
+ this.sdk,
50
+ `/parking/pools/${id}/access`,
51
+ 'PUT',
52
+ { body: { access } },
53
+ );
54
+ }
55
+
56
+ async deletePool(id) {
57
+ this.sdk.validateParams(
58
+ { id },
59
+ { id: { type: 'string', required: true } },
60
+ );
61
+ return await internalRequest(this.sdk, `/parking/pools/${id}`, 'DELETE', {});
62
+ }
63
+
64
+ /**
65
+ * @param {string} id pool id
66
+ * @param {number} [count] how many slots to add, default 1
67
+ */
68
+ async addSlots(id, count) {
69
+ this.sdk.validateParams(
70
+ { id },
71
+ { id: { type: 'string', required: true } },
72
+ );
73
+ return await internalRequest(
74
+ this.sdk,
75
+ `/parking/pools/${id}/slots`,
76
+ 'POST',
77
+ { body: { count } },
78
+ );
79
+ }
80
+
81
+ async deleteSlot(slotId) {
82
+ this.sdk.validateParams(
83
+ { slotId },
84
+ { slotId: { type: 'string', required: true } },
85
+ );
86
+ return await internalRequest(
87
+ this.sdk,
88
+ `/parking/slots/${slotId}`,
89
+ 'DELETE',
90
+ {},
91
+ );
92
+ }
93
+
94
+ /**
95
+ * @param {Object} body - { callId, slotId? } -- omit slotId for next-free
96
+ */
97
+ async park(body) {
98
+ this.sdk.validateParams(
99
+ { body },
100
+ { body: { type: 'object', required: true } },
101
+ );
102
+ return await internalRequest(this.sdk, '/parking/park', 'POST', { body });
103
+ }
104
+
105
+ /**
106
+ * @param {string} slotId
107
+ */
108
+ async retrieve(slotId) {
109
+ this.sdk.validateParams(
110
+ { slotId },
111
+ { slotId: { type: 'string', required: true } },
112
+ );
113
+ return await internalRequest(this.sdk, '/parking/retrieve', 'POST', {
114
+ body: { slotId },
115
+ });
116
+ }
117
+
118
+ async listActive() {
119
+ return await internalRequest(this.sdk, '/parking/active', 'GET', {});
120
+ }
121
+ }
@@ -24,6 +24,8 @@ export class RecentsService {
24
24
  * @param {boolean} [params.hasRecording] - Calls/meetings with a recording.
25
25
  * @param {boolean} [params.hasTranscription] - Calls/meetings/voicemail
26
26
  * with a transcript.
27
+ * @param {string} [params.voicemailBoxId] - Review this mailbox. Omit
28
+ * to list the current user's own voicemail.
27
29
  * @returns {Promise<{items: Object[], nextCursor: string|null}>}
28
30
  */
29
31
  async list({
@@ -38,6 +40,7 @@ export class RecentsService {
38
40
  missed,
39
41
  hasRecording,
40
42
  hasTranscription,
43
+ voicemailBoxId,
41
44
  } = {}) {
42
45
  this.sdk.validateParams(
43
46
  {
@@ -51,6 +54,7 @@ export class RecentsService {
51
54
  missed,
52
55
  hasRecording,
53
56
  hasTranscription,
57
+ voicemailBoxId,
54
58
  },
55
59
  {
56
60
  limit: { type: 'number', required: false },
@@ -63,6 +67,7 @@ export class RecentsService {
63
67
  missed: { type: 'boolean', required: false },
64
68
  hasRecording: { type: 'boolean', required: false },
65
69
  hasTranscription: { type: 'boolean', required: false },
70
+ voicemailBoxId: { type: 'string', required: false },
66
71
  },
67
72
  );
68
73
 
@@ -90,6 +95,7 @@ export class RecentsService {
90
95
  if (hasTranscription !== undefined) {
91
96
  query.hasTranscription = hasTranscription;
92
97
  }
98
+ if (voicemailBoxId !== undefined) query.voicemailBoxId = voicemailBoxId;
93
99
 
94
100
  const params = { query };
95
101
 
@@ -129,6 +135,16 @@ export class RecentsService {
129
135
  return result;
130
136
  }
131
137
 
138
+ /**
139
+ * Mailboxes the current user can review: their own, then any personal
140
+ * boxes shared with them. Each row includes that box's unread count.
141
+ *
142
+ * @returns {Promise<{boxes: Object[]}>}
143
+ */
144
+ async voicemailBoxes() {
145
+ return await internalRequest(this.sdk, '/recents/voicemailBoxes', 'GET');
146
+ }
147
+
132
148
  /**
133
149
  * Fetch recents stats (calls/talk time/missed/unread voicemail/meetings) for
134
150
  * the current user.
package/services/voice.js CHANGED
@@ -353,41 +353,29 @@ export class VoiceService {
353
353
  return this.transcribe(voiceChannelId, 'stop', direction);
354
354
  }
355
355
 
356
- async transfer({
357
- channels,
358
- to,
359
- callerIdName,
360
- callerIdNumber,
361
- timeout,
362
- voiceApp,
363
- }) {
356
+ /**
357
+ * Server-side blind transfer of a live call (call-transfer-api-plan.md
358
+ * §2.2/§2.7).
359
+ *
360
+ * @param {Object} params
361
+ * @param {string} params.callId
362
+ * @param {string} params.to - extension, E.164, or a routable service id
363
+ * @returns {Promise<{correlationId: string}>}
364
+ */
365
+ async transferCall({ callId, to }) {
364
366
  this.sdk.validateParams(
365
- { channels },
367
+ { callId, to },
366
368
  {
367
- channels: { type: 'array', required: true },
368
- to: { type: 'string', required: false },
369
- callerIdName: { type: 'string', required: false },
370
- callerIdNumber: { type: 'string', required: false },
371
- timeout: { type: 'number', required: false },
372
- voiceApp: { type: 'object', required: false },
369
+ callId: { type: 'string', required: true },
370
+ to: { type: 'string', required: true },
373
371
  },
374
372
  );
375
373
 
376
- const bodyData = { channels };
377
- if (to) bodyData.to = to;
378
- if (callerIdName) bodyData.callerIdName = callerIdName;
379
- if (callerIdNumber) bodyData.callerIdNumber = callerIdNumber;
380
- if (timeout !== undefined) bodyData.timeout = timeout;
381
- if (voiceApp) bodyData.voiceApp = voiceApp;
382
-
383
- const params = {
384
- body: bodyData,
385
- };
386
-
387
- const result = await internalRequest(this.sdk,
388
- '/voice/calls/transfer',
374
+ const result = await internalRequest(
375
+ this.sdk,
376
+ `/voice/calls/${callId}/transfer`,
389
377
  'POST',
390
- params,
378
+ { body: { to } },
391
379
  );
392
380
  return result;
393
381
  }