windmill-components 1.46.3 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +6 -5
- package/components/ApiConnectForm.svelte +56 -0
- package/components/ApiConnectForm.svelte.d.ts +19 -0
- package/components/AppConnect.svelte +243 -180
- package/components/AppConnect.svelte.d.ts +4 -3
- package/components/ArgInfo.svelte +8 -4
- package/components/ArgInfo.svelte.d.ts +3 -3
- package/components/ArgInput.svelte +87 -27
- package/components/ArgInput.svelte.d.ts +11 -3
- package/components/Badge.svelte.d.ts +3 -3
- package/components/Button.svelte +1 -1
- package/components/Button.svelte.d.ts +3 -3
- package/components/CenteredModal.svelte +20 -13
- package/components/CenteredModal.svelte.d.ts +3 -3
- package/components/CenteredPage.svelte +1 -1
- package/components/CenteredPage.svelte.d.ts +6 -2
- package/components/ChevronButton.svelte.d.ts +3 -3
- package/components/CollapseLink.svelte.d.ts +3 -3
- package/components/CronInput.svelte +2 -2
- package/components/CronInput.svelte.d.ts +3 -3
- package/components/DisplayResult.svelte +39 -2
- package/components/DisplayResult.svelte.d.ts +3 -3
- package/components/Dropdown.svelte +73 -94
- package/components/Dropdown.svelte.d.ts +4 -6
- package/components/Editor.svelte +19 -7
- package/components/Editor.svelte.d.ts +4 -3
- package/components/EditorBar.svelte +92 -90
- package/components/EditorBar.svelte.d.ts +4 -3
- package/components/FieldHeader.svelte +4 -3
- package/components/FieldHeader.svelte.d.ts +3 -3
- package/components/FlowBuilder.svelte +86 -57
- package/components/FlowBuilder.svelte.d.ts +4 -3
- package/components/FlowGraphViewer.svelte +178 -0
- package/components/FlowGraphViewer.svelte.d.ts +24 -0
- package/components/FlowJobResult.svelte +6 -1
- package/components/FlowJobResult.svelte.d.ts +5 -3
- package/components/FlowMetadata.svelte +4 -2
- package/components/FlowMetadata.svelte.d.ts +3 -3
- package/components/FlowPreviewContent.svelte +58 -81
- package/components/FlowPreviewContent.svelte.d.ts +6 -3
- package/components/FlowStatusViewer.svelte +284 -109
- package/components/FlowStatusViewer.svelte.d.ts +6 -3
- package/components/FlowViewer.svelte +5 -80
- package/components/FlowViewer.svelte.d.ts +4 -3
- package/components/GroupModal.svelte.d.ts +3 -3
- package/components/HighlightCode.svelte +1 -1
- package/components/HighlightCode.svelte.d.ts +4 -3
- package/components/IconedPath.svelte +16 -6
- package/components/IconedPath.svelte.d.ts +5 -3
- package/components/IconedResourceType.svelte +6 -61
- package/components/IconedResourceType.svelte.d.ts +3 -3
- package/components/InputTransformForm.svelte +139 -89
- package/components/InputTransformForm.svelte.d.ts +10 -5
- package/components/InputTransformsViewer.svelte.d.ts +3 -3
- package/components/InviteGlobalUser.svelte +2 -2
- package/components/InviteGlobalUser.svelte.d.ts +4 -4
- package/components/InviteUser.svelte +20 -6
- package/components/InviteUser.svelte.d.ts +4 -4
- package/components/ItemPicker.svelte +103 -44
- package/components/ItemPicker.svelte.d.ts +8 -5
- package/components/JobArgs.svelte +5 -5
- package/components/JobArgs.svelte.d.ts +3 -3
- package/components/JobStatus.svelte +19 -13
- package/components/JobStatus.svelte.d.ts +3 -3
- package/components/LogViewer.svelte +28 -5
- package/components/LogViewer.svelte.d.ts +4 -3
- package/components/Modal.svelte.d.ts +3 -3
- package/components/ModulePreview.svelte +8 -0
- package/components/ModulePreview.svelte.d.ts +3 -3
- package/components/ModuleStatus.svelte +38 -0
- package/components/ModuleStatus.svelte.d.ts +18 -0
- package/components/ObjectResourceInput.svelte +19 -47
- package/components/ObjectResourceInput.svelte.d.ts +3 -3
- package/components/ObjectTypeNarrowing.svelte.d.ts +3 -3
- package/components/PageHeader.svelte +2 -2
- package/components/PageHeader.svelte.d.ts +3 -3
- package/components/Password.svelte +2 -2
- package/components/Password.svelte.d.ts +4 -4
- package/components/Path.svelte +6 -3
- package/components/Path.svelte.d.ts +5 -4
- package/components/Popover.svelte +7 -1
- package/components/Popover.svelte.d.ts +6 -4
- package/components/RadioButton.svelte.d.ts +3 -3
- package/components/Required.svelte.d.ts +3 -3
- package/components/ResourceEditor.svelte +107 -169
- package/components/ResourceEditor.svelte.d.ts +3 -5
- package/components/ResourcePicker.svelte +41 -28
- package/components/ResourcePicker.svelte.d.ts +3 -3
- package/components/ResourceTypePicker.svelte.d.ts +3 -3
- package/components/RunChart.svelte.d.ts +3 -3
- package/components/RunForm.svelte.d.ts +3 -3
- package/components/SchemaEditor.svelte +57 -24
- package/components/SchemaEditor.svelte.d.ts +3 -3
- package/components/SchemaEditorProperty.svelte.d.ts +3 -3
- package/components/SchemaForm.svelte +98 -33
- package/components/SchemaForm.svelte.d.ts +9 -4
- package/components/SchemaModal.svelte +11 -10
- package/components/SchemaModal.svelte.d.ts +4 -4
- package/components/SchemaViewer.svelte.d.ts +3 -3
- package/components/ScriptBuilder.svelte +202 -189
- package/components/ScriptBuilder.svelte.d.ts +4 -4
- package/components/ScriptEditor.svelte +71 -69
- package/components/ScriptEditor.svelte.d.ts +5 -3
- package/components/ScriptPicker.svelte +28 -38
- package/components/ScriptPicker.svelte.d.ts +5 -4
- package/components/ScriptSchema.svelte +12 -31
- package/components/ScriptSchema.svelte.d.ts +3 -4
- package/components/SearchItems.svelte +29 -0
- package/components/SearchItems.svelte.d.ts +23 -0
- package/components/ShareModal.svelte.d.ts +3 -3
- package/components/SharedBadge.svelte +4 -3
- package/components/SharedBadge.svelte.d.ts +3 -3
- package/components/SimpleEditor.svelte +36 -11
- package/components/SimpleEditor.svelte.d.ts +5 -4
- package/components/Star.svelte +42 -0
- package/components/Star.svelte.d.ts +19 -0
- package/components/StringTypeNarrowing.svelte.d.ts +3 -3
- package/components/SuperadminSettings.svelte +26 -52
- package/components/SuperadminSettings.svelte.d.ts +3 -3
- package/components/TableCustom.svelte +1 -1
- package/components/TableCustom.svelte.d.ts +3 -3
- package/components/TableSimple.svelte +1 -1
- package/components/TableSimple.svelte.d.ts +3 -3
- package/components/TestJobLoader.svelte +61 -32
- package/components/TestJobLoader.svelte.d.ts +9 -3
- package/components/Toggle.svelte.d.ts +3 -3
- package/components/ToggleHubWorkspace.svelte +16 -0
- package/components/ToggleHubWorkspace.svelte.d.ts +16 -0
- package/components/Tooltip.svelte.d.ts +4 -4
- package/components/UserSettings.svelte.d.ts +3 -3
- package/components/VariableEditor.svelte +89 -37
- package/components/VariableEditor.svelte.d.ts +5 -3
- package/components/apps/CreateApp.svelte +68 -0
- package/components/apps/CreateApp.svelte.d.ts +14 -0
- package/components/apps/components/DisplayComponent.svelte +16 -0
- package/components/apps/components/DisplayComponent.svelte.d.ts +20 -0
- package/components/apps/components/buttons/AppButton.svelte +49 -0
- package/components/apps/components/buttons/AppButton.svelte.d.ts +25 -0
- package/components/apps/components/dataDisplay/AppBarChart.svelte +42 -0
- package/components/apps/components/dataDisplay/AppBarChart.svelte.d.ts +21 -0
- package/components/apps/components/dataDisplay/AppPieChart.svelte +43 -0
- package/components/apps/components/dataDisplay/AppPieChart.svelte.d.ts +21 -0
- package/components/apps/components/dataDisplay/AppTable.svelte +132 -0
- package/components/apps/components/dataDisplay/AppTable.svelte.d.ts +23 -0
- package/components/apps/components/dataDisplay/AppText.svelte +22 -0
- package/components/apps/components/dataDisplay/AppText.svelte.d.ts +22 -0
- 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 +30 -0
- package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +20 -0
- package/components/apps/components/helpers/DebouncedInput.svelte +24 -0
- package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +20 -0
- package/components/apps/components/helpers/InputValue.svelte +46 -0
- package/components/apps/components/helpers/InputValue.svelte.d.ts +18 -0
- 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 +188 -0
- package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +27 -0
- 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 +28 -0
- package/components/apps/components/selectInputs/AppCheckbox.svelte.d.ts +22 -0
- 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 +116 -0
- package/components/apps/editor/AppEditor.svelte.d.ts +19 -0
- package/components/apps/editor/AppEditorHeader.svelte +75 -0
- package/components/apps/editor/AppEditorHeader.svelte.d.ts +19 -0
- package/components/apps/editor/AppPreview.svelte +42 -0
- package/components/apps/editor/AppPreview.svelte.d.ts +17 -0
- package/components/apps/editor/ComponentEditor.svelte +85 -0
- package/components/apps/editor/ComponentEditor.svelte.d.ts +20 -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 +94 -0
- package/components/apps/editor/GridEditor.svelte.d.ts +14 -0
- 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 +160 -0
- package/components/apps/editor/componentsPanel/ComponentList.svelte.d.ts +14 -0
- package/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
- package/components/apps/editor/componentsPanel/componentDefaultProps.js +5 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +6 -0
- package/components/apps/editor/componentsPanel/componentStaticValues.js +8 -0
- package/components/apps/editor/componentsPanel/data.d.ts +3 -0
- package/components/apps/editor/componentsPanel/data.js +273 -0
- package/components/apps/editor/componentsPanel/store.d.ts +9 -0
- package/components/apps/editor/componentsPanel/store.js +16 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +22 -0
- package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte.d.ts +19 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte +192 -0
- package/components/apps/editor/contextPanel/ContextPanel.svelte.d.ts +16 -0
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte +29 -0
- package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte.d.ts +16 -0
- 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 +221 -0
- package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +18 -0
- 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 +11 -0
- package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +18 -0
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +67 -0
- package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/PickFlow.svelte +38 -0
- package/components/apps/editor/settingsPanel/PickFlow.svelte.d.ts +16 -0
- package/components/apps/editor/settingsPanel/PickInlineScript.svelte +38 -0
- package/components/apps/editor/settingsPanel/PickInlineScript.svelte.d.ts +20 -0
- 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/SectionPanel.svelte +70 -0
- package/components/apps/editor/settingsPanel/SectionPanel.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/StaticInputEditor.svelte +46 -0
- package/components/apps/editor/settingsPanel/StaticInputEditor.svelte.d.ts +18 -0
- 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 +111 -0
- package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +19 -0
- package/components/apps/editor/settingsPanel/UserInputEditor.svelte +2 -0
- package/components/apps/editor/settingsPanel/UserInputEditor.svelte.d.ts +14 -0
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte +12 -0
- package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +20 -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/gridUtils.d.ts +11 -0
- package/components/apps/gridUtils.js +24 -0
- package/components/apps/inputType.d.ts +62 -0
- package/components/apps/inputType.js +1 -0
- package/components/apps/rx.d.ts +27 -0
- package/components/apps/rx.js +99 -0
- package/components/apps/types.d.ts +86 -0
- package/components/apps/types.js +1 -0
- package/components/apps/utils.d.ts +13 -0
- package/components/apps/utils.js +132 -0
- package/components/common/actionRow/ActionRow.svelte.d.ts +3 -3
- package/components/common/alert/Alert.svelte +30 -7
- package/components/common/alert/Alert.svelte.d.ts +5 -3
- package/components/common/alert/model.d.ts +1 -1
- package/components/common/badge/Badge.svelte +3 -7
- package/components/common/badge/Badge.svelte.d.ts +6 -4
- package/components/common/badge/model.d.ts +2 -2
- package/components/common/breadcrumb/Breadcrumb.svelte.d.ts +3 -3
- package/components/common/button/Button.svelte +24 -6
- package/components/common/button/Button.svelte.d.ts +6 -4
- package/components/common/button/ButtonPopup.svelte +3 -1
- package/components/common/button/ButtonPopup.svelte.d.ts +5 -4
- package/components/common/button/ButtonPopupItem.svelte.d.ts +3 -3
- package/components/common/button/model.d.ts +2 -1
- package/components/common/button/model.js +2 -1
- package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +3 -3
- package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +4 -4
- package/components/common/drawer/Drawer.svelte +5 -1
- package/components/common/drawer/Drawer.svelte.d.ts +3 -3
- package/components/common/drawer/DrawerContent.svelte +28 -19
- package/components/common/drawer/DrawerContent.svelte.d.ts +6 -6
- package/components/common/kbd/Kbd.svelte.d.ts +2 -2
- package/components/common/languageIcons/LanguageIcon.svelte +8 -4
- package/components/common/languageIcons/LanguageIcon.svelte.d.ts +4 -4
- package/components/common/menu/Menu.svelte +7 -6
- package/components/common/menu/Menu.svelte.d.ts +7 -6
- package/components/common/menu/MenuItem.svelte +1 -0
- package/components/common/menu/MenuItem.svelte.d.ts +6 -2
- package/components/common/popup/Popup.svelte +0 -11
- package/components/common/popup/Popup.svelte.d.ts +3 -3
- package/components/common/skeleton/Skeleton.svelte.d.ts +3 -3
- package/components/common/skeleton/SkeletonElement.svelte.d.ts +3 -3
- package/components/common/skeleton/model.d.ts +4 -4
- package/components/common/table/AppRow.svelte +77 -0
- package/components/common/table/AppRow.svelte.d.ts +23 -0
- package/components/common/table/FlowRow.svelte +141 -0
- package/components/common/table/FlowRow.svelte.d.ts +25 -0
- package/components/common/table/LanguageBadge.svelte +32 -0
- package/components/common/table/LanguageBadge.svelte.d.ts +24 -0
- package/components/common/table/Row.svelte +58 -0
- package/components/common/table/Row.svelte.d.ts +28 -0
- package/components/common/table/RowIcon.svelte +28 -0
- package/components/common/table/RowIcon.svelte.d.ts +16 -0
- package/components/common/table/ScriptRow.svelte +155 -0
- package/components/common/table/ScriptRow.svelte.d.ts +25 -0
- package/components/common/table/Table.svelte +9 -0
- package/components/common/table/Table.svelte.d.ts +27 -0
- package/components/common/tabs/Tab.svelte +15 -4
- package/components/common/tabs/Tab.svelte.d.ts +5 -3
- package/components/common/tabs/TabContent.svelte.d.ts +3 -3
- package/components/common/tabs/Tabs.svelte +5 -1
- package/components/common/tabs/Tabs.svelte.d.ts +4 -4
- package/components/common/toggleButton/ToggleButton.svelte +12 -9
- package/components/common/toggleButton/ToggleButton.svelte.d.ts +6 -4
- package/components/common/toggleButton/ToggleButtonGroup.svelte +12 -19
- package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +10 -8
- package/components/flows/CreateActionsFlow.svelte +39 -0
- package/components/flows/CreateActionsFlow.svelte.d.ts +14 -0
- package/components/flows/FlowEditor.svelte +22 -5
- package/components/flows/FlowEditor.svelte.d.ts +4 -3
- package/components/flows/FlowProgressBar.svelte.d.ts +3 -3
- package/components/flows/common/FlowCard.svelte.d.ts +3 -3
- package/components/flows/common/FlowCardHeader.svelte +10 -9
- package/components/flows/common/FlowCardHeader.svelte.d.ts +3 -3
- 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/CapturePayload.svelte.d.ts +3 -3
- package/components/flows/content/DynamicInputHelpBox.svelte +2 -32
- package/components/flows/content/DynamicInputHelpBox.svelte.d.ts +4 -6
- package/components/flows/content/FlowBranchAllWrapper.svelte +2 -2
- package/components/flows/content/FlowBranchAllWrapper.svelte.d.ts +3 -3
- package/components/flows/content/FlowBranchOneWrapper.svelte +4 -35
- package/components/flows/content/FlowBranchOneWrapper.svelte.d.ts +3 -3
- 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/FlowEditorPanel.svelte +2 -0
- package/components/flows/content/FlowEditorPanel.svelte.d.ts +3 -3
- package/components/flows/content/FlowFailureModule.svelte.d.ts +4 -4
- package/components/flows/content/FlowInput.svelte +10 -14
- package/components/flows/content/FlowInput.svelte.d.ts +4 -4
- package/components/flows/content/FlowInputs.svelte +121 -140
- package/components/flows/content/FlowInputs.svelte.d.ts +4 -7
- package/components/flows/content/FlowInputsFlow.svelte +101 -0
- package/components/flows/content/FlowInputsFlow.svelte.d.ts +20 -0
- package/components/flows/content/FlowLoop.svelte +13 -5
- package/components/flows/content/FlowLoop.svelte.d.ts +3 -3
- package/components/flows/content/FlowModuleComponent.svelte +82 -67
- package/components/flows/content/FlowModuleComponent.svelte.d.ts +3 -3
- package/components/flows/content/FlowModuleEarlyStop.svelte +7 -5
- package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +3 -3
- package/components/flows/content/FlowModuleHeader.svelte +23 -19
- package/components/flows/content/FlowModuleHeader.svelte.d.ts +4 -3
- package/components/flows/content/FlowModuleScript.svelte.d.ts +3 -3
- 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 -57
- package/components/flows/content/FlowModuleSuspend.svelte.d.ts +3 -4
- package/components/flows/content/FlowModuleWrapper.svelte +59 -57
- package/components/flows/content/FlowModuleWrapper.svelte.d.ts +3 -3
- package/components/flows/content/FlowPathViewer.svelte +20 -0
- package/components/flows/content/FlowPathViewer.svelte.d.ts +17 -0
- package/components/flows/content/FlowRetries.svelte.d.ts +3 -3
- package/components/flows/content/FlowSchedules.svelte.d.ts +4 -4
- package/components/flows/content/FlowSettings.svelte +85 -94
- package/components/flows/content/FlowSettings.svelte.d.ts +3 -3
- package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +3 -3
- package/components/flows/flowState.d.ts +2 -2
- package/components/flows/flowState.js +2 -2
- package/components/flows/flowStateUtils.d.ts +8 -3
- package/components/flows/flowStateUtils.js +42 -10
- package/components/flows/flowStore.d.ts +1 -1
- package/components/flows/flowStore.js +1 -1
- package/components/flows/header/FlowImportExportMenu.svelte +9 -23
- package/components/flows/header/FlowImportExportMenu.svelte.d.ts +4 -4
- package/components/flows/header/FlowPreviewButtons.svelte +24 -16
- package/components/flows/header/FlowPreviewButtons.svelte.d.ts +4 -4
- package/components/flows/map/FlowBranchAllMap.svelte +47 -37
- package/components/flows/map/FlowBranchAllMap.svelte.d.ts +3 -3
- package/components/flows/map/FlowBranchOneMap.svelte +50 -42
- package/components/flows/map/FlowBranchOneMap.svelte.d.ts +3 -3
- package/components/flows/map/FlowErrorHandlerItem.svelte +9 -7
- package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +4 -4
- package/components/flows/map/FlowInputsItem.svelte +3 -2
- package/components/flows/map/FlowInputsItem.svelte.d.ts +4 -4
- package/components/flows/map/FlowModuleSchemaItem.svelte +54 -40
- package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +5 -5
- package/components/flows/map/FlowModuleSchemaMap.svelte +59 -95
- package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +4 -5
- package/components/flows/map/FlowSettingsItem.svelte +8 -7
- package/components/flows/map/FlowSettingsItem.svelte.d.ts +4 -4
- package/components/flows/map/InsertModuleButton.svelte +78 -8
- package/components/flows/map/InsertModuleButton.svelte.d.ts +5 -5
- package/components/flows/map/MapItem.svelte +36 -16
- package/components/flows/map/MapItem.svelte.d.ts +4 -6
- package/components/flows/pickers/FlowScriptPicker.svelte +11 -4
- package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +8 -6
- package/components/flows/pickers/PickHubFlow.svelte +72 -0
- package/components/flows/pickers/PickHubFlow.svelte.d.ts +20 -0
- package/components/flows/pickers/PickHubScript.svelte +83 -29
- package/components/flows/pickers/PickHubScript.svelte.d.ts +8 -7
- package/components/flows/pickers/PickScript.svelte +16 -9
- package/components/flows/pickers/PickScript.svelte.d.ts +3 -4
- package/components/flows/pickers/WorkspaceScriptPicker.svelte +113 -0
- package/components/flows/pickers/WorkspaceScriptPicker.svelte.d.ts +23 -0
- package/components/flows/pickers/model.d.ts +5 -3
- package/components/flows/previousResults.d.ts +3 -2
- package/components/flows/previousResults.js +7 -6
- package/components/flows/propPicker/PropPickerWrapper.svelte +11 -3
- package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +7 -7
- package/components/flows/scheduleUtils.d.ts +1 -1
- package/components/flows/scheduleUtils.js +1 -1
- package/components/flows/types.d.ts +1 -1
- package/components/flows/utils.d.ts +1 -2
- package/components/flows/utils.js +10 -15
- package/components/graph/FlowGraph.svelte +163 -58
- package/components/graph/FlowGraph.svelte.d.ts +7 -4
- package/components/graph/model.d.ts +18 -6
- 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/AirtableIcon.svelte.d.ts +3 -3
- package/components/icons/DatadogIcon.svelte +48 -0
- package/components/icons/DatadogIcon.svelte.d.ts +17 -0
- package/components/icons/DbIcon.svelte.d.ts +3 -3
- package/components/icons/DiscordIcon.svelte.d.ts +3 -3
- package/components/icons/FunkwhaleIcon.svelte +90 -0
- package/components/icons/FunkwhaleIcon.svelte.d.ts +17 -0
- package/components/icons/GCloudIcon.svelte.d.ts +3 -3
- package/components/icons/GItlabIcon.svelte.d.ts +3 -3
- package/components/icons/GSheetsIcon.svelte.d.ts +3 -3
- package/components/icons/GcalIcon.svelte.d.ts +3 -3
- package/components/icons/GdocsIcon.svelte +9 -0
- package/components/icons/GdocsIcon.svelte.d.ts +17 -0
- package/components/icons/GdriveIcon.svelte.d.ts +3 -3
- package/components/icons/GithubIcon.svelte.d.ts +3 -3
- package/components/icons/GmailIcon.svelte.d.ts +3 -3
- package/components/icons/HatIcon.svelte.d.ts +3 -3
- package/components/icons/HttpIcon.svelte.d.ts +3 -3
- 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/Mail.svelte.d.ts +3 -3
- package/components/icons/MailchimpIcon.svelte +18 -0
- package/components/icons/MailchimpIcon.svelte.d.ts +17 -0
- package/components/icons/MastodonIcon.svelte.d.ts +3 -3
- package/components/icons/MatrixIcon.svelte.d.ts +3 -3
- package/components/icons/Mysql.svelte +8 -8
- package/components/icons/Mysql.svelte.d.ts +3 -3
- package/components/icons/NextcloudIcon.svelte +9 -0
- package/components/icons/NextcloudIcon.svelte.d.ts +17 -0
- package/components/icons/PostgresIcon.svelte.d.ts +3 -3
- package/components/icons/QRCodeIcon.svelte +5 -0
- package/components/icons/QRCodeIcon.svelte.d.ts +16 -0
- package/components/icons/S3Icon.svelte.d.ts +3 -3
- package/components/icons/SendflakeIcon.svelte +15 -0
- package/components/icons/SendflakeIcon.svelte.d.ts +17 -0
- package/components/icons/SendgridIcon.svelte +66 -0
- package/components/icons/SendgridIcon.svelte.d.ts +17 -0
- package/components/icons/Slack.svelte.d.ts +3 -3
- 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/TogglIcon.svelte.d.ts +3 -3
- package/components/icons/WindmillIcon.svelte +3 -3
- package/components/icons/WindmillIcon.svelte.d.ts +3 -3
- package/components/icons/index.d.ts +70 -0
- package/components/icons/index.js +70 -0
- package/components/jobs/JobDetail.svelte +4 -4
- package/components/jobs/JobDetail.svelte.d.ts +3 -3
- package/components/preview/FlowPreviewStatus.svelte +12 -23
- package/components/preview/FlowPreviewStatus.svelte.d.ts +3 -3
- package/components/progressBar/ProgressBar.svelte.d.ts +3 -3
- package/components/progressBar/ProgressBarGeneralPart.svelte.d.ts +3 -3
- package/components/progressBar/ProgressBarLoopAccessor.svelte.d.ts +3 -3
- package/components/progressBar/ProgressBarLoopPart.svelte.d.ts +3 -3
- package/components/progressBar/model.d.ts +9 -9
- package/components/propertyPicker/ObjectViewer.svelte +34 -9
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +4 -3
- package/components/propertyPicker/PropPicker.svelte +134 -110
- package/components/propertyPicker/PropPicker.svelte.d.ts +3 -3
- package/components/propertyPicker/PropPickerResult.svelte +2 -4
- package/components/propertyPicker/PropPickerResult.svelte.d.ts +3 -3
- package/components/propertyPicker/WarningMessage.svelte.d.ts +6 -2
- package/components/scriptEditor/LogPanel.svelte +15 -8
- package/components/scriptEditor/LogPanel.svelte.d.ts +3 -3
- package/components/scripts/CreateActionsScript.svelte +29 -0
- package/components/scripts/CreateActionsScript.svelte.d.ts +14 -0
- package/components/sidebar/FavoriteMenu.svelte +52 -0
- package/components/sidebar/FavoriteMenu.svelte.d.ts +21 -0
- package/components/sidebar/MenuLink.svelte +7 -4
- package/components/sidebar/MenuLink.svelte.d.ts +4 -3
- package/components/sidebar/SidebarContent.svelte +24 -26
- package/components/sidebar/SidebarContent.svelte.d.ts +3 -3
- package/components/sidebar/UserMenu.svelte +22 -5
- package/components/sidebar/UserMenu.svelte.d.ts +3 -3
- package/components/sidebar/WorkspaceMenu.svelte +9 -10
- package/components/sidebar/WorkspaceMenu.svelte.d.ts +3 -3
- package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +3 -3
- package/editorUtils.d.ts +3 -1
- package/editorUtils.js +5 -3
- package/gen/core/ApiRequestOptions.d.ts +1 -1
- package/gen/core/ApiResult.d.ts +1 -1
- package/gen/core/OpenAPI.d.ts +3 -3
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +3 -0
- package/gen/index.js +1 -0
- package/gen/models/AppWithLastVersion.d.ts +12 -12
- package/gen/models/AuditLog.d.ts +1 -1
- package/gen/models/BranchAll.d.ts +1 -1
- package/gen/models/BranchOne.d.ts +1 -1
- package/gen/models/CompletedJob.d.ts +2 -1
- package/gen/models/ContextualVariable.d.ts +1 -1
- package/gen/models/CreateResource.d.ts +1 -2
- package/gen/models/CreateVariable.d.ts +1 -1
- package/gen/models/CreateWorkspace.d.ts +1 -2
- package/gen/models/EditResource.d.ts +1 -1
- package/gen/models/EditResourceType.d.ts +1 -1
- package/gen/models/EditSchedule.d.ts +1 -1
- package/gen/models/EditVariable.d.ts +1 -1
- package/gen/models/EditWorkspaceUser.d.ts +3 -1
- package/gen/models/Flow.d.ts +1 -1
- package/gen/models/FlowMetadata.d.ts +2 -1
- package/gen/models/FlowModule.d.ts +1 -1
- package/gen/models/FlowModuleValue.d.ts +2 -1
- package/gen/models/FlowPreview.d.ts +1 -1
- package/gen/models/FlowStatus.d.ts +4 -2
- package/gen/models/FlowStatusModule.d.ts +2 -2
- package/gen/models/FlowStatusModule.js +1 -1
- package/gen/models/FlowValue.d.ts +1 -1
- package/gen/models/ForloopFlow.d.ts +1 -1
- package/gen/models/GlobalUserInfo.d.ts +1 -1
- package/gen/models/Group.d.ts +1 -1
- package/gen/models/Identity.d.ts +2 -1
- package/gen/models/InputTransform.d.ts +1 -1
- package/gen/models/JavascriptTransform.d.ts +1 -1
- package/gen/models/Job.d.ts +1 -1
- package/gen/models/ListableApp.d.ts +10 -8
- package/gen/models/ListableResource.d.ts +14 -0
- package/gen/models/ListableResource.js +4 -0
- package/gen/models/ListableVariable.d.ts +5 -1
- package/gen/models/Login.d.ts +1 -1
- package/gen/models/MainArgSignature.d.ts +1 -1
- package/gen/models/NewSchedule.d.ts +1 -1
- package/gen/models/NewToken.d.ts +1 -1
- package/gen/models/NewUser.d.ts +1 -1
- package/gen/models/OpenFlow.d.ts +1 -1
- package/gen/models/OpenFlowWPath.d.ts +1 -1
- package/gen/models/PathFlow.d.ts +6 -0
- package/gen/models/PathFlow.js +4 -0
- package/gen/models/PathScript.d.ts +2 -1
- package/gen/models/Policy.d.ts +1 -1
- package/gen/models/Preview.d.ts +1 -1
- package/gen/models/QueuedJob.d.ts +2 -1
- package/gen/models/RawScript.d.ts +2 -1
- package/gen/models/Resource.d.ts +1 -1
- package/gen/models/ResourceType.d.ts +1 -1
- package/gen/models/Retry.d.ts +1 -1
- package/gen/models/Schedule.d.ts +3 -1
- package/gen/models/Script.d.ts +2 -1
- package/gen/models/ScriptArgs.d.ts +1 -1
- package/gen/models/SlackToken.d.ts +1 -1
- package/gen/models/StaticTransform.d.ts +1 -1
- package/gen/models/TokenResponse.d.ts +1 -1
- package/gen/models/TruncatedToken.d.ts +1 -1
- package/gen/models/Usage.d.ts +2 -4
- package/gen/models/User.d.ts +1 -1
- package/gen/models/UserWorkspaceList.d.ts +1 -1
- package/gen/models/WorkerPing.d.ts +1 -1
- package/gen/models/Workspace.d.ts +1 -1
- package/gen/models/WorkspaceInvite.d.ts +2 -1
- package/gen/services/AppService.d.ts +107 -1
- package/gen/services/AppService.js +89 -1
- package/gen/services/FavoriteService.d.ts +27 -0
- package/gen/services/FavoriteService.js +36 -0
- package/gen/services/FlowService.d.ts +7 -91
- package/gen/services/FlowService.js +2 -73
- package/gen/services/JobService.d.ts +50 -5
- package/gen/services/JobService.js +33 -5
- package/gen/services/OauthService.d.ts +1 -1
- package/gen/services/ResourceService.d.ts +9 -4
- package/gen/services/ResourceService.js +3 -2
- package/gen/services/ScheduleService.d.ts +1 -1
- package/gen/services/ScheduleService.js +1 -1
- package/gen/services/ScriptService.d.ts +7 -1
- package/gen/services/ScriptService.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 -361
- package/script_helpers.d.ts +5 -2
- package/script_helpers.js +91 -26
- package/scripts.d.ts +1 -0
- package/scripts.js +8 -1
- package/stateMachine.d.ts +4 -4
- package/stores.d.ts +13 -2
- package/stores.js +25 -6
- package/utils.d.ts +7 -3
- package/utils.js +31 -7
- package/components/ButtonAndDropdown.svelte +0 -25
- package/components/ButtonAndDropdown.svelte.d.ts +0 -23
- package/components/FlowModulesViewer.svelte +0 -191
- package/components/FlowModulesViewer.svelte.d.ts +0 -18
- package/components/flows/content/FlowBranchesWrapper.svelte +0 -140
- package/components/flows/content/FlowBranchesWrapper.svelte.d.ts +0 -19
- package/components/landing/FlowGettingStarted.svelte +0 -50
- package/components/landing/FlowGettingStarted.svelte.d.ts +0 -19
- package/components/landing/FlowLandingBox.svelte +0 -39
- package/components/landing/FlowLandingBox.svelte.d.ts +0 -17
- package/components/landing/RessourceGettingStarted.svelte +0 -21
- package/components/landing/RessourceGettingStarted.svelte.d.ts +0 -19
- package/components/landing/ScriptBox.svelte +0 -52
- package/components/landing/ScriptBox.svelte.d.ts +0 -17
- package/components/landing/ScriptGettingStarted.svelte +0 -48
- package/components/landing/ScriptGettingStarted.svelte.d.ts +0 -19
- package/components/scripts/CreateActions.svelte +0 -114
- package/components/scripts/CreateActions.svelte.d.ts +0 -14
package/script_helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Script } from "./gen";
|
|
2
|
-
export declare const PYTHON_INIT_CODE = "import os\nimport wmill\
|
|
2
|
+
export declare const PYTHON_INIT_CODE = "import os\nimport wmill\n\n# You can import any package from PyPI, even if the assistant complains\n\n\"\"\"\nUse Cmd/Ctrl + S to autoformat the code. Reset content in the bar to start from a clean template.\nThe client is used to interact with windmill itself through its standard API.\nOne can explore the methods available through autocompletion of `wmill.XXX`.\n\"\"\"\n\ndef main(no_default: str,\n name = \"Nicolas Bourbaki\",\n age = 42,\n obj: dict = {\"even\": \"dicts\"},\n l: list = [\"or\", \"lists!\"],\n file_: bytes = bytes(0)):\n \"\"\"A main function is required for the script to be able to accept arguments.\n Types are recommended.\"\"\"\n print(f\"Hello World and a warm welcome especially to {name}\")\n print(\"and its acolytes..\", age, obj, l, len(file_))\n # retrieve variables, including secrets by querying the windmill platform.\n # secret fetching is audited by windmill.\n\n try:\n secret = wmill.get_variable(\"g/all/pretty_secret\")\n except:\n secret = \"No secret yet at g/all/pretty_secret!\"\n\n print(f\"The variable at `g/all/pretty_secret`: {secret}\")\n \n # Get last state of this script execution by the same trigger/user\n last_state = wmill.get_state()\n new_state = {\"foo\": 42} if last_state is None else last_state\n new_state[\"foo\"] += 1\n wmill.set_state(new_state)\n\n # fetch reserved variables as environment variables\n user = os.environ.get(\"WM_USERNAME\")\n # the return value is then parsed and can be retrieved by other scripts conveniently\n return {\"splitted\": name.split(), \"user\": user, \"state\": new_state}\n";
|
|
3
3
|
export declare const DENO_INIT_CODE: string;
|
|
4
4
|
export declare const GO_INIT_CODE = "package inner\n\nimport (\n\t\"fmt\"\n\t\"rsc.io/quote\"\n // wmill \"github.com/windmill-labs/windmill-go-client\"\n)\n\n// the main must return (interface{}, error)\n\nfunc main(x string, nested struct{ Foo string `json:\"foo\"` }) (interface{}, error) {\n\tfmt.Println(\"Hello, World\")\n\tfmt.Println(nested.Foo)\n\tfmt.Println(quote.Opt())\n // v, _ := wmill.GetVariable(\"g/all/pretty_secret\")\n return x, nil\n}\n";
|
|
5
5
|
export declare const GO_FAILURE_MODULE_CODE = "package inner\n\nimport (\n\t\"fmt\"\n \"os\"\n)\n\n// connect the error parameter to 'previous_result.error'\n\nfunc main(error string) (interface{}, error) {\n\tfmt.Println(error)\n\tfmt.Println(\"job\", os.Getenv(\"WM_JOB_ID\"))\n return x, nil\n}\n";
|
|
@@ -8,8 +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;
|
|
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";
|
|
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";
|
|
13
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}";
|
|
14
17
|
export declare function isInitialCode(content: string): boolean;
|
|
15
|
-
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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export const PYTHON_INIT_CODE = `import os
|
|
2
2
|
import wmill
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
# You can import any package from PyPI, even if the assistant complains
|
|
4
5
|
|
|
5
6
|
"""
|
|
6
|
-
Use Cmd/Ctrl + S to autoformat the code.
|
|
7
|
+
Use Cmd/Ctrl + S to autoformat the code. Reset content in the bar to start from a clean template.
|
|
7
8
|
The client is used to interact with windmill itself through its standard API.
|
|
8
9
|
One can explore the methods available through autocompletion of \`wmill.XXX\`.
|
|
9
10
|
"""
|
|
@@ -13,12 +14,11 @@ def main(no_default: str,
|
|
|
13
14
|
age = 42,
|
|
14
15
|
obj: dict = {"even": "dicts"},
|
|
15
16
|
l: list = ["or", "lists!"],
|
|
16
|
-
file_: bytes = bytes(0)
|
|
17
|
-
dtime: datetime = datetime.now()):
|
|
17
|
+
file_: bytes = bytes(0)):
|
|
18
18
|
"""A main function is required for the script to be able to accept arguments.
|
|
19
19
|
Types are recommended."""
|
|
20
20
|
print(f"Hello World and a warm welcome especially to {name}")
|
|
21
|
-
print("and its acolytes..", age, obj, l, len(file_)
|
|
21
|
+
print("and its acolytes..", age, obj, l, len(file_))
|
|
22
22
|
# retrieve variables, including secrets by querying the windmill platform.
|
|
23
23
|
# secret fetching is audited by windmill.
|
|
24
24
|
|
|
@@ -27,18 +27,21 @@ def main(no_default: str,
|
|
|
27
27
|
except:
|
|
28
28
|
secret = "No secret yet at g/all/pretty_secret!"
|
|
29
29
|
|
|
30
|
-
print(f"The
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
print(f"The variable at \`g/all/pretty_secret\`: {secret}")
|
|
31
|
+
|
|
32
|
+
# Get last state of this script execution by the same trigger/user
|
|
33
|
+
last_state = wmill.get_state()
|
|
34
|
+
new_state = {"foo": 42} if last_state is None else last_state
|
|
35
|
+
new_state["foo"] += 1
|
|
36
|
+
wmill.set_state(new_state)
|
|
37
|
+
|
|
33
38
|
# fetch reserved variables as environment variables
|
|
34
39
|
user = os.environ.get("WM_USERNAME")
|
|
35
40
|
# the return value is then parsed and can be retrieved by other scripts conveniently
|
|
36
|
-
return {"
|
|
41
|
+
return {"splitted": name.split(), "user": user, "state": new_state}
|
|
37
42
|
`;
|
|
38
|
-
export const DENO_INIT_CODE = `//
|
|
39
|
-
// (Ctrl+space to cache dependencies on imports hover).
|
|
43
|
+
export const DENO_INIT_CODE = `// Ctrl+space to cache dependencies on imports hover, Ctrl+S to format.
|
|
40
44
|
|
|
41
|
-
// you can use npm imports directly!
|
|
42
45
|
// import { toWords } from "npm:number-to-words@1"
|
|
43
46
|
// import * as wmill from "https://deno.land/x/windmill@v${__pkg__.version}/mod.ts"
|
|
44
47
|
|
|
@@ -125,7 +128,7 @@ export const POSTGRES_INIT_CODE = `import {
|
|
|
125
128
|
//PG parameterized statement. No SQL injection is possible.
|
|
126
129
|
export async function main(
|
|
127
130
|
db: Resource<"postgresql"> = "$res:g/all/demodb",
|
|
128
|
-
key:
|
|
131
|
+
key: number,
|
|
129
132
|
value: string,
|
|
130
133
|
) {
|
|
131
134
|
const query = await pgSql(
|
|
@@ -133,6 +136,22 @@ export async function main(
|
|
|
133
136
|
)\`INSERT INTO demo VALUES (\${key}, \${value}) RETURNING *\`;
|
|
134
137
|
return query.rows;
|
|
135
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
|
+
}`;
|
|
136
155
|
export const BASH_INIT_CODE = `
|
|
137
156
|
# arguments of the form X="$I" are parsed as parameters X of type string
|
|
138
157
|
msg="$1"
|
|
@@ -144,20 +163,57 @@ export const DENO_INIT_CODE_TRIGGER = `import * as wmill from "https://deno.land
|
|
|
144
163
|
|
|
145
164
|
export async function main() {
|
|
146
165
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
166
|
+
// A common trigger script would follow this pattern:
|
|
167
|
+
// 1. Get the last saved state
|
|
168
|
+
// const state = await wmill.getState()
|
|
169
|
+
// 2. Get the actual state from the external service
|
|
170
|
+
// const newState = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json()
|
|
171
|
+
// 3. Compare the two states and update the internal state
|
|
172
|
+
// await wmill.setState(newState)
|
|
173
|
+
// 4. Return the new rows
|
|
174
|
+
// return range from (state to newState)
|
|
156
175
|
|
|
157
|
-
|
|
176
|
+
return [1,2,3]
|
|
158
177
|
|
|
159
|
-
|
|
160
|
-
|
|
178
|
+
// In subsequent scripts, you may refer to each row/value returned by the trigger script using
|
|
179
|
+
// 'flow_input.iter.value'
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
export const PYTHON_INIT_CODE_TRIGGER = `import wmill
|
|
183
|
+
|
|
184
|
+
def main():
|
|
185
|
+
# A common trigger script would follow this pattern:
|
|
186
|
+
# 1. Get the last saved state
|
|
187
|
+
# const state = wnmill.get_state()
|
|
188
|
+
# 2. Get the actual state from the external service
|
|
189
|
+
# const newState = ...
|
|
190
|
+
# 3. Compare the two states and update the internal state
|
|
191
|
+
# wmill.setState(newState)
|
|
192
|
+
# 4. Return the new rows
|
|
193
|
+
# return range from (state to newState)
|
|
194
|
+
return [1, 2, 3]
|
|
195
|
+
`;
|
|
196
|
+
export const GO_INIT_CODE_TRIGGER = `package inner
|
|
197
|
+
|
|
198
|
+
import (
|
|
199
|
+
wmill "github.com/windmill-labs/windmill-go-client"
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
func main() (interface{}, error) {
|
|
203
|
+
|
|
204
|
+
// A common trigger script would follow this pattern:
|
|
205
|
+
// 1. Get the last saved state
|
|
206
|
+
state, _ := wmill.GetState()
|
|
207
|
+
// 2. Get the actual state from the external service
|
|
208
|
+
// newState := ...
|
|
209
|
+
// 3. Compare the two states and update the internal state
|
|
210
|
+
wmill.SetState(4)
|
|
211
|
+
// 4. Return the new rows
|
|
212
|
+
|
|
213
|
+
return state, nil
|
|
214
|
+
|
|
215
|
+
// In subsequent scripts, you may refer to each row/value returned by the trigger script using
|
|
216
|
+
// 'flow_input.iter.value'
|
|
161
217
|
}
|
|
162
218
|
`;
|
|
163
219
|
export const DENO_INIT_CODE_APPROVAL = `import * as wmill from "https://deno.land/x/windmill@v1.41.0/mod.ts"
|
|
@@ -165,7 +221,7 @@ export const DENO_INIT_CODE_APPROVAL = `import * as wmill from "https://deno.lan
|
|
|
165
221
|
export async function main(approver?: string) {
|
|
166
222
|
return wmill.getResumeEndpoints(approver)
|
|
167
223
|
}`;
|
|
168
|
-
const ALL_INITIAL_CODE = [PYTHON_INIT_CODE, DENO_INIT_CODE, POSTGRES_INIT_CODE, DENO_INIT_CODE_TRIGGER, DENO_INIT_CODE_CLEAR, PYTHON_INIT_CODE_CLEAR, DENO_INIT_CODE_APPROVAL, DENO_FAILURE_MODULE_CODE];
|
|
224
|
+
const ALL_INITIAL_CODE = [PYTHON_INIT_CODE, PYTHON_INIT_CODE_TRIGGER, DENO_INIT_CODE, POSTGRES_INIT_CODE, DENO_INIT_CODE_TRIGGER, DENO_INIT_CODE_CLEAR, PYTHON_INIT_CODE_CLEAR, DENO_INIT_CODE_APPROVAL, DENO_FAILURE_MODULE_CODE];
|
|
169
225
|
export function isInitialCode(content) {
|
|
170
226
|
for (const code of ALL_INITIAL_CODE) {
|
|
171
227
|
if (content === code) {
|
|
@@ -186,6 +242,9 @@ export function initialCode(language, kind, subkind) {
|
|
|
186
242
|
else if (subkind === 'pgsql') {
|
|
187
243
|
return POSTGRES_INIT_CODE;
|
|
188
244
|
}
|
|
245
|
+
else if (subkind === 'mysql') {
|
|
246
|
+
return MYSQL_INIT_CODE;
|
|
247
|
+
}
|
|
189
248
|
else {
|
|
190
249
|
return DENO_INIT_CODE;
|
|
191
250
|
}
|
|
@@ -207,6 +266,9 @@ export function initialCode(language, kind, subkind) {
|
|
|
207
266
|
else if (kind === 'failure') {
|
|
208
267
|
return PYTHON_FAILURE_MODULE_CODE;
|
|
209
268
|
}
|
|
269
|
+
else if (kind === 'trigger') {
|
|
270
|
+
return PYTHON_INIT_CODE_TRIGGER;
|
|
271
|
+
}
|
|
210
272
|
else {
|
|
211
273
|
return PYTHON_INIT_CODE;
|
|
212
274
|
}
|
|
@@ -218,6 +280,9 @@ export function initialCode(language, kind, subkind) {
|
|
|
218
280
|
if (kind === 'failure') {
|
|
219
281
|
return GO_FAILURE_MODULE_CODE;
|
|
220
282
|
}
|
|
283
|
+
else if (kind === 'trigger') {
|
|
284
|
+
return GO_INIT_CODE_TRIGGER;
|
|
285
|
+
}
|
|
221
286
|
else {
|
|
222
287
|
return GO_INIT_CODE;
|
|
223
288
|
}
|
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/stateMachine.d.ts
CHANGED
|
@@ -7,19 +7,19 @@ export interface StateMachineTransition<T extends readonly string[]> {
|
|
|
7
7
|
from?: Partial<Record<T[number], TransitionFromFunction<T>>>;
|
|
8
8
|
to?: Partial<Record<T[number], TransitionToFunction<T>>>;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type StateMachineInfo<T extends readonly string[]> = {
|
|
11
11
|
states: StateMachine<T>['states'];
|
|
12
12
|
currentState: StateMachine<T>['currentState'];
|
|
13
13
|
};
|
|
14
14
|
/** The return value should be a `state` that is available on the current machine. */
|
|
15
|
-
export
|
|
15
|
+
export type TransitionFromFunction<T extends readonly string[]> = (info: StateMachineInfo<T> & {
|
|
16
16
|
desiredState: T[number];
|
|
17
17
|
}) => T[number];
|
|
18
18
|
/** Callback after the state has been changed. */
|
|
19
|
-
export
|
|
19
|
+
export type TransitionToFunction<T extends readonly string[]> = (info: StateMachineInfo<T> & {
|
|
20
20
|
previousState: T[number];
|
|
21
21
|
}) => T[number];
|
|
22
|
-
|
|
22
|
+
type StateStore<T extends readonly string[]> = Readable<StateMachine<T>> & {
|
|
23
23
|
setState: (state: T[number]) => StateMachineInfo<T>;
|
|
24
24
|
};
|
|
25
25
|
/** **IMPORTANT:** use the `as const` syntax on the states array to get type safety.
|
package/stores.d.ts
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
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>;
|
|
18
|
+
export declare const starStore: import("svelte/store").Writable<number>;
|
|
14
19
|
export declare const usersWorkspaceStore: import("svelte/store").Writable<UserWorkspaceList | undefined>;
|
|
15
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
|
+
}>>;
|
|
16
26
|
export declare const hubScripts: import("svelte/store").Writable<{
|
|
17
27
|
path: string;
|
|
18
28
|
summary: string;
|
|
19
29
|
approved: boolean;
|
|
20
30
|
kind: string;
|
|
21
31
|
app: string;
|
|
32
|
+
ask_id: number;
|
|
22
33
|
}[] | undefined>;
|
|
23
34
|
export declare function clearStores(): void;
|
package/stores.js
CHANGED
|
@@ -1,17 +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);
|
|
9
|
+
export const starStore = writable(1);
|
|
8
10
|
export const usersWorkspaceStore = writable(undefined);
|
|
9
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
|
+
});
|
|
10
29
|
export const hubScripts = writable(undefined);
|
|
11
30
|
if (browser) {
|
|
12
31
|
workspaceStore.subscribe(async (workspace) => {
|
|
13
32
|
if (workspace) {
|
|
14
|
-
localStorage.setItem(
|
|
33
|
+
localStorage.setItem("workspace", String(workspace));
|
|
15
34
|
userStore.set(await getUserExt(workspace));
|
|
16
35
|
}
|
|
17
36
|
else {
|
|
@@ -20,7 +39,7 @@ if (browser) {
|
|
|
20
39
|
});
|
|
21
40
|
}
|
|
22
41
|
export function clearStores() {
|
|
23
|
-
localStorage.removeItem(
|
|
42
|
+
localStorage.removeItem("workspace");
|
|
24
43
|
userStore.set(undefined);
|
|
25
44
|
workspaceStore.set(undefined);
|
|
26
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;
|
|
@@ -16,7 +16,7 @@ export declare function validatePassword(password: string): boolean;
|
|
|
16
16
|
export declare function clickOutside(node: Node): {
|
|
17
17
|
destroy(): void;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type DropdownType = 'action' | 'delete';
|
|
20
20
|
export interface DropdownItem {
|
|
21
21
|
displayName: string;
|
|
22
22
|
eventName?: string;
|
|
@@ -62,13 +62,14 @@ 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;
|
|
68
69
|
export declare function mapUserToUserExt(user: User): UserExt;
|
|
69
70
|
export declare function schemaToTsType(schema: Schema): string;
|
|
70
71
|
export declare function schemaToObject(schema: Schema, args: Record<string, any>): Object;
|
|
71
|
-
export
|
|
72
|
+
export type InputCat = 'string' | 'number' | 'boolean' | 'list' | 'resource-object' | 'enum' | 'date' | 'base64' | 'resource-string' | 'object' | 'sql';
|
|
72
73
|
export declare function setInputCat(type: string | undefined, format: string | undefined, itemsType: string | undefined, enum_: any, contentEncoding: string | undefined): InputCat;
|
|
73
74
|
export declare function scriptPathToHref(path: string): string;
|
|
74
75
|
export declare function getScriptByPath(path: string): Promise<{
|
|
@@ -91,3 +92,6 @@ export declare function scriptToHubUrl(content: string, summary: string, descrip
|
|
|
91
92
|
export declare function classNames(...classes: Array<string | undefined>): string;
|
|
92
93
|
export declare function scriptLangToEditorLang(lang: Script.language): 'typescript' | 'python' | 'go' | 'shell';
|
|
93
94
|
export declare function copyToClipboard(value: string, sendToast?: boolean): Promise<boolean>;
|
|
95
|
+
export declare function pluralize(quantity: number, word: string, customPlural?: string): string;
|
|
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';
|
|
@@ -37,23 +38,26 @@ export function displayDaysAgo(dateString) {
|
|
|
37
38
|
else {
|
|
38
39
|
let dAgo = daysAgo(date);
|
|
39
40
|
if (dAgo == 0) {
|
|
40
|
-
return `
|
|
41
|
+
return `yesterday at ${date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`;
|
|
41
42
|
}
|
|
42
43
|
else if (dAgo > 7) {
|
|
43
|
-
return `${dAgo + 1} days ago at ${date.toLocaleTimeString([], {
|
|
44
|
+
return `${dAgo + 1} days ago at ${date.toLocaleTimeString([], {
|
|
45
|
+
hour: '2-digit',
|
|
46
|
+
minute: '2-digit'
|
|
47
|
+
})}`;
|
|
44
48
|
}
|
|
45
49
|
else {
|
|
46
50
|
return displayDate(dateString);
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
|
-
export function displayDate(dateString) {
|
|
54
|
+
export function displayDate(dateString, displaySecond = false) {
|
|
51
55
|
const date = new Date(dateString ?? '');
|
|
52
56
|
if (date.toString() === 'Invalid Date') {
|
|
53
57
|
return '';
|
|
54
58
|
}
|
|
55
59
|
else {
|
|
56
|
-
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 })}`;
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
export function msToSec(ms) {
|
|
@@ -143,7 +147,7 @@ export function canWrite(path, extra_perms, user) {
|
|
|
143
147
|
if (!user) {
|
|
144
148
|
return false;
|
|
145
149
|
}
|
|
146
|
-
if (user.is_admin) {
|
|
150
|
+
if (user.is_admin || user.is_super_admin) {
|
|
147
151
|
return true;
|
|
148
152
|
}
|
|
149
153
|
let userOwner = `u/${user.username}`;
|
|
@@ -239,6 +243,9 @@ export function groupBy(scripts, toGroup, dflts = []) {
|
|
|
239
243
|
}
|
|
240
244
|
});
|
|
241
245
|
}
|
|
246
|
+
export function removeMarkdown(text) {
|
|
247
|
+
return text.replace(/[[\*|\-|#\_]/g, '');
|
|
248
|
+
}
|
|
242
249
|
export function truncate(s, n, suffix = '...') {
|
|
243
250
|
if (!s) {
|
|
244
251
|
return '';
|
|
@@ -362,7 +369,7 @@ export async function getScriptByPath(path) {
|
|
|
362
369
|
const { content, language, schema } = await ScriptService.getHubScriptByPath({ path });
|
|
363
370
|
return {
|
|
364
371
|
content,
|
|
365
|
-
language,
|
|
372
|
+
language: language,
|
|
366
373
|
schema
|
|
367
374
|
};
|
|
368
375
|
}
|
|
@@ -471,3 +478,20 @@ export async function copyToClipboard(value, sendToast = true) {
|
|
|
471
478
|
sendUserToast(success ? 'Copied to clipboard!' : "Couldn't copy to clipboard", !success);
|
|
472
479
|
return success;
|
|
473
480
|
}
|
|
481
|
+
export function pluralize(quantity, word, customPlural) {
|
|
482
|
+
if (quantity <= 1) {
|
|
483
|
+
return `${quantity} ${word}`;
|
|
484
|
+
}
|
|
485
|
+
else if (customPlural) {
|
|
486
|
+
return `${quantity} ${customPlural}}`;
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
return `${quantity} ${word}s`;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
export function capitalize(word) {
|
|
493
|
+
return word ? word.charAt(0).toUpperCase() + word.slice(1) : '';
|
|
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 declare type ButtonAndDropdownProps = typeof __propDef.props;
|
|
19
|
-
export declare type ButtonAndDropdownEvents = typeof __propDef.events;
|
|
20
|
-
export declare type ButtonAndDropdownSlots = typeof __propDef.slots;
|
|
21
|
-
export default class ButtonAndDropdown extends SvelteComponentTyped<ButtonAndDropdownProps, ButtonAndDropdownEvents, ButtonAndDropdownSlots> {
|
|
22
|
-
}
|
|
23
|
-
export {};
|