import { AbstractSession , IHandlerParameters , ITaskWithStatus , TaskStage , TextUtils } from "@zowe/imperative" ; import { Upload , IZosFilesResponse } from "@zowe/zos-files-for-zowe-sdk" ; import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler" ; export export default class FileToUSSHandler extends ZosFilesBaseHandler { public async processWithSession ( commandParameters , session ) { const task = { percentComplete : 0 , statusMessage : "Uploading USS file" , stageName : TaskStage . IN_PROGRESS } ; commandParameters . response . progress . startBar ( { task } ) ; const response = await Upload . fileToUssFile ( session , commandParameters . arguments . inputfile , commandParameters . arguments . USSFileName , { binary : commandParameters . arguments . binary , encoding : commandParameters . arguments . encoding , task , responseTimeout : commandParameters . arguments . responseTimeout } ) ; const formatMessage = TextUtils . prettyJson ( response . apiResponse ) ; commandParameters . response . console . log ( formatMessage ) ; return response ; } }