@webex/contact-center 3.8.1 → 3.9.0-multipleLLM.2
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
|
@@ -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
|
}
|
|
@@ -38,6 +38,28 @@ export declare const CC_TASK_EVENTS: {
|
|
|
38
38
|
readonly AGENT_CONSULT_END_FAILED: "AgentConsultEndFailed";
|
|
39
39
|
/** Event emitted when consultation conference ends */
|
|
40
40
|
readonly AGENT_CONSULT_CONFERENCE_ENDED: "AgentConsultConferenceEnded";
|
|
41
|
+
/** Event emitted when consultation conference is in progress */
|
|
42
|
+
readonly AGENT_CONSULT_CONFERENCING: "AgentConsultConferencing";
|
|
43
|
+
/** Event emitted when consultation conference starts */
|
|
44
|
+
readonly AGENT_CONSULT_CONFERENCED: "AgentConsultConferenced";
|
|
45
|
+
/** Event emitted when consultation conference fails */
|
|
46
|
+
readonly AGENT_CONSULT_CONFERENCE_FAILED: "AgentConsultConferenceFailed";
|
|
47
|
+
/** Event emitted when participant joins conference */
|
|
48
|
+
readonly PARTICIPANT_JOINED_CONFERENCE: "ParticipantJoinedConference";
|
|
49
|
+
/** Event emitted when participant leaves conference */
|
|
50
|
+
readonly PARTICIPANT_LEFT_CONFERENCE: "ParticipantLeftConference";
|
|
51
|
+
/** Event emitted when participant leaving conference fails */
|
|
52
|
+
readonly PARTICIPANT_LEFT_CONFERENCE_FAILED: "ParticipantLeftConferenceFailed";
|
|
53
|
+
/** Event emitted when consultation conference end fails */
|
|
54
|
+
readonly AGENT_CONSULT_CONFERENCE_END_FAILED: "AgentConsultConferenceEndFailed";
|
|
55
|
+
/** Event emitted when conference is successfully transferred */
|
|
56
|
+
readonly AGENT_CONFERENCE_TRANSFERRED: "AgentConferenceTransferred";
|
|
57
|
+
/** Event emitted when conference transfer fails */
|
|
58
|
+
readonly AGENT_CONFERENCE_TRANSFER_FAILED: "AgentConferenceTransferFailed";
|
|
59
|
+
/** Event emitted when consulted participant is moving/being transferred */
|
|
60
|
+
readonly CONSULTED_PARTICIPANT_MOVING: "ConsultedParticipantMoving";
|
|
61
|
+
/** Event emitted for post-call activity by participant */
|
|
62
|
+
readonly PARTICIPANT_POST_CALL_ACTIVITY: "ParticipantPostCallActivity";
|
|
41
63
|
/** Event emitted when contact is blind transferred */
|
|
42
64
|
readonly AGENT_BLIND_TRANSFERRED: "AgentBlindTransferred";
|
|
43
65
|
/** Event emitted when blind transfer fails */
|
|
@@ -165,6 +187,28 @@ export declare const CC_EVENTS: {
|
|
|
165
187
|
readonly AGENT_CONSULT_END_FAILED: "AgentConsultEndFailed";
|
|
166
188
|
/** Event emitted when consultation conference ends */
|
|
167
189
|
readonly AGENT_CONSULT_CONFERENCE_ENDED: "AgentConsultConferenceEnded";
|
|
190
|
+
/** Event emitted when consultation conference is in progress */
|
|
191
|
+
readonly AGENT_CONSULT_CONFERENCING: "AgentConsultConferencing";
|
|
192
|
+
/** Event emitted when consultation conference starts */
|
|
193
|
+
readonly AGENT_CONSULT_CONFERENCED: "AgentConsultConferenced";
|
|
194
|
+
/** Event emitted when consultation conference fails */
|
|
195
|
+
readonly AGENT_CONSULT_CONFERENCE_FAILED: "AgentConsultConferenceFailed";
|
|
196
|
+
/** Event emitted when participant joins conference */
|
|
197
|
+
readonly PARTICIPANT_JOINED_CONFERENCE: "ParticipantJoinedConference";
|
|
198
|
+
/** Event emitted when participant leaves conference */
|
|
199
|
+
readonly PARTICIPANT_LEFT_CONFERENCE: "ParticipantLeftConference";
|
|
200
|
+
/** Event emitted when participant leaving conference fails */
|
|
201
|
+
readonly PARTICIPANT_LEFT_CONFERENCE_FAILED: "ParticipantLeftConferenceFailed";
|
|
202
|
+
/** Event emitted when consultation conference end fails */
|
|
203
|
+
readonly AGENT_CONSULT_CONFERENCE_END_FAILED: "AgentConsultConferenceEndFailed";
|
|
204
|
+
/** Event emitted when conference is successfully transferred */
|
|
205
|
+
readonly AGENT_CONFERENCE_TRANSFERRED: "AgentConferenceTransferred";
|
|
206
|
+
/** Event emitted when conference transfer fails */
|
|
207
|
+
readonly AGENT_CONFERENCE_TRANSFER_FAILED: "AgentConferenceTransferFailed";
|
|
208
|
+
/** Event emitted when consulted participant is moving/being transferred */
|
|
209
|
+
readonly CONSULTED_PARTICIPANT_MOVING: "ConsultedParticipantMoving";
|
|
210
|
+
/** Event emitted for post-call activity by participant */
|
|
211
|
+
readonly PARTICIPANT_POST_CALL_ACTIVITY: "ParticipantPostCallActivity";
|
|
168
212
|
/** Event emitted when contact is blind transferred */
|
|
169
213
|
readonly AGENT_BLIND_TRANSFERRED: "AgentBlindTransferred";
|
|
170
214
|
/** Event emitted when blind transfer fails */
|
|
@@ -1047,67 +1091,3 @@ export type CallDistributionGroup = {
|
|
|
1047
1091
|
/** Distribution time duration in seconds */
|
|
1048
1092
|
duration: number;
|
|
1049
1093
|
};
|
|
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, ConsultConferenceData, consultConferencePayloadData, 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,26 @@ 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'];
|
|
63
|
+
/**
|
|
64
|
+
* Builds consult conference parameter data using EXACT Agent Desktop logic.
|
|
65
|
+
* This matches the Agent Desktop's consultConference implementation exactly.
|
|
66
|
+
*
|
|
67
|
+
* @param dataPassed - Original consultation data from Agent Desktop format
|
|
68
|
+
* @param interactionIdPassed - The interaction ID for the task
|
|
69
|
+
* @returns Object with interactionId and ConsultConferenceData matching Agent Desktop format
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
export declare const buildConsultConferenceParamData: (dataPassed: consultConferencePayloadData, interactionIdPassed: string) => {
|
|
73
|
+
interactionId: string;
|
|
74
|
+
data: ConsultConferenceData;
|
|
75
|
+
};
|
|
@@ -16,6 +16,9 @@ export declare const PAUSE = "/record/pause";
|
|
|
16
16
|
export declare const RESUME = "/record/resume";
|
|
17
17
|
export declare const WRAPUP = "/wrapup";
|
|
18
18
|
export declare const END = "/end";
|
|
19
|
+
export declare const CONSULT_CONFERENCE = "/consult/conference";
|
|
20
|
+
export declare const CONFERENCE_EXIT = "/conference/exit";
|
|
21
|
+
export declare const CONFERENCE_TRANSFER = "/conference/transfer";
|
|
19
22
|
export declare const TASK_MANAGER_FILE = "taskManager";
|
|
20
23
|
export declare const TASK_FILE = "task";
|
|
21
24
|
export declare const METHODS: {
|
|
@@ -32,6 +35,9 @@ export declare const METHODS: {
|
|
|
32
35
|
END_CONSULT: string;
|
|
33
36
|
TRANSFER: string;
|
|
34
37
|
CONSULT_TRANSFER: string;
|
|
38
|
+
CONSULT_CONFERENCE: string;
|
|
39
|
+
EXIT_CONFERENCE: string;
|
|
40
|
+
TRANSFER_CONFERENCE: string;
|
|
35
41
|
UPDATE_TASK_DATA: string;
|
|
36
42
|
RECONCILE_DATA: string;
|
|
37
43
|
HANDLE_INCOMING_WEB_CALL: string;
|
|
@@ -56,4 +56,14 @@ export default function routingContact(aqm: AqmReqs): {
|
|
|
56
56
|
interactionId: string;
|
|
57
57
|
data: Contact.cancelCtq;
|
|
58
58
|
}>;
|
|
59
|
+
consultConference: import("../core/types").Res<Contact.AgentContact, {
|
|
60
|
+
interactionId: string;
|
|
61
|
+
data: Contact.ConsultConferenceData;
|
|
62
|
+
}>;
|
|
63
|
+
exitConference: import("../core/types").Res<Contact.AgentContact, {
|
|
64
|
+
interactionId: string;
|
|
65
|
+
}>;
|
|
66
|
+
conferenceTransfer: import("../core/types").Res<Contact.AgentContact, {
|
|
67
|
+
interactionId: string;
|
|
68
|
+
}>;
|
|
59
69
|
};
|
|
@@ -110,6 +110,7 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
110
110
|
webCallMap: Record<TaskId, CallId>;
|
|
111
111
|
private wrapupData;
|
|
112
112
|
autoWrapup?: AutoWrapup;
|
|
113
|
+
private agentId;
|
|
113
114
|
/**
|
|
114
115
|
* Creates a new Task instance which provides the following features:
|
|
115
116
|
* @param contact - The routing contact service instance
|
|
@@ -117,7 +118,7 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
117
118
|
* @param data - Initial task data
|
|
118
119
|
* @param wrapupData - Wrap-up configuration data
|
|
119
120
|
*/
|
|
120
|
-
constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, wrapupData: WrapupData);
|
|
121
|
+
constructor(contact: ReturnType<typeof routingContact>, webCallingService: WebCallingService, data: TaskData, wrapupData: WrapupData, agentId: string);
|
|
121
122
|
/**
|
|
122
123
|
* Sets up the automatic wrap-up timer if wrap-up is required
|
|
123
124
|
* @private
|
|
@@ -565,5 +566,46 @@ export default class Task extends EventEmitter implements ITask {
|
|
|
565
566
|
* .catch(error => console.error('Failed to complete queue consultation transfer:', error));
|
|
566
567
|
* ```
|
|
567
568
|
*/
|
|
568
|
-
consultTransfer(consultTransferPayload
|
|
569
|
+
consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
|
|
570
|
+
/**
|
|
571
|
+
* Starts a consultation conference by merging the consultation call with the main call
|
|
572
|
+
*
|
|
573
|
+
* Creates a three-way conference between the agent, customer, and consulted party
|
|
574
|
+
* Extracts required consultation data from the current task data
|
|
575
|
+
* On success, emits a `task:conferenceStarted` event
|
|
576
|
+
*
|
|
577
|
+
* @returns Promise<TaskResponse> - Response from the consultation conference API
|
|
578
|
+
* @throws Error if the operation fails or if consultation data is invalid
|
|
579
|
+
*
|
|
580
|
+
* @example
|
|
581
|
+
* ```typescript
|
|
582
|
+
* try {
|
|
583
|
+
* await task.consultConference();
|
|
584
|
+
* console.log('Conference started successfully');
|
|
585
|
+
* } catch (error) {
|
|
586
|
+
* console.error('Failed to start conference:', error);
|
|
587
|
+
* }
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
consultConference(): Promise<TaskResponse>;
|
|
591
|
+
/**
|
|
592
|
+
* Exits the current conference by removing the agent from the conference call
|
|
593
|
+
*
|
|
594
|
+
* Exits the agent from the conference, leaving the customer and consulted party connected
|
|
595
|
+
* On success, emits a `task:conferenceEnded` event
|
|
596
|
+
*
|
|
597
|
+
* @returns Promise<TaskResponse> - Response from the conference exit API
|
|
598
|
+
* @throws Error if the operation fails or if no active conference exists
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```typescript
|
|
602
|
+
* try {
|
|
603
|
+
* await task.exitConference();
|
|
604
|
+
* console.log('Successfully exited conference');
|
|
605
|
+
* } catch (error) {
|
|
606
|
+
* console.error('Failed to exit conference:', error);
|
|
607
|
+
* }
|
|
608
|
+
* ```
|
|
609
|
+
*/
|
|
610
|
+
exitConference(): Promise<TaskResponse>;
|
|
569
611
|
}
|
|
@@ -334,7 +334,117 @@ export declare enum TASK_EVENTS {
|
|
|
334
334
|
* });
|
|
335
335
|
* ```
|
|
336
336
|
*/
|
|
337
|
-
TASK_OFFER_CONTACT = "task:offerContact"
|
|
337
|
+
TASK_OFFER_CONTACT = "task:offerContact",
|
|
338
|
+
/**
|
|
339
|
+
* Triggered when a conference is being established
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {
|
|
343
|
+
* console.log('Conference establishing:', task.data.interactionId);
|
|
344
|
+
* // Handle conference setup in progress
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
|
|
349
|
+
/**
|
|
350
|
+
* Triggered when a conference is started successfully
|
|
351
|
+
* @example
|
|
352
|
+
* ```typescript
|
|
353
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {
|
|
354
|
+
* console.log('Conference started:', task.data.interactionId);
|
|
355
|
+
* // Handle conference start
|
|
356
|
+
* });
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
TASK_CONFERENCE_STARTED = "task:conferenceStarted",
|
|
360
|
+
/**
|
|
361
|
+
* Triggered when a conference fails to start
|
|
362
|
+
* @example
|
|
363
|
+
* ```typescript
|
|
364
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {
|
|
365
|
+
* console.log('Conference failed:', task.data.interactionId);
|
|
366
|
+
* // Handle conference failure
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
TASK_CONFERENCE_FAILED = "task:conferenceFailed",
|
|
371
|
+
/**
|
|
372
|
+
* Triggered when a conference is ended successfully
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {
|
|
376
|
+
* console.log('Conference ended:', task.data.interactionId);
|
|
377
|
+
* // Handle conference end
|
|
378
|
+
* });
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
TASK_CONFERENCE_ENDED = "task:conferenceEnded",
|
|
382
|
+
/**
|
|
383
|
+
* Triggered when a participant joins the conference
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {
|
|
387
|
+
* console.log('Participant joined conference:', task.data.interactionId);
|
|
388
|
+
* // Handle participant joining
|
|
389
|
+
* });
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
TASK_PARTICIPANT_JOINED = "task:participantJoined",
|
|
393
|
+
/**
|
|
394
|
+
* Triggered when a participant leaves the conference
|
|
395
|
+
* @example
|
|
396
|
+
* ```typescript
|
|
397
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {
|
|
398
|
+
* console.log('Participant left conference:', task.data.interactionId);
|
|
399
|
+
* // Handle participant leaving
|
|
400
|
+
* });
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
TASK_PARTICIPANT_LEFT = "task:participantLeft",
|
|
404
|
+
/**
|
|
405
|
+
* Triggered when conference transfer is successful
|
|
406
|
+
* @example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {
|
|
409
|
+
* console.log('Conference transferred:', task.data.interactionId);
|
|
410
|
+
* // Handle successful conference transfer
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
|
|
415
|
+
/**
|
|
416
|
+
* Triggered when conference transfer fails
|
|
417
|
+
* @example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {
|
|
420
|
+
* console.log('Conference transfer failed:', task.data.interactionId);
|
|
421
|
+
* // Handle failed conference transfer
|
|
422
|
+
* });
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
|
|
426
|
+
/**
|
|
427
|
+
* Triggered when ending a conference fails
|
|
428
|
+
* @example
|
|
429
|
+
* ```typescript
|
|
430
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {
|
|
431
|
+
* console.log('Conference end failed:', task.data.interactionId);
|
|
432
|
+
* // Handle failed conference end
|
|
433
|
+
* });
|
|
434
|
+
* ```
|
|
435
|
+
*/
|
|
436
|
+
TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
|
|
437
|
+
/**
|
|
438
|
+
* Triggered when participant exit from conference fails
|
|
439
|
+
* @example
|
|
440
|
+
* ```typescript
|
|
441
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {
|
|
442
|
+
* console.log('Participant failed to leave conference:', task.data.interactionId);
|
|
443
|
+
* // Handle failed participant exit
|
|
444
|
+
* });
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed"
|
|
338
448
|
}
|
|
339
449
|
/**
|
|
340
450
|
* Represents a customer interaction within the contact center system
|
|
@@ -828,6 +938,18 @@ export type ConsultConferenceData = {
|
|
|
828
938
|
/** Type of destination (e.g., 'agent', 'queue') */
|
|
829
939
|
destinationType: string;
|
|
830
940
|
};
|
|
941
|
+
/**
|
|
942
|
+
* Legacy consultation conference data type matching Agent Desktop
|
|
943
|
+
* @public
|
|
944
|
+
*/
|
|
945
|
+
export type consultConferencePayloadData = {
|
|
946
|
+
/** Identifier of the agent initiating consult/conference */
|
|
947
|
+
agentId: string;
|
|
948
|
+
/** Type of destination (e.g., 'agent', 'queue') */
|
|
949
|
+
destinationType: string;
|
|
950
|
+
/** Identifier of the destination agent */
|
|
951
|
+
destAgentId: string;
|
|
952
|
+
};
|
|
831
953
|
/**
|
|
832
954
|
* Parameters required for cancelling a consult to queue operation
|
|
833
955
|
* @public
|