dbgate-api 5.0.4-alpha.2 → 5.0.4

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": "5.0.4-alpha.2",
4
+ "version": "5.0.4",
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.4-alpha.2",
30
- "dbgate-tools": "^5.0.4-alpha.2",
29
+ "dbgate-sqltree": "^5.0.4",
30
+ "dbgate-tools": "^5.0.4",
31
31
  "diff": "^5.0.0",
32
32
  "diff2html": "^3.4.13",
33
33
  "eslint": "^6.8.0",
@@ -52,18 +52,18 @@
52
52
  "uuid": "^3.4.0"
53
53
  },
54
54
  "scripts": {
55
- "start": "env-cmd node src/index.js",
56
- "start:portal": "env-cmd -f env/portal/.env node src/index.js",
57
- "start:singledb": "env-cmd -f env/singledb/.env node src/index.js",
58
- "start:filedb": "env-cmd node src/index.js /home/jena/test/chinook/Chinook.db",
59
- "start:singleconn": "env-cmd node src/index.js --server localhost --user root --port 3307 --engine mysql@dbgate-plugin-mysql --password test",
55
+ "start": "env-cmd node src/index.js --listen-api",
56
+ "start:portal": "env-cmd -f env/portal/.env node src/index.js --listen-api",
57
+ "start:singledb": "env-cmd -f env/singledb/.env node src/index.js --listen-api",
58
+ "start:filedb": "env-cmd node src/index.js /home/jena/test/chinook/Chinook.db --listen-api",
59
+ "start:singleconn": "env-cmd node src/index.js --server localhost --user root --port 3307 --engine mysql@dbgate-plugin-mysql --password test --listen-api",
60
60
  "ts": "tsc",
61
61
  "build": "webpack"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/fs-extra": "^9.0.11",
65
65
  "@types/lodash": "^4.14.149",
66
- "dbgate-types": "^5.0.4-alpha.2",
66
+ "dbgate-types": "^5.0.4",
67
67
  "env-cmd": "^10.1.0",
68
68
  "node-loader": "^1.0.2",
69
69
  "nodemon": "^2.0.2",
@@ -1,5 +1,5 @@
1
1
 
2
2
  module.exports = {
3
- version: '5.0.4-alpha.2',
4
- buildTime: '2022-06-12T07:51:14.028Z'
3
+ version: '5.0.4',
4
+ buildTime: '2022-06-13T17:33:25.990Z'
5
5
  };
package/src/index.js CHANGED
@@ -8,9 +8,10 @@ if (processArgs.startProcess) {
8
8
  const proc = require('./proc');
9
9
  const module = proc[processArgs.startProcess];
10
10
  module.start();
11
- } else if (!processArgs.checkParent && !global['API_PACKAGE']) {
12
- const main = require('./main');
11
+ }
13
12
 
13
+ if (processArgs.listenApi) {
14
+ const main = require('./main');
14
15
  main.start();
15
16
  }
16
17
 
@@ -39,8 +39,8 @@ const platformInfo = {
39
39
  environment: process.env.NODE_ENV,
40
40
  platform,
41
41
  runningInWebpack: !!process.env.WEBPACK_DEV_SERVER_URL,
42
- allowShellConnection: !!process.env.SHELL_CONNECTION || !!isElectron(),
43
- allowShellScripting: !!process.env.SHELL_SCRIPTING || !!isElectron(),
42
+ allowShellConnection: !processArgs.listenApiChild || !!process.env.SHELL_CONNECTION || !!isElectron(),
43
+ allowShellScripting: !processArgs.listenApiChild || !!process.env.SHELL_SCRIPTING || !!isElectron(),
44
44
  defaultKeyfile: path.join(os.homedir(), '.ssh/id_rsa'),
45
45
  };
46
46
 
@@ -11,6 +11,8 @@ const startProcess = getNamedArg('--start-process');
11
11
  const isForkedApi = process.argv.includes('--is-forked-api');
12
12
  const pluginsDir = getNamedArg('--plugins-dir');
13
13
  const workspaceDir = getNamedArg('--workspace-dir');
14
+ const listenApi = process.argv.includes('--listen-api');
15
+ const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
14
16
 
15
17
  function getPassArgs() {
16
18
  const res = [];
@@ -20,6 +22,9 @@ function getPassArgs() {
20
22
  if (global['PLUGINS_DIR']) {
21
23
  res.push('--plugins-dir', global['PLUGINS_DIR']);
22
24
  }
25
+ if (listenApiChild) {
26
+ res.push('listen-api-child');
27
+ }
23
28
  return res;
24
29
  }
25
30
 
@@ -30,4 +35,6 @@ module.exports = {
30
35
  getPassArgs,
31
36
  pluginsDir,
32
37
  workspaceDir,
38
+ listenApi,
39
+ listenApiChild,
33
40
  };