import type { IConnections, INode, IWorkflowBase } from 'n8n-workflow'; import { z } from 'zod'; export declare const partialUpdateOperationSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"updateNodeParameters">; nodeName: z.ZodString; parameters: z.ZodRecord; replace: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "updateNodeParameters"; nodeName: string; parameters: Record; replace?: boolean | undefined; }, { type: "updateNodeParameters"; nodeName: string; parameters: Record; replace?: boolean | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"setNodeParameter">; nodeName: z.ZodString; path: z.ZodString; value: z.ZodEffects; }, "strip", z.ZodTypeAny, { path: string; type: "setNodeParameter"; value: {} | null; nodeName: string; }, { path: string; type: "setNodeParameter"; nodeName: string; value?: unknown; }>, z.ZodObject<{ type: z.ZodLiteral<"addNode">; node: z.ZodObject<{ name: z.ZodString; type: z.ZodString; typeVersion: z.ZodNumber; parameters: z.ZodOptional>; position: z.ZodOptional, [number, number], number[]>>; credentials: z.ZodOptional; name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; id?: string | undefined; }, { name: string; id?: string | undefined; }>>>; disabled: z.ZodOptional; notes: z.ZodOptional; id: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; type: string; typeVersion: number; id?: string | undefined; credentials?: Record | undefined; disabled?: boolean | undefined; parameters?: Record | undefined; position?: [number, number] | undefined; notes?: string | undefined; }, { name: string; type: string; typeVersion: number; id?: string | undefined; credentials?: Record | undefined; disabled?: boolean | undefined; parameters?: Record | undefined; position?: number[] | undefined; notes?: string | undefined; }>; }, "strip", z.ZodTypeAny, { type: "addNode"; node: { name: string; type: string; typeVersion: number; id?: string | undefined; credentials?: Record | undefined; disabled?: boolean | undefined; parameters?: Record | undefined; position?: [number, number] | undefined; notes?: string | undefined; }; }, { type: "addNode"; node: { name: string; type: string; typeVersion: number; id?: string | undefined; credentials?: Record | undefined; disabled?: boolean | undefined; parameters?: Record | undefined; position?: number[] | undefined; notes?: string | undefined; }; }>, z.ZodObject<{ type: z.ZodLiteral<"removeNode">; nodeName: z.ZodString; }, "strip", z.ZodTypeAny, { type: "removeNode"; nodeName: string; }, { type: "removeNode"; nodeName: string; }>, z.ZodObject<{ type: z.ZodLiteral<"renameNode">; oldName: z.ZodString; newName: z.ZodString; }, "strip", z.ZodTypeAny, { type: "renameNode"; oldName: string; newName: string; }, { type: "renameNode"; oldName: string; newName: string; }>, z.ZodObject<{ type: z.ZodLiteral<"addConnection">; source: z.ZodString; target: z.ZodString; sourceIndex: z.ZodOptional; targetIndex: z.ZodOptional; connectionType: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "addConnection"; source: string; target: string; connectionType?: string | undefined; sourceIndex?: number | undefined; targetIndex?: number | undefined; }, { type: "addConnection"; source: string; target: string; connectionType?: string | undefined; sourceIndex?: number | undefined; targetIndex?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"removeConnection">; source: z.ZodString; target: z.ZodString; sourceIndex: z.ZodOptional; targetIndex: z.ZodOptional; connectionType: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "removeConnection"; source: string; target: string; connectionType?: string | undefined; sourceIndex?: number | undefined; targetIndex?: number | undefined; }, { type: "removeConnection"; source: string; target: string; connectionType?: string | undefined; sourceIndex?: number | undefined; targetIndex?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"setNodeCredential">; nodeName: z.ZodString; credentialKey: z.ZodString; credentialId: z.ZodString; credentialName: z.ZodString; }, "strip", z.ZodTypeAny, { type: "setNodeCredential"; credentialName: string; credentialId: string; nodeName: string; credentialKey: string; }, { type: "setNodeCredential"; credentialName: string; credentialId: string; nodeName: string; credentialKey: string; }>, z.ZodObject<{ type: z.ZodLiteral<"setNodePosition">; nodeName: z.ZodString; position: z.ZodEffects, [number, number], number[]>; }, "strip", z.ZodTypeAny, { type: "setNodePosition"; nodeName: string; position: [number, number]; }, { type: "setNodePosition"; nodeName: string; position: number[]; }>, z.ZodObject<{ type: z.ZodLiteral<"setNodeDisabled">; nodeName: z.ZodString; disabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "setNodeDisabled"; disabled: boolean; nodeName: string; }, { type: "setNodeDisabled"; disabled: boolean; nodeName: string; }>, z.ZodObject<{ type: z.ZodLiteral<"setNodeSettings">; nodeName: z.ZodString; settings: z.ZodEffects>; retryOnFail: z.ZodOptional; maxTries: z.ZodOptional; waitBetweenTries: z.ZodOptional; alwaysOutputData: z.ZodOptional; executeOnce: z.ZodOptional; }, "strip", z.ZodTypeAny, { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }, { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }>, { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }, { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }>; }, "strip", z.ZodTypeAny, { type: "setNodeSettings"; settings: { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }; nodeName: string; }, { type: "setNodeSettings"; settings: { onError?: "continueErrorOutput" | "continueRegularOutput" | "stopWorkflow" | undefined; retryOnFail?: boolean | undefined; maxTries?: number | undefined; waitBetweenTries?: number | undefined; alwaysOutputData?: boolean | undefined; executeOnce?: boolean | undefined; }; nodeName: string; }>, z.ZodObject<{ type: z.ZodLiteral<"setWorkflowMetadata">; name: z.ZodOptional; description: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "setWorkflowMetadata"; name?: string | undefined; description?: string | undefined; }, { type: "setWorkflowMetadata"; name?: string | undefined; description?: string | undefined; }>]>; export type PartialUpdateOperation = z.infer; interface WorkflowSlice { name: string; description?: string; nodes: INode[]; connections: IConnections; } export interface ApplyOperationsSuccess { success: true; workflow: WorkflowSlice; addedNodeNames: string[]; } export interface ApplyOperationsFailure { success: false; error: string; opIndex: number; } export type ApplyOperationsResult = ApplyOperationsSuccess | ApplyOperationsFailure; export declare function applyOperations(input: WorkflowSlice, operations: PartialUpdateOperation[]): ApplyOperationsResult; export declare function toWorkflowSlice(workflow: IWorkflowBase): WorkflowSlice; export {};