@voicenter-team/events-sdk 0.0.25 → 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 +12 -289
- package/dist/voicenter-events-sdk.es.js +3055 -3062
- 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/docs/package-lock.json +7 -0
- package/docs/package.json +2 -1
- package/docs/src/.vuepress/components/Demo.vue +8 -2
- package/package.json +2 -1
- package/src/classes/event-emitter/event-emitter.class.ts +3 -2
- package/src/classes/events-sdk/events-sdk.class.ts +1 -1
- package/src/classes/logger/logger.class.ts +1 -1
- package/src/classes/socket-io/socket-io.class.ts +4 -2
- package/src/index.ts +0 -3
- package/src/types/events.d.ts +14 -97
- package/src/types/socket.d.ts +1 -1
- package/vite.config.ts.timestamp-1709657877833-8e67641281433.mjs +49 -0
- package/src/enum/events.enum.ts +0 -99
- package/src/types/events.common.d.ts +0 -110
package/docs/package-lock.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"dotenv": "^16.3.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
+
"@voicenter-team/real-time-events-types": "^0.0.6",
|
|
15
16
|
"@vuepress/plugin-register-components": "^2.0.0-beta.62",
|
|
16
17
|
"typedoc": "^0.24.8",
|
|
17
18
|
"typedoc-plugin-markdown": "^3.15.3",
|
|
@@ -702,6 +703,12 @@
|
|
|
702
703
|
"vue": "^3.2.25"
|
|
703
704
|
}
|
|
704
705
|
},
|
|
706
|
+
"node_modules/@voicenter-team/real-time-events-types": {
|
|
707
|
+
"version": "0.0.6",
|
|
708
|
+
"resolved": "https://registry.npmjs.org/@voicenter-team/real-time-events-types/-/real-time-events-types-0.0.6.tgz",
|
|
709
|
+
"integrity": "sha512-BLPnYwMVraWMUPH8HXEL/xwUT3mLBDNygb5/SvKdWHvmynHngRvzNjw4cb2DJa0tgcOGFIIXnVKI5W4C7PrC5w==",
|
|
710
|
+
"dev": true
|
|
711
|
+
},
|
|
705
712
|
"node_modules/@vue/compiler-core": {
|
|
706
713
|
"version": "3.3.4",
|
|
707
714
|
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz",
|
package/docs/package.json
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"typedoc": "^0.24.8",
|
|
18
18
|
"typedoc-plugin-markdown": "^3.15.3",
|
|
19
19
|
"vuepress": "^2.0.0-beta.62",
|
|
20
|
-
"vuepress-plugin-typedoc": "^0.12.1"
|
|
20
|
+
"vuepress-plugin-typedoc": "^0.12.1",
|
|
21
|
+
"@voicenter-team/real-time-events-types": "^0.0.6"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"dotenv": "^16.3.1"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<script lang="ts" setup>
|
|
43
43
|
import {reactive, ref} from 'vue'
|
|
44
44
|
import EventsSdkClass from '@/index'
|
|
45
|
-
import {EventsEnum} from '
|
|
45
|
+
import {EventsEnum} from '@voicenter-team/real-time-events-types'
|
|
46
46
|
import {EventTypeData} from '@/types/events'
|
|
47
47
|
import {LoginType} from "@/enum/auth.enum";
|
|
48
48
|
|
|
@@ -54,7 +54,7 @@ const token = ref('')
|
|
|
54
54
|
const loading = ref(false)
|
|
55
55
|
const loggedId = ref(false)
|
|
56
56
|
const events = reactive<{ [K in EventsEnum]?: Array<EventTypeData<K>> }>({})
|
|
57
|
-
|
|
57
|
+
let eventsdk
|
|
58
58
|
/* Methods */
|
|
59
59
|
async function login() {
|
|
60
60
|
if (!token.value) {
|
|
@@ -76,6 +76,8 @@ async function login() {
|
|
|
76
76
|
|
|
77
77
|
await sdk.init()
|
|
78
78
|
|
|
79
|
+
eventsdk = sdk
|
|
80
|
+
|
|
79
81
|
sdk.on(
|
|
80
82
|
EventsEnum.ALL_DIALER_STATUS,
|
|
81
83
|
({ data }) => {
|
|
@@ -202,6 +204,9 @@ async function login() {
|
|
|
202
204
|
case EventsEnum.LOGIN_STATUS:
|
|
203
205
|
console.log(`FROM ALL ${EventsEnum.LOGIN_STATUS}`, data)
|
|
204
206
|
break
|
|
207
|
+
case EventsEnum.EXTENSIONS_UPDATED:
|
|
208
|
+
console.log(`FROM ALL ${EventsEnum.EXTENSIONS_UPDATED}`, data)
|
|
209
|
+
break
|
|
205
210
|
case EventsEnum.ONLINE_STATUS_EVENT:
|
|
206
211
|
console.log(`FROM ALL ${EventsEnum.ONLINE_STATUS_EVENT}`, data)
|
|
207
212
|
break
|
|
@@ -214,6 +219,7 @@ async function login() {
|
|
|
214
219
|
|
|
215
220
|
setTimeout(
|
|
216
221
|
() => {
|
|
222
|
+
eventsdk.emit('updateMonitoredExtensions', {extensionsString: '104082, 105703, 113921, 128288'})
|
|
217
223
|
if (!loggedId.value) {
|
|
218
224
|
loading.value = false
|
|
219
225
|
alert('Login failed')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voicenter-team/events-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/voicenter-events-sdk.cjs.js",
|
|
6
6
|
"jsdelivr": "dist/voicenter-events-sdk.umd.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@typescript-eslint/eslint-plugin": "6.20.0",
|
|
35
35
|
"@typescript-eslint/parser": "6.20.0",
|
|
36
36
|
"@voicenter-team/eslint-config-ts": "^1.0.22",
|
|
37
|
+
"@voicenter-team/real-time-events-types": "^0.0.7",
|
|
37
38
|
"dotenv": "16.4.1",
|
|
38
39
|
"eslint": "8.56.0",
|
|
39
40
|
"eslint-plugin-jest": "27.6.3",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
EventTypeNames,
|
|
6
6
|
GenericEventWrapper
|
|
7
7
|
} from '@/types/events'
|
|
8
|
-
import { EventsEnum } from '
|
|
8
|
+
import { EventsEnum } from '@voicenter-team/real-time-events-types'
|
|
9
9
|
import EventsSdkClass from '@/classes/events-sdk/events-sdk.class'
|
|
10
10
|
|
|
11
11
|
export class EventEmitterClass{
|
|
@@ -19,7 +19,8 @@ export class EventEmitterClass{
|
|
|
19
19
|
[EventsEnum.LOGIN_SUCCESS]: [],
|
|
20
20
|
[EventsEnum.LOGIN_STATUS]: [],
|
|
21
21
|
[EventsEnum.KEEP_ALIVE_RESPONSE]: [],
|
|
22
|
-
[EventsEnum.ONLINE_STATUS_EVENT]: []
|
|
22
|
+
[EventsEnum.ONLINE_STATUS_EVENT]: [],
|
|
23
|
+
[EventsEnum.EXTENSIONS_UPDATED]: []
|
|
23
24
|
}
|
|
24
25
|
private allListeners: Array<(data: GenericEventWrapper) => void> = []
|
|
25
26
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
EventTypeNames,
|
|
10
10
|
GenericEventWrapper,
|
|
11
11
|
} from '@/types/events'
|
|
12
|
-
import { EventsEnum } from '
|
|
12
|
+
import { EventsEnum } from '@voicenter-team/real-time-events-types'
|
|
13
13
|
import { LoggerClass } from '@/classes/logger/logger.class'
|
|
14
14
|
import { EventEmitterClass } from '@/classes/event-emitter/event-emitter.class'
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Socket } from 'socket.io-client'
|
|
2
2
|
import EventsSdkClass from '@/classes/events-sdk/events-sdk.class'
|
|
3
3
|
import { LoggerTypeEnum } from '@/enum/logger.enum'
|
|
4
|
-
import { EventsEnum } from '
|
|
4
|
+
import { EventsEnum } from '@voicenter-team/real-time-events-types'
|
|
5
5
|
import StorageLogger from '@voicenter-team/socketio-storage-logger'
|
|
6
6
|
|
|
7
7
|
export class LoggerClass{
|
|
@@ -3,8 +3,7 @@ import EventsSdkClass from '@/classes/events-sdk/events-sdk.class'
|
|
|
3
3
|
import sockets, { TypedSocketIo } from '@/classes/socket-io/versions'
|
|
4
4
|
import { SocketTyped } from '@/types/socket'
|
|
5
5
|
import { ServerParameter } from '@/classes/events-sdk/events-sdk.types'
|
|
6
|
-
import { EventsEnum } from '
|
|
7
|
-
import { KeepAliveResponseEvent } from '@/types/events'
|
|
6
|
+
import { EventsEnum, KeepAliveResponseEvent } from '@voicenter-team/real-time-events-types'
|
|
8
7
|
import { StorageClass } from '@/classes/storage/storage.class'
|
|
9
8
|
import { LoggerTypeEnum } from '@/enum/logger.enum'
|
|
10
9
|
// import { LoggerTypeEnum } from '@/enum/logger.enum'
|
|
@@ -99,6 +98,9 @@ export class SocketIoClass{
|
|
|
99
98
|
.on(EventsEnum.CONNECT, () => this.onConnect())
|
|
100
99
|
.on(EventsEnum.DISCONNECT, (data) => this.onDisconnect(data))
|
|
101
100
|
.on(EventsEnum.CONNECT_ERROR_EVENT, (data) => this.onConnectError(data))
|
|
101
|
+
.on(EventsEnum.EXTENSIONS_UPDATED, (data) => {
|
|
102
|
+
this.eventsSdkClass.eventEmitterClass.emit(EventsEnum.EXTENSIONS_UPDATED, data)
|
|
103
|
+
})
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
package/src/index.ts
CHANGED
|
@@ -2,13 +2,10 @@ import EventsSdkClass from '@/classes/events-sdk/events-sdk.class'
|
|
|
2
2
|
|
|
3
3
|
// Export all types and enums
|
|
4
4
|
export type * from './types/auth'
|
|
5
|
-
export type * from './types/events.common'
|
|
6
5
|
export type * from './types/events'
|
|
7
6
|
export type * from './types/listeners'
|
|
8
7
|
export type * from './types/public-api'
|
|
9
8
|
export type * from './types/socket'
|
|
10
9
|
export type * from './classes/events-sdk/events-sdk.types'
|
|
11
10
|
|
|
12
|
-
export * from './enum/events.enum'
|
|
13
|
-
|
|
14
11
|
export default EventsSdkClass
|
package/src/types/events.d.ts
CHANGED
|
@@ -1,100 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Difference in time between server and client
|
|
15
|
-
serverTimeOffset: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Inherits properties from CommonEventProperties
|
|
19
|
-
type LoginSuccessEvent = CommonEventProperties
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Data structure for login status event.
|
|
23
|
-
*/
|
|
24
|
-
export interface LoginStatusEvent extends CommonEventProperties {
|
|
25
|
-
// Array of Queue objects
|
|
26
|
-
queues: Queue[]
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Data structure for all extension status event.
|
|
31
|
-
*/
|
|
32
|
-
export interface AllExtensionStatusEvent extends CommonEventProperties {
|
|
33
|
-
// Array of Extension objects
|
|
34
|
-
extensions: Extension[]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Data structure for all dialers status event.
|
|
39
|
-
*/
|
|
40
|
-
export interface AllDialersStatusEvent extends CommonEventProperties {
|
|
41
|
-
// Array of Dialer objects
|
|
42
|
-
dialers: Dialer[]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Data structure for all users status event.
|
|
47
|
-
*/
|
|
48
|
-
export interface AllUsersStatusEvent extends CommonEventProperties {
|
|
49
|
-
// Array of User objects
|
|
50
|
-
users: User[]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Data structure for queue event.
|
|
55
|
-
*/
|
|
56
|
-
export interface QueueEvent extends CommonEventProperties {
|
|
57
|
-
eventName: EventNameEnum.QUEUE,
|
|
58
|
-
reason: QueueEventReasonEnum,
|
|
59
|
-
telephonyServerTime: number,
|
|
60
|
-
ivrUniqueId: string,
|
|
61
|
-
data: Queue
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Data structure for extension event.
|
|
66
|
-
*/
|
|
67
|
-
export interface ExtensionEvent extends CommonEventProperties {
|
|
68
|
-
data: Extension
|
|
69
|
-
eventName: EventNameEnum.EXTENSION
|
|
70
|
-
reason: ExtensionEventReasonEnum
|
|
71
|
-
telephonyServerTime?: number
|
|
72
|
-
callerID?: string
|
|
73
|
-
ivrUniqueId?: string
|
|
74
|
-
dialStatus?: string
|
|
75
|
-
cause?: ExtensionHangupCauseEnum
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Data structure for dialer event.
|
|
80
|
-
*/
|
|
81
|
-
export interface DialerEvent extends CommonEventProperties {
|
|
82
|
-
data: Dialer
|
|
83
|
-
eventName: EventNameEnum.DIALER
|
|
84
|
-
//reason: ExtensionEventReasonEnum // TODO: do research for dialer 'reason' prop
|
|
85
|
-
telephonyServerTime?: number
|
|
86
|
-
callerID?: string
|
|
87
|
-
ivrUniqueId?: string
|
|
88
|
-
dialStatus?: string
|
|
89
|
-
//cause?: ExtensionHangupCauseEnum // TODO: do research for dialer 'cause' prop
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Data structure for keep alive response event.
|
|
94
|
-
*/
|
|
95
|
-
export interface KeepAliveResponseEvent extends CommonEventProperties {
|
|
96
|
-
isOk: boolean
|
|
97
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
EventsEnum,
|
|
3
|
+
LoginSuccessEvent,
|
|
4
|
+
LoginStatusEvent,
|
|
5
|
+
AllExtensionStatusEvent,
|
|
6
|
+
AllDialersStatusEvent,
|
|
7
|
+
AllUsersStatusEvent,
|
|
8
|
+
QueueEvent,
|
|
9
|
+
ExtensionEvent,
|
|
10
|
+
KeepAliveResponseEvent,
|
|
11
|
+
DialerEvent,
|
|
12
|
+
ExtensionsUpdated
|
|
13
|
+
} from '@voicenter-team/real-time-events-types'
|
|
98
14
|
|
|
99
15
|
export interface OnlineStatusEvent {
|
|
100
16
|
isSocketConnected: boolean
|
|
@@ -115,6 +31,7 @@ export interface EventDataMap {
|
|
|
115
31
|
[EventsEnum.LOGIN_STATUS]: LoginStatusEvent
|
|
116
32
|
[EventsEnum.KEEP_ALIVE_RESPONSE]: KeepAliveResponseEvent
|
|
117
33
|
[EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent
|
|
34
|
+
[EventsEnum.EXTENSIONS_UPDATED]: ExtensionsUpdated
|
|
118
35
|
}
|
|
119
36
|
|
|
120
37
|
/**
|
package/src/types/socket.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Socket } from 'socket.io-client'
|
|
2
2
|
import { EventCallbackRegistry } from '@/types/events'
|
|
3
|
-
import { EventsEnum } from '
|
|
3
|
+
import { EventsEnum } from '@voicenter-team/real-time-events-types'
|
|
4
4
|
|
|
5
5
|
export type SocketTyped = Socket<EventCallbackRegistry, Record<EventsEnum, any>>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// vite.config.ts
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import { defineConfig, loadEnv } from "file:///home/dev/Voicenter/VoicenterEventsSDK/node_modules/vite/dist/node/index.js";
|
|
4
|
+
import dts from "file:///home/dev/Voicenter/VoicenterEventsSDK/node_modules/vite-plugin-dts/dist/index.mjs";
|
|
5
|
+
var __vite_injected_original_dirname = "/home/dev/Voicenter/VoicenterEventsSDK";
|
|
6
|
+
var vite_config_default = ({ mode }) => {
|
|
7
|
+
process.env = {
|
|
8
|
+
...process.env,
|
|
9
|
+
...loadEnv(mode, process.cwd(), "")
|
|
10
|
+
};
|
|
11
|
+
return defineConfig({
|
|
12
|
+
build: {
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
output: {
|
|
15
|
+
exports: "named"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
outDir: "dist",
|
|
19
|
+
sourcemap: true,
|
|
20
|
+
commonjsOptions: {
|
|
21
|
+
esmExternals: true
|
|
22
|
+
},
|
|
23
|
+
lib: {
|
|
24
|
+
entry: resolve(__vite_injected_original_dirname, "src/index.ts"),
|
|
25
|
+
formats: ["es", "cjs", "umd", "iife"],
|
|
26
|
+
name: "VoicenterEventsSDK",
|
|
27
|
+
fileName: (format) => {
|
|
28
|
+
return `voicenter-events-sdk.${format}.js`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
plugins: [
|
|
33
|
+
dts({
|
|
34
|
+
copyDtsFiles: true,
|
|
35
|
+
rollupTypes: true
|
|
36
|
+
})
|
|
37
|
+
],
|
|
38
|
+
resolve: {
|
|
39
|
+
alias: {
|
|
40
|
+
"@": resolve(__vite_injected_original_dirname, "./src"),
|
|
41
|
+
voicenterEventsSDK: resolve(__vite_injected_original_dirname, "./src")
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
vite_config_default as default
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9kZXYvVm9pY2VudGVyL1ZvaWNlbnRlckV2ZW50c1NES1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiL2hvbWUvZGV2L1ZvaWNlbnRlci9Wb2ljZW50ZXJFdmVudHNTREsvdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL2hvbWUvZGV2L1ZvaWNlbnRlci9Wb2ljZW50ZXJFdmVudHNTREsvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgeyByZXNvbHZlIH0gZnJvbSAncGF0aCdcbmltcG9ydCB7IGRlZmluZUNvbmZpZywgbG9hZEVudiwgQ29uZmlnRW52IH0gZnJvbSAndml0ZSdcbmltcG9ydCBkdHMgZnJvbSAndml0ZS1wbHVnaW4tZHRzJ1xuXG5leHBvcnQgZGVmYXVsdCAoeyBtb2RlIH06IENvbmZpZ0VudikgPT4ge1xuICAgIHByb2Nlc3MuZW52ID0ge1xuICAgICAgICAuLi5wcm9jZXNzLmVudixcbiAgICAgICAgLi4ubG9hZEVudihtb2RlLCBwcm9jZXNzLmN3ZCgpLCAnJylcbiAgICB9XG5cbiAgICByZXR1cm4gZGVmaW5lQ29uZmlnKHtcbiAgICAgICAgYnVpbGQ6IHtcbiAgICAgICAgICAgIHJvbGx1cE9wdGlvbnM6IHtcbiAgICAgICAgICAgICAgICBvdXRwdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgZXhwb3J0czogJ25hbWVkJ1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvdXREaXI6ICdkaXN0JyxcbiAgICAgICAgICAgIHNvdXJjZW1hcDogdHJ1ZSxcbiAgICAgICAgICAgIGNvbW1vbmpzT3B0aW9uczoge1xuICAgICAgICAgICAgICAgIGVzbUV4dGVybmFsczogdHJ1ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxpYjoge1xuICAgICAgICAgICAgICAgIGVudHJ5OiByZXNvbHZlKF9fZGlybmFtZSwgJ3NyYy9pbmRleC50cycpLFxuICAgICAgICAgICAgICAgIGZvcm1hdHM6IFsgJ2VzJywgJ2NqcycsICd1bWQnLCAnaWlmZScgXSxcbiAgICAgICAgICAgICAgICBuYW1lOiAnVm9pY2VudGVyRXZlbnRzU0RLJyxcbiAgICAgICAgICAgICAgICBmaWxlTmFtZTogKGZvcm1hdCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYHZvaWNlbnRlci1ldmVudHMtc2RrLiR7Zm9ybWF0fS5qc2BcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBwbHVnaW5zOiBbXG4gICAgICAgICAgICBkdHMoe1xuICAgICAgICAgICAgICAgIGNvcHlEdHNGaWxlczogdHJ1ZSxcbiAgICAgICAgICAgICAgICByb2xsdXBUeXBlczogdHJ1ZSxcbiAgICAgICAgICAgIH0pXG4gICAgICAgIF0sXG4gICAgICAgIHJlc29sdmU6IHtcbiAgICAgICAgICAgIGFsaWFzOiB7XG4gICAgICAgICAgICAgICAgJ0AnOiByZXNvbHZlKF9fZGlybmFtZSwgJy4vc3JjJyksXG4gICAgICAgICAgICAgICAgdm9pY2VudGVyRXZlbnRzU0RLOiByZXNvbHZlKF9fZGlybmFtZSwgJy4vc3JjJyksXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9KVxufVxuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUFvUyxTQUFTLGVBQWU7QUFDNVQsU0FBUyxjQUFjLGVBQTBCO0FBQ2pELE9BQU8sU0FBUztBQUZoQixJQUFNLG1DQUFtQztBQUl6QyxJQUFPLHNCQUFRLENBQUMsRUFBRSxLQUFLLE1BQWlCO0FBQ3BDLFVBQVEsTUFBTTtBQUFBLElBQ1YsR0FBRyxRQUFRO0FBQUEsSUFDWCxHQUFHLFFBQVEsTUFBTSxRQUFRLElBQUksR0FBRyxFQUFFO0FBQUEsRUFDdEM7QUFFQSxTQUFPLGFBQWE7QUFBQSxJQUNoQixPQUFPO0FBQUEsTUFDSCxlQUFlO0FBQUEsUUFDWCxRQUFRO0FBQUEsVUFDSixTQUFTO0FBQUEsUUFDYjtBQUFBLE1BQ0o7QUFBQSxNQUNBLFFBQVE7QUFBQSxNQUNSLFdBQVc7QUFBQSxNQUNYLGlCQUFpQjtBQUFBLFFBQ2IsY0FBYztBQUFBLE1BQ2xCO0FBQUEsTUFDQSxLQUFLO0FBQUEsUUFDRCxPQUFPLFFBQVEsa0NBQVcsY0FBYztBQUFBLFFBQ3hDLFNBQVMsQ0FBRSxNQUFNLE9BQU8sT0FBTyxNQUFPO0FBQUEsUUFDdEMsTUFBTTtBQUFBLFFBQ04sVUFBVSxDQUFDLFdBQVc7QUFDbEIsaUJBQU8sd0JBQXdCLE1BQU07QUFBQSxRQUN6QztBQUFBLE1BQ0o7QUFBQSxJQUNKO0FBQUEsSUFDQSxTQUFTO0FBQUEsTUFDTCxJQUFJO0FBQUEsUUFDQSxjQUFjO0FBQUEsUUFDZCxhQUFhO0FBQUEsTUFDakIsQ0FBQztBQUFBLElBQ0w7QUFBQSxJQUNBLFNBQVM7QUFBQSxNQUNMLE9BQU87QUFBQSxRQUNILEtBQUssUUFBUSxrQ0FBVyxPQUFPO0FBQUEsUUFDL0Isb0JBQW9CLFFBQVEsa0NBQVcsT0FBTztBQUFBLE1BQ2xEO0FBQUEsSUFDSjtBQUFBLEVBQ0osQ0FBQztBQUNMOyIsCiAgIm5hbWVzIjogW10KfQo=
|
package/src/enum/events.enum.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All events that can be received from the server.
|
|
3
|
-
*/
|
|
4
|
-
export enum EventsEnum {
|
|
5
|
-
ALL_DIALER_STATUS = 'AllDialersStatus',
|
|
6
|
-
ALL_EXTENSION_STATUS = 'AllExtensionsStatus',
|
|
7
|
-
ALL_USERS_STATUS = 'AllUsersStatus',
|
|
8
|
-
CONNECT = 'connect',
|
|
9
|
-
DISCONNECT = 'disconnect',
|
|
10
|
-
CONNECT_ERROR_EVENT = 'connect_error',
|
|
11
|
-
EXTENSION_EVENT = 'ExtensionEvent',
|
|
12
|
-
KEEP_ALIVE = 'keepalive',
|
|
13
|
-
KEEP_ALIVE_RESPONSE = 'keepaliveResponse',
|
|
14
|
-
// This type of event will be sent only in case of a successful connection.
|
|
15
|
-
// The event describes the list of monitored queues on this active connection.
|
|
16
|
-
// The list of monitored queues will only be sent if the login connection was made with account credentials or account token.
|
|
17
|
-
// If the login connection type is by user credentials, only the user’s extension assigned queues will return.
|
|
18
|
-
LOGIN_STATUS = 'loginStatus',
|
|
19
|
-
// This type of event will be sent in the initial login connection request in case of a successful connection only.
|
|
20
|
-
// In case of wrong username or password or token, you will receive a 401 (“Unauthorized”) or 500 (“Unexpected token”) http error.
|
|
21
|
-
LOGIN_SUCCESS = 'loginSuccess',
|
|
22
|
-
QUEUE_EVENT = 'QueueEvent',
|
|
23
|
-
ONLINE_STATUS_EVENT = 'onlineStatusEvent',
|
|
24
|
-
DIALER_EVENT = 'DialerEvent',
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* All the reasons for the extension event, e.g. a new call is ringing or dialing from an extension.
|
|
29
|
-
*/
|
|
30
|
-
export enum ExtensionEventReasonEnum {
|
|
31
|
-
// A new call is ringing or dialing from an extension.
|
|
32
|
-
NEW_CALL = 'NEWCALL',
|
|
33
|
-
// A call was answered at an extension.
|
|
34
|
-
ANSWER = 'ANSWER',
|
|
35
|
-
// A call was placed on hold.
|
|
36
|
-
HOLD = 'HOLD',
|
|
37
|
-
// A call is no longer on hold.
|
|
38
|
-
UNHOLD = 'UNHOLD',
|
|
39
|
-
// When a call was ended. It is not necessarily means that the call was answered.
|
|
40
|
-
HANGUP = 'HANGUP',
|
|
41
|
-
// When the extension online user updated his\her user status(Login, Break, Logout, etc.)
|
|
42
|
-
USER_STATUS_UPDATE = 'userStatusUpdate',
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export enum QueueEventReasonEnum {
|
|
46
|
-
ANSWER = 'ANSWER',
|
|
47
|
-
ABANDONED = 'ABANDONED',
|
|
48
|
-
EXIT = 'EXIT',
|
|
49
|
-
JOIN = 'JOIN'
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export enum DialerType {
|
|
53
|
-
AUTOMATIC = 'Automatic',
|
|
54
|
-
IVR = 'IVR'
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* All the eventNames that can be received from the server. Exists only in EXTENSION_EVENT and QueueEvent
|
|
59
|
-
*/
|
|
60
|
-
export enum EventNameEnum {
|
|
61
|
-
EXTENSION = 'extension',
|
|
62
|
-
QUEUE = 'queue',
|
|
63
|
-
DIALER = 'dialer',
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export enum ExtensionHangupCauseEnum {
|
|
67
|
-
NORMAL_HANGUP = 'Normal hangup',
|
|
68
|
-
USER_BUSY = 'User busy',
|
|
69
|
-
CALL_REJECTED = 'Call Rejected',
|
|
70
|
-
UNALLOCATED_NUMBER = 'Unallocated (unassigned) number',
|
|
71
|
-
UNKNOWN = 'Unknown',
|
|
72
|
-
NO_USER_RESPONDING = 'No user responding',
|
|
73
|
-
USER_ALERTING = 'User alerting, no answer',
|
|
74
|
-
ANSWERED_ELSEWHERE = 'Answered elsewhere'
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export enum CallStatusEnum {
|
|
78
|
-
RINGING = 'Ringing',
|
|
79
|
-
TALKING = 'Talking',
|
|
80
|
-
DIALING = 'Dialing',
|
|
81
|
-
HOLD = 'Hold',
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export enum CallTypeEnum {
|
|
85
|
-
INCOMING = 'Incoming',
|
|
86
|
-
OUTGOING = 'Outgoing'
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export enum DoNotCallMeStatusCodeEnum {
|
|
90
|
-
RESPONSE_FROM_API_VALID = 'RESPONSE_FROM_API_VALID',
|
|
91
|
-
RESPONSE_FROM_API_INVALID = 'RESPONSE_FROM_API_INVALID'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export enum DirectionEnum {
|
|
95
|
-
INCOMING = 'Incoming',
|
|
96
|
-
OUTGOING = 'Outgoing',
|
|
97
|
-
SPY = 'Spy',
|
|
98
|
-
CLICK2CALL = 'Click2call'
|
|
99
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { CallStatusEnum, CallTypeEnum, DialerType, DirectionEnum, DoNotCallMeStatusCodeEnum } from '@/enum/events.enum'
|
|
2
|
-
|
|
3
|
-
export interface Dialer {
|
|
4
|
-
campaignID: number,
|
|
5
|
-
name: string,
|
|
6
|
-
typeID: number,
|
|
7
|
-
type: DialerType,
|
|
8
|
-
code: string,
|
|
9
|
-
calls: unknown,
|
|
10
|
-
statistics: unknown
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface User {
|
|
14
|
-
userID: number,
|
|
15
|
-
userName: string,
|
|
16
|
-
accountID: number
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface Extension {
|
|
21
|
-
calls: ExtensionCall[],
|
|
22
|
-
userID: number,
|
|
23
|
-
userName: string,
|
|
24
|
-
number: number,
|
|
25
|
-
extenUser: string,
|
|
26
|
-
accountID: number,
|
|
27
|
-
topAccountID: number,
|
|
28
|
-
summery: Summery,
|
|
29
|
-
onlineUserID: number,
|
|
30
|
-
representative: number,
|
|
31
|
-
representativeStatus: number,
|
|
32
|
-
lastCallEventEpoch: number,
|
|
33
|
-
lastAnsweredCallEventEpoch: number,
|
|
34
|
-
lastHangupCallEpoch: number,
|
|
35
|
-
representativeUpdated: number,
|
|
36
|
-
peerStatus: unknown,
|
|
37
|
-
currentCall?: ExtensionCall,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface Queue {
|
|
41
|
-
QueueID: number,
|
|
42
|
-
QueueName: string,
|
|
43
|
-
Calls: QueueCall[],
|
|
44
|
-
UserId?: number,
|
|
45
|
-
DistributorID?: number,
|
|
46
|
-
IsDistributedQueue?: boolean,
|
|
47
|
-
AnsweredAgent?: string,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface ExtensionCall {
|
|
51
|
-
callStarted: number,
|
|
52
|
-
calldurationinterval: number,
|
|
53
|
-
callAnswered: number,
|
|
54
|
-
answered: number,
|
|
55
|
-
callername: string,
|
|
56
|
-
callerphone: string,
|
|
57
|
-
outgoingcallername?: string,
|
|
58
|
-
outgoingcallerphone?: string,
|
|
59
|
-
callstatus: CallStatusEnum,
|
|
60
|
-
customdata: CustomData,
|
|
61
|
-
direction: DirectionEnum,
|
|
62
|
-
ivrid: string,
|
|
63
|
-
recording: Recording,
|
|
64
|
-
did: string,
|
|
65
|
-
relatedIvrUniqueIDs?: string[],
|
|
66
|
-
callType?: CallTypeEnum,
|
|
67
|
-
ip: string,
|
|
68
|
-
isInternal: boolean
|
|
69
|
-
blcServerID: number,
|
|
70
|
-
isOpensips: boolean,
|
|
71
|
-
channel: string,
|
|
72
|
-
channel2: string,
|
|
73
|
-
queueID?: number,
|
|
74
|
-
isSpyed?: boolean,
|
|
75
|
-
blcServerId?: number,
|
|
76
|
-
originalCallerID?: string,
|
|
77
|
-
originalCallerName?: string,
|
|
78
|
-
actualDialedNumber?: number
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
interface QueueCall {
|
|
82
|
-
CallerID: string,
|
|
83
|
-
CallerName: string,
|
|
84
|
-
IvrUniqueID: string,
|
|
85
|
-
JoinTimeStamp: number,
|
|
86
|
-
calldurationinterval: number,
|
|
87
|
-
ivrid: string,
|
|
88
|
-
isDistributedQueue?: boolean
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
interface Summery {
|
|
92
|
-
representative: string
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
interface CustomData {
|
|
96
|
-
DoNotCallMeStatus?: string,
|
|
97
|
-
DoNotCallMeStatusCode?: DoNotCallMeStatusCodeEnum,
|
|
98
|
-
DoNotCallMeTokenName?: string,
|
|
99
|
-
DoNotCallMetransactionId?: string,
|
|
100
|
-
IsDoNotCallMe?: string
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
interface Recording {
|
|
104
|
-
Filename: string,
|
|
105
|
-
Options: string,
|
|
106
|
-
ApproximateURL: string,
|
|
107
|
-
IsMuted: number
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|