@webex/contact-center 3.8.1 → 3.9.0-next.10
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 +105 -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 +51 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +12 -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 +0 -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 +121 -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 +1 -0
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/index.js +145 -71
- package/dist/services/task/index.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 +7 -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 +0 -64
- package/dist/types/services/core/GlobalTypes.d.ts +25 -0
- package/dist/types/services/core/Utils.d.ts +27 -1
- package/dist/types/services/task/index.d.ts +1 -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 +121 -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 +54 -0
- package/src/metrics/constants.ts +15 -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 +0 -65
- package/src/services/core/GlobalTypes.ts +27 -0
- package/src/services/core/Utils.ts +155 -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 +1 -0
- package/src/services/task/index.ts +172 -56
- package/src/types.ts +180 -0
- package/src/utils/PageCache.ts +252 -0
- package/test/unit/spec/cc.ts +30 -82
- package/test/unit/spec/metrics/MetricsManager.ts +0 -1
- package/test/unit/spec/metrics/behavioral-events.ts +14 -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 +8 -1
- package/test/unit/spec/services/task/index.ts +226 -122
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { WebexSDK } from '../types';
|
|
2
|
+
import type { AddressBookEntriesResponse, AddressBookEntrySearchParams } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* AddressBook API class for managing Webex Contact Center address book entries.
|
|
5
|
+
* Provides functionality to fetch address book entries using the entry API.
|
|
6
|
+
*
|
|
7
|
+
* @class AddressBook
|
|
8
|
+
* @public
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Webex from 'webex';
|
|
12
|
+
*
|
|
13
|
+
* const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
|
|
14
|
+
* const cc = webex.cc;
|
|
15
|
+
*
|
|
16
|
+
* // Register and login first
|
|
17
|
+
* await cc.register();
|
|
18
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
19
|
+
*
|
|
20
|
+
* // Get AddressBook API instance from ContactCenter
|
|
21
|
+
* const addressBookAPI = cc.addressBook;
|
|
22
|
+
*
|
|
23
|
+
* // Get entries from agent's default address book
|
|
24
|
+
* const entries = await addressBookAPI.getEntries();
|
|
25
|
+
*
|
|
26
|
+
* // Get entries from a specific address book with pagination
|
|
27
|
+
* const entries = await addressBookAPI.getEntries({
|
|
28
|
+
* addressBookId: 'addressBookId123',
|
|
29
|
+
* page: 0,
|
|
30
|
+
* pageSize: 50
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Search for specific entries
|
|
34
|
+
* const searchResults = await addressBook.getEntries({
|
|
35
|
+
* search: 'john',
|
|
36
|
+
* filter: 'name=="John Doe"'
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class AddressBook {
|
|
41
|
+
private webexRequest;
|
|
42
|
+
private webex;
|
|
43
|
+
private getAddressBookId;
|
|
44
|
+
private metricsManager;
|
|
45
|
+
private pageCache;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an instance of AddressBook
|
|
48
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
49
|
+
* @param {() => string} getAddressBookId - Function to get the addressBookId from agent profile
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
constructor(webex: WebexSDK, getAddressBookId: () => string);
|
|
53
|
+
/**
|
|
54
|
+
* Fetches address book entries for a specific address book using the entry API
|
|
55
|
+
* @param {AddressBookEntrySearchParams} [params] - Search and pagination parameters including addressBookId
|
|
56
|
+
* @returns {Promise<AddressBookEntriesResponse>} Promise resolving to address book entries
|
|
57
|
+
* @throws {Error} If the API call fails
|
|
58
|
+
* @public
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* // Get entries from agent's default address book
|
|
62
|
+
* const response = await addressBookAPI.getEntries();
|
|
63
|
+
*
|
|
64
|
+
* // Get entries from a specific address book with pagination
|
|
65
|
+
* const response = await addressBookAPI.getEntries({
|
|
66
|
+
* addressBookId: 'addressBookId123',
|
|
67
|
+
* page: 0,
|
|
68
|
+
* pageSize: 25
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
getEntries(params?: AddressBookEntrySearchParams): Promise<AddressBookEntriesResponse>;
|
|
73
|
+
}
|
|
74
|
+
export default AddressBook;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { WebexSDK } from '../types';
|
|
2
|
+
import type { EntryPointListResponse, EntryPointSearchParams } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* EntryPoint class for managing Webex Contact Center entry points.
|
|
5
|
+
* Provides functionality to fetch, search, and paginate through entry points.
|
|
6
|
+
*
|
|
7
|
+
* @class EntryPoint
|
|
8
|
+
* @public
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Webex from 'webex';
|
|
12
|
+
*
|
|
13
|
+
* const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
|
|
14
|
+
* const cc = webex.cc;
|
|
15
|
+
*
|
|
16
|
+
* // Register and login first
|
|
17
|
+
* await cc.register();
|
|
18
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
19
|
+
*
|
|
20
|
+
* // Get EntryPoint API instance from ContactCenter
|
|
21
|
+
* const entryPointAPI = cc.entryPoint;
|
|
22
|
+
*
|
|
23
|
+
* // Get all entry points with pagination
|
|
24
|
+
* const response = await entryPointAPI.getEntryPoints({
|
|
25
|
+
* page: 0,
|
|
26
|
+
* pageSize: 50
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Search for specific entry points
|
|
30
|
+
* const searchResults = await entryPointAPI.searchEntryPoints({
|
|
31
|
+
* search: 'support',
|
|
32
|
+
* filter: 'type=="voice"'
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class EntryPoint {
|
|
37
|
+
private webexRequest;
|
|
38
|
+
private webex;
|
|
39
|
+
private metricsManager;
|
|
40
|
+
private pageCache;
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of EntryPoint
|
|
43
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
constructor(webex: WebexSDK);
|
|
47
|
+
/**
|
|
48
|
+
* Fetches entry points for the organization with pagination support
|
|
49
|
+
* @param {EntryPointSearchParams} [params] - Search and pagination parameters
|
|
50
|
+
* @returns {Promise<EntryPointListResponse>} Promise resolving to paginated entry points
|
|
51
|
+
* @throws {Error} If the API call fails
|
|
52
|
+
* @public
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Get first page of entry points
|
|
56
|
+
* const response = await entryPointAPI.getEntryPoints();
|
|
57
|
+
*
|
|
58
|
+
* // Get specific page with custom page size
|
|
59
|
+
* const response = await entryPointAPI.getEntryPoints({
|
|
60
|
+
* page: 2,
|
|
61
|
+
* pageSize: 25
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
getEntryPoints(params?: EntryPointSearchParams): Promise<EntryPointListResponse>;
|
|
66
|
+
}
|
|
67
|
+
export default EntryPoint;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { WebexSDK } from '../types';
|
|
2
|
+
import type { ContactServiceQueuesResponse, ContactServiceQueueSearchParams } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Queue API class for managing Webex Contact Center contact service queues.
|
|
5
|
+
* Provides functionality to fetch contact service queues using the queue API.
|
|
6
|
+
*
|
|
7
|
+
* @class Queue
|
|
8
|
+
* @public
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Webex from 'webex';
|
|
12
|
+
*
|
|
13
|
+
* const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
|
|
14
|
+
* const cc = webex.cc;
|
|
15
|
+
*
|
|
16
|
+
* // Register and login first
|
|
17
|
+
* await cc.register();
|
|
18
|
+
* await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });
|
|
19
|
+
*
|
|
20
|
+
* // Get Queue API instance from ContactCenter
|
|
21
|
+
* const queueAPI = cc.queue;
|
|
22
|
+
*
|
|
23
|
+
* // Get all queues
|
|
24
|
+
* const queues = await queueAPI.getQueues();
|
|
25
|
+
*
|
|
26
|
+
* // Get queues with pagination
|
|
27
|
+
* const queues = await queueAPI.getQueues({
|
|
28
|
+
* page: 0,
|
|
29
|
+
* pageSize: 50
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Search for specific queues
|
|
33
|
+
* const searchResults = await queueAPI.getQueues({
|
|
34
|
+
* search: 'support',
|
|
35
|
+
* filter: 'name=="Support Queue"'
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class Queue {
|
|
40
|
+
private webexRequest;
|
|
41
|
+
private webex;
|
|
42
|
+
private metricsManager;
|
|
43
|
+
private pageCache;
|
|
44
|
+
/**
|
|
45
|
+
* Creates an instance of Queue
|
|
46
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
constructor(webex: WebexSDK);
|
|
50
|
+
/**
|
|
51
|
+
* Fetches contact service queues for the organization
|
|
52
|
+
* @param {ContactServiceQueueSearchParams} [params] - Search and pagination parameters
|
|
53
|
+
* @returns {Promise<ContactServiceQueuesResponse>} Promise resolving to contact service queues
|
|
54
|
+
* @throws {Error} If the API call fails
|
|
55
|
+
* @public
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* // Get all queues with default pagination
|
|
59
|
+
* const response = await queueAPI.getQueues();
|
|
60
|
+
*
|
|
61
|
+
* // Get queues with specific pagination
|
|
62
|
+
* const response = await queueAPI.getQueues({
|
|
63
|
+
* page: 0,
|
|
64
|
+
* pageSize: 25
|
|
65
|
+
* });
|
|
66
|
+
*
|
|
67
|
+
* // Search for queues
|
|
68
|
+
* const response = await queueAPI.getQueues({
|
|
69
|
+
* search: 'support',
|
|
70
|
+
* filter: 'queueType=="INBOUND"'
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
getQueues(params?: ContactServiceQueueSearchParams): Promise<ContactServiceQueuesResponse>;
|
|
75
|
+
}
|
|
76
|
+
export default Queue;
|
|
@@ -51,7 +51,6 @@ export declare const METHODS: {
|
|
|
51
51
|
GET_TENANT_DATA: string;
|
|
52
52
|
GET_URL_MAPPING: string;
|
|
53
53
|
GET_DIAL_PLAN_DATA: string;
|
|
54
|
-
GET_QUEUES: string;
|
|
55
54
|
PARSE_AGENT_CONFIGS: string;
|
|
56
55
|
GET_URL_MAPPING_UTIL: string;
|
|
57
56
|
GET_MSFT_CONFIG: string;
|
|
@@ -200,4 +199,27 @@ export declare const endPointMap: {
|
|
|
200
199
|
* @ignore
|
|
201
200
|
*/
|
|
202
201
|
queueList: (orgId: string, queryParams: string) => string;
|
|
202
|
+
/**
|
|
203
|
+
* Gets the endpoint for entry points list with custom query parameters.
|
|
204
|
+
* @param orgId - Organization ID.
|
|
205
|
+
* @param queryParams - Query parameters string.
|
|
206
|
+
* @returns The endpoint URL string.
|
|
207
|
+
* @public
|
|
208
|
+
* @example
|
|
209
|
+
* const url = endPointMap.entryPointList('org123', 'page=0&pageSize=10');
|
|
210
|
+
* @ignore
|
|
211
|
+
*/
|
|
212
|
+
entryPointList: (orgId: string, queryParams: string) => string;
|
|
213
|
+
/**
|
|
214
|
+
* Gets the endpoint for address book entries with custom query parameters.
|
|
215
|
+
* @param orgId - Organization ID.
|
|
216
|
+
* @param addressBookId - Address book ID.
|
|
217
|
+
* @param queryParams - Query parameters string.
|
|
218
|
+
* @returns The endpoint URL string.
|
|
219
|
+
* @public
|
|
220
|
+
* @example
|
|
221
|
+
* const url = endPointMap.addressBookEntries('org123', 'book456', 'page=0&pageSize=10');
|
|
222
|
+
* @ignore
|
|
223
|
+
*/
|
|
224
|
+
addressBookEntries: (orgId: string, addressBookId: string, queryParams: string) => string;
|
|
203
225
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* @module AgentConfigService
|
|
4
4
|
*/
|
|
5
|
-
import { DesktopProfileResponse, ListAuxCodesResponse, AgentResponse, OrgInfo, OrgSettings, TenantData, URLMapping, TeamList, DialPlanEntity, Profile, ListTeamsResponse, AuxCode, MultimediaProfileResponse, SiteInfo
|
|
5
|
+
import { DesktopProfileResponse, ListAuxCodesResponse, AgentResponse, OrgInfo, OrgSettings, TenantData, URLMapping, TeamList, DialPlanEntity, Profile, ListTeamsResponse, AuxCode, MultimediaProfileResponse, SiteInfo } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* The AgentConfigService class provides methods to fetch agent configuration data.
|
|
8
8
|
* @private
|
|
@@ -155,17 +155,4 @@ export default class AgentConfigService {
|
|
|
155
155
|
* @private
|
|
156
156
|
*/
|
|
157
157
|
getDialPlanData(orgId: string): Promise<DialPlanEntity[]>;
|
|
158
|
-
/**
|
|
159
|
-
* Fetches the list of queues for the given orgId.
|
|
160
|
-
* @ignore
|
|
161
|
-
* @param {string} orgId - organization ID for which the queues are to be fetched.
|
|
162
|
-
* @param {number} page - the page number to fetch.
|
|
163
|
-
* @param {number} pageSize - the number of queues to fetch per page.
|
|
164
|
-
* @param {string} search - optional search string
|
|
165
|
-
* @param {string} filter - optional filter string
|
|
166
|
-
* @returns Promise<ContactServiceQueue[]> - A promise that resolves to the list of contact service queues.
|
|
167
|
-
* @throws {Error} - Throws an error if the API call fails or if the response status is not 200.
|
|
168
|
-
* @private
|
|
169
|
-
*/
|
|
170
|
-
getQueues(orgId: string, page: number, pageSize: number, search?: string, filter?: string): Promise<ContactServiceQueue[]>;
|
|
171
158
|
}
|
|
@@ -1047,67 +1047,3 @@ export type CallDistributionGroup = {
|
|
|
1047
1047
|
/** Distribution time duration in seconds */
|
|
1048
1048
|
duration: number;
|
|
1049
1049
|
};
|
|
1050
|
-
/**
|
|
1051
|
-
* Comprehensive configuration for a contact service queue
|
|
1052
|
-
* @public
|
|
1053
|
-
*/
|
|
1054
|
-
export type ContactServiceQueue = {
|
|
1055
|
-
/** Unique identifier for the queue */
|
|
1056
|
-
id: string;
|
|
1057
|
-
/** Queue name */
|
|
1058
|
-
name: string;
|
|
1059
|
-
/** Queue description */
|
|
1060
|
-
description: string;
|
|
1061
|
-
/** Type of queue */
|
|
1062
|
-
queueType: string;
|
|
1063
|
-
/** Whether to check agent availability before routing */
|
|
1064
|
-
checkAgentAvailability: boolean;
|
|
1065
|
-
/** Type of channel this queue handles */
|
|
1066
|
-
channelType: string;
|
|
1067
|
-
/** Service level threshold in seconds */
|
|
1068
|
-
serviceLevelThreshold: number;
|
|
1069
|
-
/** Maximum number of active contacts allowed */
|
|
1070
|
-
maxActiveContacts: number;
|
|
1071
|
-
/** Maximum time contacts can wait in queue (seconds) */
|
|
1072
|
-
maxTimeInQueue: number;
|
|
1073
|
-
/** Default music on hold media file ID */
|
|
1074
|
-
defaultMusicInQueueMediaFileId: string;
|
|
1075
|
-
/** Queue timezone */
|
|
1076
|
-
timezone: string;
|
|
1077
|
-
/** Whether queue is active */
|
|
1078
|
-
active: boolean;
|
|
1079
|
-
/** Whether outbound campaign routing is enabled */
|
|
1080
|
-
outdialCampaignEnabled: boolean;
|
|
1081
|
-
/** Whether monitoring is permitted */
|
|
1082
|
-
monitoringPermitted: boolean;
|
|
1083
|
-
/** Whether parking is permitted */
|
|
1084
|
-
parkingPermitted: boolean;
|
|
1085
|
-
/** Whether recording is permitted */
|
|
1086
|
-
recordingPermitted: boolean;
|
|
1087
|
-
/** Whether recording all calls is permitted */
|
|
1088
|
-
recordingAllCallsPermitted: boolean;
|
|
1089
|
-
/** Whether pausing recordings is permitted */
|
|
1090
|
-
pauseRecordingPermitted: boolean;
|
|
1091
|
-
/** Maximum recording pause duration in seconds */
|
|
1092
|
-
recordingPauseDuration: number;
|
|
1093
|
-
/** Control flow script URL */
|
|
1094
|
-
controlFlowScriptUrl: string;
|
|
1095
|
-
/** IVR requeue URL */
|
|
1096
|
-
ivrRequeueUrl: string;
|
|
1097
|
-
/** Type of routing strategy */
|
|
1098
|
-
routingType: string;
|
|
1099
|
-
/** Queue-specific routing type */
|
|
1100
|
-
queueRoutingType: string;
|
|
1101
|
-
/** Queue skill requirements for routing */
|
|
1102
|
-
queueSkillRequirements: object[];
|
|
1103
|
-
/** Associated agents */
|
|
1104
|
-
agents: object[];
|
|
1105
|
-
/** Call distribution group configurations */
|
|
1106
|
-
callDistributionGroups: CallDistributionGroup[];
|
|
1107
|
-
/** Associated resource links */
|
|
1108
|
-
links: Array<string>;
|
|
1109
|
-
/** Timestamp when queue was created */
|
|
1110
|
-
createdTime: string;
|
|
1111
|
-
/** Timestamp when queue was last updated */
|
|
1112
|
-
lastUpdatedTime: string;
|
|
1113
|
-
};
|
|
@@ -31,3 +31,28 @@ export type Failure = Msg<{
|
|
|
31
31
|
/** Human-readable description of the failure reason */
|
|
32
32
|
reason: string;
|
|
33
33
|
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Represents task API error details in a structured format
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export interface TaskError {
|
|
39
|
+
/** Original error object for throwing */
|
|
40
|
+
error: Error;
|
|
41
|
+
/** Unique tracking identifier for correlation */
|
|
42
|
+
trackingId: string;
|
|
43
|
+
/** Detailed error message from the API */
|
|
44
|
+
errorMessage: string;
|
|
45
|
+
/** Type/category of the error (e.g., "Bad Request") */
|
|
46
|
+
errorType: string;
|
|
47
|
+
/** Additional error context data */
|
|
48
|
+
errorData: string;
|
|
49
|
+
/** Numeric reason code */
|
|
50
|
+
reasonCode: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* An Error object augmented with a flexible data field for additional context.
|
|
54
|
+
* Use this to attach structured data to thrown errors without ts-ignore.
|
|
55
|
+
*/
|
|
56
|
+
export interface AugmentedError extends Error {
|
|
57
|
+
data?: Record<string, any>;
|
|
58
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Err from './Err';
|
|
2
2
|
import { LoginOption, WebexRequestPayload } from '../../types';
|
|
3
|
-
import { Failure } from './GlobalTypes';
|
|
3
|
+
import { Failure, AugmentedError } from './GlobalTypes';
|
|
4
|
+
import { TaskData, ConsultTransferPayLoad, Interaction } from '../task/types';
|
|
4
5
|
export declare const isValidDialNumber: (input: string) => boolean;
|
|
5
6
|
export declare const getStationLoginErrorData: (failure: Failure, loginOption: LoginOption) => {
|
|
6
7
|
message: any;
|
|
@@ -23,6 +24,21 @@ export declare const getErrorDetails: (error: any, methodName: string, moduleNam
|
|
|
23
24
|
error: Error;
|
|
24
25
|
reason: string;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Extracts error details from task API errors and logs them. Also uploads logs for the error.
|
|
29
|
+
* This handles the specific error format returned by task API calls.
|
|
30
|
+
*
|
|
31
|
+
* @param error - The error object from task API calls with structure: {id: string, details: {trackingId: string, msg: {...}}}
|
|
32
|
+
* @param methodName - The name of the method where the error occurred.
|
|
33
|
+
* @param moduleName - The name of the module where the error occurred.
|
|
34
|
+
* @returns AugmentedError containing structured error details on err.data for metrics and logging
|
|
35
|
+
* @public
|
|
36
|
+
* @example
|
|
37
|
+
* const taskError = generateTaskErrorObject(error, 'transfer', 'TaskModule');
|
|
38
|
+
* throw taskError.error;
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
export declare const generateTaskErrorObject: (error: any, methodName: string, moduleName: string) => AugmentedError;
|
|
26
42
|
/**
|
|
27
43
|
* Creates an error details object suitable for use with the Err.Details class.
|
|
28
44
|
*
|
|
@@ -34,3 +50,13 @@ export declare const getErrorDetails: (error: any, methodName: string, moduleNam
|
|
|
34
50
|
* @ignore
|
|
35
51
|
*/
|
|
36
52
|
export declare const createErrDetailsObject: (errObj: WebexRequestPayload) => Err.Details<"Service.reqs.generic.failure">;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the destination agent ID from participants data by finding the first
|
|
55
|
+
* non-customer participant that is not the current agent and is not in wrap-up state.
|
|
56
|
+
*
|
|
57
|
+
* @param participants - The participants data from the interaction
|
|
58
|
+
* @param agentId - The current agent's ID to exclude from the search
|
|
59
|
+
* @returns The destination agent ID, or empty string if none found
|
|
60
|
+
*/
|
|
61
|
+
export declare const getDestinationAgentId: (participants: Interaction['participants'], agentId: string) => string;
|
|
62
|
+
export declare const deriveConsultTransferDestinationType: (taskData?: TaskData) => ConsultTransferPayLoad['destinationType'];
|
|
@@ -565,5 +565,5 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
565
565
|
* .catch(error => console.error('Failed to complete queue consultation transfer:', error));
|
|
566
566
|
* ```
|
|
567
567
|
*/
|
|
568
|
-
consultTransfer(consultTransferPayload
|
|
568
|
+
consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
|
|
569
569
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CallingClientConfig } from '@webex/calling';
|
|
2
2
|
import * as Agent from './services/agent/types';
|
|
3
3
|
import { Profile } from './services/config/types';
|
|
4
|
+
import { PaginatedResponse, BaseSearchParams } from './utils/PageCache';
|
|
4
5
|
/**
|
|
5
6
|
* HTTP methods supported by WebexRequest.
|
|
6
7
|
* @enum {string}
|
|
@@ -140,6 +141,10 @@ export interface LogContext {
|
|
|
140
141
|
method?: string;
|
|
141
142
|
interactionId?: string;
|
|
142
143
|
trackingId?: string;
|
|
144
|
+
/** Additional structured data to include in logs */
|
|
145
|
+
data?: Record<string, any>;
|
|
146
|
+
/** Error object to include in logs */
|
|
147
|
+
error?: Error | unknown;
|
|
143
148
|
}
|
|
144
149
|
/**
|
|
145
150
|
* Available logging severity levels.
|
|
@@ -434,6 +439,163 @@ export type StationReLoginResponse = Agent.ReloginSuccess | Error;
|
|
|
434
439
|
* @ignore
|
|
435
440
|
*/
|
|
436
441
|
export type SetStateResponse = Agent.StateChangeSuccess | Error;
|
|
442
|
+
/**
|
|
443
|
+
* AddressBook types
|
|
444
|
+
*/
|
|
445
|
+
export interface AddressBookEntry {
|
|
446
|
+
id: string;
|
|
447
|
+
organizationId?: string;
|
|
448
|
+
version?: number;
|
|
449
|
+
name: string;
|
|
450
|
+
number: string;
|
|
451
|
+
createdTime?: number;
|
|
452
|
+
lastUpdatedTime?: number;
|
|
453
|
+
}
|
|
454
|
+
export type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;
|
|
455
|
+
export interface AddressBookEntrySearchParams extends BaseSearchParams {
|
|
456
|
+
addressBookId?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* EntryPointRecord types
|
|
460
|
+
*/
|
|
461
|
+
export interface EntryPointRecord {
|
|
462
|
+
id: string;
|
|
463
|
+
name: string;
|
|
464
|
+
description?: string;
|
|
465
|
+
type: string;
|
|
466
|
+
isActive: boolean;
|
|
467
|
+
orgId: string;
|
|
468
|
+
createdAt?: string;
|
|
469
|
+
updatedAt?: string;
|
|
470
|
+
settings?: Record<string, any>;
|
|
471
|
+
}
|
|
472
|
+
export type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;
|
|
473
|
+
export type EntryPointSearchParams = BaseSearchParams;
|
|
474
|
+
/**
|
|
475
|
+
* Queue types
|
|
476
|
+
*/
|
|
477
|
+
export interface QueueSkillRequirement {
|
|
478
|
+
organizationId?: string;
|
|
479
|
+
id?: string;
|
|
480
|
+
version?: number;
|
|
481
|
+
skillId: string;
|
|
482
|
+
skillName?: string;
|
|
483
|
+
skillType?: string;
|
|
484
|
+
condition: string;
|
|
485
|
+
skillValue: string;
|
|
486
|
+
createdTime?: number;
|
|
487
|
+
lastUpdatedTime?: number;
|
|
488
|
+
}
|
|
489
|
+
export interface QueueAgent {
|
|
490
|
+
id: string;
|
|
491
|
+
ciUserId?: string;
|
|
492
|
+
}
|
|
493
|
+
export interface AgentGroup {
|
|
494
|
+
teamId: string;
|
|
495
|
+
}
|
|
496
|
+
export interface CallDistributionGroup {
|
|
497
|
+
agentGroups: AgentGroup[];
|
|
498
|
+
order: number;
|
|
499
|
+
duration?: number;
|
|
500
|
+
}
|
|
501
|
+
export interface AssistantSkillMapping {
|
|
502
|
+
assistantSkillId?: string;
|
|
503
|
+
assistantSkillUpdatedTime?: number;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Configuration for a contact service queue
|
|
507
|
+
* @public
|
|
508
|
+
*/
|
|
509
|
+
export interface ContactServiceQueue {
|
|
510
|
+
/** Organization ID */
|
|
511
|
+
organizationId?: string;
|
|
512
|
+
/** Unique identifier for the queue */
|
|
513
|
+
id?: string;
|
|
514
|
+
/** Version of the queue */
|
|
515
|
+
version?: number;
|
|
516
|
+
/** Name of the Contact Service Queue */
|
|
517
|
+
name: string;
|
|
518
|
+
/** Description of the queue */
|
|
519
|
+
description?: string;
|
|
520
|
+
/** Queue type (INBOUND, OUTBOUND) */
|
|
521
|
+
queueType: 'INBOUND' | 'OUTBOUND';
|
|
522
|
+
/** Whether to check agent availability */
|
|
523
|
+
checkAgentAvailability: boolean;
|
|
524
|
+
/** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */
|
|
525
|
+
channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';
|
|
526
|
+
/** Social channel type for SOCIAL_CHANNEL channelType */
|
|
527
|
+
socialChannelType?: 'MESSAGEBIRD' | 'MESSENGER' | 'WHATSAPP' | 'APPLE_BUSINESS_CHAT' | 'GOOGLE_BUSINESS_MESSAGES';
|
|
528
|
+
/** Service level threshold in seconds */
|
|
529
|
+
serviceLevelThreshold: number;
|
|
530
|
+
/** Maximum number of simultaneous contacts */
|
|
531
|
+
maxActiveContacts: number;
|
|
532
|
+
/** Maximum time in queue in seconds */
|
|
533
|
+
maxTimeInQueue: number;
|
|
534
|
+
/** Default music in queue media file ID */
|
|
535
|
+
defaultMusicInQueueMediaFileId: string;
|
|
536
|
+
/** Timezone for routing strategies */
|
|
537
|
+
timezone?: string;
|
|
538
|
+
/** Whether the queue is active */
|
|
539
|
+
active: boolean;
|
|
540
|
+
/** Whether outdial campaign is enabled */
|
|
541
|
+
outdialCampaignEnabled?: boolean;
|
|
542
|
+
/** Whether monitoring is permitted */
|
|
543
|
+
monitoringPermitted: boolean;
|
|
544
|
+
/** Whether parking is permitted */
|
|
545
|
+
parkingPermitted: boolean;
|
|
546
|
+
/** Whether recording is permitted */
|
|
547
|
+
recordingPermitted: boolean;
|
|
548
|
+
/** Whether recording all calls is permitted */
|
|
549
|
+
recordingAllCallsPermitted: boolean;
|
|
550
|
+
/** Whether pausing recording is permitted */
|
|
551
|
+
pauseRecordingPermitted: boolean;
|
|
552
|
+
/** Recording pause duration in seconds */
|
|
553
|
+
recordingPauseDuration?: number;
|
|
554
|
+
/** Control flow script URL */
|
|
555
|
+
controlFlowScriptUrl: string;
|
|
556
|
+
/** IVR requeue URL */
|
|
557
|
+
ivrRequeueUrl: string;
|
|
558
|
+
/** Overflow number for telephony */
|
|
559
|
+
overflowNumber?: string;
|
|
560
|
+
/** Vendor ID */
|
|
561
|
+
vendorId?: string;
|
|
562
|
+
/** Routing type */
|
|
563
|
+
routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';
|
|
564
|
+
/** Skills-based routing type */
|
|
565
|
+
skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';
|
|
566
|
+
/** Queue routing type */
|
|
567
|
+
queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';
|
|
568
|
+
/** Queue skill requirements */
|
|
569
|
+
queueSkillRequirements?: QueueSkillRequirement[];
|
|
570
|
+
/** List of agents for agent-based queue */
|
|
571
|
+
agents?: QueueAgent[];
|
|
572
|
+
/** Call distribution groups */
|
|
573
|
+
callDistributionGroups: CallDistributionGroup[];
|
|
574
|
+
/** XSP version */
|
|
575
|
+
xspVersion?: string;
|
|
576
|
+
/** Subscription ID */
|
|
577
|
+
subscriptionId?: string;
|
|
578
|
+
/** Assistant skill mapping */
|
|
579
|
+
assistantSkill?: AssistantSkillMapping;
|
|
580
|
+
/** Whether this is a system default queue */
|
|
581
|
+
systemDefault?: boolean;
|
|
582
|
+
/** User who last updated agents list */
|
|
583
|
+
agentsLastUpdatedByUserName?: string;
|
|
584
|
+
/** Email of user who last updated agents list */
|
|
585
|
+
agentsLastUpdatedByUserEmailPrefix?: string;
|
|
586
|
+
/** When agents list was last updated */
|
|
587
|
+
agentsLastUpdatedTime?: number;
|
|
588
|
+
/** Creation timestamp in epoch millis */
|
|
589
|
+
createdTime?: number;
|
|
590
|
+
/** Last updated timestamp in epoch millis */
|
|
591
|
+
lastUpdatedTime?: number;
|
|
592
|
+
}
|
|
593
|
+
export type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;
|
|
594
|
+
export interface ContactServiceQueueSearchParams extends BaseSearchParams {
|
|
595
|
+
desktopProfileFilter?: boolean;
|
|
596
|
+
provisioningView?: boolean;
|
|
597
|
+
singleObjectResponse?: boolean;
|
|
598
|
+
}
|
|
437
599
|
/**
|
|
438
600
|
* Response type for buddy agents query operations.
|
|
439
601
|
* Either a success response with list of buddy agents or an error.
|