windmill-components 1.394.8 → 1.405.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 (219) hide show
  1. package/package/ata/edgeCases.d.ts +0 -1
  2. package/package/ata/edgeCases.js +2 -8
  3. package/package/ata/index.js +4 -3
  4. package/package/common.d.ts +1 -1
  5. package/package/common.js +2 -2
  6. package/package/components/ApiConnectForm.svelte +33 -7
  7. package/package/components/ArgInput.svelte +4 -2
  8. package/package/components/CenteredModal.svelte +4 -1
  9. package/package/components/CenteredModal.svelte.d.ts +1 -0
  10. package/package/components/DateInput.svelte +2 -0
  11. package/package/components/DateInput.svelte.d.ts +1 -0
  12. package/package/components/DefaultScripts.svelte +8 -3
  13. package/package/components/DefaultScripts.svelte.d.ts +5 -1
  14. package/package/components/DefaultScriptsInner.svelte +16 -7
  15. package/package/components/DefaultScriptsInner.svelte.d.ts +3 -1
  16. package/package/components/Dev.svelte +68 -11
  17. package/package/components/DropdownV2.svelte.d.ts +3 -3
  18. package/package/components/DropdownV2Inner.svelte.d.ts +3 -3
  19. package/package/components/EditableSchemaForm.svelte +1 -0
  20. package/package/components/Editor.svelte +3 -2
  21. package/package/components/Editor.svelte.d.ts +1 -1
  22. package/package/components/ExecutionDuration.svelte +44 -0
  23. package/package/components/ExecutionDuration.svelte.d.ts +24 -0
  24. package/package/components/FlowBuilder.svelte +20 -12
  25. package/package/components/FlowGraphViewer.svelte +9 -2
  26. package/package/components/FlowGraphViewerStep.svelte +23 -10
  27. package/package/components/FlowJobResult.svelte +0 -1
  28. package/package/components/FlowStatusViewerInner.svelte +17 -4
  29. package/package/components/FlowTimeline.svelte +3 -3
  30. package/package/components/HighlightCode.svelte +3 -0
  31. package/package/components/IconedResourceType.svelte +17 -10
  32. package/package/components/IconedResourceType.svelte.d.ts +2 -0
  33. package/package/components/IdEditorInput.svelte +0 -1
  34. package/package/components/InstanceSettings.svelte +247 -129
  35. package/package/components/InstanceSettings.svelte.d.ts +2 -0
  36. package/package/components/JobArgs.svelte +3 -1
  37. package/package/components/LightweightArgInput.svelte +35 -10
  38. package/package/components/LightweightArgInput.svelte.d.ts +1 -0
  39. package/package/components/LightweightObjectResourceInput.svelte +2 -0
  40. package/package/components/LightweightObjectResourceInput.svelte.d.ts +1 -0
  41. package/package/components/LightweightSchemaForm.svelte +2 -0
  42. package/package/components/LightweightSchemaForm.svelte.d.ts +1 -0
  43. package/package/components/Login.svelte +10 -5
  44. package/package/components/Login.svelte.d.ts +1 -0
  45. package/package/components/ModulePreview.svelte +21 -2
  46. package/package/components/ModuleStatus.svelte +3 -0
  47. package/package/components/ModuleStatus.svelte.d.ts +1 -0
  48. package/package/components/OAuthSetting.svelte +40 -15
  49. package/package/components/ObjectStoreConfigSettings.svelte +78 -76
  50. package/package/components/ParqetCsvTableRenderer.svelte +25 -3
  51. package/package/components/Password.svelte.d.ts +1 -1
  52. package/package/components/Path.svelte +74 -54
  53. package/package/components/Path.svelte.d.ts +2 -1
  54. package/package/components/ResourceEditor.svelte +38 -9
  55. package/package/components/ResultJobLoader.svelte +6 -3
  56. package/package/components/ResultJobLoader.svelte.d.ts +1 -1
  57. package/package/components/ScheduleEditorInner.svelte +2 -2
  58. package/package/components/SchemaForm.svelte +6 -1
  59. package/package/components/ScriptBuilder.svelte +12 -5
  60. package/package/components/ScriptEditor.svelte +33 -3
  61. package/package/components/ScriptEditor.svelte.d.ts +1 -1
  62. package/package/components/Scrollable.svelte +47 -0
  63. package/package/components/Scrollable.svelte.d.ts +21 -0
  64. package/package/components/ShareModal.svelte.d.ts +2 -2
  65. package/package/components/SuperadminSettings.svelte +5 -7
  66. package/package/components/TestJobLoader.svelte +46 -5
  67. package/package/components/TestJobLoader.svelte.d.ts +2 -1
  68. package/package/components/ToggleHubWorkspaceQuick.svelte +14 -0
  69. package/package/components/ToggleHubWorkspaceQuick.svelte.d.ts +16 -0
  70. package/package/components/WorkspaceGroup.svelte +3 -2
  71. package/package/components/apps/components/helpers/DebouncedInput.svelte +9 -1
  72. package/package/components/apps/components/inputs/AppSelect.svelte +1 -1
  73. package/package/components/apps/editor/component/components.d.ts +79 -79
  74. package/package/components/apps/svelte-select/lib/Select.svelte +1 -1
  75. package/package/components/common/fileUpload/FileUpload.svelte +1 -1
  76. package/package/components/common/languageIcons/LanguageIcon.svelte +5 -2
  77. package/package/components/common/menu/Menu.svelte +2 -1
  78. package/package/components/common/menu/MenuV2.svelte +3 -1
  79. package/package/components/common/menu/MenuV2.svelte.d.ts +1 -0
  80. package/package/components/common/popup/Popup.svelte +22 -12
  81. package/package/components/common/popup/Popup.svelte.d.ts +2 -0
  82. package/package/components/common/popup/PopupV2.svelte +58 -0
  83. package/package/components/common/popup/PopupV2.svelte.d.ts +27 -0
  84. package/package/components/copilot/CronGen.svelte +1 -1
  85. package/package/components/copilot/RegexGen.svelte +4 -4
  86. package/package/components/copilot/StepGen.svelte +6 -6
  87. package/package/components/copilot/StepGenQuick.svelte +57 -0
  88. package/package/components/copilot/StepGenQuick.svelte.d.ts +23 -0
  89. package/package/components/copilot/flow.d.ts +2 -0
  90. package/package/components/copilot/flow.js +55 -0
  91. package/package/components/details/DetailPageDetailPanel.svelte +9 -1
  92. package/package/components/details/DetailPageDetailPanel.svelte.d.ts +2 -1
  93. package/package/components/details/DetailPageLayout.svelte +2 -0
  94. package/package/components/details/DetailPageLayout.svelte.d.ts +3 -0
  95. package/package/components/details/utils.d.ts +0 -1
  96. package/package/components/details/utils.js +1 -12
  97. package/package/components/flows/FlowEditor.svelte +2 -1
  98. package/package/components/flows/FlowProgressBar.svelte +16 -1
  99. package/package/components/flows/FlowProgressBar.svelte.d.ts +1 -0
  100. package/package/components/flows/content/FlowBranchesAllWrapper.svelte +8 -0
  101. package/package/components/flows/content/FlowBranchesAllWrapper.svelte.d.ts +1 -0
  102. package/package/components/flows/content/FlowBranchesOneWrapper.svelte +8 -0
  103. package/package/components/flows/content/FlowBranchesOneWrapper.svelte.d.ts +1 -0
  104. package/package/components/flows/content/FlowConstants.svelte +1 -1
  105. package/package/components/flows/content/FlowEditorPanel.svelte +3 -0
  106. package/package/components/flows/content/FlowInputs.svelte +7 -6
  107. package/package/components/flows/content/FlowInputs.svelte.d.ts +1 -0
  108. package/package/components/flows/content/FlowInputsFlowQuick.svelte +65 -0
  109. package/package/components/flows/content/FlowInputsFlowQuick.svelte.d.ts +19 -0
  110. package/package/components/flows/content/FlowInputsQuick.svelte +419 -0
  111. package/package/components/flows/content/FlowInputsQuick.svelte.d.ts +33 -0
  112. package/package/components/flows/content/FlowLoop.svelte +7 -1
  113. package/package/components/flows/content/FlowModuleComponent.svelte +12 -3
  114. package/package/components/flows/content/FlowModuleComponent.svelte.d.ts +1 -0
  115. package/package/components/flows/content/FlowModuleSkip.svelte +69 -0
  116. package/package/components/flows/content/FlowModuleSkip.svelte.d.ts +20 -0
  117. package/package/components/flows/content/FlowModuleWrapper.svelte +17 -4
  118. package/package/components/flows/content/FlowPreprocessorModule.svelte +16 -0
  119. package/package/components/flows/content/FlowPreprocessorModule.svelte.d.ts +16 -0
  120. package/package/components/flows/content/FlowWhileLoop.svelte +9 -0
  121. package/package/components/flows/content/FlowWhileLoop.svelte.d.ts +1 -0
  122. package/package/components/flows/content/GenAiQuick.svelte +30 -0
  123. package/package/components/flows/content/GenAiQuick.svelte.d.ts +20 -0
  124. package/package/components/flows/content/ScriptEditorDrawer.svelte +3 -2
  125. package/package/components/flows/flowInfers.js +1 -1
  126. package/package/components/flows/header/FlowPreviewButtons.svelte +1 -0
  127. package/package/components/flows/idUtils.js +3 -1
  128. package/package/components/flows/map/FlowCopilotButton.svelte +55 -0
  129. package/package/components/flows/map/FlowCopilotButton.svelte.d.ts +16 -0
  130. package/package/components/flows/map/FlowErrorHandlerItem.svelte +77 -47
  131. package/package/components/flows/map/FlowJobsMenu.svelte +1 -1
  132. package/package/components/flows/map/FlowModuleSchemaItem.svelte +25 -12
  133. package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +1 -0
  134. package/package/components/flows/map/FlowModuleSchemaMap.svelte +61 -18
  135. package/package/components/flows/map/InsertModuleButton.svelte +161 -138
  136. package/package/components/flows/map/InsertModuleButton.svelte.d.ts +7 -4
  137. package/package/components/flows/map/MapItem.svelte +11 -0
  138. package/package/components/flows/map/MapItem.svelte.d.ts +1 -0
  139. package/package/components/flows/pickers/FlowScriptPickerQuick.svelte +48 -0
  140. package/package/components/flows/pickers/FlowScriptPickerQuick.svelte.d.ts +23 -0
  141. package/package/components/flows/pickers/FlowToplevelNode.svelte +19 -0
  142. package/package/components/flows/pickers/FlowToplevelNode.svelte.d.ts +19 -0
  143. package/package/components/flows/pickers/PickHubScriptQuick.svelte +138 -0
  144. package/package/components/flows/pickers/PickHubScriptQuick.svelte.d.ts +33 -0
  145. package/package/components/flows/pickers/TopLevelNode.svelte +58 -0
  146. package/package/components/flows/pickers/TopLevelNode.svelte.d.ts +21 -0
  147. package/package/components/flows/pickers/WorkspaceScriptPickerQuick.svelte +120 -0
  148. package/package/components/flows/pickers/WorkspaceScriptPickerQuick.svelte.d.ts +35 -0
  149. package/package/components/flows/types.d.ts +1 -0
  150. package/package/components/graph/FlowGraphV2.svelte +93 -58
  151. package/package/components/graph/FlowGraphV2.svelte.d.ts +2 -1
  152. package/package/components/graph/graphBuilder.d.ts +2 -1
  153. package/package/components/graph/graphBuilder.js +345 -280
  154. package/package/components/graph/model.d.ts +1 -0
  155. package/package/components/graph/renderers/edges/BaseEdge.svelte +36 -14
  156. package/package/components/graph/renderers/nodes/BranchOneStart.svelte +1 -1
  157. package/package/components/graph/renderers/nodes/InputNode.svelte +31 -51
  158. package/package/components/graph/renderers/nodes/InputNode.svelte.d.ts +6 -1
  159. package/package/components/graph/renderers/nodes/ModuleNode.svelte +2 -1
  160. package/package/components/graph/util.d.ts +1 -1
  161. package/package/components/graph/util.js +7 -2
  162. package/package/components/home/ListFiltersQuick.svelte +51 -0
  163. package/package/components/home/ListFiltersQuick.svelte.d.ts +23 -0
  164. package/package/components/icons/AnsibleIcon.svelte +42 -0
  165. package/package/components/icons/AnsibleIcon.svelte.d.ts +25 -0
  166. package/package/components/icons/WindmillIcon2.svelte +141 -0
  167. package/package/components/icons/WindmillIcon2.svelte.d.ts +20 -0
  168. package/package/components/icons/index.d.ts +2 -1
  169. package/package/components/icons/index.js +2 -1
  170. package/package/components/instanceSettings.d.ts +2 -2
  171. package/package/components/instanceSettings.js +25 -58
  172. package/package/components/jobs/JobProgressBar.svelte +52 -0
  173. package/package/components/jobs/JobProgressBar.svelte.d.ts +23 -0
  174. package/package/components/progressBar/ProgressBar.svelte +18 -1
  175. package/package/components/progressBar/ProgressBar.svelte.d.ts +3 -0
  176. package/package/components/runs/JobPreview.svelte +1 -0
  177. package/package/components/runs/PreprocessedArgsDisplay.svelte +71 -0
  178. package/package/components/runs/PreprocessedArgsDisplay.svelte.d.ts +16 -0
  179. package/package/components/schema/AddProperty.svelte +1 -0
  180. package/package/components/schema/EditableSchemaWrapper.svelte +142 -19
  181. package/package/components/schema/EditableSchemaWrapper.svelte.d.ts +1 -0
  182. package/package/components/schema/FlowPropertyEditor.svelte +12 -0
  183. package/package/components/schema/FlowPropertyEditor.svelte.d.ts +1 -0
  184. package/package/components/scriptEditor/LogPanel.svelte +1 -0
  185. package/package/components/scriptEditor/LogPanel.svelte.d.ts +3 -1
  186. package/package/components/search/GlobalSearchModal.svelte +2 -1
  187. package/package/components/sidebar/SidebarContent.svelte +69 -8
  188. package/package/components/sidebar/changelogs.js +10 -0
  189. package/package/components/triggers/RouteEditor.svelte +19 -0
  190. package/package/components/triggers/RouteEditor.svelte.d.ts +21 -0
  191. package/package/components/triggers/RouteEditorInner.svelte +327 -0
  192. package/package/components/triggers/RouteEditorInner.svelte.d.ts +21 -0
  193. package/package/components/triggers/RoutesPanel.svelte +74 -0
  194. package/package/components/triggers/RoutesPanel.svelte.d.ts +17 -0
  195. package/package/editorUtils.js +2 -0
  196. package/package/gen/core/OpenAPI.js +1 -1
  197. package/package/gen/schemas.gen.d.ts +159 -8
  198. package/package/gen/schemas.gen.js +161 -8
  199. package/package/gen/services.gen.d.ts +139 -1
  200. package/package/gen/services.gen.js +282 -1
  201. package/package/gen/types.gen.d.ts +455 -12
  202. package/package/hubPaths.json +6 -8
  203. package/package/infer.d.ts +4 -2
  204. package/package/infer.js +25 -23
  205. package/package/inferArgSig.js +8 -2
  206. package/package/monaco_workers/graphql.worker.bundle.js +45440 -174
  207. package/package/relative_imports.d.ts +3 -0
  208. package/package/relative_imports.js +25 -0
  209. package/package/script_helpers.d.ts +7 -2
  210. package/package/script_helpers.js +151 -3
  211. package/package/scripts.d.ts +1 -1
  212. package/package/scripts.js +5 -1
  213. package/package/stores.d.ts +1 -0
  214. package/package/stores.js +1 -0
  215. package/package/utils.d.ts +1 -0
  216. package/package/utils.js +4 -0
  217. package/package.json +16 -7
  218. package/package/components/flows/map/InsertTriggerButton.svelte +0 -48
  219. package/package/components/flows/map/InsertTriggerButton.svelte.d.ts +0 -24
