zowe-cli-cics-deploy-plugin
Version:
IBM CICS Bundle generation and deployment for Zowe CLI
113 lines (112 loc) • 3.82 kB
TypeScript
import { IHandlerParameters } from "@zowe/imperative";
/**
* Interface to represent the manifest data for a BundlePart.
*
* @export
* @interface IBundlePartDataType
*/
export interface IBundlePartDataType {
name: string;
type: string;
path: string;
}
/**
* Class to represent a CICS BundlePart.
*
* @export
* @class BundlePart
*/
export declare class BundlePart {
/**
* Perform checks to determine whether it is likely that a file can be written.
*
* @param {string} filename - The file to check
* @returns {boolean}
* @throws ImperativeError
* @memberof BundlePart
*/
static alreadyExists(filename: string, overwrite: boolean): boolean;
/**
* Determine whether a file reference is local to the Bundle. Returns a normalised
* reference, or null if the reference is invalid.
*
* @param {string} filename - The filename to validate.
* @param {string} bundledir - The home directory for the Bundle.
* @returns {string}
* @throws ImperativeError
* @memberof BundlePart
*/
static getRelativeFileReference(filename: string, bundledir: string): string;
protected static fs: any;
protected static path: any;
/**
* Function for mangaling a name into something valid for CICS
*
* @throws ImperativeError
* @memberof BundlePart
*/
protected static mangleName(text: string, maxLength: number): string;
protected bundleDirectory: string;
protected overwrite: boolean;
private partData;
private simpleType;
private params;
/**
* Constructor for creating a BundlePart.
* @param {string} directory - The bundle directory.
* @param {IBundlePartDataType} partDataLocal - The metadata for the BundlePart.
* @param {boolean} validatePath - True if the path property should be validated.
* @param {boolean} overwrite - True if the parts contents are allowed to be changed.
* @param {IHandlerParameters} params - The current Imperative handler parameters
* @static
* @throws ImperativeError
* @memberof BundlePart
*/
constructor(directory: string, partDataLocal: IBundlePartDataType, validatePath: boolean, abbrevType: string, overwrite: boolean, params?: IHandlerParameters);
/**
* Returns the BundlePart's manifest data.
*
* @returns {IBundlePartDataType}
* @throws ImperativeError
* @memberof BundlePart
*/
getPartData(): IBundlePartDataType;
/**
* Perform whatever validation can be done in advance of attempting to save the
* BundlePart, thereby reducing the possibility of a failure after some of the
* bundle's parts have already been persisted to the file system.
*
* @throws ImperativeError
* @memberof BundlePart
*/
prepareForSave(): void;
/**
* Save the current BundlePart. Any changes that have been made will be persisted.
*
* @throws ImperativeError
* @memberof BundlePart
*/
save(): void;
/**
* Resolves a file reference to ensure that it exists and is located within
* the working directory. Returns the normalized file reference.
*
* @param {string} filename - The filename to validate.
* @returns {string}
* @throws ImperativeError
* @memberof BundlePart
*/
protected normalizeAndValidateFileReference(filename: string): string;
/**
* Function to log the modification or creation of a file
*
* @param {string} file - the name of the file to log
* @param {string} action - the action to log
* @throws ImperativeError
* @memberof BundlePart
*/
protected logCreation(file: string, action: string): void;
private validateName;
private validateType;
private validatePath;
}