@broadcom/jclcheck-for-zowe-cli
Version:
JCLCheck Plug-in for Zowe CLI
166 lines • 6.71 kB
JavaScript
"use strict";
/**
* Copyright (c) 2023. Broadcom. All rights reserved.
*
* This software and all information contained therein is confidential and
* proprietary and shall not be duplicated, used, disclosed or disseminated
* in any way except as authorized by the applicable license agreement,
* without the express written permission of BROADCOM. All authorized reproductions
* must be marked with this language.
*
* EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT
* PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS SOFTWARE WITHOUT
* WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN
* NO EVENT WILL BROADCOM BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY
* LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
* INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION,
* GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR
* DAMAGE.
*
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
**/
Object.defineProperty(exports, "__esModule", { value: true });
exports.JCLCheckSessionUtils = void 0;
const imperative_1 = require("@zowe/imperative");
/**
* Builds JCLCheck session and contains command definitions for it
* @export
*/
class JCLCheckSessionUtils {
/**
* Given command line arguments, create session config for REST Client.
* @static
* @param {ICommandArguments} args - The arguments specified by the user
* @returns {ISession} - Session config for usage with the JCLCheck REST Service
*/
static createJCLCheckSessCfgFromArgs(args) {
this.log.debug("Creating a JCLCheck session from arguments");
return {
hostname: args.host,
port: args.port,
user: args.user,
password: args.password,
basePath: args.basePath,
rejectUnauthorized: args.rejectUnauthorized,
protocol: args.protocol || "https"
};
}
static get log() {
return imperative_1.Logger.getAppLogger();
}
}
exports.JCLCheckSessionUtils = JCLCheckSessionUtils;
JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP = "JCLCheck Connection Options";
/**
* Option used in profile creation and commands for hostname for JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_HOST = {
name: "host",
aliases: ["H"],
type: "string",
description: "Host name of the JCLCheck API service that is running on the mainframe system.",
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for port for JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_PORT = {
name: "port",
aliases: ["P"],
type: "number",
description: "Port for the JCLCheck API service that is running on the mainframe system.",
defaultValue: 12697,
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for user for JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_USER = {
name: "user",
aliases: ["u"],
type: "string",
description: "User name for authenticating connections to the JCLCheck API service that is running on the mainframe system.",
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for password for JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_PASSWORD = {
name: "password",
aliases: ["pass", "pw"],
type: "string",
description: "Password for authenticating connections to the JCLCheck API service that is running on the mainframe system.",
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for basePath setting for connecting to JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_BASE_PATH = {
name: "base-path",
aliases: ["bp"],
description: "The base path for your API mediation layer instance." +
" Specify this option to prepend the base path to all resources when making REST requests." +
" Do not specify this option if you are not using an API mediation layer.",
type: "string",
defaultValue: "cajclcheck/api/v1",
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for rejectUnauthorized setting for connecting to JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_REJECT_UNAUTHORIZED = {
name: "reject-unauthorized",
aliases: ["ru"],
description: "Reject self-signed certificates.",
type: "boolean",
defaultValue: true,
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Option used in profile creation and commands for protocol for JCLCheck
*/
JCLCheckSessionUtils.JCLCHECK_OPTION_PROTOCOL = {
name: "protocol",
aliases: ["o"],
description: "Specifies protocol to use for JCLCheck connection (http or https).",
type: "string",
defaultValue: "https",
required: false,
allowableValues: { values: ["http", "https"], caseSensitive: false },
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
JCLCheckSessionUtils.JCLCHECK_OPTION_JCK_OPTS = {
name: "jclcheck-options",
aliases: ["jo"],
description: "The desired set of JCLCheck runtime options. " +
"Specify the options exactly as you would on the PARM= or OPTIONS DD on a batch run of JCLCheck. " +
"See the JCLCheck runtime options documentation for details on available runtime options. " +
"If you specify options that change the format of the JCLCheck reports, you should request '--raw-output'. " +
"Changing the format of the report will affect the ability to produce a structured API response.",
type: "stringOrEmpty",
required: false,
group: JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTION_GROUP
};
/**
* Options related to connecting to JCLCheck
* These options can be filled in if the user creates a profile
*/
JCLCheckSessionUtils.JCLCHECK_CONNECTION_OPTIONS = [
JCLCheckSessionUtils.JCLCHECK_OPTION_HOST,
JCLCheckSessionUtils.JCLCHECK_OPTION_PORT,
JCLCheckSessionUtils.JCLCHECK_OPTION_USER,
JCLCheckSessionUtils.JCLCHECK_OPTION_PASSWORD,
JCLCheckSessionUtils.JCLCHECK_OPTION_BASE_PATH,
JCLCheckSessionUtils.JCLCHECK_OPTION_REJECT_UNAUTHORIZED,
JCLCheckSessionUtils.JCLCHECK_OPTION_PROTOCOL,
JCLCheckSessionUtils.JCLCHECK_OPTION_JCK_OPTS
];
//# sourceMappingURL=JCLCheckSessionUtils.js.map