@d34dman/flowdrop 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,10 +7,12 @@ A visual workflow editor component library built with Svelte 5 and @xyflow/svelt
7
7
  - **Visual Workflow Editor**: Drag-and-drop interface for building node-based workflows
8
8
  - **Svelte 5 Components**: Modern, reactive components with runes
9
9
  - **Configurable API Client**: Flexible endpoint configuration for backend integration
10
+ - **Runtime Configuration**: Build once, deploy anywhere with environment variables
10
11
  - **Node System**: Extensible node types with customizable configuration
11
12
  - **Real-time Updates**: Live workflow state management with stores
12
13
  - **Framework Agnostic**: Can be integrated into any web application
13
14
  - **TypeScript Support**: Full type definitions included
15
+ - **Docker Ready**: Production-ready Dockerfile and Docker Compose configuration
14
16
 
15
17
  ## 📦 Installation
16
18
 
@@ -325,6 +327,52 @@ MIT
325
327
  - Create an issue in the project repository
326
328
  - Review the examples in `src/lib/examples/`
327
329
 
330
+ ## 🚢 Deployment
331
+
332
+ FlowDrop uses **runtime configuration** instead of build-time environment variables, allowing you to build once and deploy to multiple environments.
333
+
334
+ ### Quick Start with Docker
335
+
336
+ ```bash
337
+ # Copy environment file
338
+ cp env.example .env
339
+
340
+ # Edit .env with your configuration
341
+ # Set FLOWDROP_API_BASE_URL to your backend API URL
342
+
343
+ # Start with Docker Compose
344
+ docker-compose up -d
345
+ ```
346
+
347
+ ### Environment Variables
348
+
349
+ **Production (Runtime):**
350
+ - `FLOWDROP_API_BASE_URL` - Backend API URL
351
+ - `FLOWDROP_THEME` - UI theme (light/dark/auto)
352
+ - `FLOWDROP_TIMEOUT` - Request timeout in milliseconds
353
+ - `FLOWDROP_AUTH_TYPE` - Authentication type (none/bearer/api_key/custom)
354
+ - `FLOWDROP_AUTH_TOKEN` - Authentication token
355
+
356
+ **Development (Build-time):**
357
+ - `VITE_API_BASE_URL` - Dev API URL (used only during `npm run dev`)
358
+
359
+ ### Build for Production
360
+
361
+ ```bash
362
+ # Install dependencies
363
+ npm ci
364
+
365
+ # Build the application
366
+ npm run build
367
+
368
+ # Set environment variables and start
369
+ export FLOWDROP_API_BASE_URL=http://your-backend:8080/api/flowdrop
370
+ node build
371
+ ```
372
+
373
+ For detailed deployment instructions, see:
374
+ - [DOCKER.md](./DOCKER.md) - Docker quick start
375
+
328
376
  ---
329
377
 
330
378
  **FlowDrop** - Visual workflow editing for modern web applications
@@ -1,44 +1,160 @@
1
1
  /**
2
2
  * Enhanced API Client for FlowDrop
3
- * Uses configurable endpoints for all API actions
3
+ *
4
+ * Uses configurable endpoints and supports pluggable authentication providers.
5
+ *
6
+ * @module api/enhanced-client
4
7
  */
5
- import type { NodeMetadata, Workflow, ExecutionResult } from '../types/index.js';
6
- import type { EndpointConfig } from '../config/endpoints.js';
8
+ import type { NodeMetadata, Workflow, ExecutionResult } from "../types/index.js";
9
+ import type { EndpointConfig } from "../config/endpoints.js";
10
+ import type { AuthProvider } from "../types/auth.js";
11
+ /**
12
+ * API error with additional context
13
+ */
14
+ export declare class ApiError extends Error {
15
+ /** HTTP status code */
16
+ readonly status: number;
17
+ /** Original error data from API */
18
+ readonly errorData: Record<string, unknown>;
19
+ /** Operation that was being performed */
20
+ readonly operation: string;
21
+ constructor(message: string, status: number, operation: string, errorData?: Record<string, unknown>);
22
+ }
7
23
  /**
8
24
  * Enhanced HTTP API client for FlowDrop with configurable endpoints
25
+ *
26
+ * Supports pluggable authentication via AuthProvider interface.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * // With AuthProvider
31
+ * const client = new EnhancedFlowDropApiClient(config, authProvider);
32
+ *
33
+ * // Backward compatible (uses config.auth)
34
+ * const client = new EnhancedFlowDropApiClient(config);
35
+ * ```
9
36
  */