@@ -0,0 +1,3 @@
1
+ export declare function parseTypescriptDeps(code: string): string[];
2
+ export declare function isTypescriptRelativePath(d: string): boolean;
3
+ export declare function approximateFindPythonRelativePath(code: string): [number, string][];
@@ -0,0 +1,25 @@
1
+ import { parse_ts_imports } from 'windmill-parser-wasm-ts';
2
+ export function parseTypescriptDeps(code) {
3
+ let r = JSON.parse(parse_ts_imports(code));
4
+ if (r.error) {
5
+ console.error(r.error);
6
+ return [];
7
+ }
8
+ else {
9
+ return r.imports;
10
+ }
11
+ }
12
+ export function isTypescriptRelativePath(d) {
13
+ return (d.startsWith('./') ||
14
+ d.startsWith('../') ||
15
+ d.startsWith('/') ||
16
+ d.startsWith('.../') ||
17
+ d.startsWith('/'));
18
+ }
19
+ export function approximateFindPythonRelativePath(code) {
20
+ // Define the regular expression for finding relative imports
21
+ const regex = /^\s*from\s+(\.+)\w*\s+import\s+.+$/gm;
22
+ // Use match to find all matches in the code
23
+ const matches = code.match(regex);
24
+ return [...(matches?.entries() ?? [])] || [];
25
+ }
@@ -20,19 +20,24 @@ export declare const POSTGRES_INIT_CODE = "-- to pin the database use '-- databa
20
20
  export declare const MYSQL_INIT_CODE = "-- to pin the database use '-- database f/your/path'\n-- :name1 (text) = default arg\n-- :name2 (int)\n-- :name3 (int)\nINSERT INTO demo VALUES (:name1, :name2);\nUPDATE demo SET col2 = :name3 WHERE col2 = :name2;\n";
