@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,452 @@
|
|
|
1
|
+
import { CallingClientConfig } from '@webex/calling';
|
|
2
|
+
import * as Agent from './services/agent/types';
|
|
3
|
+
import { Profile } from './services/config/types';
|
|
4
|
+
/**
|
|
5
|
+
* HTTP methods supported by WebexRequest.
|
|
6
|
+
* @enum {string}
|
|
7
|
+
* @public
|
|
8
|
+
* @example
|
|
9
|
+
* const method: HTTP_METHODS = HTTP_METHODS.GET;
|
|
10
|
+
* @ignore
|
|
11
|
+
*/
|
|
12
|
+
export declare const HTTP_METHODS: {
|
|
13
|
+
/** HTTP GET method for retrieving data */
|
|
14
|
+
readonly GET: "GET";
|
|
15
|
+
/** HTTP POST method for creating resources */
|
|
16
|
+
readonly POST: "POST";
|
|
17
|
+
/** HTTP PATCH method for partial updates */
|
|
18
|
+
readonly PATCH: "PATCH";
|
|
19
|
+
/** HTTP PUT method for complete updates */
|
|
20
|
+
readonly PUT: "PUT";
|
|
21
|
+
/** HTTP DELETE method for removing resources */
|
|
22
|
+
readonly DELETE: "DELETE";
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Union type of HTTP methods.
|
|
26
|
+
* @public
|
|
27
|
+
* @example
|
|
28
|
+
* function makeRequest(method: HTTP_METHODS) { ... }
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
export type HTTP_METHODS = Enum<typeof HTTP_METHODS>;
|
|
32
|
+
/**
|
|
33
|
+
* Payload for making requests to Webex APIs.
|
|
34
|
+
* @public
|
|
35
|
+
* @example
|
|
36
|
+
* const payload: WebexRequestPayload = {
|
|
37
|
+
* service: 'identity',
|
|
38
|
+
* resource: '/users',
|
|
39
|
+
* method: HTTP_METHODS.GET
|
|
40
|
+
* };
|
|
41
|
+
* @ignore
|
|
42
|
+
*/
|
|
43
|
+
export type WebexRequestPayload = {
|
|
44
|
+
/** Service name to target */
|
|
45
|
+
service?: string;
|
|
46
|
+
/** Resource path within the service */
|
|
47
|
+
resource?: string;
|
|
48
|
+
/** HTTP method to use */
|
|
49
|
+
method?: HTTP_METHODS;
|
|
50
|
+
/** Full URI if not using service/resource pattern */
|
|
51
|
+
uri?: string;
|
|
52
|
+
/** Whether to add authorization header */
|
|
53
|
+
addAuthHeader?: boolean;
|
|
54
|
+
/** Custom headers to include in request */
|
|
55
|
+
headers?: {
|
|
56
|
+
[key: string]: string | null;
|
|
57
|
+
};
|
|
58
|
+
/** Request body data */
|
|
59
|
+
body?: object;
|
|
60
|
+
/** Expected response status code */
|
|
61
|
+
statusCode?: number;
|
|
62
|
+
/** Whether to parse response as JSON */
|
|
63
|
+
json?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Configuration options for the Contact Center Plugin.
|
|
67
|
+
* @interface CCPluginConfig
|
|
68
|
+
* @public
|
|
69
|
+
* @example
|
|
70
|
+
* const config: CCPluginConfig = {
|
|
71
|
+
* allowMultiLogin: true,
|
|
72
|
+
* allowAutomatedRelogin: false,
|
|
73
|
+
* clientType: 'browser',
|
|
74
|
+
* isKeepAliveEnabled: true,
|
|
75
|
+
* force: false,
|
|
76
|
+
* metrics: { clientName: 'myClient', clientType: 'browser' },
|
|
77
|
+
* logging: { enable: true, verboseEvents: false },
|
|
78
|
+
* callingClientConfig: { ... }
|
|
79
|
+
* };
|
|
80
|
+
*/
|
|
81
|
+
export interface CCPluginConfig {
|
|
82
|
+
/** Whether to allow multiple logins from different devices */
|
|
83
|
+
allowMultiLogin: boolean;
|
|
84
|
+
/** Whether to automatically attempt relogin on connection loss */
|
|
85
|
+
allowAutomatedRelogin: boolean;
|
|
86
|
+
/** The type of client making the connection */
|
|
87
|
+
clientType: string;
|
|
88
|
+
/** Whether to enable keep-alive messages */
|
|
89
|
+
isKeepAliveEnabled: boolean;
|
|
90
|
+
/** Whether to force registration */
|
|
91
|
+
force: boolean;
|
|
92
|
+
/** Metrics configuration */
|
|
93
|
+
metrics: {
|
|
94
|
+
/** Name of the client for metrics */
|
|
95
|
+
clientName: string;
|
|
96
|
+
/** Type of client for metrics */
|
|
97
|
+
clientType: string;
|
|
98
|
+
};
|
|
99
|
+
/** Logging configuration */
|
|
100
|
+
logging: {
|
|
101
|
+
/** Whether to enable logging */
|
|
102
|
+
enable: boolean;
|
|
103
|
+
/** Whether to log verbose events */
|
|
104
|
+
verboseEvents: boolean;
|
|
105
|
+
};
|
|
106
|
+
/** Configuration for the calling client */
|
|
107
|
+
callingClientConfig: CallingClientConfig;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Logger interface for standardized logging throughout the plugin.
|
|
111
|
+
* @public
|
|
112
|
+
* @example
|
|
113
|
+
* logger.log('This is a log message');
|
|
114
|
+
* logger.error('This is an error message');
|
|
115
|
+
* @ignore
|
|
116
|
+
*/
|
|
117
|
+
export type Logger = {
|
|
118
|
+
/** Log general messages */
|
|
119
|
+
log: (payload: string) => void;
|
|
120
|
+
/** Log error messages */
|
|
121
|
+
error: (payload: string) => void;
|
|
122
|
+
/** Log warning messages */
|
|
123
|
+
warn: (payload: string) => void;
|
|
124
|
+
/** Log informational messages */
|
|
125
|
+
info: (payload: string) => void;
|
|
126
|
+
/** Log detailed trace messages */
|
|
127
|
+
trace: (payload: string) => void;
|
|
128
|
+
/** Log debug messages */
|
|
129
|
+
debug: (payload: string) => void;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Contextual information for log entries.
|
|
133
|
+
* @public
|
|
134
|
+
* @ignore
|
|
135
|
+
*/
|
|
136
|
+
export interface LogContext {
|
|
137
|
+
/** Module name where the log originated */
|
|
138
|
+
module?: string;
|
|
139
|
+
/** Method name where the log originated */
|
|
140
|
+
method?: string;
|
|
141
|
+
interactionId?: string;
|
|
142
|
+
trackingId?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Available logging severity levels.
|
|
146
|
+
* @enum {string}
|
|
147
|
+
* @public
|
|
148
|
+
* @example
|
|
149
|
+
* const level: LOGGING_LEVEL = LOGGING_LEVEL.error;
|
|
150
|
+
* @ignore
|
|
151
|
+
*/
|
|
152
|
+
export declare enum LOGGING_LEVEL {
|
|
153
|
+
/** Critical failures that require immediate attention */
|
|
154
|
+
error = "ERROR",
|
|
155
|
+
/** Important issues that don't prevent the system from working */
|
|
156
|
+
warn = "WARN",
|
|
157
|
+
/** General informational logs */
|
|
158
|
+
log = "LOG",
|
|
159
|
+
/** Detailed information about system operation */
|
|
160
|
+
info = "INFO",
|
|
161
|
+
/** Highly detailed diagnostic information */
|
|
162
|
+
trace = "TRACE"
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Metadata for log uploads.
|
|
166
|
+
* @public
|
|
167
|
+
* @example
|
|
168
|
+
* const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };
|
|
169
|
+
* @ignore
|
|
170
|
+
*/
|
|
171
|
+
export type LogsMetaData = {
|
|
172
|
+
/** Optional feedback ID to associate with logs */
|
|
173
|
+
feedbackId?: string;
|
|
174
|
+
/** Optional correlation ID to track related operations */
|
|
175
|
+
correlationId?: string;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Response from uploading logs to the server.
|
|
179
|
+
* @public
|
|
180
|
+
* @example
|
|
181
|
+
* const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };
|
|
182
|
+
*/
|
|
183
|
+
export type UploadLogsResponse = {
|
|
184
|
+
/** Tracking ID for the upload request */
|
|
185
|
+
trackingid?: string;
|
|
186
|
+
/** URL where the logs can be accessed */
|
|
187
|
+
url?: string;
|
|
188
|
+
/** ID of the user who uploaded logs */
|
|
189
|
+
userId?: string;
|
|
190
|
+
/** Feedback ID associated with the logs */
|
|
191
|
+
feedbackId?: string;
|
|
192
|
+
/** Correlation ID for tracking related operations */
|
|
193
|
+
correlationId?: string;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Interface representing the WebexSDK core functionality.
|
|
197
|
+
* @interface WebexSDK
|
|
198
|
+
* @public
|
|
199
|
+
* @example
|
|
200
|
+
* const sdk: WebexSDK = ...;
|
|
201
|
+
* sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });
|
|
202
|
+
* @ignore
|
|
203
|
+
*/
|
|
204
|
+
export interface WebexSDK {
|
|
205
|
+
/** Version of the WebexSDK */
|
|
206
|
+
version: string;
|
|
207
|
+
/** Whether the SDK can authorize requests */
|
|
208
|
+
canAuthorize: boolean;
|
|
209
|
+
/** Credentials management */
|
|
210
|
+
credentials: {
|
|
211
|
+
/** Get the user token for authentication */
|
|
212
|
+
getUserToken: () => Promise<string>;
|
|
213
|
+
/** Get the organization ID */
|
|
214
|
+
getOrgId: () => string;
|
|
215
|
+
};
|
|
216
|
+
/** Whether the SDK is ready for use */
|
|
217
|
+
ready: boolean;
|
|
218
|
+
/** Make a request to the Webex APIs */
|
|
219
|
+
request: <T>(payload: WebexRequestPayload) => Promise<T>;
|
|
220
|
+
/** Register a one-time event handler */
|
|
221
|
+
once: (event: string, callBack: () => void) => void;
|
|
222
|
+
/** Internal plugins and services */
|
|
223
|
+
internal: IWebexInternal;
|
|
224
|
+
/** Logger instance */
|
|
225
|
+
logger: Logger;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* An interface for the `ContactCenter` class.
|
|
229
|
+
* The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.
|
|
230
|
+
* @public
|
|
231
|
+
* @example
|
|
232
|
+
* const cc: IContactCenter = ...;
|
|
233
|
+
* cc.register().then(profile => { ... });
|
|
234
|
+
* @ignore
|
|
235
|
+
*/
|
|
236
|
+
export interface IContactCenter {
|
|
237
|
+
/**
|
|
238
|
+
* Initialize the CC SDK by setting up the contact center mercury connection.
|
|
239
|
+
* This establishes WebSocket connectivity for real-time communication.
|
|
240
|
+
*
|
|
241
|
+
* @returns A Promise that resolves to the agent's profile upon successful registration
|
|
242
|
+
* @public
|
|
243
|
+
* @example
|
|
244
|
+
* cc.register().then(profile => { ... });
|
|
245
|
+
*/
|
|
246
|
+
register(): Promise<Profile>;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Generic HTTP response structure.
|
|
250
|
+
* @public
|
|
251
|
+
* @example
|
|
252
|
+
* const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };
|
|
253
|
+
* @ignore
|
|
254
|
+
*/
|
|
255
|
+
export interface IHttpResponse {
|
|
256
|
+
/** Response body content */
|
|
257
|
+
body: any;
|
|
258
|
+
/** HTTP status code */
|
|
259
|
+
statusCode: number;
|
|
260
|
+
/** HTTP method used for the request */
|
|
261
|
+
method: string;
|
|
262
|
+
/** Response headers */
|
|
263
|
+
headers: Headers;
|
|
264
|
+
/** Request URL */
|
|
265
|
+
url: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Supported login options for agent authentication.
|
|
269
|
+
* @public
|
|
270
|
+
* @example
|
|
271
|
+
* const option: LoginOption = LoginOption.AGENT_DN;
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
274
|
+
export declare const LoginOption: {
|
|
275
|
+
/** Login using agent's direct number */
|
|
276
|
+
readonly AGENT_DN: "AGENT_DN";
|
|
277
|
+
/** Login using an extension number */
|
|
278
|
+
readonly EXTENSION: "EXTENSION";
|
|
279
|
+
/** Login using browser WebRTC capabilities */
|
|
280
|
+
readonly BROWSER: "BROWSER";
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Union type of login options.
|
|
284
|
+
* @public
|
|
285
|
+
* @example
|
|
286
|
+
* function login(option: LoginOption) { ... }
|
|
287
|
+
* @ignore
|
|
288
|
+
*/
|
|
289
|
+
export type LoginOption = Enum<typeof LoginOption>;
|
|
290
|
+
/**
|
|
291
|
+
* Request payload for subscribing to the contact center websocket.
|
|
292
|
+
* @public
|
|
293
|
+
* @example
|
|
294
|
+
* const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };
|
|
295
|
+
* @ignore
|
|
296
|
+
*/
|
|
297
|
+
export type SubscribeRequest = {
|
|
298
|
+
/** Whether to force connection even if another exists */
|
|
299
|
+
force: boolean;
|
|
300
|
+
/** Whether to send keepalive messages */
|
|
301
|
+
isKeepAliveEnabled: boolean;
|
|
302
|
+
/** Type of client connecting */
|
|
303
|
+
clientType: string;
|
|
304
|
+
/** Whether to allow login from multiple devices */
|
|
305
|
+
allowMultiLogin: boolean;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Represents the response from getListOfTeams method.
|
|
309
|
+
* Teams are groups of agents that can be managed together.
|
|
310
|
+
* @public
|
|
311
|
+
* @example
|
|
312
|
+
* const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };
|
|
313
|
+
* @ignore
|
|
314
|
+
*/
|
|
315
|
+
export type Team = {
|
|
316
|
+
/**
|
|
317
|
+
* Unique identifier of the team.
|
|
318
|
+
*/
|
|
319
|
+
id: string;
|
|
320
|
+
/**
|
|
321
|
+
* Display name of the team.
|
|
322
|
+
*/
|
|
323
|
+
name: string;
|
|
324
|
+
/**
|
|
325
|
+
* Associated desktop layout ID for the team.
|
|
326
|
+
* Controls how the agent desktop is displayed for team members.
|
|
327
|
+
*/
|
|
328
|
+
desktopLayoutId?: string;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Represents the request to perform agent login.
|
|
332
|
+
* @public
|
|
333
|
+
* @example
|
|
334
|
+
* const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };
|
|
335
|
+
*/
|
|
336
|
+
export type AgentLogin = {
|
|
337
|
+
/**
|
|
338
|
+
* A dialNumber field contains the number to dial such as a route point or extension.
|
|
339
|
+
* Required for AGENT_DN and EXTENSION login options.
|
|
340
|
+
*/
|
|
341
|
+
dialNumber?: string;
|
|
342
|
+
/**
|
|
343
|
+
* The unique ID representing a team of users.
|
|
344
|
+
* The agent must belong to this team.
|
|
345
|
+
*/
|
|
346
|
+
teamId: string;
|
|
347
|
+
/**
|
|
348
|
+
* The loginOption field specifies the type of login method.
|
|
349
|
+
* Controls how calls are delivered to the agent.
|
|
350
|
+
*/
|
|
351
|
+
loginOption: LoginOption;
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* Represents the request to update agent profile settings.
|
|
355
|
+
* @public
|
|
356
|
+
* @example
|
|
357
|
+
* const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };
|
|
358
|
+
*/
|
|
359
|
+
export type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;
|
|
360
|
+
/**
|
|
361
|
+
* Represents the options to fetch buddy agents for the logged in agent.
|
|
362
|
+
* Buddy agents are other agents who can be consulted or transfered to.
|
|
363
|
+
* @public
|
|
364
|
+
* @example
|
|
365
|
+
* const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };
|
|
366
|
+
* @ignore
|
|
367
|
+
*/
|
|
368
|
+
export type BuddyAgents = {
|
|
369
|
+
/**
|
|
370
|
+
* The media type channel to filter buddy agents.
|
|
371
|
+
* Determines which channel capability the returned agents must have.
|
|
372
|
+
*/
|
|
373
|
+
mediaType: 'telephony' | 'chat' | 'social' | 'email';
|
|
374
|
+
/**
|
|
375
|
+
* Optional filter for agent state.
|
|
376
|
+
* If specified, returns only agents in that state.
|
|
377
|
+
* If omitted, returns both available and idle agents.
|
|
378
|
+
*/
|
|
379
|
+
state?: 'Available' | 'Idle';
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Generic error structure for Contact Center SDK errors.
|
|
383
|
+
* Contains detailed information about the error context.
|
|
384
|
+
* @public
|
|
385
|
+
* @example
|
|
386
|
+
* const err: GenericError = new Error('Failed');
|
|
387
|
+
* err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };
|
|
388
|
+
* @ignore
|
|
389
|
+
*/
|
|
390
|
+
export interface GenericError extends Error {
|
|
391
|
+
/** Structured details about the error */
|
|
392
|
+
details: {
|
|
393
|
+
/** Error type identifier */
|
|
394
|
+
type: string;
|
|
395
|
+
/** Organization ID where the error occurred */
|
|
396
|
+
orgId: string;
|
|
397
|
+
/** Unique tracking ID for the error */
|
|
398
|
+
trackingId: string;
|
|
399
|
+
/** Additional error context data */
|
|
400
|
+
data: Record<string, any>;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Response type for station login operations.
|
|
405
|
+
* Either a success response with agent details or an error.
|
|
406
|
+
* @public
|
|
407
|
+
* @example
|
|
408
|
+
* function handleLogin(resp: StationLoginResponse) { ... }
|
|
409
|
+
*/
|
|
410
|
+
export type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;
|
|
411
|
+
/**
|
|
412
|
+
* Response type for station logout operations.
|
|
413
|
+
* Either a success response with logout details or an error.
|
|
414
|
+
* @public
|
|
415
|
+
* @example
|
|
416
|
+
* function handleLogout(resp: StationLogoutResponse) { ... }
|
|
417
|
+
*/
|
|
418
|
+
export type StationLogoutResponse = Agent.LogoutSuccess | Error;
|
|
419
|
+
/**
|
|
420
|
+
* Response type for station relogin operations.
|
|
421
|
+
* Either a success response with relogin details or an error.
|
|
422
|
+
* @public
|
|
423
|
+
* @example
|
|
424
|
+
* function handleReLogin(resp: StationReLoginResponse) { ... }
|
|
425
|
+
* @ignore
|
|
426
|
+
*/
|
|
427
|
+
export type StationReLoginResponse = Agent.ReloginSuccess | Error;
|
|
428
|
+
/**
|
|
429
|
+
* Response type for agent state change operations.
|
|
430
|
+
* Either a success response with state change details or an error.
|
|
431
|
+
* @public
|
|
432
|
+
* @example
|
|
433
|
+
* function handleStateChange(resp: SetStateResponse) { ... }
|
|
434
|
+
* @ignore
|
|
435
|
+
*/
|
|
436
|
+
export type SetStateResponse = Agent.StateChangeSuccess | Error;
|
|
437
|
+
/**
|
|
438
|
+
* Response type for buddy agents query operations.
|
|
439
|
+
* Either a success response with list of buddy agents or an error.
|
|
440
|
+
* @public
|
|
441
|
+
* @example
|
|
442
|
+
* function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }
|
|
443
|
+
*/
|
|
444
|
+
export type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;
|
|
445
|
+
/**
|
|
446
|
+
* Response type for device type update operations.
|
|
447
|
+
* Either a success response with update confirmation or an error.
|
|
448
|
+
* @public
|
|
449
|
+
* @example
|
|
450
|
+
* function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }
|
|
451
|
+
*/
|
|
452
|
+
export type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Webex SDK configuration for Contact Center integration.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
* @example
|
|
6
|
+
* import webexConfig from './webex-config';
|
|
7
|
+
* const hydraUrl = webexConfig.hydra;
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
/**
|
|
11
|
+
* URL for the Hydra API service.
|
|
12
|
+
* @type {string}
|
|
13
|
+
* @public
|
|
14
|
+
* @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'
|
|
15
|
+
*/
|
|
16
|
+
hydra: string;
|
|
17
|
+
/**
|
|
18
|
+
* Alias for the Hydra API service URL.
|
|
19
|
+
* @type {string}
|
|
20
|
+
* @public
|
|
21
|
+
* @default process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1'
|
|
22
|
+
*/
|
|
23
|
+
hydraServiceUrl: string;
|
|
24
|
+
/**
|
|
25
|
+
* Credentials configuration (empty by default).
|
|
26
|
+
* @type {object}
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
credentials: {};
|
|
30
|
+
/**
|
|
31
|
+
* Device configuration options.
|
|
32
|
+
* @type {object}
|
|
33
|
+
* @public
|
|
34
|
+
* @property {boolean} validateDomains - Whether to validate device domains.
|
|
35
|
+
* @property {boolean} ephemeral - Whether the device is ephemeral.
|
|
36
|
+
*/
|
|
37
|
+
device: {
|
|
38
|
+
validateDomains: boolean;
|
|
39
|
+
ephemeral: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Storage configuration for the SDK.
|
|
43
|
+
* @type {object}
|
|
44
|
+
* @public
|
|
45
|
+
* @property {typeof MemoryStoreAdapter} boundedAdapter - Adapter for bounded storage.
|
|
46
|
+
* @property {typeof MemoryStoreAdapter} unboundedAdapter - Adapter for unbounded storage.
|
|
47
|
+
*/
|
|
48
|
+
storage: {
|
|
49
|
+
boundedAdapter: any;
|
|
50
|
+
unboundedAdapter: any;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default _default;
|