import { IHandlerParameters , TextUtils } from "@zowe/imperative" ; import { CheckStatus , IZosmfInfoResponse , ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; import { CheckStatusMessages } from "../../constants/CheckStatus.messages" ; export class implements ICommandHandler export default class Handler extends ZosmfBaseHandler { public async processCmd ( commandParameters ) { const zosResponse = await CheckStatus . getZosmfInfo ( this . mSession ) ; const mainZosmfProps = { zosmf_port : zosResponse . zosmf_port , zosmf_saf_realm : zosResponse . zosmf_saf_realm , zos_version : zosResponse . zos_version , zosmf_full_version : zosResponse . zosmf_full_version , api_version : zosResponse . api_version } ; let userToDisplay ; if ( this . mSession . ISession . user === undefined || this . mSession . ISession . user === null || this . mSession . ISession . user . length === 0 ) { userToDisplay = "with a token" ; } else { userToDisplay = this . mSession . ISession . user ; } commandParameters . response . console . log ( TextUtils . formatMessage ( CheckStatusMessages . cmdSucceeded . message , { userName : userToDisplay , hostName : zosResponse . zosmf_hostname , mainZosmfProps : TextUtils . prettyJson ( mainZosmfProps ) , pluginStatus : TextUtils . prettyJson ( zosResponse . plugins ) } ) ) ; commandParameters . response . data . setObj ( zosResponse ) ; } }