21
21
  export declare const BIGQUERY_INIT_CODE = "-- to pin the database use '-- database f/your/path'\n-- @name1 (string) = default arg\n-- @name2 (integer)\n-- @name3 (string[])\n-- @name4 (integer)\nINSERT INTO `demodb.demo` VALUES (@name1, @name2, @name3);\nUPDATE `demodb.demo` SET col2 = @name4 WHERE col2 = @name2;\n";
22
22
  export declare const SNOWFLAKE_INIT_CODE = "-- to pin the database use '-- database f/your/path'\n-- ? name1 (varchar) = default arg\n-- ? name2 (int)\nINSERT INTO demo VALUES (?, ?);\n-- ? name3 (int)\n-- ? name2 (int)\nUPDATE demo SET col2 = ? WHERE col2 = ?;\n";
23
- export declare const MSSQL_INIT_CODE = "-- to pin the database use '-- database f/your/path'\n-- @p1 name1 (varchar) = default arg\n-- @p2 name2 (int)\n-- @p3 name3 (int)\nINSERT INTO demo VALUES (@p1, @p2);\nUPDATE demo SET col2 = @p3 WHERE col2 = @p2;\n";
23
+ export declare const MSSQL_INIT_CODE = "-- return_last_result\n-- to pin the database use '-- database f/your/path'\n-- @p1 name1 (varchar) = default arg\n-- @p2 name2 (int)\n-- @p3 name3 (int)\nINSERT INTO demo VALUES (@p1, @p2);\nUPDATE demo SET col2 = @p3 WHERE col2 = @p2;\n";
24
24
  export declare const GRAPHQL_INIT_CODE = "query($name4: String, $name2: Int, $name3: [String]) {\n\tdemo(name1: $name1, name2: $name2, name3: $name3) {\n\t\tname1,\n\t\tname2,\n\t\tname3\n\t}\n}\n";
