import { AbstractSession , ImperativeExpect , Logger } from "@zowe/imperative" ; import { posix } from "path" ; import { ZosmfConstants } from "./constants/Zosmf.constants" ; import { ZosmfMessages } from "./constants/Zosmf.messages" ; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk" ; import { IZosmfInfoResponse } from "./doc/IZosmfInfoResponse" ; /**
 * This class holds the helper functions that are used to gather zosmf information throgh the
 * z/OSMF APIs.
 */ export class CheckStatus { param { AbstractSession } session returns { promise < IZosmfInfoResponse > } throws public static async getZosmfInfo ( session ) { this . log . trace ( "getZosmfInfo called" ) ; const infoEndpoint = posix . join ( ZosmfConstants . RESOURCE , ZosmfConstants . INFO ) ; this . log . debug ( `Endpoint: ${ infoEndpoint }` ) ; ImperativeExpect . toNotBeNullOrUndefined ( session , ZosmfMessages . missingSession . message ) ; return ZosmfRestClient . getExpectJSON ( session , infoEndpoint ) ; } returns { Logger } private static get log ( ) : Logger { return Logger . getAppLogger ( ) ; } }