Skip to content

Commit 3a368c8

Browse files
authored
Merge pull request #9 from SoftwareAG/develop
Develop
2 parents 3e8163b + db498f5 commit 3a368c8

File tree

3 files changed

+71
-61
lines changed

3 files changed

+71
-61
lines changed

experimental.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
const request = require("request");
1313
const rest = require("./rest.js");
14-
14+
const crypto = require ('crypto');
1515

1616

1717
var domainName, username,password,timeout;
@@ -36,6 +36,12 @@ var loginStageCounter = 0;
3636
const maxRunningWorkflows = 20;
3737

3838

39+
function generateUUID(){
40+
var hexstring = crypto.randomBytes(16).toString("hex");
41+
var guidstring = "UI-" + hexstring.substring(0,8) + "-" + hexstring.substring(8,12) + "-" + hexstring.substring(12,16) + "-" + hexstring.substring(16,20) + "-" + hexstring.substring(20);
42+
return guidstring;
43+
}
44+
3945
function debug(message){
4046
dbg.message("<EXPERIMENTAL> " + message,4);
4147
}
@@ -206,7 +212,9 @@ function setHeaders()
206212
var headers = [
207213
{name:"authtoken",value:authtoken},
208214
{name:"accept",value:"application/json"},
209-
{name:"x-csrf-token",value:csrf},
215+
//{name:"x-csrf-token",value:csrf},
216+
{name:"X-Requested-With",value:"XMLHttpRequest"},
217+
{name:"X-Request-ID",value:generateUUID()},
210218
];
211219
return headers;
212220
}
@@ -362,7 +370,8 @@ function processListResponse(url,err,body,res){
362370
else
363371
{
364372
dbg.message("Failed to get Running Workflows",1)
365-
dbg.message(err,1);
373+
if(body!=null)dbg.message(JSON.stringify(body),1);
374+
if(err!=null)dbg.message(JSON.stringify(err),2);
366375
process.exit(99);
367376
}
368377
}
@@ -393,8 +402,8 @@ function processRunningResponse(url,err,body,res){
393402
else
394403
{
395404
dbg.message("Failed to get Running Workflows",1)
396-
dbg.message(err,4)
397-
dbg.message(body,4)
405+
if(body!=null)dbg.message(JSON.stringify(body),1);
406+
if(err!=null)dbg.message(JSON.stringify(err),2);
398407
process.exit(99);
399408
}
400409
}

package-lock.json

Lines changed: 54 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wmiocli.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Apache-2.0
55
*/
66

7-
const versionNo = "2022.10.1"
7+
const versionNo = "2022.11.1"
88
const { Command, Option } = require('commander');
99
const { exit } = require('process');
1010
const readline = require('readline-sync');
@@ -18,6 +18,7 @@ var flowservice = require('./flowservice.js');
1818
var experimental = require('./experimental.js');
1919
const { setLogLevel } = require('./debug.js');
2020

21+
2122
dbg = require('./debug.js');
2223
prettyprint = false;
2324
proxy = undefined;
@@ -658,7 +659,7 @@ program.command('flowservice-execute <project-id> <flow-name> [input-json]')
658659
experimental.projectDeployments(projectId);
659660
});
660661

661-
program.command('experimental-workflow-monitor [execution-status] [start-date] [end-date] [project-id] [workflow-id] ',{hidden: true})
662+
program.command('experimental-workflow-monitor [execution-status] [start-date] [end-date] [project-id] [workflow-id]',{hidden: true})
662663
.description('List Workflow Monitor')
663664
.action((executionStatus,startDate,endDate,projectId,workflowId) => {
664665
checkOptions();

0 commit comments

Comments
 (0)