@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,323 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _events = _interopRequireDefault(require("events"));
|
|
8
|
+
var _calling = require("@webex/calling");
|
|
9
|
+
var _constants = require("../constants");
|
|
10
|
+
var _loggerProxy = _interopRequireDefault(require("../logger-proxy"));
|
|
11
|
+
var _constants2 = require("./constants");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
/**
|
|
14
|
+
* WebCallingService provides WebRTC calling functionality for Contact Center agents.
|
|
15
|
+
* It handles registration, call management, and media operations for voice interactions.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
class WebCallingService extends _events.default {
|
|
19
|
+
/**
|
|
20
|
+
* The CallingClient instance that manages WebRTC calling capabilities
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The Line instance that handles registration and incoming calls
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The current active call instance
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Reference to the WebexSDK instance
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The login option selected for this session
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Map that associates call IDs with task IDs for correlation
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Creates an instance of WebCallingService.
|
|
51
|
+
* @param {WebexSDK} webex - The Webex SDK instance
|
|
52
|
+
*/
|
|
53
|
+
constructor(webex) {
|
|
54
|
+
super();
|
|
55
|
+
this.webex = webex;
|
|
56
|
+
this.callTaskMap = new Map();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Sets the login option for the current session
|
|
61
|
+
* @param {LoginOption} loginOption - The login option to use
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
setLoginOption(loginOption) {
|
|
65
|
+
this.loginOption = loginOption;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Handles remote media track events from the call
|
|
70
|
+
* @param {MediaStreamTrack} track - The media track received
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
handleMediaEvent = track => {
|
|
74
|
+
this.emit(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, track);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Handles disconnect events from the call
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
handleDisconnectEvent = () => {
|
|
82
|
+
this.call.end();
|
|
83
|
+
this.cleanUpCall();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Registers event listeners for the current call
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
registerCallListeners() {
|
|
91
|
+
// TODO: Add remaining call listeners here
|
|
92
|
+
this.call.on(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleMediaEvent);
|
|
93
|
+
this.call.on(_calling.CALL_EVENT_KEYS.DISCONNECT, this.handleDisconnectEvent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Cleans up resources associated with the current call
|
|
98
|
+
* Removes event listeners and clears the call-task mapping
|
|
99
|
+
* @private
|
|
100
|
+
*/
|
|
101
|
+
cleanUpCall() {
|
|
102
|
+
if (this.call) {
|
|
103
|
+
this.call.off(_calling.CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleMediaEvent);
|
|
104
|
+
this.call.off(_calling.CALL_EVENT_KEYS.DISCONNECT, this.handleDisconnectEvent);
|
|
105
|
+
const callId = this.call.getCallId();
|
|
106
|
+
const taskId = this.getTaskIdForCall(callId);
|
|
107
|
+
if (taskId) {
|
|
108
|
+
this.callTaskMap.delete(callId);
|
|
109
|
+
}
|
|
110
|
+
this.call = null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves the RTMS domain to use for WebRTC connections
|
|
116
|
+
* First tries to get it from the service catalog, then falls back to default
|
|
117
|
+
* @private
|
|
118
|
+
* @returns {Promise<string>} The RTMS domain to use
|
|
119
|
+
*/
|
|
120
|
+
async getRTMSDomain() {
|
|
121
|
+
await this.webex.internal.services.waitForCatalog(_constants2.POST_AUTH);
|
|
122
|
+
const rtmsURL = this.webex.internal.services.get(_constants2.WCC_CALLING_RTMS_DOMAIN);
|
|
123
|
+
try {
|
|
124
|
+
const url = new URL(rtmsURL);
|
|
125
|
+
return url.hostname;
|
|
126
|
+
} catch (error) {
|
|
127
|
+
_loggerProxy.default.error(`Invalid URL from u2c catalogue: ${rtmsURL} so falling back to default domain`, {
|
|
128
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
129
|
+
method: _constants2.METHODS.GET_RTMS_DOMAIN
|
|
130
|
+
});
|
|
131
|
+
return _constants2.DEFAULT_RTMS_DOMAIN;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Registers the WebCalling line for receiving calls
|
|
137
|
+
* Sets up event listeners for line events and initializes the calling client
|
|
138
|
+
*
|
|
139
|
+
* @private
|
|
140
|
+
* @returns {Promise<void>} A promise that resolves when registration is complete
|
|
141
|
+
* @throws {Error} When registration times out
|
|
142
|
+
*/
|
|
143
|
+
async registerWebCallingLine() {
|
|
144
|
+
const rtmsDomain = await this.getRTMSDomain(); // get the RTMS domain from the u2c catalogue
|
|
145
|
+
|
|
146
|
+
const callingClientConfig = {
|
|
147
|
+
logger: {
|
|
148
|
+
level: _calling.LOGGER.INFO
|
|
149
|
+
},
|
|
150
|
+
serviceData: {
|
|
151
|
+
indicator: _calling.ServiceIndicator.CONTACT_CENTER,
|
|
152
|
+
domain: rtmsDomain
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
this.callingClient = await (0, _calling.createClient)(this.webex, callingClientConfig);
|
|
156
|
+
this.line = Object.values(this.callingClient.getLines())[0];
|
|
157
|
+
this.line.on(_calling.LINE_EVENTS.UNREGISTERED, () => {
|
|
158
|
+
_loggerProxy.default.log(`WxCC-SDK: Desktop unregistered successfully`, {
|
|
159
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
160
|
+
method: _constants2.METHODS.REGISTER_WEB_CALLING_LINE
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// Start listening for incoming calls
|
|
165
|
+
this.line.on(_calling.LINE_EVENTS.INCOMING_CALL, call => {
|
|
166
|
+
this.call = call;
|
|
167
|
+
this.emit(_calling.LINE_EVENTS.INCOMING_CALL, call);
|
|
168
|
+
});
|
|
169
|
+
return new Promise((resolve, reject) => {
|
|
170
|
+
const timeout = setTimeout(() => {
|
|
171
|
+
reject(new Error('WebCallingService Registration timed out'));
|
|
172
|
+
}, _constants.TIMEOUT_DURATION);
|
|
173
|
+
this.line.on(_calling.LINE_EVENTS.REGISTERED, deviceInfo => {
|
|
174
|
+
clearTimeout(timeout);
|
|
175
|
+
_loggerProxy.default.log(`WxCC-SDK: Desktop registered successfully, mobiusDeviceId: ${deviceInfo.mobiusDeviceId}`, {
|
|
176
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
177
|
+
method: _constants2.METHODS.REGISTER_WEB_CALLING_LINE
|
|
178
|
+
});
|
|
179
|
+
resolve();
|
|
180
|
+
});
|
|
181
|
+
this.line.register();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Deregisters the WebCalling line
|
|
187
|
+
* Cleans up any active calls and deregisters from the calling service
|
|
188
|
+
*
|
|
189
|
+
* @private
|
|
190
|
+
* @returns {Promise<void>} A promise that resolves when deregistration is complete
|
|
191
|
+
*/
|
|
192
|
+
async deregisterWebCallingLine() {
|
|
193
|
+
_loggerProxy.default.log(_constants2.DEREGISTER_WEBCALLING_LINE_MSG, {
|
|
194
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
195
|
+
method: _constants2.METHODS.DEREGISTER_WEB_CALLING_LINE
|
|
196
|
+
});
|
|
197
|
+
this.cleanUpCall();
|
|
198
|
+
this.line?.deregister();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Answers an incoming call with the provided audio stream
|
|
203
|
+
*
|
|
204
|
+
* @private
|
|
205
|
+
* @param {LocalMicrophoneStream} localAudioStream - The local microphone stream to use
|
|
206
|
+
* @param {string} taskId - The task ID associated with this call
|
|
207
|
+
* @throws {Error} If answering the call fails
|
|
208
|
+
*/
|
|
209
|
+
answerCall(localAudioStream, taskId) {
|
|
210
|
+
if (this.call) {
|
|
211
|
+
try {
|
|
212
|
+
_loggerProxy.default.info(`Call answered: ${taskId}`, {
|
|
213
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
214
|
+
method: _constants2.METHODS.ANSWER_CALL
|
|
215
|
+
});
|
|
216
|
+
this.call.answer(localAudioStream);
|
|
217
|
+
this.registerCallListeners();
|
|
218
|
+
} catch (error) {
|
|
219
|
+
_loggerProxy.default.error(`Failed to answer call for ${taskId}. Error: ${error}`, {
|
|
220
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
221
|
+
method: _constants2.METHODS.ANSWER_CALL
|
|
222
|
+
});
|
|
223
|
+
// Optionally, throw the error to allow the invoker to handle it
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
_loggerProxy.default.log(`Cannot answer a non WebRtc Call: ${taskId}`, {
|
|
228
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
229
|
+
method: _constants2.METHODS.ANSWER_CALL
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Toggles the mute state of the current call
|
|
236
|
+
*
|
|
237
|
+
* @private
|
|
238
|
+
* @param {LocalMicrophoneStream} localAudioStream - The local microphone stream to control
|
|
239
|
+
*/
|
|
240
|
+
muteUnmuteCall(localAudioStream) {
|
|
241
|
+
if (this.call) {
|
|
242
|
+
_loggerProxy.default.info('Call mute or unmute requested!', {
|
|
243
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
244
|
+
method: _constants2.METHODS.MUTE_UNMUTE_CALL
|
|
245
|
+
});
|
|
246
|
+
this.call.mute(localAudioStream);
|
|
247
|
+
} else {
|
|
248
|
+
_loggerProxy.default.log(`Cannot mute a non WebRtc Call`, {
|
|
249
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
250
|
+
method: _constants2.METHODS.MUTE_UNMUTE_CALL
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Checks if the current call is muted
|
|
257
|
+
*
|
|
258
|
+
* @private
|
|
259
|
+
* @returns {boolean} True if the call is muted, false otherwise or if no call exists
|
|
260
|
+
*/
|
|
261
|
+
isCallMuted() {
|
|
262
|
+
if (this.call) {
|
|
263
|
+
return this.call.isMuted();
|
|
264
|
+
}
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Declines or ends the current call
|
|
270
|
+
*
|
|
271
|
+
* @private
|
|
272
|
+
* @param {string} taskId - The task ID associated with this call
|
|
273
|
+
* @throws {Error} If ending the call fails
|
|
274
|
+
*/
|
|
275
|
+
declineCall(taskId) {
|
|
276
|
+
if (this.call) {
|
|
277
|
+
try {
|
|
278
|
+
_loggerProxy.default.info(`Call end requested: ${taskId}`, {
|
|
279
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
280
|
+
method: _constants2.METHODS.DECLINE_CALL
|
|
281
|
+
});
|
|
282
|
+
this.call.end();
|
|
283
|
+
this.cleanUpCall();
|
|
284
|
+
} catch (error) {
|
|
285
|
+
_loggerProxy.default.error(`Failed to end call: ${taskId}. Error: ${error}`, {
|
|
286
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
287
|
+
method: _constants2.METHODS.DECLINE_CALL
|
|
288
|
+
});
|
|
289
|
+
// Optionally, throw the error to allow the invoker to handle it
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
_loggerProxy.default.log(`Cannot end a non WebRtc Call: ${taskId}`, {
|
|
294
|
+
module: _constants.WEB_CALLING_SERVICE_FILE,
|
|
295
|
+
method: _constants2.METHODS.DECLINE_CALL
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Maps a call ID to a task ID for correlation
|
|
302
|
+
*
|
|
303
|
+
* @private
|
|
304
|
+
* @param {string} callId - The unique call identifier
|
|
305
|
+
* @param {string} taskId - The associated task identifier
|
|
306
|
+
*/
|
|
307
|
+
mapCallToTask(callId, taskId) {
|
|
308
|
+
this.callTaskMap.set(callId, taskId);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Gets the task ID associated with a call ID
|
|
313
|
+
*
|
|
314
|
+
* @private
|
|
315
|
+
* @param {string} callId - The call ID to look up
|
|
316
|
+
* @returns {string|undefined} The associated task ID or undefined if not found
|
|
317
|
+
*/
|
|
318
|
+
getTaskIdForCall(callId) {
|
|
319
|
+
return this.callTaskMap.get(callId);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
exports.default = WebCallingService;
|
|
323
|
+
//# sourceMappingURL=WebCallingService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_events","_interopRequireDefault","require","_calling","_constants","_loggerProxy","_constants2","obj","__esModule","default","WebCallingService","EventEmitter","constructor","webex","callTaskMap","Map","setLoginOption","loginOption","handleMediaEvent","track","emit","CALL_EVENT_KEYS","REMOTE_MEDIA","handleDisconnectEvent","call","end","cleanUpCall","registerCallListeners","on","DISCONNECT","off","callId","getCallId","taskId","getTaskIdForCall","delete","getRTMSDomain","internal","services","waitForCatalog","POST_AUTH","rtmsURL","get","WCC_CALLING_RTMS_DOMAIN","url","URL","hostname","error","LoggerProxy","module","WEB_CALLING_SERVICE_FILE","method","METHODS","GET_RTMS_DOMAIN","DEFAULT_RTMS_DOMAIN","registerWebCallingLine","rtmsDomain","callingClientConfig","logger","level","LOGGER","INFO","serviceData","indicator","ServiceIndicator","CONTACT_CENTER","domain","callingClient","createClient","line","Object","values","getLines","LINE_EVENTS","UNREGISTERED","log","REGISTER_WEB_CALLING_LINE","INCOMING_CALL","Promise","resolve","reject","timeout","setTimeout","Error","TIMEOUT_DURATION","REGISTERED","deviceInfo","clearTimeout","mobiusDeviceId","register","deregisterWebCallingLine","DEREGISTER_WEBCALLING_LINE_MSG","DEREGISTER_WEB_CALLING_LINE","deregister","answerCall","localAudioStream","info","ANSWER_CALL","answer","muteUnmuteCall","MUTE_UNMUTE_CALL","mute","isCallMuted","isMuted","declineCall","DECLINE_CALL","mapCallToTask","set","exports"],"sources":["WebCallingService.ts"],"sourcesContent":["import EventEmitter from 'events';\nimport {\n createClient,\n ICall,\n ICallingClient,\n ILine,\n LINE_EVENTS,\n ServiceIndicator,\n LocalMicrophoneStream,\n CALL_EVENT_KEYS,\n LOGGER,\n} from '@webex/calling';\nimport {LoginOption, WebexSDK} from '../types';\nimport {TIMEOUT_DURATION, WEB_CALLING_SERVICE_FILE} from '../constants';\nimport LoggerProxy from '../logger-proxy';\nimport {\n DEFAULT_RTMS_DOMAIN,\n POST_AUTH,\n WCC_CALLING_RTMS_DOMAIN,\n DEREGISTER_WEBCALLING_LINE_MSG,\n METHODS,\n} from './constants';\n\n/**\n * WebCallingService provides WebRTC calling functionality for Contact Center agents.\n * It handles registration, call management, and media operations for voice interactions.\n * @internal\n */\nexport default class WebCallingService extends EventEmitter {\n /**\n * The CallingClient instance that manages WebRTC calling capabilities\n * @private\n */\n private callingClient: ICallingClient;\n\n /**\n * The Line instance that handles registration and incoming calls\n * @private\n */\n private line: ILine;\n\n /**\n * The current active call instance\n * @private\n */\n private call: ICall | undefined;\n\n /**\n * Reference to the WebexSDK instance\n * @private\n */\n private webex: WebexSDK;\n\n /**\n * The login option selected for this session\n * @private\n */\n public loginOption: LoginOption;\n\n /**\n * Map that associates call IDs with task IDs for correlation\n * @private\n */\n private callTaskMap: Map<string, string>;\n\n /**\n * Creates an instance of WebCallingService.\n * @param {WebexSDK} webex - The Webex SDK instance\n */\n constructor(webex: WebexSDK) {\n super();\n this.webex = webex;\n this.callTaskMap = new Map();\n }\n\n /**\n * Sets the login option for the current session\n * @param {LoginOption} loginOption - The login option to use\n * @private\n */\n public setLoginOption(loginOption: LoginOption): void {\n this.loginOption = loginOption;\n }\n\n /**\n * Handles remote media track events from the call\n * @param {MediaStreamTrack} track - The media track received\n * @private\n */\n private handleMediaEvent = (track: MediaStreamTrack): void => {\n this.emit(CALL_EVENT_KEYS.REMOTE_MEDIA, track);\n };\n\n /**\n * Handles disconnect events from the call\n * @private\n */\n private handleDisconnectEvent = (): void => {\n this.call.end();\n this.cleanUpCall();\n };\n\n /**\n * Registers event listeners for the current call\n * @private\n */\n private registerCallListeners(): void {\n // TODO: Add remaining call listeners here\n this.call.on(CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleMediaEvent);\n this.call.on(CALL_EVENT_KEYS.DISCONNECT, this.handleDisconnectEvent);\n }\n\n /**\n * Cleans up resources associated with the current call\n * Removes event listeners and clears the call-task mapping\n * @private\n */\n public cleanUpCall(): void {\n if (this.call) {\n this.call.off(CALL_EVENT_KEYS.REMOTE_MEDIA, this.handleMediaEvent);\n this.call.off(CALL_EVENT_KEYS.DISCONNECT, this.handleDisconnectEvent);\n const callId = this.call.getCallId();\n const taskId = this.getTaskIdForCall(callId);\n\n if (taskId) {\n this.callTaskMap.delete(callId);\n }\n this.call = null;\n }\n }\n\n /**\n * Retrieves the RTMS domain to use for WebRTC connections\n * First tries to get it from the service catalog, then falls back to default\n * @private\n * @returns {Promise<string>} The RTMS domain to use\n */\n private async getRTMSDomain(): Promise<string> {\n await this.webex.internal.services.waitForCatalog(POST_AUTH);\n\n const rtmsURL = this.webex.internal.services.get(WCC_CALLING_RTMS_DOMAIN);\n\n try {\n const url = new URL(rtmsURL);\n\n return url.hostname;\n } catch (error) {\n LoggerProxy.error(\n `Invalid URL from u2c catalogue: ${rtmsURL} so falling back to default domain`,\n {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.GET_RTMS_DOMAIN,\n }\n );\n\n return DEFAULT_RTMS_DOMAIN;\n }\n }\n\n /**\n * Registers the WebCalling line for receiving calls\n * Sets up event listeners for line events and initializes the calling client\n *\n * @private\n * @returns {Promise<void>} A promise that resolves when registration is complete\n * @throws {Error} When registration times out\n */\n public async registerWebCallingLine(): Promise<void> {\n const rtmsDomain = await this.getRTMSDomain(); // get the RTMS domain from the u2c catalogue\n\n const callingClientConfig = {\n logger: {\n level: LOGGER.INFO,\n },\n serviceData: {\n indicator: ServiceIndicator.CONTACT_CENTER,\n domain: rtmsDomain,\n },\n };\n\n this.callingClient = await createClient(this.webex as any, callingClientConfig);\n this.line = Object.values(this.callingClient.getLines())[0];\n\n this.line.on(LINE_EVENTS.UNREGISTERED, () => {\n LoggerProxy.log(`WxCC-SDK: Desktop unregistered successfully`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.REGISTER_WEB_CALLING_LINE,\n });\n });\n\n // Start listening for incoming calls\n this.line.on(LINE_EVENTS.INCOMING_CALL, (call: ICall) => {\n this.call = call;\n this.emit(LINE_EVENTS.INCOMING_CALL, call);\n });\n\n return new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(() => {\n reject(new Error('WebCallingService Registration timed out'));\n }, TIMEOUT_DURATION);\n\n this.line.on(LINE_EVENTS.REGISTERED, (deviceInfo: ILine) => {\n clearTimeout(timeout);\n LoggerProxy.log(\n `WxCC-SDK: Desktop registered successfully, mobiusDeviceId: ${deviceInfo.mobiusDeviceId}`,\n {module: WEB_CALLING_SERVICE_FILE, method: METHODS.REGISTER_WEB_CALLING_LINE}\n );\n resolve();\n });\n this.line.register();\n });\n }\n\n /**\n * Deregisters the WebCalling line\n * Cleans up any active calls and deregisters from the calling service\n *\n * @private\n * @returns {Promise<void>} A promise that resolves when deregistration is complete\n */\n public async deregisterWebCallingLine(): Promise<void> {\n LoggerProxy.log(DEREGISTER_WEBCALLING_LINE_MSG, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.DEREGISTER_WEB_CALLING_LINE,\n });\n this.cleanUpCall();\n this.line?.deregister();\n }\n\n /**\n * Answers an incoming call with the provided audio stream\n *\n * @private\n * @param {LocalMicrophoneStream} localAudioStream - The local microphone stream to use\n * @param {string} taskId - The task ID associated with this call\n * @throws {Error} If answering the call fails\n */\n public answerCall(localAudioStream: LocalMicrophoneStream, taskId: string): void {\n if (this.call) {\n try {\n LoggerProxy.info(`Call answered: ${taskId}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.ANSWER_CALL,\n });\n this.call.answer(localAudioStream);\n this.registerCallListeners();\n } catch (error) {\n LoggerProxy.error(`Failed to answer call for ${taskId}. Error: ${error}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.ANSWER_CALL,\n });\n // Optionally, throw the error to allow the invoker to handle it\n throw error;\n }\n } else {\n LoggerProxy.log(`Cannot answer a non WebRtc Call: ${taskId}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.ANSWER_CALL,\n });\n }\n }\n\n /**\n * Toggles the mute state of the current call\n *\n * @private\n * @param {LocalMicrophoneStream} localAudioStream - The local microphone stream to control\n */\n public muteUnmuteCall(localAudioStream: LocalMicrophoneStream): void {\n if (this.call) {\n LoggerProxy.info('Call mute or unmute requested!', {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.MUTE_UNMUTE_CALL,\n });\n this.call.mute(localAudioStream);\n } else {\n LoggerProxy.log(`Cannot mute a non WebRtc Call`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.MUTE_UNMUTE_CALL,\n });\n }\n }\n\n /**\n * Checks if the current call is muted\n *\n * @private\n * @returns {boolean} True if the call is muted, false otherwise or if no call exists\n */\n public isCallMuted(): boolean {\n if (this.call) {\n return this.call.isMuted();\n }\n\n return false;\n }\n\n /**\n * Declines or ends the current call\n *\n * @private\n * @param {string} taskId - The task ID associated with this call\n * @throws {Error} If ending the call fails\n */\n public declineCall(taskId: string): void {\n if (this.call) {\n try {\n LoggerProxy.info(`Call end requested: ${taskId}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.DECLINE_CALL,\n });\n this.call.end();\n this.cleanUpCall();\n } catch (error) {\n LoggerProxy.error(`Failed to end call: ${taskId}. Error: ${error}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.DECLINE_CALL,\n });\n // Optionally, throw the error to allow the invoker to handle it\n throw error;\n }\n } else {\n LoggerProxy.log(`Cannot end a non WebRtc Call: ${taskId}`, {\n module: WEB_CALLING_SERVICE_FILE,\n method: METHODS.DECLINE_CALL,\n });\n }\n }\n\n /**\n * Maps a call ID to a task ID for correlation\n *\n * @private\n * @param {string} callId - The unique call identifier\n * @param {string} taskId - The associated task identifier\n */\n public mapCallToTask(callId: string, taskId: string): void {\n this.callTaskMap.set(callId, taskId);\n }\n\n /**\n * Gets the task ID associated with a call ID\n *\n * @private\n * @param {string} callId - The call ID to look up\n * @returns {string|undefined} The associated task ID or undefined if not found\n */\n public getTaskIdForCall(callId: string): string | undefined {\n return this.callTaskMap.get(callId);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,G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,EAAE;UAClEE,MAAM,EAAEC,mCAAwB;UAChCC,MAAM,EAAEC,mBAAO,CAACqD;QAClB,CAAC,CAAC;QACF;QACA,MAAM1D,KAAK;MACb;IACF,CAAC,MAAM;MACLC,oBAAW,CAAC2B,GAAG,CAAE,iCAAgC1C,MAAO,EAAC,EAAE;QACzDgB,MAAM,EAAEC,mCAAwB;QAChCC,MAAM,EAAEC,mBAAO,CAACqD;MAClB,CAAC,CAAC;IACJ;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACSC,aAAaA,CAAC3E,MAAc,EAAEE,MAAc,EAAQ;IACzD,IAAI,CAACnB,WAAW,CAAC6F,GAAG,CAAC5E,MAAM,EAAEE,MAAM,CAAC;EACtC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACSC,gBAAgBA,CAACH,MAAc,EAAsB;IAC1D,OAAO,IAAI,CAACjB,WAAW,CAAC4B,GAAG,CAACX,MAAM,CAAC;EACrC;AACF;AAAC6E,OAAA,CAAAnG,OAAA,GAAAC,iBAAA"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = routingAgent;
|
|
7
|
+
var Err = _interopRequireWildcard(require("../core/Err"));
|
|
8
|
+
var _Utils = require("../core/Utils");
|
|
9
|
+
var _types = require("../../types");
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _types2 = require("../config/types");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
/**
|
|
15
|
+
* Agent Service provides methods to manage agent states and operations
|
|
16
|
+
* @param routing - AqmReqs instance for making API requests
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
function routingAgent(routing) {
|
|
20
|
+
return {
|
|
21
|
+
/**
|
|
22
|
+
* Reloads the agent session
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
reload: routing.reqEmpty(() => ({
|
|
26
|
+
host: _constants.WCC_API_GATEWAY,
|
|
27
|
+
url: '/v1/agents/reload',
|
|
28
|
+
data: {},
|
|
29
|
+
err: _Utils.createErrDetailsObject,
|
|
30
|
+
notifSuccess: {
|
|
31
|
+
bind: {
|
|
32
|
+
type: _types2.CC_EVENTS.AGENT_RELOGIN_SUCCESS,
|
|
33
|
+
data: {
|
|
34
|
+
type: _types2.CC_EVENTS.AGENT_RELOGIN_SUCCESS
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
msg: {}
|
|
38
|
+
},
|
|
39
|
+
notifFail: {
|
|
40
|
+
bind: {
|
|
41
|
+
type: _types2.CC_EVENTS.AGENT_RELOGIN_FAILED,
|
|
42
|
+
data: {
|
|
43
|
+
type: _types2.CC_EVENTS.AGENT_RELOGIN_FAILED
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
errId: 'Service.aqm.agent.reload'
|
|
47
|
+
}
|
|
48
|
+
})),
|
|
49
|
+
/**
|
|
50
|
+
* Logs out the agent
|
|
51
|
+
* @param p.data - Logout parameters
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
logout: routing.req(p => ({
|
|
55
|
+
url: '/v1/agents/logout',
|
|
56
|
+
host: _constants.WCC_API_GATEWAY,
|
|
57
|
+
data: p.data,
|
|
58
|
+
err: _Utils.createErrDetailsObject,
|
|
59
|
+
notifSuccess: {
|
|
60
|
+
bind: {
|
|
61
|
+
type: _types2.CC_EVENTS.AGENT_LOGOUT,
|
|
62
|
+
data: {
|
|
63
|
+
type: _types2.CC_EVENTS.AGENT_LOGOUT_SUCCESS
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
msg: {}
|
|
67
|
+
},
|
|
68
|
+
notifFail: {
|
|
69
|
+
bind: {
|
|
70
|
+
type: _types2.CC_EVENTS.AGENT_LOGOUT,
|
|
71
|
+
data: {
|
|
72
|
+
type: _types2.CC_EVENTS.AGENT_LOGOUT_FAILED
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
errId: 'Service.aqm.agent.logout'
|
|
76
|
+
}
|
|
77
|
+
})),
|
|
78
|
+
/**
|
|
79
|
+
* Logs in the agent to a station
|
|
80
|
+
* @param p.data - Station login parameters
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
stationLogin: routing.req(p => ({
|
|
84
|
+
url: '/v1/agents/login',
|
|
85
|
+
host: _constants.WCC_API_GATEWAY,
|
|
86
|
+
data: p.data,
|
|
87
|
+
err: /* istanbul ignore next */e => {
|
|
88
|
+
return new Err.Details('Service.aqm.agent.stationLogin', {
|
|
89
|
+
status: e.response?.status ?? 0,
|
|
90
|
+
type: e.response?.data?.errorType,
|
|
91
|
+
trackingId: e.response?.headers?.trackingid?.split('_')[1]
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
notifSuccess: {
|
|
95
|
+
bind: {
|
|
96
|
+
type: _types2.CC_EVENTS.AGENT_STATION_LOGIN,
|
|
97
|
+
data: {
|
|
98
|
+
type: _types2.CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
msg: {}
|
|
102
|
+
},
|
|
103
|
+
notifFail: {
|
|
104
|
+
bind: {
|
|
105
|
+
type: _types2.CC_EVENTS.AGENT_STATION_LOGIN,
|
|
106
|
+
data: {
|
|
107
|
+
type: _types2.CC_EVENTS.AGENT_STATION_LOGIN_FAILED
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
errId: 'Service.aqm.agent.stationLoginFailed'
|
|
111
|
+
}
|
|
112
|
+
})),
|
|
113
|
+
/**
|
|
114
|
+
* Changes the agent's state
|
|
115
|
+
* @param p.data - State change parameters
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
stateChange: routing.req(p => ({
|
|
119
|
+
url: '/v1/agents/session/state',
|
|
120
|
+
host: _constants.WCC_API_GATEWAY,
|
|
121
|
+
data: p.data,
|
|
122
|
+
err: _Utils.createErrDetailsObject,
|
|
123
|
+
method: _types.HTTP_METHODS.PUT,
|
|
124
|
+
notifSuccess: {
|
|
125
|
+
bind: {
|
|
126
|
+
type: _types2.CC_EVENTS.AGENT_STATE_CHANGE,
|
|
127
|
+
data: {
|
|
128
|
+
type: _types2.CC_EVENTS.AGENT_STATE_CHANGE_SUCCESS
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
msg: {}
|
|
132
|
+
},
|
|
133
|
+
notifFail: {
|
|
134
|
+
bind: {
|
|
135
|
+
type: _types2.CC_EVENTS.AGENT_STATE_CHANGE,
|
|
136
|
+
data: {
|
|
137
|
+
type: _types2.CC_EVENTS.AGENT_STATE_CHANGE_FAILED
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
errId: 'Service.aqm.agent.stateChange'
|
|
141
|
+
}
|
|
142
|
+
})),
|
|
143
|
+
/**
|
|
144
|
+
* Retrieves list of buddy agents
|
|
145
|
+
* @param p.data - Buddy agent query parameters
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
buddyAgents: routing.req(p => ({
|
|
149
|
+
url: `/v1/agents/buddyList`,
|
|
150
|
+
host: _constants.WCC_API_GATEWAY,
|
|
151
|
+
data: {
|
|
152
|
+
...p.data
|
|
153
|
+
},
|
|
154
|
+
err: _Utils.createErrDetailsObject,
|
|
155
|
+
method: _types.HTTP_METHODS.POST,
|
|
156
|
+
notifSuccess: {
|
|
157
|
+
bind: {
|
|
158
|
+
type: _types2.CC_EVENTS.AGENT_BUDDY_AGENTS,
|
|
159
|
+
data: {
|
|
160
|
+
type: _types2.CC_EVENTS.AGENT_BUDDY_AGENTS_SUCCESS
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
msg: {}
|
|
164
|
+
},
|
|
165
|
+
notifFail: {
|
|
166
|
+
bind: {
|
|
167
|
+
type: _types2.CC_EVENTS.AGENT_BUDDY_AGENTS,
|
|
168
|
+
data: {
|
|
169
|
+
type: _types2.CC_EVENTS.AGENT_BUDDY_AGENTS_RETRIEVE_FAILED
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
errId: 'Service.aqm.agent.BuddyAgentsRetrieveFailed'
|
|
173
|
+
}
|
|
174
|
+
}))
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Err","_interopRequireWildcard","require","_Utils","_types","_constants","_types2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","routingAgent","routing","reload","reqEmpty","host","WCC_API_GATEWAY","url","data","err","notifSuccess","bind","type","CC_EVENTS","AGENT_RELOGIN_SUCCESS","msg","notifFail","AGENT_RELOGIN_FAILED","errId","logout","req","p","AGENT_LOGOUT","AGENT_LOGOUT_SUCCESS","AGENT_LOGOUT_FAILED","stationLogin","Details","status","response","errorType","trackingId","headers","trackingid","split","AGENT_STATION_LOGIN","AGENT_STATION_LOGIN_SUCCESS","AGENT_STATION_LOGIN_FAILED","stateChange","method","HTTP_METHODS","PUT","AGENT_STATE_CHANGE","AGENT_STATE_CHANGE_SUCCESS","AGENT_STATE_CHANGE_FAILED","buddyAgents","POST","AGENT_BUDDY_AGENTS","AGENT_BUDDY_AGENTS_SUCCESS","AGENT_BUDDY_AGENTS_RETRIEVE_FAILED"],"sources":["index.ts"],"sourcesContent":["import * as Err from '../core/Err';\nimport {createErrDetailsObject as err} from '../core/Utils';\nimport * as Agent from './types';\nimport AqmReqs from '../core/aqm-reqs';\nimport {HTTP_METHODS} from '../../types';\nimport {WCC_API_GATEWAY} from '../constants';\nimport {CC_EVENTS} from '../config/types';\n\n/**\n * Agent Service provides methods to manage agent states and operations\n * @param routing - AqmReqs instance for making API requests\n * @ignore\n */\nexport default function routingAgent(routing: AqmReqs) {\n return {\n /**\n * Reloads the agent session\n * @public\n */\n reload: routing.reqEmpty(() => ({\n host: WCC_API_GATEWAY,\n url: '/v1/agents/reload',\n data: {},\n err,\n notifSuccess: {\n bind: {\n type: CC_EVENTS.AGENT_RELOGIN_SUCCESS,\n data: {type: CC_EVENTS.AGENT_RELOGIN_SUCCESS},\n },\n msg: {} as Agent.ReloginSuccess,\n },\n notifFail: {\n bind: {\n type: CC_EVENTS.AGENT_RELOGIN_FAILED,\n data: {type: CC_EVENTS.AGENT_RELOGIN_FAILED},\n },\n errId: 'Service.aqm.agent.reload',\n },\n })),\n /**\n * Logs out the agent\n * @param p.data - Logout parameters\n * @public\n */\n logout: routing.req((p: {data: Agent.Logout}) => ({\n url: '/v1/agents/logout',\n host: WCC_API_GATEWAY,\n data: p.data,\n err,\n notifSuccess: {\n bind: {\n type: CC_EVENTS.AGENT_LOGOUT,\n data: {type: CC_EVENTS.AGENT_LOGOUT_SUCCESS},\n },\n msg: {} as Agent.LogoutSuccess,\n },\n notifFail: {\n bind: {\n type: CC_EVENTS.AGENT_LOGOUT,\n data: {type: CC_EVENTS.AGENT_LOGOUT_FAILED},\n },\n errId: 'Service.aqm.agent.logout',\n },\n })),\n /**\n * Logs in the agent to a station\n * @param p.data - Station login parameters\n * @public\n */\n stationLogin: routing.req((p: {data: Agent.UserStationLogin}) => ({\n url: '/v1/agents/login',\n host: WCC_API_GATEWAY,\n data: p.data,\n err: /* istanbul ignore next */ (e: any) => {\n return new Err.Details('Service.aqm.agent.stationLogin', {\n status: e.response?.status ?? 0,\n type: e.response?.data?.errorType,\n trackingId: e.response?.headers?.trackingid?.split('_')[1],\n });\n },\n notifSuccess: {\n bind: {\n type: CC_EVENTS.AGENT_STATION_LOGIN,\n data: {type: CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS},\n },\n msg: {} as Agent.StationLoginSuccess,\n },\n notifFail: {\n bind: {\n type: CC_EVENTS.AGENT_STATION_LOGIN,\n data: {type: CC_EVENTS.AGENT_STATION_LOGIN_FAILED},\n },\n errId: 'Service.aqm.agent.stationLoginFailed',\n },\n })),\n /**\n * Changes the agent's state\n * @param p.data - State change parameters\n * @public\n */\n stateChange: routing.req((p: {data: Agent.StateChange}) => ({\n url: '/v1/agents/session/state',\n host: WCC_API_GATEWAY,\n data: p.data,\n err,\n method: HTTP_METHODS.PUT,\n notifSuccess: {\n bind: {\n type: CC_EVENTS.AGENT_STATE_CHANGE,\n data: {type: CC_EVENTS.AGENT_STATE_CHANGE_SUCCESS},\n },\n msg: {} as Agent.StateChangeSuccess,\n },\n notifFail: {\n bind: {\n type: CC_EVENTS.AGENT_STATE_CHANGE,\n data: {type: CC_EVENTS.AGENT_STATE_CHANGE_FAILED},\n },\n errId: 'Service.aqm.agent.stateChange',\n },\n })),\n /**\n * Retrieves list of buddy agents\n * @param p.data - Buddy agent query parameters\n * @public\n */\n buddyAgents: routing.req((p: {data: Agent.BuddyAgents}) => ({\n url: `/v1/agents/buddyList`,\n host: WCC_API_GATEWAY,\n data: {...p.data},\n err,\n method: HTTP_METHODS.POST,\n notifSuccess: {\n bind: {\n type: CC_EVENTS.AGENT_BUDDY_AGENTS,\n data: {type: CC_EVENTS.AGENT_BUDDY_AGENTS_SUCCESS},\n },\n msg: {} as Agent.BuddyAgentsSuccess,\n },\n notifFail: {\n bind: {\n type: CC_EVENTS.AGENT_BU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