@voicenter-team/events-sdk 0.0.12 → 0.0.14

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.
Files changed (74) hide show
  1. package/.eslintrc.cjs +17 -0
  2. package/.github/workflows/main.yml +16 -0
  3. package/.idea/VoicenterEventsSDK.iml +12 -0
  4. package/.idea/git_toolbox_prj.xml +15 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  6. package/.idea/jsLibraryMappings.xml +6 -0
  7. package/.idea/jsLinters/eslint.xml +7 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/vcs.xml +6 -0
  10. package/.nvmrc +1 -0
  11. package/TODELETE_TEMP/events.json +69122 -0
  12. package/TODELETE_TEMP/temphelper.cjs +101 -0
  13. package/dist/index.d.ts +689 -11
  14. package/dist/voicenter-events-sdk.cjs.js +10 -10
  15. package/dist/voicenter-events-sdk.cjs.js.map +1 -1
  16. package/dist/voicenter-events-sdk.es.js +1856 -1818
  17. package/dist/voicenter-events-sdk.es.js.map +1 -1
  18. package/dist/voicenter-events-sdk.iife.js +17 -17
  19. package/dist/voicenter-events-sdk.iife.js.map +1 -1
  20. package/dist/voicenter-events-sdk.umd.js +16 -16
  21. package/dist/voicenter-events-sdk.umd.js.map +1 -1
  22. package/docs/package-lock.json +3820 -0
  23. package/docs/package.json +25 -0
  24. package/docs/src/.vuepress/client.js +8 -0
  25. package/docs/src/.vuepress/components/Demo.vue +191 -0
  26. package/docs/src/.vuepress/config.js +60 -0
  27. package/docs/src/.vuepress/public/favicon.ico +0 -0
  28. package/docs/src/.vuepress/public/images/logo.png +0 -0
  29. package/docs/src/.vuepress/styles/index.scss +0 -0
  30. package/docs/src/.vuepress/styles/index.styl +8 -0
  31. package/docs/src/.vuepress/styles/palette.styl +10 -0
  32. package/docs/src/demo.md +7 -0
  33. package/docs/src/index.md +4 -0
  34. package/interface.ts +261 -0
  35. package/jest.config.js +11 -0
  36. package/package.json +1 -4
  37. package/src/classes/auth/auth.class.ts +272 -0
  38. package/src/classes/auth/auth.urls.ts +8 -0
  39. package/src/classes/events-sdk/events-sdk-default-options.ts +60 -0
  40. package/src/classes/events-sdk/events-sdk.class.ts +250 -0
  41. package/src/classes/events-sdk/events-sdk.test.ts +9 -0
  42. package/src/classes/events-sdk/events-sdk.types.ts +71 -0
  43. package/src/classes/socket-io/socket-io.class.ts +172 -0
  44. package/src/classes/socket-io/versions/index.ts +52 -0
  45. package/src/classes/socket-io/versions/v1_3_7.js +2083 -0
  46. package/src/classes/storage/storage.class.ts +43 -0
  47. package/src/enum/auth.enum.ts +4 -0
  48. package/src/enum/events.enum.ts +98 -0
  49. package/src/index.ts +15 -0
  50. package/{dist → src}/types/auth.d.ts +12 -8
  51. package/{dist → src}/types/events.common.d.ts +1 -1
  52. package/{dist → src}/types/events.d.ts +1 -1
  53. package/{dist → src}/types/socket.d.ts +1 -1
  54. package/swagger/generated/Swagger.json +1 -0
  55. package/swagger/index.js +60 -0
  56. package/swagger/package.json +21 -0
  57. package/swagger/scripts/update-swagger-json.js +53 -0
  58. package/swagger/yarn.lock +2100 -0
  59. package/tsconfig.json +47 -0
  60. package/vite.config.ts +45 -0
  61. package/dist/classes/auth/auth.class.d.ts +0 -20
  62. package/dist/classes/auth/auth.urls.d.ts +0 -4
  63. package/dist/classes/events-sdk/events-sdk-default-options.d.ts +0 -2
  64. package/dist/classes/events-sdk/events-sdk.class.d.ts +0 -35
  65. package/dist/classes/events-sdk/events-sdk.test.d.ts +0 -1
  66. package/dist/classes/events-sdk/events-sdk.types.d.ts +0 -63
  67. package/dist/classes/socket-io/socket-io.class.d.ts +0 -23
  68. package/dist/classes/socket-io/versions/index.d.ts +0 -8
  69. package/dist/classes/storage/storage.class.d.ts +0 -6
  70. package/dist/enum/auth.enum.d.ts +0 -4
  71. package/dist/enum/events.enum.d.ts +0 -77
  72. /package/{dist → src}/classes/socket-io/socket-io.d.ts +0 -0
  73. /package/{dist → src}/types/listeners.d.ts +0 -0
  74. /package/{dist → src}/types/public-api.d.ts +0 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "voicneter-events-sdk",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "authors": {
7
+ "name": "",
8
+ "email": "bohdan.ko@voicenter.com"
9
+ },
10
+ "scripts": {
11
+ "dev": "vuepress dev src",
12
+ "build": "vuepress build src"
13
+ },
14
+ "license": "MIT",
15
+ "devDependencies": {
16
+ "@vuepress/plugin-register-components": "^2.0.0-beta.62",
17
+ "typedoc": "^0.24.8",
18
+ "typedoc-plugin-markdown": "^3.15.3",
19
+ "vuepress": "^2.0.0-beta.62",
20
+ "vuepress-plugin-typedoc": "^0.12.1"
21
+ },
22
+ "dependencies": {
23
+ "dotenv": "^16.3.1"
24
+ }
25
+ }
@@ -0,0 +1,8 @@
1
+ import { defineClientConfig } from '@vuepress/client'
2
+ import './styles/index.scss'
3
+
4
+ export default defineClientConfig({
5
+ enhance({ app, router, siteData }) {},
6
+ setup() {},
7
+ rootComponents: [],
8
+ })
@@ -0,0 +1,191 @@
1
+ <template>
2
+ <div>
3
+ <p v-if="loading">
4
+ Loading...
5
+ </p>
6
+
7
+ <template v-else>
8
+ <div>
9
+ <pre><code style="color: black">{{ JSON.stringify(events, null, 4) }}</code></pre>
10
+ </div>
11
+
12
+ <div>
13
+ <form @submit.prevent="login">
14
+ <input type="text" v-model="token" placeholder="token"/>
15
+
16
+ <button type="submit">Login</button>
17
+ </form>
18
+ </div>
19
+ </template>
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts" setup>
24
+ import {reactive, ref} from 'vue'
25
+ import EventsSdkClass from '@/index'
26
+ import {eventsSdkDefaultOptions} from '@/classes/events-sdk/events-sdk-default-options'
27
+ import {EventsEnum} from '@/enum/events.enum'
28
+ import {EventTypeData} from '@/types/events'
29
+ import {LoginType} from "@/enum/auth.enum";
30
+
31
+ /* Data */
32
+ const token = ref('lJVBSEk084tzLaFpIWTReBw54trHD2Jlt8hThhX6OAxJ5IjyCC740znrXXgIzj1QtM67n2NOEGNn4SjrPJxuvkxbFb4tWHjS3cyh')
33
+ const loading = ref(false)
34
+ const loggedId = ref(false)
35
+ const events = reactive<{ [K in EventsEnum]?: Array<EventTypeData<K>> }>({})
36
+
37
+ /* Methods */
38
+ async function login() {
39
+ if (!token.value) {
40
+ return alert('Token is required')
41
+ }
42
+
43
+ loading.value = true
44
+
45
+ const sdk = new EventsSdkClass({
46
+ "token": "lJVBSEk084tzLaFpIWTReBw54trHD2Jlt8hThhX6OAxJ5IjyCC740znrXXgIzj1QtM67n2NOEGNn4SjrPJxuvkxbFb4tWHjS3cyh",
47
+ "serverFetchStrategy": "remote",
48
+ "url": "https://monitor2.comms24x7.com/monitorAPI/getMonitorUrls",
49
+ "loginUrl": "https://loginapi.comms24x7.com/monitorAPI/Login",
50
+ "refreshTokenUrl": "https://loginapi.comms24x7.com/monitorAPI/RefreshIdentityToken",
51
+ "servers": [{
52
+ "URLID": 1,
53
+ "Priority": 5,
54
+ "Version": "1.3.7",
55
+ "Domain": "monitor1.comms24x7.com"
56
+ }, {"URLID": 2, "Priority": 4, "Version": "1.3.7", "Domain": "monitor2.comms24x7.com"}]
57
+ })
58
+
59
+ await sdk.init()
60
+
61
+ sdk.on(
62
+ EventsEnum.ALL_DIALER_STATUS,
63
+ ({ data }) => {
64
+
65
+ if (!events[EventsEnum.ALL_DIALER_STATUS]) {
66
+ events[EventsEnum.ALL_DIALER_STATUS] = []
67
+ }
68
+
69
+ events[EventsEnum.ALL_DIALER_STATUS]?.push(data)
70
+ }
71
+ )
72
+
73
+ sdk.on(
74
+ EventsEnum.ALL_EXTENSION_STATUS,
75
+ ({ data }) => {
76
+
77
+ if (!events[EventsEnum.ALL_EXTENSION_STATUS]) {
78
+ events[EventsEnum.ALL_EXTENSION_STATUS] = []
79
+ }
80
+
81
+ events[EventsEnum.ALL_EXTENSION_STATUS]?.push(data)
82
+ }
83
+ )
84
+
85
+ sdk.on(
86
+ EventsEnum.ALL_USERS_STATUS,
87
+ ({ data }) => {
88
+
89
+ if (!events[EventsEnum.ALL_USERS_STATUS]) {
90
+ events[EventsEnum.ALL_USERS_STATUS] = []
91
+ }
92
+
93
+ events[EventsEnum.ALL_USERS_STATUS]?.push(data)
94
+ }
95
+ )
96
+
97
+ sdk.on(
98
+ EventsEnum.QUEUE_EVENT,
99
+ ({ data }) => {
100
+
101
+ if (!events[EventsEnum.QUEUE_EVENT]) {
102
+ events[EventsEnum.QUEUE_EVENT] = []
103
+ }
104
+
105
+ events[EventsEnum.QUEUE_EVENT]?.push(data)
106
+ }
107
+ )
108
+
109
+ sdk.on(
110
+ EventsEnum.EXTENSION_EVENT,
111
+ ({ data }) => {
112
+
113
+ if (!events[EventsEnum.EXTENSION_EVENT]) {
114
+ events[EventsEnum.EXTENSION_EVENT] = []
115
+ }
116
+
117
+ events[EventsEnum.EXTENSION_EVENT]?.push(data)
118
+ }
119
+ )
120
+
121
+ sdk.on(
122
+ EventsEnum.LOGIN_SUCCESS,
123
+ ({ data }) => {
124
+ if (!events[EventsEnum.LOGIN_SUCCESS]) {
125
+ events[EventsEnum.LOGIN_SUCCESS] = []
126
+ }
127
+
128
+ loggedId.value = true
129
+ loading.value = false
130
+
131
+ events[EventsEnum.LOGIN_SUCCESS]?.push(data)
132
+ }
133
+ )
134
+
135
+ sdk.on(
136
+ EventsEnum.LOGIN_STATUS,
137
+ ({ data }) => {
138
+ if (!events[EventsEnum.LOGIN_STATUS]) {
139
+ events[EventsEnum.LOGIN_STATUS] = []
140
+ }
141
+
142
+ events[EventsEnum.LOGIN_STATUS]?.push(data)
143
+ }
144
+ )
145
+
146
+ sdk.on(
147
+ '*',
148
+ (data) => {
149
+ switch (data.name) {
150
+ case EventsEnum.ALL_DIALER_STATUS:
151
+ console.log(`FROM ALL ${EventsEnum.ALL_DIALER_STATUS}`, data)
152
+ break
153
+ case EventsEnum.ALL_EXTENSION_STATUS:
154
+ console.log(`FROM ALL ${EventsEnum.ALL_EXTENSION_STATUS}`, data)
155
+ break
156
+ case EventsEnum.ALL_USERS_STATUS:
157
+ console.log(`FROM ALL ${EventsEnum.ALL_USERS_STATUS}`, data)
158
+ break
159
+ case EventsEnum.QUEUE_EVENT:
160
+ console.log(`FROM ALL ${EventsEnum.QUEUE_EVENT}`, data)
161
+ break
162
+ case EventsEnum.EXTENSION_EVENT:
163
+ console.log(`FROM ALL ${EventsEnum.EXTENSION_EVENT}`, data)
164
+ break
165
+ case EventsEnum.LOGIN_SUCCESS:
166
+ console.log(`FROM ALL ${EventsEnum.LOGIN_SUCCESS}`, data)
167
+ break
168
+ case EventsEnum.LOGIN_STATUS:
169
+ console.log(`FROM ALL ${EventsEnum.LOGIN_STATUS}`, data)
170
+ break
171
+ case EventsEnum.ONLINE_STATUS_EVENT:
172
+ console.log(`FROM ALL ${EventsEnum.ONLINE_STATUS_EVENT}`, data)
173
+ break
174
+ default:
175
+ console.log('Unknown event', data)
176
+
177
+ }
178
+ }
179
+ )
180
+
181
+ setTimeout(
182
+ () => {
183
+ if (!loggedId.value) {
184
+ loading.value = false
185
+ alert('Login failed')
186
+ }
187
+ },
188
+ 5000
189
+ )
190
+ }
191
+ </script>
@@ -0,0 +1,60 @@
1
+ import { defineUserConfig, defaultTheme } from 'vuepress'
2
+ import { description } from '../../package'
3
+ import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
4
+ import { getDirname, path } from '@vuepress/utils'
5
+ import { typedocPlugin } from 'vuepress-plugin-typedoc/next';
6
+ import * as dotenv from 'dotenv'
7
+ dotenv.config()
8
+
9
+ const __dirname = getDirname(import.meta.url)
10
+
11
+ export default defineUserConfig({
12
+ description: description,
13
+
14
+ head: [
15
+ ['link', {rel: 'icon', href: '/favicon.ico'}],
16
+ ['meta', {name: 'theme-color', content: '#2675FF'}],
17
+ ['meta', {name: 'apple-mobile-web-app-capable', content: 'yes'}],
18
+ ['meta', {name: 'apple-mobile-web-app-status-bar-style', content: '#2675FF'}]
19
+ ],
20
+
21
+ theme: defaultTheme({
22
+ repo: '',
23
+ editLinks: false,
24
+ logo: '/images/logo.png',
25
+ docsDir: '',
26
+ editLinkText: '',
27
+ colorMode: 'light',
28
+ lastUpdated: false,
29
+ sidebar: [
30
+ {
31
+ text: 'General',
32
+ link: '/',
33
+ collapsible: false,
34
+ children: [
35
+ 'demo',
36
+ {
37
+ text: 'API',
38
+ link: 'api',
39
+ rel: 'api'
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ }),
45
+
46
+ plugins: [
47
+ registerComponentsPlugin({
48
+ componentsDir: path.resolve(__dirname, './components')
49
+ }),
50
+ // typedocPlugin({
51
+ // entryPoints: ['../src/types/public-api.d.ts'],
52
+ // tsconfig: '../tsconfig.json'
53
+ // })
54
+ ],
55
+
56
+ alias: {
57
+ '@': path.resolve(__dirname, '../', '../', '../', 'src'),
58
+ 'root': path.resolve(__dirname, '../', '../', '../'),
59
+ }
60
+ })
File without changes
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Custom Styles here.
3
+ *
4
+ * ref:https://v1.vuepress.vuejs.org/config/#index-styl
5
+ */
6
+
7
+ .home .hero img
8
+ max-width 450px!important
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Custom palette here.
3
+ *
4
+ * ref:https://v1.vuepress.vuejs.org/zh/config/#palette-styl
5
+ */
6
+
7
+ $accentColor = #a5c544
8
+ $textColor = #2c3e50
9
+ $borderColor = #eaecef
10
+ $codeBgColor = #282c34
@@ -0,0 +1,7 @@
1
+ # Demo
2
+
3
+ <ClientOnly>
4
+ <div class="py-5">
5
+ <Demo />
6
+ </div>
7
+ </ClientOnly>
@@ -0,0 +1,4 @@
1
+ # Voicenter Events SDK
2
+
3
+ - [Demo](demo.md)
4
+ - [API](api/modules.md)
package/interface.ts ADDED
@@ -0,0 +1,261 @@
1
+ interface options {
2
+
3
+ /**
4
+ * the authentication payload sent when connecting to the Namespace
5
+ */
6
+ auth?: {
7
+ [key: string]: any;
8
+ } | ((cb: (data: object) => void) => void);
9
+ /**
10
+ * The maximum number of retries. Above the limit, the packet will be discarded.
11
+ *
12
+ * Using `Infinity` means the delivery guarantee is "at-least-once" (instead of "at-most-once" by default), but a
13
+ * smaller value like 10 should be sufficient in practice.
14
+ */
15
+ retries?: number;
16
+ /**
17
+ * The default timeout in milliseconds used when waiting for an acknowledgement.
18
+ */
19
+ ackTimeout?: number;
20
+
21
+ /**
22
+ * The host that we're connecting to. Set from the URI passed when connecting
23
+ */
24
+ host: string;
25
+ /**
26
+ * The hostname for our connection. Set from the URI passed when connecting
27
+ */
28
+ hostname: string;
29
+ /**
30
+ * If this is a secure connection. Set from the URI passed when connecting
31
+ */
32
+ secure: boolean;
33
+ /**
34
+ * The port for our connection. Set from the URI passed when connecting
35
+ */
36
+ port: string | number;
37
+ /**
38
+ * Any query parameters in our uri. Set from the URI passed when connecting
39
+ */
40
+ query: {
41
+ [key: string]: any;
42
+ };
43
+ /**
44
+ * `http.Agent` to use, defaults to `false` (NodeJS only)
45
+ *
46
+ * Note: the type should be "undefined | http.Agent | https.Agent | false", but this would break browser-only clients.
47
+ *
48
+ * @see https://nodejs.org/api/http.html#httprequestoptions-callback
49
+ */
50
+ agent: string | boolean;
51
+ /**
52
+ * Whether the client should try to upgrade the transport from
53
+ * long-polling to something better.
54
+ * @default true
55
+ */
56
+ upgrade: boolean;
57
+ /**
58
+ * Forces base 64 encoding for polling transport even when XHR2
59
+ * responseType is available and WebSocket even if the used standard
60
+ * supports binary.
61
+ */
62
+ forceBase64: boolean;
63
+ /**
64
+ * The param name to use as our timestamp key
65
+ * @default 't'
66
+ */
67
+ timestampParam: string;
68
+ /**
69
+ * Whether to add the timestamp with each transport request. Note: this
70
+ * is ignored if the browser is IE or Android, in which case requests
71
+ * are always stamped
72
+ * @default false
73
+ */
74
+ timestampRequests: boolean;
75
+ /**
76
+ * A list of transports to try (in order). Engine.io always attempts to
77
+ * connect directly with the first one, provided the feature detection test
78
+ * for it passes.
79
+ *
80
+ * @default ['polling','websocket', 'webtransport']
81
+ */
82
+ transports: string[];
83
+ /**
84
+ * If true and if the previous websocket connection to the server succeeded,
85
+ * the connection attempt will bypass the normal upgrade process and will
86
+ * initially try websocket. A connection attempt following a transport error
87
+ * will use the normal upgrade process. It is recommended you turn this on
88
+ * only when using SSL/TLS connections, or if you know that your network does
89
+ * not block websockets.
90
+ * @default false
91
+ */
92
+ rememberUpgrade: boolean;
93
+ /**
94
+ * Are we only interested in transports that support binary?
95
+ */
96
+ onlyBinaryUpgrades: boolean;
97
+ /**
98
+ * Timeout for xhr-polling requests in milliseconds (0) (only for polling transport)
99
+ */
100
+ requestTimeout: number;
101
+ /**
102
+ * Transport options for Node.js client (headers etc)
103
+ */
104
+ transportOptions: Object;
105
+ /**
106
+ * (SSL) Certificate, Private key and CA certificates to use for SSL.
107
+ * Can be used in Node.js client environment to manually specify
108
+ * certificate information.
109
+ */
110
+ pfx: string;
111
+ /**
112
+ * (SSL) Private key to use for SSL. Can be used in Node.js client
113
+ * environment to manually specify certificate information.
114
+ */
115
+ key: string;
116
+ /**
117
+ * (SSL) A string or passphrase for the private key or pfx. Can be
118
+ * used in Node.js client environment to manually specify certificate
119
+ * information.
120
+ */
121
+ passphrase: string;
122
+ /**
123
+ * (SSL) Public x509 certificate to use. Can be used in Node.js client
124
+ * environment to manually specify certificate information.
125
+ */
126
+ cert: string;
127
+ /**
128
+ * (SSL) An authority certificate or array of authority certificates to
129
+ * check the remote host against.. Can be used in Node.js client
130
+ * environment to manually specify certificate information.
131
+ */
132
+ ca: string | string[];
133
+ /**
134
+ * (SSL) A string describing the ciphers to use or exclude. Consult the
135
+ * [cipher format list]
136
+ * (http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for
137
+ * details on the format.. Can be used in Node.js client environment to
138
+ * manually specify certificate information.
139
+ */
140
+ ciphers: string;
141
+ /**
142
+ * (SSL) If true, the server certificate is verified against the list of
143
+ * supplied CAs. An 'error' event is emitted if verification fails.
144
+ * Verification happens at the connection level, before the HTTP request
145
+ * is sent. Can be used in Node.js client environment to manually specify
146
+ * certificate information.
147
+ */
148
+ rejectUnauthorized: boolean;
149
+ /**
150
+ * Headers that will be passed for each request to the server (via xhr-polling and via websockets).
151
+ * These values then can be used during handshake or for special proxies.
152
+ */
153
+ extraHeaders?: {
154
+ [header: string]: string;
155
+ };
156
+ /**
157
+ * Whether to include credentials (cookies, authorization headers, TLS
158
+ * client certificates, etc.) with cross-origin XHR polling requests
159
+ * @default false
160
+ */
161
+ withCredentials: boolean;
162
+ /**
163
+ * Whether to automatically close the connection whenever the beforeunload event is received.
164
+ * @default false
165
+ */
166
+ closeOnBeforeunload: boolean;
167
+ /**
168
+ * Whether to always use the native timeouts. This allows the client to
169
+ * reconnect when the native timeout functions are overridden, such as when
170
+ * mock clocks are installed.
171
+ * @default false
172
+ */
173
+ useNativeTimers: boolean;
174
+ /**
175
+ * weather we should unref the reconnect timer when it is
176
+ * create automatically
177
+ * @default false
178
+ */
179
+ autoUnref: boolean;
180
+ /**
181
+ * parameters of the WebSocket permessage-deflate extension (see ws module api docs). Set to false to disable.
182
+ * @default false
183
+ */
184
+ perMessageDeflate: {
185
+ threshold: number;
186
+ };
187
+ /**
188
+ * The path to get our client file from, in the case of the server
189
+ * serving it
190
+ * @default '/engine.io'
191
+ */
192
+ path: string;
193
+ /**
194
+ * Whether we should add a trailing slash to the request path.
195
+ * @default true
196
+ */
197
+ addTrailingSlash: boolean;
198
+ /**
199
+ * Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols,
200
+ * so that a single server can implement multiple WebSocket sub-protocols (for example, you might want one server to
201
+ * be able to handle different types of interactions depending on the specified protocol)
202
+ * @default []
203
+ */
204
+ protocols: string | string[];
205
+
206
+ /**
207
+ * Should we force a new Manager for this connection?
208
+ * @default false
209
+ */
210
+ forceNew: boolean;
211
+ /**
212
+ * Should we multiplex our connection (reuse existing Manager) ?
213
+ * @default true
214
+ */
215
+ multiplex: boolean;
216
+ /**
217
+ * The path to get our client file from, in the case of the server
218
+ * serving it
219
+ * @default '/socket.io'
220
+ */
221
+ path: string;
222
+ /**
223
+ * Should we allow reconnections?
224
+ * @default true
225
+ */
226
+ reconnection: boolean;
227
+ /**
228
+ * How many reconnection attempts should we try?
229
+ * @default Infinity
230
+ */
231
+ reconnectionAttempts: number;
232
+ /**
233
+ * The time delay in milliseconds between reconnection attempts
234
+ * @default 1000
235
+ */
236
+ reconnectionDelay: number;
237
+ /**
238
+ * The max time delay in milliseconds between reconnection attempts
239
+ * @default 5000
240
+ */
241
+ reconnectionDelayMax: number;
242
+ /**
243
+ * Used in the exponential backoff jitter when reconnecting
244
+ * @default 0.5
245
+ */
246
+ randomizationFactor: number;
247
+ /**
248
+ * The timeout in milliseconds for our connection attempt
249
+ * @default 20000
250
+ */
251
+ timeout: number;
252
+ /**
253
+ * Should we automatically connect?
254
+ * @default true
255
+ */
256
+ autoConnect: boolean;
257
+ /**
258
+ * the parser to use. Defaults to an instance of the Parser that ships with socket.io.
259
+ */
260
+ parser: any;
261
+ }
package/jest.config.js ADDED
@@ -0,0 +1,11 @@
1
+ // jest.config.js
2
+ module.exports = {
3
+ preset: 'ts-jest',
4
+ testEnvironment: 'node',
5
+ roots: [ '<rootDir>/src' ],
6
+ transform: {
7
+ '^.+\\.tsx?$': 'ts-jest',
8
+ },
9
+ testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
10
+ moduleFileExtensions: [ 'ts', 'tsx', 'js', 'jsx', 'json', 'node' ],
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicenter-team/events-sdk",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
5
  "main": "dist/voicenter-events-sdk.cjs.js",
6
6
  "jsdelivr": "dist/voicenter-events-sdk.umd.js",
@@ -21,9 +21,6 @@
21
21
  "npm": ">= 9.6.7",
22
22
  "yarn": ">= 1.22.4"
23
23
  },
24
- "files": [
25
- "dist"
26
- ],
27
24
  "precommit": "ts-check, lint",
28
25
  "keywords": [],
29
26
  "author": "",