@voicenter-team/events-sdk 0.0.113 → 0.0.114
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/README.md +337 -337
- package/dist/voicenter-events-sdk.cjs.js.map +1 -1
- package/dist/voicenter-events-sdk.d.ts +119 -2
- package/dist/voicenter-events-sdk.es.js +21 -21
- package/dist/voicenter-events-sdk.es.js.map +1 -1
- package/dist/voicenter-events-sdk.iife.js.map +1 -1
- package/dist/voicenter-events-sdk.umd.js +6 -6
- package/dist/voicenter-events-sdk.umd.js.map +1 -1
- package/package.json +65 -64
|
@@ -78,6 +78,26 @@ export declare type AllUsersStatusEvent = {
|
|
|
78
78
|
|
|
79
79
|
export declare type AllUsersStatusEventSDK = EventTypeData<EventsEnum.ALL_USERS_STATUS>
|
|
80
80
|
|
|
81
|
+
export declare type AllVoicebotsStatus = {
|
|
82
|
+
/**
|
|
83
|
+
* 0 - Connection was establishing successfully.
|
|
84
|
+
*/
|
|
85
|
+
errorCode?: number;
|
|
86
|
+
/**
|
|
87
|
+
* “Ok” - Connection was establishing successfully.
|
|
88
|
+
*/
|
|
89
|
+
errorDesc?: string;
|
|
90
|
+
voicebots: Array<Voicebot>;
|
|
91
|
+
/**
|
|
92
|
+
* Server time at the moment of the event
|
|
93
|
+
*/
|
|
94
|
+
servertime: number;
|
|
95
|
+
/**
|
|
96
|
+
* Difference in time between server and client
|
|
97
|
+
*/
|
|
98
|
+
servertimeoffset: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
81
101
|
declare class AuthClass {
|
|
82
102
|
private readonly eventsSdkClass;
|
|
83
103
|
constructor(eventsSdkClass: EventsSdkClass);
|
|
@@ -280,6 +300,7 @@ export declare interface EventDataMap {
|
|
|
280
300
|
[EventsEnum.ALL_EXTENSION_STATUS]: AllExtensionStatusEvent
|
|
281
301
|
[EventsEnum.ALL_DIALER_STATUS]: AllDialersStatusEvent
|
|
282
302
|
[EventsEnum.ALL_USERS_STATUS]: AllUsersStatusEvent
|
|
303
|
+
[EventsEnum.ALL_VOICEBOTS_STATUS]: AllVoicebotsStatus
|
|
283
304
|
[EventsEnum.QUEUE_EVENT]: QueueEvent
|
|
284
305
|
[EventsEnum.EXTENSION_EVENT]: ExtensionEvent
|
|
285
306
|
[EventsEnum.DIALER_EVENT]: DialerEvent
|
|
@@ -288,6 +309,11 @@ export declare interface EventDataMap {
|
|
|
288
309
|
[EventsEnum.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent
|
|
289
310
|
[EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent
|
|
290
311
|
[EventsEnum.EXTENSIONS_UPDATED]: ExtensionsUpdated
|
|
312
|
+
[EventsEnum.VOICEBOT_SUBSCRIBED_TO_CALL]: SubscribedToVoicebotCall
|
|
313
|
+
[EventsEnum.VOICEBOT_SUBSCRIBE_TO_CALL_FAILED]: SubscribeToVoicebotCallFailed
|
|
314
|
+
[EventsEnum.VOICEBOT_INITIAL_CALL_HISTORY]: InitialVoicebotCallHistory
|
|
315
|
+
[EventsEnum.VOICEBOT_UNSUBSCRIBED_FROM_CALL]: UnsubscribedFromVoicebotCall
|
|
316
|
+
[EventsEnum.VOICEBOT_EVENT]: VoicebotEvent
|
|
291
317
|
}
|
|
292
318
|
|
|
293
319
|
/**
|
|
@@ -328,6 +354,12 @@ export declare enum EventsEnum {
|
|
|
328
354
|
ONLINE_STATUS_EVENT = 'onlineStatusEvent',
|
|
329
355
|
DIALER_EVENT = 'DialerEvent',
|
|
330
356
|
EXTENSIONS_UPDATED = 'ExtensionsUpdated',
|
|
357
|
+
ALL_VOICEBOTS_STATUS = 'AllVoicebotsStatus',
|
|
358
|
+
VOICEBOT_SUBSCRIBE_TO_CALL_FAILED = 'subscribeToCallFailed',
|
|
359
|
+
VOICEBOT_SUBSCRIBED_TO_CALL = 'subscribedToCall',
|
|
360
|
+
VOICEBOT_INITIAL_CALL_HISTORY = 'initialCallHistory',
|
|
361
|
+
VOICEBOT_UNSUBSCRIBED_FROM_CALL = 'unsubscribedFromCall',
|
|
362
|
+
VOICEBOT_EVENT = 'VoicebotEvent',
|
|
331
363
|
}
|
|
332
364
|
|
|
333
365
|
/**
|
|
@@ -576,6 +608,10 @@ export declare type ExtensionCall = {
|
|
|
576
608
|
*/
|
|
577
609
|
callername: string;
|
|
578
610
|
callstatus: CallStatusEnum;
|
|
611
|
+
/**
|
|
612
|
+
* cam id
|
|
613
|
+
*/
|
|
614
|
+
campaignID?: string;
|
|
579
615
|
customdata: CustomData;
|
|
580
616
|
/**
|
|
581
617
|
* Is internal
|
|
@@ -760,6 +796,18 @@ export declare interface ExternalLoginResponse<T> {
|
|
|
760
796
|
*/
|
|
761
797
|
export declare type GenericEventWrapper = EventWrappedSocketDataMap[EventTypeNames]
|
|
762
798
|
|
|
799
|
+
export declare type InitialVoicebotCallHistory = {
|
|
800
|
+
history: Array<any>;
|
|
801
|
+
/**
|
|
802
|
+
* Voicebot id
|
|
803
|
+
*/
|
|
804
|
+
voicebotID: number;
|
|
805
|
+
/**
|
|
806
|
+
* Ivr unique id
|
|
807
|
+
*/
|
|
808
|
+
IvrUniqueID: string;
|
|
809
|
+
};
|
|
810
|
+
|
|
763
811
|
export declare type KeepAliveResponseEvent = {
|
|
764
812
|
/**
|
|
765
813
|
* Is ok
|
|
@@ -1092,7 +1140,9 @@ export declare type ServerEmitEventCallbackRegistry = {
|
|
|
1092
1140
|
*/
|
|
1093
1141
|
export declare interface ServerEmitEventDataMap {
|
|
1094
1142
|
[ServerListenerEventsEnum.UPDATE_MONITORED_EXTENSIONS]: UpdateMonitoredExtensionsPayload
|
|
1095
|
-
[ServerListenerEventsEnum.KEEP_ALIVE]: string
|
|
1143
|
+
[ServerListenerEventsEnum.KEEP_ALIVE]: string,
|
|
1144
|
+
[ServerListenerEventsEnum.SUBSCRIBE_VOICEBOT_CALL_UPDATES]: SubscriptionVoicebotCallUpdatesPayload,
|
|
1145
|
+
[ServerListenerEventsEnum.UNSUBSCRIBE_VOICEBOT_CALL_UPDATES]: SubscriptionVoicebotCallUpdatesPayload
|
|
1096
1146
|
}
|
|
1097
1147
|
|
|
1098
1148
|
/**
|
|
@@ -1103,7 +1153,9 @@ export declare type ServerEmitEventTypeNames = keyof ServerEmitEventDataMap
|
|
|
1103
1153
|
|
|
1104
1154
|
export declare enum ServerListenerEventsEnum {
|
|
1105
1155
|
UPDATE_MONITORED_EXTENSIONS = "updateMonitoredExtensions",
|
|
1106
|
-
KEEP_ALIVE = "keepalive"
|
|
1156
|
+
KEEP_ALIVE = "keepalive",
|
|
1157
|
+
SUBSCRIBE_VOICEBOT_CALL_UPDATES = "subscribeVoicebotCallUpdates",
|
|
1158
|
+
UNSUBSCRIBE_VOICEBOT_CALL_UPDATES = "unsubscribeVoicebotCallUpdates"
|
|
1107
1159
|
}
|
|
1108
1160
|
|
|
1109
1161
|
export declare enum ServerParameter {
|
|
@@ -1209,6 +1261,12 @@ declare class SocketIoClass {
|
|
|
1209
1261
|
private onQueueEvent;
|
|
1210
1262
|
private onExtensionEvent;
|
|
1211
1263
|
private onDialerEvent;
|
|
1264
|
+
private onVoicebotEvent;
|
|
1265
|
+
private onAllVoicebotsStatus;
|
|
1266
|
+
private onVoicebotSubscribedToCall;
|
|
1267
|
+
private onVoicebotSubscribeToCallFailed;
|
|
1268
|
+
private onVoicebotInitialCallHistory;
|
|
1269
|
+
private onVoicebotUnsubscribedFromCall;
|
|
1212
1270
|
private onLoginStatusEvent;
|
|
1213
1271
|
private onAllExtensionStatus;
|
|
1214
1272
|
private onAllDialerStatus;
|
|
@@ -1241,6 +1299,37 @@ declare class SocketIoClass {
|
|
|
1241
1299
|
|
|
1242
1300
|
export declare type SocketTyped = Socket_2<EventCallbackRegistry, ServerEmitEventCallbackRegistry>
|
|
1243
1301
|
|
|
1302
|
+
export declare type SubscribedToVoicebotCall = {
|
|
1303
|
+
/**
|
|
1304
|
+
* subscribe success?
|
|
1305
|
+
*/
|
|
1306
|
+
success: boolean;
|
|
1307
|
+
/**
|
|
1308
|
+
* voicebot id
|
|
1309
|
+
*/
|
|
1310
|
+
voicebotID: number;
|
|
1311
|
+
/**
|
|
1312
|
+
* ivr id
|
|
1313
|
+
*/
|
|
1314
|
+
IvrUniqueID: string;
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
export declare type SubscribeToVoicebotCallFailed = {
|
|
1318
|
+
/**
|
|
1319
|
+
* error
|
|
1320
|
+
*/
|
|
1321
|
+
error: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* success
|
|
1324
|
+
*/
|
|
1325
|
+
success: boolean;
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
export declare interface SubscriptionVoicebotCallUpdatesPayload {
|
|
1329
|
+
voicebotID: number,
|
|
1330
|
+
IvrUniqueID: string
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1244
1333
|
export declare type Summery = {
|
|
1245
1334
|
/**
|
|
1246
1335
|
* Representative
|
|
@@ -1254,6 +1343,9 @@ export declare type TestEventListener = (event: { test: string }) => void
|
|
|
1254
1343
|
|
|
1255
1344
|
declare type TypedSocketIo = (...args: Parameters<typeof io>) => SocketTyped;
|
|
1256
1345
|
|
|
1346
|
+
export declare type UnsubscribedFromVoicebotCall = {
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1257
1349
|
export declare interface UpdateMonitoredExtensionsPayload {
|
|
1258
1350
|
extensionsString: string
|
|
1259
1351
|
}
|
|
@@ -1277,6 +1369,31 @@ export declare type User = {
|
|
|
1277
1369
|
|
|
1278
1370
|
export declare type UserSDK = User
|
|
1279
1371
|
|
|
1372
|
+
export declare type Voicebot = {
|
|
1373
|
+
Calls: Array<any>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Acc id
|
|
1376
|
+
*/
|
|
1377
|
+
AccountID: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* Voicebot id
|
|
1380
|
+
*/
|
|
1381
|
+
VoicebotID: string;
|
|
1382
|
+
/**
|
|
1383
|
+
* Voicebot name
|
|
1384
|
+
*/
|
|
1385
|
+
VoicebotName: number;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
export declare type VoicebotCall = {
|
|
1389
|
+
};
|
|
1390
|
+
|
|
1391
|
+
export declare type VoicebotCallHistory = {
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
export declare type VoicebotEvent = {
|
|
1395
|
+
};
|
|
1396
|
+
|
|
1280
1397
|
/**
|
|
1281
1398
|
* The structure of received socket events.
|
|
1282
1399
|
*/
|
|
@@ -2,7 +2,7 @@ var Ie = Object.defineProperty;
|
|
|
2
2
|
var Re = (a, t, e) => t in a ? Ie(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var q = (a, t, e) => (Re(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import Be from "ws";
|
|
5
|
-
import Ue, { LevelEnum as z,
|
|
5
|
+
import Ue, { LevelEnum as z, LogTypeEnum as Y, ActionNameEnum as Q } from "@voicenter-team/socketio-storage-logger";
|
|
6
6
|
function xe(a) {
|
|
7
7
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
8
8
|
}
|
|
@@ -3048,98 +3048,98 @@ class st {
|
|
|
3048
3048
|
this.log({
|
|
3049
3049
|
Message: `Sdk connected to the socket server ${this.eventsSdkClass.server && this.eventsSdkClass.server.Domain ? this.eventsSdkClass.server.Domain : this.eventsSdkClass.URL}`,
|
|
3050
3050
|
Body: JSON.stringify(t, this.eventsSdkClass.getCircularReplacer()),
|
|
3051
|
-
ActionName:
|
|
3051
|
+
ActionName: Q.WSCONNECT,
|
|
3052
3052
|
isShowClient: !1,
|
|
3053
3053
|
Status: "Connection established",
|
|
3054
3054
|
StatusCode: 200,
|
|
3055
3055
|
Level: z.INFO,
|
|
3056
|
-
LogType:
|
|
3056
|
+
LogType: Y.INFO
|
|
3057
3057
|
});
|
|
3058
3058
|
}
|
|
3059
3059
|
sdkDisconnect(t) {
|
|
3060
3060
|
this.log({
|
|
3061
3061
|
Message: `Sdk disconnected from the socket server ${this.eventsSdkClass.server && this.eventsSdkClass.server.Domain ? this.eventsSdkClass.server.Domain : this.eventsSdkClass.URL} (${t})`,
|
|
3062
|
-
ActionName:
|
|
3062
|
+
ActionName: Q.WSCONNECT,
|
|
3063
3063
|
isShowClient: !1,
|
|
3064
3064
|
Status: "Connection closed",
|
|
3065
3065
|
StatusCode: 200,
|
|
3066
3066
|
Level: z.INFO,
|
|
3067
|
-
LogType:
|
|
3067
|
+
LogType: Y.INFO
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
sdkAttemptToConnect(t) {
|
|
3071
3071
|
this.log({
|
|
3072
3072
|
Message: `${this.eventsSdkClass.options.loggerConfig.system} is trying to connect to WS server ${t}`,
|
|
3073
|
-
ActionName:
|
|
3073
|
+
ActionName: Q.WSCONNECT,
|
|
3074
3074
|
isShowClient: !1,
|
|
3075
3075
|
Status: "Switching Protocols",
|
|
3076
3076
|
StatusCode: 101,
|
|
3077
3077
|
Level: z.INFO,
|
|
3078
|
-
LogType:
|
|
3078
|
+
LogType: Y.INFO
|
|
3079
3079
|
});
|
|
3080
3080
|
}
|
|
3081
3081
|
sdkAttemptToConnectError(t) {
|
|
3082
3082
|
this.log({
|
|
3083
3083
|
Message: `${t}`,
|
|
3084
|
-
ActionName:
|
|
3084
|
+
ActionName: Q.WSCONNECT,
|
|
3085
3085
|
isShowClient: !1,
|
|
3086
3086
|
Status: "Connection error",
|
|
3087
3087
|
StatusCode: 500,
|
|
3088
3088
|
Level: z.ERROR,
|
|
3089
|
-
LogType:
|
|
3089
|
+
LogType: Y.ERROR
|
|
3090
3090
|
});
|
|
3091
3091
|
}
|
|
3092
3092
|
loginError(t, e, r, o) {
|
|
3093
3093
|
this.log({
|
|
3094
3094
|
Message: `External login request error with the login type ${t} ${t === Z.TOKEN ? r : o}`,
|
|
3095
|
-
ActionName:
|
|
3095
|
+
ActionName: Q.WSCONNECT,
|
|
3096
3096
|
isShowClient: !1,
|
|
3097
3097
|
Status: "External login error",
|
|
3098
3098
|
StatusCode: e || 400,
|
|
3099
3099
|
Level: z.ERROR,
|
|
3100
|
-
LogType:
|
|
3100
|
+
LogType: Y.ERROR
|
|
3101
3101
|
});
|
|
3102
3102
|
}
|
|
3103
3103
|
getSettingsError(t, e) {
|
|
3104
3104
|
this.log({
|
|
3105
3105
|
Message: `Get settings error with token ${t}, error: ${e}`,
|
|
3106
|
-
ActionName:
|
|
3106
|
+
ActionName: Q.WSCONNECT,
|
|
3107
3107
|
isShowClient: !1,
|
|
3108
3108
|
Status: "Get settings error",
|
|
3109
3109
|
StatusCode: 400,
|
|
3110
3110
|
Level: z.ERROR,
|
|
3111
|
-
LogType:
|
|
3111
|
+
LogType: Y.ERROR
|
|
3112
3112
|
});
|
|
3113
3113
|
}
|
|
3114
3114
|
refreshTokenError(t, e, r) {
|
|
3115
3115
|
this.log({
|
|
3116
3116
|
Message: `Refresh token error with old refresh token ${t}, url: ${e}, error: ${r}`,
|
|
3117
|
-
ActionName:
|
|
3117
|
+
ActionName: Q.WSCONNECT,
|
|
3118
3118
|
isShowClient: !1,
|
|
3119
3119
|
Status: "Get settings error",
|
|
3120
3120
|
StatusCode: 400,
|
|
3121
3121
|
Level: z.ERROR,
|
|
3122
|
-
LogType:
|
|
3122
|
+
LogType: Y.ERROR
|
|
3123
3123
|
});
|
|
3124
3124
|
}
|
|
3125
3125
|
keepAliveEmit() {
|
|
3126
3126
|
this.log({
|
|
3127
3127
|
Message: `Keep alive event emitted with this token: ${this.eventsSdkClass.authClass.token}`,
|
|
3128
|
-
ActionName:
|
|
3128
|
+
ActionName: Q.WSCONNECT,
|
|
3129
3129
|
isShowClient: !1,
|
|
3130
3130
|
Level: z.INFO,
|
|
3131
|
-
LogType:
|
|
3131
|
+
LogType: Y.INFO
|
|
3132
3132
|
});
|
|
3133
3133
|
}
|
|
3134
3134
|
keepAliveResponse(t) {
|
|
3135
3135
|
this.log({
|
|
3136
3136
|
Message: `Keep alive response: ${JSON.stringify(t)}`,
|
|
3137
|
-
ActionName:
|
|
3137
|
+
ActionName: Q.WSCONNECT,
|
|
3138
3138
|
isShowClient: !1,
|
|
3139
3139
|
Status: "Successful",
|
|
3140
3140
|
StatusCode: 200,
|
|
3141
3141
|
Level: z.INFO,
|
|
3142
|
-
LogType:
|
|
3142
|
+
LogType: Y.INFO
|
|
3143
3143
|
});
|
|
3144
3144
|
}
|
|
3145
3145
|
eventLog(t, e) {
|
|
@@ -3156,11 +3156,11 @@ class st {
|
|
|
3156
3156
|
...this.getStaticData(),
|
|
3157
3157
|
...e
|
|
3158
3158
|
},
|
|
3159
|
-
ActionName:
|
|
3159
|
+
ActionName: Q.WSCONNECT,
|
|
3160
3160
|
isShowClient: !1,
|
|
3161
3161
|
Status: "Successful",
|
|
3162
3162
|
Level: z.DEBUG,
|
|
3163
|
-
LogType:
|
|
3163
|
+
LogType: Y.INFO
|
|
3164
3164
|
});
|
|
3165
3165
|
}
|
|
3166
3166
|
getStaticData() {
|