import { INodeExecutionData, IWebhookNodeExecutionData } from 'outerbridge-components'; import { IDeployedWorkflowsPool, IComponentNodesPool, INodeDirectedGraph, IWorkflowExecutedData, ExecutionState, IReactFlowNode, IReactFlowEdge } from './Interface'; import { DataSource } from 'typeorm'; import { AbortController } from 'node-abort-controller'; import { Execution } from './entity/Execution'; import { ActiveTestTriggerPool } from './ActiveTestTriggerPool'; import { ActiveTestWebhookPool } from './ActiveTestWebhookPool'; export declare class DeployedWorkflowPool { deployedWorkflows: IDeployedWorkflowsPool; AppDataSource: DataSource; /** * Initialize to get all deployed workflows * @param {DataSource} AppDataSource */ initialize(AppDataSource: DataSource, componentNodes: IComponentNodesPool): Promise; /** * Add workflow to deployed workflow pools * @param {string[]} startingNodeIds * @param {INodeDirectedGraph} graph * @param {IReactFlowNode[]} reactFlowNodes * @param {IComponentNodesPool} componentNodes * @param {string} workflowShortId */ add(startingNodeIds: string[], graph: INodeDirectedGraph, reactFlowNodes: IReactFlowNode[], componentNodes: IComponentNodesPool, workflowShortId: string, activeTestTriggerPool?: ActiveTestTriggerPool, activeTestWebhookPool?: ActiveTestWebhookPool): Promise; /** * Start the rest of workflow via child process * @param {string} workflowShortId * @param {IReactFlowNode} startNode * @param {string} startingNodeId * @param {INodeExecutionData[] | IWebhookNodeExecutionData[]} startingNodeExecutedData * @param {IComponentNodesPool} componentNodes * @param {string[]} startingNodeIds * @param {INodeDirectedGraph} graph */ startWorkflow(workflowShortId: string, startNode: IReactFlowNode, startingNodeId: string, startingNodeExecutedData: INodeExecutionData[] | IWebhookNodeExecutionData[], componentNodes: IComponentNodesPool, startingNodeIds: string[], graph: INodeDirectedGraph): Promise; /** * Remove workflow from deployed workflow pools by: * 1.) Remove trigger 2.) Trigger abort controller 3.) Delete the object from deployedWorkflowsPool * @param {string[]} startingNodeIds * @param {IReactFlowNode[]} reactFlowNodes * @param {IComponentNodesPool} componentNodes * @param {string} workflowShortId */ remove(startingNodeIds: string[], reactFlowNodes: IReactFlowNode[], componentNodes: IComponentNodesPool, workflowShortId: string): Promise; /** * Remove all deployed workflows from pools: * @param {IComponentNodesPool} componentNodes */ removeAll(componentNodes: IComponentNodesPool): Promise; /** * Get nodes and edges from database * @param {string} workflowShortId */ prepareDataForChildProcess(workflowShortId: string): Promise<{ reactFlowNodes: IReactFlowNode[]; reactFlowEdges: IReactFlowEdge[]; }>; /** * Add results to deployedWorkflows[workflowShortId].workflowExecutedData, and Execution DB * @param {string} workflowShortId * @param {IWorkflowExecutedData[]} workflowExecutedData * @param {AbortController} controller */ addExecution(workflowShortId: string, workflowExecutedData: IWorkflowExecutedData[], controller: AbortController): Promise; /** * Update results to deployedWorkflows[workflowShortId].workflowExecutedData, and Execution DB * @param {string} workflowShortId * @param {IWorkflowExecutedData[]} workflowExecutedData * @param {string} executionShortId * @param {ExecutionState} state */ updateExecution(workflowShortId: string, workflowExecutedData: IWorkflowExecutedData[], executionShortId: string, state: ExecutionState): Promise; /** * Update INPROGRESS execution to TERMINATED * @param {string} workflowShortId */ terminateExecutions(workflowShortId: string): Promise; /** * Update specific execution to TIMEOUT * @param {string} newExecutionShortId */ terminateSpecificExecutionAfterTimeout(newExecutionShortId: string): Promise; }