@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,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interrupt State Machine
|
|
3
|
+
*
|
|
4
|
+
* Lightweight state machine pattern for interrupt handling.
|
|
5
|
+
* Ensures valid state transitions and prevents deadlocks.
|
|
6
|
+
*
|
|
7
|
+
* State Diagram:
|
|
8
|
+
* ```
|
|
9
|
+
* ┌─────────────┐
|
|
10
|
+
* │ idle │
|
|
11
|
+
* └──────┬──────┘
|
|
12
|
+
* │
|
|
13
|
+
* ┌──────────────┼──────────────┐
|
|
14
|
+
* │ submit │ cancel │
|
|
15
|
+
* ▼ │ ▼
|
|
16
|
+
* ┌─────────────┐ │ ┌─────────────┐
|
|
17
|
+
* │ submitting │ │ │ cancelled │
|
|
18
|
+
* └──────┬──────┘ │ └─────────────┘
|
|
19
|
+
* │ │
|
|
20
|
+
* ┌──────┴──────┐ │
|
|
21
|
+
* │ │ │
|
|
22
|
+
* ▼ success ▼ fail │
|
|
23
|
+
* ┌─────────┐ ┌─────────┐ │
|
|
24
|
+
* │resolved │ │ error │──┘ cancel
|
|
25
|
+
* └─────────┘ └────┬────┘
|
|
26
|
+
* │ retry
|
|
27
|
+
* ▼
|
|
28
|
+
* ┌─────────────┐
|
|
29
|
+
* │ submitting │
|
|
30
|
+
* └─────────────┘
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @module types/interruptState
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Idle state - waiting for user action
|
|
37
|
+
*/
|
|
38
|
+
export interface IdleState {
|
|
39
|
+
readonly status: 'idle';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Submitting state - API call in progress
|
|
43
|
+
*/
|
|
44
|
+
export interface SubmittingState {
|
|
45
|
+
readonly status: 'submitting';
|
|
46
|
+
/** The value being submitted */
|
|
47
|
+
readonly pendingValue: unknown;
|
|
48
|
+
/** Whether this is a cancel operation */
|
|
49
|
+
readonly isCancelAction: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolved state - successfully completed
|
|
53
|
+
*/
|
|
54
|
+
export interface ResolvedState {
|
|
55
|
+
readonly status: 'resolved';
|
|
56
|
+
/** The submitted value */
|
|
57
|
+
readonly value: unknown;
|
|
58
|
+
/** Timestamp when resolved */
|
|
59
|
+
readonly resolvedAt: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Cancelled state - user cancelled
|
|
63
|
+
*/
|
|
64
|
+
export interface CancelledState {
|
|
65
|
+
readonly status: 'cancelled';
|
|
66
|
+
/** Timestamp when cancelled */
|
|
67
|
+
readonly cancelledAt: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Error state - submission failed, can retry
|
|
71
|
+
*/
|
|
72
|
+
export interface ErrorState {
|
|
73
|
+
readonly status: 'error';
|
|
74
|
+
/** The error message */
|
|
75
|
+
readonly error: string;
|
|
76
|
+
/** The value that failed to submit (for retry) */
|
|
77
|
+
readonly failedValue?: unknown;
|
|
78
|
+
/** Whether the failed action was a cancel */
|
|
79
|
+
readonly wasCancelAction: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Union of all possible interrupt states
|
|
83
|
+
*/
|
|
84
|
+
export type InterruptState = IdleState | SubmittingState | ResolvedState | CancelledState | ErrorState;
|
|
85
|
+
/**
|
|
86
|
+
* Submit action - user submits a value
|
|
87
|
+
*/
|
|
88
|
+
export interface SubmitAction {
|
|
89
|
+
readonly type: 'SUBMIT';
|
|
90
|
+
readonly value: unknown;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Cancel action - user cancels the interrupt
|
|
94
|
+
*/
|
|
95
|
+
export interface CancelAction {
|
|
96
|
+
readonly type: 'CANCEL';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Success action - API call succeeded
|
|
100
|
+
*/
|
|
101
|
+
export interface SuccessAction {
|
|
102
|
+
readonly type: 'SUCCESS';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Failure action - API call failed
|
|
106
|
+
*/
|
|
107
|
+
export interface FailureAction {
|
|
108
|
+
readonly type: 'FAILURE';
|
|
109
|
+
readonly error: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Retry action - retry after error
|
|
113
|
+
*/
|
|
114
|
+
export interface RetryAction {
|
|
115
|
+
readonly type: 'RETRY';
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Reset action - reset to idle state
|
|
119
|
+
*/
|
|
120
|
+
export interface ResetAction {
|
|
121
|
+
readonly type: 'RESET';
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Union of all possible actions
|
|
125
|
+
*/
|
|
126
|
+
export type InterruptAction = SubmitAction | CancelAction | SuccessAction | FailureAction | RetryAction | ResetAction;
|
|
127
|
+
/**
|
|
128
|
+
* Result of a state transition
|
|
129
|
+
*/
|
|
130
|
+
export interface TransitionResult {
|
|
131
|
+
/** The new state after transition */
|
|
132
|
+
state: InterruptState;
|
|
133
|
+
/** Whether the transition was valid */
|
|
134
|
+
valid: boolean;
|
|
135
|
+
/** Error message if transition was invalid */
|
|
136
|
+
error?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Initial idle state
|
|
140
|
+
*/
|
|
141
|
+
export declare const initialState: IdleState;
|
|
142
|
+
/**
|
|
143
|
+
* Transition function for the interrupt state machine
|
|
144
|
+
*
|
|
145
|
+
* @param state - Current state
|
|
146
|
+
* @param action - Action to apply
|
|
147
|
+
* @returns New state after transition
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* let state = initialState;
|
|
152
|
+
*
|
|
153
|
+
* // User submits
|
|
154
|
+
* const result1 = transition(state, { type: "SUBMIT", value: true });
|
|
155
|
+
* if (result1.valid) state = result1.state;
|
|
156
|
+
*
|
|
157
|
+
* // API succeeds
|
|
158
|
+
* const result2 = transition(state, { type: "SUCCESS" });
|
|
159
|
+
* if (result2.valid) state = result2.state;
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export declare function transition(state: InterruptState, action: InterruptAction): TransitionResult;
|
|
163
|
+
/**
|
|
164
|
+
* Check if the interrupt is in a terminal state (resolved or cancelled)
|
|
165
|
+
*
|
|
166
|
+
* @param state - The interrupt state
|
|
167
|
+
* @returns True if the interrupt is finished
|
|
168
|
+
*/
|
|
169
|
+
export declare function isTerminalState(state: InterruptState): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Check if the interrupt is currently submitting
|
|
172
|
+
*
|
|
173
|
+
* @param state - The interrupt state
|
|
174
|
+
* @returns True if submitting
|
|
175
|
+
*/
|
|
176
|
+
export declare function isSubmitting(state: InterruptState): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Check if the interrupt has an error
|
|
179
|
+
*
|
|
180
|
+
* @param state - The interrupt state
|
|
181
|
+
* @returns True if in error state
|
|
182
|
+
*/
|
|
183
|
+
export declare function hasError(state: InterruptState): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Check if the interrupt can accept user input
|
|
186
|
+
*
|
|
187
|
+
* @param state - The interrupt state
|
|
188
|
+
* @returns True if idle or error (can submit)
|
|
189
|
+
*/
|
|
190
|
+
export declare function canSubmit(state: InterruptState): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Get the error message if in error state
|
|
193
|
+
*
|
|
194
|
+
* @param state - The interrupt state
|
|
195
|
+
* @returns Error message or undefined
|
|
196
|
+
*/
|
|
197
|
+
export declare function getErrorMessage(state: InterruptState): string | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Get the resolved value if in resolved state
|
|
200
|
+
*
|
|
201
|
+
* @param state - The interrupt state
|
|
202
|
+
* @returns Resolved value or undefined
|
|
203
|
+
*/
|
|
204
|
+
export declare function getResolvedValue(state: InterruptState): unknown;
|
|
205
|
+
/**
|
|
206
|
+
* Map InterruptState status to legacy InterruptStatus for backward compatibility
|
|
207
|
+
*
|
|
208
|
+
* @param state - The interrupt state
|
|
209
|
+
* @returns Legacy status string
|
|
210
|
+
*/
|
|
211
|
+
export declare function toLegacyStatus(state: InterruptState): 'pending' | 'resolved' | 'cancelled' | 'expired';
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interrupt State Machine
|
|
3
|
+
*
|
|
4
|
+
* Lightweight state machine pattern for interrupt handling.
|
|
5
|
+
* Ensures valid state transitions and prevents deadlocks.
|
|
6
|
+
*
|
|
7
|
+
* State Diagram:
|
|
8
|
+
* ```
|
|
9
|
+
* ┌─────────────┐
|
|
10
|
+
* │ idle │
|
|
11
|
+
* └──────┬──────┘
|
|
12
|
+
* │
|
|
13
|
+
* ┌──────────────┼──────────────┐
|
|
14
|
+
* │ submit │ cancel │
|
|
15
|
+
* ▼ │ ▼
|
|
16
|
+
* ┌─────────────┐ │ ┌─────────────┐
|
|
17
|
+
* │ submitting │ │ │ cancelled │
|
|
18
|
+
* └──────┬──────┘ │ └─────────────┘
|
|
19
|
+
* │ │
|
|
20
|
+
* ┌──────┴──────┐ │
|
|
21
|
+
* │ │ │
|
|
22
|
+
* ▼ success ▼ fail │
|
|
23
|
+
* ┌─────────┐ ┌─────────┐ │
|
|
24
|
+
* │resolved │ │ error │──┘ cancel
|
|
25
|
+
* └─────────┘ └────┬────┘
|
|
26
|
+
* │ retry
|
|
27
|
+
* ▼
|
|
28
|
+
* ┌─────────────┐
|
|
29
|
+
* │ submitting │
|
|
30
|
+
* └─────────────┘
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @module types/interruptState
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Initial idle state
|
|
37
|
+
*/
|
|
38
|
+
export const initialState = { status: 'idle' };
|
|
39
|
+
/**
|
|
40
|
+
* Transition function for the interrupt state machine
|
|
41
|
+
*
|
|
42
|
+
* @param state - Current state
|
|
43
|
+
* @param action - Action to apply
|
|
44
|
+
* @returns New state after transition
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* let state = initialState;
|
|
49
|
+
*
|
|
50
|
+
* // User submits
|
|
51
|
+
* const result1 = transition(state, { type: "SUBMIT", value: true });
|
|
52
|
+
* if (result1.valid) state = result1.state;
|
|
53
|
+
*
|
|
54
|
+
* // API succeeds
|
|
55
|
+
* const result2 = transition(state, { type: "SUCCESS" });
|
|
56
|
+
* if (result2.valid) state = result2.state;
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export function transition(state, action) {
|
|
60
|
+
switch (state.status) {
|
|
61
|
+
case 'idle':
|
|
62
|
+
return transitionFromIdle(state, action);
|
|
63
|
+
case 'submitting':
|
|
64
|
+
return transitionFromSubmitting(state, action);
|
|
65
|
+
case 'error':
|
|
66
|
+
return transitionFromError(state, action);
|
|
67
|
+
case 'resolved':
|
|
68
|
+
return transitionFromResolved(state, action);
|
|
69
|
+
case 'cancelled':
|
|
70
|
+
return transitionFromCancelled(state, action);
|
|
71
|
+
default:
|
|
72
|
+
return {
|
|
73
|
+
state,
|
|
74
|
+
valid: false,
|
|
75
|
+
error: `Unknown state: ${state.status}`
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Transitions from idle state
|
|
81
|
+
*/
|
|
82
|
+
function transitionFromIdle(_state, action) {
|
|
83
|
+
switch (action.type) {
|
|
84
|
+
case 'SUBMIT':
|
|
85
|
+
return {
|
|
86
|
+
state: {
|
|
87
|
+
status: 'submitting',
|
|
88
|
+
pendingValue: action.value,
|
|
89
|
+
isCancelAction: false
|
|
90
|
+
},
|
|
91
|
+
valid: true
|
|
92
|
+
};
|
|
93
|
+
case 'CANCEL':
|
|
94
|
+
return {
|
|
95
|
+
state: {
|
|
96
|
+
status: 'submitting',
|
|
97
|
+
pendingValue: undefined,
|
|
98
|
+
isCancelAction: true
|
|
99
|
+
},
|
|
100
|
+
valid: true
|
|
101
|
+
};
|
|
102
|
+
case 'RESET':
|
|
103
|
+
return { state: initialState, valid: true };
|
|
104
|
+
default:
|
|
105
|
+
return {
|
|
106
|
+
state: _state,
|
|
107
|
+
valid: false,
|
|
108
|
+
error: `Cannot ${action.type} from idle state`
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Transitions from submitting state
|
|
114
|
+
*/
|
|
115
|
+
function transitionFromSubmitting(state, action) {
|
|
116
|
+
switch (action.type) {
|
|
117
|
+
case 'SUCCESS':
|
|
118
|
+
if (state.isCancelAction) {
|
|
119
|
+
return {
|
|
120
|
+
state: {
|
|
121
|
+
status: 'cancelled',
|
|
122
|
+
cancelledAt: new Date().toISOString()
|
|
123
|
+
},
|
|
124
|
+
valid: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
state: {
|
|
129
|
+
status: 'resolved',
|
|
130
|
+
value: state.pendingValue,
|
|
131
|
+
resolvedAt: new Date().toISOString()
|
|
132
|
+
},
|
|
133
|
+
valid: true
|
|
134
|
+
};
|
|
135
|
+
case 'FAILURE':
|
|
136
|
+
return {
|
|
137
|
+
state: {
|
|
138
|
+
status: 'error',
|
|
139
|
+
error: action.error,
|
|
140
|
+
failedValue: state.pendingValue,
|
|
141
|
+
wasCancelAction: state.isCancelAction
|
|
142
|
+
},
|
|
143
|
+
valid: true
|
|
144
|
+
};
|
|
145
|
+
case 'RESET':
|
|
146
|
+
return { state: initialState, valid: true };
|
|
147
|
+
// Prevent double-submit
|
|
148
|
+
case 'SUBMIT':
|
|
149
|
+
case 'CANCEL':
|
|
150
|
+
return {
|
|
151
|
+
state,
|
|
152
|
+
valid: false,
|
|
153
|
+
error: 'Cannot submit/cancel while already submitting'
|
|
154
|
+
};
|
|
155
|
+
default:
|
|
156
|
+
return {
|
|
157
|
+
state,
|
|
158
|
+
valid: false,
|
|
159
|
+
error: `Cannot ${action.type} from submitting state`
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Transitions from error state
|
|
165
|
+
*/
|
|
166
|
+
function transitionFromError(state, action) {
|
|
167
|
+
switch (action.type) {
|
|
168
|
+
case 'RETRY':
|
|
169
|
+
return {
|
|
170
|
+
state: {
|
|
171
|
+
status: 'submitting',
|
|
172
|
+
pendingValue: state.failedValue,
|
|
173
|
+
isCancelAction: state.wasCancelAction
|
|
174
|
+
},
|
|
175
|
+
valid: true
|
|
176
|
+
};
|
|
177
|
+
case 'SUBMIT':
|
|
178
|
+
// Allow resubmitting with new value
|
|
179
|
+
return {
|
|
180
|
+
state: {
|
|
181
|
+
status: 'submitting',
|
|
182
|
+
pendingValue: action.value,
|
|
183
|
+
isCancelAction: false
|
|
184
|
+
},
|
|
185
|
+
valid: true
|
|
186
|
+
};
|
|
187
|
+
case 'CANCEL':
|
|
188
|
+
return {
|
|
189
|
+
state: {
|
|
190
|
+
status: 'submitting',
|
|
191
|
+
pendingValue: undefined,
|
|
192
|
+
isCancelAction: true
|
|
193
|
+
},
|
|
194
|
+
valid: true
|
|
195
|
+
};
|
|
196
|
+
case 'RESET':
|
|
197
|
+
return { state: initialState, valid: true };
|
|
198
|
+
default:
|
|
199
|
+
return {
|
|
200
|
+
state,
|
|
201
|
+
valid: false,
|
|
202
|
+
error: `Cannot ${action.type} from error state`
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Transitions from resolved state (terminal - only reset allowed)
|
|
208
|
+
*/
|
|
209
|
+
function transitionFromResolved(state, action) {
|
|
210
|
+
if (action.type === 'RESET') {
|
|
211
|
+
return { state: initialState, valid: true };
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
state,
|
|
215
|
+
valid: false,
|
|
216
|
+
error: `Cannot ${action.type} from resolved state - interrupt already completed`
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Transitions from cancelled state (terminal - only reset allowed)
|
|
221
|
+
*/
|
|
222
|
+
function transitionFromCancelled(state, action) {
|
|
223
|
+
if (action.type === 'RESET') {
|
|
224
|
+
return { state: initialState, valid: true };
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
state,
|
|
228
|
+
valid: false,
|
|
229
|
+
error: `Cannot ${action.type} from cancelled state - interrupt already cancelled`
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
// =========================================================================
|
|
233
|
+
// Helper Functions
|
|
234
|
+
// =========================================================================
|
|
235
|
+
/**
|
|
236
|
+
* Check if the interrupt is in a terminal state (resolved or cancelled)
|
|
237
|
+
*
|
|
238
|
+
* @param state - The interrupt state
|
|
239
|
+
* @returns True if the interrupt is finished
|
|
240
|
+
*/
|
|
241
|
+
export function isTerminalState(state) {
|
|
242
|
+
return state.status === 'resolved' || state.status === 'cancelled';
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Check if the interrupt is currently submitting
|
|
246
|
+
*
|
|
247
|
+
* @param state - The interrupt state
|
|
248
|
+
* @returns True if submitting
|
|
249
|
+
*/
|
|
250
|
+
export function isSubmitting(state) {
|
|
251
|
+
return state.status === 'submitting';
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Check if the interrupt has an error
|
|
255
|
+
*
|
|
256
|
+
* @param state - The interrupt state
|
|
257
|
+
* @returns True if in error state
|
|
258
|
+
*/
|
|
259
|
+
export function hasError(state) {
|
|
260
|
+
return state.status === 'error';
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Check if the interrupt can accept user input
|
|
264
|
+
*
|
|
265
|
+
* @param state - The interrupt state
|
|
266
|
+
* @returns True if idle or error (can submit)
|
|
267
|
+
*/
|
|
268
|
+
export function canSubmit(state) {
|
|
269
|
+
return state.status === 'idle' || state.status === 'error';
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get the error message if in error state
|
|
273
|
+
*
|
|
274
|
+
* @param state - The interrupt state
|
|
275
|
+
* @returns Error message or undefined
|
|
276
|
+
*/
|
|
277
|
+
export function getErrorMessage(state) {
|
|
278
|
+
return state.status === 'error' ? state.error : undefined;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Get the resolved value if in resolved state
|
|
282
|
+
*
|
|
283
|
+
* @param state - The interrupt state
|
|
284
|
+
* @returns Resolved value or undefined
|
|
285
|
+
*/
|
|
286
|
+
export function getResolvedValue(state) {
|
|
287
|
+
return state.status === 'resolved' ? state.value : undefined;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Map InterruptState status to legacy InterruptStatus for backward compatibility
|
|
291
|
+
*
|
|
292
|
+
* @param state - The interrupt state
|
|
293
|
+
* @returns Legacy status string
|
|
294
|
+
*/
|
|
295
|
+
export function toLegacyStatus(state) {
|
|
296
|
+
switch (state.status) {
|
|
297
|
+
case 'idle':
|
|
298
|
+
case 'submitting':
|
|
299
|
+
case 'error':
|
|
300
|
+
return 'pending';
|
|
301
|
+
case 'resolved':
|
|
302
|
+
return 'resolved';
|
|
303
|
+
case 'cancelled':
|
|
304
|
+
return 'cancelled';
|
|
305
|
+
default:
|
|
306
|
+
return 'pending';
|
|
307
|
+
}
|
|
308
|
+
}
|