import { HCloud } from "../../../../Hcloud"; import { PaginatedResponse, 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; queued?: boolean; blocking?: boolean; priority?: number; retryCount?: number; startTime?: number; } 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; streamName: string; eventName: 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 { executor?: string; 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; executor?: ReducedUser; waveEngineVersion?: string; isPoolExecution?: boolean; queued?: boolean; blocking?: boolean; priority?: number; startTime?: number; currentRetry?: number; assignedClient?: string; /** * Plaintext payload data of the execution, only set when searching execution states by payload * (filter keys "payload" or "payload."). JSON payloads are returned as JSON value, generic payloads as string. */ payload?: unknown; } /** * Response of an execution state search. Searches with payload filters count at most 1000 matches, * a higher number of matches is reported with total = 1000 and totalCapped = true. */ export interface High5ExecutionStatusSearchResponse extends PaginatedResponse { /** True if total holds the capped count of a payload search instead of the exact number of matches */ totalCapped: boolean; } /** * Response of a full execution state search by payload, which considers all executions but skips the count */ export interface High5ExecutionStatusFullSearchResponse { items: High5ExecutionStatus[]; /** True if a next page exists */ hasMore: 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 {};