25
25
  export declare const PHP_INIT_CODE = "<?php\n\n// remove the first // of the following lines to specify packages to install using composer\n// // require:\n// // monolog/monolog@3.6.0\n// // stripe/stripe-php\n\nfunction main(\n // Postgresql $a,\n // array $b,\n // object $c,\n int $d = 123,\n string $e = \"default value\",\n float $f = 3.5,\n bool $g = true,\n) {\n return $d;\n}\n";
26
26
  export declare const RUST_INIT_CODE = "//! Add dependencies in the following partial Cargo.toml manifest\n//!\n//! ```cargo\n//! [dependencies]\n//! anyhow = \"1.0.86\"\n//! rand = \"0.7.2\"\n//! ```\n//!\n//! Note that serde is used by default with the `derive` feature.\n//! You can still reimport it if you need additional features.\n\nuse anyhow::anyhow;\nuse rand::seq::SliceRandom;\nuse serde::Serialize;\n\n#[derive(Serialize, Debug)]\nstruct Ret {\n msg: String,\n number: i8,\n}\n\nfn main(who_to_greet: String, numbers: Vec<i8>) -> anyhow::Result<Ret> {\n println!(\n \"Person to greet: {} - numbers to choose: {:?}\",\n who_to_greet, numbers\n );\n Ok(Ret {\n msg: format!(\"Greetings {}!\", who_to_greet),\n number: *numbers\n .choose(&mut rand::thread_rng())\n .ok_or(anyhow!(\"There should be some numbers to choose from\"))?,\n })\n}\n";
27
27
  export declare const FETCH_INIT_CODE = "export async function main(\n\turl: string | undefined,\n\tmethod: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' = 'GET',\n\tbody: Object = {},\n\theaders: Record<string, string> = {}\n): Promise<Response | null> {\n\tif (!url) {\n\t\tconsole.error('Error: URL is undefined')\n\t\treturn null\n\t}\n\n\tconst requestOptions: RequestInit = {\n\t\tmethod: method || 'GET',\n\t\theaders: headers || {}\n\t}\n\n\tif (requestOptions.method !== 'GET' && requestOptions.method !== 'HEAD' && body !== undefined) {\n\t\trequestOptions.body = JSON.stringify(body)\n\t\trequestOptions.headers = {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t...requestOptions.headers\n\t\t}\n\t}\n\n\treturn await fetch(url, requestOptions)\n\t\t.then((res) => res.json())\n\t\t.catch(() => {\n\t\t\tthrow new Error('An error occured')\n\t\t})\n}";
28
28
  export declare const BASH_INIT_CODE = "# shellcheck shell=bash\n# arguments of the form X=\"$I\" are parsed as parameters X of type string\nmsg=\"$1\"\ndflt=\"${2:-default value}\"\n\n# the last line of the stdout is the return value\n# unless you write json to './result.json' or a string to './result.out'\necho \"Hello $msg\"\n";
29
29
  export declare const DENO_INIT_CODE_TRIGGER: string;
30
+ export declare const BUN_INIT_CODE_TRIGGER = "import * as wmill from \"windmill-client\"\n\nexport async function main() {\n\n // A common trigger script would follow this pattern:\n // 1. Get the last saved state\n // const state = await wmill.getState()\n // 2. Get the actual state from the external service\n // const newState = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json()\n // 3. Compare the two states and update the internal state\n // await wmill.setState(newState)\n // 4. Return the new rows\n // return range from (state to newState)\n\n return [1,2,3]\n\n // In subsequent scripts, you may refer to each row/value returned by the trigger script using\n // 'flow_input.iter.value'\n}\n";
30
31
  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";
31
32
  export declare const DENO_INIT_CODE_APPROVAL = "import * as wmill from \"npm:windmill-client@^1.158.2\"\n\nexport async function main(approver?: string) {\n const urls = await wmill.getResumeUrls(approver)\n // send the urls to their intended recipients\n\n return {\n // if the resumeUrls are part of the response, they will be available to any persons having access\n // to the run page and allowed to be approved from there, even from non owners of the flow\n // self-approval is disableable in the suspend options\n \t...urls,\n\n // to have prompts (self-approvable steps), clude instead the resume url in the returned payload of the step\n // the UX will automatically adapt and show the prompt to the operator when running the flow. e.g:\n // resume: urls['resume'],\n\n\t\tdefault_args: {},\n\t\tenums: {},\n\t\tdescription: undefined\n\t\t// supports all formats from rich display rendering such as simple strings,\n\t\t// but also markdown, html, images, tables, maps, render_all, etc...\n\t\t// https://www.windmill.dev/docs/core_concepts/rich_display_rendering\n }\n}\n\n// add a form in Advanced - Suspend\n// all on approval steps: https://www.windmill.dev/docs/flows/flow_approval";
32
33
  export declare const BUN_INIT_CODE_APPROVAL = "import * as wmill from \"windmill-client@^1.158.2\"\n\nexport async function main(approver?: string) {\n const urls = await wmill.getResumeUrls(approver)\n // send the urls to their intended recipients\n\n return {\n // if the resumeUrls are part of the response, they will be available to any persons having access\n // to the run page and allowed to be approved from there, even from non owners of the flow\n // self-approval is disableable in the suspend options\n \t...urls,\n\n // to have prompts (self-approvable steps), clude instead the resume url in the returned payload of the step\n // the UX will automatically adapt and show the prompt to the operator when running the flow. e.g:\n // resume: urls['resume'],\n\n\t\tdefault_args: {},\n\t\tenums: {},\n\t\tdescription: undefined\n\t\t// supports all formats from rich display rendering such as simple strings,\n\t\t// but also markdown, html, images, tables, maps, render_all, etc...\n\t\t// https://www.windmill.dev/docs/core_concepts/rich_display_rendering\n }\n}\n\n// add a form in Advanced - Suspend\n// all on approval steps: https://www.windmill.dev/docs/flows/flow_approval";
