@voicenter-team/events-sdk 0.0.13 → 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 (63) 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/{voicenter-events-sdk.d.ts → index.d.ts} +192 -38
  14. package/dist/voicenter-events-sdk.cjs.js +15 -15
  15. package/dist/voicenter-events-sdk.cjs.js.map +1 -1
  16. package/dist/voicenter-events-sdk.es.js +1809 -1795
  17. package/dist/voicenter-events-sdk.es.js.map +1 -1
  18. package/dist/voicenter-events-sdk.iife.js +15 -15
  19. package/dist/voicenter-events-sdk.iife.js.map +1 -1
  20. package/dist/voicenter-events-sdk.umd.js +14 -14
  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 +54 -57
  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/socket-io.d.ts +10 -0
  45. package/src/classes/socket-io/versions/index.ts +52 -0
  46. package/src/classes/socket-io/versions/v1_3_7.js +2083 -0
  47. package/src/classes/storage/storage.class.ts +43 -0
  48. package/src/enum/auth.enum.ts +4 -0
  49. package/src/enum/events.enum.ts +98 -0
  50. package/src/index.ts +15 -0
  51. package/src/types/auth.d.ts +53 -0
  52. package/src/types/events.common.d.ts +110 -0
  53. package/src/types/events.d.ts +175 -0
  54. package/src/types/listeners.d.ts +37 -0
  55. package/src/types/public-api.d.ts +39 -0
  56. package/src/types/socket.d.ts +5 -0
  57. package/swagger/generated/Swagger.json +1 -0
  58. package/swagger/index.js +60 -0
  59. package/swagger/package.json +21 -0
  60. package/swagger/scripts/update-swagger-json.js +53 -0
  61. package/swagger/yarn.lock +2100 -0
  62. package/tsconfig.json +47 -0
  63. package/vite.config.ts +45 -0
@@ -0,0 +1,53 @@
1
+ import fs from 'fs'
2
+ import mysql from '@voicenter-team/mysql-dynamic-cluster'
3
+
4
+ const connection = mysql.createPoolCluster({
5
+ clusterName: 'demo',
6
+ hosts: [
7
+ {
8
+ host: '192.168.187.22',
9
+ port: 3306,
10
+ name: 'lab22',
11
+ }
12
+ ],
13
+ // Configuration for all pools
14
+ defaultPoolSettings: {
15
+ user: 'api',
16
+ password: 'SecretAPI35t478p3!!!',
17
+ database: 'voicenter_core',
18
+ docsDatabase: 'monitor_events_api_doc',
19
+ charset: 'utf8mb4',
20
+ port: 3313,
21
+ // validators: [],
22
+ // loadFactors: [],
23
+ },
24
+ })
25
+
26
+ const pathToFile = 'generated/'
27
+ const filename = 'Swagger.json'
28
+ const fullPath = pathToFile + filename
29
+
30
+ const generate = async () => {
31
+ await connection.connect()
32
+
33
+ const results = await connection.query('SELECT monitor_events_api_doc.FN_GetSwagger(0.01) as data')
34
+
35
+ const targetResult = results[0].data
36
+
37
+ console.log(targetResult)
38
+
39
+ const targetResultString = JSON.stringify(targetResult)
40
+
41
+ if (!fs.existsSync(pathToFile)) {
42
+ fs.mkdirSync(pathToFile, { recursive: true })
43
+ }
44
+
45
+ fs.writeFile(fullPath, targetResultString, (err) => {
46
+ if (err) throw err
47
+ console.log('Swagger.json is updated!')
48
+ })
49
+
50
+ await connection.disconnect()
51
+ }
52
+
53
+ generate().then(data => console.log(data))