import { AbstractSession , IHandlerParameters , TextUtils } from "@zowe/imperative" ; import { ZosFilesConstants , IZosFilesResponse , Invoke , IZosFilesOptions } from "@zowe/zos-files-for-zowe-sdk" ; import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler" ; export export default class AmsStatementsHandler extends ZosFilesBaseHandler { public async processWithSession ( commandParameters , session ) { const zosFilesOptions = { responseTimeout : commandParameters . arguments . responseTimeout } ; const statements = TextUtils . wordWrap ( commandParameters . arguments . controlStatements , ZosFilesConstants . MAX_AMS_LINE - ZosFilesConstants . MAX_AMS_BUFFER ) . split ( /\r?\n/ ) ; for ( let stIdx = 0 ; stIdx < statements . length - 1 ; ++ stIdx ) { statements [ stIdx ] += " -" ; } const response = await Invoke . ams ( session , statements , zosFilesOptions ) ; commandParameters . response . console . log ( TextUtils . prettyJson ( response . apiResponse ) ) ; return response ; } }