@webex/calling 3.13.0-next.1 → 3.13.0-next.10
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 +1 -1
- package/dist/CallHistory/CallHistory.js +1 -1
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +2 -1
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallQueue/CallQueue.js +1322 -0
- package/dist/CallQueue/CallQueue.js.map +1 -0
- package/dist/CallQueue/CallQueue.test.js +3321 -0
- package/dist/CallQueue/CallQueue.test.js.map +1 -0
- package/dist/CallQueue/constants.js +65 -0
- package/dist/CallQueue/constants.js.map +1 -0
- package/dist/CallQueue/types.js +4 -0
- package/dist/CallQueue/types.js.map +1 -0
- package/dist/CallQueue/utils.js +370 -0
- package/dist/CallQueue/utils.js.map +1 -0
- package/dist/CallQueue/utils.test.js +548 -0
- package/dist/CallQueue/utils.test.js.map +1 -0
- package/dist/CallingClient/constants.js +1 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/registration/register.js +2 -2
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +133 -97
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/Events/types.js +1 -0
- package/dist/Events/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +10 -10
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +40 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/api.js +47 -8
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +8 -7
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +320 -239
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/index.js +102 -45
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +1 -1
- package/dist/module/CallQueue/CallQueue.js +718 -0
- package/dist/module/CallQueue/constants.js +41 -0
- package/dist/module/CallQueue/types.js +1 -0
- package/dist/module/CallQueue/utils.js +253 -0
- package/dist/module/CallingClient/constants.js +1 -1
- package/dist/module/CallingClient/registration/register.js +1 -1
- package/dist/module/Events/types.js +1 -0
- package/dist/module/Voicemail/Voicemail.js +10 -10
- package/dist/module/api.js +5 -2
- package/dist/module/common/Utils.js +7 -5
- package/dist/module/index.js +4 -1
- package/dist/types/CallQueue/CallQueue.d.ts +45 -0
- package/dist/types/CallQueue/CallQueue.d.ts.map +1 -0
- package/dist/types/CallQueue/constants.d.ts +37 -0
- package/dist/types/CallQueue/constants.d.ts.map +1 -0
- package/dist/types/CallQueue/types.d.ts +97 -0
- package/dist/types/CallQueue/types.d.ts.map +1 -0
- package/dist/types/CallQueue/utils.d.ts +19 -0
- package/dist/types/CallQueue/utils.d.ts.map +1 -0
- package/dist/types/CallingClient/constants.d.ts +1 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +2 -1
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +1 -1
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +8 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -24
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export var ACD_STATE;
|
|
2
|
+
(function (ACD_STATE) {
|
|
3
|
+
ACD_STATE["SIGN_IN"] = "SIGN_IN";
|
|
4
|
+
ACD_STATE["SIGN_OUT"] = "SIGN_OUT";
|
|
5
|
+
ACD_STATE["AVAILABLE"] = "AVAILABLE";
|
|
6
|
+
ACD_STATE["UNAVAILABLE"] = "UNAVAILABLE";
|
|
7
|
+
ACD_STATE["WRAP_UP"] = "WRAP_UP";
|
|
8
|
+
})(ACD_STATE || (ACD_STATE = {}));
|
|
9
|
+
export const ACD_STATE_VALUES = [
|
|
10
|
+
{ state: ACD_STATE.SIGN_IN, values: [ACD_STATE.SIGN_IN, 'signIn'] },
|
|
11
|
+
{ state: ACD_STATE.SIGN_OUT, values: [ACD_STATE.SIGN_OUT, 'signOut'] },
|
|
12
|
+
{ state: ACD_STATE.AVAILABLE, values: [ACD_STATE.AVAILABLE, 'available'] },
|
|
13
|
+
{ state: ACD_STATE.UNAVAILABLE, values: [ACD_STATE.UNAVAILABLE, 'unavailable'] },
|
|
14
|
+
{ state: ACD_STATE.WRAP_UP, values: [ACD_STATE.WRAP_UP, 'wrapUp'] },
|
|
15
|
+
];
|
|
16
|
+
export var CALL_QUEUE_MERCURY_EVENT_KEYS;
|
|
17
|
+
(function (CALL_QUEUE_MERCURY_EVENT_KEYS) {
|
|
18
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_SYNC"] = "event:telephony_agents.sync";
|
|
19
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_STATE"] = "event:telephony_agents.state";
|
|
20
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_JOIN"] = "event:telephony_agents.join";
|
|
21
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_SYNC_SINGULAR"] = "event:telephony_agent.sync";
|
|
22
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_STATE_SINGULAR"] = "event:telephony_agent.state";
|
|
23
|
+
CALL_QUEUE_MERCURY_EVENT_KEYS["TELEPHONY_AGENT_JOIN_SINGULAR"] = "event:telephony_agent.join";
|
|
24
|
+
})(CALL_QUEUE_MERCURY_EVENT_KEYS || (CALL_QUEUE_MERCURY_EVENT_KEYS = {}));
|
|
25
|
+
export const SUPPORTED_STATES = new Set(Object.values(ACD_STATE));
|
|
26
|
+
export const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
27
|
+
export const CALL_QUEUE_FILE = 'CallQueue';
|
|
28
|
+
export const METHODS = {
|
|
29
|
+
GET_CALL_QUEUE_SETTINGS: 'getCallQueueSettings',
|
|
30
|
+
GET_CALL_QUEUE_NAMES: 'getCallQueueNames',
|
|
31
|
+
UPDATE_CALL_QUEUE_SETTINGS: 'updateCallQueueSettings',
|
|
32
|
+
SYNC_TELEPHONY_CALLS: 'syncTelephonyCalls',
|
|
33
|
+
};
|
|
34
|
+
export const QUEUES_PATH = 'telephony/config/people/me/settings/queues';
|
|
35
|
+
export const QUEUES_CATALOG_PATH = 'telephony/config/queues';
|
|
36
|
+
export const SYNC_PATH = 'telephony/calls/sync/invoke';
|
|
37
|
+
export const MAX_QUEUE_CATALOG_PAGES = 10;
|
|
38
|
+
export const SECONDARY_LINES_PATH = 'telephony/config/people/me/settings/secondaryLines';
|
|
39
|
+
export const LINE_OWNER_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
40
|
+
export const WDM_DEVICE_ID_PATTERN = /^[A-Za-z0-9-]{1,128}$/;
|
|
41
|
+
export const UNSUPPORTED_BACKEND_MESSAGE = 'Call queues are supported for Webex Calling cloud only';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { COMMON_EVENT_KEYS } from '../Events/types';
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { FAILURE_MESSAGE } from '../common/constants';
|
|
2
|
+
import { ACD_STATE, ACD_STATE_VALUES, UUID_PATTERN } from './constants';
|
|
3
|
+
export function lifecycleConflictResponse(requestSent = false) {
|
|
4
|
+
return {
|
|
5
|
+
statusCode: 409,
|
|
6
|
+
data: {
|
|
7
|
+
error: requestSent
|
|
8
|
+
? 'Call queue client was reinitialized; request may have completed; refresh settings before retrying'
|
|
9
|
+
: 'Call queue client was reinitialized; refresh settings',
|
|
10
|
+
},
|
|
11
|
+
message: FAILURE_MESSAGE,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function hasReadyEntitlementModels(webex) {
|
|
15
|
+
const models = webex.internal.device?.features?.entitlement?.models;
|
|
16
|
+
return Array.isArray(models) && models.every((model) => typeof model?._values?.key === 'string');
|
|
17
|
+
}
|
|
18
|
+
export default function actorIdentity(value) {
|
|
19
|
+
const parse = (candidate) => /^ciscospark:\/\/[^/]+\/(PEOPLE|PERSON|VIRTUAL_LINE)\/([^/]+)$/i.exec(candidate);
|
|
20
|
+
let match = parse(value);
|
|
21
|
+
if (!match) {
|
|
22
|
+
try {
|
|
23
|
+
match = parse(atob(value.replace(/-/g, '+').replace(/_/g, '/')));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return match
|
|
29
|
+
? { type: match[1].toUpperCase(), id: match[2].toLowerCase() }
|
|
30
|
+
: { id: value.toLowerCase() };
|
|
31
|
+
}
|
|
32
|
+
export function normalizeAcdState(value) {
|
|
33
|
+
return value === undefined
|
|
34
|
+
? undefined
|
|
35
|
+
: ACD_STATE_VALUES.find(({ values }) => values.includes(value))?.state;
|
|
36
|
+
}
|
|
37
|
+
function readString(value) {
|
|
38
|
+
return typeof value === 'string' && value.trim() ? value : undefined;
|
|
39
|
+
}
|
|
40
|
+
function readBoolean(value) {
|
|
41
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
42
|
+
}
|
|
43
|
+
function readQueue(value) {
|
|
44
|
+
if (!value || typeof value !== 'object') {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const record = value;
|
|
48
|
+
const id = readString(record.id);
|
|
49
|
+
const available = readBoolean(record.available);
|
|
50
|
+
if (!id) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const queue = { id };
|
|
54
|
+
if (available !== undefined) {
|
|
55
|
+
queue.available = available;
|
|
56
|
+
}
|
|
57
|
+
const name = readString(record.name);
|
|
58
|
+
const phoneNumber = readString(record.phoneNumber);
|
|
59
|
+
const extension = readString(record.extension);
|
|
60
|
+
const allowLogOffEnabled = readBoolean(record.allowLogOffEnabled);
|
|
61
|
+
const hasCxEssentials = readBoolean(record.hasCxEssentials);
|
|
62
|
+
if (name) {
|
|
63
|
+
queue.name = name;
|
|
64
|
+
}
|
|
65
|
+
if (phoneNumber) {
|
|
66
|
+
queue.phoneNumber = phoneNumber;
|
|
67
|
+
}
|
|
68
|
+
if (extension) {
|
|
69
|
+
queue.extension = extension;
|
|
70
|
+
}
|
|
71
|
+
if (typeof record.skillLevel === 'number') {
|
|
72
|
+
queue.skillLevel = record.skillLevel;
|
|
73
|
+
}
|
|
74
|
+
if (allowLogOffEnabled !== undefined) {
|
|
75
|
+
queue.allowLogOffEnabled = allowLogOffEnabled;
|
|
76
|
+
}
|
|
77
|
+
if (hasCxEssentials !== undefined) {
|
|
78
|
+
queue.hasCxEssentials = hasCxEssentials;
|
|
79
|
+
}
|
|
80
|
+
return queue;
|
|
81
|
+
}
|
|
82
|
+
export function hasMalformedQueueRecords(body) {
|
|
83
|
+
if (!body || typeof body !== 'object')
|
|
84
|
+
return false;
|
|
85
|
+
const queues = body.queues;
|
|
86
|
+
return Array.isArray(queues) && queues.some((queue) => !readQueue(queue));
|
|
87
|
+
}
|
|
88
|
+
export function queueIdKey(id) {
|
|
89
|
+
if (UUID_PATTERN.test(id)) {
|
|
90
|
+
return id.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const decoded = atob(id.replace(/-/g, '+').replace(/_/g, '/'));
|
|
94
|
+
const match = /^ciscospark:\/\/[^/]+\/CALL_QUEUE\/([^/]+)$/i.exec(decoded);
|
|
95
|
+
if (match && UUID_PATTERN.test(match[1])) {
|
|
96
|
+
return match[1].toLowerCase();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
}
|
|
101
|
+
return id;
|
|
102
|
+
}
|
|
103
|
+
export function publicApiId(id, type) {
|
|
104
|
+
return UUID_PATTERN.test(id)
|
|
105
|
+
? btoa(`ciscospark://us/${type}/${id}`)
|
|
106
|
+
.replace(/\+/g, '-')
|
|
107
|
+
.replace(/\//g, '_')
|
|
108
|
+
.replace(/=+$/, '')
|
|
109
|
+
: id;
|
|
110
|
+
}
|
|
111
|
+
export function parseCallQueueCatalog(body) {
|
|
112
|
+
if (!body || typeof body !== 'object') {
|
|
113
|
+
return { entries: [] };
|
|
114
|
+
}
|
|
115
|
+
const record = body;
|
|
116
|
+
let list = [];
|
|
117
|
+
if (Array.isArray(record.queues)) {
|
|
118
|
+
list = record.queues;
|
|
119
|
+
}
|
|
120
|
+
else if (Array.isArray(record.items)) {
|
|
121
|
+
list = record.items;
|
|
122
|
+
}
|
|
123
|
+
const entries = list.flatMap((value) => {
|
|
124
|
+
if (!value || typeof value !== 'object') {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const item = value;
|
|
128
|
+
const id = readString(item.id);
|
|
129
|
+
if (!id) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
const name = readString(item.name);
|
|
133
|
+
return [name ? { id, name } : { id }];
|
|
134
|
+
});
|
|
135
|
+
const paging = record.paging;
|
|
136
|
+
const next = paging && typeof paging === 'object'
|
|
137
|
+
? readString(paging.next)
|
|
138
|
+
: undefined;
|
|
139
|
+
return next ? { entries, next } : { entries };
|
|
140
|
+
}
|
|
141
|
+
export function applyQueueNames(status, names) {
|
|
142
|
+
let changed = false;
|
|
143
|
+
const queues = status.queues.map((queue) => {
|
|
144
|
+
const name = names.get(queueIdKey(queue.id));
|
|
145
|
+
if (!name || queue.name) {
|
|
146
|
+
return queue;
|
|
147
|
+
}
|
|
148
|
+
changed = true;
|
|
149
|
+
return { ...queue, name };
|
|
150
|
+
});
|
|
151
|
+
return changed ? { ...status, queues } : status;
|
|
152
|
+
}
|
|
153
|
+
export function parseCallQueueSettings(body, previous) {
|
|
154
|
+
if (!body || typeof body !== 'object') {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
const record = body;
|
|
158
|
+
const rawState = readString(record.agentACDState);
|
|
159
|
+
const acdState = record.agentACDState == null ? previous?.acdState : normalizeAcdState(rawState);
|
|
160
|
+
if ((!Array.isArray(record.queues) && !rawState) || !acdState) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
const parsedQueues = Array.isArray(record.queues) ? record.queues.map(readQueue) : undefined;
|
|
164
|
+
if (parsedQueues?.some((queue) => !queue))
|
|
165
|
+
return undefined;
|
|
166
|
+
const queues = parsedQueues ? parsedQueues : previous?.queues ?? [];
|
|
167
|
+
return { acdState, queues };
|
|
168
|
+
}
|
|
169
|
+
export function unwrapAgentPayload(event) {
|
|
170
|
+
if (!event || typeof event !== 'object') {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
const record = event;
|
|
174
|
+
const nested = record.data;
|
|
175
|
+
if (nested && typeof nested === 'object') {
|
|
176
|
+
return nested;
|
|
177
|
+
}
|
|
178
|
+
return record;
|
|
179
|
+
}
|
|
180
|
+
function mergeQueues(current, incoming) {
|
|
181
|
+
const byId = new Map(current.map((queue) => [queueIdKey(queue.id), queue]));
|
|
182
|
+
incoming.forEach((queue) => {
|
|
183
|
+
const key = queueIdKey(queue.id);
|
|
184
|
+
const previous = byId.get(key);
|
|
185
|
+
byId.set(key, previous ? { ...previous, ...queue, id: previous.id } : queue);
|
|
186
|
+
});
|
|
187
|
+
return Array.from(byId.values());
|
|
188
|
+
}
|
|
189
|
+
export function applyCallQueueEvent(current, kind, event) {
|
|
190
|
+
const payload = unwrapAgentPayload(event);
|
|
191
|
+
if (!payload) {
|
|
192
|
+
return current;
|
|
193
|
+
}
|
|
194
|
+
const acdState = normalizeAcdState(payload.agentACDState ?? payload.acdStateInfo?.state ?? payload.state);
|
|
195
|
+
const rawQueues = Array.isArray(payload.queues) ? payload.queues : undefined;
|
|
196
|
+
const incomingQueues = rawQueues
|
|
197
|
+
? rawQueues.map(readQueue).filter((queue) => Boolean(queue))
|
|
198
|
+
: undefined;
|
|
199
|
+
const incompleteQueues = Boolean(rawQueues && incomingQueues && rawQueues.length !== incomingQueues.length);
|
|
200
|
+
const hasQueueUpdates = Boolean(rawQueues && incomingQueues && (!rawQueues.length || incomingQueues.length));
|
|
201
|
+
const joinUpdates = Array.isArray(payload.joinInfo)
|
|
202
|
+
? payload.joinInfo.flatMap((entry) => {
|
|
203
|
+
const id = readString(entry?.queueId);
|
|
204
|
+
const status = readString(entry?.status)?.toLowerCase().trim();
|
|
205
|
+
if (!id || !status || !['joined', 'unjoined', 'unassigned'].includes(status)) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
return [{ id, status }];
|
|
209
|
+
})
|
|
210
|
+
: undefined;
|
|
211
|
+
const hasJoinUpdates = joinUpdates !== undefined && (payload.joinInfo?.length === 0 || joinUpdates.length > 0);
|
|
212
|
+
const incompleteJoinUpdates = Boolean(Array.isArray(payload.joinInfo) && joinUpdates && payload.joinInfo.length !== joinUpdates.length);
|
|
213
|
+
if (!acdState && !hasQueueUpdates && !hasJoinUpdates) {
|
|
214
|
+
return current;
|
|
215
|
+
}
|
|
216
|
+
const base = current ?? { acdState: ACD_STATE.SIGN_OUT, queues: [] };
|
|
217
|
+
let queues = base.queues;
|
|
218
|
+
if (hasQueueUpdates && incomingQueues) {
|
|
219
|
+
if (kind === 'sync' &&
|
|
220
|
+
!incompleteQueues &&
|
|
221
|
+
(!incompleteJoinUpdates || rawQueues?.length === 0)) {
|
|
222
|
+
const previous = new Map(base.queues.map((queue) => [queueIdKey(queue.id), queue]));
|
|
223
|
+
queues = incomingQueues.map((queue) => {
|
|
224
|
+
const existing = previous.get(queueIdKey(queue.id));
|
|
225
|
+
return existing ? { ...existing, ...queue, id: existing.id } : queue;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
queues = mergeQueues(base.queues, incomingQueues);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (hasJoinUpdates && joinUpdates) {
|
|
233
|
+
const currentById = new Map(base.queues.map((queue) => [queueIdKey(queue.id), queue]));
|
|
234
|
+
queues.forEach((queue) => currentById.set(queueIdKey(queue.id), queue));
|
|
235
|
+
const joined = joinUpdates.flatMap(({ id, status }) => {
|
|
236
|
+
if (status === 'unassigned')
|
|
237
|
+
return [];
|
|
238
|
+
const previous = currentById.get(queueIdKey(id));
|
|
239
|
+
return [{ ...previous, id: previous?.id ?? id, available: status === 'joined' }];
|
|
240
|
+
});
|
|
241
|
+
if (kind === 'sync' && !incompleteJoinUpdates) {
|
|
242
|
+
queues = joined;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
const removed = new Set(joinUpdates.filter(({ status }) => status === 'unassigned').map(({ id }) => queueIdKey(id)));
|
|
246
|
+
queues = mergeQueues(queues.filter((queue) => !removed.has(queueIdKey(queue.id))), joined);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
acdState: acdState ?? base.acdState,
|
|
251
|
+
queues,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
@@ -14,7 +14,7 @@ export const DEFAULT_REHOMING_INTERVAL_MIN = 60;
|
|
|
14
14
|
export const DEFAULT_SESSION_TIMER = 1000 * 60 * 10;
|
|
15
15
|
export const MAX_CALL_KEEPALIVE_RETRY_COUNT = 4;
|
|
16
16
|
export const DEVICES_ENDPOINT_RESOURCE = 'devices';
|
|
17
|
-
export const DISCOVERY_URL = 'https://
|
|
17
|
+
export const DISCOVERY_URL = 'https://sqdiscovery.webex.com/region';
|
|
18
18
|
export const DUMMY_METRICS = {
|
|
19
19
|
'rtp-rxstat': {
|
|
20
20
|
Dur: 0,
|
|
@@ -757,7 +757,7 @@ export class Registration {
|
|
|
757
757
|
const error = {
|
|
758
758
|
headers: {
|
|
759
759
|
trackingid: err.headers?.trackingid,
|
|
760
|
-
'retry-after': err.headers['retry-after'],
|
|
760
|
+
'retry-after': err.headers['retry-after'] ?? err.headers['Retry-After'],
|
|
761
761
|
},
|
|
762
762
|
statusCode: err.statusCode,
|
|
763
763
|
statusText: err.statusText,
|
|
@@ -10,6 +10,7 @@ export var COMMON_EVENT_KEYS;
|
|
|
10
10
|
COMMON_EVENT_KEYS["CALL_RECORDING_CREATED"] = "callRecording:created";
|
|
11
11
|
COMMON_EVENT_KEYS["CALL_RECORDING_UPDATED"] = "callRecording:updated";
|
|
12
12
|
COMMON_EVENT_KEYS["CALL_RECORDING_DELETED"] = "callRecording:deleted";
|
|
13
|
+
COMMON_EVENT_KEYS["CALL_QUEUE_UPDATED"] = "callQueue:updated";
|
|
13
14
|
})(COMMON_EVENT_KEYS || (COMMON_EVENT_KEYS = {}));
|
|
14
15
|
export var LINE_EVENT_KEYS;
|
|
15
16
|
(function (LINE_EVENT_KEYS) {
|
|
@@ -102,10 +102,10 @@ export class Voicemail extends Eventing {
|
|
|
102
102
|
file: VOICEMAIL_FILE,
|
|
103
103
|
method: METHODS.GET_VOICEMAIL_CONTENT,
|
|
104
104
|
};
|
|
105
|
-
log.info(`${METHOD_START_MESSAGE} with: messageId
|
|
105
|
+
log.info(`${METHOD_START_MESSAGE} with: messageId=[REDACTED]`, loggerContext);
|
|
106
106
|
const response = await this.backendConnector.getVoicemailContent(messageId);
|
|
107
107
|
this.submitMetric(response, VOICEMAIL_ACTION.GET_VOICEMAIL_CONTENT, messageId);
|
|
108
|
-
log.log(`Successfully retrieved voicemail content for messageId
|
|
108
|
+
log.log(`Successfully retrieved voicemail content for messageId=[REDACTED], statusCode=${response.statusCode}`, loggerContext);
|
|
109
109
|
return response;
|
|
110
110
|
}
|
|
111
111
|
async getVoicemailSummary() {
|
|
@@ -126,10 +126,10 @@ export class Voicemail extends Eventing {
|
|
|
126
126
|
file: VOICEMAIL_FILE,
|
|
127
127
|
method: METHODS.VOICEMAIL_MARK_AS_READ,
|
|
128
128
|
};
|
|
129
|
-
log.info(`${METHOD_START_MESSAGE} with: messageId
|
|
129
|
+
log.info(`${METHOD_START_MESSAGE} with: messageId=[REDACTED]`, loggerContext);
|
|
130
130
|
const response = await this.backendConnector.voicemailMarkAsRead(messageId);
|
|
131
131
|
this.submitMetric(response, VOICEMAIL_ACTION.MARK_READ, messageId);
|
|
132
|
-
log.log(`Successfully marked voicemail as read: messageId
|
|
132
|
+
log.log(`Successfully marked voicemail as read: messageId=[REDACTED], statusCode=${response.statusCode}`, loggerContext);
|
|
133
133
|
return response;
|
|
134
134
|
}
|
|
135
135
|
async voicemailMarkAsUnread(messageId) {
|
|
@@ -137,10 +137,10 @@ export class Voicemail extends Eventing {
|
|
|
137
137
|
file: VOICEMAIL_FILE,
|
|
138
138
|
method: METHODS.VOICEMAIL_MARK_AS_UNREAD,
|
|
139
139
|
};
|
|
140
|
-
log.info(`${METHOD_START_MESSAGE} with: messageId
|
|
140
|
+
log.info(`${METHOD_START_MESSAGE} with: messageId=[REDACTED]`, loggerContext);
|
|
141
141
|
const response = await this.backendConnector.voicemailMarkAsUnread(messageId);
|
|
142
142
|
this.submitMetric(response, VOICEMAIL_ACTION.MARK_UNREAD, messageId);
|
|
143
|
-
log.log(`Successfully marked voicemail as unread: messageId
|
|
143
|
+
log.log(`Successfully marked voicemail as unread: messageId=[REDACTED], statusCode=${response.statusCode}`, loggerContext);
|
|
144
144
|
return response;
|
|
145
145
|
}
|
|
146
146
|
async deleteVoicemail(messageId) {
|
|
@@ -148,10 +148,10 @@ export class Voicemail extends Eventing {
|
|
|
148
148
|
file: VOICEMAIL_FILE,
|
|
149
149
|
method: METHODS.DELETE_VOICEMAIL,
|
|
150
150
|
};
|
|
151
|
-
log.info(`${METHOD_START_MESSAGE} with: messageId
|
|
151
|
+
log.info(`${METHOD_START_MESSAGE} with: messageId=[REDACTED]`, loggerContext);
|
|
152
152
|
const response = await this.backendConnector.deleteVoicemail(messageId);
|
|
153
153
|
this.submitMetric(response, VOICEMAIL_ACTION.DELETE, messageId);
|
|
154
|
-
log.log(`Successfully deleted voicemail: messageId
|
|
154
|
+
log.log(`Successfully deleted voicemail: messageId=[REDACTED], statusCode=${response.statusCode}`, loggerContext);
|
|
155
155
|
return response;
|
|
156
156
|
}
|
|
157
157
|
async getVMTranscript(messageId) {
|
|
@@ -159,11 +159,11 @@ export class Voicemail extends Eventing {
|
|
|
159
159
|
file: VOICEMAIL_FILE,
|
|
160
160
|
method: METHODS.GET_VM_TRANSCRIPT,
|
|
161
161
|
};
|
|
162
|
-
log.info(`${METHOD_START_MESSAGE} with: messageId
|
|
162
|
+
log.info(`${METHOD_START_MESSAGE} with: messageId=[REDACTED]`, loggerContext);
|
|
163
163
|
const response = await this.backendConnector.getVMTranscript(messageId);
|
|
164
164
|
if (response !== null) {
|
|
165
165
|
this.submitMetric(response, VOICEMAIL_ACTION.TRANSCRIPT, messageId);
|
|
166
|
-
log.log(`Successfully retrieved voicemail transcript: messageId
|
|
166
|
+
log.log(`Successfully retrieved voicemail transcript: messageId=[REDACTED], statusCode=${response.statusCode}`, loggerContext);
|
|
167
167
|
}
|
|
168
168
|
return response;
|
|
169
169
|
}
|
package/dist/module/api.js
CHANGED
|
@@ -4,5 +4,8 @@ import { CallingClient, createClient } from './CallingClient/CallingClient';
|
|
|
4
4
|
import { ContactsClient, createContactsClient } from './Contacts/ContactsClient';
|
|
5
5
|
import { Voicemail, createVoicemailClient } from './Voicemail/Voicemail';
|
|
6
6
|
import { CallRecording, createCallRecordingClient } from './CallRecording/CallRecording';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { CallQueueClient, createCallQueueClient } from './CallQueue/CallQueue';
|
|
8
|
+
import { ACD_STATE } from './CallQueue/constants';
|
|
9
|
+
export { CallHistory, CallSettings, CallingClient, ContactsClient, Voicemail, CallRecording, CallQueueClient, };
|
|
10
|
+
export { ACD_STATE };
|
|
11
|
+
export { createCallHistoryClient, createCallSettingsClient, createClient, createContactsClient, createVoicemailClient, createCallRecordingClient, createCallQueueClient, };
|
|
@@ -176,7 +176,7 @@ export async function handleRegistrationErrors(err, emitterCb, loggerContext, ha
|
|
|
176
176
|
updateLineErrorContext(loggerContext, ERROR_TYPE.TOO_MANY_REQUESTS, 'Server is handling too many request at the time. Wait a moment and try again', RegistrationStatus.INACTIVE, lineError);
|
|
177
177
|
const caller = loggerContext.method || 'handleErrors';
|
|
178
178
|
if (retry429Cb && err.headers) {
|
|
179
|
-
const retryAfter = Number(err.headers['retry-after']);
|
|
179
|
+
const retryAfter = Number(err.headers['retry-after'] ?? err.headers['Retry-After']);
|
|
180
180
|
await retry429Cb(retryAfter, caller);
|
|
181
181
|
}
|
|
182
182
|
shouldDisconnect = false;
|
|
@@ -320,8 +320,10 @@ export async function handleCallErrors(emitterCb, errorLayer, retryCb, correlati
|
|
|
320
320
|
emitterCb(callError);
|
|
321
321
|
return abort;
|
|
322
322
|
}
|
|
323
|
-
if (err.headers &&
|
|
324
|
-
|
|
323
|
+
if (err.headers &&
|
|
324
|
+
('retry-after' in err.headers || 'Retry-After' in err.headers) &&
|
|
325
|
+
retryCb) {
|
|
326
|
+
const retryInterval = Number(err.headers['retry-after'] ?? err.headers['Retry-After']);
|
|
325
327
|
log.warn(`Retry Interval received: ${retryInterval}`, loggerContext);
|
|
326
328
|
retryCb(retryInterval);
|
|
327
329
|
return abort;
|
|
@@ -397,8 +399,8 @@ export async function handleCallErrors(emitterCb, errorLayer, retryCb, correlati
|
|
|
397
399
|
updateCallErrorContext(loggerContext, ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred in the call. Wait a moment and try again.', correlationId, callError);
|
|
398
400
|
emitterCb(callError);
|
|
399
401
|
if (isKeepalive && retryCb) {
|
|
400
|
-
const retryInterval = err.headers && 'retry-after' in err.headers
|
|
401
|
-
? Number(err.headers['retry-after'])
|
|
402
|
+
const retryInterval = err.headers && ('retry-after' in err.headers || 'Retry-After' in err.headers)
|
|
403
|
+
? Number(err.headers['retry-after'] ?? err.headers['Retry-After'])
|
|
402
404
|
: DEFAULT_KEEPALIVE_INTERVAL;
|
|
403
405
|
retryCb(retryInterval);
|
|
404
406
|
}
|
package/dist/module/index.js
CHANGED
|
@@ -5,11 +5,14 @@ import { createClient } from './CallingClient/CallingClient';
|
|
|
5
5
|
import { createCallHistoryClient } from './CallHistory/CallHistory';
|
|
6
6
|
import { createVoicemailClient } from './Voicemail/Voicemail';
|
|
7
7
|
import { createCallRecordingClient } from './CallRecording/CallRecording';
|
|
8
|
+
import { createCallQueueClient } from './CallQueue/CallQueue';
|
|
8
9
|
import Logger from './Logger';
|
|
9
|
-
export { createClient, createCallHistoryClient, createCallSettingsClient, createContactsClient, createMicrophoneStream, createVoicemailClient, createCallRecordingClient, Logger, NoiseReductionEffect, };
|
|
10
|
+
export { createClient, createCallHistoryClient, createCallSettingsClient, createContactsClient, createMicrophoneStream, createVoicemailClient, createCallRecordingClient, createCallQueueClient, Logger, NoiseReductionEffect, };
|
|
10
11
|
export { ERROR_LAYER, ERROR_TYPE } from './Errors/types';
|
|
11
12
|
export { RecordingStatus, RecordingRequestType, } from './CallRecording/types';
|
|
12
13
|
export { getRemoteParty } from './CallRecording/utils';
|
|
14
|
+
export { CallQueueClient } from './CallQueue/CallQueue';
|
|
15
|
+
export { ACD_STATE } from './CallQueue/constants';
|
|
13
16
|
export { GroupType } from './Contacts/types';
|
|
14
17
|
export { LINE_EVENTS } from './CallingClient/line/types';
|
|
15
18
|
export { CALLING_CLIENT_EVENT_KEYS, CALL_EVENT_KEYS, Disposition, LINE_EVENT_KEYS, COMMON_EVENT_KEYS, MOBIUS_SOCKET_DISCONNECT_REASON, } from './Events/types';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { WebexSDK } from '../SDKConnector/types';
|
|
2
|
+
import { Eventing } from '../Events/impl';
|
|
3
|
+
import { CallQueueClientOptions, CallQueueEventTypes, CallQueueResponse, ICallQueue, LoggerInterface, UpdateCallQueueSettingsRequest } from './types';
|
|
4
|
+
export declare class CallQueueClient extends Eventing<CallQueueEventTypes> implements ICallQueue {
|
|
5
|
+
private webex;
|
|
6
|
+
private callingBackend;
|
|
7
|
+
private readonly webexApiEndpoint?;
|
|
8
|
+
private currentByLine;
|
|
9
|
+
private queueNames;
|
|
10
|
+
private eventGeneration;
|
|
11
|
+
private requestSequence;
|
|
12
|
+
private committedSequence;
|
|
13
|
+
private pendingEventRefresh;
|
|
14
|
+
private mercuryListeners;
|
|
15
|
+
private disposed;
|
|
16
|
+
private lifecycleEpoch;
|
|
17
|
+
constructor(webex: WebexSDK, logger: LoggerInterface, options: CallQueueClientOptions);
|
|
18
|
+
getCallQueueSettings(lineOwnerId?: string): Promise<CallQueueResponse>;
|
|
19
|
+
updateCallQueueSettings(request: UpdateCallQueueSettingsRequest, lineOwnerId?: string): Promise<CallQueueResponse>;
|
|
20
|
+
syncTelephonyCalls(): Promise<CallQueueResponse>;
|
|
21
|
+
private registerAgentListeners;
|
|
22
|
+
prepareForReuse(): boolean;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
private eventLine;
|
|
25
|
+
private handleAgentEvent;
|
|
26
|
+
private waitForEventRefreshes;
|
|
27
|
+
private refreshEventLine;
|
|
28
|
+
private refreshQueueNames;
|
|
29
|
+
private fillQueueNames;
|
|
30
|
+
private loadQueueCatalog;
|
|
31
|
+
private catalogNextUrl;
|
|
32
|
+
private wdmDeviceId;
|
|
33
|
+
private queuesUrl;
|
|
34
|
+
private joinUrl;
|
|
35
|
+
private rejectBeforeRequest;
|
|
36
|
+
private rejectUpdate;
|
|
37
|
+
private buildUpdateBody;
|
|
38
|
+
private canChangeJoin;
|
|
39
|
+
private needsQueuePolicyRefresh;
|
|
40
|
+
private applyLocalUpdate;
|
|
41
|
+
private fail;
|
|
42
|
+
}
|
|
43
|
+
export declare function createCallQueueClient(webex: WebexSDK, logger: LoggerInterface, options: CallQueueClientOptions, previousClient: CallQueueClient | undefined, enabled: boolean): CallQueueClient | undefined;
|
|
44
|
+
export declare function createCallQueueClient(webex: WebexSDK, logger: LoggerInterface, options: CallQueueClientOptions, previousClient?: CallQueueClient): CallQueueClient;
|
|
45
|
+
//# sourceMappingURL=C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,OAAO,CAAC,SAAS;IAoCjB,OAAO,CAAC,gBAAgB;YA6CV,qBAAqB;YAYrB,gBAAgB;YAkChB,iBAAiB;YAmBjB,cAAc;YAWd,gBAAgB;IAgD9B,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,mBAAmB;IAsC3B,OAAO,CAAC,YAAY;IA0DpB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,uBAAuB;IAmB/B,OAAO,CAAC,gBAAgB;YAyBV,IAAI;CAuBnB;AAsBD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,EAC/B,cAAc,EAAE,eAAe,GAAG,SAAS,EAC3C,OAAO,EAAE,OAAO,GACf,eAAe,GAAG,SAAS,CAAC;AAC/B,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,eAAe,GAC/B,eAAe,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare enum ACD_STATE {
|
|
2
|
+
SIGN_IN = "SIGN_IN",
|
|
3
|
+
SIGN_OUT = "SIGN_OUT",
|
|
4
|
+
AVAILABLE = "AVAILABLE",
|
|
5
|
+
UNAVAILABLE = "UNAVAILABLE",
|
|
6
|
+
WRAP_UP = "WRAP_UP"
|
|
7
|
+
}
|
|
8
|
+
export declare const ACD_STATE_VALUES: ReadonlyArray<{
|
|
9
|
+
state: ACD_STATE;
|
|
10
|
+
values: readonly string[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare enum CALL_QUEUE_MERCURY_EVENT_KEYS {
|
|
13
|
+
TELEPHONY_AGENT_SYNC = "event:telephony_agents.sync",
|
|
14
|
+
TELEPHONY_AGENT_STATE = "event:telephony_agents.state",
|
|
15
|
+
TELEPHONY_AGENT_JOIN = "event:telephony_agents.join",
|
|
16
|
+
TELEPHONY_AGENT_SYNC_SINGULAR = "event:telephony_agent.sync",
|
|
17
|
+
TELEPHONY_AGENT_STATE_SINGULAR = "event:telephony_agent.state",
|
|
18
|
+
TELEPHONY_AGENT_JOIN_SINGULAR = "event:telephony_agent.join"
|
|
19
|
+
}
|
|
20
|
+
export declare const SUPPORTED_STATES: Set<string>;
|
|
21
|
+
export declare const UUID_PATTERN: RegExp;
|
|
22
|
+
export declare const CALL_QUEUE_FILE = "CallQueue";
|
|
23
|
+
export declare const METHODS: {
|
|
24
|
+
GET_CALL_QUEUE_SETTINGS: string;
|
|
25
|
+
GET_CALL_QUEUE_NAMES: string;
|
|
26
|
+
UPDATE_CALL_QUEUE_SETTINGS: string;
|
|
27
|
+
SYNC_TELEPHONY_CALLS: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const QUEUES_PATH = "telephony/config/people/me/settings/queues";
|
|
30
|
+
export declare const QUEUES_CATALOG_PATH = "telephony/config/queues";
|
|
31
|
+
export declare const SYNC_PATH = "telephony/calls/sync/invoke";
|
|
32
|
+
export declare const MAX_QUEUE_CATALOG_PAGES = 10;
|
|
33
|
+
export declare const SECONDARY_LINES_PATH = "telephony/config/people/me/settings/secondaryLines";
|
|
34
|
+
export declare const LINE_OWNER_ID_PATTERN: RegExp;
|
|
35
|
+
export declare const WDM_DEVICE_ID_PATTERN: RegExp;
|
|
36
|
+
export declare const UNSUPPORTED_BACKEND_MESSAGE = "Call queues are supported for Webex Calling cloud only";
|
|
37
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/CallQueue/constants.ts"],"names":[],"mappings":"AACA,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;CACpB;AAGD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAC,CAMzF,CAAC;AAGF,oBAAY,6BAA6B;IACvC,oBAAoB,gCAAgC;IACpD,qBAAqB,iCAAiC;IACtD,oBAAoB,gCAAgC;IACpD,6BAA6B,+BAA+B;IAC5D,8BAA8B,gCAAgC;IAC9D,6BAA6B,+BAA+B;CAC7D;AAED,eAAO,MAAM,gBAAgB,aAA4C,CAAC;AAE1E,eAAO,MAAM,YAAY,QAAoE,CAAC;AAE9F,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAA+C,CAAC;AACxE,eAAO,MAAM,mBAAmB,4BAA4B,CAAC;AAC7D,eAAO,MAAM,SAAS,gCAAgC,CAAC;AACvD,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,oBAAoB,uDAAuD,CAAC;AAEzF,eAAO,MAAM,qBAAqB,QAA2B,CAAC;AAE9D,eAAO,MAAM,qBAAqB,QAA0B,CAAC;AAE7D,eAAO,MAAM,2BAA2B,2DAA2D,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { LOGGER } from '../Logger/types';
|
|
2
|
+
import { COMMON_EVENT_KEYS } from '../Events/types';
|
|
3
|
+
import { ACD_STATE } from './constants';
|
|
4
|
+
export interface LoggerInterface {
|
|
5
|
+
level: LOGGER;
|
|
6
|
+
}
|
|
7
|
+
export type CallQueueClientOptions = {
|
|
8
|
+
webexApiBaseUrl: string;
|
|
9
|
+
};
|
|
10
|
+
export type CallQueue = {
|
|
11
|
+
id: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
phoneNumber?: string;
|
|
14
|
+
extension?: string;
|
|
15
|
+
available?: boolean;
|
|
16
|
+
skillLevel?: number;
|
|
17
|
+
allowLogOffEnabled?: boolean;
|
|
18
|
+
hasCxEssentials?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type CallQueueAgentStatus = {
|
|
21
|
+
acdState: ACD_STATE;
|
|
22
|
+
queues: CallQueue[];
|
|
23
|
+
};
|
|
24
|
+
export type CallQueueCatalogPage = {
|
|
25
|
+
entries: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
}>;
|
|
29
|
+
next?: string;
|
|
30
|
+
};
|
|
31
|
+
export type CallQueueJoinUpdate = {
|
|
32
|
+
id: string;
|
|
33
|
+
available: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type UpdateCallQueueSettingsRequest = {
|
|
36
|
+
agentACDState?: ACD_STATE;
|
|
37
|
+
queues?: CallQueueJoinUpdate[];
|
|
38
|
+
};
|
|
39
|
+
export type CallQueueResponse = {
|
|
40
|
+
statusCode: number;
|
|
41
|
+
data: {
|
|
42
|
+
callQueue?: CallQueueAgentStatus;
|
|
43
|
+
error?: string;
|
|
44
|
+
};
|
|
45
|
+
message: string | null;
|
|
46
|
+
};
|
|
47
|
+
export type CallQueueEventTypes = {
|
|
48
|
+
[COMMON_EVENT_KEYS.CALL_QUEUE_UPDATED]: (status: CallQueueAgentStatus & {
|
|
49
|
+
lineOwnerId?: string;
|
|
50
|
+
}) => void;
|
|
51
|
+
};
|
|
52
|
+
export interface ICallQueue {
|
|
53
|
+
on<Event extends keyof CallQueueEventTypes>(event: Event, listener: CallQueueEventTypes[Event]): this;
|
|
54
|
+
off<Event extends keyof CallQueueEventTypes>(event: Event, listener: CallQueueEventTypes[Event]): this;
|
|
55
|
+
getCallQueueSettings(lineOwnerId?: string): Promise<CallQueueResponse>;
|
|
56
|
+
updateCallQueueSettings(request: UpdateCallQueueSettingsRequest, lineOwnerId?: string): Promise<CallQueueResponse>;
|
|
57
|
+
syncTelephonyCalls(): Promise<CallQueueResponse>;
|
|
58
|
+
prepareForReuse?(): boolean;
|
|
59
|
+
dispose(): void;
|
|
60
|
+
}
|
|
61
|
+
export type CallQueueEventKind = 'sync' | 'state' | 'join';
|
|
62
|
+
export type EventLine = {
|
|
63
|
+
kind: 'primary';
|
|
64
|
+
} | {
|
|
65
|
+
kind: 'secondary';
|
|
66
|
+
lineOwnerId: string;
|
|
67
|
+
} | {
|
|
68
|
+
kind: 'ignore';
|
|
69
|
+
};
|
|
70
|
+
export type TelephonyAgentQueue = {
|
|
71
|
+
id?: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
phoneNumber?: string;
|
|
74
|
+
extension?: string;
|
|
75
|
+
available?: boolean;
|
|
76
|
+
skillLevel?: number;
|
|
77
|
+
allowLogOffEnabled?: boolean;
|
|
78
|
+
hasCxEssentials?: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type TelephonyAgentPayload = {
|
|
81
|
+
eventType?: string;
|
|
82
|
+
actorId?: string;
|
|
83
|
+
actorPersonId?: string;
|
|
84
|
+
actorType?: string;
|
|
85
|
+
state?: string;
|
|
86
|
+
agentACDState?: string;
|
|
87
|
+
acdStateInfo?: {
|
|
88
|
+
state?: string;
|
|
89
|
+
};
|
|
90
|
+
queues?: TelephonyAgentQueue[];
|
|
91
|
+
joinInfo?: Array<{
|
|
92
|
+
queueId?: string;
|
|
93
|
+
status?: string;
|
|
94
|
+
skillLevel?: string | number;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/CallQueue/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAGD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