windmill-components 1.35.42 → 1.36.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 (245) hide show
  1. package/components/AppConnect.svelte +85 -59
  2. package/components/ArgInput.svelte +50 -33
  3. package/components/ArgInput.svelte.d.ts +1 -1
  4. package/components/Button.svelte +15 -48
  5. package/components/Button.svelte.d.ts +1 -1
  6. package/components/CronInput.svelte +1 -1
  7. package/components/DisplayResult.svelte +75 -67
  8. package/components/Dropdown.svelte +9 -7
  9. package/components/Editor.svelte +187 -178
  10. package/components/Editor.svelte.d.ts +4 -2
  11. package/components/EditorBar.svelte +135 -98
  12. package/components/EditorBar.svelte.d.ts +2 -1
  13. package/components/FlowBuilder.svelte +115 -134
  14. package/components/FlowJobResult.svelte +4 -5
  15. package/components/FlowModulesViewer.svelte +89 -7
  16. package/components/FlowModulesViewer.svelte.d.ts +1 -0
  17. package/components/FlowPreviewContent.svelte +88 -27
  18. package/components/FlowPreviewContent.svelte.d.ts +1 -1
  19. package/components/FlowStatusViewer.svelte +39 -24
  20. package/components/FlowStatusViewer.svelte.d.ts +0 -1
  21. package/components/FlowViewer.svelte +17 -11
  22. package/components/GroupModal.svelte +10 -1
  23. package/components/HighlightCode.svelte +22 -0
  24. package/components/HighlightCode.svelte.d.ts +17 -0
  25. package/components/IconedPath.svelte +9 -7
  26. package/components/InputTransformForm.svelte +97 -115
  27. package/components/InputTransformForm.svelte.d.ts +0 -1
  28. package/components/InputTransformsViewer.svelte +1 -1
  29. package/components/InviteGlobalUser.svelte +8 -8
  30. package/components/InviteUser.svelte +9 -9
  31. package/components/ItemPicker.svelte +37 -30
  32. package/components/ItemPicker.svelte.d.ts +2 -1
  33. package/components/JobStatus.svelte +2 -1
  34. package/components/LogViewer.svelte +23 -0
  35. package/components/LogViewer.svelte.d.ts +19 -0
  36. package/components/ModulePreview.svelte +107 -0
  37. package/components/ModulePreview.svelte.d.ts +24 -0
  38. package/components/Path.svelte +1 -1
  39. package/components/RadioButton.svelte +3 -2
  40. package/components/ResourceEditor.svelte +22 -34
  41. package/components/ResourceTypePicker.svelte +23 -34
  42. package/components/RunForm.svelte +34 -31
  43. package/components/RunForm.svelte.d.ts +6 -2
  44. package/components/SchemaEditor.svelte +19 -11
  45. package/components/SchemaForm.svelte +3 -3
  46. package/components/SchemaForm.svelte.d.ts +1 -1
  47. package/components/SchemaModal.svelte +18 -7
  48. package/components/ScriptBuilder.svelte +99 -83
  49. package/components/ScriptBuilder.svelte.d.ts +2 -4
  50. package/components/ScriptEditor.svelte +71 -143
  51. package/components/ScriptEditor.svelte.d.ts +0 -5
  52. package/components/ScriptPicker.svelte +24 -14
  53. package/components/ScriptPicker.svelte.d.ts +2 -1
  54. package/components/ScriptSchema.svelte +8 -11
  55. package/components/ScriptSchema.svelte.d.ts +0 -1
  56. package/components/ShareModal.svelte +6 -6
  57. package/components/SharedBadge.svelte +5 -13
  58. package/components/SimpleEditor.svelte +14 -10
  59. package/components/StringTypeNarrowing.svelte +24 -30
  60. package/components/TestJobLoader.svelte +106 -0
  61. package/components/TestJobLoader.svelte.d.ts +26 -0
  62. package/components/Tooltip.svelte +3 -2
  63. package/components/VariableEditor.svelte +15 -24
  64. package/components/common/actionRow/ActionRow.svelte +31 -0
  65. package/components/common/actionRow/ActionRow.svelte.d.ts +22 -0
  66. package/components/common/alert/Alert.svelte +53 -0
  67. package/components/common/alert/Alert.svelte.d.ts +20 -0
  68. package/components/common/alert/model.d.ts +1 -0
  69. package/components/common/alert/model.js +1 -0
  70. package/components/common/badge/Badge.svelte +76 -0
  71. package/components/common/badge/Badge.svelte.d.ts +28 -0
  72. package/components/common/badge/model.d.ts +8 -0
  73. package/components/common/badge/model.js +1 -0
  74. package/components/common/button/Button.svelte +110 -0
  75. package/components/common/button/Button.svelte.d.ts +39 -0
  76. package/components/common/button/model.d.ts +6 -0
  77. package/components/common/button/model.js +1 -0
  78. package/components/common/confirmationModal/ConfirmationModal.svelte +72 -0
  79. package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +23 -0
  80. package/components/common/confirmationModal/UnsavedConfirmationModal.svelte +41 -0
  81. package/components/common/confirmationModal/UnsavedConfirmationModal.svelte.d.ts +14 -0
  82. package/components/common/confirmationModal/dirtyStore.d.ts +1 -0
  83. package/components/common/confirmationModal/dirtyStore.js +2 -0
  84. package/components/common/drawer/Drawer.svelte +3 -0
  85. package/components/common/drawer/Drawer.svelte.d.ts +2 -0
  86. package/components/common/index.d.ts +14 -0
  87. package/components/common/index.js +14 -0
  88. package/components/common/tabs/TabContent.svelte +3 -2
  89. package/components/common/tabs/TabContent.svelte.d.ts +1 -0
  90. package/components/common/tabs/Tabs.svelte +8 -1
  91. package/components/common/tabs/Tabs.svelte.d.ts +2 -0
  92. package/components/common/toggleButton/ToggleButton.svelte +20 -0
  93. package/components/common/toggleButton/ToggleButton.svelte.d.ts +19 -0
  94. package/components/common/toggleButton/ToggleButtonGroup.svelte +33 -0
  95. package/components/common/toggleButton/ToggleButtonGroup.svelte.d.ts +24 -0
  96. package/components/flows/FlowEditor.svelte +30 -0
  97. package/components/{FlowEditor.svelte.d.ts → flows/FlowEditor.svelte.d.ts} +1 -6
  98. package/components/flows/common/FlowCard.svelte +9 -0
  99. package/components/flows/common/FlowCard.svelte.d.ts +21 -0
  100. package/components/flows/common/FlowCardHeader.svelte +39 -0
  101. package/components/flows/common/FlowCardHeader.svelte.d.ts +20 -0
  102. package/components/flows/content/CopyFirstStepSchema.svelte +13 -0
  103. package/components/flows/{CopyFirstStepSchema.svelte.d.ts → content/CopyFirstStepSchema.svelte.d.ts} +0 -0
  104. package/components/flows/{DynamicInputHelpBox.svelte → content/DynamicInputHelpBox.svelte} +0 -0
  105. package/components/flows/{DynamicInputHelpBox.svelte.d.ts → content/DynamicInputHelpBox.svelte.d.ts} +0 -0
  106. package/components/flows/content/FlowEditorPanel.svelte +25 -0
  107. package/components/flows/content/FlowEditorPanel.svelte.d.ts +16 -0
  108. package/components/flows/content/FlowFailureModule.svelte +15 -0
  109. package/components/flows/content/FlowFailureModule.svelte.d.ts +14 -0
  110. package/components/flows/content/FlowInput.svelte +26 -0
  111. package/components/flows/{FlowInput.svelte.d.ts → content/FlowInput.svelte.d.ts} +0 -0
  112. package/components/flows/content/FlowInputs.svelte +91 -0
  113. package/components/flows/{FlowInputs.svelte.d.ts → content/FlowInputs.svelte.d.ts} +1 -0
  114. package/components/flows/content/FlowLoop.svelte +168 -0
  115. package/components/flows/content/FlowLoop.svelte.d.ts +18 -0
  116. package/components/flows/content/FlowLoopWrapper.svelte +9 -0
  117. package/components/flows/content/FlowLoopWrapper.svelte.d.ts +14 -0
  118. package/components/flows/content/FlowModule.svelte +211 -0
  119. package/components/flows/content/FlowModule.svelte.d.ts +29 -0
  120. package/components/flows/content/FlowModuleEarlyStop.svelte +76 -0
  121. package/components/flows/content/FlowModuleEarlyStop.svelte.d.ts +17 -0
  122. package/components/flows/content/FlowModuleHeader.svelte +157 -0
  123. package/components/flows/{FlowModuleHeader.svelte.d.ts → content/FlowModuleHeader.svelte.d.ts} +5 -3
  124. package/components/flows/content/FlowModuleScript.svelte +21 -0
  125. package/components/flows/content/FlowModuleScript.svelte.d.ts +17 -0
  126. package/components/flows/content/FlowModuleSuspend.svelte +27 -0
  127. package/components/flows/content/FlowModuleSuspend.svelte.d.ts +17 -0
  128. package/components/flows/content/FlowModuleWrapper.svelte +45 -0
  129. package/components/flows/content/FlowModuleWrapper.svelte.d.ts +14 -0
  130. package/components/flows/content/FlowRetries.svelte +80 -0
  131. package/components/flows/content/FlowRetries.svelte.d.ts +17 -0
  132. package/components/flows/content/FlowSchedules.svelte +18 -0
  133. package/components/flows/content/FlowSchedules.svelte.d.ts +14 -0
  134. package/components/flows/content/FlowSettings.svelte +78 -0
  135. package/components/flows/{FlowSettings.svelte.d.ts → content/FlowSettings.svelte.d.ts} +2 -6
  136. package/components/flows/content/RemoveStepConfirmationModal.svelte +32 -0
  137. package/components/flows/content/RemoveStepConfirmationModal.svelte.d.ts +19 -0
  138. package/components/flows/flowState.d.ts +8 -7
  139. package/components/flows/flowState.js +25 -46
  140. package/components/flows/flowStateUtils.d.ts +16 -14
  141. package/components/flows/flowStateUtils.js +81 -73
  142. package/components/flows/flowStore.js +7 -4
  143. package/components/flows/header/FlowImportExportMenu.svelte +55 -0
  144. package/components/flows/header/FlowImportExportMenu.svelte.d.ts +14 -0
  145. package/components/flows/header/FlowPreviewButtons.svelte +57 -0
  146. package/components/flows/header/FlowPreviewButtons.svelte.d.ts +14 -0
  147. package/components/flows/map/FlowErrorHandlerItem.svelte +60 -0
  148. package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +14 -0
  149. package/components/flows/map/FlowModuleSchemaItem.svelte +80 -0
  150. package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +32 -0
  151. package/components/flows/map/FlowModuleSchemaMap.svelte +241 -0
  152. package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -0
  153. package/components/flows/pickers/PickHubScript.svelte +5 -3
  154. package/components/flows/pickers/PickHubScript.svelte.d.ts +2 -1
  155. package/components/flows/pickers/PickScript.svelte +4 -12
  156. package/components/flows/pickers/PickScript.svelte.d.ts +1 -1
  157. package/components/flows/propPicker/PropPickerWrapper.svelte +44 -0
  158. package/components/flows/propPicker/PropPickerWrapper.svelte.d.ts +33 -0
  159. package/components/flows/scheduleUtils.d.ts +0 -1
  160. package/components/flows/scheduleUtils.js +0 -1
  161. package/components/flows/types.d.ts +8 -0
  162. package/components/flows/types.js +1 -0
  163. package/components/flows/utils.d.ts +3 -1
  164. package/components/flows/utils.js +26 -10
  165. package/components/icons/AirtableIcon.svelte +1 -1
  166. package/components/icons/DiscordIcon.svelte +1 -1
  167. package/components/icons/GCloudIcon.svelte +1 -1
  168. package/components/icons/GItlabIcon.svelte +1 -1
  169. package/components/icons/GSheetsIcon.svelte +1 -1
  170. package/components/icons/GcalIcon.svelte +1 -1
  171. package/components/icons/GdriveIcon.svelte +1 -1
  172. package/components/icons/GithubIcon.svelte +1 -1
  173. package/components/icons/GmailIcon.svelte +1 -1
  174. package/components/icons/HatIcon.svelte +19 -0
  175. package/components/icons/HatIcon.svelte.d.ts +16 -0
  176. package/components/icons/MastodonIcon.svelte +1 -1
  177. package/components/icons/MatrixIcon.svelte +1 -1
  178. package/components/icons/PostgresIcon.svelte +1 -1
  179. package/components/icons/S3Icon.svelte +1 -1
  180. package/components/icons/Slack.svelte +1 -1
  181. package/components/icons/TogglIcon.svelte +8 -46
  182. package/components/jobs/JobDetail.svelte +1 -1
  183. package/components/landing/FlowGettingStarted.svelte +22 -68
  184. package/components/landing/FlowLandingBox.svelte +1 -1
  185. package/components/landing/RessourceGettingStarted.svelte +7 -37
  186. package/components/landing/ScriptBox.svelte +33 -60
  187. package/components/landing/ScriptGettingStarted.svelte +23 -69
  188. package/components/propertyPicker/ObjectViewer.svelte +18 -12
  189. package/components/propertyPicker/ObjectViewer.svelte.d.ts +1 -0
  190. package/components/propertyPicker/PropPicker.svelte +108 -11
  191. package/components/propertyPicker/WarningMessage.svelte +2 -15
  192. package/components/script_editor/LogPanel.svelte +108 -119
  193. package/components/script_editor/LogPanel.svelte.d.ts +2 -0
  194. package/components/sidebar/SidebarContent.svelte +2 -2
  195. package/editorUtils.d.ts +3 -0
  196. package/editorUtils.js +1 -0
  197. package/gen/core/OpenAPI.js +1 -1
  198. package/gen/index.d.ts +1 -0
  199. package/gen/models/CompletedJob.d.ts +2 -1
  200. package/gen/models/CompletedJob.js +1 -0
  201. package/gen/models/FlowModule.d.ts +3 -0
  202. package/gen/models/FlowStatus.d.ts +3 -0
  203. package/gen/models/FlowStatusModule.d.ts +1 -1
  204. package/gen/models/Preview.d.ts +2 -1
  205. package/gen/models/Preview.js +1 -0
  206. package/gen/models/QueuedJob.d.ts +2 -1
  207. package/gen/models/QueuedJob.js +1 -0
  208. package/gen/models/RawScript.d.ts +2 -1
  209. package/gen/models/RawScript.js +1 -0
  210. package/gen/models/Retry.d.ts +11 -0
  211. package/gen/models/Retry.js +4 -0
  212. package/gen/models/Script.d.ts +9 -2
  213. package/gen/models/Script.js +8 -0
  214. package/gen/services/JobService.d.ts +40 -0
  215. package/gen/services/JobService.js +70 -0
  216. package/gen/services/ScriptService.d.ts +14 -3
  217. package/gen/services/ScriptService.js +13 -0
  218. package/infer.d.ts +1 -1
  219. package/infer.js +6 -1
  220. package/package.json +71 -38
  221. package/script_helpers.d.ts +8 -2
  222. package/script_helpers.js +88 -16
  223. package/stores.d.ts +1 -1
  224. package/utils.d.ts +8 -6
  225. package/utils.js +57 -21
  226. package/components/FlowEditor.svelte +0 -55
  227. package/components/FlowPreview.svelte +0 -107
  228. package/components/FlowPreview.svelte.d.ts +0 -23
  229. package/components/ModuleStep.svelte +0 -131
  230. package/components/ModuleStep.svelte.d.ts +0 -25
  231. package/components/flows/CopyFirstStepSchema.svelte +0 -13
  232. package/components/flows/FlowBox.svelte +0 -16
  233. package/components/flows/FlowBox.svelte.d.ts +0 -23
  234. package/components/flows/FlowBoxHeader.svelte +0 -16
  235. package/components/flows/FlowBoxHeader.svelte.d.ts +0 -21
  236. package/components/flows/FlowInput.svelte +0 -22
  237. package/components/flows/FlowInputs.svelte +0 -65
  238. package/components/flows/FlowModuleHeader.svelte +0 -109
  239. package/components/flows/FlowSettings.svelte +0 -165
  240. package/components/flows/FlowTimeline.svelte +0 -169
  241. package/components/flows/FlowTimeline.svelte.d.ts +0 -21
  242. package/components/flows/stepOpenedStore.d.ts +0 -1
  243. package/components/flows/stepOpenedStore.js +0 -6
  244. package/components/propertyPicker/OverlayPropertyPicker.svelte +0 -69
  245. package/components/propertyPicker/OverlayPropertyPicker.svelte.d.ts +0 -24
