@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.
- package/.eslintrc.cjs +17 -0
- package/.github/workflows/main.yml +16 -0
- package/.idea/VoicenterEventsSDK.iml +12 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/jsLinters/eslint.xml +7 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.nvmrc +1 -0
- package/TODELETE_TEMP/events.json +69122 -0
- package/TODELETE_TEMP/temphelper.cjs +101 -0
- package/dist/{voicenter-events-sdk.d.ts → index.d.ts} +192 -38
- package/dist/voicenter-events-sdk.cjs.js +15 -15
- package/dist/voicenter-events-sdk.cjs.js.map +1 -1
- package/dist/voicenter-events-sdk.es.js +1809 -1795
- package/dist/voicenter-events-sdk.es.js.map +1 -1
- package/dist/voicenter-events-sdk.iife.js +15 -15
- package/dist/voicenter-events-sdk.iife.js.map +1 -1
- package/dist/voicenter-events-sdk.umd.js +14 -14
- package/dist/voicenter-events-sdk.umd.js.map +1 -1
- package/docs/package-lock.json +3820 -0
- package/docs/package.json +25 -0
- package/docs/src/.vuepress/client.js +8 -0
- package/docs/src/.vuepress/components/Demo.vue +191 -0
- package/docs/src/.vuepress/config.js +60 -0
- package/docs/src/.vuepress/public/favicon.ico +0 -0
- package/docs/src/.vuepress/public/images/logo.png +0 -0
- package/docs/src/.vuepress/styles/index.scss +0 -0
- package/docs/src/.vuepress/styles/index.styl +8 -0
- package/docs/src/.vuepress/styles/palette.styl +10 -0
- package/docs/src/demo.md +7 -0
- package/docs/src/index.md +4 -0
- package/interface.ts +261 -0
- package/jest.config.js +11 -0
- package/package.json +54 -57
- package/src/classes/auth/auth.class.ts +272 -0
- package/src/classes/auth/auth.urls.ts +8 -0
- package/src/classes/events-sdk/events-sdk-default-options.ts +60 -0
- package/src/classes/events-sdk/events-sdk.class.ts +250 -0
- package/src/classes/events-sdk/events-sdk.test.ts +9 -0
- package/src/classes/events-sdk/events-sdk.types.ts +71 -0
- package/src/classes/socket-io/socket-io.class.ts +172 -0
- package/src/classes/socket-io/socket-io.d.ts +10 -0
- package/src/classes/socket-io/versions/index.ts +52 -0
- package/src/classes/socket-io/versions/v1_3_7.js +2083 -0
- package/src/classes/storage/storage.class.ts +43 -0
- package/src/enum/auth.enum.ts +4 -0
- package/src/enum/events.enum.ts +98 -0
- package/src/index.ts +15 -0
- package/src/types/auth.d.ts +53 -0
- package/src/types/events.common.d.ts +110 -0
- package/src/types/events.d.ts +175 -0
- package/src/types/listeners.d.ts +37 -0
- package/src/types/public-api.d.ts +39 -0
- package/src/types/socket.d.ts +5 -0
- package/swagger/generated/Swagger.json +1 -0
- package/swagger/index.js +60 -0
- package/swagger/package.json +21 -0
- package/swagger/scripts/update-swagger-json.js +53 -0
- package/swagger/yarn.lock +2100 -0
- package/tsconfig.json +47 -0
- 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))
|