qcobjects-cli 2.3.50 → 2.4.21

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.
Files changed (36) hide show
  1. package/.github/FUNDING.yml +12 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  3. package/.github/ISSUE_TEMPLATE/custom.md +10 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. package/.github/ISSUE_TEMPLATE/issue-template.md +33 -0
  6. package/.github/workflows/codeql-analysis.yml +71 -0
  7. package/.github/workflows/npmpublish-beta.yml +38 -0
  8. package/.github/workflows/npmpublish-lts.yml +38 -0
  9. package/.github/workflows/npmpublish-main.yml +38 -0
  10. package/.gitlab-ci.yml +3 -2
  11. package/VERSION +1 -1
  12. package/backend/com.qcobjects.backend.microservice.static.js +40 -24
  13. package/backend/org.qcobjects.backend.php.js +149 -116
  14. package/{org.quickcorp.qcobjects.cli.commands.jira.client_services.js → com.qcobjects.cli.commands.jira.client_services.js} +29 -22
  15. package/{org.quickcorp.qcobjects.cli.commands.jira.js → com.qcobjects.cli.commands.jira.js} +77 -60
  16. package/{org.quickcorp.qcobjects.cli.commands.js → com.qcobjects.cli.commands.js} +3 -3
  17. package/com.qcobjects.cli.commands.version.js +285 -0
  18. package/org.qcobjects.common.pipelog.js +55 -0
  19. package/org.qcobjects.enterprise.commands.js +149 -139
  20. package/org.quickcorp.qcobjects.api.client_services.js +31 -20
  21. package/org.quickcorp.qcobjects.cli.js +288 -275
  22. package/org.quickcorp.qcobjects.collab.server.js +317 -308
  23. package/org.quickcorp.qcobjects.defaultsettings.js +1 -1
  24. package/org.quickcorp.qcobjects.main.file.js +100 -79
  25. package/org.quickcorp.qcobjects.main.http.gae.server.js +264 -232
  26. package/org.quickcorp.qcobjects.main.http.server.js +155 -145
  27. package/org.quickcorp.qcobjects.main.http2.server.js +198 -191
  28. package/package.json +18 -10
  29. package/qcobjects-cli.js +8 -11
  30. package/qcobjects-collab.js +8 -6
  31. package/qcobjects-createcert.js +28 -16
  32. package/qcobjects-gae-http-server.js +8 -5
  33. package/qcobjects-http-server.js +7 -5
  34. package/qcobjects-http2-server.js +8 -5
  35. package/qcobjects-shell.js +113 -107
  36. package/org.quickcorp.qcobjects.cli.commands.version.js +0 -267
@@ -1,5 +1,5 @@
1
1
  /**
2
- * QCObjects CLI 2.3.x
2
+ * QCObjects CLI 2.4.x
3
3
  * ________________
4
4
  *
5
5
  * Author: Jean Machuca <correojean@gmail.com>
@@ -28,7 +28,6 @@
28
28
  /*eslint strict: "off"*/
29
29
  /*eslint no-mixed-operators: "off"*/
30
30
  /*eslint no-undef: "off"*/
31
- /*eslint no-global-assign: "off"*/
32
31
  "use strict";
33
32
  const os = require("os");
34
33
  const fs = require("fs");
@@ -76,335 +75,345 @@ You can also use a Unix Socket to connect yourself to the engine:
76
75
 
77
76
  }
78
77
 