34
+ export declare const BUN_PREPROCESSOR_MODULE_CODE = "\nexport async function preprocessor(\n\twm_trigger: {\n\t\tkind: 'http' | 'email' | 'webhook',\n\t\thttp?: {\n\t\t\troute: string // The route path, e.g. \"/users/:id\"\n\t\t\tpath: string // The actual path called, e.g. \"/users/123\"\n\t\t\tmethod: string\n\t\t\tparams: Record<string, string>\n\t\t\tquery: Record<string, string>\n\t\t\theaders: Record<string, string>\n\t\t}\n\t},\n\t/* your other args */ \n) {\n\treturn {\n\t\t// return the args to be passed to the flow\n\t}\n}\n";
35
+ export declare const DENO_PREPROCESSOR_MODULE_CODE = "\nexport async function preprocessor(\n\twm_trigger: {\n\t\tkind: 'http' | 'email' | 'wehbook',\n\t\thttp?: {\n\t\t\troute: string // The route path, e.g. \"/users/:id\"\n\t\t\tpath: string // The actual path called, e.g. \"/users/123\"\n\t\t\tmethod: string\n\t\t\tparams: Record<string, string>\n\t\t\tquery: Record<string, string>\n\t\t\theaders: Record<string, string>\n\t\t}\n\t},\n\t/* your other args */ \n) {\n\treturn {\n\t\t// return the args to be passed to the flow\n\t}\n}\n";
33
36
  export declare const PYTHON_INIT_CODE_APPROVAL = "import wmill\n\ndef main():\n urls = wmill.get_resume_urls()\n # send the urls to their intended recipients\n\n return {\n # if the get_resume_urls are part of the response, they will be available to any persons having access\n # to the run page and allowed to be approved from there, even from non owners of the flow\n # self-approval is disableable in the suspend options\n **urls,\n\n # to have prompts (self-approvable steps), clude instead the resume url in the returned payload of the step\n # the UX will automatically adapt and show the prompt to the operator when running the flow. e.g:\n # \"resume\": urls[\"resume\"],\n\n \"default_args\": {},\n \"enums\": {},\n \"description\": None,\n # supports all formats from rich display rendering such as simple strings,\n # but also markdown, html, images, tables, maps, render_all, etc...\n # https://www.windmill.dev/docs/core_concepts/rich_display_rendering\n }\n\n# add a form in Advanced - Suspend\n# all on approval steps: https://www.windmill.dev/docs/flows/flow_approval";
37
+ export declare const PYTHON_PREPROCESSOR_MODULE_CODE = "from typing import TypedDict, Literal\n\nclass Http(TypedDict):\n\troute: str # The route path, e.g. \"/users/:id\"\n\tpath: str # The actual path called, e.g. \"/users/123\"\n\tmethod: str\n\tparams: dict[str, str]\n\tquery: dict[str, str]\n\theaders: dict[str, str]\n\nclass WmTrigger(TypedDict):\n kind: Literal[\"http\", \"email\", \"webhook\"]\n http: Http | None\n\ndef preprocessor(\n\twm_trigger: WmTrigger,\n\t# your other args\n):\n\treturn {\n\t\t# return the args to be passed to the flow\n\t}\n";
34
38
  export declare const DOCKER_INIT_CODE = "# shellcheck shell=bash\n# Bash script that calls docker as a client to the host daemon\n# See documentation: https://www.windmill.dev/docs/advanced/docker\nmsg=\"${1:-world}\"\n\nIMAGE=\"alpine:latest\"\nCOMMAND=\"/bin/echo Hello $msg\"\n\n# ensure that the image is up-to-date\ndocker pull $IMAGE\ndocker run --rm $IMAGE $COMMAND\n";
35
39
  export declare const POWERSHELL_INIT_CODE = "param($Msg, $Dflt = \"default value\", [int]$Nb = 3)\n\n# Import-Module MyModule\n\n# Import-Module WindmillClient\n# Connect-Windmill\n# Get-WindmillVariable -Path 'u/user/foo'\n\n# the last line of the stdout is the return value\nWrite-Output \"Hello $Msg\"";
40
+ export declare const ANSIBLE_PLAYBOOK_INIT_CODE = "---\ninventory:\n - resource_type: ansible_inventory\n # You can pin an inventory to this script by hardcoding the resource path:\n # resource: u/user/your_resource\n\n# File resources will be written in the relative `target` location before\n# running the playbook\n# file_resources:\n # - resource: u/user/fabulous_jinja_template\n # target: ./config_template.j2\n\n# Define the arguments of the windmill script\nextra_vars:\n world_qualifier:\n type: string\n\ndependencies:\n galaxy:\n collections:\n - name: community.general\n - name: community.vmware\n python:\n - jmespath\n---\n- name: Echo\n hosts: 127.0.0.1\n connection: local\n vars:\n my_result:\n a: 2\n b: true\n c: \"Hello\"\n\n tasks:\n - name: Print debug message\n debug:\n msg: \"Hello, {{world_qualifier}} world!\"\n - name: Write variable my_result to result.json\n delegate_to: localhost\n copy:\n content: \"{{ my_result | to_json }}\"\n dest: result.json\n";
36
41
  export declare function isInitialCode(content: string): boolean;
37
- export declare function initialCode(language: SupportedLanguage | 'bunnative' | undefined, kind: Script['kind'] | undefined, subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | 'fetch' | 'docker' | 'powershell' | 'bunnative' | undefined): string;
42
+ export declare function initialCode(language: SupportedLanguage | 'bunnative' | undefined, kind: Script['kind'] | undefined, subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | 'fetch' | 'docker' | 'powershell' | 'bunnative' | 'preprocessor' | undefined): string;
38
43
  export declare function getResetCode(language: SupportedLanguage | 'bunnative' | undefined, kind: Script['kind'] | undefined, subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | 'fetch' | 'docker' | 'powershell' | 'bunnative' | undefined): string;
@@ -191,7 +191,8 @@ INSERT INTO demo VALUES (?, ?);
191
191
  -- ? name2 (int)
