@webex/contact-center 3.9.0-next.2 → 3.9.0-next.21

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 (106) hide show
  1. package/dist/cc.js +195 -46
  2. package/dist/cc.js.map +1 -1
  3. package/dist/constants.js +1 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/index.js +9 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/logger-proxy.js +24 -1
  8. package/dist/logger-proxy.js.map +1 -1
  9. package/dist/metrics/MetricsManager.js +1 -1
  10. package/dist/metrics/MetricsManager.js.map +1 -1
  11. package/dist/metrics/behavioral-events.js +89 -0
  12. package/dist/metrics/behavioral-events.js.map +1 -1
  13. package/dist/metrics/constants.js +32 -2
  14. package/dist/metrics/constants.js.map +1 -1
  15. package/dist/services/AddressBook.js +271 -0
  16. package/dist/services/AddressBook.js.map +1 -0
  17. package/dist/services/EntryPoint.js +227 -0
  18. package/dist/services/EntryPoint.js.map +1 -0
  19. package/dist/services/Queue.js +261 -0
  20. package/dist/services/Queue.js.map +1 -0
  21. package/dist/services/config/constants.js +36 -2
  22. package/dist/services/config/constants.js.map +1 -1
  23. package/dist/services/config/index.js +29 -21
  24. package/dist/services/config/index.js.map +1 -1
  25. package/dist/services/config/types.js +33 -1
  26. package/dist/services/config/types.js.map +1 -1
  27. package/dist/services/core/GlobalTypes.js.map +1 -1
  28. package/dist/services/core/Utils.js +162 -2
  29. package/dist/services/core/Utils.js.map +1 -1
  30. package/dist/services/core/aqm-reqs.js +0 -4
  31. package/dist/services/core/aqm-reqs.js.map +1 -1
  32. package/dist/services/core/websocket/WebSocketManager.js +0 -4
  33. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  34. package/dist/services/task/TaskManager.js +74 -2
  35. package/dist/services/task/TaskManager.js.map +1 -1
  36. package/dist/services/task/constants.js +7 -1
  37. package/dist/services/task/constants.js.map +1 -1
  38. package/dist/services/task/contact.js +86 -0
  39. package/dist/services/task/contact.js.map +1 -1
  40. package/dist/services/task/index.js +384 -72
  41. package/dist/services/task/index.js.map +1 -1
  42. package/dist/services/task/types.js +14 -0
  43. package/dist/services/task/types.js.map +1 -1
  44. package/dist/types/cc.d.ts +115 -35
  45. package/dist/types/constants.d.ts +1 -0
  46. package/dist/types/index.d.ts +3 -2
  47. package/dist/types/metrics/constants.d.ts +25 -1
  48. package/dist/types/services/AddressBook.d.ts +74 -0
  49. package/dist/types/services/EntryPoint.d.ts +67 -0
  50. package/dist/types/services/Queue.d.ts +76 -0
  51. package/dist/types/services/config/constants.d.ts +35 -1
  52. package/dist/types/services/config/index.d.ts +6 -9
  53. package/dist/types/services/config/types.d.ts +79 -58
  54. package/dist/types/services/core/GlobalTypes.d.ts +25 -0
  55. package/dist/types/services/core/Utils.d.ts +40 -1
  56. package/dist/types/services/task/constants.d.ts +6 -0
  57. package/dist/types/services/task/contact.d.ts +10 -0
  58. package/dist/types/services/task/index.d.ts +44 -2
  59. package/dist/types/services/task/types.d.ts +125 -1
  60. package/dist/types/types.d.ts +162 -0
  61. package/dist/types/utils/PageCache.d.ts +173 -0
  62. package/dist/types.js +17 -0
  63. package/dist/types.js.map +1 -1
  64. package/dist/utils/PageCache.js +192 -0
  65. package/dist/utils/PageCache.js.map +1 -0
  66. package/dist/webex.js +1 -1
  67. package/package.json +9 -8
  68. package/src/cc.ts +220 -51
  69. package/src/constants.ts +1 -0
  70. package/src/index.ts +16 -2
  71. package/src/logger-proxy.ts +24 -1
  72. package/src/metrics/MetricsManager.ts +1 -1
  73. package/src/metrics/behavioral-events.ts +94 -0
  74. package/src/metrics/constants.ts +37 -1
  75. package/src/services/AddressBook.ts +291 -0
  76. package/src/services/EntryPoint.ts +241 -0
  77. package/src/services/Queue.ts +277 -0
  78. package/src/services/config/constants.ts +42 -2
  79. package/src/services/config/index.ts +30 -30
  80. package/src/services/config/types.ts +59 -58
  81. package/src/services/core/GlobalTypes.ts +27 -0
  82. package/src/services/core/Utils.ts +199 -1
  83. package/src/services/core/aqm-reqs.ts +0 -5
  84. package/src/services/core/websocket/WebSocketManager.ts +0 -4
  85. package/src/services/task/TaskManager.ts +79 -3
  86. package/src/services/task/constants.ts +6 -0
  87. package/src/services/task/contact.ts +80 -0
  88. package/src/services/task/index.ts +457 -57
  89. package/src/services/task/types.ts +135 -0
  90. package/src/types.ts +180 -0
  91. package/src/utils/PageCache.ts +252 -0
  92. package/test/unit/spec/cc.ts +282 -85
  93. package/test/unit/spec/metrics/MetricsManager.ts +0 -1
  94. package/test/unit/spec/metrics/behavioral-events.ts +42 -0
  95. package/test/unit/spec/services/AddressBook.ts +332 -0
  96. package/test/unit/spec/services/EntryPoint.ts +259 -0
  97. package/test/unit/spec/services/Queue.ts +323 -0
  98. package/test/unit/spec/services/config/index.ts +279 -65
  99. package/test/unit/spec/services/core/Utils.ts +50 -0
  100. package/test/unit/spec/services/core/aqm-reqs.ts +1 -3
  101. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +0 -4
  102. package/test/unit/spec/services/task/TaskManager.ts +145 -1
  103. package/test/unit/spec/services/task/contact.ts +31 -1
  104. package/test/unit/spec/services/task/index.ts +410 -123
  105. package/umd/contact-center.min.js +2 -2
  106. package/umd/contact-center.min.js.map +1 -1
