@kumologica/sdk 3.4.0 → 3.5.0-beta1

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.
@@ -0,0 +1,43 @@
1
+ const path = require('path');
2
+ const { util, NodeJsFlowBuilder } = require('@kumologica/runtime');
3
+ const { codegen } = require('@kumologica/builder');
4
+
5
+ const { logError, logNotice, logInfo, logFatal } = require('../utils/logger');
6
+
7
+ const isDirectory = util.isDir.sync;
8
+
9
+
10
+ exports.command = 'start [project_directory]';
11
+ exports.desc = `Run project as standalone nodeJS app`;
12
+ exports.builder = (yargs) => {
13
+ yargs.positional(`project_directory`, {
14
+ type: 'string',
15
+ describe: 'Path to a valid kumologica project directory or flow file. (Optional)'
16
+ })
17
+ }
18
+ exports.handler = async ({ project_directory }) => {
19
+ let projectDirOrFile = project_directory || process.cwd();
20
+ let projectFlowPath = projectDirOrFile;
21
+
22
+ let isDir = isDirectory(projectDirOrFile);
23
+ if (isDir) {
24
+ let flowFileName = codegen.findFlowFile(projectDirOrFile); // returns only the flowname
25
+ if (!flowFileName) {
26
+ logFatal(`No flow found in directory: ${projectDirOrFile}`);
27
+ } else {
28
+ projectFlowPath = path.join(projectDirOrFile, flowFileName);
29
+ }
30
+ } else if (isDir === false) {
31
+ // do nothing as it was assumed to be a file
32
+ } else {
33
+ logFatal(`Directory does not exist: ${project_directory}`);
34
+ }
35
+
36
+ try {
37
+ let flowBuilder = new NodeJsFlowBuilder(projectFlowPath)
38
+ await flowBuilder.listen();
39
+
40
+ } catch (e) {
41
+ logFatal(e.message);
42
+ }
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumologica/sdk",
3
- "version": "3.4.0",
3
+ "version": "3.5.0-beta1",
4
4
  "productName": "Kumologica Designer",
5
5
  "copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
6
6
  "author": "Kumologica Pty Ltd <contact@kumologica.com>",
@@ -64,9 +64,9 @@
64
64
  "license": "Proprietary",
65
65
  "dependencies": {
66
66
  "@electron/remote": "^2.0.8",
67
- "@kumologica/builder": "3.4.0",
68
- "@kumologica/devkit": "3.4.0",
69
- "@kumologica/runtime": "3.4.0",
67
+ "@kumologica/builder": "3.5.0-beta1",
68
+ "@kumologica/devkit": "3.5.0-beta1",
69
+ "@kumologica/runtime": "3.5.0-beta1",
70
70
  "adm-zip": "0.4.13",
71
71
  "ajv": "8.10.0",
72
72
  "archive-type": "^4.0.0",
@@ -20,6 +20,7 @@ class DesignerServer {
20
20
  * @param {Object} options.cliParams - Command line parameters as an object.
21
21
  * @param {Object} options.editorApi - API object for the editor.
22
22
  * @param {Object} options.startupEmitter - EventEmitter object for handling events.
23
+ * @param {string} options.platform - The platform to run on. Default LOCAL.
23
24
  */
24
25
  constructor(options) {
25
26
 
@@ -35,7 +36,7 @@ class DesignerServer {
35
36
 
36
37
  this.config = ConfigBuilder.getInstance().buildConfig(
37
38
  options.flowPath,
38
- PLATFORMS.LOCAL,
39
+ options.platform || PLATFORMS.LOCAL,
39
40
  options.cliParams
40
41
  );
41
42
  }
package/cli/.DS_Store DELETED
Binary file
Binary file