export interface IFlow { id?: string | null; spaceId?: string | null; name?: string | null; description?: string | null; enabled: boolean | false; variables: IFlowVariable[]; nodes?: IReactFlowNode[] | null; edges?: IReactFlowEdge[] | null; viewport: { x: number; y: number; zoom: number; }; createdAt?: string | null; updatedAt?: string | null; deletedAt?: string | null; } export interface IFlowVariable { name: string; description?: string | ''; showInConversation?: boolean | false; type: 'string' | 'number' | 'boolean' | 'date' | 'json' | 'array'; } export declare enum NodeType { NULL = 0, START = 11, START_CONVERSATION_OPENED = 12, START_CONVERSATION_CLOSED = 13, START_CONTACT_TAG_UPDATED = 14, START_CONTACT_FIELD_UPDATED = 15, START_CONTACT_FIELD_DATES = 16, START_CONTACT_EVENT_DATE = 17, MSG_TEMPLATE = 20, MSG_TEXT = 21, MSG_WAIT_RESPONSE = 22, MSG_TEMPLATE_REPLY = 23, MSG_TEXT_REPLY = 24, SQL_QUERY = 31, API = 32, SEND_EMAIL = 33, FILL_FORM = 41, FILL_TICKET = 42, CONTACT_SEARCH = 51, CONTACT_UPDATE = 52, CONVERSATION_ASSIGN_TO = 61, CONVERSATION_UPDATE = 62, CONVERSATION_FINALIZE = 63, TIME_SCHEDULE_CONTROL = 81, TIME_TIMER = 82, TIME_WAIT_UNTIL = 83, CONDITIONAL = 71, REDIRECT = 72, AI_CHATBOT = 91, TOOL_TRII_CONTACT_UPDATE = 200, TOOL_TRII_CONTACT_SEARCH = 201, TOOL_TRII_CALENDAR = 202, TOOL_MAPS_CHECK_POLYGON = 203, TOOL_MCP_CLIENT = 204, TOOL_KNOWLEDGE = 205, TOOL_FUNCTION = 206, TOOL_CALCULATOR = 207, TOOL_SHOPPING_CART = 208, TOOL_API = 209, TOOL_ASSIGN_TO = 210, TOOL_OCR = 211, TOOL_EXTRACT_VARIABLES = 212, TOOL_GOOGLE_CALENDAR = 251, TOOL_GOOGLE_MAPS = 252 } export type NodeCategory = 'trigger' | 'action' | 'tool' | 'agent' | 'message'; export interface IReactFlowNode { id: string; type: NodeType; data: INode; position: { x: number; y: number; }; } export interface IReactFlowEdge { id: string | null; type: string; source: string | null; sourceHandle?: string | null; target: string | null; targetHandle?: string | null; data: { label: string | ''; }; } export interface INode { id: string; type: NodeType; category: NodeCategory; description: string | ''; tags?: string[]; version: number; icon: string; color?: string; badge?: string; hideOutput?: boolean; hideInput?: boolean; author?: string; documentation?: string; handlesIn: INodeHandle[]; handlesOut: INodeHandle[]; asyncLoadHandlesOut: boolean | false; name: string; nameKey?: string; enableStatics?: boolean | false; propertiesTabs: INodeTab[]; properties: INodeProperty[]; values?: ICommonObject; } export interface INodeTab { id: string; label: string; } export interface INodeHandle { id: string; name: string; nameKey?: string; type: 'source' | 'target'; position: 'left' | 'right' | 'top' | 'bottom'; /** * Si un handle del tipo (source) permite múltiples conexiones salientes. */ multiple: boolean; /** * Si un handle de tipo fuente (source) muestra el nombre definido en la UI */ showName: boolean; /** * To limit connections to specific node types. * Same tags must be present in the target node. */ tags?: string[]; /** * Condiciones para mostrar u ocultar el handle, basadas en los valores de las propiedades del nodo */ show?: INodeDisplay; hide?: INodeDisplay; } export interface INodeProperty { /** * Identificador/nombre único de la propiedad */ id: string; /** * Etiqueta que se muestra en la UI */ label: string; /** * Clave para utilizar en diccionario de traducciones */ labelKey?: string; /** * Tipo de parámetro, puede ser un tipo predefinido o un tipo personalizado * Ejemplo: 'string', 'number', 'boolean', 'asyncOptions', etc. */ type: NodeParamsType | string; /** * Valor por defecto del parámetro. * Puede ser un valor simple, un objeto o un array de objetos. */ default?: CommonType | ICommonObject | ICommonObject[]; description?: string; warning?: string; placeholder?: string; options?: Array; datagrid?: Array; credentialNames?: Array; optional?: boolean; step?: number; rows?: number; list?: boolean; additionalParams?: boolean; hidden?: boolean; acceptVariable?: boolean; acceptEmojis?: boolean; allowMaximizeInput?: boolean; acceptNodeOutputAsVariable?: boolean; fileType?: string; loadMethod?: string; loadConfig?: boolean; hideCodeExecute?: boolean; codeExample?: string; hint?: Record; tabId?: string; refresh?: boolean; freeSolo?: boolean; loadPreviousNodes?: boolean; array?: Array; show?: INodeDisplay; hide?: INodeDisplay; generateDocStoreDescription?: boolean; generateInstruction?: boolean; numberMin?: number; numberMax?: number; } export type NodeParamsType = 'asyncOptions' | 'asyncMultiOptions' | 'options' | 'multiOptions' | 'datagrid' | 'string' | 'number' | 'boolean' | 'password' | 'json' | 'date' | 'file' | 'folder' | 'tabs' | 'title' | 'code' | 'codeJavascript'; export type CommonType = string | number | boolean | undefined | null; export interface ICommonObject { [key: string]: any | CommonType | ICommonObject | CommonType[] | ICommonObject[]; } export interface INodeDisplay { [key: string]: string[] | string | boolean | number | ICommonObject; } export interface INodeOptionsValue { label: string; id: string; description?: string; imageSrc?: string; } export interface IBodyRequest_AsyncNodes { propertyId?: string; loadMethod?: string; nodeId?: string; nodeType?: NodeType; values?: ICommonObject; }