import { InternalCodeNode, InputPin, OutputPin, InternalMacroNode, NodeStyle, InputMode } from ".."; export * from "./configurable-node-utils"; import { SecretTypeData } from "../node/configurable-value"; export type StaticOrDerived = T | ((config: Config) => T); export interface BaseCodeNodeData { mode?: "simple" | "advanced"; id: string; namespace?: string; menuDisplayName?: string; menuDescription?: string; displayName?: StaticOrDerived; description?: StaticOrDerived; overrideNodeBodyHtml?: StaticOrDerived; aliases?: string[]; icon?: string; completionOutputs?: StaticOrDerived; run: InternalCodeNode["run"]; sourceCode?: string; /** * Whether this node is a trigger node. * If true, the node will be treated as a trigger node and will not be editable. * Experimental * @default false */ isTrigger?: boolean; } export interface SimpleCodeNode extends BaseCodeNodeData { inputs: Record; outputs: Record; } export interface AdvancedCodeNode extends BaseCodeNodeData { mode: "advanced"; inputs: StaticOrDerived, Config>; outputs: StaticOrDerived, Config>; reactiveInputs?: StaticOrDerived; defaultConfig: Config; editorConfig?: InternalMacroNode["editorConfig"]; defaultStyle?: NodeStyle; } export type CodeNode = SimpleCodeNode | AdvancedCodeNode; export type InputConfig = { defaultValue?: any; /** * The label displayed above the input field. * If not provided, the description will be used as the label. * @recommended */ label?: string; description?: string; mode?: InputMode | "reactive"; /** * Whether the type of this input can be changed in the editor. * When false, the "Change type" button will not be shown and the input won't be exposed as an input pin. * @default true */ typeConfigurable?: boolean; aiCompletion?: { prompt: string; placeholder?: string; jsonMode?: boolean; }; /** * Optional condition that determines whether this input should be shown. * If the condition evaluates to false, the input will be hidden. * * Uses a string expression like "method !== 'GET'" that will be evaluated against the config. * The expression can reference other field values directly by their key. * * @example * condition: "method !== 'GET'" */ condition?: string; /** * Optional group configuration for organizing inputs. * When specified, this input will be treated as a group container. */ group?: { /** * The title of the group */ title: string; /** * Whether the group is collapsible */ collapsible?: boolean; /** * Whether the group is collapsed by default (only applies if collapsible is true) */ defaultCollapsed?: boolean; /** * Fields to include in this group. * Can include both regular field keys and other group keys for nested groups. */ fields: string[]; /** * Optional parent group key. When specified, this group will be nested inside the parent group. * If not specified, the group will be at the top level. */ parentGroup?: string; }; } & EditorTypeConfig; type EditorTypeConfig = { [K in EditorType]: { editorType?: K; editorTypeData?: EditorTypeDataMap[K]; }; }[EditorType]; type EditorType = "string" | "number" | "boolean" | "json" | "select" | "longtext" | "enum" | "secret"; type EditorTypeDataMap = { string: undefined; number: { min?: number; max?: number; }; boolean: undefined; json: undefined; select: { options: string[] | { value: string | number; label: string; }[]; }; longtext: { rows?: number; }; enum: { options: string[]; }; secret: SecretTypeData; }; export declare function isAdvancedCodeNode(node: CodeNode): node is AdvancedCodeNode; export declare function isSimplifiedCodeNode(node: CodeNode): node is SimpleCodeNode; export declare function isCodeNode(node: any): node is CodeNode; export declare function processConfigurableNode(node: CodeNode, secrets?: Record): InternalMacroNode; //# sourceMappingURL=configurable-nodes.d.ts.map