@broadcom/ca7-for-zowe-cli
Version:
CA 7 Workload Automation Plug-in for Zowe CLI
90 lines • 4.19 kB
JavaScript
;
/*
* Copyright (c) 2025 Broadcom. All Rights Reserved. The term
* "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This software and all information contained therein is
* confidential and proprietary and shall not be duplicated,
* used, disclosed, or disseminated in any way except as
* authorized by the applicable license agreement, without the
* express written permission of Broadcom. All authorized
* reproductions must be marked with this language.
*
* EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO
* THE EXTENT PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS
* SOFTWARE WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT
* LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL BROADCOM
* BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR
* DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
* INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS
* INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS
* EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.LifeCycleForCA7 = void 0;
const imperative_1 = require("@zowe/imperative");
/**
* This class performs lifecycle functions for your plugin. You are free to
* change the name of this class to reflect your plugin and its actions.
*
* You only have to supply such a class if you specify the 'pluginLifeCycle'
* property in your IImperativeConfig definition for your plugin. In this sample,
* that definition is supplied in src/pluginDef.ts.
*/
class LifeCycleForCA7 extends imperative_1.AbstractPluginLifeCycle {
/**
* This function will be called after a plugin is installed.
* A plugin can use this opportunity to perform a sanity test or to
* perform some additional setup which is specific to your plugin.
*
* If your plugin's postInstall function performs an asynchronous operation,
* its postInstall function should return a promise, allowing the CLI
* to await the postInstall function. Such a signature would be like this:
*
* public async postInstall(): Promise<void>
*
* If it has no asynchronous operation, the postInstall function can be
* written as a synchronous function. That is the style which this trivial
* synchronous sample uses below.
*
* If you supply this class, you must supply this function. If you have nothing to
* do post-install, then simply return from the function.
*/
postInstall() {
/* It is up to you to decide what actions are meaningful for you
* to perform immediately after your plugin is installed.
*/
}
/**
* This function will be called before a plugin is uninstalled.
* This lifecycle hook is intended to replace the capability that used to
* be performed by the NPM pre-uninstall action before NPM removed that
* capability in NPM version 7.
* See https://docs.npmjs.com/cli/v9/using-npm/scripts#a-note-on-a-lack-of-npm-uninstall-scripts
*
* A plugin can use this opportunity to revert any specialized setup that was
* established during the lifetime of your plugin.
*
* If your plugin's preUninstall function performs an asynchronous operation,
* its preUninstall function should return a promise, allowing the CLI
* framework to await the preUninstall function. Such a signature would be like this:
*
* public async preUninstall(): Promise<void>
*
* If it has no asynchronous operation, the preUninstall function can be
* written as a synchronous function. That is the style which this trivial
* synchronous sample uses below.
*
* If you supply this class, you must supply this function. If you have nothing to
* do pre-uninstall, then simply return from the function.
*/
preUninstall() {
/* The comments from the postInstall function also apply to the
* preUninstall function.
*/
}
}
exports.LifeCycleForCA7 = LifeCycleForCA7;
module.exports = LifeCycleForCA7;
//# sourceMappingURL=LifeCycleForCA7.js.map