@d34dman/flowdrop 0.0.1 → 0.0.2
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 +307 -215
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +30 -30
- package/dist/api/client.d.ts +24 -1
- package/dist/api/client.js +55 -38
- package/dist/api/enhanced-client.d.ts +46 -0
- package/dist/api/enhanced-client.js +211 -0
- package/dist/clients/ApiClient.d.ts +19 -23
- package/dist/clients/ApiClient.js +36 -34
- package/dist/components/App.svelte +1299 -230
- package/dist/components/App.svelte.d.ts +21 -1
- package/dist/components/CanvasBanner.svelte +50 -44
- package/dist/components/CanvasBanner.svelte.d.ts +5 -19
- package/dist/components/ConfigForm.svelte +555 -0
- package/dist/components/ConfigForm.svelte.d.ts +32 -0
- package/dist/components/ConfigModal.svelte +261 -0
- package/dist/components/ConfigModal.svelte.d.ts +31 -0
- package/dist/components/ConfigSidebar.svelte +934 -0
- package/dist/components/ConfigSidebar.svelte.d.ts +51 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/GatewayNode.svelte +471 -0
- package/dist/components/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/LoadingSpinner.svelte +23 -23
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +82 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +565 -0
- package/dist/components/LogsSidebar.svelte.d.ts +34 -0
- package/dist/components/MarkdownDisplay.svelte +28 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.svelte +663 -0
- package/dist/components/Navbar.svelte.d.ts +21 -0
- package/dist/components/NodeSidebar.svelte +629 -488
- package/dist/components/NodeSidebar.svelte.d.ts +1 -2
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/NotesNode.svelte +566 -0
- package/dist/components/NotesNode.svelte.d.ts +43 -0
- package/dist/components/PipelineStatus.svelte +331 -0
- package/dist/components/PipelineStatus.svelte.d.ts +18 -0
- package/dist/components/SimpleNode.svelte +447 -0
- package/dist/components/SimpleNode.svelte.d.ts +24 -0
- package/dist/components/SquareNode.svelte +346 -0
- package/dist/components/SquareNode.svelte.d.ts +24 -0
- package/dist/components/StatusIcon.svelte +112 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ToolNode.svelte +385 -0
- package/dist/components/ToolNode.svelte.d.ts +36 -0
- package/dist/components/UniversalNode.svelte +126 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +871 -528
- package/dist/components/WorkflowEditor.svelte.d.ts +15 -5
- package/dist/components/WorkflowNode.svelte +428 -542
- package/dist/components/WorkflowNode.svelte.d.ts +7 -3
- package/dist/config/apiConfig.d.ts +33 -0
- package/dist/config/apiConfig.js +39 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +192 -0
- package/dist/config/demo.d.ts +58 -0
- package/dist/config/demo.js +142 -0
- package/dist/config/endpoints.d.ts +106 -0
- package/dist/config/endpoints.js +128 -0
- package/dist/data/samples.d.ts +38 -4
- package/dist/data/samples.js +2789 -737
- package/dist/examples/adapter-usage.d.ts +4 -4
- package/dist/examples/adapter-usage.js +21 -26
- package/dist/examples/api-client-usage.d.ts +6 -6
- package/dist/examples/api-client-usage.js +55 -54
- package/dist/index.d.ts +23 -15
- package/dist/index.js +23 -15
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +21 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +34 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/services/api.d.ts +13 -3
- package/dist/services/api.js +91 -36
- package/dist/services/globalSave.d.ts +20 -0
- package/dist/services/globalSave.js +165 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +261 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +69 -0
- package/dist/services/toastService.d.ts +147 -0
- package/dist/services/toastService.js +235 -0
- package/dist/services/workflowStorage.d.ts +2 -2
- package/dist/services/workflowStorage.js +10 -10
- package/dist/stores/workflowStore.d.ts +53 -0
- package/dist/stores/workflowStore.js +264 -0
- package/dist/styles/base.css +896 -363
- package/dist/svelte-app.d.ts +52 -5
- package/dist/svelte-app.js +128 -6
- package/dist/types/config.d.ts +291 -0
- package/dist/types/config.js +4 -0
- package/dist/types/index.d.ts +231 -19
- package/dist/types/index.js +1 -1
- package/dist/utils/colors.d.ts +67 -33
- package/dist/utils/colors.js +183 -118
- package/dist/utils/config.d.ts +41 -0
- package/dist/utils/config.js +248 -0
- package/dist/utils/connections.d.ts +40 -3
- package/dist/utils/connections.js +115 -44
- package/dist/utils/icons.d.ts +1 -1
- package/dist/utils/icons.js +71 -70
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +57 -0
- package/dist/utils/nodeTypes.js +109 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/package.json +129 -97
- package/dist/components/Node.svelte +0 -38
- 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
|
+
}
|
package/dist/data/samples.d.ts
CHANGED
|
@@ -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
|
|
6
|
-
import { CATEGORY_ICONS } from
|
|
5
|
+
import type { NodeMetadata, Workflow } from '../types/index.js';
|
|
6
|
+
import { CATEGORY_ICONS } from '../utils/icons.js';
|
|
7
7
|
/**
|
|
8
|
-
* Sample node
|
|
9
|
-
*
|
|
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
|