/** * FlowDrop Endpoint Configuration * Provides configurable endpoints for all API actions */ import type { AgentSpecEndpointConfig } from './agentSpecEndpoints.js'; export interface EndpointConfig { /** Base URL for all endpoints */ baseUrl: string; /** Individual endpoint paths */ endpoints: { nodes: { list: string; get: string; byCategory: string; metadata: string; }; portConfig: string; categories: string; workflows: { list: string; get: string; create: string; update: string; delete: string; validate: string; export: string; import: string; }; executions: { execute: string; status: string; cancel: string; logs: string; history: string; }; pipelines: { list: string; get: string; create: string; update: string; delete: string; status: string; logs: string; execute: string; stop: string; }; playground: { /** List sessions for a workflow */ listSessions: string; /** Create a new session */ createSession: string; /** Get session details */ getSession: string; /** Delete a session */ deleteSession: string; /** Get messages from a session */ getMessages: string; /** Send a message to a session */ sendMessage: string; /** Stop execution in a session */ stopExecution: string; }; interrupts: { /** Get interrupt details by ID */ get: string; /** Resolve an interrupt with user response */ resolve: string; /** Cancel a pending interrupt */ cancel: string; /** List interrupts for a playground session */ listBySession: string; /** List interrupts for a pipeline */ listByPipeline: string; }; chat: { /** Send a message to the chat */ sendMessage: string; /** Get conversation history */ getHistory: string; /** Clear conversation history */ clearHistory: string; }; templates: { list: string; get: string; create: string; update: string; delete: string; }; users: { profile: string; preferences: string; }; system: { health: string; config: string; version: string; }; }; /** * Optional Agent Spec runtime configuration. * When provided, enables Agent Spec execution features. */ agentSpec?: AgentSpecEndpointConfig; /** HTTP method overrides for specific endpoints */ methods?: { [key: string]: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; }; /** Custom headers for specific endpoints */ headers?: { [key: string]: Record; }; /** Authentication configuration */ auth?: { type: 'none' | 'bearer' | 'api_key' | 'custom'; token?: string; apiKey?: string; headers?: Record; }; /** Request timeout in milliseconds */ timeout?: number; /** Retry configuration */ retry?: { enabled: boolean; maxAttempts: number; delay: number; backoff?: 'linear' | 'exponential'; }; /** * Optional transform applied to workflow objects before they are sent to the backend * (i.e., in create and update requests). * * Use this to adapt the generic FlowDrop `Workflow` shape to whatever your backend * expects. The function receives the workflow data and must return the body that will * be JSON-serialised and posted. * * Default: identity — the workflow is sent as-is. * * @example Drupal integration — Drupal expects `label` in addition to `name`: * ```ts * transformWorkflowPayload: (workflow) => ({ * ...workflow, * label: workflow.name, * }) * ``` */ transformWorkflowPayload?: (workflow: Record) => Record; } /** * Default endpoint configuration */ export declare const defaultEndpointConfig: EndpointConfig; /** * Create endpoint configuration with custom base URL */ export declare function createEndpointConfig(baseUrl: string, overrides?: Partial): EndpointConfig; /** * Build full URL for an endpoint */ export declare function buildEndpointUrl(config: EndpointConfig, endpointPath: string, params?: Record): string; /** * Get HTTP method for an endpoint */ export declare function getEndpointMethod(config: EndpointConfig, endpointKey: string): string; /** * Get custom headers for an endpoint */ export declare function getEndpointHeaders(config: EndpointConfig, endpointKey: string): Record;