import { IHandlerParameters } from "@zowe/imperative" ; import { DownloadJobs , GetJobs , IDownloadAllSpoolContentParms , IJob } from "@zowe/zos-jobs-for-zowe-sdk" ; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; export class implements ICommandHandler export default class OutputHandler extends ZosmfBaseHandler { param { IHandlerParameters } params returns { Promise < void > } memberof public async processCmd ( params ) { const response = { } ; const jobid = this . mArguments . jobid + "" ; const outDir = this . mArguments . directory ; const omitJobidDirectory = ! ! this . mArguments . ojd ; const extension = this . mArguments . extension ; const job = await GetJobs . getJob ( this . mSession , jobid ) ; const options = { jobname : job . jobname , jobid , outDir , omitJobidDirectory , extension } ; await DownloadJobs . downloadAllSpoolContentCommon ( this . mSession , options ) ; if ( options . outDir == null ) { options . outDir = DownloadJobs . DEFAULT_JOBS_OUTPUT_DIR ; } this . console . log ( `Successfully downloaded the job output\nDestination: ${ options . outDir }` ) ; this . data . setObj ( response ) ; } }