import { IHandlerParameters , TextUtils } from "@zowe/imperative" ; import { explainPublishedTemplatesFull , explainPublishedTemplatesSummary , ListCatalogTemplates , ProvisioningConstants , IPublishedTemplates } from "@zowe/provisioning-for-zowe-sdk" ; import { ZosmfBaseHandler } from "@zowe/zosmf-for-zowe-sdk" ; export class implements ICommandHandler export default class CatalogTemplatesHandler extends ZosmfBaseHandler { public async processCmd ( commandParameters ) { const templates = await ListCatalogTemplates . listCatalogCommon ( this . mSession , ProvisioningConstants . ZOSMF_VERSION ) ; let prettifiedTemplates = { } ; if ( commandParameters . arguments . allInfo ) { prettifiedTemplates = TextUtils . explainObject ( templates , explainPublishedTemplatesFull , true ) ; } else { prettifiedTemplates = TextUtils . explainObject ( templates , explainPublishedTemplatesSummary , false ) ; } let response = "z/OSMF Service Catalog templates\n" ; response = response + TextUtils . prettyJson ( prettifiedTemplates ) ; commandParameters . response . console . log ( response ) ; commandParameters . response . data . setObj ( templates ) ; } }