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
36 changes: 21 additions & 15 deletions EndtoEndTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ cleanup_function() {

#---------------------------------------------------------------------------------------------------



printf "\n${COLOR_CYAN}* Projects\n${COLOR_RESET}"
# Project Functions
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' project" "grep -c CLITestProject" "1" "Project List"
Expand All @@ -246,6 +244,7 @@ run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PAS

#Import project
run_test "node --no-deprecation wmiocli.js -d ${PROD_TENANT} -u ${USER} -p '${PASS}' project-import project.zip newnameproject" "grep 'IMPORT_SUCCESS' | wc -l" "1" "Import Project"
rm project.zip

#Delete Imported Project
run_test "node --no-deprecation wmiocli.js -d ${PROD_TENANT} -u ${USER} -p '${PASS}' project-delete $projectUid" "grep 'Project deleted successfully' | wc -l" "1" "Delete Imported Project"
Expand All @@ -260,8 +259,6 @@ run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PAS
#Update Project
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' project-update $projectUid changed" "grep 'changed' | wc -l" "1" "Update Project Name"



#---------------------------------------------------------------------------------------------------

#Triggers
Expand All @@ -277,7 +274,7 @@ run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PAS
#Delete Project
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' project-delete $projectUid" "grep 'Project deleted successfully' | wc -l" "1" "Delete Project"

#---------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------

printf "\n${COLOR_CYAN}* Publish/Deploy${COLOR_RESET}\n"
#Deploy & Publish
Expand Down Expand Up @@ -363,6 +360,7 @@ run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PAS
#---------------------------------------------------------------------------------------------------

#Workflows

printf "\n${COLOR_CYAN}* Worlkflows${COLOR_RESET}\n"
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' workflow-export CLITestProject fl835fe9b99489cc5c3dbdc8 wf.zip" "grep 'success' | wc -l" "1" "Export workflow"
run_test_return_value "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' workflow-import CLITestProject wf.zip" "grep uid | wc -l" "1" "jq -r .output.uid" "Import Workflow"
Expand All @@ -387,19 +385,27 @@ rm fs.zip

#---------------------------------------------------------------------------------------------------



printf "\n${COLOR_CYAN}* Theme${COLOR_RESET}\n"
run_test_return_value "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme" \
"grep 'settings' | wc -l" \
"1" \
"jq -r '.output[] | select(.name == \"ThemeRed\") | .uid'" \
"List Themes"
themeId=`echo $result`
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme ${themeId}" "grep 'settings' | wc -l" "1" "List Themes"


node --no-deprecation wmiocli.js -d "${DEV_TENANT}" -u "${USER}" -p "${PASS}" theme > theme.json
themeId=`jq -r '.output[] | select(.name == "ThemeRed") | .uid' theme.json`
themeText=`jq -r '.output[] | select(.name == "ThemeRed")' theme.json`


#run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme ${themeId}" "grep 'settings' | wc -l" "1" "Get Individual Theme"
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme ${themeId}" "grep 'settings' | wc -l" "1" "Get Individual Theme"
run_test_return_value "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme ${themeId}" "grep 'settings' | wc -l" "1" "cat" "Get Individual Theme"
themeText=$result
run_test_return_value "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme-create TestTheme 'Test Theme3' '$themeText'" "grep primaryColor | wc -l" "1" "jq -r .output.uid" "Theme create"
themeId=`echo $result`


#run_test_return_value "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme-create TestTheme 'Test Theme3' '$themeText'" "grep primaryColor | wc -l" "1" "jq -r .output.uid" "Theme create"
run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme-create TestTheme 'Test Theme3' '$themeText'" "grep primaryColor | wc -l" "1" "Theme create"
node --no-deprecation wmiocli.js -d "${DEV_TENANT}" -u "${USER}" -p "${PASS}" theme > theme.json
themeId=`jq -r '.output[] | select(.name == "TestTheme") | .uid' theme.json`
rm theme.json

run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme-update ${themeId} TestTheme 'Test Theme3' '$themeText'" "grep primaryColor | wc -l" "1" "Theme Update"

run_test "node --no-deprecation wmiocli.js -d ${DEV_TENANT} -u ${USER} -p '${PASS}' theme-activate ${themeId}" "grep '\"active\":true' | wc -l" "1" "Theme activate"
Expand Down
33 changes: 5 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,14 @@ This requires you to provide your tenant domain name, along with a user and pass
The --help parameter provides further information on how to use this along with some examples of its usage.

This CLI tool has been tested against
* webMethods.io Integration v11.0.6
* webMethods.io Integration v11.0.3

# License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.

Contact us via the TECHcommunity (https://techcommunity.softwareag.com/) if you have any questions.

# IMPORTANT
Due to a deprecated NPM library in a dependency of tough-cookie, if you're using a later version of node, you may see a deprecation notice for 'punycode'.
This has been resolved in tough-cookie but hasn't been released (only a release candidate is available). One this is released, this will be updated to resovle this.
In the meantime if you use this in scripts, you might want to suppress the deprecation notice as it may affect any parsing of results.

To do this run the cli tool as folows:
```
node --no-deprecation wmiocli.js ....
```


# Installation
```
git clone https://github.com/SoftwareAG/webmethods-io-integration-apicli.git
Expand All @@ -33,7 +23,7 @@ node wmiocli.js --help
# Usage

```
──────────────────────────────────────────────────────────────────────────────┐
──────────────────────────────────────────────────────────────────────────────┐
│ webMethods.io Integration API CLI tool │
│ This tool provides command line access to the webMethods.io Integration APIs │
│ Intended to aid usage within DevOps Scenarios for asset deployment │
Expand All @@ -57,7 +47,7 @@ Options:
--proxy <proxyURL> URL for proxy server if required
--caCert <path-to-cert> Path to a CACert PEM file if required
--ignoreTLSErrors Ignore TLS errors
--experimentalCommands Provide help information on experimental commands
--experimental Provide help information on experimental commands
-h, --help display help for command

Commands:
Expand Down Expand Up @@ -179,20 +169,6 @@ $ node wmiocli.js
-p password
project-delete fl65d3aa87fc1783ea5cf8c8

Export Project:
$ node wmiocli.js
-d tenant.int-aws-us.webmethods.io
-u user
-p password
project-export fl65d3aa87fc1783ea5cf8c8 myproject.zip

Import Project:
$ node wmiocli.js
-d tenant.int-aws-us.webmethods.io
-u user
-p password
project-export myproject.zip MyNewProjectName

Get Project Assets:
$ node wmiocli.js
-d tenant.int-aws-us.webmethods.io
Expand Down Expand Up @@ -613,4 +589,5 @@ $ node wmiocli.js
-p password
idm-user-unlock <userid>
where userid is the unique ID returned from the idm-user call

```
50 changes: 25 additions & 25 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
},
"homepage": "https://github.com/dpembo/wmiocli#readme",
"devDependencies": {
"commander": "^8.3.0"
"commander": "^12.1.0"
},
"dependencies": {
"formdata-node": "^6.0.3",
"https-proxy-agent": "^7.0.4",
"https-proxy-agent": "^7.0.5",
"log4js": "^6.9.1",
"node-fetch": "^3.3.2",
"readline-sync": "^1.4.10",
Expand Down
Loading
Loading