@d34dman/flowdrop 0.0.1 → 0.0.3

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.
Files changed (120) hide show
  1. package/README.md +307 -215
  2. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  3. package/dist/adapters/WorkflowAdapter.js +30 -30
  4. package/dist/api/client.d.ts +24 -1
  5. package/dist/api/client.js +55 -38
  6. package/dist/api/enhanced-client.d.ts +46 -0
  7. package/dist/api/enhanced-client.js +211 -0
  8. package/dist/clients/ApiClient.d.ts +19 -23
  9. package/dist/clients/ApiClient.js +36 -34
  10. package/dist/components/App.svelte +1299 -230
  11. package/dist/components/App.svelte.d.ts +21 -1
  12. package/dist/components/CanvasBanner.svelte +50 -44
  13. package/dist/components/CanvasBanner.svelte.d.ts +5 -19
  14. package/dist/components/ConfigForm.svelte +555 -0
  15. package/dist/components/ConfigForm.svelte.d.ts +32 -0
  16. package/dist/components/ConfigModal.svelte +261 -0
  17. package/dist/components/ConfigModal.svelte.d.ts +31 -0
  18. package/dist/components/ConfigSidebar.svelte +934 -0
  19. package/dist/components/ConfigSidebar.svelte.d.ts +51 -0
  20. package/dist/components/ConnectionLine.svelte +32 -0
  21. package/dist/components/ConnectionLine.svelte.d.ts +3 -0
  22. package/dist/components/GatewayNode.svelte +471 -0
  23. package/dist/components/GatewayNode.svelte.d.ts +15 -0
  24. package/dist/components/LoadingSpinner.svelte +23 -23
  25. package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
  26. package/dist/components/Logo.svelte +82 -0
  27. package/dist/components/Logo.svelte.d.ts +26 -0
  28. package/dist/components/LogsSidebar.svelte +565 -0
  29. package/dist/components/LogsSidebar.svelte.d.ts +34 -0
  30. package/dist/components/MarkdownDisplay.svelte +28 -0
  31. package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
  32. package/dist/components/Navbar.svelte +663 -0
  33. package/dist/components/Navbar.svelte.d.ts +21 -0
  34. package/dist/components/NodeSidebar.svelte +629 -488
  35. package/dist/components/NodeSidebar.svelte.d.ts +1 -2
  36. package/dist/components/NodeStatusOverlay.svelte +327 -0
  37. package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
  38. package/dist/components/NotesNode.svelte +566 -0
  39. package/dist/components/NotesNode.svelte.d.ts +43 -0
  40. package/dist/components/PipelineStatus.svelte +331 -0
  41. package/dist/components/PipelineStatus.svelte.d.ts +18 -0
  42. package/dist/components/SimpleNode.svelte +447 -0
  43. package/dist/components/SimpleNode.svelte.d.ts +24 -0
  44. package/dist/components/SquareNode.svelte +346 -0
  45. package/dist/components/SquareNode.svelte.d.ts +24 -0
  46. package/dist/components/StatusIcon.svelte +112 -0
  47. package/dist/components/StatusIcon.svelte.d.ts +10 -0
  48. package/dist/components/StatusLabel.svelte +33 -0
  49. package/dist/components/StatusLabel.svelte.d.ts +7 -0
  50. package/dist/components/ToolNode.svelte +385 -0
  51. package/dist/components/ToolNode.svelte.d.ts +36 -0
  52. package/dist/components/UniversalNode.svelte +126 -0
  53. package/dist/components/UniversalNode.svelte.d.ts +15 -0
  54. package/dist/components/WorkflowEditor.svelte +871 -528
  55. package/dist/components/WorkflowEditor.svelte.d.ts +15 -5
  56. package/dist/components/WorkflowNode.svelte +428 -542
  57. package/dist/components/WorkflowNode.svelte.d.ts +7 -3
  58. package/dist/config/apiConfig.d.ts +33 -0
  59. package/dist/config/apiConfig.js +39 -0
  60. package/dist/config/defaultPortConfig.d.ts +6 -0
  61. package/dist/config/defaultPortConfig.js +192 -0
  62. package/dist/config/demo.d.ts +58 -0
  63. package/dist/config/demo.js +142 -0
  64. package/dist/config/endpoints.d.ts +106 -0
  65. package/dist/config/endpoints.js +128 -0
  66. package/dist/data/samples.d.ts +38 -4
  67. package/dist/data/samples.js +2789 -737
  68. package/dist/examples/adapter-usage.d.ts +4 -4
  69. package/dist/examples/adapter-usage.js +21 -26
  70. package/dist/examples/api-client-usage.d.ts +6 -6
  71. package/dist/examples/api-client-usage.js +55 -54
  72. package/dist/index.d.ts +23 -15
  73. package/dist/index.js +23 -15
  74. package/dist/mocks/app-environment.d.ts +8 -0
  75. package/dist/mocks/app-environment.js +16 -0
  76. package/dist/mocks/app-forms.d.ts +2 -0
  77. package/dist/mocks/app-forms.js +21 -0
  78. package/dist/mocks/app-navigation.d.ts +5 -0
  79. package/dist/mocks/app-navigation.js +34 -0
  80. package/dist/mocks/app-stores.d.ts +14 -0
  81. package/dist/mocks/app-stores.js +26 -0
  82. package/dist/services/api.d.ts +13 -3
  83. package/dist/services/api.js +91 -36
  84. package/dist/services/globalSave.d.ts +20 -0
  85. package/dist/services/globalSave.js +165 -0
  86. package/dist/services/nodeExecutionService.d.ts +63 -0
  87. package/dist/services/nodeExecutionService.js +261 -0
  88. package/dist/services/portConfigApi.d.ts +14 -0
  89. package/dist/services/portConfigApi.js +69 -0
  90. package/dist/services/toastService.d.ts +147 -0
  91. package/dist/services/toastService.js +235 -0
  92. package/dist/services/workflowStorage.d.ts +2 -2
  93. package/dist/services/workflowStorage.js +10 -10
  94. package/dist/stores/workflowStore.d.ts +53 -0
  95. package/dist/stores/workflowStore.js +264 -0
  96. package/dist/styles/base.css +896 -363
  97. package/dist/svelte-app.d.ts +52 -5
  98. package/dist/svelte-app.js +128 -6
  99. package/dist/types/config.d.ts +291 -0
  100. package/dist/types/config.js +4 -0
  101. package/dist/types/index.d.ts +231 -19
  102. package/dist/types/index.js +1 -1
  103. package/dist/utils/colors.d.ts +67 -33
  104. package/dist/utils/colors.js +183 -118
  105. package/dist/utils/config.d.ts +41 -0
  106. package/dist/utils/config.js +248 -0
  107. package/dist/utils/connections.d.ts +40 -3
  108. package/dist/utils/connections.js +115 -44
  109. package/dist/utils/icons.d.ts +1 -1
  110. package/dist/utils/icons.js +71 -70
  111. package/dist/utils/nodeStatus.d.ts +53 -0
  112. package/dist/utils/nodeStatus.js +183 -0
  113. package/dist/utils/nodeTypes.d.ts +57 -0
  114. package/dist/utils/nodeTypes.js +109 -0
  115. package/dist/utils/nodeWrapper.d.ts +39 -0
  116. package/dist/utils/nodeWrapper.js +62 -0
  117. package/package.json +132 -97
  118. package/dist/app.css +0 -0
  119. package/dist/components/Node.svelte +0 -38
  120. package/dist/components/Node.svelte.d.ts +0 -4
