dbgate-api-premium 6.3.0 → 6.3.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api-premium",
3
3
  "main": "src/index.js",
4
- "version": "6.3.0",
4
+ "version": "6.3.2",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,10 +29,10 @@
29
29
  "compare-versions": "^3.6.0",
30
30
  "cors": "^2.8.5",
31
31
  "cross-env": "^6.0.3",
32
- "dbgate-datalib": "^6.3.0",
32
+ "dbgate-datalib": "^6.3.2",
33
33
  "dbgate-query-splitter": "^4.11.3",
34
- "dbgate-sqltree": "^6.3.0",
35
- "dbgate-tools": "^6.3.0",
34
+ "dbgate-sqltree": "^6.3.2",
35
+ "dbgate-tools": "^6.3.2",
36
36
  "debug": "^4.3.4",
37
37
  "diff": "^5.0.0",
38
38
  "diff2html": "^3.4.13",
@@ -83,7 +83,7 @@
83
83
  "devDependencies": {
84
84
  "@types/fs-extra": "^9.0.11",
85
85
  "@types/lodash": "^4.14.149",
86
- "dbgate-types": "^6.3.0",
86
+ "dbgate-types": "^6.3.2",
87
87
  "env-cmd": "^10.1.0",
88
88
  "jsdoc-to-markdown": "^9.0.5",
89
89
  "node-loader": "^1.0.2",
@@ -102,12 +102,21 @@ function getPortalCollections() {
102
102
  trustServerCertificate: process.env[`SSL_TRUST_CERTIFICATE_${id}`],
103
103
  }));
104
104
 
105
+ for(const conn of connections) {
106
+ for(const prop in process.env) {
107
+ if (prop.startsWith(`CONNECTION_${conn._id}_`)) {
108
+ const name = prop.substring(`CONNECTION_${conn._id}_`.length);
109
+ conn[name] = process.env[prop];
110
+ }
111
+ }
112
+ }
113
+
105
114
  logger.info({ connections: connections.map(pickSafeConnectionInfo) }, 'Using connections from ENV variables');
106
115
  const noengine = connections.filter(x => !x.engine);
107
116
  if (noengine.length > 0) {
108
117
  logger.warn(
109
118
  { connections: noengine.map(x => x._id) },
110
- 'Invalid CONNECTIONS configutation, missing ENGINE for connection ID'
119
+ 'Invalid CONNECTIONS configuration, missing ENGINE for connection ID'
111
120
  );
112
121
  }
113
122
  return connections;
@@ -195,8 +195,8 @@ module.exports = {
195
195
  },
196
196
 
197
197
  exportDiagram_meta: true,
198
- async exportDiagram({ filePath, html, css, themeType, themeClassName }) {
199
- await fs.writeFile(filePath, getDiagramExport(html, css, themeType, themeClassName));
198
+ async exportDiagram({ filePath, html, css, themeType, themeClassName, watermark }) {
199
+ await fs.writeFile(filePath, getDiagramExport(html, css, themeType, themeClassName, watermark));
200
200
  return true;
201
201
  },
202
202
 
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '6.3.0',
4
- buildTime: '2025-03-18T11:15:02.094Z'
3
+ version: '6.3.2',
4
+ buildTime: '2025-04-02T12:10:04.222Z'
5
5
  };
@@ -38,6 +38,8 @@ function start() {
38
38
  detail: formatErrorDetail(e, connection),
39
39
  });
40
40
  }
41
+
42
+ process.exit(0);
41
43
  });
42
44
  }
43
45
 
@@ -1,4 +1,11 @@
1
- const getDiagramExport = (html, css, themeType, themeClassName) => {
1
+ const getDiagramExport = (html, css, themeType, themeClassName, watermark) => {
2
+ const watermarkHtml = watermark
3
+ ? `
4
+ <div style="position: fixed; bottom: 0; right: 0; padding: 5px; font-size: 12px; color: var(--theme-font-2); background-color: var(--theme-bg-2); border-top-left-radius: 5px; border: 1px solid var(--theme-border);">
5
+ ${watermark}
6
+ </div>
7
+ `
8
+ : '';
2
9
  return `<html>
3
10
  <meta charset='utf-8'>
4
11
 
@@ -13,10 +20,44 @@ const getDiagramExport = (html, css, themeType, themeClassName) => {
13
20
  </style>
14
21
 
15
22
  <link rel="stylesheet" href='https://cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.css' />
23
+
24
+ <script>
25
+ let lastX = null;
26
+ let lastY = null;
27
+
28
+ const handleMoveDown = e => {
29
+ lastX = e.clientX;
30
+ lastY = e.clientY;
31
+ document.addEventListener('mousemove', handleMoveMove, true);
32
+ document.addEventListener('mouseup', handleMoveEnd, true);
33
+ };
34
+
35
+ const handleMoveMove = e => {
36
+ e.preventDefault();
37
+
38
+ document.body.scrollLeft -= e.clientX - lastX;
39
+ document.body.scrollTop -= e.clientY - lastY;
40
+
41
+ lastX = e.clientX;
42
+ lastY = e.clientY;
43
+ };
44
+ const handleMoveEnd = e => {
45
+ e.preventDefault();
46
+ e.stopPropagation();
47
+
48
+ lastX = null;
49
+ lastY = null;
50
+ document.removeEventListener('mousemove', handleMoveMove, true);
51
+ document.removeEventListener('mouseup', handleMoveEnd, true);
52
+ };
53
+
54
+ document.addEventListener('mousedown', handleMoveDown);
55
+ </script>
16
56
  </head>
17
57
 
18
- <body class='${themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light'} ${themeClassName}'>
58
+ <body class='${themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light'} ${themeClassName}' style='user-select:none; cursor:pointer'>
19
59
  ${html}
60
+ ${watermarkHtml}
20
61
  </body>
21
62
 
22
63
  </html>`;