@webex/contact-center 3.8.1 → 3.9.0-multipleLLM.1
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/dist/cc.js +106 -63
- package/dist/cc.js.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/logger-proxy.js +24 -1
- package/dist/logger-proxy.js.map +1 -1
- package/dist/metrics/MetricsManager.js +1 -1
- package/dist/metrics/MetricsManager.js.map +1 -1
- package/dist/metrics/behavioral-events.js +88 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +26 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +271 -0
- package/dist/services/AddressBook.js.map +1 -0
- package/dist/services/EntryPoint.js +227 -0
- package/dist/services/EntryPoint.js.map +1 -0
- package/dist/services/Queue.js +261 -0
- package/dist/services/Queue.js.map +1 -0
- package/dist/services/config/constants.js +24 -2
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +1 -43
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +22 -5
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/GlobalTypes.js.map +1 -1
- package/dist/services/core/Utils.js +162 -2
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/core/aqm-reqs.js +0 -4
- package/dist/services/core/aqm-reqs.js.map +1 -1
- package/dist/services/core/websocket/WebSocketManager.js +0 -4
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
- package/dist/services/task/TaskManager.js +74 -2
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/constants.js +7 -1
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +86 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/index.js +384 -72
- package/dist/services/task/index.js.map +1 -1
- package/dist/services/task/types.js +14 -0
- package/dist/services/task/types.js.map +1 -1
- package/dist/types/cc.d.ts +77 -43
- package/dist/types/index.d.ts +8 -3
- package/dist/types/metrics/constants.d.ts +20 -0
- package/dist/types/services/AddressBook.d.ts +74 -0
- package/dist/types/services/EntryPoint.d.ts +67 -0
- package/dist/types/services/Queue.d.ts +76 -0
- package/dist/types/services/config/constants.d.ts +23 -1
- package/dist/types/services/config/index.d.ts +1 -14
- package/dist/types/services/config/types.d.ts +44 -64
- package/dist/types/services/core/GlobalTypes.d.ts +25 -0
- package/dist/types/services/core/Utils.d.ts +40 -1
- package/dist/types/services/task/constants.d.ts +6 -0
- package/dist/types/services/task/contact.d.ts +10 -0
- package/dist/types/services/task/index.d.ts +44 -2
- package/dist/types/services/task/types.d.ts +123 -1
- package/dist/types/types.d.ts +162 -0
- package/dist/types/utils/PageCache.d.ts +173 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +192 -0
- package/dist/utils/PageCache.js.map +1 -0
- package/dist/webex.js +1 -1
- package/package.json +10 -10
- package/src/cc.ts +122 -81
- package/src/index.ts +19 -3
- package/src/logger-proxy.ts +24 -1
- package/src/metrics/MetricsManager.ts +1 -1
- package/src/metrics/behavioral-events.ts +92 -0
- package/src/metrics/constants.ts +30 -0
- package/src/services/AddressBook.ts +291 -0
- package/src/services/EntryPoint.ts +241 -0
- package/src/services/Queue.ts +277 -0
- package/src/services/config/constants.ts +26 -2
- package/src/services/config/index.ts +1 -55
- package/src/services/config/types.ts +22 -65
- package/src/services/core/GlobalTypes.ts +27 -0
- package/src/services/core/Utils.ts +199 -1
- package/src/services/core/aqm-reqs.ts +0 -5
- package/src/services/core/websocket/WebSocketManager.ts +0 -4
- package/src/services/task/TaskManager.ts +79 -3
- package/src/services/task/constants.ts +6 -0
- package/src/services/task/contact.ts +80 -0
- package/src/services/task/index.ts +457 -57
- package/src/services/task/types.ts +133 -0
- package/src/types.ts +180 -0
- package/src/utils/PageCache.ts +252 -0
- package/test/unit/spec/cc.ts +31 -82
- package/test/unit/spec/metrics/MetricsManager.ts +0 -1
- package/test/unit/spec/metrics/behavioral-events.ts +56 -0
- package/test/unit/spec/services/AddressBook.ts +332 -0
- package/test/unit/spec/services/EntryPoint.ts +259 -0
- package/test/unit/spec/services/Queue.ts +323 -0
- package/test/unit/spec/services/config/index.ts +0 -71
- package/test/unit/spec/services/core/Utils.ts +50 -0
- package/test/unit/spec/services/core/aqm-reqs.ts +1 -3
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +0 -4
- package/test/unit/spec/services/task/TaskManager.ts +145 -1
- package/test/unit/spec/services/task/contact.ts +31 -1
- package/test/unit/spec/services/task/index.ts +410 -123
- package/umd/contact-center.min.js +2 -2
- 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,30 @@ export const endPointMap = {
|
|
|
245
244
|
* @ignore
|
|
246
245
|
*/
|
|
247
246
|
queueList: (orgId: string, queryParams: string) =>
|
|
248
|
-
|
|
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}`,
|
|
249
273
|
};
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
AuxCode,
|
|
21
21
|
MultimediaProfileResponse,
|
|
22
22
|
SiteInfo,
|
|
23
|
-
ContactServiceQueue,
|
|
24
23
|
} from './types';
|
|
25
24
|
import WebexRequest from '../core/WebexRequest';
|
|
26
25
|
import {WCC_API_GATEWAY} from '../constants';
|
|
@@ -686,58 +685,5 @@ export default class AgentConfigService {
|
|
|
686
685
|
}
|
|
687
686
|
}
|
|
688
687
|
|
|
689
|
-
|
|
690
|
-
* Fetches the list of queues for the given orgId.
|
|
691
|
-
* @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.
|
|
698
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
699
|
-
* @private
|
|
700
|
-
*/
|
|
701
|
-
public async getQueues(
|
|
702
|
-
orgId: string,
|
|
703
|
-
page: number,
|
|
704
|
-
pageSize: number,
|
|
705
|
-
search?: string,
|
|
706
|
-
filter?: string
|
|
707
|
-
): Promise<ContactServiceQueue[]> {
|
|
708
|
-
LoggerProxy.info('Fetching queue list', {
|
|
709
|
-
module: CONFIG_FILE_NAME,
|
|
710
|
-
method: METHODS.GET_QUEUES,
|
|
711
|
-
});
|
|
712
|
-
|
|
713
|
-
try {
|
|
714
|
-
let queryParams = `page=${page}&pageSize=${pageSize}&desktopProfileFilter=true`;
|
|
715
|
-
if (search) queryParams += `&search=${search}`;
|
|
716
|
-
if (filter) queryParams += `&filter=${filter}`;
|
|
717
|
-
|
|
718
|
-
const resource = endPointMap.queueList(orgId, queryParams);
|
|
719
|
-
const response = await this.webexReq.request({
|
|
720
|
-
service: WCC_API_GATEWAY,
|
|
721
|
-
resource,
|
|
722
|
-
method: HTTP_METHODS.GET,
|
|
723
|
-
});
|
|
724
|
-
|
|
725
|
-
if (response.statusCode !== 200) {
|
|
726
|
-
throw new Error(`API call failed with ${response.statusCode}`);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
LoggerProxy.log('getQueues API success.', {
|
|
730
|
-
module: CONFIG_FILE_NAME,
|
|
731
|
-
method: METHODS.GET_QUEUES,
|
|
732
|
-
});
|
|
733
|
-
|
|
734
|
-
return response.body?.data;
|
|
735
|
-
} catch (error) {
|
|
736
|
-
LoggerProxy.error(`getQueues API call failed with ${error}`, {
|
|
737
|
-
module: CONFIG_FILE_NAME,
|
|
738
|
-
method: METHODS.GET_QUEUES,
|
|
739
|
-
});
|
|
740
|
-
throw error;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
688
|
+
// getQueues removed - use Queue instead
|
|
743
689
|
}
|
|
@@ -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 */
|
|
@@ -1050,68 +1072,3 @@ export type CallDistributionGroup = {
|
|
|
1050
1072
|
/** Distribution time duration in seconds */
|
|
1051
1073
|
duration: number;
|
|
1052
1074
|
};
|
|
1053
|
-
|
|
1054
|
-
/**
|
|
1055
|
-
* Comprehensive configuration for a contact service queue
|
|
1056
|
-
* @public
|
|
1057
|
-
*/
|
|
1058
|
-
export type ContactServiceQueue = {
|
|
1059
|
-
/** Unique identifier for the queue */
|
|
1060
|
-
id: string;
|
|
1061
|
-
/** Queue name */
|
|
1062
|
-
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;
|
|
1117
|
-
};
|
|
@@ -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
|
+
}
|