@@ -0,0 +1,128 @@
1
+ /**
2
+ * FlowDrop Endpoint Configuration
3
+ * Provides configurable endpoints for all API actions
4
+ */
5
+ /**
6
+ * Default endpoint configuration
7
+ */
8
+ export const defaultEndpointConfig = {
9
+ baseUrl: '/api/flowdrop',
10
+ endpoints: {
11
+ nodes: {
12
+ list: '/nodes',
13
+ get: '/nodes/{id}',
14
+ byCategory: '/nodes?category={category}',
15
+ metadata: '/nodes/{id}/metadata'
16
+ },
17
+ portConfig: '/port-config',
18
+ workflows: {
19
+ list: '/workflows',
20
+ get: '/workflows/{id}',
21
+ create: '/workflows',
22
+ update: '/workflows/{id}',
23
+ delete: '/workflows/{id}',
24
+ validate: '/workflows/validate',
25
+ export: '/workflows/{id}/export',
26
+ import: '/workflows/import'
27
+ },
28
+ executions: {
29
+ execute: '/workflows/{id}/execute',
30
+ status: '/executions/{id}',
31
+ cancel: '/executions/{id}/cancel',
32
+ logs: '/executions/{id}/logs',
33
+ history: '/executions'
34
+ },
35
+ pipelines: {
36
+ list: '/workflow/{workflow_id}/pipelines',
37
+ get: '/pipeline/{id}',
38
+ create: '/pipeline',
39
+ update: '/pipeline/{id}',
40
+ delete: '/pipeline/{id}',
41
+ status: '/pipeline/{id}/status',
42
+ logs: '/pipeline/{id}/logs',
43
+ execute: '/pipeline/{id}/execute',
44
+ stop: '/pipeline/{id}/stop'
45
+ },
46
+ templates: {
47
+ list: '/templates',
48
+ get: '/templates/{id}',
49
+ create: '/templates',
50
+ update: '/templates/{id}',
51
+ delete: '/templates/{id}'
52
+ },
53
+ users: {
54
+ profile: '/users/profile',
55
+ preferences: '/users/preferences'
56
+ },
57
+ system: {
58
+ health: '/system/health',
59
+ config: '/system/config',
60
+ version: '/system/version'
61
+ }
62
+ },
63
+ timeout: 30000,
64
+ retry: {
65
+ enabled: true,
66
+ maxAttempts: 3,
67
+ delay: 1000,
68
+ backoff: 'exponential'
69
+ }
70
+ };
71
+ /**
72
+ * Create endpoint configuration with custom base URL
73
+ */
74
+ export function createEndpointConfig(baseUrl, overrides) {
75
+ const config = {
76
+ ...defaultEndpointConfig,
77
+ baseUrl: baseUrl.replace(/\/$/, ''),
78
+ ...overrides
79
+ };
80
+ return config;
81
+ }
82
+ /**
83
+ * Build full URL for an endpoint
84
+ */
85
+ export function buildEndpointUrl(config, endpointPath, params) {
86
+ let url = endpointPath;
87
+ // Replace path parameters
88
+ if (params) {
89
+ Object.entries(params).forEach(([key, value]) => {
90
+ url = url.replace(`{${key}}`, encodeURIComponent(value));
91
+ });
92
+ }
93
+ // Ensure URL starts with base URL
94
+ if (!url.startsWith('http') && !url.startsWith('//')) {
95
+ url = `${config.baseUrl}${url.startsWith('/') ? url : `/${url}`}`;
96
+ }
97
+ return url;
98
+ }
99
+ /**
100
+ * Get HTTP method for an endpoint
101
+ */
102
+ export function getEndpointMethod(config, endpointKey) {
103
+ return config.methods?.[endpointKey] || 'GET';
104
+ }
105
+ /**
106
+ * Get custom headers for an endpoint
107
+ */
108
+ export function getEndpointHeaders(config, endpointKey) {
109
+ const baseHeaders = {
110
+ 'Content-Type': 'application/json'
111
+ };
112
+ // Add authentication headers
113
+ if (config.auth?.type === 'bearer' && config.auth.token) {
114
+ baseHeaders['Authorization'] = `Bearer ${config.auth.token}`;
115
+ }
116
+ else if (config.auth?.type === 'api_key' && config.auth.apiKey) {
117
+ baseHeaders['X-API-Key'] = config.auth.apiKey;
118
+ }
119
+ else if (config.auth?.type === 'custom' && config.auth.headers) {
120
+ Object.assign(baseHeaders, config.auth.headers);
121
+ }
122
+ // Add endpoint-specific headers
123
+ const endpointHeaders = config.headers?.[endpointKey];
124
+ if (endpointHeaders) {
125
+ Object.assign(baseHeaders, endpointHeaders);
126
+ }
127
+ return baseHeaders;
128
+ }
@@ -2,14 +2,48 @@
2
2
  * Sample data for FlowDrop development and testing
