@voicenter-team/events-sdk 0.0.26 → 0.0.27
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 +16 -16
- package/dist/voicenter-events-sdk.cjs.js.map +1 -1
- package/dist/voicenter-events-sdk.d.ts +2 -176
- package/dist/voicenter-events-sdk.es.js +2715 -2725
- package/dist/voicenter-events-sdk.es.js.map +1 -1
- package/dist/voicenter-events-sdk.iife.js +21 -21
- package/dist/voicenter-events-sdk.iife.js.map +1 -1
- package/dist/voicenter-events-sdk.umd.js +21 -21
- package/dist/voicenter-events-sdk.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -3
- package/src/types/events.d.ts +3 -2
- package/vite.config.ts.timestamp-1709657877833-8e67641281433.mjs +49 -0
- package/docs/src/.vuepress/config.js.7b0e7894.mjs +0 -64
- package/src/enum/events.enum.ts +0 -73
- package/src/types/events.common.d.ts +0 -110
|
@@ -5,6 +5,7 @@ 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';
|
|
@@ -37,18 +38,6 @@ declare class AuthClass {
|
|
|
37
38
|
|
|
38
39
|
export declare type CallAddingProgressListener = (callId: string | undefined) => void
|
|
39
40
|
|
|
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
41
|
export declare type changeActiveCallsListener = (event: { [key: string]: string }) => void
|
|
53
42
|
|
|
54
43
|
export declare type changeActiveInputMediaDeviceListener = (event: string) => void
|
|
@@ -63,41 +52,6 @@ export declare type changeIsMutedListener = (value: boolean) => void
|
|
|
63
52
|
|
|
64
53
|
export declare type changeMuteWhenJoinListener = (value: boolean) => void
|
|
65
54
|
|
|
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
55
|
/**
|
|
102
56
|
* 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
57
|
* This structure is used to manage event listeners for different events
|
|
@@ -129,7 +83,7 @@ export declare interface EventDataMap {
|
|
|
129
83
|
[EventsEnum.LOGIN_STATUS]: LoginStatusEvent
|
|
130
84
|
[EventsEnum.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent
|
|
131
85
|
[EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent
|
|
132
|
-
[EventsEnum.EXTENSIONS_UPDATED]:
|
|
86
|
+
[EventsEnum.EXTENSIONS_UPDATED]: ExtensionsUpdated
|
|
133
87
|
}
|
|
134
88
|
|
|
135
89
|
declare class EventEmitterClass {
|
|
@@ -144,15 +98,6 @@ declare class EventEmitterClass {
|
|
|
144
98
|
emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
|
|
145
99
|
}
|
|
146
100
|
|
|
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
101
|
/**
|
|
157
102
|
* This is a generic type for callback functions used in event handling.
|
|
158
103
|
* It takes a generic event name and defines a callback function that receives wrapped socket event data for that specific event.
|
|
@@ -272,80 +217,6 @@ export declare type EventWrappedSocketDataMap = {
|
|
|
272
217
|
[K in EventTypeNames]: WrappedSocketEvent<K>
|
|
273
218
|
}
|
|
274
219
|
|
|
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
220
|
export declare interface ExternalLoginNewStackResponseData {
|
|
350
221
|
AccessToken: string,
|
|
351
222
|
RefreshToken: string
|
|
@@ -450,33 +321,6 @@ export declare interface OpenSIPSEventMap {
|
|
|
450
321
|
changeCallStatus: changeCallStatusListener
|
|
451
322
|
}
|
|
452
323
|
|
|
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
324
|
export declare type readyListener = (value: boolean) => void
|
|
481
325
|
|
|
482
326
|
export declare interface ReconnectOptions {
|
|
@@ -487,13 +331,6 @@ export declare interface ReconnectOptions {
|
|
|
487
331
|
maxReconnectionDelay: number;
|
|
488
332
|
}
|
|
489
333
|
|
|
490
|
-
export declare interface Recording {
|
|
491
|
-
Filename: string,
|
|
492
|
-
Options: string,
|
|
493
|
-
ApproximateURL: string,
|
|
494
|
-
IsMuted: number
|
|
495
|
-
}
|
|
496
|
-
|
|
497
334
|
export declare type removeRoomListener = (value: string) => void
|
|
498
335
|
|
|
499
336
|
export declare type RoomDeletedListener = (roomId: number) => void
|
|
@@ -560,23 +397,12 @@ declare class SocketIoClass {
|
|
|
560
397
|
|
|
561
398
|
export declare type SocketTyped = Socket_2<EventCallbackRegistry, Record<EventsEnum, any>>
|
|
562
399
|
|
|
563
|
-
export declare interface Summery {
|
|
564
|
-
representative: string
|
|
565
|
-
}
|
|
566
|
-
|
|
567
400
|
export declare type TestEventListener = (event: { test: string }) => void
|
|
568
401
|
|
|
569
402
|
declare type TypedSocketIo = (...args: Parameters<typeof io>) => SocketTyped;
|
|
570
403
|
|
|
571
404
|
export declare type updateRoomListener = (value: string) => void
|
|
572
405
|
|
|
573
|
-
export declare interface User {
|
|
574
|
-
userID: number,
|
|
575
|
-
userName: string,
|
|
576
|
-
accountID: number
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
|
|
580
406
|
export declare type WrappedSocketEvent<T extends EventsEnum> = {
|
|
581
407
|
name: T
|
|
582
408
|
data: EventDataMap[T]
|