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.
Files changed (611) hide show
  1. package/common.d.ts +6 -5
  2. package/components/ApiConnectForm.svelte +56 -0
  3. package/components/ApiConnectForm.svelte.d.ts +19 -0
  4. package/components/AppConnect.svelte +243 -180
  5. package/components/AppConnect.svelte.d.ts +4 -3
  6. package/components/ArgInfo.svelte +8 -4
  7. package/components/ArgInfo.svelte.d.ts +3 -3
  8. package/components/ArgInput.svelte +87 -27
  9. package/components/ArgInput.svelte.d.ts +11 -3
  10. package/components/Badge.svelte.d.ts +3 -3
  11. package/components/Button.svelte +1 -1
  12. package/components/Button.svelte.d.ts +3 -3
  13. package/components/CenteredModal.svelte +20 -13
  14. package/components/CenteredModal.svelte.d.ts +3 -3
  15. package/components/CenteredPage.svelte +1 -1
  16. package/components/CenteredPage.svelte.d.ts +6 -2
  17. package/components/ChevronButton.svelte.d.ts +3 -3
  18. package/components/CollapseLink.svelte.d.ts +3 -3
  19. package/components/CronInput.svelte +2 -2
  20. package/components/CronInput.svelte.d.ts +3 -3
  21. package/components/DisplayResult.svelte +39 -2
  22. package/components/DisplayResult.svelte.d.ts +3 -3
  23. package/components/Dropdown.svelte +73 -94
  24. package/components/Dropdown.svelte.d.ts +4 -6
  25. package/components/Editor.svelte +19 -7
  26. package/components/Editor.svelte.d.ts +4 -3
  27. package/components/EditorBar.svelte +92 -90
  28. package/components/EditorBar.svelte.d.ts +4 -3
  29. package/components/FieldHeader.svelte +4 -3
  30. package/components/FieldHeader.svelte.d.ts +3 -3
  31. package/components/FlowBuilder.svelte +86 -57
  32. package/components/FlowBuilder.svelte.d.ts +4 -3
  33. package/components/FlowGraphViewer.svelte +178 -0
  34. package/components/FlowGraphViewer.svelte.d.ts +24 -0
  35. package/components/FlowJobResult.svelte +6 -1
  36. package/components/FlowJobResult.svelte.d.ts +5 -3
  37. package/components/FlowMetadata.svelte +4 -2
  38. package/components/FlowMetadata.svelte.d.ts +3 -3
  39. package/components/FlowPreviewContent.svelte +58 -81
  40. package/components/FlowPreviewContent.svelte.d.ts +6 -3
  41. package/components/FlowStatusViewer.svelte +284 -109
  42. package/components/FlowStatusViewer.svelte.d.ts +6 -3
  43. package/components/FlowViewer.svelte +5 -80
  44. package/components/FlowViewer.svelte.d.ts +4 -3
  45. package/components/GroupModal.svelte.d.ts +3 -3
  46. package/components/HighlightCode.svelte +1 -1
  47. package/components/HighlightCode.svelte.d.ts +4 -3
  48. package/components/IconedPath.svelte +16 -6
  49. package/components/IconedPath.svelte.d.ts +5 -3
  50. package/components/IconedResourceType.svelte +6 -61
  51. package/components/IconedResourceType.svelte.d.ts +3 -3
  52. package/components/InputTransformForm.svelte +139 -89
  53. package/components/InputTransformForm.svelte.d.ts +10 -5
  54. package/components/InputTransformsViewer.svelte.d.ts +3 -3
  55. package/components/InviteGlobalUser.svelte +2 -2
  56. package/components/InviteGlobalUser.svelte.d.ts +4 -4
  57. package/components/InviteUser.svelte +20 -6
  58. package/components/InviteUser.svelte.d.ts +4 -4
  59. package/components/ItemPicker.svelte +103 -44
  60. package/components/ItemPicker.svelte.d.ts +8 -5
  61. package/components/JobArgs.svelte +5 -5
  62. package/components/JobArgs.svelte.d.ts +3 -3
  63. package/components/JobStatus.svelte +19 -13
  64. package/components/JobStatus.svelte.d.ts +3 -3
  65. package/components/LogViewer.svelte +28 -5
  66. package/components/LogViewer.svelte.d.ts +4 -3
  67. package/components/Modal.svelte.d.ts +3 -3
  68. package/components/ModulePreview.svelte +8 -0
  69. package/components/ModulePreview.svelte.d.ts +3 -3
  70. package/components/ModuleStatus.svelte +38 -0
  71. package/components/ModuleStatus.svelte.d.ts +18 -0
  72. package/components/ObjectResourceInput.svelte +19 -47
  73. package/components/ObjectResourceInput.svelte.d.ts +3 -3
  74. package/components/ObjectTypeNarrowing.svelte.d.ts +3 -3
  75. package/components/PageHeader.svelte +2 -2
  76. package/components/PageHeader.svelte.d.ts +3 -3
  77. package/components/Password.svelte +2 -2
  78. package/components/Password.svelte.d.ts +4 -4
  79. package/components/Path.svelte +6 -3
  80. package/components/Path.svelte.d.ts +5 -4
  81. package/components/Popover.svelte +7 -1
  82. package/components/Popover.svelte.d.ts +6 -4
  83. package/components/RadioButton.svelte.d.ts +3 -3
  84. package/components/Required.svelte.d.ts +3 -3
  85. package/components/ResourceEditor.svelte +107 -169
  86. package/components/ResourceEditor.svelte.d.ts +3 -5
  87. package/components/ResourcePicker.svelte +41 -28
  88. package/components/ResourcePicker.svelte.d.ts +3 -3
  89. package/components/ResourceTypePicker.svelte.d.ts +3 -3
  90. package/components/RunChart.svelte.d.ts +3 -3
  91. package/components/RunForm.svelte.d.ts +3 -3
  92. package/components/SchemaEditor.svelte +57 -24
  93. package/components/SchemaEditor.svelte.d.ts +3 -3
  94. package/components/SchemaEditorProperty.svelte.d.ts +3 -3
  95. package/components/SchemaForm.svelte +98 -33
  96. package/components/SchemaForm.svelte.d.ts +9 -4
  97. package/components/SchemaModal.svelte +11 -10
  98. package/components/SchemaModal.svelte.d.ts +4 -4
  99. package/components/SchemaViewer.svelte.d.ts +3 -3
  100. package/components/ScriptBuilder.svelte +202 -189
  101. package/components/ScriptBuilder.svelte.d.ts +4 -4
  102. package/components/ScriptEditor.svelte +71 -69
  103. package/components/ScriptEditor.svelte.d.ts +5 -3
  104. package/components/ScriptPicker.svelte +28 -38
  105. package/components/ScriptPicker.svelte.d.ts +5 -4
  106. package/components/ScriptSchema.svelte +12 -31
  107. package/components/ScriptSchema.svelte.d.ts +3 -4
  108. package/components/SearchItems.svelte +29 -0
  109. package/components/SearchItems.svelte.d.ts +23 -0
  110. package/components/ShareModal.svelte.d.ts +3 -3
  111. package/components/SharedBadge.svelte +4 -3
  112. package/components/SharedBadge.svelte.d.ts +3 -3
  113. package/components/SimpleEditor.svelte +36 -11
  114. package/components/SimpleEditor.svelte.d.ts +5 -4
  115. package/components/Star.svelte +42 -0
  116. package/components/Star.svelte.d.ts +19 -0
  117. package/components/StringTypeNarrowing.svelte.d.ts +3 -3
  118. package/components/SuperadminSettings.svelte +26 -52
  119. package/components/SuperadminSettings.svelte.d.ts +3 -3
  120. package/components/TableCustom.svelte +1 -1
  121. package/components/TableCustom.svelte.d.ts +3 -3
  122. package/components/TableSimple.svelte +1 -1
  123. package/components/TableSimple.svelte.d.ts +3 -3
  124. package/components/TestJobLoader.svelte +61 -32
  125. package/components/TestJobLoader.svelte.d.ts +9 -3
  126. package/components/Toggle.svelte.d.ts +3 -3
  127. package/components/ToggleHubWorkspace.svelte +16 -0
  128. package/components/ToggleHubWorkspace.svelte.d.ts +16 -0
  129. package/components/Tooltip.svelte.d.ts +4 -4
  130. package/components/UserSettings.svelte.d.ts +3 -3
  131. package/components/VariableEditor.svelte +89 -37
  132. package/components/VariableEditor.svelte.d.ts +5 -3
  133. package/components/apps/CreateApp.svelte +68 -0
  134. package/components/apps/CreateApp.svelte.d.ts +14 -0
  135. package/components/apps/components/DisplayComponent.svelte +16 -0
  136. package/components/apps/components/DisplayComponent.svelte.d.ts +20 -0
  137. package/components/apps/components/buttons/AppButton.svelte +49 -0
  138. package/components/apps/components/buttons/AppButton.svelte.d.ts +25 -0
  139. package/components/apps/components/dataDisplay/AppBarChart.svelte +42 -0
  140. package/components/apps/components/dataDisplay/AppBarChart.svelte.d.ts +21 -0
  141. package/components/apps/components/dataDisplay/AppPieChart.svelte +43 -0
  142. package/components/apps/components/dataDisplay/AppPieChart.svelte.d.ts +21 -0
  143. package/components/apps/components/dataDisplay/AppTable.svelte +132 -0
  144. package/components/apps/components/dataDisplay/AppTable.svelte.d.ts +23 -0
  145. package/components/apps/components/dataDisplay/AppText.svelte +22 -0
  146. package/components/apps/components/dataDisplay/AppText.svelte.d.ts +22 -0
  147. package/components/apps/components/dataDisplay/app.md +49 -0
  148. package/components/apps/components/form/AppForm.svelte +50 -0
  149. package/components/apps/components/form/AppForm.svelte.d.ts +25 -0
  150. package/components/apps/components/helpers/AlignWrapper.svelte +30 -0
  151. package/components/apps/components/helpers/AlignWrapper.svelte.d.ts +20 -0
  152. package/components/apps/components/helpers/DebouncedInput.svelte +24 -0
  153. package/components/apps/components/helpers/DebouncedInput.svelte.d.ts +20 -0
  154. package/components/apps/components/helpers/InputValue.svelte +46 -0
  155. package/components/apps/components/helpers/InputValue.svelte.d.ts +18 -0
  156. package/components/apps/components/helpers/NonRunnableComponent.svelte +20 -0
  157. package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +21 -0
  158. package/components/apps/components/helpers/RunnableComponent.svelte +188 -0
  159. package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +27 -0
  160. package/components/apps/components/helpers/RunnableWrapper.svelte +32 -0
  161. package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +26 -0
  162. package/components/apps/components/numberInputs/AppNumberInput.svelte +36 -0
  163. package/components/apps/components/numberInputs/AppNumberInput.svelte.d.ts +20 -0
  164. package/components/apps/components/selectInputs/AppCheckbox.svelte +28 -0
  165. package/components/apps/components/selectInputs/AppCheckbox.svelte.d.ts +22 -0
  166. package/components/apps/components/textInputs/AppTextInput.svelte +21 -0
  167. package/components/apps/components/textInputs/AppTextInput.svelte.d.ts +20 -0
  168. package/components/apps/editor/AppEditor.svelte +116 -0
  169. package/components/apps/editor/AppEditor.svelte.d.ts +19 -0
  170. package/components/apps/editor/AppEditorHeader.svelte +75 -0
  171. package/components/apps/editor/AppEditorHeader.svelte.d.ts +19 -0
  172. package/components/apps/editor/AppPreview.svelte +42 -0
  173. package/components/apps/editor/AppPreview.svelte.d.ts +17 -0
  174. package/components/apps/editor/ComponentEditor.svelte +85 -0
  175. package/components/apps/editor/ComponentEditor.svelte.d.ts +20 -0
  176. package/components/apps/editor/ComponentHeader.svelte +28 -0
  177. package/components/apps/editor/ComponentHeader.svelte.d.ts +20 -0
  178. package/components/apps/editor/GridEditor.svelte +94 -0
  179. package/components/apps/editor/GridEditor.svelte.d.ts +14 -0
  180. package/components/apps/editor/RecomputeAllComponents.svelte +28 -0
  181. package/components/apps/editor/RecomputeAllComponents.svelte.d.ts +14 -0
  182. package/components/apps/editor/componentsPanel/ComponentList.svelte +160 -0
  183. package/components/apps/editor/componentsPanel/ComponentList.svelte.d.ts +14 -0
  184. package/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
  185. package/components/apps/editor/componentsPanel/componentDefaultProps.js +5 -0
  186. package/components/apps/editor/componentsPanel/componentStaticValues.d.ts +6 -0
  187. package/components/apps/editor/componentsPanel/componentStaticValues.js +8 -0
  188. package/components/apps/editor/componentsPanel/data.d.ts +3 -0
  189. package/components/apps/editor/componentsPanel/data.js +273 -0
  190. package/components/apps/editor/componentsPanel/store.d.ts +9 -0
  191. package/components/apps/editor/componentsPanel/store.js +16 -0
  192. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +22 -0
  193. package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte.d.ts +19 -0
  194. package/components/apps/editor/contextPanel/ContextPanel.svelte +192 -0
  195. package/components/apps/editor/contextPanel/ContextPanel.svelte.d.ts +16 -0
  196. package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte +29 -0
  197. package/components/apps/editor/contextPanel/InlineScriptCreationPanel.svelte.d.ts +16 -0
  198. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte +67 -0
  199. package/components/apps/editor/settingsPanel/ArrayStaticInputEditor.svelte.d.ts +55 -0
  200. package/components/apps/editor/settingsPanel/ComponentPanel.svelte +221 -0
  201. package/components/apps/editor/settingsPanel/ComponentPanel.svelte.d.ts +18 -0
  202. package/components/apps/editor/settingsPanel/ConnectedInputEditor.svelte +70 -0
  203. package/components/apps/editor/settingsPanel/ConnectedInputEditor.svelte.d.ts +17 -0
  204. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +11 -0
  205. package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +18 -0
  206. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +67 -0
  207. package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +19 -0
  208. package/components/apps/editor/settingsPanel/PickFlow.svelte +38 -0
  209. package/components/apps/editor/settingsPanel/PickFlow.svelte.d.ts +16 -0
  210. package/components/apps/editor/settingsPanel/PickInlineScript.svelte +38 -0
  211. package/components/apps/editor/settingsPanel/PickInlineScript.svelte.d.ts +20 -0
  212. package/components/apps/editor/settingsPanel/Recompute.svelte +46 -0
  213. package/components/apps/editor/settingsPanel/Recompute.svelte.d.ts +17 -0
  214. package/components/apps/editor/settingsPanel/SectionPanel.svelte +70 -0
  215. package/components/apps/editor/settingsPanel/SectionPanel.svelte.d.ts +19 -0
  216. package/components/apps/editor/settingsPanel/StaticInputEditor.svelte +46 -0
  217. package/components/apps/editor/settingsPanel/StaticInputEditor.svelte.d.ts +18 -0
  218. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte +17 -0
  219. package/components/apps/editor/settingsPanel/SubTypeEditor.svelte.d.ts +19 -0
  220. package/components/apps/editor/settingsPanel/TableActionLabel.svelte +10 -0
  221. package/components/apps/editor/settingsPanel/TableActionLabel.svelte.d.ts +17 -0
  222. package/components/apps/editor/settingsPanel/TableActions.svelte +111 -0
  223. package/components/apps/editor/settingsPanel/TableActions.svelte.d.ts +19 -0
  224. package/components/apps/editor/settingsPanel/UserInputEditor.svelte +2 -0
  225. package/components/apps/editor/settingsPanel/UserInputEditor.svelte.d.ts +14 -0
  226. package/components/apps/editor/settingsPanel/common/PanelSection.svelte +12 -0
  227. package/components/apps/editor/settingsPanel/common/PanelSection.svelte.d.ts +20 -0
  228. package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte +53 -0
  229. package/components/apps/editor/settingsPanel/mainInput/InlineScriptList.svelte.d.ts +21 -0
  230. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +98 -0
  231. package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte.d.ts +18 -0
  232. package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +81 -0
  233. package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte.d.ts +20 -0
  234. package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte +81 -0
  235. package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte.d.ts +20 -0
  236. package/components/apps/gridUtils.d.ts +11 -0
  237. package/components/apps/gridUtils.js +24 -0
  238. package/components/apps/inputType.d.ts +62 -0
  239. package/components/apps/inputType.js +1 -0
  240. package/components/apps/rx.d.ts +27 -0
  241. package/components/apps/rx.js +99 -0
  242. package/components/apps/types.d.ts +86 -0
  243. package/components/apps/types.js +1 -0
  244. package/components/apps/utils.d.ts +13 -0
  245. package/components/apps/utils.js +132 -0
  246. package/components/common/actionRow/ActionRow.svelte.d.ts +3 -3
  247. package/components/common/alert/Alert.svelte +30 -7
  248. package/components/common/alert/Alert.svelte.d.ts +5 -3
  249. package/components/common/alert/model.d.ts +1 -1
  250. package/components/common/badge/Badge.svelte +3 -7
  251. package/components/common/badge/Badge.svelte.d.ts +6 -4
  252. package/components/common/badge/model.d.ts +2 -2
  253. package/components/common/breadcrumb/Breadcrumb.svelte.d.ts +3 -3
  254. package/components/common/button/Button.svelte +24 -6
  255. package/components/common/button/Button.svelte.d.ts +6 -4
  256. package/components/common/button/ButtonPopup.svelte +3 -1
  257. package/components/common/button/ButtonPopup.svelte.d.ts +5 -4
  258. package/components/common/button/ButtonPopupItem.svelte.d.ts +3 -3
  259. package/components/common/button/model.d.ts +2 -1
  260. package/components/common/button/model.js +2 -1
  261. package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +3 -3
  262. package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +4 -4
  263. package/components/common/drawer/Drawer.svelte +5 -1
  264. package/components/common/drawer/Drawer.svelte.d.ts +3 -3
  265. package/components/common/drawer/DrawerContent.svelte +28 -19
  266. package/components/common/drawer/DrawerContent.svelte.d.ts +6 -6
  267. package/components/common/kbd/Kbd.svelte.d.ts +2 -2
  268. package/components/common/languageIcons/LanguageIcon.svelte +8 -4
  269. package/components/common/languageIcons/LanguageIcon.svelte.d.ts +4 -4
  270. package/components/common/menu/Menu.svelte +7 -6
  271. package/components/common/menu/Menu.svelte.d.ts +7 -6
  272. package/components/common/menu/MenuItem.svelte +1 -0
  273. package/components/common/menu/MenuItem.svelte.d.ts +6 -2
  274. package/components/common/popup/Popup.svelte +0 -11
  275. package/components/common/popup/Popup.svelte.d.ts +3 -3
  276. package/components/common/skeleton/Skeleton.svelte.d.ts +3 -3
  277. package/components/common/skeleton/SkeletonElement.svelte.d.ts +3 -3
  278. package/components/common/skeleton/model.d.ts +4 -4
  279. package/components/common/table/AppRow.svelte +77 -0
  280. package/components/common/table/AppRow.svelte.d.ts +23 -0
  281. package/components/common/table/FlowRow.svelte +141 -0
  282. package/components/common/table/FlowRow.svelte.d.ts +25 -0
  283. package/components/common/table/LanguageBadge.svelte +32 -0
  284. package/components/common/table/LanguageBadge.svelte.d.ts +24 -0
  285. package/components/common/table/Row.svelte +58 -0
  286. package/components/common/table/Row.svelte.d.ts +28 -0
  287. package/components/common/table/RowIcon.svelte +28 -0
  288. package/components/common/table/RowIcon.svelte.d.ts +16 -0
  289. package/components/common/table/ScriptRow.svelte +155 -0
  290. package/components/common/table/ScriptRow.svelte.d.ts +25 -0
  291. package/components/common/table/Table.svelte +9 -0
  292. package/components/common/table/Table.svelte.d.ts +27 -0
  293. package/components/common/tabs/Tab.svelte +15 -4
  294. package/components/common/tabs/Tab.svelte.d.ts +5 -3
  295. package/components/common/tabs/TabContent.svelte.d.ts +3 -3
  296. package/components/common/tabs/Tabs.svelte +5 -1
  297. package/components/common/tabs/Tabs.svelte.d.ts +4 -4
  298. package/components/common/toggleButton/ToggleButton.svelte +12 -9
  299. package/components/common/toggleButton/ToggleButton.svelte.d.ts +6 -4
  300. package/components/common/toggleButton/ToggleButtonGroup.svelte +12 -19
  301. package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +10 -8
  302. package/components/flows/CreateActionsFlow.svelte +39 -0
  303. package/components/flows/CreateActionsFlow.svelte.d.ts +14 -0
  304. package/components/flows/FlowEditor.svelte +22 -5
  305. package/components/flows/FlowEditor.svelte.d.ts +4 -3
  306. package/components/flows/FlowProgressBar.svelte.d.ts +3 -3
  307. package/components/flows/common/FlowCard.svelte.d.ts +3 -3
  308. package/components/flows/common/FlowCardHeader.svelte +10 -9
  309. package/components/flows/common/FlowCardHeader.svelte.d.ts +3 -3
  310. package/components/flows/content/BranchPredicateEditor.svelte +30 -0
  311. package/components/flows/content/BranchPredicateEditor.svelte.d.ts +23 -0
  312. package/components/flows/content/CapturePayload.svelte +12 -8
  313. package/components/flows/content/CapturePayload.svelte.d.ts +3 -3
  314. package/components/flows/content/DynamicInputHelpBox.svelte +2 -32
  315. package/components/flows/content/DynamicInputHelpBox.svelte.d.ts +4 -6
  316. package/components/flows/content/FlowBranchAllWrapper.svelte +2 -2
  317. package/components/flows/content/FlowBranchAllWrapper.svelte.d.ts +3 -3
  318. package/components/flows/content/FlowBranchOneWrapper.svelte +4 -35
  319. package/components/flows/content/FlowBranchOneWrapper.svelte.d.ts +3 -3
  320. package/components/flows/content/FlowBranchesAllWrapper.svelte +91 -0
  321. package/components/flows/content/FlowBranchesAllWrapper.svelte.d.ts +18 -0
  322. package/components/flows/content/FlowBranchesOneWrapper.svelte +88 -0
  323. package/components/flows/content/FlowBranchesOneWrapper.svelte.d.ts +18 -0
  324. package/components/flows/content/FlowEditorPanel.svelte +2 -0
  325. package/components/flows/content/FlowEditorPanel.svelte.d.ts +3 -3
  326. package/components/flows/content/FlowFailureModule.svelte.d.ts +4 -4
  327. package/components/flows/content/FlowInput.svelte +10 -14
  328. package/components/flows/content/FlowInput.svelte.d.ts +4 -4
  329. package/components/flows/content/FlowInputs.svelte +121 -140
  330. package/components/flows/content/FlowInputs.svelte.d.ts +4 -7
  331. package/components/flows/content/FlowInputsFlow.svelte +101 -0
  332. package/components/flows/content/FlowInputsFlow.svelte.d.ts +20 -0
  333. package/components/flows/content/FlowLoop.svelte +13 -5
  334. package/components/flows/content/FlowLoop.svelte.d.ts +3 -3
  335. package/components/flows/content/FlowModuleComponent.svelte +82 -67
  336. package/components/flows/content/FlowModuleComponent.svelte.d.ts +3 -3
  337. package/components/flows/content/FlowModuleEarlyStop.svelte +7 -5
  338. package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +3 -3
  339. package/components/flows/content/FlowModuleHeader.svelte +23 -19
  340. package/components/flows/content/FlowModuleHeader.svelte.d.ts +4 -3
  341. package/components/flows/content/FlowModuleScript.svelte.d.ts +3 -3
  342. package/components/flows/content/FlowModuleSleep.svelte +69 -0
  343. package/components/flows/content/FlowModuleSleep.svelte.d.ts +18 -0
  344. package/components/flows/content/FlowModuleSuspend.svelte +5 -57
  345. package/components/flows/content/FlowModuleSuspend.svelte.d.ts +3 -4
  346. package/components/flows/content/FlowModuleWrapper.svelte +59 -57
  347. package/components/flows/content/FlowModuleWrapper.svelte.d.ts +3 -3
  348. package/components/flows/content/FlowPathViewer.svelte +20 -0
  349. package/components/flows/content/FlowPathViewer.svelte.d.ts +17 -0
  350. package/components/flows/content/FlowRetries.svelte.d.ts +3 -3
  351. package/components/flows/content/FlowSchedules.svelte.d.ts +4 -4
  352. package/components/flows/content/FlowSettings.svelte +85 -94
  353. package/components/flows/content/FlowSettings.svelte.d.ts +3 -3
  354. package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +3 -3
  355. package/components/flows/flowState.d.ts +2 -2
  356. package/components/flows/flowState.js +2 -2
  357. package/components/flows/flowStateUtils.d.ts +8 -3
  358. package/components/flows/flowStateUtils.js +42 -10
  359. package/components/flows/flowStore.d.ts +1 -1
  360. package/components/flows/flowStore.js +1 -1
  361. package/components/flows/header/FlowImportExportMenu.svelte +9 -23
  362. package/components/flows/header/FlowImportExportMenu.svelte.d.ts +4 -4
  363. package/components/flows/header/FlowPreviewButtons.svelte +24 -16
  364. package/components/flows/header/FlowPreviewButtons.svelte.d.ts +4 -4
  365. package/components/flows/map/FlowBranchAllMap.svelte +47 -37
  366. package/components/flows/map/FlowBranchAllMap.svelte.d.ts +3 -3
  367. package/components/flows/map/FlowBranchOneMap.svelte +50 -42
  368. package/components/flows/map/FlowBranchOneMap.svelte.d.ts +3 -3
  369. package/components/flows/map/FlowErrorHandlerItem.svelte +9 -7
  370. package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +4 -4
  371. package/components/flows/map/FlowInputsItem.svelte +3 -2
  372. package/components/flows/map/FlowInputsItem.svelte.d.ts +4 -4
  373. package/components/flows/map/FlowModuleSchemaItem.svelte +54 -40
  374. package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +5 -5
  375. package/components/flows/map/FlowModuleSchemaMap.svelte +59 -95
  376. package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +4 -5
  377. package/components/flows/map/FlowSettingsItem.svelte +8 -7
  378. package/components/flows/map/FlowSettingsItem.svelte.d.ts +4 -4
  379. package/components/flows/map/InsertModuleButton.svelte +78 -8
  380. package/components/flows/map/InsertModuleButton.svelte.d.ts +5 -5
  381. package/components/flows/map/MapItem.svelte +36 -16
  382. package/components/flows/map/MapItem.svelte.d.ts +4 -6
  383. package/components/flows/pickers/FlowScriptPicker.svelte +11 -4
  384. package/components/flows/pickers/FlowScriptPicker.svelte.d.ts +8 -6
  385. package/components/flows/pickers/PickHubFlow.svelte +72 -0
  386. package/components/flows/pickers/PickHubFlow.svelte.d.ts +20 -0
  387. package/components/flows/pickers/PickHubScript.svelte +83 -29
  388. package/components/flows/pickers/PickHubScript.svelte.d.ts +8 -7
  389. package/components/flows/pickers/PickScript.svelte +16 -9
  390. package/components/flows/pickers/PickScript.svelte.d.ts +3 -4
  391. package/components/flows/pickers/WorkspaceScriptPicker.svelte +113 -0
  392. package/components/flows/pickers/WorkspaceScriptPicker.svelte.d.ts +23 -0
  393. package/components/flows/pickers/model.d.ts +5 -3
  394. package/components/flows/previousResults.d.ts +3 -2
  395. package/components/flows/previousResults.js +7 -6
  396. package/components/flows/propPicker/PropPickerWrapper.svelte +11 -3
  397. package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +7 -7
  398. package/components/flows/scheduleUtils.d.ts +1 -1
  399. package/components/flows/scheduleUtils.js +1 -1
  400. package/components/flows/types.d.ts +1 -1
  401. package/components/flows/utils.d.ts +1 -2
  402. package/components/flows/utils.js +10 -15
  403. package/components/graph/FlowGraph.svelte +163 -58
  404. package/components/graph/FlowGraph.svelte.d.ts +7 -4
  405. package/components/graph/model.d.ts +18 -6
  406. package/components/home/ItemsList.svelte +265 -0
  407. package/components/home/ItemsList.svelte.d.ts +16 -0
  408. package/components/home/ListFilters.svelte +37 -0
  409. package/components/home/ListFilters.svelte.d.ts +18 -0
  410. package/components/home/NoItemFound.svelte +6 -0
  411. package/components/home/NoItemFound.svelte.d.ts +23 -0
  412. package/components/icons/AirtableIcon.svelte.d.ts +3 -3
  413. package/components/icons/DatadogIcon.svelte +48 -0
  414. package/components/icons/DatadogIcon.svelte.d.ts +17 -0
  415. package/components/icons/DbIcon.svelte.d.ts +3 -3
  416. package/components/icons/DiscordIcon.svelte.d.ts +3 -3
  417. package/components/icons/FunkwhaleIcon.svelte +90 -0
  418. package/components/icons/FunkwhaleIcon.svelte.d.ts +17 -0
  419. package/components/icons/GCloudIcon.svelte.d.ts +3 -3
  420. package/components/icons/GItlabIcon.svelte.d.ts +3 -3
  421. package/components/icons/GSheetsIcon.svelte.d.ts +3 -3
  422. package/components/icons/GcalIcon.svelte.d.ts +3 -3
  423. package/components/icons/GdocsIcon.svelte +9 -0
  424. package/components/icons/GdocsIcon.svelte.d.ts +17 -0
  425. package/components/icons/GdriveIcon.svelte.d.ts +3 -3
  426. package/components/icons/GithubIcon.svelte.d.ts +3 -3
  427. package/components/icons/GmailIcon.svelte.d.ts +3 -3
  428. package/components/icons/HatIcon.svelte.d.ts +3 -3
  429. package/components/icons/HttpIcon.svelte.d.ts +3 -3
  430. package/components/icons/HubspotIcon.svelte +9 -0
  431. package/components/icons/HubspotIcon.svelte.d.ts +17 -0
  432. package/components/icons/LinkedinIcon.svelte +9 -0
  433. package/components/icons/LinkedinIcon.svelte.d.ts +17 -0
  434. package/components/icons/Mail.svelte +9 -53
  435. package/components/icons/Mail.svelte.d.ts +3 -3
  436. package/components/icons/MailchimpIcon.svelte +18 -0
  437. package/components/icons/MailchimpIcon.svelte.d.ts +17 -0
  438. package/components/icons/MastodonIcon.svelte.d.ts +3 -3
  439. package/components/icons/MatrixIcon.svelte.d.ts +3 -3
  440. package/components/icons/Mysql.svelte +8 -8
  441. package/components/icons/Mysql.svelte.d.ts +3 -3
  442. package/components/icons/NextcloudIcon.svelte +9 -0
  443. package/components/icons/NextcloudIcon.svelte.d.ts +17 -0
  444. package/components/icons/PostgresIcon.svelte.d.ts +3 -3
  445. package/components/icons/QRCodeIcon.svelte +5 -0
  446. package/components/icons/QRCodeIcon.svelte.d.ts +16 -0
  447. package/components/icons/S3Icon.svelte.d.ts +3 -3
  448. package/components/icons/SendflakeIcon.svelte +15 -0
  449. package/components/icons/SendflakeIcon.svelte.d.ts +17 -0
  450. package/components/icons/SendgridIcon.svelte +66 -0
  451. package/components/icons/SendgridIcon.svelte.d.ts +17 -0
  452. package/components/icons/Slack.svelte.d.ts +3 -3
  453. package/components/icons/StripeIcon.svelte +9 -0
  454. package/components/icons/StripeIcon.svelte.d.ts +17 -0
  455. package/components/icons/TelegramIcon.svelte +9 -0
  456. package/components/icons/TelegramIcon.svelte.d.ts +17 -0
  457. package/components/icons/TogglIcon.svelte.d.ts +3 -3
  458. package/components/icons/WindmillIcon.svelte +3 -3
  459. package/components/icons/WindmillIcon.svelte.d.ts +3 -3
  460. package/components/icons/index.d.ts +70 -0
  461. package/components/icons/index.js +70 -0
  462. package/components/jobs/JobDetail.svelte +4 -4
  463. package/components/jobs/JobDetail.svelte.d.ts +3 -3
  464. package/components/preview/FlowPreviewStatus.svelte +12 -23
  465. package/components/preview/FlowPreviewStatus.svelte.d.ts +3 -3
  466. package/components/progressBar/ProgressBar.svelte.d.ts +3 -3
  467. package/components/progressBar/ProgressBarGeneralPart.svelte.d.ts +3 -3
  468. package/components/progressBar/ProgressBarLoopAccessor.svelte.d.ts +3 -3
  469. package/components/progressBar/ProgressBarLoopPart.svelte.d.ts +3 -3
  470. package/components/progressBar/model.d.ts +9 -9
  471. package/components/propertyPicker/ObjectViewer.svelte +34 -9
  472. package/components/propertyPicker/ObjectViewer.svelte.d.ts +4 -3
  473. package/components/propertyPicker/PropPicker.svelte +134 -110
  474. package/components/propertyPicker/PropPicker.svelte.d.ts +3 -3
  475. package/components/propertyPicker/PropPickerResult.svelte +2 -4
  476. package/components/propertyPicker/PropPickerResult.svelte.d.ts +3 -3
  477. package/components/propertyPicker/WarningMessage.svelte.d.ts +6 -2
  478. package/components/scriptEditor/LogPanel.svelte +15 -8
  479. package/components/scriptEditor/LogPanel.svelte.d.ts +3 -3
  480. package/components/scripts/CreateActionsScript.svelte +29 -0
  481. package/components/scripts/CreateActionsScript.svelte.d.ts +14 -0
  482. package/components/sidebar/FavoriteMenu.svelte +52 -0
  483. package/components/sidebar/FavoriteMenu.svelte.d.ts +21 -0
  484. package/components/sidebar/MenuLink.svelte +7 -4
  485. package/components/sidebar/MenuLink.svelte.d.ts +4 -3
  486. package/components/sidebar/SidebarContent.svelte +24 -26
  487. package/components/sidebar/SidebarContent.svelte.d.ts +3 -3
  488. package/components/sidebar/UserMenu.svelte +22 -5
  489. package/components/sidebar/UserMenu.svelte.d.ts +3 -3
  490. package/components/sidebar/WorkspaceMenu.svelte +9 -10
  491. package/components/sidebar/WorkspaceMenu.svelte.d.ts +3 -3
  492. package/components/splitPanes/SplitPanesWrapper.svelte.d.ts +3 -3
  493. package/editorUtils.d.ts +3 -1
  494. package/editorUtils.js +5 -3
  495. package/gen/core/ApiRequestOptions.d.ts +1 -1
  496. package/gen/core/ApiResult.d.ts +1 -1
  497. package/gen/core/OpenAPI.d.ts +3 -3
  498. package/gen/core/OpenAPI.js +1 -1
  499. package/gen/index.d.ts +3 -0
  500. package/gen/index.js +1 -0
  501. package/gen/models/AppWithLastVersion.d.ts +12 -12
  502. package/gen/models/AuditLog.d.ts +1 -1
  503. package/gen/models/BranchAll.d.ts +1 -1
  504. package/gen/models/BranchOne.d.ts +1 -1
  505. package/gen/models/CompletedJob.d.ts +2 -1
  506. package/gen/models/ContextualVariable.d.ts +1 -1
  507. package/gen/models/CreateResource.d.ts +1 -2
  508. package/gen/models/CreateVariable.d.ts +1 -1
  509. package/gen/models/CreateWorkspace.d.ts +1 -2
  510. package/gen/models/EditResource.d.ts +1 -1
  511. package/gen/models/EditResourceType.d.ts +1 -1
  512. package/gen/models/EditSchedule.d.ts +1 -1
  513. package/gen/models/EditVariable.d.ts +1 -1
  514. package/gen/models/EditWorkspaceUser.d.ts +3 -1
  515. package/gen/models/Flow.d.ts +1 -1
  516. package/gen/models/FlowMetadata.d.ts +2 -1
  517. package/gen/models/FlowModule.d.ts +1 -1
  518. package/gen/models/FlowModuleValue.d.ts +2 -1
  519. package/gen/models/FlowPreview.d.ts +1 -1
  520. package/gen/models/FlowStatus.d.ts +4 -2
  521. package/gen/models/FlowStatusModule.d.ts +2 -2
  522. package/gen/models/FlowStatusModule.js +1 -1
  523. package/gen/models/FlowValue.d.ts +1 -1
  524. package/gen/models/ForloopFlow.d.ts +1 -1
  525. package/gen/models/GlobalUserInfo.d.ts +1 -1
  526. package/gen/models/Group.d.ts +1 -1
  527. package/gen/models/Identity.d.ts +2 -1
  528. package/gen/models/InputTransform.d.ts +1 -1
  529. package/gen/models/JavascriptTransform.d.ts +1 -1
  530. package/gen/models/Job.d.ts +1 -1
  531. package/gen/models/ListableApp.d.ts +10 -8
  532. package/gen/models/ListableResource.d.ts +14 -0
  533. package/gen/models/ListableResource.js +4 -0
  534. package/gen/models/ListableVariable.d.ts +5 -1
  535. package/gen/models/Login.d.ts +1 -1
  536. package/gen/models/MainArgSignature.d.ts +1 -1
  537. package/gen/models/NewSchedule.d.ts +1 -1
  538. package/gen/models/NewToken.d.ts +1 -1
  539. package/gen/models/NewUser.d.ts +1 -1
  540. package/gen/models/OpenFlow.d.ts +1 -1
  541. package/gen/models/OpenFlowWPath.d.ts +1 -1
  542. package/gen/models/PathFlow.d.ts +6 -0
  543. package/gen/models/PathFlow.js +4 -0
  544. package/gen/models/PathScript.d.ts +2 -1
  545. package/gen/models/Policy.d.ts +1 -1
  546. package/gen/models/Preview.d.ts +1 -1
  547. package/gen/models/QueuedJob.d.ts +2 -1
  548. package/gen/models/RawScript.d.ts +2 -1
  549. package/gen/models/Resource.d.ts +1 -1
  550. package/gen/models/ResourceType.d.ts +1 -1
  551. package/gen/models/Retry.d.ts +1 -1
  552. package/gen/models/Schedule.d.ts +3 -1
  553. package/gen/models/Script.d.ts +2 -1
  554. package/gen/models/ScriptArgs.d.ts +1 -1
  555. package/gen/models/SlackToken.d.ts +1 -1
  556. package/gen/models/StaticTransform.d.ts +1 -1
  557. package/gen/models/TokenResponse.d.ts +1 -1
  558. package/gen/models/TruncatedToken.d.ts +1 -1
  559. package/gen/models/Usage.d.ts +2 -4
  560. package/gen/models/User.d.ts +1 -1
  561. package/gen/models/UserWorkspaceList.d.ts +1 -1
  562. package/gen/models/WorkerPing.d.ts +1 -1
  563. package/gen/models/Workspace.d.ts +1 -1
  564. package/gen/models/WorkspaceInvite.d.ts +2 -1
  565. package/gen/services/AppService.d.ts +107 -1
  566. package/gen/services/AppService.js +89 -1
  567. package/gen/services/FavoriteService.d.ts +27 -0
  568. package/gen/services/FavoriteService.js +36 -0
  569. package/gen/services/FlowService.d.ts +7 -91
  570. package/gen/services/FlowService.js +2 -73
  571. package/gen/services/JobService.d.ts +50 -5
  572. package/gen/services/JobService.js +33 -5
  573. package/gen/services/OauthService.d.ts +1 -1
  574. package/gen/services/ResourceService.d.ts +9 -4
  575. package/gen/services/ResourceService.js +3 -2
  576. package/gen/services/ScheduleService.d.ts +1 -1
  577. package/gen/services/ScheduleService.js +1 -1
  578. package/gen/services/ScriptService.d.ts +7 -1
  579. package/gen/services/ScriptService.js +2 -1
  580. package/gen/services/UserService.d.ts +6 -0
  581. package/gen/services/UserService.js +11 -0
  582. package/gen/services/WorkspaceService.d.ts +35 -0
  583. package/gen/services/WorkspaceService.js +41 -0
  584. package/package.json +461 -361
  585. package/script_helpers.d.ts +5 -2
  586. package/script_helpers.js +91 -26
  587. package/scripts.d.ts +1 -0
  588. package/scripts.js +8 -1
  589. package/stateMachine.d.ts +4 -4
  590. package/stores.d.ts +13 -2
  591. package/stores.js +25 -6
  592. package/utils.d.ts +7 -3
  593. package/utils.js +31 -7
  594. package/components/ButtonAndDropdown.svelte +0 -25
  595. package/components/ButtonAndDropdown.svelte.d.ts +0 -23
  596. package/components/FlowModulesViewer.svelte +0 -191
  597. package/components/FlowModulesViewer.svelte.d.ts +0 -18
  598. package/components/flows/content/FlowBranchesWrapper.svelte +0 -140
  599. package/components/flows/content/FlowBranchesWrapper.svelte.d.ts +0 -19
  600. package/components/landing/FlowGettingStarted.svelte +0 -50
  601. package/components/landing/FlowGettingStarted.svelte.d.ts +0 -19
  602. package/components/landing/FlowLandingBox.svelte +0 -39
  603. package/components/landing/FlowLandingBox.svelte.d.ts +0 -17
  604. package/components/landing/RessourceGettingStarted.svelte +0 -21
  605. package/components/landing/RessourceGettingStarted.svelte.d.ts +0 -19
  606. package/components/landing/ScriptBox.svelte +0 -52
  607. package/components/landing/ScriptBox.svelte.d.ts +0 -17
  608. package/components/landing/ScriptGettingStarted.svelte +0 -48
  609. package/components/landing/ScriptGettingStarted.svelte.d.ts +0 -19
  610. package/components/scripts/CreateActions.svelte +0 -114
  611. package/components/scripts/CreateActions.svelte.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  import type { Script } from "./gen";
