@voicenter-team/events-sdk 0.0.2 → 0.0.3
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/.eslintrc.cjs +2 -1
- package/.idea/inspectionProfiles/Project_Default.xml +5 -5
- package/dist/voicenter-events-sdk.cjs.js +10 -10
- package/dist/voicenter-events-sdk.d.ts +38 -33
- package/dist/voicenter-events-sdk.es.js +370 -368
- package/dist/voicenter-events-sdk.iife.js +2 -2
- package/dist/voicenter-events-sdk.umd.js +2 -2
- package/interface.ts +261 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
|
@@ -118,6 +118,11 @@ declare enum DoNotCallMeStatusCodeEnum {
|
|
|
118
118
|
RESPONSE_FROM_API_INVALID = "RESPONSE_FROM_API_INVALID"
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
export declare enum Environment {
|
|
122
|
+
BROWSER = "browser",
|
|
123
|
+
CHROME_EXTENSION = "chrome-extension"
|
|
124
|
+
}
|
|
125
|
+
|
|
121
126
|
/**
|
|
122
127
|
* Defines a registry of callback functions for each event type.
|
|
123
128
|
* Each key is an event type name, and the value is a function that takes the specific event data type as an argument.
|
|
@@ -131,16 +136,16 @@ declare type EventCallbackRegistry = {
|
|
|
131
136
|
* Mapping of event names to their respective data structures.
|
|
132
137
|
*/
|
|
133
138
|
declare interface EventDataMap {
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
[
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
[
|
|
143
|
-
[
|
|
139
|
+
[EventsEnum_2.ALL_EXTENSION_STATUS]: AllExtensionStatusEvent
|
|
140
|
+
[EventsEnum_2.ALL_DIALER_STATUS]: AllDialersStatusEvent
|
|
141
|
+
[EventsEnum_2.ALL_USERS_STATUS]: AllUsersStatusEvent
|
|
142
|
+
[EventsEnum_2.QUEUE_EVENT]: QueueEvent
|
|
143
|
+
[EventsEnum_2.EXTENSION_EVENT]: ExtensionEvent
|
|
144
|
+
[EventsEnum_2.DIALER_EVENT]: DialerEvent
|
|
145
|
+
[EventsEnum_2.LOGIN_SUCCESS]: LoginSuccessEvent
|
|
146
|
+
[EventsEnum_2.LOGIN_STATUS]: LoginStatusEvent
|
|
147
|
+
[EventsEnum_2.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent
|
|
148
|
+
[EventsEnum_2.ONLINE_STATUS_EVENT]: OnlineStatusEvent
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
/**
|
|
@@ -155,7 +160,26 @@ declare enum EventNameEnum {
|
|
|
155
160
|
/**
|
|
156
161
|
* All events that can be received from the server.
|
|
157
162
|
*/
|
|
158
|
-
declare enum EventsEnum {
|
|
163
|
+
export declare enum EventsEnum {
|
|
164
|
+
ALL_DIALER_STATUS = "AllDialersStatus",
|
|
165
|
+
ALL_EXTENSION_STATUS = "AllExtensionsStatus",
|
|
166
|
+
ALL_USERS_STATUS = "AllUsersStatus",
|
|
167
|
+
CONNECT = "connect",
|
|
168
|
+
DISCONNECT = "disconnect",
|
|
169
|
+
EXTENSION_EVENT = "ExtensionEvent",
|
|
170
|
+
KEEP_ALIVE = "keepalive",
|
|
171
|
+
KEEP_ALIVE_RESPONSE = "keepaliveResponse",
|
|
172
|
+
LOGIN_STATUS = "loginStatus",
|
|
173
|
+
LOGIN_SUCCESS = "loginSuccess",
|
|
174
|
+
QUEUE_EVENT = "QueueEvent",
|
|
175
|
+
ONLINE_STATUS_EVENT = "onlineStatusEvent",
|
|
176
|
+
DIALER_EVENT = "DialerEvent"
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* All events that can be received from the server.
|
|
181
|
+
*/
|
|
182
|
+
declare enum EventsEnum_2 {
|
|
159
183
|
ALL_DIALER_STATUS = 'AllDialersStatus',
|
|
160
184
|
ALL_EXTENSION_STATUS = 'AllExtensionsStatus',
|
|
161
185
|
ALL_USERS_STATUS = 'AllUsersStatus',
|
|
@@ -177,25 +201,6 @@ declare enum EventsEnum {
|
|
|
177
201
|
DIALER_EVENT = 'DialerEvent',
|
|
178
202
|
}
|
|
179
203
|
|
|
180
|
-
/**
|
|
181
|
-
* All events that can be received from the server.
|
|
182
|
-
*/
|
|
183
|
-
declare enum EventsEnum_2 {
|
|
184
|
-
ALL_DIALER_STATUS = "AllDialersStatus",
|
|
185
|
-
ALL_EXTENSION_STATUS = "AllExtensionsStatus",
|
|
186
|
-
ALL_USERS_STATUS = "AllUsersStatus",
|
|
187
|
-
CONNECT = "connect",
|
|
188
|
-
DISCONNECT = "disconnect",
|
|
189
|
-
EXTENSION_EVENT = "ExtensionEvent",
|
|
190
|
-
KEEP_ALIVE = "keepalive",
|
|
191
|
-
KEEP_ALIVE_RESPONSE = "keepaliveResponse",
|
|
192
|
-
LOGIN_STATUS = "loginStatus",
|
|
193
|
-
LOGIN_SUCCESS = "loginSuccess",
|
|
194
|
-
QUEUE_EVENT = "QueueEvent",
|
|
195
|
-
ONLINE_STATUS_EVENT = "onlineStatusEvent",
|
|
196
|
-
DIALER_EVENT = "DialerEvent"
|
|
197
|
-
}
|
|
198
|
-
|
|
199
204
|
/**
|
|
200
205
|
* This is a generic type for callback functions used in event handling.
|
|
201
206
|
* It takes a generic event name and defines a callback function that receives wrapped socket event data for that specific event.
|
|
@@ -268,7 +273,7 @@ declare interface EventsSdkOptions {
|
|
|
268
273
|
username: string;
|
|
269
274
|
}
|
|
270
275
|
|
|
271
|
-
declare type EventTypeData<T extends
|
|
276
|
+
declare type EventTypeData<T extends EventsEnum_2> = EventDataMap[T]
|
|
272
277
|
|
|
273
278
|
/**
|
|
274
279
|
* Represents the set of all possible event type names as keys from the EventDataMap.
|
|
@@ -505,7 +510,7 @@ declare class SocketIoClass {
|
|
|
505
510
|
private onDisconnect;
|
|
506
511
|
}
|
|
507
512
|
|
|
508
|
-
declare type SocketTyped = Socket<EventCallbackRegistry, Record<
|
|
513
|
+
declare type SocketTyped = Socket<EventCallbackRegistry, Record<EventsEnum, any>>
|
|
509
514
|
|
|
510
515
|
declare interface Summery {
|
|
511
516
|
representative: string
|
|
@@ -520,7 +525,7 @@ declare interface User {
|
|
|
520
525
|
|
|
521
526
|
}
|
|
522
527
|
|
|
523
|
-
declare type WrappedSocketEvent<T extends
|
|
528
|
+
declare type WrappedSocketEvent<T extends EventsEnum_2> = {
|
|
524
529
|
name: T
|
|
525
530
|
data: EventDataMap[T]
|
|
526
531
|
}
|