Skip to content

Commit 2ca4d6b

Browse files
authored
Merge pull request #20 from SoftwareAG/development
Development
2 parents 780006d + 286dc76 commit 2ca4d6b

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

flowservice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function init(inDomainName, inUsername, inPassword,inTimeout,inPrettyPrint,proje
5858
timeout = inTimeout;
5959
prettyprint = inPrettyPrint;
6060

61-
url = "https://" + domainName + "/enterprise/v1/rest/projects/" + projectId ;
61+
url = "https://" + domainName + "/apis/v1/rest/projects/" + projectId ;
6262
debug("Username [" + username + "]");
6363
debug("URL [" + url + "]");
6464
debug("Timeout [" + timeout + "]");

projects.js

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,26 @@ $ node wmiocli.js
157157
-u user
158158
-p password
159159
project-triggers-delete project-uid trigger-uid
160+
161+
\x1b[32mList Reference Data List:\x1b[0m
162+
$ node wmiocli.js
163+
-d tenant.int-aws-us.webmethods.io
164+
-u user
165+
-p password
166+
referencedata project_name
167+
e.g.
168+
project-ref-data project-uid
169+
170+
\x1b[32mList Reference Data List:\x1b[0m
171+
$ node wmiocli.js
172+
-d tenant.int-aws-us.webmethods.io
173+
-u user
174+
-p password
175+
referencedata project_name ref-data-name <json/csv>
176+
177+
e.g.
178+
project-ref-data project-uid ref-data-name json
179+
project-ref-data project-uid ref-data-name csv
160180
`;
161181
}
162182
function init(inDomainName, inUsername, inPassword, inTimeout, inPrettyprint) {
@@ -190,6 +210,32 @@ function processResponse(data, status) {
190210
}
191211
}
192212

213+
/* reference data */
214+
function listRefData(projectId){
215+
debug("List Reference Data - Project [" + projectId + "]");
216+
url += "/" + projectId + "/referencedata";
217+
request.get(url, username, password, timeout, processResponse);
218+
}
219+
220+
function getRefData(projectId,refDataName,format){
221+
debug("Getting Reference Data - Project [" + projectId + "] name [" + refDataName + "] format [" + format + "]");
222+
url += "/" + projectId + "/referencedata + "/ + refDataName;
223+
if(format && format.toLowerCase()=="csv")request.getPlain(url, username, password, timeout, processResponse);
224+
else request.get(url, username, password, timeout, processResponse);
225+
}
226+
227+
function addRefData(projectId,name,description,filename,encoding,separator,qualifier){
228+
debug("Adding Reference Data to project [" + projectId + "]");
229+
var body={};
230+
body.name = name;
231+
body.description = description;
232+
//file
233+
body.file_encoding = encoding;
234+
body.field_separator = separator;
235+
body.text_qualifier=qualifier;
236+
}
237+
238+
193239
/* Projects */
194240
function list(projectId) {
195241

@@ -349,5 +395,6 @@ module.exports = {
349395
listAssets, listAssetsDetailed, pub, deploy,
350396
createParam, updateParam, listParam, deleteParam,
351397
listWebhooks, regenWebhook, setWebhookAuth,
352-
listTriggers, deleteTrigger
398+
listTriggers, deleteTrigger,
399+
listRefData, getRefData
353400
};

rest.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,17 @@ function requestModifiers(options){
6161
setignoreTLS(options);
6262
}
6363

64+
65+
function getPlain(restEndPoint,user,pass,timeout,callback)
66+
{
67+
get(restEndPoint,user,pass,timeout,callback,"text/plain")
68+
}
69+
6470
function get(restEndPoint,user,pass,timeout,callback)
71+
{
72+
get(restEndPoint,user,pass,timeout,callback,"application/json")
73+
}
74+
function get(restEndPoint,user,pass,timeout,callback,accept)
6575
{
6676
debug("GET:" + restEndPoint);
6777
var options = {
@@ -71,7 +81,7 @@ function get(restEndPoint,user,pass,timeout,callback)
7181
timeout: timeout*1000,
7282
headers: {
7383
'Content-Type': 'application/json',
74-
'Accept': 'application/json'
84+
'Accept': accept
7585
},
7686
auth: {
7787
username: user,
@@ -425,4 +435,4 @@ function custom(restEndPoint,user,pass,timeout,jsonBody,formBody,type,callback,c
425435
});
426436
}
427437

428-
module.exports = { get, post, put, del, postDownloadFile, postUploadFile, downloadFile, httpDelete, custom, addCookieToJar, displayCookies };
438+
module.exports = { get, getPlain, post, put, del, postDownloadFile, postUploadFile, downloadFile, httpDelete, custom, addCookieToJar, displayCookies };
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {}
8+
}

0 commit comments

Comments
 (0)