3
3
  * Full set matching Langflow's default categories and node types
4
4
  */
5
- import type { NodeMetadata, Workflow } from "../types/index.js";
6
- import { CATEGORY_ICONS } from "../utils/icons.js";
5
+ import type { NodeMetadata, Workflow } from '../types/index.js';
6
+ import { CATEGORY_ICONS } from '../utils/icons.js';
7
7
  /**
8
- * Sample node definitions for development
9
- * Full set matching Langflow's default categories
8
+ * Sample node data for development and testing
9
+ * These represent the available node types in the workflow editor
10
10
  */
11
11
  export declare const sampleNodes: NodeMetadata[];
12
12
  export { CATEGORY_ICONS as categoryIcons };
13
+ /**
14
+ * Demo mode configuration
15
+ */
16
+ export interface DemoConfig {
17
+ enabled: boolean;
18
+ mode: 'content-management' | 'all';
19
+ }
20
+ /**
21
+ * Filter nodes based on demo configuration
22
+ * @param nodes - All available nodes
23
+ * @param config - Demo configuration
24
+ * @returns Filtered array of nodes
25
+ */
26
+ export declare function filterNodesForDemo(nodes: NodeMetadata[], config: DemoConfig): NodeMetadata[];
27
+ /**
28
+ * Get the list of allowed demo node IDs
29
+ */
30
+ export declare function getDemoAllowedNodeIds(): string[];
31
+ /**
32
+ * Check if a node is allowed in demo mode
33
+ */
34
+ export declare function isNodeAllowedInDemo(nodeId: string): boolean;
35
+ /**
36
+ * Get demo-specific nodes only
37
+ */
38
+ export declare function getDemoNodes(): NodeMetadata[];
39
+ /**
40
+ * Get nodes by category with demo filtering
41
+ */
42
+ export declare function getNodesByCategory(category: string, demoConfig?: DemoConfig): NodeMetadata[];
43
+ /**
44
+ * Search nodes with demo filtering
45
+ */
46
+ export declare function searchNodes(query: string, demoConfig?: DemoConfig): NodeMetadata[];
13
47
  /**
14
48
  * Sample workflow for development
15
49
  * Updated to use the new node types