windmill-components 1.52.0 → 1.55.1
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/components/ApiConnectForm.svelte +42 -7
- package/components/ApiConnectForm.svelte.d.ts +2 -1
- package/components/AppConnect.svelte +19 -11
- package/components/ArgInfo.svelte +6 -2
- package/components/ArgInput.svelte +9 -3
- package/components/ArgInput.svelte.d.ts +1 -0
- package/components/CenteredPage.svelte +1 -1
- package/components/CenteredPage.svelte.d.ts +6 -2
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +39 -2
- package/components/Dropdown.svelte +73 -100
- package/components/Dropdown.svelte.d.ts +1 -3
- package/components/Editor.svelte +16 -5
- package/components/EditorBar.svelte +69 -63
- package/components/EditorBar.svelte.d.ts +1 -0
- package/components/FlowBuilder.svelte +74 -68
- package/components/FlowGraphViewer.svelte +136 -34
- package/components/FlowGraphViewer.svelte.d.ts +1 -0
- package/components/FlowJobResult.svelte +6 -1
- package/components/FlowJobResult.svelte.d.ts +2 -0
- package/components/FlowMetadata.svelte +4 -2
- package/components/FlowPreviewContent.svelte +10 -23
- package/components/FlowPreviewContent.svelte.d.ts +3 -0
- package/components/FlowStatusViewer.svelte +155 -30
- package/components/FlowStatusViewer.svelte.d.ts +4 -2
- package/components/FlowViewer.svelte +5 -5
- package/components/FlowViewer.svelte.d.ts +1 -0
- package/components/HighlightCode.svelte +1 -1
- package/components/HighlightCode.svelte.d.ts +1 -0
- package/components/IconedPath.svelte +16 -6
- package/components/IconedPath.svelte.d.ts +2 -0
- package/components/IconedResourceType.svelte +5 -2
- package/components/InputTransformForm.svelte +92 -73
- package/components/InviteGlobalUser.svelte +2 -2
- package/components/InviteGlobalUser.svelte.d.ts +1 -1
- package/components/InviteUser.svelte +20 -6
- package/components/InviteUser.svelte.d.ts +1 -1
- package/components/ItemPicker.svelte +38 -27
- package/components/ItemPicker.svelte.d.ts +2 -1
- package/components/JobStatus.svelte +19 -13
- package/components/LogViewer.svelte +11 -3
- package/components/LogViewer.svelte.d.ts +1 -0
- package/components/ModuleStatus.svelte +38 -0
- package/components/ModuleStatus.svelte.d.ts +18 -0
- package/components/ObjectResourceInput.svelte +8 -52
- package/components/ObjectResourceInput.svelte.d.ts +0 -1
- package/components/Path.svelte +2 -2
- package/components/Path.svelte.d.ts +1 -1
- package/components/Popover.svelte +7 -1
- package/components/Popover.svelte.d.ts +3 -1
- package/components/ResourceEditor.svelte +57 -29
- package/components/ResourcePicker.svelte +12 -2
- package/components/RunForm.svelte +1 -1
- package/components/SchemaEditor.svelte +2 -1
- package/components/SchemaForm.svelte +2 -1
- package/components/SchemaForm.svelte.d.ts +1 -0
- package/components/SchemaModal.svelte +11 -10
- package/components/ScriptBuilder.svelte +207 -192
- package/components/ScriptBuilder.svelte.d.ts +1 -1
- package/components/ScriptEditor.svelte +49 -45
- package/components/ScriptEditor.svelte.d.ts +1 -0
- package/components/ScriptPicker.svelte.d.ts +1 -1
- package/components/ScriptSchema.svelte +11 -30
- package/components/ScriptSchema.svelte.d.ts +0 -1
- package/components/SharedBadge.svelte +2 -3
- package/components/SimpleEditor.svelte +6 -7
- package/components/SimpleEditor.svelte.d.ts +1 -0
- package/components/Star.svelte +2 -2
- package/components/SuperadminSettings.svelte +9 -38
- package/components/TableSimple.svelte +1 -1
- package/components/TestJobLoader.svelte +20 -8
- package/components/ToggleHubWorkspace.svelte +16 -0
- package/components/ToggleHubWorkspace.svelte.d.ts +16 -0
- package/components/Tooltip.svelte.d.ts +1 -1
- package/components/VariableEditor.svelte +22 -9
- package/components/apps/CreateApp.svelte +5 -2
- package/components/apps/CreateApp.svelte.d.ts +1 -1
- package/components/apps/components/DisplayComponent.svelte +7 -14
- package/components/apps/components/DisplayComponent.svelte.d.ts +3 -2
- package/components/apps/components/buttons/AppButton.svelte +34 -27
- package/components/apps/components/buttons/AppButton.svelte.d.ts +6 -6
- package/components/apps/components/dataDisplay/AppBarChart.svelte +33 -9
- package/components/apps/components/dataDisplay/AppBarChart.svelte.d.ts +3 -5
- package/components/apps/components/dataDisplay/AppPieChart.svelte +33 -12
- package/components/apps/components/dataDisplay/AppPieChart.svelte.d.ts +3 -5
- package/components/apps/components/dataDisplay/AppTable.svelte +27 -30
- package/components/apps/components/dataDisplay/AppTable.svelte.d.ts +4 -8
- package/components/apps/components/dataDisplay/AppText.svelte +16 -9
- package/components/apps/components/dataDisplay/AppText.svelte.d.ts +3 -2
- package/components/apps/components/dataDisplay/app.md +49 -0
- package/components/apps/components/form/AppForm.svelte +50 -0
- package/components/apps/components/form/AppForm.svelte.d.ts +25 -0
- package/components/apps/components/helpers/AlignWrapper.svelte +2 -1
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +1 -0
- package/components/apps/components/helpers/DebouncedInput.svelte +9 -1
- package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +2 -1
- package/components/apps/components/helpers/InputValue.svelte +15 -6
- package/components/apps/components/helpers/InputValue.svelte.d.ts +2 -2
- package/components/apps/components/helpers/NonRunnableComponent.svelte +20 -0
- package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +21 -0
- package/components/apps/components/helpers/RunnableComponent.svelte +36 -30
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +6 -7
- package/components/apps/components/helpers/RunnableWrapper.svelte +32 -0
- package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +26 -0
- package/components/apps/components/numberInputs/AppNumberInput.svelte +36 -0
- package/components/apps/components/numberInputs/AppNumberInput.svelte.d.ts +20 -0
- package/components/apps/components/selectInputs/AppCheckbox.svelte +4 -2
- package/components/apps/components/selectInputs/AppCheckbox.svelte.d.ts +2 -2
- package/components/apps/components/textInputs/AppTextInput.svelte +21 -0
- package/components/apps/components/textInputs/AppTextInput.svelte.d.ts +20 -0
- package/components/apps/editor/AppEditor.svelte +66 -55
- package/components/apps/editor/AppEditorHeader.svelte +4 -4
- package/components/apps/editor/AppPreview.svelte +42 -0
- package/components/apps/editor/AppPreview.svelte.d.ts +17 -0
- package/components/apps/editor/ComponentEditor.svelte +41 -20
- package/components/apps/editor/ComponentEditor.svelte.d.ts +2 -0
- package/components/apps/editor/ComponentHeader.svelte +28 -0
- package/components/apps/editor/ComponentHeader.svelte.d.ts +20 -0
- package/components/apps/editor/GridEditor.svelte +54 -5
- package/components/apps/editor/GridEditor.svelte.d.ts +1 -1
- package/components/apps/editor/RecomputeAllComponents.svelte +28 -0
- package/components/apps/editor/RecomputeAllComponents.svelte.d.ts +14 -0
- package/components/apps/editor/componentsPanel/ComponentList.svelte +94 -26
- package/components/apps/editor/componentsPanel/ComponentList.svelte.d.ts +1 -1
- package/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +2 -6
- package/components/apps/editor/componentsPanel/componentDefaultProps.js +1 -5
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +2 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.js +3 -1
- package/components/apps/editor/componentsPanel/data.js +191 -76
- package/components/apps/editor/contextPanel/ContextPanel.svelte +56 -48
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +67 -0
- package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +55 -0
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte +154 -129
- package/components/apps/editor/settingsPanel/ConnectedInputEditor.svelte +70 -0
- package/components/apps/editor/settingsPanel/ConnectedInputEditor.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +6 -6
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +2 -2
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +55 -87
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +3 -4
- package/components/apps/editor/settingsPanel/PickFlow.svelte +3 -2
- package/components/apps/editor/settingsPanel/PickFlow.svelte.d.ts +1 -1
- package/components/apps/editor/settingsPanel/PickInlineScript.svelte +3 -3
- package/components/apps/editor/settingsPanel/Recompute.svelte +46 -0
- package/components/apps/editor/settingsPanel/Recompute.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/StaticInputEditor.svelte +31 -14
- package/components/apps/editor/settingsPanel/StaticInputEditor.svelte.d.ts +3 -3
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +17 -0
- package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/TableActionLabel.svelte +10 -0
- package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +17 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte +13 -9
- package/components/apps/editor/settingsPanel/UserInputEditor.svelte.d.ts +1 -1
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +3 -2
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +1 -0
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +53 -0
- package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte.d.ts +21 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +98 -0
- package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +81 -0
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte.d.ts +20 -0
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte +81 -0
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte.d.ts +20 -0
- package/components/apps/inputType.d.ts +62 -0
- package/components/apps/inputType.js +1 -0
- package/components/apps/rx.d.ts +4 -4
- package/components/apps/rx.js +16 -4
- package/components/apps/types.d.ts +20 -54
- package/components/apps/utils.d.ts +11 -34
- package/components/apps/utils.js +54 -18
- package/components/common/alert/Alert.svelte +2 -1
- package/components/common/alert/Alert.svelte.d.ts +1 -0
- package/components/common/button/Button.svelte +1 -1
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +1 -1
- package/components/common/drawer/DrawerContent.svelte +23 -22
- package/components/common/drawer/DrawerContent.svelte.d.ts +1 -3
- package/components/common/kbd/Kbd.svelte.d.ts +2 -2
- package/components/common/languageIcons/LanguageIcon.svelte +4 -2
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +1 -1
- package/components/common/menu/Menu.svelte +0 -1
- package/components/common/menu/MenuItem.svelte.d.ts +6 -2
- package/components/common/popup/Popup.svelte +0 -13
- package/components/common/popup/Popup.svelte.d.ts +0 -4
- package/components/common/table/AppRow.svelte +42 -26
- package/components/common/table/AppRow.svelte.d.ts +1 -1
- package/components/common/table/FlowRow.svelte +54 -49
- package/components/common/table/LanguageBadge.svelte +1 -1
- package/components/common/table/Row.svelte +27 -16
- package/components/common/table/Row.svelte.d.ts +2 -1
- package/components/common/table/RowIcon.svelte +13 -8
- package/components/common/table/ScriptRow.svelte +65 -57
- package/components/common/table/Table.svelte.d.ts +6 -2
- package/components/flows/CreateActionsFlow.svelte +14 -41
- package/components/flows/CreateActionsFlow.svelte.d.ts +1 -1
- package/components/flows/common/FlowCardHeader.svelte +7 -8
- package/components/flows/content/BranchPredicateEditor.svelte +30 -0
- package/components/flows/content/BranchPredicateEditor.svelte.d.ts +23 -0
- package/components/flows/content/CapturePayload.svelte +12 -8
- package/components/flows/content/DynamicInputHelpBox.svelte.d.ts +1 -1
- package/components/flows/content/FlowBranchAllWrapper.svelte +2 -2
- package/components/flows/content/FlowBranchOneWrapper.svelte +4 -36
- package/components/flows/content/FlowBranchesAllWrapper.svelte +91 -0
- package/components/flows/content/FlowBranchesAllWrapper.svelte.d.ts +18 -0
- package/components/flows/content/FlowBranchesOneWrapper.svelte +88 -0
- package/components/flows/content/FlowBranchesOneWrapper.svelte.d.ts +18 -0
- package/components/flows/content/FlowFailureModule.svelte.d.ts +1 -1
- package/components/flows/content/FlowInput.svelte +1 -2
- package/components/flows/content/FlowInput.svelte.d.ts +1 -1
- package/components/flows/content/FlowInputs.svelte +28 -26
- package/components/flows/content/FlowInputsFlow.svelte +101 -0
- package/components/flows/content/FlowInputsFlow.svelte.d.ts +20 -0
- package/components/flows/content/FlowLoop.svelte +10 -3
- package/components/flows/content/FlowModuleComponent.svelte +46 -35
- package/components/flows/content/FlowModuleEarlyStop.svelte +4 -3
- package/components/flows/content/FlowModuleHeader.svelte +22 -21
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +1 -0
- package/components/flows/content/FlowModuleSleep.svelte +69 -0
- package/components/flows/content/FlowModuleSleep.svelte.d.ts +18 -0
- package/components/flows/content/FlowModuleSuspend.svelte +5 -63
- package/components/flows/content/FlowModuleSuspend.svelte.d.ts +0 -1
- package/components/flows/content/FlowModuleWrapper.svelte +59 -35
- package/components/flows/content/FlowPathViewer.svelte +20 -0
- package/components/flows/content/FlowPathViewer.svelte.d.ts +17 -0
- package/components/flows/content/FlowSchedules.svelte.d.ts +1 -1
- package/components/flows/content/FlowSettings.svelte +11 -13
- package/components/flows/flowState.js +2 -2
- package/components/flows/flowStateUtils.d.ts +7 -3
- package/components/flows/flowStateUtils.js +29 -8
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +1 -1
- package/components/flows/header/FlowPreviewButtons.svelte +17 -11
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +1 -1
- package/components/flows/map/FlowErrorHandlerItem.svelte +5 -5
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +1 -1
- package/components/flows/map/FlowInputsItem.svelte.d.ts +1 -1
- package/components/flows/map/FlowModuleSchemaItem.svelte +30 -11
- package/components/flows/map/FlowModuleSchemaMap.svelte +26 -20
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +1 -1
- package/components/flows/map/FlowSettingsItem.svelte +1 -1
- package/components/flows/map/FlowSettingsItem.svelte.d.ts +1 -1
- package/components/flows/map/InsertModuleButton.svelte +20 -4
- package/components/flows/map/InsertModuleButton.svelte.d.ts +1 -1
- package/components/flows/map/MapItem.svelte +11 -5
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +1 -1
- package/components/flows/pickers/PickHubFlow.svelte +72 -0
- package/components/flows/pickers/PickHubFlow.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +65 -56
- package/components/flows/pickers/PickHubScript.svelte.d.ts +3 -1
- package/components/flows/pickers/PickScript.svelte +2 -2
- package/components/flows/pickers/WorkspaceScriptPicker.svelte +79 -19
- package/components/flows/pickers/WorkspaceScriptPicker.svelte.d.ts +5 -1
- package/components/flows/previousResults.d.ts +1 -0
- package/components/flows/previousResults.js +2 -1
- package/components/flows/propPicker/PropPickerWrapper.svelte +9 -1
- package/components/flows/utils.d.ts +0 -1
- package/components/flows/utils.js +6 -6
- package/components/graph/FlowGraph.svelte +121 -55
- package/components/graph/FlowGraph.svelte.d.ts +3 -2
- package/components/graph/model.d.ts +46 -1
- package/components/home/ItemsList.svelte +265 -0
- package/components/home/ItemsList.svelte.d.ts +16 -0
- package/components/home/ListFilters.svelte +37 -0
- package/components/home/ListFilters.svelte.d.ts +18 -0
- package/components/home/NoItemFound.svelte +6 -0
- package/components/home/NoItemFound.svelte.d.ts +23 -0
- package/components/icons/DatadogIcon.svelte +48 -0
- package/components/icons/DatadogIcon.svelte.d.ts +17 -0
- package/components/icons/FunkwhaleIcon.svelte +90 -0
- package/components/icons/FunkwhaleIcon.svelte.d.ts +17 -0
- package/components/icons/GdocsIcon.svelte +9 -0
- package/components/icons/GdocsIcon.svelte.d.ts +17 -0
- package/components/icons/HubspotIcon.svelte +9 -0
- package/components/icons/HubspotIcon.svelte.d.ts +17 -0
- package/components/icons/LinkedinIcon.svelte +9 -0
- package/components/icons/LinkedinIcon.svelte.d.ts +17 -0
- package/components/icons/Mail.svelte +9 -53
- package/components/icons/Mysql.svelte +8 -8
- package/components/icons/NextcloudIcon.svelte +9 -0
- package/components/icons/NextcloudIcon.svelte.d.ts +17 -0
- package/components/icons/QRCodeIcon.svelte +5 -0
- package/components/icons/QRCodeIcon.svelte.d.ts +16 -0
- package/components/icons/SendflakeIcon.svelte +15 -0
- package/components/icons/SendflakeIcon.svelte.d.ts +17 -0
- package/components/icons/StripeIcon.svelte +9 -0
- package/components/icons/StripeIcon.svelte.d.ts +17 -0
- package/components/icons/TelegramIcon.svelte +9 -0
- package/components/icons/TelegramIcon.svelte.d.ts +17 -0
- package/components/icons/WindmillIcon.svelte +3 -3
- package/components/icons/index.d.ts +23 -1
- package/components/icons/index.js +23 -1
- package/components/jobs/JobDetail.svelte +2 -2
- package/components/preview/FlowPreviewStatus.svelte +12 -23
- package/components/propertyPicker/PropPicker.svelte +16 -0
- package/components/propertyPicker/PropPickerResult.svelte +2 -3
- package/components/propertyPicker/WarningMessage.svelte.d.ts +6 -2
- package/components/scriptEditor/LogPanel.svelte +11 -4
- package/components/scripts/CreateActionsScript.svelte +13 -59
- package/components/scripts/CreateActionsScript.svelte.d.ts +1 -1
- package/components/sidebar/FavoriteMenu.svelte +52 -0
- package/components/sidebar/FavoriteMenu.svelte.d.ts +21 -0
- package/components/sidebar/SidebarContent.svelte +10 -19
- package/components/sidebar/SidebarContent.svelte.d.ts +0 -4
- package/components/sidebar/UserMenu.svelte +21 -4
- package/components/sidebar/WorkspaceMenu.svelte +6 -7
- package/editorUtils.d.ts +2 -0
- package/editorUtils.js +3 -1
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +1 -0
- package/gen/models/CompletedJob.d.ts +1 -0
- package/gen/models/CreateWorkspace.d.ts +0 -1
- package/gen/models/EditWorkspaceUser.d.ts +2 -0
- package/gen/models/FlowModuleValue.d.ts +2 -1
- package/gen/models/FlowStatus.d.ts +3 -1
- package/gen/models/FlowStatusModule.d.ts +1 -1
- package/gen/models/FlowStatusModule.js +1 -1
- package/gen/models/Identity.d.ts +1 -0
- package/gen/models/ListableResource.d.ts +1 -0
- package/gen/models/ListableVariable.d.ts +1 -0
- package/gen/models/PathFlow.d.ts +6 -0
- package/gen/models/PathFlow.js +4 -0
- package/gen/models/PathScript.d.ts +1 -0
- package/gen/models/QueuedJob.d.ts +1 -0
- package/gen/models/Schedule.d.ts +2 -0
- package/gen/models/Usage.d.ts +1 -3
- package/gen/models/WorkspaceInvite.d.ts +1 -0
- package/gen/services/AppService.d.ts +7 -1
- package/gen/services/AppService.js +2 -1
- package/gen/services/JobService.d.ts +35 -5
- package/gen/services/JobService.js +14 -5
- package/gen/services/OauthService.d.ts +1 -1
- package/gen/services/ResourceService.d.ts +6 -2
- package/gen/services/ResourceService.js +2 -1
- package/gen/services/UserService.d.ts +6 -0
- package/gen/services/UserService.js +11 -0
- package/gen/services/WorkspaceService.d.ts +35 -0
- package/gen/services/WorkspaceService.js +41 -0
- package/package.json +461 -422
- package/script_helpers.d.ts +2 -1
- package/script_helpers.js +20 -3
- package/scripts.d.ts +1 -0
- package/scripts.js +8 -1
- package/stores.d.ts +11 -2
- package/stores.js +24 -6
- package/utils.d.ts +3 -1
- package/utils.js +11 -4
- package/components/ButtonAndDropdown.svelte +0 -25
- package/components/ButtonAndDropdown.svelte.d.ts +0 -23
- package/components/apps/components/index.d.ts +0 -22
- package/components/apps/components/index.js +0 -42
- package/components/apps/editor/settingsPanel/DynamicInputEditor.svelte +0 -64
- package/components/apps/editor/settingsPanel/DynamicInputEditor.svelte.d.ts +0 -17
- package/components/flows/content/FlowBranchesWrapper.svelte +0 -140
- package/components/flows/content/FlowBranchesWrapper.svelte.d.ts +0 -19
package/script_helpers.d.ts
CHANGED
|
@@ -8,10 +8,11 @@ export declare const DENO_FAILURE_MODULE_CODE = "\n// connect the error paramete
|
|
|
8
8
|
export declare const PYTHON_INIT_CODE_CLEAR = "#import wmill\n\ndef main(x: str):\n return x\n";
|
|
9
9
|
export declare const PYTHON_FAILURE_MODULE_CODE = "import os\n\n# connect the error parameter to 'previous_result.error'\n\ndef main(error: str):\n job = os.environ.get(\"WM_JOB_ID\")\n print(\"error\", error)\n print(\"job\", job)\n return error, job\n";
|
|
10
10
|
export declare const POSTGRES_INIT_CODE: string;
|
|
11
|
+
export declare const MYSQL_INIT_CODE: string;
|
|
11
12
|
export declare const BASH_INIT_CODE = "\n# arguments of the form X=\"$I\" are parsed as parameters X of type string\nmsg=\"$1\"\n\n# the last line of the stdout is the return value\necho \"Hello $msg\"\n";
|
|
12
13
|
export declare const DENO_INIT_CODE_TRIGGER: string;
|
|
13
14
|
export declare const PYTHON_INIT_CODE_TRIGGER = "import wmill\n\ndef main():\n # A common trigger script would follow this pattern:\n # 1. Get the last saved state\n # const state = wnmill.get_state()\n # 2. Get the actual state from the external service\n # const newState = ...\n # 3. Compare the two states and update the internal state\n # wmill.setState(newState)\n # 4. Return the new rows\n # return range from (state to newState)\n return [1, 2, 3]\n";
|
|
14
15
|
export declare const GO_INIT_CODE_TRIGGER = "package inner\n\nimport (\n\twmill \"github.com/windmill-labs/windmill-go-client\"\n)\n\nfunc main() (interface{}, error) {\n\n\t// A common trigger script would follow this pattern:\n\t// 1. Get the last saved state\n\tstate, _ := wmill.GetState()\n\t// 2. Get the actual state from the external service\n\t// newState := ...\n\t// 3. Compare the two states and update the internal state\n\twmill.SetState(4)\n\t// 4. Return the new rows\n\n\treturn state, nil\n\n\t// In subsequent scripts, you may refer to each row/value returned by the trigger script using\n\t// 'flow_input.iter.value'\n}\n";
|
|
15
16
|
export declare const DENO_INIT_CODE_APPROVAL = "import * as wmill from \"https://deno.land/x/windmill@v1.41.0/mod.ts\"\n\nexport async function main(approver?: string) {\n return wmill.getResumeEndpoints(approver)\n}";
|
|
16
17
|
export declare function isInitialCode(content: string): boolean;
|
|
17
|
-
export declare function initialCode(language: 'deno' | 'python3' | 'go' | 'bash', kind: Script.kind, subkind: 'pgsql' | 'flow' | 'script' | undefined): string;
|
|
18
|
+
export declare function initialCode(language: 'deno' | 'python3' | 'go' | 'bash', kind: Script.kind, subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | undefined): string;
|
package/script_helpers.js
CHANGED
|
@@ -40,10 +40,8 @@ def main(no_default: str,
|
|
|
40
40
|
# the return value is then parsed and can be retrieved by other scripts conveniently
|
|
41
41
|
return {"splitted": name.split(), "user": user, "state": new_state}
|
|
42
42
|
`;
|
|
43
|
-
export const DENO_INIT_CODE = `//
|
|
44
|
-
// (Ctrl+space to cache dependencies on imports hover, Ctrl+S to autoformat and parse parameters).
|
|
43
|
+
export const DENO_INIT_CODE = `// Ctrl+space to cache dependencies on imports hover, Ctrl+S to format.
|
|
45
44
|
|
|
46
|
-
// you can use npm imports directly
|
|
47
45
|
// import { toWords } from "npm:number-to-words@1"
|
|
48
46
|
// import * as wmill from "https://deno.land/x/windmill@v${__pkg__.version}/mod.ts"
|
|
49
47
|
|
|
@@ -138,6 +136,22 @@ export async function main(
|
|
|
138
136
|
)\`INSERT INTO demo VALUES (\${key}, \${value}) RETURNING *\`;
|
|
139
137
|
return query.rows;
|
|
140
138
|
}`;
|
|
139
|
+
export const MYSQL_INIT_CODE = `import {
|
|
140
|
+
mySql,
|
|
141
|
+
type Resource
|
|
142
|
+
} from "https://deno.land/x/windmill@v${__pkg__.version}/mod.ts";
|
|
143
|
+
|
|
144
|
+
// MySQL parameterized statement. No SQL injection is possible.
|
|
145
|
+
export async function main(
|
|
146
|
+
db: Resource<"mysql">,
|
|
147
|
+
key: number,
|
|
148
|
+
value: string,
|
|
149
|
+
) {
|
|
150
|
+
const query = await mySql(
|
|
151
|
+
db
|
|
152
|
+
)\`INSERT INTO demo VALUES (\${key}, \${value})\`;
|
|
153
|
+
return query.rows;
|
|
154
|
+
}`;
|
|
141
155
|
export const BASH_INIT_CODE = `
|
|
142
156
|
# arguments of the form X="$I" are parsed as parameters X of type string
|
|
143
157
|
msg="$1"
|
|
@@ -228,6 +242,9 @@ export function initialCode(language, kind, subkind) {
|
|
|
228
242
|
else if (subkind === 'pgsql') {
|
|
229
243
|
return POSTGRES_INIT_CODE;
|
|
230
244
|
}
|
|
245
|
+
else if (subkind === 'mysql') {
|
|
246
|
+
return MYSQL_INIT_CODE;
|
|
247
|
+
}
|
|
231
248
|
else {
|
|
232
249
|
return DENO_INIT_CODE;
|
|
233
250
|
}
|
package/scripts.d.ts
CHANGED
package/scripts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { get } from 'svelte/store';
|
|
2
|
-
import { ScriptService } from './gen';
|
|
2
|
+
import { FlowService, ScriptService } from './gen';
|
|
3
3
|
import { inferArgs } from './infer';
|
|
4
4
|
import { workspaceStore } from './stores';
|
|
5
5
|
import { emptySchema } from './utils';
|
|
@@ -23,3 +23,10 @@ export async function loadSchema(path) {
|
|
|
23
23
|
return script.schema;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
export async function loadSchemaFlow(path) {
|
|
27
|
+
const flow = await FlowService.getFlowByPath({
|
|
28
|
+
workspace: get(workspaceStore),
|
|
29
|
+
path: path ?? ''
|
|
30
|
+
});
|
|
31
|
+
return flow.schema;
|
|
32
|
+
}
|
package/stores.d.ts
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
1
|
+
import { type Readable } from "svelte/store";
|
|
2
|
+
import type { UserWorkspaceList } from "./gen/models/UserWorkspaceList.js";
|
|
3
|
+
import type { TokenResponse } from "./gen";
|
|
3
4
|
export interface UserExt {
|
|
4
5
|
email: string;
|
|
5
6
|
username: string;
|
|
6
7
|
is_admin: boolean;
|
|
8
|
+
is_super_admin: boolean;
|
|
9
|
+
operator: boolean;
|
|
7
10
|
created_at: string;
|
|
8
11
|
groups: string[];
|
|
9
12
|
pgroups: string[];
|
|
10
13
|
}
|
|
14
|
+
export declare const usageStore: import("svelte/store").Writable<number>;
|
|
11
15
|
export declare const oauthStore: import("svelte/store").Writable<TokenResponse | undefined>;
|
|
12
16
|
export declare const userStore: import("svelte/store").Writable<UserExt | undefined>;
|
|
13
17
|
export declare const workspaceStore: import("svelte/store").Writable<string | undefined>;
|
|
14
18
|
export declare const starStore: import("svelte/store").Writable<number>;
|
|
15
19
|
export declare const usersWorkspaceStore: import("svelte/store").Writable<UserWorkspaceList | undefined>;
|
|
16
20
|
export declare const superadmin: import("svelte/store").Writable<false | String | undefined>;
|
|
21
|
+
export declare const userWorkspaces: Readable<Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
username: string;
|
|
25
|
+
}>>;
|
|
17
26
|
export declare const hubScripts: import("svelte/store").Writable<{
|
|
18
27
|
path: string;
|
|
19
28
|
summary: string;
|
package/stores.js
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
|
-
import { browser } from
|
|
2
|
-
import { writable } from
|
|
3
|
-
import { getUserExt } from
|
|
4
|
-
let persistedWorkspace = browser && localStorage.getItem(
|
|
1
|
+
import { browser } from "$app/env";
|
|
2
|
+
import { derived, writable } from "svelte/store";
|
|
3
|
+
import { getUserExt } from "./user";
|
|
4
|
+
let persistedWorkspace = browser && localStorage.getItem("workspace");
|
|
5
|
+
export const usageStore = writable(0);
|
|
5
6
|
export const oauthStore = writable(undefined);
|
|
6
7
|
export const userStore = writable(undefined);
|
|
7
8
|
export const workspaceStore = writable(persistedWorkspace ? String(persistedWorkspace) : undefined);
|
|
8
9
|
export const starStore = writable(1);
|
|
9
10
|
export const usersWorkspaceStore = writable(undefined);
|
|
10
11
|
export const superadmin = writable(undefined);
|
|
12
|
+
export const userWorkspaces = derived([usersWorkspaceStore, superadmin], ([store, superadmin]) => {
|
|
13
|
+
const originalWorkspaces = (store?.workspaces ?? []);
|
|
14
|
+
if (superadmin) {
|
|
15
|
+
return [...originalWorkspaces.filter((x) => x.id != 'starter' && x.id != 'admins'), {
|
|
16
|
+
id: "admins",
|
|
17
|
+
name: "Admins",
|
|
18
|
+
username: "superadmin",
|
|
19
|
+
}, {
|
|
20
|
+
id: "starter",
|
|
21
|
+
name: "Starter",
|
|
22
|
+
username: "superadmin",
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return originalWorkspaces;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
11
29
|
export const hubScripts = writable(undefined);
|
|
12
30
|
if (browser) {
|
|
13
31
|
workspaceStore.subscribe(async (workspace) => {
|
|
14
32
|
if (workspace) {
|
|
15
|
-
localStorage.setItem(
|
|
33
|
+
localStorage.setItem("workspace", String(workspace));
|
|
16
34
|
userStore.set(await getUserExt(workspace));
|
|
17
35
|
}
|
|
18
36
|
else {
|
|
@@ -21,7 +39,7 @@ if (browser) {
|
|
|
21
39
|
});
|
|
22
40
|
}
|
|
23
41
|
export function clearStores() {
|
|
24
|
-
localStorage.removeItem(
|
|
42
|
+
localStorage.removeItem("workspace");
|
|
25
43
|
userStore.set(undefined);
|
|
26
44
|
workspaceStore.set(undefined);
|
|
27
45
|
usersWorkspaceStore.set(undefined);
|
package/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function isToday(someDate: Date): boolean;
|
|
|
6
6
|
export declare function daysAgo(someDate: Date): number;
|
|
7
7
|
export declare function secondsAgo(date: Date): number;
|
|
8
8
|
export declare function displayDaysAgo(dateString: string): string;
|
|
9
|
-
export declare function displayDate(dateString: string | undefined): string;
|
|
9
|
+
export declare function displayDate(dateString: string | undefined, displaySecond?: boolean): string;
|
|
10
10
|
export declare function msToSec(ms: number | undefined): string;
|
|
11
11
|
export declare function getToday(): Date;
|
|
12
12
|
export declare function sendUserToast(message: string, error?: boolean): void;
|
|
@@ -62,6 +62,7 @@ export declare function decodeArgs(queryArgs: string | undefined): any;
|
|
|
62
62
|
export declare function setQuery(url: URL, key: string, value: string): Promise<void>;
|
|
63
63
|
export declare function setQueryWithoutLoad(url: URL, key: string, value: string): void;
|
|
64
64
|
export declare function groupBy<T>(scripts: T[], toGroup: (t: T) => string, dflts?: string[]): [string, T[]][];
|
|
65
|
+
export declare function removeMarkdown(text: string): string;
|
|
65
66
|
export declare function truncate(s: string, n: number, suffix?: string): string;
|
|
66
67
|
export declare function truncateRev(s: string, n: number, prefix?: string): string;
|
|
67
68
|
export declare function isString(value: any): boolean;
|
|
@@ -93,3 +94,4 @@ export declare function scriptLangToEditorLang(lang: Script.language): 'typescri
|
|
|
93
94
|
export declare function copyToClipboard(value: string, sendToast?: boolean): Promise<boolean>;
|
|
94
95
|
export declare function pluralize(quantity: number, word: string, customPlural?: string): string;
|
|
95
96
|
export declare function capitalize(word: string): string;
|
|
97
|
+
export declare function isCloudHosted(): boolean;
|
package/utils.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { goto } from '$app/navigation';
|
|
3
3
|
import { FlowService, Script, ScriptService } from './gen';
|
|
4
4
|
import { toast } from '@zerodevx/svelte-toast';
|
|
5
|
-
import { get } from 'svelte/store';
|
|
6
5
|
import { hubScripts, workspaceStore } from './stores';
|
|
6
|
+
import { page } from "$app/stores";
|
|
7
|
+
import { get } from "svelte/store";
|
|
7
8
|
export function validateUsername(username) {
|
|
8
9
|
if (username != '' && !/^\w+$/.test(username)) {
|
|
9
10
|
return 'username can only contain letters and numbers';
|
|
@@ -50,13 +51,13 @@ export function displayDaysAgo(dateString) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
export function displayDate(dateString) {
|
|
54
|
+
export function displayDate(dateString, displaySecond = false) {
|
|
54
55
|
const date = new Date(dateString ?? '');
|
|
55
56
|
if (date.toString() === 'Invalid Date') {
|
|
56
57
|
return '';
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} at ${date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`;
|
|
60
|
+
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} at ${date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: displaySecond ? '2-digit' : undefined })}`;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
export function msToSec(ms) {
|
|
@@ -146,7 +147,7 @@ export function canWrite(path, extra_perms, user) {
|
|
|
146
147
|
if (!user) {
|
|
147
148
|
return false;
|
|
148
149
|
}
|
|
149
|
-
if (user.is_admin) {
|
|
150
|
+
if (user.is_admin || user.is_super_admin) {
|
|
150
151
|
return true;
|
|
151
152
|
}
|
|
152
153
|
let userOwner = `u/${user.username}`;
|
|
@@ -242,6 +243,9 @@ export function groupBy(scripts, toGroup, dflts = []) {
|
|
|
242
243
|
}
|
|
243
244
|
});
|
|
244
245
|
}
|
|
246
|
+
export function removeMarkdown(text) {
|
|
247
|
+
return text.replace(/[[\*|\-|#\_]/g, '');
|
|
248
|
+
}
|
|
245
249
|
export function truncate(s, n, suffix = '...') {
|
|
246
250
|
if (!s) {
|
|
247
251
|
return '';
|
|
@@ -488,3 +492,6 @@ export function pluralize(quantity, word, customPlural) {
|
|
|
488
492
|
export function capitalize(word) {
|
|
489
493
|
return word ? word.charAt(0).toUpperCase() + word.slice(1) : '';
|
|
490
494
|
}
|
|
495
|
+
export function isCloudHosted() {
|
|
496
|
+
return get(page).url.hostname == 'app.windmill.dev';
|
|
497
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<script>import { faSortDown } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
-
import { createEventDispatcher } from 'svelte';
|
|
3
|
-
import Icon from 'svelte-awesome';
|
|
4
|
-
import Dropdown from './Dropdown.svelte';
|
|
5
|
-
export let dropdownItems = [];
|
|
6
|
-
const dispatch = createEventDispatcher();
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<div class="bg-blue-500 rounded-sm {$$props.class} inline-block py-0 my-0 ">
|
|
10
|
-
<button
|
|
11
|
-
class="inline pl-2 text-white text-sm py-0 my-0"
|
|
12
|
-
on:click={() => {
|
|
13
|
-
dispatch('clickMain')
|
|
14
|
-
}}><slot name="name">Add script</slot></button
|
|
15
|
-
>
|
|
16
|
-
<Dropdown
|
|
17
|
-
{dropdownItems}
|
|
18
|
-
class="border-l border-gray-300 px-2 inline-block py-0 my-0"
|
|
19
|
-
on:click={() => dispatch('clickDropdown')}
|
|
20
|
-
>
|
|
21
|
-
<div class="py-0 my-0">
|
|
22
|
-
<Icon class="text-white align-top py-0 my-0" data={faSortDown} />
|
|
23
|
-
</div>
|
|
24
|
-
</Dropdown>
|
|
25
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { DropdownItem } from '../utils';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
dropdownItems?: DropdownItem[] | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
clickMain: CustomEvent<any>;
|
|
10
|
-
clickDropdown: CustomEvent<any>;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
name: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type ButtonAndDropdownProps = typeof __propDef.props;
|
|
19
|
-
export type ButtonAndDropdownEvents = typeof __propDef.events;
|
|
20
|
-
export type ButtonAndDropdownSlots = typeof __propDef.slots;
|
|
21
|
-
export default class ButtonAndDropdown extends SvelteComponentTyped<ButtonAndDropdownProps, ButtonAndDropdownEvents, ButtonAndDropdownSlots> {
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { default as AppButton } from './buttons/AppButton.svelte';
|
|
2
|
-
export { default as AppButton } from './buttons/AppButton.svelte';
|
|
3
|
-
import { default as AppBarChart } from './dataDisplay/AppBarChart.svelte';
|
|
4
|
-
export { default as AppBarChart } from './dataDisplay/AppBarChart.svelte';
|
|
5
|
-
export { default as AppPieChart } from './dataDisplay/AppPieChart.svelte';
|
|
6
|
-
export { default as AppTable } from './dataDisplay/AppTable.svelte';
|
|
7
|
-
import { default as AppText } from './dataDisplay/AppText.svelte';
|
|
8
|
-
export { default as AppText } from './dataDisplay/AppText.svelte';
|
|
9
|
-
import { default as AppCheckbox } from './selectInputs/AppCheckbox.svelte';
|
|
10
|
-
export { default as AppCheckbox } from './selectInputs/AppCheckbox.svelte';
|
|
11
|
-
export { default as AlignWrapper } from './helpers/AlignWrapper.svelte';
|
|
12
|
-
export { default as DebouncedInput } from './helpers/DebouncedInput.svelte';
|
|
13
|
-
export { default as InputValue } from './helpers/InputValue.svelte';
|
|
14
|
-
export { default as RunnableComponent } from './helpers/RunnableComponent.svelte';
|
|
15
|
-
declare const textInputs: never[];
|
|
16
|
-
declare const numberInputs: never[];
|
|
17
|
-
declare const buttons: (typeof AppButton)[];
|
|
18
|
-
declare const selectInputs: (typeof AppCheckbox)[];
|
|
19
|
-
declare const dateTimeInputs: never[];
|
|
20
|
-
declare const dataDisplay: (typeof AppBarChart | typeof AppText)[];
|
|
21
|
-
declare const APP_COMPONENTS: (typeof AppBarChart | typeof AppText)[][];
|
|
22
|
-
export { APP_COMPONENTS, textInputs, numberInputs, buttons, selectInputs, dateTimeInputs, dataDisplay };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { default as AppButton } from './buttons/AppButton.svelte';
|
|
2
|
-
export { default as AppButton } from './buttons/AppButton.svelte';
|
|
3
|
-
import { default as AppBarChart } from './dataDisplay/AppBarChart.svelte';
|
|
4
|
-
export { default as AppBarChart } from './dataDisplay/AppBarChart.svelte';
|
|
5
|
-
import { default as AppPieChart } from './dataDisplay/AppPieChart.svelte';
|
|
6
|
-
export { default as AppPieChart } from './dataDisplay/AppPieChart.svelte';
|
|
7
|
-
import { default as AppTable } from './dataDisplay/AppTable.svelte';
|
|
8
|
-
export { default as AppTable } from './dataDisplay/AppTable.svelte';
|
|
9
|
-
import { default as AppText } from './dataDisplay/AppText.svelte';
|
|
10
|
-
export { default as AppText } from './dataDisplay/AppText.svelte';
|
|
11
|
-
import { default as AppCheckbox } from './selectInputs/AppCheckbox.svelte';
|
|
12
|
-
export { default as AppCheckbox } from './selectInputs/AppCheckbox.svelte';
|
|
13
|
-
export { default as AlignWrapper } from './helpers/AlignWrapper.svelte';
|
|
14
|
-
export { default as DebouncedInput } from './helpers/DebouncedInput.svelte';
|
|
15
|
-
export { default as InputValue } from './helpers/InputValue.svelte';
|
|
16
|
-
export { default as RunnableComponent } from './helpers/RunnableComponent.svelte';
|
|
17
|
-
// Component groups
|
|
18
|
-
const textInputs = [];
|
|
19
|
-
const numberInputs = [];
|
|
20
|
-
const buttons = [
|
|
21
|
-
AppButton
|
|
22
|
-
];
|
|
23
|
-
const selectInputs = [
|
|
24
|
-
AppCheckbox
|
|
25
|
-
];
|
|
26
|
-
const dateTimeInputs = [];
|
|
27
|
-
const dataDisplay = [
|
|
28
|
-
AppBarChart,
|
|
29
|
-
AppPieChart,
|
|
30
|
-
AppTable,
|
|
31
|
-
AppText
|
|
32
|
-
];
|
|
33
|
-
// Aggregated component groups for ease of import
|
|
34
|
-
const APP_COMPONENTS = [
|
|
35
|
-
textInputs,
|
|
36
|
-
numberInputs,
|
|
37
|
-
buttons,
|
|
38
|
-
selectInputs,
|
|
39
|
-
dateTimeInputs,
|
|
40
|
-
dataDisplay
|
|
41
|
-
];
|
|
42
|
-
export { APP_COMPONENTS, textInputs, numberInputs, buttons, selectInputs, dateTimeInputs, dataDisplay };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script>import { Badge, Button } from '../../../common';
|
|
2
|
-
import { faLink } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import { getContext } from 'svelte';
|
|
4
|
-
export let input;
|
|
5
|
-
const { connectingInput, selectedComponent } = getContext('AppEditorContext');
|
|
6
|
-
function applyConnection() {
|
|
7
|
-
if (!$connectingInput.opened && $connectingInput.input !== undefined) {
|
|
8
|
-
input.id = $connectingInput.input.id;
|
|
9
|
-
input.name = $connectingInput.input.name;
|
|
10
|
-
// TODO: CHeck whether types are ok
|
|
11
|
-
// TODO: Check whether this is needed
|
|
12
|
-
$selectedComponent = $selectedComponent;
|
|
13
|
-
$connectingInput = {
|
|
14
|
-
opened: false,
|
|
15
|
-
input: undefined
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
$: $connectingInput && applyConnection();
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
{#if input.id && input.name}
|
|
23
|
-
<div class="flex justify-between w-full">
|
|
24
|
-
<span class="text-xs font-bold">Status</span>
|
|
25
|
-
<Badge color="green">Connected</Badge>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="flex justify-between w-full">
|
|
28
|
-
<span class="text-xs font-bold">Component</span>
|
|
29
|
-
<Badge color="indigo">{input.id}</Badge>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="flex justify-between w-full">
|
|
32
|
-
<span class="text-xs font-bold">Field name</span>
|
|
33
|
-
<Badge color="indigo">{input.name}</Badge>
|
|
34
|
-
</div>
|
|
35
|
-
<Button
|
|
36
|
-
size="xs"
|
|
37
|
-
startIcon={{ icon: faLink }}
|
|
38
|
-
color="red"
|
|
39
|
-
on:click={() => {
|
|
40
|
-
input.id = undefined
|
|
41
|
-
input.name = undefined
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
Clear connection
|
|
45
|
-
</Button>
|
|
46
|
-
{:else}
|
|
47
|
-
<div class="flex justify-between w-full">
|
|
48
|
-
<span class="text-xs font-bold">Status</span>
|
|
49
|
-
<Badge color="dark-yellow">Not connected</Badge>
|
|
50
|
-
</div>
|
|
51
|
-
<Button
|
|
52
|
-
size="xs"
|
|
53
|
-
startIcon={{ icon: faLink }}
|
|
54
|
-
color="dark"
|
|
55
|
-
on:click={() => {
|
|
56
|
-
$connectingInput = {
|
|
57
|
-
opened: true,
|
|
58
|
-
input: undefined
|
|
59
|
-
}
|
|
60
|
-
}}
|
|
61
|
-
>
|
|
62
|
-
Connect this input to an output
|
|
63
|
-
</Button>
|
|
64
|
-
{/if}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { DynamicInput, InputType } from '../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
input: DynamicInput<InputType, any>;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
};
|
|
12
|
-
export type DynamicInputEditorProps = typeof __propDef.props;
|
|
13
|
-
export type DynamicInputEditorEvents = typeof __propDef.events;
|
|
14
|
-
export type DynamicInputEditorSlots = typeof __propDef.slots;
|
|
15
|
-
export default class DynamicInputEditor extends SvelteComponentTyped<DynamicInputEditorProps, DynamicInputEditorEvents, DynamicInputEditorSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<script>import { Alert, Badge, Button, Tab } from '../../common';
|
|
2
|
-
import TabContent from '../../common/tabs/TabContent.svelte';
|
|
3
|
-
import Tabs from '../../common/tabs/Tabs.svelte';
|
|
4
|
-
import HighlightCode from '../../HighlightCode.svelte';
|
|
5
|
-
import Toggle from '../../Toggle.svelte';
|
|
6
|
-
import { language } from '../../../sql';
|
|
7
|
-
import { getContext } from 'svelte';
|
|
8
|
-
import FlowCard from '../common/FlowCard.svelte';
|
|
9
|
-
import FlowModuleEarlyStop from './FlowModuleEarlyStop.svelte';
|
|
10
|
-
import FlowModuleSuspend from './FlowModuleSuspend.svelte';
|
|
11
|
-
// import FlowRetries from './FlowRetries.svelte'
|
|
12
|
-
const { selectedId } = getContext('FlowEditorContext');
|
|
13
|
-
export let flowModule;
|
|
14
|
-
export let parentModule;
|
|
15
|
-
export let previousModule;
|
|
16
|
-
let selected = 'early-stop';
|
|
17
|
-
let branches = [];
|
|
18
|
-
$: if (flowModule.value.type === 'branchone') {
|
|
19
|
-
branches = flowModule.value.branches.map((branch, i) => ({
|
|
20
|
-
id: `${flowModule.id}-branch-${i}`,
|
|
21
|
-
summary: branch.summary,
|
|
22
|
-
expr: branch.expr
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
else if (flowModule.value.type === 'branchall') {
|
|
26
|
-
branches = flowModule.value.branches.map((branch, i) => ({
|
|
27
|
-
id: `${flowModule.id}-branch-${i}`,
|
|
28
|
-
summary: branch.summary,
|
|
29
|
-
expr: undefined
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<div class="h-full flex flex-col">
|
|
35
|
-
<FlowCard title={flowModule.value.type == 'branchall' ? 'Run all branches' : 'Run one branch'}>
|
|
36
|
-
<div class="flex flex-col h-full">
|
|
37
|
-
<div class="border">
|
|
38
|
-
{#if flowModule.value.type == 'branchall'}
|
|
39
|
-
<Alert type="info" title="All branches will be run">
|
|
40
|
-
Configure branches to skip errors and to not result in that step itself failing.
|
|
41
|
-
<br />
|
|
42
|
-
<br />
|
|
43
|
-
The result of this step is the list of the result of each branch.
|
|
44
|
-
</Alert>
|
|
45
|
-
{:else}
|
|
46
|
-
<Alert type="info" title="Only one branch will be run">
|
|
47
|
-
Only one branch is ran, the first one that match its predicate, if none do, the default
|
|
48
|
-
branch is chosen.
|
|
49
|
-
<br />
|
|
50
|
-
<br />
|
|
51
|
-
The result of this step is the result of the branch.
|
|
52
|
-
</Alert>
|
|
53
|
-
{/if}
|
|
54
|
-
|
|
55
|
-
<div class="p-2">
|
|
56
|
-
<h3
|
|
57
|
-
>{branches.length + (flowModule.value.type === 'branchone' ? 1 : 0)} branch{branches.length +
|
|
58
|
-
(flowModule.value.type === 'branchone' ? 1 : 0) >
|
|
59
|
-
1
|
|
60
|
-
? 'es'
|
|
61
|
-
: ''}</h3
|
|
62
|
-
>
|
|
63
|
-
<div class="flex flex-col gap-y-4 py-2">
|
|
64
|
-
{#if flowModule.value.type === 'branchone'}
|
|
65
|
-
<div class="flex flex-row">
|
|
66
|
-
<Badge large={true} color="blue">Default branch</Badge>
|
|
67
|
-
</div>
|
|
68
|
-
{/if}
|
|
69
|
-
{#each branches as branch, i}
|
|
70
|
-
{#if flowModule.value.type === 'branchone'}
|
|
71
|
-
<div class="flex flex-row gap-x-2 items-center">
|
|
72
|
-
<div class="max-w-sm w-full text-sm text-gray-600">
|
|
73
|
-
{branch.summary && branch.summary != '' ? branch.summary : 'No summary'}</div
|
|
74
|
-
>
|
|
75
|
-
<div>
|
|
76
|
-
<Button color="dark" size="sm" on:click={() => ($selectedId = branch.id)}>
|
|
77
|
-
Set branch {i} predicate</Button
|
|
78
|
-
>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="w-full text-2xs">
|
|
81
|
-
<HighlightCode language="deno" code={branch.expr} />
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
{:else}
|
|
85
|
-
<div class="flex flex-row gap-x-2">
|
|
86
|
-
<div class="max-w-sm w-full text-sm text-gray-600">
|
|
87
|
-
{branch.summary && branch.summary != '' ? branch.summary : 'No summary'}
|
|
88
|
-
</div>
|
|
89
|
-
<div>
|
|
90
|
-
<Button color="dark" size="sm" on:click={() => ($selectedId = branch.id)}>
|
|
91
|
-
Set branch {i} summary</Button
|
|
92
|
-
>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
{/if}
|
|
96
|
-
{/each}
|
|
97
|
-
</div>
|
|
98
|
-
{#if flowModule.value.type == 'branchall'}
|
|
99
|
-
<div class="mt-6 mb-2 text-sm font-bold">Run in parallel</div>
|
|
100
|
-
<Toggle
|
|
101
|
-
bind:checked={flowModule.value.parallel}
|
|
102
|
-
options={{
|
|
103
|
-
right: 'All branches run in parallel'
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
{/if}
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
{#if flowModule}
|
|
110
|
-
<Tabs bind:selected>
|
|
111
|
-
<!-- <Tab value="retries">Retries</Tab> -->
|
|
112
|
-
<Tab value="early-stop">Early Stop</Tab>
|
|
113
|
-
<Tab value="suspend">Sleep/Suspend</Tab>
|
|
114
|
-
|
|
115
|
-
<svelte:fragment slot="content">
|
|
116
|
-
<div class="overflow-hidden bg-white">
|
|
117
|
-
<!-- <TabContent value="retries" class="flex flex-col flex-1 h-full">
|
|
118
|
-
<div class="p-4 overflow-y-auto">
|
|
119
|
-
<FlowRetries bind:flowModule />
|
|
120
|
-
</div>
|
|
121
|
-
</TabContent> -->
|
|
122
|
-
|
|
123
|
-
<TabContent value="early-stop" class="flex flex-col flex-1 h-full">
|
|
124
|
-
<div class="p-4 overflow-y-auto">
|
|
125
|
-
<FlowModuleEarlyStop bind:flowModule />
|
|
126
|
-
</div>
|
|
127
|
-
</TabContent>
|
|
128
|
-
|
|
129
|
-
<TabContent value="suspend" class="flex flex-col flex-1 h-full">
|
|
130
|
-
<div class="p-4 overflow-y-auto">
|
|
131
|
-
<FlowModuleSuspend previousModuleId={previousModule?.id} bind:flowModule />
|
|
132
|
-
</div>
|
|
133
|
-
</TabContent>
|
|
134
|
-
</div>
|
|
135
|
-
</svelte:fragment>
|
|
136
|
-
</Tabs>
|
|
137
|
-
{/if}
|
|
138
|
-
</div>
|
|
139
|
-
</FlowCard>
|
|
140
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { FlowModule } from '../../../gen';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
flowModule: FlowModule;
|
|
6
|
-
parentModule: FlowModule | undefined;
|
|
7
|
-
previousModule: FlowModule | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type FlowBranchesWrapperProps = typeof __propDef.props;
|
|
15
|
-
export type FlowBranchesWrapperEvents = typeof __propDef.events;
|
|
16
|
-
export type FlowBranchesWrapperSlots = typeof __propDef.slots;
|
|
17
|
-
export default class FlowBranchesWrapper extends SvelteComponentTyped<FlowBranchesWrapperProps, FlowBranchesWrapperEvents, FlowBranchesWrapperSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|