79
-
80
- Class("CollabServer",{
81
- runScript: function (context){
82
- const runScript = (code,logOutput=false)=>{
83
- const options = {filename:sandbox.__filename};
84
-
85
- const backgroundRunScript = (code)=>{
86
- var output = vm.runInContext(code,context,options);
87
- return output;
88
- };
89
-
90
- var output = backgroundRunScript(code);
91
-
92
-
93
- if (logOutput && typeof output !== "undefined"){
94
- console.log(output);
95
- }
96
- };
97
-
98
- },
99
- protected_symbols: [ "clearInterval",
100
- "clearTimeout",
101
- "setInterval",
102
- "setTimeout", "queueMicrotask",
103
- "clearImmediate", "setImmediate", "_asyncLoad",
104
- "_fireAsyncLoad", "asyncLoad", "logger",
105
- "_Crypt", "CONFIG", "waitUntil",
106
- "_super_", "ComplexStorageCache", "TagElements",
107
- "onload", "InheritClass", "Component",
108
- "Controller", "View", "Service",
109
- "JSONService", "ConfigService", "VO",
110
- "serviceLoader", "componentLoader", "ComponentURI",
111
- "SourceJS", "SourceCSS", "ArrayList",
112
- "ArrayCollection", "Effect", "Timer",
113
- "Export", "Import", "Package",
114
- "Class", "New", "Tag",
115
- "Ready", "Contact", "FormField",
116
- "ButtonField", "InputField", "TextField",
117
- "EmailField", "GridComponent", "GridController",
118
- "GridView", "Move", "RotateX",
119
- "RotateY", "RotateZ", "Rotate",
120
- "Fade", "Radius", "CanvasTool",
121
- "BasicLayout"
122
- ],
123
- commands: {
124
- loadcmd_json:{
125
- help: `
126
- Executes a CMD Shell Command
127
- and loads the stdout to a variable after trying to convert the result
128
- to JSON format
129
- The first argument is the variable name followed by an equal sign "=".
130
- Example:
131
- > .loadcmd_json result = cat somefile.json
132
-
133
- The above command will save the content of somefile.json using cat into the variable global.result
134
- as JSON format
135
- `,
136
- action(args) {
137
- let _rplServer = this;
138
- var commandArgs = args.split(" ");
139
- if (commandArgs.length>2){
140
- var _variableName = commandArgs[0];
141
- var _equal_sign = commandArgs[1].toString();
142
- if (_equal_sign === "="){
143
- var cmdArguments = commandArgs.slice(2).join(" ");
144
- _rplServer.clearBufferedCommand();
145
- logger.debug(`Executing... ${cmdArguments}`);
146
- exec(cmdArguments, (err, stdout, stderr) => {
147
- try {
148
- _rplServer.context[_variableName] = JSON.parse(stdout);
149
- } catch (e){
150
- logger.debug("It was not possible to parse the data.");
151
- }
78
+ Package("org.quickcorp.qcobjects.collab.server",[
79
+ class CollabServer extends InheritClass {
80
+ constructor(){
81
+ super(...arguments);
82
+ this.protected_symbols= [ "clearInterval",
83
+ "clearTimeout",
84
+ "setInterval",
85
+ "setTimeout", "queueMicrotask",
86
+ "clearImmediate", "setImmediate", "_asyncLoad",
87
+ "_fireAsyncLoad", "asyncLoad", "logger",
88
+ "_Crypt", "CONFIG", "waitUntil",
89
+ "_super_", "ComplexStorageCache", "TagElements",
90
+ "onload", "InheritClass", "Component",
91
+ "Controller", "View", "Service",
92
+ "JSONService", "ConfigService", "VO",
93
+ "serviceLoader", "componentLoader", "ComponentURI",
94
+ "SourceJS", "SourceCSS", "ArrayList",
95
+ "ArrayCollection", "Effect", "Timer",
96
+ "Export", "Import", "Package",
97
+ "Class", "New", "Tag",
98
+ "Ready", "Contact", "FormField",
99
+ "ButtonField", "InputField", "TextField",
100
+ "EmailField", "GridComponent", "GridController",
101
+ "GridView", "Move", "RotateX",
102
+ "RotateY", "RotateZ", "Rotate",
103
+ "Fade", "Radius", "CanvasTool",
104
+ "BasicLayout"
105
+ ];
106
+ this.commands= {
107
+ loadcmd_json:{
108
+ help: `
109
+ Executes a CMD Shell Command
110
+ and loads the stdout to a variable after trying to convert the result
111
+ to JSON format
112
+ The first argument is the variable name followed by an equal sign "=".
113
+ Example:
114
+ > .loadcmd_json result = cat somefile.json
115
+
116
+ The above command will save the content of somefile.json using cat into the variable global.result
117
+ as JSON format
118
+ `,
119
+ action(args) {
120
+ let _rplServer = this;
121
+ var commandArgs = args.split(" ");
122
+ if (commandArgs.length>2){
123
+ var _variableName = commandArgs[0];
124
+ var _equal_sign = commandArgs[1].toString();
125
+ if (_equal_sign === "="){
126
+ var cmdArguments = commandArgs.slice(2).join(" ");
127
+ _rplServer.clearBufferedCommand();
128
+ logger.debug(`Executing... ${cmdArguments}`);
129
+ exec(cmdArguments, (err, stdout, stderr) => {
130
+ try {
131
+ _rplServer.context[_variableName] = JSON.parse(stdout);
132
+ } catch (e){
133
+ logger.debug("It was not possible to parse the data.");
134
+ }
135
+ _rplServer.displayPrompt();
136
+ }).stdout.on("data", function(data) {
137
+ console.log(data);
138
+ });
139
+ } else {
140
+ console.log("That is no good my friend. You need to specify an equal sign.");
152
141
  _rplServer.displayPrompt();
153
- }).stdout.on("data", function(data) {
154
- console.log(data);
155
- });
142
+ }
156
143
  } else {
157
- console.log("That is no good my friend. You need to specify an equal sign.");
144
+ console.log("No enough data in the command line. Try .help");
158
145
  _rplServer.displayPrompt();
159
146
  }
160
- } else {
161
- console.log("No enough data in the command line. Try .help");
162
- _rplServer.displayPrompt();
163
147
  }
164
- }
165
- },
166
- loadcmd_str:{
167
- help: `
168
- Executes a CMD Shell Command
169
- and loads the stdout to a variable.
170
- The first argument is the variable name followed by an equal sign "=".
171
- Example:
172
- > .loadcmd_str foo = ls *
173
-
174
- The above command will save the output of "ls *" into the variable global.foo as string
175
- `,
176
- action(args) {
177
- let _rplServer = this;
178
- var commandArgs = args.split(" ");
179
- if (commandArgs.length>2){
180
- var _variableName = commandArgs[0];
181
- var _equal_sign = commandArgs[1].toString();
182
- if (_equal_sign === "="){
183
- var cmdArguments = commandArgs.slice(2).join(" ");
184
- _rplServer.clearBufferedCommand();
185
- logger.debug(`Executing... ${cmdArguments}`);
186
- exec(cmdArguments, (err, stdout, stderr) => {
187
- _rplServer.context[_variableName] = stdout;
148
+ },
149
+ loadcmd_str:{
150
+ help: `
151
+ Executes a CMD Shell Command
152
+ and loads the stdout to a variable.
153
+ The first argument is the variable name followed by an equal sign "=".
154
+ Example:
155
+ > .loadcmd_str foo = ls *
156
+
157
+ The above command will save the output of "ls *" into the variable global.foo as string
158
+ `,
159
+ action(args) {
160
+ let _rplServer = this;
161
+ var commandArgs = args.split(" ");
162
+ if (commandArgs.length>2){
163
+ var _variableName = commandArgs[0];
164
+ var _equal_sign = commandArgs[1].toString();
165
+ if (_equal_sign === "="){
166
+ var cmdArguments = commandArgs.slice(2).join(" ");
167
+ _rplServer.clearBufferedCommand();
168
+ logger.debug(`Executing... ${cmdArguments}`);
169
+ exec(cmdArguments, (err, stdout, stderr) => {
170
+ _rplServer.context[_variableName] = stdout;
171
+ _rplServer.displayPrompt();
172
+ }).stdout.on("data", function(data) {
173
+ console.log(data);
174
+ });
175
+ } else {
176
+ console.log("That is no good my friend. You need to specify an equal sign.");
188
177
  _rplServer.displayPrompt();
189
- }).stdout.on("data", function(data) {
190
- console.log(data);
191
- });
178
+ }
192
179
  } else {
193
- console.log("That is no good my friend. You need to specify an equal sign.");
180
+ console.log("No enough data in the command line. Try .help");
194
181
  _rplServer.displayPrompt();
195
182
  }
196
- } else {
197
- console.log("No enough data in the command line. Try .help");
198
- _rplServer.displayPrompt();
199
- }
200
- }
201
- },
202
- save_json:{
203
- help: `
204
- Serializes a variable using JSON.stringify
205
- and saves it in a file.
206
- The first argument is the variable name and the second argument is the name of the file.
207
- Example:
208
- > .save_json foo ./filename
209
-
210
- The above command will save the stringified content of foo into ./filename
211
- `,
212
- action(args) {
213
- let _rplServer = this;
214
- var commandArgs = args.split(" ");
215
- if (commandArgs.length>=2){
216
- var _variableName = commandArgs[0];
217
- var _filename = commandArgs[1].toString();
218
- logger.debug(`Saving variable ${_variableName} in ${_filename}...`);
219
- var data = JSON.stringify(_rplServer.context[_variableName]);
220
- fs.writeFile(_filename, data, (err) => {
221
- if (err) throw err;
222
- logger.debug(`The data of the file ${_filename} has been saved!`);
223
- _rplServer.displayPrompt();
224
- });
225
-
226
- } else {
227
- console.log("No enough data in the command line. Try .help");
228
- _rplServer.displayPrompt();
229
183
  }
230
- }
231
- },
232
- load_json:{
233
- help: `
234
- Loads a json from a file and saves it into a variable.
235
- The first argument is the variable name and the second argument is the name of the file.
236
- Example:
237
- > .load_json foo = ./filename
238
-
239
- The above command will load a json from ./filename and save it in global.foo as an object
240
- `,
241
- action(args) {
242
- let _rplServer = this;
243
- var commandArgs = args.split(" ");
244
- if (commandArgs.length>2){
245
- var _variableName = commandArgs[0];
246
- var _equal_sign = commandArgs[1].toString();
247
- if (_equal_sign === "="){
248
- var _filename = commandArgs[2].toString();
249
- logger.debug(`Trying to read ${_variableName} from ${_filename}...`);
250
- fs.readFile(_filename,(err, data) => {
184
+ },
185
+ save_json:{
186
+ help: `
187
+ Serializes a variable using JSON.stringify
188
+ and saves it in a file.
189
+ The first argument is the variable name and the second argument is the name of the file.
190
+ Example:
191
+ > .save_json foo ./filename
192
+
193
+ The above command will save the stringified content of foo into ./filename
194
+ `,
195
+ action(args) {
196
+ let _rplServer = this;
197
+ var commandArgs = args.split(" ");
198
+ if (commandArgs.length>=2){
199
+ var _variableName = commandArgs[0];
200
+ var _filename = commandArgs[1].toString();
201
+ logger.debug(`Saving variable ${_variableName} in ${_filename}...`);
202
+ var data = JSON.stringify(_rplServer.context[_variableName]);
203
+ fs.writeFile(_filename, data, (err) => {
251
204
  if (err) throw err;
252
- try {
253
- _rplServer.context[_variableName] = JSON.parse(data.toString());
254
- logger.debug(`The data of the file ${_filename} has been loaded!`);
255
- } catch (e){
256
- logger.debug("It was not possible to parse the data.");
257
- }
205
+ logger.debug(`The data of the file ${_filename} has been saved!`);
258
206
  _rplServer.displayPrompt();
259
207
  });
208
+
260
209
  } else {
261
- console.log("That is no good my friend. You need to specify an equal sign.");
210
+ console.log("No enough data in the command line. Try .help");
262
211
  _rplServer.displayPrompt();
263
212
  }
264
-
265
- } else {
266
- console.log("No enough data in the command line. Try .help");
267
- _rplServer.displayPrompt();
268
213
  }
269
- }
270
- },
271
- cmd:{
272
- help: "Executes a CMD Shell Command",
273
- action() {
274
- let _rplServer = this;
275
- var cmdArguments = [...arguments].join(" ");
276
- _rplServer.clearBufferedCommand();
277
- logger.debug(`Executing... ${cmdArguments}`);
278
- exec(cmdArguments, (err, stdout, stderr) => {
279
- _rplServer.displayPrompt();
280
- }).stdout.on("data", function(data) {
281
- console.log(data);
282
- });
283
- }
284
- }
285
- },
286
- start:function (){
287
-
288
- var collabServer = this;
289
- const vm = require("vm");
290
- let sandbox = {
291
- require:require,
292
- module:module,
293
- __dirname:"./",
294
- __filename:"qcobjects-collab"
295
- };
296
- global = require("qcobjects");
297
- global.require = require.bind(global);
298
- global.module = module;
299
- global.__dirname = "./";
300
- global.__filename = "qcobjects-collab";
301
- global = vm.createContext(global);
302
-
303
- var net = require("net"),
304
- repl = require("repl");
305
-
306
- global.connections = 0;
307
-
308
- function unlink_socket (){
309
- try {
310
- logger.debug("Trying to delete the socket... ");
311
- fs.unlink(CONFIG.get("collab-unix-socket",unixsocket_default), (err) => {
312
- if (err) {
313
- logger.debug("Unix Socket does not exist");
214
+ },
215
+ load_json:{
216
+ help: `
217
+ Loads a json from a file and saves it into a variable.
218
+ The first argument is the variable name and the second argument is the name of the file.
219
+ Example:
220
+ > .load_json foo = ./filename
221
+
222
+ The above command will load a json from ./filename and save it in global.foo as an object
223
+ `,
224
+ action(args) {
225
+ let _rplServer = this;
226
+ var commandArgs = args.split(" ");
227
+ if (commandArgs.length>2){
228
+ var _variableName = commandArgs[0];
229
+ var _equal_sign = commandArgs[1].toString();
230
+ if (_equal_sign === "="){
231
+ var _filename = commandArgs[2].toString();
232
+ logger.debug(`Trying to read ${_variableName} from ${_filename}...`);
233
+ fs.readFile(_filename,(err, data) => {
234
+ if (err) throw err;
235
+ try {
236
+ _rplServer.context[_variableName] = JSON.parse(data.toString());
237
+ logger.debug(`The data of the file ${_filename} has been loaded!`);
238
+ } catch (e){
239
+ logger.debug("It was not possible to parse the data.");
240
+ }
241
+ _rplServer.displayPrompt();
242
+ });
243
+ } else {
244
+ console.log("That is no good my friend. You need to specify an equal sign.");
245
+ _rplServer.displayPrompt();
246
+ }
247
+
248
+ } else {
249
+ console.log("No enough data in the command line. Try .help");
250
+ _rplServer.displayPrompt();
314
251
  }
315
- logger.debug("Unix Socket was deleted before start");
316
- });
317
- } catch (e){
318
- // socket doesnt exists
319
- logger.debug("Unix Socket was not deleted");
252
+ }
253
+ },
254
+ cmd:{
255
+ help: "Executes a CMD Shell Command",
256
+ action() {
257
+ let _rplServer = this;
258
+ var cmdArguments = [...arguments].join(" ");
259
+ _rplServer.clearBufferedCommand();
260
+ logger.debug(`Executing... ${cmdArguments}`);
261
+ exec(cmdArguments, (err, stdout, stderr) => {
262
+ _rplServer.displayPrompt();
263
+ }).stdout.on("data", function(data) {
264
+ console.log(data);
265
+ });
266
+ }
320
267
  }
268
+ };
269
+
321
270
  }
322
-
323
- unlink_socket();
324
-
325
- var _defineReplCommands = function (_cmdReplServer,commands){
326
- for (var _command in commands){
327
- _cmdReplServer.defineCommand(_command, commands[_command]);
271
+
272
+ runScript(context){
273
+ const runScript = (code,logOutput=false)=>{
274
+ const options = {filename:sandbox.__filename};
275
+
276
+ const backgroundRunScript = (code)=>{
277
+ var output = vm.runInContext(code,context,options);
278
+ return output;
279
+ };
280
+
281
+ var output = backgroundRunScript(code);
282
+
283
+
284
+ if (logOutput && typeof output !== "undefined"){
285
+ console.log(output);
286
+ }
287
+ };
288
+
289
+ }
290
+
291
+ start (){
292
+
293
+ var collabServer = this;
294
+ const vm = require("vm");
295
+ let sandbox = {
296
+ require:require,
297
+ module:module,
298
+ __dirname:"./",
299
+ __filename:"qcobjects-collab"
300
+ };
301
+ global = require("qcobjects");
302
+ global.require = require.bind(global);
303
+ global.module = module;
304
+ global.__dirname = "./";
305
+ global.__filename = "qcobjects-collab";
306
+ global = vm.createContext(global);
307
+
308
+ var net = require("net"),
309
+ repl = require("repl");
310
+
311
+ global.connections = 0;
312
+
313
+ function unlink_socket (){
314
+ try {
315
+ logger.debug("Trying to delete the socket... ");
316
+ fs.unlink(CONFIG.get("collab-unix-socket",unixsocket_default), (err) => {
317
+ if (err) {
318
+ logger.debug("Unix Socket does not exist");
319
+ }
320
+ logger.debug("Unix Socket was deleted before start");
321
+ });
322
+ } catch (e){
323
+ // socket doesnt exists
324
+ logger.debug("Unix Socket was not deleted");
325
+ }
328
326
  }
329
- };
330
-
331
- let replServer = repl.start({
332
- useColors: true,
333
- prompt:"QCObjects Collab> ",
334
- terminal: true,
335
- useGlobal: false
336
- });
337
- replServer.context = global;
338
-
339
- replServer.on("exit", () => {
327
+
340
328
  unlink_socket();
341
-
342
- console.log("Thank you for using QCObjects Collab for Data Science!");
343
- console.log("Have a nice day!");
344
- process.exit();
345
- });
346
- _defineReplCommands(replServer,collabServer.commands);
347
-
348
-
349
-
350
- let unixsocket_server = net.createServer(function (unixsocket) {
351
- unixsocket.on("end", () => {
352
- logger.debug("A Unix socket connection was ended");
353
- });
354
- global.connections += 1;
355
- let unixReplServer = repl.start({
356
- prompt: "QCObjects Collab> "
357
- , input: unixsocket
358
- , output: unixsocket
359
- , terminal: true
360
- , useGlobal: false
361
- });
362
- unixReplServer.on("exit", function () {
363
- unixsocket.end();
364
- });
365
- unixReplServer.context=global;
366
- _defineReplCommands(unixReplServer,collabServer.commands);
367
- }).listen(CONFIG.get("collab-unix-socket",unixsocket_default));
368
-
369
-
370
- let http_server = net.createServer(function (httpsocket) {
371
- httpsocket.on("end", () => {
372
- logger.debug("A http connection was ended");
329
+
330
+ var _defineReplCommands = function (_cmdReplServer,commands){
331
+ for (var _command in commands){
332
+ _cmdReplServer.defineCommand(_command, commands[_command]);
333
+ }
334
+ };
335
+
336
+ let replServer = repl.start({
337
+ useColors: true,
338
+ prompt:"QCObjects Collab> ",
339
+ terminal: true,
340
+ useGlobal: false
341
+ });
342
+ replServer.context = global;
343
+
344
+ replServer.on("exit", () => {
345
+ unlink_socket();
346
+
347
+ console.log("Thank you for using QCObjects Collab for Data Science!");
348
+ console.log("Have a nice day!");
349
+ process.exit();
373
350
  });
374
- global.connections += 1;
375
- let httpReplServer = repl.start({
376
- prompt: "QCObjects Collab> "
377
- , input: httpsocket
378
- , output: httpsocket
379
- , terminal: true
380
- , useGlobal: false
351
+ _defineReplCommands(replServer,collabServer.commands);
352
+
353
+
354
+
355
+ let unixsocket_server = net.createServer(function (unixsocket) {
356
+ unixsocket.on("end", () => {
357
+ logger.debug("A Unix socket connection was ended");
358
+ });
359
+ global.connections += 1;
360
+ let unixReplServer = repl.start({
361
+ prompt: "QCObjects Collab> "
362
+ , input: unixsocket
363
+ , output: unixsocket
364
+ , terminal: true
365
+ , useGlobal: false
366
+ });
367
+ unixReplServer.on("exit", function () {
368
+ unixsocket.end();
369
+ });
370
+ unixReplServer.context=global;
371
+ _defineReplCommands(unixReplServer,collabServer.commands);
372
+ }).listen(CONFIG.get("collab-unix-socket",unixsocket_default));
373
+
374
+
375
+ let http_server = net.createServer(function (httpsocket) {
376
+ httpsocket.on("end", () => {
377
+ logger.debug("A http connection was ended");
378
+ });
379
+ global.connections += 1;
380
+ let httpReplServer = repl.start({
381
+ prompt: "QCObjects Collab> "
382
+ , input: httpsocket
383
+ , output: httpsocket
384
+ , terminal: true
385
+ , useGlobal: false
386
+ });
387
+ httpReplServer.on("exit", function () {
388
+ httpsocket.end();
389
+ });
390
+ httpReplServer.context=global;
391
+ _defineReplCommands(httpReplServer,collabServer.commands);
392
+ }).listen(CONFIG.get("collab-port",collab_port_default),CONFIG.get("collab-domain",collab_domain_default));
393
+
394
+
395
+ http_server.on("error", function (e) {
396
+ if (e.code == "EADDRINUSE") {
397
+ console.log("Collab HTTP Address in use, retrying...");
398
+ setTimeout(function () {
399
+ http_server.close();
400
+ http_server.listen(CONFIG.get("collab-port",collab_port_default),CONFIG.get("collab-domain",collab_domain_default));
401
+ }, 1000);
402
+ }
381
403
  });
382
- httpReplServer.on("exit", function () {
383
- httpsocket.end();
404
+
405
+ unixsocket_server.on("error", function (e) {
406
+ if (e.code == "EADDRINUSE") {
407
+ console.log("Collab Unix Socket Address in use, retrying...");
408
+ setTimeout(function () {
409
+ unixsocket_server.close();
410
+ unixsocket_server.listen(CONFIG.get("collab-unix-socket",unixsocket_default));
411
+ }, 1000);
412
+ }
384
413
  });
385
- httpReplServer.context=global;
386
- _defineReplCommands(httpReplServer,collabServer.commands);
387
- }).listen(CONFIG.get("collab-port",collab_port_default),CONFIG.get("collab-domain",collab_domain_default));
388
-
389
-
390
- http_server.on("error", function (e) {
391
- if (e.code == "EADDRINUSE") {
392
- console.log("Collab HTTP Address in use, retrying...");
393
- setTimeout(function () {
394
- http_server.close();
395
- http_server.listen(CONFIG.get("collab-port",collab_port_default),CONFIG.get("collab-domain",collab_domain_default));
396
- }, 1000);
397
- }
398
- });
399
-
400
- unixsocket_server.on("error", function (e) {
401
- if (e.code == "EADDRINUSE") {
402
- console.log("Collab Unix Socket Address in use, retrying...");
403
- setTimeout(function () {
404
- unixsocket_server.close();
405
- unixsocket_server.listen(CONFIG.get("collab-unix-socket",unixsocket_default));
406
- }, 1000);
407
- }
408
- });
414
+ }
415
+
416
+
409
417
  }
410
- });
418
+
419
+ ]);