import { RundeckClient } from '@rundeck/client'; import { ExecutionState as ApiExecState, ExecutionStateWorkflow, ExecutionStateStep } from '@rundeck/client/dist/lib/models'; import { RootStore } from './RootStore'; declare enum ExecutionStepState { PENDING = "PENDING", WAITING = "WAITING", RUNNING = "RUNNING", SUCCEEDED = "SUCCEEDED", FAILED = "FAILED" } export declare class ExecutionStateStore { readonly root: RootStore; readonly client: RundeckClient; executionStates: Map; constructor(root: RootStore, client: RundeckClient); /** * Fetch execution state from the server. * Updates stored state if it already exists. * @param id Execution ID */ fetch(id: string): Promise; /** Get existing or create new state object from id */ getOrCreate(id: string): ExecutionState; } export declare class ExecutionState { readonly store: ExecutionStateStore; executionId: number; serverNode: ExecutionNode; state: ExecutionStepState; completed: boolean; nodes: Map; workflow: ExecutionWorkflow; steps: Map; constructor(store: ExecutionStateStore); updateFromApiReponse(data: ApiExecState): void; getOrCreateNode(name: string): ExecutionNode; getOrCreateStep(stepctx: string, workflow: ExecutionWorkflow): ExecutionStep; } export declare class ExecutionWorkflow { readonly executionState: ExecutionState; steps: Array; stepCount: number; completed: boolean; startTime?: Date; endTime?: Date; targetNodes: Array; nodes: Map; constructor(executionState: ExecutionState); updateFromApiCall(data: ExecutionStateWorkflow): void; getOrCreateStep(stepctx: string): ExecutionStep; } export declare class ExecutionStep { readonly workflow: ExecutionWorkflow; id: string; stepctx: string; nodeStep: boolean; state: ExecutionStepState; nodeStates: Map; duration: number; startTime?: Date; updateTime?: Date; endTime?: Date; parameters: Map; parameterStates: Map; hasSubWorkflow: boolean; subWorkflow?: ExecutionWorkflow; constructor(workflow: ExecutionWorkflow); updateFromApiResponse(data: ExecutionStateStep): void; setNodeState(nodeState: StepState): void; } export declare class StepState { node: ExecutionNode; step: ExecutionStep; state: ExecutionStepState; constructor(node: ExecutionNode, step: ExecutionStep, state: ExecutionStepState); } export declare class ExecutionNode { /** List of workflow steps in the order they were executed on this node */ steps: Array; stepsByCtx: Map; /** Unique name of this node */ name: string; constructor(name: string); /** Add associated step if it has not already been added */ addStep(step: ExecutionStep): void; } export {};