dbgate-api 4.4.2 → 4.4.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dbgate-api",
3
3
  "main": "src/index.js",
4
- "version": "4.4.2",
4
+ "version": "4.4.3",
5
5
  "homepage": "https://dbgate.org/",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,9 +26,9 @@
26
26
  "compare-versions": "^3.6.0",
27
27
  "cors": "^2.8.5",
28
28
  "cross-env": "^6.0.3",
29
- "dbgate-query-splitter": "^4.4.2",
30
- "dbgate-sqltree": "^4.4.2",
31
- "dbgate-tools": "^4.4.2",
29
+ "dbgate-query-splitter": "^4.4.3",
30
+ "dbgate-sqltree": "^4.4.3",
31
+ "dbgate-tools": "^4.4.3",
32
32
  "diff": "^5.0.0",
33
33
  "diff2html": "^3.4.13",
34
34
  "eslint": "^6.8.0",
@@ -65,7 +65,7 @@
65
65
  "devDependencies": {
66
66
  "@types/fs-extra": "^9.0.11",
67
67
  "@types/lodash": "^4.14.149",
68
- "dbgate-types": "^4.4.2",
68
+ "dbgate-types": "^4.4.3",
69
69
  "env-cmd": "^10.1.0",
70
70
  "node-loader": "^1.0.2",
71
71
  "nodemon": "^2.0.2",
@@ -162,6 +162,29 @@ module.exports = {
162
162
  return res;
163
163
  },
164
164
 
165
+ update_meta: 'post',
166
+ async update({ _id, values }) {
167
+ if (portalConnections) return;
168
+ const res = await this.datastore.update({ _id }, { $set: values });
169
+ socket.emitChanged('connection-list-changed');
170
+ return res;
171
+ },
172
+
173
+ updateDatabase_meta: 'post',
174
+ async updateDatabase({ conid, database, values }) {
175
+ if (portalConnections) return;
176
+ const conn = await this.datastore.find({ _id: conid });
177
+ let databases = conn.databases || [];
178
+ if (databases.find(x => x.name == database)) {
179
+ databases = databases.map(x => (x.item == database ? { ...x, ...values } : x));
180
+ } else {
181
+ databases = [...databases, { name: database, ...values }];
182
+ }
183
+ const res = await this.datastore.update({ _id: conid }, { $set: { databases } });
184
+ socket.emitChanged('connection-list-changed');
185
+ return res;
186
+ },
187
+
165
188
  delete_meta: 'post',
166
189
  async delete(connection) {
167
190
  if (portalConnections) return;
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '4.4.2',
4
- buildTime: '2021-12-02T07:20:50.672Z'
3
+ version: '4.4.3',
4
+ buildTime: '2021-12-06T17:41:08.771Z'
5
5
  };