@webex/contact-center 0.0.0-next.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/README.md +81 -0
- package/__mocks__/workerMock.js +15 -0
- package/babel.config.js +15 -0
- package/dist/cc.js +1416 -0
- package/dist/cc.js.map +1 -0
- package/dist/config.js +72 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.js +58 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-proxy.js +115 -0
- package/dist/logger-proxy.js.map +1 -0
- package/dist/metrics/MetricsManager.js +474 -0
- package/dist/metrics/MetricsManager.js.map +1 -0
- package/dist/metrics/behavioral-events.js +322 -0
- package/dist/metrics/behavioral-events.js.map +1 -0
- package/dist/metrics/constants.js +134 -0
- package/dist/metrics/constants.js.map +1 -0
- package/dist/services/WebCallingService.js +323 -0
- package/dist/services/WebCallingService.js.map +1 -0
- package/dist/services/agent/index.js +177 -0
- package/dist/services/agent/index.js.map +1 -0
- package/dist/services/agent/types.js +137 -0
- package/dist/services/agent/types.js.map +1 -0
- package/dist/services/config/Util.js +203 -0
- package/dist/services/config/Util.js.map +1 -0
- package/dist/services/config/constants.js +221 -0
- package/dist/services/config/constants.js.map +1 -0
- package/dist/services/config/index.js +607 -0
- package/dist/services/config/index.js.map +1 -0
- package/dist/services/config/types.js +334 -0
- package/dist/services/config/types.js.map +1 -0
- package/dist/services/constants.js +117 -0
- package/dist/services/constants.js.map +1 -0
- package/dist/services/core/Err.js +43 -0
- package/dist/services/core/Err.js.map +1 -0
- package/dist/services/core/GlobalTypes.js +6 -0
- package/dist/services/core/GlobalTypes.js.map +1 -0
- package/dist/services/core/Utils.js +126 -0
- package/dist/services/core/Utils.js.map +1 -0
- package/dist/services/core/WebexRequest.js +96 -0
- package/dist/services/core/WebexRequest.js.map +1 -0
- package/dist/services/core/aqm-reqs.js +246 -0
- package/dist/services/core/aqm-reqs.js.map +1 -0
- package/dist/services/core/constants.js +109 -0
- package/dist/services/core/constants.js.map +1 -0
- package/dist/services/core/types.js +6 -0
- package/dist/services/core/types.js.map +1 -0
- package/dist/services/core/websocket/WebSocketManager.js +187 -0
- package/dist/services/core/websocket/WebSocketManager.js.map +1 -0
- package/dist/services/core/websocket/connection-service.js +111 -0
- package/dist/services/core/websocket/connection-service.js.map +1 -0
- package/dist/services/core/websocket/keepalive.worker.js +94 -0
- package/dist/services/core/websocket/keepalive.worker.js.map +1 -0
- package/dist/services/core/websocket/types.js +6 -0
- package/dist/services/core/websocket/types.js.map +1 -0
- package/dist/services/index.js +78 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/task/AutoWrapup.js +88 -0
- package/dist/services/task/AutoWrapup.js.map +1 -0
- package/dist/services/task/TaskManager.js +369 -0
- package/dist/services/task/TaskManager.js.map +1 -0
- package/dist/services/task/constants.js +58 -0
- package/dist/services/task/constants.js.map +1 -0
- package/dist/services/task/contact.js +464 -0
- package/dist/services/task/contact.js.map +1 -0
- package/dist/services/task/dialer.js +60 -0
- package/dist/services/task/dialer.js.map +1 -0
- package/dist/services/task/index.js +1188 -0
- package/dist/services/task/index.js.map +1 -0
- package/dist/services/task/types.js +214 -0
- package/dist/services/task/types.js.map +1 -0
- package/dist/types/cc.d.ts +676 -0
- package/dist/types/config.d.ts +66 -0
- package/dist/types/constants.d.ts +45 -0
- package/dist/types/index.d.ts +178 -0
- package/dist/types/logger-proxy.d.ts +71 -0
- package/dist/types/metrics/MetricsManager.d.ts +223 -0
- package/dist/types/metrics/behavioral-events.d.ts +29 -0
- package/dist/types/metrics/constants.d.ts +127 -0
- package/dist/types/services/WebCallingService.d.ts +1 -0
- package/dist/types/services/agent/index.d.ts +46 -0
- package/dist/types/services/agent/types.d.ts +413 -0
- package/dist/types/services/config/Util.d.ts +19 -0
- package/dist/types/services/config/constants.d.ts +203 -0
- package/dist/types/services/config/index.d.ts +171 -0
- package/dist/types/services/config/types.d.ts +1113 -0
- package/dist/types/services/constants.d.ts +97 -0
- package/dist/types/services/core/Err.d.ts +119 -0
- package/dist/types/services/core/GlobalTypes.d.ts +33 -0
- package/dist/types/services/core/Utils.d.ts +36 -0
- package/dist/types/services/core/WebexRequest.d.ts +22 -0
- package/dist/types/services/core/aqm-reqs.d.ts +16 -0
- package/dist/types/services/core/constants.d.ts +85 -0
- package/dist/types/services/core/types.d.ts +47 -0
- package/dist/types/services/core/websocket/WebSocketManager.d.ts +34 -0
- package/dist/types/services/core/websocket/connection-service.d.ts +27 -0
- package/dist/types/services/core/websocket/keepalive.worker.d.ts +2 -0
- package/dist/types/services/core/websocket/types.d.ts +37 -0
- package/dist/types/services/index.d.ts +52 -0
- package/dist/types/services/task/AutoWrapup.d.ts +40 -0
- package/dist/types/services/task/TaskManager.d.ts +1 -0
- package/dist/types/services/task/constants.d.ts +46 -0
- package/dist/types/services/task/contact.d.ts +59 -0
- package/dist/types/services/task/dialer.d.ts +28 -0
- package/dist/types/services/task/index.d.ts +569 -0
- package/dist/types/services/task/types.d.ts +1041 -0
- package/dist/types/types.d.ts +452 -0
- package/dist/types/webex-config.d.ts +53 -0
- package/dist/types/webex.d.ts +7 -0
- package/dist/types.js +292 -0
- package/dist/types.js.map +1 -0
- package/dist/webex-config.js +60 -0
- package/dist/webex-config.js.map +1 -0
- package/dist/webex.js +99 -0
- package/dist/webex.js.map +1 -0
- package/jest.config.js +45 -0
- package/package.json +83 -0
- package/src/cc.ts +1618 -0
- package/src/config.ts +65 -0
- package/src/constants.ts +51 -0
- package/src/index.ts +220 -0
- package/src/logger-proxy.ts +110 -0
- package/src/metrics/MetricsManager.ts +512 -0
- package/src/metrics/behavioral-events.ts +332 -0
- package/src/metrics/constants.ts +135 -0
- package/src/services/WebCallingService.ts +351 -0
- package/src/services/agent/index.ts +149 -0
- package/src/services/agent/types.ts +440 -0
- package/src/services/config/Util.ts +261 -0
- package/src/services/config/constants.ts +249 -0
- package/src/services/config/index.ts +743 -0
- package/src/services/config/types.ts +1117 -0
- package/src/services/constants.ts +111 -0
- package/src/services/core/Err.ts +126 -0
- package/src/services/core/GlobalTypes.ts +34 -0
- package/src/services/core/Utils.ts +132 -0
- package/src/services/core/WebexRequest.ts +103 -0
- package/src/services/core/aqm-reqs.ts +272 -0
- package/src/services/core/constants.ts +106 -0
- package/src/services/core/types.ts +48 -0
- package/src/services/core/websocket/WebSocketManager.ts +196 -0
- package/src/services/core/websocket/connection-service.ts +142 -0
- package/src/services/core/websocket/keepalive.worker.js +88 -0
- package/src/services/core/websocket/types.ts +40 -0
- package/src/services/index.ts +71 -0
- package/src/services/task/AutoWrapup.ts +86 -0
- package/src/services/task/TaskManager.ts +420 -0
- package/src/services/task/constants.ts +52 -0
- package/src/services/task/contact.ts +429 -0
- package/src/services/task/dialer.ts +52 -0
- package/src/services/task/index.ts +1375 -0
- package/src/services/task/types.ts +1113 -0
- package/src/types.ts +639 -0
- package/src/webex-config.ts +54 -0
- package/src/webex.js +96 -0
- package/test/unit/spec/cc.ts +1985 -0
- package/test/unit/spec/metrics/MetricsManager.ts +491 -0
- package/test/unit/spec/metrics/behavioral-events.ts +102 -0
- package/test/unit/spec/services/WebCallingService.ts +416 -0
- package/test/unit/spec/services/agent/index.ts +65 -0
- package/test/unit/spec/services/config/index.ts +1035 -0
- package/test/unit/spec/services/core/Utils.ts +279 -0
- package/test/unit/spec/services/core/WebexRequest.ts +144 -0
- package/test/unit/spec/services/core/aqm-reqs.ts +570 -0
- package/test/unit/spec/services/core/websocket/WebSocketManager.ts +378 -0
- package/test/unit/spec/services/core/websocket/connection-service.ts +178 -0
- package/test/unit/spec/services/task/TaskManager.ts +1351 -0
- package/test/unit/spec/services/task/contact.ts +204 -0
- package/test/unit/spec/services/task/dialer.ts +157 -0
- package/test/unit/spec/services/task/index.ts +1474 -0
- package/tsconfig.json +6 -0
- package/typedoc.json +37 -0
- package/typedoc.md +240 -0
- package/umd/contact-center.min.js +3 -0
- package/umd/contact-center.min.js.map +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
type Enum<T extends Record<string, unknown>> = T[keyof T];
|
|
2
|
+
/**
|
|
3
|
+
* @ignore
|
|
4
|
+
* @module METRIC_EVENT_NAMES
|
|
5
|
+
* @export
|
|
6
|
+
* @description
|
|
7
|
+
* A constant object containing all metric event names used for tracking various agent and task-related events
|
|
8
|
+
* within the Contact Center plugin. Each property represents a specific event and its corresponding string value
|
|
9
|
+
* as reported in metrics.
|
|
10
|
+
*
|
|
11
|
+
* @property {string} STATION_LOGIN_SUCCESS - Event name for successful station login.
|
|
12
|
+
* @property {string} STATION_LOGIN_FAILED - Event name for failed station login.
|
|
13
|
+
* @property {string} STATION_LOGOUT_SUCCESS - Event name for successful station logout.
|
|
14
|
+
* @property {string} STATION_LOGOUT_FAILED - Event name for failed station logout.
|
|
15
|
+
* @property {string} STATION_RELOGIN_SUCCESS - Event name for successful station relogin.
|
|
16
|
+
* @property {string} STATION_RELOGIN_FAILED - Event name for failed station relogin.
|
|
17
|
+
* @property {string} AGENT_STATE_CHANGE_SUCCESS - Event name for successful agent state change.
|
|
18
|
+
* @property {string} AGENT_STATE_CHANGE_FAILED - Event name for failed agent state change.
|
|
19
|
+
* @property {string} FETCH_BUDDY_AGENTS_SUCCESS - Event name for successfully fetching buddy agents.
|
|
20
|
+
* @property {string} FETCH_BUDDY_AGENTS_FAILED - Event name for failed attempt to fetch buddy agents.
|
|
21
|
+
* @property {string} WEBSOCKET_REGISTER_SUCCESS - Event name for successful websocket registration.
|
|
22
|
+
* @property {string} WEBSOCKET_REGISTER_FAILED - Event name for failed websocket registration.
|
|
23
|
+
* @property {string} AGENT_RONA - Event name for agent RONA (Ring No Answer).
|
|
24
|
+
* @property {string} AGENT_CONTACT_ASSIGN_FAILED - Event name for failed agent contact assignment.
|
|
25
|
+
* @property {string} AGENT_INVITE_FAILED - Event name for failed agent invite.
|
|
26
|
+
*
|
|
27
|
+
* @property {string} TASK_ACCEPT_SUCCESS - Event name for successful task acceptance.
|
|
28
|
+
* @property {string} TASK_ACCEPT_FAILED - Event name for failed task acceptance.
|
|
29
|
+
* @property {string} TASK_DECLINE_SUCCESS - Event name for successful task decline.
|
|
30
|
+
* @property {string} TASK_DECLINE_FAILED - Event name for failed task decline.
|
|
31
|
+
* @property {string} TASK_END_SUCCESS - Event name for successful task end.
|
|
32
|
+
* @property {string} TASK_END_FAILED - Event name for failed task end.
|
|
33
|
+
* @property {string} TASK_WRAPUP_SUCCESS - Event name for successful task wrap-up.
|
|
34
|
+
* @property {string} TASK_WRAPUP_FAILED - Event name for failed task wrap-up.
|
|
35
|
+
* @property {string} TASK_HOLD_SUCCESS - Event name for successful task hold.
|
|
36
|
+
* @property {string} TASK_HOLD_FAILED - Event name for failed task hold.
|
|
37
|
+
* @property {string} TASK_RESUME_SUCCESS - Event name for successful task resume.
|
|
38
|
+
* @property {string} TASK_RESUME_FAILED - Event name for failed task resume.
|
|
39
|
+
*
|
|
40
|
+
* @property {string} TASK_CONSULT_START_SUCCESS - Event name for successful consult start.
|
|
41
|
+
* @property {string} TASK_CONSULT_START_FAILED - Event name for failed consult start.
|
|
42
|
+
* @property {string} TASK_CONSULT_END_SUCCESS - Event name for successful consult end.
|
|
43
|
+
* @property {string} TASK_CONSULT_END_FAILED - Event name for failed consult end.
|
|
44
|
+
* @property {string} TASK_TRANSFER_SUCCESS - Event name for successful task transfer.
|
|
45
|
+
* @property {string} TASK_TRANSFER_FAILED - Event name for failed task transfer.
|
|
46
|
+
* @property {string} TASK_RESUME_RECORDING_SUCCESS - Event name for successful resume of recording.
|
|
47
|
+
* @property {string} TASK_RESUME_RECORDING_FAILED - Event name for failed resume of recording.
|
|
48
|
+
* @property {string} TASK_PAUSE_RECORDING_SUCCESS - Event name for successful pause of recording.
|
|
49
|
+
* @property {string} TASK_PAUSE_RECORDING_FAILED - Event name for failed pause of recording.
|
|
50
|
+
* @property {string} TASK_ACCEPT_CONSULT_SUCCESS - Event name for successful consult acceptance.
|
|
51
|
+
* @property {string} TASK_ACCEPT_CONSULT_FAILED - Event name for failed consult acceptance.
|
|
52
|
+
*
|
|
53
|
+
* @property {string} TASK_OUTDIAL_SUCCESS - Event name for successful outdial task.
|
|
54
|
+
* @property {string} TASK_OUTDIAL_FAILED - Event name for failed outdial task.
|
|
55
|
+
*
|
|
56
|
+
* @property {string} UPLOAD_LOGS_SUCCESS - Event name for successful log upload.
|
|
57
|
+
* @property {string} UPLOAD_LOGS_FAILED - Event name for failed log upload.
|
|
58
|
+
* @property {string} WEBSOCKET_DEREGISTER_SUCCESS - Event name for successful websocket deregistration.
|
|
59
|
+
* @property {string} WEBSOCKET_DEREGISTER_FAIL - Event name for failed websocket deregistration.
|
|
60
|
+
*
|
|
61
|
+
* @property {string} AGENT_DEVICE_TYPE_UPDATE_SUCCESS - Event name for successful agent device type update.
|
|
62
|
+
* @property {string} AGENT_DEVICE_TYPE_UPDATE_FAILED - Event name for failed agent device type update.
|
|
63
|
+
*
|
|
64
|
+
* @readonly
|
|
65
|
+
*/
|
|
66
|
+
export declare const METRIC_EVENT_NAMES: {
|
|
67
|
+
readonly STATION_LOGIN_SUCCESS: "Station Login Success";
|
|
68
|
+
readonly STATION_LOGIN_FAILED: "Station Login Failed";
|
|
69
|
+
readonly STATION_LOGOUT_SUCCESS: "Station Logout Success";
|
|
70
|
+
readonly STATION_LOGOUT_FAILED: "Station Logout Failed";
|
|
71
|
+
readonly STATION_RELOGIN_SUCCESS: "Station Relogin Success";
|
|
72
|
+
readonly STATION_RELOGIN_FAILED: "Station Relogin Failed";
|
|
73
|
+
readonly AGENT_STATE_CHANGE_SUCCESS: "Agent State Change Success";
|
|
74
|
+
readonly AGENT_STATE_CHANGE_FAILED: "Agent State Change Failed";
|
|
75
|
+
readonly FETCH_BUDDY_AGENTS_SUCCESS: "Fetch Buddy Agents Success";
|
|
76
|
+
readonly FETCH_BUDDY_AGENTS_FAILED: "Fetch Buddy Agents Failed";
|
|
77
|
+
readonly WEBSOCKET_REGISTER_SUCCESS: "Websocket Register Success";
|
|
78
|
+
readonly WEBSOCKET_REGISTER_FAILED: "Websocket Register Failed";
|
|
79
|
+
readonly AGENT_RONA: "Agent RONA";
|
|
80
|
+
readonly AGENT_CONTACT_ASSIGN_FAILED: "Agent Contact Assign Failed";
|
|
81
|
+
readonly AGENT_INVITE_FAILED: "Agent Invite Failed";
|
|
82
|
+
readonly TASK_ACCEPT_SUCCESS: "Task Accept Success";
|
|
83
|
+
readonly TASK_ACCEPT_FAILED: "Task Accept Failed";
|
|
84
|
+
readonly TASK_DECLINE_SUCCESS: "Task Decline Success";
|
|
85
|
+
readonly TASK_DECLINE_FAILED: "Task Decline Failed";
|
|
86
|
+
readonly TASK_END_SUCCESS: "Task End Success";
|
|
87
|
+
readonly TASK_END_FAILED: "Task End Failed";
|
|
88
|
+
readonly TASK_WRAPUP_SUCCESS: "Task Wrapup Success";
|
|
89
|
+
readonly TASK_WRAPUP_FAILED: "Task Wrapup Failed";
|
|
90
|
+
readonly TASK_HOLD_SUCCESS: "Task Hold Success";
|
|
91
|
+
readonly TASK_HOLD_FAILED: "Task Hold Failed";
|
|
92
|
+
readonly TASK_RESUME_SUCCESS: "Task Resume Success";
|
|
93
|
+
readonly TASK_RESUME_FAILED: "Task Resume Failed";
|
|
94
|
+
readonly TASK_CONSULT_START_SUCCESS: "Task Consult Start Success";
|
|
95
|
+
readonly TASK_CONSULT_START_FAILED: "Task Consult Start Failed";
|
|
96
|
+
readonly TASK_CONSULT_END_SUCCESS: "Task Consult End Success";
|
|
97
|
+
readonly TASK_CONSULT_END_FAILED: "Task Consult End Failed";
|
|
98
|
+
readonly TASK_TRANSFER_SUCCESS: "Task Transfer Success";
|
|
99
|
+
readonly TASK_TRANSFER_FAILED: "Task Transfer Failed";
|
|
100
|
+
readonly TASK_RESUME_RECORDING_SUCCESS: "Task Resume Recording Success";
|
|
101
|
+
readonly TASK_RESUME_RECORDING_FAILED: "Task Resume Recording Failed";
|
|
102
|
+
readonly TASK_PAUSE_RECORDING_SUCCESS: "Task Pause Recording Success";
|
|
103
|
+
readonly TASK_PAUSE_RECORDING_FAILED: "Task Pause Recording Failed";
|
|
104
|
+
readonly TASK_ACCEPT_CONSULT_SUCCESS: "Task Accept Consult Success";
|
|
105
|
+
readonly TASK_ACCEPT_CONSULT_FAILED: "Task Accept Consult Failed";
|
|
106
|
+
readonly TASK_OUTDIAL_SUCCESS: "Task Outdial Success";
|
|
107
|
+
readonly TASK_OUTDIAL_FAILED: "Task Outdial Failed";
|
|
108
|
+
readonly UPLOAD_LOGS_SUCCESS: "Upload Logs Success";
|
|
109
|
+
readonly UPLOAD_LOGS_FAILED: "Upload Logs Failed";
|
|
110
|
+
readonly WEBSOCKET_DEREGISTER_SUCCESS: "Websocket Deregister Success";
|
|
111
|
+
readonly WEBSOCKET_DEREGISTER_FAIL: "Websocket Deregister Failed";
|
|
112
|
+
readonly AGENT_DEVICE_TYPE_UPDATE_SUCCESS: "Agent Device Type Update Success";
|
|
113
|
+
readonly AGENT_DEVICE_TYPE_UPDATE_FAILED: "Agent Device Type Update Failed";
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Represents the possible metric event names used within the metrics system.
|
|
117
|
+
*
|
|
118
|
+
* This type is derived from the keys of the `METRIC_EVENT_NAMES` constant, ensuring
|
|
119
|
+
* type safety and consistency when referring to metric event names throughout the codebase.
|
|
120
|
+
* @export
|
|
121
|
+
* @typedef {Enum<typeof METRIC_EVENT_NAMES>} METRIC_EVENT_NAMES
|
|
122
|
+
* @typeParam T - The type of the `METRIC_EVENT_NAMES` constant.
|
|
123
|
+
*
|
|
124
|
+
* @see {@link METRIC_EVENT_NAMES}
|
|
125
|
+
*/
|
|
126
|
+
export type METRIC_EVENT_NAMES = Enum<typeof METRIC_EVENT_NAMES>;
|
|
127
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as Agent from './types';
|
|
2
|
+
import AqmReqs from '../core/aqm-reqs';
|
|
3
|
+
/**
|
|
4
|
+
* Agent Service provides methods to manage agent states and operations
|
|
5
|
+
* @param routing - AqmReqs instance for making API requests
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export default function routingAgent(routing: AqmReqs): {
|
|
9
|
+
/**
|
|
10
|
+
* Reloads the agent session
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
reload: import("../core/types").ResEmpty<Agent.ReloginSuccess>;
|
|
14
|
+
/**
|
|
15
|
+
* Logs out the agent
|
|
16
|
+
* @param p.data - Logout parameters
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
logout: import("../core/types").Res<Agent.LogoutSuccess, {
|
|
20
|
+
data: Agent.Logout;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Logs in the agent to a station
|
|
24
|
+
* @param p.data - Station login parameters
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
stationLogin: import("../core/types").Res<Agent.StationLoginSuccess, {
|
|
28
|
+
data: Agent.UserStationLogin;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Changes the agent's state
|
|
32
|
+
* @param p.data - State change parameters
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
stateChange: import("../core/types").Res<Agent.StateChangeSuccess, {
|
|
36
|
+
data: Agent.StateChange;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves list of buddy agents
|
|
40
|
+
* @param p.data - Buddy agent query parameters
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
buddyAgents: import("../core/types").Res<Agent.BuddyAgentsSuccess, {
|
|
44
|
+
data: Agent.BuddyAgents;
|
|
45
|
+
}>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { Msg } from '../core/GlobalTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Response type received when an agent successfully logs out from the system
|
|
4
|
+
* @public
|
|
5
|
+
* @remarks
|
|
6
|
+
* This type represents the response message sent by the server when an agent
|
|
7
|
+
* successfully logs out. It includes essential details about the logout action
|
|
8
|
+
* and the agent's final state.
|
|
9
|
+
*/
|
|
10
|
+
export type LogoutSuccess = Msg<{
|
|
11
|
+
/** Message type identifier for agent desktop events */
|
|
12
|
+
eventType: 'AgentDesktopMessage';
|
|
13
|
+
/** Unique identifier of the agent */
|
|
14
|
+
agentId: string;
|
|
15
|
+
/** Tracking ID for the logout request */
|
|
16
|
+
trackingId: string;
|
|
17
|
+
/** Current session ID of the agent */
|
|
18
|
+
agentSessionId: string;
|
|
19
|
+
/** Organization ID the agent belongs to */
|
|
20
|
+
orgId: string;
|
|
21
|
+
/** Current status of the agent (e.g., 'LoggedOut') */
|
|
22
|
+
status: string;
|
|
23
|
+
/** Detailed status information */
|
|
24
|
+
subStatus: string;
|
|
25
|
+
/** Identity of who initiated the logout if not the agent themselves */
|
|
26
|
+
loggedOutBy?: string;
|
|
27
|
+
/** List of roles assigned to the agent */
|
|
28
|
+
roles?: string[];
|
|
29
|
+
/** Type identifier for logout success event */
|
|
30
|
+
type: 'AgentLogoutSuccess';
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Response type received when an agent successfully relogins to the system
|
|
34
|
+
* @public
|
|
35
|
+
* @remarks
|
|
36
|
+
* Represents the response message when an agent successfully re-authenticates.
|
|
37
|
+
* Contains comprehensive information about the agent's new session, including
|
|
38
|
+
* their state, assigned channels, and device information.
|
|
39
|
+
*/
|
|
40
|
+
export type ReloginSuccess = Msg<{
|
|
41
|
+
/** Message type identifier for agent desktop events */
|
|
42
|
+
eventType: 'AgentDesktopMessage';
|
|
43
|
+
/** Unique identifier of the agent */
|
|
44
|
+
agentId: string;
|
|
45
|
+
/** Tracking ID for the relogin request */
|
|
46
|
+
trackingId: string;
|
|
47
|
+
/** Auxiliary code ID for the agent's initial state */
|
|
48
|
+
auxCodeId: string;
|
|
49
|
+
/** ID of the team the agent belongs to */
|
|
50
|
+
teamId: string;
|
|
51
|
+
/** New session ID assigned to the agent */
|
|
52
|
+
agentSessionId: string;
|
|
53
|
+
/** Directory number assigned to the agent */
|
|
54
|
+
dn: string;
|
|
55
|
+
/** Organization ID the agent belongs to */
|
|
56
|
+
orgId: string;
|
|
57
|
+
/** List of active interaction IDs */
|
|
58
|
+
interactionIds: string[];
|
|
59
|
+
/** Indicates if login is via extension */
|
|
60
|
+
isExtension: boolean;
|
|
61
|
+
/** Current login status */
|
|
62
|
+
status: 'LoggedIn';
|
|
63
|
+
/** Current sub-status */
|
|
64
|
+
subStatus: 'Idle';
|
|
65
|
+
/** ID of the site where the agent is located */
|
|
66
|
+
siteId: string;
|
|
67
|
+
/** Timestamp of last idle code change */
|
|
68
|
+
lastIdleCodeChangeTimestamp: number;
|
|
69
|
+
/** Timestamp of last state change */
|
|
70
|
+
lastStateChangeTimestamp: number;
|
|
71
|
+
/** Reason for the last state change */
|
|
72
|
+
lastStateChangeReason?: string;
|
|
73
|
+
/** Type of agent profile */
|
|
74
|
+
profileType: string;
|
|
75
|
+
/** Map of channel types to channel IDs */
|
|
76
|
+
channelsMap: Record<string, string[]>;
|
|
77
|
+
/** Phone number for dialing */
|
|
78
|
+
dialNumber?: string;
|
|
79
|
+
/** List of roles assigned to the agent */
|
|
80
|
+
roles?: string[];
|
|
81
|
+
/** Type of device being used */
|
|
82
|
+
deviceType?: DeviceType;
|
|
83
|
+
/** Unique identifier of the device */
|
|
84
|
+
deviceId?: string | null;
|
|
85
|
+
/** Flag indicating if emergency modal was shown */
|
|
86
|
+
isEmergencyModalAlreadyDisplayed?: boolean;
|
|
87
|
+
/** Type identifier for relogin success event */
|
|
88
|
+
type: 'AgentReloginSuccess';
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Response type received when an agent's state is successfully changed
|
|
92
|
+
* @public
|
|
93
|
+
* @remarks
|
|
94
|
+
* Contains information about the agent's new state, including who initiated
|
|
95
|
+
* the change and timestamps for tracking state transitions.
|
|
96
|
+
*/
|
|
97
|
+
export type StateChangeSuccess = Msg<{
|
|
98
|
+
/** Message type identifier for agent desktop events */
|
|
99
|
+
eventType: 'AgentDesktopMessage';
|
|
100
|
+
/** Unique identifier of the agent */
|
|
101
|
+
agentId: string;
|
|
102
|
+
/** Tracking ID for the state change request */
|
|
103
|
+
trackingId: string;
|
|
104
|
+
/** Auxiliary code ID associated with the new state */
|
|
105
|
+
auxCodeId: string;
|
|
106
|
+
/** Current session ID of the agent */
|
|
107
|
+
agentSessionId: string;
|
|
108
|
+
/** Organization ID the agent belongs to */
|
|
109
|
+
orgId: string;
|
|
110
|
+
/** Current status of the agent */
|
|
111
|
+
status: string;
|
|
112
|
+
/** Detailed status indicating availability */
|
|
113
|
+
subStatus: 'Available' | 'Idle';
|
|
114
|
+
/** Timestamp of last idle code change */
|
|
115
|
+
lastIdleCodeChangeTimestamp: number;
|
|
116
|
+
/** Timestamp of current state change */
|
|
117
|
+
lastStateChangeTimestamp: number;
|
|
118
|
+
/** Type identifier for state change success event */
|
|
119
|
+
type: 'AgentStateChangeSuccess';
|
|
120
|
+
/** Identity of who initiated the state change */
|
|
121
|
+
changedBy: string | null;
|
|
122
|
+
/** ID of the user who initiated the change */
|
|
123
|
+
changedById: string | null;
|
|
124
|
+
/** Name of the user who initiated the change */
|
|
125
|
+
changedByName: string | null;
|
|
126
|
+
/** Reason for the state change */
|
|
127
|
+
lastStateChangeReason: string;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* Response type received when an agent successfully logs into their station
|
|
131
|
+
* @public
|
|
132
|
+
* @remarks
|
|
133
|
+
* Represents the success response when an agent logs into their workstation.
|
|
134
|
+
* Includes details about the agent's initial state, assigned teams, and channels.
|
|
135
|
+
*/
|
|
136
|
+
export type StationLoginSuccess = Msg<{
|
|
137
|
+
/** Message type identifier for agent desktop events */
|
|
138
|
+
eventType: 'AgentDesktopMessage';
|
|
139
|
+
/** Unique identifier of the agent */
|
|
140
|
+
agentId: string;
|
|
141
|
+
/** Tracking ID for the station login request */
|
|
142
|
+
trackingId: string;
|
|
143
|
+
/** Auxiliary code ID for initial state */
|
|
144
|
+
auxCodeId: string;
|
|
145
|
+
/** ID of the team the agent belongs to */
|
|
146
|
+
teamId: string;
|
|
147
|
+
/** New session ID assigned to the agent */
|
|
148
|
+
agentSessionId: string;
|
|
149
|
+
/** Organization ID the agent belongs to */
|
|
150
|
+
orgId: string;
|
|
151
|
+
/** List of active interaction IDs */
|
|
152
|
+
interactionIds: string[];
|
|
153
|
+
/** Current login status */
|
|
154
|
+
status: string;
|
|
155
|
+
/** Current availability status */
|
|
156
|
+
subStatus: 'Available' | 'Idle';
|
|
157
|
+
/** ID of the site where the agent is located */
|
|
158
|
+
siteId: string;
|
|
159
|
+
/** Timestamp of last idle code change */
|
|
160
|
+
lastIdleCodeChangeTimestamp: number;
|
|
161
|
+
/** Timestamp of last state change */
|
|
162
|
+
lastStateChangeTimestamp: number;
|
|
163
|
+
/** Type of agent profile */
|
|
164
|
+
profileType: string;
|
|
165
|
+
/** Map of channel types to channel IDs */
|
|
166
|
+
channelsMap: Record<string, string[]>;
|
|
167
|
+
/** Phone number for dialing */
|
|
168
|
+
dialNumber?: string;
|
|
169
|
+
/** List of roles assigned to the agent */
|
|
170
|
+
roles?: string[];
|
|
171
|
+
/** Session ID of the supervising agent if applicable */
|
|
172
|
+
supervisorSessionId?: string;
|
|
173
|
+
/** Type identifier for station login success event */
|
|
174
|
+
type: 'AgentStationLoginSuccess';
|
|
175
|
+
}>;
|
|
176
|
+
/**
|
|
177
|
+
* Extended response type for station login success that includes notification tracking
|
|
178
|
+
* @public
|
|
179
|
+
* @remarks
|
|
180
|
+
* Similar to StationLoginSuccess but includes additional fields for notification
|
|
181
|
+
* tracking and multimedia profile settings.
|
|
182
|
+
*/
|
|
183
|
+
export type StationLoginSuccessResponse = {
|
|
184
|
+
/** Message type identifier for agent desktop events */
|
|
185
|
+
eventType: 'AgentDesktopMessage';
|
|
186
|
+
/** Unique identifier of the agent */
|
|
187
|
+
agentId: string;
|
|
188
|
+
/** Tracking ID for the station login request */
|
|
189
|
+
trackingId: string;
|
|
190
|
+
/** Auxiliary code ID for initial state */
|
|
191
|
+
auxCodeId: string;
|
|
192
|
+
/** ID of the team the agent belongs to */
|
|
193
|
+
teamId: string;
|
|
194
|
+
/** New session ID assigned to the agent */
|
|
195
|
+
agentSessionId: string;
|
|
196
|
+
/** Organization ID the agent belongs to */
|
|
197
|
+
orgId: string;
|
|
198
|
+
/** List of active interaction IDs */
|
|
199
|
+
interactionIds: string[];
|
|
200
|
+
/** Current login status */
|
|
201
|
+
status: string;
|
|
202
|
+
/** Current availability status */
|
|
203
|
+
subStatus: 'Available' | 'Idle';
|
|
204
|
+
/** ID of the site where the agent is located */
|
|
205
|
+
siteId: string;
|
|
206
|
+
/** Timestamp of last idle code change */
|
|
207
|
+
lastIdleCodeChangeTimestamp: number;
|
|
208
|
+
/** Timestamp of last state change */
|
|
209
|
+
lastStateChangeTimestamp: number;
|
|
210
|
+
/** Type of agent profile */
|
|
211
|
+
profileType: string;
|
|
212
|
+
/** Multimedia profile capacity settings */
|
|
213
|
+
mmProfile: {
|
|
214
|
+
/** Maximum concurrent chat capacity */
|
|
215
|
+
chat: number;
|
|
216
|
+
/** Maximum concurrent email capacity */
|
|
217
|
+
email: number;
|
|
218
|
+
/** Maximum concurrent social media capacity */
|
|
219
|
+
social: number;
|
|
220
|
+
/** Maximum concurrent voice call capacity */
|
|
221
|
+
telephony: number;
|
|
222
|
+
};
|
|
223
|
+
/** Phone number for dialing */
|
|
224
|
+
dialNumber?: string;
|
|
225
|
+
/** List of roles assigned to the agent */
|
|
226
|
+
roles?: string[];
|
|
227
|
+
/** Session ID of the supervising agent if applicable */
|
|
228
|
+
supervisorSessionId?: string;
|
|
229
|
+
/** Type identifier for station login success event */
|
|
230
|
+
type: 'AgentStationLoginSuccess';
|
|
231
|
+
/** Tracking ID for notifications */
|
|
232
|
+
notifsTrackingId: string;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Extended response type for agent device type update success
|
|
236
|
+
* @public
|
|
237
|
+
* @remarks
|
|
238
|
+
* Represents the response when an agent's device type is successfully updated.
|
|
239
|
+
* Contains all the details of the agent's session and device configuration.
|
|
240
|
+
*/
|
|
241
|
+
export type DeviceTypeUpdateSuccess = Omit<StationLoginSuccessResponse, 'type'> & {
|
|
242
|
+
type: 'AgentDeviceTypeUpdateSuccess';
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* Parameters required for initiating an agent logout
|
|
246
|
+
* @public
|
|
247
|
+
* @remarks
|
|
248
|
+
* Defines the parameters that can be provided when logging out an agent,
|
|
249
|
+
* including the reason for logout which helps with reporting and auditing.
|
|
250
|
+
*/
|
|
251
|
+
export type Logout = {
|
|
252
|
+
/** Reason for the logout action */
|
|
253
|
+
logoutReason?: 'User requested logout' | 'Inactivity Logout' | 'User requested agent device change';
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Represents the possible states an agent can be in
|
|
257
|
+
* @public
|
|
258
|
+
* @remarks
|
|
259
|
+
* Defines the various states an agent can transition between during their session.
|
|
260
|
+
* Common states include 'Available' (ready to handle interactions), 'Idle' (on break
|
|
261
|
+
* or not ready), and 'RONA' (Response on No Answer).
|
|
262
|
+
*/
|
|
263
|
+
export type AgentState = 'Available' | 'Idle' | 'RONA' | string;
|
|
264
|
+
/**
|
|
265
|
+
* Parameters required for changing an agent's state
|
|
266
|
+
* @public
|
|
267
|
+
* @remarks
|
|
268
|
+
* Defines the necessary information for transitioning an agent from one state to another.
|
|
269
|
+
*/
|
|
270
|
+
export type StateChange = {
|
|
271
|
+
/** New state to transition the agent to */
|
|
272
|
+
state: AgentState;
|
|
273
|
+
/** Auxiliary code ID associated with the state change */
|
|
274
|
+
auxCodeId: string;
|
|
275
|
+
/** Reason for the state change */
|
|
276
|
+
lastStateChangeReason?: string;
|
|
277
|
+
/** ID of the agent whose state is being changed */
|
|
278
|
+
agentId?: string;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Parameters required for agent station login
|
|
282
|
+
* @public
|
|
283
|
+
* @remarks
|
|
284
|
+
* Contains all the necessary information for logging an agent into their workstation,
|
|
285
|
+
* including team assignments, roles, and device configurations.
|
|
286
|
+
*/
|
|
287
|
+
export type UserStationLogin = {
|
|
288
|
+
/** Phone number for dialing */
|
|
289
|
+
dialNumber?: string | null;
|
|
290
|
+
/** Directory number */
|
|
291
|
+
dn?: string | null;
|
|
292
|
+
/** ID of the team the agent belongs to */
|
|
293
|
+
teamId: string | null;
|
|
294
|
+
/** Name of the team */
|
|
295
|
+
teamName: string | null;
|
|
296
|
+
/** List of roles assigned to the agent */
|
|
297
|
+
roles?: Array<string>;
|
|
298
|
+
/** ID of the site where the agent is located */
|
|
299
|
+
siteId: string;
|
|
300
|
+
/** Indicates if agent uses a different DN than their assigned one */
|
|
301
|
+
usesOtherDN: boolean;
|
|
302
|
+
/** ID of the agent's skill profile */
|
|
303
|
+
skillProfileId?: string;
|
|
304
|
+
/** ID of the initial auxiliary state code */
|
|
305
|
+
auxCodeId: string;
|
|
306
|
+
/** Indicates if login is via extension */
|
|
307
|
+
isExtension?: boolean;
|
|
308
|
+
/** Type of device being used */
|
|
309
|
+
deviceType?: DeviceType;
|
|
310
|
+
/** Unique identifier of the device */
|
|
311
|
+
deviceId?: string | null;
|
|
312
|
+
/** Flag indicating if emergency modal was shown */
|
|
313
|
+
isEmergencyModalAlreadyDisplayed?: boolean;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Available options for agent login methods
|
|
317
|
+
* @public
|
|
318
|
+
* @remarks
|
|
319
|
+
* Defines the supported methods for agent login:
|
|
320
|
+
* - AGENT_DN: Login using agent's direct number
|
|
321
|
+
* - EXTENSION: Login using extension number
|
|
322
|
+
* - BROWSER: Browser-based login
|
|
323
|
+
*/
|
|
324
|
+
export type LoginOption = 'AGENT_DN' | 'EXTENSION' | 'BROWSER';
|
|
325
|
+
/**
|
|
326
|
+
* Type of device used for agent login
|
|
327
|
+
* @public
|
|
328
|
+
* @remarks
|
|
329
|
+
* Represents the type of device being used for login. Can be one of the standard
|
|
330
|
+
* LoginOptions or a custom device type string.
|
|
331
|
+
*/
|
|
332
|
+
export type DeviceType = LoginOption | string;
|
|
333
|
+
/**
|
|
334
|
+
* Parameters for retrieving buddy agent information
|
|
335
|
+
* @public
|
|
336
|
+
* @remarks
|
|
337
|
+
* Defines the criteria for fetching information about other agents (buddies)
|
|
338
|
+
* in the system, allowing filtering by profile, media type, and state.
|
|
339
|
+
*/
|
|
340
|
+
export type BuddyAgents = {
|
|
341
|
+
agentProfileId: string;
|
|
342
|
+
mediaType: string;
|
|
343
|
+
/** Filter for agent state eg : Available | Idle */
|
|
344
|
+
state?: string;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Detailed information about a buddy agent
|
|
348
|
+
* @public
|
|
349
|
+
* @remarks
|
|
350
|
+
* Contains comprehensive information about a buddy agent including their
|
|
351
|
+
* current state, assignments, and contact information.
|
|
352
|
+
*/
|
|
353
|
+
export type BuddyDetails = {
|
|
354
|
+
agentId: string;
|
|
355
|
+
state: string;
|
|
356
|
+
teamId: string;
|
|
357
|
+
dn: string;
|
|
358
|
+
agentName: string;
|
|
359
|
+
siteId: string;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Response type received when successfully retrieving buddy agent information
|
|
363
|
+
* @public
|
|
364
|
+
* @remarks
|
|
365
|
+
* Contains the list of buddy agents and their details returned from a buddy
|
|
366
|
+
* agent lookup request. Used for monitoring team member statuses and availability.
|
|
367
|
+
*/
|
|
368
|
+
export type BuddyAgentsSuccess = Msg<{
|
|
369
|
+
/** Message type identifier for agent desktop events */
|
|
370
|
+
eventType: 'AgentDesktopMessage';
|
|
371
|
+
/** Unique identifier of the requesting agent */
|
|
372
|
+
agentId: string;
|
|
373
|
+
/** Tracking ID for the buddy list request */
|
|
374
|
+
trackingId: string;
|
|
375
|
+
/** Current session ID of the requesting agent */
|
|
376
|
+
agentSessionId: string;
|
|
377
|
+
/** Organization ID the agent belongs to */
|
|
378
|
+
orgId: string;
|
|
379
|
+
/** Type identifier for buddy agents response */
|
|
380
|
+
type: 'BuddyAgents';
|
|
381
|
+
/** List of buddy agents and their details */
|
|
382
|
+
agentList: Array<BuddyDetails>;
|
|
383
|
+
}>;
|
|
384
|
+
/**
|
|
385
|
+
* Events emitted by the agent service for various state changes and actions
|
|
386
|
+
* @public
|
|
387
|
+
* @remarks
|
|
388
|
+
* Enumeration of all possible events that can be emitted by the agent service.
|
|
389
|
+
* These events can be used to track and respond to changes in agent state,
|
|
390
|
+
* login status, and other important agent-related activities.
|
|
391
|
+
*/
|
|
392
|
+
export declare enum AGENT_EVENTS {
|
|
393
|
+
/** Emitted when an agent's state changes (e.g., Available to Idle) */
|
|
394
|
+
AGENT_STATE_CHANGE = "agent:stateChange",
|
|
395
|
+
/** Emitted when multiple logins are detected for the same agent */
|
|
396
|
+
AGENT_MULTI_LOGIN = "agent:multiLogin",
|
|
397
|
+
/** Emitted when an agent successfully logs into their station */
|
|
398
|
+
AGENT_STATION_LOGIN_SUCCESS = "agent:stationLoginSuccess",
|
|
399
|
+
/** Emitted when station login attempt fails */
|
|
400
|
+
AGENT_STATION_LOGIN_FAILED = "agent:stationLoginFailed",
|
|
401
|
+
/** Emitted when an agent successfully logs out */
|
|
402
|
+
AGENT_LOGOUT_SUCCESS = "agent:logoutSuccess",
|
|
403
|
+
/** Emitted when logout attempt fails */
|
|
404
|
+
AGENT_LOGOUT_FAILED = "agent:logoutFailed",
|
|
405
|
+
/** Emitted when an agent's directory number is successfully registered */
|
|
406
|
+
AGENT_DN_REGISTERED = "agent:dnRegistered",
|
|
407
|
+
/** Emitted when an agent successfully re-authenticates */
|
|
408
|
+
AGENT_RELOGIN_SUCCESS = "agent:reloginSuccess",
|
|
409
|
+
/** Emitted when agent state change is successful */
|
|
410
|
+
AGENT_STATE_CHANGE_SUCCESS = "agent:stateChangeSuccess",
|
|
411
|
+
/** Emitted when agent state change attempt fails */
|
|
412
|
+
AGENT_STATE_CHANGE_FAILED = "agent:stateChangeFailed"
|
|
413
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AgentResponse, AuxCode, DesktopProfileResponse, DialPlanEntity, OrgInfo, OrgSettings, Profile, Team, TenantData, URLMapping } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Parse the agent configurations
|
|
4
|
+
* @param {Object} profileData
|
|
5
|
+
* @returns {Profile}
|
|
6
|
+
*/
|
|
7
|
+
declare function parseAgentConfigs(profileData: {
|
|
8
|
+
userData: AgentResponse;
|
|
9
|
+
teamData: Team[];
|
|
10
|
+
tenantData: TenantData;
|
|
11
|
+
orgInfoData: OrgInfo;
|
|
12
|
+
auxCodes: AuxCode[];
|
|
13
|
+
orgSettingsData: OrgSettings;
|
|
14
|
+
agentProfileData: DesktopProfileResponse;
|
|
15
|
+
dialPlanData: DialPlanEntity[];
|
|
16
|
+
urlMapping: URLMapping[];
|
|
17
|
+
multimediaProfileId: string;
|
|
18
|
+
}): Profile;
|
|
19
|
+
export { parseAgentConfigs };
|