@kumologica/sdk 3.5.4 → 3.6.0-beta2

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.
@@ -22470,7 +22470,7 @@ var require_acorn = __commonJS({
22470
22470
  // (the latest version the library supports). This influences
22471
22471
  // support for strict mode, the set of reserved words, and support
22472
22472
  // for new syntax features.
22473
- ecmaVersion: null,
22473
+ ecmaVersion: null,
22474
22474
  // `sourceType` indicates the mode the code should be parsed in.
22475
22475
  // Can be either `"script"` or `"module"`. This influences global
22476
22476
  // strict mode and parsing of `import` and `export` declarations.
@@ -22618,7 +22618,12 @@ var require_acorn = __commonJS({
22618
22618
  }
22619
22619
  var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5;
22620
22620
  var Parser = function Parser2(options, input, startPos) {
22621
+
22622
+
22621
22623
  this.options = options = getOptions(options);
22624
+ this.options.sourceType = "module"; // overrite by kumologica
22625
+ this.options.ecmaVersion = 2022;
22626
+
22622
22627
  this.sourceFile = options.sourceFile;
22623
22628
  this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
22624
22629
  var reserved = "";
@@ -85304,7 +85309,8 @@ var require_no_undef = __commonJS({
85304
85309
  identifier.name === 'msg' ||
85305
85310
  identifier.name ==='vars' ||
85306
85311
  identifier.name === 'env' ||
85307
- identifier.name === 'node') return;
85312
+ identifier.name === 'node'
85313
+ ) return;
85308
85314
 
85309
85315
  context.report({
85310
85316
  node: identifier,
@@ -104042,6 +104048,8 @@ var require_linter = __commonJS({
104042
104048
  nodeType: null
104043
104049
  }
104044
104050
  };
104051
+
104052
+
104045
104053
  }
104046
104054
  }
104047
104055
  function createRuleListeners(rule, ruleContext) {
@@ -47,7 +47,7 @@
47
47
  </head>
48
48
  <body spellcheck="false" style="overflow: hidden !important">
49
49
  <div class="win-top-separator" style="display:flex; height:1px; border-top:1px solid #ddd"></div>
50
- <div id="header" style="-webkit-app-region: drag;">
50
+ <div id="header">
51
51
  <!-- <span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span> -->
52
52
  <!-- <ul class="header-toolbar hide"> -->
53
53
  <div id="left">
@@ -1,10 +1,11 @@
1
1
  const {
2
- AbstractServerfulServer,
3
- ConfigBuilder,
4
- PLATFORMS
5
- } = require('@kumologica/runtime');
6
- const tcpPortUsed = require('tcp-port-used');
2
+ AbstractServerfulServer,
3
+ ConfigBuilder,
4
+ PLATFORMS,
5
+ } = require("@kumologica/runtime");
6
+ const tcpPortUsed = require("tcp-port-used");
7
7
 
8
+ const os = require("os");
8
9
  /**
9
10
  * This class will encapsulate the adminApp and FlowApp into two servers.
10
11
  * It will be the one running on the development box of the user (either local or remote),
@@ -12,155 +13,153 @@ const tcpPortUsed = require('tcp-port-used');
12
13
  */
13
14
 
14
15
  class DesignerServer {
15
-
16
- /**
17
- * @param {Object} options - Configuration options.
18
- * @param {string} options.flowPath - The path of the flow.
19
- * @param {boolean} options.safe - A boolean indicating safety.
20
- * @param {Object} options.cliParams - Command line parameters as an object.
21
- * @param {Object} options.editorApi - API object for the editor.
22
- * @param {Object} options.startupEmitter - EventEmitter object for handling events.
23
- * @param {string} options.platform - The platform to run on. Default LOCAL.
24
- */
25
- constructor(options) {
26
-
27
- if (!options.flowPath) {
28
- console.log(
29
- '[ERROR] Flow is not defined. Make sure you pass the flow file to the constructor of FlowBuilder'
30
- );
31
- os.exit(1);
32
- }
33
-
34
- this.editorApi = options.editorApi;
35
- this.startupEmitter = options.startupEmitter;
36
-
37
- this.config = ConfigBuilder.getInstance().buildConfig(
38
- options.flowPath,
39
- options.platform || PLATFORMS.LOCAL,
40
- options.cliParams
41
- );
42
- }
43
-
44
- async start() {
45
- // Check if port passed by parameter is available otherwise allocate a new one
46
- this.config.port = await this.allocatePort(this.config.port);
47
- this.flowServer = new AbstractServerfulServer(this.config, this.editorApi, this.startupEmitter);
48
-
49
- await this.flowServer.start();
50
- this.flowServer.log.debug(`Runtime Configuration:${JSON.stringify(this.config, null, 2)}`);
51
- }
52
-
53
- async allocatePort(port) {
54
- let inUse = await tcpPortUsed.check(port);
55
- if (inUse){
56
- let newPort = port + 1;
57
- console.log(`> Port: ${port} in use. Trying with port: ${newPort}...`);
58
- return await this.allocatePort(newPort);
59
- } else{
60
- return port;
61
- }
62
- }
63
-
64
- getFlowServer() {
65
- return this.flowServer;
66
- }
67
-
68
- getListeningPort() {
69
- return this.flowServer.serverSettings.port;
70
- }
71
-
72
- async stop() {
73
- await this.flowServer.stop();
74
- }
75
-
76
- /**
77
- * The express application for HTTP Nodes
78
- */
79
- get httpNode() {
80
- return this.flowServer.httpNode.expressApp;
81
- }
82
-
83
-
84
-
85
- /**
86
- * Pointer to the internal HTTP Server upon which all the express applications (Nodes and Admin) are deployed upon
87
- *
88
- * @readonly
89
- */
90
- get server() {
91
- return this.flowServer.server;
92
- }
93
-
94
- /**
95
- * Access to internal runtime api
96
- */
97
- get runtime() {
98
- return this.flowServer.runtime;
99
- }
100
-
101
-
102
-
103
- /**
104
- *
105
- * Returns the version of the runtime lib used internally
106
- * @readonly
107
- * @static
108
- */
109
- static get version() {
110
- return AbstractServerfulServer.version;
111
- }
112
-
113
- /**
114
- * This provides access to the internal settings module of the
115
- * runtime.
116
- * This is the object derived from the server settings.
117
- */
118
- get settings() {
119
- return this.flowServer._.settings;
120
- }
121
-
122
- /**
123
- * EventEmitter use to publish and subscribe to internal runtime events
124
- * For example:
125
- * runtime.events.on(
126
- * 'runtime-event',
127
- * (flowStarted = async data => {
128
- * if (data.id === 'flow-started') {
129
- * runtime.events.removeListener('runtime-event', flowStarted);
130
- *
131
- * @readonly
132
- */
133
- get events() {
134
- return this.flowServer.events;
135
- }
136
-
137
- get eventTypes() {
138
- return this.flowServer.runtimeEventTypes;
139
- }
140
-
141
- /**
142
- * This provides access to the internal nodes module of the
143
- * runtime. The details of this API remain undocumented as they should not
144
- * be used directly.
145
- *
146
- * Most administrative actions should be performed use the runtime api
147
- * under [node.runtime]
148
- */
149
- get nodes() {
150
- return this.flowServer._.nodes;
151
- }
152
-
153
- get log() {
154
- return this.flowServer.log;
155
- }
156
-
157
- get util() {
158
- return this.flowServer.util;
159
- }
160
-
161
-
16
+ /**
17
+ * @param {Object} options - Configuration options.
18
+ * @param {string} options.flowPath - The path of the flow.
19
+ * @param {boolean} options.safe - A boolean indicating safety.
20
+ * @param {Object} options.cliParams - Command line parameters as an object.
21
+ * @param {Object} options.editorApi - API object for the editor.
22
+ * @param {Object} options.startupEmitter - EventEmitter object for handling events.
23
+ * @param {string} options.platform - The platform to run on. Default LOCAL.
24
+ */
25
+ constructor(options) {
26
+ if (!options.flowPath) {
27
+ console.log(
28
+ "[ERROR] Flow is not defined. Make sure you pass the flow file to the constructor of FlowBuilder"
29
+ );
30
+ os.exit(1);
31
+ }
32
+
33
+ this.editorApi = options.editorApi;
34
+ this.startupEmitter = options.startupEmitter;
35
+
36
+ this.config = ConfigBuilder.getInstance().buildConfig(
37
+ options.flowPath,
38
+ options.platform || PLATFORMS.LOCAL,
39
+ options.cliParams
40
+ );
41
+ }
42
+
43
+ async start() {
44
+ // Check if port passed by parameter is available otherwise allocate a new one
45
+ this.config.port = await this.allocatePort(this.config.port);
46
+ this.flowServer = new AbstractServerfulServer(
47
+ this.config,
48
+ this.editorApi,
49
+ this.startupEmitter
50
+ );
51
+
52
+ await this.flowServer.start();
53
+ this.flowServer.log.debug(
54
+ `Runtime Configuration:${JSON.stringify(this.config, null, 2)}`
55
+ );
56
+ }
57
+
58
+ async allocatePort(port) {
59
+ let inUse = await tcpPortUsed.check(port);
60
+ if (inUse) {
61
+ let newPort = port + 1;
62
+ console.log(`> Port: ${port} in use. Trying with port: ${newPort}...`);
63
+ return await this.allocatePort(newPort);
64
+ } else {
65
+ return port;
66
+ }
67
+ }
68
+
69
+ getFlowServer() {
70
+ return this.flowServer;
71
+ }
72
+
73
+ getListeningPort() {
74
+ return this.flowServer.serverSettings.port;
75
+ }
76
+
77
+ async stop() {
78
+ await this.flowServer.stop();
79
+ }
80
+
81
+ /**
82
+ * The express application for HTTP Nodes
83
+ */
84
+ get httpNode() {
85
+ return this.flowServer.httpNode.expressApp;
86
+ }
87
+
88
+ /**
89
+ * Pointer to the internal HTTP Server upon which all the express applications (Nodes and Admin) are deployed upon
90
+ *
91
+ * @readonly
92
+ */
93
+ get server() {
94
+ return this.flowServer.server;
95
+ }
96
+
97
+ /**
98
+ * Access to internal runtime api
99
+ */
100
+ get runtime() {
101
+ return this.flowServer.runtime;
102
+ }
103
+
104
+ /**
105
+ *
106
+ * Returns the version of the runtime lib used internally
107
+ * @readonly
108
+ * @static
109
+ */
110
+ static get version() {
111
+ return AbstractServerfulServer.version;
112
+ }
113
+
114
+ /**
115
+ * This provides access to the internal settings module of the
116
+ * runtime.
117
+ * This is the object derived from the server settings.
118
+ */
119
+ get settings() {
120
+ return this.flowServer._.settings;
121
+ }
122
+
123
+ /**
124
+ * EventEmitter use to publish and subscribe to internal runtime events
125
+ * For example:
126
+ * runtime.events.on(
127
+ * 'runtime-event',
128
+ * (flowStarted = async data => {
129
+ * if (data.id === 'flow-started') {
130
+ * runtime.events.removeListener('runtime-event', flowStarted);
131
+ *
132
+ * @readonly
133
+ */
134
+ get events() {
135
+ return this.flowServer.events;
136
+ }
137
+
138
+ get eventTypes() {
139
+ return this.flowServer.runtimeEventTypes;
140
+ }
141
+
142
+ /**
143
+ * This provides access to the internal nodes module of the
144
+ * runtime. The details of this API remain undocumented as they should not
145
+ * be used directly.
146
+ *
147
+ * Most administrative actions should be performed use the runtime api
148
+ * under [node.runtime]
149
+ */
150
+ get nodes() {
151
+ return this.flowServer._.nodes;
152
+ }
153
+
154
+ get log() {
155
+ return this.flowServer.log;
156
+ }
157
+
158
+ get util() {
159
+ return this.flowServer.util;
160
+ }
162
161
  }
163
162
 
164
163
  module.exports = {
165
- DesignerServer,
164
+ DesignerServer,
166
165
  };