@@ -0,0 +1,277 @@
1
+ import {HTTP_METHODS, WebexSDK} from '../types';
2
+ import type {
3
+ ContactServiceQueue,
4
+ ContactServiceQueuesResponse,
5
+ ContactServiceQueueSearchParams,
6
+ } from '../types';
7
+ import LoggerProxy from '../logger-proxy';
8
+ import WebexRequest from './core/WebexRequest';
9
+ import PageCache, {PAGINATION_DEFAULTS} from '../utils/PageCache';
10
+ import MetricsManager from '../metrics/MetricsManager';
11
+ import {WCC_API_GATEWAY} from './constants';
12
+ import {endPointMap} from './config/constants';
13
+ import {METRIC_EVENT_NAMES} from '../metrics/constants';
14
+ import {METHODS} from '../constants';
15
+
16
+ /**
17
+ * Queue API class for managing Webex Contact Center contact service queues.
18
+ * Provides functionality to fetch contact service queues using the queue API.
19
+ *
20
+ * @class Queue
21
+ * @public
22
+ * @example
23
+ * ```typescript
24
+ * import Webex from 'webex';
25
+ *
26
+ * const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
27
+ * const cc = webex.cc;
28
+ *
29
+ * // Register and login first
30
+ * await cc.register();
31
+ * await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
32
+ *
33
+ * // Get Queue API instance from ContactCenter
34
+ * const queueAPI = cc.queue;
35
+ *
36
+ * // Get all queues
37
+ * const queues = await queueAPI.getQueues();
38
+ *
39
+ * // Get queues with pagination
40
+ * const queues = await queueAPI.getQueues({
41
+ * page: 0,
42
+ * pageSize: 50
43
+ * });
44
+ *
45
+ * // Search for specific queues
46
+ * const searchResults = await queueAPI.getQueues({
47
+ * search: 'support',
48
+ * filter: 'name=="Support Queue"'
49
+ * });
50
+ * ```
51
+ */
52
+ export class Queue {
53
+ private webexRequest: WebexRequest;
54
+ private webex: WebexSDK;
55
+ private metricsManager: MetricsManager;
56
+
57
+ // Page cache using the common utility
58
+ private pageCache: PageCache<ContactServiceQueue>;
59
+
60
+ /**
61
+ * Creates an instance of Queue
62
+ * @param {WebexSDK} webex - The Webex SDK instance
63
+ * @public
64
+ */
65
+ constructor(webex: WebexSDK) {
66
+ this.webex = webex;
67
+ this.webexRequest = WebexRequest.getInstance({webex});
68
+ this.pageCache = new PageCache<ContactServiceQueue>('Queue');
69
+ this.metricsManager = MetricsManager.getInstance({webex});
70
+ }
71
+
72
+ /**
73
+ * Fetches contact service queues for the organization
74
+ * @param {ContactServiceQueueSearchParams} [params] - Search and pagination parameters
75
+ * @returns {Promise<ContactServiceQueuesResponse>} Promise resolving to contact service queues
76
+ * @throws {Error} If the API call fails
77
+ * @public
78
+ * @example
79
+ * ```typescript
80
+ * // Get all queues with default pagination
81
+ * const response = await queueAPI.getQueues();
82
+ *
83
+ * // Get queues with specific pagination
84
+ * const response = await queueAPI.getQueues({
85
+ * page: 0,
86
+ * pageSize: 25
87
+ * });
88
+ *
89
+ * // Search for queues
90
+ * const response = await queueAPI.getQueues({
91
+ * search: 'support',
92
+ * filter: 'queueType=="INBOUND"'
93
+ * });
94
+ * ```
95
+ */
96
+ public async getQueues(
97
+ params: ContactServiceQueueSearchParams = {}
98
+ ): Promise<ContactServiceQueuesResponse> {
99
+ const startTime = Date.now();
100
+ const {
101
+ page = PAGINATION_DEFAULTS.PAGE,
102
+ pageSize = PAGINATION_DEFAULTS.PAGE_SIZE,
103
+ search,
104
+ filter,
105
+ attributes,
106
+ sortBy,
107
+ sortOrder,
108
+ desktopProfileFilter,
109
+ provisioningView,
110
+ singleObjectResponse,
111
+ } = params;
112
+
113
+ const orgId = this.webex.credentials.getOrgId();
114
+ const isSearchRequest = !!(search || filter || attributes || sortBy);
115
+
116
+ LoggerProxy.info('Fetching contact service queues', {
117
+ module: 'Queue',
118
+ method: METHODS.GET_QUEUES,
119
+ data: {
120
+ orgId,
121
+ page,
122
+ pageSize,
123
+ isSearchRequest,
124
+ },
125
+ });
126
+
127
+ // Check if we can use cache for simple pagination (no search/filter/attributes/sort)
128
+ if (this.pageCache.canUseCache({search, filter, attributes, sortBy})) {
129
+ const cacheKey = this.pageCache.buildCacheKey(orgId, page, pageSize);
130
+ const cachedPage = this.pageCache.getCachedPage(cacheKey);
131
+
132
+ if (cachedPage) {
133
+ const duration = Date.now() - startTime;
134
+
135
+ LoggerProxy.log(`Returning page ${page} from cache`, {
136
+ module: 'Queue',
137
+ method: 'getQueues',
138
+ data: {
139
+ cacheHit: true,
140
+ duration,
141
+ recordCount: cachedPage.data.length,
142
+ page,
143
+ pageSize,
144
+ },
145
+ });
146
+
147
+ return {
148
+ data: cachedPage.data,
149
+ meta: {
150
+ page,
151
+ pageSize,
152
+ totalPages: cachedPage.totalMeta?.totalPages,
153
+ totalRecords: cachedPage.totalMeta?.totalRecords,
154
+ orgid: orgId,
155
+ },
156
+ };
157
+ }
158
+ }
159
+
160
+ // Start timing only for actual API calls (not cache hits)
161
+ this.metricsManager.timeEvent(METRIC_EVENT_NAMES.QUEUE_FETCH_SUCCESS);
162
+
163
+ try {
164
+ // Build query parameters according to spec
165
+ const queryParams = new URLSearchParams({
166
+ page: page.toString(),
167
+ pageSize: pageSize.toString(),
168
+ });
169
+
170
+ if (filter) queryParams.append('filter', filter);
171
+ if (attributes) queryParams.append('attributes', attributes);
172
+ if (search) queryParams.append('search', search);
173
+ if (sortBy) queryParams.append('sortBy', sortBy);
174
+ if (sortOrder) queryParams.append('sortOrder', sortOrder);
175
+ if (desktopProfileFilter !== undefined)
176
+ queryParams.append('desktopProfileFilter', desktopProfileFilter.toString());
177
+ if (provisioningView !== undefined)
178
+ queryParams.append('provisioningView', provisioningView.toString());
179
+ if (singleObjectResponse !== undefined)
180
+ queryParams.append('singleObjectResponse', singleObjectResponse.toString());
181
+
182
+ const resource = endPointMap.queueList(orgId, queryParams.toString());
183
+
184
+ LoggerProxy.log('Making API request to fetch contact service queues', {
185
+ module: 'Queue',
186
+ method: METHODS.GET_QUEUES,
187
+ data: {
188
+ resource,
189
+ service: WCC_API_GATEWAY,
190
+ },
191
+ });
192
+
193
+ const response = await this.webexRequest.request({
194
+ service: WCC_API_GATEWAY,
195
+ resource,
196
+ method: HTTP_METHODS.GET,
197
+ });
198
+
199
+ const duration = Date.now() - startTime;
200
+
201
+ const recordCount = response.body?.data?.length || 0;
202
+ const totalRecords = response.body?.meta?.totalRecords;
203
+
204
+ LoggerProxy.log(`Successfully retrieved ${recordCount} contact service queues`, {
205
+ module: 'Queue',
206
+ method: METHODS.GET_QUEUES,
207
+ data: {
208
+ statusCode: response.statusCode,
209
+ duration,
210
+ recordCount,
211
+ totalRecords,
212
+ isSearchRequest,
213
+ page,
214
+ pageSize,
215
+ },
216
+ });
217
+
218
+ // Only track metrics for search requests or first page loads to reduce metric volume
219
+ if (isSearchRequest || page === 0) {
220
+ this.metricsManager.trackEvent(
221
+ METRIC_EVENT_NAMES.QUEUE_FETCH_SUCCESS,
222
+ {
223
+ orgId,
224
+ statusCode: response.statusCode,
225
+ recordCount,
226
+ totalRecords,
227
+ isSearchRequest,
228
+ isFirstPage: page === 0,
229
+ },
230
+ ['behavioral', 'operational']
231
+ );
232
+ }
233
+
234
+ // Cache the page data for simple pagination (no search/filter/attributes/sort)
235
+ if (this.pageCache.canUseCache({search, filter, attributes, sortBy}) && response.body?.data) {
236
+ const cacheKey = this.pageCache.buildCacheKey(orgId, page, pageSize);
237
+ this.pageCache.cachePage(cacheKey, response.body.data, response.body.meta);
238
+
239
+ LoggerProxy.log('Cached contact service queues for future requests', {
240
+ module: 'Queue',
241
+ method: METHODS.GET_QUEUES,
242
+ data: {
243
+ cacheKey,
244
+ recordCount,
245
+ },
246
+ });
247
+ }
248
+
249
+ return response.body;
250
+ } catch (error) {
251
+ const errorData = {
252
+ orgId,
253
+ error: error instanceof Error ? error.message : String(error),
254
+ isSearchRequest,
255
+ page,
256
+ pageSize,
257
+ };
258
+
259
+ LoggerProxy.error('Failed to fetch contact service queues', {
260
+ module: 'Queue',
261
+ method: METHODS.GET_QUEUES,
262
+ data: errorData,
263
+ error,
264
+ });
265
+
266
+ // Track all failures for troubleshooting
267
+ this.metricsManager.trackEvent(METRIC_EVENT_NAMES.QUEUE_FETCH_FAILED, errorData, [
268
+ 'behavioral',
269
+ 'operational',
270
+ ]);
271
+
272
+ throw error;
273
+ }
274
+ }
275
+ }
276
+
277
+ export default Queue;
@@ -67,7 +67,6 @@ export const METHODS = {
67
67
  GET_TENANT_DATA: 'getTenantData',
68
68
  GET_URL_MAPPING: 'getURLMapping',
69
69
  GET_DIAL_PLAN_DATA: 'getDialPlanData',
70
- GET_QUEUES: 'getQueues',
71
70
 
72
71
  // Util methods
73
72
  PARSE_AGENT_CONFIGS: 'parseAgentConfigs',
@@ -245,5 +244,46 @@ export const endPointMap = {
245
244
  * @ignore
246
245
  */
247
246
  queueList: (orgId: string, queryParams: string) =>
248
- `organization/${orgId}/v2/contact-service-queue?${queryParams}`,
247
+ `/organization/${orgId}/v2/contact-service-queue?${queryParams}`,
248
+ /**
249
+ * Gets the endpoint for entry points list with custom query parameters.
250
+ * @param orgId - Organization ID.
251
+ * @param queryParams - Query parameters string.
252
+ * @returns The endpoint URL string.
253
+ * @public
254
+ * @example
255
+ * const url = endPointMap.entryPointList('org123', 'page=0&pageSize=10');
256
+ * @ignore
257
+ */
258
+ entryPointList: (orgId: string, queryParams: string) =>
259
+ `/organization/${orgId}/v2/entry-point?${queryParams}`,
260
+ /**
261
+ * Gets the endpoint for address book entries with custom query parameters.
262
+ * @param orgId - Organization ID.
263
+ * @param addressBookId - Address book ID.
264
+ * @param queryParams - Query parameters string.
265
+ * @returns The endpoint URL string.
266
+ * @public
267
+ * @example
268
+ * const url = endPointMap.addressBookEntries('org123', 'book456', 'page=0&pageSize=10');
269
+ * @ignore
270
+ */
271
+ addressBookEntries: (orgId: string, addressBookId: string, queryParams: string) =>
272
+ `/organization/${orgId}/v2/address-book/${addressBookId}/entry?${queryParams}`,
273
+
274
+ /**
275
+ * Gets the endpoint for outdial ANI entries with custom query parameters.
276
+ * @param orgId - Organization ID.
277
+ * @param outdialANI - Outdial ANI ID.
278
+ * @param queryParams - Query parameters string.
279
+ * @returns The endpoint URL string.
280
+ * @public
281
+ * @example
282
+ * const url = endPointMap.outdialAniEntries('org123', 'ani456', 'page=0&pageSize=10');
283
+ * @ignore
284
+ */
285
+ outdialAniEntries: (orgId: string, outdialANI: string, queryParams: string) =>
286
+ `organization/${orgId}/v2/outdial-ani/${outdialANI}/entry${
287
+ queryParams ? `?${queryParams}` : ''
288
+ }`,
249
289
  };
@@ -9,9 +9,9 @@ import {
9
9
  DesktopProfileResponse,
10
10
  ListAuxCodesResponse,
11
11
  AgentResponse,
12
+ TenantData,
12
13
  OrgInfo,
13
14
  OrgSettings,
14
- TenantData,
15
15
  URLMapping,
16
16
  TeamList,
17
17
  DialPlanEntity,
@@ -20,11 +20,12 @@ import {
20
20
  AuxCode,
21
21
  MultimediaProfileResponse,
22
22
  SiteInfo,
23
- ContactServiceQueue,
23
+ OutdialAniEntriesResponse,
24
+ OutdialAniParams,
24
25
  } from './types';
25
26
  import WebexRequest from '../core/WebexRequest';
26
27
  import {WCC_API_GATEWAY} from '../constants';
27
- import {CONFIG_FILE_NAME} from '../../constants';
28
+ import {CONFIG_FILE_NAME, METHODS as MAIN_METHODS} from '../../constants';
28
29
  import {parseAgentConfigs} from './Util';
29
30
  import {
30
31
  DEFAULT_AUXCODE_ATTRIBUTES,
@@ -686,56 +687,55 @@ export default class AgentConfigService {
686
687
  }
687
688
  }
688
689
 
690
+ // getQueues removed - use Queue instead
691
+
689
692
  /**
690
- * Fetches the list of queues for the given orgId.
693
+ * Fetches outdial ANI (Automatic Number Identification) entries for the given orgId and outdial ANI ID.
691
694
  * @ignore
692
- * @param {string} orgId - organization ID for which the queues are to be fetched.
693
- * @param {number} page - the page number to fetch.
694
- * @param {number} pageSize - the number of queues to fetch per page.
695
- * @param {string} search - optional search string
696
- * @param {string} filter - optional filter string
697
- * @returns Promise<ContactServiceQueue[]> - A promise that resolves to the list of contact service queues.
695
+ * @param {string} orgId - organization ID for which the outdial ANI entries are to be fetched.
696
+ * @param {OutdialAniParams} params - parameters object containing outdialANI and optional pagination/filtering options
697
+ * @returns {Promise<OutdialAniEntriesResponse>} - A promise that resolves to the outdial ANI entries response.
698
698
  * @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
699
699
  * @private
700
700
  */
701
- public async getQueues(
701
+ public async getOutdialAniEntries(
702
702
  orgId: string,
703
- page: number,
704
- pageSize: number,
705
- search?: string,
706
- filter?: string
707
- ): Promise<ContactServiceQueue[]> {
708
- LoggerProxy.info('Fetching queue list', {
703
+ params: OutdialAniParams
704
+ ): Promise<OutdialAniEntriesResponse> {
705
+ const {outdialANI, page, pageSize, search, filter, attributes} = params;
706
+
707
+ LoggerProxy.info('Fetching outdial ANI entries', {
709
708
  module: CONFIG_FILE_NAME,
710
- method: METHODS.GET_QUEUES,
709
+ method: MAIN_METHODS.GET_OUTDIAL_ANI_ENTRIES,
711
710
  });
712
711
 
713
712
  try {
714
- let queryParams = `page=${page}&pageSize=${pageSize}&desktopProfileFilter=true`;
715
- if (search) queryParams += `&search=${search}`;
716
- if (filter) queryParams += `&filter=${filter}`;
713
+ const queryParams = [];
714
+ if (page !== undefined) queryParams.push(`page=${page}`);
715
+ if (pageSize !== undefined) queryParams.push(`pageSize=${pageSize}`);
716
+ if (search) queryParams.push(`search=${search}`);
717
+ if (filter) queryParams.push(`filter=${filter}`);
718
+ if (attributes) queryParams.push(`attributes=${attributes}`);
719
+
720
+ const queryString = queryParams.length > 0 ? queryParams.join('&') : '';
721
+ const resource = endPointMap.outdialAniEntries(orgId, outdialANI, queryString);
717
722
 
718
- const resource = endPointMap.queueList(orgId, queryParams);
719
723
  const response = await this.webexReq.request({
720
724
  service: WCC_API_GATEWAY,
721
725
  resource,
722
726
  method: HTTP_METHODS.GET,
723
727
  });
724
728
 
725
- if (response.statusCode !== 200) {
726
- throw new Error(`API call failed with ${response.statusCode}`);
727
- }
728
-
729
- LoggerProxy.log('getQueues API success.', {
729
+ LoggerProxy.log('getOutdialAniEntries API success.', {
730
730
  module: CONFIG_FILE_NAME,
731
- method: METHODS.GET_QUEUES,
731
+ method: MAIN_METHODS.GET_OUTDIAL_ANI_ENTRIES,
732
732
  });
733
733
 
734
734
  return response.body?.data;
735
735
  } catch (error) {
736
- LoggerProxy.error(`getQueues API call failed with ${error}`, {
736
+ LoggerProxy.error(`getOutdialAniEntries API call failed with ${error}`, {
737
737
  module: CONFIG_FILE_NAME,
738
- method: METHODS.GET_QUEUES,
738
+ method: MAIN_METHODS.GET_OUTDIAL_ANI_ENTRIES,
739
739
  });
740
740
  throw error;
741
741
  }
@@ -45,6 +45,28 @@ export const CC_TASK_EVENTS = {
45
45
  AGENT_CONSULT_END_FAILED: 'AgentConsultEndFailed',
46
46
  /** Event emitted when consultation conference ends */
47
47
  AGENT_CONSULT_CONFERENCE_ENDED: 'AgentConsultConferenceEnded',
48
+ /** Event emitted when consultation conference is in progress */
49
+ AGENT_CONSULT_CONFERENCING: 'AgentConsultConferencing',
50
+ /** Event emitted when consultation conference starts */
51
+ AGENT_CONSULT_CONFERENCED: 'AgentConsultConferenced',
52
+ /** Event emitted when consultation conference fails */
53
+ AGENT_CONSULT_CONFERENCE_FAILED: 'AgentConsultConferenceFailed',
54
+ /** Event emitted when participant joins conference */
55
+ PARTICIPANT_JOINED_CONFERENCE: 'ParticipantJoinedConference',
56
+ /** Event emitted when participant leaves conference */
57
+ PARTICIPANT_LEFT_CONFERENCE: 'ParticipantLeftConference',
58
+ /** Event emitted when participant leaving conference fails */
59
+ PARTICIPANT_LEFT_CONFERENCE_FAILED: 'ParticipantLeftConferenceFailed',
60
+ /** Event emitted when consultation conference end fails */
61
+ AGENT_CONSULT_CONFERENCE_END_FAILED: 'AgentConsultConferenceEndFailed',
62
+ /** Event emitted when conference is successfully transferred */
63
+ AGENT_CONFERENCE_TRANSFERRED: 'AgentConferenceTransferred',
64
+ /** Event emitted when conference transfer fails */
65
+ AGENT_CONFERENCE_TRANSFER_FAILED: 'AgentConferenceTransferFailed',
66
+ /** Event emitted when consulted participant is moving/being transferred */
67
+ CONSULTED_PARTICIPANT_MOVING: 'ConsultedParticipantMoving',
68
+ /** Event emitted for post-call activity by participant */
69
+ PARTICIPANT_POST_CALL_ACTIVITY: 'ParticipantPostCallActivity',
48
70
  /** Event emitted when contact is blind transferred */
49
71
  AGENT_BLIND_TRANSFERRED: 'AgentBlindTransferred',
50
72
  /** Event emitted when blind transfer fails */
@@ -1052,66 +1074,45 @@ export type CallDistributionGroup = {
1052
1074
  };
1053
1075
 
1054
1076
  /**
1055
- * Comprehensive configuration for a contact service queue
1077
+ * Represents a single outdial ANI (Automatic Number Identification) entry
1056
1078
  * @public
1057
1079
  */
1058
- export type ContactServiceQueue = {
1059
- /** Unique identifier for the queue */
1080
+ export type OutdialAniEntry = {
1081
+ /** Unique identifier for the ANI entry */
1060
1082
  id: string;
1061
- /** Queue name */
1083
+ /** Display name for the ANI entry */
1062
1084
  name: string;
1063
- /** Queue description */
1064
- description: string;
1065
- /** Type of queue */
1066
- queueType: string;
1067
- /** Whether to check agent availability before routing */
1068
- checkAgentAvailability: boolean;
1069
- /** Type of channel this queue handles */
1070
- channelType: string;
1071
- /** Service level threshold in seconds */
1072
- serviceLevelThreshold: number;
1073
- /** Maximum number of active contacts allowed */
1074
- maxActiveContacts: number;
1075
- /** Maximum time contacts can wait in queue (seconds) */
1076
- maxTimeInQueue: number;
1077
- /** Default music on hold media file ID */
1078
- defaultMusicInQueueMediaFileId: string;
1079
- /** Queue timezone */
1080
- timezone: string;
1081
- /** Whether queue is active */
1082
- active: boolean;
1083
- /** Whether outbound campaign routing is enabled */
1084
- outdialCampaignEnabled: boolean;
1085
- /** Whether monitoring is permitted */
1086
- monitoringPermitted: boolean;
1087
- /** Whether parking is permitted */
1088
- parkingPermitted: boolean;
1089
- /** Whether recording is permitted */
1090
- recordingPermitted: boolean;
1091
- /** Whether recording all calls is permitted */
1092
- recordingAllCallsPermitted: boolean;
1093
- /** Whether pausing recordings is permitted */
1094
- pauseRecordingPermitted: boolean;
1095
- /** Maximum recording pause duration in seconds */
1096
- recordingPauseDuration: number;
1097
- /** Control flow script URL */
1098
- controlFlowScriptUrl: string;
1099
- /** IVR requeue URL */
1100
- ivrRequeueUrl: string;
1101
- /** Type of routing strategy */
1102
- routingType: string;
1103
- /** Queue-specific routing type */
1104
- queueRoutingType: string;
1105
- /** Queue skill requirements for routing */
1106
- queueSkillRequirements: object[];
1107
- /** Associated agents */
1108
- agents: object[];
1109
- /** Call distribution group configurations */
1110
- callDistributionGroups: CallDistributionGroup[];
1111
- /** Associated resource links */
1112
- links: Array<string>;
1113
- /** Timestamp when queue was created */
1114
- createdTime: string;
1115
- /** Timestamp when queue was last updated */
1116
- lastUpdatedTime: string;
1085
+ /** Phone number associated with this ANI entry */
1086
+ number: string;
1087
+ /** Related links for this ANI entry */
1088
+ links: string[];
1089
+ /** Timestamp when this entry was created (Unix timestamp in milliseconds) */
1090
+ createdTime: number;
1091
+ /** Timestamp when this entry was last updated (Unix timestamp in milliseconds) */
1092
+ lastUpdatedTime: number;
1093
+ };
1094
+
1095
+ /**
1096
+ * Response structure for outdial ANI entries API call
1097
+ * @public
1098
+ */
1099
+ export type OutdialAniEntriesResponse = OutdialAniEntry[];
1100
+
1101
+ /**
1102
+ * Parameters for fetching outdial ANI entries
1103
+ * @public
1104
+ */
1105
+ export type OutdialAniParams = {
1106
+ /** Outdial ANI ID from agent profile */
1107
+ outdialANI: string;
1108
+ /** Page number for pagination (optional) */
1109
+ page?: number;
1110
+ /** Number of entries per page (optional) */
1111
+ pageSize?: number;
1112
+ /** Search string to filter entries (optional) */
1113
+ search?: string;
1114
+ /** Filter expression for advanced filtering (optional) */
1115
+ filter?: string;
1116
+ /** Comma-separated list of attributes to include in response (optional) */
1117
+ attributes?: string;
1117
1118
  };
@@ -32,3 +32,30 @@ export type Failure = Msg<{
32
32
  /** Human-readable description of the failure reason */
33
33
  reason: string;
34
34
  }>;
35
+
36
+ /**
37
+ * Represents task API error details in a structured format
38
+ * @public
39
+ */
40
+ export interface TaskError {
41
+ /** Original error object for throwing */
42
+ error: Error;
43
+ /** Unique tracking identifier for correlation */
44
+ trackingId: string;
45
+ /** Detailed error message from the API */
46
+ errorMessage: string;
47
+ /** Type/category of the error (e.g., "Bad Request") */
48
+ errorType: string;
49
+ /** Additional error context data */
50
+ errorData: string;
51
+ /** Numeric reason code */
52
+ reasonCode: number;
53
+ }
54
+
55
+ /**
56
+ * An Error object augmented with a flexible data field for additional context.
57
+ * Use this to attach structured data to thrown errors without ts-ignore.
58
+ */
59
+ export interface AugmentedError extends Error {
60
+ data?: Record<string, any>;
61
+ }