192
192
  UPDATE demo SET col2 = ? WHERE col2 = ?;
193
193
  `;
194
- export const MSSQL_INIT_CODE = `-- to pin the database use '-- database f/your/path'
194
+ export const MSSQL_INIT_CODE = `-- return_last_result
195
+ -- to pin the database use '-- database f/your/path'
195
196
  -- @p1 name1 (varchar) = default arg
196
197
  -- @p2 name2 (int)
197
198
  -- @p3 name3 (int)
@@ -300,6 +301,26 @@ echo "Hello $msg"
300
301
  `;
301
302
  export const DENO_INIT_CODE_TRIGGER = `import * as wmill from "npm:windmill-client@${__pkg__.version}"
302
303
 
304
+ export async function main() {
305
+
306
+ // A common trigger script would follow this pattern:
307
+ // 1. Get the last saved state
308
+ // const state = await wmill.getState()
309
+ // 2. Get the actual state from the external service
310
+ // const newState = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json()
311
+ // 3. Compare the two states and update the internal state
312
+ // await wmill.setState(newState)
313
+ // 4. Return the new rows
314
+ // return range from (state to newState)
315
+
316
+ return [1,2,3]
317
+
318
+ // In subsequent scripts, you may refer to each row/value returned by the trigger script using
319
+ // 'flow_input.iter.value'
320
+ }
321
+ `;
322
+ export const BUN_INIT_CODE_TRIGGER = `import * as wmill from "windmill-client"
323
+
303
324
  export async function main() {
304
325
 
305
326
  // A common trigger script would follow this pattern:
@@ -395,6 +416,46 @@ export async function main(approver?: string) {
395
416
 
396
417
  // add a form in Advanced - Suspend
397
418
  // all on approval steps: https://www.windmill.dev/docs/flows/flow_approval`;
419
+ export const BUN_PREPROCESSOR_MODULE_CODE = `
420
+ export async function preprocessor(
421
+ wm_trigger: {
422
+ kind: 'http' | 'email' | 'webhook',
423
+ http?: {
424
+ route: string // The route path, e.g. "/users/:id"
425
+ path: string // The actual path called, e.g. "/users/123"
426
+ method: string
427
+ params: Record<string, string>
428
+ query: Record<string, string>
429
+ headers: Record<string, string>
430
+ }
431
+ },
432
+ /* your other args */
433
+ ) {
434
+ return {
435
+ // return the args to be passed to the flow
436
+ }
437
+ }
438
+ `;
439
+ export const DENO_PREPROCESSOR_MODULE_CODE = `
440
+ export async function preprocessor(
441
+ wm_trigger: {
442
+ kind: 'http' | 'email' | 'wehbook',
443
+ http?: {
444
+ route: string // The route path, e.g. "/users/:id"
445
+ path: string // The actual path called, e.g. "/users/123"
446
+ method: string
447
+ params: Record<string, string>
448
+ query: Record<string, string>
449
+ headers: Record<string, string>
450
+ }
451
+ },
452
+ /* your other args */
453
+ ) {
454
+ return {
455
+ // return the args to be passed to the flow
456
+ }
457
+ }
458
+ `;
398
459
  export const PYTHON_INIT_CODE_APPROVAL = `import wmill
399
460
 
400
461
  def main():
@@ -421,6 +482,28 @@ def main():
421
482
 
422
483
  # add a form in Advanced - Suspend
423
484
  # all on approval steps: https://www.windmill.dev/docs/flows/flow_approval`;
