Skip to content

Commit f62e1f4

Browse files
committed
added help text
added theme activate/deactivate
1 parent 6f295e6 commit f62e1f4

File tree

2 files changed

+177
-7
lines changed

2 files changed

+177
-7
lines changed

themes.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,19 @@ function del(themeUid){
150150
request.httpDelete(url,username,password,timeout,data,processResponse);
151151
}
152152

153+
function activate(themeUid){
154+
debug("Activate Theme UID [" + themeUid + "]");
155+
url += "/" + themeUid + "/activate";
156+
var data={};
157+
request.put(url,username,password,timeout,data,processResponse);
158+
}
159+
160+
function deactivate(themeUid){
161+
debug("Deactivate Theme UID [" + themeUid + "]");
162+
url += "/" + themeUid + "/deactivate";
163+
var data={};
164+
request.put(url,username,password,timeout,data,processResponse);
165+
}
153166

154167
//, update, del, default, activate, deactivate
155-
module.exports = {init, list, create,update,del};
168+
module.exports = {init, list, create,update,del,activate,deactivate};

wmiocli.js

Lines changed: 163 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const program = new Command();
7777
program
7878

7979
//Program Info
80-
.version('2022.07.2')
80+
.version('2022.07.3')
8181

8282
//required options
8383
.option('-d, --domain <tenantDomain>', 'Tenant Doamin Name, e.g. "tenant.int-aws-us.webmethods.io"')
@@ -157,20 +157,79 @@ Examples:
157157
-p password
158158
project-assets fl65d3aa87fc1783ea5cf8c8
159159
160-
\x1b[32m/Publish Project to another tenant:\x1b[0m
160+
\x1b[32mPublish Project to another tenant:\x1b[0m
161161
$ node wmiocli.js
162162
-d tenant.int-aws-us.webmethods.io
163163
-u user
164164
-p password
165-
project-publish fl65d3aa87fc1783ea5cf8c8 'My deployment' 'target.int-aws-us.webmethods.io' 'targetuser' 'targetpassword' '{"output":{"workflows":["fla73a20e13dd6736cf9c355","fl3cfd145262bbc5d44acff3"],"flows":["mapLeads"],"rest_api":[],"soap_api":[],"listener":[],"messaging":[]}}'
165+
project-publish fl65d3aa87fc1783ea5cf8c8 'My deployment' 'target.int-aws-us.webmethods.io'
166+
'targetuser' 'targetpassword'
167+
'{"output":{"workflows":["fla73a20e13dd6736cf9c355","fl3cfd145262bbc5d44acff3"],
168+
"flows":["mapLeads"],"rest_api":[],"soap_api":[],"listener":[],"messaging":[]}}'
166169
167170
168-
\x1b[32m/Deploy published Project in the tenant with the given name and deploy version:\x1b[0m
171+
\x1b[32mDeploy published Project in the tenant with the given name and deploy version:\x1b[0m
169172
$ node wmiocli.js
170173
-d tenant.int-aws-us.webmethods.io
171174
-u user
172175
-p password
173-
project-deploy projectName 1
176+
project-deploy projectName 1
177+
178+
179+
\x1b[32mList Project Workflow Parameters or gets an individual where name is specified\x1b[0m
180+
$ node wmiocli.js
181+
-d tenant.int-aws-us.webmethods.io
182+
-u user
183+
-p password
184+
project-param projectName [param-name]
185+
186+
\x1b[32mCreate Project Workflow Parameter\x1b[0m
187+
$ node wmiocli.js
188+
-d tenant.int-aws-us.webmethods.io
189+
-u user
190+
-p password
191+
project-param-create projectName param-name param-value required isPassword
192+
193+
e.g. node wmiocli.js -d env -u user -p pass project-param-create project name dave false false
194+
195+
\x1b[32mUpdate Project Workflow Parameter\x1b[0m
196+
$ node wmiocli.js
197+
-d tenant.int-aws-us.webmethods.io
198+
-u user
199+
-p password
200+
project-param-update projectName param-uid param-name param-value required isPassword
201+
202+
\x1b[32mDelete Project Workflow Parameter\x1b[0m
203+
$ node wmiocli.js
204+
-d tenant.int-aws-us.webmethods.io
205+
-u user
206+
-p password
207+
project-param-delete projectName param-uid
208+
209+
\x1b[32mProject webhooks List\x1b[0m
210+
$ node wmiocli.js
211+
-d tenant.int-aws-us.webmethods.io
212+
-u user
213+
-p password
214+
project-webhooks-list [project-uid]
215+
216+
\x1b[32mRegenerate webhook token\x1b[0m
217+
$ node wmiocli.js
218+
-d tenant.int-aws-us.webmethods.io
219+
-u user
220+
-p password
221+
project-webhooks-regenerate project-uid webhook-uid
222+
223+
\x1b[32mChange webhook Auth\x1b[0m
224+
$ node wmiocli.js
225+
-d tenant.int-aws-us.webmethods.io
226+
-u user
227+
-p password
228+
project-webhooks-auth project-uid webhook-uid auth-type<none,login,token>
229+
230+
e.g.
231+
node wmiocli.js -d env -u user -p pass project-webhooks-auth flf1111 flf2222 login
232+
174233
175234
\x1b[4mWorkflow\x1b[0m
176235
@@ -271,9 +330,91 @@ Examples:
271330
-d tenant.int-aws-us.webmethods.io
272331
-u user
273332
-p password
274-
role-delete 'roleId'
333+
role-delete 'roleId'
334+
335+
336+
\x1b[4mRecipes\x1b[0m
337+
338+
\x1b[32mGet recipe list or individual recipe\x1b[0m
339+
$ node wmiocli.js
340+
-d tenant.int-aws-us.webmethods.io
341+
-u user
342+
-p password
343+
recipe [recipe-Uid]
344+
345+
\x1b[32mCreates a Workflow recipe from a workflow export\x1b[0m
346+
$ node wmiocli.js
347+
-d tenant.int-aws-us.webmethods.io
348+
-u user
349+
-p password
350+
recipe-create export-flf111111.zip
351+
352+
\x1b[32mDeletes a Workflow recipe with the provided UID\x1b[0m
353+
$ node wmiocli.js
354+
-d tenant.int-aws-us.webmethods.io
355+
-u user
356+
-p password
357+
recipe-delete fl1771d591cfb4f31e558daf
358+
359+
360+
\x1b[4mThemes\x1b[0m
361+
362+
\x1b[32mLists whitelabel themes\x1b[0m
363+
$ node wmiocli.js
364+
-d tenant.int-aws-us.webmethods.io
365+
-u user
366+
-p password
367+
theme [theme-uid]
368+
369+
The theme settings returned can be use as a way to create the theme.
370+
You can use jq to retrieve the theme settings by piping the output to jq, e.g.
371+
372+
node wmiocli.js -d env -u user -p pass theme fl40018d9a1a273bb8aa92bf | jq -c .output.settings.theme > ~/dracula-theme.txt
373+
374+
\x1b[32mDeletes a whitelabel theme\x1b[0m
375+
$ node wmiocli.js
376+
-d tenant.int-aws-us.webmethods.io
377+
-u user
378+
-p password
379+
theme-delete [theme-uid]
380+
381+
\x1b[32mCreates a new whitelabel theme\x1b[0m
382+
$ node wmiocli.js
383+
-d tenant.int-aws-us.webmethods.io
384+
-u user
385+
-p password
386+
theme-create dracula 'desc' [theme-settings] "Footer Text" "About Page"
387+
388+
Theme settings can be used from the list example above, e.g.
389+
node wmiocli.js -d env -u user -p pass theme-create dracula7 'updated' "\`cat ~/dracula-theme.txt\`" 'Footer' 'About'
390+
391+
\x1b[32mUpdates a whitelabel theme\x1b[0m
392+
$ node wmiocli.js
393+
-d tenant.int-aws-us.webmethods.io
394+
-u user
395+
-p password
396+
theme-update themeid dracula 'desc' [theme-settings] "Footer Text" "About Page"
397+
398+
Theme settings can be used from the list example above, e.g.
399+
node wmiocli.js -d env -u user -p pass theme-update themeid dracula7 'updated' "\`cat ~/dracula-theme.txt\`" 'Footer' 'About'
400+
401+
\x1b[32mActivates a whitelabel theme\x1b[0m
402+
$ node wmiocli.js
403+
-d tenant.int-aws-us.webmethods.io
404+
-u user
405+
-p password
406+
theme-activate [theme-uid]
407+
408+
\x1b[32mDeactivates a whitelabel theme\x1b[0m
409+
$ node wmiocli.js
410+
-d tenant.int-aws-us.webmethods.io
411+
-u user
412+
-p password
413+
theme-deactivate [theme-uid]
414+
275415
`)
276416

417+
277418
.showSuggestionAfterError()
278419
;
279420

@@ -598,6 +739,22 @@ program.command('flowservice-execute <project-id> <flow-name> [input-json]')
598739
theme.del(themeUid);
599740
});
600741

742+
program.command('theme-activate <theme-uid>')
743+
.description('Activate theme with the given UID')
744+
.action((themeUid) => {
745+
checkOptions();
746+
theme.init(tenantDomain,tenantUser,tenantPw,program.opts().timeout,program.opts().prettyprint)
747+
theme.activate(themeUid);
748+
});
749+
750+
program.command('theme-deactivate <theme-uid>')
751+
.description('Deactivate theme with the given UID')
752+
.action((themeUid) => {
753+
checkOptions();
754+
theme.init(tenantDomain,tenantUser,tenantPw,program.opts().timeout,program.opts().prettyprint)
755+
theme.deactivate(themeUid);
756+
});
757+
601758
/**
602759
* ------------------------------------------------------------------------------------------------------------------------------------
603760
* Recipes

0 commit comments

Comments
 (0)