@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.
- 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 +132 -97
- package/dist/app.css +0 -0
- package/dist/components/Node.svelte +0 -38
- package/dist/components/Node.svelte.d.ts +0 -4
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Execution Service
|
|
3
|
+
* Handles fetching and managing node execution information from the backend
|
|
4
|
+
*/
|
|
5
|
+
import { getEndpointConfig } from './api.js';
|
|
6
|
+
import { buildEndpointUrl } from '../config/endpoints.js';
|
|
7
|
+
/**
|
|
8
|
+
* Service for managing node execution information
|
|
9
|
+
*/
|
|
10
|
+
export class NodeExecutionService {
|
|
11
|
+
static instance;
|
|
12
|
+
cache = new Map();
|
|
13
|
+
cacheTimeout = 30000; // 30 seconds
|
|
14
|
+
lastFetch = 0;
|
|
15
|
+
apiUnavailable = false;
|
|
16
|
+
apiUnavailableUntil = 0;
|
|
17
|
+
constructor() { }
|
|
18
|
+
static getInstance() {
|
|
19
|
+
if (!NodeExecutionService.instance) {
|
|
20
|
+
NodeExecutionService.instance = new NodeExecutionService();
|
|
21
|
+
}
|
|
22
|
+
return NodeExecutionService.instance;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get execution information for a specific node from pipeline data
|
|
26
|
+
*/
|
|
27
|
+
async getNodeExecutionInfo(nodeId, pipelineId) {
|
|
28
|
+
if (!pipelineId) {
|
|
29
|
+
console.warn('Pipeline ID is required to fetch node execution info');
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const endpointConfig = getEndpointConfig();
|
|
34
|
+
const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.pipelines.get, {
|
|
35
|
+
id: pipelineId
|
|
36
|
+
});
|
|
37
|
+
const response = await fetch(url);
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
40
|
+
}
|
|
41
|
+
const pipelineData = await response.json();
|
|
42
|
+
const jobs = pipelineData.jobs || [];
|
|
43
|
+
const nodeStatuses = pipelineData.node_statuses || {};
|
|
44
|
+
// Find the job for this node
|
|
45
|
+
const nodeJob = jobs.find((job) => job.node_id === nodeId);
|
|
46
|
+
const nodeStatus = nodeStatuses[nodeId];
|
|
47
|
+
if (!nodeJob && !nodeStatus) {
|
|
48
|
+
return {
|
|
49
|
+
status: 'idle',
|
|
50
|
+
executionCount: 0,
|
|
51
|
+
isExecuting: false
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const executionInfo = {
|
|
55
|
+
status: this.mapJobStatusToExecutionStatus(nodeStatus?.status || nodeJob?.status || 'idle'),
|
|
56
|
+
executionCount: nodeJob?.execution_count || 0,
|
|
57
|
+
isExecuting: nodeStatus?.status === 'running' || nodeJob?.status === 'running',
|
|
58
|
+
lastExecuted: nodeJob?.last_executed || nodeStatus?.last_executed,
|
|
59
|
+
lastExecutionDuration: nodeJob?.execution_time || nodeStatus?.execution_time,
|
|
60
|
+
lastError: nodeJob?.error || nodeStatus?.error
|
|
61
|
+
};
|
|
62
|
+
this.cache.set(nodeId, executionInfo);
|
|
63
|
+
return executionInfo;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.error('Failed to fetch node execution info:', error);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get execution information for multiple nodes from pipeline data
|
|
72
|
+
*/
|
|
73
|
+
async getMultipleNodeExecutionInfo(nodeIds, pipelineId) {
|
|
74
|
+
if (!pipelineId) {
|
|
75
|
+
console.warn('Pipeline ID is required to fetch node execution info');
|
|
76
|
+
return {};
|
|
77
|
+
}
|
|
78
|
+
// Check if API is temporarily unavailable
|
|
79
|
+
if (this.apiUnavailable && Date.now() < this.apiUnavailableUntil) {
|
|
80
|
+
console.log('API temporarily unavailable, returning cached/default values');
|
|
81
|
+
const defaultExecutionInfo = {};
|
|
82
|
+
nodeIds.forEach((nodeId) => {
|
|
83
|
+
defaultExecutionInfo[nodeId] = {
|
|
84
|
+
status: 'idle',
|
|
85
|
+
executionCount: 0,
|
|
86
|
+
isExecuting: false
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
return defaultExecutionInfo;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const endpointConfig = getEndpointConfig();
|
|
93
|
+
const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.pipelines.get, {
|
|
94
|
+
id: pipelineId
|
|
95
|
+
});
|
|
96
|
+
const response = await fetch(url);
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
// If the endpoint returns 404, it means the pipeline API is not available
|
|
99
|
+
// Mark API as unavailable for 5 minutes to prevent repeated calls
|
|
100
|
+
if (response.status === 404) {
|
|
101
|
+
console.warn(`Pipeline API endpoint not available for pipeline ${pipelineId}`);
|
|
102
|
+
this.apiUnavailable = true;
|
|
103
|
+
this.apiUnavailableUntil = Date.now() + 5 * 60 * 1000; // 5 minutes
|
|
104
|
+
const defaultExecutionInfo = {};
|
|
105
|
+
nodeIds.forEach((nodeId) => {
|
|
106
|
+
defaultExecutionInfo[nodeId] = {
|
|
107
|
+
status: 'idle',
|
|
108
|
+
executionCount: 0,
|
|
109
|
+
isExecuting: false
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
return defaultExecutionInfo;
|
|
113
|
+
}
|
|
114
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
115
|
+
}
|
|
116
|
+
const result = await response.json();
|
|
117
|
+
const jobs = result.jobs || [];
|
|
118
|
+
const executionInfoMap = {};
|
|
119
|
+
// Initialize all nodes with default values
|
|
120
|
+
nodeIds.forEach((nodeId) => {
|
|
121
|
+
executionInfoMap[nodeId] = {
|
|
122
|
+
status: 'idle',
|
|
123
|
+
executionCount: 0,
|
|
124
|
+
isExecuting: false
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
// Update with actual job data
|
|
128
|
+
jobs.forEach((job) => {
|
|
129
|
+
const nodeId = job.node_id;
|
|
130
|
+
if (nodeIds.includes(nodeId)) {
|
|
131
|
+
executionInfoMap[nodeId] = {
|
|
132
|
+
status: this.mapJobStatusToExecutionStatus(job.status),
|
|
133
|
+
executionCount: job.execution_count || 0,
|
|
134
|
+
isExecuting: job.status === 'running',
|
|
135
|
+
lastExecuted: job.completed || job.started,
|
|
136
|
+
lastExecutionDuration: job.execution_time,
|
|
137
|
+
lastError: job.error_message
|
|
138
|
+
};
|
|
139
|
+
// Update cache
|
|
140
|
+
this.cache.set(nodeId, executionInfoMap[nodeId]);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return executionInfoMap;
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
console.error('Failed to fetch multiple node execution info:', error);
|
|
147
|
+
// Return default values instead of empty object to prevent repeated calls
|
|
148
|
+
const defaultExecutionInfo = {};
|
|
149
|
+
nodeIds.forEach((nodeId) => {
|
|
150
|
+
defaultExecutionInfo[nodeId] = {
|
|
151
|
+
status: 'idle',
|
|
152
|
+
executionCount: 0,
|
|
153
|
+
isExecuting: false
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
return defaultExecutionInfo;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get all node execution counts
|
|
161
|
+
*/
|
|
162
|
+
async getAllNodeExecutionCounts() {
|
|
163
|
+
try {
|
|
164
|
+
const endpointConfig = getEndpointConfig();
|
|
165
|
+
const url = buildEndpointUrl(endpointConfig, '/node-execution-counts');
|
|
166
|
+
const response = await fetch(url);
|
|
167
|
+
if (!response.ok) {
|
|
168
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
169
|
+
}
|
|
170
|
+
const result = await response.json();
|
|
171
|
+
if (result.success && result.data) {
|
|
172
|
+
return result.data;
|
|
173
|
+
}
|
|
174
|
+
return {};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.error('Failed to fetch all node execution counts:', error);
|
|
178
|
+
return {};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get cached execution info for a node
|
|
183
|
+
*/
|
|
184
|
+
getCachedNodeExecutionInfo(nodeId) {
|
|
185
|
+
return this.cache.get(nodeId) || null;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Clear cache for a specific node
|
|
189
|
+
*/
|
|
190
|
+
clearNodeCache(nodeId) {
|
|
191
|
+
this.cache.delete(nodeId);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Clear all cache
|
|
195
|
+
*/
|
|
196
|
+
clearAllCache() {
|
|
197
|
+
this.cache.clear();
|
|
198
|
+
this.lastFetch = 0;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Check if cache is stale
|
|
202
|
+
*/
|
|
203
|
+
isCacheStale() {
|
|
204
|
+
return Date.now() - this.lastFetch > this.cacheTimeout;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Update execution info for a node (for real-time updates)
|
|
208
|
+
*/
|
|
209
|
+
updateNodeExecutionInfo(nodeId, executionInfo) {
|
|
210
|
+
const existing = this.cache.get(nodeId);
|
|
211
|
+
if (existing) {
|
|
212
|
+
this.cache.set(nodeId, { ...existing, ...executionInfo });
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.cache.set(nodeId, {
|
|
216
|
+
status: 'idle',
|
|
217
|
+
executionCount: 0,
|
|
218
|
+
isExecuting: false,
|
|
219
|
+
...executionInfo
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Map job status to execution status
|
|
225
|
+
*/
|
|
226
|
+
mapJobStatusToExecutionStatus(jobStatus) {
|
|
227
|
+
switch (jobStatus) {
|
|
228
|
+
case 'pending':
|
|
229
|
+
return 'pending';
|
|
230
|
+
case 'running':
|
|
231
|
+
return 'running';
|
|
232
|
+
case 'completed':
|
|
233
|
+
return 'completed';
|
|
234
|
+
case 'failed':
|
|
235
|
+
return 'failed';
|
|
236
|
+
case 'cancelled':
|
|
237
|
+
return 'cancelled';
|
|
238
|
+
case 'skipped':
|
|
239
|
+
return 'skipped';
|
|
240
|
+
default:
|
|
241
|
+
return 'idle';
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Batch update execution info for multiple nodes
|
|
246
|
+
*/
|
|
247
|
+
updateMultipleNodeExecutionInfo(updates) {
|
|
248
|
+
Object.entries(updates).forEach(([nodeId, executionInfo]) => {
|
|
249
|
+
this.updateNodeExecutionInfo(nodeId, executionInfo);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Reset API availability status (useful for testing or when API becomes available)
|
|
254
|
+
*/
|
|
255
|
+
resetApiAvailability() {
|
|
256
|
+
this.apiUnavailable = false;
|
|
257
|
+
this.apiUnavailableUntil = 0;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// Export singleton instance
|
|
261
|
+
export const nodeExecutionService = NodeExecutionService.getInstance();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port Configuration API Service
|
|
3
|
+
* Handles fetching port configuration from the backend
|
|
4
|
+
*/
|
|
5
|
+
import type { PortConfig } from '../types/index.js';
|
|
6
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
7
|
+
/**
|
|
8
|
+
* Fetch port configuration from API
|
|
9
|
+
*/
|
|
10
|
+
export declare function fetchPortConfig(endpointConfig: EndpointConfig): Promise<PortConfig>;
|
|
11
|
+
/**
|
|
12
|
+
* Validate port configuration structure
|
|
13
|
+
*/
|
|
14
|
+
export declare function validatePortConfig(config: PortConfig): boolean;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port Configuration API Service
|
|
3
|
+
* Handles fetching port configuration from the backend
|
|
4
|
+
*/
|
|
5
|
+
import { buildEndpointUrl } from '../config/endpoints.js';
|
|
6
|
+
import { DEFAULT_PORT_CONFIG } from '../config/defaultPortConfig.js';
|
|
7
|
+
import { FlowDropApiClient } from '../api/client.js';
|
|
8
|
+
/**
|
|
9
|
+
* Fetch port configuration from API
|
|
10
|
+
*/
|
|
11
|
+
export async function fetchPortConfig(endpointConfig) {
|
|
12
|
+
try {
|
|
13
|
+
const url = buildEndpointUrl(endpointConfig, endpointConfig.endpoints.portConfig);
|
|
14
|
+
console.log('📡 Fetching port configuration from:', url);
|
|
15
|
+
// Create API client instance
|
|
16
|
+
const client = new FlowDropApiClient(endpointConfig.baseUrl);
|
|
17
|
+
// Use the client to fetch port configuration
|
|
18
|
+
const portConfig = await client.getPortConfig();
|
|
19
|
+
// Validate the configuration has required fields
|
|
20
|
+
if (!portConfig.dataTypes || !Array.isArray(portConfig.dataTypes)) {
|
|
21
|
+
console.warn('⚠️ Invalid port config received from API, using default');
|
|
22
|
+
return DEFAULT_PORT_CONFIG;
|
|
23
|
+
}
|
|
24
|
+
console.log('✅ Port configuration loaded successfully:', {
|
|
25
|
+
version: portConfig.version,
|
|
26
|
+
dataTypesCount: portConfig.dataTypes.length,
|
|
27
|
+
rulesCount: portConfig.compatibilityRules?.length || 0,
|
|
28
|
+
defaultType: portConfig.defaultDataType
|
|
29
|
+
});
|
|
30
|
+
return portConfig;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('❌ Error fetching port configuration:', error);
|
|
34
|
+
console.log('🔄 Falling back to default port configuration');
|
|
35
|
+
return DEFAULT_PORT_CONFIG;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Validate port configuration structure
|
|
40
|
+
*/
|
|
41
|
+
export function validatePortConfig(config) {
|
|
42
|
+
if (!config || typeof config !== 'object') {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
if (!config.dataTypes || !Array.isArray(config.dataTypes)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (!config.defaultDataType || typeof config.defaultDataType !== 'string') {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// Check that all data types have required fields
|
|
52
|
+
for (const dataType of config.dataTypes) {
|
|
53
|
+
if (!dataType.id || !dataType.name || !dataType.color) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Check that compatibility rules reference valid data types
|
|
58
|
+
if (config.compatibilityRules) {
|
|
59
|
+
// TODO: Fix type definition for PortCompatibilityRule - sourceType and targetType properties missing
|
|
60
|
+
// const dataTypeIds = new Set(config.dataTypes.map((dt) => dt.id));
|
|
61
|
+
// for (const rule of config.compatibilityRules) {
|
|
62
|
+
// if (!dataTypeIds.has(rule.sourceType) || !dataTypeIds.has(rule.targetType)) {
|
|
63
|
+
// console.warn("⚠️ Compatibility rule references unknown data type:", rule);
|
|
64
|
+
// return false;
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Service
|
|
3
|
+
* Centralized toast notification service using svelte-french-toast
|
|
4
|
+
* Provides consistent toast notifications across the FlowDrop application
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Toast notification types
|
|
8
|
+
*/
|
|
9
|
+
export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
10
|
+
/**
|
|
11
|
+
* Toast configuration options
|
|
12
|
+
*/
|
|
13
|
+
export interface ToastOptions {
|
|
14
|
+
duration?: number;
|
|
15
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Show a success toast notification
|
|
19
|
+
*/
|
|
20
|
+
export declare function showSuccess(message: string, options?: ToastOptions): string;
|
|
21
|
+
/**
|
|
22
|
+
* Show an error toast notification
|
|
23
|
+
*/
|
|
24
|
+
export declare function showError(message: string, options?: ToastOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Show a warning toast notification
|
|
27
|
+
*/
|
|
28
|
+
export declare function showWarning(message: string, options?: ToastOptions): string;
|
|
29
|
+
/**
|
|
30
|
+
* Show an info toast notification
|
|
31
|
+
*/
|
|
32
|
+
export declare function showInfo(message: string, options?: ToastOptions): string;
|
|
33
|
+
/**
|
|
34
|
+
* Show a loading toast notification
|
|
35
|
+
*/
|
|
36
|
+
export declare function showLoading(message: string, options?: ToastOptions): string;
|
|
37
|
+
/**
|
|
38
|
+
* Dismiss a specific toast by ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function dismissToast(toastId: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Dismiss all toasts
|
|
43
|
+
*/
|
|
44
|
+
export declare function dismissAllToasts(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Show a promise-based toast (loading -> success/error)
|
|
47
|
+
*/
|
|
48
|
+
export declare function showPromise<T>(promise: Promise<T>, { loading, success, error, options }: {
|
|
49
|
+
loading: string;
|
|
50
|
+
success: string | ((data: T) => string);
|
|
51
|
+
error: string | ((error: any) => string);
|
|
52
|
+
options?: ToastOptions;
|
|
53
|
+
}): Promise<T>;
|
|
54
|
+
/**
|
|
55
|
+
* Show a confirmation toast (simplified version without action buttons)
|
|
56
|
+
*/
|
|
57
|
+
export declare function showConfirmation(message: string, options?: ToastOptions): string;
|
|
58
|
+
/**
|
|
59
|
+
* API-specific toast helpers
|
|
60
|
+
*/
|
|
61
|
+
export declare const apiToasts: {
|
|
62
|
+
/**
|
|
63
|
+
* Show API success message
|
|
64
|
+
*/
|
|
65
|
+
success: (operation: string, details?: string) => string;
|
|
66
|
+
/**
|
|
67
|
+
* Show API error message
|
|
68
|
+
*/
|
|
69
|
+
error: (operation: string, error: string | Error) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Show API loading message
|
|
72
|
+
*/
|
|
73
|
+
loading: (operation: string) => string;
|
|
74
|
+
/**
|
|
75
|
+
* Show API promise with automatic success/error handling
|
|
76
|
+
*/
|
|
77
|
+
promise: <T>(promise: Promise<T>, operation: string, options?: {
|
|
78
|
+
successMessage?: string;
|
|
79
|
+
errorMessage?: string;
|
|
80
|
+
}) => Promise<T>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Workflow-specific toast helpers
|
|
84
|
+
*/
|
|
85
|
+
export declare const workflowToasts: {
|
|
86
|
+
/**
|
|
87
|
+
* Show workflow save success
|
|
88
|
+
*/
|
|
89
|
+
saved: (workflowName?: string) => string;
|
|
90
|
+
/**
|
|
91
|
+
* Show workflow save error
|
|
92
|
+
*/
|
|
93
|
+
saveError: (error: string | Error) => string;
|
|
94
|
+
/**
|
|
95
|
+
* Show workflow delete success
|
|
96
|
+
*/
|
|
97
|
+
deleted: (workflowName?: string) => string;
|
|
98
|
+
/**
|
|
99
|
+
* Show workflow delete error
|
|
100
|
+
*/
|
|
101
|
+
deleteError: (error: string | Error) => string;
|
|
102
|
+
/**
|
|
103
|
+
* Show workflow execution started
|
|
104
|
+
*/
|
|
105
|
+
executionStarted: (workflowName?: string) => string;
|
|
106
|
+
/**
|
|
107
|
+
* Show workflow execution completed
|
|
108
|
+
*/
|
|
109
|
+
executionCompleted: (workflowName?: string) => string;
|
|
110
|
+
/**
|
|
111
|
+
* Show workflow export success
|
|
112
|
+
*/
|
|
113
|
+
exported: (workflowName?: string) => string;
|
|
114
|
+
/**
|
|
115
|
+
* Show workflow execution error
|
|
116
|
+
*/
|
|
117
|
+
executionError: (error: string | Error) => string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Pipeline-specific toast helpers
|
|
121
|
+
*/
|
|
122
|
+
export declare const pipelineToasts: {
|
|
123
|
+
/**
|
|
124
|
+
* Show pipeline creation success
|
|
125
|
+
*/
|
|
126
|
+
created: (pipelineName?: string) => string;
|
|
127
|
+
/**
|
|
128
|
+
* Show pipeline creation error
|
|
129
|
+
*/
|
|
130
|
+
creationError: (error: string | Error) => string;
|
|
131
|
+
/**
|
|
132
|
+
* Show pipeline execution started
|
|
133
|
+
*/
|
|
134
|
+
executionStarted: (pipelineId: string) => string;
|
|
135
|
+
/**
|
|
136
|
+
* Show pipeline execution completed
|
|
137
|
+
*/
|
|
138
|
+
executionCompleted: (pipelineId: string) => string;
|
|
139
|
+
/**
|
|
140
|
+
* Show pipeline execution error
|
|
141
|
+
*/
|
|
142
|
+
executionError: (pipelineId: string, error: string | Error) => string;
|
|
143
|
+
/**
|
|
144
|
+
* Show pipeline status update
|
|
145
|
+
*/
|
|
146
|
+
statusUpdate: (pipelineId: string, status: string) => string;
|
|
147
|
+
};
|