diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..6be900a --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '24 20 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..fa6dafb --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm install + #- run: npm ci + #- run: npm run build --if-present + #- run: npm test diff --git a/README.md b/README.md index eda926a..c51dd76 100644 --- a/README.md +++ b/README.md @@ -29,191 +29,160 @@ node wmiocli.js --help │ Intended to aid usage within DevOps Scenarios for asset deployment │ └──────────────────────────────────────────────────────────────────────────────┘ + + Usage: wmiocli [options] [command] Options: - -V, --version - output the version number - -d, --domain - Tenant Doamin Name, e.g. "tenant.int-aws-us.webmethods.io" - -u, --user - Tenant User ID - -p, --password - Tenant User Password - -t, --timeout - timeout in seconds (default: one minute) - --prettyprint - Pretty Print JSON output - --verbose - Verbose output useful for diagnosing issues - -h, --help - display help for command + -V, --version output the version number + -d, --domain Tenant Doamin Name, e.g. "tenant.int-aws-us.webmethods.io" + -u, --user Tenant User ID + -p, --password Tenant User Password + -t, --timeout timeout in seconds (default: one minute) + --prettyprint Pretty Print JSON output + --verbose Enables full debug mode (replaced by --loglevel DEBUG) + --loglevel Change the logging level of DEBUG, INFO,WARN,ERROR,OFF (default being off) + --proxy URL for proxy server if required + --caCert Path to a CACert PEM file if required + --ignoreTLSErrors Ignore TLS errors + -h, --help display help for command Commands: - project [project-name] - Lists all projects or view an individual project, specified via project name or uid - project-assets - Lists project assets from given project name or uid - project-create - Create project with given name - project-update - Update project with new name - project-delete - Delete project with given id + project [project-name] Lists all projects or view an individual project, specified via project name or uid + project-assets Lists project assets from given project name or uid + project-assets-detailed Lists project assets (All Details) from given project name or uid + project-create Create project with given name + project-update Update project with new name + project-delete Delete project with given id project-publish Pubilsh project to another tenant with given id - project-deploy - deploy published project with given version into tenant - project-param [param-uid] - Lists all project parameters from given project name, or specific parameter with given paramater uid - project-param-create - Creates a project parameter with given values - project-param-update - Updates a project parameter matching the provided UID with given values - project-param-delete - Deletes a project parameter mathcing the given paramater uid - project-webhooks-list - List webhooks in a project - project-webhooks-regenerate - Regenerate a webhook in a project for a given workflow UID - project-webhooks-auth - Set authenatication type (none,login,token) for a webhook in a project for a given workflow UID - role [role-id] - Lists all roles or views an individual role - role-create - Create roles and specify the permissions for that role. Roles-list should be provided as follows projectName,r,w,e;project name 2,r; - role-update - Create roles and specify the permissions for that role. Roles-list should be provided as follows projectName,r,w,e;project name 2,r; - role-delete - Delete a roles with the given role id - user - Lists all users - user-role-assignment - Assigns a user to roles - workflow-export - Export workflow with id from project - workflow-import - Import workflow into project from file - workflow-delete - Delete workflow from project - workflow-execute - Execute workflow from project - workflow-status - Gets Execution status for workflow execution - flowservice-export - Export FlowService with name from project - flowservice-import - Import FlowService from into project - flowservice-delete - Delete FlowService from project - flowservice-execute [input-json] - Execute FlowService from project with data - theme [theme-uid] - Lists themes or views an individual theme, specified via uid - theme-create [footer-text] [about-page] - Create theme with given data - theme-update [footer-text] [about-page] - Update theme with the given UID with given data - theme-delete - Delete theme with the given UID - theme-activate - Activate theme with the given UID - theme-deactivate - Deactivate theme with the given UID - recipe [recipe-uid] - List all Workflow recipes, or get a single recipe with a given recipe UID - recipe-delete - Delete Workflow recipe with a given recipe UID - recipe-create - Create Workfllow Receipt from file - unofficial [recipe-uid] - List all Workflow recipes, or get a single recipe with a given recipe UID - help [command] - display help for command + project-deploy deploy published project with given version into tenant + project-param [param-uid] Lists all project parameters from given project name, or specific parameter with given parameter uid + project-param-create Creates a project parameter with given values + project-param-update Updates a project parameter matching the provided UID with given values + project-param-delete Deletes a project parameter mathcing the given paramater uid + project-webhooks-list List webhooks in a project + project-webhooks-regenerate Regenerate a webhook in a project for a given workflow UID + project-webhooks-auth Set authenatication type (none,login,token) for a webhook in a project for a given workflow UID + project-triggers-list Provide a list of triggers within a project + project-triggers-delete Delete a trigger within a project with the given IDs + role [role-id] Lists all roles or views an individual role + role-create Create roles and specify the permissions for that role. Roles-list should be provided as follows projectName,r,w,e;project name 2,r; + role-update Create roles and specify the permissions for that role. Roles-list should be provided as follows projectName,r,w,e;project name 2,r; + role-delete Delete a roles with the given role id + user Lists all users + user-role-assignment Assigns a user to roles + workflow-export Export workflow with id from project + workflow-import Import workflow into project from file + workflow-delete Delete workflow from project + workflow-execute Execute workflow from project + workflow-status Gets Execution status for workflow execution + workflow-create Creates a blank workflow with the given name/description + flowservice-export Export FlowService with name from project + flowservice-import Import FlowService from into project + flowservice-delete Delete FlowService from project + flowservice-execute [input-json] Execute FlowService from project with data + theme [theme-uid] Lists themes or views an individual theme, specified via uid + theme-create [footer-text] [about-page] Create theme with given data + theme-update [footer-text] [about-page] Update theme with the given UID with given data + theme-delete Delete theme with the given UID + theme-activate Activate theme with the given UID + theme-deactivate Deactivate theme with the given UID + recipe [recipe-uid] List all Workflow recipes, or get a single recipe with a given recipe UID + recipe-delete Delete Workflow recipe with a given recipe UID + recipe-create Create Workfllow Receipt from file + help [command] display help for command Examples: - Help +Help - Show the command line help: - $ node wmiocli.js --help +Show the command line help: +$ node wmiocli.js --help - Projects +Projects - List projects in a tenant: - $ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project +List projects in a tenant: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project - View individual project using project ID (indentified from URL in webMethods.io when in a project, i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/workflows): - $ node wmiocli.js +View individual project using project ID (indentified from URL in webMethods.io when in a project, i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/workflows): +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project fl65d3aa87fc1783ea5cf8c8 - View individual project with given project name: +View individual project with given project name: $ node wmiocli.js - -d tenant.int-aws-us.webmethods.io - -u user - -p password - project Default + -d tenant.int-aws-us.webmethods.io + -u user + -p password + project Default - View Project assets from project with given name: +View Project assets from project with given name: $ node wmiocli.js - -d tenant.int-aws-us.webmethods.io - -u user - -p password - project-assets Default + -d tenant.int-aws-us.webmethods.io + -u user + -p password + project-assets Default + +View Project assets (All Details) from project with given name: + $ node wmiocli.js + -d tenant.int-aws-us.webmethods.io + -u user + -p password + project-assets-detailed Default - Update Project name: - $ node wmiocli.js +Update Project name: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-update fl65d3aa87fc1783ea5cf8c8 "my New Name" - Delete Project: - $ node wmiocli.js +Delete Project: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-delete fl65d3aa87fc1783ea5cf8c8 - Get Project Assets: - $ node wmiocli.js +Get Project Assets: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password - project-assets fl65d3aa87fc1783ea5cf8c8 + project-assets fl65d3aa87fc1783ea5cf8c8 - Publish Project to another tenant: - $ node wmiocli.js +Publish Project to another tenant: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password - 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":[]}}' + 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":[]}}' - Deploy published Project in the tenant with the given name and deploy version: - $ node wmiocli.js +Deploy published Project in the tenant with the given name and deploy version: +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-deploy projectName 1 - List Project Workflow Parameters or gets an individual where name is specified - $ node wmiocli.js +List Project Workflow Parameters or gets an individual where name is specified +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-param projectName [param-name] - Create Project Workflow Parameter - $ node wmiocli.js +Create Project Workflow Parameter +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password @@ -221,36 +190,36 @@ Examples: e.g. node wmiocli.js -d env -u user -p pass project-param-create project name dave false false - Update Project Workflow Parameter - $ node wmiocli.js +Update Project Workflow Parameter +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-param-update projectName param-uid param-name param-value required isPassword - Delete Project Workflow Parameter - $ node wmiocli.js +Delete Project Workflow Parameter matching the provided parameter id +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-param-delete projectName param-uid - Project webhooks List - $ node wmiocli.js +Project webhooks List +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-webhooks-list [project-uid] - Regenerate webhook token - $ node wmiocli.js +Regenerate webhook token +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password project-webhooks-regenerate project-uid webhook-uid - Change webhook Auth - $ node wmiocli.js +Change webhook Auth +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password @@ -259,137 +228,158 @@ Examples: e.g. node wmiocli.js -d env -u user -p pass project-webhooks-auth flf1111 flf2222 login +List triggers in project +$ node wmiocli.js + -d tenant.int-aws-us.webmethods.io + -u user + -p password + project-triggers-list project-uid + +Delete trigger in project +$ node wmiocli.js + -d tenant.int-aws-us.webmethods.io + -u user + -p password + project-triggers-delete project-uid trigger-uid - Workflow +Workflow - Export Workflow from a given project (identified from URL in webMethods.io when in workflow canvas, - i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/workflows/fl52232a2dfafbd6536963d7/edit): - $ node wmiocli.js +Export Workflow from a given project (identified from URL in webMethods.io when in workflow canvas, +i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/workflows/fl52232a2dfafbd6536963d7/edit): +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password workflow-export fl65d3aa87fc1783ea5cf8c8 fl52232a2dfafbd6536963d7 export.zip - Import Workflow from a given file into a project - $ node wmiocli.js +Import Workflow from a given file into a project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password workflow-import fl65d3aa87fc1783ea5cf8c8 export.zip - Delete Workflow from a given project - $ node wmiocli.js +Create a blank workflow +$ node wmiocli.js + -d tenant.int-aws-us.webmethods.io + -u user + -p password + workflow-create fl65d3aa87fc1783ea5cf8c8 "name" "description" + +Delete Workflow from a given project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password workflow-delete fl65d3aa87fc1783ea5cf8c8 fl52232a2dfafbd6536963d7 - Execute a Workflow from a given project - $ node wmiocli.js +Execute a Workflow from a given project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password workflow-execute fl65d3aa87fc1783ea5cf8c8 fl52232a2dfafbd6536963d7 - Get Workflow execution status from a given project - $ node wmiocli.js +Get Workflow execution status from a given project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password workflow-status fl65d3aa87fc1783ea5cf8c8 vbid3d247cd26aa5e19354e1fc6951766a3d19c049bee11d - FlowService +FlowService - Export FlowService from a given project (identified from URL in webMethods.io when in FlowEditor - i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/flow-editor/myFlowService): - $ node wmiocli.js +Export FlowService from a given project (identified from URL in webMethods.io when in FlowEditor +i.e. https://tenant.int-aws-us.webmethods.io/#/projects/fl65d3aa87fc1783ea5cf8c8/flow-editor/myFlowService): +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password flowservice-export fl65d3aa87fc1783ea5cf8c8 myFlowService export.zip - Import Flowservice from a given file into a project - $ node wmiocli.js +Import Flowservice from a given file into a project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password flowservice-import fl65d3aa87fc1783ea5cf8c8 export.zip - Delete FlowService from a given project - $ node wmiocli.js +Delete FlowService from a given project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password flowservice-delete fl65d3aa87fc1783ea5cf8c8 myFlowService - Execute a FlowService from a given project - $ node wmiocli.js +Execute a FlowService from a given project +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password flowservice-execute fl65d3aa87fc1783ea5cf8c8 myFlowService - Roles +Roles - Get roles list or individual role - $ node wmiocli.js +Get roles list or individual role +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password role [role-name] - Creates a role - $ node wmiocli.js +Creates a role +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password role-create 'rolename' 'role description' 'project 1 name,r,w,e;project 2 name,r;' - Updates a role with a provided Id - $ node wmiocli.js +Updates a role with a provided Id +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password role-update 'roleId' 'rolename' 'role description' 'project 1 name,r,w,e;project 2 name,r;' - Delete a role with a provided Id - $ node wmiocli.js +Delete a role with a provided Id +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password role-delete 'roleId' - Recipes +Recipes - Get recipe list or individual recipe - $ node wmiocli.js +Get recipe list or individual recipe +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password recipe [recipe-Uid] - Creates a Workflow recipe from a workflow export - $ node wmiocli.js +Creates a Workflow recipe from a workflow export +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password recipe-create export-flf111111.zip - Deletes a Workflow recipe with the provided UID - $ node wmiocli.js +Deletes a Workflow recipe with the provided UID +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password recipe-delete fl1771d591cfb4f31e558daf - Themes - Lists whitelabel themes - $ node wmiocli.js +Themes + +Lists whitelabel themes +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password @@ -400,15 +390,15 @@ Examples: node wmiocli.js -d env -u user -p pass theme fl40018d9a1a273bb8aa92bf | jq -c .output.settings.theme > ~/dracula-theme.txt - Deletes a whitelabel theme - $ node wmiocli.js +Deletes a whitelabel theme +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password theme-delete [theme-uid] - Creates a new whitelabel theme - $ node wmiocli.js +Creates a new whitelabel theme +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password @@ -417,8 +407,8 @@ Examples: Theme settings can be used from the list example above, e.g. node wmiocli.js -d env -u user -p pass theme-create dracula7 'updated' "`cat ~/dracula-theme.txt`" 'Footer' 'About' - Updates a whitelabel theme - $ node wmiocli.js +Updates a whitelabel theme +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password @@ -427,18 +417,17 @@ Examples: Theme settings can be used from the list example above, e.g. node wmiocli.js -d env -u user -p pass theme-update themeid dracula7 'updated' "`cat ~/dracula-theme.txt`" 'Footer' 'About' - Activates a whitelabel theme - $ node wmiocli.js +Activates a whitelabel theme +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password theme-activate [theme-uid] - Deactivates a whitelabel theme - $ node wmiocli.js +Deactivates a whitelabel theme +$ node wmiocli.js -d tenant.int-aws-us.webmethods.io -u user -p password theme-deactivate [theme-uid] - ```