dbgate-api 5.0.0 → 5.0.3

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/.env CHANGED
@@ -1,4 +1,6 @@
1
1
  DEVMODE=1
2
+ SHELL_SCRIPTING=1
3
+
2
4
  # PERMISSIONS=~widgets/app,~widgets/plugins
3
5
  # DISABLE_SHELL=1
4
6
  # HIDE_APP_EDITOR=1
package/env/portal/.env CHANGED
@@ -1,6 +1,6 @@
1
1
  DEVMODE=1
2
2
 
3
- CONNECTIONS=mysql,postgres,mongo,mongo2,mysqlssh,sqlite
3
+ CONNECTIONS=mysql,postgres,mongo,mongo2,mysqlssh,sqlite,relational
4
4
 
5
5
  LABEL_mysql=MySql localhost
6
6
  SERVER_mysql=localhost
@@ -41,4 +41,11 @@ LABEL_sqlite=sqlite
41
41
  FILE_sqlite=/home/jena/.dbgate/files/sqlite/feeds.sqlite
42
42
  ENGINE_sqlite=sqlite@dbgate-plugin-sqlite
43
43
 
44
+ LABEL_relational=Relational dataset repo
45
+ SERVER_relational=relational.fit.cvut.cz
46
+ USER_relational=guest
47
+ PASSWORD_relational=relational
48
+ ENGINE_relational=mariadb@dbgate-plugin-mysql
49
+ READONLY_relational=1
50
+
44
51
  # docker run -p 3000:3000 -e CONNECTIONS=mongo -e URL_mongo=mongodb://localhost:27017 -e ENGINE_mongo=mongo@dbgate-plugin-mongo -e LABEL_mongo=mongo dbgate/dbgate:beta
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api",
3
3
  "main": "src/index.js",
4
- "version": "5.0.0",
4
+ "version": "5.0.3",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,8 +26,8 @@
26
26
  "cors": "^2.8.5",
27
27
  "cross-env": "^6.0.3",
28
28
  "dbgate-query-splitter": "^4.9.0",
29
- "dbgate-sqltree": "^5.0.0",
30
- "dbgate-tools": "^5.0.0",
29
+ "dbgate-sqltree": "^5.0.3",
30
+ "dbgate-tools": "^5.0.3",
31
31
  "diff": "^5.0.0",
32
32
  "diff2html": "^3.4.13",
33
33
  "eslint": "^6.8.0",
@@ -63,7 +63,7 @@
63
63
  "devDependencies": {
64
64
  "@types/fs-extra": "^9.0.11",
65
65
  "@types/lodash": "^4.14.149",
66
- "dbgate-types": "^5.0.0",
66
+ "dbgate-types": "^5.0.3",
67
67
  "env-cmd": "^10.1.0",
68
68
  "node-loader": "^1.0.2",
69
69
  "nodemon": "^2.0.2",
@@ -36,7 +36,7 @@ module.exports = {
36
36
  singleDatabase: connections.singleDatabase,
37
37
  // hideAppEditor: !!process.env.HIDE_APP_EDITOR,
38
38
  allowShellConnection: platformInfo.allowShellConnection,
39
- allowShellScripting: platformInfo.allowShellConnection,
39
+ allowShellScripting: platformInfo.allowShellScripting,
40
40
  isDocker: platformInfo.isDocker,
41
41
  permissions,
42
42
  login,
@@ -271,9 +271,9 @@ module.exports = {
271
271
  },
272
272
 
273
273
  syncModel_meta: true,
274
- async syncModel({ conid, database }) {
274
+ async syncModel({ conid, database, isFullRefresh }) {
275
275
  const conn = await this.ensureOpened(conid, database);
276
- conn.subprocess.send({ msgtype: 'syncModel' });
276
+ conn.subprocess.send({ msgtype: 'syncModel', isFullRefresh });
277
277
  return { status: 'ok' };
278
278
  },
279
279
 
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '5.0.0',
4
- buildTime: '2022-05-23T17:17:42.400Z'
3
+ version: '5.0.3',
4
+ buildTime: '2022-06-10T18:31:02.360Z'
5
5
  };
@@ -15,6 +15,7 @@ let afterConnectCallbacks = [];
15
15
  let afterAnalyseCallbacks = [];
16
16
  let analysedStructure = null;
17
17
  let lastPing = null;
18
+ let lastStatusString = null;
18
19
  let lastStatus = null;
19
20
  let analysedTime = 0;
20
21
  let serverVersion;
@@ -78,21 +79,24 @@ async function handleIncrementalRefresh(forceSend) {
78
79
  resolveAnalysedPromises();
79
80
  }
80
81
 
81
- function handleSyncModel() {
82
+ function handleSyncModel({ isFullRefresh }) {
82
83
  if (loadingModel) return;
83
- handleIncrementalRefresh();
84
+ if (isFullRefresh) handleFullRefresh();
85
+ else handleIncrementalRefresh();
84
86
  }
85
87
 
86
88
  function setStatus(status) {
87
- const statusString = stableStringify(status);
88
- if (lastStatus != statusString) {
89
- process.send({ msgtype: 'status', status: { ...status, counter: getStatusCounter() } });
90
- lastStatus = statusString;
89
+ const newStatus = { ...lastStatus, ...status };
90
+ const statusString = stableStringify(newStatus);
91
+ if (lastStatusString != statusString) {
92
+ process.send({ msgtype: 'status', status: { ...newStatus, counter: getStatusCounter() } });
93
+ lastStatusString = statusString;
94
+ lastStatus = newStatus;
91
95
  }
92
96
  }
93
97
 
94
98
  function setStatusName(name) {
95
- setStatus({ name });
99
+ setStatus({ name, message: null });
96
100
  }
97
101
 
98
102
  async function readVersion() {
@@ -109,6 +113,7 @@ async function handleConnect({ connection, structure, globalSettings }) {
109
113
  if (!structure) setStatusName('pending');
110
114
  const driver = requireEngineDriver(storedConnection);
111
115
  systemConnection = await checkedAsyncCall(connectUtility(driver, storedConnection, 'app'));
116
+ systemConnection.feedback = feedback => setStatus({ feedback });
112
117
  await checkedAsyncCall(readVersion());
113
118
  if (structure) {
114
119
  analysedStructure = structure;