/** * Client-side API service for FlowDrop * Provides methods to interact with the backend APIs using configurable endpoints */ import type { NodeMetadata, Workflow } from '../types/index.js'; import type { EndpointConfig } from '../config/endpoints.js'; /** * Set the endpoint configuration at runtime */ export declare function setEndpointConfig(config: EndpointConfig): void; /** * Get the current endpoint configuration */ export declare function getEndpointConfig(): EndpointConfig | null; /** * Node API methods */ export declare const nodeApi: { /** * Get all node types with optional filtering */ getNodes(options?: { category?: string; search?: string; limit?: number; offset?: number; }): Promise; /** * Get a specific node type by ID */ getNode(id: string): Promise; }; /** * Workflow API methods */ export declare const workflowApi: { /** * Get all workflows with optional filtering */ getWorkflows(options?: { search?: string; limit?: number; offset?: number; }): Promise; /** * Get a specific workflow by ID */ getWorkflow(id: string): Promise; /** * Create a new workflow */ createWorkflow(workflow: Omit): Promise; /** * Update an existing workflow */ updateWorkflow(id: string, workflow: Partial): Promise; /** * Delete a workflow */ deleteWorkflow(id: string): Promise; /** * Save workflow (create or update). * * A workflow is considered existing when it already has an id (any format — * integer, UUID, slug). Only a missing/empty id means "truly new". * * Note: globalSave.ts bypasses this method and calls createWorkflow / * updateWorkflow directly so it can capture the new/existing decision before * the uuidv4() fallback. This method is kept for external callers. */ saveWorkflow(workflow: Workflow): Promise; }; /** * Export the API service */ export declare const api: { nodes: { /** * Get all node types with optional filtering */ getNodes(options?: { category?: string; search?: string; limit?: number; offset?: number; }): Promise; /** * Get a specific node type by ID */ getNode(id: string): Promise; }; workflows: { /** * Get all workflows with optional filtering */ getWorkflows(options?: { search?: string; limit?: number; offset?: number; }): Promise; /** * Get a specific workflow by ID */ getWorkflow(id: string): Promise; /** * Create a new workflow */ createWorkflow(workflow: Omit): Promise; /** * Update an existing workflow */ updateWorkflow(id: string, workflow: Partial): Promise; /** * Delete a workflow */ deleteWorkflow(id: string): Promise; /** * Save workflow (create or update). * * A workflow is considered existing when it already has an id (any format — * integer, UUID, slug). Only a missing/empty id means "truly new". * * Note: globalSave.ts bypasses this method and calls createWorkflow / * updateWorkflow directly so it can capture the new/existing decision before * the uuidv4() fallback. This method is kept for external callers. */ saveWorkflow(workflow: Workflow): Promise; }; };