@webex/contact-center 3.9.0-next.9 → 3.10.0
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/dist/cc.js +182 -47
- package/dist/cc.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/logger-proxy.js +24 -1
- package/dist/logger-proxy.js.map +1 -1
- package/dist/metrics/behavioral-events.js +89 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +30 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AddressBook.js +271 -0
- package/dist/services/AddressBook.js.map +1 -0
- package/dist/services/EntryPoint.js +227 -0
- package/dist/services/EntryPoint.js.map +1 -0
- package/dist/services/Queue.js +261 -0
- package/dist/services/Queue.js.map +1 -0
- package/dist/services/config/constants.js +36 -2
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +29 -21
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +33 -1
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Utils.js +42 -1
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/task/TaskManager.js +113 -3
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/TaskUtils.js +76 -0
- package/dist/services/task/TaskUtils.js.map +1 -0
- package/dist/services/task/constants.js +26 -1
- package/dist/services/task/constants.js.map +1 -1
- package/dist/services/task/contact.js +86 -0
- package/dist/services/task/contact.js.map +1 -1
- package/dist/services/task/index.js +241 -5
- package/dist/services/task/index.js.map +1 -1
- package/dist/services/task/types.js +14 -0
- package/dist/services/task/types.js.map +1 -1
- package/dist/types/cc.d.ts +115 -35
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/metrics/constants.d.ts +24 -1
- package/dist/types/services/AddressBook.d.ts +74 -0
- package/dist/types/services/EntryPoint.d.ts +67 -0
- package/dist/types/services/Queue.d.ts +76 -0
- package/dist/types/services/config/constants.d.ts +35 -1
- package/dist/types/services/config/index.d.ts +6 -9
- package/dist/types/services/config/types.d.ts +79 -58
- package/dist/types/services/core/Utils.d.ts +14 -1
- package/dist/types/services/task/TaskUtils.d.ts +28 -0
- package/dist/types/services/task/constants.d.ts +23 -0
- package/dist/types/services/task/contact.d.ts +10 -0
- package/dist/types/services/task/index.d.ts +64 -1
- package/dist/types/services/task/types.d.ts +221 -19
- package/dist/types/types.d.ts +162 -0
- package/dist/types/utils/PageCache.d.ts +173 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/PageCache.js +192 -0
- package/dist/utils/PageCache.js.map +1 -0
- package/dist/webex.js +1 -1
- package/package.json +10 -9
- package/src/cc.ts +206 -52
- package/src/constants.ts +1 -0
- package/src/index.ts +16 -2
- package/src/logger-proxy.ts +24 -1
- package/src/metrics/behavioral-events.ts +94 -0
- package/src/metrics/constants.ts +34 -1
- package/src/services/AddressBook.ts +291 -0
- package/src/services/EntryPoint.ts +241 -0
- package/src/services/Queue.ts +277 -0
- package/src/services/config/constants.ts +42 -2
- package/src/services/config/index.ts +30 -30
- package/src/services/config/types.ts +59 -58
- package/src/services/core/Utils.ts +44 -0
- package/src/services/task/TaskManager.ts +122 -5
- package/src/services/task/TaskUtils.ts +81 -0
- package/src/services/task/constants.ts +25 -0
- package/src/services/task/contact.ts +80 -0
- package/src/services/task/index.ts +300 -4
- package/src/services/task/types.ts +239 -18
- package/src/types.ts +180 -0
- package/src/utils/PageCache.ts +252 -0
- package/test/unit/spec/cc.ts +282 -85
- package/test/unit/spec/metrics/behavioral-events.ts +42 -0
- package/test/unit/spec/services/AddressBook.ts +332 -0
- package/test/unit/spec/services/EntryPoint.ts +259 -0
- package/test/unit/spec/services/Queue.ts +323 -0
- package/test/unit/spec/services/config/index.ts +279 -65
- package/test/unit/spec/services/task/TaskManager.ts +382 -0
- package/test/unit/spec/services/task/TaskUtils.ts +131 -0
- package/test/unit/spec/services/task/contact.ts +31 -1
- package/test/unit/spec/services/task/index.ts +242 -8
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -334,7 +334,117 @@ export declare enum TASK_EVENTS {
|
|
|
334
334
|
* });
|
|
335
335
|
* ```
|
|
336
336
|
*/
|
|
337
|
-
TASK_OFFER_CONTACT = "task:offerContact"
|
|
337
|
+
TASK_OFFER_CONTACT = "task:offerContact",
|
|
338
|
+
/**
|
|
339
|
+
* Triggered when a conference is being established
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_ESTABLISHING, (task: ITask) => {
|
|
343
|
+
* console.log('Conference establishing:', task.data.interactionId);
|
|
344
|
+
* // Handle conference setup in progress
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
TASK_CONFERENCE_ESTABLISHING = "task:conferenceEstablishing",
|
|
349
|
+
/**
|
|
350
|
+
* Triggered when a conference is started successfully
|
|
351
|
+
* @example
|
|
352
|
+
* ```typescript
|
|
353
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_STARTED, (task: ITask) => {
|
|
354
|
+
* console.log('Conference started:', task.data.interactionId);
|
|
355
|
+
* // Handle conference start
|
|
356
|
+
* });
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
TASK_CONFERENCE_STARTED = "task:conferenceStarted",
|
|
360
|
+
/**
|
|
361
|
+
* Triggered when a conference fails to start
|
|
362
|
+
* @example
|
|
363
|
+
* ```typescript
|
|
364
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_FAILED, (task: ITask) => {
|
|
365
|
+
* console.log('Conference failed:', task.data.interactionId);
|
|
366
|
+
* // Handle conference failure
|
|
367
|
+
* });
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
TASK_CONFERENCE_FAILED = "task:conferenceFailed",
|
|
371
|
+
/**
|
|
372
|
+
* Triggered when a conference is ended successfully
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_ENDED, (task: ITask) => {
|
|
376
|
+
* console.log('Conference ended:', task.data.interactionId);
|
|
377
|
+
* // Handle conference end
|
|
378
|
+
* });
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
TASK_CONFERENCE_ENDED = "task:conferenceEnded",
|
|
382
|
+
/**
|
|
383
|
+
* Triggered when a participant joins the conference
|
|
384
|
+
* @example
|
|
385
|
+
* ```typescript
|
|
386
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_JOINED, (task: ITask) => {
|
|
387
|
+
* console.log('Participant joined conference:', task.data.interactionId);
|
|
388
|
+
* // Handle participant joining
|
|
389
|
+
* });
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
TASK_PARTICIPANT_JOINED = "task:participantJoined",
|
|
393
|
+
/**
|
|
394
|
+
* Triggered when a participant leaves the conference
|
|
395
|
+
* @example
|
|
396
|
+
* ```typescript
|
|
397
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT, (task: ITask) => {
|
|
398
|
+
* console.log('Participant left conference:', task.data.interactionId);
|
|
399
|
+
* // Handle participant leaving
|
|
400
|
+
* });
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
TASK_PARTICIPANT_LEFT = "task:participantLeft",
|
|
404
|
+
/**
|
|
405
|
+
* Triggered when conference transfer is successful
|
|
406
|
+
* @example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFERRED, (task: ITask) => {
|
|
409
|
+
* console.log('Conference transferred:', task.data.interactionId);
|
|
410
|
+
* // Handle successful conference transfer
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
TASK_CONFERENCE_TRANSFERRED = "task:conferenceTransferred",
|
|
415
|
+
/**
|
|
416
|
+
* Triggered when conference transfer fails
|
|
417
|
+
* @example
|
|
418
|
+
* ```typescript
|
|
419
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_TRANSFER_FAILED, (task: ITask) => {
|
|
420
|
+
* console.log('Conference transfer failed:', task.data.interactionId);
|
|
421
|
+
* // Handle failed conference transfer
|
|
422
|
+
* });
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
TASK_CONFERENCE_TRANSFER_FAILED = "task:conferenceTransferFailed",
|
|
426
|
+
/**
|
|
427
|
+
* Triggered when ending a conference fails
|
|
428
|
+
* @example
|
|
429
|
+
* ```typescript
|
|
430
|
+
* task.on(TASK_EVENTS.TASK_CONFERENCE_END_FAILED, (task: ITask) => {
|
|
431
|
+
* console.log('Conference end failed:', task.data.interactionId);
|
|
432
|
+
* // Handle failed conference end
|
|
433
|
+
* });
|
|
434
|
+
* ```
|
|
435
|
+
*/
|
|
436
|
+
TASK_CONFERENCE_END_FAILED = "task:conferenceEndFailed",
|
|
437
|
+
/**
|
|
438
|
+
* Triggered when participant exit from conference fails
|
|
439
|
+
* @example
|
|
440
|
+
* ```typescript
|
|
441
|
+
* task.on(TASK_EVENTS.TASK_PARTICIPANT_LEFT_FAILED, (task: ITask) => {
|
|
442
|
+
* console.log('Participant failed to leave conference:', task.data.interactionId);
|
|
443
|
+
* // Handle failed participant exit
|
|
444
|
+
* });
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
TASK_PARTICIPANT_LEFT_FAILED = "task:participantLeftFailed"
|
|
338
448
|
}
|
|
339
449
|
/**
|
|
340
450
|
* Represents a customer interaction within the contact center system
|
|
@@ -572,6 +682,8 @@ export type TaskData = {
|
|
|
572
682
|
isConsulted?: boolean;
|
|
573
683
|
/** Indicates if the task is in conference state */
|
|
574
684
|
isConferencing: boolean;
|
|
685
|
+
/** Indicates if a conference is currently in progress (2+ active agents) */
|
|
686
|
+
isConferenceInProgress?: boolean;
|
|
575
687
|
/** Identifier of agent who last updated the task */
|
|
576
688
|
updatedBy?: string;
|
|
577
689
|
/** Type of destination for transfer/consult */
|
|
@@ -828,6 +940,18 @@ export type ConsultConferenceData = {
|
|
|
828
940
|
/** Type of destination (e.g., 'agent', 'queue') */
|
|
829
941
|
destinationType: string;
|
|
830
942
|
};
|
|
943
|
+
/**
|
|
944
|
+
* Legacy consultation conference data type matching Agent Desktop
|
|
945
|
+
* @public
|
|
946
|
+
*/
|
|
947
|
+
export type consultConferencePayloadData = {
|
|
948
|
+
/** Identifier of the agent initiating consult/conference */
|
|
949
|
+
agentId: string;
|
|
950
|
+
/** Type of destination (e.g., 'agent', 'queue') */
|
|
951
|
+
destinationType: string;
|
|
952
|
+
/** Identifier of the destination agent */
|
|
953
|
+
destAgentId: string;
|
|
954
|
+
};
|
|
831
955
|
/**
|
|
832
956
|
* Parameters required for cancelling a consult to queue operation
|
|
833
957
|
* @public
|
|
@@ -875,6 +999,8 @@ export type DialerPayload = {
|
|
|
875
999
|
mediaType: 'telephony' | 'chat' | 'social' | 'email';
|
|
876
1000
|
/** The outbound type for the task */
|
|
877
1001
|
outboundType: 'OUTDIAL' | 'CALLBACK' | 'EXECUTE_FLOW';
|
|
1002
|
+
/** The Outdial ANI number that will be used while making a call to the customer. */
|
|
1003
|
+
origin: string;
|
|
878
1004
|
};
|
|
879
1005
|
/**
|
|
880
1006
|
* Data structure for cleaning up contact resources
|
|
@@ -938,15 +1064,15 @@ export interface ITask extends EventEmitter {
|
|
|
938
1064
|
*/
|
|
939
1065
|
autoWrapup?: AutoWrapup;
|
|
940
1066
|
/**
|
|
941
|
-
*
|
|
942
|
-
* This method stops the auto-wrapup process if it is currently active
|
|
1067
|
+
* Cancels the auto-wrapup timer for the task.
|
|
1068
|
+
* This method stops the auto-wrapup process if it is currently active.
|
|
943
1069
|
* Note: This is supported only in single session mode. Not supported in multi-session mode.
|
|
944
1070
|
* @returns void
|
|
945
1071
|
*/
|
|
946
1072
|
cancelAutoWrapupTimer(): void;
|
|
947
1073
|
/**
|
|
948
|
-
* Deregisters all web call event listeners
|
|
949
|
-
* Used when cleaning up task resources
|
|
1074
|
+
* Deregisters all web call event listeners.
|
|
1075
|
+
* Used when cleaning up task resources.
|
|
950
1076
|
* @ignore
|
|
951
1077
|
*/
|
|
952
1078
|
unregisterWebCallListeners(): void;
|
|
@@ -964,7 +1090,7 @@ export interface ITask extends EventEmitter {
|
|
|
964
1090
|
* @returns Promise<TaskResponse>
|
|
965
1091
|
* @example
|
|
966
1092
|
* ```typescript
|
|
967
|
-
* task.accept();
|
|
1093
|
+
* await task.accept();
|
|
968
1094
|
* ```
|
|
969
1095
|
*/
|
|
970
1096
|
accept(): Promise<TaskResponse>;
|
|
@@ -973,44 +1099,44 @@ export interface ITask extends EventEmitter {
|
|
|
973
1099
|
* @returns Promise<TaskResponse>
|
|
974
1100
|
* @example
|
|
975
1101
|
* ```typescript
|
|
976
|
-
* task.decline();
|
|
1102
|
+
* await task.decline();
|
|
977
1103
|
* ```
|
|
978
1104
|
*/
|
|
979
1105
|
decline(): Promise<TaskResponse>;
|
|
980
1106
|
/**
|
|
981
|
-
* Places the current task on hold
|
|
1107
|
+
* Places the current task on hold.
|
|
982
1108
|
* @returns Promise<TaskResponse>
|
|
983
1109
|
* @example
|
|
984
1110
|
* ```typescript
|
|
985
|
-
* task.hold();
|
|
1111
|
+
* await task.hold();
|
|
986
1112
|
* ```
|
|
987
1113
|
*/
|
|
988
1114
|
hold(): Promise<TaskResponse>;
|
|
989
1115
|
/**
|
|
990
|
-
* Resumes a task that was previously on hold
|
|
1116
|
+
* Resumes a task that was previously on hold.
|
|
991
1117
|
* @returns Promise<TaskResponse>
|
|
992
1118
|
* @example
|
|
993
1119
|
* ```typescript
|
|
994
|
-
* task.resume();
|
|
1120
|
+
* await task.resume();
|
|
995
1121
|
* ```
|
|
996
1122
|
*/
|
|
997
1123
|
resume(): Promise<TaskResponse>;
|
|
998
1124
|
/**
|
|
999
|
-
* Ends/terminates the current task
|
|
1125
|
+
* Ends/terminates the current task.
|
|
1000
1126
|
* @returns Promise<TaskResponse>
|
|
1001
1127
|
* @example
|
|
1002
1128
|
* ```typescript
|
|
1003
|
-
* task.end();
|
|
1129
|
+
* await task.end();
|
|
1004
1130
|
* ```
|
|
1005
1131
|
*/
|
|
1006
1132
|
end(): Promise<TaskResponse>;
|
|
1007
1133
|
/**
|
|
1008
|
-
* Initiates wrap-up process for the task with specified details
|
|
1134
|
+
* Initiates wrap-up process for the task with specified details.
|
|
1009
1135
|
* @param wrapupPayload - Wrap-up details including reason and auxiliary code
|
|
1010
1136
|
* @returns Promise<TaskResponse>
|
|
1011
1137
|
* @example
|
|
1012
1138
|
* ```typescript
|
|
1013
|
-
* task.wrapup({
|
|
1139
|
+
* await task.wrapup({
|
|
1014
1140
|
* wrapUpReason: "Customer issue resolved",
|
|
1015
1141
|
* auxCodeId: "RESOLVED"
|
|
1016
1142
|
* });
|
|
@@ -1018,24 +1144,100 @@ export interface ITask extends EventEmitter {
|
|
|
1018
1144
|
*/
|
|
1019
1145
|
wrapup(wrapupPayload: WrapupPayLoad): Promise<TaskResponse>;
|
|
1020
1146
|
/**
|
|
1021
|
-
* Pauses the recording for current task
|
|
1147
|
+
* Pauses the recording for current task.
|
|
1022
1148
|
* @returns Promise<TaskResponse>
|
|
1023
1149
|
* @example
|
|
1024
1150
|
* ```typescript
|
|
1025
|
-
* task.pauseRecording();
|
|
1151
|
+
* await task.pauseRecording();
|
|
1026
1152
|
* ```
|
|
1027
1153
|
*/
|
|
1028
1154
|
pauseRecording(): Promise<TaskResponse>;
|
|
1029
1155
|
/**
|
|
1030
|
-
* Resumes a previously paused recording
|
|
1156
|
+
* Resumes a previously paused recording.
|
|
1031
1157
|
* @param resumeRecordingPayload - Parameters for resuming the recording
|
|
1032
1158
|
* @returns Promise<TaskResponse>
|
|
1033
1159
|
* @example
|
|
1034
1160
|
* ```typescript
|
|
1035
|
-
* task.resumeRecording({
|
|
1161
|
+
* await task.resumeRecording({
|
|
1036
1162
|
* autoResumed: false
|
|
1037
1163
|
* });
|
|
1038
1164
|
* ```
|
|
1039
1165
|
*/
|
|
1040
1166
|
resumeRecording(resumeRecordingPayload: ResumeRecordingPayload): Promise<TaskResponse>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Initiates a consultation with another agent or queue.
|
|
1169
|
+
* @param consultPayload - Consultation details including destination and type
|
|
1170
|
+
* @returns Promise<TaskResponse>
|
|
1171
|
+
* @example
|
|
1172
|
+
* ```typescript
|
|
1173
|
+
* await task.consult({ to: "agentId", destinationType: "agent" });
|
|
1174
|
+
* ```
|
|
1175
|
+
*/
|
|
1176
|
+
consult(consultPayload: ConsultPayload): Promise<TaskResponse>;
|
|
1177
|
+
/**
|
|
1178
|
+
* Ends an ongoing consultation.
|
|
1179
|
+
* @param consultEndPayload - Details for ending the consultation
|
|
1180
|
+
* @returns Promise<TaskResponse>
|
|
1181
|
+
* @example
|
|
1182
|
+
* ```typescript
|
|
1183
|
+
* await task.endConsult({ isConsult: true, taskId: "taskId" });
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
endConsult(consultEndPayload: ConsultEndPayload): Promise<TaskResponse>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Transfers the task to another agent or queue.
|
|
1189
|
+
* @param transferPayload - Transfer details including destination and type
|
|
1190
|
+
* @returns Promise<TaskResponse>
|
|
1191
|
+
* @example
|
|
1192
|
+
* ```typescript
|
|
1193
|
+
* await task.transfer({ to: "queueId", destinationType: "queue" });
|
|
1194
|
+
* ```
|
|
1195
|
+
*/
|
|
1196
|
+
transfer(transferPayload: TransferPayLoad): Promise<TaskResponse>;
|
|
1197
|
+
/**
|
|
1198
|
+
* Transfers the task after consultation.
|
|
1199
|
+
* @param consultTransferPayload - Details for consult transfer (optional)
|
|
1200
|
+
* @returns Promise<TaskResponse>
|
|
1201
|
+
* @example
|
|
1202
|
+
* ```typescript
|
|
1203
|
+
* await task.consultTransfer({ to: "agentId", destinationType: "agent" });
|
|
1204
|
+
* ```
|
|
1205
|
+
*/
|
|
1206
|
+
consultTransfer(consultTransferPayload?: ConsultTransferPayLoad): Promise<TaskResponse>;
|
|
1207
|
+
/**
|
|
1208
|
+
* Initiates a consult conference (merge consult call with main call).
|
|
1209
|
+
* @returns Promise<TaskResponse>
|
|
1210
|
+
* @example
|
|
1211
|
+
* ```typescript
|
|
1212
|
+
* await task.consultConference();
|
|
1213
|
+
* ```
|
|
1214
|
+
*/
|
|
1215
|
+
consultConference(): Promise<TaskResponse>;
|
|
1216
|
+
/**
|
|
1217
|
+
* Exits from an ongoing conference.
|
|
1218
|
+
* @returns Promise<TaskResponse>
|
|
1219
|
+
* @example
|
|
1220
|
+
* ```typescript
|
|
1221
|
+
* await task.exitConference();
|
|
1222
|
+
* ```
|
|
1223
|
+
*/
|
|
1224
|
+
exitConference(): Promise<TaskResponse>;
|
|
1225
|
+
/**
|
|
1226
|
+
* Transfers the conference to another participant.
|
|
1227
|
+
* @returns Promise<TaskResponse>
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```typescript
|
|
1230
|
+
* await task.transferConference();
|
|
1231
|
+
* ```
|
|
1232
|
+
*/
|
|
1233
|
+
transferConference(): Promise<TaskResponse>;
|
|
1234
|
+
/**
|
|
1235
|
+
* Toggles mute/unmute for the local audio stream during a WebRTC task.
|
|
1236
|
+
* @returns Promise<void>
|
|
1237
|
+
* @example
|
|
1238
|
+
* ```typescript
|
|
1239
|
+
* await task.toggleMute();
|
|
1240
|
+
* ```
|
|
1241
|
+
*/
|
|
1242
|
+
toggleMute(): Promise<void>;
|
|
1041
1243
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CallingClientConfig } from '@webex/calling';
|
|
2
2
|
import * as Agent from './services/agent/types';
|
|
3
3
|
import { Profile } from './services/config/types';
|
|
4
|
+
import { PaginatedResponse, BaseSearchParams } from './utils/PageCache';
|
|
4
5
|
/**
|
|
5
6
|
* HTTP methods supported by WebexRequest.
|
|
6
7
|
* @enum {string}
|
|
@@ -140,6 +141,10 @@ export interface LogContext {
|
|
|
140
141
|
method?: string;
|
|
141
142
|
interactionId?: string;
|
|
142
143
|
trackingId?: string;
|
|
144
|
+
/** Additional structured data to include in logs */
|
|
145
|
+
data?: Record<string, any>;
|
|
146
|
+
/** Error object to include in logs */
|
|
147
|
+
error?: Error | unknown;
|
|
143
148
|
}
|
|
144
149
|
/**
|
|
145
150
|
* Available logging severity levels.
|
|
@@ -434,6 +439,163 @@ export type StationReLoginResponse = Agent.ReloginSuccess | Error;
|
|
|
434
439
|
* @ignore
|
|
435
440
|
*/
|
|
436
441
|
export type SetStateResponse = Agent.StateChangeSuccess | Error;
|
|
442
|
+
/**
|
|
443
|
+
* AddressBook types
|
|
444
|
+
*/
|
|
445
|
+
export interface AddressBookEntry {
|
|
446
|
+
id: string;
|
|
447
|
+
organizationId?: string;
|
|
448
|
+
version?: number;
|
|
449
|
+
name: string;
|
|
450
|
+
number: string;
|
|
451
|
+
createdTime?: number;
|
|
452
|
+
lastUpdatedTime?: number;
|
|
453
|
+
}
|
|
454
|
+
export type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;
|
|
455
|
+
export interface AddressBookEntrySearchParams extends BaseSearchParams {
|
|
456
|
+
addressBookId?: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* EntryPointRecord types
|
|
460
|
+
*/
|
|
461
|
+
export interface EntryPointRecord {
|
|
462
|
+
id: string;
|
|
463
|
+
name: string;
|
|
464
|
+
description?: string;
|
|
465
|
+
type: string;
|
|
466
|
+
isActive: boolean;
|
|
467
|
+
orgId: string;
|
|
468
|
+
createdAt?: string;
|
|
469
|
+
updatedAt?: string;
|
|
470
|
+
settings?: Record<string, any>;
|
|
471
|
+
}
|
|
472
|
+
export type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;
|
|
473
|
+
export type EntryPointSearchParams = BaseSearchParams;
|
|
474
|
+
/**
|
|
475
|
+
* Queue types
|
|
476
|
+
*/
|
|
477
|
+
export interface QueueSkillRequirement {
|
|
478
|
+
organizationId?: string;
|
|
479
|
+
id?: string;
|
|
480
|
+
version?: number;
|
|
481
|
+
skillId: string;
|
|
482
|
+
skillName?: string;
|
|
483
|
+
skillType?: string;
|
|
484
|
+
condition: string;
|
|
485
|
+
skillValue: string;
|
|
486
|
+
createdTime?: number;
|
|
487
|
+
lastUpdatedTime?: number;
|
|
488
|
+
}
|
|
489
|
+
export interface QueueAgent {
|
|
490
|
+
id: string;
|
|
491
|
+
ciUserId?: string;
|
|
492
|
+
}
|
|
493
|
+
export interface AgentGroup {
|
|
494
|
+
teamId: string;
|
|
495
|
+
}
|
|
496
|
+
export interface CallDistributionGroup {
|
|
497
|
+
agentGroups: AgentGroup[];
|
|
498
|
+
order: number;
|
|
499
|
+
duration?: number;
|
|
500
|
+
}
|
|
501
|
+
export interface AssistantSkillMapping {
|
|
502
|
+
assistantSkillId?: string;
|
|
503
|
+
assistantSkillUpdatedTime?: number;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Configuration for a contact service queue
|
|
507
|
+
* @public
|
|
508
|
+
*/
|
|
509
|
+
export interface ContactServiceQueue {
|
|
510
|
+
/** Organization ID */
|
|
511
|
+
organizationId?: string;
|
|
512
|
+
/** Unique identifier for the queue */
|
|
513
|
+
id?: string;
|
|
514
|
+
/** Version of the queue */
|
|
515
|
+
version?: number;
|
|
516
|
+
/** Name of the Contact Service Queue */
|
|
517
|
+
name: string;
|
|
518
|
+
/** Description of the queue */
|
|
519
|
+
description?: string;
|
|
520
|
+
/** Queue type (INBOUND, OUTBOUND) */
|
|
521
|
+
queueType: 'INBOUND' | 'OUTBOUND';
|
|
522
|
+
/** Whether to check agent availability */
|
|
523
|
+
checkAgentAvailability: boolean;
|
|
524
|
+
/** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */
|
|
525
|
+
channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';
|
|
526
|
+
/** Social channel type for SOCIAL_CHANNEL channelType */
|
|
527
|
+
socialChannelType?: 'MESSAGEBIRD' | 'MESSENGER' | 'WHATSAPP' | 'APPLE_BUSINESS_CHAT' | 'GOOGLE_BUSINESS_MESSAGES';
|
|
528
|
+
/** Service level threshold in seconds */
|
|
529
|
+
serviceLevelThreshold: number;
|
|
530
|
+
/** Maximum number of simultaneous contacts */
|
|
531
|
+
maxActiveContacts: number;
|
|
532
|
+
/** Maximum time in queue in seconds */
|
|
533
|
+
maxTimeInQueue: number;
|
|
534
|
+
/** Default music in queue media file ID */
|
|
535
|
+
defaultMusicInQueueMediaFileId: string;
|
|
536
|
+
/** Timezone for routing strategies */
|
|
537
|
+
timezone?: string;
|
|
538
|
+
/** Whether the queue is active */
|
|
539
|
+
active: boolean;
|
|
540
|
+
/** Whether outdial campaign is enabled */
|
|
541
|
+
outdialCampaignEnabled?: boolean;
|
|
542
|
+
/** Whether monitoring is permitted */
|
|
543
|
+
monitoringPermitted: boolean;
|
|
544
|
+
/** Whether parking is permitted */
|
|
545
|
+
parkingPermitted: boolean;
|
|
546
|
+
/** Whether recording is permitted */
|
|
547
|
+
recordingPermitted: boolean;
|
|
548
|
+
/** Whether recording all calls is permitted */
|
|
549
|
+
recordingAllCallsPermitted: boolean;
|
|
550
|
+
/** Whether pausing recording is permitted */
|
|
551
|
+
pauseRecordingPermitted: boolean;
|
|
552
|
+
/** Recording pause duration in seconds */
|
|
553
|
+
recordingPauseDuration?: number;
|
|
554
|
+
/** Control flow script URL */
|
|
555
|
+
controlFlowScriptUrl: string;
|
|
556
|
+
/** IVR requeue URL */
|
|
557
|
+
ivrRequeueUrl: string;
|
|
558
|
+
/** Overflow number for telephony */
|
|
559
|
+
overflowNumber?: string;
|
|
560
|
+
/** Vendor ID */
|
|
561
|
+
vendorId?: string;
|
|
562
|
+
/** Routing type */
|
|
563
|
+
routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';
|
|
564
|
+
/** Skills-based routing type */
|
|
565
|
+
skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';
|
|
566
|
+
/** Queue routing type */
|
|
567
|
+
queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';
|
|
568
|
+
/** Queue skill requirements */
|
|
569
|
+
queueSkillRequirements?: QueueSkillRequirement[];
|
|
570
|
+
/** List of agents for agent-based queue */
|
|
571
|
+
agents?: QueueAgent[];
|
|
572
|
+
/** Call distribution groups */
|
|
573
|
+
callDistributionGroups: CallDistributionGroup[];
|
|
574
|
+
/** XSP version */
|
|
575
|
+
xspVersion?: string;
|
|
576
|
+
/** Subscription ID */
|
|
577
|
+
subscriptionId?: string;
|
|
578
|
+
/** Assistant skill mapping */
|
|
579
|
+
assistantSkill?: AssistantSkillMapping;
|
|
580
|
+
/** Whether this is a system default queue */
|
|
581
|
+
systemDefault?: boolean;
|
|
582
|
+
/** User who last updated agents list */
|
|
583
|
+
agentsLastUpdatedByUserName?: string;
|
|
584
|
+
/** Email of user who last updated agents list */
|
|
585
|
+
agentsLastUpdatedByUserEmailPrefix?: string;
|
|
586
|
+
/** When agents list was last updated */
|
|
587
|
+
agentsLastUpdatedTime?: number;
|
|
588
|
+
/** Creation timestamp in epoch millis */
|
|
589
|
+
createdTime?: number;
|
|
590
|
+
/** Last updated timestamp in epoch millis */
|
|
591
|
+
lastUpdatedTime?: number;
|
|
592
|
+
}
|
|
593
|
+
export type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;
|
|
594
|
+
export interface ContactServiceQueueSearchParams extends BaseSearchParams {
|
|
595
|
+
desktopProfileFilter?: boolean;
|
|
596
|
+
provisioningView?: boolean;
|
|
597
|
+
singleObjectResponse?: boolean;
|
|
598
|
+
}
|
|
437
599
|
/**
|
|
438
600
|
* Response type for buddy agents query operations.
|
|
439
601
|
* Either a success response with list of buddy agents or an error.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common pagination metadata interface used across all APIs.
|
|
3
|
+
* @public
|
|
4
|
+
* @template T - Additional metadata properties specific to the API
|
|
5
|
+
*/
|
|
6
|
+
export interface PaginationMeta {
|
|
7
|
+
/** Organization ID */
|
|
8
|
+
orgid?: string;
|
|
9
|
+
/** Current page number */
|
|
10
|
+
page?: number;
|
|
11
|
+
/** Page size for current data set */
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
/** Number of pages */
|
|
14
|
+
totalPages?: number;
|
|
15
|
+
/** Total number of items */
|
|
16
|
+
totalRecords?: number;
|
|
17
|
+
/** Total number of items (alias for compatibility) */
|
|
18
|
+
totalItems?: number;
|
|
19
|
+
/** Current page number (alias for compatibility) */
|
|
20
|
+
currentPage?: number;
|
|
21
|
+
/** Map of pagination links */
|
|
22
|
+
links?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Common paginated response interface used across all APIs.
|
|
26
|
+
* @public
|
|
27
|
+
* @template T - The type of data items in the response
|
|
28
|
+
*/
|
|
29
|
+
export interface PaginatedResponse<T> {
|
|
30
|
+
/** Array of data items */
|
|
31
|
+
data: T[];
|
|
32
|
+
/** Pagination metadata */
|
|
33
|
+
meta: PaginationMeta;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Common search and pagination parameters interface.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface BaseSearchParams {
|
|
40
|
+
/** Search keyword */
|
|
41
|
+
search?: string;
|
|
42
|
+
/** Filter criteria using RSQL syntax */
|
|
43
|
+
filter?: string;
|
|
44
|
+
/** Attributes to be returned */
|
|
45
|
+
attributes?: string;
|
|
46
|
+
/** Page number (starts from 0) */
|
|
47
|
+
page?: number;
|
|
48
|
+
/** Number of items per page */
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
/** Sort field */
|
|
51
|
+
sortBy?: string;
|
|
52
|
+
/** Sort direction */
|
|
53
|
+
sortOrder?: 'asc' | 'desc';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Default pagination constants used across all APIs.
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export declare const PAGINATION_DEFAULTS: {
|
|
60
|
+
/** Default page number */
|
|
61
|
+
readonly PAGE: 0;
|
|
62
|
+
/** Default page size */
|
|
63
|
+
readonly PAGE_SIZE: 100;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Interface for cached page entry with metadata
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export interface PageCacheEntry<T> {
|
|
70
|
+
/** Cached data items for this page */
|
|
71
|
+
data: T[];
|
|
72
|
+
/** Timestamp when this page was cached */
|
|
73
|
+
timestamp: number;
|
|
74
|
+
/** Total metadata if available */
|
|
75
|
+
totalMeta?: {
|
|
76
|
+
totalPages?: number;
|
|
77
|
+
totalRecords?: number;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Interface for cache validation parameters
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export interface CacheValidationParams {
|
|
85
|
+
/** Search query parameter */
|
|
86
|
+
search?: string;
|
|
87
|
+
/** Filter parameter */
|
|
88
|
+
filter?: string;
|
|
89
|
+
/** Attributes parameter */
|
|
90
|
+
attributes?: string;
|
|
91
|
+
/** Sort by parameter */
|
|
92
|
+
sortBy?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Page cache utility class for managing paginated API response caching.
|
|
96
|
+
* Provides consistent caching behavior across all Contact Center APIs.
|
|
97
|
+
*
|
|
98
|
+
* @class PageCache
|
|
99
|
+
* @public
|
|
100
|
+
* @template T - The type of data items being cached
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* // Create a cache instance for a specific data type
|
|
104
|
+
* const cache = new PageCache<AddressBookEntry>('AddressBook');
|
|
105
|
+
*
|
|
106
|
+
* // Check if we can use cache (no search/filter parameters)
|
|
107
|
+
* if (cache.canUseCache({ search, filter })) {
|
|
108
|
+
* const cacheKey = cache.buildCacheKey(orgId, page, pageSize);
|
|
109
|
+
* const cachedPage = cache.getCachedPage(cacheKey);
|
|
110
|
+
*
|
|
111
|
+
* if (cachedPage) {
|
|
112
|
+
* return cachedPage.data;
|
|
113
|
+
* }
|
|
114
|
+
* }
|
|
115
|
+
*
|
|
116
|
+
* // Cache API response
|
|
117
|
+
* cache.cachePage(cacheKey, responseData, responseMeta);
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare class PageCache<T> {
|
|
121
|
+
private cache;
|
|
122
|
+
private apiName;
|
|
123
|
+
/**
|
|
124
|
+
* Creates an instance of PageCache
|
|
125
|
+
* @param {string} apiName - Name of the API using this cache (for logging)
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
constructor(apiName: string);
|
|
129
|
+
/**
|
|
130
|
+
* Checks if cache can be used for the given parameters.
|
|
131
|
+
* Cache is only used for simple pagination without search/filter/attributes/sort.
|
|
132
|
+
* @param {CacheValidationParams} params - Parameters to validate
|
|
133
|
+
* @returns {boolean} True if cache can be used
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
canUseCache(params: CacheValidationParams): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Builds a cache key for the given parameters
|
|
139
|
+
* @param {string} orgId - Organization ID
|
|
140
|
+
* @param {number} page - Page number
|
|
141
|
+
* @param {number} pageSize - Page size
|
|
142
|
+
* @returns {string} Cache key
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
buildCacheKey(orgId: string, page: number, pageSize: number): string;
|
|
146
|
+
/**
|
|
147
|
+
* Gets a cached page if it exists and is valid
|
|
148
|
+
* @param {string} cacheKey - Cache key to look up
|
|
149
|
+
* @returns {PageCacheEntry<T> | null} Cached page entry or null if not found/expired
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
getCachedPage(cacheKey: string): PageCacheEntry<T> | null;
|
|
153
|
+
/**
|
|
154
|
+
* Caches a page of data with metadata
|
|
155
|
+
* @param {string} cacheKey - Cache key
|
|
156
|
+
* @param {T[]} data - Data items to cache
|
|
157
|
+
* @param {any} meta - Metadata from API response
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
160
|
+
cachePage(cacheKey: string, data: T[], meta?: any): void;
|
|
161
|
+
/**
|
|
162
|
+
* Clears all cached entries
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
clearCache(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Gets the current number of cached entries
|
|
168
|
+
* @returns {number} Number of cached entries
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
getCacheSize(): number;
|
|
172
|
+
}
|
|
173
|
+
export default PageCache;
|