import { IHandlerParameters } from "@zowe/imperative" ; import { IJob , GetJobs } from "@zowe/zos-jobs-for-zowe-sdk" ; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; export class export default class SpoolFileByIdHandler extends ZosmfBaseHandler { param { IHandlerParameters } params returns { Promise < void > } memberof public async processCmd ( params ) { const job = await GetJobs . getJob ( this . mSession , this . mArguments . jobid ) ; const content = await GetJobs . getSpoolContentById ( this . mSession , job . jobname , job . jobid , this . mArguments . spoolfileid ) ; this . data . setObj ( content ) ; this . data . setMessage ( `Spool file "${ this . mArguments . spoolfileid }" content obtained for job "${ job . jobname }(${ job . jobid })"` ) ; this . console . log ( Buffer . from ( content ) ) ; } }