@flowdrop/flowdrop 1.0.0
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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/adapters/WorkflowAdapter.d.ts +167 -0
- package/dist/adapters/WorkflowAdapter.js +368 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +626 -0
- package/dist/adapters/agentspec/agentAdapter.d.ts +59 -0
- package/dist/adapters/agentspec/agentAdapter.js +91 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +34 -0
- package/dist/adapters/agentspec/autoLayout.js +127 -0
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
- package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +53 -0
- package/dist/adapters/agentspec/defaultNodeTypes.js +561 -0
- package/dist/adapters/agentspec/index.d.ts +37 -0
- package/dist/adapters/agentspec/index.js +39 -0
- package/dist/adapters/agentspec/validator.d.ts +34 -0
- package/dist/adapters/agentspec/validator.js +169 -0
- package/dist/api/enhanced-client.d.ts +183 -0
- package/dist/api/enhanced-client.js +430 -0
- package/dist/components/App.svelte +981 -0
- package/dist/components/App.svelte.d.ts +54 -0
- package/dist/components/CanvasBanner.stories.svelte +29 -0
- package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
- package/dist/components/CanvasBanner.svelte +57 -0
- package/dist/components/CanvasBanner.svelte.d.ts +8 -0
- package/dist/components/ConfigForm.svelte +1138 -0
- package/dist/components/ConfigForm.svelte.d.ts +44 -0
- package/dist/components/ConfigModal.svelte +188 -0
- package/dist/components/ConfigModal.svelte.d.ts +13 -0
- package/dist/components/ConfigPanel.stories.svelte +47 -0
- package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
- package/dist/components/ConfigPanel.svelte +182 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/EdgeRefresher.svelte +41 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/FlowDropZone.svelte +83 -0
- package/dist/components/FlowDropZone.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.stories.svelte +30 -0
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
- package/dist/components/LoadingSpinner.svelte +36 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +8 -0
- package/dist/components/Logo.stories.svelte +22 -0
- package/dist/components/Logo.stories.svelte.d.ts +27 -0
- package/dist/components/Logo.svelte +102 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +563 -0
- package/dist/components/LogsSidebar.svelte.d.ts +17 -0
- package/dist/components/MarkdownDisplay.stories.svelte +36 -0
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
- package/dist/components/MarkdownDisplay.svelte +29 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.stories.svelte +53 -0
- package/dist/components/Navbar.stories.svelte.d.ts +27 -0
- package/dist/components/Navbar.svelte +726 -0
- package/dist/components/Navbar.svelte.d.ts +29 -0
- package/dist/components/NodeSidebar.svelte +762 -0
- package/dist/components/NodeSidebar.svelte.d.ts +9 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +85 -0
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/PipelineStatus.svelte +314 -0
- package/dist/components/PipelineStatus.svelte.d.ts +20 -0
- package/dist/components/PortCoordinateTracker.svelte +58 -0
- package/dist/components/PortCoordinateTracker.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +170 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/SchemaForm.stories.svelte +116 -0
- package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
- package/dist/components/SchemaForm.svelte +536 -0
- package/dist/components/SchemaForm.svelte.d.ts +83 -0
- package/dist/components/SettingsModal.svelte +279 -0
- package/dist/components/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/SettingsPanel.svelte +638 -0
- package/dist/components/SettingsPanel.svelte.d.ts +21 -0
- package/dist/components/StatusIcon.stories.svelte +60 -0
- package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
- package/dist/components/StatusIcon.svelte +119 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.stories.svelte +17 -0
- package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.stories.svelte +25 -0
- package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
- package/dist/components/ThemeToggle.svelte +185 -0
- package/dist/components/ThemeToggle.svelte.d.ts +14 -0
- package/dist/components/UniversalNode.svelte +155 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +1035 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +23 -0
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormAutocomplete.svelte +1009 -0
- package/dist/components/form/FormAutocomplete.svelte.d.ts +25 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormCheckboxGroup.svelte +155 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +17 -0
- package/dist/components/form/FormCodeEditor.svelte +458 -0
- package/dist/components/form/FormCodeEditor.svelte.d.ts +25 -0
- package/dist/components/form/FormField.svelte +417 -0
- package/dist/components/form/FormField.svelte.d.ts +29 -0
- package/dist/components/form/FormFieldLight.svelte +425 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte +53 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormFieldWrapper.svelte +125 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +752 -0
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +33 -0
- package/dist/components/form/FormNumberField.stories.svelte +36 -0
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormNumberField.svelte +112 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +25 -0
- package/dist/components/form/FormRangeField.stories.svelte +31 -0
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormRangeField.svelte +246 -0
- package/dist/components/form/FormRangeField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.stories.svelte +50 -0
- package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormSelect.svelte +129 -0
- package/dist/components/form/FormSelect.svelte.d.ts +20 -0
- package/dist/components/form/FormTemplateEditor.svelte +825 -0
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +41 -0
- package/dist/components/form/FormTextField.stories.svelte +30 -0
- package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextField.svelte +91 -0
- package/dist/components/form/FormTextField.svelte.d.ts +19 -0
- package/dist/components/form/FormTextarea.stories.svelte +34 -0
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextarea.svelte +97 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +21 -0
- package/dist/components/form/FormToggle.stories.svelte +30 -0
- package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormToggle.svelte +126 -0
- package/dist/components/form/FormToggle.svelte.d.ts +19 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +136 -0
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +32 -0
- package/dist/components/form/index.d.ts +50 -0
- package/dist/components/form/index.js +54 -0
- package/dist/components/form/templateAutocomplete.d.ts +29 -0
- package/dist/components/form/templateAutocomplete.js +254 -0
- package/dist/components/form/types.d.ts +485 -0
- package/dist/components/form/types.js +73 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +52 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +401 -0
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +71 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +292 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +25 -0
- package/dist/components/interrupt/FormPrompt.svelte +236 -0
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/InterruptBubble.svelte +601 -0
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +16 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +67 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -0
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +47 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +346 -0
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/index.d.ts +13 -0
- package/dist/components/interrupt/index.js +15 -0
- package/dist/components/layouts/MainLayout.svelte +718 -0
- package/dist/components/layouts/MainLayout.svelte.d.ts +62 -0
- package/dist/components/nodes/GatewayNode.stories.svelte +108 -0
- package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +591 -0
- package/dist/components/nodes/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/nodes/IdeaNode.stories.svelte +52 -0
- package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/IdeaNode.svelte +455 -0
- package/dist/components/nodes/IdeaNode.svelte.d.ts +24 -0
- package/dist/components/nodes/NotesNode.stories.svelte +76 -0
- package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/NotesNode.svelte +378 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +24 -0
- package/dist/components/nodes/SimpleNode.stories.svelte +159 -0
- package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SimpleNode.svelte +451 -0
- package/dist/components/nodes/SimpleNode.svelte.d.ts +25 -0
- package/dist/components/nodes/SquareNode.stories.svelte +82 -0
- package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SquareNode.svelte +407 -0
- package/dist/components/nodes/SquareNode.svelte.d.ts +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/TerminalNode.svelte +690 -0
- package/dist/components/nodes/TerminalNode.svelte.d.ts +25 -0
- package/dist/components/nodes/ToolNode.stories.svelte +189 -0
- package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/ToolNode.svelte +471 -0
- package/dist/components/nodes/ToolNode.svelte.d.ts +36 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte +55 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/WorkflowNode.svelte +571 -0
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +15 -0
- package/dist/components/playground/ChatPanel.svelte +905 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +46 -0
- package/dist/components/playground/ExecutionLogs.svelte +488 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.stories.svelte +62 -0
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
- package/dist/components/playground/MessageBubble.svelte +633 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +24 -0
- package/dist/components/playground/Playground.svelte +1075 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/PlaygroundModal.svelte +220 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +538 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +31 -0
- package/dist/config/defaultCategories.d.ts +7 -0
- package/dist/config/defaultCategories.js +126 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +201 -0
- package/dist/config/endpoints.d.ts +160 -0
- package/dist/config/endpoints.js +146 -0
- package/dist/config/runtimeConfig.d.ts +47 -0
- package/dist/config/runtimeConfig.js +80 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.js +92 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +95 -0
- package/dist/editor/index.js +138 -0
- package/dist/form/code.d.ts +101 -0
- package/dist/form/code.js +168 -0
- package/dist/form/fieldRegistry.d.ts +169 -0
- package/dist/form/fieldRegistry.js +152 -0
- package/dist/form/full.d.ts +56 -0
- package/dist/form/full.js +80 -0
- package/dist/form/index.d.ts +77 -0
- package/dist/form/index.js +91 -0
- package/dist/form/markdown.d.ts +69 -0
- package/dist/form/markdown.js +103 -0
- package/dist/helpers/nodeLayoutHelper.d.ts +14 -0
- package/dist/helpers/nodeLayoutHelper.js +19 -0
- package/dist/helpers/proximityConnect.d.ts +94 -0
- package/dist/helpers/proximityConnect.js +314 -0
- package/dist/helpers/workflowEditorHelper.d.ts +183 -0
- package/dist/helpers/workflowEditorHelper.js +595 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +64 -0
- 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 +22 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +36 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/playground/index.d.ts +131 -0
- package/dist/playground/index.js +172 -0
- package/dist/playground/mount.d.ts +203 -0
- package/dist/playground/mount.js +235 -0
- package/dist/registry/BaseRegistry.d.ts +92 -0
- package/dist/registry/BaseRegistry.js +124 -0
- package/dist/registry/builtinFormats.d.ts +23 -0
- package/dist/registry/builtinFormats.js +70 -0
- package/dist/registry/builtinNodes.d.ts +77 -0
- package/dist/registry/builtinNodes.js +211 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/nodeComponentRegistry.d.ts +276 -0
- package/dist/registry/nodeComponentRegistry.js +262 -0
- package/dist/registry/plugin.d.ts +215 -0
- package/dist/registry/plugin.js +249 -0
- package/dist/registry/workflowFormatRegistry.d.ts +122 -0
- package/dist/registry/workflowFormatRegistry.js +96 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/index.js +23 -0
- package/dist/schemas/v1/workflow.schema.json +1078 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +334 -0
- package/dist/services/api.d.ts +115 -0
- package/dist/services/api.js +214 -0
- package/dist/services/apiVariableService.d.ts +114 -0
- package/dist/services/apiVariableService.js +338 -0
- package/dist/services/autoSaveService.d.ts +112 -0
- package/dist/services/autoSaveService.js +227 -0
- package/dist/services/categoriesApi.d.ts +14 -0
- package/dist/services/categoriesApi.js +49 -0
- package/dist/services/draftStorage.d.ts +171 -0
- package/dist/services/draftStorage.js +299 -0
- package/dist/services/dynamicSchemaService.d.ts +108 -0
- package/dist/services/dynamicSchemaService.js +444 -0
- package/dist/services/globalSave.d.ts +69 -0
- package/dist/services/globalSave.js +248 -0
- package/dist/services/historyService.d.ts +208 -0
- package/dist/services/historyService.js +321 -0
- package/dist/services/interruptService.d.ts +133 -0
- package/dist/services/interruptService.js +280 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +266 -0
- package/dist/services/playgroundService.d.ts +130 -0
- package/dist/services/playgroundService.js +321 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +54 -0
- package/dist/services/settingsService.d.ts +92 -0
- package/dist/services/settingsService.js +196 -0
- package/dist/services/toastService.d.ts +156 -0
- package/dist/services/toastService.js +265 -0
- package/dist/services/variableService.d.ts +141 -0
- package/dist/services/variableService.js +463 -0
- package/dist/services/workflowStorage.d.ts +37 -0
- package/dist/services/workflowStorage.js +116 -0
- package/dist/settings/index.d.ts +25 -0
- package/dist/settings/index.js +33 -0
- package/dist/stores/categoriesStore.svelte.d.ts +32 -0
- package/dist/stores/categoriesStore.svelte.js +77 -0
- package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
- package/dist/stores/editorStateMachine.svelte.js +132 -0
- package/dist/stores/historyStore.svelte.d.ts +136 -0
- package/dist/stores/historyStore.svelte.js +207 -0
- package/dist/stores/interruptStore.svelte.d.ts +179 -0
- package/dist/stores/interruptStore.svelte.js +346 -0
- package/dist/stores/playgroundStore.svelte.d.ts +230 -0
- package/dist/stores/playgroundStore.svelte.js +515 -0
- package/dist/stores/portCoordinateStore.svelte.d.ts +66 -0
- package/dist/stores/portCoordinateStore.svelte.js +186 -0
- package/dist/stores/settingsStore.svelte.d.ts +158 -0
- package/dist/stores/settingsStore.svelte.js +544 -0
- package/dist/stores/workflowStore.svelte.d.ts +260 -0
- package/dist/stores/workflowStore.svelte.js +649 -0
- package/dist/stories/CanvasDecorator.svelte +49 -0
- package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
- package/dist/stories/NodeDecorator.svelte +73 -0
- package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
- package/dist/stories/utils.d.ts +93 -0
- package/dist/stories/utils.js +122 -0
- package/dist/styles/base.css +1300 -0
- package/dist/styles/toast.css +35 -0
- package/dist/styles/tokens.css +475 -0
- package/dist/svelte-app.d.ts +150 -0
- package/dist/svelte-app.js +295 -0
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/auth.d.ts +263 -0
- package/dist/types/auth.js +229 -0
- package/dist/types/config.d.ts +151 -0
- package/dist/types/config.js +7 -0
- package/dist/types/events.d.ts +190 -0
- package/dist/types/events.js +30 -0
- package/dist/types/index.d.ts +1234 -0
- package/dist/types/index.js +27 -0
- package/dist/types/interrupt.d.ts +390 -0
- package/dist/types/interrupt.js +145 -0
- package/dist/types/interruptState.d.ts +211 -0
- package/dist/types/interruptState.js +308 -0
- package/dist/types/playground.d.ts +351 -0
- package/dist/types/playground.js +95 -0
- package/dist/types/settings.d.ts +189 -0
- package/dist/types/settings.js +97 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/colors.d.ts +288 -0
- package/dist/utils/colors.js +548 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.js +226 -0
- package/dist/utils/connections.d.ts +125 -0
- package/dist/utils/connections.js +414 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/fetchWithAuth.d.ts +25 -0
- package/dist/utils/fetchWithAuth.js +34 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/dist/utils/handlePositioning.d.ts +31 -0
- package/dist/utils/handlePositioning.js +35 -0
- package/dist/utils/icons.d.ts +106 -0
- package/dist/utils/icons.js +157 -0
- package/dist/utils/logger.d.ts +47 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +117 -0
- package/dist/utils/nodeTypes.js +244 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/dist/utils/performanceUtils.d.ts +30 -0
- package/dist/utils/performanceUtils.js +108 -0
- package/dist/utils/sanitize.d.ts +19 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.js +39 -0
- package/package.json +292 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Service for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides API operations for user preferences/settings using the
|
|
5
|
+
* configurable endpoint system. Integrates with settingsStore for
|
|
6
|
+
* hybrid localStorage + API persistence.
|
|
7
|
+
*
|
|
8
|
+
* @module services/settingsService
|
|
9
|
+
*/
|
|
10
|
+
import { buildEndpointUrl, getEndpointHeaders } from '../config/endpoints.js';
|
|
11
|
+
// =========================================================================
|
|
12
|
+
// Configuration
|
|
13
|
+
// =========================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Endpoint configuration reference
|
|
16
|
+
*/
|
|
17
|
+
let endpointConfig = null;
|
|
18
|
+
/**
|
|
19
|
+
* Set the endpoint configuration for settings API calls
|
|
20
|
+
*
|
|
21
|
+
* @param config - Endpoint configuration
|
|
22
|
+
*/
|
|
23
|
+
export function setSettingsEndpointConfig(config) {
|
|
24
|
+
endpointConfig = config;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the current endpoint configuration
|
|
28
|
+
*
|
|
29
|
+
* @returns Current endpoint configuration or null
|
|
30
|
+
*/
|
|
31
|
+
export function getSettingsEndpointConfig() {
|
|
32
|
+
return endpointConfig;
|
|
33
|
+
}
|
|
34
|
+
// =========================================================================
|
|
35
|
+
// API Request Helper
|
|
36
|
+
// =========================================================================
|
|
37
|
+
/**
|
|
38
|
+
* Make an API request for settings operations
|
|
39
|
+
*
|
|
40
|
+
* @param endpointKey - Key for headers lookup
|
|
41
|
+
* @param endpointPath - Path to the endpoint
|
|
42
|
+
* @param options - Additional fetch options
|
|
43
|
+
* @returns Parsed response data
|
|
44
|
+
*/
|
|
45
|
+
async function settingsRequest(endpointKey, endpointPath, options = {}) {
|
|
46
|
+
if (!endpointConfig) {
|
|
47
|
+
throw new Error('Endpoint configuration not set. Call setSettingsEndpointConfig() first.');
|
|
48
|
+
}
|
|
49
|
+
const url = buildEndpointUrl(endpointConfig, endpointPath);
|
|
50
|
+
const headers = getEndpointHeaders(endpointConfig, endpointKey);
|
|
51
|
+
const response = await fetch(url, {
|
|
52
|
+
headers,
|
|
53
|
+
...options
|
|
54
|
+
});
|
|
55
|
+
// Check if response is JSON
|
|
56
|
+
const contentType = response.headers.get('content-type');
|
|
57
|
+
const isJson = contentType?.includes('application/json');
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
let errorMessage = `HTTP ${response.status}: ${response.statusText}`;
|
|
60
|
+
if (isJson) {
|
|
61
|
+
try {
|
|
62
|
+
const data = (await response.json());
|
|
63
|
+
errorMessage = data.error ?? data.message ?? errorMessage;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Failed to parse JSON, use default error message
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
throw new Error(errorMessage);
|
|
70
|
+
}
|
|
71
|
+
// Parse successful response
|
|
72
|
+
const data = (await response.json());
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
75
|
+
// =========================================================================
|
|
76
|
+
// Settings API Methods
|
|
77
|
+
// =========================================================================
|
|
78
|
+
/**
|
|
79
|
+
* Settings API namespace
|
|
80
|
+
*/
|
|
81
|
+
export const settingsApi = {
|
|
82
|
+
/**
|
|
83
|
+
* Get user preferences from the backend
|
|
84
|
+
*
|
|
85
|
+
* @returns User's saved preferences
|
|
86
|
+
*/
|
|
87
|
+
async getPreferences() {
|
|
88
|
+
if (!endpointConfig) {
|
|
89
|
+
throw new Error('Endpoint configuration not set');
|
|
90
|
+
}
|
|
91
|
+
const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, { method: 'GET' });
|
|
92
|
+
if (!response.success || !response.data) {
|
|
93
|
+
throw new Error(typeof response.error === 'string' ? response.error : 'Failed to fetch user preferences');
|
|
94
|
+
}
|
|
95
|
+
return response.data;
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Save user preferences to the backend
|
|
99
|
+
*
|
|
100
|
+
* @param settings - Complete settings to save
|
|
101
|
+
*/
|
|
102
|
+
async savePreferences(settings) {
|
|
103
|
+
if (!endpointConfig) {
|
|
104
|
+
throw new Error('Endpoint configuration not set');
|
|
105
|
+
}
|
|
106
|
+
const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, {
|
|
107
|
+
method: 'PUT',
|
|
108
|
+
body: JSON.stringify(settings)
|
|
109
|
+
});
|
|
110
|
+
if (!response.success) {
|
|
111
|
+
throw new Error(typeof response.error === 'string' ? response.error : 'Failed to save user preferences');
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Partially update user preferences
|
|
116
|
+
*
|
|
117
|
+
* @param partial - Partial settings to merge
|
|
118
|
+
*/
|
|
119
|
+
async patchPreferences(partial) {
|
|
120
|
+
if (!endpointConfig) {
|
|
121
|
+
throw new Error('Endpoint configuration not set');
|
|
122
|
+
}
|
|
123
|
+
const response = await settingsRequest('users.preferences', endpointConfig.endpoints.users.preferences, {
|
|
124
|
+
method: 'PATCH',
|
|
125
|
+
body: JSON.stringify(partial)
|
|
126
|
+
});
|
|
127
|
+
if (!response.success || !response.data) {
|
|
128
|
+
throw new Error(typeof response.error === 'string' ? response.error : 'Failed to update user preferences');
|
|
129
|
+
}
|
|
130
|
+
return response.data;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
// =========================================================================
|
|
134
|
+
// Settings Service Class (for settingsStore integration)
|
|
135
|
+
// =========================================================================
|
|
136
|
+
/**
|
|
137
|
+
* Settings service class for integration with settingsStore
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* import { SettingsService } from "@flowdrop/flowdrop";
|
|
142
|
+
* import { setSettingsService } from "@flowdrop/flowdrop";
|
|
143
|
+
*
|
|
144
|
+
* const service = new SettingsService(endpointConfig);
|
|
145
|
+
* setSettingsService(service);
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export class SettingsService {
|
|
149
|
+
config;
|
|
150
|
+
/**
|
|
151
|
+
* Create a new settings service instance
|
|
152
|
+
*
|
|
153
|
+
* @param config - Endpoint configuration
|
|
154
|
+
*/
|
|
155
|
+
constructor(config) {
|
|
156
|
+
this.config = config;
|
|
157
|
+
// Also set the module-level config
|
|
158
|
+
setSettingsEndpointConfig(config);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Get user preferences from the backend
|
|
162
|
+
*
|
|
163
|
+
* @returns User's saved preferences
|
|
164
|
+
*/
|
|
165
|
+
async getPreferences() {
|
|
166
|
+
return settingsApi.getPreferences();
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Save user preferences to the backend
|
|
170
|
+
*
|
|
171
|
+
* @param settings - Complete settings to save
|
|
172
|
+
*/
|
|
173
|
+
async savePreferences(settings) {
|
|
174
|
+
return settingsApi.savePreferences(settings);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Partially update user preferences
|
|
178
|
+
*
|
|
179
|
+
* @param partial - Partial settings to merge
|
|
180
|
+
*/
|
|
181
|
+
async patchPreferences(partial) {
|
|
182
|
+
return settingsApi.patchPreferences(partial);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// =========================================================================
|
|
186
|
+
// Factory Function
|
|
187
|
+
// =========================================================================
|
|
188
|
+
/**
|
|
189
|
+
* Create a settings service instance
|
|
190
|
+
*
|
|
191
|
+
* @param config - Endpoint configuration
|
|
192
|
+
* @returns SettingsService instance
|
|
193
|
+
*/
|
|
194
|
+
export function createSettingsService(config) {
|
|
195
|
+
return new SettingsService(config);
|
|
196
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Service
|
|
3
|
+
* Centralized toast notification service using svelte-french-toast
|
|
4
|
+
* Provides consistent toast notifications across the FlowDrop application
|
|
5
|
+
*/
|
|
6
|
+
import { type DefaultToastOptions } from 'svelte-5-french-toast';
|
|
7
|
+
/**
|
|
8
|
+
* Default toast options themed with FlowDrop design tokens.
|
|
9
|
+
* Use with <Toaster toastOptions={flowdropToastOptions} containerClassName="flowdrop-toaster" />
|
|
10
|
+
* and import '@flowdrop/flowdrop/styles/toast.css' (or app toast.css) so toast bar styles apply.
|
|
11
|
+
*/
|
|
12
|
+
export declare const flowdropToastOptions: DefaultToastOptions;
|
|
13
|
+
/** Container class for FlowDrop-themed Toaster (used with toast.css). */
|
|
14
|
+
export declare const FLOWDROP_TOASTER_CLASS = "flowdrop-toaster";
|
|
15
|
+
/**
|
|
16
|
+
* Toast notification types
|
|
17
|
+
*/
|
|
18
|
+
export type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
19
|
+
/**
|
|
20
|
+
* Toast configuration options
|
|
21
|
+
*/
|
|
22
|
+
export interface ToastOptions {
|
|
23
|
+
duration?: number;
|
|
24
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Show a success toast notification
|
|
28
|
+
*/
|
|
29
|
+
export declare function showSuccess(message: string, options?: ToastOptions): string;
|
|
30
|
+
/**
|
|
31
|
+
* Show an error toast notification
|
|
32
|
+
*/
|
|
33
|
+
export declare function showError(message: string, options?: ToastOptions): string;
|
|
34
|
+
/**
|
|
35
|
+
* Show a warning toast notification
|
|
36
|
+
*/
|
|
37
|
+
export declare function showWarning(message: string, options?: ToastOptions): string;
|
|
38
|
+
/**
|
|
39
|
+
* Show an info toast notification
|
|
40
|
+
*/
|
|
41
|
+
export declare function showInfo(message: string, options?: ToastOptions): string;
|
|
42
|
+
/**
|
|
43
|
+
* Show a loading toast notification
|
|
44
|
+
*/
|
|
45
|
+
export declare function showLoading(message: string, options?: ToastOptions): string;
|
|
46
|
+
/**
|
|
47
|
+
* Dismiss a specific toast by ID
|
|
48
|
+
*/
|
|
49
|
+
export declare function dismissToast(toastId: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Dismiss all toasts
|
|
52
|
+
*/
|
|
53
|
+
export declare function dismissAllToasts(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Show a promise-based toast (loading -> success/error)
|
|
56
|
+
*/
|
|
57
|
+
export declare function showPromise<T>(promise: Promise<T>, { loading, success, error, options }: {
|
|
58
|
+
loading: string;
|
|
59
|
+
success: string | ((data: T) => string);
|
|
60
|
+
error: string | ((error: unknown) => string);
|
|
61
|
+
options?: ToastOptions;
|
|
62
|
+
}): Promise<T>;
|
|
63
|
+
/**
|
|
64
|
+
* Show a confirmation toast (simplified version without action buttons)
|
|
65
|
+
*/
|
|
66
|
+
export declare function showConfirmation(message: string, options?: ToastOptions): string;
|
|
67
|
+
/**
|
|
68
|
+
* API-specific toast helpers
|
|
69
|
+
*/
|
|
70
|
+
export declare const apiToasts: {
|
|
71
|
+
/**
|
|
72
|
+
* Show API success message
|
|
73
|
+
*/
|
|
74
|
+
success: (operation: string, details?: string) => string;
|
|
75
|
+
/**
|
|
76
|
+
* Show API error message
|
|
77
|
+
*/
|
|
78
|
+
error: (operation: string, error: string | Error) => string;
|
|
79
|
+
/**
|
|
80
|
+
* Show API loading message
|
|
81
|
+
*/
|
|
82
|
+
loading: (operation: string) => string;
|
|
83
|
+
/**
|
|
84
|
+
* Show API promise with automatic success/error handling
|
|
85
|
+
*/
|
|
86
|
+
promise: <T>(promise: Promise<T>, operation: string, options?: {
|
|
87
|
+
successMessage?: string;
|
|
88
|
+
errorMessage?: string;
|
|
89
|
+
}) => Promise<T>;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Workflow-specific toast helpers
|
|
93
|
+
*/
|
|
94
|
+
export declare const workflowToasts: {
|
|
95
|
+
/**
|
|
96
|
+
* Show workflow save success
|
|
97
|
+
*/
|
|
98
|
+
saved: (workflowName?: string) => string;
|
|
99
|
+
/**
|
|
100
|
+
* Show workflow save error
|
|
101
|
+
*/
|
|
102
|
+
saveError: (error: string | Error) => string;
|
|
103
|
+
/**
|
|
104
|
+
* Show workflow delete success
|
|
105
|
+
*/
|
|
106
|
+
deleted: (workflowName?: string) => string;
|
|
107
|
+
/**
|
|
108
|
+
* Show workflow delete error
|
|
109
|
+
*/
|
|
110
|
+
deleteError: (error: string | Error) => string;
|
|
111
|
+
/**
|
|
112
|
+
* Show workflow execution started
|
|
113
|
+
*/
|
|
114
|
+
executionStarted: (workflowName?: string) => string;
|
|
115
|
+
/**
|
|
116
|
+
* Show workflow execution completed
|
|
117
|
+
*/
|
|
118
|
+
executionCompleted: (workflowName?: string) => string;
|
|
119
|
+
/**
|
|
120
|
+
* Show workflow export success
|
|
121
|
+
*/
|
|
122
|
+
exported: (workflowName?: string) => string;
|
|
123
|
+
/**
|
|
124
|
+
* Show workflow execution error
|
|
125
|
+
*/
|
|
126
|
+
executionError: (error: string | Error) => string;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Pipeline-specific toast helpers
|
|
130
|
+
*/
|
|
131
|
+
export declare const pipelineToasts: {
|
|
132
|
+
/**
|
|
133
|
+
* Show pipeline creation success
|
|
134
|
+
*/
|
|
135
|
+
created: (pipelineName?: string) => string;
|
|
136
|
+
/**
|
|
137
|
+
* Show pipeline creation error
|
|
138
|
+
*/
|
|
139
|
+
creationError: (error: string | Error) => string;
|
|
140
|
+
/**
|
|
141
|
+
* Show pipeline execution started
|
|
142
|
+
*/
|
|
143
|
+
executionStarted: (pipelineId: string) => string;
|
|
144
|
+
/**
|
|
145
|
+
* Show pipeline execution completed
|
|
146
|
+
*/
|
|
147
|
+
executionCompleted: (pipelineId: string) => string;
|
|
148
|
+
/**
|
|
149
|
+
* Show pipeline execution error
|
|
150
|
+
*/
|
|
151
|
+
executionError: (pipelineId: string, error: string | Error) => string;
|
|
152
|
+
/**
|
|
153
|
+
* Show pipeline status update
|
|
154
|
+
*/
|
|
155
|
+
statusUpdate: (pipelineId: string, status: string) => string;
|
|
156
|
+
};
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Service
|
|
3
|
+
* Centralized toast notification service using svelte-french-toast
|
|
4
|
+
* Provides consistent toast notifications across the FlowDrop application
|
|
5
|
+
*/
|
|
6
|
+
import { toast } from 'svelte-5-french-toast';
|
|
7
|
+
import { TOAST_DURATION } from '../config/constants.js';
|
|
8
|
+
/**
|
|
9
|
+
* Default toast options themed with FlowDrop design tokens.
|
|
10
|
+
* Use with <Toaster toastOptions={flowdropToastOptions} containerClassName="flowdrop-toaster" />
|
|
11
|
+
* and import '@flowdrop/flowdrop/styles/toast.css' (or app toast.css) so toast bar styles apply.
|
|
12
|
+
*/
|
|
13
|
+
export const flowdropToastOptions = {
|
|
14
|
+
className: 'flowdrop-toast-bar',
|
|
15
|
+
style: '',
|
|
16
|
+
success: {
|
|
17
|
+
iconTheme: {
|
|
18
|
+
primary: 'var(--fd-success)',
|
|
19
|
+
secondary: 'var(--fd-success-foreground)'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
error: {
|
|
23
|
+
iconTheme: {
|
|
24
|
+
primary: 'var(--fd-error)',
|
|
25
|
+
secondary: 'var(--fd-error-foreground)'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
loading: {
|
|
29
|
+
iconTheme: {
|
|
30
|
+
primary: 'var(--fd-primary)',
|
|
31
|
+
secondary: 'var(--fd-primary-muted)'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/** Container class for FlowDrop-themed Toaster (used with toast.css). */
|
|
36
|
+
export const FLOWDROP_TOASTER_CLASS = 'flowdrop-toaster';
|
|
37
|
+
/**
|
|
38
|
+
* Show a success toast notification
|
|
39
|
+
*/
|
|
40
|
+
export function showSuccess(message, options) {
|
|
41
|
+
return toast.success(message, {
|
|
42
|
+
duration: options?.duration || TOAST_DURATION.SUCCESS,
|
|
43
|
+
position: options?.position || 'bottom-center'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Show an error toast notification
|
|
48
|
+
*/
|
|
49
|
+
export function showError(message, options) {
|
|
50
|
+
return toast.error(message, {
|
|
51
|
+
duration: options?.duration || TOAST_DURATION.ERROR,
|
|
52
|
+
position: options?.position || 'bottom-center'
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Show a warning toast notification
|
|
57
|
+
*/
|
|
58
|
+
export function showWarning(message, options) {
|
|
59
|
+
return toast.error(message, {
|
|
60
|
+
duration: options?.duration || TOAST_DURATION.WARNING,
|
|
61
|
+
position: options?.position || 'bottom-center'
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Show an info toast notification
|
|
66
|
+
*/
|
|
67
|
+
export function showInfo(message, options) {
|
|
68
|
+
return toast.success(message, {
|
|
69
|
+
duration: options?.duration || TOAST_DURATION.INFO,
|
|
70
|
+
position: options?.position || 'bottom-center'
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Show a loading toast notification
|
|
75
|
+
*/
|
|
76
|
+
export function showLoading(message, options) {
|
|
77
|
+
return toast.loading(message, {
|
|
78
|
+
duration: options?.duration || Infinity,
|
|
79
|
+
position: options?.position || 'bottom-center'
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Dismiss a specific toast by ID
|
|
84
|
+
*/
|
|
85
|
+
export function dismissToast(toastId) {
|
|
86
|
+
toast.dismiss(toastId);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Dismiss all toasts
|
|
90
|
+
*/
|
|
91
|
+
export function dismissAllToasts() {
|
|
92
|
+
toast.dismiss();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Show a promise-based toast (loading -> success/error)
|
|
96
|
+
*/
|
|
97
|
+
export function showPromise(promise, { loading, success, error, options }) {
|
|
98
|
+
return toast.promise(promise, {
|
|
99
|
+
loading,
|
|
100
|
+
success,
|
|
101
|
+
error,
|
|
102
|
+
...options
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Show a confirmation toast (simplified version without action buttons)
|
|
107
|
+
*/
|
|
108
|
+
export function showConfirmation(message, options) {
|
|
109
|
+
return toast(message, {
|
|
110
|
+
duration: options?.duration || TOAST_DURATION.CONFIRMATION,
|
|
111
|
+
position: options?.position || 'bottom-center'
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* API-specific toast helpers
|
|
116
|
+
*/
|
|
117
|
+
export const apiToasts = {
|
|
118
|
+
/**
|
|
119
|
+
* Show API success message
|
|
120
|
+
*/
|
|
121
|
+
success: (operation, details) => {
|
|
122
|
+
const message = details ? `${operation}: ${details}` : operation;
|
|
123
|
+
return showSuccess(message);
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* Show API error message
|
|
127
|
+
*/
|
|
128
|
+
error: (operation, error) => {
|
|
129
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
130
|
+
return showError(`${operation} failed: ${errorMessage}`);
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Show API loading message
|
|
134
|
+
*/
|
|
135
|
+
loading: (operation) => {
|
|
136
|
+
return showLoading(`${operation}...`);
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Show API promise with automatic success/error handling
|
|
140
|
+
*/
|
|
141
|
+
promise: (promise, operation, options) => {
|
|
142
|
+
return showPromise(promise, {
|
|
143
|
+
loading: `${operation}...`,
|
|
144
|
+
success: options?.successMessage || `${operation} completed successfully`,
|
|
145
|
+
error: options?.errorMessage || `${operation} failed`
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Workflow-specific toast helpers
|
|
151
|
+
*/
|
|
152
|
+
export const workflowToasts = {
|
|
153
|
+
/**
|
|
154
|
+
* Show workflow save success
|
|
155
|
+
*/
|
|
156
|
+
saved: (workflowName) => {
|
|
157
|
+
const message = workflowName
|
|
158
|
+
? `Workflow "${workflowName}" saved successfully`
|
|
159
|
+
: 'Workflow saved successfully';
|
|
160
|
+
return showSuccess(message);
|
|
161
|
+
},
|
|
162
|
+
/**
|
|
163
|
+
* Show workflow save error
|
|
164
|
+
*/
|
|
165
|
+
saveError: (error) => {
|
|
166
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
167
|
+
return showError(`Failed to save workflow: ${errorMessage}`);
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Show workflow delete success
|
|
171
|
+
*/
|
|
172
|
+
deleted: (workflowName) => {
|
|
173
|
+
const message = workflowName
|
|
174
|
+
? `Workflow "${workflowName}" deleted successfully`
|
|
175
|
+
: 'Workflow deleted successfully';
|
|
176
|
+
return showSuccess(message);
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* Show workflow delete error
|
|
180
|
+
*/
|
|
181
|
+
deleteError: (error) => {
|
|
182
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
183
|
+
return showError(`Failed to delete workflow: ${errorMessage}`);
|
|
184
|
+
},
|
|
185
|
+
/**
|
|
186
|
+
* Show workflow execution started
|
|
187
|
+
*/
|
|
188
|
+
executionStarted: (workflowName) => {
|
|
189
|
+
const message = workflowName
|
|
190
|
+
? `Workflow "${workflowName}" execution started`
|
|
191
|
+
: 'Workflow execution started';
|
|
192
|
+
return showInfo(message);
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* Show workflow execution completed
|
|
196
|
+
*/
|
|
197
|
+
executionCompleted: (workflowName) => {
|
|
198
|
+
const message = workflowName
|
|
199
|
+
? `Workflow "${workflowName}" execution completed`
|
|
200
|
+
: 'Workflow execution completed';
|
|
201
|
+
return showSuccess(message);
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Show workflow export success
|
|
205
|
+
*/
|
|
206
|
+
exported: (workflowName) => {
|
|
207
|
+
const message = workflowName
|
|
208
|
+
? `Workflow "${workflowName}" exported successfully`
|
|
209
|
+
: 'Workflow exported successfully';
|
|
210
|
+
return showSuccess(message);
|
|
211
|
+
},
|
|
212
|
+
/**
|
|
213
|
+
* Show workflow execution error
|
|
214
|
+
*/
|
|
215
|
+
executionError: (error) => {
|
|
216
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
217
|
+
return showError(`Workflow execution failed: ${errorMessage}`);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Pipeline-specific toast helpers
|
|
222
|
+
*/
|
|
223
|
+
export const pipelineToasts = {
|
|
224
|
+
/**
|
|
225
|
+
* Show pipeline creation success
|
|
226
|
+
*/
|
|
227
|
+
created: (pipelineName) => {
|
|
228
|
+
const message = pipelineName
|
|
229
|
+
? `Pipeline "${pipelineName}" created successfully`
|
|
230
|
+
: 'Pipeline created successfully';
|
|
231
|
+
return showSuccess(message);
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* Show pipeline creation error
|
|
235
|
+
*/
|
|
236
|
+
creationError: (error) => {
|
|
237
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
238
|
+
return showError(`Failed to create pipeline: ${errorMessage}`);
|
|
239
|
+
},
|
|
240
|
+
/**
|
|
241
|
+
* Show pipeline execution started
|
|
242
|
+
*/
|
|
243
|
+
executionStarted: (pipelineId) => {
|
|
244
|
+
return showInfo(`Pipeline ${pipelineId} execution started`);
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* Show pipeline execution completed
|
|
248
|
+
*/
|
|
249
|
+
executionCompleted: (pipelineId) => {
|
|
250
|
+
return showSuccess(`Pipeline ${pipelineId} execution completed`);
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* Show pipeline execution error
|
|
254
|
+
*/
|
|
255
|
+
executionError: (pipelineId, error) => {
|
|
256
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
257
|
+
return showError(`Pipeline ${pipelineId} execution failed: ${errorMessage}`);
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* Show pipeline status update
|
|
261
|
+
*/
|
|
262
|
+
statusUpdate: (pipelineId, status) => {
|
|
263
|
+
return showInfo(`Pipeline ${pipelineId} status: ${status}`);
|
|
264
|
+
}
|
|
265
|
+
};
|