@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,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AGENT_EVENTS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Response type received when an agent successfully logs out from the system
|
|
9
|
+
* @public
|
|
10
|
+
* @remarks
|
|
11
|
+
* This type represents the response message sent by the server when an agent
|
|
12
|
+
* successfully logs out. It includes essential details about the logout action
|
|
13
|
+
* and the agent's final state.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Response type received when an agent successfully relogins to the system
|
|
17
|
+
* @public
|
|
18
|
+
* @remarks
|
|
19
|
+
* Represents the response message when an agent successfully re-authenticates.
|
|
20
|
+
* Contains comprehensive information about the agent's new session, including
|
|
21
|
+
* their state, assigned channels, and device information.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Response type received when an agent's state is successfully changed
|
|
25
|
+
* @public
|
|
26
|
+
* @remarks
|
|
27
|
+
* Contains information about the agent's new state, including who initiated
|
|
28
|
+
* the change and timestamps for tracking state transitions.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Response type received when an agent successfully logs into their station
|
|
32
|
+
* @public
|
|
33
|
+
* @remarks
|
|
34
|
+
* Represents the success response when an agent logs into their workstation.
|
|
35
|
+
* Includes details about the agent's initial state, assigned teams, and channels.
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Extended response type for station login success that includes notification tracking
|
|
39
|
+
* @public
|
|
40
|
+
* @remarks
|
|
41
|
+
* Similar to StationLoginSuccess but includes additional fields for notification
|
|
42
|
+
* tracking and multimedia profile settings.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Extended response type for agent device type update success
|
|
46
|
+
* @public
|
|
47
|
+
* @remarks
|
|
48
|
+
* Represents the response when an agent's device type is successfully updated.
|
|
49
|
+
* Contains all the details of the agent's session and device configuration.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Parameters required for initiating an agent logout
|
|
53
|
+
* @public
|
|
54
|
+
* @remarks
|
|
55
|
+
* Defines the parameters that can be provided when logging out an agent,
|
|
56
|
+
* including the reason for logout which helps with reporting and auditing.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Represents the possible states an agent can be in
|
|
60
|
+
* @public
|
|
61
|
+
* @remarks
|
|
62
|
+
* Defines the various states an agent can transition between during their session.
|
|
63
|
+
* Common states include 'Available' (ready to handle interactions), 'Idle' (on break
|
|
64
|
+
* or not ready), and 'RONA' (Response on No Answer).
|
|
65
|
+
*/
|
|
66
|
+
/**
|
|
67
|
+
* Parameters required for changing an agent's state
|
|
68
|
+
* @public
|
|
69
|
+
* @remarks
|
|
70
|
+
* Defines the necessary information for transitioning an agent from one state to another.
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* Parameters required for agent station login
|
|
74
|
+
* @public
|
|
75
|
+
* @remarks
|
|
76
|
+
* Contains all the necessary information for logging an agent into their workstation,
|
|
77
|
+
* including team assignments, roles, and device configurations.
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* Available options for agent login methods
|
|
81
|
+
* @public
|
|
82
|
+
* @remarks
|
|
83
|
+
* Defines the supported methods for agent login:
|
|
84
|
+
* - AGENT_DN: Login using agent's direct number
|
|
85
|
+
* - EXTENSION: Login using extension number
|
|
86
|
+
* - BROWSER: Browser-based login
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Type of device used for agent login
|
|
90
|
+
* @public
|
|
91
|
+
* @remarks
|
|
92
|
+
* Represents the type of device being used for login. Can be one of the standard
|
|
93
|
+
* LoginOptions or a custom device type string.
|
|
94
|
+
*/
|
|
95
|
+
/**
|
|
96
|
+
* Parameters for retrieving buddy agent information
|
|
97
|
+
* @public
|
|
98
|
+
* @remarks
|
|
99
|
+
* Defines the criteria for fetching information about other agents (buddies)
|
|
100
|
+
* in the system, allowing filtering by profile, media type, and state.
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* Detailed information about a buddy agent
|
|
104
|
+
* @public
|
|
105
|
+
* @remarks
|
|
106
|
+
* Contains comprehensive information about a buddy agent including their
|
|
107
|
+
* current state, assignments, and contact information.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* Response type received when successfully retrieving buddy agent information
|
|
111
|
+
* @public
|
|
112
|
+
* @remarks
|
|
113
|
+
* Contains the list of buddy agents and their details returned from a buddy
|
|
114
|
+
* agent lookup request. Used for monitoring team member statuses and availability.
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* Events emitted by the agent service for various state changes and actions
|
|
118
|
+
* @public
|
|
119
|
+
* @remarks
|
|
120
|
+
* Enumeration of all possible events that can be emitted by the agent service.
|
|
121
|
+
* These events can be used to track and respond to changes in agent state,
|
|
122
|
+
* login status, and other important agent-related activities.
|
|
123
|
+
*/
|
|
124
|
+
let AGENT_EVENTS = exports.AGENT_EVENTS = /*#__PURE__*/function (AGENT_EVENTS) {
|
|
125
|
+
AGENT_EVENTS["AGENT_STATE_CHANGE"] = "agent:stateChange";
|
|
126
|
+
AGENT_EVENTS["AGENT_MULTI_LOGIN"] = "agent:multiLogin";
|
|
127
|
+
AGENT_EVENTS["AGENT_STATION_LOGIN_SUCCESS"] = "agent:stationLoginSuccess";
|
|
128
|
+
AGENT_EVENTS["AGENT_STATION_LOGIN_FAILED"] = "agent:stationLoginFailed";
|
|
129
|
+
AGENT_EVENTS["AGENT_LOGOUT_SUCCESS"] = "agent:logoutSuccess";
|
|
130
|
+
AGENT_EVENTS["AGENT_LOGOUT_FAILED"] = "agent:logoutFailed";
|
|
131
|
+
AGENT_EVENTS["AGENT_DN_REGISTERED"] = "agent:dnRegistered";
|
|
132
|
+
AGENT_EVENTS["AGENT_RELOGIN_SUCCESS"] = "agent:reloginSuccess";
|
|
133
|
+
AGENT_EVENTS["AGENT_STATE_CHANGE_SUCCESS"] = "agent:stateChangeSuccess";
|
|
134
|
+
AGENT_EVENTS["AGENT_STATE_CHANGE_FAILED"] = "agent:stateChangeFailed";
|
|
135
|
+
return AGENT_EVENTS;
|
|
136
|
+
}({});
|
|
137
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AGENT_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {Msg} from '../core/GlobalTypes';\n\n/**\n * Response type received when an agent successfully logs out from the system\n * @public\n * @remarks\n * This type represents the response message sent by the server when an agent\n * successfully logs out. It includes essential details about the logout action\n * and the agent's final state.\n */\nexport type LogoutSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the logout request */\n trackingId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent (e.g., 'LoggedOut') */\n status: string;\n /** Detailed status information */\n subStatus: string;\n /** Identity of who initiated the logout if not the agent themselves */\n loggedOutBy?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type identifier for logout success event */\n type: 'AgentLogoutSuccess';\n}>;\n\n/**\n * Response type received when an agent successfully relogins to the system\n * @public\n * @remarks\n * Represents the response message when an agent successfully re-authenticates.\n * Contains comprehensive information about the agent's new session, including\n * their state, assigned channels, and device information.\n */\nexport type ReloginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the relogin request */\n trackingId: string;\n /** Auxiliary code ID for the agent's initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Directory number assigned to the agent */\n dn: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Indicates if login is via extension */\n isExtension: boolean;\n /** Current login status */\n status: 'LoggedIn';\n /** Current sub-status */\n subStatus: 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Reason for the last state change */\n lastStateChangeReason?: string;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n /** Type identifier for relogin success event */\n type: 'AgentReloginSuccess';\n}>;\n\n/**\n * Response type received when an agent's state is successfully changed\n * @public\n * @remarks\n * Contains information about the agent's new state, including who initiated\n * the change and timestamps for tracking state transitions.\n */\nexport type StateChangeSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the state change request */\n trackingId: string;\n /** Auxiliary code ID associated with the new state */\n auxCodeId: string;\n /** Current session ID of the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Current status of the agent */\n status: string;\n /** Detailed status indicating availability */\n subStatus: 'Available' | 'Idle';\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of current state change */\n lastStateChangeTimestamp: number;\n /** Type identifier for state change success event */\n type: 'AgentStateChangeSuccess';\n /** Identity of who initiated the state change */\n changedBy: string | null;\n /** ID of the user who initiated the change */\n changedById: string | null;\n /** Name of the user who initiated the change */\n changedByName: string | null;\n /** Reason for the state change */\n lastStateChangeReason: string;\n}>;\n\n/**\n * Response type received when an agent successfully logs into their station\n * @public\n * @remarks\n * Represents the success response when an agent logs into their workstation.\n * Includes details about the agent's initial state, assigned teams, and channels.\n */\nexport type StationLoginSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Map of channel types to channel IDs */\n channelsMap: Record<string, string[]>;\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n}>;\n\n/**\n * Extended response type for station login success that includes notification tracking\n * @public\n * @remarks\n * Similar to StationLoginSuccess but includes additional fields for notification\n * tracking and multimedia profile settings.\n */\nexport type StationLoginSuccessResponse = {\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the agent */\n agentId: string;\n /** Tracking ID for the station login request */\n trackingId: string;\n /** Auxiliary code ID for initial state */\n auxCodeId: string;\n /** ID of the team the agent belongs to */\n teamId: string;\n /** New session ID assigned to the agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** List of active interaction IDs */\n interactionIds: string[];\n /** Current login status */\n status: string;\n /** Current availability status */\n subStatus: 'Available' | 'Idle';\n /** ID of the site where the agent is located */\n siteId: string;\n /** Timestamp of last idle code change */\n lastIdleCodeChangeTimestamp: number;\n /** Timestamp of last state change */\n lastStateChangeTimestamp: number;\n /** Type of agent profile */\n profileType: string;\n /** Multimedia profile capacity settings */\n mmProfile: {\n /** Maximum concurrent chat capacity */\n chat: number;\n /** Maximum concurrent email capacity */\n email: number;\n /** Maximum concurrent social media capacity */\n social: number;\n /** Maximum concurrent voice call capacity */\n telephony: number;\n };\n /** Phone number for dialing */\n dialNumber?: string;\n /** List of roles assigned to the agent */\n roles?: string[];\n /** Session ID of the supervising agent if applicable */\n supervisorSessionId?: string;\n /** Type identifier for station login success event */\n type: 'AgentStationLoginSuccess';\n /** Tracking ID for notifications */\n notifsTrackingId: string;\n};\n\n/**\n * Extended response type for agent device type update success\n * @public\n * @remarks\n * Represents the response when an agent's device type is successfully updated.\n * Contains all the details of the agent's session and device configuration.\n */\nexport type DeviceTypeUpdateSuccess = Omit<StationLoginSuccessResponse, 'type'> & {\n type: 'AgentDeviceTypeUpdateSuccess';\n};\n/**\n * Parameters required for initiating an agent logout\n * @public\n * @remarks\n * Defines the parameters that can be provided when logging out an agent,\n * including the reason for logout which helps with reporting and auditing.\n */\nexport type Logout = {\n /** Reason for the logout action */\n logoutReason?:\n | 'User requested logout'\n | 'Inactivity Logout'\n | 'User requested agent device change';\n};\n\n/**\n * Represents the possible states an agent can be in\n * @public\n * @remarks\n * Defines the various states an agent can transition between during their session.\n * Common states include 'Available' (ready to handle interactions), 'Idle' (on break\n * or not ready), and 'RONA' (Response on No Answer).\n */\nexport type AgentState = 'Available' | 'Idle' | 'RONA' | string;\n\n/**\n * Parameters required for changing an agent's state\n * @public\n * @remarks\n * Defines the necessary information for transitioning an agent from one state to another.\n */\nexport type StateChange = {\n /** New state to transition the agent to */\n state: AgentState;\n /** Auxiliary code ID associated with the state change */\n auxCodeId: string;\n /** Reason for the state change */\n lastStateChangeReason?: string;\n /** ID of the agent whose state is being changed */\n agentId?: string;\n};\n\n/**\n * Parameters required for agent station login\n * @public\n * @remarks\n * Contains all the necessary information for logging an agent into their workstation,\n * including team assignments, roles, and device configurations.\n */\nexport type UserStationLogin = {\n /** Phone number for dialing */\n dialNumber?: string | null;\n /** Directory number */\n dn?: string | null;\n /** ID of the team the agent belongs to */\n teamId: string | null;\n /** Name of the team */\n teamName: string | null;\n /** List of roles assigned to the agent */\n roles?: Array<string>;\n /** ID of the site where the agent is located */\n siteId: string;\n /** Indicates if agent uses a different DN than their assigned one */\n usesOtherDN: boolean;\n /** ID of the agent's skill profile */\n skillProfileId?: string;\n /** ID of the initial auxiliary state code */\n auxCodeId: string;\n /** Indicates if login is via extension */\n isExtension?: boolean;\n /** Type of device being used */\n deviceType?: DeviceType;\n /** Unique identifier of the device */\n deviceId?: string | null;\n /** Flag indicating if emergency modal was shown */\n isEmergencyModalAlreadyDisplayed?: boolean;\n};\n\n/**\n * Available options for agent login methods\n * @public\n * @remarks\n * Defines the supported methods for agent login:\n * - AGENT_DN: Login using agent's direct number\n * - EXTENSION: Login using extension number\n * - BROWSER: Browser-based login\n */\nexport type LoginOption = 'AGENT_DN' | 'EXTENSION' | 'BROWSER';\n\n/**\n * Type of device used for agent login\n * @public\n * @remarks\n * Represents the type of device being used for login. Can be one of the standard\n * LoginOptions or a custom device type string.\n */\nexport type DeviceType = LoginOption | string;\n\n/**\n * Parameters for retrieving buddy agent information\n * @public\n * @remarks\n * Defines the criteria for fetching information about other agents (buddies)\n * in the system, allowing filtering by profile, media type, and state.\n */\nexport type BuddyAgents = {\n agentProfileId: string;\n mediaType: string;\n /** Filter for agent state eg : Available | Idle */\n state?: string;\n};\n\n/**\n * Detailed information about a buddy agent\n * @public\n * @remarks\n * Contains comprehensive information about a buddy agent including their\n * current state, assignments, and contact information.\n */\nexport type BuddyDetails = {\n agentId: string;\n state: string;\n teamId: string;\n dn: string;\n agentName: string;\n siteId: string;\n};\n\n/**\n * Response type received when successfully retrieving buddy agent information\n * @public\n * @remarks\n * Contains the list of buddy agents and their details returned from a buddy\n * agent lookup request. Used for monitoring team member statuses and availability.\n */\nexport type BuddyAgentsSuccess = Msg<{\n /** Message type identifier for agent desktop events */\n eventType: 'AgentDesktopMessage';\n /** Unique identifier of the requesting agent */\n agentId: string;\n /** Tracking ID for the buddy list request */\n trackingId: string;\n /** Current session ID of the requesting agent */\n agentSessionId: string;\n /** Organization ID the agent belongs to */\n orgId: string;\n /** Type identifier for buddy agents response */\n type: 'BuddyAgents';\n /** List of buddy agents and their details */\n agentList: Array<BuddyDetails>;\n}>;\n\n/**\n * Events emitted by the agent service for various state changes and actions\n * @public\n * @remarks\n * Enumeration of all possible events that can be emitted by the agent service.\n * These events can be used to track and respond to changes in agent state,\n * login status, and other important agent-related activities.\n */\nexport enum AGENT_EVENTS {\n /** Emitted when an agent's state changes (e.g., Available to Idle) */\n AGENT_STATE_CHANGE = 'agent:stateChange',\n\n /** Emitted when multiple logins are detected for the same agent */\n AGENT_MULTI_LOGIN = 'agent:multiLogin',\n\n /** Emitted when an agent successfully logs into their station */\n AGENT_STATION_LOGIN_SUCCESS = 'agent:stationLoginSuccess',\n\n /** Emitted when station login attempt fails */\n AGENT_STATION_LOGIN_FAILED = 'agent:stationLoginFailed',\n\n /** Emitted when an agent successfully logs out */\n AGENT_LOGOUT_SUCCESS = 'agent:logoutSuccess',\n\n /** Emitted when logout attempt fails */\n AGENT_LOGOUT_FAILED = 'agent:logoutFailed',\n\n /** Emitted when an agent's directory number is successfully registered */\n AGENT_DN_REGISTERED = 'agent:dnRegistered',\n\n /** Emitted when an agent successfully re-authenticates */\n AGENT_RELOGIN_SUCCESS = 'agent:reloginSuccess',\n\n /** Emitted when agent state change is successful */\n AGENT_STATE_CHANGE_SUCCESS = 'agent:stateChangeSuccess',\n\n /** Emitted when agent state change attempt fails */\n AGENT_STATE_CHANGE_FAILED = 'agent:stateChangeFailed',\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAoDA;AACA;AACA;AACA;AACA;AACA;AACA;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYA,YAAY,GAAAC,OAAA,CAAAD,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseAgentConfigs = parseAgentConfigs;
|
|
7
|
+
var _constants = require("../core/constants");
|
|
8
|
+
var _types = require("./types");
|
|
9
|
+
/**
|
|
10
|
+
* Get the URL mapping for the given name
|
|
11
|
+
* @param {Array<URLMapping>} urlMappings
|
|
12
|
+
* @param {string} name
|
|
13
|
+
* @returns {string}
|
|
14
|
+
*/
|
|
15
|
+
const getUrlMapping = (urlMappings, name) => {
|
|
16
|
+
const mappedUrl = urlMappings.find(mapping => mapping.name === name)?.url;
|
|
17
|
+
return mappedUrl || '';
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get the MSFT and Webex configuration
|
|
22
|
+
* @param {DesktopProfileResponse} agentProfileData
|
|
23
|
+
* @returns {Object}
|
|
24
|
+
*/
|
|
25
|
+
const getMsftConfig = agentProfileData => {
|
|
26
|
+
return {
|
|
27
|
+
showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,
|
|
28
|
+
stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the Webex configuration
|
|
34
|
+
* @param {DesktopProfileResponse} agentProfileData
|
|
35
|
+
* @returns {Object}
|
|
36
|
+
*/
|
|
37
|
+
const getWebexConfig = agentProfileData => {
|
|
38
|
+
return {
|
|
39
|
+
showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,
|
|
40
|
+
stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get the default agent DN
|
|
46
|
+
* @param {string} agentDNValidation
|
|
47
|
+
* @returns {boolean}
|
|
48
|
+
*/
|
|
49
|
+
const getDefaultAgentDN = agentDNValidation => {
|
|
50
|
+
return agentDNValidation === 'PROVISIONED_VALUE';
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get the filtered dialplan entries
|
|
55
|
+
* @param {Array<DialPlanEntity>} dialPlanData
|
|
56
|
+
* @param {Array<string>} profileDialPlans
|
|
57
|
+
* @returns {Array<Entity>}
|
|
58
|
+
*/
|
|
59
|
+
const getFilteredDialplanEntries = (dialPlanData, profileDialPlans) => {
|
|
60
|
+
const dialPlanEntries = [];
|
|
61
|
+
dialPlanData.forEach(dailPlan => {
|
|
62
|
+
if (profileDialPlans.includes(dailPlan.id)) {
|
|
63
|
+
const filteredPlan = {
|
|
64
|
+
regex: dailPlan.regularExpression,
|
|
65
|
+
prefix: dailPlan.prefix,
|
|
66
|
+
strippedChars: dailPlan.strippedChars,
|
|
67
|
+
name: dailPlan.name
|
|
68
|
+
};
|
|
69
|
+
dialPlanEntries.push(filteredPlan);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return dialPlanEntries;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get the filtered aux codes
|
|
77
|
+
* @param {Array<AuxCode>} auxCodes
|
|
78
|
+
* @param {AuxCodeType} type
|
|
79
|
+
* @param {Array<string>} specificCodes
|
|
80
|
+
* @returns {Array<Entity>}
|
|
81
|
+
*/
|
|
82
|
+
const getFilterAuxCodes = (auxCodes, type, specificCodes) => {
|
|
83
|
+
const filteredAuxCodes = [];
|
|
84
|
+
auxCodes.forEach(auxCode => {
|
|
85
|
+
if (auxCode.workTypeCode === type && auxCode.active && (specificCodes.length === 0 || specificCodes.includes(auxCode.id))) {
|
|
86
|
+
filteredAuxCodes.push({
|
|
87
|
+
id: auxCode.id,
|
|
88
|
+
name: auxCode.name,
|
|
89
|
+
isSystem: auxCode.isSystemCode,
|
|
90
|
+
isDefault: auxCode.defaultCode
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return filteredAuxCodes;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get the default wrapup code
|
|
99
|
+
* @param {Array<Entity>} wrapUpReasonList
|
|
100
|
+
* @returns {Entity}
|
|
101
|
+
*/
|
|
102
|
+
function getDefaultWrapUpCode(wrapUpReasonList) {
|
|
103
|
+
return wrapUpReasonList?.find(c => c.isDefault);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Parse the agent configurations
|
|
108
|
+
* @param {Object} profileData
|
|
109
|
+
* @returns {Profile}
|
|
110
|
+
*/
|
|
111
|
+
function parseAgentConfigs(profileData) {
|
|
112
|
+
const {
|
|
113
|
+
userData,
|
|
114
|
+
teamData,
|
|
115
|
+
tenantData,
|
|
116
|
+
orgInfoData,
|
|
117
|
+
auxCodes,
|
|
118
|
+
orgSettingsData,
|
|
119
|
+
agentProfileData,
|
|
120
|
+
dialPlanData,
|
|
121
|
+
urlMapping
|
|
122
|
+
} = profileData;
|
|
123
|
+
const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled ? tenantData.timeoutDesktopInactivityMins : null;
|
|
124
|
+
const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled ? agentProfileData.timeoutDesktopInactivityMins : tenantDataTimeout;
|
|
125
|
+
const wrapupCodes = getFilterAuxCodes(auxCodes, _types.WRAP_UP_CODE, agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes);
|
|
126
|
+
const idleCodes = getFilterAuxCodes(auxCodes, _types.IDLE_CODE, agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes);
|
|
127
|
+
idleCodes.push({
|
|
128
|
+
id: '0',
|
|
129
|
+
name: 'Available',
|
|
130
|
+
isSystem: false,
|
|
131
|
+
isDefault: false
|
|
132
|
+
}); // pushing available state to idle codes
|
|
133
|
+
|
|
134
|
+
const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);
|
|
135
|
+
const finalData = {
|
|
136
|
+
teams: teamData,
|
|
137
|
+
defaultDn: userData.defaultDialledNumber,
|
|
138
|
+
forceDefaultDn: tenantData.forceDefaultDn,
|
|
139
|
+
forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),
|
|
140
|
+
regexUS: tenantData.dnDefaultRegex,
|
|
141
|
+
regexOther: tenantData.dnOtherRegex,
|
|
142
|
+
agentId: userData.ciUserId,
|
|
143
|
+
agentName: `${userData.firstName} ${userData.lastName}`,
|
|
144
|
+
agentMailId: userData.email,
|
|
145
|
+
agentProfileID: userData.agentProfileId,
|
|
146
|
+
autoAnswer: agentProfileData.autoAnswer,
|
|
147
|
+
dialPlan: agentProfileData.dialPlanEnabled ? {
|
|
148
|
+
type: 'adhocDial',
|
|
149
|
+
dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans)
|
|
150
|
+
} : undefined,
|
|
151
|
+
multimediaProfileId: profileData.multimediaProfileId,
|
|
152
|
+
skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,
|
|
153
|
+
siteId: userData.siteId,
|
|
154
|
+
enterpriseId: orgInfoData.tenantId,
|
|
155
|
+
tenantTimezone: orgInfoData.timezone,
|
|
156
|
+
privacyShieldVisible: tenantData.privacyShieldVisible,
|
|
157
|
+
organizationIdleCodes: [],
|
|
158
|
+
// TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),
|
|
159
|
+
idleCodesAccess: agentProfileData.accessIdleCode,
|
|
160
|
+
idleCodes,
|
|
161
|
+
wrapupCodes,
|
|
162
|
+
wrapUpData: {
|
|
163
|
+
wrapUpProps: {
|
|
164
|
+
autoWrapup: agentProfileData.autoWrapUp,
|
|
165
|
+
autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,
|
|
166
|
+
lastAgentRoute: agentProfileData.lastAgentRouting,
|
|
167
|
+
wrapUpCodeAccess: agentProfileData.accessWrapUpCode,
|
|
168
|
+
wrapUpReasonList: wrapupCodes,
|
|
169
|
+
allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
defaultWrapupCode: defaultWrapUpData?.id ?? '',
|
|
173
|
+
isOutboundEnabledForTenant: tenantData.outdialEnabled,
|
|
174
|
+
isOutboundEnabledForAgent: agentProfileData.outdialEnabled,
|
|
175
|
+
isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,
|
|
176
|
+
isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,
|
|
177
|
+
outDialEp: agentProfileData.outdialEntryPointId,
|
|
178
|
+
isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,
|
|
179
|
+
isEndCallEnabled: tenantData.endCallEnabled,
|
|
180
|
+
isEndConsultEnabled: tenantData.endConsultEnabled,
|
|
181
|
+
callVariablesSuppressed: tenantData.callVariablesSuppressed,
|
|
182
|
+
agentDbId: userData.dbId,
|
|
183
|
+
allowConsultToQueue: agentProfileData.consultToQueue,
|
|
184
|
+
agentPersonalStatsEnabled: agentProfileData.viewableStatistics ? agentProfileData.viewableStatistics.agentStats : false,
|
|
185
|
+
addressBookId: agentProfileData.addressBookId,
|
|
186
|
+
outdialANIId: agentProfileData.outdialANIId,
|
|
187
|
+
analyserUserId: userData.id,
|
|
188
|
+
urlMappings: {
|
|
189
|
+
acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),
|
|
190
|
+
acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL')
|
|
191
|
+
},
|
|
192
|
+
isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,
|
|
193
|
+
timeoutDesktopInactivityMins: inactivityTimeoutTimer,
|
|
194
|
+
loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],
|
|
195
|
+
webRtcEnabled: orgSettingsData.webRtcEnabled,
|
|
196
|
+
maskSensitiveData: orgSettingsData.maskSensitiveData ? orgSettingsData.maskSensitiveData : false,
|
|
197
|
+
microsoftConfig: getMsftConfig(agentProfileData),
|
|
198
|
+
webexConfig: getWebexConfig(agentProfileData),
|
|
199
|
+
lostConnectionRecoveryTimeout: tenantData.lostConnectionRecoveryTimeout || _constants.LOST_CONNECTION_RECOVERY_TIMEOUT
|
|
200
|
+
};
|
|
201
|
+
return finalData;
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=Util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_constants","require","_types","getUrlMapping","urlMappings","name","mappedUrl","find","mapping","url","getMsftConfig","agentProfileData","showUserDetailsMS","stateSynchronizationMS","getWebexConfig","showUserDetailsWebex","stateSynchronizationWebex","getDefaultAgentDN","agentDNValidation","getFilteredDialplanEntries","dialPlanData","profileDialPlans","dialPlanEntries","forEach","dailPlan","includes","id","filteredPlan","regex","regularExpression","prefix","strippedChars","push","getFilterAuxCodes","auxCodes","type","specificCodes","filteredAuxCodes","auxCode","workTypeCode","active","length","isSystem","isSystemCode","isDefault","defaultCode","getDefaultWrapUpCode","wrapUpReasonList","c","parseAgentConfigs","profileData","userData","teamData","tenantData","orgInfoData","orgSettingsData","urlMapping","tenantDataTimeout","timeoutDesktopInactivityEnabled","timeoutDesktopInactivityMins","inactivityTimeoutTimer","timeoutDesktopInactivityCustomEnabled","wrapupCodes","WRAP_UP_CODE","accessWrapUpCode","wrapUpCodes","idleCodes","IDLE_CODE","accessIdleCode","defaultWrapUpData","finalData","teams","defaultDn","defaultDialledNumber","forceDefaultDn","forceDefaultDnForAgent","regexUS","dnDefaultRegex","regexOther","dnOtherRegex","agentId","ciUserId","agentName","firstName","lastName","agentMailId","email","agentProfileID","agentProfileId","autoAnswer","dialPlan","dialPlanEnabled","dialPlanEntity","dialPlans","undefined","multimediaProfileId","skillProfileId","siteId","enterpriseId","tenantId","tenantTimezone","timezone","privacyShieldVisible","organizationIdleCodes","idleCodesAccess","wrapUpData","wrapUpProps","autoWrapup","autoWrapUp","autoWrapupInterval","autoWrapAfterSeconds","lastAgentRoute","lastAgentRouting","wrapUpCodeAccess","allowCancelAutoWrapup","allowAutoWrapUpExtension","defaultWrapupCode","isOutboundEnabledForTenant","outdialEnabled","isOutboundEnabledForAgent","isAdhocDialingEnabled","isAgentAvailableAfterOutdial","agentAvailableAfterOutdial","outDialEp","outdialEntryPointId","isCampaignManagementEnabled","campaignManagerEnabled","isEndCallEnabled","endCallEnabled","isEndConsultEnabled","endConsultEnabled","callVariablesSuppressed","agentDbId","dbId","allowConsultToQueue","consultToQueue","agentPersonalStatsEnabled","viewableStatistics","agentStats","addressBookId","outdialANIId","analyserUserId","acqueonApiUrl","acqueonConsoleUrl","isTimeoutDesktopInactivityEnabled","loginVoiceOptions","webRtcEnabled","maskSensitiveData","microsoftConfig","webexConfig","lostConnectionRecoveryTimeout","LOST_CONNECTION_RECOVERY_TIMEOUT"],"sources":["Util.ts"],"sourcesContent":["import {LOST_CONNECTION_RECOVERY_TIMEOUT} from '../core/constants';\nimport {\n AgentResponse,\n AuxCode,\n AuxCodeType,\n DesktopProfileResponse,\n DialPlanEntity,\n Entity,\n IDLE_CODE,\n OrgInfo,\n OrgSettings,\n Profile,\n Team,\n TenantData,\n URLMapping,\n WRAP_UP_CODE,\n} from './types';\n\n/**\n * Get the URL mapping for the given name\n * @param {Array<URLMapping>} urlMappings\n * @param {string} name\n * @returns {string}\n */\nconst getUrlMapping = (urlMappings: Array<URLMapping>, name: string) => {\n const mappedUrl = urlMappings.find((mapping) => mapping.name === name)?.url;\n\n return mappedUrl || '';\n};\n\n/**\n * Get the MSFT and Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getMsftConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsMS: agentProfileData.showUserDetailsMS ?? false,\n stateSynchronizationMS: agentProfileData.stateSynchronizationMS ?? false,\n };\n};\n\n/**\n * Get the Webex configuration\n * @param {DesktopProfileResponse} agentProfileData\n * @returns {Object}\n */\nconst getWebexConfig = (agentProfileData: DesktopProfileResponse) => {\n return {\n showUserDetailsWebex: agentProfileData.showUserDetailsWebex ?? false,\n stateSynchronizationWebex: agentProfileData.stateSynchronizationWebex ?? false,\n };\n};\n\n/**\n * Get the default agent DN\n * @param {string} agentDNValidation\n * @returns {boolean}\n */\nconst getDefaultAgentDN = (agentDNValidation: string) => {\n return agentDNValidation === 'PROVISIONED_VALUE';\n};\n\n/**\n * Get the filtered dialplan entries\n * @param {Array<DialPlanEntity>} dialPlanData\n * @param {Array<string>} profileDialPlans\n * @returns {Array<Entity>}\n */\nconst getFilteredDialplanEntries = (dialPlanData: DialPlanEntity[], profileDialPlans: string[]) => {\n const dialPlanEntries = [];\n dialPlanData.forEach((dailPlan: DialPlanEntity) => {\n if (profileDialPlans.includes(dailPlan.id)) {\n const filteredPlan = {\n regex: dailPlan.regularExpression,\n prefix: dailPlan.prefix,\n strippedChars: dailPlan.strippedChars,\n name: dailPlan.name,\n };\n dialPlanEntries.push(filteredPlan);\n }\n });\n\n return dialPlanEntries;\n};\n\n/**\n * Get the filtered aux codes\n * @param {Array<AuxCode>} auxCodes\n * @param {AuxCodeType} type\n * @param {Array<string>} specificCodes\n * @returns {Array<Entity>}\n */\nconst getFilterAuxCodes = (\n auxCodes: Array<AuxCode>,\n type: AuxCodeType,\n specificCodes: string[]\n) => {\n const filteredAuxCodes: Array<Entity> = [];\n auxCodes.forEach((auxCode: AuxCode) => {\n if (\n auxCode.workTypeCode === type &&\n auxCode.active &&\n (specificCodes.length === 0 || specificCodes.includes(auxCode.id))\n ) {\n filteredAuxCodes.push({\n id: auxCode.id,\n name: auxCode.name,\n isSystem: auxCode.isSystemCode,\n isDefault: auxCode.defaultCode,\n });\n }\n });\n\n return filteredAuxCodes;\n};\n\n/**\n * Get the default wrapup code\n * @param {Array<Entity>} wrapUpReasonList\n * @returns {Entity}\n */\nfunction getDefaultWrapUpCode(wrapUpReasonList: Entity[]) {\n return wrapUpReasonList?.find((c: Entity) => c.isDefault);\n}\n\n/**\n * Parse the agent configurations\n * @param {Object} profileData\n * @returns {Profile}\n */\nfunction parseAgentConfigs(profileData: {\n userData: AgentResponse;\n teamData: Team[];\n tenantData: TenantData;\n orgInfoData: OrgInfo;\n auxCodes: AuxCode[];\n orgSettingsData: OrgSettings;\n agentProfileData: DesktopProfileResponse;\n dialPlanData: DialPlanEntity[];\n urlMapping: URLMapping[];\n multimediaProfileId: string;\n}): Profile {\n const {\n userData,\n teamData,\n tenantData,\n orgInfoData,\n auxCodes,\n orgSettingsData,\n agentProfileData,\n dialPlanData,\n urlMapping,\n } = profileData;\n\n const tenantDataTimeout = tenantData.timeoutDesktopInactivityEnabled\n ? tenantData.timeoutDesktopInactivityMins\n : null;\n const inactivityTimeoutTimer = agentProfileData.timeoutDesktopInactivityCustomEnabled\n ? agentProfileData.timeoutDesktopInactivityMins\n : tenantDataTimeout;\n\n const wrapupCodes = getFilterAuxCodes(\n auxCodes,\n WRAP_UP_CODE,\n agentProfileData.accessWrapUpCode === 'ALL' ? [] : agentProfileData.wrapUpCodes\n );\n\n const idleCodes = getFilterAuxCodes(\n auxCodes,\n IDLE_CODE,\n agentProfileData.accessIdleCode === 'ALL' ? [] : agentProfileData.idleCodes\n );\n\n idleCodes.push({\n id: '0',\n name: 'Available',\n isSystem: false,\n isDefault: false,\n }); // pushing available state to idle codes\n\n const defaultWrapUpData = getDefaultWrapUpCode(wrapupCodes);\n\n const finalData = {\n teams: teamData,\n defaultDn: userData.defaultDialledNumber,\n forceDefaultDn: tenantData.forceDefaultDn,\n forceDefaultDnForAgent: getDefaultAgentDN(agentProfileData.agentDNValidation),\n regexUS: tenantData.dnDefaultRegex,\n regexOther: tenantData.dnOtherRegex,\n agentId: userData.ciUserId,\n agentName: `${userData.firstName} ${userData.lastName}`,\n agentMailId: userData.email,\n agentProfileID: userData.agentProfileId,\n autoAnswer: agentProfileData.autoAnswer,\n dialPlan: agentProfileData.dialPlanEnabled\n ? {\n type: 'adhocDial',\n dialPlanEntity: getFilteredDialplanEntries(dialPlanData, agentProfileData.dialPlans),\n }\n : undefined,\n multimediaProfileId: profileData.multimediaProfileId,\n skillProfileId: userData.skillProfileId ? userData.skillProfileId : null,\n siteId: userData.siteId,\n enterpriseId: orgInfoData.tenantId,\n tenantTimezone: orgInfoData.timezone,\n privacyShieldVisible: tenantData.privacyShieldVisible,\n organizationIdleCodes: [], // TODO: for supervisor, getOrgFilteredIdleCodes(auxCodes, false),\n idleCodesAccess: agentProfileData.accessIdleCode as 'ALL' | 'SPECIFIC',\n idleCodes,\n wrapupCodes,\n wrapUpData: {\n wrapUpProps: {\n autoWrapup: agentProfileData.autoWrapUp,\n autoWrapupInterval: agentProfileData.autoWrapAfterSeconds,\n lastAgentRoute: agentProfileData.lastAgentRouting,\n wrapUpCodeAccess: agentProfileData.accessWrapUpCode,\n wrapUpReasonList: wrapupCodes,\n allowCancelAutoWrapup: agentProfileData.allowAutoWrapUpExtension,\n },\n },\n defaultWrapupCode: defaultWrapUpData?.id ?? '',\n isOutboundEnabledForTenant: tenantData.outdialEnabled,\n isOutboundEnabledForAgent: agentProfileData.outdialEnabled,\n isAdhocDialingEnabled: agentProfileData.dialPlanEnabled,\n isAgentAvailableAfterOutdial: agentProfileData.agentAvailableAfterOutdial,\n outDialEp: agentProfileData.outdialEntryPointId,\n isCampaignManagementEnabled: orgSettingsData.campaignManagerEnabled,\n isEndCallEnabled: tenantData.endCallEnabled,\n isEndConsultEnabled: tenantData.endConsultEnabled,\n callVariablesSuppressed: tenantData.callVariablesSuppressed,\n agentDbId: userData.dbId,\n allowConsultToQueue: agentProfileData.consultToQueue,\n agentPersonalStatsEnabled: agentProfileData.viewableStatistics\n ? agentProfileData.viewableStatistics.agentStats\n : false,\n addressBookId: agentProfileData.addressBookId,\n outdialANIId: agentProfileData.outdialANIId,\n analyserUserId: userData.id,\n\n urlMappings: {\n acqueonApiUrl: getUrlMapping(urlMapping, 'ACQUEON_API_URL'),\n acqueonConsoleUrl: getUrlMapping(urlMapping, 'ACQUEON_CONSOLE_URL'),\n },\n isTimeoutDesktopInactivityEnabled: tenantData.timeoutDesktopInactivityEnabled,\n timeoutDesktopInactivityMins: inactivityTimeoutTimer,\n loginVoiceOptions: agentProfileData.loginVoiceOptions ?? [],\n webRtcEnabled: orgSettingsData.webRtcEnabled,\n maskSensitiveData: orgSettingsData.maskSensitiveData\n ? orgSettingsData.maskSensitiveData\n : false,\n microsoftConfig: getMsftConfig(agentProfileData),\n webexConfig: getWebexConfig(agentProfileData),\n lostConnectionRecoveryTimeout:\n tenantData.lostConnectionRecoveryTimeout || LOST_CONNECTION_RECOVERY_TIMEOUT,\n };\n\n return finalData;\n}\n\nexport {parseAgentConfigs};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAACC,WAA8B,EAAEC,IAAY,K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ACxBC,mBAAmB,EAAE3H,gBAAgB,CAAC4H,cAAc;IACpDC,yBAAyB,EAAE7H,gBAAgB,CAAC8H,kBAAkB,GAC1D9H,gBAAgB,CAAC8H,kBAAkB,CAACC,UAAU,GAC9C,KAAK;IACTC,aAAa,EAAEhI,gBAAgB,CAACgI,aAAa;IAC7CC,YAAY,EAAEjI,gBAAgB,CAACiI,YAAY;IAC3CC,cAAc,EAAE1F,QAAQ,CAACzB,EAAE;IAE3BtB,WAAW,EAAE;MACX0I,aAAa,EAAE3I,aAAa,CAACqD,UAAU,EAAE,iBAAiB,CAAC;MAC3DuF,iBAAiB,EAAE5I,aAAa,CAACqD,UAAU,EAAE,qBAAqB;IACpE,CAAC;IACDwF,iCAAiC,EAAE3F,UAAU,CAACK,+BAA+B;IAC7EC,4BAA4B,EAAEC,sBAAsB;IACpDqF,iBAAiB,EAAEtI,gBAAgB,CAACsI,iBAAiB,IAAI,EAAE;IAC3DC,aAAa,EAAE3F,eAAe,CAAC2F,aAAa;IAC5CC,iBAAiB,EAAE5F,eAAe,CAAC4F,iBAAiB,GAChD5F,eAAe,CAAC4F,iBAAiB,GACjC,KAAK;IACTC,eAAe,EAAE1I,aAAa,CAACC,gBAAgB,CAAC;IAChD0I,WAAW,EAAEvI,cAAc,CAACH,gBAAgB,CAAC;IAC7C2I,6BAA6B,EAC3BjG,UAAU,CAACiG,6BAA6B,IAAIC;EAChD,CAAC;EAED,OAAOjF,SAAS;AAClB"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.endPointMap = exports.METHODS = exports.DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE = exports.DEFAULT_AUXCODE_ATTRIBUTES = exports.AGENT_STATE_AVAILABLE_ID = exports.AGENT_STATE_AVAILABLE_DESCRIPTION = exports.AGENT_STATE_AVAILABLE = void 0;
|
|
7
|
+
// making query params configurable for List Teams and List Aux Codes API
|
|
8
|
+
const DEFAULT_PAGE = exports.DEFAULT_PAGE = 0;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Default page size for paginated API requests.
|
|
12
|
+
* @type {number}
|
|
13
|
+
* @public
|
|
14
|
+
* @example
|
|
15
|
+
* const pageSize = DEFAULT_PAGE_SIZE; // 100
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 100;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Agent state ID for 'Available'.
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @public
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
const AGENT_STATE_AVAILABLE_ID = exports.AGENT_STATE_AVAILABLE_ID = '0';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Agent state label for 'Available'.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @public
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
34
|
+
const AGENT_STATE_AVAILABLE = exports.AGENT_STATE_AVAILABLE = 'Available';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Description for the 'Available' agent state.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @public
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
const AGENT_STATE_AVAILABLE_DESCRIPTION = exports.AGENT_STATE_AVAILABLE_DESCRIPTION = 'Agent is available to receive calls';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Default attributes for auxiliary code API requests.
|
|
46
|
+
* @type {string[]}
|
|
47
|
+
* @public
|
|
48
|
+
* @ignore
|
|
49
|
+
*/
|
|
50
|
+
const DEFAULT_AUXCODE_ATTRIBUTES = exports.DEFAULT_AUXCODE_ATTRIBUTES = ['id', 'isSystemCode', 'name', 'defaultCode', 'workTypeCode', 'active'];
|
|
51
|
+
|
|
52
|
+
// Method names for config services
|
|
53
|
+
const METHODS = exports.METHODS = {
|
|
54
|
+
// AgentConfigService methods
|
|
55
|
+
GET_AGENT_CONFIG: 'getAgentConfig',
|
|
56
|
+
GET_USER_USING_CI: 'getUserUsingCI',
|
|
57
|
+
GET_DESKTOP_PROFILE_BY_ID: 'getDesktopProfileById',
|
|
58
|
+
GET_MULTIMEDIA_PROFILE_BY_ID: 'getMultimediaProfileById',
|
|
59
|
+
GET_LIST_OF_TEAMS: 'getListOfTeams',
|
|
60
|
+
GET_ALL_TEAMS: 'getAllTeams',
|
|
61
|
+
GET_LIST_OF_AUX_CODES: 'getListOfAuxCodes',
|
|
62
|
+
GET_ALL_AUX_CODES: 'getAllAuxCodes',
|
|
63
|
+
GET_SITE_INFO: 'getSiteInfo',
|
|
64
|
+
GET_ORG_INFO: 'getOrgInfo',
|
|
65
|
+
GET_ORGANIZATION_SETTING: 'getOrganizationSetting',
|
|
66
|
+
GET_TENANT_DATA: 'getTenantData',
|
|
67
|
+
GET_URL_MAPPING: 'getURLMapping',
|
|
68
|
+
GET_DIAL_PLAN_DATA: 'getDialPlanData',
|
|
69
|
+
GET_QUEUES: 'getQueues',
|
|
70
|
+
// Util methods
|
|
71
|
+
PARSE_AGENT_CONFIGS: 'parseAgentConfigs',
|
|
72
|
+
GET_URL_MAPPING_UTIL: 'getUrlMapping',
|
|
73
|
+
GET_MSFT_CONFIG: 'getMsftConfig',
|
|
74
|
+
GET_WEBEX_CONFIG: 'getWebexConfig',
|
|
75
|
+
GET_DEFAULT_AGENT_DN: 'getDefaultAgentDN',
|
|
76
|
+
GET_FILTERED_DIALPLAN_ENTRIES: 'getFilteredDialplanEntries',
|
|
77
|
+
GET_FILTER_AUX_CODES: 'getFilterAuxCodes',
|
|
78
|
+
GET_DEFAULT_WRAP_UP_CODE: 'getDefaultWrapUpCode'
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Maps API endpoint names to functions that generate endpoint URLs for various organization resources.
|
|
83
|
+
* @public
|
|
84
|
+
* @example
|
|
85
|
+
* const url = endPointMap.userByCI('org123', 'agent456');
|
|
86
|
+
*/
|
|
87
|
+
const endPointMap = exports.endPointMap = {
|
|
88
|
+
/**
|
|
89
|
+
* Gets the endpoint for a user by CI user ID.
|
|
90
|
+
* @param orgId - Organization ID.
|
|
91
|
+
* @param agentId - Agent ID.
|
|
92
|
+
* @returns The endpoint URL string.
|
|
93
|
+
* @public
|
|
94
|
+
* @example
|
|
95
|
+
* const url = endPointMap.userByCI('org123', 'agent456');
|
|
96
|
+
* @ignore
|
|
97
|
+
*/
|
|
98
|
+
userByCI: (orgId, agentId) => `organization/${orgId}/user/by-ci-user-id/${agentId}`,
|
|
99
|
+
/**
|
|
100
|
+
* Gets the endpoint for a desktop profile.
|
|
101
|
+
* @param orgId - Organization ID.
|
|
102
|
+
* @param desktopProfileId - Desktop profile ID.
|
|
103
|
+
* @returns The endpoint URL string.
|
|
104
|
+
* @public
|
|
105
|
+
* @example
|
|
106
|
+
* const url = endPointMap.desktopProfile('org123', 'profile789');
|
|
107
|
+
* @ignore
|
|
108
|
+
*/
|
|
109
|
+
desktopProfile: (orgId, desktopProfileId) => `organization/${orgId}/agent-profile/${desktopProfileId}`,
|
|
110
|
+
/**
|
|
111
|
+
* Gets the endpoint for a multimedia profile.
|
|
112
|
+
* @param orgId - Organization ID.
|
|
113
|
+
* @param multimediaProfileId - Multimedia profile ID.
|
|
114
|
+
* @returns The endpoint URL string.
|
|
115
|
+
* @public
|
|
116
|
+
* @example
|
|
117
|
+
* const url = endPointMap.multimediaProfile('org123', 'multi456');
|
|
118
|
+
* @ignore
|
|
119
|
+
*/
|
|
120
|
+
multimediaProfile: (orgId, multimediaProfileId) => `organization/${orgId}/multimedia-profile/${multimediaProfileId}`,
|
|
121
|
+
/**
|
|
122
|
+
* Gets the endpoint for listing teams with optional filters.
|
|
123
|
+
* @param orgId - Organization ID.
|
|
124
|
+
* @param page - Page number.
|
|
125
|
+
* @param pageSize - Page size.
|
|
126
|
+
* @param filter - Array of team IDs to filter.
|
|
127
|
+
* @returns The endpoint URL string.
|
|
128
|
+
* @public
|
|
129
|
+
* @example
|
|
130
|
+
* const url = endPointMap.listTeams('org123', 0, 100, ['team1', 'team2']);
|
|
131
|
+
* @ignore
|
|
132
|
+
*/
|
|
133
|
+
listTeams: (orgId, page, pageSize, filter) => `organization/${orgId}/v2/team?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}`,
|
|
134
|
+
/**
|
|
135
|
+
* Gets the endpoint for listing auxiliary codes with optional filters and attributes.
|
|
136
|
+
* @param orgId - Organization ID.
|
|
137
|
+
* @param page - Page number.
|
|
138
|
+
* @param pageSize - Page size.
|
|
139
|
+
* @param filter - Array of auxiliary code IDs to filter.
|
|
140
|
+
* @param attributes - Array of attribute names to include.
|
|
141
|
+
* @returns The endpoint URL string.
|
|
142
|
+
* @public
|
|
143
|
+
* @example
|
|
144
|
+
* const url = endPointMap.listAuxCodes('org123', 0, 100, ['aux1'], ['id', 'name']);
|
|
145
|
+
* @ignore
|
|
146
|
+
*/
|
|
147
|
+
listAuxCodes: (orgId, page, pageSize, filter, attributes) => `organization/${orgId}/v2/auxiliary-code?page=${page}&pageSize=${pageSize}${filter && filter.length > 0 ? `&filter=id=in=(${filter})` : ''}&attributes=${attributes}`,
|
|
148
|
+
/**
|
|
149
|
+
* Gets the endpoint for organization info.
|
|
150
|
+
* @param orgId - Organization ID.
|
|
151
|
+
* @returns The endpoint URL string.
|
|
152
|
+
* @public
|
|
153
|
+
* @example
|
|
154
|
+
* const url = endPointMap.orgInfo('org123');
|
|
155
|
+
* @ignore
|
|
156
|
+
*/
|
|
157
|
+
orgInfo: orgId => `organization/${orgId}`,
|
|
158
|
+
/**
|
|
159
|
+
* Gets the endpoint for organization settings.
|
|
160
|
+
* @param orgId - Organization ID.
|
|
161
|
+
* @returns The endpoint URL string.
|
|
162
|
+
* @public
|
|
163
|
+
* @example
|
|
164
|
+
* const url = endPointMap.orgSettings('org123');
|
|
165
|
+
* @ignore
|
|
166
|
+
*/
|
|
167
|
+
orgSettings: orgId => `organization/${orgId}/v2/organization-setting?agentView=true`,
|
|
168
|
+
/**
|
|
169
|
+
* Gets the endpoint for site info.
|
|
170
|
+
* @param orgId - Organization ID.
|
|
171
|
+
* @param siteId - Site ID.
|
|
172
|
+
* @returns The endpoint URL string.
|
|
173
|
+
* @public
|
|
174
|
+
* @example
|
|
175
|
+
* const url = endPointMap.siteInfo('org123', 'site456');
|
|
176
|
+
* @ignore
|
|
177
|
+
*/
|
|
178
|
+
siteInfo: (orgId, siteId) => `organization/${orgId}/site/${siteId}`,
|
|
179
|
+
/**
|
|
180
|
+
* Gets the endpoint for tenant configuration data.
|
|
181
|
+
* @param orgId - Organization ID.
|
|
182
|
+
* @returns The endpoint URL string.
|
|
183
|
+
* @public
|
|
184
|
+
* @example
|
|
185
|
+
* const url = endPointMap.tenantData('org123');
|
|
186
|
+
* @ignore
|
|
187
|
+
*/
|
|
188
|
+
tenantData: orgId => `organization/${orgId}/v2/tenant-configuration?agentView=true`,
|
|
189
|
+
/**
|
|
190
|
+
* Gets the endpoint for organization URL mapping.
|
|
191
|
+
* @param orgId - Organization ID.
|
|
192
|
+
* @returns The endpoint URL string.
|
|
193
|
+
* @public
|
|
194
|
+
* @example
|
|
195
|
+
* const url = endPointMap.urlMapping('org123');
|
|
196
|
+
* @ignore
|
|
197
|
+
*/
|
|
198
|
+
urlMapping: orgId => `organization/${orgId}/v2/org-url-mapping?sort=name,ASC`,
|
|
199
|
+
/**
|
|
200
|
+
* Gets the endpoint for dial plan.
|
|
201
|
+
* @param orgId - Organization ID.
|
|
202
|
+
* @returns The endpoint URL string.
|
|
203
|
+
* @public
|
|
204
|
+
* @example
|
|
205
|
+
* const url = endPointMap.dialPlan('org123');
|
|
206
|
+
* @ignore
|
|
207
|
+
*/
|
|
208
|
+
dialPlan: orgId => `organization/${orgId}/dial-plan?agentView=true`,
|
|
209
|
+
/**
|
|
210
|
+
* Gets the endpoint for the queue list with custom query parameters.
|
|
211
|
+
* @param orgId - Organization ID.
|
|
212
|
+
* @param queryParams - Query parameters string.
|
|
213
|
+
* @returns The endpoint URL string.
|
|
214
|
+
* @public
|
|
215
|
+
* @example
|
|
216
|
+
* const url = endPointMap.queueList('org123', 'page=0&pageSize=10');
|
|
217
|
+
* @ignore
|
|
218
|
+
*/
|
|
219
|
+
queueList: (orgId, queryParams) => `organization/${orgId}/v2/contact-service-queue?${queryParams}`
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=constants.js.map
|