@zowe/cics-for-zowe-cli
Version:
IBM CICS Plug-in for Zowe CLI
60 lines • 2.62 kB
JavaScript
;
/**
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
const cics_for_zowe_sdk_1 = require("@zowe/cics-for-zowe-sdk");
const imperative_1 = require("@zowe/imperative");
const CicsBaseHandler_1 = require("../../CicsBaseHandler");
// Does not use the import in anticipation of some internationalization work to be done later.
const strings = require("../../-strings-/en").default.DEFINE.RESOURCES.WEBSERVICE;
/**
* Command handler for defining CICS transactions via CMCI
* @export
* @class TransactionHandler
* @implements {ICommandHandler}
*/
class WebServiceHandler extends CicsBaseHandler_1.CicsBaseHandler {
async processWithSession(params, session) {
const status = {
statusMessage: "Defining web service to CICS",
percentComplete: 0,
stageName: imperative_1.TaskStage.IN_PROGRESS,
};
params.response.progress.startBar({ task: status });
/*
* Git Bash on Windows attempts to replace forward slashes with a
* directory path (e.g., /u -> U:/). CICS is picky when it validates the
* wsbind path. Unlike typical Unix paths, it must start with one slash
* and two are not allowed. We need to support paths prefixed with two
* slashes so Git Bash does not tamper with them, and then strip off the
* extra leading slash here so CICS validation will not complain.
*/
let wsBind = params.arguments.wsbind;
if (wsBind.startsWith("//")) {
wsBind = wsBind.slice(1);
}
const response = await (0, cics_for_zowe_sdk_1.defineWebservice)(session, {
name: params.arguments.webserviceName,
csdGroup: params.arguments.csdGroup,
pipelineName: params.arguments.pipelineName,
wsBind,
description: params.arguments.description,
validation: params.arguments.validation,
wsdlFile: params.arguments.wsdlFile,
regionName: params.arguments.regionName,
cicsPlex: params.arguments.cicsPlex,
});
params.response.console.log(strings.MESSAGES.SUCCESS, params.arguments.webserviceName);
return response;
}
}
exports.default = WebServiceHandler;
//# sourceMappingURL=Webservice.handler.js.map