import { HCloud } from "../../../../Hcloud"; import { ReducedSpace } from "../../../global"; import { ReducedOrganization, ReducedUser } from "../../../idp"; import { WaveCatalog, WaveEngine } from "../../wave"; import { ReducedEvent } from "../event"; import { DesignBuild } from "../event/stream"; import { NodeType, StreamNodeAdditionalConnector, StreamNodeOutput, StreamNodeResolvedInputs, StreamSingleNodeResult } from "../event/stream/node"; export declare enum High5ExecutionPayloadType { JSON = "JSON", GENERIC = "GENERIC" } export interface High5ExecutionPayload { type: High5ExecutionPayloadType; data: string; } export interface High5ExecutionRequest { payload: High5ExecutionPayload; target: string; dry?: boolean; parentExecutionSecret?: string; } export interface High5ExecuteAgentResponse { failed: boolean; message: string; } export declare enum High5ExecutionState { QUEUED = "QUEUED", RUNNING = "RUNNING", WAITING = "WAITING", COMPLETED = "COMPLETED" } export declare enum High5ExecutionOutcome { PENDING = "PENDING", SUCCESS = "SUCCESS", FAILED = "FAILED", CANCELED = "CANCELED" } export interface StreamRunningNode { uuid: string; name: string; progress: number; message: string; } export interface EventExecutionResult { high5ExecutionId: string; streamId: string; state: High5ExecutionState; outcome: High5ExecutionOutcome; runningNodes: StreamRunningNode[]; } export interface High5ExecutionPackage { design?: DesignBuild; payload: High5ExecutionPayload; waveCatalogs: WaveCatalog[]; waveEngine: WaveEngine; dry: boolean; info: StreamInfo; debug: boolean; executionId: string; } type StreamInfo = { target: string; webhook?: WebhookInfo; triggerDetails?: TriggerDetails; }; type WebhookInfo = { callbackUrl: string; }; type TriggerDetails = { source: TriggerSource; ip: string; country: string; }; declare enum TriggerSource { webhook = "webhook", api = "api", sdk = "sdk", stream = "stream" } export interface ExtendedHigh5ExecutionPackage extends High5ExecutionPackage { hcl: HCloud; orgName: string; orgId: string; spaceName: string; spaceId: string; streamId: string; secret: string; targetEmail: string; poolName?: string; } export interface High5ExecutionPatchLog { streamId: string; nodeResults: StreamSingleNodeResult[]; nodeResultsToRemove?: string[]; } export interface StreamRunningNodePatch { uuid: string; name: string; progress: number; message: string; } interface ReducedAgentInfo { bundleVersion?: string; osRelease?: string; osVersion?: string; cpu?: string; cpuArchitecture?: string; ip?: string; } export interface High5ExecutionPatchStatus { streamId: string; state?: High5ExecutionState; outcome?: High5ExecutionOutcome; runningNodes?: StreamRunningNodePatch[]; message?: string; startDate: number; endDate?: number; agentInfo?: ReducedAgentInfo; } export interface High5ExecutionPatch { high5ExecutionPatchStatus: High5ExecutionPatchStatus; high5ExecutionPatchLog: High5ExecutionPatchLog; } export interface High5ExecutionStatus { _id: string; organization: ReducedOrganization; space: ReducedSpace; event: ReducedEvent; streamId: string; streamName: string; high5ExecutionId: string; creator: ReducedUser; state: High5ExecutionState; outcome: High5ExecutionOutcome; message: string; runningNodes: StreamRunningNode[]; target: ReducedUser; triggerSource?: TriggerSource; dry: boolean; createDate: number; startDate: number; endDate: number; debug?: boolean; agentInfo?: ReducedAgentInfo; waveEngineVersion?: string; isPoolExecution?: boolean; } export interface High5ExecutionLog { _id: string; streamId: string; payload?: High5ExecutionPayload; high5ExecutionId: string; nodeResults: StreamSingleNodeResult[]; target: ReducedUser; createDate: number; } export interface High5ExecutionResponse { high5ExecutionId: string; statusId: string; logId: string; } export interface StreamNode { uuid: string; name: string; catalog: WaveCatalog; path: string; bypass?: boolean; onSuccess?: string; onFail?: string; inputs?: StreamNodeResolvedInputs[]; outputs?: StreamNodeOutput[]; additionalConnectors?: StreamNodeAdditionalConnector[]; breakpoint?: boolean; color?: string; nodeType?: NodeType; streamId?: string; } export interface High5ExecuteOnAgentRequest { organizationName: string; spaceName: string; spaceId: string; streamId: string; secret: string; subject: string; } export interface High5ExecutionCancelRequest { secret: string; } export interface ExecutionTreeNode { executionStatusId: string; orgName: string; spaceName: string; eventName: string; streamName: string; streamId: string; state: High5ExecutionState; outcome: High5ExecutionOutcome; message?: string; runningNodes: StreamRunningNode[]; target: string; triggerSource: TriggerSource; startDate: number; endDate: number; children: ExecutionTreeNode[]; } export interface ExecutionTree { root: ExecutionTreeNode; } export {};