@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,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Save Service
|
|
3
|
+
* Provides save and export functionality that can be accessed from anywhere in the app.
|
|
4
|
+
* This is the single source of truth for save/export logic.
|
|
5
|
+
*
|
|
6
|
+
* App.svelte delegates to globalSaveWorkflow() / globalExportWorkflow() rather than
|
|
7
|
+
* reimplementing the logic, ensuring "blur active element" flushing and metadata
|
|
8
|
+
* construction happen in exactly one place.
|
|
9
|
+
*/
|
|
10
|
+
import { tick } from 'svelte';
|
|
11
|
+
import { getWorkflowStore, workflowActions, markAsSaved as storeMarkAsSaved } from '../stores/workflowStore.svelte.js';
|
|
12
|
+
import { workflowApi, setEndpointConfig } from './api.js';
|
|
13
|
+
import { createEndpointConfig } from '../config/endpoints.js';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
|
+
import { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
|
|
16
|
+
import { apiToasts, workflowToasts, dismissToast } from './toastService.js';
|
|
17
|
+
import { DEFAULT_FEATURES } from '../types/events.js';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Internal helpers
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/**
|
|
22
|
+
* Ensure API configuration is initialized.
|
|
23
|
+
* This is needed when the global save function is called from the layout component
|
|
24
|
+
* which doesn't initialize the API configuration like the App component does.
|
|
25
|
+
*/
|
|
26
|
+
async function ensureApiConfiguration() {
|
|
27
|
+
try {
|
|
28
|
+
const { getEndpointConfig } = await import('./api.js');
|
|
29
|
+
const currentConfig = getEndpointConfig();
|
|
30
|
+
if (currentConfig && currentConfig.baseUrl) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Could not check existing API configuration, initializing
|
|
36
|
+
}
|
|
37
|
+
// API configuration is not initialized — derive URL from window.location when available
|
|
38
|
+
const apiBaseUrl = typeof window !== 'undefined'
|
|
39
|
+
? `${window.location.protocol}//${window.location.host}/api/flowdrop`
|
|
40
|
+
: '/api/flowdrop';
|
|
41
|
+
const config = createEndpointConfig(apiBaseUrl, {
|
|
42
|
+
auth: {
|
|
43
|
+
type: 'none'
|
|
44
|
+
},
|
|
45
|
+
timeout: 10000,
|
|
46
|
+
retry: {
|
|
47
|
+
enabled: true,
|
|
48
|
+
maxAttempts: 2,
|
|
49
|
+
delay: 1000,
|
|
50
|
+
backoff: 'exponential'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
setEndpointConfig(config);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Flush any pending form changes by blurring the active element.
|
|
57
|
+
* This ensures focusout handlers (like ConfigForm's handleFormBlur)
|
|
58
|
+
* sync local state to the global store before we read it.
|
|
59
|
+
*
|
|
60
|
+
* Must be called once, in this file only, so the logic lives in exactly one place.
|
|
61
|
+
*/
|
|
62
|
+
async function flushPendingFormChanges() {
|
|
63
|
+
if (typeof document !== 'undefined' && document.activeElement instanceof HTMLElement) {
|
|
64
|
+
document.activeElement.blur();
|
|
65
|
+
}
|
|
66
|
+
// Wait for any pending DOM / Svelte reactive updates before reading the store
|
|
67
|
+
await tick();
|
|
68
|
+
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Public API
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
/**
|
|
73
|
+
* Save the current workflow to the backend.
|
|
74
|
+
*
|
|
75
|
+
* This is the single source of truth for save logic. App.svelte delegates
|
|
76
|
+
* to this function rather than reimplementing the steps.
|
|
77
|
+
*
|
|
78
|
+
* Steps performed:
|
|
79
|
+
* 1. Flush pending form changes (blur active element + tick)
|
|
80
|
+
* 2. Optionally call onBeforeSave — return false cancels the save
|
|
81
|
+
* 3. Build the canonical Workflow object (preserving metadata, format, etc.)
|
|
82
|
+
* 4. Persist via enhanced apiClient or legacy workflowApi
|
|
83
|
+
* 5. Update the store if the server assigned a new ID
|
|
84
|
+
* 6. Call onMarkAsSaved / onAfterSave hooks
|
|
85
|
+
* 7. Show toast notifications (respecting features.showToasts)
|
|
86
|
+
*/
|
|
87
|
+
export async function globalSaveWorkflow(options = {}) {
|
|
88
|
+
const { apiClient, eventHandlers, onMarkAsSaved } = options;
|
|
89
|
+
const features = { ...DEFAULT_FEATURES, ...options.features };
|
|
90
|
+
// Step 1 — Flush pending form changes (single location for this logic)
|
|
91
|
+
await flushPendingFormChanges();
|
|
92
|
+
// Get current workflow from global store after flush
|
|
93
|
+
const currentWorkflow = getWorkflowStore();
|
|
94
|
+
if (!currentWorkflow) {
|
|
95
|
+
if (features.showToasts) {
|
|
96
|
+
apiToasts.error('Save workflow', 'No workflow to save');
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Step 2 — Allow the parent to cancel the save
|
|
101
|
+
if (eventHandlers?.onBeforeSave) {
|
|
102
|
+
const shouldContinue = await eventHandlers.onBeforeSave(currentWorkflow);
|
|
103
|
+
if (shouldContinue === false) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const loadingToast = features.showToasts ? apiToasts.loading('Saving workflow') : null;
|
|
108
|
+
try {
|
|
109
|
+
// Ensure API configuration is initialised (needed when called outside App.svelte)
|
|
110
|
+
await ensureApiConfiguration();
|
|
111
|
+
// Step 3 — Build the canonical workflow object.
|
|
112
|
+
// Preserve all existing metadata fields (format, tags, etc.) so nothing is dropped.
|
|
113
|
+
const workflowId = currentWorkflow.id || uuidv4();
|
|
114
|
+
const finalWorkflow = {
|
|
115
|
+
id: workflowId,
|
|
116
|
+
name: currentWorkflow.name || 'Untitled Workflow',
|
|
117
|
+
description: currentWorkflow.description || '',
|
|
118
|
+
nodes: currentWorkflow.nodes || [],
|
|
119
|
+
edges: currentWorkflow.edges || [],
|
|
120
|
+
metadata: {
|
|
121
|
+
...currentWorkflow.metadata,
|
|
122
|
+
version: currentWorkflow.metadata?.version || '1.0.0',
|
|
123
|
+
format: currentWorkflow.metadata?.format || DEFAULT_WORKFLOW_FORMAT,
|
|
124
|
+
createdAt: currentWorkflow.metadata?.createdAt || new Date().toISOString(),
|
|
125
|
+
updatedAt: new Date().toISOString()
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
// Step 4 — Persist
|
|
129
|
+
let savedWorkflow;
|
|
130
|
+
if (apiClient) {
|
|
131
|
+
// Enhanced client path — detects existing workflows by non-UUID ID
|
|
132
|
+
const isExistingWorkflow = finalWorkflow.id.length > 0 &&
|
|
133
|
+
!finalWorkflow.id.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i);
|
|
134
|
+
if (isExistingWorkflow) {
|
|
135
|
+
savedWorkflow = await apiClient.updateWorkflow(finalWorkflow.id, finalWorkflow);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
savedWorkflow = await apiClient.saveWorkflow(finalWorkflow);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
// Legacy path
|
|
143
|
+
savedWorkflow = await workflowApi.saveWorkflow(finalWorkflow);
|
|
144
|
+
}
|
|
145
|
+
// Step 5 — If the server assigned a new ID, sync the store
|
|
146
|
+
if (savedWorkflow.id && savedWorkflow.id !== finalWorkflow.id) {
|
|
147
|
+
workflowActions.batchUpdate({
|
|
148
|
+
nodes: finalWorkflow.nodes,
|
|
149
|
+
edges: finalWorkflow.edges,
|
|
150
|
+
name: finalWorkflow.name,
|
|
151
|
+
metadata: {
|
|
152
|
+
...finalWorkflow.metadata,
|
|
153
|
+
...savedWorkflow.metadata
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
// Step 6a — Mark dirty state as clean
|
|
158
|
+
if (onMarkAsSaved) {
|
|
159
|
+
onMarkAsSaved();
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
// Fallback: call the store's own markAsSaved if no callback was provided
|
|
163
|
+
storeMarkAsSaved();
|
|
164
|
+
}
|
|
165
|
+
// Show success toast
|
|
166
|
+
if (loadingToast)
|
|
167
|
+
dismissToast(loadingToast);
|
|
168
|
+
if (features.showToasts) {
|
|
169
|
+
workflowToasts.saved(finalWorkflow.name);
|
|
170
|
+
}
|
|
171
|
+
// Step 6b — After-save hook
|
|
172
|
+
if (eventHandlers?.onAfterSave) {
|
|
173
|
+
await eventHandlers.onAfterSave(savedWorkflow);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
if (loadingToast)
|
|
178
|
+
dismissToast(loadingToast);
|
|
179
|
+
const errorObj = error instanceof Error ? error : new Error('Unknown error occurred');
|
|
180
|
+
// onSaveError hook
|
|
181
|
+
const currentWorkflowForError = getWorkflowStore();
|
|
182
|
+
if (eventHandlers?.onSaveError && currentWorkflowForError) {
|
|
183
|
+
await eventHandlers.onSaveError(errorObj, currentWorkflowForError);
|
|
184
|
+
}
|
|
185
|
+
// onApiError hook — return true suppresses the default toast
|
|
186
|
+
let suppressToast = false;
|
|
187
|
+
if (eventHandlers?.onApiError) {
|
|
188
|
+
suppressToast = eventHandlers.onApiError(errorObj, 'save') === true;
|
|
189
|
+
}
|
|
190
|
+
if (features.showToasts && !suppressToast) {
|
|
191
|
+
apiToasts.error('Save workflow', errorObj.message);
|
|
192
|
+
}
|
|
193
|
+
throw error;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Export the current workflow as a downloadable JSON file.
|
|
198
|
+
*
|
|
199
|
+
* This is the single source of truth for export logic. App.svelte delegates
|
|
200
|
+
* to this function rather than reimplementing the steps.
|
|
201
|
+
*
|
|
202
|
+
* Preserves all metadata fields (format, tags, etc.) consistently with save.
|
|
203
|
+
*/
|
|
204
|
+
export async function globalExportWorkflow(options = {}) {
|
|
205
|
+
const features = { ...DEFAULT_FEATURES, ...options.features };
|
|
206
|
+
try {
|
|
207
|
+
// Flush pending changes before exporting (same discipline as save)
|
|
208
|
+
await flushPendingFormChanges();
|
|
209
|
+
const currentWorkflow = getWorkflowStore();
|
|
210
|
+
if (!currentWorkflow) {
|
|
211
|
+
if (features.showToasts) {
|
|
212
|
+
apiToasts.error('Export workflow', 'No workflow to export');
|
|
213
|
+
}
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
// Build the canonical export object — preserve all metadata fields
|
|
217
|
+
const finalWorkflow = {
|
|
218
|
+
id: currentWorkflow.id || 'untitled-workflow',
|
|
219
|
+
name: currentWorkflow.name || 'Untitled Workflow',
|
|
220
|
+
description: currentWorkflow.description || '',
|
|
221
|
+
nodes: currentWorkflow.nodes || [],
|
|
222
|
+
edges: currentWorkflow.edges || [],
|
|
223
|
+
metadata: {
|
|
224
|
+
...currentWorkflow.metadata,
|
|
225
|
+
version: currentWorkflow.metadata?.version || '1.0.0',
|
|
226
|
+
format: currentWorkflow.metadata?.format || DEFAULT_WORKFLOW_FORMAT,
|
|
227
|
+
createdAt: currentWorkflow.metadata?.createdAt || new Date().toISOString(),
|
|
228
|
+
updatedAt: new Date().toISOString()
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
// Trigger browser download
|
|
232
|
+
const dataStr = JSON.stringify(finalWorkflow, null, 2);
|
|
233
|
+
const dataBlob = new Blob([dataStr], { type: 'application/json' });
|
|
234
|
+
const url = URL.createObjectURL(dataBlob);
|
|
235
|
+
const link = document.createElement('a');
|
|
236
|
+
link.href = url;
|
|
237
|
+
link.download = `${finalWorkflow.name}.json`;
|
|
238
|
+
link.click();
|
|
239
|
+
URL.revokeObjectURL(url);
|
|
240
|
+
if (features.showToasts) {
|
|
241
|
+
workflowToasts.exported(finalWorkflow.name);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
const errorObj = error instanceof Error ? error : new Error('Unknown error occurred');
|
|
246
|
+
apiToasts.error('Export workflow', errorObj.message);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* History Service for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides undo/redo functionality for the workflow editor using snapshot-based history.
|
|
5
|
+
* Supports debounced drag operations and configurable history limits.
|
|
6
|
+
*
|
|
7
|
+
* @module services/historyService
|
|
8
|
+
*/
|
|
9
|
+
import type { Workflow } from '../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Represents a single entry in the history stack
|
|
12
|
+
*/
|
|
13
|
+
export interface HistoryEntry {
|
|
14
|
+
/** Deep clone of the workflow state at this point */
|
|
15
|
+
snapshot: Workflow;
|
|
16
|
+
/** Timestamp when the entry was created */
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/** Human-readable description of the change (e.g., "Add node", "Delete edge") */
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Current state of the history service
|
|
23
|
+
*/
|
|
24
|
+
export interface HistoryState {
|
|
25
|
+
/** Whether undo is available */
|
|
26
|
+
canUndo: boolean;
|
|
27
|
+
/** Whether redo is available */
|
|
28
|
+
canRedo: boolean;
|
|
29
|
+
/** Current position in the history stack */
|
|
30
|
+
currentIndex: number;
|
|
31
|
+
/** Total number of entries in the history stack */
|
|
32
|
+
historyLength: number;
|
|
33
|
+
/** Whether a transaction is currently active */
|
|
34
|
+
isInTransaction: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Options for pushing a new state to history
|
|
38
|
+
*/
|
|
39
|
+
export interface PushOptions {
|
|
40
|
+
/** Description of the change for debugging/display */
|
|
41
|
+
description?: string;
|
|
42
|
+
/** Whether to skip adding this to history (used internally for undo/redo) */
|
|
43
|
+
skipHistory?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Manages undo/redo history for workflow state
|
|
47
|
+
*
|
|
48
|
+
* Uses a snapshot-based approach where each history entry contains
|
|
49
|
+
* a complete copy of the workflow state. This trades memory for simplicity
|
|
50
|
+
* and reliability.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const historyService = new HistoryService();
|
|
55
|
+
*
|
|
56
|
+
* // Initialize with current workflow
|
|
57
|
+
* historyService.initialize(workflow);
|
|
58
|
+
*
|
|
59
|
+
* // Push state before making changes
|
|
60
|
+
* historyService.push(workflow, { description: "Add node" });
|
|
61
|
+
*
|
|
62
|
+
* // Undo/Redo
|
|
63
|
+
* const previousState = historyService.undo();
|
|
64
|
+
* const nextState = historyService.redo();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare class HistoryService {
|
|
68
|
+
/** Stack of history entries */
|
|
69
|
+
private undoStack;
|
|
70
|
+
/** Stack of redo entries (cleared when new changes are made) */
|
|
71
|
+
private redoStack;
|
|
72
|
+
/** Maximum number of entries to keep in history */
|
|
73
|
+
private maxEntries;
|
|
74
|
+
/** Flag to track if we're in a transaction (batch operation) */
|
|
75
|
+
private inTransaction;
|
|
76
|
+
/** Snapshot captured at transaction start */
|
|
77
|
+
private transactionSnapshot;
|
|
78
|
+
/** Description for the transaction */
|
|
79
|
+
private transactionDescription;
|
|
80
|
+
/** Callbacks to notify when history state changes */
|
|
81
|
+
private changeCallbacks;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new HistoryService instance
|
|
84
|
+
*
|
|
85
|
+
* @param maxEntries - Maximum number of history entries to keep (default: 50)
|
|
86
|
+
*/
|
|
87
|
+
constructor(maxEntries?: number);
|
|
88
|
+
/**
|
|
89
|
+
* Initialize the history with the current workflow state
|
|
90
|
+
*
|
|
91
|
+
* This clears any existing history and sets the initial state.
|
|
92
|
+
* Should be called when a workflow is first loaded.
|
|
93
|
+
*
|
|
94
|
+
* @param workflow - The initial workflow state
|
|
95
|
+
*/
|
|
96
|
+
initialize(workflow: Workflow): void;
|
|
97
|
+
/**
|
|
98
|
+
* Push the current state to history before making changes
|
|
99
|
+
*
|
|
100
|
+
* Call this BEFORE modifying the workflow to capture the "before" state.
|
|
101
|
+
* The redo stack is cleared when new changes are pushed.
|
|
102
|
+
*
|
|
103
|
+
* @param workflow - The current workflow state (before changes)
|
|
104
|
+
* @param options - Options for this history entry
|
|
105
|
+
*/
|
|
106
|
+
push(workflow: Workflow, options?: PushOptions): void;
|
|
107
|
+
/**
|
|
108
|
+
* Undo the last change
|
|
109
|
+
*
|
|
110
|
+
* Returns the previous workflow state, or null if at the beginning of history.
|
|
111
|
+
*
|
|
112
|
+
* @returns The previous workflow state, or null if cannot undo
|
|
113
|
+
*/
|
|
114
|
+
undo(): Workflow | null;
|
|
115
|
+
/**
|
|
116
|
+
* Redo the last undone change
|
|
117
|
+
*
|
|
118
|
+
* Returns the next workflow state, or null if at the end of history.
|
|
119
|
+
*
|
|
120
|
+
* @returns The next workflow state, or null if cannot redo
|
|
121
|
+
*/
|
|
122
|
+
redo(): Workflow | null;
|
|
123
|
+
/**
|
|
124
|
+
* Start a transaction for grouping multiple changes
|
|
125
|
+
*
|
|
126
|
+
* All changes made during a transaction are combined into a single undo entry.
|
|
127
|
+
* Useful for operations like "delete node" which also removes connected edges.
|
|
128
|
+
*
|
|
129
|
+
* @param workflow - The current workflow state (before changes)
|
|
130
|
+
* @param description - Description for the combined change
|
|
131
|
+
*/
|
|
132
|
+
startTransaction(workflow: Workflow, description?: string): void;
|
|
133
|
+
/**
|
|
134
|
+
* Commit the current transaction
|
|
135
|
+
*
|
|
136
|
+
* Pushes the state captured at transaction start to the history stack.
|
|
137
|
+
*/
|
|
138
|
+
commitTransaction(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Cancel the current transaction without committing
|
|
141
|
+
*
|
|
142
|
+
* Discards the transaction without adding to history.
|
|
143
|
+
*/
|
|
144
|
+
cancelTransaction(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Clear all history
|
|
147
|
+
*
|
|
148
|
+
* Resets the history stack. Optionally keeps the current state as initial.
|
|
149
|
+
*
|
|
150
|
+
* @param currentWorkflow - If provided, keeps this as the initial state
|
|
151
|
+
*/
|
|
152
|
+
clear(currentWorkflow?: Workflow): void;
|
|
153
|
+
/**
|
|
154
|
+
* Get the current history state
|
|
155
|
+
*
|
|
156
|
+
* @returns The current state of the history service
|
|
157
|
+
*/
|
|
158
|
+
getState(): HistoryState;
|
|
159
|
+
/**
|
|
160
|
+
* Check if undo is available
|
|
161
|
+
*/
|
|
162
|
+
canUndo(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Check if redo is available
|
|
165
|
+
*/
|
|
166
|
+
canRedo(): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Subscribe to history state changes
|
|
169
|
+
*
|
|
170
|
+
* @param callback - Function to call when history state changes
|
|
171
|
+
* @returns Unsubscribe function
|
|
172
|
+
*/
|
|
173
|
+
subscribe(callback: (state: HistoryState) => void): () => void;
|
|
174
|
+
/**
|
|
175
|
+
* Update the maximum number of history entries
|
|
176
|
+
*
|
|
177
|
+
* @param maxEntries - New maximum number of entries
|
|
178
|
+
*/
|
|
179
|
+
setMaxEntries(maxEntries: number): void;
|
|
180
|
+
/**
|
|
181
|
+
* Internal method to push a state to history
|
|
182
|
+
*/
|
|
183
|
+
private pushInternal;
|
|
184
|
+
/**
|
|
185
|
+
* Trim history to stay within maxEntries limit.
|
|
186
|
+
* A maxEntries of 0 means unlimited (no trimming).
|
|
187
|
+
*/
|
|
188
|
+
private trimHistory;
|
|
189
|
+
/**
|
|
190
|
+
* Create a deep clone of a workflow
|
|
191
|
+
*
|
|
192
|
+
* Uses JSON parse/stringify to properly strip non-serializable values
|
|
193
|
+
* like functions (e.g., onConfigOpen callbacks) that are added to nodes
|
|
194
|
+
* at runtime but shouldn't be persisted in history.
|
|
195
|
+
*/
|
|
196
|
+
private cloneWorkflow;
|
|
197
|
+
/**
|
|
198
|
+
* Notify all subscribers of state changes
|
|
199
|
+
*/
|
|
200
|
+
private notifyChange;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Singleton instance of the history service
|
|
204
|
+
*
|
|
205
|
+
* Use this for the main workflow editor. For isolated instances,
|
|
206
|
+
* create a new HistoryService directly.
|
|
207
|
+
*/
|
|
208
|
+
export declare const historyService: HistoryService;
|