@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,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Provider Types for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides interfaces and implementations for authentication in FlowDrop.
|
|
5
|
+
* AuthProvider is passed at mount time and cannot be changed without remounting.
|
|
6
|
+
*
|
|
7
|
+
* @module types/auth
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Authentication provider interface
|
|
11
|
+
*
|
|
12
|
+
* Defines the contract for authentication providers that can be passed to FlowDrop.
|
|
13
|
+
* Implementations handle token retrieval, authentication state, and error handling.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const authProvider: AuthProvider = {
|
|
18
|
+
* getAuthHeaders: async () => ({ Authorization: "Bearer token123" }),
|
|
19
|
+
* isAuthenticated: () => true
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export interface AuthProvider {
|
|
24
|
+
/**
|
|
25
|
+
* Get current authentication headers
|
|
26
|
+
*
|
|
27
|
+
* Called before every API request to retrieve current auth headers.
|
|
28
|
+
* Should return fresh headers each time (e.g., after token refresh).
|
|
29
|
+
*
|
|
30
|
+
* @returns Promise resolving to a record of header name-value pairs
|
|
31
|
+
*/
|
|
32
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if currently authenticated
|
|
35
|
+
*
|
|
36
|
+
* Used to determine if API requests should be attempted.
|
|
37
|
+
* Should return synchronously for performance.
|
|
38
|
+
*
|
|
39
|
+
* @returns true if authenticated, false otherwise
|
|
40
|
+
*/
|
|
41
|
+
isAuthenticated(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Called when API returns 401 Unauthorized
|
|
44
|
+
*
|
|
45
|
+
* Allows the provider to attempt token refresh or re-authentication.
|
|
46
|
+
* If this returns true, the failed request will be retried with new headers.
|
|
47
|
+
*
|
|
48
|
+
* @returns Promise resolving to true if auth was refreshed and request should retry
|
|
49
|
+
*/
|
|
50
|
+
onUnauthorized?(): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* Called when API returns 403 Forbidden
|
|
53
|
+
*
|
|
54
|
+
* Allows the provider to handle permission errors (e.g., show error UI).
|
|
55
|
+
* Unlike 401, this typically means the user is authenticated but lacks permission.
|
|
56
|
+
*/
|
|
57
|
+
onForbidden?(): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Configuration for static authentication
|
|
61
|
+
*
|
|
62
|
+
* Used to configure StaticAuthProvider with different auth types.
|
|
63
|
+
*/
|
|
64
|
+
export interface StaticAuthConfig {
|
|
65
|
+
/** Authentication type */
|
|
66
|
+
type: 'none' | 'bearer' | 'api_key' | 'custom';
|
|
67
|
+
/** Bearer token (used when type is "bearer") */
|
|
68
|
+
token?: string;
|
|
69
|
+
/** API key (used when type is "api_key") */
|
|
70
|
+
apiKey?: string;
|
|
71
|
+
/** Custom headers (used when type is "custom") */
|
|
72
|
+
headers?: Record<string, string>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Static authentication provider
|
|
76
|
+
*
|
|
77
|
+
* Provides authentication using static credentials configured at instantiation.
|
|
78
|
+
* Suitable for simple use cases where tokens don't change during the session.
|
|
79
|
+
* Also used internally for backward compatibility with existing endpointConfig.auth.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Bearer token authentication
|
|
84
|
+
* const authProvider = new StaticAuthProvider({
|
|
85
|
+
* type: "bearer",
|
|
86
|
+
* token: "your-jwt-token"
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* // API key authentication
|
|
90
|
+
* const authProvider = new StaticAuthProvider({
|
|
91
|
+
* type: "api_key",
|
|
92
|
+
* apiKey: "your-api-key"
|
|
93
|
+
* });
|
|
94
|
+
*
|
|
95
|
+
* // Custom headers
|
|
96
|
+
* const authProvider = new StaticAuthProvider({
|
|
97
|
+
* type: "custom",
|
|
98
|
+
* headers: {
|
|
99
|
+
* "X-Custom-Auth": "value",
|
|
100
|
+
* "X-Tenant-ID": "tenant123"
|
|
101
|
+
* }
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare class StaticAuthProvider implements AuthProvider {
|
|
106
|
+
/** Cached authentication headers */
|
|
107
|
+
private headers;
|
|
108
|
+
/**
|
|
109
|
+
* Create a new StaticAuthProvider
|
|
110
|
+
*
|
|
111
|
+
* @param config - Static authentication configuration
|
|
112
|
+
*/
|
|
113
|
+
constructor(config: StaticAuthConfig);
|
|
114
|
+
/**
|
|
115
|
+
* Get authentication headers
|
|
116
|
+
*
|
|
117
|
+
* Returns the statically configured headers.
|
|
118
|
+
*
|
|
119
|
+
* @returns Promise resolving to authentication headers
|
|
120
|
+
*/
|
|
121
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
122
|
+
/**
|
|
123
|
+
* Check if authenticated
|
|
124
|
+
*
|
|
125
|
+
* Returns true if any auth headers are configured.
|
|
126
|
+
*
|
|
127
|
+
* @returns true if headers are configured
|
|
128
|
+
*/
|
|
129
|
+
isAuthenticated(): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Handle unauthorized response
|
|
132
|
+
*
|
|
133
|
+
* Static provider cannot refresh tokens, so always returns false.
|
|
134
|
+
*
|
|
135
|
+
* @returns Promise resolving to false (cannot refresh)
|
|
136
|
+
*/
|
|
137
|
+
onUnauthorized(): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Handle forbidden response
|
|
140
|
+
*
|
|
141
|
+
* Static provider has no special handling for 403.
|
|
142
|
+
*/
|
|
143
|
+
onForbidden(): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Configuration for callback-based authentication
|
|
147
|
+
*
|
|
148
|
+
* Used to configure CallbackAuthProvider with dynamic token retrieval.
|
|
149
|
+
*/
|
|
150
|
+
export interface CallbackAuthConfig {
|
|
151
|
+
/**
|
|
152
|
+
* Function to get the current access token
|
|
153
|
+
*
|
|
154
|
+
* Called before each API request to get a fresh token.
|
|
155
|
+
* Should return null if not authenticated.
|
|
156
|
+
*/
|
|
157
|
+
getToken: () => Promise<string | null>;
|
|
158
|
+
/**
|
|
159
|
+
* Optional callback when 401 Unauthorized is received
|
|
160
|
+
*
|
|
161
|
+
* Can be used to trigger token refresh.
|
|
162
|
+
*
|
|
163
|
+
* @returns Promise resolving to true if token was refreshed successfully
|
|
164
|
+
*/
|
|
165
|
+
onUnauthorized?: () => Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* Optional callback when 403 Forbidden is received
|
|
168
|
+
*
|
|
169
|
+
* Can be used to show permission error UI.
|
|
170
|
+
*/
|
|
171
|
+
onForbidden?: () => Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Callback-based authentication provider
|
|
175
|
+
*
|
|
176
|
+
* Provides authentication using callback functions for dynamic token retrieval.
|
|
177
|
+
* Ideal for enterprise integrations where the parent application manages auth.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const authProvider = new CallbackAuthProvider({
|
|
182
|
+
* getToken: async () => {
|
|
183
|
+
* return authService.getAccessToken();
|
|
184
|
+
* },
|
|
185
|
+
* onUnauthorized: async () => {
|
|
186
|
+
* const refreshed = await authService.refreshToken();
|
|
187
|
+
* return refreshed;
|
|
188
|
+
* },
|
|
189
|
+
* onForbidden: async () => {
|
|
190
|
+
* showError("You don't have permission to access this resource");
|
|
191
|
+
* }
|
|
192
|
+
* });
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
export declare class CallbackAuthProvider implements AuthProvider {
|
|
196
|
+
/** Function to get the current token */
|
|
197
|
+
private getToken;
|
|
198
|
+
/** Optional unauthorized callback */
|
|
199
|
+
private onUnauthorizedCallback?;
|
|
200
|
+
/** Optional forbidden callback */
|
|
201
|
+
private onForbiddenCallback?;
|
|
202
|
+
/**
|
|
203
|
+
* Create a new CallbackAuthProvider
|
|
204
|
+
*
|
|
205
|
+
* @param config - Callback authentication configuration
|
|
206
|
+
*/
|
|
207
|
+
constructor(config: CallbackAuthConfig);
|
|
208
|
+
/**
|
|
209
|
+
* Get authentication headers
|
|
210
|
+
*
|
|
211
|
+
* Calls the getToken callback to retrieve the current token.
|
|
212
|
+
*
|
|
213
|
+
* @returns Promise resolving to authentication headers
|
|
214
|
+
*/
|
|
215
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
216
|
+
/**
|
|
217
|
+
* Check if authenticated
|
|
218
|
+
*
|
|
219
|
+
* For callback-based auth, we assume authenticated if getToken exists.
|
|
220
|
+
* The actual token validity is checked when making requests.
|
|
221
|
+
*
|
|
222
|
+
* @returns true (assumes authenticated, actual check happens on request)
|
|
223
|
+
*/
|
|
224
|
+
isAuthenticated(): boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Handle unauthorized response
|
|
227
|
+
*
|
|
228
|
+
* Calls the onUnauthorized callback if provided.
|
|
229
|
+
*
|
|
230
|
+
* @returns Promise resolving to true if auth was refreshed
|
|
231
|
+
*/
|
|
232
|
+
onUnauthorized(): Promise<boolean>;
|
|
233
|
+
/**
|
|
234
|
+
* Handle forbidden response
|
|
235
|
+
*
|
|
236
|
+
* Calls the onForbidden callback if provided.
|
|
237
|
+
*/
|
|
238
|
+
onForbidden(): Promise<void>;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* No-op authentication provider
|
|
242
|
+
*
|
|
243
|
+
* Used when no authentication is required.
|
|
244
|
+
* Provides empty headers and always returns not authenticated.
|
|
245
|
+
*/
|
|
246
|
+
export declare class NoAuthProvider implements AuthProvider {
|
|
247
|
+
/**
|
|
248
|
+
* Get authentication headers
|
|
249
|
+
*
|
|
250
|
+
* Returns empty headers (no auth).
|
|
251
|
+
*
|
|
252
|
+
* @returns Promise resolving to empty object
|
|
253
|
+
*/
|
|
254
|
+
getAuthHeaders(): Promise<Record<string, string>>;
|
|
255
|
+
/**
|
|
256
|
+
* Check if authenticated
|
|
257
|
+
*
|
|
258
|
+
* Always returns false (no auth configured).
|
|
259
|
+
*
|
|
260
|
+
* @returns false
|
|
261
|
+
*/
|
|
262
|
+
isAuthenticated(): boolean;
|
|
263
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Provider Types for FlowDrop
|
|
3
|
+
*
|
|
4
|
+
* Provides interfaces and implementations for authentication in FlowDrop.
|
|
5
|
+
* AuthProvider is passed at mount time and cannot be changed without remounting.
|
|
6
|
+
*
|
|
7
|
+
* @module types/auth
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Static authentication provider
|
|
11
|
+
*
|
|
12
|
+
* Provides authentication using static credentials configured at instantiation.
|
|
13
|
+
* Suitable for simple use cases where tokens don't change during the session.
|
|
14
|
+
* Also used internally for backward compatibility with existing endpointConfig.auth.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Bearer token authentication
|
|
19
|
+
* const authProvider = new StaticAuthProvider({
|
|
20
|
+
* type: "bearer",
|
|
21
|
+
* token: "your-jwt-token"
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* // API key authentication
|
|
25
|
+
* const authProvider = new StaticAuthProvider({
|
|
26
|
+
* type: "api_key",
|
|
27
|
+
* apiKey: "your-api-key"
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Custom headers
|
|
31
|
+
* const authProvider = new StaticAuthProvider({
|
|
32
|
+
* type: "custom",
|
|
33
|
+
* headers: {
|
|
34
|
+
* "X-Custom-Auth": "value",
|
|
35
|
+
* "X-Tenant-ID": "tenant123"
|
|
36
|
+
* }
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export class StaticAuthProvider {
|
|
41
|
+
/** Cached authentication headers */
|
|
42
|
+
headers;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new StaticAuthProvider
|
|
45
|
+
*
|
|
46
|
+
* @param config - Static authentication configuration
|
|
47
|
+
*/
|
|
48
|
+
constructor(config) {
|
|
49
|
+
this.headers = {};
|
|
50
|
+
switch (config.type) {
|
|
51
|
+
case 'bearer':
|
|
52
|
+
if (config.token) {
|
|
53
|
+
this.headers['Authorization'] = `Bearer ${config.token}`;
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
case 'api_key':
|
|
57
|
+
if (config.apiKey) {
|
|
58
|
+
this.headers['X-API-Key'] = config.apiKey;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case 'custom':
|
|
62
|
+
if (config.headers) {
|
|
63
|
+
this.headers = { ...config.headers };
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
case 'none':
|
|
67
|
+
default:
|
|
68
|
+
// No headers needed
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get authentication headers
|
|
74
|
+
*
|
|
75
|
+
* Returns the statically configured headers.
|
|
76
|
+
*
|
|
77
|
+
* @returns Promise resolving to authentication headers
|
|
78
|
+
*/
|
|
79
|
+
async getAuthHeaders() {
|
|
80
|
+
return this.headers;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check if authenticated
|
|
84
|
+
*
|
|
85
|
+
* Returns true if any auth headers are configured.
|
|
86
|
+
*
|
|
87
|
+
* @returns true if headers are configured
|
|
88
|
+
*/
|
|
89
|
+
isAuthenticated() {
|
|
90
|
+
return Object.keys(this.headers).length > 0;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Handle unauthorized response
|
|
94
|
+
*
|
|
95
|
+
* Static provider cannot refresh tokens, so always returns false.
|
|
96
|
+
*
|
|
97
|
+
* @returns Promise resolving to false (cannot refresh)
|
|
98
|
+
*/
|
|
99
|
+
async onUnauthorized() {
|
|
100
|
+
// Static provider cannot refresh tokens
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Handle forbidden response
|
|
105
|
+
*
|
|
106
|
+
* Static provider has no special handling for 403.
|
|
107
|
+
*/
|
|
108
|
+
async onForbidden() {
|
|
109
|
+
// No special handling for static provider
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Callback-based authentication provider
|
|
114
|
+
*
|
|
115
|
+
* Provides authentication using callback functions for dynamic token retrieval.
|
|
116
|
+
* Ideal for enterprise integrations where the parent application manages auth.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const authProvider = new CallbackAuthProvider({
|
|
121
|
+
* getToken: async () => {
|
|
122
|
+
* return authService.getAccessToken();
|
|
123
|
+
* },
|
|
124
|
+
* onUnauthorized: async () => {
|
|
125
|
+
* const refreshed = await authService.refreshToken();
|
|
126
|
+
* return refreshed;
|
|
127
|
+
* },
|
|
128
|
+
* onForbidden: async () => {
|
|
129
|
+
* showError("You don't have permission to access this resource");
|
|
130
|
+
* }
|
|
131
|
+
* });
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export class CallbackAuthProvider {
|
|
135
|
+
/** Function to get the current token */
|
|
136
|
+
getToken;
|
|
137
|
+
/** Optional unauthorized callback */
|
|
138
|
+
onUnauthorizedCallback;
|
|
139
|
+
/** Optional forbidden callback */
|
|
140
|
+
onForbiddenCallback;
|
|
141
|
+
/**
|
|
142
|
+
* Create a new CallbackAuthProvider
|
|
143
|
+
*
|
|
144
|
+
* @param config - Callback authentication configuration
|
|
145
|
+
*/
|
|
146
|
+
constructor(config) {
|
|
147
|
+
this.getToken = config.getToken;
|
|
148
|
+
this.onUnauthorizedCallback = config.onUnauthorized;
|
|
149
|
+
this.onForbiddenCallback = config.onForbidden;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get authentication headers
|
|
153
|
+
*
|
|
154
|
+
* Calls the getToken callback to retrieve the current token.
|
|
155
|
+
*
|
|
156
|
+
* @returns Promise resolving to authentication headers
|
|
157
|
+
*/
|
|
158
|
+
async getAuthHeaders() {
|
|
159
|
+
const token = await this.getToken();
|
|
160
|
+
if (token) {
|
|
161
|
+
return { Authorization: `Bearer ${token}` };
|
|
162
|
+
}
|
|
163
|
+
return {};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Check if authenticated
|
|
167
|
+
*
|
|
168
|
+
* For callback-based auth, we assume authenticated if getToken exists.
|
|
169
|
+
* The actual token validity is checked when making requests.
|
|
170
|
+
*
|
|
171
|
+
* @returns true (assumes authenticated, actual check happens on request)
|
|
172
|
+
*/
|
|
173
|
+
isAuthenticated() {
|
|
174
|
+
// For callback-based auth, we assume authenticated if getToken exists
|
|
175
|
+
// The actual token validity is checked when making requests
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Handle unauthorized response
|
|
180
|
+
*
|
|
181
|
+
* Calls the onUnauthorized callback if provided.
|
|
182
|
+
*
|
|
183
|
+
* @returns Promise resolving to true if auth was refreshed
|
|
184
|
+
*/
|
|
185
|
+
async onUnauthorized() {
|
|
186
|
+
if (this.onUnauthorizedCallback) {
|
|
187
|
+
return this.onUnauthorizedCallback();
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Handle forbidden response
|
|
193
|
+
*
|
|
194
|
+
* Calls the onForbidden callback if provided.
|
|
195
|
+
*/
|
|
196
|
+
async onForbidden() {
|
|
197
|
+
if (this.onForbiddenCallback) {
|
|
198
|
+
await this.onForbiddenCallback();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* No-op authentication provider
|
|
204
|
+
*
|
|
205
|
+
* Used when no authentication is required.
|
|
206
|
+
* Provides empty headers and always returns not authenticated.
|
|
207
|
+
*/
|
|
208
|
+
export class NoAuthProvider {
|
|
209
|
+
/**
|
|
210
|
+
* Get authentication headers
|
|
211
|
+
*
|
|
212
|
+
* Returns empty headers (no auth).
|
|
213
|
+
*
|
|
214
|
+
* @returns Promise resolving to empty object
|
|
215
|
+
*/
|
|
216
|
+
async getAuthHeaders() {
|
|
217
|
+
return {};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Check if authenticated
|
|
221
|
+
*
|
|
222
|
+
* Always returns false (no auth configured).
|
|
223
|
+
*
|
|
224
|
+
* @returns false
|
|
225
|
+
*/
|
|
226
|
+
isAuthenticated() {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FlowDrop Editor Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* This module contains configuration-specific types for the workflow editor.
|
|
5
|
+
* For core workflow types (WorkflowNode, WorkflowEdge, etc.), see ./index.ts
|
|
6
|
+
*/
|
|
7
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
8
|
+
import type { PortConfig, NodeMetadata } from './index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Re-export core types from index.ts for convenience
|
|
11
|
+
* This allows consumers to import from either location
|
|
12
|
+
*/
|
|
13
|
+
export type { WorkflowNode, WorkflowEdge, NodePort, ExecutionResult, NodeMetadata } from './index.js';
|
|
14
|
+
export interface WorkflowEditorConfig {
|
|
15
|
+
/** API configuration with endpoints */
|
|
16
|
+
api: APIConfig;
|
|
17
|
+
/** Available node types loaded from API (uses NodeMetadata from index.ts) */
|
|
18
|
+
nodeTypes?: NodeMetadata[];
|
|
19
|
+
/** Port configuration system */
|
|
20
|
+
ports: PortConfig;
|
|
21
|
+
/** Theme configuration */
|
|
22
|
+
theme: 'light' | 'dark' | 'auto';
|
|
23
|
+
/** Editor features configuration */
|
|
24
|
+
features: EditorFeatures;
|
|
25
|
+
/** UI customization options */
|
|
26
|
+
ui: UIConfig;
|
|
27
|
+
/** Execution configuration */
|
|
28
|
+
execution: ExecutionConfig;
|
|
29
|
+
/** Storage configuration */
|
|
30
|
+
storage: StorageConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface EditorFeatures {
|
|
33
|
+
/** Enable drag and drop functionality */
|
|
34
|
+
dragAndDrop: boolean;
|
|
35
|
+
/** Enable node editing */
|
|
36
|
+
nodeEditing: boolean;
|
|
37
|
+
/** Enable workflow execution */
|
|
38
|
+
execution: boolean;
|
|
39
|
+
/** Enable workflow saving */
|
|
40
|
+
saveWorkflow: boolean;
|
|
41
|
+
/** Enable workflow loading */
|
|
42
|
+
loadWorkflow: boolean;
|
|
43
|
+
/** Enable undo/redo */
|
|
44
|
+
undoRedo: boolean;
|
|
45
|
+
/** Enable node search */
|
|
46
|
+
nodeSearch: boolean;
|
|
47
|
+
/** Enable node categories */
|
|
48
|
+
nodeCategories: boolean;
|
|
49
|
+
/** Enable node validation */
|
|
50
|
+
nodeValidation: boolean;
|
|
51
|
+
/** Enable real-time collaboration */
|
|
52
|
+
collaboration: boolean;
|
|
53
|
+
/** Enable workflow templates */
|
|
54
|
+
templates: boolean;
|
|
55
|
+
/** Enable workflow import/export */
|
|
56
|
+
importExport: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface UIConfig {
|
|
59
|
+
/** Show node sidebar */
|
|
60
|
+
showSidebar: boolean;
|
|
61
|
+
/** Show toolbar */
|
|
62
|
+
showToolbar: boolean;
|
|
63
|
+
/** Show minimap */
|
|
64
|
+
showMinimap: boolean;
|
|
65
|
+
/** Show grid */
|
|
66
|
+
showGrid: boolean;
|
|
67
|
+
/** Grid size */
|
|
68
|
+
gridSize: number;
|
|
69
|
+
/** Node spacing */
|
|
70
|
+
nodeSpacing: number;
|
|
71
|
+
/** Canvas padding */
|
|
72
|
+
canvasPadding: number;
|
|
73
|
+
/** Navbar height in pixels (configurable at runtime) */
|
|
74
|
+
navbarHeight: number;
|
|
75
|
+
/** Zoom limits */
|
|
76
|
+
zoom: {
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
default: number;
|
|
80
|
+
};
|
|
81
|
+
/** Node colors */
|
|
82
|
+
colors: {
|
|
83
|
+
primary: string;
|
|
84
|
+
secondary: string;
|
|
85
|
+
accent: string;
|
|
86
|
+
background: string;
|
|
87
|
+
text: string;
|
|
88
|
+
};
|
|
89
|
+
/** Custom CSS classes */
|
|
90
|
+
cssClasses: {
|
|
91
|
+
container?: string;
|
|
92
|
+
sidebar?: string;
|
|
93
|
+
toolbar?: string;
|
|
94
|
+
canvas?: string;
|
|
95
|
+
node?: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export interface APIConfig {
|
|
99
|
+
/** Endpoint configuration */
|
|
100
|
+
endpoints: EndpointConfig;
|
|
101
|
+
/** API timeout in milliseconds */
|
|
102
|
+
timeout: number;
|
|
103
|
+
/** Retry configuration */
|
|
104
|
+
retry: {
|
|
105
|
+
enabled: boolean;
|
|
106
|
+
maxAttempts: number;
|
|
107
|
+
delay: number;
|
|
108
|
+
};
|
|
109
|
+
/** Authentication configuration */
|
|
110
|
+
auth: {
|
|
111
|
+
type: 'none' | 'bearer' | 'api_key' | 'custom';
|
|
112
|
+
token?: string;
|
|
113
|
+
apiKey?: string;
|
|
114
|
+
headers?: Record<string, string>;
|
|
115
|
+
};
|
|
116
|
+
/** Custom headers */
|
|
117
|
+
headers: Record<string, string>;
|
|
118
|
+
}
|
|
119
|
+
export interface ExecutionConfig {
|
|
120
|
+
/** Enable real-time execution updates */
|
|
121
|
+
realTimeUpdates: boolean;
|
|
122
|
+
/** Execution timeout in seconds */
|
|
123
|
+
timeout: number;
|
|
124
|
+
/** Maximum concurrent executions */
|
|
125
|
+
maxConcurrent: number;
|
|
126
|
+
/** Show execution progress */
|
|
127
|
+
showProgress: boolean;
|
|
128
|
+
/** Auto-save execution state */
|
|
129
|
+
autoSaveState: boolean;
|
|
130
|
+
/** Execution result caching */
|
|
131
|
+
caching: {
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
ttl: number;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export interface StorageConfig {
|
|
137
|
+
/** Storage type */
|
|
138
|
+
type: 'api' | 'local' | 'session' | 'custom';
|
|
139
|
+
/** Auto-save interval in milliseconds */
|
|
140
|
+
autoSaveInterval: number;
|
|
141
|
+
/** Maximum undo steps */
|
|
142
|
+
maxUndoSteps: number;
|
|
143
|
+
/** Storage key prefix */
|
|
144
|
+
keyPrefix: string;
|
|
145
|
+
/** Custom storage implementation */
|
|
146
|
+
customStorage?: {
|
|
147
|
+
save: (key: string, data: unknown) => Promise<void>;
|
|
148
|
+
load: (key: string) => Promise<unknown>;
|
|
149
|
+
delete: (key: string) => Promise<void>;
|
|
150
|
+
};
|
|
151
|
+
}
|