Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

const request = require("request");
const rest = require("./rest.js");

const crypto = require ('crypto');


var domainName, username,password,timeout;
Expand All @@ -36,6 +36,12 @@ var loginStageCounter = 0;
const maxRunningWorkflows = 20;


function generateUUID(){
var hexstring = crypto.randomBytes(16).toString("hex");
var guidstring = "UI-" + hexstring.substring(0,8) + "-" + hexstring.substring(8,12) + "-" + hexstring.substring(12,16) + "-" + hexstring.substring(16,20) + "-" + hexstring.substring(20);
return guidstring;
}

function debug(message){
dbg.message("<EXPERIMENTAL> " + message,4);
}
Expand Down Expand Up @@ -206,7 +212,9 @@ function setHeaders()
var headers = [
{name:"authtoken",value:authtoken},
{name:"accept",value:"application/json"},
{name:"x-csrf-token",value:csrf},
//{name:"x-csrf-token",value:csrf},
{name:"X-Requested-With",value:"XMLHttpRequest"},
{name:"X-Request-ID",value:generateUUID()},
];
return headers;
}
Expand Down Expand Up @@ -362,7 +370,8 @@ function processListResponse(url,err,body,res){
else
{
dbg.message("Failed to get Running Workflows",1)
dbg.message(err,1);
if(body!=null)dbg.message(JSON.stringify(body),1);
if(err!=null)dbg.message(JSON.stringify(err),2);
process.exit(99);
}
}
Expand Down Expand Up @@ -393,8 +402,8 @@ function processRunningResponse(url,err,body,res){
else
{
dbg.message("Failed to get Running Workflows",1)
dbg.message(err,4)
dbg.message(body,4)
if(body!=null)dbg.message(JSON.stringify(body),1);
if(err!=null)dbg.message(JSON.stringify(err),2);
process.exit(99);
}
}
Expand Down
108 changes: 54 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions wmiocli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Apache-2.0
*/

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


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

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