windmill-components 1.37.0 → 1.46.2
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/common.d.ts +1 -0
- package/components/AppConnect.svelte +45 -49
- package/components/ArgInfo.svelte +37 -15
- package/components/ArgInput.svelte +33 -34
- package/components/ArgInput.svelte.d.ts +3 -1
- package/components/ButtonAndDropdown.svelte +1 -1
- package/components/CenteredPage.svelte +2 -2
- package/components/CronInput.svelte +24 -20
- package/components/CronInput.svelte.d.ts +1 -0
- package/components/DisplayResult.svelte +2 -2
- package/components/Dropdown.svelte +10 -13
- package/components/Dropdown.svelte.d.ts +4 -1
- package/components/Editor.svelte +27 -3
- package/components/Editor.svelte.d.ts +3 -1
- package/components/EditorBar.svelte +77 -30
- package/components/EditorBar.svelte.d.ts +3 -1
- package/components/FieldHeader.svelte +6 -5
- package/components/FlowBuilder.svelte +52 -55
- package/components/FlowBuilder.svelte.d.ts +2 -0
- package/components/FlowJobResult.svelte +11 -18
- package/components/FlowJobResult.svelte.d.ts +2 -2
- package/components/FlowMetadata.svelte +65 -0
- package/components/FlowMetadata.svelte.d.ts +17 -0
- package/components/FlowModulesViewer.svelte +18 -4
- package/components/FlowPreviewContent.svelte +88 -50
- package/components/FlowPreviewContent.svelte.d.ts +1 -0
- package/components/FlowStatusViewer.svelte +123 -61
- package/components/FlowStatusViewer.svelte.d.ts +8 -3
- package/components/FlowViewer.svelte +84 -9
- package/components/FlowViewer.svelte.d.ts +1 -0
- package/components/GroupModal.svelte +43 -44
- package/components/GroupModal.svelte.d.ts +2 -2
- package/components/HighlightCode.svelte +4 -1
- package/components/HighlightCode.svelte.d.ts +1 -1
- package/components/IconedResourceType.svelte +6 -4
- package/components/IconedResourceType.svelte.d.ts +1 -0
- package/components/InputTransformForm.svelte +38 -27
- package/components/InputTransformsViewer.svelte +2 -1
- package/components/InviteGlobalUser.svelte +6 -10
- package/components/InviteGlobalUser.svelte.d.ts +1 -4
- package/components/InviteUser.svelte +4 -8
- package/components/InviteUser.svelte.d.ts +1 -4
- package/components/ItemPicker.svelte +50 -43
- package/components/ItemPicker.svelte.d.ts +2 -2
- package/components/JobArgs.svelte +33 -0
- package/components/JobArgs.svelte.d.ts +16 -0
- package/components/JobStatus.svelte +21 -17
- package/components/LogViewer.svelte +11 -6
- package/components/Modal.svelte +5 -5
- package/components/Modal.svelte.d.ts +4 -4
- package/components/ModulePreview.svelte +47 -63
- package/components/ModulePreview.svelte.d.ts +0 -1
- package/components/PageHeader.svelte +6 -6
- package/components/Password.svelte +1 -1
- package/components/Path.svelte +28 -7
- package/components/Path.svelte.d.ts +3 -3
- package/components/Popover.svelte +61 -0
- package/components/Popover.svelte.d.ts +17 -0
- package/components/Required.svelte +4 -4
- package/components/Required.svelte.d.ts +1 -0
- package/components/ResourceEditor.svelte +105 -116
- package/components/ResourceEditor.svelte.d.ts +0 -1
- package/components/ResourcePicker.svelte +9 -6
- package/components/ResourceTypePicker.svelte +3 -1
- package/components/RunChart.svelte +102 -0
- package/components/RunChart.svelte.d.ts +20 -0
- package/components/RunForm.svelte +58 -40
- package/components/RunForm.svelte.d.ts +13 -0
- package/components/SchemaEditor.svelte +5 -5
- package/components/SchemaEditorProperty.svelte +1 -1
- package/components/SchemaForm.svelte +3 -1
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/SchemaModal.svelte +113 -105
- package/components/SchemaModal.svelte.d.ts +4 -4
- package/components/SchemaViewer.svelte +7 -4
- package/components/ScriptBuilder.svelte +143 -163
- package/components/ScriptBuilder.svelte.d.ts +1 -0
- package/components/ScriptEditor.svelte +117 -114
- package/components/ScriptEditor.svelte.d.ts +1 -0
- package/components/ScriptPicker.svelte +16 -24
- package/components/ScriptSchema.svelte +33 -32
- package/components/ShareModal.svelte +74 -68
- package/components/ShareModal.svelte.d.ts +2 -2
- package/components/SimpleEditor.svelte +4 -2
- package/components/SuperadminSettings.svelte +134 -0
- package/components/SuperadminSettings.svelte.d.ts +19 -0
- package/components/TableCustom.svelte +1 -1
- package/components/TableSimple.svelte +1 -1
- package/components/TestJobLoader.svelte +14 -6
- package/components/TestJobLoader.svelte.d.ts +4 -2
- package/components/Toggle.svelte +5 -3
- package/components/Toggle.svelte.d.ts +2 -0
- package/components/Tooltip.svelte +9 -64
- package/components/UserSettings.svelte +241 -0
- package/components/UserSettings.svelte.d.ts +19 -0
- package/components/VariableEditor.svelte +80 -74
- package/components/common/actionRow/ActionRow.svelte +5 -4
- package/components/common/alert/Alert.svelte +1 -1
- package/components/common/alert/Alert.svelte.d.ts +1 -0
- package/components/common/badge/Badge.svelte +2 -2
- package/components/common/breadcrumb/Breadcrumb.svelte +24 -0
- package/components/common/breadcrumb/Breadcrumb.svelte.d.ts +22 -0
- package/components/common/button/Button.svelte +20 -8
- package/components/common/button/Button.svelte.d.ts +1 -0
- package/components/common/button/model.d.ts +1 -1
- package/components/common/confirmationModal/ConfirmationModal.svelte +1 -0
- package/components/common/drawer/Drawer.svelte +38 -7
- package/components/common/drawer/Drawer.svelte.d.ts +6 -0
- package/components/common/drawer/DrawerContent.svelte +21 -7
- package/components/common/drawer/DrawerContent.svelte.d.ts +4 -0
- package/components/common/index.d.ts +1 -0
- package/components/common/index.js +1 -0
- package/components/common/kbd/Kbd.svelte +1 -1
- package/components/common/languageIcons/Bash.svelte +18 -0
- package/components/common/languageIcons/Bash.svelte.d.ts +27 -0
- package/components/common/languageIcons/Go.svelte +34 -0
- package/components/common/languageIcons/Go.svelte.d.ts +27 -0
- package/components/common/languageIcons/LanguageIcon.svelte +19 -0
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +21 -0
- package/components/common/languageIcons/Python.svelte +51 -0
- package/components/common/languageIcons/Python.svelte.d.ts +27 -0
- package/components/common/languageIcons/TypeScript.svelte +31 -0
- package/components/common/languageIcons/TypeScript.svelte.d.ts +27 -0
- package/components/common/languageIcons/index.d.ts +5 -0
- package/components/common/languageIcons/index.js +5 -0
- package/components/common/menu/Menu.svelte +15 -19
- package/components/common/skeleton/Skeleton.svelte +1 -2
- package/components/common/skeleton/Skeleton.svelte.d.ts +0 -1
- package/components/common/skeleton/SkeletonElement.svelte +1 -1
- package/components/common/tabs/TabContent.svelte +2 -1
- package/components/common/tabs/TabContent.svelte.d.ts +1 -0
- package/components/common/tabs/Tabs.svelte +8 -6
- package/components/common/tabs/Tabs.svelte.d.ts +1 -0
- package/components/flows/FlowEditor.svelte +11 -20
- package/components/flows/FlowProgressBar.svelte +55 -0
- package/components/flows/FlowProgressBar.svelte.d.ts +21 -0
- package/components/flows/common/FlowCardHeader.svelte +5 -6
- package/components/flows/content/CapturePayload.svelte +112 -0
- package/components/flows/content/CapturePayload.svelte.d.ts +17 -0
- package/components/flows/content/DynamicInputHelpBox.svelte +6 -10
- package/components/flows/content/FlowBranchAllWrapper.svelte +21 -0
- package/components/flows/content/FlowBranchAllWrapper.svelte.d.ts +21 -0
- package/components/flows/content/FlowBranchOneWrapper.svelte +49 -0
- package/components/flows/content/FlowBranchOneWrapper.svelte.d.ts +23 -0
- package/components/flows/content/FlowBranchesWrapper.svelte +140 -0
- package/components/flows/content/FlowBranchesWrapper.svelte.d.ts +19 -0
- package/components/flows/content/FlowEditorPanel.svelte +8 -6
- package/components/flows/content/FlowFailureModule.svelte +4 -6
- package/components/flows/content/FlowInput.svelte +31 -5
- package/components/flows/content/FlowInputs.svelte +119 -50
- package/components/flows/content/FlowInputs.svelte.d.ts +5 -4
- package/components/flows/content/FlowLoop.svelte +85 -142
- package/components/flows/content/FlowLoop.svelte.d.ts +2 -1
- package/components/flows/content/FlowModuleComponent.svelte +231 -0
- package/components/flows/content/FlowModuleComponent.svelte.d.ts +20 -0
- package/components/flows/content/FlowModuleEarlyStop.svelte +45 -48
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleHeader.svelte +11 -40
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +0 -1
- package/components/flows/content/FlowModuleScript.svelte +7 -12
- package/components/flows/content/FlowModuleScript.svelte.d.ts +1 -2
- package/components/flows/content/FlowModuleSuspend.svelte +31 -15
- package/components/flows/content/FlowModuleSuspend.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleWrapper.svelte +138 -38
- package/components/flows/content/FlowModuleWrapper.svelte.d.ts +6 -1
- package/components/flows/content/FlowRetries.svelte +13 -2
- package/components/flows/content/FlowRetries.svelte.d.ts +1 -0
- package/components/flows/content/FlowSchedules.svelte +0 -2
- package/components/flows/content/FlowSettings.svelte +103 -72
- package/components/flows/flowState.d.ts +8 -8
- package/components/flows/flowState.js +32 -17
- package/components/flows/flowStateUtils.d.ts +21 -38
- package/components/flows/flowStateUtils.js +86 -158
- package/components/flows/flowStore.d.ts +3 -2
- package/components/flows/flowStore.js +60 -7
- package/components/flows/header/FlowImportExportMenu.svelte +12 -22
- package/components/flows/header/FlowPreviewButtons.svelte +11 -11
- package/components/flows/map/FlowBranchAllMap.svelte +90 -0
- package/components/flows/map/FlowBranchAllMap.svelte.d.ts +17 -0
- package/components/flows/map/FlowBranchOneMap.svelte +116 -0
- package/components/flows/map/FlowBranchOneMap.svelte.d.ts +17 -0
- package/components/flows/map/FlowErrorHandlerItem.svelte +14 -11
- package/components/flows/map/FlowInputsItem.svelte +19 -0
- package/components/flows/map/FlowInputsItem.svelte.d.ts +14 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +53 -36
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +5 -5
- package/components/flows/map/FlowModuleSchemaMap.svelte +73 -144
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +2 -3
- package/components/flows/map/FlowSettingsItem.svelte +29 -0
- package/components/flows/map/FlowSettingsItem.svelte.d.ts +14 -0
- package/components/flows/map/InsertModuleButton.svelte +11 -0
- package/components/flows/map/InsertModuleButton.svelte.d.ts +16 -0
- package/components/flows/map/MapItem.svelte +105 -0
- package/components/flows/map/MapItem.svelte.d.ts +22 -0
- package/components/flows/pickers/FlowScriptPicker.svelte +14 -4
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/components/flows/pickers/PickHubScript.svelte +5 -4
- package/components/flows/pickers/PickHubScript.svelte.d.ts +1 -0
- package/components/flows/pickers/PickScript.svelte +6 -5
- package/components/flows/pickers/PickScript.svelte.d.ts +1 -0
- package/components/flows/previousResults.d.ts +14 -0
- package/components/flows/previousResults.js +118 -0
- package/components/flows/propPicker/PropPickerWrapper.svelte +22 -15
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +6 -2
- package/components/flows/utils.d.ts +8 -5
- package/components/flows/utils.js +86 -56
- package/components/graph/FlowGraph.svelte +259 -0
- package/components/graph/FlowGraph.svelte.d.ts +20 -0
- package/components/graph/index.d.ts +3 -0
- package/components/graph/index.js +3 -0
- package/components/graph/model.d.ts +20 -0
- package/components/graph/model.js +9 -0
- package/components/graph/util.d.ts +9 -0
- package/components/graph/util.js +14 -0
- package/components/icons/WindmillIcon.svelte +85 -52
- package/components/icons/WindmillIcon.svelte.d.ts +2 -0
- package/components/jobs/JobDetail.svelte +40 -30
- package/components/landing/FlowGettingStarted.svelte +4 -3
- package/components/landing/FlowLandingBox.svelte +23 -53
- package/components/landing/RessourceGettingStarted.svelte +1 -1
- package/components/landing/ScriptBox.svelte +25 -27
- package/components/landing/ScriptGettingStarted.svelte +4 -3
- package/components/preview/FlowPreviewStatus.svelte +1 -1
- package/components/progressBar/ProgressBar.svelte +89 -0
- package/components/{ProgressBar.svelte.d.ts → progressBar/ProgressBar.svelte.d.ts} +5 -2
- package/components/progressBar/ProgressBarGeneralPart.svelte +22 -0
- package/components/progressBar/ProgressBarGeneralPart.svelte.d.ts +19 -0
- package/components/progressBar/ProgressBarLoopAccessor.svelte +14 -0
- package/components/progressBar/ProgressBarLoopAccessor.svelte.d.ts +19 -0
- package/components/progressBar/ProgressBarLoopPart.svelte +34 -0
- package/components/progressBar/ProgressBarLoopPart.svelte.d.ts +19 -0
- package/components/progressBar/index.d.ts +2 -0
- package/components/progressBar/index.js +2 -0
- package/components/progressBar/model.d.ts +32 -0
- package/components/progressBar/model.js +14 -0
- package/components/propertyPicker/ObjectViewer.svelte +18 -13
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
- package/components/propertyPicker/PropPicker.svelte +90 -44
- package/components/propertyPicker/PropPicker.svelte.d.ts +4 -1
- package/components/propertyPicker/PropPickerResult.svelte +12 -0
- package/components/propertyPicker/PropPickerResult.svelte.d.ts +18 -0
- package/components/propertyPicker/utils.d.ts +1 -1
- package/components/propertyPicker/utils.js +4 -1
- package/components/{script_editor → scriptEditor}/LogPanel.svelte +30 -20
- package/components/{script_editor → scriptEditor}/LogPanel.svelte.d.ts +0 -0
- package/components/scripts/CreateActions.svelte +2 -2
- package/components/sidebar/SidebarContent.svelte +1 -1
- package/components/sidebar/UserMenu.svelte +17 -1
- package/components/sidebar/UserMenu.svelte.d.ts +3 -0
- package/components/sidebar/WorkspaceMenu.svelte +16 -14
- package/components/splitPanes/SplitPanesWrapper.svelte +34 -0
- package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +20 -0
- package/editorUtils.js +2 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +8 -1
- package/gen/index.js +5 -0
- package/gen/models/AppWithLastVersion.d.ts +21 -0
- package/gen/models/AppWithLastVersion.js +12 -0
- package/gen/models/BranchAll.d.ts +10 -0
- package/gen/models/{Branches.js → BranchAll.js} +0 -0
- package/gen/models/{Branches.d.ts → BranchOne.d.ts} +3 -5
- package/gen/models/BranchOne.js +4 -0
- package/gen/models/CompletedJob.d.ts +4 -2
- package/gen/models/CompletedJob.js +2 -0
- package/gen/models/FlowModule.d.ts +2 -1
- package/gen/models/FlowModuleValue.d.ts +4 -2
- package/gen/models/FlowStatusModule.d.ts +11 -2
- package/gen/models/ForloopFlow.d.ts +1 -0
- package/gen/models/Identity.d.ts +3 -0
- package/gen/models/Identity.js +4 -0
- package/gen/models/ListableApp.d.ts +16 -0
- package/gen/models/ListableApp.js +12 -0
- package/gen/models/ListableVariable.d.ts +1 -1
- package/gen/models/PathScript.d.ts +2 -0
- package/gen/models/Policy.d.ts +12 -0
- package/gen/models/Policy.js +12 -0
- package/gen/models/Preview.d.ts +2 -1
- package/gen/models/Preview.js +1 -0
- package/gen/models/QueuedJob.d.ts +4 -2
- package/gen/models/QueuedJob.js +2 -0
- package/gen/models/RawScript.d.ts +4 -1
- package/gen/models/RawScript.js +1 -0
- package/gen/models/Script.d.ts +4 -2
- package/gen/models/Script.js +2 -0
- package/gen/services/AppService.d.ts +31 -0
- package/gen/services/AppService.js +49 -0
- package/gen/services/CaptureService.d.ts +30 -0
- package/gen/services/CaptureService.js +52 -0
- package/gen/services/FlowService.d.ts +90 -0
- package/gen/services/FlowService.js +72 -0
- package/gen/services/JobService.d.ts +57 -8
- package/gen/services/JobService.js +78 -10
- package/gen/services/OauthService.d.ts +6 -15
- package/gen/services/OauthService.js +6 -19
- package/gen/services/ResourceService.d.ts +10 -1
- package/gen/services/ResourceService.js +16 -1
- package/gen/services/ScriptService.d.ts +28 -3
- package/gen/services/ScriptService.js +27 -0
- package/gen/services/UserService.d.ts +14 -6
- package/gen/services/UserService.js +25 -11
- package/infer.d.ts +1 -1
- package/infer.js +35 -18
- package/logout.d.ts +1 -1
- package/logout.js +7 -9
- package/package.json +74 -68
- package/script_helpers.d.ts +5 -3
- package/script_helpers.js +42 -12
- package/scripts.js +9 -4
- package/utils.d.ts +8 -9
- package/utils.js +42 -81
- package/components/AutosizedTextarea.svelte +0 -34
- package/components/AutosizedTextarea.svelte.d.ts +0 -19
- package/components/ProgressBar.svelte +0 -31
- package/components/ProgressBarPart.svelte +0 -20
- package/components/ProgressBarPart.svelte.d.ts +0 -20
- package/components/Switch.svelte +0 -61
- package/components/Switch.svelte.d.ts +0 -31
- package/components/flows/content/CopyFirstStepSchema.svelte +0 -13
- package/components/flows/content/CopyFirstStepSchema.svelte.d.ts +0 -14
- package/components/flows/content/FlowLoopWrapper.svelte +0 -9
- package/components/flows/content/FlowLoopWrapper.svelte.d.ts +0 -14
- package/components/flows/content/FlowModule.svelte +0 -217
- package/components/flows/content/FlowModule.svelte.d.ts +0 -29
- package/gen/schemas/$AuditLog.d.ts +0 -32
- package/gen/schemas/$AuditLog.js +0 -35
- package/gen/schemas/$CompletedJob.d.ts +0 -98
- package/gen/schemas/$CompletedJob.js +0 -103
- package/gen/schemas/$ContextualVariable.d.ts +0 -16
- package/gen/schemas/$ContextualVariable.js +0 -19
- package/gen/schemas/$CreateResource.d.ts +0 -22
- package/gen/schemas/$CreateResource.js +0 -25
- package/gen/schemas/$CreateVariable.d.ts +0 -26
- package/gen/schemas/$CreateVariable.js +0 -29
- package/gen/schemas/$CreateWorkspace.d.ts +0 -20
- package/gen/schemas/$CreateWorkspace.js +0 -23
- package/gen/schemas/$EditResource.d.ts +0 -13
- package/gen/schemas/$EditResource.js +0 -16
- package/gen/schemas/$EditResourceType.d.ts +0 -10
- package/gen/schemas/$EditResourceType.js +0 -13
- package/gen/schemas/$EditSchedule.d.ts +0 -20
- package/gen/schemas/$EditSchedule.js +0 -23
- package/gen/schemas/$EditVariable.d.ts +0 -16
- package/gen/schemas/$EditVariable.js +0 -19
- package/gen/schemas/$EditWorkspaceUser.d.ts +0 -7
- package/gen/schemas/$EditWorkspaceUser.js +0 -10
- package/gen/schemas/$Flow.d.ts +0 -23
- package/gen/schemas/$Flow.js +0 -26
- package/gen/schemas/$FlowMetadata.d.ts +0 -31
- package/gen/schemas/$FlowMetadata.js +0 -34
- package/gen/schemas/$FlowPreview.d.ts +0 -80
- package/gen/schemas/$FlowPreview.js +0 -83
- package/gen/schemas/$GlobalUserInfo.d.ts +0 -26
- package/gen/schemas/$GlobalUserInfo.js +0 -29
- package/gen/schemas/$Group.d.ts +0 -23
- package/gen/schemas/$Group.js +0 -26
- package/gen/schemas/$Job.d.ts +0 -17
- package/gen/schemas/$Job.js +0 -20
- package/gen/schemas/$ListableVariable.d.ts +0 -35
- package/gen/schemas/$ListableVariable.js +0 -38
- package/gen/schemas/$Login.d.ts +0 -12
- package/gen/schemas/$Login.js +0 -15
- package/gen/schemas/$MainArgSignature.d.ts +0 -50
- package/gen/schemas/$MainArgSignature.js +0 -53
- package/gen/schemas/$NewSchedule.d.ts +0 -30
- package/gen/schemas/$NewSchedule.js +0 -33
- package/gen/schemas/$NewToken.d.ts +0 -11
- package/gen/schemas/$NewToken.js +0 -14
- package/gen/schemas/$NewUser.d.ts +0 -16
- package/gen/schemas/$NewUser.js +0 -19
- package/gen/schemas/$Preview.d.ts +0 -19
- package/gen/schemas/$Preview.js +0 -22
- package/gen/schemas/$QueuedJob.d.ts +0 -139
- package/gen/schemas/$QueuedJob.js +0 -144
- package/gen/schemas/$Resource.d.ts +0 -31
- package/gen/schemas/$Resource.js +0 -34
- package/gen/schemas/$ResourceType.d.ts +0 -17
- package/gen/schemas/$ResourceType.js +0 -20
- package/gen/schemas/$Schedule.d.ts +0 -47
- package/gen/schemas/$Schedule.js +0 -50
- package/gen/schemas/$Script.d.ts +0 -77
- package/gen/schemas/$Script.js +0 -80
- package/gen/schemas/$ScriptArgs.d.ts +0 -6
- package/gen/schemas/$ScriptArgs.js +0 -9
- package/gen/schemas/$SlackToken.d.ts +0 -24
- package/gen/schemas/$SlackToken.js +0 -27
- package/gen/schemas/$TokenResponse.d.ts +0 -23
- package/gen/schemas/$TokenResponse.js +0 -26
- package/gen/schemas/$TruncatedToken.d.ts +0 -25
- package/gen/schemas/$TruncatedToken.js +0 -28
- package/gen/schemas/$Usage.d.ts +0 -13
- package/gen/schemas/$Usage.js +0 -16
- package/gen/schemas/$User.d.ts +0 -42
- package/gen/schemas/$User.js +0 -45
- package/gen/schemas/$UserWorkspaceList.d.ts +0 -28
- package/gen/schemas/$UserWorkspaceList.js +0 -31
- package/gen/schemas/$WorkerPing.d.ts +0 -31
- package/gen/schemas/$WorkerPing.js +0 -34
- package/gen/schemas/$Workspace.d.ts +0 -19
- package/gen/schemas/$Workspace.js +0 -22
- package/gen/schemas/$WorkspaceInvite.d.ts +0 -16
- package/gen/schemas/$WorkspaceInvite.js +0 -19
|
@@ -7,85 +7,116 @@ import Required from '../../Required.svelte';
|
|
|
7
7
|
import FlowCard from '../common/FlowCard.svelte';
|
|
8
8
|
import FlowSchedules from './FlowSchedules.svelte';
|
|
9
9
|
import SvelteMarkdown from 'svelte-markdown';
|
|
10
|
-
import
|
|
10
|
+
import Toggle from '../../Toggle.svelte';
|
|
11
|
+
import { Alert } from '../../common';
|
|
12
|
+
import { FlowGraph } from '../../graph';
|
|
13
|
+
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
|
11
14
|
export let initialPath;
|
|
12
15
|
export let defaultTab = 'metadata';
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
>
|
|
28
|
-
to share your flow, and <span class="font-mono">user</span> to keep it private.
|
|
29
|
-
<a href="https://docs.windmill.dev/docs/reference/namespaces">docs</a>
|
|
18
|
+
<div class="h-full overflow-hidden">
|
|
19
|
+
<FlowCard title="Settings">
|
|
20
|
+
<div class="h-full flex-1">
|
|
21
|
+
<Splitpanes horizontal>
|
|
22
|
+
<Pane size={50} minSize={20}>
|
|
23
|
+
<div class="max-w-full w-full overflow-hidden h-full">
|
|
24
|
+
{#if $flowStore.value.modules}
|
|
25
|
+
<FlowGraph
|
|
26
|
+
modules={$flowStore.value.modules}
|
|
27
|
+
failureModule={$flowStore.value.failure_module}
|
|
28
|
+
/>
|
|
29
|
+
{/if}
|
|
30
30
|
</div>
|
|
31
|
-
</
|
|
31
|
+
</Pane>
|
|
32
|
+
<Pane size={50} minSize={20}>
|
|
33
|
+
<Tabs selected={defaultTab}>
|
|
34
|
+
<Tab value="metadata">Metadata</Tab>
|
|
35
|
+
<Tab value="schedule">Schedule</Tab>
|
|
36
|
+
<Tab value="same-worker">Same Worker</Tab>
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/>
|
|
42
|
-
</label>
|
|
38
|
+
<svelte:fragment slot="content">
|
|
39
|
+
<TabContent value="metadata" class="p-4">
|
|
40
|
+
<Path
|
|
41
|
+
bind:path={$flowStore.path}
|
|
42
|
+
{initialPath}
|
|
43
|
+
namePlaceholder="my_flow"
|
|
44
|
+
kind="flow"
|
|
45
|
+
/>
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
rounded-md
|
|
55
|
-
border-gray-300
|
|
56
|
-
shadow-sm
|
|
57
|
-
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
58
|
-
"
|
|
59
|
-
placeholder="A description to help users understand what this script does and how to use it."
|
|
60
|
-
rows="3"
|
|
61
|
-
/>
|
|
62
|
-
</span>
|
|
63
|
-
</label>
|
|
47
|
+
<label class="block my-4">
|
|
48
|
+
<span class="text-gray-700 text-sm">Summary <Required required={false} /></span>
|
|
49
|
+
<input
|
|
50
|
+
type="text"
|
|
51
|
+
bind:value={$flowStore.summary}
|
|
52
|
+
placeholder="A very short summary of the flow displayed when the flow is listed"
|
|
53
|
+
rows="1"
|
|
54
|
+
id="flow-summary"
|
|
55
|
+
/>
|
|
56
|
+
</label>
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
<label class="block my-4" for="inp">
|
|
59
|
+
<span class="text-gray-700 text-sm">
|
|
60
|
+
Description
|
|
61
|
+
<Required required={false} detail="markdown" />
|
|
62
|
+
<textarea
|
|
63
|
+
type="text"
|
|
64
|
+
class="text-sm"
|
|
65
|
+
id="inp"
|
|
66
|
+
bind:value={$flowStore.description}
|
|
67
|
+
placeholder="A description to help users understand what this flow does and how to use it. Markdown accepted."
|
|
68
|
+
rows="3"
|
|
69
|
+
/>
|
|
70
|
+
</span>
|
|
71
|
+
</label>
|
|
78
72
|
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
<div>
|
|
74
|
+
<div class="font-bold pb-1 mt-4">Description preview</div>
|
|
75
|
+
{#if $flowStore.description}
|
|
76
|
+
<div
|
|
77
|
+
class="prose max-h-48 mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto"
|
|
78
|
+
>
|
|
79
|
+
<SvelteMarkdown source={$flowStore.description} />
|
|
80
|
+
</div>
|
|
81
|
+
{:else}
|
|
82
|
+
<div class="text-sm text-gray-500">
|
|
83
|
+
Enter a description to see the preview
|
|
84
|
+
</div>
|
|
85
|
+
{/if}
|
|
86
|
+
</div>
|
|
87
|
+
</TabContent>
|
|
88
|
+
<TabContent value="schedule" class="p-4">
|
|
89
|
+
<Alert type="info" title="Primary Schedule">
|
|
90
|
+
Flows can be triggered by any schedules, their webhooks or their UI but they only
|
|
91
|
+
have only one primary schedules with which they share the same path. The primary
|
|
92
|
+
schedule can be set here.
|
|
93
|
+
</Alert>
|
|
94
|
+
<div class="mt-4" />
|
|
95
|
+
<FlowSchedules />
|
|
96
|
+
</TabContent>
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</
|
|
98
|
+
<TabContent value="same-worker" class="p-4 flex flex-col">
|
|
99
|
+
<Alert
|
|
100
|
+
type="info"
|
|
101
|
+
title="Toggle Same Worker to have all steps be ran on the same worker"
|
|
102
|
+
>
|
|
103
|
+
Steps will be run one after the other on the same worker, and will share a folder
|
|
104
|
+
at `/shared` in which they can store heavier data and pass them to the next step. <br
|
|
105
|
+
/><br />Beware that the `/shared` folder is not preserved across suspends and
|
|
106
|
+
sleeps.
|
|
107
|
+
</Alert>
|
|
108
|
+
<span class="my-2 text-sm font-bold">Same Worker</span>
|
|
109
|
+
<Toggle
|
|
110
|
+
bind:checked={$flowStore.value.same_worker}
|
|
111
|
+
options={{
|
|
112
|
+
right: 'Same Worker'
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
</TabContent>
|
|
116
|
+
</svelte:fragment>
|
|
117
|
+
</Tabs>
|
|
118
|
+
</Pane>
|
|
119
|
+
</Splitpanes>
|
|
120
|
+
</div>
|
|
121
|
+
</FlowCard>
|
|
122
|
+
</div>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
|
-
import type { Flow
|
|
2
|
+
import type { Flow } from '../../gen';
|
|
3
3
|
export declare type FlowModuleState = {
|
|
4
4
|
schema: Schema;
|
|
5
|
-
childFlowModules?: FlowModuleState[];
|
|
6
|
-
previewArgs?: any;
|
|
7
5
|
previewResult?: any;
|
|
6
|
+
previewArgs?: any;
|
|
8
7
|
};
|
|
9
|
-
export declare type FlowState =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export declare type FlowState = Record<string, FlowModuleState>;
|
|
9
|
+
/**
|
|
10
|
+
* flowStateStore represents the local state of each module indexed by its id.
|
|
11
|
+
* It contains data loaded that are not contained in a Flow object i.e. schemas.
|
|
12
|
+
* We also hold the data of the results of a test job, ran by the user.
|
|
13
|
+
*/
|
|
13
14
|
export declare const flowStateStore: import("svelte/store").Writable<FlowState>;
|
|
14
15
|
export declare function initFlowState(flow: Flow): Promise<void>;
|
|
15
|
-
export declare function mapFlowModules(flowModules: FlowModule[]): Promise<FlowModuleState[]>;
|
|
@@ -1,31 +1,46 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { loadFlowModuleState } from './flowStateUtils';
|
|
3
|
+
import { emptyFlowModuleState, isEmptyFlowModule } from './utils';
|
|
4
|
+
/**
|
|
5
|
+
* flowStateStore represents the local state of each module indexed by its id.
|
|
6
|
+
* It contains data loaded that are not contained in a Flow object i.e. schemas.
|
|
7
|
+
* We also hold the data of the results of a test job, ran by the user.
|
|
8
|
+
*/
|
|
9
|
+
export const flowStateStore = writable({});
|
|
4
10
|
export async function initFlowState(flow) {
|
|
5
|
-
const
|
|
11
|
+
const modulesState = {};
|
|
12
|
+
await mapFlowModules(flow.value.modules, modulesState);
|
|
6
13
|
const failureModule = flow.value.failure_module
|
|
7
|
-
? await
|
|
14
|
+
? await loadFlowModuleState(flow.value.failure_module)
|
|
8
15
|
: emptyFlowModuleState();
|
|
9
16
|
flowStateStore.set({
|
|
10
|
-
|
|
11
|
-
failureModule
|
|
17
|
+
...modulesState,
|
|
18
|
+
failure: failureModule
|
|
12
19
|
});
|
|
13
20
|
}
|
|
14
|
-
|
|
21
|
+
/**
|
|
22
|
+
* mapFlowModule recursively explore the flow, following deeply nested loop and branches modules
|
|
23
|
+
* to build the initial state.
|
|
24
|
+
*/
|
|
25
|
+
async function mapFlowModule(flowModule, modulesState) {
|
|
15
26
|
const value = flowModule.value;
|
|
16
27
|
if (value.type === 'forloopflow') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
await mapFlowModules(value.modules, modulesState);
|
|
29
|
+
}
|
|
30
|
+
if (value.type === 'branchone') {
|
|
31
|
+
await mapFlowModules(value.default, modulesState);
|
|
32
|
+
}
|
|
33
|
+
if (value.type === 'branchone' || value.type === 'branchall') {
|
|
34
|
+
await Promise.all(value.branches.map((branchModule) => mapFlowModules(branchModule.modules, modulesState)));
|
|
23
35
|
}
|
|
24
36
|
if (isEmptyFlowModule(flowModule)) {
|
|
25
|
-
|
|
37
|
+
modulesState[flowModule.id] = emptyFlowModuleState();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const flowModuleState = await loadFlowModuleState(flowModule);
|
|
41
|
+
modulesState[flowModule.id] = flowModuleState;
|
|
26
42
|
}
|
|
27
|
-
return loadFlowModuleSchema(flowModule);
|
|
28
43
|
}
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
async function mapFlowModules(flowModules, modulesState) {
|
|
45
|
+
await Promise.all(flowModules.map((flowModule) => mapFlowModule(flowModule, modulesState)));
|
|
31
46
|
}
|
|
@@ -1,39 +1,22 @@
|
|
|
1
1
|
import type { Schema } from '../../common';
|
|
2
|
-
import {
|
|
3
|
-
import { type FlowModuleState
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
export declare
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare function createLoop(): Promise<[FlowModule, FlowModuleState]>;
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
declare
|
|
23
|
-
flow_input?: Object;
|
|
24
|
-
previous_result: Result | undefined;
|
|
25
|
-
step?: Result[];
|
|
26
|
-
};
|
|
27
|
-
declare type StepPropPicker = {
|
|
28
|
-
pickableProperties: PickableProperties;
|
|
29
|
-
extraLib: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const NEVER_TESTED_THIS_FAR = "never tested this far";
|
|
32
|
-
export declare function getStepPropPicker(indexes: number[], flowInputSchema: Schema, flowState: FlowState, args: Record<string, any>): StepPropPicker;
|
|
33
|
-
export declare type JobResult = {
|
|
34
|
-
job?: Job;
|
|
35
|
-
innerJobs: JobResult[];
|
|
36
|
-
loopJobs?: JobResult[];
|
|
37
|
-
};
|
|
38
|
-
export declare function mapJobResultsToFlowState(jobs: JobResult, upto: number): void;
|
|
39
|
-
export {};
|
|
2
|
+
import { Script, type FlowModule, type PathScript, type RawScript } from '../../gen';
|
|
3
|
+
import { type FlowModuleState } from './flowState';
|
|
4
|
+
import { Mutex } from 'async-mutex';
|
|
5
|
+
export declare function loadFlowModuleState(flowModule: FlowModule): Promise<FlowModuleState>;
|
|
6
|
+
export declare const idMutex: Mutex;
|
|
7
|
+
export declare function nextId(): string;
|
|
8
|
+
export declare function pickScript(path: string, summary: string, id: string): Promise<[FlowModule & {
|
|
9
|
+
value: PathScript;
|
|
10
|
+
}, FlowModuleState]>;
|
|
11
|
+
export declare function createInlineScriptModule(language: RawScript.language, kind: Script.kind, subkind: 'pgsql' | 'flow', id: string): Promise<[FlowModule, FlowModuleState]>;
|
|
12
|
+
export declare function createLoop(id: string): Promise<[FlowModule, FlowModuleState]>;
|
|
13
|
+
export declare function createBranches(id: string): Promise<[FlowModule, FlowModuleState]>;
|
|
14
|
+
export declare function createBranchAll(id: string): Promise<[FlowModule, FlowModuleState]>;
|
|
15
|
+
export declare function fork(flowModule: FlowModule): Promise<[FlowModule & {
|
|
16
|
+
value: RawScript;
|
|
17
|
+
}, FlowModuleState]>;
|
|
18
|
+
export declare function emptyModule(): FlowModule;
|
|
19
|
+
export declare function createScriptFromInlineScript(flowModule: FlowModule, suffix: string, schema: Schema): Promise<[FlowModule & {
|
|
20
|
+
value: PathScript;
|
|
21
|
+
}, FlowModuleState]>;
|
|
22
|
+
export declare function deleteFlowStateById(id: string): void;
|
|
@@ -1,81 +1,123 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Script, ScriptService } from '../../gen';
|
|
2
2
|
import { initialCode } from '../../script_helpers';
|
|
3
3
|
import { userStore, workspaceStore } from '../../stores';
|
|
4
|
-
import {
|
|
4
|
+
import { getScriptByPath } from '../../utils';
|
|
5
5
|
import { get } from 'svelte/store';
|
|
6
6
|
import { flowStateStore } from './flowState';
|
|
7
7
|
import { flowStore } from './flowStore';
|
|
8
|
-
import { loadSchemaFromModule } from './utils';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
schema: emptySchema()
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export async function loadFlowModuleSchema(flowModule) {
|
|
8
|
+
import { charsToNumber, emptyFlowModuleState, findNextAvailablePath, loadSchemaFromModule, NEVER_TESTED_THIS_FAR, numberToChars } from './utils';
|
|
9
|
+
import { Mutex } from 'async-mutex';
|
|
10
|
+
export async function loadFlowModuleState(flowModule) {
|
|
15
11
|
try {
|
|
16
12
|
const { input_transforms, schema } = await loadSchemaFromModule(flowModule);
|
|
17
|
-
flowModule.
|
|
13
|
+
if (flowModule.value.type == 'script' || flowModule.value.type == 'rawscript') {
|
|
14
|
+
flowModule.value.input_transforms = input_transforms;
|
|
15
|
+
}
|
|
18
16
|
return { schema, previewResult: NEVER_TESTED_THIS_FAR };
|
|
19
17
|
}
|
|
20
18
|
catch (e) {
|
|
21
|
-
|
|
19
|
+
console.error(e);
|
|
20
|
+
return emptyFlowModuleState();
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
export
|
|
23
|
+
export const idMutex = new Mutex();
|
|
24
|
+
// Computes the next available id
|
|
25
|
+
export function nextId() {
|
|
26
|
+
const flowState = get(flowStateStore);
|
|
27
|
+
const max = Object.keys(flowState)
|
|
28
|
+
.reduce((acc, key) => {
|
|
29
|
+
if (key === 'failure' || key.includes('branch') || key.includes('loop')) {
|
|
30
|
+
return acc;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const num = charsToNumber(key);
|
|
34
|
+
return Math.max(acc, num + 1);
|
|
35
|
+
}
|
|
36
|
+
}, 0);
|
|
37
|
+
return numberToChars(max);
|
|
38
|
+
}
|
|
39
|
+
export async function pickScript(path, summary, id) {
|
|
25
40
|
const flowModule = {
|
|
26
|
-
|
|
27
|
-
input_transforms: {}
|
|
41
|
+
id,
|
|
42
|
+
value: { type: 'script', path, input_transforms: {} },
|
|
43
|
+
summary
|
|
28
44
|
};
|
|
29
|
-
return [flowModule, await
|
|
45
|
+
return [flowModule, await loadFlowModuleState(flowModule)];
|
|
30
46
|
}
|
|
31
|
-
export async function createInlineScriptModule(
|
|
47
|
+
export async function createInlineScriptModule(language, kind, subkind, id) {
|
|
32
48
|
const code = initialCode(language, kind, subkind);
|
|
33
49
|
const flowModule = {
|
|
34
|
-
|
|
35
|
-
input_transforms: {}
|
|
50
|
+
id,
|
|
51
|
+
value: { type: 'rawscript', content: code, language, input_transforms: {} }
|
|
36
52
|
};
|
|
37
|
-
return [flowModule, await
|
|
53
|
+
return [flowModule, await loadFlowModuleState(flowModule)];
|
|
38
54
|
}
|
|
39
|
-
export async function createLoop() {
|
|
55
|
+
export async function createLoop(id) {
|
|
40
56
|
const loopFlowModule = {
|
|
57
|
+
id,
|
|
41
58
|
value: {
|
|
42
59
|
type: 'forloopflow',
|
|
43
60
|
modules: [],
|
|
44
|
-
iterator: { type: 'javascript', expr: '
|
|
61
|
+
iterator: { type: 'javascript', expr: '' },
|
|
45
62
|
skip_failures: true
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const flowModuleState = await loadFlowModuleState(loopFlowModule);
|
|
66
|
+
return [loopFlowModule, flowModuleState];
|
|
67
|
+
}
|
|
68
|
+
export async function createBranches(id) {
|
|
69
|
+
const branchesFlowModules = {
|
|
70
|
+
id,
|
|
71
|
+
value: {
|
|
72
|
+
type: 'branchone',
|
|
73
|
+
branches: [],
|
|
74
|
+
default: []
|
|
46
75
|
},
|
|
47
|
-
|
|
76
|
+
summary: ''
|
|
48
77
|
};
|
|
49
|
-
const
|
|
50
|
-
return [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
const flowModuleState = await loadFlowModuleState(branchesFlowModules);
|
|
79
|
+
return [branchesFlowModules, flowModuleState];
|
|
80
|
+
}
|
|
81
|
+
export async function createBranchAll(id) {
|
|
82
|
+
const branchesFlowModules = {
|
|
83
|
+
id,
|
|
84
|
+
value: {
|
|
85
|
+
type: 'branchall',
|
|
86
|
+
branches: []
|
|
87
|
+
},
|
|
88
|
+
summary: ''
|
|
89
|
+
};
|
|
90
|
+
const flowModuleState = await loadFlowModuleState(branchesFlowModules);
|
|
91
|
+
return [branchesFlowModules, flowModuleState];
|
|
58
92
|
}
|
|
59
93
|
export async function fork(flowModule) {
|
|
60
94
|
if (flowModule.value.type !== 'script') {
|
|
61
95
|
throw new Error('Can only fork a script module');
|
|
62
96
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
97
|
+
const forkedFlowModule = await createInlineScriptModuleFromPath(flowModule.value.path ?? '', flowModule.id);
|
|
98
|
+
const flowModuleState = await loadFlowModuleState(forkedFlowModule);
|
|
99
|
+
return [forkedFlowModule, flowModuleState];
|
|
65
100
|
}
|
|
66
|
-
|
|
101
|
+
async function createInlineScriptModuleFromPath(path, id) {
|
|
67
102
|
const { content, language } = await getScriptByPath(path);
|
|
68
103
|
return {
|
|
104
|
+
id,
|
|
69
105
|
value: {
|
|
70
106
|
type: 'rawscript',
|
|
71
107
|
language: language,
|
|
72
108
|
content: content,
|
|
73
|
-
path
|
|
74
|
-
|
|
75
|
-
|
|
109
|
+
path,
|
|
110
|
+
input_transforms: {}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function emptyModule() {
|
|
115
|
+
return {
|
|
116
|
+
id: nextId(),
|
|
117
|
+
value: { type: 'identity' }
|
|
76
118
|
};
|
|
77
119
|
}
|
|
78
|
-
export async function createScriptFromInlineScript(
|
|
120
|
+
export async function createScriptFromInlineScript(flowModule, suffix, schema) {
|
|
79
121
|
const flow = get(flowStore);
|
|
80
122
|
const user = get(userStore);
|
|
81
123
|
if (flowModule.value.type != 'rawscript') {
|
|
@@ -95,7 +137,7 @@ export async function createScriptFromInlineScript({ flowModule, suffix, schema
|
|
|
95
137
|
workspace: get(workspaceStore),
|
|
96
138
|
requestBody: {
|
|
97
139
|
path: availablePath,
|
|
98
|
-
summary: '',
|
|
140
|
+
summary: flowModule.summary ?? '',
|
|
99
141
|
description,
|
|
100
142
|
content: flowModule.value.content,
|
|
101
143
|
parent_hash: undefined,
|
|
@@ -104,125 +146,11 @@ export async function createScriptFromInlineScript({ flowModule, suffix, schema
|
|
|
104
146
|
language: flowModule.value.language
|
|
105
147
|
}
|
|
106
148
|
});
|
|
107
|
-
return pickScript(availablePath);
|
|
149
|
+
return pickScript(availablePath, flowModule.summary ?? '', flowModule.id);
|
|
108
150
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
path
|
|
114
|
-
});
|
|
115
|
-
const [_, version] = path.split(/.*_([0-9]*)/);
|
|
116
|
-
if (version.length > 0) {
|
|
117
|
-
path = path.slice(0, -(version.length + 1));
|
|
118
|
-
}
|
|
119
|
-
path = `${path}_${Number(version) + 1}`;
|
|
120
|
-
return findNextAvailablePath(path);
|
|
121
|
-
}
|
|
122
|
-
catch (e) {
|
|
123
|
-
// Catching an error means the path is available
|
|
124
|
-
return path;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
export function isEmptyFlowModule(flowModule) {
|
|
128
|
-
return flowModule.value.type === 'script' && flowModule.value.path === '';
|
|
129
|
-
}
|
|
130
|
-
export const NEVER_TESTED_THIS_FAR = 'never tested this far';
|
|
131
|
-
export function getStepPropPicker(indexes, flowInputSchema, flowState, args) {
|
|
132
|
-
const [parentIndex, childIndex] = indexes;
|
|
133
|
-
const isInsideLoop = childIndex !== undefined;
|
|
134
|
-
const flowInput = schemaToObject(flowInputSchema, args);
|
|
135
|
-
const results = getPreviousResults(flowState.modules, parentIndex);
|
|
136
|
-
const lastResult = parentIndex == 0
|
|
137
|
-
? flowInput
|
|
138
|
-
: results.length > 0
|
|
139
|
-
? results[results.length - 1]
|
|
140
|
-
: NEVER_TESTED_THIS_FAR;
|
|
141
|
-
if (isInsideLoop) {
|
|
142
|
-
let forLoopFlowInput = {
|
|
143
|
-
...flowInput,
|
|
144
|
-
iter: {
|
|
145
|
-
value: "Iteration's value",
|
|
146
|
-
index: "Iteration's index"
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
if (flowState.modules[parentIndex]?.previewArgs) {
|
|
150
|
-
forLoopFlowInput = flowState.modules[parentIndex]?.previewArgs;
|
|
151
|
-
}
|
|
152
|
-
const innerResults = getPreviousResults(flowState.modules[parentIndex]?.childFlowModules, childIndex);
|
|
153
|
-
const innerLastResult = childIndex == 0
|
|
154
|
-
? forLoopFlowInput
|
|
155
|
-
: innerResults.length > 0
|
|
156
|
-
? innerResults[innerResults.length - 1]
|
|
157
|
-
: NEVER_TESTED_THIS_FAR;
|
|
158
|
-
const extraLib = buildExtraLib(objectToTsType(forLoopFlowInput), objectToTsType(innerLastResult));
|
|
159
|
-
return {
|
|
160
|
-
extraLib,
|
|
161
|
-
pickableProperties: {
|
|
162
|
-
flow_input: forLoopFlowInput,
|
|
163
|
-
previous_result: innerLastResult,
|
|
164
|
-
step: innerResults
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
const extraLib = buildExtraLib(schemaToTsType(flowInputSchema), objectToTsType(lastResult));
|
|
170
|
-
return {
|
|
171
|
-
extraLib,
|
|
172
|
-
pickableProperties: {
|
|
173
|
-
flow_input: flowInput,
|
|
174
|
-
previous_result: lastResult,
|
|
175
|
-
step: results
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function getPreviousResults(flowModuleSchemas, target) {
|
|
181
|
-
if (!Array.isArray(flowModuleSchemas) || target < 1) {
|
|
182
|
-
return [];
|
|
183
|
-
}
|
|
184
|
-
const results = extractPreviewResults(flowModuleSchemas);
|
|
185
|
-
return results.splice(0, target);
|
|
186
|
-
}
|
|
187
|
-
function extractPreviewResults(flowModuleSchemas) {
|
|
188
|
-
return flowModuleSchemas.map((fms) => fms.previewResult);
|
|
189
|
-
}
|
|
190
|
-
function getResult(job) {
|
|
191
|
-
if (job && 'result' in job) {
|
|
192
|
-
return job.result;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
export function mapJobResultsToFlowState(jobs, upto) {
|
|
196
|
-
const results = jobs.innerJobs.map(({ job, loopJobs }) => {
|
|
197
|
-
if (loopJobs && loopJobs.length > 0) {
|
|
198
|
-
return [
|
|
199
|
-
job?.args,
|
|
200
|
-
loopJobs.map(({ job }) => {
|
|
201
|
-
return getResult(job);
|
|
202
|
-
})
|
|
203
|
-
];
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
return [job?.args, getResult(job)];
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
const old = get(flowStateStore);
|
|
210
|
-
const modules = old.modules.map((flowModuleState, index) => {
|
|
211
|
-
if (results[index] && index <= upto) {
|
|
212
|
-
if (results[index][1] != NEVER_TESTED_THIS_FAR ||
|
|
213
|
-
flowModuleState.previewResult == undefined) {
|
|
214
|
-
flowModuleState.previewArgs = results[index][0];
|
|
215
|
-
flowModuleState.previewResult = results[index][1];
|
|
216
|
-
flowModuleState.childFlowModules?.map((innerMod, j) => {
|
|
217
|
-
const lastLoopJob = jobs.innerJobs[index].loopJobs?.length ?? 0;
|
|
218
|
-
innerMod.previewResult = getResult(jobs.innerJobs[index].loopJobs?.[lastLoopJob - 1]?.innerJobs?.[j]?.job);
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return flowModuleState;
|
|
223
|
-
});
|
|
224
|
-
flowStateStore.set({
|
|
225
|
-
modules,
|
|
226
|
-
failureModule: old.failureModule
|
|
151
|
+
export function deleteFlowStateById(id) {
|
|
152
|
+
flowStateStore.update((fss) => {
|
|
153
|
+
delete fss[id];
|
|
154
|
+
return fss;
|
|
227
155
|
});
|
|
228
156
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Flow } from '../../gen';
|
|
1
|
+
import type { Flow, FlowModule } from '../../gen';
|
|
2
2
|
export declare type FlowMode = 'push' | 'pull';
|
|
3
3
|
export declare const flowStore: import("svelte/store").Writable<Flow>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function dfs(modules: FlowModule[]): string[];
|
|
5
|
+
export declare function initFlow(flow: Flow): Promise<void>;
|
|
5
6
|
export declare function copyFirstStepSchema(): Promise<void>;
|