485
+ export const PYTHON_PREPROCESSOR_MODULE_CODE = `from typing import TypedDict, Literal
486
+
487
+ class Http(TypedDict):
488
+ route: str # The route path, e.g. "/users/:id"
489
+ path: str # The actual path called, e.g. "/users/123"
490
+ method: str
491
+ params: dict[str, str]
492
+ query: dict[str, str]
493
+ headers: dict[str, str]
494
+
495
+ class WmTrigger(TypedDict):
496
+ kind: Literal["http", "email", "webhook"]
497
+ http: Http | None
498
+
499
+ def preprocessor(
500
+ wm_trigger: WmTrigger,
501
+ # your other args
502
+ ):
503
+ return {
504
+ # return the args to be passed to the flow
505
+ }
506
+ `;
424
507
  export const DOCKER_INIT_CODE = `# shellcheck shell=bash
425
508
  # Bash script that calls docker as a client to the host daemon
426
509
  # See documentation: https://www.windmill.dev/docs/advanced/docker
@@ -443,6 +526,50 @@ export const POWERSHELL_INIT_CODE = `param($Msg, $Dflt = "default value", [int]$
443
526
 
444
527
  # the last line of the stdout is the return value
445
528
  Write-Output "Hello $Msg"`;
529
+ export const ANSIBLE_PLAYBOOK_INIT_CODE = `---
530
+ inventory:
531
+ - resource_type: ansible_inventory
532
+ # You can pin an inventory to this script by hardcoding the resource path:
533
+ # resource: u/user/your_resource
534
+
535
+ # File resources will be written in the relative \`target\` location before
536
+ # running the playbook
537
+ # file_resources:
538
+ # - resource: u/user/fabulous_jinja_template
539
+ # target: ./config_template.j2
540
+
541
+ # Define the arguments of the windmill script
542
+ extra_vars:
543
+ world_qualifier:
544
+ type: string
545
+
546
+ dependencies:
547
+ galaxy:
548
+ collections:
549
+ - name: community.general
550
+ - name: community.vmware
551
+ python:
552
+ - jmespath
553
+ ---
554
+ - name: Echo
555
+ hosts: 127.0.0.1
556
+ connection: local
557
+ vars:
558
+ my_result:
559
+ a: 2
560
+ b: true
561
+ c: "Hello"
562
+
563
+ tasks:
564
+ - name: Print debug message
565
+ debug:
566
+ msg: "Hello, {{world_qualifier}} world!"
567
+ - name: Write variable my_result to result.json
568
+ delegate_to: localhost
569
+ copy:
570
+ content: "{{ my_result | to_json }}"
571
+ dest: result.json
572
+ `;
446
573
  const ALL_INITIAL_CODE = [
447
574
  PYTHON_INIT_CODE,
448
575
  PYTHON_INIT_CODE_TRIGGER,
@@ -456,15 +583,21 @@ const ALL_INITIAL_CODE = [
456
583
  DENO_INIT_CODE_TRIGGER,
457
584
  DENO_INIT_CODE_CLEAR,
458
585
  PYTHON_INIT_CODE_CLEAR,
586
+ PYTHON_FAILURE_MODULE_CODE,
587
+ PYTHON_PREPROCESSOR_MODULE_CODE,
459
588
  DENO_INIT_CODE_APPROVAL,
460
589
  DENO_FAILURE_MODULE_CODE,
590
+ DENO_PREPROCESSOR_MODULE_CODE,
461
591
  BUN_INIT_CODE,
462
592
  BUN_INIT_CODE_CLEAR,
463
593
  BUN_INIT_CODE_APPROVAL,
594
+ BUN_FAILURE_MODULE_CODE,
595
+ BUN_PREPROCESSOR_MODULE_CODE,
464
596
  BASH_INIT_CODE,
465
597
  POWERSHELL_INIT_CODE,
466
598
  PHP_INIT_CODE,
467
599
  RUST_INIT_CODE,
600
+ ANSIBLE_PLAYBOOK_INIT_CODE
468
601
  ];
469
602
  export function isInitialCode(content) {
470
603
  for (const code of ALL_INITIAL_CODE) {
@@ -495,6 +628,9 @@ export function initialCode(language, kind, subkind) {
495
628
  else if (subkind === 'fetch') {
496
629
  return FETCH_INIT_CODE;
497
630
  }
631
+ else if (subkind === 'preprocessor') {
632
+ return DENO_PREPROCESSOR_MODULE_CODE;
633
+ }
498
634
  else {
499
635
  return DENO_INIT_CODE;
500
636
  }
@@ -522,6 +658,9 @@ export function initialCode(language, kind, subkind) {
522
658
  else if (subkind === 'flow') {
523
659
  return PYTHON_INIT_CODE_CLEAR;
524
660
  }
661
+ else if (subkind === 'preprocessor') {
662
+ return PYTHON_PREPROCESSOR_MODULE_CODE;
663
+ }
525
664
  else {
526
665
  return PYTHON_INIT_CODE;
527
666
  }
@@ -564,8 +703,14 @@ export function initialCode(language, kind, subkind) {
564
703
  else if (language == 'rust') {
565
704
  return RUST_INIT_CODE;
566
705
  }
706
+ else if (language == 'ansible') {
707
+ return ANSIBLE_PLAYBOOK_INIT_CODE;
708
+ }
567
709
  else if (language == 'bun' || language == 'bunnative') {
568
- if (language == 'bunnative' || subkind === 'bunnative') {
710
+ if (kind == 'trigger') {
711
+ return BUN_INIT_CODE_TRIGGER;
712
+ }
713
+ else if (language == 'bunnative' || subkind === 'bunnative') {
569
714
  return BUNNATIVE_INIT_CODE;
570
715
  }
571
716
  else if (kind === 'approval') {
@@ -574,7 +719,10 @@ export function initialCode(language, kind, subkind) {
574
719
  else if (kind === 'failure') {
575
720
  return BUN_FAILURE_MODULE_CODE;
576
721
  }
577
- if (subkind === 'flow') {
722
+ else if (subkind === 'preprocessor') {
723
+ return BUN_PREPROCESSOR_MODULE_CODE;
724
+ }
725
+ else if (subkind === 'flow') {
578
726
  return BUN_INIT_CODE_CLEAR;
579
727
  }
580
728
  return BUN_INIT_CODE;
@@ -1,6 +1,6 @@
1
1
  import type { Schema, SupportedLanguage } from './common';
2
2
  import { type Script } from './gen';
3
- export declare function scriptLangToEditorLang(lang: Script['language'] | 'bunnative' | 'frontend' | undefined): "go" | "powershell" | "graphql" | "php" | "rust" | "sql" | "typescript" | "python" | "shell";
3
+ export declare function scriptLangToEditorLang(lang: Script['language'] | 'bunnative' | 'frontend' | undefined): "go" | "powershell" | "graphql" | "php" | "rust" | "sql" | "yaml" | "typescript" | "python" | "shell";
4
4
  export type ScriptSchedule = {
5
5
  summary: string | undefined;
6
6
  args: Record<string, any>;
@@ -47,6 +47,9 @@ export function scriptLangToEditorLang(lang) {
47
47
  else if (lang == 'graphql') {
48
48
  return 'graphql';
49
49
  }
50
+ else if (lang == 'ansible') {
51
+ return 'yaml';
52
+ }
50
53
  else if (lang == undefined) {
51
54
  return 'typescript';
52
55
  }
@@ -107,6 +110,7 @@ const scriptLanguagesArray = [
107
110
  ['powershell', 'PowerShell'],
108
111
  ['php', 'PHP'],
109
112
  ['rust', 'Rust'],
113
+ ['ansible', 'Ansible Playbook'],
110
114
  ['docker', 'Docker']
111
115
  ];
112
116
  export function processLangs(selected, langs) {
@@ -116,7 +120,7 @@ export function processLangs(selected, langs) {
116
120
  else {
117
121
  let ls = langs.filter((lang) => lang !== 'nativets');
118
122
  //those languages are newer and may not be in the saved list
119
- let nl = ['bunnative', 'rust'];
123
+ let nl = ['bunnative', 'rust', 'ansible'];
120
124
  nl.forEach((lang) => {
121
125
  if (!ls.includes(lang)) {
122
126
  ls.push(lang);
@@ -51,6 +51,7 @@ export declare const CODE_COMPLETION_SETTING_NAME = "codeCompletionSessionEnable
51
51
  export declare const formatOnSave: import("svelte/store").Writable<boolean>;
52
52
  export declare const vimMode: import("svelte/store").Writable<boolean>;
53
53
  export declare const codeCompletionSessionEnabled: import("svelte/store").Writable<boolean>;
54
+ export declare const usedTriggerKinds: import("svelte/store").Writable<string[]>;
54
55
  type SQLBaseSchema = {
55
56
  [schemaKey: string]: {
56
57
  [tableKey: string]: {
package/package/stores.js CHANGED
@@ -60,4 +60,5 @@ export const CODE_COMPLETION_SETTING_NAME = 'codeCompletionSessionEnabled';
60
60
  export const formatOnSave = writable(getLocalSetting(FORMAT_ON_SAVE_SETTING_NAME) != 'false');
61
61
  export const vimMode = writable(getLocalSetting(VIM_MODE_SETTING_NAME) == 'true');
62
62
  export const codeCompletionSessionEnabled = writable(getLocalSetting(CODE_COMPLETION_SETTING_NAME) != 'false');
63
+ export const usedTriggerKinds = writable([]);
63
64
  export const dbSchemas = writable({});
@@ -105,3 +105,4 @@ export declare function shouldDisplayPlaceholder(type: string | undefined, forma
105
105
  export declare function getSchemaFromProperties(properties: {
106
106
  [name: string]: SchemaProperty;
107
107
  }): Schema;
108
+ export declare function validateFileExtension(ext: string): boolean;
package/package/utils.js CHANGED
@@ -799,3 +799,7 @@ export function getSchemaFromProperties(properties) {
799
799
  order: Object.keys(properties).filter((k) => k !== 'label')
800
800
  };
801
801
  }
802
+ export function validateFileExtension(ext) {
803
+ const validExtensionRegex = /^[a-zA-Z0-9]+([._][a-zA-Z0-9]+)*$/;
804
+ return validExtensionRegex.test(ext);
805
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.394.8",
3
+ "version": "1.405.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",
@@ -139,12 +139,13 @@
139
139
  "vscode-languageclient": "~9.0.1",
140
140
  "vscode-uri": "~3.0.8",
141
141
  "vscode-ws-jsonrpc": "~3.3.2",
142
- "windmill-parser-wasm-go": "^1.382.2",
143
- "windmill-parser-wasm-php": "^1.382.2",
144
- "windmill-parser-wasm-py": "^1.382.2",
145
- "windmill-parser-wasm-regex": "^1.382.2",
146
- "windmill-parser-wasm-rust": "^1.387.0",
147
- "windmill-parser-wasm-ts": "^1.382.2",
142
+ "windmill-parser-wasm-go": "^1.397.2",
143
+ "windmill-parser-wasm-php": "^1.397.2",
144
+ "windmill-parser-wasm-py": "^1.397.2",
145
+ "windmill-parser-wasm-regex": "^1.397.2",
146
+ "windmill-parser-wasm-rust": "^1.397.2",
147
+ "windmill-parser-wasm-ts": "^1.397.2",
148
+ "windmill-parser-wasm-yaml": "^1.398.1",
148
149
  "windmill-sql-datatype-parser-wasm": "^1.318.0",
149
150
  "y-monaco": "^0.1.4",
150
151
  "y-websocket": "^1.5.4",
@@ -176,6 +177,11 @@
176
177
  "svelte": "./package/components/icons/WindmillIcon.svelte",
177
178
  "default": "./package/components/icons/WindmillIcon.svelte"
178
179
  },
180
+ "./components/icons/WindmillIcon2.svelte": {
181
+ "types": "./package/components/icons/WindmillIcon2.d.ts",
182
+ "svelte": "./package/components/icons/WindmillIcon2.svelte",
183
+ "default": "./package/components/icons/WindmillIcon2.svelte"
184
+ },
179
185
  "./components/IconedResourceType.svelte": {
180
186
  "types": "./package/components/IconedResourceType.svelte.d.ts",
181
187
  "svelte": "./package/components/IconedResourceType.svelte",
@@ -357,6 +363,9 @@
357
363
  "components/icons/WindmillIcon.svelte": [
358
364
  "./package/components/icons/WindmillIcon.svelte.d.ts"
359
365
  ],
366
+ "components/icons/WindmillIcon2.svelte": [
367
+ "./package/components/icons/WindmillIcon2.svelte.d.ts"
368
+ ],
360
369
  "components/scriptEditor/LogPanel.svelte": [
361
370
  "./package/components/scriptEditor/LogPanel.svelte.d.ts"
362
371
  ],
@@ -1,48 +0,0 @@
1
- <script>import { Menu } from '../../common';
2
- import { createEventDispatcher } from 'svelte';
3
- import StepGen from '../../copilot/StepGen.svelte';
4
- import { Zap } from 'lucide-svelte';
5
- const dispatch = createEventDispatcher();
6
- export let open = undefined;
7
- export let index;
8
- export let funcDesc = '';
9
- export let modules;
10
- export let disableAi = false;
11
- $: !open && (funcDesc = '');
12
- </script>
13
-
14
- <Menu
15
- transitionDuration={0}
16
- pointerDown
17
- bind:show={open}
18
- noMinW
19
- placement="bottom-center"
20
- let:close
21
- >
22
- <button
23
- title="Add a Trigger"
24
- slot="trigger"
25
- type="button"
26
- class="text-secondary bg-surface outline-[1px] outline dark:outline-gray-500 outline-gray-300 rotate-180 focus:outline-none hover:bg-surface-hover focus:ring-4 focus:ring-gray-200 font-medium rounded text-sm w-[20px] h-[20px] flex items-center justify-center"
27
- >
28
- <Zap size={12} />
29
- </button>
30
- {#if !disableAi}
31
- <StepGen {index} bind:funcDesc bind:open {close} {modules} trigger on:insert />
32
- {/if}
33
- {#if funcDesc.length === 0}
34
- <div class="font-mono divide-y text-xs w-full text-secondary whitespace-nowrap">
35
- <button
36
- class="w-full text-left py-2 px-3 hover:bg-surface-hover flex flex-row items-center gap-2"
37
- on:pointerdown={() => {
38
- close()
39
- dispatch('new', 'trigger')
40
- }}
41
- role="menuitem"
42
- tabindex="-1"
43
- >
44
- <Zap size={14} />Trigger
45
- </button>
46
- </div>
47
- {/if}
48
- </Menu>
@@ -1,24 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { FlowModule } from '../../../gen';
3
- declare const __propDef: {
4
- props: {
5
- open?: boolean | undefined;
6
- index: number;
7
- funcDesc?: string | undefined;
8
- modules: FlowModule[];
9
- disableAi?: boolean | undefined;
10
- };
11
- events: {
12
- insert: CustomEvent<any>;
13
- new: CustomEvent<any>;
14
- } & {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- };
19
- export type InsertTriggerButtonProps = typeof __propDef.props;
20
- export type InsertTriggerButtonEvents = typeof __propDef.events;
21
- export type InsertTriggerButtonSlots = typeof __propDef.slots;
22
- export default class InsertTriggerButton extends SvelteComponent<InsertTriggerButtonProps, InsertTriggerButtonEvents, InsertTriggerButtonSlots> {
23
- }
24
- export {};