10
37
  export declare class EnhancedFlowDropApiClient {
11
38
  private config;
12
- constructor(config: EndpointConfig);
39
+ private authProvider;
13
40
  /**
14
- * Make HTTP request with error handling and retry logic
41
+ * Create a new EnhancedFlowDropApiClient
42
+ *
43
+ * @param config - Endpoint configuration
44
+ * @param authProvider - Optional authentication provider (if not provided, uses config.auth)
45
+ */
46
+ constructor(config: EndpointConfig, authProvider?: AuthProvider);
47
+ /**
48
+ * Make HTTP request with error handling, retry logic, and auth support
49
+ *
50
+ * @param endpointKey - Key identifying the endpoint (for method/header lookup)
51
+ * @param endpointPath - The endpoint path template
52
+ * @param params - URL parameters to substitute
53
+ * @param options - Additional fetch options
54
+ * @param operation - Description of the operation (for error messages)
15
55
  */
16
56
  private request;
57
+ /**
58
+ * Update the auth provider
59
+ *
60
+ * Useful for updating auth after token refresh in parent application.
61
+ * Note: Per specification, this should rarely be needed as auth is typically
62
+ * set at mount time and requires remount to change.
63
+ *
64
+ * @param authProvider - New authentication provider
65
+ */
66
+ setAuthProvider(authProvider: AuthProvider): void;
67
+ /**
68
+ * Get current auth provider
69
+ *
70
+ * @returns The current AuthProvider instance
71
+ */
72
+ getAuthProvider(): AuthProvider;
73
+ /**
74
+ * Fetch all available node types
75
+ */
17
76
  getAvailableNodes(): Promise<NodeMetadata[]>;
77
+ /**
78
+ * Fetch nodes filtered by category
79
+ */
18
80
  getNodesByCategory(category: string): Promise<NodeMetadata[]>;
81
+ /**
82
+ * Fetch metadata for a specific node type
83
+ */
19
84
  getNodeMetadata(nodeId: string): Promise<NodeMetadata>;
85
+ /**
86
+ * Save a new workflow
87
+ */
20
88
  saveWorkflow(workflow: Workflow): Promise<Workflow>;
89
+ /**
90
+ * Update an existing workflow
91
+ */
21
92
  updateWorkflow(workflowId: string, workflow: Partial<Workflow>): Promise<Workflow>;
93
+ /**
94
+ * Load a workflow by ID
95
+ */
22
96
  loadWorkflow(workflowId: string): Promise<Workflow>;
97
+ /**
98
+ * List all workflows
99
+ */
23
100
  listWorkflows(): Promise<Workflow[]>;
101
+ /**
102
+ * Delete a workflow
103
+ */
24
104
  deleteWorkflow(workflowId: string): Promise<void>;
105
+ /**
106
+ * Validate a workflow
107
+ */
25
108
  validateWorkflow(workflow: Workflow): Promise<{
26
109
  valid: boolean;
27
110
  errors: string[];
28
111
  }>;
112
+ /**
113
+ * Export a workflow as JSON string
114
+ */
29
115
  exportWorkflow(workflowId: string): Promise<string>;
116
+ /**
117
+ * Import a workflow from JSON
118
+ */
30
119
  importWorkflow(workflowJson: string): Promise<Workflow>;
120
+ /**
121
+ * Execute a workflow
122
+ */
31
123
  executeWorkflow(workflowId: string, inputs?: Record<string, unknown>): Promise<ExecutionResult>;
124
+ /**
125
+ * Get execution status
126
+ */
32
127
  getExecutionStatus(executionId: string): Promise<ExecutionResult>;
128
+ /**
129
+ * Cancel a running execution
130
+ */
33
131
  cancelExecution(executionId: string): Promise<void>;
132
+ /**
133
+ * Get execution logs
134
+ */
34
135
  getExecutionLogs(executionId: string): Promise<string[]>;
136
+ /**
137
+ * List available templates
138
+ */
35
139
  listTemplates(): Promise<Workflow[]>;
140
+ /**
141
+ * Get a template by ID
142
+ */
36
143
  getTemplate(templateId: string): Promise<Workflow>;
144
+ /**
145
+ * Get system health status
146
+ */
37
147
  getSystemHealth(): Promise<{
38
148
  status: string;
39
149
  timestamp: number;
40
150
  }>;
151
+ /**
152
+ * Get system configuration
153
+ */
41
154
  getSystemConfig(): Promise<Record<string, unknown>>;
155
+ /**
156
+ * Get system version information
157
+ */
42
158
  getSystemVersion(): Promise<{
43
159
  version: string;
44
160
  build: string;