@voicenter-team/events-sdk 0.0.38 → 0.0.41
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/voicenter-events-sdk.cjs.js +28 -29
- package/dist/voicenter-events-sdk.cjs.js.map +1 -1
- package/dist/voicenter-events-sdk.d.ts +170 -79
- package/dist/voicenter-events-sdk.es.js +6416 -6182
- package/dist/voicenter-events-sdk.es.js.map +1 -1
- package/dist/voicenter-events-sdk.iife.js +28 -29
- package/dist/voicenter-events-sdk.iife.js.map +1 -1
- package/dist/voicenter-events-sdk.umd.js +28 -29
- package/dist/voicenter-events-sdk.umd.js.map +1 -1
- package/package.json +59 -59
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { DebouncedFuncLeading } from 'lodash';
|
|
2
2
|
import { io } from 'socket.io-client';
|
|
3
|
-
import { LoggerOptions } from '@voicenter-team/socketio-storage-logger
|
|
3
|
+
import { LoggerOptions } from '@voicenter-team/socketio-storage-logger';
|
|
4
4
|
import { Socket as Socket_2 } from 'socket.io-client';
|
|
5
5
|
|
|
6
6
|
export declare type ActiveRoomListener = (event: number | undefined) => void
|
|
7
7
|
|
|
8
8
|
export declare type addRoomListener = (value: string) => void
|
|
9
9
|
|
|
10
|
-
export declare type AllDialersStatusEvent =
|
|
10
|
+
export declare type AllDialersStatusEvent = EventTypeData<EventsEnum.ALL_DIALER_STATUS>
|
|
11
|
+
|
|
12
|
+
declare type AllDialersStatusEvent_2 = {
|
|
11
13
|
dialers: Array<Dialer>;
|
|
12
14
|
/**
|
|
13
15
|
* 0 - Connection was establishing successfully.
|
|
@@ -27,7 +29,9 @@ export declare type AllDialersStatusEvent = {
|
|
|
27
29
|
serverTimeOffset: number;
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
export declare type AllExtensionStatusEvent =
|
|
32
|
+
export declare type AllExtensionStatusEvent = EventTypeData<EventsEnum.ALL_EXTENSION_STATUS>
|
|
33
|
+
|
|
34
|
+
declare type AllExtensionStatusEvent_2 = {
|
|
31
35
|
/**
|
|
32
36
|
* 0 - Connection was establishing successfully.
|
|
33
37
|
*/
|
|
@@ -40,14 +44,20 @@ export declare type AllExtensionStatusEvent = {
|
|
|
40
44
|
/**
|
|
41
45
|
* Server time at the moment of the event
|
|
42
46
|
*/
|
|
43
|
-
|
|
47
|
+
servertime: number;
|
|
44
48
|
/**
|
|
45
49
|
* Difference in time between server and client
|
|
46
50
|
*/
|
|
47
|
-
|
|
51
|
+
servertimeoffset: number;
|
|
48
52
|
};
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
declare interface AllExtensionStatusEventExtended extends Omit<AllExtensionStatusEvent_2, 'extensions'> {
|
|
55
|
+
extensions: Array<ExtensionDataExtended>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export declare type AllUsersStatusEvent = EventTypeData<EventsEnum.ALL_USERS_STATUS>
|
|
59
|
+
|
|
60
|
+
declare type AllUsersStatusEvent_2 = {
|
|
51
61
|
users: Array<User>;
|
|
52
62
|
/**
|
|
53
63
|
* 0 - Connection was establishing successfully.
|
|
@@ -87,14 +97,14 @@ declare class AuthClass {
|
|
|
87
97
|
|
|
88
98
|
export declare type CallAddingProgressListener = (callId: string | undefined) => void
|
|
89
99
|
|
|
90
|
-
|
|
100
|
+
declare enum CallStatusEnum {
|
|
91
101
|
RINGING = 'Ringing',
|
|
92
102
|
TALKING = 'Talking',
|
|
93
103
|
DIALING = 'Dialing',
|
|
94
104
|
HOLD = 'Hold',
|
|
95
105
|
}
|
|
96
106
|
|
|
97
|
-
|
|
107
|
+
declare enum CallTypeEnum {
|
|
98
108
|
INCOMING = 'Incoming',
|
|
99
109
|
OUTGOING = 'Outgoing',
|
|
100
110
|
}
|
|
@@ -113,7 +123,18 @@ export declare type changeIsMutedListener = (value: boolean) => void
|
|
|
113
123
|
|
|
114
124
|
export declare type changeMuteWhenJoinListener = (value: boolean) => void
|
|
115
125
|
|
|
116
|
-
|
|
126
|
+
declare interface CurrentCallEnded extends CurrentCallUTCExtended {
|
|
127
|
+
duration: number
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare interface CurrentCallUTCExtended extends ExtensionCall {
|
|
131
|
+
callStarted_UTC: number
|
|
132
|
+
callStarted_UTC_CLIENT: number
|
|
133
|
+
callAnswered_UTC: number
|
|
134
|
+
callAnswered_UTC_CLIENT: number
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare type CustomData = {
|
|
117
138
|
/**
|
|
118
139
|
* Is do not call me
|
|
119
140
|
*/
|
|
@@ -133,7 +154,7 @@ export declare type CustomData = {
|
|
|
133
154
|
DoNotCallMetransactionId?: string;
|
|
134
155
|
};
|
|
135
156
|
|
|
136
|
-
|
|
157
|
+
declare type Dialer = {
|
|
137
158
|
/**
|
|
138
159
|
* Code
|
|
139
160
|
*/
|
|
@@ -161,7 +182,9 @@ export declare type Dialer = {
|
|
|
161
182
|
statistics: string;
|
|
162
183
|
};
|
|
163
184
|
|
|
164
|
-
export declare type DialerEvent =
|
|
185
|
+
export declare type DialerEvent = EventTypeData<EventsEnum.DIALER_EVENT>
|
|
186
|
+
|
|
187
|
+
declare type DialerEvent_2 = {
|
|
165
188
|
data: Dialer;
|
|
166
189
|
/**
|
|
167
190
|
* callerID
|
|
@@ -185,27 +208,23 @@ export declare type DialerEvent = {
|
|
|
185
208
|
telephonyServerTime?: number;
|
|
186
209
|
};
|
|
187
210
|
|
|
188
|
-
|
|
211
|
+
declare enum DialerTypeEnum {
|
|
189
212
|
AUTOMATIC = 'Automatic',
|
|
190
213
|
IVR = 'IVR',
|
|
191
214
|
}
|
|
192
215
|
|
|
193
|
-
|
|
216
|
+
declare enum DirectionEnum {
|
|
194
217
|
INCOMINC = 'Incoming',
|
|
195
218
|
OUTGOING = 'Outgoing',
|
|
196
219
|
SPY = 'Spy',
|
|
197
220
|
CLICK2CALL = 'Click2Call',
|
|
198
221
|
}
|
|
199
222
|
|
|
200
|
-
|
|
223
|
+
declare enum DoNotCallMeStatusCodeEnum {
|
|
201
224
|
RESPONSE_FROM_API_VALID = 'RESPONSE_FROM_API_VALID',
|
|
202
225
|
RESPONSE_FROM_API_INVALID = 'RESPONSE_FROM_API_INVALID',
|
|
203
226
|
}
|
|
204
227
|
|
|
205
|
-
declare type Error_2 = {
|
|
206
|
-
};
|
|
207
|
-
export { Error_2 as Error }
|
|
208
|
-
|
|
209
228
|
/**
|
|
210
229
|
* This type defines a map where each key is an event name, and the value is an array of callback functions associated with that event.
|
|
211
230
|
* This structure is used to manage event listeners for different events
|
|
@@ -223,21 +242,33 @@ export declare type EventCallbackRegistry = {
|
|
|
223
242
|
[K in EventTypeNames]: (data: EventDataMap[K]) => void
|
|
224
243
|
}
|
|
225
244
|
|
|
245
|
+
export declare type EventData = EventDataMapExtended[EventsEnum]
|
|
246
|
+
|
|
226
247
|
/**
|
|
227
248
|
* Mapping of event names to their respective data structures.
|
|
249
|
+
* The data structures that socket io will send us
|
|
228
250
|
*/
|
|
229
251
|
export declare interface EventDataMap {
|
|
230
|
-
[EventsEnum.ALL_EXTENSION_STATUS]:
|
|
231
|
-
[EventsEnum.ALL_DIALER_STATUS]:
|
|
232
|
-
[EventsEnum.ALL_USERS_STATUS]:
|
|
233
|
-
[EventsEnum.QUEUE_EVENT]:
|
|
234
|
-
[EventsEnum.EXTENSION_EVENT]:
|
|
235
|
-
[EventsEnum.DIALER_EVENT]:
|
|
236
|
-
[EventsEnum.LOGIN_SUCCESS]:
|
|
237
|
-
[EventsEnum.LOGIN_STATUS]:
|
|
238
|
-
[EventsEnum.KEEP_ALIVE_RESPONSE]:
|
|
239
|
-
[EventsEnum.ONLINE_STATUS_EVENT]:
|
|
240
|
-
[EventsEnum.EXTENSIONS_UPDATED]:
|
|
252
|
+
[EventsEnum.ALL_EXTENSION_STATUS]: AllExtensionStatusEvent_2
|
|
253
|
+
[EventsEnum.ALL_DIALER_STATUS]: AllDialersStatusEvent_2
|
|
254
|
+
[EventsEnum.ALL_USERS_STATUS]: AllUsersStatusEvent_2
|
|
255
|
+
[EventsEnum.QUEUE_EVENT]: QueueEvent_2
|
|
256
|
+
[EventsEnum.EXTENSION_EVENT]: ExtensionEvent_2
|
|
257
|
+
[EventsEnum.DIALER_EVENT]: DialerEvent_2
|
|
258
|
+
[EventsEnum.LOGIN_SUCCESS]: LoginSuccessEvent_2
|
|
259
|
+
[EventsEnum.LOGIN_STATUS]: LoginStatusEvent_2
|
|
260
|
+
[EventsEnum.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent_2
|
|
261
|
+
[EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent_2
|
|
262
|
+
[EventsEnum.EXTENSIONS_UPDATED]: ExtensionsUpdated_2
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Mapping of event names to their respective data structures.
|
|
267
|
+
* The data structures that we will send to the end user, here we can modify the type of events data
|
|
268
|
+
*/
|
|
269
|
+
export declare interface EventDataMapExtended extends EventDataMap {
|
|
270
|
+
[EventsEnum.EXTENSION_EVENT]: ExtensionEventExtended
|
|
271
|
+
[EventsEnum.ALL_EXTENSION_STATUS]: AllExtensionStatusEventExtended
|
|
241
272
|
}
|
|
242
273
|
|
|
243
274
|
declare class EventEmitterClass {
|
|
@@ -245,14 +276,13 @@ declare class EventEmitterClass {
|
|
|
245
276
|
private listeners;
|
|
246
277
|
private allListeners;
|
|
247
278
|
constructor(eventsSdkClass: EventsSdkClass);
|
|
248
|
-
on
|
|
249
|
-
on(event: '*', callback: (data: GenericEventWrapper) => void): void;
|
|
279
|
+
on(event: unknown, callback: unknown): void;
|
|
250
280
|
off<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
|
|
251
281
|
off(event: '*', callback: (data: GenericEventWrapper) => void): void;
|
|
252
282
|
emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
|
|
253
283
|
}
|
|
254
284
|
|
|
255
|
-
|
|
285
|
+
declare enum EventsEnum {
|
|
256
286
|
ALL_DIALER_STATUS = 'AllDialersStatus',
|
|
257
287
|
ALL_EXTENSION_STATUS = 'AllExtensionsStatus',
|
|
258
288
|
ALL_USERS_STATUS = 'AllUsersStatus',
|
|
@@ -294,7 +324,8 @@ declare class EventsSdkClass {
|
|
|
294
324
|
retryConnection: DebouncedFuncLeading<(serverParameter: ServerParameter) => void>;
|
|
295
325
|
constructor(options: EventsSdkOptions);
|
|
296
326
|
on<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
|
|
297
|
-
|
|
327
|
+
on(event: '*', callback: (data: GenericEventWrapper) => void): void;
|
|
328
|
+
emit<T extends ServerEmitEventTypeNames>(event: T, ...args: Parameters<ServerEmitEventCallbackRegistry[T]>): void;
|
|
298
329
|
connect(serverParameter: ServerParameter): void;
|
|
299
330
|
disconnect(): void;
|
|
300
331
|
clearKeepAliveInterval(): void;
|
|
@@ -338,7 +369,10 @@ export declare interface EventsSdkOptions {
|
|
|
338
369
|
username: string;
|
|
339
370
|
}
|
|
340
371
|
|
|
341
|
-
|
|
372
|
+
/**
|
|
373
|
+
* The structure of event data for a specific event type.
|
|
374
|
+
*/
|
|
375
|
+
export declare type EventTypeData<T extends EventsEnum> = EventDataMapExtended[T]
|
|
342
376
|
|
|
343
377
|
/**
|
|
344
378
|
* Represents the set of all possible event type names as keys from the EventDataMap.
|
|
@@ -389,7 +423,7 @@ export declare type EventWrappedSocketDataMap = {
|
|
|
389
423
|
[K in EventTypeNames]: WrappedSocketEvent<K>
|
|
390
424
|
}
|
|
391
425
|
|
|
392
|
-
|
|
426
|
+
declare type Extension = {
|
|
393
427
|
calls: Array<ExtensionCall>;
|
|
394
428
|
/**
|
|
395
429
|
* Number
|
|
@@ -451,7 +485,7 @@ export declare type Extension = {
|
|
|
451
485
|
lastAnsweredCallEventEpoch: number;
|
|
452
486
|
};
|
|
453
487
|
|
|
454
|
-
|
|
488
|
+
declare type ExtensionCall = {
|
|
455
489
|
/**
|
|
456
490
|
* Ip
|
|
457
491
|
*/
|
|
@@ -481,10 +515,6 @@ export declare type ExtensionCall = {
|
|
|
481
515
|
*/
|
|
482
516
|
answered: number;
|
|
483
517
|
callType?: CallTypeEnum;
|
|
484
|
-
/**
|
|
485
|
-
* duration
|
|
486
|
-
*/
|
|
487
|
-
duration?: number;
|
|
488
518
|
/**
|
|
489
519
|
* Channel 2
|
|
490
520
|
*/
|
|
@@ -525,14 +555,6 @@ export declare type ExtensionCall = {
|
|
|
525
555
|
* Call answered
|
|
526
556
|
*/
|
|
527
557
|
callAnswered: number;
|
|
528
|
-
/**
|
|
529
|
-
* callStartedUTC
|
|
530
|
-
*/
|
|
531
|
-
callStartedUTC?: number;
|
|
532
|
-
/**
|
|
533
|
-
* callAnsweredUTC
|
|
534
|
-
*/
|
|
535
|
-
callAnsweredUTC?: number;
|
|
536
558
|
/**
|
|
537
559
|
* Original caller id
|
|
538
560
|
*/
|
|
@@ -557,21 +579,21 @@ export declare type ExtensionCall = {
|
|
|
557
579
|
* Related ivr unique ids
|
|
558
580
|
*/
|
|
559
581
|
relatedIvrUniqueIDs?: Array<string>;
|
|
560
|
-
/**
|
|
561
|
-
* callStartedUTCClient
|
|
562
|
-
*/
|
|
563
|
-
callStartedUTCClient?: number;
|
|
564
582
|
/**
|
|
565
583
|
* Call duration interval
|
|
566
584
|
*/
|
|
567
585
|
calldurationinterval: number;
|
|
568
|
-
/**
|
|
569
|
-
* callAnsweredUTCClient
|
|
570
|
-
*/
|
|
571
|
-
callAnsweredUTCClient?: number;
|
|
572
586
|
};
|
|
573
587
|
|
|
574
|
-
|
|
588
|
+
declare type ExtensionDataExtended = ExtensionUTCExtended | ExtensionEnded
|
|
589
|
+
|
|
590
|
+
declare interface ExtensionEnded extends Extension {
|
|
591
|
+
currentCall?: CurrentCallEnded
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export declare type ExtensionEvent = EventTypeData<EventsEnum.EXTENSION_EVENT>
|
|
595
|
+
|
|
596
|
+
declare type ExtensionEvent_2 = {
|
|
575
597
|
data: Extension;
|
|
576
598
|
cause?: ExtensionHangupCauseEnum;
|
|
577
599
|
reason: ExtensionEventReasonEnum;
|
|
@@ -605,7 +627,14 @@ export declare type ExtensionEvent = {
|
|
|
605
627
|
telephonyServerTime?: number;
|
|
606
628
|
};
|
|
607
629
|
|
|
608
|
-
|
|
630
|
+
declare interface ExtensionEventEnded extends Omit<ExtensionEvent_2, 'reason' | 'data'> {
|
|
631
|
+
reason: ExtensionEventReasonEnum.HANGUP
|
|
632
|
+
data: ExtensionEnded
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
declare type ExtensionEventExtended = ExtensionEventUTCExtended | ExtensionEventEnded
|
|
636
|
+
|
|
637
|
+
declare enum ExtensionEventReasonEnum {
|
|
609
638
|
NEWCALL = 'NEWCALL',
|
|
610
639
|
ANSWER = 'ANSWER',
|
|
611
640
|
HOLD = 'HOLD',
|
|
@@ -614,7 +643,12 @@ export declare enum ExtensionEventReasonEnum {
|
|
|
614
643
|
USER_STATUS_UPDATE = 'userStatusUpdate',
|
|
615
644
|
}
|
|
616
645
|
|
|
617
|
-
|
|
646
|
+
declare interface ExtensionEventUTCExtended extends Omit<ExtensionEvent_2, 'reason' | 'data'> {
|
|
647
|
+
reason: Exclude<ExtensionEventReasonEnum, ExtensionEventReasonEnum.HANGUP>
|
|
648
|
+
data: ExtensionUTCExtended
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
declare enum ExtensionHangupCauseEnum {
|
|
618
652
|
NORMAL_HANGUP = 'Normal hangup',
|
|
619
653
|
USER_BUSY = 'User busy',
|
|
620
654
|
CALL_REJECTED = 'Call Rejected',
|
|
@@ -625,7 +659,13 @@ export declare enum ExtensionHangupCauseEnum {
|
|
|
625
659
|
ANSWERED_ELSEWHERE = 'Answered elsewhere',
|
|
626
660
|
}
|
|
627
661
|
|
|
628
|
-
export declare type ExtensionsUpdated =
|
|
662
|
+
export declare type ExtensionsUpdated = EventTypeData<EventsEnum.EXTENSIONS_UPDATED>
|
|
663
|
+
|
|
664
|
+
declare type ExtensionsUpdated_2 = string;
|
|
665
|
+
|
|
666
|
+
declare interface ExtensionUTCExtended extends Extension {
|
|
667
|
+
currentCall?: CurrentCallUTCExtended
|
|
668
|
+
}
|
|
629
669
|
|
|
630
670
|
export declare interface ExternalLoginNewStackResponseData {
|
|
631
671
|
AccessToken: string,
|
|
@@ -655,7 +695,9 @@ export declare interface ExternalLoginResponse<T> {
|
|
|
655
695
|
*/
|
|
656
696
|
export declare type GenericEventWrapper = EventWrappedSocketDataMap[EventTypeNames]
|
|
657
697
|
|
|
658
|
-
export declare type KeepAliveResponseEvent =
|
|
698
|
+
export declare type KeepAliveResponseEvent = EventTypeData<EventsEnum.KEEP_ALIVE_RESPONSE>
|
|
699
|
+
|
|
700
|
+
declare type KeepAliveResponseEvent_2 = {
|
|
659
701
|
/**
|
|
660
702
|
* Is ok
|
|
661
703
|
*/
|
|
@@ -726,7 +768,9 @@ export declare interface LoginSessionPayload {
|
|
|
726
768
|
password: string
|
|
727
769
|
}
|
|
728
770
|
|
|
729
|
-
export declare type LoginStatusEvent =
|
|
771
|
+
export declare type LoginStatusEvent = EventTypeData<EventsEnum.LOGIN_STATUS>
|
|
772
|
+
|
|
773
|
+
declare type LoginStatusEvent_2 = {
|
|
730
774
|
queues: Array<Queue>;
|
|
731
775
|
/**
|
|
732
776
|
* 0 - Connection was establishing successfully.
|
|
@@ -746,7 +790,16 @@ export declare type LoginStatusEvent = {
|
|
|
746
790
|
serverTimeOffset: number;
|
|
747
791
|
};
|
|
748
792
|
|
|
749
|
-
|
|
793
|
+
/**
|
|
794
|
+
* Event types declared for being used in the application.
|
|
795
|
+
* These are just aliases for the EventTypeData type.
|
|
796
|
+
* We need that for the IDE to show the correct type of the event data, based on if the event is extended or not.
|
|
797
|
+
* NOT FOR USAGE IN THE EVENTS SDK CODEBASE, JUST FOR USAGE IN THE APPLICATION CODEBASE.
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
export declare type LoginSuccessEvent = EventTypeData<EventsEnum.LOGIN_SUCCESS>
|
|
801
|
+
|
|
802
|
+
declare type LoginSuccessEvent_2 = {
|
|
750
803
|
/**
|
|
751
804
|
* 0 - Connection was establishing successfully.
|
|
752
805
|
*/
|
|
@@ -770,7 +823,9 @@ declare enum LoginType {
|
|
|
770
823
|
TOKEN = "Token"
|
|
771
824
|
}
|
|
772
825
|
|
|
773
|
-
export declare type OnlineStatusEvent =
|
|
826
|
+
export declare type OnlineStatusEvent = EventTypeData<EventsEnum.ONLINE_STATUS_EVENT>
|
|
827
|
+
|
|
828
|
+
declare type OnlineStatusEvent_2 = {
|
|
774
829
|
/**
|
|
775
830
|
* attemptToConnect
|
|
776
831
|
*/
|
|
@@ -799,7 +854,7 @@ export declare interface OpenSIPSEventMap {
|
|
|
799
854
|
changeCallStatus: changeCallStatusListener
|
|
800
855
|
}
|
|
801
856
|
|
|
802
|
-
|
|
857
|
+
declare type Queue = {
|
|
803
858
|
Calls: Array<QueueCall>;
|
|
804
859
|
/**
|
|
805
860
|
* User id
|
|
@@ -827,7 +882,7 @@ export declare type Queue = {
|
|
|
827
882
|
IsDistributedQueue?: boolean;
|
|
828
883
|
};
|
|
829
884
|
|
|
830
|
-
|
|
885
|
+
declare type QueueCall = {
|
|
831
886
|
/**
|
|
832
887
|
* Ivr id
|
|
833
888
|
*/
|
|
@@ -858,7 +913,9 @@ export declare type QueueCall = {
|
|
|
858
913
|
calldurationinterval: number;
|
|
859
914
|
};
|
|
860
915
|
|
|
861
|
-
export declare type QueueEvent =
|
|
916
|
+
export declare type QueueEvent = EventTypeData<EventsEnum.QUEUE_EVENT>
|
|
917
|
+
|
|
918
|
+
declare type QueueEvent_2 = {
|
|
862
919
|
data: Queue;
|
|
863
920
|
reason: QueueEventReasonEnum;
|
|
864
921
|
/**
|
|
@@ -875,7 +932,7 @@ export declare type QueueEvent = {
|
|
|
875
932
|
telephonyServerTime: number;
|
|
876
933
|
};
|
|
877
934
|
|
|
878
|
-
|
|
935
|
+
declare enum QueueEventReasonEnum {
|
|
879
936
|
ANSWER = 'ANSWER',
|
|
880
937
|
ABANDONED = 'ABANDONED',
|
|
881
938
|
EXIT = 'EXIT',
|
|
@@ -892,7 +949,7 @@ export declare interface ReconnectOptions {
|
|
|
892
949
|
maxReconnectionDelay: number;
|
|
893
950
|
}
|
|
894
951
|
|
|
895
|
-
|
|
952
|
+
declare type Recording = {
|
|
896
953
|
/**
|
|
897
954
|
* Is muted
|
|
898
955
|
*/
|
|
@@ -913,10 +970,6 @@ export declare type Recording = {
|
|
|
913
970
|
|
|
914
971
|
export declare type removeRoomListener = (value: string) => void
|
|
915
972
|
|
|
916
|
-
declare type Response_2 = {
|
|
917
|
-
};
|
|
918
|
-
export { Response_2 as Response }
|
|
919
|
-
|
|
920
973
|
export declare type RoomDeletedListener = (roomId: number) => void
|
|
921
974
|
|
|
922
975
|
export declare interface Server {
|
|
@@ -926,6 +979,30 @@ export declare interface Server {
|
|
|
926
979
|
Version: string;
|
|
927
980
|
}
|
|
928
981
|
|
|
982
|
+
export declare type ServerEmitEventCallbackRegistry = {
|
|
983
|
+
[K in ServerEmitEventTypeNames]: (data: ServerEmitEventDataMap[K]) => void
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Mapping of event names to their respective data structures.
|
|
988
|
+
* The data structures that we can send to the server
|
|
989
|
+
*/
|
|
990
|
+
export declare interface ServerEmitEventDataMap {
|
|
991
|
+
[ServerListenerEventsEnum.UPDATE_MONITORED_EXTENSIONS]: UpdateMonitoredExtensionsPayload
|
|
992
|
+
[ServerListenerEventsEnum.KEEP_ALIVE]: string
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Represents the set of all possible event type names as keys from the ServerEmitEventDataMap.
|
|
997
|
+
* This type is used to define event emitters and data.
|
|
998
|
+
*/
|
|
999
|
+
export declare type ServerEmitEventTypeNames = keyof ServerEmitEventDataMap
|
|
1000
|
+
|
|
1001
|
+
export declare enum ServerListenerEventsEnum {
|
|
1002
|
+
UPDATE_MONITORED_EXTENSIONS = "updateMonitoredExtensions",
|
|
1003
|
+
KEEP_ALIVE = "keepAlive"
|
|
1004
|
+
}
|
|
1005
|
+
|
|
929
1006
|
export declare enum ServerParameter {
|
|
930
1007
|
MAIN = "main",
|
|
931
1008
|
NEXT = "next"
|
|
@@ -969,20 +1046,27 @@ declare class SocketIoClass {
|
|
|
969
1046
|
private connected;
|
|
970
1047
|
getSocketIoFunction(Client: string): void;
|
|
971
1048
|
initSocketConnection(): void;
|
|
972
|
-
initSocketEvents(): void;
|
|
973
1049
|
clearKeepAliveInterval(): void;
|
|
974
1050
|
initKeepAlive(): void;
|
|
975
1051
|
closeAllConnections(): void;
|
|
1052
|
+
initSocketEvents(): void;
|
|
1053
|
+
private onLoginSuccessEvent;
|
|
1054
|
+
private onQueueEvent;
|
|
1055
|
+
private onExtensionEvent;
|
|
1056
|
+
private onDialerEvent;
|
|
1057
|
+
private onLoginStatusEvent;
|
|
1058
|
+
private onAllExtensionStatus;
|
|
1059
|
+
private onAllDialerStatus;
|
|
976
1060
|
private onKeepAliveResponse;
|
|
1061
|
+
private onExtensionsUpdatedEvent;
|
|
977
1062
|
private onConnect;
|
|
978
1063
|
private onDisconnect;
|
|
979
1064
|
private onConnectError;
|
|
980
|
-
private configureUTCForObject;
|
|
981
1065
|
}
|
|
982
1066
|
|
|
983
|
-
export declare type SocketTyped = Socket_2<EventCallbackRegistry,
|
|
1067
|
+
export declare type SocketTyped = Socket_2<EventCallbackRegistry, ServerEmitEventCallbackRegistry>
|
|
984
1068
|
|
|
985
|
-
|
|
1069
|
+
declare type Summery = {
|
|
986
1070
|
/**
|
|
987
1071
|
* Representative
|
|
988
1072
|
*/
|
|
@@ -993,9 +1077,13 @@ export declare type TestEventListener = (event: { test: string }) => void
|
|
|
993
1077
|
|
|
994
1078
|
declare type TypedSocketIo = (...args: Parameters<typeof io>) => SocketTyped;
|
|
995
1079
|
|
|
1080
|
+
export declare interface UpdateMonitoredExtensionsPayload {
|
|
1081
|
+
extensionsString: string
|
|
1082
|
+
}
|
|
1083
|
+
|
|
996
1084
|
export declare type updateRoomListener = (value: string) => void
|
|
997
1085
|
|
|
998
|
-
|
|
1086
|
+
declare type User = {
|
|
999
1087
|
/**
|
|
1000
1088
|
* User id
|
|
1001
1089
|
*/
|
|
@@ -1010,9 +1098,12 @@ export declare type User = {
|
|
|
1010
1098
|
accountID: number;
|
|
1011
1099
|
};
|
|
1012
1100
|
|
|
1101
|
+
/**
|
|
1102
|
+
* The structure of received socket events.
|
|
1103
|
+
*/
|
|
1013
1104
|
export declare type WrappedSocketEvent<T extends EventsEnum> = {
|
|
1014
1105
|
name: T
|
|
1015
|
-
data:
|
|
1106
|
+
data: EventDataMapExtended[T]
|
|
1016
1107
|
}
|
|
1017
1108
|
|
|
1018
1109
|
export { }
|