import { IContext, IDelegatedParameters, IFlow, IFlowLocationOptions } from '../interfaces'; import { ActionHandler, ActionSnapshot } from '../models'; export declare class FlowService { static MASKED: string; private index; private flowPathCache; private flowResolvers; private constructor(); private static pInstance; static get instance(): FlowService; static reset(): void; /** * Get FBL home directory */ static getHomeDir(): string; /** * Turn to true to capture snapshots * @type {boolean} */ debug: boolean; /** * Execute action * @param {string} wd Working Directory * @param action * @param {IContext} context * @param {IDelegatedParameters} parameters * @param {ActionSnapshot} parentSnapshot * @returns {Promise} */ executeAction(source: string, wd: string, action: Record | string, context: IContext, parameters: IDelegatedParameters, parentSnapshot?: ActionSnapshot): Promise; /** * Get cached tarball pass by given url * @param url */ static getCachedTarballPathForURL(url: string): Promise; /** * Download tarball into temp location * @param {IFlowLocationOptions} location * @param {number} [redirectCount] * @return {Promise} temp tarball location */ private downloadTarball; /** * Extract tarball to temp dir * @param {string} path * @return {Promise} path to temp dir */ private extractTarball; /** * Recursively find index.yml in directory structure * @param {string} path * @return {Promise} */ recursivelyFindIndexFileInDir(path: string): Promise; /** * Resolve flow, skipping checks if similar resolve action is already running * @param {IFlowLocationOptions} location * @return {Promise} */ resolveFlowSkipChecks(location: IFlowLocationOptions): Promise; resolveFlowTarget(local: string, location: IFlowLocationOptions): Promise; /** * Resolve flow based on path * @param {IFlowLocationOptions} location * @return {Promise} */ resolveFlow(location: IFlowLocationOptions): Promise; /** * Read flow from file * @param {IFlowLocationOptions} location * @param {IContext} context * @param {ActionSnapshot} snapshot * @param {IDelegatedParameters} parameters * @returns {Promise} */ readFlowFromFile(location: IFlowLocationOptions, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters): Promise<{ flow: IFlow; wd: string; }>; /** * Resolve template * @param {string} delimiter EJS template delimiter * @param {string} tpl template to resolve * @param {IContext} context * @param {ActionSnapshot} snapshot * @param {IDelegatedParameters} parameters * @param [extraVariables] additional varialbes to be presented in EJS data * @return {string} */ resolveTemplate(delimiter: string, tpl: string, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters, extraVariables?: { [key: string]: any; }, wd?: string): Promise; /** * Resolve options with no handler check * @param {string} delimiter - EJS template delimiter, by default EJS is using % * @param options * @param {IContext} context * @param {ActionSnapshot} snapshot * @param {IDelegatedParameters} parameters delegated parameters * @param {boolean} maskSecrets if true - all secrets will be masked * @return {any} */ resolveOptionsWithNoHandlerCheck(delimiter: string, options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters, maskSecrets: boolean): Promise; /** * Resolve options for handler * @param {ActionHandler} handler * @param options * @param {IContext} context * @param {IDelegatedParameters} parameters delegated parameters * @param {boolean} maskSecrets if true - all secrets will be masked * @returns {Promise} */ resolveOptions(handler: ActionHandler, options: any, context: IContext, snapshot: ActionSnapshot, parameters: IDelegatedParameters, maskSecrets: boolean): Promise; }