2
- export declare const PYTHON_INIT_CODE = "import os\nimport wmill\nfrom datetime import datetime\n\n\"\"\"\nUse Cmd/Ctrl + S to autoformat the code.\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 dtime: datetime = datetime.now()):\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_), dtime)\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 env variable at `g/all/pretty_secret`: {secret}\")\n # interact with the windmill platform to get the version\n version = wmill.get_version()\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 {\"version\": version, \"splitted\": name.split(), \"user\": user}\n";
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
- from datetime import datetime
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_), dtime)
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 env variable at \`g/all/pretty_secret\`: {secret}")
31
- # interact with the windmill platform to get the version
32
- version = wmill.get_version()
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 {"version": version, "splitted": name.split(), "user": user}
41
+ return {"splitted": name.split(), "user": user, "state": new_state}
37
42
  `;
38
- export const DENO_INIT_CODE = `// reload the smart assistant on the top right if it dies to get autocompletion and syntax highlighting
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: string,
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
- // A common trigger script would follow this pattern:
148
- // 1. Get the last saved state
149
- // const state = await wmill.getInternalState()
150
- // 2. Get the actual state from the external service
151
- // const newState = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json()
152
- // 3. Compare the two states and update the internal state
153
- // await wmill.setInternalState(newState)
154
- // 4. Return the new rows
155
- // return range from (state to newState)
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
- return [1,2,3]
176
+ return [1,2,3]
158
177
 
159
- // In subsequent scripts, you may refer to each row/value returned by the trigger script using
160
- // 'flow_input._value'
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
@@ -1,2 +1,3 @@
1
1
  import type { Schema } from './common';
2
2
  export declare function loadSchema(path: string): Promise<Schema>;
3
+ export declare function loadSchemaFlow(path: string): Promise<Schema>;
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
- declare type StateMachineInfo<T extends readonly string[]> = {
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 declare type TransitionFromFunction<T extends readonly string[]> = (info: StateMachineInfo<T> & {
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 declare type TransitionToFunction<T extends readonly string[]> = (info: StateMachineInfo<T> & {
19
+ export type TransitionToFunction<T extends readonly string[]> = (info: StateMachineInfo<T> & {
20
20
  previousState: T[number];
21
21
  }) => T[number];
22
- declare type StateStore<T extends readonly string[]> = Readable<StateMachine<T>> & {
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 { UserWorkspaceList } from './gen/models/UserWorkspaceList.js';
2
- import type { TokenResponse } from './gen';
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 '$app/env';
2
- import { writable } from 'svelte/store';
3
- import { getUserExt } from './user';
4
- let persistedWorkspace = browser && localStorage.getItem('workspace');
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('workspace', String(workspace));
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('workspace');
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 declare type DropdownType = 'action' | 'delete';
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 declare type InputCat = 'string' | 'number' | 'boolean' | 'list' | 'resource-object' | 'enum' | 'date' | 'base64' | 'resource-string' | 'object' | 'sql';
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 `yday at ${date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`;
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([], { hour: '2-digit', minute: '2-digit' })}`;
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 {};