import { Command } from 'commander'; import CliCommand from './cli-command'; export default class Pack extends CliCommand { connectorJson: any; constructor(); options(module: Command): void; handler(module: Command): void; /** * Helper method that initializes the global connector.json file based on the CWD and checks * for a valid connector structure. * * @returns True if the connectorJson was parsed successfully */ loadConnectorJson(): boolean; /** * Helper method that helps check to make sure the necessary files and folders * are present for packaging. * * @param filePath Path to TACO folder * @param connectorJsonPath Path to app/connector.json * @returns True if the connector.json and dist folder exists, false otherwise. */ checkFiles(filePath: string, connectorJsonPath: string, isTest?: boolean): boolean; /** * Helper method that helps verify that the connector.json file found in the connectors * app/folder is valid against the connector.schema.json file. * * @param filePath Path to the connector folder to be packaged * @returns True if connector.json is validated successfully */ validateConnectorJson(filePath: string, isTest?: boolean): boolean; /** * Returns whether the connector is set up to use Oauth or not * * @param connectorJson JSON string cast to object, read from connectors app/connector.json file */ isOauthConnector(): boolean; /** * Returns the mapping of file template values to the ConnectorJson values for the sake of * replacement when generating connector xml files. */ getReplacementsMap(): any; /** * Helper method that creates all the necessary files for packaging by reading the * necessary data from the given connector.json file. * * @param filePath Path to the connector folder to be packaged * @returns True if all the files were created successfully */ createFiles(filePath: string, overwriteFiles?: boolean): boolean; /** * Helper method that generates key value entry for capabilities and accessTokenResponseMaps * * @param entryObject Map containing values to be added to oauth-config file * @returns String containing result entry, or null if the input is falsy */ generateKeyValueEntries(entryObject: any): string | null; /** * Helper method that validates the created files by calling the existing Connector * validation scripts and using XML/XSD validation. * * @param filePath Path to the connector folder to be packaged * @returns True if all the files are validated successfully */ validateFiles(filePath: string, isTest?: boolean): boolean; /** * Helper method that checks to make sure that there is a valid JDK installed and * then packages all the necessary files into a *.taco file. * * @returns True if connector is packaged successfully */ packageConnector(extraFiles?: never[]): boolean; /** * Helper method that moves the packaged connector to the proper destination folder * if another folder is specified. * * @param destPath Destination folder where the packaged connector is to be moved to */ movePackage(destPath: string, isTest?: boolean): boolean; }