From a06417112de508fa4fc9d0f1c45141fa92d980f3 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 18 Feb 2025 10:23:12 -0500 Subject: [PATCH 1/5] Fix codeql flagged items Signed-off-by: Andrew W. Harn --- ...i.zowe.daemon.integration.suite.subtest.ts | 2 +- .../__unit__/DaemonDecider.unit.test.ts | 1 - ...tart.workflowFull.integration.test.ts.snap | 8 +- .../WorkflowFull.definition.unit.test.ts.snap | 4 +- .../workflowFull/WorkflowFull.definition.ts | 4 +- .../src/zosfiles/compare/CompareBaseHelper.ts | 1 + .../response/CommandResponse.unit.test.ts | 2 +- .../help/abstract/AbstractHelpGenerator.ts | 2 +- .../src/cmd/src/yargs/AbstractCommandYargs.ts | 2 +- .../DefinitionTreeResolver.unit.test.ts.snap | 2 +- .../imperative/src/DefinitionTreeResolver.ts | 2 +- .../src/utilities/src/DaemonRequest.ts | 4 +- packages/zostso/src/IssueTso.ts | 92 +++++++++---------- 13 files changed, 60 insertions(+), 66 deletions(-) diff --git a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts index 313f1f3a8d..5acd3023a0 100644 --- a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts +++ b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts @@ -52,7 +52,7 @@ describe("Zowe daemon suite", () => { } default: { zoweExeFileNm = "exeForUnknownOs"; - zoweExeTgzPath += "unknownOs.tgz"; + zoweExeTgzPath = "unknownOs.tgz"; throw "cli.zowe.daemon.integration.suite.test.ts: beforeAll: " + sysInfo.platform + " is not a known OS."; } diff --git a/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts b/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts index 10b51b5f09..c6ee276e05 100644 --- a/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts +++ b/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts @@ -321,7 +321,6 @@ describe("DaemonDecider tests", () => { let existTimes; if (process.platform === "win32") { - existsSyncSpy.mockImplementationOnce; existTimes = 2; } else { existTimes = 3; diff --git a/packages/cli/__tests__/workflows/__integration__/start/workflowFull/__snapshots__/cli.workflows.start.workflowFull.integration.test.ts.snap b/packages/cli/__tests__/workflows/__integration__/start/workflowFull/__snapshots__/cli.workflows.start.workflowFull.integration.test.ts.snap index 4b1ee8d276..9927218036 100644 --- a/packages/cli/__tests__/workflows/__integration__/start/workflowFull/__snapshots__/cli.workflows.start.workflowFull.integration.test.ts.snap +++ b/packages/cli/__tests__/workflows/__integration__/start/workflowFull/__snapshots__/cli.workflows.start.workflowFull.integration.test.ts.snap @@ -145,12 +145,12 @@ exports[`Create workflow cli system tests Start workflow Display Help should dis $ zowe zos-workflows start workflow-full --workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" - To start a workflow instance in z/OSMF with workflow key - \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and wait forit to be finished: + \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and wait for it to be finished: $ zowe zos-workflows start workflow-full --workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" --wait - To start a workflow instance in z/OSMF with workflow key - \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\"and if there is a conflict in variable's + \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and if there is a conflict in variable's value use the value that is in output file: $ zowe zos-workflows start workflow-full --workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" --resolve-conflict-by \\"outputFileValue\\" @@ -165,8 +165,8 @@ exports[`Create workflow cli system tests Start workflow Display Help should dis \\"success\\": true, \\"exitCode\\": 0, \\"message\\": \\"The help was constructed for command: workflow-full.\\", - \\"stdout\\": \\"\\\\n COMMAND NAME\\\\n ------------\\\\n\\\\n workflow-full | wf\\\\n\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n Will run workflow from the beginning to the end or to the first manual step.\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n zowe zos-workflows start workflow-full [options]\\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --workflow-key | --wk (string)\\\\n\\\\n Workflow key of workflow instance to be started\\\\n\\\\n --workflow-name | --wn (string)\\\\n\\\\n Workflow name of workflow instance to be started\\\\n\\\\n --resolve-conflict-by | --rcb (string)\\\\n\\\\n How variable conflicts should be handled.\\\\n Options:\\\\n outputFileValue: Allow the output file values to override the existing values.\\\\n existingValue: Use the existing variables values instead of the output file\\\\n values.\\\\n leaveConflict: Automation is stopped. The user must resolve the conflict\\\\n manually.\\\\n\\\\n Default value: outputFileValue\\\\n Allowed values: outputFileValue, existingValue, leaveConflict\\\\n\\\\n --wait | -w (boolean)\\\\n\\\\n Identifies whether to wait for workflow instance to finish.\\\\n\\\\n ZOSMF CONNECTION OPTIONS\\\\n ------------------------\\\\n\\\\n --host | -H (string)\\\\n\\\\n The z/OSMF server host name.\\\\n\\\\n --port | -P (number)\\\\n\\\\n The z/OSMF server port.\\\\n\\\\n Default value: 443\\\\n\\\\n --user | -u (string)\\\\n\\\\n Mainframe (z/OSMF) user name, which can be the same as your TSO login.\\\\n\\\\n --password | --pass | --pw (string)\\\\n\\\\n Mainframe (z/OSMF) password, which can be the same as your TSO password.\\\\n\\\\n --reject-unauthorized | --ru (boolean)\\\\n\\\\n Reject self-signed certificates.\\\\n\\\\n Default value: true\\\\n\\\\n --base-path | --bp (string)\\\\n\\\\n The base path for your API mediation layer instance. Specify this option to\\\\n prepend the base path to all z/OSMF resources when making REST requests. Do not\\\\n specify this option if you are not using an API mediation layer.\\\\n\\\\n --protocol (string)\\\\n\\\\n The protocol used (HTTP or HTTPS)\\\\n\\\\n Default value: https\\\\n Allowed values: http, https\\\\n\\\\n --cert-file (local file path)\\\\n\\\\n The file path to a certificate file to use for authentication\\\\n\\\\n --cert-key-file (local file path)\\\\n\\\\n The file path to a certificate key file to use for authentication\\\\n\\\\n PROFILE OPTIONS\\\\n ---------------\\\\n\\\\n --zosmf-profile | --zosmf-p (string)\\\\n\\\\n The name of a (zosmf) profile to load for this command execution.\\\\n\\\\n --base-profile | --base-p (string)\\\\n\\\\n The name of a (base) profile to load for this command execution.\\\\n\\\\n BASE CONNECTION OPTIONS\\\\n -----------------------\\\\n\\\\n --token-type | --tt (string)\\\\n\\\\n The type of token to get and use for the API. Omit this option to use the\\\\n default token type, which is provided by 'zowe auth login'.\\\\n\\\\n --token-value | --tv (string)\\\\n\\\\n The value of the token to pass to the API.\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --show-inputs-only (boolean)\\\\n\\\\n Show command inputs and do not run the command\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n EXAMPLES\\\\n --------\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and wait forit to be finished:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --wait\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"and if there is a conflict in variable's\\\\n value use the value that is in output file:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --resolve-conflict-by \\\\\\"outputFileValue\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow name\\\\n \\\\\\"testWorkflow\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-name \\\\\\"testWorkflow\\\\\\"\\\\n\\\\n\\", + \\"stdout\\": \\"\\\\n COMMAND NAME\\\\n ------------\\\\n\\\\n workflow-full | wf\\\\n\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n Will run workflow from the beginning to the end or to the first manual step.\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n zowe zos-workflows start workflow-full [options]\\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --workflow-key | --wk (string)\\\\n\\\\n Workflow key of workflow instance to be started\\\\n\\\\n --workflow-name | --wn (string)\\\\n\\\\n Workflow name of workflow instance to be started\\\\n\\\\n --resolve-conflict-by | --rcb (string)\\\\n\\\\n How variable conflicts should be handled.\\\\n Options:\\\\n outputFileValue: Allow the output file values to override the existing values.\\\\n existingValue: Use the existing variables values instead of the output file\\\\n values.\\\\n leaveConflict: Automation is stopped. The user must resolve the conflict\\\\n manually.\\\\n\\\\n Default value: outputFileValue\\\\n Allowed values: outputFileValue, existingValue, leaveConflict\\\\n\\\\n --wait | -w (boolean)\\\\n\\\\n Identifies whether to wait for workflow instance to finish.\\\\n\\\\n ZOSMF CONNECTION OPTIONS\\\\n ------------------------\\\\n\\\\n --host | -H (string)\\\\n\\\\n The z/OSMF server host name.\\\\n\\\\n --port | -P (number)\\\\n\\\\n The z/OSMF server port.\\\\n\\\\n Default value: 443\\\\n\\\\n --user | -u (string)\\\\n\\\\n Mainframe (z/OSMF) user name, which can be the same as your TSO login.\\\\n\\\\n --password | --pass | --pw (string)\\\\n\\\\n Mainframe (z/OSMF) password, which can be the same as your TSO password.\\\\n\\\\n --reject-unauthorized | --ru (boolean)\\\\n\\\\n Reject self-signed certificates.\\\\n\\\\n Default value: true\\\\n\\\\n --base-path | --bp (string)\\\\n\\\\n The base path for your API mediation layer instance. Specify this option to\\\\n prepend the base path to all z/OSMF resources when making REST requests. Do not\\\\n specify this option if you are not using an API mediation layer.\\\\n\\\\n --protocol (string)\\\\n\\\\n The protocol used (HTTP or HTTPS)\\\\n\\\\n Default value: https\\\\n Allowed values: http, https\\\\n\\\\n --cert-file (local file path)\\\\n\\\\n The file path to a certificate file to use for authentication\\\\n\\\\n --cert-key-file (local file path)\\\\n\\\\n The file path to a certificate key file to use for authentication\\\\n\\\\n PROFILE OPTIONS\\\\n ---------------\\\\n\\\\n --zosmf-profile | --zosmf-p (string)\\\\n\\\\n The name of a (zosmf) profile to load for this command execution.\\\\n\\\\n --base-profile | --base-p (string)\\\\n\\\\n The name of a (base) profile to load for this command execution.\\\\n\\\\n BASE CONNECTION OPTIONS\\\\n -----------------------\\\\n\\\\n --token-type | --tt (string)\\\\n\\\\n The type of token to get and use for the API. Omit this option to use the\\\\n default token type, which is provided by 'zowe auth login'.\\\\n\\\\n --token-value | --tv (string)\\\\n\\\\n The value of the token to pass to the API.\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --show-inputs-only (boolean)\\\\n\\\\n Show command inputs and do not run the command\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n EXAMPLES\\\\n --------\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and wait for it to be finished:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --wait\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and if there is a conflict in variable's\\\\n value use the value that is in output file:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --resolve-conflict-by \\\\\\"outputFileValue\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow name\\\\n \\\\\\"testWorkflow\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-name \\\\\\"testWorkflow\\\\\\"\\\\n\\\\n\\", \\"stderr\\": \\"\\", - \\"data\\": \\"\\\\n COMMAND NAME\\\\n ------------\\\\n\\\\n workflow-full | wf\\\\n\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n Will run workflow from the beginning to the end or to the first manual step.\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n zowe zos-workflows start workflow-full [options]\\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --workflow-key | --wk (string)\\\\n\\\\n Workflow key of workflow instance to be started\\\\n\\\\n --workflow-name | --wn (string)\\\\n\\\\n Workflow name of workflow instance to be started\\\\n\\\\n --resolve-conflict-by | --rcb (string)\\\\n\\\\n How variable conflicts should be handled.\\\\n Options:\\\\n outputFileValue: Allow the output file values to override the existing values.\\\\n existingValue: Use the existing variables values instead of the output file\\\\n values.\\\\n leaveConflict: Automation is stopped. The user must resolve the conflict\\\\n manually.\\\\n\\\\n Default value: outputFileValue\\\\n Allowed values: outputFileValue, existingValue, leaveConflict\\\\n\\\\n --wait | -w (boolean)\\\\n\\\\n Identifies whether to wait for workflow instance to finish.\\\\n\\\\n ZOSMF CONNECTION OPTIONS\\\\n ------------------------\\\\n\\\\n --host | -H (string)\\\\n\\\\n The z/OSMF server host name.\\\\n\\\\n --port | -P (number)\\\\n\\\\n The z/OSMF server port.\\\\n\\\\n Default value: 443\\\\n\\\\n --user | -u (string)\\\\n\\\\n Mainframe (z/OSMF) user name, which can be the same as your TSO login.\\\\n\\\\n --password | --pass | --pw (string)\\\\n\\\\n Mainframe (z/OSMF) password, which can be the same as your TSO password.\\\\n\\\\n --reject-unauthorized | --ru (boolean)\\\\n\\\\n Reject self-signed certificates.\\\\n\\\\n Default value: true\\\\n\\\\n --base-path | --bp (string)\\\\n\\\\n The base path for your API mediation layer instance. Specify this option to\\\\n prepend the base path to all z/OSMF resources when making REST requests. Do not\\\\n specify this option if you are not using an API mediation layer.\\\\n\\\\n --protocol (string)\\\\n\\\\n The protocol used (HTTP or HTTPS)\\\\n\\\\n Default value: https\\\\n Allowed values: http, https\\\\n\\\\n --cert-file (local file path)\\\\n\\\\n The file path to a certificate file to use for authentication\\\\n\\\\n --cert-key-file (local file path)\\\\n\\\\n The file path to a certificate key file to use for authentication\\\\n\\\\n PROFILE OPTIONS\\\\n ---------------\\\\n\\\\n --zosmf-profile | --zosmf-p (string)\\\\n\\\\n The name of a (zosmf) profile to load for this command execution.\\\\n\\\\n --base-profile | --base-p (string)\\\\n\\\\n The name of a (base) profile to load for this command execution.\\\\n\\\\n BASE CONNECTION OPTIONS\\\\n -----------------------\\\\n\\\\n --token-type | --tt (string)\\\\n\\\\n The type of token to get and use for the API. Omit this option to use the\\\\n default token type, which is provided by 'zowe auth login'.\\\\n\\\\n --token-value | --tv (string)\\\\n\\\\n The value of the token to pass to the API.\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --show-inputs-only (boolean)\\\\n\\\\n Show command inputs and do not run the command\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n EXAMPLES\\\\n --------\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and wait forit to be finished:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --wait\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"and if there is a conflict in variable's\\\\n value use the value that is in output file:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --resolve-conflict-by \\\\\\"outputFileValue\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow name\\\\n \\\\\\"testWorkflow\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-name \\\\\\"testWorkflow\\\\\\"\\\\n\\\\n\\" + \\"data\\": \\"\\\\n COMMAND NAME\\\\n ------------\\\\n\\\\n workflow-full | wf\\\\n\\\\n DESCRIPTION\\\\n -----------\\\\n\\\\n Will run workflow from the beginning to the end or to the first manual step.\\\\n\\\\n USAGE\\\\n -----\\\\n\\\\n zowe zos-workflows start workflow-full [options]\\\\n\\\\n OPTIONS\\\\n -------\\\\n\\\\n --workflow-key | --wk (string)\\\\n\\\\n Workflow key of workflow instance to be started\\\\n\\\\n --workflow-name | --wn (string)\\\\n\\\\n Workflow name of workflow instance to be started\\\\n\\\\n --resolve-conflict-by | --rcb (string)\\\\n\\\\n How variable conflicts should be handled.\\\\n Options:\\\\n outputFileValue: Allow the output file values to override the existing values.\\\\n existingValue: Use the existing variables values instead of the output file\\\\n values.\\\\n leaveConflict: Automation is stopped. The user must resolve the conflict\\\\n manually.\\\\n\\\\n Default value: outputFileValue\\\\n Allowed values: outputFileValue, existingValue, leaveConflict\\\\n\\\\n --wait | -w (boolean)\\\\n\\\\n Identifies whether to wait for workflow instance to finish.\\\\n\\\\n ZOSMF CONNECTION OPTIONS\\\\n ------------------------\\\\n\\\\n --host | -H (string)\\\\n\\\\n The z/OSMF server host name.\\\\n\\\\n --port | -P (number)\\\\n\\\\n The z/OSMF server port.\\\\n\\\\n Default value: 443\\\\n\\\\n --user | -u (string)\\\\n\\\\n Mainframe (z/OSMF) user name, which can be the same as your TSO login.\\\\n\\\\n --password | --pass | --pw (string)\\\\n\\\\n Mainframe (z/OSMF) password, which can be the same as your TSO password.\\\\n\\\\n --reject-unauthorized | --ru (boolean)\\\\n\\\\n Reject self-signed certificates.\\\\n\\\\n Default value: true\\\\n\\\\n --base-path | --bp (string)\\\\n\\\\n The base path for your API mediation layer instance. Specify this option to\\\\n prepend the base path to all z/OSMF resources when making REST requests. Do not\\\\n specify this option if you are not using an API mediation layer.\\\\n\\\\n --protocol (string)\\\\n\\\\n The protocol used (HTTP or HTTPS)\\\\n\\\\n Default value: https\\\\n Allowed values: http, https\\\\n\\\\n --cert-file (local file path)\\\\n\\\\n The file path to a certificate file to use for authentication\\\\n\\\\n --cert-key-file (local file path)\\\\n\\\\n The file path to a certificate key file to use for authentication\\\\n\\\\n PROFILE OPTIONS\\\\n ---------------\\\\n\\\\n --zosmf-profile | --zosmf-p (string)\\\\n\\\\n The name of a (zosmf) profile to load for this command execution.\\\\n\\\\n --base-profile | --base-p (string)\\\\n\\\\n The name of a (base) profile to load for this command execution.\\\\n\\\\n BASE CONNECTION OPTIONS\\\\n -----------------------\\\\n\\\\n --token-type | --tt (string)\\\\n\\\\n The type of token to get and use for the API. Omit this option to use the\\\\n default token type, which is provided by 'zowe auth login'.\\\\n\\\\n --token-value | --tv (string)\\\\n\\\\n The value of the token to pass to the API.\\\\n\\\\n GLOBAL OPTIONS\\\\n --------------\\\\n\\\\n --show-inputs-only (boolean)\\\\n\\\\n Show command inputs and do not run the command\\\\n\\\\n --response-format-json | --rfj (boolean)\\\\n\\\\n Produce JSON formatted data from a command\\\\n\\\\n --help | -h (boolean)\\\\n\\\\n Display help text\\\\n\\\\n --help-web | --hw (boolean)\\\\n\\\\n Display HTML help in browser\\\\n\\\\n EXAMPLES\\\\n --------\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and wait for it to be finished:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --wait\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow key\\\\n \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" and if there is a conflict in variable's\\\\n value use the value that is in output file:\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-key \\\\\\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\\\\\" --resolve-conflict-by \\\\\\"outputFileValue\\\\\\"\\\\n\\\\n - To start a workflow instance in z/OSMF with workflow name\\\\n \\\\\\"testWorkflow\\\\\\":\\\\n\\\\n $ zowe zos-workflows start workflow-full --workflow-name \\\\\\"testWorkflow\\\\\\"\\\\n\\\\n\\" }" `; diff --git a/packages/cli/__tests__/workflows/__unit__/start/workflowFull/__snapshots__/WorkflowFull.definition.unit.test.ts.snap b/packages/cli/__tests__/workflows/__unit__/start/workflowFull/__snapshots__/WorkflowFull.definition.unit.test.ts.snap index d9da9d9c6e..e540dfdff5 100644 --- a/packages/cli/__tests__/workflows/__unit__/start/workflowFull/__snapshots__/WorkflowFull.definition.unit.test.ts.snap +++ b/packages/cli/__tests__/workflows/__unit__/start/workflowFull/__snapshots__/WorkflowFull.definition.unit.test.ts.snap @@ -12,11 +12,11 @@ Object { "options": "--workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\"", }, Object { - "description": "To start a workflow instance in z/OSMF with workflow key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and wait forit to be finished", + "description": "To start a workflow instance in z/OSMF with workflow key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and wait for it to be finished", "options": "--workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" --wait", }, Object { - "description": "To start a workflow instance in z/OSMF with workflow key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\"and if there is a conflict in variable's value use the value that is in output file", + "description": "To start a workflow instance in z/OSMF with workflow key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" and if there is a conflict in variable's value use the value that is in output file", "options": "--workflow-key \\"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\\" --resolve-conflict-by \\"outputFileValue\\"", }, Object { diff --git a/packages/cli/src/workflows/start/workflowFull/WorkflowFull.definition.ts b/packages/cli/src/workflows/start/workflowFull/WorkflowFull.definition.ts index 757da41b5b..f7f277d0dc 100644 --- a/packages/cli/src/workflows/start/workflowFull/WorkflowFull.definition.ts +++ b/packages/cli/src/workflows/start/workflowFull/WorkflowFull.definition.ts @@ -43,12 +43,12 @@ export const WorkflowFull: ICommandDefinition = { options: "--workflow-key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\"" }, { - description: "To start a workflow instance in z/OSMF with workflow key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\" and wait for" + + description: "To start a workflow instance in z/OSMF with workflow key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\" and wait for " + "it to be finished", options: "--workflow-key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\" --wait" }, { - description: "To start a workflow instance in z/OSMF with workflow key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\"" + + description: "To start a workflow instance in z/OSMF with workflow key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\" " + "and if there is a conflict in variable's value use the value that is in output file", options: "--workflow-key \"d043b5f1-adab-48e7-b7c3-d41cd95fa4b0\" --resolve-conflict-by \"outputFileValue\"" }, diff --git a/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts b/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts index be2ef09872..1eb1a17efa 100644 --- a/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts +++ b/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts @@ -133,6 +133,7 @@ export class CompareBaseHelper { try { try { // check if the path given is of a file or not + // eslint-disable-next-line @typescript-eslint/no-magic-numbers localFileHandle = fs.openSync(localFile, 'r'); if(!fs.fstatSync(localFileHandle).isFile()){ throw new ImperativeError({ diff --git a/packages/imperative/src/cmd/__tests__/response/CommandResponse.unit.test.ts b/packages/imperative/src/cmd/__tests__/response/CommandResponse.unit.test.ts index 894e26bd60..979d273e6d 100644 --- a/packages/imperative/src/cmd/__tests__/response/CommandResponse.unit.test.ts +++ b/packages/imperative/src/cmd/__tests__/response/CommandResponse.unit.test.ts @@ -130,7 +130,7 @@ describe("Command Response", () => { }); it("If we create a progress bar, an interval should be set to update the bar. " + - "If we finish the bar, the interval should be stopped and no longer stored" + + "If we finish the bar, the interval should be stopped and no longer stored " + "in the command response. ", (done) => { // eslint-disable-line jest/no-done-callback process.env.FORCE_COLOR = "1"; const response = new CommandResponse({ silent: false, responseFormat: "default" }); diff --git a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts index 90aad23474..aeeec60576 100644 --- a/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts +++ b/packages/imperative/src/cmd/src/help/abstract/AbstractHelpGenerator.ts @@ -135,7 +135,7 @@ export abstract class AbstractHelpGenerator implements IHelpGenerator { (alias.length === 1 ? "-" : "--") + alias + "{{codeEnd}}"); } else { - this.log.warn("The aliases for option " + option.name + " contained a null or empty alias." + + this.log.warn("The aliases for option " + option.name + " contained a null or empty alias. " + "This has been ignored; please take corrective action in your option definition."); } } diff --git a/packages/imperative/src/cmd/src/yargs/AbstractCommandYargs.ts b/packages/imperative/src/cmd/src/yargs/AbstractCommandYargs.ts index d0a5381066..5cbb640dc5 100644 --- a/packages/imperative/src/cmd/src/yargs/AbstractCommandYargs.ts +++ b/packages/imperative/src/cmd/src/yargs/AbstractCommandYargs.ts @@ -345,7 +345,7 @@ export abstract class AbstractCommandYargs { tempOpPath = path.substring(0, path.length - "options".length); if (completeName) { tempOp = `${completeName} ${value}`; - } else if(topLevelName && !completeName) { + } else if (topLevelName) { tempOp = `${topLevelName} ${value}`; } else { tempOp = value; diff --git a/packages/imperative/src/imperative/__tests__/__snapshots__/DefinitionTreeResolver.unit.test.ts.snap b/packages/imperative/src/imperative/__tests__/__snapshots__/DefinitionTreeResolver.unit.test.ts.snap index eb12f17345..f19caa0a05 100644 --- a/packages/imperative/src/imperative/__tests__/__snapshots__/DefinitionTreeResolver.unit.test.ts.snap +++ b/packages/imperative/src/imperative/__tests__/__snapshots__/DefinitionTreeResolver.unit.test.ts.snap @@ -2,4 +2,4 @@ exports[`DefinitionTreeResolver tests should error with unmatching globs commands 1`] = `"Command module glob for the glob **/bad/glob did not match any files searching from: /random/caller/dir"`; -exports[`DefinitionTreeResolver tests should error without commands 1`] = `"No command definitions have been provided to Imperative. Specify modules and/or definitions on your Imperativeconfiguration."`; +exports[`DefinitionTreeResolver tests should error without commands 1`] = `"No command definitions have been provided to Imperative. Specify modules and/or definitions on your Imperative configuration."`; diff --git a/packages/imperative/src/imperative/src/DefinitionTreeResolver.ts b/packages/imperative/src/imperative/src/DefinitionTreeResolver.ts index 19c2f4bd7f..6a42990a8a 100644 --- a/packages/imperative/src/imperative/src/DefinitionTreeResolver.ts +++ b/packages/imperative/src/imperative/src/DefinitionTreeResolver.ts @@ -43,7 +43,7 @@ export class DefinitionTreeResolver { if (childrenDefinitions == null && childrenModuleGlobs == null) { throw new ImperativeError({ msg: "No command definitions have been provided " + - "to Imperative. Specify modules and/or definitions on your Imperative" + + "to Imperative. Specify modules and/or definitions on your Imperative " + "configuration." }); } else if (childrenDefinitions == null) { diff --git a/packages/imperative/src/utilities/src/DaemonRequest.ts b/packages/imperative/src/utilities/src/DaemonRequest.ts index 6a14b4529d..e60789e438 100644 --- a/packages/imperative/src/utilities/src/DaemonRequest.ts +++ b/packages/imperative/src/utilities/src/DaemonRequest.ts @@ -31,9 +31,7 @@ export class DaemonRequest { * @param {IDaemonRequest} request * @memberof DaemonRequest */ - constructor(private request: IDaemonRequest) { - this.request = request; - } + constructor(private request: IDaemonRequest) {} /** * Create daemon request from input options diff --git a/packages/zostso/src/IssueTso.ts b/packages/zostso/src/IssueTso.ts index 2fd0d5e26d..c22ecc1969 100644 --- a/packages/zostso/src/IssueTso.ts +++ b/packages/zostso/src/IssueTso.ts @@ -39,7 +39,7 @@ export class IssueTso { session, ZosmfConstants.VERSIONS.V2R4 ); - let useNewApi = + const useNewApi = opts.addressSpaceOptions == null || versionCheck && opts.suppressStartupMessages; @@ -73,63 +73,59 @@ export class IssueTso { return response; } catch (e) { if (e.message?.includes("status 404")) { - // Set useNewApi to false to handle fallback logic - useNewApi = false; + // Continue to the old API behavior } else { // Re-throw for other exceptions throw e; } } } - // Deprecated API Behavior [former issueTsoCommand() behavior] - if (!useNewApi) { - TsoValidator.validateSession(session); - TsoValidator.validateNotEmptyString( - opts.addressSpaceOptions?.account, - noAccountNumber.message - ); - TsoValidator.validateNotEmptyString( - command as string, - noCommandInput.message - ); - const response: IIssueResponse = { - success: false, - startResponse: await StartTso.start( - session, - opts.addressSpaceOptions?.account, - opts.addressSpaceOptions || {} - ), - startReady: false, - zosmfResponse: null, - commandResponse: null, - stopResponse: null, - }; - - if (!response.startResponse.success) { - throw new ImperativeError({ - msg: `TSO address space failed to start.`, - additionalDetails: - response.startResponse.failureResponse?.message, - }); - } + // Deprecated API Behavior [former issueTsoCommand() behavior] + TsoValidator.validateSession(session); + TsoValidator.validateNotEmptyString( + opts.addressSpaceOptions?.account, + noAccountNumber.message + ); + TsoValidator.validateNotEmptyString( + command as string, + noCommandInput.message + ); - const sendResponse = await SendTso.sendDataToTSOCollect( - session, - response.startResponse.servletKey, - command as string - ); - response.success = sendResponse.success; - response.zosmfResponse = sendResponse.zosmfResponse; - response.commandResponse = sendResponse.commandResponse; - response.stopResponse = await StopTso.stop( + const response: IIssueResponse = { + success: false, + startResponse: await StartTso.start( session, - response.startResponse.servletKey - ); - return response; - } else { - throw "ERROR"; + opts.addressSpaceOptions?.account, + opts.addressSpaceOptions || {} + ), + startReady: false, + zosmfResponse: null, + commandResponse: null, + stopResponse: null, + }; + + if (!response.startResponse.success) { + throw new ImperativeError({ + msg: `TSO address space failed to start.`, + additionalDetails: + response.startResponse.failureResponse?.message, + }); } + + const sendResponse = await SendTso.sendDataToTSOCollect( + session, + response.startResponse.servletKey, + command as string + ); + response.success = sendResponse.success; + response.zosmfResponse = sendResponse.zosmfResponse; + response.commandResponse = sendResponse.commandResponse; + response.stopResponse = await StopTso.stop( + session, + response.startResponse.servletKey + ); + return response; } /** From a6118bc8dae353e89dc84ae6fbabd9aaa675101a Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 18 Feb 2025 10:40:27 -0500 Subject: [PATCH 2/5] Fix test unused variables Signed-off-by: Andrew W. Harn --- .../cli.zowe.daemon.integration.suite.subtest.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts index 5acd3023a0..57734db3da 100644 --- a/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts +++ b/packages/cli/__tests__/daemon/__integration__/cli.zowe.daemon.integration.suite.subtest.ts @@ -51,8 +51,6 @@ describe("Zowe daemon suite", () => { break; } default: { - zoweExeFileNm = "exeForUnknownOs"; - zoweExeTgzPath = "unknownOs.tgz"; throw "cli.zowe.daemon.integration.suite.test.ts: beforeAll: " + sysInfo.platform + " is not a known OS."; } From 83ab053a5590edb145fa12043726de7e5d485d18 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 18 Feb 2025 10:50:22 -0500 Subject: [PATCH 3/5] Remove extra magic numbers comment Signed-off-by: Andrew W. Harn --- packages/cli/src/zosfiles/compare/CompareBaseHelper.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts b/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts index 1eb1a17efa..be2ef09872 100644 --- a/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts +++ b/packages/cli/src/zosfiles/compare/CompareBaseHelper.ts @@ -133,7 +133,6 @@ export class CompareBaseHelper { try { try { // check if the path given is of a file or not - // eslint-disable-next-line @typescript-eslint/no-magic-numbers localFileHandle = fs.openSync(localFile, 'r'); if(!fs.fstatSync(localFileHandle).isFile()){ throw new ImperativeError({ From 714fc8151ce558b1e634298b55a1970e8b7c31bc Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 18 Feb 2025 11:38:00 -0500 Subject: [PATCH 4/5] Make requested change Signed-off-by: Andrew W. Harn --- packages/zostso/src/IssueTso.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/zostso/src/IssueTso.ts b/packages/zostso/src/IssueTso.ts index c22ecc1969..20d8f2bb7c 100644 --- a/packages/zostso/src/IssueTso.ts +++ b/packages/zostso/src/IssueTso.ts @@ -72,10 +72,7 @@ export class IssueTso { }; return response; } catch (e) { - if (e.message?.includes("status 404")) { - // Continue to the old API behavior - } else { - // Re-throw for other exceptions + if (e.message == null || !e.message.includes("status 404")) { throw e; } } From c0247b4ac9d3a2f6606b2ef09b2e522755939383 Mon Sep 17 00:00:00 2001 From: "Andrew W. Harn" Date: Tue, 18 Feb 2025 12:29:41 -0500 Subject: [PATCH 5/5] Fix more items Signed-off-by: Andrew W. Harn --- .../__unit__/DaemonDecider.unit.test.ts | 4 ++-- .../ds/cli.files.delete.ds.system.test.ts | 22 ++++++++--------- .../vsam/cli.files.delete.vsam.system.test.ts | 24 +++++++++---------- .../zfs/cli.files.delete.zfs.system.test.ts | 12 +++++----- .../src/workflows/archive/Archive.handler.ts | 2 +- .../workflows/create/Create.common.handler.ts | 2 +- .../imperative/plugins/suites/UsingPlugins.ts | 4 ++-- .../src/plugins/PluginManagementFacility.ts | 2 +- .../src/operations/src/Operation.ts | 2 +- .../utils/ProvisioningTestUtils.ts | 2 +- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts b/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts index 7a535f43d0..cfd119b6e4 100644 --- a/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts +++ b/packages/cli/__tests__/daemon/__unit__/DaemonDecider.unit.test.ts @@ -139,7 +139,7 @@ describe("DaemonDecider tests", () => { const envWinPipeName = "MyWinPipeName"; const envDaemonDir = path.normalize("./testOutput/daemonDir"); - let expectedCommChannel: string = "NotAssignedYet"; + let expectedCommChannel: string; if (process.platform === "win32") { process.env.ZOWE_DAEMON_PIPE = envWinPipeName; @@ -238,7 +238,7 @@ describe("DaemonDecider tests", () => { const daemonDecider = new DaemonDecider(["node", "zowe", "--daemon"]); daemonDecider.init(); - let expectedCommChannel: string = "NotAssignedYet"; + let expectedCommChannel: string; if (process.platform === "win32") { expectedCommChannel = `\\\\.\\pipe\\${os.userInfo().username}\\ZoweDaemon`; } else { diff --git a/packages/cli/__tests__/zosfiles/__system__/delete/ds/cli.files.delete.ds.system.test.ts b/packages/cli/__tests__/zosfiles/__system__/delete/ds/cli.files.delete.ds.system.test.ts index 076efc7e2f..2f52b82501 100644 --- a/packages/cli/__tests__/zosfiles/__system__/delete/ds/cli.files.delete.ds.system.test.ts +++ b/packages/cli/__tests__/zosfiles/__system__/delete/ds/cli.files.delete.ds.system.test.ts @@ -58,7 +58,7 @@ describe("Delete Data Set", () => { }); it("should delete a data set", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", TEST_ENVIRONMENT, [dsname]); const ZOWE_OPT_BASE_PATH = "ZOWE_OPT_BASE_PATH"; @@ -69,7 +69,7 @@ describe("Delete Data Set", () => { TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = defaultSys.zosmf.basePath; } - response = runCliScript(__dirname + "/__scripts__/command/command_delete_ds_fully_qualified.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_ds_fully_qualified.sh", TEST_ENVIRONMENT_NO_PROF, [dsname, "--for-sure", defaultSys.zosmf.host, defaultSys.zosmf.port, @@ -84,9 +84,9 @@ describe("Delete Data Set", () => { describe("Success scenarios", () => { it("should delete a data set", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", TEST_ENVIRONMENT, [dsname]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -94,9 +94,9 @@ describe("Delete Data Set", () => { }); it("should delete a data set with response timeout", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", TEST_ENVIRONMENT, [dsname, "--responseTimeout 5"]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", TEST_ENVIRONMENT, [dsname, "--responseTimeout 5 --for-sure"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -104,9 +104,9 @@ describe("Delete Data Set", () => { }); it("should delete a partitioned data set and print attributes", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", TEST_ENVIRONMENT, [dsname]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure", "--rfj"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -114,13 +114,13 @@ describe("Delete Data Set", () => { }); it("should delete a partitioned data set member", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set.sh", TEST_ENVIRONMENT, [dsname]); const dsnameWithMember = dsname + "(TESTMEM)"; const fileLocation = __dirname + "/__scripts__/command/file.txt"; - response = runCliScript(__dirname + "/__scripts__/command/command_create_data_set_member.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_data_set_member.sh", TEST_ENVIRONMENT, [dsnameWithMember, fileLocation]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_data_set.sh", TEST_ENVIRONMENT, [dsnameWithMember, "--for-sure", "--rfj"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); diff --git a/packages/cli/__tests__/zosfiles/__system__/delete/vsam/cli.files.delete.vsam.system.test.ts b/packages/cli/__tests__/zosfiles/__system__/delete/vsam/cli.files.delete.vsam.system.test.ts index a635e5dece..4f986cb51d 100644 --- a/packages/cli/__tests__/zosfiles/__system__/delete/vsam/cli.files.delete.vsam.system.test.ts +++ b/packages/cli/__tests__/zosfiles/__system__/delete/vsam/cli.files.delete.vsam.system.test.ts @@ -59,7 +59,7 @@ describe("Delete VSAM Data Set", () => { }); it("should delete a data set", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); const ZOWE_OPT_BASE_PATH = "ZOWE_OPT_BASE_PATH"; @@ -70,7 +70,7 @@ describe("Delete VSAM Data Set", () => { TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = systemProps.zosmf.basePath; } - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set_fully_qualified.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set_fully_qualified.sh", TEST_ENVIRONMENT_NO_PROF, [dsname, "--for-sure", systemProps.zosmf.host, systemProps.zosmf.port, @@ -85,9 +85,9 @@ describe("Delete VSAM Data Set", () => { describe("Success scenarios", () => { it("should delete a VSAM data set", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -95,9 +95,9 @@ describe("Delete VSAM Data Set", () => { }); it("should delete a VSAM data set with response timeout", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure", "--responseTimeout 5"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -105,18 +105,18 @@ describe("Delete VSAM Data Set", () => { }); it("should delete a VSAM data set And print attributes", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure", "--rfj"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); }); it("should delete a VSAM data set that has a retention period", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure", "--purge"]); expect(response.stderr.toString()).toBe(""); expect(response.status).toBe(0); @@ -162,10 +162,10 @@ describe("Delete VSAM Data Set", () => { }); it("should fail due to retention period not being exceeded", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh", + runCliScript(__dirname + "/__scripts__/command/command_invoke_ams_define_for_statement.sh", TEST_ENVIRONMENT, [dsname, volume]); // delete without --purge should fail - response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", + let response = runCliScript(__dirname + "/__scripts__/command/command_delete_vsam_data_set.sh", TEST_ENVIRONMENT, [dsname, "--for-sure"]); expect(response.status).toBe(1); expect(stripNewLines(response.stderr.toString())).toContain("IDC3023I UNEXPIRED PURGE DATE"); diff --git a/packages/cli/__tests__/zosfiles/__system__/delete/zfs/cli.files.delete.zfs.system.test.ts b/packages/cli/__tests__/zosfiles/__system__/delete/zfs/cli.files.delete.zfs.system.test.ts index 2ba1dc9ca5..74bc11e880 100644 --- a/packages/cli/__tests__/zosfiles/__system__/delete/zfs/cli.files.delete.zfs.system.test.ts +++ b/packages/cli/__tests__/zosfiles/__system__/delete/zfs/cli.files.delete.zfs.system.test.ts @@ -67,14 +67,14 @@ describe("Delete z/OS File System", () => { TEST_ENVIRONMENT_NO_PROF.env[ZOWE_OPT_BASE_PATH] = defaultSys.zosmf.basePath; } - let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs_fully_qualified.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_zfs_fully_qualified.sh", TEST_ENVIRONMENT_NO_PROF, [fsname, volume, defaultSys.zosmf.host, defaultSys.zosmf.port, defaultSys.zosmf.user, defaultSys.zosmf.password]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs_fully_qualified.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs_fully_qualified.sh", TEST_ENVIRONMENT_NO_PROF, [fsname, "--for-sure", defaultSys.zosmf.host, defaultSys.zosmf.port, @@ -89,10 +89,10 @@ describe("Delete z/OS File System", () => { describe("Success scenarios", () => { it("should delete a ZFS", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh", TEST_ENVIRONMENT, [fsname, volume]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh", TEST_ENVIRONMENT, [fsname, "--for-sure"]); expect(response.stderr.toString()).toBe(""); @@ -101,10 +101,10 @@ describe("Delete z/OS File System", () => { }); it("should delete a ZFS with response timeout", async () => { - let response = runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh", + runCliScript(__dirname + "/__scripts__/command/command_create_zfs.sh", TEST_ENVIRONMENT, [fsname, volume, "--responseTimeout 5"]); - response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh", + const response = runCliScript(__dirname + "/__scripts__/command/command_delete_zfs.sh", TEST_ENVIRONMENT, [fsname, "--for-sure", "--responseTimeout 5"]); expect(response.stderr.toString()).toBe(""); diff --git a/packages/cli/src/workflows/archive/Archive.handler.ts b/packages/cli/src/workflows/archive/Archive.handler.ts index 30fdf5d75b..2479ba914c 100644 --- a/packages/cli/src/workflows/archive/Archive.handler.ts +++ b/packages/cli/src/workflows/archive/Archive.handler.ts @@ -74,7 +74,7 @@ export default class ArchiveHandler extends ZosmfBaseHandler { const failedWfs: IWorkflowsInfo[] = []; for(const element of getWfKey.workflows){ try { - resp = await ArchiveWorkflow.archiveWorkflowByKey(this.mSession, element.workflowKey); + await ArchiveWorkflow.archiveWorkflowByKey(this.mSession, element.workflowKey); successWfs.push(element); } catch (err) { failedWfs.push(element); diff --git a/packages/cli/src/workflows/create/Create.common.handler.ts b/packages/cli/src/workflows/create/Create.common.handler.ts index 12564c3183..d3089f1b41 100644 --- a/packages/cli/src/workflows/create/Create.common.handler.ts +++ b/packages/cli/src/workflows/create/Create.common.handler.ts @@ -59,7 +59,7 @@ export default class CreateCommonHandler extends ZosmfBaseHandler { ); if (wfKey) { try { - resp = await DeleteWorkflow.deleteWorkflow( + await DeleteWorkflow.deleteWorkflow( this.mSession, wfKey ); diff --git a/packages/imperative/__tests__/src/packages/imperative/plugins/suites/UsingPlugins.ts b/packages/imperative/__tests__/src/packages/imperative/plugins/suites/UsingPlugins.ts index b39bbaf554..91a988ac8b 100644 --- a/packages/imperative/__tests__/src/packages/imperative/plugins/suites/UsingPlugins.ts +++ b/packages/imperative/__tests__/src/packages/imperative/plugins/suites/UsingPlugins.ts @@ -270,12 +270,12 @@ describe("Using a Plugin", () => { // install the override plugin let cmd = `plugins install ${overridePluginDir}`; - let result = T.executeTestCLICommand(cliBin, this, cmd.split(" ")); + T.executeTestCLICommand(cliBin, this, cmd.split(" ")); // confirm the plugin summary is displayed from zowe help const pluginGrpNm = "override-plugin"; cmd = ``; - result = T.executeTestCLICommand(cliBin, this, cmd.split(" ")); + let result = T.executeTestCLICommand(cliBin, this, cmd.split(" ")); expect(result.stderr).toBe(""); expect(result.stdout).toContain(pluginGrpNm); expect(result.stdout).toContain("imperative override plugin pluginSummary"); diff --git a/packages/imperative/src/imperative/src/plugins/PluginManagementFacility.ts b/packages/imperative/src/imperative/src/plugins/PluginManagementFacility.ts index bfba9258ae..8034f8a1a1 100644 --- a/packages/imperative/src/imperative/src/plugins/PluginManagementFacility.ts +++ b/packages/imperative/src/imperative/src/plugins/PluginManagementFacility.ts @@ -1135,7 +1135,7 @@ export class PluginManagementFacility { ): void { for (const pluginCmdDef of pluginCmdDefs) { // check for name property - let pluginCmdName: string = "NotYetAssigned"; + let pluginCmdName: string; if (Object.prototype.hasOwnProperty.call(pluginCmdDef, "name")) { pluginCmdName = pluginCmdDef.name + " (at depth = " + cmdTreeDepth + ")"; } else { diff --git a/packages/imperative/src/operations/src/Operation.ts b/packages/imperative/src/operations/src/Operation.ts index 3e3179137b..47b3bfa6d1 100644 --- a/packages/imperative/src/operations/src/Operation.ts +++ b/packages/imperative/src/operations/src/Operation.ts @@ -389,7 +389,7 @@ export abstract class Operation implements ITaskWithStatus { this.mOperationResults = result; this.log.debug("Queued first operation to result list: " + result.operationName); } else { - let prevResult: IOperationResult = this.mOperationResults; + let prevResult: IOperationResult; let currentResult: IOperationResult = this.mOperationResults; do { prevResult = currentResult; diff --git a/packages/provisioning/__tests__/__resources__/utils/ProvisioningTestUtils.ts b/packages/provisioning/__tests__/__resources__/utils/ProvisioningTestUtils.ts index 9b36618ae3..e09ca0ce28 100644 --- a/packages/provisioning/__tests__/__resources__/utils/ProvisioningTestUtils.ts +++ b/packages/provisioning/__tests__/__resources__/utils/ProvisioningTestUtils.ts @@ -120,7 +120,7 @@ export class ProvisioningTestUtils { } else if (instanceState === this.STATE_BEING_INIT || instanceState === this.STATE_BEING_PROV) { // Wait until instance state is 'provisioned' - instance = await this.waitInstanceState(session, zOSMFVersion, instanceID, this.STATE_PROV); + await this.waitInstanceState(session, zOSMFVersion, instanceID, this.STATE_PROV); // Deprovision an instance in 'provisioned' state instance = await PerformAction.doProvisioningActionCommon(session, ProvisioningConstants.ZOSMF_VERSION,