@voicenter-team/events-sdk 0.0.26 → 0.0.28

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.
@@ -5,11 +5,13 @@ import { DebouncedFuncLeading } from 'lodash';
5
5
  import { DialerEvent } from '@voicenter-team/real-time-events-types';
6
6
  import { EventsEnum } from '@voicenter-team/real-time-events-types';
7
7
  import { ExtensionEvent } from '@voicenter-team/real-time-events-types';
8
+ import { ExtensionsUpdated } from '@voicenter-team/real-time-events-types';
8
9
  import { io } from 'socket.io-client';
9
10
  import { KeepAliveResponseEvent } from '@voicenter-team/real-time-events-types';
10
11
  import { LoggerOptions } from '@voicenter-team/socketio-storage-logger/dist/storage-logger';
11
12
  import { LoginStatusEvent } from '@voicenter-team/real-time-events-types';
12
13
  import { LoginSuccessEvent } from '@voicenter-team/real-time-events-types';
14
+ import { OnlineStatusEvent } from '@voicenter-team/real-time-events-types';
13
15
  import { QueueEvent } from '@voicenter-team/real-time-events-types';
14
16
  import { Socket as Socket_2 } from 'socket.io-client';
15
17
 
@@ -37,18 +39,6 @@ declare class AuthClass {
37
39
 
38
40
  export declare type CallAddingProgressListener = (callId: string | undefined) => void
39
41
 
40
- export declare enum CallStatusEnum {
41
- RINGING = "Ringing",
42
- TALKING = "Talking",
43
- DIALING = "Dialing",
44
- HOLD = "Hold"
45
- }
46
-
47
- export declare enum CallTypeEnum {
48
- INCOMING = "Incoming",
49
- OUTGOING = "Outgoing"
50
- }
51
-
52
42
  export declare type changeActiveCallsListener = (event: { [key: string]: string }) => void
53
43
 
54
44
  export declare type changeActiveInputMediaDeviceListener = (event: string) => void
@@ -63,41 +53,6 @@ export declare type changeIsMutedListener = (value: boolean) => void
63
53
 
64
54
  export declare type changeMuteWhenJoinListener = (value: boolean) => void
65
55
 
66
- export declare interface CustomData {
67
- DoNotCallMeStatus?: string,
68
- DoNotCallMeStatusCode?: DoNotCallMeStatusCodeEnum,
69
- DoNotCallMeTokenName?: string,
70
- DoNotCallMetransactionId?: string,
71
- IsDoNotCallMe?: string
72
- }
73
-
74
- export declare interface Dialer {
75
- campaignID: number,
76
- name: string,
77
- typeID: number,
78
- type: DialerType,
79
- code: string,
80
- calls: unknown,
81
- statistics: unknown
82
- }
83
-
84
- export declare enum DialerType {
85
- AUTOMATIC = "Automatic",
86
- IVR = "IVR"
87
- }
88
-
89
- export declare enum DirectionEnum {
90
- INCOMING = "Incoming",
91
- OUTGOING = "Outgoing",
92
- SPY = "Spy",
93
- CLICK2CALL = "Click2call"
94
- }
95
-
96
- export declare enum DoNotCallMeStatusCodeEnum {
97
- RESPONSE_FROM_API_VALID = "RESPONSE_FROM_API_VALID",
98
- RESPONSE_FROM_API_INVALID = "RESPONSE_FROM_API_INVALID"
99
- }
100
-
101
56
  /**
102
57
  * 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.
103
58
  * This structure is used to manage event listeners for different events
@@ -129,7 +84,7 @@ export declare interface EventDataMap {
129
84
  [EventsEnum.LOGIN_STATUS]: LoginStatusEvent
130
85
  [EventsEnum.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent
131
86
  [EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent
132
- [EventsEnum.EXTENSIONS_UPDATED]: string
87
+ [EventsEnum.EXTENSIONS_UPDATED]: ExtensionsUpdated
133
88
  }
134
89
 
135
90
  declare class EventEmitterClass {
@@ -144,15 +99,6 @@ declare class EventEmitterClass {
144
99
  emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
145
100
  }
146
101
 
147
- /**
148
- * All the eventNames that can be received from the server. Exists only in EXTENSION_EVENT and QueueEvent
149
- */
150
- export declare enum EventNameEnum {
151
- EXTENSION = "extension",
152
- QUEUE = "queue",
153
- DIALER = "dialer"
154
- }
155
-
156
102
  /**
157
103
  * This is a generic type for callback functions used in event handling.
158
104
  * It takes a generic event name and defines a callback function that receives wrapped socket event data for that specific event.
@@ -272,80 +218,6 @@ export declare type EventWrappedSocketDataMap = {
272
218
  [K in EventTypeNames]: WrappedSocketEvent<K>
273
219
  }
274
220
 
275
- export declare interface Extension {
276
- calls: ExtensionCall[],
277
- userID: number,
278
- userName: string,
279
- number: number,
280
- extenUser: string,
281
- accountID: number,
282
- topAccountID: number,
283
- summery: Summery,
284
- onlineUserID: number,
285
- representative: number,
286
- representativeStatus: number,
287
- lastCallEventEpoch: number,
288
- lastAnsweredCallEventEpoch: number,
289
- lastHangupCallEpoch: number,
290
- representativeUpdated: number,
291
- peerStatus: unknown,
292
- currentCall?: ExtensionCall,
293
- }
294
-
295
- export declare interface ExtensionCall {
296
- callStarted: number,
297
- calldurationinterval: number,
298
- callAnswered: number,
299
- answered: number,
300
- callername: string,
301
- callerphone: string,
302
- outgoingcallername?: string,
303
- outgoingcallerphone?: string,
304
- callstatus: CallStatusEnum,
305
- customdata: CustomData,
306
- direction: DirectionEnum,
307
- ivrid: string,
308
- recording: Recording,
309
- did: string,
310
- relatedIvrUniqueIDs?: string[],
311
- callType?: CallTypeEnum,
312
- ip: string,
313
- isInternal: boolean
314
- blcServerID: number,
315
- isOpensips: boolean,
316
- channel: string,
317
- channel2: string,
318
- queueID?: number,
319
- isSpyed?: boolean,
320
- blcServerId?: number,
321
- originalCallerID?: string,
322
- originalCallerName?: string,
323
- actualDialedNumber?: number
324
- }
325
-
326
- /**
327
- * All the reasons for the extension event, e.g. a new call is ringing or dialing from an extension.
328
- */
329
- export declare enum ExtensionEventReasonEnum {
330
- NEW_CALL = "NEWCALL",
331
- ANSWER = "ANSWER",
332
- HOLD = "HOLD",
333
- UNHOLD = "UNHOLD",
334
- HANGUP = "HANGUP",
335
- USER_STATUS_UPDATE = "userStatusUpdate"
336
- }
337
-
338
- export declare enum ExtensionHangupCauseEnum {
339
- NORMAL_HANGUP = "Normal hangup",
340
- USER_BUSY = "User busy",
341
- CALL_REJECTED = "Call Rejected",
342
- UNALLOCATED_NUMBER = "Unallocated (unassigned) number",
343
- UNKNOWN = "Unknown",
344
- NO_USER_RESPONDING = "No user responding",
345
- USER_ALERTING = "User alerting, no answer",
346
- ANSWERED_ELSEWHERE = "Answered elsewhere"
347
- }
348
-
349
221
  export declare interface ExternalLoginNewStackResponseData {
350
222
  AccessToken: string,
351
223
  RefreshToken: string
@@ -427,11 +299,6 @@ declare enum LoginType {
427
299
  TOKEN = "Token"
428
300
  }
429
301
 
430
- export declare interface OnlineStatusEvent {
431
- isSocketConnected: boolean
432
- attemptToConnect?: string
433
- }
434
-
435
302
  export declare interface OpenSIPSEventMap {
436
303
  ready: readyListener
437
304
  changeActiveCalls: changeActiveCallsListener
@@ -450,33 +317,6 @@ export declare interface OpenSIPSEventMap {
450
317
  changeCallStatus: changeCallStatusListener
451
318
  }
452
319
 
453
- export declare interface Queue {
454
- QueueID: number,
455
- QueueName: string,
456
- Calls: QueueCall[],
457
- UserId?: number,
458
- DistributorID?: number,
459
- IsDistributedQueue?: boolean,
460
- AnsweredAgent?: string,
461
- }
462
-
463
- export declare interface QueueCall {
464
- CallerID: string,
465
- CallerName: string,
466
- IvrUniqueID: string,
467
- JoinTimeStamp: number,
468
- calldurationinterval: number,
469
- ivrid: string,
470
- isDistributedQueue?: boolean
471
- }
472
-
473
- export declare enum QueueEventReasonEnum {
474
- ANSWER = "ANSWER",
475
- ABANDONED = "ABANDONED",
476
- EXIT = "EXIT",
477
- JOIN = "JOIN"
478
- }
479
-
480
320
  export declare type readyListener = (value: boolean) => void
481
321
 
482
322
  export declare interface ReconnectOptions {
@@ -487,13 +327,6 @@ export declare interface ReconnectOptions {
487
327
  maxReconnectionDelay: number;
488
328
  }
489
329
 
490
- export declare interface Recording {
491
- Filename: string,
492
- Options: string,
493
- ApproximateURL: string,
494
- IsMuted: number
495
- }
496
-
497
330
  export declare type removeRoomListener = (value: string) => void
498
331
 
499
332
  export declare type RoomDeletedListener = (roomId: number) => void
@@ -560,26 +393,18 @@ declare class SocketIoClass {
560
393
 
561
394
  export declare type SocketTyped = Socket_2<EventCallbackRegistry, Record<EventsEnum, any>>
562
395
 
563
- export declare interface Summery {
564
- representative: string
565
- }
566
-
567
396
  export declare type TestEventListener = (event: { test: string }) => void
568
397
 
569
398
  declare type TypedSocketIo = (...args: Parameters<typeof io>) => SocketTyped;
570
399
 
571
400
  export declare type updateRoomListener = (value: string) => void
572
401
 
573
- export declare interface User {
574
- userID: number,
575
- userName: string,
576
- accountID: number
577
-
578
- }
579
-
580
402
  export declare type WrappedSocketEvent<T extends EventsEnum> = {
581
403
  name: T
582
404
  data: EventDataMap[T]
583
405
  }
584
406
 
407
+
408
+ export * from "@voicenter-team/real-time-events-types";
409
+
585
410
  export { }