@@ -0,0 +1,80 @@
1
+ <script>import Toggle from '../../Toggle.svelte';
2
+ export let flowModule;
3
+ function setConstantRetries() {
4
+ flowModule.retry = {
5
+ ...flowModule.retry,
6
+ constant: {
7
+ attempts: 0,
8
+ seconds: 0
9
+ }
10
+ };
11
+ }
12
+ function setExpoentialRetries() {
13
+ flowModule.retry = {
14
+ ...flowModule.retry,
15
+ exponential: {
16
+ attempts: 0,
17
+ multiplier: 1,
18
+ seconds: 0
19
+ }
20
+ };
21
+ }
22
+ $: isConstantRetryEnabled = Boolean(flowModule.retry?.constant);
23
+ $: isExponentialRetryEnabled = Boolean(flowModule.retry?.exponential);
24
+ </script>
25
+
26
+ <div class="flex flex-col items-start space-y-1">
27
+ <Toggle
28
+ checked={isConstantRetryEnabled}
29
+ on:change={() => {
30
+ if (isConstantRetryEnabled && flowModule.retry?.constant) {
31
+ flowModule.retry.constant = undefined
32
+ } else {
33
+ setConstantRetries()
34
+ }
35
+ }}
36
+ options={{
37
+ right: 'Constant retry enabled'
38
+ }}
39
+ />
40
+ {#if flowModule.retry?.constant}
41
+ <span class="text-xs font-bold">Attempts</span>
42
+ <input bind:value={flowModule.retry.constant.attempts} type="number" />
43
+ <span class="text-xs font-bold">Delay (seconds)</span>
44
+ <input bind:value={flowModule.retry.constant.seconds} type="number" />
45
+ {:else}
46
+ <span class="text-xs font-bold">Attempts</span>
47
+ <input type="number" disabled />
48
+ <span class="text-xs font-bold">Delay (seconds)</span>
49
+ <input type="number" disabled />
50
+ {/if}
51
+
52
+ <Toggle
53
+ checked={isExponentialRetryEnabled}
54
+ on:change={() => {
55
+ if (isExponentialRetryEnabled && flowModule.retry?.exponential) {
56
+ flowModule.retry.exponential = undefined
57
+ } else {
58
+ setExpoentialRetries()
59
+ }
60
+ }}
61
+ options={{
62
+ right: 'Exponential retry enabled'
63
+ }}
64
+ />
65
+ {#if flowModule.retry?.exponential}
66
+ <span class="text-xs font-bold">Attempts</span>
67
+ <input bind:value={flowModule.retry.exponential.attempts} type="number" />
68
+ <span class="text-xs font-bold">Mulitplier</span>
69
+ <input bind:value={flowModule.retry.exponential.multiplier} type="number" />
70
+ <span class="text-xs font-bold">Initial delay (seconds)</span>
71
+ <input bind:value={flowModule.retry.exponential.seconds} type="number" />
72
+ {:else}
73
+ <span class="text-xs font-bold">Attempts</span>
74
+ <input type="number" disabled />
75
+ <span class="text-xs font-bold">Mulitplier</span>
76
+ <input type="number" disabled />
77
+ <span class="text-xs font-bold">Initial delay (seconds)</span>
78
+ <input type="number" disabled />
79
+ {/if}
80
+ </div>
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { FlowModule } from '../../../gen';
3
+ declare const __propDef: {
4
+ props: {
5
+ flowModule: FlowModule;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type FlowRetriesProps = typeof __propDef.props;
13
+ export declare type FlowRetriesEvents = typeof __propDef.events;
14
+ export declare type FlowRetriesSlots = typeof __propDef.slots;
15
+ export default class FlowRetries extends SvelteComponentTyped<FlowRetriesProps, FlowRetriesEvents, FlowRetriesSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,18 @@
1
+ <script>import CronInput from '../../CronInput.svelte';
2
+ import SchemaForm from '../../SchemaForm.svelte';
3
+ import Toggle from '../../Toggle.svelte';
4
+ import { getContext } from 'svelte';
5
+ import { flowStore } from '../flowStore';
6
+ const { schedule } = getContext('FlowEditorContext');
7
+ </script>
8
+
9
+ <CronInput bind:schedule={$schedule.cron} />
10
+
11
+ <SchemaForm schema={$flowStore.schema} bind:args={$schedule.args} />
12
+
13
+ <Toggle
14
+ bind:checked={$schedule.enabled}
15
+ options={{
16
+ right: 'Schedule enabled'
17
+ }}
18
+ />
@@ -0,0 +1,14 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {};
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {};
8
+ };
9
+ export declare type FlowSchedulesProps = typeof __propDef.props;
10
+ export declare type FlowSchedulesEvents = typeof __propDef.events;
11
+ export declare type FlowSchedulesSlots = typeof __propDef.slots;
12
+ export default class FlowSchedules extends SvelteComponentTyped<FlowSchedulesProps, FlowSchedulesEvents, FlowSchedulesSlots> {
13
+ }
14
+ export {};
@@ -0,0 +1,78 @@
1
+ <script>import Tabs from '../../common/tabs/Tabs.svelte';
2
+ import Tab from '../../common/tabs/Tab.svelte';
3
+ import TabContent from '../../common/tabs/TabContent.svelte';
4
+ import { flowStore } from '../flowStore';
5
+ import Path from '../../Path.svelte';
6
+ import Required from '../../Required.svelte';
7
+ import FlowCard from '../common/FlowCard.svelte';
8
+ import FlowSchedules from './FlowSchedules.svelte';
9
+ import SvelteMarkdown from 'svelte-markdown';
10
+ export let initialPath;
11
+ export let defaultTab = 'metadata';
12
+ </script>
13
+
14
+ <FlowCard title="Settings">
15
+ <Tabs selected={defaultTab}>
16
+ <Tab value="metadata">Metadata</Tab>
17
+ <Tab value="schedule">Schedule</Tab>
18
+
19
+ <svelte:fragment slot="content">
20
+ <TabContent value="metadata" class="p-4">
21
+ <Path bind:path={$flowStore.path} {initialPath} namePlaceholder="my_flow" kind="flow">
22
+ <div slot="ownerToolkit">
23
+ Flow permissions depend on their path. Select the group <span class="font-mono"
24
+ >all</span
25
+ >
26
+ to share your flow, and <span class="font-mono">user</span> to keep it private.
27
+ <a href="https://docs.windmill.dev/docs/reference/namespaces">docs</a>
28
+ </div>
29
+ </Path>
30
+
31
+ <label class="block my-4">
32
+ <span class="text-gray-700">Summary <Required required={false} /></span>
33
+ <textarea
34
+ bind:value={$flowStore.summary}
35
+ class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
36
+ placeholder="A very short summary of the flow displayed when the flow is listed"
37
+ rows="1"
38
+ id="flow-summary"
39
+ />
40
+ </label>
41
+
42
+ <label class="block my-4" for="inp">
43
+ <span class="text-gray-700"
44
+ >Description<Required required={false} detail="accept markdown formatting" />
45
+ <textarea
46
+ id="inp"
47
+ bind:value={$flowStore.description}
48
+ class="
49
+ mt-1
50
+ block
51
+ w-full
52
+ rounded-md
53
+ border-gray-300
54
+ shadow-sm
55
+ focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
56
+ "
57
+ placeholder="A description to help users understand what this script does and how to use it."
58
+ rows="3"
59
+ />
60
+ </span>
61
+ </label>
62
+
63
+ <div>
64
+ <h3 class="text-gray-700 ">Description rendered</h3>
65
+ <div
66
+ class="prose mt-5 text-xs shadow-inner shadow-blue p-4 overflow-auto"
67
+ style="max-height: 200px;"
68
+ >
69
+ <SvelteMarkdown source={$flowStore.description ?? ''} />
70
+ </div>
71
+ </div>
72
+ </TabContent>
73
+ <TabContent value="schedule" class="p-4">
74
+ <FlowSchedules />
75
+ </TabContent>
76
+ </svelte:fragment>
77
+ </Tabs>
78
+ </FlowCard>
@@ -1,12 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- pathError?: string | undefined;
5
- initialPath?: string | undefined;
6
- previewArgs?: Record<string, any> | undefined;
7
- scheduleArgs?: Record<string, any> | undefined;
8
- scheduleEnabled?: boolean | undefined;
9
- scheduleCron?: string | undefined;
4
+ initialPath: string;
5
+ defaultTab?: string | undefined;
10
6
  };
11
7
  events: {
12
8
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,32 @@
1
+ <script>import Alert from '../../common/alert/Alert.svelte';
2
+ import Badge from '../../common/badge/Badge.svelte';
3
+ import ConfirmationModal from '../../common/confirmationModal/ConfirmationModal.svelte';
4
+ import { createEventDispatcher } from 'svelte';
5
+ export let open;
6
+ const dispatch = createEventDispatcher();
7
+ </script>
8
+
9
+ <ConfirmationModal
10
+ {open}
11
+ title="Remove step"
12
+ confirmationText="Remove"
13
+ on:canceled={() => {
14
+ open = false
15
+ dispatch('canceled')
16
+ }}
17
+ on:confirmed={() => {
18
+ open = false
19
+ dispatch('confirmed')
20
+ }}
21
+ >
22
+ <div class="flex flex-col w-full space-y-4">
23
+ <span>Are you sure you want to remove this step?</span>
24
+ <Alert type="info" title="Bypass confirmation">
25
+ <div>
26
+ You can press
27
+ <kbd color="dark-gray">SHIFT</kbd>
28
+ while removing a step to bypass confirmation.
29
+ </div>
30
+ </Alert>
31
+ </div>
32
+ </ConfirmationModal>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ open: boolean;
5
+ };
6
+ events: {
7
+ canceled: CustomEvent<any>;
8
+ confirmed: CustomEvent<any>;
9
+ } & {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type RemoveStepConfirmationModalProps = typeof __propDef.props;
15
+ export declare type RemoveStepConfirmationModalEvents = typeof __propDef.events;
16
+ export declare type RemoveStepConfirmationModalSlots = typeof __propDef.slots;
17
+ export default class RemoveStepConfirmationModal extends SvelteComponentTyped<RemoveStepConfirmationModalProps, RemoveStepConfirmationModalEvents, RemoveStepConfirmationModalSlots> {
18
+ }
19
+ export {};
@@ -1,14 +1,15 @@
1
1
  import type { Schema } from '../../common';
2
2
  import type { Flow, FlowModule } from '../../gen';
3
- export declare type FlowModuleSchema = {
4
- flowModule: FlowModule;
3
+ export declare type FlowModuleState = {
5
4
  schema: Schema;
6
- childFlowModules?: FlowModuleSchema[];
5
+ childFlowModules?: FlowModuleState[];
6
+ previewArgs?: any;
7
7
  previewResult?: any;
8
8
  };
9
- export declare type FlowState = FlowModuleSchema[];
9
+ export declare type FlowState = {
10
+ modules: FlowModuleState[];
11
+ failureModule: FlowModuleState;
12
+ };
10
13
  export declare const flowStateStore: import("svelte/store").Writable<FlowState>;
11
14
  export declare function initFlowState(flow: Flow): Promise<void>;
12
- export declare const isCopyFirstStepSchemaDisabled: import("svelte/store").Readable<boolean>;
13
- export declare function flowModulesToFlowState(flowModules: FlowModule[]): Promise<FlowState>;
14
- export declare function flowStateToFlow(flowState: FlowState, flow: Flow): Flow;
15
+ export declare function mapFlowModules(flowModules: FlowModule[]): Promise<FlowModuleState[]>;
@@ -1,52 +1,31 @@
1
- import { derived, writable } from 'svelte/store';
2
- import { emptyFlowModuleSchema, isEmptyFlowModule, loadFlowModuleSchema } from './flowStateUtils';
3
- export const flowStateStore = writable(undefined);
1
+ import { writable } from 'svelte/store';
2
+ import { emptyFlowModuleState, isEmptyFlowModule, loadFlowModuleSchema } from './flowStateUtils';
3
+ export const flowStateStore = writable({ modules: [], failureModule: emptyFlowModuleState() });
4
4
  export async function initFlowState(flow) {
5
- const flowState = await flowModulesToFlowState(flow.value.modules);
6
- flowStateStore.set(flowState);
5
+ const modules = await mapFlowModules(flow.value.modules);
6
+ const failureModule = flow.value.failure_module
7
+ ? await mapFlowModule(flow.value.failure_module)
8
+ : emptyFlowModuleState();
9
+ flowStateStore.set({
10
+ modules,
11
+ failureModule
12
+ });
7
13
  }
8
- export const isCopyFirstStepSchemaDisabled = derived(flowStateStore, (flowState) => {
9
- if (flowState) {
10
- const firstModule = flowState[0];
11
- if (!firstModule) {
12
- return true;
13
- }
14
- const fm = firstModule.flowModule;
15
- return flowState.length === 0 || isEmptyFlowModule(fm);
14
+ async function mapFlowModule(flowModule) {
15
+ const value = flowModule.value;
16
+ if (value.type === 'forloopflow') {
17
+ const childFlowModules = await Promise.all(value.modules.map(async (module) => loadFlowModuleSchema(module)));
18
+ const loopFlowModule = await loadFlowModuleSchema(flowModule);
19
+ return {
20
+ ...loopFlowModule,
21
+ childFlowModules
22
+ };
16
23
  }
17
- else {
18
- return true;
24
+ if (isEmptyFlowModule(flowModule)) {
25
+ return emptyFlowModuleState();
19
26
  }
20
- });
21
- export async function flowModulesToFlowState(flowModules) {
22
- return Promise.all(flowModules.map(async (flowModule) => {
23
- const value = flowModule.value;
24
- if (value.type === 'forloopflow') {
25
- const childFlowModules = await Promise.all(value.modules.map(async (module) => loadFlowModuleSchema(module)));
26
- const loopFlowModule = await loadFlowModuleSchema(flowModule);
27
- return {
28
- ...loopFlowModule,
29
- childFlowModules
30
- };
31
- }
32
- if (isEmptyFlowModule(flowModule)) {
33
- return emptyFlowModuleSchema();
34
- }
35
- return loadFlowModuleSchema(flowModule);
36
- }));
27
+ return loadFlowModuleSchema(flowModule);
37
28
  }
38
- export function flowStateToFlow(flowState, flow) {
39
- if (!flowState || !flow) {
40
- return flow;
41
- }
42
- const modules = flowState.map(({ flowModule, childFlowModules }) => {
43
- const fmv = flowModule.value;
44
- if (fmv.type === 'forloopflow' && childFlowModules && Array.isArray(childFlowModules)) {
45
- fmv.modules = childFlowModules.map((cfm) => cfm.flowModule);
46
- flowModule.value = fmv;
47
- }
48
- return flowModule;
49
- });
50
- flow.value.modules = modules;
51
- return flow;
29
+ export async function mapFlowModules(flowModules) {
30
+ return Promise.all(flowModules.map(async (flowModule) => mapFlowModule(flowModule)));
52
31
  }
@@ -1,37 +1,39 @@
1
1
  import type { Schema } from '../../common';
2
- import { Job, type FlowModule, type RawScript } from '../../gen';
3
- import { type FlowModuleSchema, type FlowState } from './flowState';
4
- export declare function emptyFlowModuleSchema(): FlowModuleSchema;
5
- export declare function loadFlowModuleSchema(flowModule: FlowModule): Promise<FlowModuleSchema>;
6
- export declare function pickScript(path: string): Promise<FlowModuleSchema>;
7
- export declare function createInlineScriptModule({ language, type }: {
2
+ import { Job, Script, type FlowModule, type RawScript } from '../../gen';
3
+ import { type FlowModuleState, type FlowState } from './flowState';
4
+ export declare function emptyFlowModuleState(): FlowModuleState;
5
+ export declare function loadFlowModuleSchema(flowModule: FlowModule): Promise<FlowModuleState>;
6
+ export declare function pickScript(path: string): Promise<[FlowModule, FlowModuleState]>;
7
+ export declare function createInlineScriptModule({ language, kind, subkind }: {
8
8
  language: RawScript.language;
9
- type: 'trigger' | 'flow' | 'pgsql';
10
- }): Promise<FlowModuleSchema>;
11
- export declare function createLoop(): Promise<FlowModuleSchema>;
12
- export declare function fork(flowModule: FlowModule): Promise<FlowModuleSchema>;
9
+ kind: Script.kind;
10
+ subkind: 'pgsql' | 'flow';
11
+ }): Promise<[FlowModule, FlowModuleState]>;
12
+ export declare function createLoop(): Promise<[FlowModule, FlowModuleState]>;
13
+ export declare function fork(flowModule: FlowModule): Promise<[FlowModule, FlowModuleState]>;
13
14
  export declare function createInlineScriptModuleFromPath(path: string): Promise<FlowModule>;
14
15
  export declare function createScriptFromInlineScript({ flowModule, suffix, schema }: {
15
16
  flowModule: FlowModule;
16
17
  suffix: string;
17
18
  schema: Schema;
18
- }): Promise<FlowModuleSchema>;
19
+ }): Promise<[FlowModule, FlowModuleState]>;
19
20
  export declare function isEmptyFlowModule(flowModule: FlowModule): boolean;
20
21
  declare type Result = any;
21
22
  declare type PickableProperties = {
22
23
  flow_input?: Object;
23
24
  previous_result: Result | undefined;
24
- step: Result[];
25
+ step?: Result[];
25
26
  };
26
27
  declare type StepPropPicker = {
27
28
  pickableProperties: PickableProperties;
28
29
  extraLib: string;
29
30
  };
31
+ export declare const NEVER_TESTED_THIS_FAR = "never tested this far";
30
32
  export declare function getStepPropPicker(indexes: number[], flowInputSchema: Schema, flowState: FlowState, args: Record<string, any>): StepPropPicker;
31
33
  export declare type JobResult = {
32
34
  job?: Job;
33
- innerJobs?: JobResult[];
35
+ innerJobs: JobResult[];
34
36
  loopJobs?: JobResult[];
35
37
  };
36
- export declare function mapJobResultsToFlowState(jobs: JobResult, config: 'upto' | 'justthis', configIndex: number): void;
38
+ export declare function mapJobResultsToFlowState(jobs: JobResult, upto: number): void;
37
39
  export {};