@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
package/dist/types.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LoginOption = exports.LOGGING_LEVEL = exports.HTTP_METHODS = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Generic type for converting a const enum object into a union type of its values.
|
|
9
|
+
* @template T The enum object type
|
|
10
|
+
* @internal
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* HTTP methods supported by WebexRequest.
|
|
16
|
+
* @enum {string}
|
|
17
|
+
* @public
|
|
18
|
+
* @example
|
|
19
|
+
* const method: HTTP_METHODS = HTTP_METHODS.GET;
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
const HTTP_METHODS = exports.HTTP_METHODS = {
|
|
23
|
+
/** HTTP GET method for retrieving data */
|
|
24
|
+
GET: 'GET',
|
|
25
|
+
/** HTTP POST method for creating resources */
|
|
26
|
+
POST: 'POST',
|
|
27
|
+
/** HTTP PATCH method for partial updates */
|
|
28
|
+
PATCH: 'PATCH',
|
|
29
|
+
/** HTTP PUT method for complete updates */
|
|
30
|
+
PUT: 'PUT',
|
|
31
|
+
/** HTTP DELETE method for removing resources */
|
|
32
|
+
DELETE: 'DELETE'
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Union type of HTTP methods.
|
|
37
|
+
* @public
|
|
38
|
+
* @example
|
|
39
|
+
* function makeRequest(method: HTTP_METHODS) { ... }
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Payload for making requests to Webex APIs.
|
|
45
|
+
* @public
|
|
46
|
+
* @example
|
|
47
|
+
* const payload: WebexRequestPayload = {
|
|
48
|
+
* service: 'identity',
|
|
49
|
+
* resource: '/users',
|
|
50
|
+
* method: HTTP_METHODS.GET
|
|
51
|
+
* };
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Event listener function type.
|
|
57
|
+
* @internal
|
|
58
|
+
* @ignore
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Event listener removal function type.
|
|
63
|
+
* @internal
|
|
64
|
+
* @ignore
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Service host configuration.
|
|
69
|
+
* @internal
|
|
70
|
+
* @ignore
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Configuration options for the Contact Center Plugin.
|
|
75
|
+
* @interface CCPluginConfig
|
|
76
|
+
* @public
|
|
77
|
+
* @example
|
|
78
|
+
* const config: CCPluginConfig = {
|
|
79
|
+
* allowMultiLogin: true,
|
|
80
|
+
* allowAutomatedRelogin: false,
|
|
81
|
+
* clientType: 'browser',
|
|
82
|
+
* isKeepAliveEnabled: true,
|
|
83
|
+
* force: false,
|
|
84
|
+
* metrics: { clientName: 'myClient', clientType: 'browser' },
|
|
85
|
+
* logging: { enable: true, verboseEvents: false },
|
|
86
|
+
* callingClientConfig: { ... }
|
|
87
|
+
* };
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Logger interface for standardized logging throughout the plugin.
|
|
92
|
+
* @public
|
|
93
|
+
* @example
|
|
94
|
+
* logger.log('This is a log message');
|
|
95
|
+
* logger.error('This is an error message');
|
|
96
|
+
* @ignore
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Contextual information for log entries.
|
|
101
|
+
* @public
|
|
102
|
+
* @ignore
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* Available logging severity levels.
|
|
106
|
+
* @enum {string}
|
|
107
|
+
* @public
|
|
108
|
+
* @example
|
|
109
|
+
* const level: LOGGING_LEVEL = LOGGING_LEVEL.error;
|
|
110
|
+
* @ignore
|
|
111
|
+
*/
|
|
112
|
+
let LOGGING_LEVEL = exports.LOGGING_LEVEL = /*#__PURE__*/function (LOGGING_LEVEL) {
|
|
113
|
+
LOGGING_LEVEL["error"] = "ERROR";
|
|
114
|
+
LOGGING_LEVEL["warn"] = "WARN";
|
|
115
|
+
LOGGING_LEVEL["log"] = "LOG";
|
|
116
|
+
LOGGING_LEVEL["info"] = "INFO";
|
|
117
|
+
LOGGING_LEVEL["trace"] = "TRACE";
|
|
118
|
+
return LOGGING_LEVEL;
|
|
119
|
+
}({});
|
|
120
|
+
/**
|
|
121
|
+
* Metadata for log uploads.
|
|
122
|
+
* @public
|
|
123
|
+
* @example
|
|
124
|
+
* const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };
|
|
125
|
+
* @ignore
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Response from uploading logs to the server.
|
|
129
|
+
* @public
|
|
130
|
+
* @example
|
|
131
|
+
* const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* Internal Webex SDK interfaces needed for plugin integration.
|
|
135
|
+
* @internal
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Interface representing the WebexSDK core functionality.
|
|
140
|
+
* @interface WebexSDK
|
|
141
|
+
* @public
|
|
142
|
+
* @example
|
|
143
|
+
* const sdk: WebexSDK = ...;
|
|
144
|
+
* sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });
|
|
145
|
+
* @ignore
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* An interface for the `ContactCenter` class.
|
|
149
|
+
* The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.
|
|
150
|
+
* @public
|
|
151
|
+
* @example
|
|
152
|
+
* const cc: IContactCenter = ...;
|
|
153
|
+
* cc.register().then(profile => { ... });
|
|
154
|
+
* @ignore
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* Generic HTTP response structure.
|
|
158
|
+
* @public
|
|
159
|
+
* @example
|
|
160
|
+
* const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };
|
|
161
|
+
* @ignore
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* Supported login options for agent authentication.
|
|
165
|
+
* @public
|
|
166
|
+
* @example
|
|
167
|
+
* const option: LoginOption = LoginOption.AGENT_DN;
|
|
168
|
+
* @ignore
|
|
169
|
+
*/
|
|
170
|
+
const LoginOption = exports.LoginOption = {
|
|
171
|
+
/** Login using agent's direct number */
|
|
172
|
+
AGENT_DN: 'AGENT_DN',
|
|
173
|
+
/** Login using an extension number */
|
|
174
|
+
EXTENSION: 'EXTENSION',
|
|
175
|
+
/** Login using browser WebRTC capabilities */
|
|
176
|
+
BROWSER: 'BROWSER'
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Union type of login options.
|
|
181
|
+
* @public
|
|
182
|
+
* @example
|
|
183
|
+
* function login(option: LoginOption) { ... }
|
|
184
|
+
* @ignore
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Request payload for subscribing to the contact center websocket.
|
|
189
|
+
* @public
|
|
190
|
+
* @example
|
|
191
|
+
* const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };
|
|
192
|
+
* @ignore
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Represents the response from getListOfTeams method.
|
|
197
|
+
* Teams are groups of agents that can be managed together.
|
|
198
|
+
* @public
|
|
199
|
+
* @example
|
|
200
|
+
* const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };
|
|
201
|
+
* @ignore
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Represents the request to perform agent login.
|
|
206
|
+
* @public
|
|
207
|
+
* @example
|
|
208
|
+
* const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Represents the request to update agent profile settings.
|
|
213
|
+
* @public
|
|
214
|
+
* @example
|
|
215
|
+
* const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };
|
|
216
|
+
*/
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Union type for all possible request body types.
|
|
220
|
+
* @internal
|
|
221
|
+
* @ignore
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Represents the options to fetch buddy agents for the logged in agent.
|
|
226
|
+
* Buddy agents are other agents who can be consulted or transfered to.
|
|
227
|
+
* @public
|
|
228
|
+
* @example
|
|
229
|
+
* const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
|
|
230
|
+
* @ignore
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Generic error structure for Contact Center SDK errors.
|
|
235
|
+
* Contains detailed information about the error context.
|
|
236
|
+
* @public
|
|
237
|
+
* @example
|
|
238
|
+
* const err: GenericError = new Error('Failed');
|
|
239
|
+
* err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };
|
|
240
|
+
* @ignore
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Response type for station login operations.
|
|
245
|
+
* Either a success response with agent details or an error.
|
|
246
|
+
* @public
|
|
247
|
+
* @example
|
|
248
|
+
* function handleLogin(resp: StationLoginResponse) { ... }
|
|
249
|
+
*/
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Response type for station logout operations.
|
|
253
|
+
* Either a success response with logout details or an error.
|
|
254
|
+
* @public
|
|
255
|
+
* @example
|
|
256
|
+
* function handleLogout(resp: StationLogoutResponse) { ... }
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Response type for station relogin operations.
|
|
261
|
+
* Either a success response with relogin details or an error.
|
|
262
|
+
* @public
|
|
263
|
+
* @example
|
|
264
|
+
* function handleReLogin(resp: StationReLoginResponse) { ... }
|
|
265
|
+
* @ignore
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Response type for agent state change operations.
|
|
270
|
+
* Either a success response with state change details or an error.
|
|
271
|
+
* @public
|
|
272
|
+
* @example
|
|
273
|
+
* function handleStateChange(resp: SetStateResponse) { ... }
|
|
274
|
+
* @ignore
|
|
275
|
+
*/
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Response type for buddy agents query operations.
|
|
279
|
+
* Either a success response with list of buddy agents or an error.
|
|
280
|
+
* @public
|
|
281
|
+
* @example
|
|
282
|
+
* function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }
|
|
283
|
+
*/
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Response type for device type update operations.
|
|
287
|
+
* Either a success response with update confirmation or an error.
|
|
288
|
+
* @public
|
|
289
|
+
* @example
|
|
290
|
+
* function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }
|
|
291
|
+
*/
|
|
292
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HTTP_METHODS","exports","GET","POST","PATCH","PUT","DELETE","LOGGING_LEVEL","LoginOption","AGENT_DN","EXTENSION","BROWSER"],"sources":["types.ts"],"sourcesContent":["import {CallingClientConfig} from '@webex/calling';\nimport {\n SubmitBehavioralEvent,\n SubmitOperationalEvent,\n SubmitBusinessEvent,\n} from '@webex/internal-plugin-metrics/src/metrics.types';\nimport * as Agent from './services/agent/types';\nimport * as Contact from './services/task/types';\nimport {Profile} from './services/config/types';\n\n/**\n * Generic type for converting a const enum object into a union type of its values.\n * @template T The enum object type\n * @internal\n * @ignore\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * HTTP methods supported by WebexRequest.\n * @enum {string}\n * @public\n * @example\n * const method: HTTP_METHODS = HTTP_METHODS.GET;\n * @ignore\n */\nexport const HTTP_METHODS = {\n /** HTTP GET method for retrieving data */\n GET: 'GET',\n /** HTTP POST method for creating resources */\n POST: 'POST',\n /** HTTP PATCH method for partial updates */\n PATCH: 'PATCH',\n /** HTTP PUT method for complete updates */\n PUT: 'PUT',\n /** HTTP DELETE method for removing resources */\n DELETE: 'DELETE',\n} as const;\n\n/**\n * Union type of HTTP methods.\n * @public\n * @example\n * function makeRequest(method: HTTP_METHODS) { ... }\n * @ignore\n */\nexport type HTTP_METHODS = Enum<typeof HTTP_METHODS>;\n\n/**\n * Payload for making requests to Webex APIs.\n * @public\n * @example\n * const payload: WebexRequestPayload = {\n * service: 'identity',\n * resource: '/users',\n * method: HTTP_METHODS.GET\n * };\n * @ignore\n */\nexport type WebexRequestPayload = {\n /** Service name to target */\n service?: string;\n /** Resource path within the service */\n resource?: string;\n /** HTTP method to use */\n method?: HTTP_METHODS;\n /** Full URI if not using service/resource pattern */\n uri?: string;\n /** Whether to add authorization header */\n addAuthHeader?: boolean;\n /** Custom headers to include in request */\n headers?: {\n [key: string]: string | null;\n };\n /** Request body data */\n body?: object;\n /** Expected response status code */\n statusCode?: number;\n /** Whether to parse response as JSON */\n json?: boolean;\n};\n\n/**\n * Event listener function type.\n * @internal\n * @ignore\n */\ntype Listener = (e: string, data?: unknown) => void;\n\n/**\n * Event listener removal function type.\n * @internal\n * @ignore\n */\ntype ListenerOff = (e: string) => void;\n\n/**\n * Service host configuration.\n * @internal\n * @ignore\n */\ntype ServiceHost = {\n /** Host URL/domain for the service */\n host: string;\n /** Time-to-live in seconds */\n ttl: number;\n /** Priority level for load balancing (lower is higher priority) */\n priority: number;\n /** Unique identifier for this host */\n id: string;\n /** Whether this is the home cluster for the user */\n homeCluster?: boolean;\n};\n\n/**\n * Configuration options for the Contact Center Plugin.\n * @interface CCPluginConfig\n * @public\n * @example\n * const config: CCPluginConfig = {\n * allowMultiLogin: true,\n * allowAutomatedRelogin: false,\n * clientType: 'browser',\n * isKeepAliveEnabled: true,\n * force: false,\n * metrics: { clientName: 'myClient', clientType: 'browser' },\n * logging: { enable: true, verboseEvents: false },\n * callingClientConfig: { ... }\n * };\n */\nexport interface CCPluginConfig {\n /** Whether to allow multiple logins from different devices */\n allowMultiLogin: boolean;\n /** Whether to automatically attempt relogin on connection loss */\n allowAutomatedRelogin: boolean;\n /** The type of client making the connection */\n clientType: string;\n /** Whether to enable keep-alive messages */\n isKeepAliveEnabled: boolean;\n /** Whether to force registration */\n force: boolean;\n /** Metrics configuration */\n metrics: {\n /** Name of the client for metrics */\n clientName: string;\n /** Type of client for metrics */\n clientType: string;\n };\n /** Logging configuration */\n logging: {\n /** Whether to enable logging */\n enable: boolean;\n /** Whether to log verbose events */\n verboseEvents: boolean;\n };\n /** Configuration for the calling client */\n callingClientConfig: CallingClientConfig;\n}\n\n/**\n * Logger interface for standardized logging throughout the plugin.\n * @public\n * @example\n * logger.log('This is a log message');\n * logger.error('This is an error message');\n * @ignore\n */\nexport type Logger = {\n /** Log general messages */\n log: (payload: string) => void;\n /** Log error messages */\n error: (payload: string) => void;\n /** Log warning messages */\n warn: (payload: string) => void;\n /** Log informational messages */\n info: (payload: string) => void;\n /** Log detailed trace messages */\n trace: (payload: string) => void;\n /** Log debug messages */\n debug: (payload: string) => void;\n};\n\n/**\n * Contextual information for log entries.\n * @public\n * @ignore\n */\nexport interface LogContext {\n /** Module name where the log originated */\n module?: string;\n /** Method name where the log originated */\n method?: string;\n interactionId?: string;\n trackingId?: string;\n}\n\n/**\n * Available logging severity levels.\n * @enum {string}\n * @public\n * @example\n * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;\n * @ignore\n */\nexport enum LOGGING_LEVEL {\n /** Critical failures that require immediate attention */\n error = 'ERROR',\n /** Important issues that don't prevent the system from working */\n warn = 'WARN',\n /** General informational logs */\n log = 'LOG',\n /** Detailed information about system operation */\n info = 'INFO',\n /** Highly detailed diagnostic information */\n trace = 'TRACE',\n}\n\n/**\n * Metadata for log uploads.\n * @public\n * @example\n * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };\n * @ignore\n */\nexport type LogsMetaData = {\n /** Optional feedback ID to associate with logs */\n feedbackId?: string;\n /** Optional correlation ID to track related operations */\n correlationId?: string;\n};\n\n/**\n * Response from uploading logs to the server.\n * @public\n * @example\n * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };\n */\nexport type UploadLogsResponse = {\n /** Tracking ID for the upload request */\n trackingid?: string;\n /** URL where the logs can be accessed */\n url?: string;\n /** ID of the user who uploaded logs */\n userId?: string;\n /** Feedback ID associated with the logs */\n feedbackId?: string;\n /** Correlation ID for tracking related operations */\n correlationId?: string;\n};\n\n/**\n * Internal Webex SDK interfaces needed for plugin integration.\n * @internal\n * @ignore\n */\ninterface IWebexInternal {\n /** Mercury service for real-time messaging */\n mercury: {\n /** Register an event listener */\n on: Listener;\n /** Remove an event listener */\n off: ListenerOff;\n /** Establish a connection to the Mercury service */\n connect: () => Promise<void>;\n /** Disconnect from the Mercury service */\n disconnect: () => Promise<void>;\n /** Whether Mercury is currently connected */\n connected: boolean;\n /** Whether Mercury is in the process of connecting */\n connecting: boolean;\n };\n /** Device information */\n device: {\n /** Current WDM URL */\n url: string;\n /** Current user's ID */\n userId: string;\n /** Current organization ID */\n orgId: string;\n /** Device version */\n version: string;\n /** Calling behavior configuration */\n callingBehavior: string;\n };\n /** Presence service */\n presence: unknown;\n /** Services discovery and management */\n services: {\n /** Get a service URL by name */\n get: (service: string) => string;\n /** Wait for service catalog to be loaded */\n waitForCatalog: (service: string) => Promise<void>;\n /** Host catalog for service discovery */\n _hostCatalog: Record<string, ServiceHost[]>;\n /** Service URLs cache */\n _serviceUrls: {\n /** Mobius calling service */\n mobius: string;\n /** Identity service */\n identity: string;\n /** Janus media server */\n janus: string;\n /** WDM (WebEx Device Management) service */\n wdm: string;\n /** BroadWorks IDP proxy service */\n broadworksIdpProxy: string;\n /** Hydra API service */\n hydra: string;\n /** Mercury API service */\n mercuryApi: string;\n /** UC Management gateway service */\n 'ucmgmt-gateway': string;\n /** Contacts service */\n contactsService: string;\n };\n };\n /** Metrics collection services */\n newMetrics: {\n /** Submit behavioral events (user actions) */\n submitBehavioralEvent: SubmitBehavioralEvent;\n /** Submit operational events (system operations) */\n submitOperationalEvent: SubmitOperationalEvent;\n /** Submit business events (business outcomes) */\n submitBusinessEvent: SubmitBusinessEvent;\n };\n /** Support functionality */\n support: {\n /** Submit logs to server */\n submitLogs: (\n metaData: LogsMetaData,\n logs: string,\n options: {\n /** Whether to submit full logs or just differences */\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n}\n\n/**\n * Interface representing the WebexSDK core functionality.\n * @interface WebexSDK\n * @public\n * @example\n * const sdk: WebexSDK = ...;\n * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });\n * @ignore\n */\nexport interface WebexSDK {\n /** Version of the WebexSDK */\n version: string;\n /** Whether the SDK can authorize requests */\n canAuthorize: boolean;\n /** Credentials management */\n credentials: {\n /** Get the user token for authentication */\n getUserToken: () => Promise<string>;\n /** Get the organization ID */\n getOrgId: () => string;\n };\n /** Whether the SDK is ready for use */\n ready: boolean;\n /** Make a request to the Webex APIs */\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n /** Register a one-time event handler */\n once: (event: string, callBack: () => void) => void;\n /** Internal plugins and services */\n internal: IWebexInternal;\n /** Logger instance */\n logger: Logger;\n}\n\n/**\n * An interface for the `ContactCenter` class.\n * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.\n * @public\n * @example\n * const cc: IContactCenter = ...;\n * cc.register().then(profile => { ... });\n * @ignore\n */\nexport interface IContactCenter {\n /**\n * Initialize the CC SDK by setting up the contact center mercury connection.\n * This establishes WebSocket connectivity for real-time communication.\n *\n * @returns A Promise that resolves to the agent's profile upon successful registration\n * @public\n * @example\n * cc.register().then(profile => { ... });\n */\n register(): Promise<Profile>;\n}\n\n/**\n * Generic HTTP response structure.\n * @public\n * @example\n * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };\n * @ignore\n */\nexport interface IHttpResponse {\n /** Response body content */\n body: any;\n /** HTTP status code */\n statusCode: number;\n /** HTTP method used for the request */\n method: string;\n /** Response headers */\n headers: Headers;\n /** Request URL */\n url: string;\n}\n\n/**\n * Supported login options for agent authentication.\n * @public\n * @example\n * const option: LoginOption = LoginOption.AGENT_DN;\n * @ignore\n */\nexport const LoginOption = {\n /** Login using agent's direct number */\n AGENT_DN: 'AGENT_DN',\n /** Login using an extension number */\n EXTENSION: 'EXTENSION',\n /** Login using browser WebRTC capabilities */\n BROWSER: 'BROWSER',\n} as const;\n\n/**\n * Union type of login options.\n * @public\n * @example\n * function login(option: LoginOption) { ... }\n * @ignore\n */\nexport type LoginOption = Enum<typeof LoginOption>;\n\n/**\n * Request payload for subscribing to the contact center websocket.\n * @public\n * @example\n * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };\n * @ignore\n */\nexport type SubscribeRequest = {\n /** Whether to force connection even if another exists */\n force: boolean;\n /** Whether to send keepalive messages */\n isKeepAliveEnabled: boolean;\n /** Type of client connecting */\n clientType: string;\n /** Whether to allow login from multiple devices */\n allowMultiLogin: boolean;\n};\n\n/**\n * Represents the response from getListOfTeams method.\n * Teams are groups of agents that can be managed together.\n * @public\n * @example\n * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };\n * @ignore\n */\nexport type Team = {\n /**\n * Unique identifier of the team.\n */\n id: string;\n\n /**\n * Display name of the team.\n */\n name: string;\n\n /**\n * Associated desktop layout ID for the team.\n * Controls how the agent desktop is displayed for team members.\n */\n desktopLayoutId?: string;\n};\n\n/**\n * Represents the request to perform agent login.\n * @public\n * @example\n * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };\n */\nexport type AgentLogin = {\n /**\n * A dialNumber field contains the number to dial such as a route point or extension.\n * Required for AGENT_DN and EXTENSION login options.\n */\n dialNumber?: string;\n\n /**\n * The unique ID representing a team of users.\n * The agent must belong to this team.\n */\n teamId: string;\n\n /**\n * The loginOption field specifies the type of login method.\n * Controls how calls are delivered to the agent.\n */\n loginOption: LoginOption;\n};\n\n/**\n * Represents the request to update agent profile settings.\n * @public\n * @example\n * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };\n */\nexport type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;\n\n/**\n * Union type for all possible request body types.\n * @internal\n * @ignore\n */\nexport type RequestBody =\n | SubscribeRequest\n | Agent.Logout\n | Agent.UserStationLogin\n | Agent.StateChange\n | Agent.BuddyAgents\n | Contact.HoldResumePayload\n | Contact.ResumeRecordingPayload\n | Contact.ConsultPayload\n | Contact.ConsultEndAPIPayload // API Payload accepts only QueueId wheres SDK API allows more params\n | Contact.TransferPayLoad\n | Contact.ConsultTransferPayLoad\n | Contact.cancelCtq\n | Contact.WrapupPayLoad\n | Contact.DialerPayload;\n\n/**\n * Represents the options to fetch buddy agents for the logged in agent.\n * Buddy agents are other agents who can be consulted or transfered to.\n * @public\n * @example\n * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };\n * @ignore\n */\nexport type BuddyAgents = {\n /**\n * The media type channel to filter buddy agents.\n * Determines which channel capability the returned agents must have.\n */\n mediaType: 'telephony' | 'chat' | 'social' | 'email';\n\n /**\n * Optional filter for agent state.\n * If specified, returns only agents in that state.\n * If omitted, returns both available and idle agents.\n */\n state?: 'Available' | 'Idle';\n};\n\n/**\n * Generic error structure for Contact Center SDK errors.\n * Contains detailed information about the error context.\n * @public\n * @example\n * const err: GenericError = new Error('Failed');\n * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };\n * @ignore\n */\nexport interface GenericError extends Error {\n /** Structured details about the error */\n details: {\n /** Error type identifier */\n type: string;\n /** Organization ID where the error occurred */\n orgId: string;\n /** Unique tracking ID for the error */\n trackingId: string;\n /** Additional error context data */\n data: Record<string, any>;\n };\n}\n\n/**\n * Response type for station login operations.\n * Either a success response with agent details or an error.\n * @public\n * @example\n * function handleLogin(resp: StationLoginResponse) { ... }\n */\nexport type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;\n\n/**\n * Response type for station logout operations.\n * Either a success response with logout details or an error.\n * @public\n * @example\n * function handleLogout(resp: StationLogoutResponse) { ... }\n */\nexport type StationLogoutResponse = Agent.LogoutSuccess | Error;\n\n/**\n * Response type for station relogin operations.\n * Either a success response with relogin details or an error.\n * @public\n * @example\n * function handleReLogin(resp: StationReLoginResponse) { ... }\n * @ignore\n */\nexport type StationReLoginResponse = Agent.ReloginSuccess | Error;\n\n/**\n * Response type for agent state change operations.\n * Either a success response with state change details or an error.\n * @public\n * @example\n * function handleStateChange(resp: SetStateResponse) { ... }\n * @ignore\n */\nexport type SetStateResponse = Agent.StateChangeSuccess | Error;\n\n/**\n * Response type for buddy agents query operations.\n * Either a success response with list of buddy agents or an error.\n * @public\n * @example\n * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }\n */\nexport type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;\n\n/**\n * Response type for device type update operations.\n * Either a success response with update confirmation or an error.\n * @public\n * @example\n * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }\n */\nexport type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;\n"],"mappings":";;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1B;EACAE,GAAG,EAAE,KAAK;EACV;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,aAAa,GAAAN,OAAA,CAAAM,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AAqFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _webexCore = require("@webex/webex-core");
|
|
8
|
+
/**
|
|
9
|
+
* Default Webex SDK configuration for Contact Center integration.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
* @example
|
|
13
|
+
* import webexConfig from './webex-config';
|
|
14
|
+
* const hydraUrl = webexConfig.hydra;
|
|
15
|
+
*/
|
|
16
|
+
var _default = exports.default = {
|
|
17
|
+
/**
|
|
18
|
+
* URL for the Hydra API service.
|
|
19
|
+
* @type {string}
|
|
20
|
+
* @public
|
|
21
|
+
* @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'
|
|
22
|
+
*/
|
|
23
|
+
hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',
|
|
24
|
+
/**
|
|
25
|
+
* Alias for the Hydra API service URL.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @public
|
|
28
|
+
* @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'
|
|
29
|
+
*/
|
|
30
|
+
hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',
|
|
31
|
+
/**
|
|
32
|
+
* Credentials configuration (empty by default).
|
|
33
|
+
* @type {object}
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
credentials: {},
|
|
37
|
+
/**
|
|
38
|
+
* Device configuration options.
|
|
39
|
+
* @type {object}
|
|
40
|
+
* @public
|
|
41
|
+
* @property {boolean} validateDomains - Whether to validate device domains.
|
|
42
|
+
* @property {boolean} ephemeral - Whether the device is ephemeral.
|
|
43
|
+
*/
|
|
44
|
+
device: {
|
|
45
|
+
validateDomains: true,
|
|
46
|
+
ephemeral: true
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Storage configuration for the SDK.
|
|
50
|
+
* @type {object}
|
|
51
|
+
* @public
|
|
52
|
+
* @property {typeof MemoryStoreAdapter} boundedAdapter - Adapter for bounded storage.
|
|
53
|
+
* @property {typeof MemoryStoreAdapter} unboundedAdapter - Adapter for unbounded storage.
|
|
54
|
+
*/
|
|
55
|
+
storage: {
|
|
56
|
+
boundedAdapter: _webexCore.MemoryStoreAdapter,
|
|
57
|
+
unboundedAdapter: _webexCore.MemoryStoreAdapter
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=webex-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_default","exports","default","hydra","process","env","HYDRA_SERVICE_URL","hydraServiceUrl","credentials","device","validateDomains","ephemeral","storage","boundedAdapter","MemoryStoreAdapter","unboundedAdapter"],"sources":["webex-config.ts"],"sourcesContent":["import {MemoryStoreAdapter} from '@webex/webex-core';\n\n/**\n * Default Webex SDK configuration for Contact Center integration.\n *\n * @public\n * @example\n * import webexConfig from './webex-config';\n * const hydraUrl = webexConfig.hydra;\n */\nexport default {\n /**\n * URL for the Hydra API service.\n * @type {string}\n * @public\n * @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'\n */\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n /**\n * Alias for the Hydra API service URL.\n * @type {string}\n * @public\n * @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'\n */\n hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n /**\n * Credentials configuration (empty by default).\n * @type {object}\n * @public\n */\n credentials: {},\n /**\n * Device configuration options.\n * @type {object}\n * @public\n * @property {boolean} validateDomains - Whether to validate device domains.\n * @property {boolean} ephemeral - Whether the device is ephemeral.\n */\n device: {\n validateDomains: true,\n ephemeral: true,\n },\n /**\n * Storage configuration for the SDK.\n * @type {object}\n * @public\n * @property {typeof MemoryStoreAdapter} boundedAdapter - Adapter for bounded storage.\n * @property {typeof MemoryStoreAdapter} unboundedAdapter - Adapter for unbounded storage.\n */\n storage: {\n boundedAdapter: MemoryStoreAdapter,\n unboundedAdapter: MemoryStoreAdapter,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe;EACb;AACF;AACA;AACA;AACA;AACA;EACEC,KAAK,EAAEC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,+BAA+B;EACvE;AACF;AACA;AACA;AACA;AACA;EACEC,eAAe,EAAEH,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAI,+BAA+B;EACjF;AACF;AACA;AACA;AACA;EACEE,WAAW,EAAE,CAAC,CAAC;EACf;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,MAAM,EAAE;IACNC,eAAe,EAAE,IAAI;IACrBC,SAAS,EAAE;EACb,CAAC;EACD;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,OAAO,EAAE;IACPC,cAAc,EAAEC,6BAAkB;IAClCC,gBAAgB,EAAED;EACpB;AACF,CAAC"}
|
package/dist/webex.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
8
|
+
var _webexCore = _interopRequireDefault(require("@webex/webex-core"));
|
|
9
|
+
var _safeBuffer = require("safe-buffer");
|
|
10
|
+
require("@webex/plugin-authorization");
|
|
11
|
+
require("@webex/internal-plugin-mercury");
|
|
12
|
+
require("@webex/plugin-logger");
|
|
13
|
+
require("@webex/internal-plugin-support");
|
|
14
|
+
require("./index");
|
|
15
|
+
var _webexConfig = _interopRequireDefault(require("./webex-config"));
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
/**
|
|
18
|
+
* Ensures global Buffer is defined, which is required for SDK functionality in some environments.
|
|
19
|
+
* @ignore
|
|
20
|
+
*/
|
|
21
|
+
if (!global.Buffer) {
|
|
22
|
+
global.Buffer = _safeBuffer.Buffer;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Webex SDK class extended from the core SDK.
|
|
27
|
+
* Includes custom configuration and plugin registration for CC (Contact Center) use cases.
|
|
28
|
+
* @ignore
|
|
29
|
+
*/
|
|
30
|
+
const Webex = _webexCore.default.extend({
|
|
31
|
+
webex: true,
|
|
32
|
+
version: `0.0.0-next.1`
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Initializes a new Webex instance with merged configuration.
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} [attrs={}] - Initialization attributes.
|
|
39
|
+
* @param {Object} [attrs.config] - Optional custom config to override defaults.
|
|
40
|
+
* @param {Object} [attrs.config.logger] - Logging configuration.
|
|
41
|
+
* @param {string} [attrs.config.logger.level='info'] - Logging level (e.g., 'debug', 'info').
|
|
42
|
+
* @param {string} [attrs.config.logger.bufferLogLevel='log'] - Log buffering level for log uploads.
|
|
43
|
+
* @param {Object} [attrs.config.cc] - Contact Center (CC) specific configurations.
|
|
44
|
+
* @param {boolean} [attrs.config.cc.allowMultiLogin=false] - Whether to allow multiple logins.
|
|
45
|
+
* @param {boolean} [attrs.config.cc.allowAutomatedRelogin=true] - Whether to allow automated re-login.
|
|
46
|
+
* @param {string} [attrs.config.cc.clientType='WebexCCSDK'] - Type of the client.
|
|
47
|
+
* @param {boolean} [attrs.config.cc.isKeepAliveEnabled=false] - Whether to enable keep-alive functionality.
|
|
48
|
+
* @param {boolean} [attrs.config.cc.force=true] - Whether to force specific CC configurations.
|
|
49
|
+
* @param {Object} [attrs.config.cc.metrics] - Metrics configuration for CC.
|
|
50
|
+
* @param {string} [attrs.config.cc.metrics.clientName='WEBEX_JS_SDK'] - Metrics client name.
|
|
51
|
+
* @param {string} [attrs.config.cc.metrics.clientType='WebexCCSDK'] - Metrics client type.
|
|
52
|
+
* @returns {Webex} A new Webex instance.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://developer.webex.com/meeting/docs/sdks/webex-meetings-sdk-web-quickstart#webex-object-attribute-reference} - Webex Object Attribute Reference for SDK Configuration.
|
|
55
|
+
*
|
|
56
|
+
* This configuration merges the default `webex-config` with any custom configuration provided as `attrs.config`.
|
|
57
|
+
* The merged configuration governs various SDK behaviors, such as authorization, logging, and CC-specific settings.
|
|
58
|
+
*
|
|
59
|
+
* @example <caption>Basic Usage</caption>
|
|
60
|
+
* import Webex from '@webex/contact-center';
|
|
61
|
+
*
|
|
62
|
+
* // Initialize Webex SDK with default configuration
|
|
63
|
+
* const webex = Webex.init();
|
|
64
|
+
*
|
|
65
|
+
* @example <caption>Custom Configuration</caption>
|
|
66
|
+
* import Webex from '@webex/contact-center';
|
|
67
|
+
*
|
|
68
|
+
* const customConfig = {
|
|
69
|
+
* logger: {
|
|
70
|
+
* level: 'debug', // Enable debug logging
|
|
71
|
+
* bufferLogLevel: 'log', // Used for upload logs
|
|
72
|
+
* },
|
|
73
|
+
* credentials: {
|
|
74
|
+
* client_id: 'your-client-id', // Replace with your Webex application's client ID
|
|
75
|
+
* client_secret: 'your-client-secret', // Replace with your Webex application's client secret
|
|
76
|
+
* redirect_uri: 'https://your-redirect-uri', // Replace with your app's redirect URI
|
|
77
|
+
* },
|
|
78
|
+
* cc: {
|
|
79
|
+
* allowMultiLogin: false, // Disallow multiple logins
|
|
80
|
+
* allowAutomatedRelogin: true, // Enable automated re-login
|
|
81
|
+
* clientType: 'WebexCCSDK', // Specify the Contact Center client type
|
|
82
|
+
* isKeepAliveEnabled: false, // Disable keep-alive functionality
|
|
83
|
+
* force: true, // Force CC-specific configurations
|
|
84
|
+
* metrics: {
|
|
85
|
+
* clientName: 'WEBEX_JS_SDK', // Metrics client name
|
|
86
|
+
* clientType: 'WebexCCSDK', // Metrics client type
|
|
87
|
+
* },
|
|
88
|
+
* },
|
|
89
|
+
* };
|
|
90
|
+
*
|
|
91
|
+
* // Initialize Webex SDK with custom configuration
|
|
92
|
+
* const webex = Webex.init({ config: customConfig });
|
|
93
|
+
*/
|
|
94
|
+
Webex.init = function init(attrs = {}) {
|
|
95
|
+
attrs.config = (0, _merge.default)({}, _webexConfig.default, attrs.config);
|
|
96
|
+
return new Webex(attrs);
|
|
97
|
+
};
|
|
98
|
+
var _default = exports.default = Webex;
|
|
99
|
+
//# sourceMappingURL=webex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_merge","_interopRequireDefault","require","_webexCore","_safeBuffer","_webexConfig","obj","__esModule","default","global","Buffer","Webex","WebexCore","extend","webex","version","init","attrs","config","merge","_default","exports"],"sources":["webex.js"],"sourcesContent":["import merge from 'lodash/merge';\nimport WebexCore from '@webex/webex-core';\nimport {Buffer} from 'safe-buffer';\nimport '@webex/plugin-authorization';\nimport '@webex/internal-plugin-mercury';\nimport '@webex/plugin-logger';\nimport '@webex/internal-plugin-support';\n\nimport './index';\n\nimport config from './webex-config';\n\n/**\n * Ensures global Buffer is defined, which is required for SDK functionality in some environments.\n * @ignore\n */\nif (!global.Buffer) {\n global.Buffer = Buffer;\n}\n\n/**\n * Webex SDK class extended from the core SDK.\n * Includes custom configuration and plugin registration for CC (Contact Center) use cases.\n * @ignore\n */\nconst Webex = WebexCore.extend({\n webex: true,\n version: PACKAGE_VERSION,\n});\n\n/**\n * Initializes a new Webex instance with merged configuration.\n *\n * @param {Object} [attrs={}] - Initialization attributes.\n * @param {Object} [attrs.config] - Optional custom config to override defaults.\n * @param {Object} [attrs.config.logger] - Logging configuration.\n * @param {string} [attrs.config.logger.level='info'] - Logging level (e.g., 'debug', 'info').\n * @param {string} [attrs.config.logger.bufferLogLevel='log'] - Log buffering level for log uploads.\n * @param {Object} [attrs.config.cc] - Contact Center (CC) specific configurations.\n * @param {boolean} [attrs.config.cc.allowMultiLogin=false] - Whether to allow multiple logins.\n * @param {boolean} [attrs.config.cc.allowAutomatedRelogin=true] - Whether to allow automated re-login.\n * @param {string} [attrs.config.cc.clientType='WebexCCSDK'] - Type of the client.\n * @param {boolean} [attrs.config.cc.isKeepAliveEnabled=false] - Whether to enable keep-alive functionality.\n * @param {boolean} [attrs.config.cc.force=true] - Whether to force specific CC configurations.\n * @param {Object} [attrs.config.cc.metrics] - Metrics configuration for CC.\n * @param {string} [attrs.config.cc.metrics.clientName='WEBEX_JS_SDK'] - Metrics client name.\n * @param {string} [attrs.config.cc.metrics.clientType='WebexCCSDK'] - Metrics client type.\n * @returns {Webex} A new Webex instance.\n *\n * @see {@link https://developer.webex.com/meeting/docs/sdks/webex-meetings-sdk-web-quickstart#webex-object-attribute-reference} - Webex Object Attribute Reference for SDK Configuration.\n *\n * This configuration merges the default `webex-config` with any custom configuration provided as `attrs.config`.\n * The merged configuration governs various SDK behaviors, such as authorization, logging, and CC-specific settings.\n *\n * @example <caption>Basic Usage</caption>\n * import Webex from '@webex/contact-center';\n *\n * // Initialize Webex SDK with default configuration\n * const webex = Webex.init();\n *\n * @example <caption>Custom Configuration</caption>\n * import Webex from '@webex/contact-center';\n *\n * const customConfig = {\n * logger: {\n * level: 'debug', // Enable debug logging\n * bufferLogLevel: 'log', // Used for upload logs\n * },\n * credentials: {\n * client_id: 'your-client-id', // Replace with your Webex application's client ID\n * client_secret: 'your-client-secret', // Replace with your Webex application's client secret\n * redirect_uri: 'https://your-redirect-uri', // Replace with your app's redirect URI\n * },\n * cc: {\n * allowMultiLogin: false, // Disallow multiple logins\n * allowAutomatedRelogin: true, // Enable automated re-login\n * clientType: 'WebexCCSDK', // Specify the Contact Center client type\n * isKeepAliveEnabled: false, // Disable keep-alive functionality\n * force: true, // Force CC-specific configurations\n * metrics: {\n * clientName: 'WEBEX_JS_SDK', // Metrics client name\n * clientType: 'WebexCCSDK', // Metrics client type\n * },\n * },\n * };\n *\n * // Initialize Webex SDK with custom configuration\n * const webex = Webex.init({ config: customConfig });\n */\nWebex.init = function init(attrs = {}) {\n attrs.config = merge({}, config, attrs.config);\n\n return new Webex(attrs);\n};\n\nexport default Webex;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEAA,OAAA;AAEA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpC;AACA;AACA;AACA;AACA,IAAI,CAACG,MAAM,CAACC,MAAM,EAAE;EAClBD,MAAM,CAACC,MAAM,GAAGA,kBAAM;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAGC,kBAAS,CAACC,MAAM,CAAC;EAC7BC,KAAK,EAAE,IAAI;EACXC,OAAO;AACT,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAJ,KAAK,CAACK,IAAI,GAAG,SAASA,IAAIA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE;EACrCA,KAAK,CAACC,MAAM,GAAG,IAAAC,cAAK,EAAC,CAAC,CAAC,EAAED,oBAAM,EAAED,KAAK,CAACC,MAAM,CAAC;EAE9C,OAAO,IAAIP,KAAK,CAACM,KAAK,CAAC;AACzB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEaG,KAAK"}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import config from '@webex/jest-config-legacy';
|
|
2
|
+
|
|
3
|
+
const jestConfig = {
|
|
4
|
+
rootDir: './',
|
|
5
|
+
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
|
6
|
+
testResultsProcessor: 'jest-junit',
|
|
7
|
+
transformIgnorePatterns: [
|
|
8
|
+
'/node_modules/(?!(uuid)/)', // Transform `uuid` using Babel
|
|
9
|
+
],
|
|
10
|
+
// Clear mocks in between tests by default
|
|
11
|
+
clearMocks: true,
|
|
12
|
+
collectCoverage: true,
|
|
13
|
+
coverageThreshold: {
|
|
14
|
+
global: {
|
|
15
|
+
lines: 85,
|
|
16
|
+
functions: 85,
|
|
17
|
+
branches: 85,
|
|
18
|
+
statements: 85,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
coverageDirectory: 'coverage',
|
|
22
|
+
coverageReporters: ['clover', 'json', 'lcov'],
|
|
23
|
+
reporters: [
|
|
24
|
+
'default',
|
|
25
|
+
[
|
|
26
|
+
'jest-junit',
|
|
27
|
+
{
|
|
28
|
+
outputDirectory: 'coverage/junit',
|
|
29
|
+
outputName: 'coverage-junit.xml',
|
|
30
|
+
classNameTemplate: '{classname}',
|
|
31
|
+
titleTemplate: '{title}',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
'jest-html-reporters',
|
|
36
|
+
{
|
|
37
|
+
publicPath: './coverage',
|
|
38
|
+
filename: 'jest-report.html',
|
|
39
|
+
openReport: false,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default {...config, ...jestConfig};
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webex/contact-center",
|
|
3
|
+
"description": "This package provides a set of APIs to perform various operations for the Agent flow within Webex Contact Center",
|
|
4
|
+
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Adhwaith Menon <adhmenon@cisco.com>",
|
|
7
|
+
"Bharath Balan <bhabalan@cisco.com>",
|
|
8
|
+
"Kesava Krishnan Madavan <kmadavan@cisco.com>",
|
|
9
|
+
"Priya Kesari <pkesari@cisco.com>",
|
|
10
|
+
"Rajesh Kumar <rarajes2@cisco.com>",
|
|
11
|
+
"Ravi Chandra Sekhar Sarika <rsarika@cisco.com>",
|
|
12
|
+
"Shreyas Sharma <shreysh2@cisco.com>",
|
|
13
|
+
"Sreekanth Narayanan <sreenara@cisco.com>"
|
|
14
|
+
],
|
|
15
|
+
"main": "dist/webex.js",
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"devMain": "src/index.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/webex.js",
|
|
21
|
+
"require": "./dist/webex.js",
|
|
22
|
+
"types": "./dist/types/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./package": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/webex/webex-js-sdk.git",
|
|
29
|
+
"directory": "packages/@webex/contact-center"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=20.x"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build:src": "webex-legacy-tools build -dest \"./dist\" -src \"./src\" -js -ts -maps && yarn build",
|
|
36
|
+
"build": " yarn workspace @webex/calling run build:src && yarn run -T tsc --declaration true --declarationDir ./dist/types",
|
|
37
|
+
"fix:lint": "eslint 'src/**/*.ts' --fix",
|
|
38
|
+
"build:docs": "typedoc --out ../../../docs/wxcc",
|
|
39
|
+
"fix:prettier": "prettier \"src/**/*.ts\" --write",
|
|
40
|
+
"prebuild": "rimraf dist",
|
|
41
|
+
"test": "yarn test:style && yarn test:unit",
|
|
42
|
+
"test:style": "eslint 'src/**/*.ts'",
|
|
43
|
+
"test:unit": "webex-legacy-tools test --unit --runner jest",
|
|
44
|
+
"deploy:npm": "yarn npm publish"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@types/platform": "1.3.4",
|
|
48
|
+
"@webex/calling": "3.8.1-next.22",
|
|
49
|
+
"@webex/internal-plugin-mercury": "3.8.1-next.11",
|
|
50
|
+
"@webex/internal-plugin-metrics": "3.8.1-next.11",
|
|
51
|
+
"@webex/internal-plugin-support": "3.8.1-next.13",
|
|
52
|
+
"@webex/plugin-authorization": "3.8.1-next.11",
|
|
53
|
+
"@webex/plugin-logger": "3.8.1-next.11",
|
|
54
|
+
"@webex/webex-core": "3.8.1-next.11",
|
|
55
|
+
"jest-html-reporters": "3.0.11",
|
|
56
|
+
"lodash": "^4.17.21"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/preset-typescript": "7.22.11",
|
|
60
|
+
"@types/jest": "27.4.1",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "5.38.1",
|
|
62
|
+
"@typescript-eslint/parser": "5.38.1",
|
|
63
|
+
"@webex/babel-config-legacy": "0.0.0",
|
|
64
|
+
"@webex/eslint-config-legacy": "0.0.0",
|
|
65
|
+
"@webex/jest-config-legacy": "0.0.0",
|
|
66
|
+
"@webex/legacy-tools": "0.0.0",
|
|
67
|
+
"@webex/test-helper-mock-webex": "3.8.1-next.11",
|
|
68
|
+
"eslint": "^8.24.0",
|
|
69
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
70
|
+
"eslint-config-prettier": "8.3.0",
|
|
71
|
+
"eslint-import-resolver-typescript": "2.4.0",
|
|
72
|
+
"eslint-plugin-import": "2.25.3",
|
|
73
|
+
"eslint-plugin-jsdoc": "38.0.4",
|
|
74
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
75
|
+
"eslint-plugin-tsdoc": "0.2.14",
|
|
76
|
+
"jest": "27.5.1",
|
|
77
|
+
"jest-junit": "13.0.0",
|
|
78
|
+
"prettier": "2.5.1",
|
|
79
|
+
"typedoc": "^0.25.0",
|
|
80
|
+
"typescript": "4.9.5"
|
|
81
|
+
},
|
|
82
|
+
"version": "0.0.0-next.1"
|
|
83
|
+
}
|