From 16bed593dfd0b735a92d0928df5091547b98ae79 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 15 Apr 2025 18:51:18 +0100 Subject: [PATCH 01/53] fix(frontend): load all step jobs (#5617) * fecth run from deployed script * do not show job loader for fast loading jobs * format file * Add padding to step output viewer * adjust prop picker popover * update job filters --- .../lib/components/FlowPreviewContent.svelte | 2 +- .../flows/map/FlowModuleSchemaItem.svelte | 2 + .../components/flows/map/VirtualItem.svelte | 2 + .../flows/propPicker/OutputPickerInner.svelte | 58 ++++++++++++------- .../flows/propPicker/StepHistory.svelte | 2 +- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/frontend/src/lib/components/FlowPreviewContent.svelte b/frontend/src/lib/components/FlowPreviewContent.svelte index 30edf25691..448e6e89b4 100644 --- a/frontend/src/lib/components/FlowPreviewContent.svelte +++ b/frontend/src/lib/components/FlowPreviewContent.svelte @@ -187,7 +187,7 @@ `path` in module.value ? module.value.path : ($initialPathStore == '' ? $pathStore : $initialPathStore) + '/' + module.id, - jobKinds: ['preview', 'script', 'flowpreview', 'flow'].join(','), + jobKinds: ['preview', 'script', 'flowpreview', 'flow', 'flowscript'].join(','), page: 1, perPage: 1 }) diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index 84f59161da..745b312a7b 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -338,6 +338,8 @@ {loopStatus} rightMargin bind:derivedHistoryOpen={historyOpen} + historyOffset={{ mainAxis: 12, crossAxis: -9 }} + class="p-1" /> {/if} diff --git a/frontend/src/lib/components/flows/map/VirtualItem.svelte b/frontend/src/lib/components/flows/map/VirtualItem.svelte index 909a02a120..5d61c842bc 100644 --- a/frontend/src/lib/components/flows/map/VirtualItem.svelte +++ b/frontend/src/lib/components/flows/map/VirtualItem.svelte @@ -91,6 +91,8 @@ hideHeaderBar simpleViewer={inputJson} rightMargin + historyOffset={{ mainAxis: 12, crossAxis: -9 }} + class="p-1" /> {/if} diff --git a/frontend/src/lib/components/flows/propPicker/OutputPickerInner.svelte b/frontend/src/lib/components/flows/propPicker/OutputPickerInner.svelte index 4b820e08f9..7f3bdc3b16 100644 --- a/frontend/src/lib/components/flows/propPicker/OutputPickerInner.svelte +++ b/frontend/src/lib/components/flows/propPicker/OutputPickerInner.svelte @@ -57,6 +57,7 @@ export let disableMock: boolean = false export let disableHistory: boolean = false export let derivedHistoryOpen: boolean = false // derived from historyOpen + export let historyOffset = { mainAxis: 8, crossAxis: -4.5 } type SelectedJob = | Job @@ -211,7 +212,7 @@
@@ -234,8 +235,9 @@ { + isLoading = true + }, 200) + + try { + const fullJob = await detail.getFullJob() + if (fullJob) { + selectJob(fullJob) + togglePreview('job') + } + } finally { + // Clear the timeout if operation completed before 200ms + clearTimeout(loadingTimeout) + isLoading = false } - isLoading = false }} mockValue={mock?.return_value} mockEnabled={mock?.enabled} @@ -540,20 +556,20 @@ { - if (mock?.enabled) { - const newMock = { - enabled: true, - return_value: structuredClone(detail) + on:changeValue={({ detail }) => { + if (mock?.enabled) { + const newMock = { + enabled: true, + return_value: structuredClone(detail) + } + tmpMock = newMock } - tmpMock = newMock - } - }} - code={JSON.stringify( - mock?.enabled && mock.return_value ? mock.return_value : '', - null, - 2 - )} + }} + code={JSON.stringify( + mock?.enabled && mock.return_value ? mock.return_value : '', + null, + 2 + )} class="h-full" /> {/await} diff --git a/frontend/src/lib/components/flows/propPicker/StepHistory.svelte b/frontend/src/lib/components/flows/propPicker/StepHistory.svelte index 1fb5448801..c94876d343 100644 --- a/frontend/src/lib/components/flows/propPicker/StepHistory.svelte +++ b/frontend/src/lib/components/flows/propPicker/StepHistory.svelte @@ -27,7 +27,7 @@ const previousJobs = await JobService.listCompletedJobs({ workspace: $workspaceStore!, scriptPathExact: path === '' ? $pathStore + '/' + moduleId : path, - jobKinds: ['preview', 'script', 'flowpreview', 'flow'].join(','), + jobKinds: ['preview', 'script', 'flowpreview', 'flow', 'flowscript'].join(','), page, perPage }) From 1d0f5291f9978f5f45ea3f9757e4cf9321b1d0ce Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 15 Apr 2025 21:57:34 +0200 Subject: [PATCH 02/53] chore(main): release 1.482.0 (#5561) * chore(main): release 1.482.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- CHANGELOG.md | 45 +++ backend/Cargo.lock | 338 +++++++++--------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 6 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 224 insertions(+), 197 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a133b737a..8b440e9a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,50 @@ # Changelog +## [1.482.0](https://github.com/windmill-labs/windmill/compare/v1.481.0...v1.482.0) (2025-04-15) + + +### Features + +* add diff toggle to flow inline scripts ([#5550](https://github.com/windmill-labs/windmill/issues/5550)) ([b3ecde3](https://github.com/windmill-labs/windmill/commit/b3ecde3316252bcd7323de98149786349019ba7e)) +* add gcp trigger ([#5501](https://github.com/windmill-labs/windmill/issues/5501)) ([6339775](https://github.com/windmill-labs/windmill/commit/63397754046eed41d32e28d4698db37b4c9b9710)) +* add wildcards filter for worker/label/tags ([62f14d1](https://github.com/windmill-labs/windmill/commit/62f14d1cb95e3f1c7de85c46e1c6bb092247656c)) +* add windmill context to autocomplete ([#5548](https://github.com/windmill-labs/windmill/issues/5548)) ([b47c151](https://github.com/windmill-labs/windmill/commit/b47c15165f93ca68a58f81cf2b86fc9467155482)) +* agent workers v2 using http ([#5588](https://github.com/windmill-labs/windmill/issues/5588)) ([63fa499](https://github.com/windmill-labs/windmill/commit/63fa4990153f33434b49269922f7803d04e407cd)) +* Batch re-run ([#5553](https://github.com/windmill-labs/windmill/issues/5553)) ([26b5ea5](https://github.com/windmill-labs/windmill/commit/26b5ea5023a100c57d077910c99a5e5703edf1c1)) +* **frontend:** app editor code input component (monaco) ([#5566](https://github.com/windmill-labs/windmill/issues/5566)) ([177e16b](https://github.com/windmill-labs/windmill/commit/177e16bb18eed0d1c454b967aaa59547f61e8d26)) +* handle sending selected lines to ai context ([#5527](https://github.com/windmill-labs/windmill/issues/5527)) ([5abdc3e](https://github.com/windmill-labs/windmill/commit/5abdc3e4403b5c604309bd99a24d7a2847a17b9b)) +* Implement sending diff to ai ([#5510](https://github.com/windmill-labs/windmill/issues/5510)) ([e118d2c](https://github.com/windmill-labs/windmill/commit/e118d2cd5f9c641884a76229802a5228ef41f1a5)) +* make azure a standalone AI provider ([#5558](https://github.com/windmill-labs/windmill/issues/5558)) ([2c5e58c](https://github.com/windmill-labs/windmill/commit/2c5e58cf1ab9225d516540b38d9e4dde482a3a7f)) +* migrate to svelte5 + vite6 ([#4813](https://github.com/windmill-labs/windmill/issues/4813)) ([3c99b3f](https://github.com/windmill-labs/windmill/commit/3c99b3fdc7b78b1cdc7d8fb21d999296695f7889)) +* **postgres-trigger:** postgres trigger fix circular dependencies and add remove associate resource ([#5606](https://github.com/windmill-labs/windmill/issues/5606)) ([1daeb2f](https://github.com/windmill-labs/windmill/commit/1daeb2f48f3026621b3ffc58e10f048d5911906c)) +* **python:** per import requirement pin ([#5520](https://github.com/windmill-labs/windmill/issues/5520)) ([0b6d017](https://github.com/windmill-labs/windmill/commit/0b6d017fedc31e790a76cf29a1adaaf2a72acc61)) +* signed s3 objects ([#5593](https://github.com/windmill-labs/windmill/issues/5593)) ([b9e8796](https://github.com/windmill-labs/windmill/commit/b9e879618bc223ce17effde8bb4c5d1df2ad6df5)) + + +### Bug Fixes + +* add support for ${} syntax without default in bash ([#5594](https://github.com/windmill-labs/windmill/issues/5594)) ([3950cfd](https://github.com/windmill-labs/windmill/commit/3950cfd7e3297d7f8ec56430d6462f6b67ecd3c2)) +* app editor svelte 5 fixes ([#5570](https://github.com/windmill-labs/windmill/issues/5570)) ([b926076](https://github.com/windmill-labs/windmill/commit/b9260769883348ecd5aeb5684f527a8bf0073928)) +* binding not working in nested array script arg ([#5585](https://github.com/windmill-labs/windmill/issues/5585)) ([f5d46d5](https://github.com/windmill-labs/windmill/commit/f5d46d5751bc875b7f4da1db06be40571ac55ab8)) +* **cli:** properly handle enabled/disabled updates of schedules ([2629458](https://github.com/windmill-labs/windmill/commit/26294584d6c2ca02bbc4fc5f28cb8df6a5fb3790)) +* **cli:** wmill-locks improvement ([8d062c4](https://github.com/windmill-labs/windmill/commit/8d062c47ecd9e84a81140d5c59814da9217dd434)) +* Dynamic select does not work with tag //native ([#5576](https://github.com/windmill-labs/windmill/issues/5576)) ([1f3e7d9](https://github.com/windmill-labs/windmill/commit/1f3e7d9029051832db6ab1755b3cad38176a9e96)), closes [#5490](https://github.com/windmill-labs/windmill/issues/5490) +* fix list jobs by tag ([0c3cb37](https://github.com/windmill-labs/windmill/commit/0c3cb3700a3fb9b69e396487bd7491dbbd8861c0)) +* flow editor svelte 5 issues ([#5567](https://github.com/windmill-labs/windmill/issues/5567)) ([4f6be6e](https://github.com/windmill-labs/windmill/commit/4f6be6ed340e26bf1ed95398a9dc9f1eb41b33dd)) +* freeze when clicking script history diff button ([#5581](https://github.com/windmill-labs/windmill/issues/5581)) ([07094b6](https://github.com/windmill-labs/windmill/commit/07094b6aa21f10688b138d2a81d4fd5833f003fc)) +* **frontend:** app builder - force json configuration in rich result ([#5565](https://github.com/windmill-labs/windmill/issues/5565)) ([6fae3a5](https://github.com/windmill-labs/windmill/commit/6fae3a566be06dae88ece8ec23f5723cd8f3f2b9)) +* **frontend:** load all step jobs ([#5617](https://github.com/windmill-labs/windmill/issues/5617)) ([16bed59](https://github.com/windmill-labs/windmill/commit/16bed593dfd0b735a92d0928df5091547b98ae79)) +* **frontend:** prevent deploy popover to show if deploy dropdown is open ([#5542](https://github.com/windmill-labs/windmill/issues/5542)) ([c2180c6](https://github.com/windmill-labs/windmill/commit/c2180c6eb34e14fe2292ff40aa6a99c627698d5e)) +* **frontend:** proper each block binding + better app settings reactivity ([#5568](https://github.com/windmill-labs/windmill/issues/5568)) ([4c71af8](https://github.com/windmill-labs/windmill/commit/4c71af8a74627d0ba76917e0dac0ac9e5e984cca)) +* improve app image picker UX ([#5589](https://github.com/windmill-labs/windmill/issues/5589)) ([f497a4b](https://github.com/windmill-labs/windmill/commit/f497a4bfae8d1bff097e0c2c9df8381a531dfeb9)) +* legacy script gen model selection ([#5574](https://github.com/windmill-labs/windmill/issues/5574)) ([3507925](https://github.com/windmill-labs/windmill/commit/3507925624a43804a3be463b6f7913cea5821384)) +* mssql ca_cert deserializing ([#5587](https://github.com/windmill-labs/windmill/issues/5587)) ([b4f8c88](https://github.com/windmill-labs/windmill/commit/b4f8c88c19bd4f844c3ecb53ececc340ee326b0e)) +* number input in app multiselect yields NOT_NUMBER ([#5616](https://github.com/windmill-labs/windmill/issues/5616)) ([4aae6ab](https://github.com/windmill-labs/windmill/commit/4aae6ab634280adc1de9abd890100b7c12c89158)) +* prevent invalid returned ai completion object errors ([#5564](https://github.com/windmill-labs/windmill/issues/5564)) ([9276c71](https://github.com/windmill-labs/windmill/commit/9276c717a21aaee3241845a9cc00d3fb6bce9eb9)) +* Remaining svelte 5 bugs ([#5563](https://github.com/windmill-labs/windmill/issues/5563)) ([6e9ec63](https://github.com/windmill-labs/windmill/commit/6e9ec6323c265a747ef8696865297e6d47abb016)) +* tenant id to never be undefined on teams ([#5572](https://github.com/windmill-labs/windmill/issues/5572)) ([102b58a](https://github.com/windmill-labs/windmill/commit/102b58a5f40dde22f15700d4b6c11eb7f3fbf4bb)) +* validate saved module before passing to flow module editor ([#5580](https://github.com/windmill-labs/windmill/issues/5580)) ([2eb1a16](https://github.com/windmill-labs/windmill/commit/2eb1a161d15627b440195b65eec54998561f4ef6)) + ## [1.481.0](https://github.com/windmill-labs/windmill/compare/v1.480.1...v1.481.0) (2025-04-02) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 0f9558966f..90ccbcfd85 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -225,9 +225,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arc-swap" @@ -421,7 +421,7 @@ dependencies = [ "arrow-schema", "chrono", "half", - "indexmap 2.8.0", + "indexmap 2.9.0", "lexical-core", "num", "serde", @@ -986,7 +986,7 @@ dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "h2 0.4.8", + "h2 0.4.9", "http 0.2.12", "http 1.3.1", "http-body 0.4.6", @@ -997,7 +997,7 @@ dependencies = [ "hyper-util", "pin-project-lite", "rustls 0.21.12", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", @@ -1189,9 +1189,9 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backon" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970d91570c01a8a5959b36ad7dd1c30642df24b6b3068710066f6809f7033bb7" +checksum = "fd0b50b1b78dbadd44ab18b3c794e496f3a139abb9fbc27d9c94c4eebbb96496" dependencies = [ "fastrand", "gloo-timers", @@ -1207,7 +1207,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.5", + "miniz_oxide 0.8.8", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -1419,9 +1419,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a796731680be7931955498a16a10b2270c7762963d5d570fdbfe02dcbf314f" +checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" dependencies = [ "arrayref", "arrayvec", @@ -1591,9 +1591,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "serde", @@ -1833,9 +1833,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" dependencies = [ "jobserver", "libc", @@ -1975,9 +1975,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" dependencies = [ "clap_builder", "clap_derive", @@ -1985,9 +1985,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" dependencies = [ "anstream", "anstyle", @@ -2321,9 +2321,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] @@ -2588,9 +2588,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "data-url" @@ -2632,7 +2632,7 @@ dependencies = [ "glob", "half", "hashbrown 0.14.5", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.12.1", "log", "num_cpus", @@ -2801,7 +2801,7 @@ dependencies = [ "datafusion-expr", "datafusion-physical-expr", "hashbrown 0.14.5", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.12.1", "log", "regex-syntax 0.8.5", @@ -2830,7 +2830,7 @@ dependencies = [ "half", "hashbrown 0.14.5", "hex", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.12.1", "log", "paste", @@ -2874,7 +2874,7 @@ dependencies = [ "futures", "half", "hashbrown 0.14.5", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.12.1", "log", "once_cell", @@ -3006,7 +3006,7 @@ dependencies = [ "deno_media_type", "deno_path_util", "http 1.3.1", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "once_cell", "parking_lot 0.12.3", @@ -3047,7 +3047,7 @@ dependencies = [ "glob", "ignore", "import_map", - "indexmap 2.8.0", + "indexmap 2.9.0", "jsonc-parser", "log", "percent-encoding", @@ -3088,7 +3088,7 @@ dependencies = [ "deno_path_util", "deno_unsync", "futures", - "indexmap 2.8.0", + "indexmap 2.9.0", "libc", "memoffset", "parking_lot 0.12.3", @@ -3211,7 +3211,7 @@ dependencies = [ "deno_tls", "dyn-clone", "error_reporter", - "h2 0.4.8", + "h2 0.4.9", "hickory-resolver", "http 1.3.1", "http-body-util", @@ -3492,14 +3492,14 @@ dependencies = [ "elliptic-curve", "errno", "faster-hex", - "h2 0.4.8", + "h2 0.4.9", "hkdf", "http 1.3.1", "http-body-util", "hyper 1.6.0", "hyper-util", "idna", - "indexmap 2.8.0", + "indexmap 2.9.0", "ipnetwork", "k256", "lazy-regex", @@ -3575,7 +3575,7 @@ version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2d328067139909aa81522a5d90f119368b541fbddd73ab630e4d9f777865f0d" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "proc-macro-rules", "proc-macro2", "quote", @@ -3619,7 +3619,7 @@ dependencies = [ "deno_error", "deno_path_util", "deno_semver", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_json", "sys_traits", @@ -3856,7 +3856,7 @@ dependencies = [ "deno_core", "deno_error", "deno_native_certs", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-pemfile 2.2.0", "rustls-tokio-stream", "rustls-webpki 0.102.8", @@ -3948,7 +3948,7 @@ dependencies = [ "deno_permissions", "deno_tls", "fastwebsockets", - "h2 0.4.8", + "h2 0.4.9", "http 1.3.1", "http-body-util", "hyper 1.6.0", @@ -4089,9 +4089,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", "serde", @@ -4424,9 +4424,9 @@ dependencies = [ [[package]] name = "ecow" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42fc0a93992b20c58b99e59d61eaf1635a25bfbe49e4275c34ba0aee98119ba" +checksum = "ef5eeffa816451f3a6a4cce9cd796e3e5ba6018638d3ce5cc7f87b73bababf60" dependencies = [ "serde", ] @@ -4573,9 +4573,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -4784,7 +4784,7 @@ checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide 0.8.5", + "miniz_oxide 0.8.8", ] [[package]] @@ -5536,7 +5536,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.8.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -5545,9 +5545,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633" dependencies = [ "atomic-waker", "bytes", @@ -5555,7 +5555,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.8.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -5794,13 +5794,13 @@ dependencies = [ [[package]] name = "hostname" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" dependencies = [ "cfg-if", "libc", - "windows 0.52.0", + "windows-link", ] [[package]] @@ -5930,7 +5930,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.8", + "h2 0.4.9", "http 1.3.1", "http-body 1.0.1", "httparse", @@ -5983,7 +5983,7 @@ dependencies = [ "http 1.3.1", "hyper 1.6.0", "hyper-util", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-native-certs 0.8.1", "rustls-pki-types", "tokio", @@ -6281,7 +6281,7 @@ checksum = "1215d4d92511fbbdaea50e750e91f2429598ef817f02b579158e92803b52c00a" dependencies = [ "boxed_error", "deno_error", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "percent-encoding", "serde", @@ -6303,9 +6303,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -6587,7 +6587,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -6758,9 +6758,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libffi" @@ -6826,7 +6826,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", ] [[package]] @@ -6877,9 +6877,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" @@ -7041,7 +7041,7 @@ dependencies = [ "base64 0.22.1", "gethostname", "mail-builder", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-pki-types", "smtp-proto", "tokio", @@ -7310,9 +7310,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", "simd-adler32", @@ -7509,7 +7509,7 @@ dependencies = [ "bitflags 2.9.0", "codespan-reporting", "hexf-parse", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "num-traits", "rustc-hash 1.1.0", @@ -7798,7 +7798,7 @@ dependencies = [ "dirs-sys 0.4.1", "fancy-regex", "heck 0.5.0", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "lru", "miette", @@ -8186,9 +8186,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.71" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -8218,18 +8218,18 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.4.2+3.4.1" +version = "300.5.0+3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" dependencies = [ "cc", "libc", @@ -8522,7 +8522,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", "smallvec", "windows-targets 0.52.6", ] @@ -8652,7 +8652,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -8662,7 +8662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset 0.5.7", - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -8824,7 +8824,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.5", + "miniz_oxide 0.8.8", ] [[package]] @@ -8953,9 +8953,9 @@ checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" [[package]] name = "prettyplease" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", "syn 2.0.100", @@ -9281,7 +9281,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.1.1", - "rustls 0.23.25", + "rustls 0.23.26", "socket2", "thiserror 2.0.12", "tokio", @@ -9300,7 +9300,7 @@ dependencies = [ "rand 0.9.0", "ring 0.17.14", "rustc-hash 2.1.1", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-pki-types", "slab", "thiserror 2.0.12", @@ -9534,9 +9534,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ "bitflags 2.9.0", ] @@ -9691,7 +9691,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.8", + "h2 0.4.9", "http 1.3.1", "http-body 1.0.1", "http-body-util", @@ -9708,7 +9708,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -9734,9 +9734,9 @@ dependencies = [ [[package]] name = "reqwest-middleware" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e8975513bd9a7a43aad01030e79b3498e05db14e9d945df6483e8cf9b8c4c4" +checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e" dependencies = [ "anyhow", "async-trait", @@ -10065,7 +10065,7 @@ dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys 0.9.3", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] @@ -10097,9 +10097,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.25" +version = "0.23.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +checksum = "df51b5869f3a441595eac5e8ff14d486ff285f7b8c0df8770e49c3b56351f0f0" dependencies = [ "aws-lc-rs", "log", @@ -10182,7 +10182,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22557157d7395bc30727745b365d923f1ecc230c4c80b176545f3f4f08c46e33" dependencies = [ "futures", - "rustls 0.23.25", + "rustls 0.23.26", "socket2", "tokio", ] @@ -10618,7 +10618,7 @@ version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "itoa", "memchr", "ryu", @@ -10709,7 +10709,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -10947,9 +10947,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" dependencies = [ "serde", ] @@ -11132,9 +11132,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" +checksum = "14e22987355fbf8cfb813a0cf8cd97b1b4ec834b94dbd759a9e8679d41fabe83" dependencies = [ "sqlx-core", "sqlx-macros", @@ -11145,10 +11145,11 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" +checksum = "55c4720d7d4cd3d5b00f61d03751c685ad09c33ae8290c8a2c11335e0604300b" dependencies = [ + "base64 0.22.1", "bigdecimal", "bytes", "chrono", @@ -11162,13 +11163,12 @@ dependencies = [ "futures-util", "hashbrown 0.15.2", "hashlink 0.10.0", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "memchr", "once_cell", "percent-encoding", - "rustls 0.23.25", - "rustls-pemfile 2.2.0", + "rustls 0.23.26", "serde", "serde_json", "sha2 0.10.8", @@ -11184,9 +11184,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +checksum = "175147fcb75f353ac7675509bc58abb2cb291caf0fd24a3623b8f7e3eb0a754b" dependencies = [ "proc-macro2", "quote", @@ -11197,9 +11197,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +checksum = "1cde983058e53bfa75998e1982086c5efe3c370f3250bf0357e344fa3352e32b" dependencies = [ "dotenvy", "either", @@ -11223,9 +11223,9 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +checksum = "847d2e5393a4f39e47e4f36cab419709bc2b83cbe4223c60e86e1471655be333" dependencies = [ "atoi", "base64 0.22.1", @@ -11268,9 +11268,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" +checksum = "cc35947a541b9e0a2e3d85da444f1c4137c13040267141b208395a0d0ca4659f" dependencies = [ "atoi", "base64 0.22.1", @@ -11309,9 +11309,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" +checksum = "6c48291dac4e5ed32da0927a0b981788be65674aeb62666d19873ab4289febde" dependencies = [ "atoi", "chrono", @@ -11327,6 +11327,7 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", + "thiserror 2.0.12", "tracing", "url", "uuid", @@ -11561,7 +11562,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4740e53eaf68b101203c1df0937d5161a29f3c13bceed0836ddfe245b72dd000" dependencies = [ "anyhow", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_json", "swc_cached", @@ -11673,7 +11674,7 @@ checksum = "65f21494e75d0bd8ef42010b47cabab9caaed8f2207570e809f6f4eb51a710d1" dependencies = [ "better_scoped_tls", "bitflags 2.9.0", - "indexmap 2.8.0", + "indexmap 2.9.0", "once_cell", "phf", "rustc-hash 1.1.0", @@ -11742,7 +11743,7 @@ checksum = "76c76d8b9792ce51401d38da0fa62158d61f6d80d16d68fe5b03ce4bf5fba383" dependencies = [ "base64 0.21.7", "dashmap", - "indexmap 2.8.0", + "indexmap 2.9.0", "once_cell", "serde", "sha1", @@ -11782,7 +11783,7 @@ version = "0.134.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029eec7dd485923a75b5a45befd04510288870250270292fc2c1b3a9e7547408" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "num_cpus", "once_cell", "rustc-hash 1.1.0", @@ -12466,9 +12467,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.1" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", @@ -12614,7 +12615,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.25", + "rustls 0.23.26", "tokio", ] @@ -12735,7 +12736,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -12748,9 +12749,9 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "toml_datetime", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -12765,7 +12766,7 @@ dependencies = [ "base64 0.22.1", "bytes", "flate2", - "h2 0.4.8", + "h2 0.4.9", "http 1.3.1", "http-body 1.0.1", "http-body-util", @@ -13373,7 +13374,7 @@ dependencies = [ "log", "native-tls", "once_cell", - "rustls 0.23.25", + "rustls 0.23.26", "rustls-pki-types", "serde", "serde_json", @@ -13482,7 +13483,7 @@ checksum = "97599c400fc79925922b58303e98fcb8fa88f573379a08ddb652e72cbd2e70f6" dependencies = [ "bitflags 2.9.0", "encoding_rs", - "indexmap 2.8.0", + "indexmap 2.9.0", "num-bigint", "serde", "thiserror 1.0.69", @@ -13766,7 +13767,7 @@ dependencies = [ "cfg_aliases 0.1.1", "codespan-reporting", "document-features", - "indexmap 2.8.0", + "indexmap 2.9.0", "log", "naga", "once_cell", @@ -13867,7 +13868,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" dependencies = [ - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", "wasite", "web-sys", ] @@ -13911,7 +13912,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "axum", @@ -13931,7 +13932,7 @@ dependencies = [ "quote", "rand 0.9.0", "reqwest 0.12.15", - "rustls 0.23.25", + "rustls 0.23.26", "serde", "serde_json", "sha1", @@ -13958,7 +13959,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "argon2", @@ -14065,7 +14066,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.481.0" +version = "1.482.0" dependencies = [ "base64 0.22.1", "chrono", @@ -14080,7 +14081,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.481.0" +version = "1.482.0" dependencies = [ "chrono", "serde", @@ -14093,7 +14094,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "serde", @@ -14107,7 +14108,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "async-stream", @@ -14129,7 +14130,7 @@ dependencies = [ "hex", "hmac", "hyper 1.6.0", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.14.0", "jsonwebtoken 8.3.0", "lazy_static", @@ -14171,7 +14172,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.481.0" +version = "1.482.0" dependencies = [ "regex", "serde", @@ -14185,7 +14186,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "bytes", @@ -14208,7 +14209,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.481.0" +version = "1.482.0" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -14220,7 +14221,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.481.0" +version = "1.482.0" dependencies = [ "convert_case 0.6.0", "serde", @@ -14229,7 +14230,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "lazy_static", @@ -14241,7 +14242,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "serde_json", @@ -14253,7 +14254,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "gosyn", @@ -14265,7 +14266,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "lazy_static", @@ -14277,7 +14278,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "serde_json", @@ -14289,7 +14290,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "nu-parser", @@ -14300,7 +14301,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14311,7 +14312,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14322,7 +14323,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "async-recursion", @@ -14342,7 +14343,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -14359,7 +14360,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "lazy_static", @@ -14371,7 +14372,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "lazy_static", @@ -14389,7 +14390,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -14413,7 +14414,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "serde_json", @@ -14423,7 +14424,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "async-recursion", @@ -14456,7 +14457,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.481.0" +version = "1.482.0" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -14466,7 +14467,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.481.0" +version = "1.482.0" dependencies = [ "anyhow", "async-recursion", @@ -14554,16 +14555,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.56.0" @@ -14594,15 +14585,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.56.0" @@ -15045,9 +15027,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" dependencies = [ "memchr", ] @@ -15145,9 +15127,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "xmlparser" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index ed4155f495..8e718debba 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.481.0" +version = "1.482.0" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.481.0" +version = "1.482.0" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 5ed6537931..55eea24d23 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.481.0 + version: 1.482.0 title: Windmill API contact: @@ -6623,7 +6623,7 @@ paths: type: object additionalProperties: $ref: "#/components/schemas/InputTransform" - use_latest_version: boolean + use_latest_version: 1.482.0 flow_options_by_path: type: object additionalProperties: @@ -6633,7 +6633,7 @@ paths: type: object additionalProperties: $ref: "#/components/schemas/InputTransform" - use_latest_version: boolean + use_latest_version: 1.482.0 responses: "201": description: stream of created job uuids separated by \n. Lines may start with 'Error:' diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index a4fc35045b..3f4a8ed24e 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.481.0"; +export const VERSION = "v1.482.0"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 92131ce63b..84e30a4bdb 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -63,7 +63,7 @@ export { // } // }); -export const VERSION = "1.481.0"; +export const VERSION = "1.482.0"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 207f5b22f5..69cfe8c20a 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.481.0", + "version": "1.482.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.481.0", + "version": "1.482.0", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index 5d0e13fe3f..e37e03865a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.481.0", + "version": "1.482.0", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index 4128f31f60..45e4c17df2 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.481.0" -wmill_pg = ">=1.481.0" +wmill = ">=1.482.0" +wmill_pg = ">=1.482.0" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index de1b475a94..6724dce66b 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.481.0 + version: 1.482.0 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index 7a205b98f7..220bbd7a30 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.481.0' + ModuleVersion = '1.482.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index aa01391777..0d460bfc45 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.481.0" +version = "1.482.0" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index 60c0cbd728..24aff1ad80 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.481.0" +version = "1.482.0" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index e37ca23e7f..6ad1b20d4f 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.481.0", + "version": "1.482.0", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index 14be6fa471..5970770b2b 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.481.0", + "version": "1.482.0", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index 11ccffe4f9..5645e944ef 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.481.0 +1.482.0 From 24e893b8c50fafdb41f4b6e1777cb34aceafc466 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 16 Apr 2025 00:44:49 +0000 Subject: [PATCH 03/53] fix: flow editor workspace script test use actual workspace script hash --- backend/windmill-api/openapi.yaml | 2 ++ backend/windmill-api/src/jobs.rs | 8 ++++-- backend/windmill-worker/src/worker.rs | 26 ++++++++++++------- .../src/lib/components/ModulePreview.svelte | 4 ++- .../src/lib/components/TestJobLoader.svelte | 3 ++- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 55eea24d23..2fd46fea08 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -14048,6 +14048,8 @@ components: type: string path: type: string + script_hash: + type: string args: $ref: "#/components/schemas/ScriptArgs" language: diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index be015f5929..1e5758d646 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -3095,16 +3095,17 @@ struct CancelJob { enum PreviewKind { Code, Identity, - Http, Noop, Bundle, Tarbundle, + ScriptHash, } #[derive(Deserialize)] struct Preview { content: Option, kind: Option, + script_hash: Option, path: Option, args: Option>>, language: Option, @@ -4851,7 +4852,10 @@ async fn run_preview_script( Some(PreviewKind::Identity) => JobPayload::Identity, Some(PreviewKind::Noop) => JobPayload::Noop, _ => JobPayload::Code(RawCode { - hash: None, + hash: preview + .script_hash + .as_ref() + .and_then(|s| windmill_common::scripts::to_i64(s).ok()), content: preview.content.unwrap_or_default(), path: preview.path, language: preview.language.unwrap_or(ScriptLang::Deno), diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index b92a3bc560..e8eff2f1cd 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -2456,16 +2456,22 @@ async fn handle_code_execution_job( _ => None, }; - arc_data = - preview.ok_or_else(|| Error::internal_err("expected preview".to_string()))?; - metadata = ScriptMetadata { - language: job.script_lang, - codebase, - envs: None, - schema: None, - schema_validator: None, - }; - (arc_data.as_ref(), &metadata) + if codebase.is_none() && job.runnable_id.is_some() { + (arc_data, arc_metadata) = + cache::script::fetch(conn, job.runnable_id.unwrap()).await?; + (arc_data.as_ref(), arc_metadata.as_ref()) + } else { + arc_data = + preview.ok_or_else(|| Error::internal_err("expected preview".to_string()))?; + metadata = ScriptMetadata { + language: job.script_lang, + codebase, + envs: None, + schema: None, + schema_validator: None, + }; + (arc_data.as_ref(), &metadata) + } } JobKind::Script_Hub => { let ContentReqLangEnvs { content, lockfile, language, envs, codebase, schema } = diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index d58a48e316..4d6c433bd8 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -68,7 +68,9 @@ script.content, script.language, args, - $flowStore?.tag ?? (val.tag_override ? val.tag_override : script.tag) + $flowStore?.tag ?? (val.tag_override ? val.tag_override : script.tag), + script.lock, + val.hash ) } else if (val.type == 'flow') { await testJobLoader?.abstractRun(() => diff --git a/frontend/src/lib/components/TestJobLoader.svelte b/frontend/src/lib/components/TestJobLoader.svelte index e16ea23dc3..a7f911aff7 100644 --- a/frontend/src/lib/components/TestJobLoader.svelte +++ b/frontend/src/lib/components/TestJobLoader.svelte @@ -126,7 +126,8 @@ lang: SupportedLanguage | undefined, args: Record, tag: string | undefined, - lock?: string + lock?: string, + hash?: string ): Promise { // Reset in case we rerun job without reloading scriptProgress = undefined From cb8731e7e37fb6cd052f5dae6fdce46e6ca2409c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 16 Apr 2025 08:54:20 +0000 Subject: [PATCH 04/53] fix(openapi): fix openapi def of batch re-run jobs --- backend/windmill-api/openapi.yaml | 6 +- cli/.gitignore | 1 + cli/gen/core/ApiError.ts | 21 - cli/gen/core/ApiRequestOptions.ts | 21 - cli/gen/core/ApiResult.ts | 7 - cli/gen/core/CancelablePromise.ts | 126 - cli/gen/core/OpenAPI.ts | 63 - cli/gen/core/request.ts | 350 -- cli/gen/index.ts | 6 - cli/gen/services.gen.ts | 8995 ----------------------------- cli/gen/types.gen.ts | 7828 ------------------------- 11 files changed, 5 insertions(+), 17419 deletions(-) delete mode 100644 cli/gen/core/ApiError.ts delete mode 100644 cli/gen/core/ApiRequestOptions.ts delete mode 100644 cli/gen/core/ApiResult.ts delete mode 100644 cli/gen/core/CancelablePromise.ts delete mode 100644 cli/gen/core/OpenAPI.ts delete mode 100644 cli/gen/core/request.ts delete mode 100644 cli/gen/index.ts delete mode 100644 cli/gen/services.gen.ts delete mode 100644 cli/gen/types.gen.ts diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 2fd46fea08..5f677f5f58 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -6623,7 +6623,8 @@ paths: type: object additionalProperties: $ref: "#/components/schemas/InputTransform" - use_latest_version: 1.482.0 + use_latest_version: + type: boolean flow_options_by_path: type: object additionalProperties: @@ -6633,7 +6634,8 @@ paths: type: object additionalProperties: $ref: "#/components/schemas/InputTransform" - use_latest_version: 1.482.0 + use_latest_version: + type: boolean responses: "201": description: stream of created job uuids separated by \n. Lines may start with 'Error:' diff --git a/cli/.gitignore b/cli/.gitignore index 409ee189ef..d0b1f2c514 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -1 +1,2 @@ npm/ +gen/ \ No newline at end of file diff --git a/cli/gen/core/ApiError.ts b/cli/gen/core/ApiError.ts deleted file mode 100644 index 81aa78a668..0000000000 --- a/cli/gen/core/ApiError.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; -import type { ApiResult } from './ApiResult.ts'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: unknown; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} \ No newline at end of file diff --git a/cli/gen/core/ApiRequestOptions.ts b/cli/gen/core/ApiRequestOptions.ts deleted file mode 100644 index 939a0aa4c8..0000000000 --- a/cli/gen/core/ApiRequestOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -export type ApiRequestOptions = { - readonly body?: any; - readonly cookies?: Record; - readonly errors?: Record; - readonly formData?: Record | any[] | Blob | File; - readonly headers?: Record; - readonly mediaType?: string; - readonly method: - | 'DELETE' - | 'GET' - | 'HEAD' - | 'OPTIONS' - | 'PATCH' - | 'POST' - | 'PUT'; - readonly path?: Record; - readonly query?: Record; - readonly responseHeader?: string; - readonly responseTransformer?: (data: unknown) => Promise; - readonly url: string; -}; \ No newline at end of file diff --git a/cli/gen/core/ApiResult.ts b/cli/gen/core/ApiResult.ts deleted file mode 100644 index 4c58e39138..0000000000 --- a/cli/gen/core/ApiResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ApiResult = { - readonly body: TData; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly url: string; -}; \ No newline at end of file diff --git a/cli/gen/core/CancelablePromise.ts b/cli/gen/core/CancelablePromise.ts deleted file mode 100644 index ccc082e8f2..0000000000 --- a/cli/gen/core/CancelablePromise.ts +++ /dev/null @@ -1,126 +0,0 @@ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - readonly cancelHandlers: (() => void)[]; - readonly promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: unknown) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: unknown) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this.cancelHandlers = []; - this.promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - if (this._resolve) this._resolve(value); - }; - - const onReject = (reason?: unknown): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - if (this._reject) this._reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this.cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null - ): Promise { - return this.promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: unknown) => TResult | PromiseLike) | null - ): Promise { - return this.promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this.cancelHandlers.length) { - try { - for (const cancelHandler of this.cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.cancelHandlers.length = 0; - if (this._reject) this._reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} \ No newline at end of file diff --git a/cli/gen/core/OpenAPI.ts b/cli/gen/core/OpenAPI.ts deleted file mode 100644 index 2938820ca7..0000000000 --- a/cli/gen/core/OpenAPI.ts +++ /dev/null @@ -1,63 +0,0 @@ -const getEnv = (key: string) => { - return Deno.env.get(key) -}; - -const baseUrl = getEnv("BASE_INTERNAL_URL") ?? getEnv("BASE_URL") ?? "http://localhost:8000"; -const baseUrlApi = (baseUrl ?? '') + "/api"; - -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; - -type Headers = Record; -type Middleware = (value: T) => T | Promise; -type Resolver = (options: ApiRequestOptions) => Promise; - -export class Interceptors { - _fns: Middleware[]; - - constructor() { - this._fns = []; - } - - eject(fn: Middleware): void { - const index = this._fns.indexOf(fn); - if (index !== -1) { - this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; - } - } - - use(fn: Middleware): void { - this._fns = [...this._fns, fn]; - } -} - -export type OpenAPIConfig = { - BASE: string; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - ENCODE_PATH?: ((path: string) => string) | undefined; - HEADERS?: Headers | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - VERSION: string; - WITH_CREDENTIALS: boolean; - interceptors: { - request: Interceptors; - response: Interceptors; - }; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: baseUrlApi, - CREDENTIALS: 'include', - ENCODE_PATH: undefined, - HEADERS: undefined, - PASSWORD: undefined, - TOKEN: getEnv("WM_TOKEN"), - USERNAME: undefined, - VERSION: '1.481.0', - WITH_CREDENTIALS: true, - interceptors: { - request: new Interceptors(), - response: new Interceptors(), - }, -}; \ No newline at end of file diff --git a/cli/gen/core/request.ts b/cli/gen/core/request.ts deleted file mode 100644 index ed11eb4482..0000000000 --- a/cli/gen/core/request.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { ApiError } from './ApiError.ts'; -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; -import type { ApiResult } from './ApiResult.ts'; -import { CancelablePromise } from './CancelablePromise.ts'; -import type { OnCancel } from './CancelablePromise.ts'; -import type { OpenAPIConfig } from './OpenAPI.ts'; - -export const isString = (value: unknown): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: unknown): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return value instanceof Blob; -}; - -export const isFormData = (value: unknown): value is FormData => { - return value instanceof FormData; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: unknown) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const encodePair = (key: string, value: unknown) => { - if (value === undefined || value === null) { - return; - } - - if (value instanceof Date) { - append(key, value.toISOString()); - } else if (Array.isArray(value)) { - value.forEach(v => encodePair(key, v)); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); - } else { - append(key, value); - } - }; - - Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - - return qs.length ? `?${qs.join('&')}` : ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = config.BASE + path; - return options.query ? url + getQueryString(options.query) : url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: unknown) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([, value]) => value !== undefined && value !== null) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { - const [token, username, password, additionalHeaders] = await Promise.all([ - // @ts-ignore - resolve(options, config.TOKEN), - // @ts-ignore - resolve(options, config.USERNAME), - // @ts-ignore - resolve(options, config.PASSWORD), - // @ts-ignore - resolve(options, config.HEADERS), - ]); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([, value]) => value !== undefined && value !== null) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -export const getRequestBody = (options: ApiRequestOptions): unknown => { - if (options.body !== undefined) { - if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body); - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - let request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - for (const fn of config.interceptors.request._fns) { - request = await fn(request); - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const binaryTypes = ['application/octet-stream', 'application/pdf', 'application/zip', 'audio/', 'image/', 'video/']; - if (contentType.includes('application/json') || contentType.includes('+json')) { - return await response.json(); - } else if (binaryTypes.some(type => contentType.includes(type))) { - return await response.blob(); - } else if (contentType.includes('multipart/form-data')) { - return await response.formData(); - } else if (contentType.includes('text/')) { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Payload Too Large', - 414: 'URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Range Not Satisfiable', - 417: 'Expectation Failed', - 418: 'Im a teapot', - 421: 'Misdirected Request', - 422: 'Unprocessable Content', - 423: 'Locked', - 424: 'Failed Dependency', - 425: 'Too Early', - 426: 'Upgrade Required', - 428: 'Precondition Required', - 429: 'Too Many Requests', - 431: 'Request Header Fields Too Large', - 451: 'Unavailable For Legal Reasons', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported', - 506: 'Variant Also Negotiates', - 507: 'Insufficient Storage', - 508: 'Loop Detected', - 510: 'Not Extended', - 511: 'Network Authentication Required', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - let response = await sendRequest(config, options, url, body, formData, headers, onCancel); - - for (const fn of config.interceptors.response._fns) { - response = await fn(response); - } - - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - let transformedBody = responseBody; - if (options.responseTransformer && response.ok) { - transformedBody = await options.responseTransformer(responseBody) - } - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? transformedBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; \ No newline at end of file diff --git a/cli/gen/index.ts b/cli/gen/index.ts deleted file mode 100644 index 77b08aeebb..0000000000 --- a/cli/gen/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts -export { ApiError } from './core/ApiError.ts'; -export { CancelablePromise, CancelError } from './core/CancelablePromise.ts'; -export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI.ts'; -export * from './services.gen.ts'; -export * from './types.gen.ts'; \ No newline at end of file diff --git a/cli/gen/services.gen.ts b/cli/gen/services.gen.ts deleted file mode 100644 index a94a3a544d..0000000000 --- a/cli/gen/services.gen.ts +++ /dev/null @@ -1,8995 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -import type { CancelablePromise } from './core/CancelablePromise.ts'; -import { OpenAPI } from './core/OpenAPI.ts'; -import { request as __request } from './core/request.ts'; -import type { BackendVersionResponse, BackendUptodateResponse, GetLicenseIdResponse, GetOpenApiYamlResponse, GetAuditLogData, GetAuditLogResponse, ListAuditLogsData, ListAuditLogsResponse, LoginData, LoginResponse, LogoutResponse, GetUserData, GetUserResponse, UpdateUserData, UpdateUserResponse, IsOwnerOfPathData, IsOwnerOfPathResponse, SetPasswordData, SetPasswordResponse, SetPasswordForUserData, SetPasswordForUserResponse, SetLoginTypeForUserData, SetLoginTypeForUserResponse, CreateUserGloballyData, CreateUserGloballyResponse, GlobalUserUpdateData, GlobalUserUpdateResponse, GlobalUsernameInfoData, GlobalUsernameInfoResponse, GlobalUserRenameData, GlobalUserRenameResponse, GlobalUserDeleteData, GlobalUserDeleteResponse, GlobalUsersOverwriteData, GlobalUsersOverwriteResponse, GlobalUsersExportResponse, DeleteUserData, DeleteUserResponse, GetGlobalConnectedRepositoriesResponse, ListWorkspacesResponse, IsDomainAllowedResponse, ListUserWorkspacesResponse, ListWorkspacesAsSuperAdminData, ListWorkspacesAsSuperAdminResponse, CreateWorkspaceData, CreateWorkspaceResponse, ExistsWorkspaceData, ExistsWorkspaceResponse, ExistsUsernameData, ExistsUsernameResponse, GetGlobalData, GetGlobalResponse, SetGlobalData, SetGlobalResponse, GetLocalResponse, TestSmtpData, TestSmtpResponse, TestCriticalChannelsData, TestCriticalChannelsResponse, GetCriticalAlertsData, GetCriticalAlertsResponse, AcknowledgeCriticalAlertData, AcknowledgeCriticalAlertResponse, AcknowledgeAllCriticalAlertsResponse, TestLicenseKeyData, TestLicenseKeyResponse, TestObjectStorageConfigData, TestObjectStorageConfigResponse, SendStatsResponse, GetLatestKeyRenewalAttemptResponse, RenewLicenseKeyData, RenewLicenseKeyResponse, CreateCustomerPortalSessionData, CreateCustomerPortalSessionResponse, TestMetadataData, TestMetadataResponse, ListGlobalSettingsResponse, GetCurrentEmailResponse, RefreshUserTokenData, RefreshUserTokenResponse, GetTutorialProgressResponse, UpdateTutorialProgressData, UpdateTutorialProgressResponse, LeaveInstanceResponse, GetUsageResponse, GetRunnableResponse, GlobalWhoamiResponse, ListWorkspaceInvitesResponse, WhoamiData, WhoamiResponse, GetGithubAppTokenData, GetGithubAppTokenResponse, InstallFromWorkspaceData, InstallFromWorkspaceResponse, DeleteFromWorkspaceData, DeleteFromWorkspaceResponse, ExportInstallationData, ExportInstallationResponse, ImportInstallationData, ImportInstallationResponse, AcceptInviteData, AcceptInviteResponse, DeclineInviteData, DeclineInviteResponse, InviteUserData, InviteUserResponse, AddUserData, AddUserResponse, DeleteInviteData, DeleteInviteResponse, ArchiveWorkspaceData, ArchiveWorkspaceResponse, UnarchiveWorkspaceData, UnarchiveWorkspaceResponse, DeleteWorkspaceData, DeleteWorkspaceResponse, LeaveWorkspaceData, LeaveWorkspaceResponse, GetWorkspaceNameData, GetWorkspaceNameResponse, ChangeWorkspaceNameData, ChangeWorkspaceNameResponse, ChangeWorkspaceIdData, ChangeWorkspaceIdResponse, ChangeWorkspaceColorData, ChangeWorkspaceColorResponse, WhoisData, WhoisResponse, UpdateOperatorSettingsData, UpdateOperatorSettingsResponse, ExistsEmailData, ExistsEmailResponse, ListUsersAsSuperAdminData, ListUsersAsSuperAdminResponse, ListPendingInvitesData, ListPendingInvitesResponse, GetSettingsData, GetSettingsResponse, GetDeployToData, GetDeployToResponse, GetIsPremiumData, GetIsPremiumResponse, GetPremiumInfoData, GetPremiumInfoResponse, GetThresholdAlertData, GetThresholdAlertResponse, SetThresholdAlertData, SetThresholdAlertResponse, EditSlackCommandData, EditSlackCommandResponse, EditTeamsCommandData, EditTeamsCommandResponse, ListAvailableTeamsIdsData, ListAvailableTeamsIdsResponse, ListAvailableTeamsChannelsData, ListAvailableTeamsChannelsResponse, ConnectTeamsData, ConnectTeamsResponse, RunSlackMessageTestJobData, RunSlackMessageTestJobResponse, RunTeamsMessageTestJobData, RunTeamsMessageTestJobResponse, EditDeployToData, EditDeployToResponse, EditAutoInviteData, EditAutoInviteResponse, EditWebhookData, EditWebhookResponse, EditCopilotConfigData, EditCopilotConfigResponse, GetCopilotInfoData, GetCopilotInfoResponse, EditErrorHandlerData, EditErrorHandlerResponse, EditLargeFileStorageConfigData, EditLargeFileStorageConfigResponse, EditWorkspaceGitSyncConfigData, EditWorkspaceGitSyncConfigResponse, EditWorkspaceDeployUiSettingsData, EditWorkspaceDeployUiSettingsResponse, EditWorkspaceDefaultAppData, EditWorkspaceDefaultAppResponse, EditDefaultScriptsData, EditDefaultScriptsResponse, GetDefaultScriptsData, GetDefaultScriptsResponse, SetEnvironmentVariableData, SetEnvironmentVariableResponse, GetWorkspaceEncryptionKeyData, GetWorkspaceEncryptionKeyResponse, SetWorkspaceEncryptionKeyData, SetWorkspaceEncryptionKeyResponse, GetWorkspaceDefaultAppData, GetWorkspaceDefaultAppResponse, GetLargeFileStorageConfigData, GetLargeFileStorageConfigResponse, GetWorkspaceUsageData, GetWorkspaceUsageResponse, GetUsedTriggersData, GetUsedTriggersResponse, ListUsersData, ListUsersResponse, ListUsersUsageData, ListUsersUsageResponse, ListUsernamesData, ListUsernamesResponse, UsernameToEmailData, UsernameToEmailResponse, CreateTokenData, CreateTokenResponse, CreateTokenImpersonateData, CreateTokenImpersonateResponse, DeleteTokenData, DeleteTokenResponse, ListTokensData, ListTokensResponse, GetOidcTokenData, GetOidcTokenResponse, CreateVariableData, CreateVariableResponse, EncryptValueData, EncryptValueResponse, DeleteVariableData, DeleteVariableResponse, UpdateVariableData, UpdateVariableResponse, GetVariableData, GetVariableResponse, GetVariableValueData, GetVariableValueResponse, ExistsVariableData, ExistsVariableResponse, ListVariableData, ListVariableResponse, ListContextualVariablesData, ListContextualVariablesResponse, WorkspaceGetCriticalAlertsData, WorkspaceGetCriticalAlertsResponse, WorkspaceAcknowledgeCriticalAlertData, WorkspaceAcknowledgeCriticalAlertResponse, WorkspaceAcknowledgeAllCriticalAlertsData, WorkspaceAcknowledgeAllCriticalAlertsResponse, WorkspaceMuteCriticalAlertsUiData, WorkspaceMuteCriticalAlertsUiResponse, LoginWithOauthData, LoginWithOauthResponse, ConnectSlackCallbackData, ConnectSlackCallbackResponse, ConnectSlackCallbackInstanceData, ConnectSlackCallbackInstanceResponse, ConnectCallbackData, ConnectCallbackResponse, CreateAccountData, CreateAccountResponse, RefreshTokenData, RefreshTokenResponse, DisconnectAccountData, DisconnectAccountResponse, DisconnectSlackData, DisconnectSlackResponse, DisconnectTeamsData, DisconnectTeamsResponse, ListOauthLoginsResponse, ListOauthConnectsResponse, GetOauthConnectData, GetOauthConnectResponse, SyncTeamsResponse, SendMessageToConversationData, SendMessageToConversationResponse, CreateResourceData, CreateResourceResponse, DeleteResourceData, DeleteResourceResponse, UpdateResourceData, UpdateResourceResponse, UpdateResourceValueData, UpdateResourceValueResponse, GetResourceData, GetResourceResponse, GetResourceValueInterpolatedData, GetResourceValueInterpolatedResponse, GetResourceValueData, GetResourceValueResponse, ExistsResourceData, ExistsResourceResponse, ListResourceData, ListResourceResponse, ListSearchResourceData, ListSearchResourceResponse, ListResourceNamesData, ListResourceNamesResponse, CreateResourceTypeData, CreateResourceTypeResponse, FileResourceTypeToFileExtMapData, FileResourceTypeToFileExtMapResponse, DeleteResourceTypeData, DeleteResourceTypeResponse, UpdateResourceTypeData, UpdateResourceTypeResponse, GetResourceTypeData, GetResourceTypeResponse, ExistsResourceTypeData, ExistsResourceTypeResponse, ListResourceTypeData, ListResourceTypeResponse, ListResourceTypeNamesData, ListResourceTypeNamesResponse, QueryResourceTypesData, QueryResourceTypesResponse, ListHubIntegrationsData, ListHubIntegrationsResponse, ListHubFlowsResponse, GetHubFlowByIdData, GetHubFlowByIdResponse, ListHubAppsResponse, GetHubAppByIdData, GetHubAppByIdResponse, GetPublicAppByCustomPathData, GetPublicAppByCustomPathResponse, GetHubScriptContentByPathData, GetHubScriptContentByPathResponse, GetHubScriptByPathData, GetHubScriptByPathResponse, GetTopHubScriptsData, GetTopHubScriptsResponse, QueryHubScriptsData, QueryHubScriptsResponse, ListSearchScriptData, ListSearchScriptResponse, ListScriptsData, ListScriptsResponse, ListScriptPathsData, ListScriptPathsResponse, CreateDraftData, CreateDraftResponse, DeleteDraftData, DeleteDraftResponse, CreateScriptData, CreateScriptResponse, ToggleWorkspaceErrorHandlerForScriptData, ToggleWorkspaceErrorHandlerForScriptResponse, GetCustomTagsData, GetCustomTagsResponse, GeDefaultTagsResponse, IsDefaultTagsPerWorkspaceResponse, ArchiveScriptByPathData, ArchiveScriptByPathResponse, ArchiveScriptByHashData, ArchiveScriptByHashResponse, DeleteScriptByHashData, DeleteScriptByHashResponse, DeleteScriptByPathData, DeleteScriptByPathResponse, GetScriptByPathData, GetScriptByPathResponse, GetTriggersCountOfScriptData, GetTriggersCountOfScriptResponse, ListTokensOfScriptData, ListTokensOfScriptResponse, GetScriptByPathWithDraftData, GetScriptByPathWithDraftResponse, GetScriptHistoryByPathData, GetScriptHistoryByPathResponse, ListScriptPathsFromWorkspaceRunnableData, ListScriptPathsFromWorkspaceRunnableResponse, GetScriptLatestVersionData, GetScriptLatestVersionResponse, UpdateScriptHistoryData, UpdateScriptHistoryResponse, RawScriptByPathData, RawScriptByPathResponse, RawScriptByPathTokenedData, RawScriptByPathTokenedResponse, ExistsScriptByPathData, ExistsScriptByPathResponse, GetScriptByHashData, GetScriptByHashResponse, RawScriptByHashData, RawScriptByHashResponse, GetScriptDeploymentStatusData, GetScriptDeploymentStatusResponse, RunScriptByPathData, RunScriptByPathResponse, OpenaiSyncScriptByPathData, OpenaiSyncScriptByPathResponse, RunWaitResultScriptByPathData, RunWaitResultScriptByPathResponse, RunWaitResultScriptByPathGetData, RunWaitResultScriptByPathGetResponse, OpenaiSyncFlowByPathData, OpenaiSyncFlowByPathResponse, RunWaitResultFlowByPathData, RunWaitResultFlowByPathResponse, ResultByIdData, ResultByIdResponse, ListFlowPathsData, ListFlowPathsResponse, ListSearchFlowData, ListSearchFlowResponse, ListFlowsData, ListFlowsResponse, GetFlowHistoryData, GetFlowHistoryResponse, GetFlowLatestVersionData, GetFlowLatestVersionResponse, ListFlowPathsFromWorkspaceRunnableData, ListFlowPathsFromWorkspaceRunnableResponse, GetFlowVersionData, GetFlowVersionResponse, UpdateFlowHistoryData, UpdateFlowHistoryResponse, GetFlowByPathData, GetFlowByPathResponse, GetFlowDeploymentStatusData, GetFlowDeploymentStatusResponse, GetTriggersCountOfFlowData, GetTriggersCountOfFlowResponse, ListTokensOfFlowData, ListTokensOfFlowResponse, ToggleWorkspaceErrorHandlerForFlowData, ToggleWorkspaceErrorHandlerForFlowResponse, GetFlowByPathWithDraftData, GetFlowByPathWithDraftResponse, ExistsFlowByPathData, ExistsFlowByPathResponse, CreateFlowData, CreateFlowResponse, UpdateFlowData, UpdateFlowResponse, ArchiveFlowByPathData, ArchiveFlowByPathResponse, DeleteFlowByPathData, DeleteFlowByPathResponse, ListRawAppsData, ListRawAppsResponse, ExistsRawAppData, ExistsRawAppResponse, GetRawAppDataData, GetRawAppDataResponse, ListSearchAppData, ListSearchAppResponse, ListAppsData, ListAppsResponse, CreateAppData, CreateAppResponse, ExistsAppData, ExistsAppResponse, GetAppByPathData, GetAppByPathResponse, GetAppLiteByPathData, GetAppLiteByPathResponse, GetAppByPathWithDraftData, GetAppByPathWithDraftResponse, GetAppHistoryByPathData, GetAppHistoryByPathResponse, GetAppLatestVersionData, GetAppLatestVersionResponse, ListAppPathsFromWorkspaceRunnableData, ListAppPathsFromWorkspaceRunnableResponse, UpdateAppHistoryData, UpdateAppHistoryResponse, GetPublicAppBySecretData, GetPublicAppBySecretResponse, GetPublicResourceData, GetPublicResourceResponse, GetPublicSecretOfAppData, GetPublicSecretOfAppResponse, GetAppByVersionData, GetAppByVersionResponse, CreateRawAppData, CreateRawAppResponse, UpdateRawAppData, UpdateRawAppResponse, DeleteRawAppData, DeleteRawAppResponse, DeleteAppData, DeleteAppResponse, UpdateAppData, UpdateAppResponse, CustomPathExistsData, CustomPathExistsResponse, ExecuteComponentData, ExecuteComponentResponse, UploadS3FileFromAppData, UploadS3FileFromAppResponse, DeleteS3FileFromAppData, DeleteS3FileFromAppResponse, RunFlowByPathData, RunFlowByPathResponse, RestartFlowAtStepData, RestartFlowAtStepResponse, RunScriptByHashData, RunScriptByHashResponse, RunScriptPreviewData, RunScriptPreviewResponse, RunCodeWorkflowTaskData, RunCodeWorkflowTaskResponse, RunRawScriptDependenciesData, RunRawScriptDependenciesResponse, RunFlowPreviewData, RunFlowPreviewResponse, ListQueueData, ListQueueResponse, GetQueueCountData, GetQueueCountResponse, GetCompletedCountData, GetCompletedCountResponse, CountCompletedJobsData, CountCompletedJobsResponse, ListFilteredUuidsData, ListFilteredUuidsResponse, CancelSelectionData, CancelSelectionResponse, ListCompletedJobsData, ListCompletedJobsResponse, ListJobsData, ListJobsResponse, GetDbClockResponse, CountJobsByTagData, CountJobsByTagResponse, GetJobData, GetJobResponse, GetRootJobIdData, GetRootJobIdResponse, GetJobLogsData, GetJobLogsResponse, GetJobArgsData, GetJobArgsResponse, GetJobUpdatesData, GetJobUpdatesResponse, GetLogFileFromStoreData, GetLogFileFromStoreResponse, GetFlowDebugInfoData, GetFlowDebugInfoResponse, GetCompletedJobData, GetCompletedJobResponse, GetCompletedJobResultData, GetCompletedJobResultResponse, GetCompletedJobResultMaybeData, GetCompletedJobResultMaybeResponse, DeleteCompletedJobData, DeleteCompletedJobResponse, CancelQueuedJobData, CancelQueuedJobResponse, CancelPersistentQueuedJobsData, CancelPersistentQueuedJobsResponse, ForceCancelQueuedJobData, ForceCancelQueuedJobResponse, CreateJobSignatureData, CreateJobSignatureResponse, GetResumeUrlsData, GetResumeUrlsResponse, GetSlackApprovalPayloadData, GetSlackApprovalPayloadResponse, ResumeSuspendedJobGetData, ResumeSuspendedJobGetResponse, ResumeSuspendedJobPostData, ResumeSuspendedJobPostResponse, SetFlowUserStateData, SetFlowUserStateResponse, GetFlowUserStateData, GetFlowUserStateResponse, ResumeSuspendedFlowAsOwnerData, ResumeSuspendedFlowAsOwnerResponse, CancelSuspendedJobGetData, CancelSuspendedJobGetResponse, CancelSuspendedJobPostData, CancelSuspendedJobPostResponse, GetSuspendedJobFlowData, GetSuspendedJobFlowResponse, PreviewScheduleData, PreviewScheduleResponse, CreateScheduleData, CreateScheduleResponse, UpdateScheduleData, UpdateScheduleResponse, SetScheduleEnabledData, SetScheduleEnabledResponse, DeleteScheduleData, DeleteScheduleResponse, GetScheduleData, GetScheduleResponse, ExistsScheduleData, ExistsScheduleResponse, ListSchedulesData, ListSchedulesResponse, ListSchedulesWithJobsData, ListSchedulesWithJobsResponse, SetDefaultErrorOrRecoveryHandlerData, SetDefaultErrorOrRecoveryHandlerResponse, CreateHttpTriggerData, CreateHttpTriggerResponse, UpdateHttpTriggerData, UpdateHttpTriggerResponse, DeleteHttpTriggerData, DeleteHttpTriggerResponse, GetHttpTriggerData, GetHttpTriggerResponse, ListHttpTriggersData, ListHttpTriggersResponse, ExistsHttpTriggerData, ExistsHttpTriggerResponse, ExistsRouteData, ExistsRouteResponse, CreateWebsocketTriggerData, CreateWebsocketTriggerResponse, UpdateWebsocketTriggerData, UpdateWebsocketTriggerResponse, DeleteWebsocketTriggerData, DeleteWebsocketTriggerResponse, GetWebsocketTriggerData, GetWebsocketTriggerResponse, ListWebsocketTriggersData, ListWebsocketTriggersResponse, ExistsWebsocketTriggerData, ExistsWebsocketTriggerResponse, SetWebsocketTriggerEnabledData, SetWebsocketTriggerEnabledResponse, TestWebsocketConnectionData, TestWebsocketConnectionResponse, CreateKafkaTriggerData, CreateKafkaTriggerResponse, UpdateKafkaTriggerData, UpdateKafkaTriggerResponse, DeleteKafkaTriggerData, DeleteKafkaTriggerResponse, GetKafkaTriggerData, GetKafkaTriggerResponse, ListKafkaTriggersData, ListKafkaTriggersResponse, ExistsKafkaTriggerData, ExistsKafkaTriggerResponse, SetKafkaTriggerEnabledData, SetKafkaTriggerEnabledResponse, TestKafkaConnectionData, TestKafkaConnectionResponse, CreateNatsTriggerData, CreateNatsTriggerResponse, UpdateNatsTriggerData, UpdateNatsTriggerResponse, DeleteNatsTriggerData, DeleteNatsTriggerResponse, GetNatsTriggerData, GetNatsTriggerResponse, ListNatsTriggersData, ListNatsTriggersResponse, ExistsNatsTriggerData, ExistsNatsTriggerResponse, SetNatsTriggerEnabledData, SetNatsTriggerEnabledResponse, TestNatsConnectionData, TestNatsConnectionResponse, CreateSqsTriggerData, CreateSqsTriggerResponse, UpdateSqsTriggerData, UpdateSqsTriggerResponse, DeleteSqsTriggerData, DeleteSqsTriggerResponse, GetSqsTriggerData, GetSqsTriggerResponse, ListSqsTriggersData, ListSqsTriggersResponse, ExistsSqsTriggerData, ExistsSqsTriggerResponse, SetSqsTriggerEnabledData, SetSqsTriggerEnabledResponse, TestSqsConnectionData, TestSqsConnectionResponse, CreateMqttTriggerData, CreateMqttTriggerResponse, UpdateMqttTriggerData, UpdateMqttTriggerResponse, DeleteMqttTriggerData, DeleteMqttTriggerResponse, GetMqttTriggerData, GetMqttTriggerResponse, ListMqttTriggersData, ListMqttTriggersResponse, ExistsMqttTriggerData, ExistsMqttTriggerResponse, SetMqttTriggerEnabledData, SetMqttTriggerEnabledResponse, TestMqttConnectionData, TestMqttConnectionResponse, CreateGcpTriggerData, CreateGcpTriggerResponse, UpdateGcpTriggerData, UpdateGcpTriggerResponse, DeleteGcpTriggerData, DeleteGcpTriggerResponse, GetGcpTriggerData, GetGcpTriggerResponse, ListGcpTriggersData, ListGcpTriggersResponse, ExistsGcpTriggerData, ExistsGcpTriggerResponse, SetGcpTriggerEnabledData, SetGcpTriggerEnabledResponse, TestGcpConnectionData, TestGcpConnectionResponse, DeleteGcpSubscriptionData, DeleteGcpSubscriptionResponse, ListGoogleTopicsData, ListGoogleTopicsResponse, ListAllTgoogleTopicSubscriptionsData, ListAllTgoogleTopicSubscriptionsResponse, IsValidPostgresConfigurationData, IsValidPostgresConfigurationResponse, CreateTemplateScriptData, CreateTemplateScriptResponse, GetTemplateScriptData, GetTemplateScriptResponse, ListPostgresReplicationSlotData, ListPostgresReplicationSlotResponse, CreatePostgresReplicationSlotData, CreatePostgresReplicationSlotResponse, DeletePostgresReplicationSlotData, DeletePostgresReplicationSlotResponse, ListPostgresPublicationData, ListPostgresPublicationResponse, GetPostgresPublicationData, GetPostgresPublicationResponse, CreatePostgresPublicationData, CreatePostgresPublicationResponse, UpdatePostgresPublicationData, UpdatePostgresPublicationResponse, DeletePostgresPublicationData, DeletePostgresPublicationResponse, CreatePostgresTriggerData, CreatePostgresTriggerResponse, UpdatePostgresTriggerData, UpdatePostgresTriggerResponse, DeletePostgresTriggerData, DeletePostgresTriggerResponse, GetPostgresTriggerData, GetPostgresTriggerResponse, ListPostgresTriggersData, ListPostgresTriggersResponse, ExistsPostgresTriggerData, ExistsPostgresTriggerResponse, SetPostgresTriggerEnabledData, SetPostgresTriggerEnabledResponse, TestPostgresConnectionData, TestPostgresConnectionResponse, ListInstanceGroupsResponse, GetInstanceGroupData, GetInstanceGroupResponse, CreateInstanceGroupData, CreateInstanceGroupResponse, UpdateInstanceGroupData, UpdateInstanceGroupResponse, DeleteInstanceGroupData, DeleteInstanceGroupResponse, AddUserToInstanceGroupData, AddUserToInstanceGroupResponse, RemoveUserFromInstanceGroupData, RemoveUserFromInstanceGroupResponse, ExportInstanceGroupsResponse, OverwriteInstanceGroupsData, OverwriteInstanceGroupsResponse, ListGroupsData, ListGroupsResponse, ListGroupNamesData, ListGroupNamesResponse, CreateGroupData, CreateGroupResponse, UpdateGroupData, UpdateGroupResponse, DeleteGroupData, DeleteGroupResponse, GetGroupData, GetGroupResponse, AddUserToGroupData, AddUserToGroupResponse, RemoveUserToGroupData, RemoveUserToGroupResponse, ListFoldersData, ListFoldersResponse, ListFolderNamesData, ListFolderNamesResponse, CreateFolderData, CreateFolderResponse, UpdateFolderData, UpdateFolderResponse, DeleteFolderData, DeleteFolderResponse, GetFolderData, GetFolderResponse, ExistsFolderData, ExistsFolderResponse, GetFolderUsageData, GetFolderUsageResponse, AddOwnerToFolderData, AddOwnerToFolderResponse, RemoveOwnerToFolderData, RemoveOwnerToFolderResponse, ListWorkersData, ListWorkersResponse, ExistsWorkerWithTagData, ExistsWorkerWithTagResponse, GetQueueMetricsResponse, GetCountsOfJobsWaitingPerTagResponse, ListWorkerGroupsResponse, GetConfigData, GetConfigResponse, UpdateConfigData, UpdateConfigResponse, DeleteConfigData, DeleteConfigResponse, ListConfigsResponse, ListAutoscalingEventsData, ListAutoscalingEventsResponse, GetGranularAclsData, GetGranularAclsResponse, AddGranularAclsData, AddGranularAclsResponse, RemoveGranularAclsData, RemoveGranularAclsResponse, SetCaptureConfigData, SetCaptureConfigResponse, PingCaptureConfigData, PingCaptureConfigResponse, GetCaptureConfigsData, GetCaptureConfigsResponse, ListCapturesData, ListCapturesResponse, MoveCapturesAndConfigsData, MoveCapturesAndConfigsResponse, GetCaptureData, GetCaptureResponse, DeleteCaptureData, DeleteCaptureResponse, StarData, StarResponse, UnstarData, UnstarResponse, GetInputHistoryData, GetInputHistoryResponse, GetArgsFromHistoryOrSavedInputData, GetArgsFromHistoryOrSavedInputResponse, ListInputsData, ListInputsResponse, CreateInputData, CreateInputResponse, UpdateInputData, UpdateInputResponse, DeleteInputData, DeleteInputResponse, DuckdbConnectionSettingsData, DuckdbConnectionSettingsResponse, DuckdbConnectionSettingsV2Data, DuckdbConnectionSettingsV2Response, PolarsConnectionSettingsData, PolarsConnectionSettingsResponse, PolarsConnectionSettingsV2Data, PolarsConnectionSettingsV2Response, S3ResourceInfoData, S3ResourceInfoResponse, DatasetStorageTestConnectionData, DatasetStorageTestConnectionResponse, ListStoredFilesData, ListStoredFilesResponse, LoadFileMetadataData, LoadFileMetadataResponse, LoadFilePreviewData, LoadFilePreviewResponse, LoadParquetPreviewData, LoadParquetPreviewResponse, LoadTableRowCountData, LoadTableRowCountResponse, LoadCsvPreviewData, LoadCsvPreviewResponse, DeleteS3FileData, DeleteS3FileResponse, MoveS3FileData, MoveS3FileResponse, FileUploadData, FileUploadResponse, FileDownloadData, FileDownloadResponse, FileDownloadParquetAsCsvData, FileDownloadParquetAsCsvResponse, GetJobMetricsData, GetJobMetricsResponse, SetJobProgressData, SetJobProgressResponse, GetJobProgressData, GetJobProgressResponse, ListLogFilesData, ListLogFilesResponse, GetLogFileData, GetLogFileResponse, ListConcurrencyGroupsResponse, DeleteConcurrencyGroupData, DeleteConcurrencyGroupResponse, GetConcurrencyKeyData, GetConcurrencyKeyResponse, ListExtendedJobsData, ListExtendedJobsResponse, SearchJobsIndexData, SearchJobsIndexResponse, SearchLogsIndexData, SearchLogsIndexResponse, CountSearchLogsIndexData, CountSearchLogsIndexResponse, ClearIndexData, ClearIndexResponse } from './types.gen.ts'; - -/** - * get backend version - * @returns string git version of backend - * @throws ApiError - */ -export const backendVersion = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/version' -}); }; - -/** - * is backend up to date - * @returns string is backend up to date - * @throws ApiError - */ -export const backendUptodate = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/uptodate' -}); }; - -/** - * get license id - * @returns string get license id (empty if not ee) - * @throws ApiError - */ -export const getLicenseId = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/ee_license' -}); }; - -/** - * get openapi yaml spec - * @returns string openapi yaml file content - * @throws ApiError - */ -export const getOpenApiYaml = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/openapi.yaml' -}); }; - -/** - * get audit log (requires admin privilege) - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns AuditLog an audit log - * @throws ApiError - */ -export const getAuditLog = (data: GetAuditLogData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/audit/get/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * list audit logs (requires admin privilege) - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.before filter on started before (inclusive) timestamp - * @param data.after filter on created after (exclusive) timestamp - * @param data.username filter on exact username of user - * @param data.operation filter on exact or prefix name of operation - * @param data.operations comma separated list of exact operations to include - * @param data.excludeOperations comma separated list of operations to exclude - * @param data.resource filter on exact or prefix name of resource - * @param data.actionKind filter on type of operation - * @param data.allWorkspaces get audit logs for all workspaces - * @returns AuditLog a list of audit logs - * @throws ApiError - */ -export const listAuditLogs = (data: ListAuditLogsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/audit/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - before: data.before, - after: data.after, - username: data.username, - operation: data.operation, - operations: data.operations, - exclude_operations: data.excludeOperations, - resource: data.resource, - action_kind: data.actionKind, - all_workspaces: data.allWorkspaces - } -}); }; - -/** - * login with password - * @param data The data for the request. - * @param data.requestBody credentials - * @returns string Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience. - * - * @throws ApiError - */ -export const login = (data: LoginData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/auth/login', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * logout - * @returns string clear cookies and clear token (if applicable) - * @throws ApiError - */ -export const logout = (): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/auth/logout' -}); }; - -/** - * get user (require admin privilege) - * @param data The data for the request. - * @param data.workspace - * @param data.username - * @returns User user created - * @throws ApiError - */ -export const getUser = (data: GetUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/get/{username}', - path: { - workspace: data.workspace, - username: data.username - } -}); }; - -/** - * update user (require admin privilege) - * @param data The data for the request. - * @param data.workspace - * @param data.username - * @param data.requestBody new user - * @returns string edited user - * @throws ApiError - */ -export const updateUser = (data: UpdateUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/users/update/{username}', - path: { - workspace: data.workspace, - username: data.username - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * is owner of path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean is owner - * @throws ApiError - */ -export const isOwnerOfPath = (data: IsOwnerOfPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/is_owner/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set password - * @param data The data for the request. - * @param data.requestBody set password - * @returns string password set - * @throws ApiError - */ -export const setPassword = (data: SetPasswordData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/setpassword', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set password for a specific user (require super admin) - * @param data The data for the request. - * @param data.user - * @param data.requestBody set password - * @returns string password set - * @throws ApiError - */ -export const setPasswordForUser = (data: SetPasswordForUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/set_password_of/{user}', - path: { - user: data.user - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set login type for a specific user (require super admin) - * @param data The data for the request. - * @param data.user - * @param data.requestBody set login type - * @returns string login type set - * @throws ApiError - */ -export const setLoginTypeForUser = (data: SetLoginTypeForUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/set_login_type/{user}', - path: { - user: data.user - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create user - * @param data The data for the request. - * @param data.requestBody user info - * @returns string user created - * @throws ApiError - */ -export const createUserGlobally = (data: CreateUserGloballyData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/create', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * global update user (require super admin) - * @param data The data for the request. - * @param data.email - * @param data.requestBody new user info - * @returns string user updated - * @throws ApiError - */ -export const globalUserUpdate = (data: GlobalUserUpdateData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/update/{email}', - path: { - email: data.email - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * global username info (require super admin) - * @param data The data for the request. - * @param data.email - * @returns unknown user renamed - * @throws ApiError - */ -export const globalUsernameInfo = (data: GlobalUsernameInfoData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/username_info/{email}', - path: { - email: data.email - } -}); }; - -/** - * global rename user (require super admin) - * @param data The data for the request. - * @param data.email - * @param data.requestBody new username - * @returns string user renamed - * @throws ApiError - */ -export const globalUserRename = (data: GlobalUserRenameData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/rename/{email}', - path: { - email: data.email - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * global delete user (require super admin) - * @param data The data for the request. - * @param data.email - * @returns string user deleted - * @throws ApiError - */ -export const globalUserDelete = (data: GlobalUserDeleteData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/users/delete/{email}', - path: { - email: data.email - } -}); }; - -/** - * global overwrite users (require super admin and EE) - * @param data The data for the request. - * @param data.requestBody List of users - * @returns string Success message - * @throws ApiError - */ -export const globalUsersOverwrite = (data: GlobalUsersOverwriteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/overwrite', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * global export users (require super admin and EE) - * @returns ExportedUser exported users - * @throws ApiError - */ -export const globalUsersExport = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/export' -}); }; - -/** - * delete user (require admin privilege) - * @param data The data for the request. - * @param data.workspace - * @param data.username - * @returns string delete user - * @throws ApiError - */ -export const deleteUser = (data: DeleteUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/users/delete/{username}', - path: { - workspace: data.workspace, - username: data.username - } -}); }; - -/** - * get connected repositories - * @returns GithubInstallations connected repositories - * @throws ApiError - */ -export const getGlobalConnectedRepositories = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/github_app/connected_repositories' -}); }; - -/** - * list all workspaces visible to me - * @returns Workspace all workspaces - * @throws ApiError - */ -export const listWorkspaces = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workspaces/list' -}); }; - -/** - * is domain allowed for auto invi - * @returns boolean domain allowed or not - * @throws ApiError - */ -export const isDomainAllowed = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workspaces/allowed_domain_auto_invite' -}); }; - -/** - * list all workspaces visible to me with user info - * @returns UserWorkspaceList workspace with associated username - * @throws ApiError - */ -export const listUserWorkspaces = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workspaces/users' -}); }; - -/** - * list all workspaces as super admin (require to be super admin) - * @param data The data for the request. - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns Workspace workspaces - * @throws ApiError - */ -export const listWorkspacesAsSuperAdmin = (data: ListWorkspacesAsSuperAdminData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workspaces/list_as_superadmin', - query: { - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * create workspace - * @param data The data for the request. - * @param data.requestBody new token - * @returns string token created - * @throws ApiError - */ -export const createWorkspace = (data: CreateWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/workspaces/create', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * exists workspace - * @param data The data for the request. - * @param data.requestBody id of workspace - * @returns boolean status - * @throws ApiError - */ -export const existsWorkspace = (data: ExistsWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/workspaces/exists', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * exists username - * @param data The data for the request. - * @param data.requestBody - * @returns boolean status - * @throws ApiError - */ -export const existsUsername = (data: ExistsUsernameData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/workspaces/exists_username', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get global settings - * @param data The data for the request. - * @param data.key - * @returns unknown status - * @throws ApiError - */ -export const getGlobal = (data: GetGlobalData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/settings/global/{key}', - path: { - key: data.key - } -}); }; - -/** - * post global settings - * @param data The data for the request. - * @param data.key - * @param data.requestBody value set - * @returns string status - * @throws ApiError - */ -export const setGlobal = (data: SetGlobalData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/global/{key}', - path: { - key: data.key - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get local settings - * @returns unknown status - * @throws ApiError - */ -export const getLocal = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/settings/local' -}); }; - -/** - * test smtp - * @param data The data for the request. - * @param data.requestBody test smtp payload - * @returns string status - * @throws ApiError - */ -export const testSmtp = (data: TestSmtpData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/test_smtp', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test critical channels - * @param data The data for the request. - * @param data.requestBody test critical channel payload - * @returns string status - * @throws ApiError - */ -export const testCriticalChannels = (data: TestCriticalChannelsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/test_critical_channels', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Get all critical alerts - * @param data The data for the request. - * @param data.page - * @param data.pageSize - * @param data.acknowledged - * @returns unknown Successfully retrieved all critical alerts - * @throws ApiError - */ -export const getCriticalAlerts = (data: GetCriticalAlertsData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/settings/critical_alerts', - query: { - page: data.page, - page_size: data.pageSize, - acknowledged: data.acknowledged - } -}); }; - -/** - * Acknowledge a critical alert - * @param data The data for the request. - * @param data.id The ID of the critical alert to acknowledge - * @returns string Successfully acknowledged the critical alert - * @throws ApiError - */ -export const acknowledgeCriticalAlert = (data: AcknowledgeCriticalAlertData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/critical_alerts/{id}/acknowledge', - path: { - id: data.id - } -}); }; - -/** - * Acknowledge all unacknowledged critical alerts - * @returns string Successfully acknowledged all unacknowledged critical alerts. - * @throws ApiError - */ -export const acknowledgeAllCriticalAlerts = (): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/critical_alerts/acknowledge_all' -}); }; - -/** - * test license key - * @param data The data for the request. - * @param data.requestBody test license key - * @returns string status - * @throws ApiError - */ -export const testLicenseKey = (data: TestLicenseKeyData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/test_license_key', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test object storage config - * @param data The data for the request. - * @param data.requestBody test object storage config - * @returns string status - * @throws ApiError - */ -export const testObjectStorageConfig = (data: TestObjectStorageConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/test_object_storage_config', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * send stats - * @returns string status - * @throws ApiError - */ -export const sendStats = (): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/send_stats' -}); }; - -/** - * get latest key renewal attempt - * @returns unknown status - * @throws ApiError - */ -export const getLatestKeyRenewalAttempt = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/settings/latest_key_renewal_attempt' -}); }; - -/** - * renew license key - * @param data The data for the request. - * @param data.licenseKey - * @returns string status - * @throws ApiError - */ -export const renewLicenseKey = (data: RenewLicenseKeyData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/renew_license_key', - query: { - license_key: data.licenseKey - } -}); }; - -/** - * create customer portal session - * @param data The data for the request. - * @param data.licenseKey - * @returns string url to portal - * @throws ApiError - */ -export const createCustomerPortalSession = (data: CreateCustomerPortalSessionData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/settings/customer_portal', - query: { - license_key: data.licenseKey - } -}); }; - -/** - * test metadata - * @param data The data for the request. - * @param data.requestBody test metadata - * @returns string status - * @throws ApiError - */ -export const testMetadata = (data: TestMetadataData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/saml/test_metadata', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list global settings - * @returns GlobalSetting list of settings - * @throws ApiError - */ -export const listGlobalSettings = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/settings/list_global' -}); }; - -/** - * get current user email (if logged in) - * @returns string user email - * @throws ApiError - */ -export const getCurrentEmail = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/email' -}); }; - -/** - * refresh the current token - * @param data The data for the request. - * @param data.ifExpiringInLessThanS - * @returns string new token - * @throws ApiError - */ -export const refreshUserToken = (data: RefreshUserTokenData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/refresh_token', - query: { - if_expiring_in_less_than_s: data.ifExpiringInLessThanS - } -}); }; - -/** - * get tutorial progress - * @returns unknown tutorial progress - * @throws ApiError - */ -export const getTutorialProgress = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/tutorial_progress' -}); }; - -/** - * update tutorial progress - * @param data The data for the request. - * @param data.requestBody progress update - * @returns string tutorial progress - * @throws ApiError - */ -export const updateTutorialProgress = (data: UpdateTutorialProgressData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/tutorial_progress', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * leave instance - * @returns string status - * @throws ApiError - */ -export const leaveInstance = (): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/leave_instance' -}); }; - -/** - * get current usage outside of premium workspaces - * @returns number free usage - * @throws ApiError - */ -export const getUsage = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/usage' -}); }; - -/** - * get all runnables in every workspace - * @returns unknown free all runnables - * @throws ApiError - */ -export const getRunnable = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/all_runnables' -}); }; - -/** - * get current global whoami (if logged in) - * @returns GlobalUserInfo user email - * @throws ApiError - */ -export const globalWhoami = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/whoami' -}); }; - -/** - * list all workspace invites - * @returns WorkspaceInvite list all workspace invites - * @throws ApiError - */ -export const listWorkspaceInvites = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/list_invites' -}); }; - -/** - * whoami - * @param data The data for the request. - * @param data.workspace - * @returns User user - * @throws ApiError - */ -export const whoami = (data: WhoamiData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/whoami', - path: { - workspace: data.workspace - } -}); }; - -/** - * get github app token - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody jwt job token - * @returns unknown github app token - * @throws ApiError - */ -export const getGithubAppToken = (data: GetGithubAppTokenData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/github_app/token', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Install a GitHub installation from another workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns unknown Installation successfully copied - * @throws ApiError - */ -export const installFromWorkspace = (data: InstallFromWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/github_app/install_from_workspace', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Delete a GitHub installation from a workspace - * Removes a GitHub installation from the specified workspace. Requires admin privileges. - * @param data The data for the request. - * @param data.workspace - * @param data.installationId The ID of the GitHub installation to delete - * @returns unknown Installation successfully deleted - * @throws ApiError - */ -export const deleteFromWorkspace = (data: DeleteFromWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/github_app/installation/{installation_id}', - path: { - workspace: data.workspace, - installation_id: data.installationId - } -}); }; - -/** - * Export GitHub installation JWT token - * Exports the JWT token for a specific GitHub installation in the workspace - * @param data The data for the request. - * @param data.workspace - * @param data.installationId - * @returns unknown Successfully exported the JWT token - * @throws ApiError - */ -export const exportInstallation = (data: ExportInstallationData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/github_app/export/{installationId}', - path: { - workspace: data.workspace, - installationId: data.installationId - } -}); }; - -/** - * Import GitHub installation from JWT token - * Imports a GitHub installation from a JWT token exported from another instance - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns unknown Successfully imported the installation - * @throws ApiError - */ -export const importInstallation = (data: ImportInstallationData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/github_app/import', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * accept invite to workspace - * @param data The data for the request. - * @param data.requestBody accept invite - * @returns string status - * @throws ApiError - */ -export const acceptInvite = (data: AcceptInviteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/accept_invite', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * decline invite to workspace - * @param data The data for the request. - * @param data.requestBody decline invite - * @returns string status - * @throws ApiError - */ -export const declineInvite = (data: DeclineInviteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/decline_invite', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * invite user to workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const inviteUser = (data: InviteUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/invite_user', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * add user to workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const addUser = (data: AddUserData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/add_user', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete user invite - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const deleteInvite = (data: DeleteInviteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/delete_invite', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * archive workspace - * @param data The data for the request. - * @param data.workspace - * @returns string status - * @throws ApiError - */ -export const archiveWorkspace = (data: ArchiveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/archive', - path: { - workspace: data.workspace - } -}); }; - -/** - * unarchive workspace - * @param data The data for the request. - * @param data.workspace - * @returns string status - * @throws ApiError - */ -export const unarchiveWorkspace = (data: UnarchiveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/workspaces/unarchive/{workspace}', - path: { - workspace: data.workspace - } -}); }; - -/** - * delete workspace (require super admin) - * @param data The data for the request. - * @param data.workspace - * @returns string status - * @throws ApiError - */ -export const deleteWorkspace = (data: DeleteWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/workspaces/delete/{workspace}', - path: { - workspace: data.workspace - } -}); }; - -/** - * leave workspace - * @param data The data for the request. - * @param data.workspace - * @returns string status - * @throws ApiError - */ -export const leaveWorkspace = (data: LeaveWorkspaceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/leave', - path: { - workspace: data.workspace - } -}); }; - -/** - * get workspace name - * @param data The data for the request. - * @param data.workspace - * @returns string status - * @throws ApiError - */ -export const getWorkspaceName = (data: GetWorkspaceNameData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/get_workspace_name', - path: { - workspace: data.workspace - } -}); }; - -/** - * change workspace name - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string status - * @throws ApiError - */ -export const changeWorkspaceName = (data: ChangeWorkspaceNameData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/change_workspace_name', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * change workspace id - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string status - * @throws ApiError - */ -export const changeWorkspaceId = (data: ChangeWorkspaceIdData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/change_workspace_id', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * change workspace id - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string status - * @throws ApiError - */ -export const changeWorkspaceColor = (data: ChangeWorkspaceColorData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/change_workspace_color', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * whois - * @param data The data for the request. - * @param data.workspace - * @param data.username - * @returns User user - * @throws ApiError - */ -export const whois = (data: WhoisData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/whois/{username}', - path: { - workspace: data.workspace, - username: data.username - } -}); }; - -/** - * Update operator settings for a workspace - * Updates the operator settings for a specific workspace. Requires workspace admin privileges. - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string Operator settings updated successfully - * @throws ApiError - */ -export const updateOperatorSettings = (data: UpdateOperatorSettingsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/operator_settings', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * exists email - * @param data The data for the request. - * @param data.email - * @returns boolean user - * @throws ApiError - */ -export const existsEmail = (data: ExistsEmailData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/exists/{email}', - path: { - email: data.email - } -}); }; - -/** - * list all users as super admin (require to be super amdin) - * @param data The data for the request. - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.activeOnly filter only active users - * @returns GlobalUserInfo user - * @throws ApiError - */ -export const listUsersAsSuperAdmin = (data: ListUsersAsSuperAdminData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/list_as_super_admin', - query: { - page: data.page, - per_page: data.perPage, - active_only: data.activeOnly - } -}); }; - -/** - * list pending invites for a workspace - * @param data The data for the request. - * @param data.workspace - * @returns WorkspaceInvite user - * @throws ApiError - */ -export const listPendingInvites = (data: ListPendingInvitesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/list_pending_invites', - path: { - workspace: data.workspace - } -}); }; - -/** - * get settings - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getSettings = (data: GetSettingsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/get_settings', - path: { - workspace: data.workspace - } -}); }; - -/** - * get deploy to - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getDeployTo = (data: GetDeployToData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/get_deploy_to', - path: { - workspace: data.workspace - } -}); }; - -/** - * get if workspace is premium - * @param data The data for the request. - * @param data.workspace - * @returns boolean status - * @throws ApiError - */ -export const getIsPremium = (data: GetIsPremiumData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/is_premium', - path: { - workspace: data.workspace - } -}); }; - -/** - * get premium info - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getPremiumInfo = (data: GetPremiumInfoData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/premium_info', - path: { - workspace: data.workspace - } -}); }; - -/** - * get threshold alert info - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getThresholdAlert = (data: GetThresholdAlertData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/threshold_alert', - path: { - workspace: data.workspace - } -}); }; - -/** - * set threshold alert info - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody threshold alert info - * @returns string status - * @throws ApiError - */ -export const setThresholdAlert = (data: SetThresholdAlertData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/threshold_alert', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit slack command - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const editSlackCommand = (data: EditSlackCommandData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_slack_command', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit teams command - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const editTeamsCommand = (data: EditTeamsCommandData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_teams_command', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list available teams ids - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const listAvailableTeamsIds = (data: ListAvailableTeamsIdsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/available_teams_ids', - path: { - workspace: data.workspace - } -}); }; - -/** - * list available teams channels - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const listAvailableTeamsChannels = (data: ListAvailableTeamsChannelsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/available_teams_channels', - path: { - workspace: data.workspace - } -}); }; - -/** - * connect teams - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody connect teams - * @returns string status - * @throws ApiError - */ -export const connectTeams = (data: ConnectTeamsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/connect_teams', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run a job that sends a message to Slack - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody path to hub script to run and its corresponding args - * @returns unknown status - * @throws ApiError - */ -export const runSlackMessageTestJob = (data: RunSlackMessageTestJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/run_slack_message_test_job', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run a job that sends a message to Teams - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody path to hub script to run and its corresponding args - * @returns unknown status - * @throws ApiError - */ -export const runTeamsMessageTestJob = (data: RunTeamsMessageTestJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/run_teams_message_test_job', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit deploy to - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string status - * @throws ApiError - */ -export const editDeployTo = (data: EditDeployToData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_deploy_to', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit auto invite - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceInvite - * @returns string status - * @throws ApiError - */ -export const editAutoInvite = (data: EditAutoInviteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_auto_invite', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit webhook - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceWebhook - * @returns string status - * @throws ApiError - */ -export const editWebhook = (data: EditWebhookData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_webhook', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit copilot config - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceCopilotConfig - * @returns string status - * @throws ApiError - */ -export const editCopilotConfig = (data: EditCopilotConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_copilot_config', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get copilot info - * @param data The data for the request. - * @param data.workspace - * @returns AIConfig status - * @throws ApiError - */ -export const getCopilotInfo = (data: GetCopilotInfoData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/get_copilot_info', - path: { - workspace: data.workspace - } -}); }; - -/** - * edit error handler - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody WorkspaceErrorHandler - * @returns string status - * @throws ApiError - */ -export const editErrorHandler = (data: EditErrorHandlerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_error_handler', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit large file storage settings - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody LargeFileStorage info - * @returns unknown status - * @throws ApiError - */ -export const editLargeFileStorageConfig = (data: EditLargeFileStorageConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_large_file_storage_config', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit workspace git sync settings - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Workspace Git sync settings - * @returns unknown status - * @throws ApiError - */ -export const editWorkspaceGitSyncConfig = (data: EditWorkspaceGitSyncConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_git_sync_config', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit workspace deploy ui settings - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Workspace deploy UI settings - * @returns unknown status - * @throws ApiError - */ -export const editWorkspaceDeployUiSettings = (data: EditWorkspaceDeployUiSettingsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_deploy_ui_config', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit default app for workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Workspace default app - * @returns string status - * @throws ApiError - */ -export const editWorkspaceDefaultApp = (data: EditWorkspaceDefaultAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/edit_default_app', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * edit default scripts for workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Workspace default app - * @returns string status - * @throws ApiError - */ -export const editDefaultScripts = (data: EditDefaultScriptsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/default_scripts', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get default scripts for workspace - * @param data The data for the request. - * @param data.workspace - * @returns WorkspaceDefaultScripts status - * @throws ApiError - */ -export const getDefaultScripts = (data: GetDefaultScriptsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/default_scripts', - path: { - workspace: data.workspace - } -}); }; - -/** - * set environment variable - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Workspace default app - * @returns string status - * @throws ApiError - */ -export const setEnvironmentVariable = (data: SetEnvironmentVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/set_environment_variable', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * retrieves the encryption key for this workspace - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getWorkspaceEncryptionKey = (data: GetWorkspaceEncryptionKeyData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/encryption_key', - path: { - workspace: data.workspace - } -}); }; - -/** - * update the encryption key for this workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody New encryption key - * @returns string status - * @throws ApiError - */ -export const setWorkspaceEncryptionKey = (data: SetWorkspaceEncryptionKeyData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/encryption_key', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get default app for workspace - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getWorkspaceDefaultApp = (data: GetWorkspaceDefaultAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/default_app', - path: { - workspace: data.workspace - } -}); }; - -/** - * get large file storage config - * @param data The data for the request. - * @param data.workspace - * @returns LargeFileStorage status - * @throws ApiError - */ -export const getLargeFileStorageConfig = (data: GetLargeFileStorageConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/get_large_file_storage_config', - path: { - workspace: data.workspace - } -}); }; - -/** - * get usage - * @param data The data for the request. - * @param data.workspace - * @returns number usage - * @throws ApiError - */ -export const getWorkspaceUsage = (data: GetWorkspaceUsageData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/usage', - path: { - workspace: data.workspace - } -}); }; - -/** - * get used triggers - * @param data The data for the request. - * @param data.workspace - * @returns unknown status - * @throws ApiError - */ -export const getUsedTriggers = (data: GetUsedTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/used_triggers', - path: { - workspace: data.workspace - } -}); }; - -/** - * list users - * @param data The data for the request. - * @param data.workspace - * @returns User user - * @throws ApiError - */ -export const listUsers = (data: ListUsersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/list', - path: { - workspace: data.workspace - } -}); }; - -/** - * list users usage - * @param data The data for the request. - * @param data.workspace - * @returns UserUsage user - * @throws ApiError - */ -export const listUsersUsage = (data: ListUsersUsageData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/list_usage', - path: { - workspace: data.workspace - } -}); }; - -/** - * list usernames - * @param data The data for the request. - * @param data.workspace - * @returns string user - * @throws ApiError - */ -export const listUsernames = (data: ListUsernamesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/list_usernames', - path: { - workspace: data.workspace - } -}); }; - -/** - * get email from username - * @param data The data for the request. - * @param data.workspace - * @param data.username - * @returns string email - * @throws ApiError - */ -export const usernameToEmail = (data: UsernameToEmailData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/users/username_to_email/{username}', - path: { - workspace: data.workspace, - username: data.username - } -}); }; - -/** - * create token - * @param data The data for the request. - * @param data.requestBody new token - * @returns string token created - * @throws ApiError - */ -export const createToken = (data: CreateTokenData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/tokens/create', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create token to impersonate a user (require superadmin) - * @param data The data for the request. - * @param data.requestBody new token - * @returns string token created - * @throws ApiError - */ -export const createTokenImpersonate = (data: CreateTokenImpersonateData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/users/tokens/impersonate', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete token - * @param data The data for the request. - * @param data.tokenPrefix - * @returns string delete token - * @throws ApiError - */ -export const deleteToken = (data: DeleteTokenData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/users/tokens/delete/{token_prefix}', - path: { - token_prefix: data.tokenPrefix - } -}); }; - -/** - * list token - * @param data The data for the request. - * @param data.excludeEphemeral - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns TruncatedToken truncated token - * @throws ApiError - */ -export const listTokens = (data: ListTokensData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/users/tokens/list', - query: { - exclude_ephemeral: data.excludeEphemeral, - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * get OIDC token (ee only) - * @param data The data for the request. - * @param data.workspace - * @param data.audience - * @returns string new oidc token - * @throws ApiError - */ -export const getOidcToken = (data: GetOidcTokenData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oidc/token/{audience}', - path: { - workspace: data.workspace, - audience: data.audience - } -}); }; - -/** - * create variable - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new variable - * @param data.alreadyEncrypted - * @returns string variable created - * @throws ApiError - */ -export const createVariable = (data: CreateVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/variables/create', - path: { - workspace: data.workspace - }, - query: { - already_encrypted: data.alreadyEncrypted - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * encrypt value - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new variable - * @returns string encrypted value - * @throws ApiError - */ -export const encryptValue = (data: EncryptValueData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/variables/encrypt', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete variable - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string variable deleted - * @throws ApiError - */ -export const deleteVariable = (data: DeleteVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/variables/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * update variable - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated variable - * @param data.alreadyEncrypted - * @returns string variable updated - * @throws ApiError - */ -export const updateVariable = (data: UpdateVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/variables/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - already_encrypted: data.alreadyEncrypted - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get variable - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.decryptSecret ask to decrypt secret if this variable is secret - * (if not secret no effect, default: true) - * - * @param data.includeEncrypted ask to include the encrypted value if secret and decrypt secret is not true (default: false) - * - * @returns ListableVariable variable - * @throws ApiError - */ -export const getVariable = (data: GetVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/variables/get/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - decrypt_secret: data.decryptSecret, - include_encrypted: data.includeEncrypted - } -}); }; - -/** - * get variable value - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string variable - * @throws ApiError - */ -export const getVariableValue = (data: GetVariableValueData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/variables/get_value/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * does variable exists at path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean variable - * @throws ApiError - */ -export const existsVariable = (data: ExistsVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/variables/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list variables - * @param data The data for the request. - * @param data.workspace - * @param data.pathStart - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns ListableVariable variable list - * @throws ApiError - */ -export const listVariable = (data: ListVariableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/variables/list', - path: { - workspace: data.workspace - }, - query: { - path_start: data.pathStart, - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * list contextual variables - * @param data The data for the request. - * @param data.workspace - * @returns ContextualVariable contextual variable list - * @throws ApiError - */ -export const listContextualVariables = (data: ListContextualVariablesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/variables/list_contextual', - path: { - workspace: data.workspace - } -}); }; - -/** - * Get all critical alerts for this workspace - * @param data The data for the request. - * @param data.workspace - * @param data.page - * @param data.pageSize - * @param data.acknowledged - * @returns unknown Successfully retrieved all critical alerts - * @throws ApiError - */ -export const workspaceGetCriticalAlerts = (data: WorkspaceGetCriticalAlertsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/workspaces/critical_alerts', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - page_size: data.pageSize, - acknowledged: data.acknowledged - } -}); }; - -/** - * Acknowledge a critical alert for this workspace - * @param data The data for the request. - * @param data.workspace - * @param data.id The ID of the critical alert to acknowledge - * @returns string Successfully acknowledged the critical alert - * @throws ApiError - */ -export const workspaceAcknowledgeCriticalAlert = (data: WorkspaceAcknowledgeCriticalAlertData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/critical_alerts/{id}/acknowledge', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * Acknowledge all unacknowledged critical alerts for this workspace - * @param data The data for the request. - * @param data.workspace - * @returns string Successfully acknowledged all unacknowledged critical alerts. - * @throws ApiError - */ -export const workspaceAcknowledgeAllCriticalAlerts = (data: WorkspaceAcknowledgeAllCriticalAlertsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/critical_alerts/acknowledge_all', - path: { - workspace: data.workspace - } -}); }; - -/** - * Mute critical alert UI for this workspace - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Boolean flag to mute critical alerts. - * @returns string Successfully updated mute critical alert settings. - * @throws ApiError - */ -export const workspaceMuteCriticalAlertsUi = (data: WorkspaceMuteCriticalAlertsUiData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/workspaces/critical_alerts/mute', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * login with oauth authorization flow - * @param data The data for the request. - * @param data.clientName - * @param data.requestBody Partially filled script - * @returns string Successfully authenticated. The session ID is returned in a cookie named `token` and as plaintext response. Preferred method of authorization is through the bearer token. The cookie is only for browser convenience. - * - * @throws ApiError - */ -export const loginWithOauth = (data: LoginWithOauthData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/oauth/login_callback/{client_name}', - path: { - client_name: data.clientName - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * connect slack callback - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody code endpoint - * @returns string slack token - * @throws ApiError - */ -export const connectSlackCallback = (data: ConnectSlackCallbackData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/connect_slack_callback', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * connect slack callback instance - * @param data The data for the request. - * @param data.requestBody code endpoint - * @returns string success message - * @throws ApiError - */ -export const connectSlackCallbackInstance = (data: ConnectSlackCallbackInstanceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/oauth/connect_slack_callback', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * connect callback - * @param data The data for the request. - * @param data.clientName - * @param data.requestBody code endpoint - * @returns TokenResponse oauth token - * @throws ApiError - */ -export const connectCallback = (data: ConnectCallbackData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/oauth/connect_callback/{client_name}', - path: { - client_name: data.clientName - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create OAuth account - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody code endpoint - * @returns string account set - * @throws ApiError - */ -export const createAccount = (data: CreateAccountData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/create_account', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * refresh token - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody variable path - * @returns string token refreshed - * @throws ApiError - */ -export const refreshToken = (data: RefreshTokenData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/refresh_token/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * disconnect account - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns string disconnected client - * @throws ApiError - */ -export const disconnectAccount = (data: DisconnectAccountData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/disconnect/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * disconnect slack - * @param data The data for the request. - * @param data.workspace - * @returns string disconnected slack - * @throws ApiError - */ -export const disconnectSlack = (data: DisconnectSlackData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/disconnect_slack', - path: { - workspace: data.workspace - } -}); }; - -/** - * disconnect teams - * @param data The data for the request. - * @param data.workspace - * @returns string disconnected teams - * @throws ApiError - */ -export const disconnectTeams = (data: DisconnectTeamsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/oauth/disconnect_teams', - path: { - workspace: data.workspace - } -}); }; - -/** - * list oauth logins - * @returns unknown list of oauth and saml login clients - * @throws ApiError - */ -export const listOauthLogins = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/oauth/list_logins' -}); }; - -/** - * list oauth connects - * @returns string list of oauth connects clients - * @throws ApiError - */ -export const listOauthConnects = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/oauth/list_connects' -}); }; - -/** - * get oauth connect - * @param data The data for the request. - * @param data.client client name - * @returns unknown get - * @throws ApiError - */ -export const getOauthConnect = (data: GetOauthConnectData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/oauth/get_connect/{client}', - path: { - client: data.client - } -}); }; - -/** - * synchronize Microsoft Teams information (teams/channels) - * @returns TeamInfo Teams information successfully synchronized - * @throws ApiError - */ -export const syncTeams = (): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/teams/sync' -}); }; - -/** - * send update to Microsoft Teams activity - * Respond to a Microsoft Teams activity after a workspace command is run - * @param data The data for the request. - * @param data.requestBody - * @returns unknown Activity processed successfully - * @throws ApiError - */ -export const sendMessageToConversation = (data: SendMessageToConversationData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/teams/activities', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create resource - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new resource - * @param data.updateIfExists - * @returns string resource created - * @throws ApiError - */ -export const createResource = (data: CreateResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/resources/create', - path: { - workspace: data.workspace - }, - query: { - update_if_exists: data.updateIfExists - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete resource - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string resource deleted - * @throws ApiError - */ -export const deleteResource = (data: DeleteResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/resources/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * update resource - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated resource - * @returns string resource updated - * @throws ApiError - */ -export const updateResource = (data: UpdateResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/resources/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update resource value - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated resource - * @returns string resource value updated - * @throws ApiError - */ -export const updateResourceValue = (data: UpdateResourceValueData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/resources/update_value/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get resource - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns Resource resource - * @throws ApiError - */ -export const getResource = (data: GetResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get resource interpolated (variables and resources are fully unrolled) - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.jobId job id - * @returns unknown resource value - * @throws ApiError - */ -export const getResourceValueInterpolated = (data: GetResourceValueInterpolatedData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/get_value_interpolated/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - job_id: data.jobId - } -}); }; - -/** - * get resource value - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns unknown resource value - * @throws ApiError - */ -export const getResourceValue = (data: GetResourceValueData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/get_value/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * does resource exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean does resource exists - * @throws ApiError - */ -export const existsResource = (data: ExistsResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list resources - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.resourceType resource_types to list from, separated by ',', - * @param data.resourceTypeExclude resource_types to not list from, separated by ',', - * @param data.pathStart - * @returns ListableResource resource list - * @throws ApiError - */ -export const listResource = (data: ListResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - resource_type: data.resourceType, - resource_type_exclude: data.resourceTypeExclude, - path_start: data.pathStart - } -}); }; - -/** - * list resources for search - * @param data The data for the request. - * @param data.workspace - * @returns unknown resource list - * @throws ApiError - */ -export const listSearchResource = (data: ListSearchResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/list_search', - path: { - workspace: data.workspace - } -}); }; - -/** - * list resource names - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns unknown resource list names - * @throws ApiError - */ -export const listResourceNames = (data: ListResourceNamesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/list_names/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * create resource_type - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new resource_type - * @returns string resource_type created - * @throws ApiError - */ -export const createResourceType = (data: CreateResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/resources/type/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get map from resource type to format extension - * @param data The data for the request. - * @param data.workspace - * @returns unknown map from resource type to file ext - * @throws ApiError - */ -export const fileResourceTypeToFileExtMap = (data: FileResourceTypeToFileExtMapData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/file_resource_type_to_file_ext_map', - path: { - workspace: data.workspace - } -}); }; - -/** - * delete resource_type - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string resource_type deleted - * @throws ApiError - */ -export const deleteResourceType = (data: DeleteResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/resources/type/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * update resource_type - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated resource_type - * @returns string resource_type updated - * @throws ApiError - */ -export const updateResourceType = (data: UpdateResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/resources/type/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get resource_type - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns ResourceType resource_type deleted - * @throws ApiError - */ -export const getResourceType = (data: GetResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/type/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * does resource_type exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean does resource_type exist - * @throws ApiError - */ -export const existsResourceType = (data: ExistsResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/type/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list resource_types - * @param data The data for the request. - * @param data.workspace - * @returns ResourceType resource_type list - * @throws ApiError - */ -export const listResourceType = (data: ListResourceTypeData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/type/list', - path: { - workspace: data.workspace - } -}); }; - -/** - * list resource_types names - * @param data The data for the request. - * @param data.workspace - * @returns string resource_type list - * @throws ApiError - */ -export const listResourceTypeNames = (data: ListResourceTypeNamesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/resources/type/listnames', - path: { - workspace: data.workspace - } -}); }; - -/** - * query resource types by similarity - * @param data The data for the request. - * @param data.workspace - * @param data.text query text - * @param data.limit query limit - * @returns unknown resource type details - * @throws ApiError - */ -export const queryResourceTypes = (data: QueryResourceTypesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/embeddings/query_resource_types', - path: { - workspace: data.workspace - }, - query: { - text: data.text, - limit: data.limit - } -}); }; - -/** - * list hub integrations - * @param data The data for the request. - * @param data.kind query integrations kind - * @returns unknown integrations details - * @throws ApiError - */ -export const listHubIntegrations = (data: ListHubIntegrationsData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/integrations/hub/list', - query: { - kind: data.kind - } -}); }; - -/** - * list all hub flows - * @returns unknown hub flows list - * @throws ApiError - */ -export const listHubFlows = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/flows/hub/list' -}); }; - -/** - * get hub flow by id - * @param data The data for the request. - * @param data.id - * @returns unknown flow - * @throws ApiError - */ -export const getHubFlowById = (data: GetHubFlowByIdData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/flows/hub/get/{id}', - path: { - id: data.id - } -}); }; - -/** - * list all hub apps - * @returns unknown hub apps list - * @throws ApiError - */ -export const listHubApps = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/apps/hub/list' -}); }; - -/** - * get hub app by id - * @param data The data for the request. - * @param data.id - * @returns unknown app - * @throws ApiError - */ -export const getHubAppById = (data: GetHubAppByIdData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/apps/hub/get/{id}', - path: { - id: data.id - } -}); }; - -/** - * get public app by custom path - * @param data The data for the request. - * @param data.customPath - * @returns unknown app details - * @throws ApiError - */ -export const getPublicAppByCustomPath = (data: GetPublicAppByCustomPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/apps_u/public_app_by_custom_path/{custom_path}', - path: { - custom_path: data.customPath - } -}); }; - -/** - * get hub script content by path - * @param data The data for the request. - * @param data.path - * @returns string script details - * @throws ApiError - */ -export const getHubScriptContentByPath = (data: GetHubScriptContentByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/scripts/hub/get/{path}', - path: { - path: data.path - } -}); }; - -/** - * get full hub script by path - * @param data The data for the request. - * @param data.path - * @returns unknown script details - * @throws ApiError - */ -export const getHubScriptByPath = (data: GetHubScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/scripts/hub/get_full/{path}', - path: { - path: data.path - } -}); }; - -/** - * get top hub scripts - * @param data The data for the request. - * @param data.limit query limit - * @param data.app query scripts app - * @param data.kind query scripts kind - * @returns unknown hub scripts list - * @throws ApiError - */ -export const getTopHubScripts = (data: GetTopHubScriptsData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/scripts/hub/top', - query: { - limit: data.limit, - app: data.app, - kind: data.kind - } -}); }; - -/** - * query hub scripts by similarity - * @param data The data for the request. - * @param data.text query text - * @param data.kind query scripts kind - * @param data.limit query limit - * @param data.app query scripts app - * @returns unknown script details - * @throws ApiError - */ -export const queryHubScripts = (data: QueryHubScriptsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/embeddings/query_hub_scripts', - query: { - text: data.text, - kind: data.kind, - limit: data.limit, - app: data.app - } -}); }; - -/** - * list scripts for search - * @param data The data for the request. - * @param data.workspace - * @returns unknown script list - * @throws ApiError - */ -export const listSearchScript = (data: ListSearchScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/list_search', - path: { - workspace: data.workspace - } -}); }; - -/** - * list all scripts - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.pathStart mask to filter matching starting path - * @param data.pathExact mask to filter exact matching path - * @param data.firstParentHash mask to filter scripts whom first direct parent has exact hash - * @param data.lastParentHash mask to filter scripts whom last parent in the chain has exact hash. - * Beware that each script stores only a limited number of parents. Hence - * the last parent hash for a script is not necessarily its top-most parent. - * To find the top-most parent you will have to jump from last to last hash - * until finding the parent - * - * @param data.parentHash is the hash present in the array of stored parent hashes for this script. - * The same warning applies than for last_parent_hash. A script only store a - * limited number of direct parent - * - * @param data.showArchived (default false) - * show only the archived files. - * when multiple archived hash share the same path, only the ones with the latest create_at - * are - * ed. - * - * @param data.includeWithoutMain (default false) - * include scripts without an exported main function - * - * @param data.includeDraftOnly (default false) - * include scripts that have no deployed version - * - * @param data.isTemplate (default regardless) - * if true show only the templates - * if false show only the non templates - * if not defined, show all regardless of if the script is a template - * - * @param data.kinds (default regardless) - * script kinds to filter, split by comma - * - * @param data.starredOnly (default false) - * show only the starred items - * - * @param data.withDeploymentMsg (default false) - * include deployment message - * - * @returns Script All scripts - * @throws ApiError - */ -export const listScripts = (data: ListScriptsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - order_desc: data.orderDesc, - created_by: data.createdBy, - path_start: data.pathStart, - path_exact: data.pathExact, - first_parent_hash: data.firstParentHash, - last_parent_hash: data.lastParentHash, - parent_hash: data.parentHash, - show_archived: data.showArchived, - include_without_main: data.includeWithoutMain, - include_draft_only: data.includeDraftOnly, - is_template: data.isTemplate, - kinds: data.kinds, - starred_only: data.starredOnly, - with_deployment_msg: data.withDeploymentMsg - } -}); }; - -/** - * list all scripts paths - * @param data The data for the request. - * @param data.workspace - * @returns string list of script paths - * @throws ApiError - */ -export const listScriptPaths = (data: ListScriptPathsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/list_paths', - path: { - workspace: data.workspace - } -}); }; - -/** - * create draft - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns string draft created - * @throws ApiError - */ -export const createDraft = (data: CreateDraftData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/drafts/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete draft - * @param data The data for the request. - * @param data.workspace - * @param data.kind - * @param data.path - * @returns string draft deleted - * @throws ApiError - */ -export const deleteDraft = (data: DeleteDraftData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/drafts/delete/{kind}/{path}', - path: { - workspace: data.workspace, - kind: data.kind, - path: data.path - } -}); }; - -/** - * create script - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Partially filled script - * @returns string script created - * @throws ApiError - */ -export const createScript = (data: CreateScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Toggle ON and OFF the workspace error handler for a given script - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody Workspace error handler enabled - * @returns string error handler toggled - * @throws ApiError - */ -export const toggleWorkspaceErrorHandlerForScript = (data: ToggleWorkspaceErrorHandlerForScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/toggle_workspace_error_handler/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get all instance custom tags (tags are used to dispatch jobs to different worker groups) - * @param data The data for the request. - * @param data.workspace - * @param data.showWorkspaceRestriction - * @returns string list of custom tags - * @throws ApiError - */ -export const getCustomTags = (data: GetCustomTagsData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/custom_tags', - query: { - workspace: data.workspace, - show_workspace_restriction: data.showWorkspaceRestriction - } -}); }; - -/** - * get all instance default tags - * @returns string list of default tags - * @throws ApiError - */ -export const geDefaultTags = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/get_default_tags' -}); }; - -/** - * is default tags per workspace - * @returns boolean is the default tags per workspace - * @throws ApiError - */ -export const isDefaultTagsPerWorkspace = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/is_default_tags_per_workspace' -}); }; - -/** - * archive script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string script archived - * @throws ApiError - */ -export const archiveScriptByPath = (data: ArchiveScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/archive/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * archive script by hash - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @returns Script script details - * @throws ApiError - */ -export const archiveScriptByHash = (data: ArchiveScriptByHashData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/archive/h/{hash}', - path: { - workspace: data.workspace, - hash: data.hash - } -}); }; - -/** - * delete script by hash (erase content but keep hash, require admin) - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @returns Script script details - * @throws ApiError - */ -export const deleteScriptByHash = (data: DeleteScriptByHashData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/delete/h/{hash}', - path: { - workspace: data.workspace, - hash: data.hash - } -}); }; - -/** - * delete script at a given path (require admin) - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.keepCaptures keep captures - * @returns string script path - * @throws ApiError - */ -export const deleteScriptByPath = (data: DeleteScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/delete/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - keep_captures: data.keepCaptures - } -}); }; - -/** - * get script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.withStarredInfo - * @returns Script script details - * @throws ApiError - */ -export const getScriptByPath = (data: GetScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/get/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - with_starred_info: data.withStarredInfo - } -}); }; - -/** - * get triggers count of script - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns TriggersCount triggers count - * @throws ApiError - */ -export const getTriggersCountOfScript = (data: GetTriggersCountOfScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/get_triggers_count/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get tokens with script scope - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns TruncatedToken tokens list - * @throws ApiError - */ -export const listTokensOfScript = (data: ListTokensOfScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/list_tokens/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get script by path with draft - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns NewScriptWithDraft script details - * @throws ApiError - */ -export const getScriptByPathWithDraft = (data: GetScriptByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/get/draft/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get history of a script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns ScriptHistory script history - * @throws ApiError - */ -export const getScriptHistoryByPath = (data: GetScriptHistoryByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/history/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list script paths using provided script as a relative import - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string list of script paths - * @throws ApiError - */ -export const listScriptPathsFromWorkspaceRunnable = (data: ListScriptPathsFromWorkspaceRunnableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/list_paths_from_workspace_runnable/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get scripts's latest version (hash) - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns ScriptHistory Script version/hash - * @throws ApiError - */ -export const getScriptLatestVersion = (data: GetScriptLatestVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/get_latest_version/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * update history of a script - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @param data.path - * @param data.requestBody Script deployment message - * @returns string success - * @throws ApiError - */ -export const updateScriptHistory = (data: UpdateScriptHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/scripts/history_update/h/{hash}/p/{path}', - path: { - workspace: data.workspace, - hash: data.hash, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * raw script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string script content - * @throws ApiError - */ -export const rawScriptByPath = (data: RawScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/raw/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * raw script by path with a token (mostly used by lsp to be used with import maps to resolve scripts) - * @param data The data for the request. - * @param data.workspace - * @param data.token - * @param data.path - * @returns string script content - * @throws ApiError - */ -export const rawScriptByPathTokened = (data: RawScriptByPathTokenedData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/scripts_u/tokened_raw/{workspace}/{token}/{path}', - path: { - workspace: data.workspace, - token: data.token, - path: data.path - } -}); }; - -/** - * exists script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean does it exists - * @throws ApiError - */ -export const existsScriptByPath = (data: ExistsScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/exists/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get script by hash - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @param data.withStarredInfo - * @returns Script script details - * @throws ApiError - */ -export const getScriptByHash = (data: GetScriptByHashData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/get/h/{hash}', - path: { - workspace: data.workspace, - hash: data.hash - }, - query: { - with_starred_info: data.withStarredInfo - } -}); }; - -/** - * raw script by hash - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string script content - * @throws ApiError - */ -export const rawScriptByHash = (data: RawScriptByHashData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/raw/h/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get script deployment status - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @returns unknown script details - * @throws ApiError - */ -export const getScriptDeploymentStatus = (data: GetScriptDeploymentStatusData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/scripts/deployment_status/h/{hash}', - path: { - workspace: data.workspace, - hash: data.hash - } -}); }; - -/** - * run script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody script args - * @param data.scheduledFor when to schedule this job (leave empty for immediate run) - * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now - * @param data.skipPreprocessor skip the preprocessor - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.invisibleToOwner make the run invisible to the the script owner (default false) - * @returns string job created - * @throws ApiError - */ -export const runScriptByPath = (data: RunScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - scheduled_for: data.scheduledFor, - scheduled_in_secs: data.scheduledInSecs, - skip_preprocessor: data.skipPreprocessor, - parent_job: data.parentJob, - tag: data.tag, - cache_ttl: data.cacheTtl, - job_id: data.jobId, - invisible_to_owner: data.invisibleToOwner - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run script by path in openai format - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody script args - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - * @returns unknown job result - * @throws ApiError - */ -export const openaiSyncScriptByPath = (data: OpenaiSyncScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/openai_sync/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - parent_job: data.parentJob, - job_id: data.jobId, - include_header: data.includeHeader, - queue_limit: data.queueLimit - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run script by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody script args - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - * @returns unknown job result - * @throws ApiError - */ -export const runWaitResultScriptByPath = (data: RunWaitResultScriptByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run_wait_result/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - parent_job: data.parentJob, - tag: data.tag, - cache_ttl: data.cacheTtl, - job_id: data.jobId, - include_header: data.includeHeader, - queue_limit: data.queueLimit - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run script by path with get - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent - * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` - * - * @returns unknown job result - * @throws ApiError - */ -export const runWaitResultScriptByPathGet = (data: RunWaitResultScriptByPathGetData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/run_wait_result/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - parent_job: data.parentJob, - tag: data.tag, - cache_ttl: data.cacheTtl, - job_id: data.jobId, - include_header: data.includeHeader, - queue_limit: data.queueLimit, - payload: data.payload - } -}); }; - -/** - * run flow by path and wait until completion in openai format - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody script args - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @returns unknown job result - * @throws ApiError - */ -export const openaiSyncFlowByPath = (data: OpenaiSyncFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/openai_sync/f/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - include_header: data.includeHeader, - queue_limit: data.queueLimit, - job_id: data.jobId - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run flow by path and wait until completion - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody script args - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @returns unknown job result - * @throws ApiError - */ -export const runWaitResultFlowByPath = (data: RunWaitResultFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run_wait_result/f/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - include_header: data.includeHeader, - queue_limit: data.queueLimit, - job_id: data.jobId - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get job result by id - * @param data The data for the request. - * @param data.workspace - * @param data.flowJobId - * @param data.nodeId - * @returns unknown job result - * @throws ApiError - */ -export const resultById = (data: ResultByIdData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/result_by_id/{flow_job_id}/{node_id}', - path: { - workspace: data.workspace, - flow_job_id: data.flowJobId, - node_id: data.nodeId - } -}); }; - -/** - * list all flow paths - * @param data The data for the request. - * @param data.workspace - * @returns string list of flow paths - * @throws ApiError - */ -export const listFlowPaths = (data: ListFlowPathsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/list_paths', - path: { - workspace: data.workspace - } -}); }; - -/** - * list flows for search - * @param data The data for the request. - * @param data.workspace - * @returns unknown flow list - * @throws ApiError - */ -export const listSearchFlow = (data: ListSearchFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/list_search', - path: { - workspace: data.workspace - } -}); }; - -/** - * list all flows - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.pathStart mask to filter matching starting path - * @param data.pathExact mask to filter exact matching path - * @param data.showArchived (default false) - * show only the archived files. - * when multiple archived hash share the same path, only the ones with the latest create_at - * are displayed. - * - * @param data.starredOnly (default false) - * show only the starred items - * - * @param data.includeDraftOnly (default false) - * include items that have no deployed version - * - * @param data.withDeploymentMsg (default false) - * include deployment message - * - * @returns unknown All flow - * @throws ApiError - */ -export const listFlows = (data: ListFlowsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - order_desc: data.orderDesc, - created_by: data.createdBy, - path_start: data.pathStart, - path_exact: data.pathExact, - show_archived: data.showArchived, - starred_only: data.starredOnly, - include_draft_only: data.includeDraftOnly, - with_deployment_msg: data.withDeploymentMsg - } -}); }; - -/** - * get flow history by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns FlowVersion Flow history - * @throws ApiError - */ -export const getFlowHistory = (data: GetFlowHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/history/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get flow's latest version - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns FlowVersion Flow version - * @throws ApiError - */ -export const getFlowLatestVersion = (data: GetFlowLatestVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/get_latest_version/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list flow paths from workspace runnable - * @param data The data for the request. - * @param data.workspace - * @param data.runnableKind - * @param data.path - * @returns string list of flow paths - * @throws ApiError - */ -export const listFlowPathsFromWorkspaceRunnable = (data: ListFlowPathsFromWorkspaceRunnableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/list_paths_from_workspace_runnable/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - runnable_kind: data.runnableKind, - path: data.path - } -}); }; - -/** - * get flow version - * @param data The data for the request. - * @param data.workspace - * @param data.version - * @param data.path - * @returns Flow flow details - * @throws ApiError - */ -export const getFlowVersion = (data: GetFlowVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/get/v/{version}/p/{path}', - path: { - workspace: data.workspace, - version: data.version, - path: data.path - } -}); }; - -/** - * update flow history - * @param data The data for the request. - * @param data.workspace - * @param data.version - * @param data.path - * @param data.requestBody Flow deployment message - * @returns string success - * @throws ApiError - */ -export const updateFlowHistory = (data: UpdateFlowHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/flows/history_update/v/{version}/p/{path}', - path: { - workspace: data.workspace, - version: data.version, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get flow by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.withStarredInfo - * @returns Flow flow details - * @throws ApiError - */ -export const getFlowByPath = (data: GetFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/get/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - with_starred_info: data.withStarredInfo - } -}); }; - -/** - * get flow deployment status - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns unknown flow status - * @throws ApiError - */ -export const getFlowDeploymentStatus = (data: GetFlowDeploymentStatusData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/deployment_status/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get triggers count of flow - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns TriggersCount triggers count - * @throws ApiError - */ -export const getTriggersCountOfFlow = (data: GetTriggersCountOfFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/get_triggers_count/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get tokens with flow scope - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns TruncatedToken tokens list - * @throws ApiError - */ -export const listTokensOfFlow = (data: ListTokensOfFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/list_tokens/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * Toggle ON and OFF the workspace error handler for a given flow - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody Workspace error handler enabled - * @returns string error handler toggled - * @throws ApiError - */ -export const toggleWorkspaceErrorHandlerForFlow = (data: ToggleWorkspaceErrorHandlerForFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/flows/toggle_workspace_error_handler/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get flow by path with draft - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns unknown flow details with draft - * @throws ApiError - */ -export const getFlowByPathWithDraft = (data: GetFlowByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/get/draft/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * exists flow by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean flow details - * @throws ApiError - */ -export const existsFlowByPath = (data: ExistsFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/flows/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * create flow - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Partially filled flow - * @returns string flow created - * @throws ApiError - */ -export const createFlow = (data: CreateFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/flows/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update flow - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody Partially filled flow - * @returns string flow updated - * @throws ApiError - */ -export const updateFlow = (data: UpdateFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/flows/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * archive flow by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody archiveFlow - * @returns string flow archived - * @throws ApiError - */ -export const archiveFlowByPath = (data: ArchiveFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/flows/archive/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete flow by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.keepCaptures keep captures - * @returns string flow delete - * @throws ApiError - */ -export const deleteFlowByPath = (data: DeleteFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/flows/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - keep_captures: data.keepCaptures - } -}); }; - -/** - * list all raw apps - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.pathStart mask to filter matching starting path - * @param data.pathExact mask to filter exact matching path - * @param data.starredOnly (default false) - * show only the starred items - * - * @returns ListableRawApp All raw apps - * @throws ApiError - */ -export const listRawApps = (data: ListRawAppsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/raw_apps/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - order_desc: data.orderDesc, - created_by: data.createdBy, - path_start: data.pathStart, - path_exact: data.pathExact, - starred_only: data.starredOnly - } -}); }; - -/** - * does an app exisst at path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean app exists - * @throws ApiError - */ -export const existsRawApp = (data: ExistsRawAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/raw_apps/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get app by path - * @param data The data for the request. - * @param data.workspace - * @param data.version - * @param data.path - * @returns string app details - * @throws ApiError - */ -export const getRawAppData = (data: GetRawAppDataData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get_data/{version}/{path}', - path: { - workspace: data.workspace, - version: data.version, - path: data.path - } -}); }; - -/** - * list apps for search - * @param data The data for the request. - * @param data.workspace - * @returns unknown app list - * @throws ApiError - */ -export const listSearchApp = (data: ListSearchAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/list_search', - path: { - workspace: data.workspace - } -}); }; - -/** - * list all apps - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.pathStart mask to filter matching starting path - * @param data.pathExact mask to filter exact matching path - * @param data.starredOnly (default false) - * show only the starred items - * - * @param data.includeDraftOnly (default false) - * include items that have no deployed version - * - * @param data.withDeploymentMsg (default false) - * include deployment message - * - * @returns ListableApp All apps - * @throws ApiError - */ -export const listApps = (data: ListAppsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - order_desc: data.orderDesc, - created_by: data.createdBy, - path_start: data.pathStart, - path_exact: data.pathExact, - starred_only: data.starredOnly, - include_draft_only: data.includeDraftOnly, - with_deployment_msg: data.withDeploymentMsg - } -}); }; - -/** - * create app - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new app - * @returns string app created - * @throws ApiError - */ -export const createApp = (data: CreateAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/apps/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * does an app exisst at path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean app exists - * @throws ApiError - */ -export const existsApp = (data: ExistsAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get app by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.withStarredInfo - * @returns AppWithLastVersion app details - * @throws ApiError - */ -export const getAppByPath = (data: GetAppByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get/p/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - with_starred_info: data.withStarredInfo - } -}); }; - -/** - * get app lite by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns AppWithLastVersion app lite details - * @throws ApiError - */ -export const getAppLiteByPath = (data: GetAppLiteByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get/lite/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get app by path with draft - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns AppWithLastVersionWDraft app details with draft - * @throws ApiError - */ -export const getAppByPathWithDraft = (data: GetAppByPathWithDraftData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get/draft/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get app history by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns AppHistory app history - * @throws ApiError - */ -export const getAppHistoryByPath = (data: GetAppHistoryByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/history/p/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get apps's latest version - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns AppHistory App version - * @throws ApiError - */ -export const getAppLatestVersion = (data: GetAppLatestVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get_latest_version/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list app paths from workspace runnable - * @param data The data for the request. - * @param data.workspace - * @param data.runnableKind - * @param data.path - * @returns string list of app paths - * @throws ApiError - */ -export const listAppPathsFromWorkspaceRunnable = (data: ListAppPathsFromWorkspaceRunnableData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/list_paths_from_workspace_runnable/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - runnable_kind: data.runnableKind, - path: data.path - } -}); }; - -/** - * update app history - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.version - * @param data.requestBody App deployment message - * @returns string success - * @throws ApiError - */ -export const updateAppHistory = (data: UpdateAppHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/apps/history_update/a/{id}/v/{version}', - path: { - workspace: data.workspace, - id: data.id, - version: data.version - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get public app by secret - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns AppWithLastVersion app details - * @throws ApiError - */ -export const getPublicAppBySecret = (data: GetPublicAppBySecretData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps_u/public_app/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get public resource - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns unknown resource value - * @throws ApiError - */ -export const getPublicResource = (data: GetPublicResourceData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps_u/public_resource/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get public secret of app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string app secret - * @throws ApiError - */ -export const getPublicSecretOfApp = (data: GetPublicSecretOfAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/secret_of/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get app by version - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns AppWithLastVersion app details - * @throws ApiError - */ -export const getAppByVersion = (data: GetAppByVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/get/v/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * create raw app - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new raw app - * @returns string raw app created - * @throws ApiError - */ -export const createRawApp = (data: CreateRawAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/raw_apps/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updateraw app - * @returns string app updated - * @throws ApiError - */ -export const updateRawApp = (data: UpdateRawAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/raw_apps/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete raw app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string app deleted - * @throws ApiError - */ -export const deleteRawApp = (data: DeleteRawAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/raw_apps/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * delete app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string app deleted - * @throws ApiError - */ -export const deleteApp = (data: DeleteAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/apps/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * update app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody update app - * @returns string app updated - * @throws ApiError - */ -export const updateApp = (data: UpdateAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/apps/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * check if custom path exists - * @param data The data for the request. - * @param data.workspace - * @param data.customPath - * @returns boolean custom path exists - * @throws ApiError - */ -export const customPathExists = (data: CustomPathExistsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/apps/custom_path_exists/{custom_path}', - path: { - workspace: data.workspace, - custom_path: data.customPath - } -}); }; - -/** - * executeComponent - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody update app - * @returns string job uuid - * @throws ApiError - */ -export const executeComponent = (data: ExecuteComponentData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/apps_u/execute_component/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * upload s3 file from app - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody File content - * @param data.fileKey - * @param data.fileExtension - * @param data.s3ResourcePath - * @param data.resourceType - * @param data.storage - * @param data.contentType - * @param data.contentDisposition - * @returns unknown file uploaded - * @throws ApiError - */ -export const uploadS3FileFromApp = (data: UploadS3FileFromAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/apps_u/upload_s3_file/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - file_key: data.fileKey, - file_extension: data.fileExtension, - s3_resource_path: data.s3ResourcePath, - resource_type: data.resourceType, - storage: data.storage, - content_type: data.contentType, - content_disposition: data.contentDisposition - }, - body: data.requestBody, - mediaType: 'application/octet-stream' -}); }; - -/** - * delete s3 file from app - * @param data The data for the request. - * @param data.workspace - * @param data.deleteToken - * @returns string file deleted - * @throws ApiError - */ -export const deleteS3FileFromApp = (data: DeleteS3FileFromAppData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/apps_u/delete_s3_file', - path: { - workspace: data.workspace - }, - query: { - delete_token: data.deleteToken - } -}); }; - -/** - * run flow by path - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody flow args - * @param data.scheduledFor when to schedule this job (leave empty for immediate run) - * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now - * @param data.skipPreprocessor skip the preprocessor - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.invisibleToOwner make the run invisible to the the flow owner (default false) - * @returns string job created - * @throws ApiError - */ -export const runFlowByPath = (data: RunFlowByPathData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/f/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - scheduled_for: data.scheduledFor, - scheduled_in_secs: data.scheduledInSecs, - skip_preprocessor: data.skipPreprocessor, - parent_job: data.parentJob, - tag: data.tag, - job_id: data.jobId, - include_header: data.includeHeader, - invisible_to_owner: data.invisibleToOwner - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * restart a completed flow at a given step - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.stepId step id to restart the flow from - * @param data.branchOrIterationN for branchall or loop, the iteration at which the flow should restart - * @param data.requestBody flow args - * @param data.scheduledFor when to schedule this job (leave empty for immediate run) - * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.invisibleToOwner make the run invisible to the the flow owner (default false) - * @returns string job created - * @throws ApiError - */ -export const restartFlowAtStep = (data: RestartFlowAtStepData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/restart/f/{id}/from/{step_id}/{branch_or_iteration_n}', - path: { - workspace: data.workspace, - id: data.id, - step_id: data.stepId, - branch_or_iteration_n: data.branchOrIterationN - }, - query: { - scheduled_for: data.scheduledFor, - scheduled_in_secs: data.scheduledInSecs, - parent_job: data.parentJob, - tag: data.tag, - job_id: data.jobId, - include_header: data.includeHeader, - invisible_to_owner: data.invisibleToOwner - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run script by hash - * @param data The data for the request. - * @param data.workspace - * @param data.hash - * @param data.requestBody Partially filled args - * @param data.scheduledFor when to schedule this job (leave empty for immediate run) - * @param data.scheduledInSecs schedule the script to execute in the number of seconds starting now - * @param data.skipPreprocessor skip the preprocessor - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.tag Override the tag to use - * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.invisibleToOwner make the run invisible to the the script owner (default false) - * @returns string job created - * @throws ApiError - */ -export const runScriptByHash = (data: RunScriptByHashData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/h/{hash}', - path: { - workspace: data.workspace, - hash: data.hash - }, - query: { - scheduled_for: data.scheduledFor, - scheduled_in_secs: data.scheduledInSecs, - skip_preprocessor: data.skipPreprocessor, - parent_job: data.parentJob, - tag: data.tag, - cache_ttl: data.cacheTtl, - job_id: data.jobId, - include_header: data.includeHeader, - invisible_to_owner: data.invisibleToOwner - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run script preview - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody preview - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.invisibleToOwner make the run invisible to the the script owner (default false) - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @returns string job created - * @throws ApiError - */ -export const runScriptPreview = (data: RunScriptPreviewData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/preview', - path: { - workspace: data.workspace - }, - query: { - include_header: data.includeHeader, - invisible_to_owner: data.invisibleToOwner, - job_id: data.jobId - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run code-workflow task - * @param data The data for the request. - * @param data.workspace - * @param data.jobId - * @param data.entrypoint - * @param data.requestBody preview - * @returns string job created - * @throws ApiError - */ -export const runCodeWorkflowTask = (data: RunCodeWorkflowTaskData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/workflow_as_code/{job_id}/{entrypoint}', - path: { - workspace: data.workspace, - job_id: data.jobId, - entrypoint: data.entrypoint - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run a one-off dependencies job - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody raw script content - * @returns unknown dependency job result - * @throws ApiError - */ -export const runRawScriptDependencies = (data: RunRawScriptDependenciesData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/dependencies', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * run flow preview - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody preview - * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - * @param data.invisibleToOwner make the run invisible to the the script owner (default false) - * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - * @returns string job created - * @throws ApiError - */ -export const runFlowPreview = (data: RunFlowPreviewData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/run/preview_flow', - path: { - workspace: data.workspace - }, - query: { - include_header: data.includeHeader, - invisible_to_owner: data.invisibleToOwner, - job_id: data.jobId - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list all queued jobs - * @param data The data for the request. - * @param data.workspace - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.worker worker this job was ran on - * @param data.scriptPathExact mask to filter exact matching path - * @param data.scriptPathStart mask to filter matching starting path - * @param data.schedulePath mask to filter by schedule path - * @param data.scriptHash mask to filter exact matching path - * @param data.startedBefore filter on started before (inclusive) timestamp - * @param data.startedAfter filter on started after (exclusive) timestamp - * @param data.success filter on successful jobs - * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) - * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - * @param data.suspended filter on suspended jobs - * @param data.running filter on running jobs - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.result filter on jobs containing those result as a json subset (@> in postgres) - * @param data.allowWildcards allow wildcards (*) in the filter of label, tag, worker - * @param data.tag filter on jobs with a given tag/worker group - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) - * @param data.isNotSchedule is not a scheduled job - * @returns QueuedJob All queued jobs - * @throws ApiError - */ -export const listQueue = (data: ListQueueData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/queue/list', - path: { - workspace: data.workspace - }, - query: { - order_desc: data.orderDesc, - created_by: data.createdBy, - parent_job: data.parentJob, - worker: data.worker, - script_path_exact: data.scriptPathExact, - script_path_start: data.scriptPathStart, - schedule_path: data.schedulePath, - script_hash: data.scriptHash, - started_before: data.startedBefore, - started_after: data.startedAfter, - success: data.success, - scheduled_for_before_now: data.scheduledForBeforeNow, - job_kinds: data.jobKinds, - suspended: data.suspended, - running: data.running, - args: data.args, - result: data.result, - allow_wildcards: data.allowWildcards, - tag: data.tag, - page: data.page, - per_page: data.perPage, - all_workspaces: data.allWorkspaces, - is_not_schedule: data.isNotSchedule - } -}); }; - -/** - * get queue count - * @param data The data for the request. - * @param data.workspace - * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) - * @returns unknown queue count - * @throws ApiError - */ -export const getQueueCount = (data: GetQueueCountData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/queue/count', - path: { - workspace: data.workspace - }, - query: { - all_workspaces: data.allWorkspaces - } -}); }; - -/** - * get completed count - * @param data The data for the request. - * @param data.workspace - * @returns unknown completed count - * @throws ApiError - */ -export const getCompletedCount = (data: GetCompletedCountData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/completed/count', - path: { - workspace: data.workspace - } -}); }; - -/** - * count number of completed jobs with filter - * @param data The data for the request. - * @param data.workspace - * @param data.completedAfterSAgo - * @param data.success - * @param data.tags - * @param data.allWorkspaces - * @returns number Count of completed jobs - * @throws ApiError - */ -export const countCompletedJobs = (data: CountCompletedJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/completed/count_jobs', - path: { - workspace: data.workspace - }, - query: { - completed_after_s_ago: data.completedAfterSAgo, - success: data.success, - tags: data.tags, - all_workspaces: data.allWorkspaces - } -}); }; - -/** - * get the ids of all jobs matching the given filters - * @param data The data for the request. - * @param data.workspace - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.scriptPathExact mask to filter exact matching path - * @param data.scriptPathStart mask to filter matching starting path - * @param data.schedulePath mask to filter by schedule path - * @param data.scriptHash mask to filter exact matching path - * @param data.startedBefore filter on started before (inclusive) timestamp - * @param data.startedAfter filter on started after (exclusive) timestamp - * @param data.success filter on successful jobs - * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) - * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - * @param data.suspended filter on suspended jobs - * @param data.running filter on running jobs - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.result filter on jobs containing those result as a json subset (@> in postgres) - * @param data.allowWildcards allow wildcards (*) in the filter of label, tag, worker - * @param data.tag filter on jobs with a given tag/worker group - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.concurrencyKey - * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) - * @param data.isNotSchedule is not a scheduled job - * @returns string uuids of jobs - * @throws ApiError - */ -export const listFilteredUuids = (data: ListFilteredUuidsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/queue/list_filtered_uuids', - path: { - workspace: data.workspace - }, - query: { - order_desc: data.orderDesc, - created_by: data.createdBy, - parent_job: data.parentJob, - script_path_exact: data.scriptPathExact, - script_path_start: data.scriptPathStart, - schedule_path: data.schedulePath, - script_hash: data.scriptHash, - started_before: data.startedBefore, - started_after: data.startedAfter, - success: data.success, - scheduled_for_before_now: data.scheduledForBeforeNow, - job_kinds: data.jobKinds, - suspended: data.suspended, - running: data.running, - args: data.args, - result: data.result, - allow_wildcards: data.allowWildcards, - tag: data.tag, - page: data.page, - per_page: data.perPage, - concurrency_key: data.concurrencyKey, - all_workspaces: data.allWorkspaces, - is_not_schedule: data.isNotSchedule - } -}); }; - -/** - * cancel jobs based on the given uuids - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody uuids of the jobs to cancel - * @returns string uuids of canceled jobs - * @throws ApiError - */ -export const cancelSelection = (data: CancelSelectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/queue/cancel_selection', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list all completed jobs - * @param data The data for the request. - * @param data.workspace - * @param data.orderDesc order by desc order (default true) - * @param data.createdBy mask to filter exact matching user creator - * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') - * @param data.worker worker this job was ran on - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.scriptPathExact mask to filter exact matching path - * @param data.scriptPathStart mask to filter matching starting path - * @param data.schedulePath mask to filter by schedule path - * @param data.scriptHash mask to filter exact matching path - * @param data.startedBefore filter on started before (inclusive) timestamp - * @param data.startedAfter filter on started after (exclusive) timestamp - * @param data.success filter on successful jobs - * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.result filter on jobs containing those result as a json subset (@> in postgres) - * @param data.allowWildcards allow wildcards (*) in the filter of label, tag, worker - * @param data.tag filter on jobs with a given tag/worker group - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.isSkipped is the job skipped - * @param data.isFlowStep is the job a flow step - * @param data.hasNullParent has null parent - * @param data.isNotSchedule is not a scheduled job - * @returns CompletedJob All completed jobs - * @throws ApiError - */ -export const listCompletedJobs = (data: ListCompletedJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/completed/list', - path: { - workspace: data.workspace - }, - query: { - order_desc: data.orderDesc, - created_by: data.createdBy, - label: data.label, - worker: data.worker, - parent_job: data.parentJob, - script_path_exact: data.scriptPathExact, - script_path_start: data.scriptPathStart, - schedule_path: data.schedulePath, - script_hash: data.scriptHash, - started_before: data.startedBefore, - started_after: data.startedAfter, - success: data.success, - job_kinds: data.jobKinds, - args: data.args, - result: data.result, - allow_wildcards: data.allowWildcards, - tag: data.tag, - page: data.page, - per_page: data.perPage, - is_skipped: data.isSkipped, - is_flow_step: data.isFlowStep, - has_null_parent: data.hasNullParent, - is_not_schedule: data.isNotSchedule - } -}); }; - -/** - * list all jobs - * @param data The data for the request. - * @param data.workspace - * @param data.createdBy mask to filter exact matching user creator - * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') - * @param data.worker worker this job was ran on - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.scriptPathExact mask to filter exact matching path - * @param data.scriptPathStart mask to filter matching starting path - * @param data.schedulePath mask to filter by schedule path - * @param data.scriptHash mask to filter exact matching path - * @param data.startedBefore filter on started before (inclusive) timestamp - * @param data.startedAfter filter on started after (exclusive) timestamp - * @param data.createdBefore filter on created before (inclusive) timestamp - * @param data.createdAfter filter on created after (exclusive) timestamp - * @param data.createdOrStartedBefore filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp - * @param data.running filter on running jobs - * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) - * @param data.createdOrStartedAfter filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp - * @param data.createdOrStartedAfterCompletedJobs filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs - * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - * @param data.suspended filter on suspended jobs - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.tag filter on jobs with a given tag/worker group - * @param data.result filter on jobs containing those result as a json subset (@> in postgres) - * @param data.allowWildcards allow wildcards (*) in the filter of label, tag, worker - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.isSkipped is the job skipped - * @param data.isFlowStep is the job a flow step - * @param data.hasNullParent has null parent - * @param data.success filter on successful jobs - * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) - * @param data.isNotSchedule is not a scheduled job - * @returns Job All jobs - * @throws ApiError - */ -export const listJobs = (data: ListJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/list', - path: { - workspace: data.workspace - }, - query: { - created_by: data.createdBy, - label: data.label, - worker: data.worker, - parent_job: data.parentJob, - script_path_exact: data.scriptPathExact, - script_path_start: data.scriptPathStart, - schedule_path: data.schedulePath, - script_hash: data.scriptHash, - started_before: data.startedBefore, - started_after: data.startedAfter, - created_before: data.createdBefore, - created_after: data.createdAfter, - created_or_started_before: data.createdOrStartedBefore, - running: data.running, - scheduled_for_before_now: data.scheduledForBeforeNow, - created_or_started_after: data.createdOrStartedAfter, - created_or_started_after_completed_jobs: data.createdOrStartedAfterCompletedJobs, - job_kinds: data.jobKinds, - suspended: data.suspended, - args: data.args, - tag: data.tag, - result: data.result, - allow_wildcards: data.allowWildcards, - page: data.page, - per_page: data.perPage, - is_skipped: data.isSkipped, - is_flow_step: data.isFlowStep, - has_null_parent: data.hasNullParent, - success: data.success, - all_workspaces: data.allWorkspaces, - is_not_schedule: data.isNotSchedule - } -}); }; - -/** - * get db clock - * @returns number the timestamp of the db that can be used to compute the drift - * @throws ApiError - */ -export const getDbClock = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/jobs/db_clock' -}); }; - -/** - * Count jobs by tag - * @param data The data for the request. - * @param data.horizonSecs Past Time horizon in seconds (when to start the count = now - horizon) (default is 3600) - * @param data.workspaceId Specific workspace ID to filter results (optional) - * @returns unknown Job counts by tag - * @throws ApiError - */ -export const countJobsByTag = (data: CountJobsByTagData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/jobs/completed/count_by_tag', - query: { - horizon_secs: data.horizonSecs, - workspace_id: data.workspaceId - } -}); }; - -/** - * get job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.noLogs - * @returns Job job details - * @throws ApiError - */ -export const getJob = (data: GetJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - query: { - no_logs: data.noLogs - } -}); }; - -/** - * get root job id - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns string get root job id - * @throws ApiError - */ -export const getRootJobId = (data: GetRootJobIdData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_root_job_id/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * get job logs - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns string job details - * @throws ApiError - */ -export const getJobLogs = (data: GetJobLogsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_logs/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * get job args - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns unknown job args - * @throws ApiError - */ -export const getJobArgs = (data: GetJobArgsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_args/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * get job updates - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.running - * @param data.logOffset - * @param data.getProgress - * @returns unknown job details - * @throws ApiError - */ -export const getJobUpdates = (data: GetJobUpdatesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/getupdate/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - query: { - running: data.running, - log_offset: data.logOffset, - get_progress: data.getProgress - } -}); }; - -/** - * get log file from object store - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns unknown job log - * @throws ApiError - */ -export const getLogFileFromStore = (data: GetLogFileFromStoreData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_log_file/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get flow debug info - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns unknown flow debug info details - * @throws ApiError - */ -export const getFlowDebugInfo = (data: GetFlowDebugInfoData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_flow_debug_info/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * get completed job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns CompletedJob job details - * @throws ApiError - */ -export const getCompletedJob = (data: GetCompletedJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/completed/get/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * get completed job result - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.suspendedJob - * @param data.resumeId - * @param data.secret - * @param data.approver - * @returns unknown result - * @throws ApiError - */ -export const getCompletedJobResult = (data: GetCompletedJobResultData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/completed/get_result/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - query: { - suspended_job: data.suspendedJob, - resume_id: data.resumeId, - secret: data.secret, - approver: data.approver - } -}); }; - -/** - * get completed job result if job is completed - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.getStarted - * @returns unknown result - * @throws ApiError - */ -export const getCompletedJobResultMaybe = (data: GetCompletedJobResultMaybeData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/completed/get_result_maybe/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - query: { - get_started: data.getStarted - } -}); }; - -/** - * delete completed job (erase content but keep run id) - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns CompletedJob job details - * @throws ApiError - */ -export const deleteCompletedJob = (data: DeleteCompletedJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/completed/delete/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * cancel queued or running job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody reason - * @returns string job canceled - * @throws ApiError - */ -export const cancelQueuedJob = (data: CancelQueuedJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs_u/queue/cancel/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * cancel all queued jobs for persistent script - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody reason - * @returns string persistent job scaled down to zero - * @throws ApiError - */ -export const cancelPersistentQueuedJobs = (data: CancelPersistentQueuedJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs_u/queue/cancel_persistent/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * force cancel queued job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody reason - * @returns string job canceled - * @throws ApiError - */ -export const forceCancelQueuedJob = (data: ForceCancelQueuedJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs_u/queue/force_cancel/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create an HMac signature given a job id and a resume id - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.approver - * @returns string job signature - * @throws ApiError - */ -export const createJobSignature = (data: CreateJobSignatureData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/job_signature/{id}/{resume_id}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId - }, - query: { - approver: data.approver - } -}); }; - -/** - * get resume urls given a job_id, resume_id and a nonce to resume a flow - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.approver - * @returns unknown url endpoints - * @throws ApiError - */ -export const getResumeUrls = (data: GetResumeUrlsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/resume_urls/{id}/{resume_id}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId - }, - query: { - approver: data.approver - } -}); }; - -/** - * generate interactive slack approval for suspended job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.slackResourcePath - * @param data.channelId - * @param data.flowStepId - * @param data.approver - * @param data.message - * @param data.defaultArgsJson - * @param data.dynamicEnumsJson - * @returns unknown Interactive slack approval message sent successfully - * @throws ApiError - */ -export const getSlackApprovalPayload = (data: GetSlackApprovalPayloadData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/slack_approval/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - query: { - approver: data.approver, - message: data.message, - slack_resource_path: data.slackResourcePath, - channel_id: data.channelId, - flow_step_id: data.flowStepId, - default_args_json: data.defaultArgsJson, - dynamic_enums_json: data.dynamicEnumsJson - } -}); }; - -/** - * resume a job for a suspended flow - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.signature - * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent - * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` - * - * @param data.approver - * @returns string job resumed - * @throws ApiError - */ -export const resumeSuspendedJobGet = (data: ResumeSuspendedJobGetData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId, - signature: data.signature - }, - query: { - payload: data.payload, - approver: data.approver - } -}); }; - -/** - * resume a job for a suspended flow - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.signature - * @param data.requestBody - * @param data.approver - * @returns string job resumed - * @throws ApiError - */ -export const resumeSuspendedJobPost = (data: ResumeSuspendedJobPostData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs_u/resume/{id}/{resume_id}/{signature}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId, - signature: data.signature - }, - query: { - approver: data.approver - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set flow user state at a given key - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.key - * @param data.requestBody new value - * @returns string flow user state updated - * @throws ApiError - */ -export const setFlowUserState = (data: SetFlowUserStateData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/flow/user_states/{id}/{key}', - path: { - workspace: data.workspace, - id: data.id, - key: data.key - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get flow user state at a given key - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.key - * @returns unknown flow user state updated - * @throws ApiError - */ -export const getFlowUserState = (data: GetFlowUserStateData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs/flow/user_states/{id}/{key}', - path: { - workspace: data.workspace, - id: data.id, - key: data.key - } -}); }; - -/** - * resume a job for a suspended flow as an owner - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody - * @returns string job resumed - * @throws ApiError - */ -export const resumeSuspendedFlowAsOwner = (data: ResumeSuspendedFlowAsOwnerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs/flow/resume/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * cancel a job for a suspended flow - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.signature - * @param data.approver - * @returns string job canceled - * @throws ApiError - */ -export const cancelSuspendedJobGet = (data: CancelSuspendedJobGetData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId, - signature: data.signature - }, - query: { - approver: data.approver - } -}); }; - -/** - * cancel a job for a suspended flow - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.signature - * @param data.requestBody - * @param data.approver - * @returns string job canceled - * @throws ApiError - */ -export const cancelSuspendedJobPost = (data: CancelSuspendedJobPostData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/jobs_u/cancel/{id}/{resume_id}/{signature}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId, - signature: data.signature - }, - query: { - approver: data.approver - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get parent flow job of suspended job - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.resumeId - * @param data.signature - * @param data.approver - * @returns unknown parent flow details - * @throws ApiError - */ -export const getSuspendedJobFlow = (data: GetSuspendedJobFlowData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/jobs_u/get_flow/{id}/{resume_id}/{signature}', - path: { - workspace: data.workspace, - id: data.id, - resume_id: data.resumeId, - signature: data.signature - }, - query: { - approver: data.approver - } -}); }; - -/** - * preview schedule - * @param data The data for the request. - * @param data.requestBody schedule - * @returns string List of 5 estimated upcoming execution events (in UTC) - * @throws ApiError - */ -export const previewSchedule = (data: PreviewScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/schedules/preview', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create schedule - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new schedule - * @returns string schedule created - * @throws ApiError - */ -export const createSchedule = (data: CreateScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/schedules/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update schedule - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated schedule - * @returns string schedule updated - * @throws ApiError - */ -export const updateSchedule = (data: UpdateScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/schedules/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set enabled schedule - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated schedule enable - * @returns string schedule enabled set - * @throws ApiError - */ -export const setScheduleEnabled = (data: SetScheduleEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/schedules/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete schedule - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string schedule deleted - * @throws ApiError - */ -export const deleteSchedule = (data: DeleteScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/schedules/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get schedule - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns Schedule schedule deleted - * @throws ApiError - */ -export const getSchedule = (data: GetScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/schedules/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * does schedule exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean schedule exists - * @throws ApiError - */ -export const existsSchedule = (data: ExistsScheduleData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/schedules/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list schedules - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns Schedule schedule list - * @throws ApiError - */ -export const listSchedules = (data: ListSchedulesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/schedules/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - args: data.args, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * list schedules with last 20 jobs - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns ScheduleWJobs schedule list - * @throws ApiError - */ -export const listSchedulesWithJobs = (data: ListSchedulesWithJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/schedules/list_with_jobs', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * Set default error or recoevery handler - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Handler description - * @returns unknown default error handler set - * @throws ApiError - */ -export const setDefaultErrorOrRecoveryHandler = (data: SetDefaultErrorOrRecoveryHandlerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/schedules/setdefaulthandler', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create http trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new http trigger - * @returns string http trigger created - * @throws ApiError - */ -export const createHttpTrigger = (data: CreateHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/http_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update http trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string http trigger updated - * @throws ApiError - */ -export const updateHttpTrigger = (data: UpdateHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/http_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete http trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string http trigger deleted - * @throws ApiError - */ -export const deleteHttpTrigger = (data: DeleteHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/http_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get http trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns HttpTrigger http trigger deleted - * @throws ApiError - */ -export const getHttpTrigger = (data: GetHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/http_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list http triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns HttpTrigger http trigger list - * @throws ApiError - */ -export const listHttpTriggers = (data: ListHttpTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/http_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does http trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean http trigger exists - * @throws ApiError - */ -export const existsHttpTrigger = (data: ExistsHttpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/http_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * does route exists - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody route exists request - * @returns boolean route exists - * @throws ApiError - */ -export const existsRoute = (data: ExistsRouteData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/http_triggers/route_exists', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create websocket trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new websocket trigger - * @returns string websocket trigger created - * @throws ApiError - */ -export const createWebsocketTrigger = (data: CreateWebsocketTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/websocket_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update websocket trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string websocket trigger updated - * @throws ApiError - */ -export const updateWebsocketTrigger = (data: UpdateWebsocketTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/websocket_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete websocket trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string websocket trigger deleted - * @throws ApiError - */ -export const deleteWebsocketTrigger = (data: DeleteWebsocketTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/websocket_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get websocket trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns WebsocketTrigger websocket trigger deleted - * @throws ApiError - */ -export const getWebsocketTrigger = (data: GetWebsocketTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/websocket_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list websocket triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns WebsocketTrigger websocket trigger list - * @throws ApiError - */ -export const listWebsocketTriggers = (data: ListWebsocketTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/websocket_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does websocket trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean websocket trigger exists - * @throws ApiError - */ -export const existsWebsocketTrigger = (data: ExistsWebsocketTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/websocket_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled websocket trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated websocket trigger enable - * @returns string websocket trigger enabled set - * @throws ApiError - */ -export const setWebsocketTriggerEnabled = (data: SetWebsocketTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/websocket_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test websocket connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test websocket connection - * @returns string successfuly connected to websocket - * @throws ApiError - */ -export const testWebsocketConnection = (data: TestWebsocketConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/websocket_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create kafka trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new kafka trigger - * @returns string kafka trigger created - * @throws ApiError - */ -export const createKafkaTrigger = (data: CreateKafkaTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/kafka_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update kafka trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string kafka trigger updated - * @throws ApiError - */ -export const updateKafkaTrigger = (data: UpdateKafkaTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/kafka_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete kafka trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string kafka trigger deleted - * @throws ApiError - */ -export const deleteKafkaTrigger = (data: DeleteKafkaTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/kafka_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get kafka trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns KafkaTrigger kafka trigger deleted - * @throws ApiError - */ -export const getKafkaTrigger = (data: GetKafkaTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/kafka_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list kafka triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns KafkaTrigger kafka trigger list - * @throws ApiError - */ -export const listKafkaTriggers = (data: ListKafkaTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/kafka_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does kafka trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean kafka trigger exists - * @throws ApiError - */ -export const existsKafkaTrigger = (data: ExistsKafkaTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/kafka_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled kafka trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated kafka trigger enable - * @returns string kafka trigger enabled set - * @throws ApiError - */ -export const setKafkaTriggerEnabled = (data: SetKafkaTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/kafka_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test kafka connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test kafka connection - * @returns string successfuly connected to kafka brokers - * @throws ApiError - */ -export const testKafkaConnection = (data: TestKafkaConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/kafka_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create nats trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new nats trigger - * @returns string nats trigger created - * @throws ApiError - */ -export const createNatsTrigger = (data: CreateNatsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/nats_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update nats trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string nats trigger updated - * @throws ApiError - */ -export const updateNatsTrigger = (data: UpdateNatsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/nats_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete nats trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string nats trigger deleted - * @throws ApiError - */ -export const deleteNatsTrigger = (data: DeleteNatsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/nats_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get nats trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns NatsTrigger nats trigger deleted - * @throws ApiError - */ -export const getNatsTrigger = (data: GetNatsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/nats_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list nats triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns NatsTrigger nats trigger list - * @throws ApiError - */ -export const listNatsTriggers = (data: ListNatsTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/nats_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does nats trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean nats trigger exists - * @throws ApiError - */ -export const existsNatsTrigger = (data: ExistsNatsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/nats_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled nats trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated nats trigger enable - * @returns string nats trigger enabled set - * @throws ApiError - */ -export const setNatsTriggerEnabled = (data: SetNatsTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/nats_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test NATS connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test nats connection - * @returns string successfuly connected to NATS servers - * @throws ApiError - */ -export const testNatsConnection = (data: TestNatsConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/nats_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create sqs trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new sqs trigger - * @returns string sqs trigger created - * @throws ApiError - */ -export const createSqsTrigger = (data: CreateSqsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/sqs_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update sqs trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string sqs trigger updated - * @throws ApiError - */ -export const updateSqsTrigger = (data: UpdateSqsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/sqs_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete sqs trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string sqs trigger deleted - * @throws ApiError - */ -export const deleteSqsTrigger = (data: DeleteSqsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/sqs_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get sqs trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns SqsTrigger sqs trigger deleted - * @throws ApiError - */ -export const getSqsTrigger = (data: GetSqsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/sqs_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list sqs triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns SqsTrigger sqs trigger list - * @throws ApiError - */ -export const listSqsTriggers = (data: ListSqsTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/sqs_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does sqs trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean sqs trigger exists - * @throws ApiError - */ -export const existsSqsTrigger = (data: ExistsSqsTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/sqs_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled sqs trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated sqs trigger enable - * @returns string sqs trigger enabled set - * @throws ApiError - */ -export const setSqsTriggerEnabled = (data: SetSqsTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/sqs_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test sqs connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test sqs connection - * @returns string successfuly connected to sqs - * @throws ApiError - */ -export const testSqsConnection = (data: TestSqsConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/sqs_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create mqtt trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new mqtt trigger - * @returns string mqtt trigger created - * @throws ApiError - */ -export const createMqttTrigger = (data: CreateMqttTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/mqtt_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update mqtt trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string mqtt trigger updated - * @throws ApiError - */ -export const updateMqttTrigger = (data: UpdateMqttTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/mqtt_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete mqtt trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string mqtt trigger deleted - * @throws ApiError - */ -export const deleteMqttTrigger = (data: DeleteMqttTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/mqtt_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get mqtt trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns MqttTrigger mqtt trigger deleted - * @throws ApiError - */ -export const getMqttTrigger = (data: GetMqttTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/mqtt_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list mqtt triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns MqttTrigger mqtt trigger list - * @throws ApiError - */ -export const listMqttTriggers = (data: ListMqttTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/mqtt_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does mqtt trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean mqtt trigger exists - * @throws ApiError - */ -export const existsMqttTrigger = (data: ExistsMqttTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/mqtt_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled mqtt trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated mqtt trigger enable - * @returns string mqtt trigger enabled set - * @throws ApiError - */ -export const setMqttTriggerEnabled = (data: SetMqttTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/mqtt_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test mqtt connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test mqtt connection - * @returns string successfully connected to mqtt - * @throws ApiError - */ -export const testMqttConnection = (data: TestMqttConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/mqtt_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * create gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new gcp trigger - * @returns string gcp trigger created - * @throws ApiError - */ -export const createGcpTrigger = (data: CreateGcpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/gcp_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string gcp trigger updated - * @throws ApiError - */ -export const updateGcpTrigger = (data: UpdateGcpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/gcp_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string gcp trigger deleted - * @throws ApiError - */ -export const deleteGcpTrigger = (data: DeleteGcpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/gcp_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns GcpTrigger gcp trigger deleted - * @throws ApiError - */ -export const getGcpTrigger = (data: GetGcpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/gcp_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list gcp triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns GcpTrigger gcp trigger list - * @throws ApiError - */ -export const listGcpTriggers = (data: ListGcpTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/gcp_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does gcp trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean gcp trigger exists - * @throws ApiError - */ -export const existsGcpTrigger = (data: ExistsGcpTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/gcp_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated gcp trigger enable - * @returns string gcp trigger enabled set - * @throws ApiError - */ -export const setGcpTriggerEnabled = (data: SetGcpTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/gcp_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test gcp connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test gcp connection - * @returns string try to connect to a gcp broker - * @throws ApiError - */ -export const testGcpConnection = (data: TestGcpConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/gcp_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete gcp trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody args to delete subscription from google cloud - * @returns string gcp trigger deleted - * @throws ApiError - */ -export const deleteGcpSubscription = (data: DeleteGcpSubscriptionData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/gcp_triggers/subscriptions/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list all topics of google cloud service - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string get all google topics - * @throws ApiError - */ -export const listGoogleTopics = (data: ListGoogleTopicsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/gcp_triggers/topics/list/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list all subscription of a give topic from google cloud service - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody args to get subscription's topic from google cloud - * @returns string get all google topic subscriptions name - * @throws ApiError - */ -export const listAllTgoogleTopicSubscriptions = (data: ListAllTgoogleTopicSubscriptionsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/gcp_triggers/subscriptions/list/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * check if postgres configuration is set to logical - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean boolean that indicates if postgres is set to logical level or not - * @throws ApiError - */ -export const isValidPostgresConfiguration = (data: IsValidPostgresConfigurationData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/is_valid_postgres_configuration/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * create template script - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody template script - * @returns string custom id to retrieve template script - * @throws ApiError - */ -export const createTemplateScript = (data: CreateTemplateScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/create_template_script', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get template script - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns string template script - * @throws ApiError - */ -export const getTemplateScript = (data: GetTemplateScriptData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/get_template_script/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * list postgres replication slot - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns SlotList list postgres slot - * @throws ApiError - */ -export const listPostgresReplicationSlot = (data: ListPostgresReplicationSlotData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/slot/list/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * create replication slot for postgres - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody new slot for postgres - * @returns string slot created - * @throws ApiError - */ -export const createPostgresReplicationSlot = (data: CreatePostgresReplicationSlotData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/slot/create/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete postgres replication slot - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody replication slot of postgres - * @returns string postgres replication slot deleted - * @throws ApiError - */ -export const deletePostgresReplicationSlot = (data: DeletePostgresReplicationSlotData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/postgres_triggers/slot/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list postgres publication - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string database publication list - * @throws ApiError - */ -export const listPostgresPublication = (data: ListPostgresPublicationData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/publication/list/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get postgres publication - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.publication - * @returns PublicationData postgres publication get - * @throws ApiError - */ -export const getPostgresPublication = (data: GetPostgresPublicationData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/publication/get/{publication}/{path}', - path: { - workspace: data.workspace, - path: data.path, - publication: data.publication - } -}); }; - -/** - * create publication for postgres - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.publication - * @param data.requestBody new publication for postgres - * @returns string publication created - * @throws ApiError - */ -export const createPostgresPublication = (data: CreatePostgresPublicationData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/publication/create/{publication}/{path}', - path: { - workspace: data.workspace, - path: data.path, - publication: data.publication - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update publication for postgres - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.publication - * @param data.requestBody update publication for postgres - * @returns string publication updated - * @throws ApiError - */ -export const updatePostgresPublication = (data: UpdatePostgresPublicationData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/publication/update/{publication}/{path}', - path: { - workspace: data.workspace, - path: data.path, - publication: data.publication - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete postgres publication - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.publication - * @returns string postgres publication deleted - * @throws ApiError - */ -export const deletePostgresPublication = (data: DeletePostgresPublicationData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/postgres_triggers/publication/delete/{publication}/{path}', - path: { - workspace: data.workspace, - path: data.path, - publication: data.publication - } -}); }; - -/** - * create postgres trigger - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody new postgres trigger - * @returns string postgres trigger created - * @throws ApiError - */ -export const createPostgresTrigger = (data: CreatePostgresTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update postgres trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated trigger - * @returns string postgres trigger updated - * @throws ApiError - */ -export const updatePostgresTrigger = (data: UpdatePostgresTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/update/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete postgres trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns string postgres trigger deleted - * @throws ApiError - */ -export const deletePostgresTrigger = (data: DeletePostgresTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/postgres_triggers/delete/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * get postgres trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns PostgresTrigger get postgres trigger - * @throws ApiError - */ -export const getPostgresTrigger = (data: GetPostgresTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/get/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * list postgres triggers - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.path filter by path - * @param data.isFlow - * @param data.pathStart - * @returns PostgresTrigger postgres trigger list - * @throws ApiError - */ -export const listPostgresTriggers = (data: ListPostgresTriggersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage, - path: data.path, - is_flow: data.isFlow, - path_start: data.pathStart - } -}); }; - -/** - * does postgres trigger exists - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @returns boolean postgres trigger exists - * @throws ApiError - */ -export const existsPostgresTrigger = (data: ExistsPostgresTriggerData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/postgres_triggers/exists/{path}', - path: { - workspace: data.workspace, - path: data.path - } -}); }; - -/** - * set enabled postgres trigger - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.requestBody updated postgres trigger enable - * @returns string postgres trigger enabled set - * @throws ApiError - */ -export const setPostgresTriggerEnabled = (data: SetPostgresTriggerEnabledData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/setenabled/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * test postgres connection - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody test postgres connection - * @returns string successfuly connected to postgres - * @throws ApiError - */ -export const testPostgresConnection = (data: TestPostgresConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/postgres_triggers/test', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list instance groups - * @returns InstanceGroup instance group list - * @throws ApiError - */ -export const listInstanceGroups = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/groups/list' -}); }; - -/** - * get instance group - * @param data The data for the request. - * @param data.name - * @returns InstanceGroup instance group - * @throws ApiError - */ -export const getInstanceGroup = (data: GetInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/groups/get/{name}', - path: { - name: data.name - } -}); }; - -/** - * create instance group - * @param data The data for the request. - * @param data.requestBody create instance group - * @returns string instance group created - * @throws ApiError - */ -export const createInstanceGroup = (data: CreateInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/groups/create', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update instance group - * @param data The data for the request. - * @param data.name - * @param data.requestBody update instance group - * @returns string instance group updated - * @throws ApiError - */ -export const updateInstanceGroup = (data: UpdateInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/groups/update/{name}', - path: { - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete instance group - * @param data The data for the request. - * @param data.name - * @returns string instance group deleted - * @throws ApiError - */ -export const deleteInstanceGroup = (data: DeleteInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/groups/delete/{name}', - path: { - name: data.name - } -}); }; - -/** - * add user to instance group - * @param data The data for the request. - * @param data.name - * @param data.requestBody user to add to instance group - * @returns string user added to instance group - * @throws ApiError - */ -export const addUserToInstanceGroup = (data: AddUserToInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/groups/adduser/{name}', - path: { - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * remove user from instance group - * @param data The data for the request. - * @param data.name - * @param data.requestBody user to remove from instance group - * @returns string user removed from instance group - * @throws ApiError - */ -export const removeUserFromInstanceGroup = (data: RemoveUserFromInstanceGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/groups/removeuser/{name}', - path: { - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * export instance groups - * @returns ExportedInstanceGroup exported instance groups - * @throws ApiError - */ -export const exportInstanceGroups = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/groups/export' -}); }; - -/** - * overwrite instance groups - * @param data The data for the request. - * @param data.requestBody overwrite instance groups - * @returns string success message - * @throws ApiError - */ -export const overwriteInstanceGroups = (data: OverwriteInstanceGroupsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/groups/overwrite', - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list groups - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns Group group list - * @throws ApiError - */ -export const listGroups = (data: ListGroupsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/groups/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * list group names - * @param data The data for the request. - * @param data.workspace - * @param data.onlyMemberOf only list the groups the user is member of (default false) - * @returns string group list - * @throws ApiError - */ -export const listGroupNames = (data: ListGroupNamesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/groups/listnames', - path: { - workspace: data.workspace - }, - query: { - only_member_of: data.onlyMemberOf - } -}); }; - -/** - * create group - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody create group - * @returns string group created - * @throws ApiError - */ -export const createGroup = (data: CreateGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/groups/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update group - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody updated group - * @returns string group updated - * @throws ApiError - */ -export const updateGroup = (data: UpdateGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/groups/update/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete group - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns string group deleted - * @throws ApiError - */ -export const deleteGroup = (data: DeleteGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/groups/delete/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * get group - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns Group group - * @throws ApiError - */ -export const getGroup = (data: GetGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/groups/get/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * add user to group - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody added user to group - * @returns string user added to group - * @throws ApiError - */ -export const addUserToGroup = (data: AddUserToGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/groups/adduser/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * remove user to group - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody added user to group - * @returns string user removed from group - * @throws ApiError - */ -export const removeUserToGroup = (data: RemoveUserToGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/groups/removeuser/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list folders - * @param data The data for the request. - * @param data.workspace - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns Folder folder list - * @throws ApiError - */ -export const listFolders = (data: ListFoldersData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/folders/list', - path: { - workspace: data.workspace - }, - query: { - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * list folder names - * @param data The data for the request. - * @param data.workspace - * @param data.onlyMemberOf only list the folders the user is member of (default false) - * @returns string folder list - * @throws ApiError - */ -export const listFolderNames = (data: ListFolderNamesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/folders/listnames', - path: { - workspace: data.workspace - }, - query: { - only_member_of: data.onlyMemberOf - } -}); }; - -/** - * create folder - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody create folder - * @returns string folder created - * @throws ApiError - */ -export const createFolder = (data: CreateFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/folders/create', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * update folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody update folder - * @returns string folder updated - * @throws ApiError - */ -export const updateFolder = (data: UpdateFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/folders/update/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * delete folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns string folder deleted - * @throws ApiError - */ -export const deleteFolder = (data: DeleteFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/folders/delete/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * get folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns Folder folder - * @throws ApiError - */ -export const getFolder = (data: GetFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/folders/get/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * exists folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns boolean folder exists - * @throws ApiError - */ -export const existsFolder = (data: ExistsFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/folders/exists/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * get folder usage - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @returns unknown folder - * @throws ApiError - */ -export const getFolderUsage = (data: GetFolderUsageData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/folders/getusage/{name}', - path: { - workspace: data.workspace, - name: data.name - } -}); }; - -/** - * add owner to folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody owner user to folder - * @returns string owner added to folder - * @throws ApiError - */ -export const addOwnerToFolder = (data: AddOwnerToFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/folders/addowner/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * remove owner to folder - * @param data The data for the request. - * @param data.workspace - * @param data.name - * @param data.requestBody added owner to folder - * @returns string owner removed from folder - * @throws ApiError - */ -export const removeOwnerToFolder = (data: RemoveOwnerToFolderData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/folders/removeowner/{name}', - path: { - workspace: data.workspace, - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * list workers - * @param data The data for the request. - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.pingSince number of seconds the worker must have had a last ping more recent of (default to 300) - * @returns WorkerPing a list of workers - * @throws ApiError - */ -export const listWorkers = (data: ListWorkersData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/list', - query: { - page: data.page, - per_page: data.perPage, - ping_since: data.pingSince - } -}); }; - -/** - * exists worker with tag - * @param data The data for the request. - * @param data.tag - * @returns boolean whether a worker with the tag exists - * @throws ApiError - */ -export const existsWorkerWithTag = (data: ExistsWorkerWithTagData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/exists_worker_with_tag', - query: { - tag: data.tag - } -}); }; - -/** - * get queue metrics - * @returns unknown metrics - * @throws ApiError - */ -export const getQueueMetrics = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/queue_metrics' -}); }; - -/** - * get counts of jobs waiting for an executor per tag - * @returns number queue counts - * @throws ApiError - */ -export const getCountsOfJobsWaitingPerTag = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/workers/queue_counts' -}); }; - -/** - * list worker groups - * @returns unknown a list of worker group configs - * @throws ApiError - */ -export const listWorkerGroups = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/configs/list_worker_groups' -}); }; - -/** - * get config - * @param data The data for the request. - * @param data.name - * @returns unknown a config - * @throws ApiError - */ -export const getConfig = (data: GetConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/configs/get/{name}', - path: { - name: data.name - } -}); }; - -/** - * Update config - * @param data The data for the request. - * @param data.name - * @param data.requestBody worker group - * @returns string Update a worker group - * @throws ApiError - */ -export const updateConfig = (data: UpdateConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/configs/update/{name}', - path: { - name: data.name - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Delete Config - * @param data The data for the request. - * @param data.name - * @returns string Delete config - * @throws ApiError - */ -export const deleteConfig = (data: DeleteConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/configs/update/{name}', - path: { - name: data.name - } -}); }; - -/** - * list configs - * @returns Config list of configs - * @throws ApiError - */ -export const listConfigs = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/configs/list' -}); }; - -/** - * List autoscaling events - * @param data The data for the request. - * @param data.workerGroup - * @returns AutoscalingEvent List of autoscaling events - * @throws ApiError - */ -export const listAutoscalingEvents = (data: ListAutoscalingEventsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/configs/list_autoscaling_events/{worker_group}', - path: { - worker_group: data.workerGroup - } -}); }; - -/** - * get granular acls - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.kind - * @returns boolean acls - * @throws ApiError - */ -export const getGranularAcls = (data: GetGranularAclsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/acls/get/{kind}/{path}', - path: { - workspace: data.workspace, - path: data.path, - kind: data.kind - } -}); }; - -/** - * add granular acls - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.kind - * @param data.requestBody acl to add - * @returns string granular acl added - * @throws ApiError - */ -export const addGranularAcls = (data: AddGranularAclsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/acls/add/{kind}/{path}', - path: { - workspace: data.workspace, - path: data.path, - kind: data.kind - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * remove granular acls - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.kind - * @param data.requestBody acl to add - * @returns string granular acl removed - * @throws ApiError - */ -export const removeGranularAcls = (data: RemoveGranularAclsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/acls/remove/{kind}/{path}', - path: { - workspace: data.workspace, - path: data.path, - kind: data.kind - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set capture config - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody capture config - * @returns unknown capture config set - * @throws ApiError - */ -export const setCaptureConfig = (data: SetCaptureConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/capture/set_config', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * ping capture config - * @param data The data for the request. - * @param data.workspace - * @param data.triggerKind - * @param data.runnableKind - * @param data.path - * @returns unknown capture config pinged - * @throws ApiError - */ -export const pingCaptureConfig = (data: PingCaptureConfigData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/capture/ping_config/{trigger_kind}/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - trigger_kind: data.triggerKind, - runnable_kind: data.runnableKind, - path: data.path - } -}); }; - -/** - * get capture configs for a script or flow - * @param data The data for the request. - * @param data.workspace - * @param data.runnableKind - * @param data.path - * @returns CaptureConfig capture configs for a script or flow - * @throws ApiError - */ -export const getCaptureConfigs = (data: GetCaptureConfigsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/capture/get_configs/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - runnable_kind: data.runnableKind, - path: data.path - } -}); }; - -/** - * list captures for a script or flow - * @param data The data for the request. - * @param data.workspace - * @param data.runnableKind - * @param data.path - * @param data.triggerKind - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns Capture list of captures for a script or flow - * @throws ApiError - */ -export const listCaptures = (data: ListCapturesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/capture/list/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - runnable_kind: data.runnableKind, - path: data.path - }, - query: { - trigger_kind: data.triggerKind, - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * move captures and configs for a script or flow - * @param data The data for the request. - * @param data.workspace - * @param data.runnableKind - * @param data.path - * @param data.requestBody move captures and configs to a new path - * @returns string captures and configs moved - * @throws ApiError - */ -export const moveCapturesAndConfigs = (data: MoveCapturesAndConfigsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/capture/move/{runnable_kind}/{path}', - path: { - workspace: data.workspace, - runnable_kind: data.runnableKind, - path: data.path - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get a capture - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns Capture capture - * @throws ApiError - */ -export const getCapture = (data: GetCaptureData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/capture/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * delete a capture - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns unknown capture deleted - * @throws ApiError - */ -export const deleteCapture = (data: DeleteCaptureData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/capture/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * star item - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns unknown star item - * @throws ApiError - */ -export const star = (data: StarData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/favorites/star', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * unstar item - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody - * @returns unknown unstar item - * @throws ApiError - */ -export const unstar = (data: UnstarData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/favorites/unstar', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * List Inputs used in previously completed jobs - * @param data The data for the request. - * @param data.workspace - * @param data.runnableId - * @param data.runnableType - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.includePreview - * @returns Input Input history for completed jobs - * @throws ApiError - */ -export const getInputHistory = (data: GetInputHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/inputs/history', - path: { - workspace: data.workspace - }, - query: { - runnable_id: data.runnableId, - runnable_type: data.runnableType, - page: data.page, - per_page: data.perPage, - args: data.args, - include_preview: data.includePreview - } -}); }; - -/** - * Get args from history or saved input - * @param data The data for the request. - * @param data.workspace - * @param data.jobOrInputId - * @param data.input - * @param data.allowLarge - * @returns unknown args - * @throws ApiError - */ -export const getArgsFromHistoryOrSavedInput = (data: GetArgsFromHistoryOrSavedInputData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/inputs/{jobOrInputId}/args', - path: { - workspace: data.workspace, - jobOrInputId: data.jobOrInputId - }, - query: { - input: data.input, - allow_large: data.allowLarge - } -}); }; - -/** - * List saved Inputs for a Runnable - * @param data The data for the request. - * @param data.workspace - * @param data.runnableId - * @param data.runnableType - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @returns Input Saved Inputs for a Runnable - * @throws ApiError - */ -export const listInputs = (data: ListInputsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/inputs/list', - path: { - workspace: data.workspace - }, - query: { - runnable_id: data.runnableId, - runnable_type: data.runnableType, - page: data.page, - per_page: data.perPage - } -}); }; - -/** - * Create an Input for future use in a script or flow - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody Input - * @param data.runnableId - * @param data.runnableType - * @returns string Input created - * @throws ApiError - */ -export const createInput = (data: CreateInputData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/inputs/create', - path: { - workspace: data.workspace - }, - query: { - runnable_id: data.runnableId, - runnable_type: data.runnableType - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Update an Input - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody UpdateInput - * @returns string Input updated - * @throws ApiError - */ -export const updateInput = (data: UpdateInputData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/inputs/update', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Delete a Saved Input - * @param data The data for the request. - * @param data.workspace - * @param data.input - * @returns string Input deleted - * @throws ApiError - */ -export const deleteInput = (data: DeleteInputData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/inputs/delete/{input}', - path: { - workspace: data.workspace, - input: data.input - } -}); }; - -/** - * Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody S3 resource to connect to - * @returns unknown Connection settings - * @throws ApiError - */ -export const duckdbConnectionSettings = (data: DuckdbConnectionSettingsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/duckdb_connection_settings', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Converts an S3 resource to the set of instructions necessary to connect DuckDB to an S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used - * @returns unknown Connection settings - * @throws ApiError - */ -export const duckdbConnectionSettingsV2 = (data: DuckdbConnectionSettingsV2Data): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/v2/duckdb_connection_settings', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody S3 resource to connect to - * @returns unknown Connection settings - * @throws ApiError - */ -export const polarsConnectionSettings = (data: PolarsConnectionSettingsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/polars_connection_settings', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Converts an S3 resource to the set of arguments necessary to connect Polars to an S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody S3 resource path to use to generate the connection settings. If empty, the S3 resource defined in the workspace settings will be used - * @returns unknown Connection settings - * @throws ApiError - */ -export const polarsConnectionSettingsV2 = (data: PolarsConnectionSettingsV2Data): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/v2/polars_connection_settings', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Returns the s3 resource associated to the provided path, or the workspace default S3 resource - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody S3 resource path to use. If empty, the S3 resource defined in the workspace settings will be used - * @returns S3Resource Connection settings - * @throws ApiError - */ -export const s3ResourceInfo = (data: S3ResourceInfoData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/v2/s3_resource_info', - path: { - workspace: data.workspace - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * Test connection to the workspace object storage - * @param data The data for the request. - * @param data.workspace - * @param data.storage - * @returns unknown Connection settings - * @throws ApiError - */ -export const datasetStorageTestConnection = (data: DatasetStorageTestConnectionData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/test_connection', - path: { - workspace: data.workspace - }, - query: { - storage: data.storage - } -}); }; - -/** - * List the file keys available in a workspace object storage - * @param data The data for the request. - * @param data.workspace - * @param data.maxKeys - * @param data.marker - * @param data.prefix - * @param data.storage - * @returns unknown List of file keys - * @throws ApiError - */ -export const listStoredFiles = (data: ListStoredFilesData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/list_stored_files', - path: { - workspace: data.workspace - }, - query: { - max_keys: data.maxKeys, - marker: data.marker, - prefix: data.prefix, - storage: data.storage - } -}); }; - -/** - * Load metadata of the file - * @param data The data for the request. - * @param data.workspace - * @param data.fileKey - * @param data.storage - * @returns WindmillFileMetadata FileMetadata - * @throws ApiError - */ -export const loadFileMetadata = (data: LoadFileMetadataData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/load_file_metadata', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - storage: data.storage - } -}); }; - -/** - * Load a preview of the file - * @param data The data for the request. - * @param data.workspace - * @param data.fileKey - * @param data.fileSizeInBytes - * @param data.fileMimeType - * @param data.csvSeparator - * @param data.csvHasHeader - * @param data.readBytesFrom - * @param data.readBytesLength - * @param data.storage - * @returns WindmillFilePreview FilePreview - * @throws ApiError - */ -export const loadFilePreview = (data: LoadFilePreviewData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/load_file_preview', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - file_size_in_bytes: data.fileSizeInBytes, - file_mime_type: data.fileMimeType, - csv_separator: data.csvSeparator, - csv_has_header: data.csvHasHeader, - read_bytes_from: data.readBytesFrom, - read_bytes_length: data.readBytesLength, - storage: data.storage - } -}); }; - -/** - * Load a preview of a parquet file - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.offset - * @param data.limit - * @param data.sortCol - * @param data.sortDesc - * @param data.searchCol - * @param data.searchTerm - * @param data.storage - * @returns unknown Parquet Preview - * @throws ApiError - */ -export const loadParquetPreview = (data: LoadParquetPreviewData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/load_parquet_preview/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - offset: data.offset, - limit: data.limit, - sort_col: data.sortCol, - sort_desc: data.sortDesc, - search_col: data.searchCol, - search_term: data.searchTerm, - storage: data.storage - } -}); }; - -/** - * Load the table row count - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.searchCol - * @param data.searchTerm - * @param data.storage - * @returns unknown Table count - * @throws ApiError - */ -export const loadTableRowCount = (data: LoadTableRowCountData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/load_table_count/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - search_col: data.searchCol, - search_term: data.searchTerm, - storage: data.storage - } -}); }; - -/** - * Load a preview of a csv file - * @param data The data for the request. - * @param data.workspace - * @param data.path - * @param data.offset - * @param data.limit - * @param data.sortCol - * @param data.sortDesc - * @param data.searchCol - * @param data.searchTerm - * @param data.storage - * @param data.csvSeparator - * @returns unknown Csv Preview - * @throws ApiError - */ -export const loadCsvPreview = (data: LoadCsvPreviewData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/load_csv_preview/{path}', - path: { - workspace: data.workspace, - path: data.path - }, - query: { - offset: data.offset, - limit: data.limit, - sort_col: data.sortCol, - sort_desc: data.sortDesc, - search_col: data.searchCol, - search_term: data.searchTerm, - storage: data.storage, - csv_separator: data.csvSeparator - } -}); }; - -/** - * Permanently delete file from S3 - * @param data The data for the request. - * @param data.workspace - * @param data.fileKey - * @param data.storage - * @returns unknown Confirmation - * @throws ApiError - */ -export const deleteS3File = (data: DeleteS3FileData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/w/{workspace}/job_helpers/delete_s3_file', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - storage: data.storage - } -}); }; - -/** - * Move a S3 file from one path to the other within the same bucket - * @param data The data for the request. - * @param data.workspace - * @param data.srcFileKey - * @param data.destFileKey - * @param data.storage - * @returns unknown Confirmation - * @throws ApiError - */ -export const moveS3File = (data: MoveS3FileData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/move_s3_file', - path: { - workspace: data.workspace - }, - query: { - src_file_key: data.srcFileKey, - dest_file_key: data.destFileKey, - storage: data.storage - } -}); }; - -/** - * Upload file to S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.requestBody File content - * @param data.fileKey - * @param data.fileExtension - * @param data.s3ResourcePath - * @param data.resourceType - * @param data.storage - * @param data.contentType - * @param data.contentDisposition - * @returns unknown File upload status - * @throws ApiError - */ -export const fileUpload = (data: FileUploadData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_helpers/upload_s3_file', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - file_extension: data.fileExtension, - s3_resource_path: data.s3ResourcePath, - resource_type: data.resourceType, - storage: data.storage, - content_type: data.contentType, - content_disposition: data.contentDisposition - }, - body: data.requestBody, - mediaType: 'application/octet-stream' -}); }; - -/** - * Download file from S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.fileKey - * @param data.s3ResourcePath - * @param data.resourceType - * @param data.storage - * @returns binary Chunk of the downloaded file - * @throws ApiError - */ -export const fileDownload = (data: FileDownloadData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/download_s3_file', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - s3_resource_path: data.s3ResourcePath, - resource_type: data.resourceType, - storage: data.storage - } -}); }; - -/** - * Download file to S3 bucket - * @param data The data for the request. - * @param data.workspace - * @param data.fileKey - * @param data.s3ResourcePath - * @param data.resourceType - * @returns string The downloaded file - * @throws ApiError - */ -export const fileDownloadParquetAsCsv = (data: FileDownloadParquetAsCsvData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_helpers/download_s3_parquet_file_as_csv', - path: { - workspace: data.workspace - }, - query: { - file_key: data.fileKey, - s3_resource_path: data.s3ResourcePath, - resource_type: data.resourceType - } -}); }; - -/** - * get job metrics - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody parameters for statistics retrieval - * @returns unknown job details - * @throws ApiError - */ -export const getJobMetrics = (data: GetJobMetricsData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_metrics/get/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * set job metrics - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @param data.requestBody parameters for statistics retrieval - * @returns unknown Job progress updated - * @throws ApiError - */ -export const setJobProgress = (data: SetJobProgressData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/w/{workspace}/job_metrics/set_progress/{id}', - path: { - workspace: data.workspace, - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json' -}); }; - -/** - * get job progress - * @param data The data for the request. - * @param data.workspace - * @param data.id - * @returns number job progress between 0 and 99 - * @throws ApiError - */ -export const getJobProgress = (data: GetJobProgressData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/job_metrics/get_progress/{id}', - path: { - workspace: data.workspace, - id: data.id - } -}); }; - -/** - * list log files ordered by timestamp - * @param data The data for the request. - * @param data.before filter on started before (inclusive) timestamp - * @param data.after filter on created after (exclusive) timestamp - * @param data.withError - * @returns unknown time - * @throws ApiError - */ -export const listLogFiles = (data: ListLogFilesData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/service_logs/list_files', - query: { - before: data.before, - after: data.after, - with_error: data.withError - } -}); }; - -/** - * get log file by path - * @param data The data for the request. - * @param data.path - * @returns string log stream - * @throws ApiError - */ -export const getLogFile = (data: GetLogFileData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/service_logs/get_log_file/{path}', - path: { - path: data.path - } -}); }; - -/** - * List all concurrency groups - * @returns ConcurrencyGroup all concurrency groups - * @throws ApiError - */ -export const listConcurrencyGroups = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/concurrency_groups/list' -}); }; - -/** - * Delete concurrency group - * @param data The data for the request. - * @param data.concurrencyId - * @returns unknown concurrency group removed - * @throws ApiError - */ -export const deleteConcurrencyGroup = (data: DeleteConcurrencyGroupData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/concurrency_groups/prune/{concurrency_id}', - path: { - concurrency_id: data.concurrencyId - } -}); }; - -/** - * Get the concurrency key for a job that has concurrency limits enabled - * @param data The data for the request. - * @param data.id - * @returns string concurrency key for given job - * @throws ApiError - */ -export const getConcurrencyKey = (data: GetConcurrencyKeyData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/concurrency_groups/{id}/key', - path: { - id: data.id - } -}); }; - -/** - * Get intervals of job runtime concurrency - * @param data The data for the request. - * @param data.workspace - * @param data.concurrencyKey - * @param data.rowLimit - * @param data.createdBy mask to filter exact matching user creator - * @param data.label mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') - * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any - * @param data.scriptPathExact mask to filter exact matching path - * @param data.scriptPathStart mask to filter matching starting path - * @param data.schedulePath mask to filter by schedule path - * @param data.scriptHash mask to filter exact matching path - * @param data.startedBefore filter on started before (inclusive) timestamp - * @param data.startedAfter filter on started after (exclusive) timestamp - * @param data.createdOrStartedBefore filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp - * @param data.running filter on running jobs - * @param data.scheduledForBeforeNow filter on jobs scheduled_for before now (hence waitinf for a worker) - * @param data.createdOrStartedAfter filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp - * @param data.createdOrStartedAfterCompletedJobs filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs - * @param data.jobKinds filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - * @param data.args filter on jobs containing those args as a json subset (@> in postgres) - * @param data.tag filter on jobs with a given tag/worker group - * @param data.result filter on jobs containing those result as a json subset (@> in postgres) - * @param data.allowWildcards allow wildcards (*) in the filter of label, tag, worker - * @param data.page which page to return (start at 1, default 1) - * @param data.perPage number of items to return for a given page (default 30, max 100) - * @param data.isSkipped is the job skipped - * @param data.isFlowStep is the job a flow step - * @param data.hasNullParent has null parent - * @param data.success filter on successful jobs - * @param data.allWorkspaces get jobs from all workspaces (only valid if request come from the `admins` workspace) - * @param data.isNotSchedule is not a scheduled job - * @returns ExtendedJobs time - * @throws ApiError - */ -export const listExtendedJobs = (data: ListExtendedJobsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/w/{workspace}/concurrency_groups/list_jobs', - path: { - workspace: data.workspace - }, - query: { - concurrency_key: data.concurrencyKey, - row_limit: data.rowLimit, - created_by: data.createdBy, - label: data.label, - parent_job: data.parentJob, - script_path_exact: data.scriptPathExact, - script_path_start: data.scriptPathStart, - schedule_path: data.schedulePath, - script_hash: data.scriptHash, - started_before: data.startedBefore, - started_after: data.startedAfter, - created_or_started_before: data.createdOrStartedBefore, - running: data.running, - scheduled_for_before_now: data.scheduledForBeforeNow, - created_or_started_after: data.createdOrStartedAfter, - created_or_started_after_completed_jobs: data.createdOrStartedAfterCompletedJobs, - job_kinds: data.jobKinds, - args: data.args, - tag: data.tag, - result: data.result, - allow_wildcards: data.allowWildcards, - page: data.page, - per_page: data.perPage, - is_skipped: data.isSkipped, - is_flow_step: data.isFlowStep, - has_null_parent: data.hasNullParent, - success: data.success, - all_workspaces: data.allWorkspaces, - is_not_schedule: data.isNotSchedule - } -}); }; - -/** - * Search through jobs with a string query - * @param data The data for the request. - * @param data.workspace - * @param data.searchQuery - * @returns unknown search results - * @throws ApiError - */ -export const searchJobsIndex = (data: SearchJobsIndexData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/srch/w/{workspace}/index/search/job', - path: { - workspace: data.workspace - }, - query: { - search_query: data.searchQuery - } -}); }; - -/** - * Search through service logs with a string query - * @param data The data for the request. - * @param data.searchQuery - * @param data.mode - * @param data.hostname - * @param data.workerGroup - * @param data.minTs - * @param data.maxTs - * @returns unknown search results - * @throws ApiError - */ -export const searchLogsIndex = (data: SearchLogsIndexData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/srch/index/search/service_logs', - query: { - search_query: data.searchQuery, - mode: data.mode, - worker_group: data.workerGroup, - hostname: data.hostname, - min_ts: data.minTs, - max_ts: data.maxTs - } -}); }; - -/** - * Search and count the log line hits on every provided host - * @param data The data for the request. - * @param data.searchQuery - * @param data.minTs - * @param data.maxTs - * @returns unknown search results - * @throws ApiError - */ -export const countSearchLogsIndex = (data: CountSearchLogsIndexData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/srch/index/search/count_service_logs', - query: { - search_query: data.searchQuery, - min_ts: data.minTs, - max_ts: data.maxTs - } -}); }; - -/** - * Restart container and delete the index to recreate it. - * @param data The data for the request. - * @param data.idxName - * @returns string idx to be deleted and container restarting - * @throws ApiError - */ -export const clearIndex = (data: ClearIndexData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/srch/index/delete/{idx_name}', - path: { - idx_name: data.idxName - } -}); }; \ No newline at end of file diff --git a/cli/gen/types.gen.ts b/cli/gen/types.gen.ts deleted file mode 100644 index a7924d0b90..0000000000 --- a/cli/gen/types.gen.ts +++ /dev/null @@ -1,7828 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export type AIProvider = 'openai' | 'azure_openai' | 'anthropic' | 'mistral' | 'deepseek' | 'googleai' | 'groq' | 'openrouter' | 'togetherai' | 'customai'; - -export type AIProviderModel = { - model: string; - provider: AIProvider; -}; - -export type AIProviderConfig = { - resource_path: string; - models: Array<(string)>; -}; - -export type AIConfig = { - providers?: { - [key: string]: AIProviderConfig; - }; - default_model?: AIProviderModel; - code_completion_model?: AIProviderModel; -}; - -export type Script = { - workspace_id?: string; - hash: string; - path: string; - /** - * The first element is the direct parent of the script, the second is the parent of the first, etc - * - */ - parent_hashes?: Array<(string)>; - summary: string; - description: string; - content: string; - created_by: string; - created_at: string; - archived: boolean; - schema?: { - [key: string]: unknown; - }; - deleted: boolean; - is_template: boolean; - extra_perms: { - [key: string]: (boolean); - }; - lock?: string; - lock_error_logs?: string; - language: ScriptLang; - kind: 'script' | 'failure' | 'trigger' | 'command' | 'approval' | 'preprocessor'; - starred: boolean; - tag?: string; - has_draft?: boolean; - draft_only?: boolean; - envs?: Array<(string)>; - concurrent_limit?: number; - concurrency_time_window_s?: number; - concurrency_key?: string; - cache_ttl?: number; - dedicated_worker?: boolean; - ws_error_handler_muted?: boolean; - priority?: number; - restart_unless_cancelled?: boolean; - timeout?: number; - delete_after_use?: boolean; - visible_to_runner_only?: boolean; - no_main_func: boolean; - codebase?: string; - has_preprocessor: boolean; - on_behalf_of_email?: string; -}; - -export type kind = 'script' | 'failure' | 'trigger' | 'command' | 'approval' | 'preprocessor'; - -export type NewScript = { - path: string; - parent_hash?: string; - summary: string; - description: string; - content: string; - schema?: { - [key: string]: unknown; - }; - is_template?: boolean; - lock?: string; - language: ScriptLang; - kind?: 'script' | 'failure' | 'trigger' | 'command' | 'approval' | 'preprocessor'; - tag?: string; - draft_only?: boolean; - envs?: Array<(string)>; - concurrent_limit?: number; - concurrency_time_window_s?: number; - cache_ttl?: number; - dedicated_worker?: boolean; - ws_error_handler_muted?: boolean; - priority?: number; - restart_unless_cancelled?: boolean; - timeout?: number; - delete_after_use?: boolean; - deployment_message?: string; - concurrency_key?: string; - visible_to_runner_only?: boolean; - no_main_func?: boolean; - codebase?: string; - has_preprocessor?: boolean; - on_behalf_of_email?: string; -}; - -export type NewScriptWithDraft = NewScript & { - draft?: NewScript; - hash: string; -}; - -export type ScriptHistory = { - script_hash: string; - deployment_msg?: string; -}; - -export type ScriptArgs = { - [key: string]: unknown; -}; - -export type Input = { - id: string; - name: string; - created_by: string; - created_at: string; - is_public: boolean; - success?: boolean; -}; - -export type CreateInput = { - name: string; - args: { - [key: string]: unknown; - }; -}; - -export type UpdateInput = { - id: string; - name: string; - is_public: boolean; -}; - -export type RunnableType = 'ScriptHash' | 'ScriptPath' | 'FlowPath'; - -export type QueuedJob = { - workspace_id?: string; - id: string; - parent_job?: string; - created_by?: string; - created_at?: string; - started_at?: string; - scheduled_for?: string; - running: boolean; - script_path?: string; - script_hash?: string; - args?: ScriptArgs; - logs?: string; - raw_code?: string; - canceled: boolean; - canceled_by?: string; - canceled_reason?: string; - last_ping?: string; - job_kind: 'script' | 'preview' | 'dependencies' | 'flowdependencies' | 'appdependencies' | 'flow' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow' | 'flowscript' | 'flownode' | 'appscript'; - schedule_path?: string; - /** - * The user (u/userfoo) or group (g/groupfoo) whom - * the execution of this script will be permissioned_as and by extension its DT_TOKEN. - * - */ - permissioned_as: string; - flow_status?: FlowStatus; - raw_flow?: FlowValue; - is_flow_step: boolean; - language?: ScriptLang; - email: string; - visible_to_owner: boolean; - mem_peak?: number; - tag: string; - priority?: number; - self_wait_time_ms?: number; - aggregate_wait_time_ms?: number; - suspend?: number; - preprocessed?: boolean; - worker?: string; -}; - -export type job_kind = 'script' | 'preview' | 'dependencies' | 'flowdependencies' | 'appdependencies' | 'flow' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow' | 'flowscript' | 'flownode' | 'appscript'; - -export type CompletedJob = { - workspace_id?: string; - id: string; - parent_job?: string; - created_by: string; - created_at: string; - started_at: string; - duration_ms: number; - success: boolean; - script_path?: string; - script_hash?: string; - args?: ScriptArgs; - result?: unknown; - logs?: string; - deleted?: boolean; - raw_code?: string; - canceled: boolean; - canceled_by?: string; - canceled_reason?: string; - job_kind: 'script' | 'preview' | 'dependencies' | 'flow' | 'flowdependencies' | 'appdependencies' | 'flowpreview' | 'script_hub' | 'identity' | 'deploymentcallback' | 'singlescriptflow' | 'flowscript' | 'flownode' | 'appscript'; - schedule_path?: string; - /** - * The user (u/userfoo) or group (g/groupfoo) whom - * the execution of this script will be permissioned_as and by extension its DT_TOKEN. - * - */ - permissioned_as: string; - flow_status?: FlowStatus; - raw_flow?: FlowValue; - is_flow_step: boolean; - language?: ScriptLang; - is_skipped: boolean; - email: string; - visible_to_owner: boolean; - mem_peak?: number; - tag: string; - priority?: number; - labels?: Array<(string)>; - self_wait_time_ms?: number; - aggregate_wait_time_ms?: number; - preprocessed?: boolean; - worker?: string; -}; - -export type ObscuredJob = { - typ?: string; - started_at?: string; - duration_ms?: number; -}; - -export type Job = (CompletedJob & { - type?: 'CompletedJob'; -}) | (QueuedJob & { - type?: 'QueuedJob'; -}); - -export type type = 'CompletedJob'; - -export type User = { - email: string; - username: string; - is_admin: boolean; - name?: string; - is_super_admin: boolean; - created_at: string; - operator: boolean; - disabled: boolean; - groups?: Array<(string)>; - folders: Array<(string)>; - folders_owners: Array<(string)>; -}; - -export type UserUsage = { - email?: string; - executions?: number; -}; - -export type Login = { - email: string; - password: string; -}; - -export type EditWorkspaceUser = { - is_admin?: boolean; - operator?: boolean; - disabled?: boolean; -}; - -export type TruncatedToken = { - label?: string; - expiration?: string; - token_prefix: string; - created_at: string; - last_used_at: string; - scopes?: Array<(string)>; - email?: string; -}; - -export type NewToken = { - label?: string; - expiration?: string; - scopes?: Array<(string)>; - workspace_id?: string; -}; - -export type NewTokenImpersonate = { - label?: string; - expiration?: string; - impersonate_email: string; - workspace_id?: string; -}; - -export type ListableVariable = { - workspace_id: string; - path: string; - value?: string; - is_secret: boolean; - description?: string; - account?: number; - is_oauth?: boolean; - extra_perms: { - [key: string]: (boolean); - }; - is_expired?: boolean; - refresh_error?: string; - is_linked?: boolean; - is_refreshed?: boolean; - expires_at?: string; -}; - -export type ContextualVariable = { - name: string; - value: string; - description: string; - is_custom: boolean; -}; - -export type CreateVariable = { - path: string; - value: string; - is_secret: boolean; - description: string; - account?: number; - is_oauth?: boolean; - expires_at?: string; -}; - -export type EditVariable = { - path?: string; - value?: string; - is_secret?: boolean; - description?: string; -}; - -export type AuditLog = { - id: number; - timestamp: string; - username: string; - operation: 'jobs.run' | 'jobs.run.script' | 'jobs.run.preview' | 'jobs.run.flow' | 'jobs.run.flow_preview' | 'jobs.run.script_hub' | 'jobs.run.dependencies' | 'jobs.run.identity' | 'jobs.run.noop' | 'jobs.flow_dependencies' | 'jobs' | 'jobs.cancel' | 'jobs.force_cancel' | 'jobs.disapproval' | 'jobs.delete' | 'account.delete' | 'ai.request' | 'resources.create' | 'resources.update' | 'resources.delete' | 'resource_types.create' | 'resource_types.update' | 'resource_types.delete' | 'schedule.create' | 'schedule.setenabled' | 'schedule.edit' | 'schedule.delete' | 'scripts.create' | 'scripts.update' | 'scripts.archive' | 'scripts.delete' | 'users.create' | 'users.delete' | 'users.update' | 'users.login' | 'users.login_failure' | 'users.logout' | 'users.accept_invite' | 'users.decline_invite' | 'users.token.create' | 'users.token.delete' | 'users.add_to_workspace' | 'users.add_global' | 'users.setpassword' | 'users.impersonate' | 'users.leave_workspace' | 'oauth.login' | 'oauth.login_failure' | 'oauth.signup' | 'variables.create' | 'variables.delete' | 'variables.update' | 'flows.create' | 'flows.update' | 'flows.delete' | 'flows.archive' | 'apps.create' | 'apps.update' | 'apps.delete' | 'folder.create' | 'folder.update' | 'folder.delete' | 'folder.add_owner' | 'folder.remove_owner' | 'group.create' | 'group.delete' | 'group.edit' | 'group.adduser' | 'group.removeuser' | 'igroup.create' | 'igroup.delete' | 'igroup.adduser' | 'igroup.removeuser' | 'variables.decrypt_secret' | 'workspaces.edit_command_script' | 'workspaces.edit_deploy_to' | 'workspaces.edit_auto_invite_domain' | 'workspaces.edit_webhook' | 'workspaces.edit_copilot_config' | 'workspaces.edit_error_handler' | 'workspaces.create' | 'workspaces.update' | 'workspaces.archive' | 'workspaces.unarchive' | 'workspaces.delete'; - action_kind: 'Created' | 'Updated' | 'Delete' | 'Execute'; - resource?: string; - parameters?: { - [key: string]: unknown; - }; -}; - -export type operation = 'jobs.run' | 'jobs.run.script' | 'jobs.run.preview' | 'jobs.run.flow' | 'jobs.run.flow_preview' | 'jobs.run.script_hub' | 'jobs.run.dependencies' | 'jobs.run.identity' | 'jobs.run.noop' | 'jobs.flow_dependencies' | 'jobs' | 'jobs.cancel' | 'jobs.force_cancel' | 'jobs.disapproval' | 'jobs.delete' | 'account.delete' | 'ai.request' | 'resources.create' | 'resources.update' | 'resources.delete' | 'resource_types.create' | 'resource_types.update' | 'resource_types.delete' | 'schedule.create' | 'schedule.setenabled' | 'schedule.edit' | 'schedule.delete' | 'scripts.create' | 'scripts.update' | 'scripts.archive' | 'scripts.delete' | 'users.create' | 'users.delete' | 'users.update' | 'users.login' | 'users.login_failure' | 'users.logout' | 'users.accept_invite' | 'users.decline_invite' | 'users.token.create' | 'users.token.delete' | 'users.add_to_workspace' | 'users.add_global' | 'users.setpassword' | 'users.impersonate' | 'users.leave_workspace' | 'oauth.login' | 'oauth.login_failure' | 'oauth.signup' | 'variables.create' | 'variables.delete' | 'variables.update' | 'flows.create' | 'flows.update' | 'flows.delete' | 'flows.archive' | 'apps.create' | 'apps.update' | 'apps.delete' | 'folder.create' | 'folder.update' | 'folder.delete' | 'folder.add_owner' | 'folder.remove_owner' | 'group.create' | 'group.delete' | 'group.edit' | 'group.adduser' | 'group.removeuser' | 'igroup.create' | 'igroup.delete' | 'igroup.adduser' | 'igroup.removeuser' | 'variables.decrypt_secret' | 'workspaces.edit_command_script' | 'workspaces.edit_deploy_to' | 'workspaces.edit_auto_invite_domain' | 'workspaces.edit_webhook' | 'workspaces.edit_copilot_config' | 'workspaces.edit_error_handler' | 'workspaces.create' | 'workspaces.update' | 'workspaces.archive' | 'workspaces.unarchive' | 'workspaces.delete'; - -export type action_kind = 'Created' | 'Updated' | 'Delete' | 'Execute'; - -export type MainArgSignature = { - type: 'Valid' | 'Invalid'; - error: string; - star_args: boolean; - star_kwargs?: boolean; - args: Array<{ - name: string; - typ: ('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { - resource: (string) | null; -} | { - str: Array<(string)> | null; -} | { - object: Array<{ - key: string; - typ: ('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { - str: unknown; -}); - }>; -} | { - list: (('float' | 'int' | 'bool' | 'email' | 'unknown' | 'bytes' | 'dict' | 'datetime' | 'sql' | { - str: unknown; -}) | null); -}); - has_default?: boolean; - default?: unknown; - }>; - no_main_func: (boolean) | null; - has_preprocessor: (boolean) | null; -}; - -export type type2 = 'Valid' | 'Invalid'; - -export type ScriptLang = 'python3' | 'deno' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'bun' | 'php' | 'rust' | 'ansible' | 'csharp' | 'nu' | 'java'; - -export type Preview = { - content?: string; - path?: string; - args: ScriptArgs; - language?: ScriptLang; - tag?: string; - kind?: 'code' | 'identity' | 'http'; - dedicated_worker?: boolean; - lock?: string; -}; - -export type kind2 = 'code' | 'identity' | 'http'; - -export type WorkflowTask = { - args: ScriptArgs; -}; - -export type WorkflowStatusRecord = { - [key: string]: WorkflowStatus; -}; - -export type WorkflowStatus = { - scheduled_for?: string; - started_at?: string; - duration_ms?: number; - name?: string; -}; - -export type CreateResource = { - path: string; - value: unknown; - description?: string; - resource_type: string; -}; - -export type EditResource = { - path?: string; - description?: string; - value?: unknown; -}; - -export type Resource = { - workspace_id?: string; - path: string; - description?: string; - resource_type: string; - value?: unknown; - is_oauth: boolean; - extra_perms?: { - [key: string]: (boolean); - }; - created_by?: string; - edited_at?: string; -}; - -export type ListableResource = { - workspace_id?: string; - path: string; - description?: string; - resource_type: string; - value?: unknown; - is_oauth: boolean; - extra_perms?: { - [key: string]: (boolean); - }; - is_expired?: boolean; - refresh_error?: string; - is_linked: boolean; - is_refreshed: boolean; - account?: number; - created_by?: string; - edited_at?: string; -}; - -export type ResourceType = { - workspace_id?: string; - name: string; - schema?: unknown; - description?: string; - created_by?: string; - edited_at?: string; - format_extension?: string; -}; - -export type EditResourceType = { - schema?: unknown; - description?: string; -}; - -export type Schedule = { - path: string; - edited_by: string; - edited_at: string; - schedule: string; - timezone: string; - enabled: boolean; - script_path: string; - is_flow: boolean; - args?: ScriptArgs; - extra_perms: { - [key: string]: (boolean); - }; - email: string; - error?: string; - on_failure?: string; - on_failure_times?: number; - on_failure_exact?: boolean; - on_failure_extra_args?: ScriptArgs; - on_recovery?: string; - on_recovery_times?: number; - on_recovery_extra_args?: ScriptArgs; - on_success?: string; - on_success_extra_args?: ScriptArgs; - ws_error_handler_muted?: boolean; - retry?: Retry; - summary?: string; - description?: string; - no_flow_overlap?: boolean; - tag?: string; - paused_until?: string; - cron_version?: string; -}; - -export type ScheduleWJobs = Schedule & { - jobs?: Array<{ - id: string; - success: boolean; - duration_ms: number; - }>; -}; - -export type NewSchedule = { - path: string; - schedule: string; - timezone: string; - script_path: string; - is_flow: boolean; - args: ScriptArgs; - enabled?: boolean; - on_failure?: string; - on_failure_times?: number; - on_failure_exact?: boolean; - on_failure_extra_args?: ScriptArgs; - on_recovery?: string; - on_recovery_times?: number; - on_recovery_extra_args?: ScriptArgs; - on_success?: string; - on_success_extra_args?: ScriptArgs; - ws_error_handler_muted?: boolean; - retry?: Retry; - no_flow_overlap?: boolean; - summary?: string; - description?: string; - tag?: string; - paused_until?: string; - cron_version?: string; -}; - -export type EditSchedule = { - schedule: string; - timezone: string; - args: ScriptArgs; - on_failure?: string; - on_failure_times?: number; - on_failure_exact?: boolean; - on_failure_extra_args?: ScriptArgs; - on_recovery?: string; - on_recovery_times?: number; - on_recovery_extra_args?: ScriptArgs; - on_success?: string; - on_success_extra_args?: ScriptArgs; - ws_error_handler_muted?: boolean; - retry?: Retry; - no_flow_overlap?: boolean; - summary?: string; - description?: string; - tag?: string; - paused_until?: string; - cron_version?: string; -}; - -export type TriggerExtraProperty = { - path: string; - script_path: string; - email: string; - extra_perms: { - [key: string]: (boolean); - }; - workspace_id: string; - edited_by: string; - edited_at: string; - is_flow: boolean; -}; - -export type AuthenticationMethod = 'none' | 'windmill' | 'api_key' | 'basic_http' | 'custom_script' | 'signature'; - -export type HttpTrigger = TriggerExtraProperty & { - route_path: string; - static_asset_config?: { - s3: string; - storage?: string; - filename?: string; - }; - http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; - authentication_resource_path?: string; - is_async: boolean; - authentication_method: AuthenticationMethod; - is_static_website: boolean; - workspaced_route: boolean; - wrap_body: boolean; - raw_string: boolean; -}; - -export type http_method = 'get' | 'post' | 'put' | 'delete' | 'patch'; - -export type NewHttpTrigger = { - path: string; - script_path: string; - route_path: string; - workspaced_route?: boolean; - static_asset_config?: { - s3: string; - storage?: string; - filename?: string; - }; - is_flow: boolean; - http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; - authentication_resource_path?: string; - is_async: boolean; - authentication_method: AuthenticationMethod; - is_static_website: boolean; - wrap_body?: boolean; - raw_string?: boolean; -}; - -export type EditHttpTrigger = { - path: string; - script_path: string; - route_path?: string; - workspaced_route?: boolean; - static_asset_config?: { - s3: string; - storage?: string; - filename?: string; - }; - authentication_resource_path?: string; - is_flow: boolean; - http_method: 'get' | 'post' | 'put' | 'delete' | 'patch'; - is_async: boolean; - authentication_method: AuthenticationMethod; - is_static_website: boolean; - wrap_body?: boolean; - raw_string?: boolean; -}; - -export type TriggersCount = { - primary_schedule?: { - schedule?: string; - }; - schedule_count?: number; - http_routes_count?: number; - webhook_count?: number; - email_count?: number; - websocket_count?: number; - postgres_count?: number; - kafka_count?: number; - nats_count?: number; - mqtt_count?: number; - gcp_count?: number; - sqs_count?: number; -}; - -export type WebsocketTrigger = TriggerExtraProperty & { - url: string; - server_id?: string; - last_server_ping?: string; - error?: string; - enabled: boolean; - filters: Array<{ - key: string; - value: unknown; - }>; - initial_messages?: Array; - url_runnable_args?: ScriptArgs; - can_return_message: boolean; -}; - -export type NewWebsocketTrigger = { - path: string; - script_path: string; - is_flow: boolean; - url: string; - enabled?: boolean; - filters: Array<{ - key: string; - value: unknown; - }>; - initial_messages?: Array; - url_runnable_args?: ScriptArgs; - can_return_message: boolean; -}; - -export type EditWebsocketTrigger = { - url: string; - path: string; - script_path: string; - is_flow: boolean; - filters: Array<{ - key: string; - value: unknown; - }>; - initial_messages?: Array; - url_runnable_args?: ScriptArgs; - can_return_message: boolean; -}; - -export type WebsocketTriggerInitialMessage = { - raw_message: string; -} | { - runnable_result: { - path: string; - args: ScriptArgs; - is_flow: boolean; - }; -}; - -export type MqttQoS = 'qos0' | 'qos1' | 'qos2'; - -export type MqttV3Config = { - clean_session?: boolean; -}; - -export type MqttV5Config = { - clean_start?: boolean; - topic_alias?: number; - session_expiry_interval?: number; -}; - -export type MqttSubscribeTopic = { - qos: MqttQoS; - topic: string; -}; - -export type MqttClientVersion = 'v3' | 'v5'; - -export type MqttTrigger = TriggerExtraProperty & { - mqtt_resource_path: string; - subscribe_topics: Array; - v3_config?: MqttV3Config; - v5_config?: MqttV5Config; - client_id?: string; - client_version?: MqttClientVersion; - server_id?: string; - last_server_ping?: string; - error?: string; - enabled: boolean; -}; - -export type NewMqttTrigger = { - mqtt_resource_path: string; - subscribe_topics: Array; - client_id?: string; - v3_config?: MqttV3Config; - v5_config?: MqttV5Config; - client_version?: MqttClientVersion; - path: string; - script_path: string; - is_flow: boolean; - enabled?: boolean; -}; - -export type EditMqttTrigger = { - mqtt_resource_path: string; - subscribe_topics: Array; - client_id?: string; - v3_config?: MqttV3Config; - v5_config?: MqttV5Config; - client_version?: MqttClientVersion; - path: string; - script_path: string; - is_flow: boolean; - enabled: boolean; -}; - -export type DeliveryType = 'push' | 'pull'; - -export type PushConfig = { - audience?: string; - authenticate: boolean; - base_endpoint: string; -}; - -export type GcpTrigger = TriggerExtraProperty & { - gcp_resource_path: string; - topic_id: string; - subscription_id: string; - server_id?: string; - delivery_type: DeliveryType; - delivery_config?: PushConfig; - last_server_ping?: string; - error?: string; - enabled: boolean; -}; - -/** - * The mode of subscription. 'existing' means using an existing GCP subscription, while 'create_update' involves creating or updating a new subscription. - */ -export type SubscriptionMode = 'existing' | 'create_update'; - -export type GcpExistingSubscription = { - subscription_id: string; - base_endpoint: string; -}; - -export type GcpCreateUpdateSubscription = { - subscription_id?: string; - delivery_type: DeliveryType; - delivery_config?: PushConfig; -}; - -/** - * "This is a union type representing the subscription mode. - * - 'existing': Represents an existing GCP subscription, and should be accompanied by an 'ExistingGcpSubscription' object. - * - 'create_update': Represents a new or updated GCP subscription, and should be accompanied by a 'CreateUpdateConfig' object." - * - */ -export type GcpSubscriptionModeConfig = (GcpExistingSubscription | GcpCreateUpdateSubscription) & { - subscription_mode: SubscriptionMode; -}; - -export type NewGcpTrigger = { - gcp_resource_path: string; - topic_id: string; - subscription_mode: GcpSubscriptionModeConfig; - path: string; - script_path: string; - is_flow: boolean; - enabled?: boolean; -}; - -export type EditGcpTrigger = { - gcp_resource_path?: string; - topic_id: string; - subscription_mode: GcpSubscriptionModeConfig; - path: string; - script_path: string; - is_flow: boolean; - enabled: boolean; -}; - -export type GetAllTopicSubscription = { - topic_id: string; -}; - -export type DeleteGcpSubscription = { - subscription_id: string; -}; - -export type SqsTrigger = TriggerExtraProperty & { - queue_url: string; - aws_resource_path: string; - message_attributes?: Array<(string)>; - server_id?: string; - last_server_ping?: string; - error?: string; - enabled: boolean; -}; - -export type NewSqsTrigger = { - queue_url: string; - aws_resource_path: string; - message_attributes?: Array<(string)>; - path: string; - script_path: string; - is_flow: boolean; - enabled?: boolean; -}; - -export type EditSqsTrigger = { - queue_url: string; - aws_resource_path: string; - message_attributes?: Array<(string)>; - path: string; - script_path: string; - is_flow: boolean; - enabled: boolean; -}; - -export type Slot = { - name?: string; -}; - -export type SlotList = { - slot_name?: string; - active?: boolean; -}; - -export type PublicationData = { - table_to_track?: Array; - transaction_to_track: Array<(string)>; -}; - -export type TableToTrack = Array<{ - table_name: string; - columns_name?: Array<(string)>; - where_clause?: string; -}>; - -export type Relations = { - schema_name: string; - table_to_track: TableToTrack; -}; - -export type Language = 'Typescript'; - -export type TemplateScript = { - postgres_resource_path: string; - relations: Array; - language: Language; -}; - -export type PostgresTrigger = TriggerExtraProperty & { - enabled: boolean; - postgres_resource_path: string; - publication_name: string; - server_id?: string; - replication_slot_name: string; - error?: string; - last_server_ping?: string; -}; - -export type NewPostgresTrigger = { - replication_slot_name?: string; - publication_name?: string; - path: string; - script_path: string; - is_flow: boolean; - enabled: boolean; - postgres_resource_path: string; - publication?: PublicationData; -}; - -export type EditPostgresTrigger = { - replication_slot_name: string; - publication_name: string; - path: string; - script_path: string; - is_flow: boolean; - enabled: boolean; - postgres_resource_path: string; - publication?: PublicationData; -}; - -export type KafkaTrigger = TriggerExtraProperty & { - kafka_resource_path: string; - group_id: string; - topics: Array<(string)>; - server_id?: string; - last_server_ping?: string; - error?: string; - enabled: boolean; -}; - -export type NewKafkaTrigger = { - path: string; - script_path: string; - is_flow: boolean; - kafka_resource_path: string; - group_id: string; - topics: Array<(string)>; - enabled?: boolean; -}; - -export type EditKafkaTrigger = { - kafka_resource_path: string; - group_id: string; - topics: Array<(string)>; - path: string; - script_path: string; - is_flow: boolean; -}; - -export type NatsTrigger = TriggerExtraProperty & { - nats_resource_path: string; - use_jetstream: boolean; - stream_name?: string; - consumer_name?: string; - subjects: Array<(string)>; - server_id?: string; - last_server_ping?: string; - error?: string; - enabled: boolean; -}; - -export type NewNatsTrigger = { - path: string; - script_path: string; - is_flow: boolean; - nats_resource_path: string; - use_jetstream: boolean; - stream_name?: string; - consumer_name?: string; - subjects: Array<(string)>; - enabled?: boolean; -}; - -export type EditNatsTrigger = { - nats_resource_path: string; - use_jetstream: boolean; - stream_name?: string; - consumer_name?: string; - subjects: Array<(string)>; - path: string; - script_path: string; - is_flow: boolean; -}; - -export type Group = { - name: string; - summary?: string; - members?: Array<(string)>; - extra_perms?: { - [key: string]: (boolean); - }; -}; - -export type InstanceGroup = { - name: string; - summary?: string; - emails?: Array<(string)>; -}; - -export type Folder = { - name: string; - owners: Array<(string)>; - extra_perms: { - [key: string]: (boolean); - }; - summary?: string; - created_by?: string; - edited_at?: string; -}; - -export type WorkerPing = { - worker: string; - worker_instance: string; - last_ping?: number; - started_at: string; - ip: string; - jobs_executed: number; - custom_tags?: Array<(string)>; - worker_group: string; - wm_version: string; - last_job_id?: string; - last_job_workspace_id?: string; - occupancy_rate?: number; - occupancy_rate_15s?: number; - occupancy_rate_5m?: number; - occupancy_rate_30m?: number; - memory?: number; - vcpus?: number; - memory_usage?: number; - wm_memory_usage?: number; -}; - -export type UserWorkspaceList = { - email: string; - workspaces: Array<{ - id: string; - name: string; - username: string; - color: string; - operator_settings?: OperatorSettings; - }>; -}; - -export type CreateWorkspace = { - id: string; - name: string; - username?: string; - color?: string; -}; - -export type Workspace = { - id: string; - name: string; - owner: string; - domain?: string; - color?: string; -}; - -export type WorkspaceInvite = { - workspace_id: string; - email: string; - is_admin: boolean; - operator: boolean; -}; - -export type GlobalUserInfo = { - email: string; - login_type: 'password' | 'github'; - super_admin: boolean; - devops?: boolean; - verified: boolean; - name?: string; - company?: string; - username?: string; - operator_only?: boolean; -}; - -export type login_type = 'password' | 'github'; - -export type Flow = OpenFlow & FlowMetadata & { - lock_error_logs?: string; -}; - -export type ExtraPerms = { - [key: string]: (boolean); -}; - -export type FlowMetadata = { - workspace_id?: string; - path: string; - edited_by: string; - edited_at: string; - archived: boolean; - extra_perms: ExtraPerms; - starred?: boolean; - draft_only?: boolean; - tag?: string; - ws_error_handler_muted?: boolean; - priority?: number; - dedicated_worker?: boolean; - timeout?: number; - visible_to_runner_only?: boolean; - on_behalf_of_email?: string; -}; - -export type OpenFlowWPath = OpenFlow & { - path: string; - tag?: string; - ws_error_handler_muted?: boolean; - priority?: number; - dedicated_worker?: boolean; - timeout?: number; - visible_to_runner_only?: boolean; - on_behalf_of_email?: string; -}; - -export type FlowPreview = { - value: FlowValue; - path?: string; - args: ScriptArgs; - tag?: string; - restarted_from?: RestartedFrom; -}; - -export type RestartedFrom = { - flow_job_id?: string; - step_id?: string; - branch_or_iteration_n?: number; -}; - -export type Policy = { - triggerables?: { - [key: string]: { - [key: string]: unknown; - }; - }; - triggerables_v2?: { - [key: string]: { - [key: string]: unknown; - }; - }; - s3_inputs?: Array<{ - [key: string]: unknown; - }>; - allowed_s3_keys?: Array<{ - s3_path?: string; - resource?: string; - }>; - execution_mode?: 'viewer' | 'publisher' | 'anonymous'; - on_behalf_of?: string; - on_behalf_of_email?: string; -}; - -export type execution_mode = 'viewer' | 'publisher' | 'anonymous'; - -export type ListableApp = { - id: number; - workspace_id: string; - path: string; - summary: string; - version: number; - extra_perms: { - [key: string]: (boolean); - }; - starred?: boolean; - edited_at: string; - execution_mode: 'viewer' | 'publisher' | 'anonymous'; -}; - -export type ListableRawApp = { - workspace_id: string; - path: string; - summary: string; - extra_perms: { - [key: string]: (boolean); - }; - starred?: boolean; - version: number; - edited_at: string; -}; - -export type AppWithLastVersion = { - id: number; - workspace_id: string; - path: string; - summary: string; - versions: Array<(number)>; - created_by: string; - created_at: string; - value: { - [key: string]: unknown; - }; - policy: Policy; - execution_mode: 'viewer' | 'publisher' | 'anonymous'; - extra_perms: { - [key: string]: (boolean); - }; - custom_path?: string; -}; - -export type AppWithLastVersionWDraft = AppWithLastVersion & { - draft_only?: boolean; - draft?: unknown; -}; - -export type AppHistory = { - version: number; - deployment_msg?: string; -}; - -export type FlowVersion = { - id: number; - created_at: string; - deployment_msg?: string; -}; - -export type SlackToken = { - access_token: string; - team_id: string; - team_name: string; - bot: { - bot_access_token?: string; - }; -}; - -export type TokenResponse = { - access_token: string; - expires_in?: number; - refresh_token?: string; - scope?: Array<(string)>; -}; - -export type HubScriptKind = unknown; - -export type PolarsClientKwargs = { - region_name: string; -}; - -export type LargeFileStorage = { - type?: 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; - s3_resource_path?: string; - azure_blob_resource_path?: string; - public_resource?: boolean; - secondary_storage?: { - [key: string]: { - type?: 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; - s3_resource_path?: string; - azure_blob_resource_path?: string; - public_resource?: boolean; - }; - }; -}; - -export type type3 = 'S3Storage' | 'AzureBlobStorage' | 'AzureWorkloadIdentity' | 'S3AwsOidc'; - -export type WindmillLargeFile = { - s3: string; -}; - -export type WindmillFileMetadata = { - mime_type?: string; - size_in_bytes?: number; - last_modified?: string; - expires?: string; - version_id?: string; -}; - -export type WindmillFilePreview = { - msg?: string; - content?: string; - content_type: 'RawText' | 'Csv' | 'Parquet' | 'Unknown'; -}; - -export type content_type = 'RawText' | 'Csv' | 'Parquet' | 'Unknown'; - -export type S3Resource = { - bucket: string; - region: string; - endPoint: string; - useSSL: boolean; - accessKey?: string; - secretKey?: string; - pathStyle: boolean; -}; - -export type WorkspaceGitSyncSettings = { - include_path?: Array<(string)>; - include_type?: Array<('script' | 'flow' | 'app' | 'folder' | 'resource' | 'variable' | 'secret' | 'resourcetype' | 'schedule' | 'user' | 'group')>; - repositories?: Array; -}; - -export type WorkspaceDeployUISettings = { - include_path?: Array<(string)>; - include_type?: Array<('script' | 'flow' | 'app' | 'resource' | 'variable' | 'secret' | 'trigger')>; -}; - -export type WorkspaceDefaultScripts = { - order?: Array<(string)>; - hidden?: Array<(string)>; - default_script_content?: { - [key: string]: (string); - }; -}; - -export type GitRepositorySettings = { - script_path: string; - git_repo_resource_path: string; - use_individual_branch?: boolean; - group_by_folder?: boolean; - exclude_types_override?: Array<('script' | 'flow' | 'app' | 'folder' | 'resource' | 'variable' | 'secret' | 'resourcetype' | 'schedule' | 'user' | 'group')>; -}; - -export type UploadFilePart = { - part_number: number; - tag: string; -}; - -export type MetricMetadata = { - id: string; - name?: string; -}; - -export type ScalarMetric = { - metric_id?: string; - value: number; -}; - -export type TimeseriesMetric = { - metric_id?: string; - values: Array; -}; - -export type MetricDataPoint = { - timestamp: string; - value: number; -}; - -export type RawScriptForDependencies = { - raw_code: string; - path: string; - language: ScriptLang; -}; - -export type ConcurrencyGroup = { - concurrency_key: string; - total_running: number; -}; - -export type ExtendedJobs = { - jobs: Array; - obscured_jobs: Array; - /** - * Obscured jobs omitted for security because of too specific filtering - */ - omitted_obscured_jobs?: boolean; -}; - -export type ExportedUser = { - email: string; - password_hash?: string; - super_admin: boolean; - verified: boolean; - name?: string; - company?: string; - first_time_user: boolean; - username?: string; -}; - -export type GlobalSetting = { - name: string; - value: { - [key: string]: unknown; - }; -}; - -export type Config = { - name: string; - config?: { - [key: string]: unknown; - }; -}; - -export type ExportedInstanceGroup = { - name: string; - summary?: string; - emails?: Array<(string)>; - id?: string; - scim_display_name?: string; - external_id?: string; -}; - -export type JobSearchHit = { - dancer?: string; -}; - -export type LogSearchHit = { - dancer?: string; -}; - -export type AutoscalingEvent = { - id?: number; - worker_group?: string; - event_type?: string; - desired_workers?: number; - reason?: string; - applied_at?: string; -}; - -export type CriticalAlert = { - /** - * Unique identifier for the alert - */ - id?: number; - /** - * Type of alert (e.g., critical_error) - */ - alert_type?: string; - /** - * The message content of the alert - */ - message?: string; - /** - * Time when the alert was created - */ - created_at?: string; - /** - * Acknowledgment status of the alert, can be true, false, or null if not set - */ - acknowledged?: (boolean) | null; - /** - * Workspace id if the alert is in the scope of a workspace - */ - workspace_id?: (string) | null; -}; - -export type CaptureTriggerKind = 'webhook' | 'http' | 'websocket' | 'kafka' | 'email' | 'nats' | 'postgres' | 'sqs' | 'mqtt' | 'gcp'; - -export type Capture = { - trigger_kind: CaptureTriggerKind; - payload: unknown; - trigger_extra?: unknown; - id: number; - created_at: string; -}; - -export type CaptureConfig = { - trigger_config?: unknown; - trigger_kind: CaptureTriggerKind; - error?: string; - last_server_ping?: string; -}; - -export type OperatorSettings = { - /** - * Whether operators can view runs - */ - runs: boolean; - /** - * Whether operators can view schedules - */ - schedules: boolean; - /** - * Whether operators can view resources - */ - resources: boolean; - /** - * Whether operators can view variables - */ - variables: boolean; - /** - * Whether operators can view audit logs - */ - audit_logs: boolean; - /** - * Whether operators can view triggers - */ - triggers: boolean; - /** - * Whether operators can view groups page - */ - groups: boolean; - /** - * Whether operators can view folders page - */ - folders: boolean; - /** - * Whether operators can view workers page - */ - workers: boolean; -} | null; - -export type TeamInfo = { - /** - * The unique identifier of the Microsoft Teams team - */ - team_id: string; - /** - * The display name of the Microsoft Teams team - */ - team_name: string; - /** - * List of channels within the team - */ - channels: Array; -}; - -export type ChannelInfo = { - /** - * The unique identifier of the channel - */ - channel_id: string; - /** - * The display name of the channel - */ - channel_name: string; - /** - * The Microsoft Teams tenant identifier - */ - tenant_id: string; - /** - * The service URL for the channel - */ - service_url: string; -}; - -export type GithubInstallations = Array<{ - workspace_id?: string; - installation_id: number; - account_id: string; - repositories: Array<{ - name: string; - url: string; - }>; -}>; - -export type WorkspaceGithubInstallation = { - account_id: string; - installation_id: number; -}; - -export type OpenFlow = { - summary: string; - description?: string; - value: FlowValue; - schema?: { - [key: string]: unknown; - }; -}; - -export type FlowValue = { - modules: Array; - failure_module?: FlowModule; - preprocessor_module?: FlowModule; - same_worker?: boolean; - concurrent_limit?: number; - concurrency_key?: string; - concurrency_time_window_s?: number; - skip_expr?: string; - cache_ttl?: number; - priority?: number; - early_return?: string; -}; - -export type Retry = { - constant?: { - attempts?: number; - seconds?: number; - }; - exponential?: { - attempts?: number; - multiplier?: number; - seconds?: number; - random_factor?: number; - }; -}; - -export type FlowModule = { - id: string; - value: FlowModuleValue; - stop_after_if?: { - skip_if_stopped?: boolean; - expr: string; - }; - stop_after_all_iters_if?: { - skip_if_stopped?: boolean; - expr: string; - }; - skip_if?: { - expr: string; - }; - sleep?: InputTransform; - cache_ttl?: number; - timeout?: number; - delete_after_use?: boolean; - summary?: string; - mock?: { - enabled?: boolean; - return_value?: unknown; - }; - suspend?: { - required_events?: number; - timeout?: number; - resume_form?: { - schema?: { - [key: string]: unknown; - }; - }; - user_auth_required?: boolean; - user_groups_required?: InputTransform; - self_approval_disabled?: boolean; - hide_cancel?: boolean; - continue_on_disapprove_timeout?: boolean; - }; - priority?: number; - continue_on_error?: boolean; - retry?: Retry; -}; - -export type InputTransform = StaticTransform | JavascriptTransform; - -export type StaticTransform = { - value?: unknown; - type: 'static'; -}; - -export type JavascriptTransform = { - expr: string; - type: 'javascript'; -}; - -export type FlowModuleValue = RawScript | PathScript | PathFlow | ForloopFlow | WhileloopFlow | BranchOne | BranchAll | Identity; - -export type RawScript = { - input_transforms: { - [key: string]: InputTransform; - }; - content: string; - language: 'deno' | 'bun' | 'python3' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'php'; - path?: string; - lock?: string; - type: 'rawscript'; - tag?: string; - concurrent_limit?: number; - concurrency_time_window_s?: number; - custom_concurrency_key?: string; - is_trigger?: boolean; -}; - -export type language = 'deno' | 'bun' | 'python3' | 'go' | 'bash' | 'powershell' | 'postgresql' | 'mysql' | 'bigquery' | 'snowflake' | 'mssql' | 'oracledb' | 'graphql' | 'nativets' | 'php'; - -export type PathScript = { - input_transforms: { - [key: string]: InputTransform; - }; - path: string; - hash?: string; - type: 'script'; - tag_override?: string; - is_trigger?: boolean; -}; - -export type PathFlow = { - input_transforms: { - [key: string]: InputTransform; - }; - path: string; - type: 'flow'; -}; - -export type ForloopFlow = { - modules: Array; - iterator: InputTransform; - skip_failures: boolean; - type: 'forloopflow'; - parallel?: boolean; - parallelism?: number; -}; - -export type WhileloopFlow = { - modules: Array; - skip_failures: boolean; - type: 'whileloopflow'; - parallel?: boolean; - parallelism?: number; -}; - -export type BranchOne = { - branches: Array<{ - summary?: string; - expr: string; - modules: Array; - }>; - default: Array; - type: 'branchone'; -}; - -export type BranchAll = { - branches: Array<{ - summary?: string; - skip_failure?: boolean; - modules: Array; - }>; - type: 'branchall'; - parallel?: boolean; -}; - -export type Identity = { - type: 'identity'; - flow?: boolean; -}; - -export type FlowStatus = { - step: number; - modules: Array; - user_states?: { - [key: string]: unknown; - }; - preprocessor_module?: (FlowStatusModule); - failure_module: (FlowStatusModule & { - parent_module?: string; -}); - retry?: { - fail_count?: number; - failed_jobs?: Array<(string)>; - }; -}; - -export type FlowStatusModule = { - type: 'WaitingForPriorSteps' | 'WaitingForEvents' | 'WaitingForExecutor' | 'InProgress' | 'Success' | 'Failure'; - id?: string; - job?: string; - count?: number; - progress?: number; - iterator?: { - index?: number; - itered?: Array; - args?: unknown; - }; - flow_jobs?: Array<(string)>; - flow_jobs_success?: Array<(boolean)>; - branch_chosen?: { - type: 'branch' | 'default'; - branch?: number; - }; - branchall?: { - branch: number; - len: number; - }; - approvers?: Array<{ - resume_id: number; - approver: string; - }>; - failed_retries?: Array<(string)>; - skipped?: boolean; -}; - -export type type4 = 'WaitingForPriorSteps' | 'WaitingForEvents' | 'WaitingForExecutor' | 'InProgress' | 'Success' | 'Failure'; - -export type ParameterId = string; - -export type ParameterKey = string; - -export type ParameterWorkspaceId = string; - -export type ParameterPublicationName = string; - -export type ParameterVersionId = number; - -export type ParameterToken = string; - -export type ParameterAccountId = number; - -export type ParameterClientName = string; - -export type ParameterScriptPath = string; - -export type ParameterScriptHash = string; - -export type ParameterJobId = string; - -export type ParameterPath = string; - -export type ParameterCustomPath = string; - -export type ParameterPathId = number; - -export type ParameterPathVersion = number; - -export type ParameterName = string; - -/** - * which page to return (start at 1, default 1) - */ -export type ParameterPage = number; - -/** - * number of items to return for a given page (default 30, max 100) - */ -export type ParameterPerPage = number; - -/** - * order by desc order (default true) - */ -export type ParameterOrderDesc = boolean; - -/** - * mask to filter exact matching user creator - */ -export type ParameterCreatedBy = string; - -/** - * mask to filter exact matching job's label (job labels are completed jobs with as a result an object containing a string in the array at key 'wm_labels') - */ -export type ParameterLabel = string; - -/** - * worker this job was ran on - */ -export type ParameterWorker = string; - -/** - * The parent job that is at the origin and responsible for the execution of this script if any - */ -export type ParameterParentJob = string; - -/** - * Override the tag to use - */ -export type ParameterWorkerTag = string; - -/** - * Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl - */ -export type ParameterCacheTtl = string; - -/** - * The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) - */ -export type ParameterNewJobId = string; - -/** - * List of headers's keys (separated with ',') whove value are added to the args - * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key - * - */ -export type ParameterIncludeHeader = string; - -/** - * The maximum size of the queue for which the request would get rejected if that job would push it above that limit - * - */ -export type ParameterQueueLimit = string; - -/** - * The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent - * `encodeURIComponent(btoa(JSON.stringify({a: 2})))` - * - */ -export type ParameterPayload = string; - -/** - * mask to filter matching starting path - */ -export type ParameterScriptStartPath = string; - -/** - * mask to filter by schedule path - */ -export type ParameterSchedulePath = string; - -/** - * mask to filter exact matching path - */ -export type ParameterScriptExactPath = string; - -/** - * mask to filter exact matching path - */ -export type ParameterScriptExactHash = string; - -/** - * filter on created before (inclusive) timestamp - */ -export type ParameterCreatedBefore = string; - -/** - * filter on created after (exclusive) timestamp - */ -export type ParameterCreatedAfter = string; - -/** - * filter on started before (inclusive) timestamp - */ -export type ParameterStartedBefore = string; - -/** - * filter on started after (exclusive) timestamp - */ -export type ParameterStartedAfter = string; - -/** - * filter on started before (inclusive) timestamp - */ -export type ParameterBefore = string; - -/** - * filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp - */ -export type ParameterCreatedOrStartedAfter = string; - -/** - * filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp but only for the completed jobs - */ -export type ParameterCreatedOrStartedAfterCompletedJob = string; - -/** - * filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp - */ -export type ParameterCreatedOrStartedBefore = string; - -/** - * filter on successful jobs - */ -export type ParameterSuccess = boolean; - -/** - * filter on jobs scheduled_for before now (hence waitinf for a worker) - */ -export type ParameterScheduledForBeforeNow = boolean; - -/** - * filter on suspended jobs - */ -export type ParameterSuspended = boolean; - -/** - * filter on running jobs - */ -export type ParameterRunning = boolean; - -/** - * allow wildcards (*) in the filter of label, tag, worker - */ -export type ParameterAllowWildcards = boolean; - -/** - * filter on jobs containing those args as a json subset (@> in postgres) - */ -export type ParameterArgsFilter = string; - -/** - * filter on jobs with a given tag/worker group - */ -export type ParameterTag = string; - -/** - * filter on jobs containing those result as a json subset (@> in postgres) - */ -export type ParameterResultFilter = string; - -/** - * filter on created after (exclusive) timestamp - */ -export type ParameterAfter = string; - -/** - * filter on exact username of user - */ -export type ParameterUsername = string; - -/** - * filter on exact or prefix name of operation - */ -export type ParameterOperation = string; - -/** - * filter on exact or prefix name of resource - */ -export type ParameterResourceName = string; - -/** - * filter on type of operation - */ -export type ParameterActionKind = 'Create' | 'Update' | 'Delete' | 'Execute'; - -/** - * filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, - */ -export type ParameterJobKinds = string; - -export type ParameterRunnableId = string; - -export type ParameterRunnableTypeQuery = RunnableType; - -export type ParameterInputId = string; - -export type ParameterGetStarted = boolean; - -export type ParameterConcurrencyId = string; - -export type ParameterRunnableKind = 'script' | 'flow'; - -export type BackendVersionResponse = (string); - -export type BackendUptodateResponse = (string); - -export type GetLicenseIdResponse = (string); - -export type GetOpenApiYamlResponse = (string); - -export type GetAuditLogData = { - id: number; - workspace: string; -}; - -export type GetAuditLogResponse = (AuditLog); - -export type ListAuditLogsData = { - /** - * filter on type of operation - */ - actionKind?: 'Create' | 'Update' | 'Delete' | 'Execute'; - /** - * filter on created after (exclusive) timestamp - */ - after?: string; - /** - * get audit logs for all workspaces - */ - allWorkspaces?: boolean; - /** - * filter on started before (inclusive) timestamp - */ - before?: string; - /** - * comma separated list of operations to exclude - */ - excludeOperations?: string; - /** - * filter on exact or prefix name of operation - */ - operation?: string; - /** - * comma separated list of exact operations to include - */ - operations?: string; - /** - * which page to return (start at 1, default 1) - */ - page?: number; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; - /** - * filter on exact or prefix name of resource - */ - resource?: string; - /** - * filter on exact username of user - */ - username?: string; - workspace: string; -}; - -export type ListAuditLogsResponse = (Array); - -export type LoginData = { - /** - * credentials - */ - requestBody: Login; -}; - -export type LoginResponse = (string); - -export type LogoutResponse = (string); - -export type GetUserData = { - username: string; - workspace: string; -}; - -export type GetUserResponse = (User); - -export type UpdateUserData = { - /** - * new user - */ - requestBody: EditWorkspaceUser; - username: string; - workspace: string; -}; - -export type UpdateUserResponse = (string); - -export type IsOwnerOfPathData = { - path: string; - workspace: string; -}; - -export type IsOwnerOfPathResponse = (boolean); - -export type SetPasswordData = { - /** - * set password - */ - requestBody: { - password: string; - }; -}; - -export type SetPasswordResponse = (string); - -export type SetPasswordForUserData = { - /** - * set password - */ - requestBody: { - password: string; - }; - user: string; -}; - -export type SetPasswordForUserResponse = (string); - -export type SetLoginTypeForUserData = { - /** - * set login type - */ - requestBody: { - login_type: string; - }; - user: string; -}; - -export type SetLoginTypeForUserResponse = (string); - -export type CreateUserGloballyData = { - /** - * user info - */ - requestBody: { - email: string; - password: string; - super_admin: boolean; - name?: string; - company?: string; - }; -}; - -export type CreateUserGloballyResponse = (string); - -export type GlobalUserUpdateData = { - email: string; - /** - * new user info - */ - requestBody: { - is_super_admin?: boolean; - is_devops?: boolean; - name?: string; - }; -}; - -export type GlobalUserUpdateResponse = (string); - -export type GlobalUsernameInfoData = { - email: string; -}; - -export type GlobalUsernameInfoResponse = ({ - username: string; - workspace_usernames: Array<{ - workspace_id: string; - username: string; - }>; -}); - -export type GlobalUserRenameData = { - email: string; - /** - * new username - */ - requestBody: { - new_username: string; - }; -}; - -export type GlobalUserRenameResponse = (string); - -export type GlobalUserDeleteData = { - email: string; -}; - -export type GlobalUserDeleteResponse = (string); - -export type GlobalUsersOverwriteData = { - /** - * List of users - */ - requestBody: Array; -}; - -export type GlobalUsersOverwriteResponse = (string); - -export type GlobalUsersExportResponse = (Array); - -export type DeleteUserData = { - username: string; - workspace: string; -}; - -export type DeleteUserResponse = (string); - -export type GetGlobalConnectedRepositoriesResponse = (GithubInstallations); - -export type ListWorkspacesResponse = (Array); - -export type IsDomainAllowedResponse = (boolean); - -export type ListUserWorkspacesResponse = (UserWorkspaceList); - -export type ListWorkspacesAsSuperAdminData = { - /** - * which page to return (start at 1, default 1) - */ - page?: number; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; -}; - -export type ListWorkspacesAsSuperAdminResponse = (Array); - -export type CreateWorkspaceData = { - /** - * new token - */ - requestBody: CreateWorkspace; -}; - -export type CreateWorkspaceResponse = (string); - -export type ExistsWorkspaceData = { - /** - * id of workspace - */ - requestBody: { - id: string; - }; -}; - -export type ExistsWorkspaceResponse = (boolean); - -export type ExistsUsernameData = { - requestBody: { - id: string; - username: string; - }; -}; - -export type ExistsUsernameResponse = (boolean); - -export type GetGlobalData = { - key: string; -}; - -export type GetGlobalResponse = (unknown); - -export type SetGlobalData = { - key: string; - /** - * value set - */ - requestBody: { - value?: unknown; - }; -}; - -export type SetGlobalResponse = (string); - -export type GetLocalResponse = (unknown); - -export type TestSmtpData = { - /** - * test smtp payload - */ - requestBody: { - to: string; - smtp: { - host: string; - username: string; - password: string; - port: number; - from: string; - tls_implicit: boolean; - disable_tls: boolean; - }; - }; -}; - -export type TestSmtpResponse = (string); - -export type TestCriticalChannelsData = { - /** - * test critical channel payload - */ - requestBody: Array<{ - email?: string; - slack_channel?: string; - }>; -}; - -export type TestCriticalChannelsResponse = (string); - -export type GetCriticalAlertsData = { - acknowledged?: (boolean) | null; - page?: number; - pageSize?: number; -}; - -export type GetCriticalAlertsResponse = ({ - alerts?: Array; - /** - * Total number of rows matching the query. - */ - total_rows?: number; - /** - * Total number of pages based on the page size. - */ - total_pages?: number; -}); - -export type AcknowledgeCriticalAlertData = { - /** - * The ID of the critical alert to acknowledge - */ - id: number; -}; - -export type AcknowledgeCriticalAlertResponse = (string); - -export type AcknowledgeAllCriticalAlertsResponse = (string); - -export type TestLicenseKeyData = { - /** - * test license key - */ - requestBody: { - license_key: string; - }; -}; - -export type TestLicenseKeyResponse = (string); - -export type TestObjectStorageConfigData = { - /** - * test object storage config - */ - requestBody: { - [key: string]: unknown; - }; -}; - -export type TestObjectStorageConfigResponse = (string); - -export type SendStatsResponse = (string); - -export type GetLatestKeyRenewalAttemptResponse = ({ - result: string; - attempted_at: string; -} | null); - -export type RenewLicenseKeyData = { - licenseKey?: string; -}; - -export type RenewLicenseKeyResponse = (string); - -export type CreateCustomerPortalSessionData = { - licenseKey?: string; -}; - -export type CreateCustomerPortalSessionResponse = (string); - -export type TestMetadataData = { - /** - * test metadata - */ - requestBody: string; -}; - -export type TestMetadataResponse = (string); - -export type ListGlobalSettingsResponse = (Array); - -export type GetCurrentEmailResponse = (string); - -export type RefreshUserTokenData = { - ifExpiringInLessThanS?: number; -}; - -export type RefreshUserTokenResponse = (string); - -export type GetTutorialProgressResponse = ({ - progress?: number; -}); - -export type UpdateTutorialProgressData = { - /** - * progress update - */ - requestBody: { - progress?: number; - }; -}; - -export type UpdateTutorialProgressResponse = (string); - -export type LeaveInstanceResponse = (string); - -export type GetUsageResponse = (number); - -export type GetRunnableResponse = ({ - workspace: string; - endpoint_async: string; - endpoint_sync: string; - endpoint_openai_sync: string; - summary: string; - description?: string; - kind: string; -}); - -export type GlobalWhoamiResponse = (GlobalUserInfo); - -export type ListWorkspaceInvitesResponse = (Array); - -export type WhoamiData = { - workspace: string; -}; - -export type WhoamiResponse = (User); - -export type GetGithubAppTokenData = { - /** - * jwt job token - */ - requestBody: { - job_token: string; - }; - workspace: string; -}; - -export type GetGithubAppTokenResponse = ({ - token: string; -}); - -export type InstallFromWorkspaceData = { - requestBody: { - /** - * The ID of the workspace containing the installation to copy - */ - source_workspace_id: string; - /** - * The ID of the GitHub installation to copy - */ - installation_id: number; - }; - workspace: string; -}; - -export type InstallFromWorkspaceResponse = (unknown); - -export type DeleteFromWorkspaceData = { - /** - * The ID of the GitHub installation to delete - */ - installationId: number; - workspace: string; -}; - -export type DeleteFromWorkspaceResponse = (unknown); - -export type ExportInstallationData = { - installationId: number; - workspace: string; -}; - -export type ExportInstallationResponse = ({ - jwt_token?: string; -}); - -export type ImportInstallationData = { - requestBody: { - jwt_token: string; - }; - workspace: string; -}; - -export type ImportInstallationResponse = (unknown); - -export type AcceptInviteData = { - /** - * accept invite - */ - requestBody: { - workspace_id: string; - username?: string; - }; -}; - -export type AcceptInviteResponse = (string); - -export type DeclineInviteData = { - /** - * decline invite - */ - requestBody: { - workspace_id: string; - }; -}; - -export type DeclineInviteResponse = (string); - -export type InviteUserData = { - /** - * WorkspaceInvite - */ - requestBody: { - email: string; - is_admin: boolean; - operator: boolean; - }; - workspace: string; -}; - -export type InviteUserResponse = (string); - -export type AddUserData = { - /** - * WorkspaceInvite - */ - requestBody: { - email: string; - is_admin: boolean; - username?: string; - operator: boolean; - }; - workspace: string; -}; - -export type AddUserResponse = (string); - -export type DeleteInviteData = { - /** - * WorkspaceInvite - */ - requestBody: { - email: string; - is_admin: boolean; - operator: boolean; - }; - workspace: string; -}; - -export type DeleteInviteResponse = (string); - -export type ArchiveWorkspaceData = { - workspace: string; -}; - -export type ArchiveWorkspaceResponse = (string); - -export type UnarchiveWorkspaceData = { - workspace: string; -}; - -export type UnarchiveWorkspaceResponse = (string); - -export type DeleteWorkspaceData = { - workspace: string; -}; - -export type DeleteWorkspaceResponse = (string); - -export type LeaveWorkspaceData = { - workspace: string; -}; - -export type LeaveWorkspaceResponse = (string); - -export type GetWorkspaceNameData = { - workspace: string; -}; - -export type GetWorkspaceNameResponse = (string); - -export type ChangeWorkspaceNameData = { - requestBody?: { - new_name?: string; - }; - workspace: string; -}; - -export type ChangeWorkspaceNameResponse = (string); - -export type ChangeWorkspaceIdData = { - requestBody?: { - new_id?: string; - new_name?: string; - }; - workspace: string; -}; - -export type ChangeWorkspaceIdResponse = (string); - -export type ChangeWorkspaceColorData = { - requestBody?: { - color?: string; - }; - workspace: string; -}; - -export type ChangeWorkspaceColorResponse = (string); - -export type WhoisData = { - username: string; - workspace: string; -}; - -export type WhoisResponse = (User); - -export type UpdateOperatorSettingsData = { - requestBody: OperatorSettings; - workspace: string; -}; - -export type UpdateOperatorSettingsResponse = (string); - -export type ExistsEmailData = { - email: string; -}; - -export type ExistsEmailResponse = (boolean); - -export type ListUsersAsSuperAdminData = { - /** - * filter only active users - */ - activeOnly?: boolean; - /** - * which page to return (start at 1, default 1) - */ - page?: number; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; -}; - -export type ListUsersAsSuperAdminResponse = (Array); - -export type ListPendingInvitesData = { - workspace: string; -}; - -export type ListPendingInvitesResponse = (Array); - -export type GetSettingsData = { - workspace: string; -}; - -export type GetSettingsResponse = ({ - workspace_id?: string; - slack_name?: string; - slack_team_id?: string; - slack_command_script?: string; - teams_team_id?: string; - teams_command_script?: string; - teams_team_name?: string; - auto_invite_domain?: string; - auto_invite_operator?: boolean; - auto_add?: boolean; - plan?: string; - customer_id?: string; - webhook?: string; - deploy_to?: string; - ai_config?: AIConfig; - error_handler?: string; - error_handler_extra_args?: ScriptArgs; - error_handler_muted_on_cancel: boolean; - large_file_storage?: LargeFileStorage; - git_sync?: WorkspaceGitSyncSettings; - deploy_ui?: WorkspaceDeployUISettings; - default_app?: string; - default_scripts?: WorkspaceDefaultScripts; - mute_critical_alerts?: boolean; - color?: string; - operator_settings?: OperatorSettings; -}); - -export type GetDeployToData = { - workspace: string; -}; - -export type GetDeployToResponse = ({ - deploy_to?: string; -}); - -export type GetIsPremiumData = { - workspace: string; -}; - -export type GetIsPremiumResponse = (boolean); - -export type GetPremiumInfoData = { - workspace: string; -}; - -export type GetPremiumInfoResponse = ({ - premium: boolean; - usage?: number; - owner: string; - status?: string; -}); - -export type GetThresholdAlertData = { - workspace: string; -}; - -export type GetThresholdAlertResponse = ({ - threshold_alert_amount?: number; - last_alert_sent?: string; -}); - -export type SetThresholdAlertData = { - /** - * threshold alert info - */ - requestBody: { - threshold_alert_amount?: number; - }; - workspace: string; -}; - -export type SetThresholdAlertResponse = (string); - -export type EditSlackCommandData = { - /** - * WorkspaceInvite - */ - requestBody: { - slack_command_script?: string; - }; - workspace: string; -}; - -export type EditSlackCommandResponse = (string); - -export type EditTeamsCommandData = { - /** - * WorkspaceInvite - */ - requestBody: { - slack_command_script?: string; - }; - workspace: string; -}; - -export type EditTeamsCommandResponse = (string); - -export type ListAvailableTeamsIdsData = { - workspace: string; -}; - -export type ListAvailableTeamsIdsResponse = (Array<{ - team_name?: string; - team_id?: string; -}>); - -export type ListAvailableTeamsChannelsData = { - workspace: string; -}; - -export type ListAvailableTeamsChannelsResponse = (Array<{ - channel_name?: string; - channel_id?: string; - service_url?: string; - tenant_id?: string; -}>); - -export type ConnectTeamsData = { - /** - * connect teams - */ - requestBody: { - team_id?: string; - team_name?: string; - }; - workspace: string; -}; - -export type ConnectTeamsResponse = (string); - -export type RunSlackMessageTestJobData = { - /** - * path to hub script to run and its corresponding args - */ - requestBody: { - hub_script_path?: string; - channel?: string; - test_msg?: string; - }; - workspace: string; -}; - -export type RunSlackMessageTestJobResponse = ({ - job_uuid?: string; -}); - -export type RunTeamsMessageTestJobData = { - /** - * path to hub script to run and its corresponding args - */ - requestBody: { - hub_script_path?: string; - channel?: string; - test_msg?: string; - }; - workspace: string; -}; - -export type RunTeamsMessageTestJobResponse = ({ - job_uuid?: string; -}); - -export type EditDeployToData = { - requestBody: { - deploy_to?: string; - }; - workspace: string; -}; - -export type EditDeployToResponse = (string); - -export type EditAutoInviteData = { - /** - * WorkspaceInvite - */ - requestBody: { - operator?: boolean; - invite_all?: boolean; - auto_add?: boolean; - }; - workspace: string; -}; - -export type EditAutoInviteResponse = (string); - -export type EditWebhookData = { - /** - * WorkspaceWebhook - */ - requestBody: { - webhook?: string; - }; - workspace: string; -}; - -export type EditWebhookResponse = (string); - -export type EditCopilotConfigData = { - /** - * WorkspaceCopilotConfig - */ - requestBody: AIConfig; - workspace: string; -}; - -export type EditCopilotConfigResponse = (string); - -export type GetCopilotInfoData = { - workspace: string; -}; - -export type GetCopilotInfoResponse = (AIConfig); - -export type EditErrorHandlerData = { - /** - * WorkspaceErrorHandler - */ - requestBody: { - error_handler?: string; - error_handler_extra_args?: ScriptArgs; - error_handler_muted_on_cancel?: boolean; - }; - workspace: string; -}; - -export type EditErrorHandlerResponse = (string); - -export type EditLargeFileStorageConfigData = { - /** - * LargeFileStorage info - */ - requestBody: { - large_file_storage?: LargeFileStorage; - }; - workspace: string; -}; - -export type EditLargeFileStorageConfigResponse = (unknown); - -export type EditWorkspaceGitSyncConfigData = { - /** - * Workspace Git sync settings - */ - requestBody: { - git_sync_settings?: WorkspaceGitSyncSettings; - }; - workspace: string; -}; - -export type EditWorkspaceGitSyncConfigResponse = (unknown); - -export type EditWorkspaceDeployUiSettingsData = { - /** - * Workspace deploy UI settings - */ - requestBody: { - deploy_ui_settings?: WorkspaceDeployUISettings; - }; - workspace: string; -}; - -export type EditWorkspaceDeployUiSettingsResponse = (unknown); - -export type EditWorkspaceDefaultAppData = { - /** - * Workspace default app - */ - requestBody: { - default_app_path?: string; - }; - workspace: string; -}; - -export type EditWorkspaceDefaultAppResponse = (string); - -export type EditDefaultScriptsData = { - /** - * Workspace default app - */ - requestBody?: WorkspaceDefaultScripts; - workspace: string; -}; - -export type EditDefaultScriptsResponse = (string); - -export type GetDefaultScriptsData = { - workspace: string; -}; - -export type GetDefaultScriptsResponse = (WorkspaceDefaultScripts); - -export type SetEnvironmentVariableData = { - /** - * Workspace default app - */ - requestBody: { - name: string; - value?: string; - }; - workspace: string; -}; - -export type SetEnvironmentVariableResponse = (string); - -export type GetWorkspaceEncryptionKeyData = { - workspace: string; -}; - -export type GetWorkspaceEncryptionKeyResponse = ({ - key: string; -}); - -export type SetWorkspaceEncryptionKeyData = { - /** - * New encryption key - */ - requestBody: { - new_key: string; - skip_reencrypt?: boolean; - }; - workspace: string; -}; - -export type SetWorkspaceEncryptionKeyResponse = (string); - -export type GetWorkspaceDefaultAppData = { - workspace: string; -}; - -export type GetWorkspaceDefaultAppResponse = ({ - default_app_path?: string; -}); - -export type GetLargeFileStorageConfigData = { - workspace: string; -}; - -export type GetLargeFileStorageConfigResponse = (LargeFileStorage); - -export type GetWorkspaceUsageData = { - workspace: string; -}; - -export type GetWorkspaceUsageResponse = (number); - -export type GetUsedTriggersData = { - workspace: string; -}; - -export type GetUsedTriggersResponse = ({ - http_routes_used: boolean; - websocket_used: boolean; - kafka_used: boolean; - nats_used: boolean; - postgres_used: boolean; - mqtt_used: boolean; - gcp_used: boolean; - sqs_used: boolean; -}); - -export type ListUsersData = { - workspace: string; -}; - -export type ListUsersResponse = (Array); - -export type ListUsersUsageData = { - workspace: string; -}; - -export type ListUsersUsageResponse = (Array); - -export type ListUsernamesData = { - workspace: string; -}; - -export type ListUsernamesResponse = (Array<(string)>); - -export type UsernameToEmailData = { - username: string; - workspace: string; -}; - -export type UsernameToEmailResponse = (string); - -export type CreateTokenData = { - /** - * new token - */ - requestBody: NewToken; -}; - -export type CreateTokenResponse = (string); - -export type CreateTokenImpersonateData = { - /** - * new token - */ - requestBody: NewTokenImpersonate; -}; - -export type CreateTokenImpersonateResponse = (string); - -export type DeleteTokenData = { - tokenPrefix: string; -}; - -export type DeleteTokenResponse = (string); - -export type ListTokensData = { - excludeEphemeral?: boolean; - /** - * which page to return (start at 1, default 1) - */ - page?: number; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; -}; - -export type ListTokensResponse = (Array); - -export type GetOidcTokenData = { - audience: string; - workspace: string; -}; - -export type GetOidcTokenResponse = (string); - -export type CreateVariableData = { - alreadyEncrypted?: boolean; - /** - * new variable - */ - requestBody: CreateVariable; - workspace: string; -}; - -export type CreateVariableResponse = (string); - -export type EncryptValueData = { - /** - * new variable - */ - requestBody: string; - workspace: string; -}; - -export type EncryptValueResponse = (string); - -export type DeleteVariableData = { - path: string; - workspace: string; -}; - -export type DeleteVariableResponse = (string); - -export type UpdateVariableData = { - alreadyEncrypted?: boolean; - path: string; - /** - * updated variable - */ - requestBody: EditVariable; - workspace: string; -}; - -export type UpdateVariableResponse = (string); - -export type GetVariableData = { - /** - * ask to decrypt secret if this variable is secret - * (if not secret no effect, default: true) - * - */ - decryptSecret?: boolean; - /** - * ask to include the encrypted value if secret and decrypt secret is not true (default: false) - * - */ - includeEncrypted?: boolean; - path: string; - workspace: string; -}; - -export type GetVariableResponse = (ListableVariable); - -export type GetVariableValueData = { - path: string; - workspace: string; -}; - -export type GetVariableValueResponse = (string); - -export type ExistsVariableData = { - path: string; - workspace: string; -}; - -export type ExistsVariableResponse = (boolean); - -export type ListVariableData = { - /** - * which page to return (start at 1, default 1) - */ - page?: number; - pathStart?: string; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; - workspace: string; -}; - -export type ListVariableResponse = (Array); - -export type ListContextualVariablesData = { - workspace: string; -}; - -export type ListContextualVariablesResponse = (Array); - -export type WorkspaceGetCriticalAlertsData = { - acknowledged?: (boolean) | null; - page?: number; - pageSize?: number; - workspace: string; -}; - -export type WorkspaceGetCriticalAlertsResponse = ({ - alerts?: Array; - /** - * Total number of rows matching the query. - */ - total_rows?: number; - /** - * Total number of pages based on the page size. - */ - total_pages?: number; -}); - -export type WorkspaceAcknowledgeCriticalAlertData = { - /** - * The ID of the critical alert to acknowledge - */ - id: number; - workspace: string; -}; - -export type WorkspaceAcknowledgeCriticalAlertResponse = (string); - -export type WorkspaceAcknowledgeAllCriticalAlertsData = { - workspace: string; -}; - -export type WorkspaceAcknowledgeAllCriticalAlertsResponse = (string); - -export type WorkspaceMuteCriticalAlertsUiData = { - /** - * Boolean flag to mute critical alerts. - */ - requestBody: { - /** - * Whether critical alerts should be muted. - */ - mute_critical_alerts?: boolean; - }; - workspace: string; -}; - -export type WorkspaceMuteCriticalAlertsUiResponse = (string); - -export type LoginWithOauthData = { - clientName: string; - /** - * Partially filled script - */ - requestBody: { - code?: string; - state?: string; - }; -}; - -export type LoginWithOauthResponse = (string); - -export type ConnectSlackCallbackData = { - /** - * code endpoint - */ - requestBody: { - code: string; - state: string; - }; - workspace: string; -}; - -export type ConnectSlackCallbackResponse = (string); - -export type ConnectSlackCallbackInstanceData = { - /** - * code endpoint - */ - requestBody: { - code: string; - state: string; - }; -}; - -export type ConnectSlackCallbackInstanceResponse = (string); - -export type ConnectCallbackData = { - clientName: string; - /** - * code endpoint - */ - requestBody: { - code: string; - state: string; - }; -}; - -export type ConnectCallbackResponse = (TokenResponse); - -export type CreateAccountData = { - /** - * code endpoint - */ - requestBody: { - refresh_token?: string; - expires_in: number; - client: string; - }; - workspace: string; -}; - -export type CreateAccountResponse = (string); - -export type RefreshTokenData = { - id: number; - /** - * variable path - */ - requestBody: { - path: string; - }; - workspace: string; -}; - -export type RefreshTokenResponse = (string); - -export type DisconnectAccountData = { - id: number; - workspace: string; -}; - -export type DisconnectAccountResponse = (string); - -export type DisconnectSlackData = { - workspace: string; -}; - -export type DisconnectSlackResponse = (string); - -export type DisconnectTeamsData = { - workspace: string; -}; - -export type DisconnectTeamsResponse = (string); - -export type ListOauthLoginsResponse = ({ - oauth: Array<{ - type: string; - display_name?: string; - }>; - saml?: string; -}); - -export type ListOauthConnectsResponse = (Array<(string)>); - -export type GetOauthConnectData = { - /** - * client name - */ - client: string; -}; - -export type GetOauthConnectResponse = ({ - extra_params?: { - [key: string]: unknown; - }; - scopes?: Array<(string)>; -}); - -export type SyncTeamsResponse = (Array); - -export type SendMessageToConversationData = { - requestBody: { - /** - * The ID of the Teams conversation/activity - */ - conversation_id: string; - /** - * Used for styling the card conditionally - */ - success?: boolean; - /** - * The message text to be sent in the Teams card - */ - text: string; - /** - * The card block to be sent in the Teams card - */ - card_block?: { - [key: string]: unknown; - }; - }; -}; - -export type SendMessageToConversationResponse = (unknown); - -export type CreateResourceData = { - /** - * new resource - */ - requestBody: CreateResource; - updateIfExists?: boolean; - workspace: string; -}; - -export type CreateResourceResponse = (string); - -export type DeleteResourceData = { - path: string; - workspace: string; -}; - -export type DeleteResourceResponse = (string); - -export type UpdateResourceData = { - path: string; - /** - * updated resource - */ - requestBody: EditResource; - workspace: string; -}; - -export type UpdateResourceResponse = (string); - -export type UpdateResourceValueData = { - path: string; - /** - * updated resource - */ - requestBody: { - value?: unknown; - }; - workspace: string; -}; - -export type UpdateResourceValueResponse = (string); - -export type GetResourceData = { - path: string; - workspace: string; -}; - -export type GetResourceResponse = (Resource); - -export type GetResourceValueInterpolatedData = { - /** - * job id - */ - jobId?: string; - path: string; - workspace: string; -}; - -export type GetResourceValueInterpolatedResponse = (unknown); - -export type GetResourceValueData = { - path: string; - workspace: string; -}; - -export type GetResourceValueResponse = (unknown); - -export type ExistsResourceData = { - path: string; - workspace: string; -}; - -export type ExistsResourceResponse = (boolean); - -export type ListResourceData = { - /** - * which page to return (start at 1, default 1) - */ - page?: number; - pathStart?: string; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; - /** - * resource_types to list from, separated by ',', - */ - resourceType?: string; - /** - * resource_types to not list from, separated by ',', - */ - resourceTypeExclude?: string; - workspace: string; -}; - -export type ListResourceResponse = (Array); - -export type ListSearchResourceData = { - workspace: string; -}; - -export type ListSearchResourceResponse = (Array<{ - path: string; - value: unknown; -}>); - -export type ListResourceNamesData = { - name: string; - workspace: string; -}; - -export type ListResourceNamesResponse = (Array<{ - name: string; - path: string; -}>); - -export type CreateResourceTypeData = { - /** - * new resource_type - */ - requestBody: ResourceType; - workspace: string; -}; - -export type CreateResourceTypeResponse = (string); - -export type FileResourceTypeToFileExtMapData = { - workspace: string; -}; - -export type FileResourceTypeToFileExtMapResponse = (unknown); - -export type DeleteResourceTypeData = { - path: string; - workspace: string; -}; - -export type DeleteResourceTypeResponse = (string); - -export type UpdateResourceTypeData = { - path: string; - /** - * updated resource_type - */ - requestBody: EditResourceType; - workspace: string; -}; - -export type UpdateResourceTypeResponse = (string); - -export type GetResourceTypeData = { - path: string; - workspace: string; -}; - -export type GetResourceTypeResponse = (ResourceType); - -export type ExistsResourceTypeData = { - path: string; - workspace: string; -}; - -export type ExistsResourceTypeResponse = (boolean); - -export type ListResourceTypeData = { - workspace: string; -}; - -export type ListResourceTypeResponse = (Array); - -export type ListResourceTypeNamesData = { - workspace: string; -}; - -export type ListResourceTypeNamesResponse = (Array<(string)>); - -export type QueryResourceTypesData = { - /** - * query limit - */ - limit?: number; - /** - * query text - */ - text: string; - workspace: string; -}; - -export type QueryResourceTypesResponse = (Array<{ - name: string; - score: number; - schema?: unknown; -}>); - -export type ListHubIntegrationsData = { - /** - * query integrations kind - */ - kind?: string; -}; - -export type ListHubIntegrationsResponse = (Array<{ - name: string; -}>); - -export type ListHubFlowsResponse = ({ - flows?: Array<{ - id: number; - flow_id: number; - summary: string; - apps: Array<(string)>; - approved: boolean; - votes: number; - }>; -}); - -export type GetHubFlowByIdData = { - id: number; -}; - -export type GetHubFlowByIdResponse = ({ - flow?: OpenFlow; -}); - -export type ListHubAppsResponse = ({ - apps?: Array<{ - id: number; - app_id: number; - summary: string; - apps: Array<(string)>; - approved: boolean; - votes: number; - }>; -}); - -export type GetHubAppByIdData = { - id: number; -}; - -export type GetHubAppByIdResponse = ({ - app: { - summary: string; - value: unknown; - }; -}); - -export type GetPublicAppByCustomPathData = { - customPath: string; -}; - -export type GetPublicAppByCustomPathResponse = ((AppWithLastVersion & { - workspace_id?: string; -})); - -export type GetHubScriptContentByPathData = { - path: string; -}; - -export type GetHubScriptContentByPathResponse = (string); - -export type GetHubScriptByPathData = { - path: string; -}; - -export type GetHubScriptByPathResponse = ({ - content: string; - lockfile?: string; - schema?: unknown; - language: string; - summary?: string; -}); - -export type GetTopHubScriptsData = { - /** - * query scripts app - */ - app?: string; - /** - * query scripts kind - */ - kind?: string; - /** - * query limit - */ - limit?: number; -}; - -export type GetTopHubScriptsResponse = ({ - asks?: Array<{ - id: number; - ask_id: number; - summary: string; - app: string; - version_id: number; - kind: HubScriptKind; - votes: number; - views: number; - }>; -}); - -export type QueryHubScriptsData = { - /** - * query scripts app - */ - app?: string; - /** - * query scripts kind - */ - kind?: string; - /** - * query limit - */ - limit?: number; - /** - * query text - */ - text: string; -}; - -export type QueryHubScriptsResponse = (Array<{ - ask_id: number; - id: number; - version_id: number; - summary: string; - app: string; - kind: HubScriptKind; - score: number; -}>); - -export type ListSearchScriptData = { - workspace: string; -}; - -export type ListSearchScriptResponse = (Array<{ - path: string; - content: string; -}>); - -export type ListScriptsData = { - /** - * mask to filter exact matching user creator - */ - createdBy?: string; - /** - * mask to filter scripts whom first direct parent has exact hash - */ - firstParentHash?: string; - /** - * (default false) - * include scripts that have no deployed version - * - */ - includeDraftOnly?: boolean; - /** - * (default false) - * include scripts without an exported main function - * - */ - includeWithoutMain?: boolean; - /** - * (default regardless) - * if true show only the templates - * if false show only the non templates - * if not defined, show all regardless of if the script is a template - * - */ - isTemplate?: boolean; - /** - * (default regardless) - * script kinds to filter, split by comma - * - */ - kinds?: string; - /** - * mask to filter scripts whom last parent in the chain has exact hash. - * Beware that each script stores only a limited number of parents. Hence - * the last parent hash for a script is not necessarily its top-most parent. - * To find the top-most parent you will have to jump from last to last hash - * until finding the parent - * - */ - lastParentHash?: string; - /** - * order by desc order (default true) - */ - orderDesc?: boolean; - /** - * which page to return (start at 1, default 1) - */ - page?: number; - /** - * is the hash present in the array of stored parent hashes for this script. - * The same warning applies than for last_parent_hash. A script only store a - * limited number of direct parent - * - */ - parentHash?: string; - /** - * mask to filter exact matching path - */ - pathExact?: string; - /** - * mask to filter matching starting path - */ - pathStart?: string; - /** - * number of items to return for a given page (default 30, max 100) - */ - perPage?: number; - /** - * (default false) - * show only the archived files. - * when multiple archived hash share the same path, only the ones with the latest create_at - * are - * ed. - * - */ - showArchived?: boolean; - /** - * (default false) - * show only the starred items - * - */ - starredOnly?: boolean; - /** - * (default false) - * include deployment message - * - */ - withDeploymentMsg?: boolean; - workspace: string; -}; - -export type ListScriptsResponse = (Array @@ -55,10 +54,10 @@

Workspace color

- {#if savedWorkspaceColor} + {#if $workspaceColor}
{:else} No color set @@ -76,9 +75,7 @@ }} />
-

- Color to identify the current workspace in the list of workspaces -

+

Color to identify the current workspace in the list of workspaces

@@ -88,12 +85,12 @@
{#if colorEnabled} - + {/if} diff --git a/frontend/src/lib/components/settings/ChangeWorkspaceName.svelte b/frontend/src/lib/components/settings/ChangeWorkspaceName.svelte index 52b9dfb2de..1fabd3b231 100644 --- a/frontend/src/lib/components/settings/ChangeWorkspaceName.svelte +++ b/frontend/src/lib/components/settings/ChangeWorkspaceName.svelte @@ -6,15 +6,21 @@ import Modal from '../common/modal/Modal.svelte' import { Pen } from 'lucide-svelte' - let newName = '' - let currentName = '' + let { open = false } = $props<{ open?: boolean }>() + + let newName = $state('') + let currentName = $state('') + + $effect(() => { + if ($workspaceStore) { + getWorkspaceName() + } + }) async function getWorkspaceName() { currentName = await WorkspaceService.getWorkspaceName({ workspace: $workspaceStore! }) } - getWorkspaceName() - async function renameWorkspace() { open = false await WorkspaceService.changeWorkspaceName({ @@ -28,8 +34,6 @@ newName = '' getWorkspaceName() } - - export let open = false
@@ -50,9 +54,7 @@ />
-

- Displayable name -

+

Displayable name

diff --git a/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte b/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte index c110f5df4f..f7e481b7cb 100644 --- a/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte +++ b/frontend/src/lib/components/sidebar/WorkspaceMenu.svelte @@ -5,7 +5,8 @@ userStore, userWorkspaces, workspaceStore, - workspaceUsageStore + workspaceUsageStore, + workspaceColor } from '$lib/stores' import { Building, Plus, Settings } from 'lucide-svelte' import MenuButton from '$lib/components/sidebar/MenuButton.svelte' @@ -61,7 +62,7 @@ icon={Building} label={$workspaceStore ?? ''} {isCollapsed} - color={$userWorkspaces.find((w) => w.id === $workspaceStore)?.color} + color={$workspaceColor} {trigger} /> @@ -153,9 +154,7 @@ >{$workspaceUsageStore}/1000 free workspace execs
-
{/if} diff --git a/frontend/src/lib/stores.ts b/frontend/src/lib/stores.ts index 5168b184c4..20e48d235c 100644 --- a/frontend/src/lib/stores.ts +++ b/frontend/src/lib/stores.ts @@ -9,7 +9,8 @@ import { type OperatorSettings, type TokenResponse, type UserWorkspaceList, - type WorkspaceDefaultScripts + type WorkspaceDefaultScripts, + WorkspaceService } from './gen' import { getLocalSetting } from './utils' @@ -202,3 +203,32 @@ export const dbSchemas = writable({}) export const instanceSettingsSelectedTab = writable('Core') export const isCriticalAlertsUIOpen = writable(false) + +export const workspaceColor: Readable = derived( + [workspaceStore, usersWorkspaceStore, superadmin], + ([workspaceStore, usersWorkspaceStore, superadmin], set: (value: string | undefined) => void) => { + if (!workspaceStore) { + set(undefined) + return + } + + // First try to get the color from usersWorkspaceStore + const color = usersWorkspaceStore?.workspaces.find((w) => w.id === workspaceStore)?.color + + if (color) { + set(color) + return + } + + // If not found and user is superadmin, try to get it from superadmin list + if (!superadmin) { + set(undefined) + return + } + + WorkspaceService.listWorkspacesAsSuperAdmin().then((workspaces) => { + const superadminColor = workspaces.find((w) => w.id === workspaceStore)?.color + set(superadminColor) + }) + } +) From ab7511e75f508ed5298a66e2ed5cd23b5ec783f2 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Wed, 16 Apr 2025 22:57:52 +0100 Subject: [PATCH 06/53] ensure schedule is deployed to edit and open advanced (#5626) --- frontend/src/lib/components/RunPageSchedules.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/RunPageSchedules.svelte b/frontend/src/lib/components/RunPageSchedules.svelte index 18083513bd..de392dd4d9 100644 --- a/frontend/src/lib/components/RunPageSchedules.svelte +++ b/frontend/src/lib/components/RunPageSchedules.svelte @@ -92,7 +92,7 @@ right: 'Enabled' }} on:change={async (e) => { - if (!newItem) { + if (!newItem && $initialPrimarySchedule != false) { await ScheduleService.setScheduleEnabled({ path: path, workspace: $workspaceStore ?? '', @@ -143,7 +143,7 @@

Define a schedule frequency first

{/if} - {#if $initialPrimarySchedule != false} + {#if $initialPrimarySchedule != false && !newItem}
Date: Thu, 17 Apr 2025 00:05:40 +0200 Subject: [PATCH 07/53] improve no_proxy value by default --- backend/windmill-worker/src/worker.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index e8eff2f1cd..fed83e07e0 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -284,6 +284,8 @@ lazy_static::lazy_static! { let mut proxy_env = Vec::new(); if let Some(no_proxy) = NO_PROXY.as_ref() { proxy_env.push(("NO_PROXY", no_proxy.to_string())); + } else if HTTPS_PROXY.is_some() || HTTP_PROXY.is_some() { + proxy_env.push(("NO_PROXY", "localhost,127.0.0.1".to_string())); } if let Some(http_proxy) = HTTP_PROXY.as_ref() { proxy_env.push(("HTTP_PROXY", http_proxy.to_string())); From 11e316519124bf5dd995fc0e50f2c1fdb549114a Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 17 Apr 2025 00:15:10 +0200 Subject: [PATCH 08/53] fix gcp trigger types issue temporarily by disabling them on cli --- cli/trigger.ts | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/cli/trigger.ts b/cli/trigger.ts index f099885615..2edd6b1674 100644 --- a/cli/trigger.ts +++ b/cli/trigger.ts @@ -28,7 +28,7 @@ type Trigger = { postgres: PostgresTrigger; mqtt: MqttTrigger; sqs: SqsTrigger; - gcp: GcpTrigger + gcp: GcpTrigger; }; type TriggerFile = Omit< @@ -62,7 +62,7 @@ async function getTrigger( postgres: wmill.getPostgresTrigger, mqtt: wmill.getMqttTrigger, sqs: wmill.getSqsTrigger, - gcp: wmill.getGcpTrigger + gcp: wmill.getGcpTrigger, }; const triggerFunction = triggerFunctions[triggerType]; @@ -90,7 +90,9 @@ async function updateTrigger( postgres: wmill.updatePostgresTrigger, mqtt: wmill.updateMqttTrigger, sqs: wmill.updateSqsTrigger, - gcp: wmill.updateGcpTrigger + gcp: async (args) => { + throw new Error("GCP triggers are not supported yet"); + }, }; const triggerFunction = triggerFunctions[triggerType]; await triggerFunction({ workspace, path, requestBody: trigger }); @@ -116,7 +118,9 @@ async function createTrigger( postgres: wmill.createPostgresTrigger, mqtt: wmill.createMqttTrigger, sqs: wmill.createSqsTrigger, - gcp: wmill.createGcpTrigger + gcp: async (args) => { + throw new Error("GCP triggers are not supported yet"); + }, }; const triggerFunction = triggerFunctions[triggerType]; await triggerFunction({ workspace, path, requestBody: trigger }); @@ -197,8 +201,8 @@ async function list(opts: GlobalOptions) { workspace: workspace.workspaceId, }); const gcpTriggers = await wmill.listGcpTriggers({ - workspace: workspace.workspaceId - }) + workspace: workspace.workspaceId, + }); const triggers = [ ...httpTriggers.map((x) => ({ path: x.path, kind: "http" })), ...websocketTriggers.map((x) => ({ path: x.path, kind: "websocket" })), @@ -207,7 +211,7 @@ async function list(opts: GlobalOptions) { ...postgresTriggers.map((x) => ({ path: x.path, kind: "postgres" })), ...mqttTriggers.map((x) => ({ path: x.path, kind: "mqtt" })), ...sqsTriggers.map((x) => ({ path: x.path, kind: "sqs" })), - ...gcpTriggers.map((x) => ({ path: x.path, kind: "gcp" })) + ...gcpTriggers.map((x) => ({ path: x.path, kind: "gcp" })), ]; new Table() @@ -221,7 +225,16 @@ async function list(opts: GlobalOptions) { function checkIfValidTrigger(kind: string | undefined): kind is TriggerType { if ( kind && - ["http", "websocket", "kafka", "nats", "postgres", "mqtt", "sqs", "gcp"].includes(kind) + [ + "http", + "websocket", + "kafka", + "nats", + "postgres", + "mqtt", + "sqs", + "gcp", + ].includes(kind) ) { return true; } else { From bd7c6a2a46047de5fe89753decdfdf1f4851ee3f Mon Sep 17 00:00:00 2001 From: Guilhem Date: Wed, 16 Apr 2025 23:21:00 +0100 Subject: [PATCH 09/53] fix(frontend): postgres remove selectedTable (#5386) * remove selectedTable * add deletion options * fix select * add delete option for replication slot and fixed type conversion for timestampz * fix delete active slot * fix undefined error and add schema display --------- Co-authored-by: dieriba Co-authored-by: dieriba --- backend/windmill-api/src/postgres_triggers/handler.rs | 7 ++++--- .../triggers/postgres/PostgresEditorConfigSection.svelte | 1 - .../triggers/postgres/PostgresTriggerEditorInner.svelte | 7 +++---- .../lib/components/triggers/postgres/RelationPicker.svelte | 7 ++++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/windmill-api/src/postgres_triggers/handler.rs b/backend/windmill-api/src/postgres_triggers/handler.rs index 69fe8604f2..fcb5a934ff 100644 --- a/backend/windmill-api/src/postgres_triggers/handler.rs +++ b/backend/windmill-api/src/postgres_triggers/handler.rs @@ -30,9 +30,10 @@ use windmill_common::{ }; use super::{ - create_logical_replication_slot_query, create_publication_query, drop_publication_query, - generate_random_string, get_database_connection, get_raw_postgres_connection, - ERROR_PUBLICATION_NAME_NOT_EXISTS, ERROR_REPLICATION_SLOT_NOT_EXISTS, + create_logical_replication_slot_query, create_publication_query, + drop_logical_replication_slot_query, drop_publication_query, generate_random_string, + get_database_connection, get_raw_postgres_connection, ERROR_PUBLICATION_NAME_NOT_EXISTS, + ERROR_REPLICATION_SLOT_NOT_EXISTS, }; use lazy_static::lazy_static; diff --git a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte index 29172d031a..9ed430bcee 100644 --- a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte +++ b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte @@ -35,7 +35,6 @@ export let publication: PublicationData = DEFAULT_PUBLICATION function updateValidity(publication: PublicationData) { - console.log({ publication }) isValid = !emptyString(postgres_resource_path) && (!publication.table_to_track || publication.table_to_track.length === 0) diff --git a/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte b/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte index 4956808907..988152f00c 100644 --- a/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte +++ b/frontend/src/lib/components/triggers/postgres/PostgresTriggerEditorInner.svelte @@ -45,7 +45,7 @@ let postgres_resource_path = '' let publication_name: string = '' let replication_slot_name: string = '' - let relations: Relations[] = [] + let relations: Relations[] | undefined = [] let transaction_to_track: string[] = [] let language: Language = 'Typescript' let loading = false @@ -247,11 +247,10 @@ } const getTemplateScript = async () => { - if (relations.length === 0 || emptyString(postgres_resource_path)) { + if (!relations || relations.length === 0 || emptyString(postgres_resource_path)) { sendUserToast('You must pick a database resource and choose at least one schema', true) return } - try { loading = true let templateId = await PostgresTriggerService.createTemplateScript({ @@ -359,7 +358,7 @@ allowRefresh /> - {#if script_path === undefined && is_flow === false} + {#if emptyStringTrimmed(script_path) && is_flow === false}
{/each}
- {:else if relations} + {/if} + {#if selected === 'specific'}
Date: Thu, 17 Apr 2025 00:23:55 +0200 Subject: [PATCH 10/53] chore(main): release 1.482.1 (#5623) * chore(main): release 1.482.1 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- CHANGELOG.md | 10 +++ backend/Cargo.lock | 90 +++++++++---------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 72 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b440e9a04..29ef5a0eb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.482.1](https://github.com/windmill-labs/windmill/compare/v1.482.0...v1.482.1) (2025-04-16) + + +### Bug Fixes + +* flow editor workspace script test use actual workspace script hash ([24e893b](https://github.com/windmill-labs/windmill/commit/24e893b8c50fafdb41f4b6e1777cb34aceafc466)) +* **frontend:** postgres remove selectedTable ([#5386](https://github.com/windmill-labs/windmill/issues/5386)) ([bd7c6a2](https://github.com/windmill-labs/windmill/commit/bd7c6a2a46047de5fe89753decdfdf1f4851ee3f)) +* **openapi:** fix openapi def of batch re-run jobs ([cb8731e](https://github.com/windmill-labs/windmill/commit/cb8731e7e37fb6cd052f5dae6fdce46e6ca2409c)) +* show workspace color if superadmin and not in workspace + change workspace name when switching workspace ([#5625](https://github.com/windmill-labs/windmill/issues/5625)) ([cc4384f](https://github.com/windmill-labs/windmill/commit/cc4384f48cc89f883237a2082d854d69a7b5dc56)) + ## [1.482.0](https://github.com/windmill-labs/windmill/compare/v1.481.0...v1.482.0) (2025-04-15) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 90ccbcfd85..c1a86edbb3 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -9050,9 +9050,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -9259,9 +9259,9 @@ dependencies = [ [[package]] name = "quick_cache" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f8ed0655cbaf18a26966142ad23b95d8ab47221c50c4f73a1db7d0d2d6e3da8" +checksum = "287e56aac5a2b4fb25a6fb050961d157635924c8696305a5c937a76f29841a0f" dependencies = [ "ahash 0.8.11", "equivalent", @@ -11132,9 +11132,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e22987355fbf8cfb813a0cf8cd97b1b4ec834b94dbd759a9e8679d41fabe83" +checksum = "f3c3a85280daca669cfd3bcb68a337882a8bc57ec882f72c5d13a430613a738e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -11145,9 +11145,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c4720d7d4cd3d5b00f61d03751c685ad09c33ae8290c8a2c11335e0604300b" +checksum = "f743f2a3cea30a58cd479013f75550e879009e3a02f616f18ca699335aa248c3" dependencies = [ "base64 0.22.1", "bigdecimal", @@ -11184,9 +11184,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175147fcb75f353ac7675509bc58abb2cb291caf0fd24a3623b8f7e3eb0a754b" +checksum = "7f4200e0fde19834956d4252347c12a083bdcb237d7a1a1446bffd8768417dce" dependencies = [ "proc-macro2", "quote", @@ -11197,9 +11197,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cde983058e53bfa75998e1982086c5efe3c370f3250bf0357e344fa3352e32b" +checksum = "882ceaa29cade31beca7129b6beeb05737f44f82dbe2a9806ecea5a7093d00b7" dependencies = [ "dotenvy", "either", @@ -11223,9 +11223,9 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847d2e5393a4f39e47e4f36cab419709bc2b83cbe4223c60e86e1471655be333" +checksum = "0afdd3aa7a629683c2d750c2df343025545087081ab5942593a5288855b1b7a7" dependencies = [ "atoi", "base64 0.22.1", @@ -11268,9 +11268,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc35947a541b9e0a2e3d85da444f1c4137c13040267141b208395a0d0ca4659f" +checksum = "a0bedbe1bbb5e2615ef347a5e9d8cd7680fb63e77d9dafc0f29be15e53f1ebe6" dependencies = [ "atoi", "base64 0.22.1", @@ -11309,9 +11309,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c48291dac4e5ed32da0927a0b981788be65674aeb62666d19873ab4289febde" +checksum = "c26083e9a520e8eb87a06b12347679b142dc2ea29e6e409f805644a7a979a5bc" dependencies = [ "atoi", "chrono", @@ -13912,7 +13912,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "axum", @@ -13959,7 +13959,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "argon2", @@ -14066,7 +14066,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.482.0" +version = "1.482.1" dependencies = [ "base64 0.22.1", "chrono", @@ -14081,7 +14081,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.482.0" +version = "1.482.1" dependencies = [ "chrono", "serde", @@ -14094,7 +14094,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "serde", @@ -14108,7 +14108,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "async-stream", @@ -14172,7 +14172,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.482.0" +version = "1.482.1" dependencies = [ "regex", "serde", @@ -14186,7 +14186,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "bytes", @@ -14209,7 +14209,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.482.0" +version = "1.482.1" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -14221,7 +14221,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.482.0" +version = "1.482.1" dependencies = [ "convert_case 0.6.0", "serde", @@ -14230,7 +14230,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "lazy_static", @@ -14242,7 +14242,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "serde_json", @@ -14254,7 +14254,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "gosyn", @@ -14266,7 +14266,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "lazy_static", @@ -14278,7 +14278,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "serde_json", @@ -14290,7 +14290,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "nu-parser", @@ -14301,7 +14301,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14312,7 +14312,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14323,7 +14323,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "async-recursion", @@ -14343,7 +14343,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -14360,7 +14360,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "lazy_static", @@ -14372,7 +14372,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "lazy_static", @@ -14390,7 +14390,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -14414,7 +14414,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "serde_json", @@ -14424,7 +14424,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "async-recursion", @@ -14457,7 +14457,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.482.0" +version = "1.482.1" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -14467,7 +14467,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.482.0" +version = "1.482.1" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 8e718debba..16e919618a 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.482.0" +version = "1.482.1" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.482.0" +version = "1.482.1" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 5f677f5f58..c73797244c 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.482.0 + version: 1.482.1 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 3f4a8ed24e..592cf6a006 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.482.0"; +export const VERSION = "v1.482.1"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 84e30a4bdb..b6f88d5a9e 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -63,7 +63,7 @@ export { // } // }); -export const VERSION = "1.482.0"; +export const VERSION = "1.482.1"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 69cfe8c20a..01990d9d44 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.482.0", + "version": "1.482.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.482.0", + "version": "1.482.1", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index e37e03865a..e192984785 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.482.0", + "version": "1.482.1", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index 45e4c17df2..2df2f0ee4e 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.482.0" -wmill_pg = ">=1.482.0" +wmill = ">=1.482.1" +wmill_pg = ">=1.482.1" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 6724dce66b..ab00748a74 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.482.0 + version: 1.482.1 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index 220bbd7a30..c6c64b9bb2 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.482.0' + ModuleVersion = '1.482.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index 0d460bfc45..b205777dbc 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.482.0" +version = "1.482.1" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index 24aff1ad80..3de477865b 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.482.0" +version = "1.482.1" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index 6ad1b20d4f..caa472284e 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.482.0", + "version": "1.482.1", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index 5970770b2b..f3ce3e5b22 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.482.0", + "version": "1.482.1", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index 5645e944ef..1afef9f22a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.482.0 +1.482.1 From 4198a574d475db8ca97ec6c878fd5b2bb6cddd55 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 17 Apr 2025 09:22:20 +0200 Subject: [PATCH 11/53] fix checks --- backend/windmill-api/src/postgres_triggers/handler.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/windmill-api/src/postgres_triggers/handler.rs b/backend/windmill-api/src/postgres_triggers/handler.rs index fcb5a934ff..d1cd92e8c3 100644 --- a/backend/windmill-api/src/postgres_triggers/handler.rs +++ b/backend/windmill-api/src/postgres_triggers/handler.rs @@ -30,10 +30,9 @@ use windmill_common::{ }; use super::{ - create_logical_replication_slot_query, create_publication_query, - drop_logical_replication_slot_query, drop_publication_query, generate_random_string, - get_database_connection, get_raw_postgres_connection, ERROR_PUBLICATION_NAME_NOT_EXISTS, - ERROR_REPLICATION_SLOT_NOT_EXISTS, + create_logical_replication_slot_query, create_publication_query, drop_publication_query, + generate_random_string, get_database_connection, get_raw_postgres_connection, + ERROR_PUBLICATION_NAME_NOT_EXISTS, ERROR_REPLICATION_SLOT_NOT_EXISTS, }; use lazy_static::lazy_static; @@ -396,7 +395,7 @@ pub async fn create_postgres_trigger( "Missing replication slot name".to_string(), )); } - (publication_name.unwrap(), replication_slot_name.unwrap(), ) + (publication_name.unwrap(), replication_slot_name.unwrap()) }; let mut tx = user_db.begin(&authed).await?; From 081145726a5d4ab81510a7637126a036823a1565 Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Thu, 17 Apr 2025 09:33:30 +0200 Subject: [PATCH 12/53] fix: fix click outside popover fullscreen (#5631) Co-authored-by: Diego Imbert --- frontend/src/lib/components/meltComponents/Popover.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/meltComponents/Popover.svelte b/frontend/src/lib/components/meltComponents/Popover.svelte index fc8c2c4153..4a451213a3 100644 --- a/frontend/src/lib/components/meltComponents/Popover.svelte +++ b/frontend/src/lib/components/meltComponents/Popover.svelte @@ -115,7 +115,8 @@ }} on:pointerdown_outside={() => { if (usePointerDownOutside) { - close() + if (fullScreen) fullScreen = false + else close() } }} data-popover From 2fa0717ee0f4c856ff43276e49a492f47930559d Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Thu, 17 Apr 2025 09:33:52 +0200 Subject: [PATCH 13/53] Fix batch rerun not working on pg 14 (#5624) * fix sql query for postgres 14 * deno_core when building backend image in github workflows * sqlx prepare --------- Co-authored-by: Diego Imbert --- .github/workflows/build-publish-rh-image.yml | 7 +++-- .github/workflows/docker-image-rpi4.yml | 2 +- .github/workflows/docker-image.yml | 26 +++++++------------ ...70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json | 23 ++++++++++++++++ backend/windmill-api/src/jobs.rs | 8 ++++-- 5 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json diff --git a/.github/workflows/build-publish-rh-image.yml b/.github/workflows/build-publish-rh-image.yml index 10d2fe43d9..030c617777 100644 --- a/.github/workflows/build-publish-rh-image.yml +++ b/.github/workflows/build-publish-rh-image.yml @@ -64,7 +64,7 @@ jobs: platforms: linux/amd64 push: true build-args: | - features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,license,otel,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,postgres_trigger,gcp_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,license,otel,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,postgres_trigger,gcp_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages,deno_core secrets: | rh_username=${{ secrets.RH_USERNAME }} rh_password=${{ secrets.RH_PASSWORD }} @@ -81,7 +81,7 @@ jobs: platforms: linux/arm64 push: true build-args: | - features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,license,otel,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,postgres_trigger,gcp_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,license,otel,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,postgres_trigger,gcp_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages,deno_core secrets: | rh_username=${{ secrets.RH_USERNAME }} rh_password=${{ secrets.RH_PASSWORD }} @@ -111,8 +111,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: RHEL9-amd64 build - path: - ${{ steps.extract-ee-amd64.outputs.destination + path: ${{ steps.extract-ee-amd64.outputs.destination }}/windmill-ee-amd64-rhel9 # - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/docker-image-rpi4.yml b/.github/workflows/docker-image-rpi4.yml index ed4fd7810b..b275ad2154 100644 --- a/.github/workflows/docker-image-rpi4.yml +++ b/.github/workflows/docker-image-rpi4.yml @@ -67,7 +67,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true build-args: | - features=embedding,parquet,openidconnect,license,http_trigger,zip,oauth2,postgres_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages + features=embedding,parquet,openidconnect,license,http_trigger,zip,oauth2,postgres_trigger,mqtt_trigger,websocket,smtp,static_frontend,all_languages,deno_core tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev ${{ steps.meta-public.outputs.tags }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4b5b19c74a..06f8003c96 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,10 +1,8 @@ env: REGISTRY: ghcr.io - IMAGE_NAME: - ${{ github.event_name != 'pull_request' && github.event_name != + IMAGE_NAME: ${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && github.repository || 'windmill-labs/windmill-test' }} - DEV_SHA: - ${{ github.event_name != 'pull_request' && github.event_name != + DEV_SHA: ${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && 'dev' || github.event.inputs.tag || github.sha }} name: Build windmill:main on: @@ -40,8 +38,7 @@ permissions: write-all jobs: build: runs-on: ubicloud - if: - (github.event_name != 'workflow_dispatch') || (github.event.inputs && + if: (github.event_name != 'workflow_dispatch') || (github.event.inputs && !github.event.inputs.ee) steps: - uses: actions/checkout@v4 @@ -95,7 +92,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true build-args: | - features=embedding,parquet,openidconnect,jemalloc,license,http_trigger,zip,oauth2,dind,postgres_trigger,mqtt_trigger,websocket,smtp,static_frontend,agent_worker_server,all_languages + features=embedding,parquet,openidconnect,jemalloc,license,http_trigger,zip,oauth2,dind,postgres_trigger,mqtt_trigger,websocket,smtp,static_frontend,agent_worker_server,all_languages,deno_core tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEV_SHA }} ${{ steps.meta-public.outputs.tags }} @@ -157,7 +154,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true build-args: | - features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,agent_worker_server,tantivy,license,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,otel,dind,postgres_trigger,mqtt_trigger,gcp_trigger,websocket,smtp,static_frontend,all_languages + features=enterprise,enterprise_saml,stripe,embedding,parquet,prometheus,openidconnect,cloud,jemalloc,agent_worker_server,tantivy,license,http_trigger,zip,oauth2,kafka,sqs_trigger,nats,otel,dind,postgres_trigger,mqtt_trigger,gcp_trigger,websocket,smtp,static_frontend,all_languages,deno_core tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }} ${{ steps.meta-ee-public.outputs.tags }} @@ -315,7 +312,7 @@ jobs: needs: [run_integration_test, build] if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || - startsWith(github.ref, 'refs/tags/v')) && (github.event_name != 'workflow_dispatch') + startsWith(github.ref, 'refs/tags/v')) && (github.event_name != 'workflow_dispatch') steps: - uses: actions/checkout@v4 with: @@ -355,7 +352,7 @@ jobs: verify_ee_image_vulnerabilities: runs-on: ubicloud needs: [tag_latest_ee] - if: startsWith(github.ref, 'refs/tags/v') && (github.event_name != 'workflow_dispatch') + if: startsWith(github.ref, 'refs/tags/v') && (github.event_name != 'workflow_dispatch') steps: - name: Checkout code uses: actions/checkout@v4 @@ -397,8 +394,7 @@ jobs: build_ee_nsjail: needs: [build_ee] runs-on: ubicloud - if: - (github.event_name != 'pull_request') && ((github.event_name != 'workflow_dispatch') || (github.event.inputs.ee || github.event.inputs.nsjail)) + if: (github.event_name != 'pull_request') && ((github.event_name != 'workflow_dispatch') || (github.event.inputs.ee || github.event.inputs.nsjail)) steps: - uses: actions/checkout@v4 @@ -437,7 +433,7 @@ jobs: run: | sed -i 's|FROM ghcr.io/windmill-labs/windmill-ee:dev|FROM ghcr.io/${{ env.IMAGE_NAME }}-ee:${{ env.DEV_SHA }}|' ./docker/DockerfileNsjail cat ./docker/DockerfileNsjail | grep "FROM" - + - name: Build and push publicly ee uses: depot/build-push-action@v1 with: @@ -451,12 +447,10 @@ jobs: ${{ steps.meta-ee-public.outputs.labels }} org.opencontainers.image.licenses=Windmill-Enterprise-License - publish_ecr_s3: needs: [build_ee_nsjail] runs-on: ubicloud-standard-2-arm - if: - (github.event_name != 'pull_request') && (github.event_name != + if: (github.event_name != 'pull_request') && (github.event_name != 'workflow_dispatch') env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json b/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json new file mode 100644 index 0000000000..f43524a12a --- /dev/null +++ b/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT jsonb_build_object(\n 'kind', jb.kind,\n 'script_path', jb.runnable_path,\n 'latest_schema', COALESCE(\n (SELECT DISTINCT ON (s.path) s.schema FROM script s WHERE s.path = jb.runnable_path AND jb.kind = 'script' ORDER BY s.path, s.created_at DESC),\n (SELECT flow_version.schema FROM flow LEFT JOIN flow_version ON flow_version.id = flow.versions[array_upper(flow.versions, 1)] WHERE flow.path = jb.runnable_path AND jb.kind = 'flow')\n ),\n 'schemas', ARRAY(\n SELECT jsonb_build_object(\n 'script_hash', LPAD(TO_HEX(COALESCE(s.hash, f.id)), 16, '0'),\n 'job_ids', ARRAY_AGG(DISTINCT j.id),\n 'schema', (ARRAY_AGG(COALESCE(s.schema, f.schema)))[1]\n ) FROM v2_job j\n LEFT JOIN script s ON s.hash = j.runnable_id AND j.kind = 'script'\n LEFT JOIN flow_version f ON f.id = j.runnable_id AND j.kind = 'flow'\n WHERE j.id = ANY(ARRAY_AGG(jb.id))\n GROUP BY COALESCE(s.hash, f.id)\n )\n ) FROM v2_job jb\n WHERE (jb.kind = 'flow' OR jb.kind = 'script')\n AND jb.workspace_id = $1 AND jb.id = ANY($2)\n GROUP BY jb.kind, jb.runnable_path", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "jsonb_build_object", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Text", + "UuidArray" + ] + }, + "nullable": [ + null + ] + }, + "hash": "264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6" +} diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index 1e5758d646..0948e44497 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -681,7 +681,7 @@ async fn list_selected_job_groups( SELECT jsonb_build_object( 'script_hash', LPAD(TO_HEX(COALESCE(s.hash, f.id)), 16, '0'), 'job_ids', ARRAY_AGG(DISTINCT j.id), - 'schema', ANY_VALUE(COALESCE(s.schema, f.schema)) + 'schema', (ARRAY_AGG(COALESCE(s.schema, f.schema)))[1] ) FROM v2_job j LEFT JOIN script s ON s.hash = j.runnable_id AND j.kind = 'script' LEFT JOIN flow_version f ON f.id = j.runnable_id AND j.kind = 'flow' @@ -3441,7 +3441,11 @@ async fn batch_rerun_handle_job( } InputTransform::Javascript { expr } => { #[cfg(not(feature = "deno_core"))] - tracing::error!("deno_core feature is not activated, cannot evaluate: {expr}"); + Err(error::Error::ExecutionErr( + format!("deno_core feature is not activated, cannot evaluate: {expr}") + .to_string(), + ))?; + #[cfg(feature = "deno_core")] args.insert( property_name.clone(), From 2655da07965e1a0627ad0eb53760e3708dd34088 Mon Sep 17 00:00:00 2001 From: dieriba Date: Thu, 17 Apr 2025 15:12:34 +0200 Subject: [PATCH 14/53] add old row (#5633) --- .../src/postgres_triggers/mapper.rs | 6 +- .../src/postgres_triggers/relation.rs | 2 +- .../src/postgres_triggers/trigger.rs | 90 ++++++++++++++----- frontend/src/lib/script_helpers.ts | 8 +- 4 files changed, 75 insertions(+), 31 deletions(-) diff --git a/backend/windmill-api/src/postgres_triggers/mapper.rs b/backend/windmill-api/src/postgres_triggers/mapper.rs index 817a2e8cf6..bbc7b9c011 100644 --- a/backend/windmill-api/src/postgres_triggers/mapper.rs +++ b/backend/windmill-api/src/postgres_triggers/mapper.rs @@ -124,11 +124,13 @@ export async function main( transaction_type: "insert" | "update" | "delete", schema_name: string, table_name: string, - row: {} + row: {}, + old_row?: {} ) {{ }} "#, - struct_definition + &struct_definition, + &struct_definition ) } } diff --git a/backend/windmill-api/src/postgres_triggers/relation.rs b/backend/windmill-api/src/postgres_triggers/relation.rs index f893f0ed5b..f313efb893 100644 --- a/backend/windmill-api/src/postgres_triggers/relation.rs +++ b/backend/windmill-api/src/postgres_triggers/relation.rs @@ -47,7 +47,7 @@ impl RelationConverter { .ok_or(RelationConversionError::FailToFindMatchingTable) } - pub fn body_to_json( + pub fn row_to_json( &self, to_decode: (Oid, Vec), ) -> Result, RelationConversionError> { diff --git a/backend/windmill-api/src/postgres_triggers/trigger.rs b/backend/windmill-api/src/postgres_triggers/trigger.rs index 2ba161b268..746dca99eb 100644 --- a/backend/windmill-api/src/postgres_triggers/trigger.rs +++ b/backend/windmill-api/src/postgres_triggers/trigger.rs @@ -650,37 +650,79 @@ async fn listen_to_transactions( None } Insert(insert) => { - Some((insert.o_id, relations.body_to_json((insert.o_id, insert.tuple)), "insert")) + Some((insert.o_id, Ok(None), relations.row_to_json((insert.o_id, insert.tuple)), "insert")) } Update(update) => { - Some((update.o_id, relations.body_to_json((update.o_id, update.new_tuple)), "update")) + let old_row = update.old_tuple.map(|old_tuple| relations.row_to_json((update.o_id, old_tuple))).transpose(); + let row = relations.row_to_json((update.o_id, update.new_tuple)); + Some((update.o_id, old_row, row, "update")) } Delete(delete) => { - let body = delete.old_tuple.unwrap_or_else(|| delete.key_tuple.unwrap()); - Some((delete.o_id, relations.body_to_json((delete.o_id, body)), "delete")) + let row = delete.old_tuple.unwrap_or_else(|| delete.key_tuple.unwrap()); + Some((delete.o_id, Ok(None), relations.row_to_json((delete.o_id, row)), "delete")) } }; - if let Some((o_id, Ok(body), transaction_type)) = json { - let relation = match relations.get_relation(o_id) { - Ok(relation) => relation, - Err(err) => { - tracing::error!("Postgres trigger named: {}, error: {}", pg.get_path(), err.to_string()); - continue; + match json { + Some((o_id, Ok(old_row), Ok(row), transaction_type)) => { + let relation = match relations.get_relation(o_id) { + Ok(relation) => relation, + Err(err) => { + tracing::error!("Postgres trigger named: {}, error: {}", pg.get_path(), err.to_string()); + continue; + } + }; + let database_info = HashMap::from([ + ("schema_name".to_string(), to_raw_value(&relation.namespace)), + ("table_name".to_string(), to_raw_value(&relation.name)), + ("transaction_type".to_string(), to_raw_value(&transaction_type)), + ("old_row".to_string(), to_raw_value(&old_row)), + ("row".to_string(), to_raw_value(&row)), + ]); + let extra = Some(HashMap::from([( + "wm_trigger".to_string(), + to_raw_value(&serde_json::json!({"kind": "postgres", })), + )])); + + + let _ = pg.handle(&db, Some(database_info), extra).await; + } + Some((o_id, old_row, row, transaction_type)) => { + let relation = match relations.get_relation(o_id) { + Ok(relation) => relation, + Err(err) => { + tracing::error!("Postgres trigger named: {}, error: {}", pg.get_path(), err.to_string()); + continue; + } + }; + + if let Err(err) = old_row { + tracing::error!( + transaction_type = ?transaction_type, + schema = %relation.namespace, + table = %relation.name, + error = %err, + "Failed to decode OLD row for {} transaction on {}.{}", + transaction_type, + relation.namespace, + relation.name, + ); } - }; - let database_info = HashMap::from([ - ("schema_name".to_string(), to_raw_value(&relation.namespace)), - ("table_name".to_string(), to_raw_value(&relation.name)), - ("transaction_type".to_string(), to_raw_value(&transaction_type)), - ("row".to_string(), to_raw_value(&body)), - ]); - let extra = Some(HashMap::from([( - "wm_trigger".to_string(), - to_raw_value(&serde_json::json!({"kind": "postgres", })), - )])); - - - let _ = pg.handle(&db, Some(database_info), extra).await; + + if let Err(err) = row { + tracing::error!( + transaction_type = ?transaction_type, + schema = %relation.namespace, + table = %relation.name, + error = %err, + "Failed to decode NEW row for {} transaction on {}.{}", + transaction_type, + relation.namespace, + relation.name, + ); + } + + } + _ => {} } } diff --git a/frontend/src/lib/script_helpers.ts b/frontend/src/lib/script_helpers.ts index a32f31e5ee..9e90ebe74c 100644 --- a/frontend/src/lib/script_helpers.ts +++ b/frontend/src/lib/script_helpers.ts @@ -634,7 +634,7 @@ export const TS_PREPROCESSOR_SCRIPT_INTRO = `/** * The preprocessor receives trigger metadata (\`wm_trigger\`) along with the main trigger arguments. * The structure of \`wm_trigger\` and the main trigger arguments are specific to each trigger type: * - Webhook/HTTP: \`(wm_trigger: { kind: 'http' | 'webhook', http?: { ... } }, body_key_1: any, body_key_2: any, ...)\` - * - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, row: any)\` + * - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, old_row?: any, row: any)\` * - WebSocket/Kafka/NATS/SQS: \`(wm_trigger: { kind: 'websocket' | 'kafka' | 'nats' | 'sqs', [kind]: { ... } }, msg: string)\` * - MQTT: \`(wm_trigger: { kind: 'mqtt', [kind]: { ... } }, payload: Array)\` * - GCP: \`(wm_trigger: { kind: 'gcp', [kind]: { ... } }, payload: string)\` @@ -656,7 +656,7 @@ export const TS_PREPROCESSOR_FLOW_INTRO = `/** * The preprocessor receives trigger metadata (\`wm_trigger\`) along with the main trigger arguments. * The structure of \`wm_trigger\` and the main trigger arguments are specific to each trigger type: * - Webhook/HTTP: \`(wm_trigger: { kind: 'http' | 'webhook', http?: { ... } }, body_key_1: any, body_key_2: any, ...)\` - * - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, row: any)\` + * - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, old_row?: any, row: any)\` * - WebSocket/Kafka/NATS/SQS: \`(wm_trigger: { kind: 'websocket' | 'kafka' | 'nats' | 'sqs', [kind]: { ... } }, msg: string)\` * - MQTT: \`(wm_trigger: { kind: 'mqtt', [kind]: { ... } }, payload: Array)\` * - GCP: \`(wm_trigger: { kind: 'gcp', [kind]: { ... } }, payload: string)\`* @@ -781,7 +781,7 @@ export const PYTHON_PREPROCESSOR_SCRIPT_INTRO = `# Trigger preprocessor # The preprocessor receives trigger metadata (\`wm_trigger\`) along with the main trigger arguments. # The structure of \`wm_trigger\` and the main trigger arguments are specific to each trigger type: # - Webhook/HTTP: \`(wm_trigger: { kind: 'http' | 'webhook', http?: { ... } }, body_key_1: any, body_key_2: any, ...)\` -# - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, row: any)\` +# - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, old_row?: any, row: any)\` # - WebSocket/Kafka/NATS/SQS: \`(wm_trigger: { kind: 'websocket' | 'kafka' | 'nats' | 'sqs', [kind]: { ... } }, msg: string)\` # - MQTT: \`(wm_trigger: { kind: 'mqtt', [kind]: { ... } }, payload: Array)\` # - GCP: \`(wm_trigger: { kind: 'gcp', [kind]: { ... } }, payload: string)\` @@ -801,7 +801,7 @@ export const PYTHON_PREPROCESSOR_FLOW_INTRO = `# Trigger preprocessor # The preprocessor receives the same data the flow would if no preprocessor was used, # plus trigger metadata in the \`wm_trigger\` object: # - Webhook/HTTP: \`(wm_trigger: { kind: 'http' | 'webhook', http?: { ... } }, body_key_1: any, body_key_2: any, ...)\` -# - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, row: any)\` +# - Postgres: \`(wm_trigger: { kind: 'postgres' }, transaction_type: string, schema_name: string, table_name: string, old_row?:any, row: any)\` # - WebSocket/Kafka/NATS/SQS: \`(wm_trigger: { kind: 'websocket' | 'kafka' | 'nats' | 'sqs', [kind]: { ... } }, msg: string)\` # - MQTT: \`(wm_trigger: { kind: 'mqtt', [kind]: { ... } }, payload: Array)\` # - GCP: \`(wm_trigger: { kind: 'gcp', [kind]: { ... } }, payload: string)\` From 34b307b2be1f6cf92a81694325f4c333bdd7b055 Mon Sep 17 00:00:00 2001 From: dieriba Date: Thu, 17 Apr 2025 15:36:17 +0200 Subject: [PATCH 15/53] feat: oidc support for sqs trigger (#5614) * feat: oidc auth with sqs * rafctor * update: add id token struct * update has_expired function * fix duration * fix typo * Update backend/windmill-common/src/auth.rs Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Update backend/windmill-common/src/auth.rs Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * update ref * update sqlx * update resource type * update repo ref * Update settings.json --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- ...b65cdcd277257192ee0a6d18a00f41bce49d4.json | 22 --- ...543252891c53351bdc98da66cc30ffc895866.json | 22 --- ...4cdb6eae2e71e56bc8e5215559af967c81bd8.json | 79 ---------- ...4809e7b7f2c1b0d53b10da3b5578d337e28ec.json | 14 ++ ...0d206b722ec4192368599c3a5027f50a89c80.json | 14 -- ...4844b4c1a38701190795a801fa43c74a0beeb.json | 22 --- ...ff808ba646f4f99d0c8837097e747b481f03a.json | 22 --- ...deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json | 22 --- ...f1bfbe4e2db85da9a478a07460733999e9beb.json | 20 --- ...8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json | 28 ---- ...3b077c957da8455ea747b0680923d8282425b.json | 73 --------- ...75b58d65ca93d68b29124d04bd526239b9df2.json | 15 -- ...7e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8.json | 73 --------- ...b1ec3fc844ed286ff563f0c9a5c4778cfb718.json | 67 --------- ...110efa11a7731ad0f0e5509f55efabdf535cd.json | 22 --- ...05d394a7cbcf0038c72a78add5c7b02ef5927.json | 2 +- ...32580dc7f7a9e5a67026f8c0b3077f371fc62.json | 22 --- backend/.vscode/settings.json | 2 +- backend/Cargo.lock | 1 + backend/Cargo.toml | 2 +- backend/ee-repo-ref.txt | 2 +- backend/windmill-api/Cargo.toml | 1 + backend/windmill-common/Cargo.toml | 1 + backend/windmill-common/src/auth.rs | 138 ++++++++++++++++++ .../sqs/SqsTriggerEditorConfigSection.svelte | 2 +- 25 files changed, 160 insertions(+), 528 deletions(-) delete mode 100644 backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json delete mode 100644 backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json delete mode 100644 backend/.sqlx/query-3376b42d273c2499f3517c7754f4cdb6eae2e71e56bc8e5215559af967c81bd8.json create mode 100644 backend/.sqlx/query-65e6aa50db7cb878ce456d6665a4809e7b7f2c1b0d53b10da3b5578d337e28ec.json delete mode 100644 backend/.sqlx/query-85c116da4a43a5ade37bb9ab2660d206b722ec4192368599c3a5027f50a89c80.json delete mode 100644 backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json delete mode 100644 backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json delete mode 100644 backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json delete mode 100644 backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json delete mode 100644 backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json delete mode 100644 backend/.sqlx/query-b61a00e6a8ca0a1d24e64fdc9223b077c957da8455ea747b0680923d8282425b.json delete mode 100644 backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json delete mode 100644 backend/.sqlx/query-c4f382045e5c47986e02f1e57667e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8.json delete mode 100644 backend/.sqlx/query-ccd4c7fe5fbdf1ab4bbbbd7d2a9b1ec3fc844ed286ff563f0c9a5c4778cfb718.json delete mode 100644 backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json delete mode 100644 backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json diff --git a/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json b/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json deleted file mode 100644 index 84c0804c95..0000000000 --- a/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT suspend > 0 AS \"r!\" FROM v2_job_queue WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "r!", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - null - ] - }, - "hash": "12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4" -} diff --git a/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json b/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json deleted file mode 100644 index e9705c23a6..0000000000 --- a/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT script_path FROM v2_as_completed_job WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "script_path", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - true - ] - }, - "hash": "280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866" -} diff --git a/backend/.sqlx/query-3376b42d273c2499f3517c7754f4cdb6eae2e71e56bc8e5215559af967c81bd8.json b/backend/.sqlx/query-3376b42d273c2499f3517c7754f4cdb6eae2e71e56bc8e5215559af967c81bd8.json deleted file mode 100644 index 7229d4053f..0000000000 --- a/backend/.sqlx/query-3376b42d273c2499f3517c7754f4cdb6eae2e71e56bc8e5215559af967c81bd8.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT \n j.id,\n j.kind AS \"kind: _\",\n COALESCE(s.path, f.path) AS \"script_path!\",\n COALESCE(s.hash, f.id) AS \"script_hash!: _\",\n COALESCE(jc.started_at, jq.scheduled_for, make_date(1970, 1, 1)) AS \"scheduled_for!: _\",\n args AS input\n FROM v2_job j\n LEFT JOIN script s ON j.runnable_id = s.hash AND j.kind = 'script'\n LEFT JOIN flow_version f ON j.runnable_id = f.id AND j.runnable_path = f.path AND j.kind = 'flow'\n LEFT JOIN v2_job_completed jc ON jc.id = j.id\n LEFT JOIN v2_job_queue jq ON jq.id = j.id\n WHERE j.id = ANY($1)\n AND j.workspace_id = $2\n AND COALESCE(s.hash, f.id) IS NOT NULL\n AND COALESCE(s.path, f.path) IS NOT NULL", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "kind: _", - "type_info": { - "Custom": { - "name": "job_kind", - "kind": { - "Enum": [ - "script", - "preview", - "flow", - "dependencies", - "flowpreview", - "script_hub", - "identity", - "flowdependencies", - "http", - "graphql", - "postgresql", - "noop", - "appdependencies", - "deploymentcallback", - "singlescriptflow", - "flowscript", - "flownode", - "appscript" - ] - } - } - } - }, - { - "ordinal": 2, - "name": "script_path!", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "script_hash!: _", - "type_info": "Int8" - }, - { - "ordinal": 4, - "name": "scheduled_for!: _", - "type_info": "Timestamptz" - }, - { - "ordinal": 5, - "name": "input", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "UuidArray", - "Text" - ] - }, - "nullable": [ - false, - false, - null, - null, - null, - true - ] - }, - "hash": "3376b42d273c2499f3517c7754f4cdb6eae2e71e56bc8e5215559af967c81bd8" -} diff --git a/backend/.sqlx/query-65e6aa50db7cb878ce456d6665a4809e7b7f2c1b0d53b10da3b5578d337e28ec.json b/backend/.sqlx/query-65e6aa50db7cb878ce456d6665a4809e7b7f2c1b0d53b10da3b5578d337e28ec.json new file mode 100644 index 0000000000..7a7b066e97 --- /dev/null +++ b/backend/.sqlx/query-65e6aa50db7cb878ce456d6665a4809e7b7f2c1b0d53b10da3b5578d337e28ec.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO global_settings (name, value)\n VALUES ('rsa_keys', $1)\n ON CONFLICT (name) DO UPDATE\n SET value = EXCLUDED.value\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "65e6aa50db7cb878ce456d6665a4809e7b7f2c1b0d53b10da3b5578d337e28ec" +} diff --git a/backend/.sqlx/query-85c116da4a43a5ade37bb9ab2660d206b722ec4192368599c3a5027f50a89c80.json b/backend/.sqlx/query-85c116da4a43a5ade37bb9ab2660d206b722ec4192368599c3a5027f50a89c80.json deleted file mode 100644 index a54cdf49ab..0000000000 --- a/backend/.sqlx/query-85c116da4a43a5ade37bb9ab2660d206b722ec4192368599c3a5027f50a89c80.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO global_settings (name, value) VALUES ('rsa_keys', $1)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "85c116da4a43a5ade37bb9ab2660d206b722ec4192368599c3a5027f50a89c80" -} diff --git a/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json b/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json deleted file mode 100644 index 9232baf39c..0000000000 --- a/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT workflow_as_code_status FROM v2_job_completed WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "workflow_as_code_status", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - true - ] - }, - "hash": "867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb" -} diff --git a/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json b/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json deleted file mode 100644 index 68982a2183..0000000000 --- a/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT id FROM v2_job WHERE parent_job = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Uuid" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false - ] - }, - "hash": "99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a" -} diff --git a/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json b/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json deleted file mode 100644 index 79bd8d0666..0000000000 --- a/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT labels FROM v2_job WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "labels", - "type_info": "TextArray" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - true - ] - }, - "hash": "9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d" -} diff --git a/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json b/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json deleted file mode 100644 index 298a66c89c..0000000000 --- a/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT count(*) AS \"count!\" FROM resume_job", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "count!", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb" -} diff --git a/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json b/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json deleted file mode 100644 index eb852c75ee..0000000000 --- a/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT preprocessed, script_entrypoint_override FROM v2_job WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "preprocessed", - "type_info": "Bool" - }, - { - "ordinal": 1, - "name": "script_entrypoint_override", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - true, - true - ] - }, - "hash": "a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0" -} diff --git a/backend/.sqlx/query-b61a00e6a8ca0a1d24e64fdc9223b077c957da8455ea747b0680923d8282425b.json b/backend/.sqlx/query-b61a00e6a8ca0a1d24e64fdc9223b077c957da8455ea747b0680923d8282425b.json deleted file mode 100644 index 80f0549739..0000000000 --- a/backend/.sqlx/query-b61a00e6a8ca0a1d24e64fdc9223b077c957da8455ea747b0680923d8282425b.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT\n j.kind AS \"kind!: JobKind\",\n j.runnable_id AS \"script_hash: _\",\n j.runnable_path AS script_path,\n COUNT(*) AS \"count!\",\n ANY_VALUE(COALESCE(f.schema, s.schema)) AS schema\n FROM v2_job j\n LEFT JOIN script s ON s.hash = j.runnable_id AND j.kind = 'script'\n LEFT JOIN flow_version f ON f.id = j.runnable_id AND f.path = j.runnable_path AND j.kind = 'flow'\n WHERE COALESCE(s.hash, f.id) IS NOT NULL\n AND COALESCE(s.path, f.path) IS NOT NULL\n AND j.workspace_id = $1 AND j.id = ANY($2)\n GROUP BY j.runnable_id, j.runnable_path, j.kind", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "kind!: JobKind", - "type_info": { - "Custom": { - "name": "job_kind", - "kind": { - "Enum": [ - "script", - "preview", - "flow", - "dependencies", - "flowpreview", - "script_hub", - "identity", - "flowdependencies", - "http", - "graphql", - "postgresql", - "noop", - "appdependencies", - "deploymentcallback", - "singlescriptflow", - "flowscript", - "flownode", - "appscript" - ] - } - } - } - }, - { - "ordinal": 1, - "name": "script_hash: _", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "script_path", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "count!", - "type_info": "Int8" - }, - { - "ordinal": 4, - "name": "schema", - "type_info": "Json" - } - ], - "parameters": { - "Left": [ - "Text", - "UuidArray" - ] - }, - "nullable": [ - false, - true, - true, - null, - null - ] - }, - "hash": "b61a00e6a8ca0a1d24e64fdc9223b077c957da8455ea747b0680923d8282425b" -} diff --git a/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json b/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json deleted file mode 100644 index 81a97984ee..0000000000 --- a/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE v2_job SET labels = $2 WHERE id = $1 AND $2::TEXT[] IS NOT NULL", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "TextArray" - ] - }, - "nullable": [] - }, - "hash": "bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2" -} diff --git a/backend/.sqlx/query-c4f382045e5c47986e02f1e57667e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8.json b/backend/.sqlx/query-c4f382045e5c47986e02f1e57667e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8.json deleted file mode 100644 index e976cd0dd9..0000000000 --- a/backend/.sqlx/query-c4f382045e5c47986e02f1e57667e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT DISTINCT ON (j.runnable_path, j.kind) \n j.kind AS \"kind!: JobKind\",\n j.runnable_path AS script_path,\n NULL as \"script_hash: _\",\n -1::bigint as \"count!: _\",\n COALESCE(f.schema, s.schema) AS schema\n FROM v2_job j\n LEFT JOIN script s ON s.path = j.runnable_path AND j.kind = 'script'\n LEFT JOIN flow_version f ON f.path = j.runnable_path AND j.kind = 'flow'\n WHERE COALESCE(s.hash, f.id) IS NOT NULL\n AND j.workspace_id = $1 AND j.id = ANY($2)\n ORDER BY j.runnable_path, j.kind, COALESCE(f.created_at, s.created_at) DESC", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "kind!: JobKind", - "type_info": { - "Custom": { - "name": "job_kind", - "kind": { - "Enum": [ - "script", - "preview", - "flow", - "dependencies", - "flowpreview", - "script_hub", - "identity", - "flowdependencies", - "http", - "graphql", - "postgresql", - "noop", - "appdependencies", - "deploymentcallback", - "singlescriptflow", - "flowscript", - "flownode", - "appscript" - ] - } - } - } - }, - { - "ordinal": 1, - "name": "script_path", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "script_hash: _", - "type_info": "Text" - }, - { - "ordinal": 3, - "name": "count!: _", - "type_info": "Int8" - }, - { - "ordinal": 4, - "name": "schema", - "type_info": "Json" - } - ], - "parameters": { - "Left": [ - "Text", - "UuidArray" - ] - }, - "nullable": [ - false, - true, - null, - null, - null - ] - }, - "hash": "c4f382045e5c47986e02f1e57667e6b3cb1d60f15fed9a24e3f05b1bd60c0fc8" -} diff --git a/backend/.sqlx/query-ccd4c7fe5fbdf1ab4bbbbd7d2a9b1ec3fc844ed286ff563f0c9a5c4778cfb718.json b/backend/.sqlx/query-ccd4c7fe5fbdf1ab4bbbbd7d2a9b1ec3fc844ed286ff563f0c9a5c4778cfb718.json deleted file mode 100644 index a457b8b2bf..0000000000 --- a/backend/.sqlx/query-ccd4c7fe5fbdf1ab4bbbbd7d2a9b1ec3fc844ed286ff563f0c9a5c4778cfb718.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT j.kind AS \"kind: _\", COALESCE(s.path, f.path) AS \"script_path!\", COALESCE(s.hash, f.id) AS \"script_hash!: _\", args\n FROM v2_job j\n LEFT JOIN script s ON j.runnable_id = s.hash AND j.kind = 'script'\n LEFT JOIN flow_version f ON j.runnable_id = f.id AND j.runnable_path = f.path AND j.kind = 'flow'\n WHERE j.id = ANY($1)\n AND j.workspace_id = $2\n AND COALESCE(s.hash, f.id) IS NOT NULL\n AND COALESCE(s.path, f.path) IS NOT NULL", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "kind: _", - "type_info": { - "Custom": { - "name": "job_kind", - "kind": { - "Enum": [ - "script", - "preview", - "flow", - "dependencies", - "flowpreview", - "script_hub", - "identity", - "flowdependencies", - "http", - "graphql", - "postgresql", - "noop", - "appdependencies", - "deploymentcallback", - "singlescriptflow", - "flowscript", - "flownode", - "appscript" - ] - } - } - } - }, - { - "ordinal": 1, - "name": "script_path!", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "script_hash!: _", - "type_info": "Int8" - }, - { - "ordinal": 3, - "name": "args", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "UuidArray", - "Text" - ] - }, - "nullable": [ - false, - null, - null, - true - ] - }, - "hash": "ccd4c7fe5fbdf1ab4bbbbd7d2a9b1ec3fc844ed286ff563f0c9a5c4778cfb718" -} diff --git a/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json b/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json deleted file mode 100644 index f5eb13f1fd..0000000000 --- a/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT preprocessed FROM v2_job WHERE id = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "preprocessed", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - true - ] - }, - "hash": "cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd" -} diff --git a/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json b/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json index c2dfed73a2..5bfff47576 100644 --- a/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json +++ b/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json @@ -15,7 +15,7 @@ ] }, "nullable": [ - null + true ] }, "hash": "ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927" diff --git a/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json b/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json deleted file mode 100644 index 08c5851944..0000000000 --- a/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT hash FROM script WHERE path = $1", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "hash", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false - ] - }, - "hash": "ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62" -} diff --git a/backend/.vscode/settings.json b/backend/.vscode/settings.json index ab8340f5c8..6ebd36cf07 100644 --- a/backend/.vscode/settings.json +++ b/backend/.vscode/settings.json @@ -11,5 +11,5 @@ "remote.autoForwardPorts": true, "conventionalCommits.scopes": [ "restructring triggers, decoding trigger message on work" - ], + ] } diff --git a/backend/Cargo.lock b/backend/Cargo.lock index c1a86edbb3..abcb8cf486 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -13970,6 +13970,7 @@ dependencies = [ "async_zip", "aws-config", "aws-sdk-sqs", + "aws-sdk-sts", "axum", "base32", "base64 0.22.1", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 16e919618a..73c7214f1d 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -73,7 +73,7 @@ websocket = ["windmill-api/websocket"] http_trigger = ["windmill-api/http_trigger"] postgres_trigger = ["windmill-api/postgres_trigger"] mqtt_trigger = ["windmill-api/mqtt_trigger"] -sqs_trigger = ["windmill-api/sqs_trigger"] +sqs_trigger = ["windmill-api/sqs_trigger", "windmill-common/aws_auth", "windmill-api/openidconnect"] gcp_trigger = ["windmill-api/gcp_trigger"] smtp = ["windmill-api/smtp", "windmill-common/smtp"] license = ["windmill-api/license"] diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 91f337034b..d64168d898 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -1475a504133766e005ec551004c2af2283663352 \ No newline at end of file +29a22d49c710bf21abcfe0e4c081e7eace4ac21e \ No newline at end of file diff --git a/backend/windmill-api/Cargo.toml b/backend/windmill-api/Cargo.toml index 0996b5956d..09f6dac049 100644 --- a/backend/windmill-api/Cargo.toml +++ b/backend/windmill-api/Cargo.toml @@ -133,6 +133,7 @@ rust-postgres-native-tls = { workspace = true, optional = true} rumqttc = { workspace = true, optional = true } aws-sdk-sqs = { workspace = true, optional = true } aws-config = { workspace = true, optional = true } +aws-sdk-sts = { workspace = true, optional = true } google-cloud-pubsub = { workspace = true, optional = true } google-cloud-googleapis = { workspace = true , optional = true } tonic = { workspace = true, optional = true } diff --git a/backend/windmill-common/Cargo.toml b/backend/windmill-common/Cargo.toml index 140d3e2b74..a0278a4c2e 100644 --- a/backend/windmill-common/Cargo.toml +++ b/backend/windmill-common/Cargo.toml @@ -13,6 +13,7 @@ prometheus = ["dep:prometheus"] loki = ["dep:tracing-loki"] benchmark = [] parquet = ["dep:object_store", "dep:aws-config", "dep:aws-sdk-sts"] +aws_auth = ["dep:aws-sdk-sts", "dep:aws-config"] otel = ["dep:opentelemetry-semantic-conventions", "dep:opentelemetry-otlp", "dep:opentelemetry_sdk", "dep:opentelemetry", "dep:tracing-opentelemetry", "dep:opentelemetry-appender-tracing", "dep:tonic"] smtp = ["dep:mail-send"] diff --git a/backend/windmill-common/src/auth.rs b/backend/windmill-common/src/auth.rs index 0266498773..cbbda52588 100644 --- a/backend/windmill-common/src/auth.rs +++ b/backend/windmill-common/src/auth.rs @@ -1,4 +1,5 @@ use anyhow::Context; +use chrono::{DateTime, Duration, Utc}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -10,6 +11,48 @@ use crate::{ DB, }; +#[derive(Debug)] +pub struct IdToken { + token: String, + expiration: DateTime, +} + +pub fn has_expired(expiration_time: DateTime, take: Option) -> bool { + let now = Utc::now(); + + let expiration = match take { + Some(duration) => expiration_time - duration, + None => expiration_time, + }; + + now > expiration +} + +impl From for String { + fn from(value: IdToken) -> Self { + value.token + } +} + +impl ToString for IdToken { + fn to_string(&self) -> String { + self.token.clone() + } +} + +impl IdToken { + pub fn new(token: String, expiration: DateTime) -> Self { + Self { token, expiration } + } + + pub fn token(&self) -> &str { + &self.token + } + pub fn expiration(&self) -> &DateTime { + &self.expiration + } +} + #[derive(Deserialize, Serialize)] pub struct JWTAuthClaims { pub email: String, @@ -267,3 +310,98 @@ pub async fn create_token_for_owner( Ok(format!("jwt_{}", token)) } + +#[cfg(feature = "aws_auth")] +pub mod aws { + + use crate::error::to_anyhow; + + use super::*; + use crate::utils::empty_string_as_none; + use aws_config::{BehaviorVersion, Region}; + use aws_sdk_sts::{ + config::Credentials as AwsCredentials, + operation::{ + assume_role_with_saml::AssumeRoleWithSamlOutput, + assume_role_with_web_identity::AssumeRoleWithWebIdentityOutput, + }, + types::Credentials, + Client, + }; + + pub const AWS_OIDC_AUDIENCE: &'static str = "sts.amazonaws.com"; + + pub trait GetAuthenticationOutput { + fn get_credentials(&self) -> Result<&Credentials>; + } + + impl GetAuthenticationOutput for AssumeRoleWithSamlOutput { + fn get_credentials(&self) -> Result<&Credentials> { + let credentials = self.credentials.as_ref().ok_or(Error::BadGateway( + "Error fetching credentials from AWS STS".to_string(), + ))?; + Ok(credentials) + } + } + + impl GetAuthenticationOutput for AssumeRoleWithWebIdentityOutput { + fn get_credentials(&self) -> Result<&Credentials> { + let credentials = self.credentials.as_ref().ok_or(Error::BadGateway( + "Error fetching credentials from AWS STS".to_string(), + ))?; + Ok(credentials) + } + } + + #[derive(Debug, Deserialize)] + pub struct CredentialsAuth { + #[serde(deserialize_with = "empty_string_as_none")] + pub region: Option, + pub access_key_id: String, + pub secret_access_key: String, + } + + #[derive(Clone, Debug, Deserialize)] + pub struct OidcAuth { + #[serde(deserialize_with = "empty_string_as_none")] + pub region: Option, + pub role_arn: String, + } + + #[derive(Debug, Deserialize)] + #[serde(untagged)] + pub enum AWSAuthConfig { + Credentials(CredentialsAuth), + Oidc(OidcAuth), + } + + pub async fn get_oidc_authentication_data( + oidc_auth: OidcAuth, + role_session_name: Option, + token: String, + ) -> Result { + let region = oidc_auth.region.unwrap_or_else(|| "us-east-1".to_string()); + + let credentials = AwsCredentials::new("", "", None, None, "UserInput"); + + let config = aws_config::defaults(BehaviorVersion::latest()) + .credentials_provider(credentials) + .region(Region::new(region.clone())) + .load() + .await; + + let assume_role_with_web_identity_fluent_builder = Client::new(&config) + .assume_role_with_web_identity() + .set_role_arn(Some(oidc_auth.role_arn)) + .set_role_session_name(role_session_name.map(|str| str.to_string())) + .set_web_identity_token(Some(token)); + + let resp = assume_role_with_web_identity_fluent_builder + .clone() + .send() + .await + .map_err(to_anyhow)?; + + Ok(resp) + } +} diff --git a/frontend/src/lib/components/triggers/sqs/SqsTriggerEditorConfigSection.svelte b/frontend/src/lib/components/triggers/sqs/SqsTriggerEditorConfigSection.svelte index 48f89730ab..80b6d4f513 100644 --- a/frontend/src/lib/components/triggers/sqs/SqsTriggerEditorConfigSection.svelte +++ b/frontend/src/lib/components/triggers/sqs/SqsTriggerEditorConfigSection.svelte @@ -64,7 +64,7 @@ required={true} />

- + {#if isValid} {/if} From 58fa4c80062a5704bbd13ddda1b2f00c7c9e40dd Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Thu, 17 Apr 2025 15:41:41 +0200 Subject: [PATCH 16/53] fix: improve flow editor step switch performance * replace on click wt on pointer down on flow node click * pointerdown on virtualitems * Load monaco async with a placeholder to avoid size flash * monaco placeholder for editor * less flashing * simulate first line bg * better match to monaco * more fine tune * fix for increased browser font sizes * flow nodes feel much better to click on * move setTimeout upwards * only load async in flow editor * load async monaco in app * lots of components dont respect the type and pass undefined * weird outline when opening and closing OutputPicker * fixed hover flow nodes * moved setTimeout upwards * hover color for virtual items * wrong Cargo.lock * disable interaction if not selectable * pixel perfect editor placeholder * fake monaco editor perfect in flow editor * fake monaco for app json editor * (temp) never load editor monaco * os dependant constants in monaco * Revert " (temp) never load editor monaco" This reverts commit c20fca134d9369032cd6375c514dcc4beabec97b. --------- Co-authored-by: Diego Imbert --- frontend/src/lib/components/Editor.svelte | 16 ++- .../components/FakeMonacoPlaceHolder.svelte | 112 ++++++++++++++++++ .../lib/components/InputTransformForm.svelte | 2 + frontend/src/lib/components/JsonEditor.svelte | 2 + .../src/lib/components/ResourcePicker.svelte | 2 +- .../src/lib/components/SimpleEditor.svelte | 38 ++++-- .../src/lib/components/TemplateEditor.svelte | 27 ++++- .../inputEditor/EvalV2InputEditor.svelte | 6 +- .../inputEditor/StaticInputEditor.svelte | 1 + .../flows/content/FlowModuleComponent.svelte | 3 +- .../flows/map/FlowConstantsItem.svelte | 5 +- .../flows/map/FlowModuleSchemaItem.svelte | 11 +- .../flows/map/FlowSettingsItem.svelte | 3 +- .../lib/components/flows/map/MapItem.svelte | 5 + .../components/flows/map/VirtualItem.svelte | 2 + .../flows/map/VirtualItemWrapper.svelte | 18 +-- .../flows/propPicker/OutputPicker.svelte | 1 + .../renderers/nodes/BranchAllStart.svelte | 7 +- .../renderers/nodes/BranchOneStart.svelte | 6 +- .../renderers/nodes/ForLoopEndNode.svelte | 4 +- .../renderers/nodes/ForLoopStartNode.svelte | 11 +- .../graph/renderers/nodes/InputNode.svelte | 7 +- .../graph/renderers/nodes/ModuleNode.svelte | 13 +- .../graph/renderers/nodes/NoBranchNode.svelte | 5 +- .../graph/renderers/nodes/ResultNode.svelte | 8 +- .../graph/renderers/nodes/SubflowBound.svelte | 5 +- .../graph/renderers/nodes/TriggersNode.svelte | 3 +- .../renderers/nodes/branchAllEndNode.svelte | 3 +- .../renderers/nodes/branchOneEndNode.svelte | 5 +- .../renderers/triggers/TriggersWrapper.svelte | 7 +- frontend/src/lib/components/graph/util.ts | 23 ++++ frontend/src/lib/utils.ts | 21 ++++ 32 files changed, 318 insertions(+), 64 deletions(-) create mode 100644 frontend/src/lib/components/FakeMonacoPlaceHolder.svelte diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index c03666b2fe..76c3e8071b 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -175,6 +175,7 @@ import GlobalReviewButtons from './copilot/chat/GlobalReviewButtons.svelte' import { writable } from 'svelte/store' import { formatResourceTypes } from './copilot/chat/core' + import FakeMonacoPlaceHolder from './FakeMonacoPlaceHolder.svelte' // import EditorTheme from './EditorTheme.svelte' let divEl: HTMLDivElement | null = null @@ -221,6 +222,7 @@ export let disabled: boolean = false export let lineNumbersMinChars = 3 export let isAiPanelOpen: boolean = false + export let loadAsync = false const rHash = randomHash() $: filePath = computePath(path) @@ -1374,9 +1376,14 @@ }) } - onMount(() => { + onMount(async () => { if (BROWSER) { - loadMonaco().then((x) => (disposeMethod = x)) + if (loadAsync) { + setTimeout(() => loadMonaco().then((x) => (disposeMethod = x)), 0) + } else { + let m = await loadMonaco() + disposeMethod = m + } } }) @@ -1408,6 +1415,11 @@ +{#if !editor} +
+ +
+{/if}
{#if $vimMode}
diff --git a/frontend/src/lib/components/FakeMonacoPlaceHolder.svelte b/frontend/src/lib/components/FakeMonacoPlaceHolder.svelte new file mode 100644 index 0000000000..315f4dcc3e --- /dev/null +++ b/frontend/src/lib/components/FakeMonacoPlaceHolder.svelte @@ -0,0 +1,112 @@ + + + + + + +
+
+
+ +
+
+
+ {#each lines as line, i} +
+ {line} +
+ {/each} +
+
+
+
+
+
diff --git a/frontend/src/lib/components/InputTransformForm.svelte b/frontend/src/lib/components/InputTransformForm.svelte index 67f88534c5..a12b4026a8 100644 --- a/frontend/src/lib/components/InputTransformForm.svelte +++ b/frontend/src/lib/components/InputTransformForm.svelte @@ -515,6 +515,7 @@ on:change={() => { dispatch('change', { argName, arg }) }} + loadAsync /> {/if}
@@ -583,6 +584,7 @@ focused = false }} autoHeight + loadAsync />
{#if !hideHelpButton} diff --git a/frontend/src/lib/components/JsonEditor.svelte b/frontend/src/lib/components/JsonEditor.svelte index 93481027e7..24b41f9e55 100644 --- a/frontend/src/lib/components/JsonEditor.svelte +++ b/frontend/src/lib/components/JsonEditor.svelte @@ -9,6 +9,7 @@ export let error = '' export let editor: SimpleEditor | undefined = undefined export let small = false + export let loadAsync = false $: tooBig = code && code?.length > 1000000 @@ -38,6 +39,7 @@
-
+
{#if collection?.length > 0} -
+
+ + +
+
+ + x + +
+
From 8f7854dc633d590aa5a718fd32d3f2b7b33b12a6 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 18 Apr 2025 15:48:33 +0200 Subject: [PATCH 22/53] update vite, rm circular deps --- frontend/package-lock.json | 127 ++++++++++++++++++++++--------------- frontend/package.json | 3 +- frontend/vite.config.js | 3 +- 3 files changed, 78 insertions(+), 55 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 01990d9d44..655a72a6be 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -133,8 +133,7 @@ "tailwindcss": "^3.4.1", "tslib": "^2.6.1", "typescript": "^5.5.0", - "vite": "^6.2.1", - "vite-plugin-circular-dependency": "^0.2.1", + "vite": "^6.3.2", "vite-plugin-mkcert": "^1.17.5", "yootils": "^0.3.1" }, @@ -1208,43 +1207,6 @@ "version": "0.0.1", "license": "SEE LICENSE IN LICENSE" }, - "node_modules/@rollup/pluginutils": { - "version": "5.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "2.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "4.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.35.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz", @@ -10197,6 +10159,48 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "dev": true, @@ -10505,13 +10509,17 @@ } }, "node_modules/vite": { - "version": "6.2.1", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.2.tgz", + "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "^0.25.0", + "fdir": "^6.4.3", + "picomatch": "^4.0.2", "postcss": "^8.5.3", - "rollup": "^4.30.1" + "rollup": "^4.34.9", + "tinyglobby": "^0.2.12" }, "bin": { "vite": "bin/vite.js" @@ -10574,15 +10582,6 @@ } } }, - "node_modules/vite-plugin-circular-dependency": { - "version": "0.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.2", - "chalk": "^4.1.2" - } - }, "node_modules/vite-plugin-mkcert": { "version": "1.17.7", "dev": true, @@ -10599,6 +10598,32 @@ "vite": ">=3" } }, + "node_modules/vite/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/vitefu": { "version": "1.0.6", "dev": true, diff --git a/frontend/package.json b/frontend/package.json index e192984785..ced0b2d46d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -66,8 +66,7 @@ "tailwindcss": "^3.4.1", "tslib": "^2.6.1", "typescript": "^5.5.0", - "vite": "^6.2.1", - "vite-plugin-circular-dependency": "^0.2.1", + "vite": "^6.3.2", "vite-plugin-mkcert": "^1.17.5", "yootils": "^0.3.1" }, diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 873a68c042..4c33d61234 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,7 +1,6 @@ import { sveltekit } from '@sveltejs/kit/vite' import { readFileSync } from 'fs' import { fileURLToPath } from 'url' -import circleDependency from 'vite-plugin-circular-dependency' // import mkcert from 'vite-plugin-mkcert' import importMetaUrlPlugin from '@windmill-labs/esbuild-import-meta-url-plugin' @@ -35,7 +34,7 @@ const config = { preview: { port: 3000 }, - plugins: [sveltekit(), circleDependency({ circleImportThrowErr: false })], + plugins: [sveltekit()], define: { __pkg__: version }, From ab3ff1d7015061b263152fd51e955df80552ba02 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 18 Apr 2025 19:04:02 +0200 Subject: [PATCH 23/53] fix run script preview for bundle scripts --- frontend/src/lib/components/ModulePreview.svelte | 2 +- frontend/src/lib/components/TestJobLoader.svelte | 3 ++- frontend/src/lib/scripts.ts | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index 4d6c433bd8..2abcb938ee 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -70,7 +70,7 @@ args, $flowStore?.tag ?? (val.tag_override ? val.tag_override : script.tag), script.lock, - val.hash + val.hash ?? script.hash ) } else if (val.type == 'flow') { await testJobLoader?.abstractRun(() => diff --git a/frontend/src/lib/components/TestJobLoader.svelte b/frontend/src/lib/components/TestJobLoader.svelte index a7f911aff7..10b0fcfb7f 100644 --- a/frontend/src/lib/components/TestJobLoader.svelte +++ b/frontend/src/lib/components/TestJobLoader.svelte @@ -142,7 +142,8 @@ args, language: lang as Preview['language'], tag, - lock + lock, + script_hash: hash } }) ) diff --git a/frontend/src/lib/scripts.ts b/frontend/src/lib/scripts.ts index d5516a69bc..3d8299bf09 100644 --- a/frontend/src/lib/scripts.ts +++ b/frontend/src/lib/scripts.ts @@ -47,7 +47,7 @@ export function scriptLangToEditorLang( return 'nu' } else if (lang == 'java') { return 'java' - // for related places search: ADD_NEW_LANG + // for related places search: ADD_NEW_LANG } else if (lang == undefined) { return 'typescript' } else { @@ -130,7 +130,7 @@ const scriptLanguagesArray: [SupportedLanguage | 'docker' | 'bunnative', string] ['docker', 'Docker'], ['nu', 'Nu'], ['java', 'Java'] - // for related places search: ADD_NEW_LANG + // for related places search: ADD_NEW_LANG ] export function processLangs(selected: string | undefined, langs: string[]): string[] { if (selected === 'nativets') { @@ -140,7 +140,7 @@ export function processLangs(selected: string | undefined, langs: string[]): str //those languages are newer and may not be in the saved list let nl = ['bunnative', 'rust', 'ansible', 'csharp', 'nu', 'java'] - // for related places search: ADD_NEW_LANG + // for related places search: ADD_NEW_LANG nl.forEach((lang) => { if (!ls.includes(lang)) { ls.push(lang) @@ -162,6 +162,7 @@ export async function getScriptByPath(path: string): Promise<{ concurrency_time_window_s: number | undefined lock?: string created_at?: string + hash?: string }> { if (path.startsWith('hub/')) { const { content, language, schema, lockfile } = await ScriptService.getHubScriptByPath({ path }) @@ -190,6 +191,7 @@ export async function getScriptByPath(path: string): Promise<{ concurrent_limit: script.concurrent_limit, concurrency_time_window_s: script.concurrency_time_window_s, lock: script.lock, + hash: script.hash, created_at: script.created_at } } From 02a25ba62e2fdf55ac2a10e5e04b9d75ae2feb1a Mon Sep 17 00:00:00 2001 From: dieriba Date: Sat, 19 Apr 2025 00:51:42 +0200 Subject: [PATCH 24/53] rename zoom key for http auth (#5640) --- backend/windmill-api/src/http_trigger_auth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/windmill-api/src/http_trigger_auth.rs b/backend/windmill-api/src/http_trigger_auth.rs index fd15927b69..b4fac32925 100644 --- a/backend/windmill-api/src/http_trigger_auth.rs +++ b/backend/windmill-api/src/http_trigger_auth.rs @@ -253,8 +253,8 @@ mod zoom { use super::*; #[derive(Debug, Deserialize)] - #[serde(rename_all = "snake_case")] struct ZoomPayload { + #[serde(rename = "plainToken")] plain_token: String, } From 64c72b6fce669e47f04dc620750840857cbe66cf Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Sat, 19 Apr 2025 11:00:39 +0200 Subject: [PATCH 25/53] fix: output picker output opening doesn't change id (#5641) --- .../src/lib/components/flows/propPicker/OutputPicker.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/lib/components/flows/propPicker/OutputPicker.svelte b/frontend/src/lib/components/flows/propPicker/OutputPicker.svelte index 968d124c00..d30a3cc87b 100644 --- a/frontend/src/lib/components/flows/propPicker/OutputPicker.svelte +++ b/frontend/src/lib/components/flows/propPicker/OutputPicker.svelte @@ -91,6 +91,10 @@ 'shadow-[inset_0_1px_5px_0_rgba(0,0,0,0.05)] rounded-b-sm', 'group' )} + on:pointerdown={(e) => { + e.preventDefault() + e.stopPropagation() + }} data-prop-picker title={`${isOpen ? 'Close' : 'Open'} step output`} > From 236762641f5a6f1089ac71a7b5ff116d4af88fdd Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 19 Apr 2025 11:06:30 +0200 Subject: [PATCH 26/53] chore(main): release 1.483.0 (#5632) * chore(main): release 1.483.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- CHANGELOG.md | 16 +++ backend/Cargo.lock | 97 +++++++++++-------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 91 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29ef5a0eb2..1ecce76eb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [1.483.0](https://github.com/windmill-labs/windmill/compare/v1.482.1...v1.483.0) (2025-04-19) + + +### Features + +* handle different aws auth resource type ([#5637](https://github.com/windmill-labs/windmill/issues/5637)) ([5b123b0](https://github.com/windmill-labs/windmill/commit/5b123b01a1318208450789b5bcade447a0b331c7)) +* oidc support for sqs trigger ([#5614](https://github.com/windmill-labs/windmill/issues/5614)) ([34b307b](https://github.com/windmill-labs/windmill/commit/34b307b2be1f6cf92a81694325f4c333bdd7b055)) + + +### Bug Fixes + +* fix click outside popover fullscreen ([#5631](https://github.com/windmill-labs/windmill/issues/5631)) ([0811457](https://github.com/windmill-labs/windmill/commit/081145726a5d4ab81510a7637126a036823a1565)) +* improve flow editor step switch performance ([58fa4c8](https://github.com/windmill-labs/windmill/commit/58fa4c80062a5704bbd13ddda1b2f00c7c9e40dd)) +* linter in early stop doesn't include flow_input ([#5638](https://github.com/windmill-labs/windmill/issues/5638)) ([6a9bdfd](https://github.com/windmill-labs/windmill/commit/6a9bdfd3bd52ff802b6a71c3ae9504bfe7d0421f)) +* output picker output opening doesn't change id ([#5641](https://github.com/windmill-labs/windmill/issues/5641)) ([64c72b6](https://github.com/windmill-labs/windmill/commit/64c72b6fce669e47f04dc620750840857cbe66cf)) + ## [1.482.1](https://github.com/windmill-labs/windmill/compare/v1.482.0...v1.482.1) (2025-04-16) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index abcb8cf486..5849506c72 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -793,9 +793,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f7720b74ed28ca77f90769a71fd8c637a0137f6fae4ae947e1050229cff57f" +checksum = "0ddeb19ee86cb16ecfc871e5b0660aff6285760957aaedda6284cf0e790d3769" dependencies = [ "bindgen 0.69.5", "cc", @@ -1342,6 +1342,24 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "bindgen" +version = "0.71.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" +dependencies = [ + "bitflags 2.9.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.1", + "shlex", + "syn 2.0.100", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -1581,9 +1599,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1975,9 +1993,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -1985,9 +2003,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -4052,9 +4070,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "der_derive", @@ -6842,10 +6860,11 @@ dependencies = [ [[package]] name = "libxml" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe73cdec2bcb36d25a9fe3f607ffcd44bb8907ca0100c4098d1aa342d1e7bec" +checksum = "86119bbd85c39c7f890fe970a18f77e9a599467fa613d44929aea4acecb9a031" dependencies = [ + "bindgen 0.71.1", "libc", "pkg-config", "vcpkg", @@ -13912,7 +13931,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "axum", @@ -13959,7 +13978,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "argon2", @@ -14067,7 +14086,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.482.1" +version = "1.483.0" dependencies = [ "base64 0.22.1", "chrono", @@ -14082,7 +14101,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.482.1" +version = "1.483.0" dependencies = [ "chrono", "serde", @@ -14095,7 +14114,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "serde", @@ -14109,7 +14128,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "async-stream", @@ -14173,7 +14192,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.482.1" +version = "1.483.0" dependencies = [ "regex", "serde", @@ -14187,7 +14206,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "bytes", @@ -14210,7 +14229,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.482.1" +version = "1.483.0" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -14222,7 +14241,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.482.1" +version = "1.483.0" dependencies = [ "convert_case 0.6.0", "serde", @@ -14231,7 +14250,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "lazy_static", @@ -14243,7 +14262,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "serde_json", @@ -14255,7 +14274,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "gosyn", @@ -14267,7 +14286,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "lazy_static", @@ -14279,7 +14298,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "serde_json", @@ -14291,7 +14310,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "nu-parser", @@ -14302,7 +14321,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14313,7 +14332,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14324,7 +14343,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "async-recursion", @@ -14344,7 +14363,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -14361,7 +14380,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "lazy_static", @@ -14373,7 +14392,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "lazy_static", @@ -14391,7 +14410,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -14415,7 +14434,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "serde_json", @@ -14425,7 +14444,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "async-recursion", @@ -14458,7 +14477,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.482.1" +version = "1.483.0" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -14468,7 +14487,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.482.1" +version = "1.483.0" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 73c7214f1d..d20ad2f7ed 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.482.1" +version = "1.483.0" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.482.1" +version = "1.483.0" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 3132b9346d..d868df1ec8 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.482.1 + version: 1.483.0 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 592cf6a006..1c3e98816e 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.482.1"; +export const VERSION = "v1.483.0"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index b6f88d5a9e..453121c095 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -63,7 +63,7 @@ export { // } // }); -export const VERSION = "1.482.1"; +export const VERSION = "1.483.0"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 655a72a6be..f55eaf68bf 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.482.1", + "version": "1.483.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.482.1", + "version": "1.483.0", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index ced0b2d46d..204e0bf652 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.482.1", + "version": "1.483.0", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index 2df2f0ee4e..26ff602d84 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.482.1" -wmill_pg = ">=1.482.1" +wmill = ">=1.483.0" +wmill_pg = ">=1.483.0" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index ab00748a74..a52ce585b7 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.482.1 + version: 1.483.0 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index c6c64b9bb2..1b4e923310 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.482.1' + ModuleVersion = '1.483.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index b205777dbc..37b1a053ff 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.482.1" +version = "1.483.0" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index 3de477865b..5f295ab328 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.482.1" +version = "1.483.0" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index caa472284e..6776d9019e 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.482.1", + "version": "1.483.0", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index f3ce3e5b22..bd33cd481c 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.482.1", + "version": "1.483.0", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index 1afef9f22a..12147b22f6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.482.1 +1.483.0 From e5595e41b5c87704d814eff95bc00b82195728ba Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 19 Apr 2025 11:20:00 +0200 Subject: [PATCH 27/53] fix: pin libxml to 0.3.3 --- backend/Cargo.lock | 24 +++--------------------- backend/Cargo.toml | 1 + backend/windmill-api/Cargo.toml | 3 ++- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 5849506c72..b3cd9500ff 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1342,24 +1342,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.9.0", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash 2.1.1", - "shlex", - "syn 2.0.100", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -6860,11 +6842,10 @@ dependencies = [ [[package]] name = "libxml" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86119bbd85c39c7f890fe970a18f77e9a599467fa613d44929aea4acecb9a031" +checksum = "5fe73cdec2bcb36d25a9fe3f607ffcd44bb8907ca0100c4098d1aa342d1e7bec" dependencies = [ - "bindgen 0.71.1", "libc", "pkg-config", "vcpkg", @@ -14020,6 +14001,7 @@ dependencies = [ "itertools 0.14.0", "jsonwebtoken 8.3.0", "lazy_static", + "libxml", "magic-crypt", "mail-parser", "matchit", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index d20ad2f7ed..fbe8ef430d 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -304,6 +304,7 @@ postgres-native-tls = "^0" native-tls = "^0" # samael will break compilation on MacOS. Use this fork instead to make it work # samael = { git="https://github.com/njaremko/samael", rev="464d015e3ae393e4b5dd00b4d6baa1b617de0dd6", features = ["xmlsec"] } +libxml = { version = "=0.3.3" } samael = { version="0.0.14", features = ["xmlsec"] } gcp_auth = "0.9.0" rust_decimal = { version = "^1", features = ["db-postgres", "serde-float"]} diff --git a/backend/windmill-api/Cargo.toml b/backend/windmill-api/Cargo.toml index 09f6dac049..c6702b8ac3 100644 --- a/backend/windmill-api/Cargo.toml +++ b/backend/windmill-api/Cargo.toml @@ -13,7 +13,7 @@ default = [] enterprise = ["windmill-queue/enterprise", "windmill-audit/enterprise", "windmill-git-sync/enterprise", "windmill-common/enterprise", "windmill-worker/enterprise"] stripe = [] agent_worker_server = [] -enterprise_saml = ["dep:samael"] +enterprise_saml = ["dep:samael", "dep:libxml"] benchmark = [] embedding = ["dep:tinyvector", "dep:hf-hub", "dep:tokenizers", "dep:candle-core", "dep:candle-transformers", "dep:candle-nn", "dep:half"] parquet = ["dep:datafusion", "dep:object_store", "dep:url", "windmill-common/parquet", "windmill-worker/parquet"] @@ -100,6 +100,7 @@ async_zip = { workspace = true, optional = true } regex.workspace = true bytes.workspace = true samael = { workspace = true, optional = true } +libxml = { workspace = true, optional = true } async-recursion.workspace = true rsa = { workspace = true, optional = true} uuid.workspace = true From 2bf070ee5c8b18e6565e5c3736692b97ae4edc9f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 19 Apr 2025 11:31:27 +0200 Subject: [PATCH 28/53] chore(main): release 1.483.1 (#5642) * chore(main): release 1.483.1 * change versions --- CHANGELOG.md | 7 +++ backend/Cargo.lock | 54 +++++++++---------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 51 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ecce76eb4..6c5ee479f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.483.1](https://github.com/windmill-labs/windmill/compare/v1.483.0...v1.483.1) (2025-04-19) + + +### Bug Fixes + +* pin libxml to 0.3.3 ([e5595e4](https://github.com/windmill-labs/windmill/commit/e5595e41b5c87704d814eff95bc00b82195728ba)) + ## [1.483.0](https://github.com/windmill-labs/windmill/compare/v1.482.1...v1.483.0) (2025-04-19) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index b3cd9500ff..247f2cc5ba 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -13912,7 +13912,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "axum", @@ -13959,7 +13959,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "argon2", @@ -14068,7 +14068,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.483.0" +version = "1.483.1" dependencies = [ "base64 0.22.1", "chrono", @@ -14083,7 +14083,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.483.0" +version = "1.483.1" dependencies = [ "chrono", "serde", @@ -14096,7 +14096,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "serde", @@ -14110,7 +14110,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "async-stream", @@ -14174,7 +14174,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.483.0" +version = "1.483.1" dependencies = [ "regex", "serde", @@ -14188,7 +14188,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "bytes", @@ -14211,7 +14211,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.483.0" +version = "1.483.1" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -14223,7 +14223,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.483.0" +version = "1.483.1" dependencies = [ "convert_case 0.6.0", "serde", @@ -14232,7 +14232,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "lazy_static", @@ -14244,7 +14244,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "serde_json", @@ -14256,7 +14256,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "gosyn", @@ -14268,7 +14268,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "lazy_static", @@ -14280,7 +14280,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "serde_json", @@ -14292,7 +14292,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "nu-parser", @@ -14303,7 +14303,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14314,7 +14314,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14325,7 +14325,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "async-recursion", @@ -14345,7 +14345,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -14362,7 +14362,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "lazy_static", @@ -14374,7 +14374,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "lazy_static", @@ -14392,7 +14392,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -14416,7 +14416,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "serde_json", @@ -14426,7 +14426,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "async-recursion", @@ -14459,7 +14459,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.483.0" +version = "1.483.1" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -14469,7 +14469,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.483.0" +version = "1.483.1" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index fbe8ef430d..52f6f39ce6 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.483.0" +version = "1.483.1" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.483.0" +version = "1.483.1" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index d868df1ec8..4ad0ecc65d 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.483.0 + version: 1.483.1 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index 1c3e98816e..ee61b90d51 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.483.0"; +export const VERSION = "v1.483.1"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index 453121c095..ab60532ce1 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -63,7 +63,7 @@ export { // } // }); -export const VERSION = "1.483.0"; +export const VERSION = "1.483.1"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f55eaf68bf..467211a069 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.483.0", + "version": "1.483.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.483.0", + "version": "1.483.1", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index 204e0bf652..f4012baed1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.483.0", + "version": "1.483.1", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index 26ff602d84..572e02ad91 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.483.0" -wmill_pg = ">=1.483.0" +wmill = ">=1.483.1" +wmill_pg = ">=1.483.1" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index a52ce585b7..560bcad877 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.483.0 + version: 1.483.1 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index 1b4e923310..a0f2ebc8b1 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.483.0' + ModuleVersion = '1.483.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index 37b1a053ff..e8e8749dec 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.483.0" +version = "1.483.1" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index 5f295ab328..dcc137a381 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.483.0" +version = "1.483.1" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index 6776d9019e..532504ea0f 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.483.0", + "version": "1.483.1", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index bd33cd481c..fb6018f26b 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.483.0", + "version": "1.483.1", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index 12147b22f6..f4f7573b1b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.483.0 +1.483.1 From e88909aa93acb2181fca64103b4795bb52ea8d6f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sat, 19 Apr 2025 12:09:11 +0200 Subject: [PATCH 29/53] add missing sqlx files for tests --- ...b65cdcd277257192ee0a6d18a00f41bce49d4.json | 22 +++++++++++++++ ...543252891c53351bdc98da66cc30ffc895866.json | 22 +++++++++++++++ ...4844b4c1a38701190795a801fa43c74a0beeb.json | 22 +++++++++++++++ ...ff808ba646f4f99d0c8837097e747b481f03a.json | 22 +++++++++++++++ ...deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json | 22 +++++++++++++++ ...f1bfbe4e2db85da9a478a07460733999e9beb.json | 20 +++++++++++++ ...8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json | 28 +++++++++++++++++++ ...75b58d65ca93d68b29124d04bd526239b9df2.json | 15 ++++++++++ ...110efa11a7731ad0f0e5509f55efabdf535cd.json | 22 +++++++++++++++ ...05d394a7cbcf0038c72a78add5c7b02ef5927.json | 2 +- ...32580dc7f7a9e5a67026f8c0b3077f371fc62.json | 22 +++++++++++++++ 11 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json create mode 100644 backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json create mode 100644 backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json create mode 100644 backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json create mode 100644 backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json create mode 100644 backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json create mode 100644 backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json create mode 100644 backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json create mode 100644 backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json create mode 100644 backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json diff --git a/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json b/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json new file mode 100644 index 0000000000..84c0804c95 --- /dev/null +++ b/backend/.sqlx/query-12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT suspend > 0 AS \"r!\" FROM v2_job_queue WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "r!", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + null + ] + }, + "hash": "12828c9b2964f2b484a68de1e01b65cdcd277257192ee0a6d18a00f41bce49d4" +} diff --git a/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json b/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json new file mode 100644 index 0000000000..e9705c23a6 --- /dev/null +++ b/backend/.sqlx/query-280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT script_path FROM v2_as_completed_job WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "script_path", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + true + ] + }, + "hash": "280a361076d1c6317610765960f543252891c53351bdc98da66cc30ffc895866" +} diff --git a/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json b/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json new file mode 100644 index 0000000000..9232baf39c --- /dev/null +++ b/backend/.sqlx/query-867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT workflow_as_code_status FROM v2_job_completed WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "workflow_as_code_status", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + true + ] + }, + "hash": "867d5c75ddc6c5d20136880c7294844b4c1a38701190795a801fa43c74a0beeb" +} diff --git a/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json b/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json new file mode 100644 index 0000000000..68982a2183 --- /dev/null +++ b/backend/.sqlx/query-99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id FROM v2_job WHERE parent_job = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "99f74bf675120daf965e063e5eaff808ba646f4f99d0c8837097e747b481f03a" +} diff --git a/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json b/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json new file mode 100644 index 0000000000..79bd8d0666 --- /dev/null +++ b/backend/.sqlx/query-9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT labels FROM v2_job WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "labels", + "type_info": "TextArray" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + true + ] + }, + "hash": "9d518842a9ad90ff9c28dc39690deb0ee6b62cf1d8ae1a02b28c23255d377b3d" +} diff --git a/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json b/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json new file mode 100644 index 0000000000..298a66c89c --- /dev/null +++ b/backend/.sqlx/query-a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT count(*) AS \"count!\" FROM resume_job", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "count!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "a0c35cb515a842067b294343c90f1bfbe4e2db85da9a478a07460733999e9beb" +} diff --git a/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json b/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json new file mode 100644 index 0000000000..eb852c75ee --- /dev/null +++ b/backend/.sqlx/query-a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT preprocessed, script_entrypoint_override FROM v2_job WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "preprocessed", + "type_info": "Bool" + }, + { + "ordinal": 1, + "name": "script_entrypoint_override", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + true, + true + ] + }, + "hash": "a56eef5f5ecbe1a8d309ff65d9a8c456a3c165f7f2a107cf7fa6a4cdd30d55c0" +} diff --git a/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json b/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json new file mode 100644 index 0000000000..81a97984ee --- /dev/null +++ b/backend/.sqlx/query-bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE v2_job SET labels = $2 WHERE id = $1 AND $2::TEXT[] IS NOT NULL", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "TextArray" + ] + }, + "nullable": [] + }, + "hash": "bd5a0c06e2f2361c9fc670eb0b975b58d65ca93d68b29124d04bd526239b9df2" +} diff --git a/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json b/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json new file mode 100644 index 0000000000..f5eb13f1fd --- /dev/null +++ b/backend/.sqlx/query-cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT preprocessed FROM v2_job WHERE id = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "preprocessed", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + true + ] + }, + "hash": "cd5f02cf10cbf92dd1df53a54f2110efa11a7731ad0f0e5509f55efabdf535cd" +} diff --git a/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json b/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json index 5bfff47576..c2dfed73a2 100644 --- a/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json +++ b/backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json @@ -15,7 +15,7 @@ ] }, "nullable": [ - true + null ] }, "hash": "ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927" diff --git a/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json b/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json new file mode 100644 index 0000000000..08c5851944 --- /dev/null +++ b/backend/.sqlx/query-ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT hash FROM script WHERE path = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "hash", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "ef6795d93423f98eea82eb18e6332580dc7f7a9e5a67026f8c0b3077f371fc62" +} From 3c68fef2abcb380c146a809106e1dbb3aef766df Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 20 Apr 2025 01:19:02 +0200 Subject: [PATCH 30/53] ui code builder v0 (at secret path) (#4964) --- ...e0dbed634f3b12dedaa5fee0362d670887f6.json} | 7 +- ...8b9bbef26008803f2dd2a043bdb091b2ff20.json} | 7 +- .../20241223155748_raw_apps_v2.down.sql | 2 + .../20241223155748_raw_apps_v2.up.sql | 2 + backend/parsers/windmill-parser-ts/src/lib.rs | 6 +- backend/windmill-api/openapi.yaml | 94 + backend/windmill-api/src/apps.rs | 301 +- backend/windmill-api/src/workspaces_export.rs | 2 +- backend/windmill-common/src/apps.rs | 7 + backend/windmill-common/src/s3_helpers.rs | 4 + backend/windmill-common/src/utils.rs | 3 +- backend/windmill-queue/src/jobs.rs | 1 + .../windmill-worker/src/worker_lockfiles.rs | 84 + frontend/.gitignore | 4 +- frontend/package-lock.json | 406 +- frontend/package.json | 4 +- frontend/scripts/untar_ui_builder.js | 48 + frontend/src/lib/ata/index.ts | 67 +- frontend/src/lib/components/ArgInput.svelte | 7 +- frontend/src/lib/components/DiffEditor.svelte | 2 +- .../lib/components/EditableSchemaForm.svelte | 4 +- frontend/src/lib/components/Editor.svelte | 377 +- .../components/ErrorOrRecoveryHandler.svelte | 2 +- .../lib/components/GraphqlSchemaViewer.svelte | 2 +- .../src/lib/components/ModulePreview.svelte | 12 +- frontend/src/lib/components/RunButton.svelte | 33 + frontend/src/lib/components/SchemaForm.svelte | 5 +- .../src/lib/components/ScriptEditor.svelte | 1 - .../src/lib/components/SimpleEditor.svelte | 3 +- .../src/lib/components/TemplateEditor.svelte | 2 +- .../src/lib/components/WorkerGroup.svelte | 1 - .../helpers/RunnableComponent.svelte | 144 +- .../components/helpers/executeRunnable.ts | 50 + .../apps/editor/AppEditorHeader.svelte | 332 +- .../apps/editor/AppExportButton.svelte | 5 +- .../apps/editor/AppJobsDrawer.svelte | 299 + .../components/apps/editor/AppTimeline.svelte | 13 +- .../components/apps/editor/commonAppUtils.ts | 37 + .../inlineScriptsPanel/AppRunButton.svelte | 39 + .../EmptyInlineScript.svelte | 104 +- .../InlineScriptEditor.svelte | 21 +- .../InlineScriptEditorDrawer.svelte | 4 +- .../InlineScriptEditorPanel.svelte | 2 +- .../InlineScriptHiddenRunnable.svelte | 12 +- .../InlineScriptRunnableByPath.svelte | 57 +- .../InlineScriptsPanel.svelte | 77 +- .../InlineScriptsPanelList.svelte | 6 +- .../apps/editor/inlineScriptsPanel/utils.ts | 50 +- .../settingsPanel/ComponentPanel.svelte | 1 - .../editor/settingsPanel/HideButton.svelte | 3 +- .../settingsPanel/SelectedRunnable.svelte | 49 +- .../inputEditor/RunnableInputEditor.svelte | 4 +- .../inputEditor/StaticInputEditor.svelte | 5 +- .../mainInput/RunnableSelector.svelte | 48 +- frontend/src/lib/components/apps/inputType.ts | 2 + frontend/src/lib/components/apps/store.ts | 3 +- frontend/src/lib/components/apps/types.ts | 27 +- frontend/src/lib/components/apps/utils.ts | 8 +- .../lib/components/common/modal/Modal.svelte | 36 +- .../lib/components/common/table/AppRow.svelte | 23 +- .../copilot/autocomplete/monaco-adapter.ts | 38 +- .../copilot/autocomplete/request.ts | 2 +- .../src/lib/components/copilot/chat/core.ts | 2 +- .../components/flows/CreateActionsApp.svelte | 75 +- .../src/lib/components/icons/CssIcon.svelte | 0 .../components/icons/JavaScriptIcon.svelte | 16 + .../src/lib/components/icons/JsonIcon.svelte | 11 + .../src/lib/components/icons/ReactIcon.svelte | 18 + .../lib/components/icons/SvelteIcon.svelte | 15 + .../src/lib/components/icons/VueIcon.svelte | 13 + .../components/raw_apps/FileEditorIcon.svelte | 26 + .../raw_apps/RawAppBackgroundRunner.svelte | 90 + .../components/raw_apps/RawAppEditor.svelte | 197 + .../raw_apps/RawAppEditorHeader.svelte | 1078 + .../raw_apps/RawAppInlineScriptEditor.svelte | 219 + .../RawAppInlineScriptPanelList.svelte | 90 + .../RawAppInlineScriptRunnable.svelte | 214 + .../raw_apps/RawAppInlineScriptsPanel.svelte | 61 + .../raw_apps/RawAppInputsSpecEditor.svelte | 113 + .../components/raw_apps/RawAppPreview.svelte | 23 + frontend/src/lib/components/raw_apps/utils.ts | 109 + .../components/schema/SchemaFormDND.svelte | 4 +- .../src/lib/components/tutorials/utils.ts | 2 +- frontend/src/lib/components/vscode.ts | 5 +- frontend/src/lib/editorUtils.ts | 59 +- .../monaco_workers/graphql.worker.bundle.js | 27441 +--------------- frontend/src/lib/schema.ts | 2 +- frontend/src/lib/scripts.ts | 19 +- frontend/src/lib/svelteMonarch.ts | 313 + frontend/src/lib/vueMonarch.ts | 270 + .../(logged)/apps/edit/[...path]/+page.svelte | 15 +- .../(root)/(logged)/apps_raw/add/+page.svelte | 190 + .../(root)/(logged)/apps_raw/add/templates.ts | 585 + .../(logged)/apps_raw/edit/[...path]/+page.js | 5 + .../apps_raw/edit/[...path]/+page.svelte | 226 + .../(logged)/apps_raw/get/[...path]/+page.js | 5 + .../apps_raw/get/[...path]/+page.svelte | 58 + .../(root)/(logged)/run/[...run]/+page.svelte | 28 +- .../[workspace]/[...version]/+page.js | 5 + .../[workspace]/[...version]/+page.svelte | 11 + .../src/routes/test_dev_page_2/+page.svelte | 4 +- frontend/static/_headers | 3 + frontend/svelte.config.js | 6 +- frontend/use_latest_ui_builder.sh | 5 + frontend/vite.config.js | 21 +- functions/api/[[path]].ts | 4 + 106 files changed, 6029 insertions(+), 28628 deletions(-) rename backend/.sqlx/{query-2a3992b5e9abcfbb032d10e142d98efa969dae26a7242eb7ac12593ed5421ef3.json => query-56264b88a9f428e79c6e531a0011e0dbed634f3b12dedaa5fee0362d670887f6.json} (62%) rename backend/.sqlx/{query-83d18f4e1cda2c1867168551d855d5626e766b5469c6976c986bdafc8b9407c5.json => query-a9f6e5720f748418ae52cf0e31778b9bbef26008803f2dd2a043bdb091b2ff20.json} (63%) create mode 100644 backend/migrations/20241223155748_raw_apps_v2.down.sql create mode 100644 backend/migrations/20241223155748_raw_apps_v2.up.sql create mode 100644 frontend/scripts/untar_ui_builder.js create mode 100644 frontend/src/lib/components/RunButton.svelte create mode 100644 frontend/src/lib/components/apps/components/helpers/executeRunnable.ts create mode 100644 frontend/src/lib/components/apps/editor/AppJobsDrawer.svelte create mode 100644 frontend/src/lib/components/apps/editor/commonAppUtils.ts create mode 100644 frontend/src/lib/components/apps/editor/inlineScriptsPanel/AppRunButton.svelte create mode 100644 frontend/src/lib/components/icons/CssIcon.svelte create mode 100644 frontend/src/lib/components/icons/JavaScriptIcon.svelte create mode 100644 frontend/src/lib/components/icons/JsonIcon.svelte create mode 100644 frontend/src/lib/components/icons/ReactIcon.svelte create mode 100644 frontend/src/lib/components/icons/SvelteIcon.svelte create mode 100644 frontend/src/lib/components/icons/VueIcon.svelte create mode 100644 frontend/src/lib/components/raw_apps/FileEditorIcon.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppBackgroundRunner.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppEditor.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppInlineScriptEditor.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppInlineScriptPanelList.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppInlineScriptRunnable.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppInlineScriptsPanel.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppInputsSpecEditor.svelte create mode 100644 frontend/src/lib/components/raw_apps/RawAppPreview.svelte create mode 100644 frontend/src/lib/components/raw_apps/utils.ts create mode 100644 frontend/src/lib/svelteMonarch.ts create mode 100644 frontend/src/lib/vueMonarch.ts create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/add/+page.svelte create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/add/templates.ts create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.js create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/edit/[...path]/+page.svelte create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/get/[...path]/+page.js create mode 100644 frontend/src/routes/(root)/(logged)/apps_raw/get/[...path]/+page.svelte create mode 100644 frontend/src/routes/apps_raw/[workspace]/[...version]/+page.js create mode 100644 frontend/src/routes/apps_raw/[workspace]/[...version]/+page.svelte create mode 100644 frontend/static/_headers create mode 100755 frontend/use_latest_ui_builder.sh diff --git a/backend/.sqlx/query-2a3992b5e9abcfbb032d10e142d98efa969dae26a7242eb7ac12593ed5421ef3.json b/backend/.sqlx/query-56264b88a9f428e79c6e531a0011e0dbed634f3b12dedaa5fee0362d670887f6.json similarity index 62% rename from backend/.sqlx/query-2a3992b5e9abcfbb032d10e142d98efa969dae26a7242eb7ac12593ed5421ef3.json rename to backend/.sqlx/query-56264b88a9f428e79c6e531a0011e0dbed634f3b12dedaa5fee0362d670887f6.json index 326e45bf24..e5e1ecd5de 100644 --- a/backend/.sqlx/query-2a3992b5e9abcfbb032d10e142d98efa969dae26a7242eb7ac12593ed5421ef3.json +++ b/backend/.sqlx/query-56264b88a9f428e79c6e531a0011e0dbed634f3b12dedaa5fee0362d670887f6.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO app_version\n (app_id, value, created_by)\n VALUES ($1, $2::text::json, $3) RETURNING id", + "query": "INSERT INTO app_version\n (app_id, value, created_by, raw_app)\n VALUES ($1, $2::text::json, $3, $4) RETURNING id", "describe": { "columns": [ { @@ -13,12 +13,13 @@ "Left": [ "Int8", "Text", - "Varchar" + "Varchar", + "Bool" ] }, "nullable": [ false ] }, - "hash": "2a3992b5e9abcfbb032d10e142d98efa969dae26a7242eb7ac12593ed5421ef3" + "hash": "56264b88a9f428e79c6e531a0011e0dbed634f3b12dedaa5fee0362d670887f6" } diff --git a/backend/.sqlx/query-83d18f4e1cda2c1867168551d855d5626e766b5469c6976c986bdafc8b9407c5.json b/backend/.sqlx/query-a9f6e5720f748418ae52cf0e31778b9bbef26008803f2dd2a043bdb091b2ff20.json similarity index 63% rename from backend/.sqlx/query-83d18f4e1cda2c1867168551d855d5626e766b5469c6976c986bdafc8b9407c5.json rename to backend/.sqlx/query-a9f6e5720f748418ae52cf0e31778b9bbef26008803f2dd2a043bdb091b2ff20.json index 24cabff562..0310f2197b 100644 --- a/backend/.sqlx/query-83d18f4e1cda2c1867168551d855d5626e766b5469c6976c986bdafc8b9407c5.json +++ b/backend/.sqlx/query-a9f6e5720f748418ae52cf0e31778b9bbef26008803f2dd2a043bdb091b2ff20.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "INSERT INTO app_version\n (app_id, value, created_by)\n VALUES ($1, $2::text::json, $3) RETURNING id", + "query": "INSERT INTO app_version\n (app_id, value, created_by, raw_app)\n VALUES ($1, $2::text::json, $3, $4) RETURNING id", "describe": { "columns": [ { @@ -13,12 +13,13 @@ "Left": [ "Int8", "Text", - "Varchar" + "Varchar", + "Bool" ] }, "nullable": [ false ] }, - "hash": "83d18f4e1cda2c1867168551d855d5626e766b5469c6976c986bdafc8b9407c5" + "hash": "a9f6e5720f748418ae52cf0e31778b9bbef26008803f2dd2a043bdb091b2ff20" } diff --git a/backend/migrations/20241223155748_raw_apps_v2.down.sql b/backend/migrations/20241223155748_raw_apps_v2.down.sql new file mode 100644 index 0000000000..7e7dbecf84 --- /dev/null +++ b/backend/migrations/20241223155748_raw_apps_v2.down.sql @@ -0,0 +1,2 @@ +-- Add down migration script here +ALTER TABLE app_version DROP COLUMN IF EXISTS raw_app; \ No newline at end of file diff --git a/backend/migrations/20241223155748_raw_apps_v2.up.sql b/backend/migrations/20241223155748_raw_apps_v2.up.sql new file mode 100644 index 0000000000..02b1124957 --- /dev/null +++ b/backend/migrations/20241223155748_raw_apps_v2.up.sql @@ -0,0 +1,2 @@ +-- Add up migration script here +ALTER TABLE app_version ADD COLUMN IF NOT EXISTS raw_app BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file diff --git a/backend/parsers/windmill-parser-ts/src/lib.rs b/backend/parsers/windmill-parser-ts/src/lib.rs index 24c9eefab3..d4d34cecd6 100644 --- a/backend/parsers/windmill-parser-ts/src/lib.rs +++ b/backend/parsers/windmill-parser-ts/src/lib.rs @@ -49,8 +49,12 @@ impl Visit for ImportsFinder { pub fn parse_expr_for_imports(code: &str) -> anyhow::Result> { let cm: Lrc = Default::default(); let fm = cm.new_source_file(FileName::Custom("main.d.ts".into()).into(), code.into()); + let mut tss = TsSyntax::default(); + tss.disallow_ambiguous_jsx_like; + tss.tsx = true; + tss.no_early_errors = true; let lexer = Lexer::new( - Syntax::Typescript(TsSyntax::default()), + Syntax::Typescript(tss), // EsVersion defaults to es5 Default::default(), StringInput::from(&*fm), diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 4ad0ecc65d..329cd80968 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -5985,6 +5985,55 @@ paths: schema: type: string + /w/{workspace}/apps/create_raw: + post: + summary: create app raw + operationId: createAppRaw + tags: + - app + parameters: + - $ref: "#/components/parameters/WorkspaceId" + requestBody: + description: new app + required: true + content: + multipart/form-data: + schema: + type: object + properties: + app: + type: object + properties: + path: + type: string + value: {} + summary: + type: string + policy: + $ref: "#/components/schemas/Policy" + draft_only: + type: boolean + deployment_message: + type: string + custom_path: + type: string + required: + - path + - value + - summary + - policy + js: + type: string + css: + type: string + responses: + "201": + description: app created + content: + text/plain: + schema: + type: string + /w/{workspace}/apps/exists/{path}: get: summary: does an app exisst at path @@ -6344,6 +6393,49 @@ paths: schema: type: string + /w/{workspace}/apps/update_raw/{path}: + post: + summary: update app + operationId: updateAppRaw + tags: + - app + parameters: + - $ref: "#/components/parameters/WorkspaceId" + - $ref: "#/components/parameters/ScriptPath" + requestBody: + description: update app + required: true + content: + multipart/form-data: + schema: + type: object + properties: + app: + type: object + properties: + path: + type: string + summary: + type: string + value: {} + policy: + $ref: "#/components/schemas/Policy" + deployment_message: + type: string + custom_path: + type: string + js: + type: string + css: + type: string + responses: + "200": + description: app updated + content: + text/plain: + schema: + type: string + /w/{workspace}/apps/custom_path_exists/{custom_path}: get: summary: check if custom path exists @@ -15921,6 +16013,8 @@ components: execution_mode: type: string enum: [viewer, publisher, anonymous] + raw_app: + type: boolean required: - id - workspace_id diff --git a/backend/windmill-api/src/apps.rs b/backend/windmill-api/src/apps.rs index b3ffdb896b..533da11d1c 100644 --- a/backend/windmill-api/src/apps.rs +++ b/backend/windmill-api/src/apps.rs @@ -24,10 +24,10 @@ use crate::{ }, users::fetch_api_authed_from_permissioned_as, }; -#[cfg(feature = "parquet")] use axum::response::Response; use axum::{ - extract::{Extension, Json, Path, Query}, + body::Body, + extract::{Extension, Json, Multipart, Path, Query}, response::IntoResponse, routing::{delete, get, post}, Router, @@ -88,10 +88,13 @@ pub fn workspaced_service() -> Router { .route("/get/draft/*path", get(get_app_w_draft)) .route("/secret_of/*path", get(get_secret_id)) .route("/get/v/*id", get(get_app_by_id)) + .route("/get_data/v/*id", get(get_raw_app_data)) .route("/exists/*path", get(exists_app)) .route("/update/*path", post(update_app)) + .route("/update_raw/*path", post(update_app_raw)) .route("/delete/*path", delete(delete_app)) .route("/create", post(create_app)) + .route("/create_raw", post(create_app_raw)) .route("/history/p/*path", get(get_app_history)) .route("/get_latest_version/*path", get(get_latest_version)) .route("/history_update/a/:id/v/:version", post(update_app_history)) @@ -135,6 +138,12 @@ pub struct ListableApp { #[sqlx(default)] #[serde(skip_serializing_if = "Option::is_none")] pub deployment_msg: Option, + #[serde(skip_serializing_if = "is_false")] + pub raw_app: bool, +} + +fn is_false(b: &bool) -> bool { + !b } #[derive(FromRow, Serialize, Deserialize)] @@ -328,7 +337,8 @@ async fn list_apps( "app.extra_perms", "favorite.path IS NOT NULL as starred", "draft.path IS NOT NULL as has_draft", - "draft_only" + "draft_only", + "app_version.raw_app", ]) .left() .join("favorite") @@ -387,6 +397,44 @@ async fn list_apps( Ok(Json(rows)) } +async fn get_raw_app_data(Path((w_id, version_id)): Path<(String, String)>) -> Result { + let file_path = format!("/tmp/wmill/{}/{}", w_id, version_id); + let file = tokio::fs::File::open(file_path).await?; + let stream = tokio_util::io::ReaderStream::new(file); + let res = Response::builder().header( + http::header::CONTENT_TYPE, + if version_id.ends_with(".css") { + "text/css" + } else { + "text/javascript" + }, + ); + Ok(res.body(Body::from_stream(stream)).unwrap()) +} + +// async fn get_app_version( +// authed: ApiAuthed, +// Extension(user_db): Extension, +// Path((w_id, path)): Path<(String, StripPath)>, +// ) -> JsonResult { +// let path = path.to_path(); +// let mut tx = user_db.begin(&authed).await?; + +// let version_o = sqlx::query_scalar!( +// "SELECT app.versions[array_upper(app.versions, 1)] as version FROM app +// WHERE app.path = $1 AND app.workspace_id = $2", +// path, +// &w_id, +// ) +// .fetch_optional(&mut *tx) +// .await? +// .flatten(); +// tx.commit().await?; + +// let version = not_found_if_none(version_o, "App", path)?; +// Ok(Json(version)) +// } + async fn get_app( authed: ApiAuthed, Extension(user_db): Extension, @@ -727,6 +775,97 @@ async fn get_secret_id( Ok(hx) } +macro_rules! process_app_multipart { + ($authed:expr, $user_db:expr, $db:expr, $w_id:expr, $path:expr, $multipart:expr, $internal_fn:expr) => { + async { + let mut saved_app = None; + let mut uploaded_js = false; + + //todo: use s3 instead + let file_path = format!("/tmp/wmill/{}", $w_id); + std::fs::create_dir_all(&file_path).unwrap(); + + let mut multipart = $multipart; + while let Some(field) = multipart.next_field().await.unwrap() { + let name = field.name().unwrap().to_string(); + let data = field.bytes().await.unwrap(); + if name == "app" { + let app = serde_json::from_slice(&data).map_err(to_anyhow)?; + let (ntx, npath, nid) = $internal_fn( + $authed.clone(), + $db.clone(), + $user_db.clone(), + $w_id, + $path, + true, + app, + ) + .await?; + saved_app = Some((npath, nid, ntx)); + } else if name == "js" { + if let Some((_npath, id, _tx)) = saved_app.as_ref() { + let file_path = format!("{}/{}.js", file_path, id); + std::fs::write(file_path, data).unwrap(); + uploaded_js = true; + } else { + return Err(Error::BadRequest( + "App payload need to be created first".to_string(), + )); + } + } else if name == "css" { + if let Some((_npath, id, _tx)) = saved_app.as_ref() { + let file_path = format!("{}/{}.css", file_path, id); + std::fs::write(file_path, data).unwrap(); + } else { + return Err(Error::BadRequest( + "App payload need to be created first".to_string(), + )); + } + } else { + return Err(Error::BadRequest(format!("Unsupported field: {}", name))); + } + } + if !uploaded_js { + return Err(Error::BadRequest("js or css file not uploaded".to_string())); + } + if let Some((npath, id, tx)) = saved_app { + tx.commit().await?; + Ok((npath, id)) + } else { + Err(Error::BadRequest("App not created".to_string())) + } + } + }; +} + +async fn create_app_raw<'a>( + authed: ApiAuthed, + Extension(user_db): Extension, + Extension(db): Extension, + Extension(webhook): Extension, + Path(w_id): Path, + multipart: Multipart, +) -> Result<(StatusCode, String)> { + let (path, _id) = process_app_multipart!( + authed, + user_db, + db, + &w_id, + "", + multipart, + |authed, db, user_db, w_id, _path, raw_app, app| create_app_internal( + authed, db, user_db, w_id, raw_app, app + ) + ) + .await?; + + webhook.send_message( + w_id.clone(), + WebhookMessage::CreateApp { workspace: w_id, path: path.clone() }, + ); + Ok((StatusCode::CREATED, path)) +} + async fn list_paths_from_workspace_runnable( authed: ApiAuthed, Extension(user_db): Extension, @@ -755,17 +894,36 @@ async fn create_app( Extension(db): Extension, Extension(webhook): Extension, Path(w_id): Path, - Json(mut app): Json, + Json(app): Json, ) -> Result<(StatusCode, String)> { - let mut tx = user_db.clone().begin(&authed).await?; + let path = app.path.clone(); + let (new_tx, _path, _id) = create_app_internal(authed, db, user_db, &w_id, false, app).await?; + new_tx.commit().await?; + + webhook.send_message( + w_id.clone(), + WebhookMessage::CreateApp { workspace: w_id, path: path.clone() }, + ); + + Ok((StatusCode::CREATED, path)) +} + +async fn create_app_internal<'a>( + authed: ApiAuthed, + db: sqlx::Pool, + user_db: UserDB, + w_id: &String, + raw_app: bool, + mut app: CreateApp, +) -> Result<(sqlx::Transaction<'a, sqlx::Postgres>, String, i64)> { + let mut tx = user_db.clone().begin(&authed).await?; app.policy.on_behalf_of = Some(username_to_permissioned_as(&authed.username)); app.policy.on_behalf_of_email = Some(authed.email.clone()); - + let path = app.path.clone(); if &app.path == "" { return Err(Error::BadRequest("App path cannot be empty".to_string())); } - let exists = sqlx::query_scalar!( "SELECT EXISTS(SELECT 1 FROM app WHERE path = $1 AND workspace_id = $2)", &app.path, @@ -774,21 +932,19 @@ async fn create_app( .fetch_one(&mut *tx) .await? .unwrap_or(false); - if exists { return Err(Error::BadRequest(format!( "App with path {} already exists", &app.path ))); } - if let Some(custom_path) = &app.custom_path { require_admin(authed.is_admin, &authed.username)?; let exists = sqlx::query_scalar!( "SELECT EXISTS(SELECT 1 FROM app WHERE custom_path = $1 AND ($2::TEXT IS NULL OR workspace_id = $2))", custom_path, - if *CLOUD_HOSTED { Some(&w_id) } else { None } + if *CLOUD_HOSTED { Some(w_id) } else { None } ) .fetch_one(&mut *tx) .await?.unwrap_or(false); @@ -800,7 +956,6 @@ async fn create_app( ))); } } - sqlx::query!( "DELETE FROM draft WHERE path = $1 AND workspace_id = $2 AND typ = 'app'", &app.path, @@ -808,7 +963,6 @@ async fn create_app( ) .execute(&mut *tx) .await?; - let id = sqlx::query_scalar!( "INSERT INTO app (workspace_id, path, summary, policy, versions, draft_only, custom_path) @@ -819,24 +973,24 @@ async fn create_app( json!(app.policy), app.draft_only, app.custom_path + .as_ref() .map(|s| if s.is_empty() { None } else { Some(s) }) .flatten() ) .fetch_one(&mut *tx) .await?; - let v_id = sqlx::query_scalar!( "INSERT INTO app_version - (app_id, value, created_by) - VALUES ($1, $2::text::json, $3) RETURNING id", + (app_id, value, created_by, raw_app) + VALUES ($1, $2::text::json, $3, $4) RETURNING id", id, //to preserve key orders serde_json::to_string(&app.value).unwrap(), authed.username, + raw_app ) .fetch_one(&mut *tx) .await?; - sqlx::query!( "UPDATE app SET versions = array_append(versions, $1::bigint) WHERE id = $2", v_id, @@ -850,22 +1004,20 @@ async fn create_app( &authed, "apps.create", ActionKind::Create, - &w_id, + w_id, Some(&app.path), None, ) .await?; - let mut args: HashMap> = HashMap::new(); - if let Some(dm) = app.deployment_message { + if let Some(dm) = &app.deployment_message { args.insert("deployment_message".to_string(), to_raw_value(&dm)); } - let tx = PushIsolationLevel::Transaction(tx); let (dependency_job_uuid, new_tx) = push( &db, tx, - &w_id, + w_id, JobPayload::AppDependencies { path: app.path.clone(), version: v_id }, PushArgs { args: &args, extra: None }, &authed.username, @@ -889,14 +1041,7 @@ async fn create_app( .await?; tracing::info!("Pushed app dependency job {}", dependency_job_uuid); - new_tx.commit().await?; - - webhook.send_message( - w_id.clone(), - WebhookMessage::CreateApp { workspace: w_id, path: app.path.clone() }, - ); - - Ok((StatusCode::CREATED, app.path)) + Ok((new_tx, path, v_id)) } async fn list_hub_apps(Extension(db): Extension) -> impl IntoResponse { @@ -1017,12 +1162,76 @@ async fn update_app( Path((w_id, path)): Path<(String, StripPath)>, Json(ns): Json, ) -> Result { - use sql_builder::prelude::*; - + // create_app_internal(authed, user_db, db, &w_id, &mut app).await?; let path = path.to_path(); + let opath = path.to_string(); + let (new_tx, npath, _v_id) = + update_app_internal(authed, db, user_db, &w_id, path, false, ns).await?; + new_tx.commit().await?; + webhook.send_message( + w_id.clone(), + WebhookMessage::UpdateApp { + workspace: w_id.clone(), + old_path: opath.clone(), + new_path: npath.clone(), + }, + ); + + Ok(format!("app {} updated (npath: {:?})", opath, npath)) +} + +async fn update_app_raw<'a>( + authed: ApiAuthed, + Extension(user_db): Extension, + Extension(db): Extension, + Extension(webhook): Extension, + Path((w_id, path)): Path<(String, StripPath)>, + multipart: Multipart, +) -> Result { + let path = path.to_path(); + let opath = path.to_string(); + let (npath, _id) = process_app_multipart!( + authed, + user_db, + db, + &w_id, + path, + multipart, + update_app_internal + ) + .await?; + + webhook.send_message( + w_id.clone(), + WebhookMessage::UpdateApp { + workspace: w_id.clone(), + old_path: opath.to_owned(), + new_path: npath.clone(), + }, + ); + + Ok(format!("app {} updated (npath: {:?})", opath, npath)) +} +// async fn create_app_internal<'a>( +// authed: ApiAuthed, +// db: sqlx::Pool, +// user_db: UserDB, +// w_id: &String, +// app: &mut CreateApp, +// ) + +async fn update_app_internal<'a>( + authed: ApiAuthed, + db: sqlx::Pool, + user_db: UserDB, + w_id: &str, + path: &str, + raw_app: bool, + ns: EditApp, +) -> Result<(sqlx::Transaction<'a, sqlx::Postgres>, String, i64)> { + use sql_builder::prelude::*; let mut tx = user_db.clone().begin(&authed).await?; - let npath = if ns.policy.is_some() || ns.path.is_some() || ns.summary.is_some() @@ -1069,7 +1278,7 @@ async fn update_app( let exists = sqlx::query_scalar!( "SELECT EXISTS(SELECT 1 FROM app WHERE custom_path = $1 AND ($2::TEXT IS NULL OR workspace_id = $2) AND NOT (path = $3 AND workspace_id = $4))", ncustom_path, - if *CLOUD_HOSTED { Some(&w_id) } else { None }, + if *CLOUD_HOSTED { Some(w_id) } else { None }, path, w_id ) @@ -1116,12 +1325,13 @@ async fn update_app( let v_id = sqlx::query_scalar!( "INSERT INTO app_version - (app_id, value, created_by) - VALUES ($1, $2::text::json, $3) RETURNING id", + (app_id, value, created_by, raw_app) + VALUES ($1, $2::text::json, $3, $4) RETURNING id", app_id, //to preserve key orders serde_json::to_string(&nvalue).unwrap(), authed.username, + raw_app ) .fetch_one(&mut *tx) .await?; @@ -1152,7 +1362,6 @@ async fn update_app( ))); } }; - sqlx::query!( "DELETE FROM draft WHERE path = $1 AND workspace_id = $2 AND typ = 'app'", path, @@ -1160,29 +1369,26 @@ async fn update_app( ) .execute(&mut *tx) .await?; - audit_log( &mut *tx, &authed, "apps.update", ActionKind::Update, - &w_id, + w_id, Some(&npath), None, ) .await?; - let tx = PushIsolationLevel::Transaction(tx); let mut args: HashMap> = HashMap::new(); if let Some(dm) = ns.deployment_message { args.insert("deployment_message".to_string(), to_raw_value(&dm)); } args.insert("parent_path".to_string(), to_raw_value(&path)); - let (dependency_job_uuid, new_tx) = push( &db, tx, - &w_id, + w_id, JobPayload::AppDependencies { path: npath.clone(), version: v_id }, PushArgs { args: &args, extra: None }, &authed.username, @@ -1205,18 +1411,7 @@ async fn update_app( ) .await?; tracing::info!("Pushed app dependency job {}", dependency_job_uuid); - new_tx.commit().await?; - - webhook.send_message( - w_id.clone(), - WebhookMessage::UpdateApp { - workspace: w_id, - old_path: path.to_owned(), - new_path: npath.clone(), - }, - ); - - Ok(format!("app {} updated (npath: {:?})", path, npath)) + Ok((new_tx, npath, v_id)) } #[derive(Debug, Deserialize, Clone)] diff --git a/backend/windmill-api/src/workspaces_export.rs b/backend/windmill-api/src/workspaces_export.rs index 22357f2ed6..b799313933 100644 --- a/backend/windmill-api/src/workspaces_export.rs +++ b/backend/windmill-api/src/workspaces_export.rs @@ -501,7 +501,7 @@ pub(crate) async fn tarball_workspace( "SELECT app.id, app.path, app.summary, app.versions, app.policy, app.custom_path, app.extra_perms, app_version.value, app_version.created_at, app_version.created_by from app, app_version - WHERE app.workspace_id = $1 AND app_version.id = app.versions[array_upper(app.versions, 1)]", + WHERE app.workspace_id = $1 AND app_version.id = app.versions[array_upper(app.versions, 1)] AND app_version.raw_app IS false", ) .bind(&w_id) .fetch_all(&mut *tx) diff --git a/backend/windmill-common/src/apps.rs b/backend/windmill-common/src/apps.rs index bc8429c279..c5b22d434c 100644 --- a/backend/windmill-common/src/apps.rs +++ b/backend/windmill-common/src/apps.rs @@ -6,6 +6,8 @@ * LICENSE-AGPL for a copy of the license. */ +use std::collections::HashMap; + use serde::{Deserialize, Serialize}; /// Id in the `app_script` table. @@ -21,3 +23,8 @@ pub struct ListAppQuery { pub include_draft_only: Option, pub with_deployment_msg: Option, } + +#[derive(Deserialize)] +pub struct RawAppValue { + pub files: HashMap, +} diff --git a/backend/windmill-common/src/s3_helpers.rs b/backend/windmill-common/src/s3_helpers.rs index e3dff5350c..495f45912e 100644 --- a/backend/windmill-common/src/s3_helpers.rs +++ b/backend/windmill-common/src/s3_helpers.rs @@ -476,3 +476,7 @@ impl CredentialProvider for AwsCredentialAdapter { pub fn bundle(w_id: &str, hash: &str) -> String { format!("script_bundle/{}/{}", w_id, hash) } + +pub fn raw_app(w_id: &str, version: &i64) -> String { + format!("/home/rfiszel/raw_app/{}/{}", w_id, version) +} diff --git a/backend/windmill-common/src/utils.rs b/backend/windmill-common/src/utils.rs index 5018591072..62c193031a 100644 --- a/backend/windmill-common/src/utils.rs +++ b/backend/windmill-common/src/utils.rs @@ -19,8 +19,7 @@ use git_version::git_version; use chrono::Utc; use croner::Cron; -use rand::distr::Alphanumeric; -use rand::{rng, Rng}; +use rand::{distr::Alphanumeric, rng, Rng}; use reqwest::Client; use semver::Version; use serde::{Deserialize, Deserializer, Serialize}; diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index 9c7dd8a4fc..c92933ef92 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -4101,6 +4101,7 @@ pub async fn push<'c, 'd>( } else if job_kind == JobKind::Dependencies || job_kind == JobKind::FlowDependencies || job_kind == JobKind::DeploymentCallback + || job_kind == JobKind::AppDependencies { // using the dependency tag for deployment callback for now. We can create a separate tag when we need "dependency".to_string() diff --git a/backend/windmill-worker/src/worker_lockfiles.rs b/backend/windmill-worker/src/worker_lockfiles.rs index 6c56f1acef..cab717a94f 100644 --- a/backend/windmill-worker/src/worker_lockfiles.rs +++ b/backend/windmill-worker/src/worker_lockfiles.rs @@ -1731,6 +1731,90 @@ pub async fn handle_app_dependency_job( } } +// async fn upload_raw_app( +// app_value: &RawAppValue, +// job: &QueuedJob, +// mem_peak: &mut i32, +// canceled_by: &mut Option, +// job_dir: &str, +// db: &sqlx::Pool, +// worker_name: &str, +// occupancy_metrics: &mut Option<&mut OccupancyMetrics>, +// version: i64, +// ) -> Result<()> { +// let mut entrypoint = "index.ts"; +// for file in app_value.files.iter() { +// if file.0 == "/index.tsx" { +// entrypoint = "index.tsx"; +// } else if file.0 == "/index.js" { +// entrypoint = "index.js"; +// } +// write_file(&job_dir, file.0, &file.1)?; +// } +// let common_bun_proc_envs: HashMap = get_common_bun_proc_envs(None).await; + +// install_bun_lockfile( +// mem_peak, +// canceled_by, +// &job.id, +// &job.workspace_id, +// Some(db), +// job_dir, +// worker_name, +// common_bun_proc_envs, +// false, +// occupancy_metrics, +// ) +// .await?; +// let mut cmd = tokio::process::Command::new("esbuild"); +// let mut args = "--bundle --minify --outdir=dist/" +// .split(' ') +// .collect::>(); +// args.push(entrypoint); +// cmd.current_dir(job_dir) +// .env_clear() +// .args(args) +// .stdout(Stdio::piped()) +// .stderr(Stdio::piped()); +// let child = start_child_process(cmd, "esbuild").await?; + +// crate::handle_child::handle_child( +// &job.id, +// db, +// mem_peak, +// canceled_by, +// child, +// false, +// worker_name, +// &job.workspace_id, +// "esbuild", +// Some(30), +// false, +// occupancy_metrics, +// ) +// .await?; +// let output_dir = format!("{}/dist", job_dir); +// let target_dir = format!("/home/rfiszel/wmill/{}/{}", job.workspace_id, version); + +// tokio::fs::create_dir_all(&target_dir).await?; + +// tracing::info!("Copying files from {} to {}", output_dir, target_dir); + +// let index_ts = format!("{}/index.js", output_dir); +// let index_css = format!("{}/index.css", output_dir); + +// if tokio::fs::metadata(&index_ts).await.is_ok() { +// tokio::fs::copy(&index_ts, format!("{}/index.js", target_dir)).await?; +// } + +// if tokio::fs::metadata(&index_css).await.is_ok() { +// tokio::fs::copy(&index_css, format!("{}/index.css", target_dir)).await?; +// } +// // let file_path = format!("/home/rfiszel/wmill/{}/{}", job.workspace_id, version); + +// Ok(()) +// } + #[cfg(feature = "python")] async fn python_dep( reqs: String, diff --git a/frontend/.gitignore b/frontend/.gitignore index 32ae7e5b89..f11fc8c669 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -9,4 +9,6 @@ tests-out/ storageState.json .env.production dist/ -static/tsdocs/ \ No newline at end of file +static/tsdocs/ +static/ui_builder/ +ui_builder.tar.gz \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 467211a069..149b11d498 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "windmill-components", "version": "1.483.1", + "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", @@ -74,7 +75,7 @@ "windmill-parser-wasm-py": "^1.477.1", "windmill-parser-wasm-regex": "^1.481.0", "windmill-parser-wasm-rust": "^1.429.0", - "windmill-parser-wasm-ts": "^1.429.0", + "windmill-parser-wasm-ts": "^1.438.2", "windmill-parser-wasm-yaml": "^1.429.0", "windmill-sql-datatype-parser-wasm": "^1.318.0", "y-monaco": "^0.1.4", @@ -131,6 +132,7 @@ "svelte-splitpanes": "^8.0.9", "svelte2tsx": "^0.6.16", "tailwindcss": "^3.4.1", + "tar": "^7.4.3", "tslib": "^2.6.1", "typescript": "^5.5.0", "vite": "^6.3.2", @@ -988,6 +990,27 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@isaacs/fs-minipass/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "license": "MIT", @@ -1207,200 +1230,6 @@ "version": "0.0.1", "license": "SEE LICENSE IN LICENSE" }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.35.0.tgz", - "integrity": "sha512-uYQ2WfPaqz5QtVgMxfN6NpLD+no0MYHDBywl7itPYd3K5TjjSghNKmX8ic9S8NU8w81NVhJv/XojcHptRly7qQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.35.0.tgz", - "integrity": "sha512-FtKddj9XZudurLhdJnBl9fl6BwCJ3ky8riCXjEw3/UIbjmIY58ppWwPEvU3fNu+W7FUsAsB1CdH+7EQE6CXAPA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.35.0.tgz", - "integrity": "sha512-Uk+GjOJR6CY844/q6r5DR/6lkPFOw0hjfOIzVx22THJXMxktXG6CbejseJFznU8vHcEBLpiXKY3/6xc+cBm65Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.35.0.tgz", - "integrity": "sha512-3IrHjfAS6Vkp+5bISNQnPogRAW5GAV1n+bNCrDwXmfMHbPl5EhTmWtfmwlJxFRUCBZ+tZ/OxDyU08aF6NI/N5Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.35.0.tgz", - "integrity": "sha512-sxjoD/6F9cDLSELuLNnY0fOrM9WA0KrM0vWm57XhrIMf5FGiN8D0l7fn+bpUeBSU7dCgPV2oX4zHAsAXyHFGcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.35.0.tgz", - "integrity": "sha512-2mpHCeRuD1u/2kruUiHSsnjWtHjqVbzhBkNVQ1aVD63CcexKVcQGwJ2g5VphOd84GvxfSvnnlEyBtQCE5hxVVw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.35.0.tgz", - "integrity": "sha512-mrA0v3QMy6ZSvEuLs0dMxcO2LnaCONs1Z73GUDBHWbY8tFFocM6yl7YyMu7rz4zS81NDSqhrUuolyZXGi8TEqg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.35.0.tgz", - "integrity": "sha512-DnYhhzcvTAKNexIql8pFajr0PiDGrIsBYPRvCKlA5ixSS3uwo/CWNZxB09jhIapEIg945KOzcYEAGGSmTSpk7A==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.35.0", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.35.0.tgz", - "integrity": "sha512-XQxVOCd6VJeHQA/7YcqyV0/88N6ysSVzRjJ9I9UA/xXpEsjvAgDTgH3wQYz5bmr7SPtVK2TsP2fQ2N9L4ukoUg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.35.0.tgz", - "integrity": "sha512-5pMT5PzfgwcXEwOaSrqVsz/LvjDZt+vQ8RT/70yhPU06PTuq8WaHhfT1LW+cdD7mW6i/J5/XIkX/1tCAkh1W6g==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.35.0.tgz", - "integrity": "sha512-c+zkcvbhbXF98f4CtEIP1EBA/lCic5xB0lToneZYvMeKu5Kamq3O8gqrxiYYLzlZH6E3Aq+TSW86E4ay8iD8EA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.35.0.tgz", - "integrity": "sha512-s91fuAHdOwH/Tad2tzTtPX7UZyytHIRR6V4+2IGlV0Cej5rkG0R61SX4l4y9sh0JBibMiploZx3oHKPnQBKe4g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.35.0.tgz", - "integrity": "sha512-hQRkPQPLYJZYGP+Hj4fR9dDBMIM7zrzJDWFEMPdTnTy95Ljnv0/4w/ixFw3pTBMEuuEuoqtBINYND4M7ujcuQw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.39.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.39.0.tgz", @@ -1428,48 +1257,6 @@ "linux" ] }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.35.0.tgz", - "integrity": "sha512-OUOlGqPkVJCdJETKOCEf1mw848ZyJ5w50/rZ/3IBQVdLfR5jk/6Sr5m3iO2tdPgwo0x7VcncYuOvMhBWZq8ayg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.35.0.tgz", - "integrity": "sha512-2/lsgejMrtwQe44glq7AFFHLfJBPafpsTa6JvP2NGef/ifOa4KBoglVf7AKN7EV9o32evBPRqfg96fEHzWo5kw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.35.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.35.0.tgz", - "integrity": "sha512-PIQeY5XDkrOysbQblSW7v3l1MDZzkTEzAfTPkj5VAu3FW8fS4ynyLg2sINp0fp3SjZ8xkRYpLqoKcYqAkhU1dw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@smithy/types": { "version": "4.1.0", "license": "Apache-2.0", @@ -2887,11 +2674,12 @@ } }, "node_modules/chownr": { - "version": "2.0.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, - "license": "ISC", "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/citty": { @@ -4396,8 +4184,9 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, - "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -4407,8 +4196,9 @@ }, "node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, - "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -4426,7 +4216,6 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -4516,11 +4305,74 @@ "giget": "dist/cli.mjs" } }, + "node_modules/giget/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/giget/node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/giget/node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/giget/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/giget/node_modules/pathe": { "version": "2.0.3", "dev": true, "license": "MIT" }, + "node_modules/giget/node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/glob": { "version": "7.2.3", "dev": true, @@ -6504,37 +6356,39 @@ } }, "node_modules/minizlib": { - "version": "2.1.2", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", "dev": true, - "license": "MIT", "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "minipass": "^7.1.2" }, "engines": { - "node": ">= 8" + "node": ">= 18" } }, "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" } }, "node_modules/mkdirp": { - "version": "1.0.4", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", "dev": true, - "license": "MIT", "bin": { - "mkdirp": "bin/cmd.js" + "mkdirp": "dist/cjs/src/bin.js" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mlly": { @@ -7885,7 +7739,6 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -10115,19 +9968,38 @@ } }, "node_modules/tar": { - "version": "6.2.1", + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", "dev": true, - "license": "ISC", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "engines": { + "node": ">=18" } }, "node_modules/text-table": { diff --git a/frontend/package.json b/frontend/package.json index f4012baed1..9ba7dd084d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,6 +5,7 @@ "dev": "vite dev", "build": "vite build", "preview": "vite preview", + "postinstall": "node scripts/untar_ui_builder.js", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --threshold warning", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", @@ -64,6 +65,7 @@ "svelte-splitpanes": "^8.0.9", "svelte2tsx": "^0.6.16", "tailwindcss": "^3.4.1", + "tar": "^7.4.3", "tslib": "^2.6.1", "typescript": "^5.5.0", "vite": "^6.3.2", @@ -142,7 +144,7 @@ "windmill-parser-wasm-py": "^1.477.1", "windmill-parser-wasm-regex": "^1.481.0", "windmill-parser-wasm-rust": "^1.429.0", - "windmill-parser-wasm-ts": "^1.429.0", + "windmill-parser-wasm-ts": "^1.438.2", "windmill-parser-wasm-yaml": "^1.429.0", "windmill-sql-datatype-parser-wasm": "^1.318.0", "y-monaco": "^0.1.4", diff --git a/frontend/scripts/untar_ui_builder.js b/frontend/scripts/untar_ui_builder.js new file mode 100644 index 0000000000..c64b1b1484 --- /dev/null +++ b/frontend/scripts/untar_ui_builder.js @@ -0,0 +1,48 @@ +import path from 'path' +import fs from 'fs' + +import { x } from 'tar' + +const tarUrl = 'https://pub-06154ed168a24e73a86ab84db6bf15d8.r2.dev/ui_builder-d44b577.tar.gz' +const outputTarPath = path.join(process.cwd(), 'ui_builder.tar.gz') +const extractTo = path.join(process.cwd(), 'static/ui_builder/') + +import { fileURLToPath } from 'url' +import { dirname } from 'path' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = dirname(__filename) + +// Download the tar file +const response = await fetch(tarUrl) +const buffer = await response.arrayBuffer() +await fs.promises.writeFile(outputTarPath, Buffer.from(buffer)) + +// Check if this script is being run from the package root +const isRootInstall = process.cwd() + '/scripts' === __dirname + +if (isRootInstall) { + console.log('Running postinstall: direct install') + // Your postinstall logic here +} else { + console.log('Skipping postinstall: installed as dependency') + process.exit(0) +} + +// Create extract directory if it doesn't exist +try { + await fs.promises.mkdir(extractTo, { recursive: true }) +} catch (err) { + if (err.code !== 'EEXIST') { + throw err + } +} + +await x({ + file: outputTarPath, + cwd: extractTo, + sync: false, + gzip: true +}) + +await fs.promises.unlink(outputTarPath) diff --git a/frontend/src/lib/ata/index.ts b/frontend/src/lib/ata/index.ts index 5414df8b18..3099094bf5 100644 --- a/frontend/src/lib/ata/index.ts +++ b/frontend/src/lib/ata/index.ts @@ -38,6 +38,30 @@ export interface ATABootstrapConfig { type ModuleMeta = { state: 'loading' } +export type DepsToGet = { + raw: string + module: string + version: string | undefined +}[] + +function getVersionFromRaw(d: string) { + if (d.lastIndexOf('@') > 0) { + const splitted = d.split('@') + let version = splitted.pop() + if (version?.startsWith('^') || version?.startsWith('~')) { + version = version.slice(1) + } + return version + } + return 'latest' +} + +export function versionRangeToVersion(version: string) { + if (version.startsWith('^') || version.startsWith('~')) { + return version.slice(1) + } + return version +} /** * The function which starts up type acquisition, * returns a function which you then pass the initial @@ -57,11 +81,11 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { let resLimit = { usage: 0 } - return async (initialSourceFile: string) => { + return async (initialSourceFile: string | DepsToGet) => { estimatedToDownload = 0 estimatedDownloaded = 0 - let todo: string[] = [initialSourceFile] + let todo: (string | DepsToGet)[] = [initialSourceFile] let next: string[] = [] let i = 0 let nb = 0 @@ -84,34 +108,25 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => { } } - function getVersion(d: string) { - if (d.lastIndexOf('@') > 0) { - const splitted = d.split('@') - let version = splitted.pop() - if (version?.startsWith('^') || version?.startsWith('~')) { - version = version.slice(1) - } - return version - } - return 'latest' - } - async function resolveDeps( - initialSourceFile: string, + depsSource: string | DepsToGet, depth: number, resLimit: ResLimit ): Promise { - let depsToGet = config - .depsParser(initialSourceFile) - .map((d: string) => { - let raw = mapModuleNameToModule(d) - return { - raw, - module: raw.lastIndexOf('@') > 0 ? raw.split('@').slice(0, -1).join('@') : raw, - version: getVersion(d) - } - }) - .filter((f) => !moduleMap.has(f.raw)) + let depsToGet = + typeof depsSource == 'object' + ? depsSource + : config + .depsParser(depsSource) + .map((d: string) => { + let raw = mapModuleNameToModule(d) + return { + raw, + module: raw.lastIndexOf('@') > 0 ? raw.split('@').slice(0, -1).join('@') : raw, + version: getVersionFromRaw(raw) + } + }) + .filter((f) => !moduleMap.has(f.raw)) if (depth == 0) { const relativeDeps = depsToGet.filter((f) => isTypescriptRelativePath(f.raw)) diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index f7d100c1a4..dbbf7e9e89 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -375,6 +375,9 @@ (e.ctrlKey || e.metaKey) && (e.key == 'Enter' || e.key == 'c' || e.key == 'v' || e.key == 'x') ) { + if (e.key == 'Enter') { + dispatch('keydownCmdEnter') + } return } e.stopPropagation() @@ -846,7 +849,7 @@ }} bind:args={value} dndType={`nested-${title}`} - schemaSkippedValues={['label']} + hiddenArgs={['label']} on:reorder={(e) => { if (oneOf && oneOf[objIdx]) { const keys = e.detail @@ -865,7 +868,7 @@ {onlyMaskPassword} {disablePortal} {disabled} - schemaSkippedValues={['label']} + hiddenArgs={['label']} schema={{ properties: obj.properties, order: obj.order, diff --git a/frontend/src/lib/components/DiffEditor.svelte b/frontend/src/lib/components/DiffEditor.svelte index 92acf052e6..3b24ce9180 100644 --- a/frontend/src/lib/components/DiffEditor.svelte +++ b/frontend/src/lib/components/DiffEditor.svelte @@ -2,7 +2,7 @@ import { BROWSER } from 'esm-env' import { createEventDispatcher, onMount } from 'svelte' - import '@codingame/monaco-vscode-standalone-languages' + // import '@codingame/monaco-vscode-standalone-languages' import '@codingame/monaco-vscode-standalone-json-language-features' import '@codingame/monaco-vscode-standalone-typescript-language-features' import { editor as meditor } from 'monaco-editor' diff --git a/frontend/src/lib/components/EditableSchemaForm.svelte b/frontend/src/lib/components/EditableSchemaForm.svelte index 8af0b2bcbd..a39314824c 100644 --- a/frontend/src/lib/components/EditableSchemaForm.svelte +++ b/frontend/src/lib/components/EditableSchemaForm.svelte @@ -27,7 +27,7 @@ import { createDispatcherIfMounted } from '$lib/createDispatcherIfMounted' export let schema: Schema | any - export let schemaSkippedValues: string[] = [] + export let hiddenArgs: string[] = [] export let args: Record = {} export let shouldHideNoInputs: boolean = false export let noVariablePicker = false @@ -439,7 +439,7 @@
{#if opened === argName}
- {#if !schemaSkippedValues.includes(argName) && Object.keys(schema?.properties ?? {}).includes(argName)} + {#if !hiddenArgs.includes(argName) && Object.keys(schema?.properties ?? {}).includes(argName)} {#if typeof args == 'object' && schema?.properties[argName]} + +{#if !isLoading} + +{:else} + +{/if} diff --git a/frontend/src/lib/components/SchemaForm.svelte b/frontend/src/lib/components/SchemaForm.svelte index a3aa090914..f9852cf3a5 100644 --- a/frontend/src/lib/components/SchemaForm.svelte +++ b/frontend/src/lib/components/SchemaForm.svelte @@ -18,7 +18,7 @@ import type { ComponentCustomCSS } from './apps/types' export let schema: Schema | any - export let schemaSkippedValues: string[] = [] + export let hiddenArgs: string[] = [] export let schemaFieldTooltip: Record = {} export let args: Record = {} export let disabledArgs: string[] = [] @@ -204,7 +204,7 @@ : ''} > - {#if !schemaSkippedValues.includes(argName) && keys.includes(argName)} + {#if !hiddenArgs.includes(argName) && keys.includes(argName)} {#if typeof diff[argName] === 'object' && diff[argName].oldSchema} {@const formerProperty = diff[argName].oldSchema}
@@ -278,6 +278,7 @@ }} on:acceptChange={(e) => dispatch('acceptChange', e.detail)} on:rejectChange={(e) => dispatch('rejectChange', e.detail)} + on:keydownCmdEnter={() => dispatch('keydownCmdEnter')} {disablePortal} {resourceTypes} {prettifyHeader} diff --git a/frontend/src/lib/components/ScriptEditor.svelte b/frontend/src/lib/components/ScriptEditor.svelte index 67943052b8..b464baece4 100644 --- a/frontend/src/lib/components/ScriptEditor.svelte +++ b/frontend/src/lib/components/ScriptEditor.svelte @@ -535,7 +535,6 @@ dispatch('format') }} class="flex flex-1 h-full !overflow-visible" - lang={scriptLangToEditorLang(lang)} scriptLang={lang} automaticLayout={true} {fixedOverflowWidgets} diff --git a/frontend/src/lib/components/SimpleEditor.svelte b/frontend/src/lib/components/SimpleEditor.svelte index ecd40cf5b8..2a7f3f37ae 100644 --- a/frontend/src/lib/components/SimpleEditor.svelte +++ b/frontend/src/lib/components/SimpleEditor.svelte @@ -2,7 +2,7 @@ let cssClassesLoaded = $state(false) let tailwindClassesLoaded = $state(false) - import '@codingame/monaco-vscode-standalone-languages' + // import '@codingame/monaco-vscode-standalone-languages' import '@codingame/monaco-vscode-standalone-json-language-features' import '@codingame/monaco-vscode-standalone-css-language-features' import '@codingame/monaco-vscode-standalone-typescript-language-features' @@ -54,6 +54,7 @@ type IDisposable } from 'monaco-editor' + import { allClasses } from './apps/editor/componentsPanel/cssUtils' import { createEventDispatcher, onDestroy, onMount } from 'svelte' diff --git a/frontend/src/lib/components/TemplateEditor.svelte b/frontend/src/lib/components/TemplateEditor.svelte index a8d312a1f5..1d82563e38 100644 --- a/frontend/src/lib/components/TemplateEditor.svelte +++ b/frontend/src/lib/components/TemplateEditor.svelte @@ -13,7 +13,7 @@ import { createEventDispatcher, getContext, onDestroy, onMount } from 'svelte' import type { AppViewerContext } from './apps/types' import { writable } from 'svelte/store' - import '@codingame/monaco-vscode-standalone-languages' + // import '@codingame/monaco-vscode-standalone-languages' import '@codingame/monaco-vscode-standalone-typescript-language-features' import { initializeVscode } from './vscode' diff --git a/frontend/src/lib/components/WorkerGroup.svelte b/frontend/src/lib/components/WorkerGroup.svelte index fbb6154e19..017584d57f 100644 --- a/frontend/src/lib/components/WorkerGroup.svelte +++ b/frontend/src/lib/components/WorkerGroup.svelte @@ -748,7 +748,6 @@ disabled={!$superadmin} class="flex flex-1 grow h-full w-full" automaticLayout - lang="shell" scriptLang={'bash'} useWebsockets={false} fixedOverflowWidgets={false} diff --git a/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte b/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte index d1f191fe08..8ff15f0832 100644 --- a/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte +++ b/frontend/src/lib/components/apps/components/helpers/RunnableComponent.svelte @@ -2,7 +2,7 @@ import type { Schema } from '$lib/common' import Alert from '$lib/components/common/alert/Alert.svelte' import Popover from '$lib/components/Popover.svelte' - import { AppService, type ExecuteComponentData } from '$lib/gen' + import { type ExecuteComponentData } from '$lib/gen' import { classNames, defaultIfEmptyString, emptySchema, sendUserToast } from '$lib/utils' import { deepEqual } from 'fast-equals' import { Bug } from 'lucide-svelte' @@ -26,6 +26,7 @@ import RefreshButton from '$lib/components/apps/components/helpers/RefreshButton.svelte' import { ctxRegex } from '../../utils' import { computeWorkspaceS3FileInputPolicy } from '../../editor/appUtilsS3' + import { executeRunnable } from './executeRunnable' import SchemaForm from '$lib/components/SchemaForm.svelte' import { createDispatcherIfMounted } from '$lib/createDispatcherIfMounted' @@ -40,7 +41,6 @@ export let forceSchemaDisplay: boolean = false export let wrapperClass = '' export let wrapperStyle = '' - export let initializing: boolean | undefined = undefined export let render: boolean export let outputs: { result: Output @@ -48,6 +48,7 @@ jobId?: Output | undefined } export let extraKey = '' + export let initializing: boolean = false export let recomputeOnInputChanged: boolean = true export let loading = false export let refreshOnStart: boolean = false @@ -350,84 +351,22 @@ try { jobId = await resultJobLoader?.abstractRun(async () => { - const nonStaticRunnableInputs = dynamicArgsOverride ?? {} - const staticRunnableInputs = {} - const allowUserResources: string[] = [] - for (const k of Object.keys(fields ?? {})) { - let field = fields[k] - if (field?.type == 'static' && fields[k]) { - if (isEditor) { - staticRunnableInputs[k] = field.value - } - } else if (field?.type == 'user') { - nonStaticRunnableInputs[k] = args?.[k] - if (isEditor && field.allowUserResources) { - allowUserResources.push(k) - } - } else if (field?.type == 'eval' || (field?.type == 'evalv2' && inputValues[k])) { - const ctxMatch = field.expr.match(ctxRegex) - if (ctxMatch) { - nonStaticRunnableInputs[k] = '$ctx:' + ctxMatch[1] - } else { - nonStaticRunnableInputs[k] = await inputValues[k]?.computeExpr() - } - if (isEditor && field?.type == 'evalv2' && field.allowUserResources) { - allowUserResources.push(k) - } - } else { - if (isEditor && field?.type == 'connected' && field.allowUserResources) { - allowUserResources.push(k) - } - nonStaticRunnableInputs[k] = runnableInputValues[k] - } - } - - const oneOfRunnableInputs = isEditor ? collectOneOfFields(fields, $app) : {} - - const requestBody: ExecuteComponentData['requestBody'] = { - args: nonStaticRunnableInputs, - component: id, - force_viewer_static_fields: !isEditor ? undefined : staticRunnableInputs, - force_viewer_one_of_fields: !isEditor ? undefined : oneOfRunnableInputs, - force_viewer_allow_user_resources: !isEditor ? undefined : allowUserResources - } - - if (runnable?.type === 'runnableByName') { - const { inlineScript } = inlineScriptOverride - ? { inlineScript: inlineScriptOverride } - : runnable - - if (inlineScript) { - if (inlineScript.id !== undefined) { - requestBody['id'] = inlineScript.id - } - requestBody['raw_code'] = { - content: inlineScript.id === undefined ? inlineScript.content : '', - language: inlineScript.language ?? '', - path: inlineScript.path, - lock: inlineScript.id === undefined ? inlineScript.lock : undefined, - cache_ttl: inlineScript.cache_ttl - } - } - } else if (runnable?.type === 'runnableByPath') { - const { path, runType } = runnable - requestBody['path'] = runType !== 'hubscript' ? `${runType}/${path}` : `script/${path}` - } - - if ($app.version !== undefined) { - requestBody['version'] = $app.version - } - - const uuid = await AppService.executeComponent({ + const uuid = await executeRunnable( + runnable, workspace, - path: defaultIfEmptyString($appPath, `u/${$userStore?.username ?? 'unknown'}/newapp`), - requestBody - }) + $app.version, + $userStore?.username, + $appPath, + id, + await buildRequestBody(dynamicArgsOverride), + inlineScriptOverride + ) if (isEditor) { addJob(uuid) } return uuid }, callbacks) + if (setRunnableJobEditorPanel && editorContext) { editorContext.runnableJobEditorPanel.update((p) => { return { @@ -449,6 +388,51 @@ } type Callbacks = { done: (x: any) => void; cancel: () => void; error: (e: any) => void } + export async function buildRequestBody(dynamicArgsOverride: Record | undefined) { + const nonStaticRunnableInputs = dynamicArgsOverride ?? {} + const staticRunnableInputs = {} + const allowUserResources: string[] = [] + for (const k of Object.keys(fields ?? {})) { + let field = fields[k] + if (field?.type == 'static' && fields[k]) { + if (isEditor) { + staticRunnableInputs[k] = field.value + } + } else if (field?.type == 'user') { + nonStaticRunnableInputs[k] = args?.[k] + if (isEditor && field.allowUserResources) { + allowUserResources.push(k) + } + } else if (field?.type == 'eval' || (field?.type == 'evalv2' && inputValues[k])) { + const ctxMatch = field.expr.match(ctxRegex) + if (ctxMatch) { + nonStaticRunnableInputs[k] = '$ctx:' + ctxMatch[1] + } else { + nonStaticRunnableInputs[k] = await inputValues[k]?.computeExpr() + } + if (isEditor && field?.type == 'evalv2' && field.allowUserResources) { + allowUserResources.push(k) + } + } else { + if (isEditor && field?.type == 'connected' && field.allowUserResources) { + allowUserResources.push(k) + } + nonStaticRunnableInputs[k] = runnableInputValues[k] + } + } + + const oneOfRunnableInputs = isEditor ? collectOneOfFields(fields, $app) : {} + + const requestBody: ExecuteComponentData['requestBody'] = { + args: nonStaticRunnableInputs, + component: id, + force_viewer_static_fields: !isEditor ? undefined : staticRunnableInputs, + force_viewer_one_of_fields: !isEditor ? undefined : oneOfRunnableInputs, + force_viewer_allow_user_resources: !isEditor ? undefined : allowUserResources + } + return requestBody + } + export async function runComponent( noToast = true, inlineScriptOverride?: InlineScript, @@ -647,15 +631,16 @@ } } + const nautoRefresh = (autoRefresh && recomputableByRefreshButton) || overrideAutoRefresh if (replaceCallback) { $runnableComponents[id] = { - autoRefresh: (autoRefresh && recomputableByRefreshButton) || overrideAutoRefresh, + autoRefresh: nautoRefresh, refreshOnStart: refreshOnStart, cb: [cancellableRun] } } else { $runnableComponents[id] = { - autoRefresh: (autoRefresh && recomputableByRefreshButton) || overrideAutoRefresh, + autoRefresh: nautoRefresh, refreshOnStart: refreshOnStart, cb: [...($runnableComponents[id]?.cb ?? []), cancellableRun] } @@ -664,6 +649,10 @@ if (!noInitialize && !$initialized.initializedComponents.includes(id)) { $initialized.initializedComponents = [...$initialized.initializedComponents, id] } + // console.log(initializing, $initialized.initialized, refreshOnStart) + if (initializing && $initialized.initialized && (refreshOnStart || nautoRefresh)) { + setDebouncedExecute() + } }) onDestroy(() => { @@ -850,7 +839,8 @@
{/if} - {#if render && !initializing && autoRefresh === true && !hideRefreshButton} + + {#if render && autoRefresh === true && !hideRefreshButton}
diff --git a/frontend/src/lib/components/apps/components/helpers/executeRunnable.ts b/frontend/src/lib/components/apps/components/helpers/executeRunnable.ts new file mode 100644 index 0000000000..397f690ae2 --- /dev/null +++ b/frontend/src/lib/components/apps/components/helpers/executeRunnable.ts @@ -0,0 +1,50 @@ +import { AppService, type ExecuteComponentData } from '$lib/gen' +import { defaultIfEmptyString } from '$lib/utils' +import type { Runnable } from '../../inputType' +import type { InlineScript } from '../../types' + +export async function executeRunnable( + runnable: Runnable, + workspace: string, + version: number | undefined, + username: string | undefined, + path: string, + id: string, + requestBody: ExecuteComponentData['requestBody'], + inlineScriptOverride?: InlineScript +) { + let appPath = defaultIfEmptyString(path, `u/${username ?? 'unknown'}/newapp`) + if (runnable?.type === 'runnableByName') { + const { inlineScript } = inlineScriptOverride + ? { inlineScript: inlineScriptOverride } + : runnable + + if (inlineScript) { + if (inlineScript.id !== undefined) { + requestBody['id'] = inlineScript.id + } + requestBody['raw_code'] = { + content: inlineScript.id === undefined ? inlineScript.content : '', + language: inlineScript.language ?? '', + path: appPath + '/' + id, + lock: inlineScript.id === undefined ? inlineScript.lock : undefined, + cache_ttl: inlineScript.cache_ttl + } + } + } else if (runnable?.type === 'runnableByPath') { + const { path, runType } = runnable + requestBody['path'] = runType !== 'hubscript' ? `${runType}/${path}` : `script/${path}` + } + + if (version !== undefined) { + requestBody['version'] = version + } + + const uuid = await AppService.executeComponent({ + workspace, + path: appPath, + requestBody + }) + + return uuid +} diff --git a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte index 46fde6f024..48bbfc0288 100644 --- a/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte +++ b/frontend/src/lib/components/apps/editor/AppEditorHeader.svelte @@ -1,15 +1,10 @@ + + + + + { + open = false + }} + tooltip="Look at latests runs to spot potential bugs." + documentationLink="https://www.windmill.dev/docs/apps/app_debugging" + > + + + +
+ {#if jobs.length > 0} +
+ {#each jobs ?? [] as id} + {@const selectedJob = jobsById[id]} + {#if selectedJob} + + +
{ + selectedJobId = id + rightColumnSelect = 'detail' + }} + > + {truncateRev(selectedJob.job, 20)} + {selectedJob.component} +
+ {/if} + {/each} +
+ {:else} +
No items
+ {/if} +
+
+
+ +
+
+ + Timeline + Details + +
+ {#if rightColumnSelect == 'timeline'} +
+ +
+ {:else if rightColumnSelect == 'detail'} +
+ {#if selectedJobId} + {#if selectedJobId?.includes('Frontend')} + {@const jobResult = jobsById[selectedJobId]} + {#if jobResult?.error !== undefined} + + + + + +
+ +
+
+
+ {:else if jobResult !== undefined} + + + + + +
+ +
+
+
+ {:else} + + {/if} + {:else} +
+ {#if job?.['running']} +
+ +
+ {/if} + {#if job?.args} +
+ +
+ {/if} + {#if job?.raw_code} +
+ +
+ {/if} + + {#if job?.job_kind !== 'flow' && !isFlowPreview(job?.job_kind)} + {@const jobResult = jobsById[selectedJobId]} + + + + + + {#if job != undefined && 'result' in job && job.result != undefined}
+ {:else if testIsLoading} +
+ {:else if job != undefined && 'result' in job && job?.['result'] == undefined} +
Result is undefined
+ {:else} +
+ +
+ {/if} +
+ {#if jobResult?.transformer} + +
Transformer results
+ {#if job != undefined && 'result' in job && job.result != undefined} +
+ +
+ {:else if testIsLoading} +
+ {:else if job != undefined && 'result' in job && job?.['result'] == undefined} +
Result is undefined
+ {:else} +
+ +
+ {/if} +
+ {/if} +
+ {:else} +
+ +
+ {#if job?.id} + { + job = detail + }} + /> + {:else} + + {/if} +
+ {/if} +
+ {/if} + {:else} +
Select a job to see its details
+ {/if} +
+ {/if} +
+ + + + {#if refreshComponents} + + {/if} + + {#if hasErrors} + + {/if} + + + diff --git a/frontend/src/lib/components/apps/editor/AppTimeline.svelte b/frontend/src/lib/components/apps/editor/AppTimeline.svelte index 7d2f4b06f1..bf41491c29 100644 --- a/frontend/src/lib/components/apps/editor/AppTimeline.svelte +++ b/frontend/src/lib/components/apps/editor/AppTimeline.svelte @@ -1,18 +1,19 @@ + +{#if runnableComponents && $runnableComponents[id] != undefined} + +{/if} diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte index 4e02887b4f..12cfedd2cf 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte @@ -10,26 +10,25 @@ import { defaultScriptLanguages, getScriptByPath, processLangs } from '$lib/scripts' import { Building, GitFork, Globe2 } from 'lucide-svelte' - import { createEventDispatcher, getContext } from 'svelte' + import { createEventDispatcher } from 'svelte' import { fly } from 'svelte/transition' - import type { AppViewerContext } from '../../types' import { defaultCode } from '../component' - import InlineScriptList from '../settingsPanel/mainInput/InlineScriptList.svelte' import WorkspaceScriptList from '../settingsPanel/mainInput/WorkspaceScriptList.svelte' import RunnableSelector from '../settingsPanel/mainInput/RunnableSelector.svelte' import { defaultScripts } from '$lib/stores' import DefaultScripts from '$lib/components/DefaultScripts.svelte' import type { Preview } from '$lib/gen' + import type { InlineScript } from '../../types' - export let name: string export let componentType: string | undefined = undefined export let showScriptPicker = false + export let rawApps = false + export let unusedInlineScripts: { name: string; inlineScript: InlineScript }[] - let tab = 'inlinescripts' + let tab = 'workspacescripts' let filter: string = '' let picker: Drawer - const { appPath, app } = getContext('AppViewerContext') const dispatch = createEventDispatcher() async function inferInlineScriptSchema( @@ -48,26 +47,22 @@ async function createInlineScriptByLanguage( language: Preview['language'], - path: string, subkind: 'pgsql' | 'mysql' | 'fetch' | undefined = undefined ) { const content = defaultCode(componentType ?? '', (subkind || language) ?? '') ?? initialCode(language, 'script', subkind ?? 'flow') - return newInlineScript(content, language, path) + return newInlineScript(content, language) } - async function newInlineScript(content: string, language: Preview['language'], path: string) { - const fullPath = `${$appPath}/${path}` - + async function newInlineScript(content: string, language: Preview['language']) { let schema: Schema = emptySchema() schema = await inferInlineScriptSchema(language, content, schema) const newInlineScript = { content, language, - path: fullPath, schema } dispatch('new', newInlineScript) @@ -75,23 +70,12 @@ async function pickScript(path: string) { const script = await getScriptByPath(path) - newInlineScript(script.content, script.language, path) + newInlineScript(script.content, script.language) } async function pickHubScript(path: string) { const script = await getScriptByPath(path) - newInlineScript(script.content, script.language, path) - } - - function pickInlineScript(name: string) { - const unusedInlineScriptIndex = $app.unusedInlineScripts?.findIndex( - (script) => script.name === name - ) - const unusedInlineScript = $app.unusedInlineScripts?.[unusedInlineScriptIndex] - - $app.unusedInlineScripts.splice(unusedInlineScriptIndex, 1) - $app = $app - dispatch('new', unusedInlineScript.inlineScript) + newInlineScript(script.content, script.language) } $: langs = processLangs(undefined, $defaultScripts?.order ?? Object.keys(defaultScriptLanguages)) @@ -108,12 +92,6 @@
- -
- - Detached Inline Scripts -
-
@@ -131,14 +109,7 @@
- {#if tab == 'inlinescripts'} - pickInlineScript(e.detail)} - inlineScripts={$app.unusedInlineScripts - ? $app.unusedInlineScripts.map((uis) => uis.name) - : []} - /> - {:else if tab == 'workspacescripts'} + {#if tab == 'workspacescripts'} pickScript(e.detail)} /> {:else if tab == 'hubscripts'} pickHubScript(e.detail.path)} /> @@ -159,7 +130,7 @@
Choose a language
{#if showScriptPicker} - + {/if}
-
-
- Frontend - - Frontend scripts are executed in the browser and can manipulate the app context directly. - -
+ {#if !rawApps} +
+
+ Frontend + + Frontend scripts are executed in the browser and can manipulate the app context + directly. + +
-
- { - const newInlineScript = { - content: `// read outputs and ctx +
+ { + const newInlineScript = { + content: `// read outputs and ctx console.log(ctx.email) // access a global state store @@ -235,14 +208,15 @@ state.foo += 1 // all helpers can be found at https://www.windmill.dev/docs/apps/app-runnable-panel#frontend-scripts-helpers return state.foo`, - language: 'frontend', - path: 'frontend script', - schema: undefined - } - dispatch('new', newInlineScript) - }} - /> + language: 'frontend', + path: 'frontend script', + schema: undefined + } + dispatch('new', newInlineScript) + }} + /> +
-
+ {/if}
diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte index cdf071618e..670ebb2445 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte @@ -14,13 +14,13 @@ import type { AppInput } from '../../inputType' import SimpleEditor from '$lib/components/SimpleEditor.svelte' import { buildExtraLib } from '../../utils' - import RunButton from './RunButton.svelte' + import RunButton from './AppRunButton.svelte' import { scriptLangToEditorLang } from '$lib/scripts' import ScriptGen from '$lib/components/copilot/ScriptGen.svelte' import DiffEditor from '$lib/components/DiffEditor.svelte' - import { userStore } from '$lib/stores' import CacheTtlPopup from './CacheTtlPopup.svelte' import EditorSettings from '$lib/components/EditorSettings.svelte' + import { userStore } from '$lib/stores' let inlineScriptEditorDrawer: InlineScriptEditorDrawer @@ -179,7 +179,9 @@ if (!deepEqual(newFields, fields)) { fields = newFields - $stateId++ + if (stateId) { + $stateId++ + } } } } @@ -211,7 +213,9 @@ ] } } - $stateId++ + if (stateId) { + $stateId++ + } } } @@ -219,6 +223,8 @@ {#if inlineScript} {#if inlineScript.language != 'frontend'} { $app = $app - $stateId++ + if (stateId) { + $stateId++ + } }} />
{:else} { if ( diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptHiddenRunnable.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptHiddenRunnable.svelte index 3a04c55389..aca0f9c043 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptHiddenRunnable.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptHiddenRunnable.svelte @@ -10,7 +10,7 @@ export let id: string export let transformer: boolean - const { runnableComponents } = getContext('AppViewerContext') + const { runnableComponents, app } = getContext('AppViewerContext') async function fork(nrunnable: Runnable) { runnable = { ...runnable, ...nrunnable, autoRefresh: true, recomputeOnInputChanged: true } } @@ -37,9 +37,11 @@ bind:inlineScript={runnable.transformer} name="Transformer" on:delete={() => { - delete $runnableComponents[id] - runnable.transformer = undefined - runnable = runnable + if (runnableComponents) { + delete $runnableComponents[id] + runnable.transformer = undefined + runnable = runnable + } }} /> {:else} @@ -67,8 +69,8 @@ /> {:else} onPick(e.detail)} - name={runnable.name} on:delete showScriptPicker on:new={(e) => { diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte index 16fe10c594..866141b231 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte @@ -18,18 +18,26 @@ import { deepEqual } from 'fast-equals' import { computeFields } from './utils' import { inferArgs, loadSchema } from '$lib/infer' - import RunButton from './RunButton.svelte' + import AppRunButton from './AppRunButton.svelte' import { getScriptByPath } from '$lib/scripts' import { sendUserToast } from '$lib/toast' import { autoPlacement } from '@floating-ui/core' import { ExternalLink, Eye, GitFork, Pen, RefreshCw, Trash } from 'lucide-svelte' + import { get } from 'svelte/store' + import RunButton from '$lib/components/RunButton.svelte' import Popover from '$lib/components/meltComponents/Popover.svelte' export let runnable: RunnableByPath - export let fields: Record + export let fields: + | Record + | undefined export let id: string + export let rawApps = false + export let isLoading = false + export let onRun = async () => {} + export let onCancel = async () => {} - const { stateId } = getContext('AppViewerContext') + const viewerContext = getContext('AppViewerContext') let drawerFlowViewer: Drawer let flowPath: string = '' @@ -37,15 +45,16 @@ const dispatch = createEventDispatcher() - async function refreshScript(x: RunnableByPath) { + async function refreshScript(runnable: RunnableByPath) { try { - let { schema } = await getScriptByPath(x.path) - if (!deepEqual(x.schema, schema)) { - x.schema = schema - if (!x.schema.order) { - x.schema.order = Object.keys(x.schema.properties ?? {}) + let { schema } = await getScriptByPath(runnable.path) + console.log('schema1', schema) + if (!deepEqual(runnable.schema, schema)) { + runnable.schema = schema + if (!runnable.schema.order) { + runnable.schema.order = Object.keys(runnable.schema.properties ?? {}) } - fields = computeFields(schema, false, fields) + fields = computeFields(schema, false, fields ?? {}) } } catch (e) { notFound = true @@ -53,15 +62,16 @@ } } - async function refreshFlow(x: RunnableByPath) { + async function refreshFlow(runnable: RunnableByPath) { try { - const { schema } = (await loadSchema($workspaceStore ?? '', x.path, 'flow')) ?? emptySchema() - if (!deepEqual(x.schema, schema)) { - x.schema = schema - if (!x.schema.order) { - x.schema.order = Object.keys(x.schema.properties ?? {}) + const { schema } = + (await loadSchema($workspaceStore ?? '', runnable.path, 'flow')) ?? emptySchema() + if (!deepEqual(runnable.schema, schema)) { + runnable.schema = schema + if (!runnable.schema.order) { + runnable.schema.order = Object.keys(runnable.schema.properties ?? {}) } - fields = computeFields(schema, false, fields) + fields = computeFields(schema, false, fields ?? {}) } } catch (e) { notFound = true @@ -92,6 +102,7 @@ if (deepEqual(runnable, lastRunnable)) { return } + console.log('runnable', runnable) notFound = false if (runnable.runType == 'script') { refreshScript(runnable) @@ -111,7 +122,11 @@
- + {#if !rawApps} + + {:else} + + {/if}
- {#key $stateId} + {#key viewerContext?.stateId ? get(viewerContext.stateId) : 0} {#if notFound}
{runnable.runType} not found at {runnable.path} in workspace {$workspaceStore}
import { getContext } from 'svelte' - import type { AppEditorContext, AppViewerContext, HiddenRunnable } from '../../types' + import type { AppEditorContext, AppViewerContext } from '../../types' import { Pane, Splitpanes } from 'svelte-splitpanes' import InlineScriptsPanelList from './InlineScriptsPanelList.svelte' import InlineScriptEditor from './InlineScriptEditor.svelte' @@ -9,13 +9,11 @@ import InlineScriptHiddenRunnable from './InlineScriptHiddenRunnable.svelte' import { BG_PREFIX } from '../../utils' import { sendUserToast } from '$lib/toast' - import type { RunnableByName } from '../../inputType' - import { ScriptService } from '$lib/gen' import { workspaceStore } from '$lib/stores' - import { findNextAvailablePath } from '$lib/path' import { twMerge } from 'tailwind-merge' + import { createScriptFromInlineScript } from './utils' - const { app, runnableComponents } = getContext('AppViewerContext') + const { app, runnableComponents, appPath } = getContext('AppViewerContext') const { selectedComponentInEditor } = getContext('AppEditorContext') function deleteBackgroundScript(index: number) { @@ -36,8 +34,10 @@ } $selectedComponentInEditor = undefined - delete $runnableComponents[BG_PREFIX + index] - $runnableComponents = $runnableComponents + if (runnableComponents) { + delete $runnableComponents[BG_PREFIX + index] + $runnableComponents = $runnableComponents + } } $: gridItem = @@ -57,50 +57,6 @@ (k_, index) => `unused-${index}` === $selectedComponentInEditor ) - async function createScriptFromInlineScript( - id: string, - runnable: HiddenRunnable | RunnableByName - ) { - if (runnable.type != 'runnableByName') { - sendUserToast('Only inline scripts can be saved to workspace', true) - return - } - if (!runnable.inlineScript) { - sendUserToast('No inline script found', true) - return - } - let path = `${runnable.inlineScript.path}/inline_${id}` - path = await findNextAvailablePath(path) - let language = runnable.inlineScript.language - if (language == 'frontend') { - sendUserToast('Frontend scripts can not be saved to workspace', true) - return - } - await ScriptService.createScript({ - workspace: $workspaceStore!, - requestBody: { - path: path, - summary: runnable.name ?? '', - description: '', - content: runnable.inlineScript.content, - parent_hash: undefined, - schema: runnable.inlineScript.schema, - is_template: false, - language: language! - } - }) - - Object.assign(runnable, { - type: 'runnableByPath', - schema: runnable.inlineScript.schema, - runType: 'script', - recomputeIds: undefined, - path - }) - - $app = $app - } - export let width: number | undefined = undefined @@ -114,13 +70,18 @@ {#if !$selectedComponentInEditor}
- Select a script on the left panel + Select a runnable on the left panel
{:else if gridItem} {#key gridItem?.id} { - createScriptFromInlineScript(gridItem?.id ?? 'unknown', e.detail) + createScriptFromInlineScript( + gridItem?.id ?? 'unknown', + e.detail, + $workspaceStore ?? '', + $appPath + ) }} bind:gridItem /> @@ -145,7 +106,13 @@ {#if $app.hiddenInlineScripts?.[hiddenInlineScript]} { - createScriptFromInlineScript(BG_PREFIX + hiddenInlineScript, e.detail) + createScriptFromInlineScript( + BG_PREFIX + hiddenInlineScript, + e.detail, + $workspaceStore ?? '', + $appPath + ) + $app = $app }} transformer={$selectedComponentInEditor?.endsWith('_transformer')} on:delete={() => deleteBackgroundScript(hiddenInlineScript)} @@ -154,7 +121,7 @@ />{/if}{/key} {:else}
- No script found at id {$selectedComponentInEditor} + No runnable found at id {$selectedComponentInEditor}
{/if}
diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte index e5a83cc178..4ba20786dc 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte @@ -21,7 +21,7 @@ function selectScript(id: string) { $selectedComponentInEditor = id - if (!id.startsWith('unused-') || !id.startsWith(BG_PREFIX)) { + if ((selectedComponent && !id.startsWith('unused-')) || !id.startsWith(BG_PREFIX)) { $selectedComponent = [$selectedComponentInEditor.split('_transformer')[0]] } } @@ -29,7 +29,7 @@ $: runnables = getAppScripts($app.grid, $app.subgrids) // When selected component changes, update selectedScriptComponentId - $: handleSelectedComponent($selectedComponent) + $: selectedComponent && handleSelectedComponent($selectedComponent) function handleSelectedComponent(selectedComponent: string[] | undefined) { if ( @@ -184,11 +184,11 @@ {/if}
-
Background Runnables + diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/utils.ts b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/utils.ts index 15b7c44237..7609ce4beb 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/utils.ts +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/utils.ts @@ -1,6 +1,8 @@ import type { Schema } from '$lib/common' -import type { AppInputs, Runnable } from '../../inputType' -import type { GridItem, InlineScript } from '../../types' +import { ScriptService } from '$lib/gen' +import { sendUserToast } from '$lib/toast' +import type { AppInputs, Runnable, RunnableByName } from '../../inputType' +import type { GridItem, HiddenRunnable, InlineScript } from '../../types' import { fieldTypeToTsType, schemaToInputsSpec } from '../../utils' import type { AppComponent } from '../component' @@ -111,7 +113,7 @@ export function getAppScripts( grid: GridItem[], subgrids: Record | undefined ): AppScriptsList { - const scriptsList = grid.reduce( + const scriptsList = (grid ?? []).reduce( (acc, gridComponent) => processGridItemRunnable(gridComponent, acc), { inline: [], imported: [], transformer: false } as AppScriptsList ) @@ -143,3 +145,45 @@ function processRunnable( transformer: transformer !== undefined }) } + +export async function createScriptFromInlineScript( + id: string, + runnable: HiddenRunnable | RunnableByName, + workspace: string, + appPath: string +) { + if (runnable.type != 'runnableByName') { + sendUserToast('Only inline scripts can be saved to workspace', true) + return + } + if (!runnable.inlineScript) { + sendUserToast('No inline script found', true) + return + } + let language = runnable.inlineScript.language + if (language == 'frontend') { + sendUserToast('Frontend scripts can not be saved to workspace', true) + return + } + await ScriptService.createScript({ + workspace, + requestBody: { + path: appPath + '/' + id, + summary: runnable.name ?? '', + description: '', + content: runnable.inlineScript.content, + parent_hash: undefined, + schema: runnable.inlineScript.schema, + is_template: false, + language: language! + } + }) + + Object.assign(runnable, { + type: 'runnableByPath', + schema: runnable.inlineScript.schema, + runType: 'script', + recomputeIds: undefined, + path: appPath + '/' + id + }) +} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte index e9fe80912d..b706095172 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/ComponentPanel.svelte @@ -156,7 +156,6 @@ type: 'runnableByName', name: `Eval of ${id}`, inlineScript: { - path: `${id}_eval`, content: `return ${componentSettings?.item.data.componentInput?.['expr']}`, language: 'frontend', refreshOn: componentSettings?.item.data.componentInput?.['connections']?.map((c) => { diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/HideButton.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/HideButton.svelte index 2a998e75e3..f473894312 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/HideButton.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/HideButton.svelte @@ -41,7 +41,8 @@ const shortcuts = { left: 'B', right: 'U', - bottom: 'L' + bottom: 'L', + top: 'T' } diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/SelectedRunnable.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/SelectedRunnable.svelte index 84cec1ed75..94c0af27cf 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/SelectedRunnable.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/SelectedRunnable.svelte @@ -46,36 +46,25 @@ appInput?.runnable?.type === 'runnableByPath' || (appInput?.runnable?.type === 'runnableByName' && appInput.runnable?.inlineScript !== undefined) - function getActions(hasScript: boolean): ActionType[] { - if (hasScript) { - return [ - ...(appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript - ? ([ - { - label: 'Detach', - icon: ExternalLink, - color: 'light', - callback: detach - } - ] as const) - : []), - { - label: 'Clear', - icon: X, - color: 'red', - callback: clear - } - ] - } else { - return [ - { - label: 'Clear', - icon: X, - color: 'red', - callback: clear - } - ] - } + function getActions(_hasScript: boolean): ActionType[] { + return [ + ...(appInput.runnable?.type === 'runnableByName' && appInput.runnable.inlineScript + ? ([ + { + label: 'Detach', + icon: ExternalLink, + color: 'light', + callback: detach + } + ] as const) + : []), + { + label: 'Clear', + icon: X, + color: 'red', + callback: clear + } + ] } $: actions = getActions(hasScript) diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte index 6f9a629261..8028ea9657 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/inputEditor/RunnableInputEditor.svelte @@ -5,13 +5,14 @@ import type { AppComponent } from '../../component' import RunnableSelector from '../mainInput/RunnableSelector.svelte' import SelectedRunnable from '../SelectedRunnable.svelte' - import type { AppEditorContext } from '$lib/components/apps/types' + import type { AppEditorContext, AppViewerContext } from '$lib/components/apps/types' export let appInput: ResultAppInput export let defaultUserInput = false export let appComponent: AppComponent const { selectedComponentInEditor } = getContext('AppEditorContext') + const { app } = getContext('AppViewerContext') function onPick({ runnable, @@ -33,6 +34,7 @@ {:else if appInput !== undefined} ('AppViewerContext') + const appContext = getContext('AppViewerContext') + $: componentInput && appContext?.onchange?.() let s3FileUploadRawMode = false let s3FilePicker: S3FilePicker | undefined = undefined - - $: componentInput && onchange?.() {#key subFieldType} diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte index 3934666353..176b8c670b 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte @@ -6,12 +6,13 @@ import type { Runnable, StaticAppInput } from '$lib/components/apps/inputType' import WorkspaceScriptList from './WorkspaceScriptList.svelte' import WorkspaceFlowList from './WorkspaceFlowList.svelte' - import type { AppViewerContext } from '$lib/components/apps/types' - import { createEventDispatcher, getContext } from 'svelte' + import { createEventDispatcher } from 'svelte' import type { Schema } from '$lib/common' - import { getAllScriptNames, schemaToInputsSpec } from '$lib/components/apps/utils' + import { schemaToInputsSpec } from '$lib/components/apps/utils' import { defaultIfEmptyString, emptySchema } from '$lib/utils' import { loadSchema } from '$lib/infer' + import { workspaceStore } from '$lib/stores' + import type { InlineScript } from '$lib/components/apps/types' type Tab = 'hubscripts' | 'workspacescripts' | 'workspaceflows' | 'inlinescripts' @@ -19,14 +20,15 @@ export let hideCreateScript = false export let onlyFlow = false export let rawApps = false + export let unusedInlineScripts: { name: string; inlineScript: InlineScript }[] - const { app, workspace } = getContext('AppViewerContext') + // const { app, workspace } = getContext('AppViewerContext') let tab: Tab = onlyFlow ? 'workspaceflows' - : $app?.unusedInlineScripts?.length > 0 - ? 'inlinescripts' - : 'workspacescripts' + : unusedInlineScripts?.length > 0 + ? 'inlinescripts' + : 'workspacescripts' let filter: string = '' let picker: Drawer @@ -41,7 +43,7 @@ path: string, runType: 'script' | 'flow' | 'hubscript' ): Promise<{ schema: Schema; summary: string | undefined }> { - const schema = await loadSchema(workspace, path, runType) + const schema = await loadSchema($workspaceStore!, path, runType) if (!schema.schema.order) { schema.schema.order = Object.keys(schema.schema.properties ?? {}) } @@ -88,7 +90,7 @@ type: 'runnableByPath', path, runType: 'hubscript', - schema, + schema: schema.schema, name: defaultIfEmptyString(schema.summary, path) } as const dispatch('pick', { @@ -98,10 +100,8 @@ } function pickInlineScript(name: string) { - const unusedInlineScriptIndex = $app.unusedInlineScripts?.findIndex( - (script) => script.name === name - ) - const unusedInlineScript = $app.unusedInlineScripts?.[unusedInlineScriptIndex] + const unusedInlineScriptIndex = unusedInlineScripts?.findIndex((script) => script.name === name) + const unusedInlineScript = unusedInlineScripts?.[unusedInlineScriptIndex] dispatch('pick', { runnable: { type: 'runnableByName', @@ -111,25 +111,17 @@ fields: {} }) - $app.unusedInlineScripts.splice(unusedInlineScriptIndex, 1) - $app.unusedInlineScripts = $app.unusedInlineScripts + unusedInlineScripts.splice(unusedInlineScriptIndex, 1) + unusedInlineScripts = unusedInlineScripts } function createScript() { - let index = 0 - let newScriptPath = `Inline Script ${index}` - - const names = getAllScriptNames($app) - - // Find a name that is not used by any other inline script - while (names.includes(newScriptPath)) { - newScriptPath = `Inline Script ${++index}` - } + let newScriptName = `Inline Script` dispatch('pick', { runnable: { type: 'runnableByName', - name: newScriptPath, + name: newScriptName, inlineScript: undefined }, fields: {} @@ -179,8 +171,8 @@ {#if tab == 'inlinescripts'} pickInlineScript(e.detail)} - inlineScripts={$app.unusedInlineScripts - ? $app.unusedInlineScripts.map((uis) => uis.name) + inlineScripts={unusedInlineScripts + ? unusedInlineScripts.map((uis) => uis.name) : []} /> {:else if tab == 'workspacescripts'} @@ -215,7 +207,7 @@ on:click={() => picker?.openDrawer()} size="xs" color="blue" - variant="border" + variant={rawApps ? 'contained' : 'border'} startIcon={{ icon: MousePointer }} btnClasses="truncate w-full" > diff --git a/frontend/src/lib/components/apps/inputType.ts b/frontend/src/lib/components/apps/inputType.ts index e348300628..96e051a90a 100644 --- a/frontend/src/lib/components/apps/inputType.ts +++ b/frontend/src/lib/components/apps/inputType.ts @@ -142,6 +142,8 @@ export type RunnableByName = { export type Runnable = RunnableByPath | RunnableByName | undefined +export type RunnableWithFields = Runnable & { fields?: Record } + // Runnable input, set by the developer in the component panel export type ResultInput = { runnable: Runnable diff --git a/frontend/src/lib/components/apps/store.ts b/frontend/src/lib/components/apps/store.ts index 54356aa2a5..69b064e2f9 100644 --- a/frontend/src/lib/components/apps/store.ts +++ b/frontend/src/lib/components/apps/store.ts @@ -1,7 +1,6 @@ import type { Policy } from '$lib/gen' import { writable } from 'svelte/store' -import type { App } from './types' -export const importStore = writable<{ summary: string; value: App; policy: Policy } | undefined>( +export const importStore = writable<{ summary: string; value: any; policy: Policy } | undefined>( undefined ) diff --git a/frontend/src/lib/components/apps/types.ts b/frontend/src/lib/components/apps/types.ts index e58618f99b..b000fc2326 100644 --- a/frontend/src/lib/components/apps/types.ts +++ b/frontend/src/lib/components/apps/types.ts @@ -196,6 +196,17 @@ export type ListInputs = { export type GroupContext = { id: string; context: Writable> } +export type JobById = { + job: string + component: string + result?: any + error?: any + transformer?: { result?: any; error?: string } + created_at?: number + started_at?: number + duration_ms?: number +} + export type AppViewerContext = { worldStore: Writable app: Writable @@ -227,21 +238,7 @@ export type AppViewerContext = { isEditor: boolean jobs: Writable // jobByComponent: Writable>, - jobsById: Writable< - Record< - string, - { - job: string - component: string - result?: string - error?: any - transformer?: { result?: string; error?: string } - created_at?: number - started_at?: number - duration_ms?: number - } - > - > + jobsById: Writable> noBackend: boolean errorByComponent: Writable> openDebugRun: Writable<((jobID: string) => void) | undefined> diff --git a/frontend/src/lib/components/apps/utils.ts b/frontend/src/lib/components/apps/utils.ts index cf9e218c4d..dc512b8645 100644 --- a/frontend/src/lib/components/apps/utils.ts +++ b/frontend/src/lib/components/apps/utils.ts @@ -42,9 +42,9 @@ export function allItems( subgrids: Record | undefined ): GridItem[] { if (subgrids == undefined) { - return grid + return grid ?? [] } - return [...grid, ...Object.values(subgrids).flat()] + return [...(grid ?? []), ...Object.values(subgrids).flat()] } export function schemaToInputsSpec( @@ -377,7 +377,7 @@ declare const result: any; } export function getAllScriptNames(app: App): string[] { - const names = allItems(app.grid, app?.subgrids).reduce((acc, gridItem: GridItem) => { + const names = (allItems(app.grid, app?.subgrids) ?? []).reduce((acc, gridItem: GridItem) => { const { componentInput } = gridItem.data if ( @@ -426,7 +426,7 @@ export function getAllScriptNames(app: App): string[] { return acc }, [] as string[]) - const unusedNames = app.unusedInlineScripts.map((x) => x.name) + const unusedNames = app.unusedInlineScripts?.map((x) => x.name) ?? [] const backgroundNames = app.hiddenInlineScripts?.map((x) => x.name) ?? [] return [...names, ...unusedNames, ...backgroundNames] diff --git a/frontend/src/lib/components/common/modal/Modal.svelte b/frontend/src/lib/components/common/modal/Modal.svelte index 46593e49cd..47a2fe09a0 100644 --- a/frontend/src/lib/components/common/modal/Modal.svelte +++ b/frontend/src/lib/components/common/modal/Modal.svelte @@ -4,6 +4,7 @@ import Button from '../button/Button.svelte' import Badge from '../badge/Badge.svelte' import { twMerge } from 'tailwind-merge' + import CloseButton from '../CloseButton.svelte' export let title: string export let open: boolean = false @@ -11,6 +12,7 @@ export { c as class } export let style = '' export let cancelText: string | undefined = undefined + export let kind: 'button' | 'X' = 'button' const dispatch = createEventDispatcher() @@ -69,6 +71,10 @@ )} {style} > + {#if kind == 'X'} +
(open = false)} />
+ {/if}
@@ -81,21 +87,23 @@
-
- - -
+ {cancelText ?? 'Cancel'}Escape + +
+ {/if}
diff --git a/frontend/src/lib/components/common/table/AppRow.svelte b/frontend/src/lib/components/common/table/AppRow.svelte index 4e629dc205..12d13cbf38 100644 --- a/frontend/src/lib/components/common/table/AppRow.svelte +++ b/frontend/src/lib/components/common/table/AppRow.svelte @@ -23,8 +23,7 @@ Pen, Share, Trash, - Clipboard, - Loader2 + Clipboard } from 'lucide-svelte' import { goto as gotoUrl } from '$app/navigation' import { page } from '$app/stores' @@ -55,16 +54,14 @@ {#if menuOpen} - {#await import('$lib/components/apps/editor/AppJsonEditor.svelte')} - - {:then Module} + {#await import('$lib/components/apps/editor/AppJsonEditor.svelte') then Module} {/await} {/if} {/if} + {#if app.raw_app} + +
+ + Raw +
+ {/if}
@@ -98,7 +103,7 @@ size="xs" variant="border" startIcon={{ icon: Pen }} - href="{base}/apps/edit/{app.path}?nodraft=true" + href="{base}/apps{app.raw_app ? '_raw' : ''}/edit/{app.path}?nodraft=true" > Edit @@ -110,7 +115,7 @@ size="xs" variant="border" startIcon={{ icon: GitFork }} - href="{base}/apps/add?template={app.path}" + href="{base}/apps{app.raw_app ? '_raw' : ''}/add?template={app.path}" > Fork @@ -157,7 +162,7 @@ { displayName: 'Duplicate/Fork', icon: GitFork, - href: `${base}/apps/add?template=${path}`, + href: `${base}/apps${app.raw_app ? '_raw' : ''}/add?template=${path}`, hide: $userStore?.operator }, { diff --git a/frontend/src/lib/components/copilot/autocomplete/monaco-adapter.ts b/frontend/src/lib/components/copilot/autocomplete/monaco-adapter.ts index 8d421b450f..9952199fd2 100644 --- a/frontend/src/lib/components/copilot/autocomplete/monaco-adapter.ts +++ b/frontend/src/lib/components/copilot/autocomplete/monaco-adapter.ts @@ -154,22 +154,22 @@ const MAX_PATCHES = 4 export class Autocompletor { editor: meditor.IStandaloneCodeEditor language: string - scriptLang: ScriptLang | 'bunnative' + scriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json' viewZoneIds: string[] = [] decorationsCollection: meditor.IEditorDecorationsCollection | undefined = undefined visualChanges: VisualChange[] = [] modifiedCode: string = '' applyZone: | { - startLineNumber: number - endLineNumber: number - } + startLineNumber: number + endLineNumber: number + } | undefined = undefined lastChangePosition: | { - lineNumber: number - column: number - } + lineNumber: number + column: number + } | undefined = undefined abortController: AbortController | undefined = undefined @@ -180,19 +180,19 @@ export class Autocompletor { predictedChange: | { - position: { - lineNumber: number - column: number - } - distance: number - } + position: { + lineNumber: number + column: number + } + distance: number + } | undefined = undefined tabWidget: meditor.IContentWidget | undefined = undefined constructor( editor: meditor.IStandaloneCodeEditor, language: string, - scriptLang: ScriptLang | 'bunnative' + scriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json' ) { this.editor = editor this.language = language @@ -240,18 +240,18 @@ export class Autocompletor { let closestPosition: | { - lineNumber: number - column: number - } + lineNumber: number + column: number + } | undefined = undefined let closestDistance = Infinity for (const change of this.visualChanges) { if (change.type === 'deleted') { const distance = Math.min( Math.abs(change.range.startLine - position.lineNumber) + - Math.abs(change.range.startColumn - position.column) / 10000, + Math.abs(change.range.startColumn - position.column) / 10000, Math.abs(change.range.endLine - position.lineNumber) + - Math.abs(change.range.endColumn - position.column) / 10000 + Math.abs(change.range.endColumn - position.column) / 10000 ) if (distance < closestDistance) { closestDistance = distance diff --git a/frontend/src/lib/components/copilot/autocomplete/request.ts b/frontend/src/lib/components/copilot/autocomplete/request.ts index b670f5ed06..0d6700a2b4 100644 --- a/frontend/src/lib/components/copilot/autocomplete/request.ts +++ b/frontend/src/lib/components/copilot/autocomplete/request.ts @@ -64,7 +64,7 @@ export async function autocompleteRequest( modifiableSuffix: string suffix: string language: string - scriptLang: ScriptLang | 'bunnative' + scriptLang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json' events: string[] }, abortController: AbortController diff --git a/frontend/src/lib/components/copilot/chat/core.ts b/frontend/src/lib/components/copilot/chat/core.ts index ed5c968b88..ee0b67c710 100644 --- a/frontend/src/lib/components/copilot/chat/core.ts +++ b/frontend/src/lib/components/copilot/chat/core.ts @@ -93,7 +93,7 @@ export const SUPPORTED_CHAT_SCRIPT_LANGUAGES = [ ] export function getLangContext( - lang: ScriptLang | 'bunnative', + lang: ScriptLang | 'bunnative' | 'jsx' | 'tsx' | 'json', { allowResourcesFetch = false }: { allowResourcesFetch?: boolean } = {} ) { const tsContext = diff --git a/frontend/src/lib/components/flows/CreateActionsApp.svelte b/frontend/src/lib/components/flows/CreateActionsApp.svelte index c8260b0fc0..d68356e786 100644 --- a/frontend/src/lib/components/flows/CreateActionsApp.svelte +++ b/frontend/src/lib/components/flows/CreateActionsApp.svelte @@ -2,24 +2,16 @@ import { goto } from '$lib/navigation' import { base } from '$lib/base' - import { Button, FileInput } from '$lib/components/common' + import { Button } from '$lib/components/common' import Drawer from '$lib/components/common/drawer/Drawer.svelte' import DrawerContent from '$lib/components/common/drawer/DrawerContent.svelte' import { LayoutDashboard, Loader2, Plus } from 'lucide-svelte' import { importStore } from '../apps/store' - import { RawAppService } from '$lib/gen' - import { workspaceStore } from '$lib/stores' - import Path from '../Path.svelte' - import Tooltip from '../Tooltip.svelte' + import YAML from 'yaml' let drawer: Drawer | undefined = undefined - let rawAppDrawer: Drawer | undefined = undefined let pendingRaw: string = '' - let pendingCode: string = '' - let summary: string = '' - let path: string = '' - let pathError: string = '' let importType: 'yaml' | 'json' = 'yaml' @@ -28,19 +20,6 @@ await goto('/apps/add?nodraft=true') drawer?.closeDrawer?.() } - - async function importRawApp() { - await RawAppService.createRawApp({ - workspace: $workspaceStore!, - requestBody: { - path, - summary, - value: pendingCode - } - }) - await goto(`/apps/get_raw/0/${path}`) - rawAppDrawer?.closeDrawer?.() - } @@ -65,11 +44,11 @@ drawer?.toggleDrawer?.() importType = 'json' } - }, - { - label: 'Import app in React/Vue/Svelte', - onClick: () => rawAppDrawer?.toggleDrawer?.() } + // { + // label: 'Build app in React/Vue/Svelte (alpha)', + // onClick: () => goto('/apps_raw/add?nodraft=true') + // } ]} >
@@ -99,45 +78,3 @@ - - - - rawAppDrawer?.toggleDrawer?.()} - > - -

Summary

- - - -

IIFE JS code Bundle that contains an IIFE code that will mount itself to a "root" element. Any framework - or vanilla JS can be used to create an app and templates are provided for the major - frameworks: React/Vue/Svelte. In those frontend apps, it is possible to inline scripts - directly to be executed by windmill backend which makes it a convenient way of building apps - with both frontend and backend all-in-one.

- { - pendingCode = detail?.[0] - }} - /> - - - - -
-
diff --git a/frontend/src/lib/components/icons/CssIcon.svelte b/frontend/src/lib/components/icons/CssIcon.svelte new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frontend/src/lib/components/icons/JavaScriptIcon.svelte b/frontend/src/lib/components/icons/JavaScriptIcon.svelte new file mode 100644 index 0000000000..23dce0a347 --- /dev/null +++ b/frontend/src/lib/components/icons/JavaScriptIcon.svelte @@ -0,0 +1,16 @@ + + + + + + + diff --git a/frontend/src/lib/components/icons/JsonIcon.svelte b/frontend/src/lib/components/icons/JsonIcon.svelte new file mode 100644 index 0000000000..2736d80406 --- /dev/null +++ b/frontend/src/lib/components/icons/JsonIcon.svelte @@ -0,0 +1,11 @@ + + + diff --git a/frontend/src/lib/components/icons/ReactIcon.svelte b/frontend/src/lib/components/icons/ReactIcon.svelte new file mode 100644 index 0000000000..fc286af4e0 --- /dev/null +++ b/frontend/src/lib/components/icons/ReactIcon.svelte @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/frontend/src/lib/components/icons/SvelteIcon.svelte b/frontend/src/lib/components/icons/SvelteIcon.svelte new file mode 100644 index 0000000000..6f6dfcc528 --- /dev/null +++ b/frontend/src/lib/components/icons/SvelteIcon.svelte @@ -0,0 +1,15 @@ + + + + + + diff --git a/frontend/src/lib/components/icons/VueIcon.svelte b/frontend/src/lib/components/icons/VueIcon.svelte new file mode 100644 index 0000000000..a04b3dd918 --- /dev/null +++ b/frontend/src/lib/components/icons/VueIcon.svelte @@ -0,0 +1,13 @@ + + + + + + + diff --git a/frontend/src/lib/components/raw_apps/FileEditorIcon.svelte b/frontend/src/lib/components/raw_apps/FileEditorIcon.svelte new file mode 100644 index 0000000000..f1419b32c7 --- /dev/null +++ b/frontend/src/lib/components/raw_apps/FileEditorIcon.svelte @@ -0,0 +1,26 @@ + + +{#if file.endsWith('.tsx')} + +{:else if file.endsWith('.json')} + +{:else if file.endsWith('.ts')} + +{:else if file.endsWith('.js')} + +{:else if file.endsWith('.vue')} + +{:else if file.endsWith('.css')} + # +{:else if file.endsWith('.svelte')} + +{/if} diff --git a/frontend/src/lib/components/raw_apps/RawAppBackgroundRunner.svelte b/frontend/src/lib/components/raw_apps/RawAppBackgroundRunner.svelte new file mode 100644 index 0000000000..c80bd2c41b --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppBackgroundRunner.svelte @@ -0,0 +1,90 @@ + + + diff --git a/frontend/src/lib/components/raw_apps/RawAppEditor.svelte b/frontend/src/lib/components/raw_apps/RawAppEditor.svelte new file mode 100644 index 0000000000..019d442fee --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppEditor.svelte @@ -0,0 +1,197 @@ + + + + + + +
+ + + + + + + + +
+ { + appPanelSize = 100 + }} + appPath={path} + bind:selectedRunnable + {runnables} + /> +
+ +
+
+ {#if appPanelSize == 100} +
+ { + appPanelSize = 70 + }} + direction="bottom" + hidden + btnClasses="border bg-surface" + /> +
+ {/if} +
diff --git a/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte new file mode 100644 index 0000000000..a7bb51be65 --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppEditorHeader.svelte @@ -0,0 +1,1078 @@ + + + + + + +{#if appPath == ''} + + closeDraftDrawer()}> + + Choose a path to save the initial draft of the app. + +

Summary

+
+ + { + if (appPath == '' && summary?.length > 0 && !dirtyPath) { + path?.setName( + summary + .toLowerCase() + .replace(/[^a-z0-9_]/g, '_') + .replace(/-+/g, '_') + .replace(/^-|-$/g, '') + ) + } + }} + /> +
+
+ +
+ +
+ +
+ + +{/if} + + closeSaveDrawer()}> + {#if !onLatest} + + By deploying, you may overwrite changes made by other users. Press 'Deploy' to see diff. + +
+ {/if} + Summary +
+ + { + if (appPath == '' && summary?.length > 0 && !dirtyPath) { + path?.setName( + summary + .toLowerCase() + .replace(/[^a-z0-9_]/g, '_') + .replace(/-+/g, '_') + .replace(/^-|-$/g, '') + ) + } + }} + /> +
+
+ Deployment message +
+ + +
+
+ Path + + +
+ + +
+
+ {#if appPath == ''} + + Save this app once before you can publish it + + {:else} + + A viewer of the app will execute the runnables of the app on behalf of the publisher (you) + + It ensures that all required resources/runnable visible for publisher but not for viewer + at time of creating the app would prevent the execution of the app. To guarantee tight + security, a policy is computed at time of deployment of the app which only allow the + scripts/flows referred to in the app to be called on behalf of. Furthermore, static + parameters are not overridable. Hence, users will only be able to use the app as intended + by the publisher without risk for leaking resources not used in the app. + + + +
+ +

Public URL

+
+ +
+ { + policy.execution_mode = e.detail ? 'anonymous' : 'publisher' + setPublishState() + }} + /> +
+ +
+
+
Public URL
+
+ {#if secretUrl} + {@const href = `${window.location.origin}${base}/public/${$workspaceStore}/${secretUrl}`} + + {:else} + {/if} +
+ Share this url directly or embed it using an iframe (if requiring login, top-level domain + of embedding app must be the same as the one of Windmill) +
+ +
+ {#if !$enterpriseLicense} + + Custom path is an enterprise only feature. + +
+ {:else if !($userStore?.is_admin || $userStore?.is_super_admin)} + + Custom path can only be set by workspace admins + +
+ {/if} + { + customPath = detail ? '' : undefined + }} + checked={customPath !== undefined} + options={{ + right: 'Use a custom URL' + }} + disabled={!$enterpriseLicense || !($userStore?.is_admin || $userStore?.is_super_admin)} + /> + + {#if customPath !== undefined} +
+
Custom path
+
+ { + dirtyCustomPath = true + }} + /> +
+
Custom public URL
+
+ + +
{dirtyCustomPath ? customPathError : ''} +
+ {/if} +
+
+ + You will still need to deploy the app to make visible the latest changes + + + Embed this app in your own product to be used by your own users + {/if} + + + + + (historyBrowserDrawerOpen = false)}> + + + + + { + jobs = [] + }} + on:clearErrors={() => { + console.log('todo clear errors') + }} + {jobs} + hasErrors={false} + {jobsById} + errorByComponent={{}} +/> + +
+
+ +
+ +
+ {#if newPath || newEditedPath} +
+
+ +
+ { + currentTarget.select() + }} + /> +
+ {/if} +
+ {#if $enterpriseLicense && appPath != ''} + + {/if} +
+ + + + + + + + + + +
+
diff --git a/frontend/src/lib/components/raw_apps/RawAppInlineScriptEditor.svelte b/frontend/src/lib/components/raw_apps/RawAppInlineScriptEditor.svelte new file mode 100644 index 0000000000..7754e965e3 --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppInlineScriptEditor.svelte @@ -0,0 +1,219 @@ + + +{#if inlineScript} + {#if inlineScript.language != 'frontend'} + { + dispatch('createScriptFromInlineScript') + drawerIsOpen = false + }} + /> + {/if} +
+
+ {#if name !== undefined} +
+ { + // $app = $app + // if (stateId) { + // $stateId++ + // } + }} + /> +
+
+ {/if} +
+ {#if inlineScript} + + {/if} + { + acc[key] = obj.type === 'static' ? obj.value : undefined + return acc + }, {})} + /> + + + + +
+
+ + + +
+ {#if !drawerIsOpen && inlineScript.language != 'frontend'} + onRun()} + on:change={async (e) => { + if (inlineScript && inlineScript.language != 'frontend') { + if (inlineScript.lock != undefined) { + inlineScript.lock = undefined + } + const oldSchema = JSON.stringify(inlineScript.schema) + if (inlineScript.schema == undefined) { + inlineScript.schema = emptySchema() + } + await inferInlineScriptSchema(inlineScript?.language, e.detail, inlineScript.schema) + if (JSON.stringify(inlineScript.schema) != oldSchema) { + inlineScript = inlineScript + syncFields() + } + } + // $app = $app + }} + args={Object.entries(fields ?? {}).reduce((acc, [key, obj]) => { + acc[key] = obj.type === 'static' ? obj.value : undefined + return acc + }, {})} + /> + + + {/if} +
+
+{/if} diff --git a/frontend/src/lib/components/raw_apps/RawAppInlineScriptPanelList.svelte b/frontend/src/lib/components/raw_apps/RawAppInlineScriptPanelList.svelte new file mode 100644 index 0000000000..8bece2ea3a --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppInlineScriptPanelList.svelte @@ -0,0 +1,90 @@ + + + + +
+ { + dispatch('hidePanel') + }} + /> + + +
+
+
+
+
+ {#if Object.keys($runnables ?? {}).length > 0} + {#each Object.entries($runnables ?? {}) as [id, runnable]} + {#if runnable} + + {/if} + {/each} + {:else} +
No backend runnable
+ {/if} +
+
+
+
+ + diff --git a/frontend/src/lib/components/raw_apps/RawAppInlineScriptRunnable.svelte b/frontend/src/lib/components/raw_apps/RawAppInlineScriptRunnable.svelte new file mode 100644 index 0000000000..1c96d7b9c9 --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppInlineScriptRunnable.svelte @@ -0,0 +1,214 @@ + + + +{#if runnable?.type == 'runnableByPath' || (runnable?.type == 'runnableByName' && runnable.inlineScript)} + + + {#if runnable?.type === 'runnableByName' && runnable.inlineScript} + {#if runnable.inlineScript.language == 'frontend'} +
Frontend scripts not supported for raw apps
+ {:else} + + dispatch('createScriptFromInlineScript', runnable)} + {id} + bind:inlineScript={runnable.inlineScript} + bind:name={runnable.name} + bind:fields={runnable.fields} + isLoading={testIsLoading} + onRun={testPreview} + onCancel={async () => { + if (testJobLoader) { + await testJobLoader.cancelJob() + } + }} + on:delete + path={appPath} + /> + {/if} + {:else if runnable?.type == 'runnableByPath'} + fork(e.detail)} + on:delete + {id} + isLoading={testIsLoading} + onRun={testPreview} + onCancel={async () => { + if (testJobLoader) { + await testJobLoader.cancelJob() + } + }} + /> + {/if} +
+ + + Inputs + Test + + {#if selectedTab == 'inputs'} + {#if runnable?.fields} +
+ {#each Object.keys(runnable.fields) as k} + {@const meta = runnable.fields[k]} + + {/each} +
+ {:else} +
No inputs
+ {/if} + {:else if selectedTab == 'test'} + + + +
+ v.type == 'static') + .map(([k]) => k)} + schema={getSchema(runnable)} + bind:args + shouldCapitalize + /> +
+
+ + + +
+
+ {/if} +
+
+
+
+{:else} + onPick(e.detail)} + on:delete + showScriptPicker + on:new={(e) => { + runnable = { + type: 'runnableByName', + inlineScript: e.detail, + name: runnable?.name ?? 'Background Runnable' + } + }} + /> +{/if} diff --git a/frontend/src/lib/components/raw_apps/RawAppInlineScriptsPanel.svelte b/frontend/src/lib/components/raw_apps/RawAppInlineScriptsPanel.svelte new file mode 100644 index 0000000000..b3c00b5cc6 --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppInlineScriptsPanel.svelte @@ -0,0 +1,61 @@ + + + + + + + + {#if !selectedRunnable} +
+ Select a runnable on the left panel +
+ {:else if $runnables?.[selectedRunnable]} + {#key selectedRunnable} + { + createScriptFromInlineScript( + selectedRunnable ?? '', + e.detail, + $workspaceStore ?? '', + appPath + ) + }} + on:delete={() => { + runnables.update((runnables) => { + if (selectedRunnable) { + delete runnables[selectedRunnable] + } + selectedRunnable = undefined + return { ...runnables } + }) + }} + id={selectedRunnable} + bind:runnable={$runnables[selectedRunnable]} + />{/key} + {:else} +
+ No runnable at id {selectedRunnable} +
+ {/if} +
+
diff --git a/frontend/src/lib/components/raw_apps/RawAppInputsSpecEditor.svelte b/frontend/src/lib/components/raw_apps/RawAppInputsSpecEditor.svelte new file mode 100644 index 0000000000..7160917bcb --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppInputsSpecEditor.svelte @@ -0,0 +1,113 @@ + + +{#if !(resourceOnly && (fieldType !== 'object' || !format?.startsWith('resource-')))} +
+
+
+
+ + {customTitle + ? customTitle + : shouldCapitalize + ? capitalize(addWhitespaceBeforeCapitals(key)) + : key} + + {#if loading} + + {/if} + {#if tooltip || markdownTooltip} + + {tooltip} + + {/if} +
+ {#if displayType} +
+ {fieldType === 'array' && subFieldType + ? `${fieldTypeToTsType(subFieldType)}[]` + : fieldTypeToTsType(fieldType)} +
+ {/if} +
+ +
+ {#if componentInput?.type && allowTypeChange !== false} + + + + + {/if} +
+
+ + {#if componentInput?.type === 'static'} +
+ +
+ {:else if componentInput?.type === 'user' || componentInput?.type == undefined} + Field's value is a frontend input + {/if} + {#if componentInput?.type === 'user' && ((fieldType == 'object' && format?.startsWith('resource-') && format !== 'resource-s3_object') || fieldType == 'resource')} +
+ + Apps are executed on behalf of publishers. If you want to accept resources from user, you + need to enable this (potentially dangerous!) +
+ {/if} +
+{/if} diff --git a/frontend/src/lib/components/raw_apps/RawAppPreview.svelte b/frontend/src/lib/components/raw_apps/RawAppPreview.svelte new file mode 100644 index 0000000000..4957a520ba --- /dev/null +++ b/frontend/src/lib/components/raw_apps/RawAppPreview.svelte @@ -0,0 +1,23 @@ + + + + + From 5bca8f60e970cc67839edb5dc491685f36cf0499 Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:46:28 +0200 Subject: [PATCH 40/53] fix: improve MySQL datetime parser timezone handling (WIN-1155) (#5645) * fix mysql datetime parser for non tz dates * static regexes --- backend/windmill-worker/src/mysql_executor.rs | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/backend/windmill-worker/src/mysql_executor.rs b/backend/windmill-worker/src/mysql_executor.rs index a1309395a7..7148e7b961 100644 --- a/backend/windmill-worker/src/mysql_executor.rs +++ b/backend/windmill-worker/src/mysql_executor.rs @@ -6,8 +6,10 @@ use itertools::Itertools; use mysql_async::{ consts::ColumnType, prelude::*, FromValueError, OptsBuilder, Params, Row, SslOpts, }; +use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use serde_json::{json, value::RawValue, Value}; +use std::str::FromStr; use tokio::sync::Mutex; use windmill_common::{ error::{to_anyhow, Error}, @@ -303,26 +305,38 @@ pub async fn do_mysql( return Ok(raw_result); } +// 2023-12-01T16:18:00.000Z +static DATE_REGEX_TZ: Lazy = Lazy::new(|| { + regex::Regex::new(r"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d+)Z").unwrap() +}); +// 2025-04-21 10:08:00 +static DATE_REGEX: Lazy = + Lazy::new(|| regex::Regex::new(r"(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})").unwrap()); + fn string_date_to_mysql_date(s: &str) -> mysql_async::Value { - // 2023-12-01T16:18:00.000Z - let re = regex::Regex::new(r"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d+)Z").unwrap(); - let caps = re.captures(s); + let caps = DATE_REGEX_TZ.captures(s).or_else(|| DATE_REGEX.captures(s)); if let Some(caps) = caps { mysql_async::Value::Date( - caps.get(1).unwrap().as_str().parse().unwrap_or_default(), - caps.get(2).unwrap().as_str().parse().unwrap_or_default(), - caps.get(3).unwrap().as_str().parse().unwrap_or_default(), - caps.get(4).unwrap().as_str().parse().unwrap_or_default(), - caps.get(5).unwrap().as_str().parse().unwrap_or_default(), - caps.get(6).unwrap().as_str().parse().unwrap_or_default(), - caps.get(7).unwrap().as_str().parse().unwrap_or_default(), + get_capture_by_index(&caps, 1), + get_capture_by_index(&caps, 2), + get_capture_by_index(&caps, 3), + get_capture_by_index(&caps, 4), + get_capture_by_index(&caps, 5), + get_capture_by_index(&caps, 6), + get_capture_by_index(&caps, 7), ) } else { mysql_async::Value::Date(0, 0, 0, 0, 0, 0, 0) } } +fn get_capture_by_index(caps: ®ex::Captures, n: usize) -> T { + caps.get(n) + .and_then(|s| s.as_str().parse::().ok()) + .unwrap_or_default() +} + fn convert_row_to_value(row: Row) -> serde_json::Value { let mut map = serde_json::Map::new(); From 2620300ce9f2d432451e06d7461a4c2c7f7764c8 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Mon, 21 Apr 2025 10:26:28 -0400 Subject: [PATCH 41/53] AWS cloudformation quicklaunch (#5650) --- .../deploy/aws-eks-cloudformation/README.md | 46 ++ .../aws-eks-cloudformation/quicklaunch.yaml | 688 ++++++++++++++++++ 2 files changed, 734 insertions(+) create mode 100644 examples/deploy/aws-eks-cloudformation/README.md create mode 100644 examples/deploy/aws-eks-cloudformation/quicklaunch.yaml diff --git a/examples/deploy/aws-eks-cloudformation/README.md b/examples/deploy/aws-eks-cloudformation/README.md new file mode 100644 index 0000000000..16c1a372eb --- /dev/null +++ b/examples/deploy/aws-eks-cloudformation/README.md @@ -0,0 +1,46 @@ +# windmill-cloudformation +Cloudformation Template for Windmill on AWS EKS + +## Overview + +This CloudFormation template automatically deploys Windmill on AWS EKS. The deployment includes: + +- An EKS cluster with configurable node types and sizes +- An RDS PostgreSQL database for Windmill data +- AWS Load Balancer Controller for handling ingress traffic +- Proper network configuration with VPC, subnets, and security groups +- A fully automated installation of Windmill via Helm + +## Parameters + +The template accepts various parameters to customize your deployment: + +- **NodeInstanceType**: EC2 instance type for EKS worker nodes (t3.small to r5.2xlarge) +- **NodeGroupSize**: Number of EKS worker nodes +- **RdsInstanceClass**: RDS instance class for the PostgreSQL database (db.t3.micro to db.r5.2xlarge) +- **DBPassword**: Password for the PostgreSQL database +- **WorkerReplicas**: Number of Windmill worker replicas +- **NativeWorkerReplicas**: Number of Windmill native worker replicas +- **Enterprise**: Enable Windmill [Enterprise features](https://www.windmill.dev/docs/misc/plans_details#upgrading-to-enterprise-edition) (requires license key) + +## Customization + +To modify the Helm chart configuration or update the template, refer to the official Windmill Helm chart repository: +[https://github.com/windmill-labs/windmill-helm-charts](https://github.com/windmill-labs/windmill-helm-charts) + +## Documentation + +For more information about Windmill's Helm chart deployment options, see: +[https://www.windmill.dev/docs/advanced/self_host#helm-chart](https://www.windmill.dev/docs/advanced/self_host#helm-chart) + +For detailed information about setting up RDS for Windmill on AWS: +[https://www.windmill.dev/docs/advanced/self_host/aws_ecs#create-a-rds-database](https://www.windmill.dev/docs/advanced/self_host/aws_ecs#create-a-rds-database) + +## Deployment + +1. Upload the CloudFormation template to your AWS account +2. Fill in the required parameters +3. Deploy the stack +4. Access Windmill using the URL provided in the Outputs section of the stack + +After deployment, you can access Windmill via the LoadBalancer URL shown in the CloudFormation stack outputs. diff --git a/examples/deploy/aws-eks-cloudformation/quicklaunch.yaml b/examples/deploy/aws-eks-cloudformation/quicklaunch.yaml new file mode 100644 index 0000000000..3dda495ebe --- /dev/null +++ b/examples/deploy/aws-eks-cloudformation/quicklaunch.yaml @@ -0,0 +1,688 @@ +AWSTemplateFormatVersion: "2010-09-09" +Description: Deploy Windmill on EKS with Helm + +Parameters: + NodeInstanceType: + Type: String + Default: t3.medium + AllowedValues: + - t3.small + - t3.medium + - t3.large + - t3.xlarge + - t3.2xlarge + - m5.large + - m5.xlarge + - m5.2xlarge + - m5.4xlarge + - c5.large + - c5.xlarge + - c5.2xlarge + - r5.large + - r5.xlarge + - r5.2xlarge + Description: EC2 instance type for the EKS worker nodes + NodeGroupSize: + Type: Number + Default: 2 + RdsInstanceClass: + Type: String + Default: db.t3.small + AllowedValues: + - db.t3.micro + - db.t3.small + - db.t3.medium + - db.t3.large + - db.t3.xlarge + - db.m5.large + - db.m5.xlarge + - db.m5.2xlarge + - db.r5.large + - db.r5.xlarge + - db.r5.2xlarge + Description: RDS instance class for the PostgreSQL database + DBPassword: + Type: String + NoEcho: true + WorkerReplicas: + Type: Number + Default: 2 + NativeWorkerReplicas: + Type: Number + Default: 1 + Enterprise: + Type: String + Default: false + AllowedValues: + - true + - false + Description: Enable Windmill Enterprise features (requires license key) + +Mappings: + RegionMap: + us-east-1: + AMI: ami-0cff7528ff583bf9a + us-east-2: + AMI: ami-0cd3c7f72edd5b06d + us-west-1: + AMI: ami-0d9858aa3c6322f73 + us-west-2: + AMI: ami-098e42ae54c764c35 + ca-central-1: + AMI: ami-00f881f027a6d74a0 + eu-west-1: + AMI: ami-04dd4500af104442f + eu-west-2: + AMI: ami-0eb260c4d5475b901 + eu-west-3: + AMI: ami-05e8e20cef0eaa9d0 + eu-central-1: + AMI: ami-0bad4a5e987bdebde + ap-northeast-1: + AMI: ami-0b7546e839d7ace12 + ap-northeast-2: + AMI: ami-0fd0765afb77bcca7 + ap-southeast-1: + AMI: ami-0c802847a7dd848c0 + ap-southeast-2: + AMI: ami-07620139298af599e + ap-south-1: + AMI: ami-0851b76e8b1bce90b + sa-east-1: + AMI: ami-054a31f1b3bf90920 + +Resources: + VPC: + Type: AWS::EC2::VPC + Properties: + CidrBlock: 10.0.0.0/16 + EnableDnsSupport: true + EnableDnsHostnames: true + Tags: + - Key: Name + Value: !Sub "${AWS::StackName}-vpc" + - Key: !Sub "kubernetes.io/cluster/${AWS::StackName}-cluster" + Value: shared + + InternetGateway: + Type: AWS::EC2::InternetGateway + + AttachGateway: + Type: AWS::EC2::VPCGatewayAttachment + Properties: + VpcId: !Ref VPC + InternetGatewayId: !Ref InternetGateway + + PublicSubnet1: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref VPC + CidrBlock: 10.0.1.0/24 + AvailabilityZone: !Select [0, !GetAZs ""] + MapPublicIpOnLaunch: true + Tags: + - Key: kubernetes.io/role/elb + Value: "1" + - Key: !Sub "kubernetes.io/cluster/${AWS::StackName}-cluster" + Value: shared + - Key: Name + Value: !Sub ${AWS::StackName}-public-subnet-1 + + PublicSubnet2: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref VPC + CidrBlock: 10.0.2.0/24 + AvailabilityZone: !Select [1, !GetAZs ""] + MapPublicIpOnLaunch: true + Tags: + - Key: kubernetes.io/role/elb + Value: "1" + - Key: !Sub "kubernetes.io/cluster/${AWS::StackName}-cluster" + Value: shared + - Key: Name + Value: !Sub ${AWS::StackName}-public-subnet-2 + + RouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref VPC + + PublicRoute: + Type: AWS::EC2::Route + DependsOn: AttachGateway + Properties: + RouteTableId: !Ref RouteTable + DestinationCidrBlock: 0.0.0.0/0 + GatewayId: !Ref InternetGateway + + SubnetRouteTableAssociation1: + Type: AWS::EC2::SubnetRouteTableAssociation + DependsOn: PublicRoute + Properties: + SubnetId: !Ref PublicSubnet1 + RouteTableId: !Ref RouteTable + + SubnetRouteTableAssociation2: + Type: AWS::EC2::SubnetRouteTableAssociation + DependsOn: PublicRoute + Properties: + SubnetId: !Ref PublicSubnet2 + RouteTableId: !Ref RouteTable + + EKSClusterRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Principal: + Service: + - eks.amazonaws.com + - ec2.amazonaws.com + Action: + - sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/AmazonEKSClusterPolicy + - arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy + Policies: + - PolicyName: EKSAccess + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Action: + - eks:* + - ec2:DescribeInstances + - ec2:DescribeRouteTables + - ec2:DescribeSecurityGroups + - ec2:DescribeSubnets + - ec2:DescribeVpcs + - iam:GetRole + - iam:ListRoles + Resource: "*" + - Effect: Allow + Action: + - ssm:GetParameter + - ssm:PutParameter + Resource: !Sub "arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${AWS::StackName}/*" + - PolicyName: KubernetesAccess + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Action: + - eks:DescribeCluster + - eks:ListClusters + - eks:AccessKubernetesApi + Resource: !Sub "arn:aws:eks:${AWS::Region}:${AWS::AccountId}:cluster/${AWS::StackName}-cluster" + + EKSNodeRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Principal: + Service: + - ec2.amazonaws.com + Action: + - sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy + - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly + - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy + + EKSCluster: + Type: AWS::EKS::Cluster + Properties: + Name: !Sub "${AWS::StackName}-cluster" + RoleArn: !GetAtt EKSClusterRole.Arn + ResourcesVpcConfig: + SubnetIds: + - !Ref PublicSubnet1 + - !Ref PublicSubnet2 + EndpointPublicAccess: true + AccessConfig: + AuthenticationMode: API_AND_CONFIG_MAP + BootstrapClusterCreatorAdminPermissions: true + DependsOn: + - PublicRoute + - VPCCleanup + + EKSClusterAccess: + Type: AWS::EKS::AccessEntry + Properties: + ClusterName: !Ref EKSCluster + PrincipalArn: !GetAtt EKSClusterRole.Arn + Type: STANDARD + Username: admin + AccessPolicies: + - PolicyArn: arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy + AccessScope: + Type: cluster + + EKSNodeGroup: + Type: AWS::EKS::Nodegroup + DependsOn: + - WindmillDB + - EKSCluster + Properties: + ClusterName: !Ref EKSCluster + NodeRole: !GetAtt EKSNodeRole.Arn + Subnets: + - !Ref PublicSubnet1 + - !Ref PublicSubnet2 + ScalingConfig: + MinSize: 1 + DesiredSize: !Ref NodeGroupSize + MaxSize: 4 + InstanceTypes: + - !Ref NodeInstanceType + + WindmillDBSubnetGroup: + Type: AWS::RDS::DBSubnetGroup + Properties: + DBSubnetGroupDescription: Subnet group for RDS instance + SubnetIds: + - !Ref PublicSubnet1 + - !Ref PublicSubnet2 + + WindmillDBSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Allow PostgreSQL access from EKS nodes + VpcId: !Ref VPC + SecurityGroupIngress: + - IpProtocol: tcp + FromPort: 5432 + ToPort: 5432 + CidrIp: 10.0.0.0/16 + + WindmillDB: + Type: AWS::RDS::DBInstance + Properties: + DBInstanceIdentifier: !Sub "${AWS::StackName}-db" + AllocatedStorage: 20 + DBInstanceClass: !Ref RdsInstanceClass + Engine: postgres + EngineVersion: 17.2 + MasterUsername: postgres + MasterUserPassword: !Ref DBPassword + DBName: windmill + PubliclyAccessible: false + DBSubnetGroupName: !Ref WindmillDBSubnetGroup + VPCSecurityGroups: + - !Ref WindmillDBSecurityGroup + DependsOn: + - WindmillDBSubnetGroup + + WindmillInstallerInstanceProfile: + Type: AWS::IAM::InstanceProfile + Properties: + Roles: + - !Ref EKSClusterRole + + WindmillInstallerSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupDescription: Security group for Windmill installer instance + VpcId: !Ref VPC + SecurityGroupEgress: + - IpProtocol: -1 + FromPort: -1 + ToPort: -1 + CidrIp: 0.0.0.0/0 + + WindmillInstaller: + Type: AWS::EC2::Instance + CreationPolicy: + ResourceSignal: + Timeout: PT30M # Gives 30 minutes for the installation to complete + DependsOn: + - EKSNodeGroup + - WindmillDB + Properties: + ImageId: !FindInMap [RegionMap, !Ref "AWS::Region", AMI] + InstanceType: t3.micro + IamInstanceProfile: !Ref WindmillInstallerInstanceProfile + SubnetId: !Ref PublicSubnet1 + SecurityGroupIds: + - !Ref WindmillInstallerSecurityGroup + UserData: + Fn::Base64: !Sub | + #!/bin/bash + set -e # Exit on any error + + # Install required tools + yum update -y + yum install -y aws-cli jq postgresql15 aws-cfn-bootstrap + + # Set up logging directory with correct permissions + mkdir -p /var/log/windmill-installer + touch /var/log/windmill-installer/install.log + + # Create installation directory + mkdir -p /opt/windmill-installer + + # Install kubectl + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl + mv kubectl /usr/local/bin/ + + # Install helm + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 + chmod +x get_helm.sh + ./get_helm.sh + + # Create the installation script + cat << 'EOF' > /opt/windmill-installer/install.sh + #!/bin/bash + set -e + + # Configure kubectl + aws sts get-caller-identity > /dev/null + export AWS_SDK_LOAD_CONFIG=1 + export KUBECONFIG=/root/.kube/config + aws eks update-kubeconfig --name ${AWS::StackName}-cluster --region ${AWS::Region} + + # Add debugging for each kubectl attempt + echo "HOME: $HOME" + echo "KUBECONFIG: $KUBECONFIG" + echo "User: $(whoami)" + echo "AWS Identity: $(aws sts get-caller-identity)" + echo "Trying kubectl command..." + kubectl get nodes || echo "Command failed with status $?" + + echo "Waiting for EKS nodes to be ready..." + while true; do + # Force credential refresh on each attempt + aws sts get-caller-identity > /dev/null + aws eks update-kubeconfig --name ${AWS::StackName}-cluster --region ${AWS::Region} + + if kubectl get nodes &>/dev/null; then + READY_NODES=$(kubectl get nodes -o json | jq -r '.items[] | select(.status.conditions[] | select(.type=="Ready" and .status=="True")) | .metadata.name' | wc -l) + DESIRED_NODES=${NodeGroupSize} + if [ "$READY_NODES" -eq "$DESIRED_NODES" ]; then + echo "All nodes are ready" + break + fi + echo "Found $READY_NODES ready nodes out of $DESIRED_NODES desired nodes" + else + echo "Waiting for cluster access..." + fi + sleep 30 + done + + echo "Installing AWS Load Balancer Controller..." + # Install AWS Load Balancer Controller + helm repo add eks https://aws.github.io/eks-charts + helm repo update + + helm install aws-load-balancer-controller eks/aws-load-balancer-controller \ + -n kube-system \ + --set clusterName=${AWS::StackName}-cluster \ + --set region=${AWS::Region} \ + --set vpcId=${VPC} + + echo "Waiting for AWS Load Balancer Controller to be ready..." + kubectl wait --namespace kube-system \ + --for=condition=ready pod \ + --selector=app.kubernetes.io/name=aws-load-balancer-controller \ + --timeout=300s + + echo "Waiting for RDS to be available..." + while true; do + if pg_isready -h ${WindmillDB.Endpoint.Address} -p 5432 -U postgres 2>/dev/null; then + echo "Database is ready" + break + fi + echo "Database not ready yet..." + sleep 30 + done + + echo "Creating namespace and installing Windmill..." + kubectl create namespace windmill + + # Add helm repo and install Windmill + helm repo add windmill https://windmill-labs.github.io/windmill-helm-charts + helm repo update + + helm install ${AWS::StackName} windmill/windmill \ + --namespace windmill \ + --set windmill.databaseUrl="postgres://postgres:${DBPassword}@${WindmillDB.Endpoint.Address}/windmill?sslmode=require" \ + --set windmill.baseDomain=windmill.local \ + --set windmill.baseProtocol=http \ + --set windmill.appReplicas=${WorkerReplicas} \ + --set windmill.lspReplicas=2 \ + --set windmill.workerGroups[0].name=default \ + --set windmill.workerGroups[0].mode=worker \ + --set windmill.workerGroups[0].replicas=${WorkerReplicas} \ + --set windmill.workerGroups[1].name=native \ + --set windmill.workerGroups[1].mode=worker \ + --set windmill.workerGroups[1].replicas=${NativeWorkerReplicas} \ + --set windmill.app.service.spec.type=LoadBalancer \ + --set windmill.app.service.spec.sessionAffinity=None \ + --set windmill.app.service.port=8000 \ + --set windmill.app.service.ports[0].port=8000 \ + --set windmill.app.service.ports[0].targetPort=8000 \ + --set windmill.app.service.ports[0].protocol=TCP \ + --set postgresql.enabled=false \ + --set enterprise.enabled=${Enterprise} + + # Change service to LoadBalancer + echo "Changing service to LoadBalancer" + kubectl patch service windmill-app -n windmill -p '{"spec":{"type":"LoadBalancer","sessionAffinity":"None"}}' + kubectl patch service windmill-app -n windmill -p '{"spec":{"ports":[{"name":"api","port":8000,"targetPort":8000,"protocol":"TCP"},{"name":"http","port":80,"targetPort":8000,"protocol":"TCP"}]}}' + + # Wait for LoadBalancer to get an address + echo "Waiting for LoadBalancer address..." + while true; do + LB_HOSTNAME=$(kubectl get svc -n windmill windmill-app -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' 2>/dev/null) + if [ ! -z "$LB_HOSTNAME" ]; then + break + fi + echo "Waiting for LoadBalancer hostname..." + sleep 30 + done + + # Store the LoadBalancer hostname in SSM + aws ssm put-parameter \ + --region ${AWS::Region} \ + --name "/${AWS::StackName}/loadbalancer-hostname" \ + --value "$LB_HOSTNAME" \ + --type "String" \ + --overwrite + + # Signal CloudFormation that installation is complete + echo "Signal CloudFormation that installation is complete" + /opt/aws/bin/cfn-signal -e $? \ + --stack ${AWS::StackName} \ + --resource WindmillInstaller \ + --region ${AWS::Region} + + # Self-terminate this instance + echo "Self-terminating instance" + aws ec2 terminate-instances --instance-ids $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --region ${AWS::Region} + EOF + + # Set permissions and run the installation script + chmod +x /opt/windmill-installer/install.sh + + # Run the installation script directly (not as ec2-user) + cd /opt/windmill-installer && ./install.sh > /var/log/windmill-installer/install.log 2>&1 + + LoadBalancerHostnameLookup: + Type: Custom::SSMParameterLookup + DependsOn: WindmillInstaller + Properties: + ServiceToken: !GetAtt LookupSSMParameterFunction.Arn + ParameterName: !Sub "/${AWS::StackName}/loadbalancer-hostname" + + LookupSSMParameterFunction: + Type: AWS::Lambda::Function + Properties: + Handler: index.handler + Role: !GetAtt LambdaExecutionRole.Arn + Timeout: 300 + Runtime: nodejs18.x + Code: + ZipFile: !Sub | + const { SSMClient, GetParameterCommand } = require('@aws-sdk/client-ssm'); + const response = require('cfn-response'); + + exports.handler = async (event, context) => { + if (event.RequestType === 'Delete') { + return response.send(event, context, response.SUCCESS); + } + + try { + const ssmClient = new SSMClient(); + + // Loop to check for the parameter until it's not "pending" + let tries = 0; + let paramValue = "pending"; + + while (paramValue === "pending" && tries < 20) { + const params = { + Name: event.ResourceProperties.ParameterName, + WithDecryption: false + }; + + const result = await ssmClient.send(new GetParameterCommand(params)); + paramValue = result.Parameter.Value; + + if (paramValue === "pending") { + await new Promise(resolve => setTimeout(resolve, 15000)); // wait 15 seconds + tries++; + } + } + + return response.send(event, context, response.SUCCESS, { + HostnameValue: paramValue + }); + } catch (error) { + console.error(error); + return response.send(event, context, response.FAILED, { error: error.message }); + } + }; + + LambdaExecutionRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Principal: + Service: lambda.amazonaws.com + Action: sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + Policies: + - PolicyName: SSMParameterAccess + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Action: + - ssm:GetParameter + Resource: !Sub "arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${AWS::StackName}/*" + + VPCCleanupFunction: + Type: AWS::Lambda::Function + Properties: + Handler: index.handler + Role: !GetAtt VPCCleanupRole.Arn + Timeout: 300 + Runtime: nodejs18.x + Code: + ZipFile: | + const { ElasticLoadBalancingClient, DescribeLoadBalancersCommand, + DeleteLoadBalancerCommand } = require('@aws-sdk/client-elastic-load-balancing'); + const response = require('cfn-response'); + + exports.handler = async (event, context) => { + if (event.RequestType !== 'Delete') { + return response.send(event, context, response.SUCCESS); + } + + try { + const elb = new ElasticLoadBalancingClient(); + const vpcId = event.ResourceProperties.VpcId; + + // Find and delete Classic Load Balancers in the VPC + const lbResponse = await elb.send(new DescribeLoadBalancersCommand({})); + let deleted = false; + + for (const lb of lbResponse.LoadBalancerDescriptions || []) { + if (lb.VPCId === vpcId) { + console.log(`Deleting Classic Load Balancer: ${lb.LoadBalancerName}`); + await elb.send(new DeleteLoadBalancerCommand({ + LoadBalancerName: lb.LoadBalancerName + })); + deleted = true; + } + } + + if (deleted) { + // Wait for deletion to complete + console.log('Waiting 30 seconds for load balancer deletion to complete...'); + await new Promise(r => setTimeout(r, 30000)); + } + + return response.send(event, context, response.SUCCESS); + } catch (error) { + console.error('Error deleting load balancers:', error); + return response.send(event, context, response.FAILED, {error: error.message}); + } + }; + + VPCCleanupRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Principal: + Service: lambda.amazonaws.com + Action: sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + Policies: + - PolicyName: VPCCleanupPolicy + PolicyDocument: + Version: "2012-10-17" + Statement: + - Effect: Allow + Action: + - ec2:DescribeAddresses + - ec2:DisassociateAddress + - ec2:DescribeNetworkInterfaces + - elasticloadbalancing:DescribeLoadBalancers + - elasticloadbalancing:DeleteLoadBalancer + - elasticloadbalancingv2:DescribeLoadBalancers + - elasticloadbalancingv2:DeleteLoadBalancer + Resource: "*" + + VPCCleanup: + Type: Custom::VPCCleanup + Properties: + ServiceToken: !GetAtt VPCCleanupFunction.Arn + VpcId: !Ref VPC + +Outputs: + ClusterName: + Description: EKS cluster name + Value: !Sub "${AWS::StackName}-cluster" + + DatabaseEndpoint: + Description: RDS instance endpoint + Value: !GetAtt WindmillDB.Endpoint.Address + + LoadBalancerHostname: + Description: Windmill LoadBalancer hostname + Value: !Sub "http://${LoadBalancerHostnameLookup.HostnameValue}" From 42514f2b1d014996b1fb9131881716e19d9f9331 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 21 Apr 2025 16:45:13 +0200 Subject: [PATCH 42/53] add event handlers to more components --- .../components/inputs/AppDateInput.svelte | 10 ++- .../components/inputs/AppDateTimeInput.svelte | 11 +++- .../components/inputs/AppNumberInput.svelte | 11 +++- .../components/inputs/AppTextInput.svelte | 18 +++++- .../components/inputs/AppTimeInput.svelte | 10 ++- .../editor/component/ComponentInner.svelte | 8 +++ .../apps/editor/component/components.ts | 64 ++++++++++++++----- .../editor/settingsPanel/EventHandlers.svelte | 22 ++++++- 8 files changed, 127 insertions(+), 27 deletions(-) diff --git a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte index a17cb29ce2..4544432ae2 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte @@ -17,8 +17,9 @@ export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined export let customCss: ComponentCustomCSS<'dateinputcomponent'> | undefined = undefined export let render: boolean + export let onChange: string[] | undefined = undefined - const { app, worldStore, selectedComponent, componentControl } = + const { app, worldStore, selectedComponent, componentControl, runnableComponents } = getContext('AppViewerContext') let resolvedConfig = initConfig( @@ -64,6 +65,13 @@ } else { outputs?.result.set(undefined) } + fireOnChange() + } + + function fireOnChange() { + if (onChange) { + onChange.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb())) + } } function handleDefault(defaultValue: string | undefined) { diff --git a/frontend/src/lib/components/apps/components/inputs/AppDateTimeInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppDateTimeInput.svelte index 276d542b79..5c8f3f77b3 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppDateTimeInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppDateTimeInput.svelte @@ -25,8 +25,8 @@ export let verticalAlignment: VerticalAlignment | undefined = undefined export let customCss: ComponentCustomCSS<'datetimeinputcomponent'> | undefined = undefined export let render: boolean - - const { app, worldStore, componentControl, selectedComponent } = + export let onChange: string[] | undefined = undefined + const { app, worldStore, componentControl, selectedComponent, runnableComponents } = getContext('AppViewerContext') const iterContext = getContext('ListWrapperContext') @@ -119,6 +119,13 @@ listInputs.set(id, undefined) } } + fireOnChange() + } + + function fireOnChange() { + if (onChange) { + onChange.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb())) + } } function handleDefault(defaultValue: string | undefined) { diff --git a/frontend/src/lib/components/apps/components/inputs/AppNumberInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppNumberInput.svelte index 567094e224..0022fa0885 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppNumberInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppNumberInput.svelte @@ -21,8 +21,8 @@ export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined export let customCss: ComponentCustomCSS<'numberinputcomponent'> | undefined = undefined export let render: boolean - - const { app, worldStore, selectedComponent, componentControl } = + export let onChange: string[] | undefined = undefined + const { app, worldStore, selectedComponent, componentControl, runnableComponents } = getContext('AppViewerContext') const iterContext = getContext('ListWrapperContext') const listInputs: ListInputs | undefined = getContext('ListInputs') @@ -61,6 +61,13 @@ if (iterContext && listInputs) { listInputs.set(id, value ?? undefined) } + fireOnChange() + } + + function fireOnChange() { + if (onChange) { + onChange.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb())) + } } function handleDefault(defaultValue: number | undefined) { diff --git a/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte index 731ce20d07..9eba5c8323 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppTextInput.svelte @@ -28,9 +28,16 @@ | 'emailinputcomponent' | 'textareainputcomponent' = 'textinputcomponent' export let render: boolean + export let onChange: string[] | undefined = undefined - const { app, worldStore, selectedComponent, connectingInput, componentControl } = - getContext('AppViewerContext') + const { + app, + worldStore, + selectedComponent, + connectingInput, + componentControl, + runnableComponents + } = getContext('AppViewerContext') let resolvedConfig = initConfig( components['textinputcomponent'].initialData.configuration, @@ -70,6 +77,13 @@ if (iterContext && listInputs) { listInputs.set(id, val) } + fireOnChange() + } + + function fireOnChange() { + if (onChange) { + onChange.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb())) + } } function handleDefault(defaultValue: string | undefined) { diff --git a/frontend/src/lib/components/apps/components/inputs/AppTimeInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppTimeInput.svelte index 60a888113f..cfee4a193c 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppTimeInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppTimeInput.svelte @@ -15,8 +15,9 @@ export let verticalAlignment: 'top' | 'center' | 'bottom' | undefined = undefined export let customCss: ComponentCustomCSS<'timeinputcomponent'> | undefined = undefined export let render: boolean + export let onChange: string[] | undefined = undefined - const { app, worldStore, selectedComponent, componentControl } = + const { app, worldStore, selectedComponent, componentControl, runnableComponents } = getContext('AppViewerContext') let resolvedConfig = initConfig( @@ -78,6 +79,13 @@ // At the end, set the validity outputs?.validity.set(isValid) } + fireOnChange() + } + + function fireOnChange() { + if (onChange) { + onChange.forEach((id) => $runnableComponents?.[id]?.cb?.forEach((cb) => cb())) + } } function handleDefault(defaultValue: string | undefined) { diff --git a/frontend/src/lib/components/apps/editor/component/ComponentInner.svelte b/frontend/src/lib/components/apps/editor/component/ComponentInner.svelte index acbe2d5b83..c69cd9f178 100644 --- a/frontend/src/lib/components/apps/editor/component/ComponentInner.svelte +++ b/frontend/src/lib/components/apps/editor/component/ComponentInner.svelte @@ -393,6 +393,7 @@ verticalAlignment={component.verticalAlignment} configuration={component.configuration} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'quillcomponent'} @@ -405,6 +406,7 @@ customCss={component.customCss} inputType="textarea" appCssKey="textareainputcomponent" + onChange={component.onChange} {render} /> {:else if component.type === 'emailinputcomponent'} @@ -415,6 +417,7 @@ appCssKey="emailinputcomponent" id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'passwordinputcomponent'} @@ -425,6 +428,7 @@ appCssKey="passwordinputcomponent" id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'dateinputcomponent'} @@ -434,6 +438,7 @@ inputType="date" id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'timeinputcomponent'} @@ -442,6 +447,7 @@ configuration={component.configuration} id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'datetimeinputcomponent'} @@ -451,6 +457,7 @@ inputType="date" id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'numberinputcomponent'} @@ -459,6 +466,7 @@ configuration={component.configuration} id={component.id} customCss={component.customCss} + onChange={component.onChange} {render} /> {:else if component.type === 'currencycomponent'} diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index a0b99e4805..bc66fdab8f 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -91,21 +91,51 @@ export type CustomComponentConfig = { reactVersion?: string } } -export type TextComponent = BaseComponent<'textcomponent'> -export type TextInputComponent = BaseComponent<'textinputcomponent'> -export type QuillComponent = BaseComponent<'quillcomponent'> -export type CodeInputComponent = BaseComponent<'codeinputcomponent'> -export type TextareaInputComponent = BaseComponent<'textareainputcomponent'> -export type PasswordInputComponent = BaseComponent<'passwordinputcomponent'> -export type EmailInputComponent = BaseComponent<'emailinputcomponent'> -export type DateInputComponent = BaseComponent<'dateinputcomponent'> -export type TimeInputComponent = BaseComponent<'timeinputcomponent'> -export type DateTimeInputComponent = BaseComponent<'datetimeinputcomponent'> -export type NumberInputComponent = BaseComponent<'numberinputcomponent'> -export type CurrencyComponent = BaseComponent<'currencycomponent'> -export type SliderComponent = BaseComponent<'slidercomponent'> -export type DateSliderComponent = BaseComponent<'dateslidercomponent'> -export type RangeComponent = BaseComponent<'rangecomponent'> +export type TextComponent = BaseComponent<'textcomponent'> & { + onChange?: string[] +} +export type TextInputComponent = BaseComponent<'textinputcomponent'> & { + onChange?: string[] +} +export type QuillComponent = BaseComponent<'quillcomponent'> & { + onChange?: string[] +} +export type CodeInputComponent = BaseComponent<'codeinputcomponent'> & { + onChange?: string[] +} +export type TextareaInputComponent = BaseComponent<'textareainputcomponent'> & { + onChange?: string[] +} +export type PasswordInputComponent = BaseComponent<'passwordinputcomponent'> & { + onChange?: string[] +} +export type EmailInputComponent = BaseComponent<'emailinputcomponent'> & { + onChange?: string[] +} +export type DateInputComponent = BaseComponent<'dateinputcomponent'> & { + onChange?: string[] +} +export type TimeInputComponent = BaseComponent<'timeinputcomponent'> & { + onChange?: string[] +} +export type DateTimeInputComponent = BaseComponent<'datetimeinputcomponent'> & { + onChange?: string[] +} +export type NumberInputComponent = BaseComponent<'numberinputcomponent'> & { + onChange?: string[] +} +export type CurrencyComponent = BaseComponent<'currencycomponent'> & { + onChange?: string[] +} +export type SliderComponent = BaseComponent<'slidercomponent'> & { + onChange?: string[] +} +export type DateSliderComponent = BaseComponent<'dateslidercomponent'> & { + onChange?: string[] +} +export type RangeComponent = BaseComponent<'rangecomponent'> & { + onChange?: string[] +} export type HtmlComponent = BaseComponent<'htmlcomponent'> export type CustomComponent = BaseComponent<'customcomponent'> & { customComponent: CustomComponentConfig @@ -293,7 +323,9 @@ export type NavBarComponent = BaseComponent<'navbarcomponent'> & { navbarItems: NavbarItem[] } -export type DateSelectComponent = BaseComponent<'dateselectcomponent'> +export type DateSelectComponent = BaseComponent<'dateselectcomponent'> & { + onChange?: string[] +} export type RecomputeAllComponent = BaseComponent<'recomputeallcomponent'> diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte index a048a4fb20..8a0e4acafc 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte @@ -23,7 +23,15 @@ 'conditionalwrapper', 'fileinputcomponent', 's3fileinputcomponent', - 'steppercomponent' + 'steppercomponent', + 'dateinputcomponent', + 'datetimeinputcomponent', + 'timeinputcomponent', + 'numberinputcomponent', + 'textinputcomponent', + 'textareainputcomponent', + 'passwordinputcomponent', + 'emailinputcomponent' ] @@ -49,7 +57,7 @@ bind:value={item.data.onCloseRecomputeIds} /> {/if} - {#if (`recomputeIds` in item.data && Array.isArray(item.data.recomputeIds)) || item.data.type === 'buttoncomponent' || item.data.type === 'formcomponent' || item.data.type === 'formbuttoncomponent' || item.data.type === 'checkboxcomponent'} + {#if (`recomputeIds` in item.data && Array.isArray(item.data.recomputeIds)) || item.data.type === 'buttoncomponent' || item.data.type === 'formbuttoncomponent'} id !== ownId)} bind:value={item.data.onToggle} /> {/if} + {#if item.data.type === 'dateinputcomponent' || item.data.type === 'datetimeinputcomponent' || item.data.type === 'timeinputcomponent' || item.data.type === 'numberinputcomponent' || item.data.type === 'textinputcomponent' || item.data.type === 'textareainputcomponent' || item.data.type === 'passwordinputcomponent' || item.data.type === 'emailinputcomponent'} + id !== ownId)} + bind:value={item.data.onChange} + /> + {/if} {#if item.data.type === 'resourceselectcomponent' || item.data.type === 'selectcomponent' || item.data.type == 'userresourcecomponent'} Date: Mon, 21 Apr 2025 16:46:37 +0200 Subject: [PATCH 43/53] add disabled to date component --- .../components/apps/components/inputs/AppDateInput.svelte | 1 + .../src/lib/components/apps/editor/component/components.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte index 4544432ae2..697c0d040e 100644 --- a/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte +++ b/frontend/src/lib/components/apps/components/inputs/AppDateInput.svelte @@ -108,6 +108,7 @@ on:pointerdown|stopPropagation type="date" bind:value + disabled={resolvedConfig.disabled} min={resolvedConfig.minDate} max={resolvedConfig.maxDate} placeholder="Type..." diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index bc66fdab8f..2ff364f44a 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -2801,6 +2801,11 @@ See date-fns format for more information. By default, it is 'yyyy-MM-dd' documentationLink: 'https://date-fns.org/v2.30.0/docs/format', placeholder: 'yyyy-MM-dd' + }, + disabled: { + type: 'static', + value: false, + fieldType: 'boolean' } } } From 855a079744e7aca4f8c8859331a2a3cd8dfe2bb1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 21 Apr 2025 16:53:23 +0200 Subject: [PATCH 44/53] fix .env --- .env | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.env b/.env index f09d57bc24..ad887513cd 100644 --- a/.env +++ b/.env @@ -1,5 +1,13 @@ -DATABASE_URL=postgres://postgres:changeme@localhost:5432/windmill?sslmode=disable -DENO_PATH=/opt/homebrew/bin/deno -BUN_PATH=/opt/homebrew/bin/bun +DATABASE_URL=postgres://postgres:changeme@db/windmill?sslmode=disable -WM_IMAGE=ghcr.io/windmill-labs/windmill:main \ No newline at end of file +# For Enterprise Edition, use: +# WM_IMAGE=ghcr.io/windmill-labs/windmill-ee:main +WM_IMAGE=ghcr.io/windmill-labs/windmill:main + + +# To use another port than :80, setup the Caddyfile and the caddy section of the docker-compose to your needs: https://caddyserver.com/docs/getting-started +# To have caddy take care of automatic TLS + +# To rotate logs, set the following variables: +#LOG_MAX_SIZE=10m +#LOG_MAX_FILE=3 \ No newline at end of file From 128f6c1383bef72dd95d96b463f9cf6526c3dff8 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 21 Apr 2025 17:41:24 +0200 Subject: [PATCH 45/53] fix e2e test --- .github/change-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/change-versions.sh b/.github/change-versions.sh index 699b87b0d7..454f373038 100755 --- a/.github/change-versions.sh +++ b/.github/change-versions.sh @@ -24,4 +24,4 @@ sed -i -e "/^wmill_pg =/s/= .*/= \">=$VERSION\"/" ${root_dirpath}/lsp/Pipfile sed -i -zE "s/name = \"windmill\"\nversion = \"[^\"]*\"\\n(.*)/name = \"windmill\"\nversion = \"$VERSION\"\\n\\1/" ${root_dirpath}/backend/Cargo.lock -cd ${root_dirpath}/frontend && npm i --package-lock-only +cd ${root_dirpath}/frontend && npm i --package-lock-only --ignore-scripts From 444a6abad670114c52e44f3606bf6fefc5d3fd98 Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Tue, 22 Apr 2025 11:37:18 +0200 Subject: [PATCH 46/53] fix: batch reruns query missing workspace_id check in subquery (#5652) --- ...94e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4.json | 23 +++++++++++++++++++ backend/windmill-api/src/jobs.rs | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 backend/.sqlx/query-26761fbd7953416eb391de47b1694e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4.json diff --git a/backend/.sqlx/query-26761fbd7953416eb391de47b1694e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4.json b/backend/.sqlx/query-26761fbd7953416eb391de47b1694e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4.json new file mode 100644 index 0000000000..b14dab2503 --- /dev/null +++ b/backend/.sqlx/query-26761fbd7953416eb391de47b1694e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT jsonb_build_object(\n 'kind', jb.kind,\n 'script_path', jb.runnable_path,\n 'latest_schema', COALESCE(\n (SELECT DISTINCT ON (s.path) s.schema FROM script s WHERE s.workspace_id = $1 AND s.path = jb.runnable_path AND jb.kind = 'script' ORDER BY s.path, s.created_at DESC),\n (SELECT flow_version.schema FROM flow LEFT JOIN flow_version ON flow_version.id = flow.versions[array_upper(flow.versions, 1)] WHERE flow.workspace_id = $1 AND flow.path = jb.runnable_path AND jb.kind = 'flow')\n ),\n 'schemas', ARRAY(\n SELECT jsonb_build_object(\n 'script_hash', LPAD(TO_HEX(COALESCE(s.hash, f.id)), 16, '0'),\n 'job_ids', ARRAY_AGG(DISTINCT j.id),\n 'schema', (ARRAY_AGG(COALESCE(s.schema, f.schema)))[1]\n ) FROM v2_job j\n LEFT JOIN script s ON s.hash = j.runnable_id AND j.kind = 'script'\n LEFT JOIN flow_version f ON f.id = j.runnable_id AND j.kind = 'flow'\n WHERE j.id = ANY(ARRAY_AGG(jb.id))\n GROUP BY COALESCE(s.hash, f.id)\n )\n ) FROM v2_job jb\n WHERE (jb.kind = 'flow' OR jb.kind = 'script')\n AND jb.workspace_id = $1 AND jb.id = ANY($2)\n GROUP BY jb.kind, jb.runnable_path", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "jsonb_build_object", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Text", + "UuidArray" + ] + }, + "nullable": [ + null + ] + }, + "hash": "26761fbd7953416eb391de47b1694e0f4ab2bb96a6d838f1b1fdce4b58a8f5d4" +} diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index 0948e44497..5317b78fbc 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -674,8 +674,8 @@ async fn list_selected_job_groups( 'kind', jb.kind, 'script_path', jb.runnable_path, 'latest_schema', COALESCE( - (SELECT DISTINCT ON (s.path) s.schema FROM script s WHERE s.path = jb.runnable_path AND jb.kind = 'script' ORDER BY s.path, s.created_at DESC), - (SELECT flow_version.schema FROM flow LEFT JOIN flow_version ON flow_version.id = flow.versions[array_upper(flow.versions, 1)] WHERE flow.path = jb.runnable_path AND jb.kind = 'flow') + (SELECT DISTINCT ON (s.path) s.schema FROM script s WHERE s.workspace_id = $1 AND s.path = jb.runnable_path AND jb.kind = 'script' ORDER BY s.path, s.created_at DESC), + (SELECT flow_version.schema FROM flow LEFT JOIN flow_version ON flow_version.id = flow.versions[array_upper(flow.versions, 1)] WHERE flow.workspace_id = $1 AND flow.path = jb.runnable_path AND jb.kind = 'flow') ), 'schemas', ARRAY( SELECT jsonb_build_object( From e316dbd9bdd5c59e9aaba6a4472bb7d832834e84 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 23 Apr 2025 08:40:22 +0200 Subject: [PATCH 47/53] fix: track relative imports in python and ts even if lockfile is provided --- backend/windmill-api/src/scripts.rs | 20 ++++ backend/windmill-worker/src/lib.rs | 2 + .../windmill-worker/src/worker_lockfiles.rs | 105 +++++++++++------- 3 files changed, 89 insertions(+), 38 deletions(-) diff --git a/backend/windmill-api/src/scripts.rs b/backend/windmill-api/src/scripts.rs index 8e707a15d2..2c372a0d95 100644 --- a/backend/windmill-api/src/scripts.rs +++ b/backend/windmill-api/src/scripts.rs @@ -40,6 +40,7 @@ use std::{ }; use windmill_audit::audit_ee::audit_log; use windmill_audit::ActionKind; +use windmill_worker::process_relative_imports; use windmill_common::error::to_anyhow; @@ -894,6 +895,25 @@ async fn create_script_internal<'c>( .await?; Ok((hash, new_tx)) } else { + if let Err(e) = process_relative_imports( + &db, + None, + None, + &w_id, + &ns.path, + p_path_opt.clone(), + ns.deployment_message.clone(), + &ns.content, + &Some(ns.language.clone()), + &authed.email, + &authed.username, + &permissioned_as, + ) + .await + { + tracing::error!(%e, "error processing relative imports"); + } + handle_deployment_metadata( &authed.email, &authed.username, diff --git a/backend/windmill-worker/src/lib.rs b/backend/windmill-worker/src/lib.rs index 2b0a5d6f4a..64a9cf2c88 100644 --- a/backend/windmill-worker/src/lib.rs +++ b/backend/windmill-worker/src/lib.rs @@ -49,6 +49,8 @@ mod worker_flow; mod worker_lockfiles; mod worker_utils; +pub use worker_lockfiles::process_relative_imports; + pub use worker::*; pub use result_processor::handle_job_error; diff --git a/backend/windmill-worker/src/worker_lockfiles.rs b/backend/windmill-worker/src/worker_lockfiles.rs index cab717a94f..93cc355eb0 100644 --- a/backend/windmill-worker/src/worker_lockfiles.rs +++ b/backend/windmill-worker/src/worker_lockfiles.rs @@ -364,44 +364,21 @@ pub async fn handle_dependency_job( tracing::error!(%e, "error handling deployment metadata"); } - let relative_imports = - extract_relative_imports(&script_data.code, script_path, &job.script_lang); - if let Some(relative_imports) = relative_imports { - update_script_dependency_map( - &job.id, - db, - w_id, - &parent_path, - script_path, - relative_imports, - ) - .await?; - let already_visited = job - .args - .as_ref() - .map(|x| { - x.get("already_visited") - .map(|v| serde_json::from_str::>(v.get()).ok()) - .flatten() - }) - .flatten() - .unwrap_or_default(); - if let Err(e) = trigger_dependents_to_recompute_dependencies( - w_id, - script_path, - deployment_message, - parent_path, - &job.permissioned_as_email, - &job.created_by, - &job.permissioned_as, - db, - already_visited, - ) - .await - { - tracing::error!(%e, "error triggering dependents to recompute dependencies"); - } - } + process_relative_imports( + db, + Some(job.id), + job.args.as_ref(), + &job.workspace_id, + script_path, + parent_path, + deployment_message, + &script_data.code, + &job.script_lang, + &job.permissioned_as_email, + &job.created_by, + &job.permissioned_as, + ) + .await?; Ok(to_raw_value_owned( json!({ "status": "Successful lock file generation", "lock": content }), @@ -439,6 +416,58 @@ fn remove_ansi_codes(s: &str) -> String { ANSI_REGEX.replace_all(s, "").to_string() } +pub async fn process_relative_imports( + db: &sqlx::Pool, + job_id: Option, + args: Option<&Json>>>, + w_id: &str, + script_path: &str, + parent_path: Option, + deployment_message: Option, + code: &str, + script_lang: &Option, + permissioned_as_email: &str, + created_by: &str, + permissioned_as: &str, +) -> error::Result<()> { + let relative_imports = extract_relative_imports(&code, script_path, script_lang); + if let Some(relative_imports) = relative_imports { + update_script_dependency_map( + &job_id.unwrap_or_else(|| Uuid::nil()), + db, + w_id, + &parent_path, + script_path, + relative_imports, + ) + .await?; + let already_visited = args + .map(|x| { + x.get("already_visited") + .map(|v| serde_json::from_str::>(v.get()).ok()) + .flatten() + }) + .flatten() + .unwrap_or_default(); + if let Err(e) = trigger_dependents_to_recompute_dependencies( + w_id, + script_path, + deployment_message, + parent_path, + permissioned_as_email, + created_by, + permissioned_as, + db, + already_visited, + ) + .await + { + tracing::error!(%e, "error triggering dependents to recompute dependencies"); + } + } + Ok(()) +} + async fn trigger_dependents_to_recompute_dependencies( w_id: &str, script_path: &str, From 0a866da274396327eae9a0c1190a4ae99483cf37 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 23 Apr 2025 09:28:31 +0200 Subject: [PATCH 48/53] delay triggering dependent script when lockfile is present to account for CLI push --- backend/windmill-api/src/scripts.rs | 49 ++++++++++++++++++----------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/backend/windmill-api/src/scripts.rs b/backend/windmill-api/src/scripts.rs index 2c372a0d95..a1ca9c3322 100644 --- a/backend/windmill-api/src/scripts.rs +++ b/backend/windmill-api/src/scripts.rs @@ -895,24 +895,37 @@ async fn create_script_internal<'c>( .await?; Ok((hash, new_tx)) } else { - if let Err(e) = process_relative_imports( - &db, - None, - None, - &w_id, - &ns.path, - p_path_opt.clone(), - ns.deployment_message.clone(), - &ns.content, - &Some(ns.language.clone()), - &authed.email, - &authed.username, - &permissioned_as, - ) - .await - { - tracing::error!(%e, "error processing relative imports"); - } + let db2 = db.clone(); + let w_id2 = w_id.clone(); + let authed2 = authed.clone(); + let permissioned_as2 = permissioned_as.clone(); + let script_path2 = script_path.clone(); + let parent_path = p_path_opt.clone(); + let deployment_message = ns.deployment_message.clone(); + let content = ns.content.clone(); + let language = ns.language.clone(); + tokio::spawn(async move { + // wait for 10 seconds to make sure the script is deployed and that the CLI sync that pushed it (f one) is complete + tokio::time::sleep(std::time::Duration::from_secs(10)).await; + if let Err(e) = process_relative_imports( + &db2, + None, + None, + &w_id2, + &script_path2, + parent_path, + deployment_message, + &content, + &Some(language), + &authed2.email, + &authed2.username, + &permissioned_as2, + ) + .await + { + tracing::error!(%e, "error processing relative imports"); + } + }); handle_deployment_metadata( &authed.email, From 494d662b2d398ee6ad20f291c90001b844d90c6b Mon Sep 17 00:00:00 2001 From: dieriba Date: Wed, 23 Apr 2025 12:18:36 +0200 Subject: [PATCH 49/53] fix cli gcp types (#5644) * update types * fix types cli * fix ci * fix gcp types and fix used triggers * update repo ref revert .env and nits * fix build * Update frontend/src/lib/utils.ts Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fix type and deploy to * update ee-repo-ref * update .sqlx * add missing fields * fix: add sqlx derive macro * hanfle missing field, fix deploy to other workspace and update ee-repo-ref * update repo ref --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Ruben Fiszel --- ...61f003c29185c267642cfd898075ebda855d.json} | 40 ++++++--- ...f578a21813f038d75184a5034c37d4daf36e.json} | 40 ++++++--- ...588fc040c7a29ae6d9bab1f05af0b535e2ac.json} | 40 ++++++--- backend/ee-repo-ref.txt | 2 +- ...035_add-new-column-to-gcp-trigger.down.sql | 3 + ...44035_add-new-column-to-gcp-trigger.up.sql | 3 + backend/windmill-api/openapi.yaml | 85 +++---------------- backend/windmill-api/src/capture.rs | 26 ++++-- backend/windmill-api/src/gcp_triggers_ee.rs | 14 ++- backend/windmill-api/src/workspaces_export.rs | 1 + .../gcp/GcpTriggerEditorConfigSection.svelte | 31 +++---- .../triggers/gcp/GcpTriggerEditorInner.svelte | 29 +++---- frontend/src/lib/utils.ts | 14 ++- frontend/src/lib/utils_deployable.ts | 83 ++++++++---------- .../(root)/(logged)/gcp_triggers/+page.svelte | 6 +- .../(logged)/kafka_triggers/+page.svelte | 26 ++++-- .../(logged)/mqtt_triggers/+page.svelte | 20 +++-- .../(logged)/nats_triggers/+page.svelte | 26 ++++-- .../(logged)/postgres_triggers/+page.svelte | 6 +- .../(root)/(logged)/routes/+page.svelte | 26 ++++-- .../(root)/(logged)/sqs_triggers/+page.svelte | 20 +++-- .../(logged)/websocket_triggers/+page.svelte | 24 +++--- 22 files changed, 307 insertions(+), 258 deletions(-) rename backend/.sqlx/{query-f4f6336fc671b00bed7835124892f7a4d3bbe673f7c48153819dab385a5cb357.json => query-1312b7fd622cc814a406c85dbbff61f003c29185c267642cfd898075ebda855d.json} (74%) rename backend/.sqlx/{query-15fbe481789a7817bf37415fb935f9ed537fd7d3b266d928af4d5d3dd8bb5c18.json => query-2dcff8b16da75740c362015b2293f578a21813f038d75184a5034c37d4daf36e.json} (85%) rename backend/.sqlx/{query-0102308ffa1c0dbfba54d29246535bb81146a4cfae0ec408435570e0813a3bef.json => query-c2925a28212265bd9ac8e2d498b3588fc040c7a29ae6d9bab1f05af0b535e2ac.json} (73%) create mode 100644 backend/migrations/20250420144035_add-new-column-to-gcp-trigger.down.sql create mode 100644 backend/migrations/20250420144035_add-new-column-to-gcp-trigger.up.sql diff --git a/backend/.sqlx/query-f4f6336fc671b00bed7835124892f7a4d3bbe673f7c48153819dab385a5cb357.json b/backend/.sqlx/query-1312b7fd622cc814a406c85dbbff61f003c29185c267642cfd898075ebda855d.json similarity index 74% rename from backend/.sqlx/query-f4f6336fc671b00bed7835124892f7a4d3bbe673f7c48153819dab385a5cb357.json rename to backend/.sqlx/query-1312b7fd622cc814a406c85dbbff61f003c29185c267642cfd898075ebda855d.json index b20ae56e30..582896cc65 100644 --- a/backend/.sqlx/query-f4f6336fc671b00bed7835124892f7a4d3bbe673f7c48153819dab385a5cb357.json +++ b/backend/.sqlx/query-1312b7fd622cc814a406c85dbbff61f003c29185c267642cfd898075ebda855d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM \n gcp_trigger\n WHERE \n workspace_id = $1 AND \n path = $2\n ", + "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n subscription_mode AS \"subscription_mode: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM \n gcp_trigger\n WHERE \n workspace_id = $1 AND \n path = $2\n ", "describe": { "columns": [ { @@ -45,56 +45,71 @@ }, { "ordinal": 6, + "name": "subscription_mode: _", + "type_info": { + "Custom": { + "name": "gcp_subscription_mode", + "kind": { + "Enum": [ + "create_update", + "existing" + ] + } + } + } + }, + { + "ordinal": 7, "name": "path", "type_info": "Varchar" }, { - "ordinal": 7, + "ordinal": 8, "name": "script_path", "type_info": "Varchar" }, { - "ordinal": 8, + "ordinal": 9, "name": "is_flow", "type_info": "Bool" }, { - "ordinal": 9, + "ordinal": 10, "name": "edited_by", "type_info": "Varchar" }, { - "ordinal": 10, + "ordinal": 11, "name": "email", "type_info": "Varchar" }, { - "ordinal": 11, + "ordinal": 12, "name": "edited_at", "type_info": "Timestamptz" }, { - "ordinal": 12, + "ordinal": 13, "name": "server_id", "type_info": "Varchar" }, { - "ordinal": 13, + "ordinal": 14, "name": "last_server_ping", "type_info": "Timestamptz" }, { - "ordinal": 14, + "ordinal": 15, "name": "extra_perms", "type_info": "Jsonb" }, { - "ordinal": 15, + "ordinal": 16, "name": "error", "type_info": "Text" }, { - "ordinal": 16, + "ordinal": 17, "name": "enabled", "type_info": "Bool" } @@ -118,6 +133,7 @@ false, false, false, + false, true, true, false, @@ -125,5 +141,5 @@ false ] }, - "hash": "f4f6336fc671b00bed7835124892f7a4d3bbe673f7c48153819dab385a5cb357" + "hash": "1312b7fd622cc814a406c85dbbff61f003c29185c267642cfd898075ebda855d" } diff --git a/backend/.sqlx/query-15fbe481789a7817bf37415fb935f9ed537fd7d3b266d928af4d5d3dd8bb5c18.json b/backend/.sqlx/query-2dcff8b16da75740c362015b2293f578a21813f038d75184a5034c37d4daf36e.json similarity index 85% rename from backend/.sqlx/query-15fbe481789a7817bf37415fb935f9ed537fd7d3b266d928af4d5d3dd8bb5c18.json rename to backend/.sqlx/query-2dcff8b16da75740c362015b2293f578a21813f038d75184a5034c37d4daf36e.json index 5f76c31d8b..5622b3691e 100644 --- a/backend/.sqlx/query-15fbe481789a7817bf37415fb935f9ed537fd7d3b266d928af4d5d3dd8bb5c18.json +++ b/backend/.sqlx/query-2dcff8b16da75740c362015b2293f578a21813f038d75184a5034c37d4daf36e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM\n gcp_trigger\n WHERE\n delivery_type != 'push'::DELIVERY_MODE AND\n enabled IS TRUE\n AND (last_server_ping IS NULL OR\n last_server_ping < now() - interval '15 seconds'\n )\n ", + "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n subscription_mode AS \"subscription_mode: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM\n gcp_trigger\n WHERE\n delivery_type != 'push'::DELIVERY_MODE AND\n enabled IS TRUE\n AND (last_server_ping IS NULL OR\n last_server_ping < now() - interval '15 seconds'\n )\n ", "describe": { "columns": [ { @@ -45,56 +45,71 @@ }, { "ordinal": 6, + "name": "subscription_mode: _", + "type_info": { + "Custom": { + "name": "gcp_subscription_mode", + "kind": { + "Enum": [ + "create_update", + "existing" + ] + } + } + } + }, + { + "ordinal": 7, "name": "path", "type_info": "Varchar" }, { - "ordinal": 7, + "ordinal": 8, "name": "script_path", "type_info": "Varchar" }, { - "ordinal": 8, + "ordinal": 9, "name": "is_flow", "type_info": "Bool" }, { - "ordinal": 9, + "ordinal": 10, "name": "edited_by", "type_info": "Varchar" }, { - "ordinal": 10, + "ordinal": 11, "name": "email", "type_info": "Varchar" }, { - "ordinal": 11, + "ordinal": 12, "name": "edited_at", "type_info": "Timestamptz" }, { - "ordinal": 12, + "ordinal": 13, "name": "server_id", "type_info": "Varchar" }, { - "ordinal": 13, + "ordinal": 14, "name": "last_server_ping", "type_info": "Timestamptz" }, { - "ordinal": 14, + "ordinal": 15, "name": "extra_perms", "type_info": "Jsonb" }, { - "ordinal": 15, + "ordinal": 16, "name": "error", "type_info": "Text" }, { - "ordinal": 16, + "ordinal": 17, "name": "enabled", "type_info": "Bool" } @@ -115,6 +130,7 @@ false, false, false, + false, true, true, false, @@ -122,5 +138,5 @@ false ] }, - "hash": "15fbe481789a7817bf37415fb935f9ed537fd7d3b266d928af4d5d3dd8bb5c18" + "hash": "2dcff8b16da75740c362015b2293f578a21813f038d75184a5034c37d4daf36e" } diff --git a/backend/.sqlx/query-0102308ffa1c0dbfba54d29246535bb81146a4cfae0ec408435570e0813a3bef.json b/backend/.sqlx/query-c2925a28212265bd9ac8e2d498b3588fc040c7a29ae6d9bab1f05af0b535e2ac.json similarity index 73% rename from backend/.sqlx/query-0102308ffa1c0dbfba54d29246535bb81146a4cfae0ec408435570e0813a3bef.json rename to backend/.sqlx/query-c2925a28212265bd9ac8e2d498b3588fc040c7a29ae6d9bab1f05af0b535e2ac.json index 06390d0ce9..eec208dbbb 100644 --- a/backend/.sqlx/query-0102308ffa1c0dbfba54d29246535bb81146a4cfae0ec408435570e0813a3bef.json +++ b/backend/.sqlx/query-c2925a28212265bd9ac8e2d498b3588fc040c7a29ae6d9bab1f05af0b535e2ac.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM \n gcp_trigger\n WHERE \n workspace_id = $1\n ", + "query": "\n SELECT\n gcp_resource_path,\n subscription_id,\n topic_id,\n workspace_id,\n delivery_type AS \"delivery_type: _\",\n delivery_config AS \"delivery_config: _\",\n subscription_mode AS \"subscription_mode: _\",\n path,\n script_path,\n is_flow,\n edited_by,\n email,\n edited_at,\n server_id,\n last_server_ping,\n extra_perms,\n error,\n enabled\n FROM \n gcp_trigger\n WHERE \n workspace_id = $1\n ", "describe": { "columns": [ { @@ -45,56 +45,71 @@ }, { "ordinal": 6, + "name": "subscription_mode: _", + "type_info": { + "Custom": { + "name": "gcp_subscription_mode", + "kind": { + "Enum": [ + "create_update", + "existing" + ] + } + } + } + }, + { + "ordinal": 7, "name": "path", "type_info": "Varchar" }, { - "ordinal": 7, + "ordinal": 8, "name": "script_path", "type_info": "Varchar" }, { - "ordinal": 8, + "ordinal": 9, "name": "is_flow", "type_info": "Bool" }, { - "ordinal": 9, + "ordinal": 10, "name": "edited_by", "type_info": "Varchar" }, { - "ordinal": 10, + "ordinal": 11, "name": "email", "type_info": "Varchar" }, { - "ordinal": 11, + "ordinal": 12, "name": "edited_at", "type_info": "Timestamptz" }, { - "ordinal": 12, + "ordinal": 13, "name": "server_id", "type_info": "Varchar" }, { - "ordinal": 13, + "ordinal": 14, "name": "last_server_ping", "type_info": "Timestamptz" }, { - "ordinal": 14, + "ordinal": 15, "name": "extra_perms", "type_info": "Jsonb" }, { - "ordinal": 15, + "ordinal": 16, "name": "error", "type_info": "Text" }, { - "ordinal": 16, + "ordinal": 17, "name": "enabled", "type_info": "Bool" } @@ -117,6 +132,7 @@ false, false, false, + false, true, true, false, @@ -124,5 +140,5 @@ false ] }, - "hash": "0102308ffa1c0dbfba54d29246535bb81146a4cfae0ec408435570e0813a3bef" + "hash": "c2925a28212265bd9ac8e2d498b3588fc040c7a29ae6d9bab1f05af0b535e2ac" } diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 668c3a7485..cd49b42813 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -4c4db954d9de775905a2e207a5969d5feff23455 \ No newline at end of file +b9ca3ccdd188683c81832fd3ed41c8dd632a0c9c \ No newline at end of file diff --git a/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.down.sql b/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.down.sql new file mode 100644 index 0000000000..076f1891b6 --- /dev/null +++ b/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.down.sql @@ -0,0 +1,3 @@ +-- Add down migration script here +ALTER TABLE gcp_trigger DROP COLUMN subscription_mode; +DROP TYPE GCP_SUBSCRIPTION_MODE; \ No newline at end of file diff --git a/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.up.sql b/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.up.sql new file mode 100644 index 0000000000..529d9580db --- /dev/null +++ b/backend/migrations/20250420144035_add-new-column-to-gcp-trigger.up.sql @@ -0,0 +1,3 @@ +-- Add up migration script here +CREATE TYPE GCP_SUBSCRIPTION_MODE AS ENUM ('create_update', 'existing'); +ALTER TABLE gcp_trigger ADD COLUMN subscription_mode GCP_SUBSCRIPTION_MODE NOT NULL DEFAULT 'create_update'::GCP_SUBSCRIPTION_MODE; \ No newline at end of file diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 329cd80968..cd3eea2850 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -9539,7 +9539,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/NewGcpTrigger" + $ref: "#/components/schemas/GcpTriggerData" responses: "201": description: gcp trigger created @@ -9563,7 +9563,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/EditGcpTrigger" + $ref: "#/components/schemas/GcpTriggerData" responses: "200": description: gcp trigger updated @@ -15045,8 +15045,6 @@ components: type: string authenticate: type: boolean - base_endpoint: - type: string required: - authenticate - base_endpoint @@ -15068,6 +15066,8 @@ components: $ref: "#/components/schemas/DeliveryType" delivery_config: $ref: "#/components/schemas/PushConfig" + subscription_mode: + $ref: "#/components/schemas/SubscriptionMode" last_server_ping: type: string format: date-time @@ -15081,6 +15081,8 @@ components: - subscription_id - enabled - delivery_type + - subscription_mode + SubscriptionMode: type: string @@ -15089,55 +15091,24 @@ components: - create_update description: "The mode of subscription. 'existing' means using an existing GCP subscription, while 'create_update' involves creating or updating a new subscription." - GcpExistingSubscription: + + GcpTriggerData: type: object properties: + gcp_resource_path: + type: string + subscription_mode: + $ref: "#/components/schemas/SubscriptionMode" + topic_id: + type: string subscription_id: type: string base_endpoint: type: string - required: - - subscription_id - - base_endpoint - - GcpCreateUpdateSubscription: - type: object - properties: - subscription_id: - type: string delivery_type: $ref: "#/components/schemas/DeliveryType" delivery_config: $ref: "#/components/schemas/PushConfig" - required: - - delivery_type - - - GcpSubscriptionModeConfig: - type: object - properties: - subscription_mode: - $ref: "#/components/schemas/SubscriptionMode" - required: - - subscription_mode - allOf: - - oneOf: - - $ref: "#/components/schemas/GcpExistingSubscription" - - $ref: "#/components/schemas/GcpCreateUpdateSubscription" - description: | - "This is a union type representing the subscription mode. - - 'existing': Represents an existing GCP subscription, and should be accompanied by an 'ExistingGcpSubscription' object. - - 'create_update': Represents a new or updated GCP subscription, and should be accompanied by a 'CreateUpdateConfig' object." - - NewGcpTrigger: - type: object - properties: - gcp_resource_path: - type: string - topic_id: - type: string - subscription_mode: - $ref: "#/components/schemas/GcpSubscriptionModeConfig" path: type: string script_path: @@ -15154,34 +15125,6 @@ components: - topic_id - subscription_mode - EditGcpTrigger: - type: object - properties: - gcp_resource_path: - type: string - topic_id: - type: string - subscription_mode: - $ref: "#/components/schemas/GcpSubscriptionModeConfig" - path: - type: string - script_path: - type: string - is_flow: - type: boolean - enabled: - type: boolean - required: - - path - - script_path - - is_flow - - enabled - - mqtt_resource_path - - subscription_id - - delivery_type - - topic_id - - subscription_mode - GetAllTopicSubscription: type: object properties: diff --git a/backend/windmill-api/src/capture.rs b/backend/windmill-api/src/capture.rs index 1247dd78a7..547b56954b 100644 --- a/backend/windmill-api/src/capture.rs +++ b/backend/windmill-api/src/capture.rs @@ -18,7 +18,8 @@ use { #[cfg(all(feature = "enterprise", feature = "gcp_trigger"))] use crate::gcp_triggers_ee::{ - manage_google_subscription, process_google_push_request, validate_jwt_token, SubscriptionMode, + manage_google_subscription, process_google_push_request, validate_jwt_token, + CreateUpdateConfig, SubscriptionMode, }; #[cfg(all(feature = "enterprise", feature = "sqs_trigger"))] @@ -29,8 +30,10 @@ use windmill_common::auth::aws::AwsAuthResourceType; all(feature = "enterprise", feature = "gcp_trigger") ))] use { - axum::extract::Request, http::HeaderMap, serde::de::DeserializeOwned, - windmill_common::error::Error, + axum::extract::Request, + http::HeaderMap, + serde::de::DeserializeOwned, + windmill_common::{error::Error, utils::empty_string_as_none}, }; #[cfg(all(feature = "enterprise", feature = "kafka"))] @@ -160,8 +163,13 @@ pub struct SqsTriggerConfig { #[derive(Debug, Serialize, Deserialize)] pub struct GcpTriggerConfig { pub gcp_resource_path: String, - #[serde(flatten)] pub subscription_mode: SubscriptionMode, + #[serde(default, deserialize_with = "empty_string_as_none")] + pub subscription_id: Option, + #[serde(default, deserialize_with = "empty_string_as_none")] + pub base_endpoint: Option, + #[serde(flatten)] + pub create_update: Option, pub topic_id: String, } @@ -370,11 +378,15 @@ async fn set_gcp_trigger_config( &gcp_config.gcp_resource_path, &capture_config.path, &gcp_config.topic_id, + &mut gcp_config.subscription_id, + &mut gcp_config.base_endpoint, gcp_config.subscription_mode, + gcp_config.create_update, + false, ) .await?; - - gcp_config.subscription_mode = SubscriptionMode::CreateUpdate(config); + gcp_config.create_update = Some(config); + gcp_config.subscription_mode = SubscriptionMode::CreateUpdate; capture_config.trigger_config = Some(TriggerConfig::Gcp(gcp_config)); Ok(capture_config) @@ -891,7 +903,7 @@ async fn gcp_payload( let authed = fetch_api_authed(owner.clone(), email, &w_id, &db, None).await?; - let SubscriptionMode::CreateUpdate(config) = &gcp_trigger_config.subscription_mode else { + let Some(config) = &gcp_trigger_config.create_update else { return Err(Error::BadConfig("Bad config".to_string())); }; diff --git a/backend/windmill-api/src/gcp_triggers_ee.rs b/backend/windmill-api/src/gcp_triggers_ee.rs index ec0a6ec115..4c8c72a4e4 100644 --- a/backend/windmill-api/src/gcp_triggers_ee.rs +++ b/backend/windmill-api/src/gcp_triggers_ee.rs @@ -52,11 +52,12 @@ pub struct ExistingGcpSubscription { pub base_endpoint: String, } -#[derive(Debug, Deserialize, Serialize)] -#[serde(tag = "subscription_mode", rename_all = "snake_case")] +#[derive(Debug, Deserialize, Serialize, sqlx::Type)] +#[serde(rename_all = "snake_case")] +#[sqlx(type_name = "GCP_SUBSCRIPTION_MODE", rename_all = "snake_case")] pub enum SubscriptionMode { - Existing(ExistingGcpSubscription), - CreateUpdate(CreateUpdateConfig), + Existing, + CreateUpdate, } pub fn workspaced_service() -> Router { @@ -77,7 +78,11 @@ pub async fn manage_google_subscription( _gcp_resource_path: &str, _path: &str, _topic_id: &str, + _subscription_id: &mut Option, + _base_endpoint: &mut Option, _subscription_mode: SubscriptionMode, + _create_update_config: Option, + _trigger_mode: bool, ) -> WindmillResult { Ok(CreateUpdateConfig::default()) } @@ -117,6 +122,7 @@ pub struct GcpTrigger { pub subscription_id: String, pub delivery_type: DeliveryType, pub delivery_config: Option>, + pub subscription_mode: SubscriptionMode, pub topic_id: String, pub path: String, pub script_path: String, diff --git a/backend/windmill-api/src/workspaces_export.rs b/backend/windmill-api/src/workspaces_export.rs index b799313933..fea688c78a 100644 --- a/backend/windmill-api/src/workspaces_export.rs +++ b/backend/windmill-api/src/workspaces_export.rs @@ -692,6 +692,7 @@ pub(crate) async fn tarball_workspace( workspace_id, delivery_type AS "delivery_type: _", delivery_config AS "delivery_config: _", + subscription_mode AS "subscription_mode: _", path, script_path, is_flow, diff --git a/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte b/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte index d359085122..816dffd90f 100644 --- a/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte +++ b/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte @@ -50,7 +50,6 @@ const DEFAULT_PUSH_CONFIG: PushConfig = { audience: '', authenticate: false, - base_endpoint } async function loadAllPubSubTopicsFromProject() { @@ -87,7 +86,7 @@ function getBaseUrl(captureInfo: CaptureInfo | undefined) { if (captureInfo) { - return `${location.origin}${base}/api/w/${$workspaceStore}/capture_u/gcp/${ + return `${window.location.origin}${base}/api/w/${$workspaceStore}/capture_u/gcp/${ captureInfo.isFlow ? 'flow' : 'script' }` } else { @@ -271,19 +270,6 @@
- - -

Enable Google Cloud authentication for push delivery using a verified token. + {#if delivery_config.authenticate} + + + + {/if}

{/if}
diff --git a/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorInner.svelte b/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorInner.svelte index 45a74ec93d..b59fb4c60f 100644 --- a/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorInner.svelte +++ b/frontend/src/lib/components/triggers/gcp/GcpTriggerEditorInner.svelte @@ -103,6 +103,7 @@ delivery_type = s.delivery_type subscription_id = s.subscription_id delivery_config = s.delivery_config + subscription_mode = s.subscription_mode is_flow = s.is_flow path = s.path enabled = s.enabled @@ -116,12 +117,12 @@ async function updateTrigger(): Promise { try { is_loading = true + const base_endpoint = `${window.location.origin}${base}` if (delivery_type === 'push') { if (!delivery_config) { sendUserToast('Must set route path when delivery type is push', true) return } - delivery_config.base_endpoint = `${window.location.origin}${base}` } else { delivery_config = undefined } @@ -131,13 +132,11 @@ path: initialPath, requestBody: { gcp_resource_path, - subscription_mode: { - subscription_mode, - subscription_id, - delivery_type, - delivery_config, - base_endpoint: `${window.location.origin}${base}` - }, + subscription_mode, + subscription_id, + delivery_type, + delivery_config, + base_endpoint, topic_id, path, script_path, @@ -151,13 +150,11 @@ workspace: $workspaceStore!, requestBody: { gcp_resource_path, - subscription_mode: { - subscription_mode, - subscription_id, - delivery_type, - delivery_config: delivery_config, - base_endpoint: `${window.location.origin}${base}` - }, + subscription_mode, + subscription_id, + delivery_type, + delivery_config, + base_endpoint, topic_id, path, script_path, @@ -281,7 +278,7 @@ bind:delivery_config bind:topic_id bind:subscription_mode - bind:path={path} + bind:path cloud_subscription_id={subscription_id} create_update_subscription_id={subscription_id} {can_write} diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index f5da07ee38..7ee8e1edd6 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -9,7 +9,7 @@ import { deepEqual } from 'fast-equals' import YAML from 'yaml' -import type { UserExt } from './stores' +import { type UserExt } from './stores' import { sendUserToast } from './toast' import type { Job, Script } from './gen' import type { EnumType, SchemaProperty } from './common' @@ -17,6 +17,7 @@ import type { Schema } from './common' export { sendUserToast } import type { AnyMeltElement } from '@melt-ui/svelte' import type { RunsSelectionMode } from './components/runs/RunsBatchActionsDropdown.svelte' +import type { TriggerKind } from './components/triggers' export function isJobCancelable(j: Job): boolean { return j.type === 'QueuedJob' && !j.schedule_path && !j.canceled @@ -141,6 +142,17 @@ export function msToSec(ms: number | undefined, maximumFractionDigits?: number): }) } +export function removeTriggerKindIfUnused( + length: number, + triggerKind: TriggerKind, + usedTriggerKinds: string[] +) { + if (length === 0 && usedTriggerKinds.includes(triggerKind)) { + return usedTriggerKinds.filter((kind) => kind != triggerKind) + } + return usedTriggerKinds +} + export function msToReadableTime(ms: number | undefined): string { if (ms === undefined) return '?' diff --git a/frontend/src/lib/utils_deployable.ts b/frontend/src/lib/utils_deployable.ts index 355fe79071..2a81423b47 100644 --- a/frontend/src/lib/utils_deployable.ts +++ b/frontend/src/lib/utils_deployable.ts @@ -9,7 +9,7 @@ import { ScheduleService, SqsTriggerService, WebsocketTriggerService, - type NewGcpTrigger, + type GcpTriggerData, type WorkspaceDeployUISettings } from './gen' import type { TriggerKind } from './components/triggers' @@ -78,11 +78,9 @@ export async function existsTrigger( return await PostgresTriggerService.existsPostgresTrigger(data) } else if (triggerKind === 'sqs') { return await SqsTriggerService.existsSqsTrigger(data) - } - else if (triggerKind === 'gcp') { + } else if (triggerKind === 'gcp') { return await GcpTriggerService.existsGcpTrigger(data) - } - else if (triggerKind === 'websockets') { + } else if (triggerKind === 'websockets') { return await WebsocketTriggerService.existsWebsocketTrigger(data) } else if (triggerKind === 'nats') { return await NatsTriggerService.existsNatsTrigger(data) @@ -140,36 +138,31 @@ export async function getTriggersDeployData(kind: TriggerKind, path: string, wor createFn: NatsTriggerService.createNatsTrigger, updateFn: NatsTriggerService.updateNatsTrigger } - } - else if (kind === 'gcp') { + } else if (kind === 'gcp') { const gcpTrigger = await GcpTriggerService.getGcpTrigger({ workspace: workspace!, path: path }) gcpTrigger.subscription_id = '' + gcpTrigger.subscription_mode = 'create_update' + if (gcpTrigger.delivery_config) { gcpTrigger.delivery_config.audience = '' } - const data: NewGcpTrigger = { - subscription_mode: { - subscription_mode: 'create_update', - subscription_id: gcpTrigger.subscription_id, - delivery_type: gcpTrigger.delivery_type, - delivery_config: gcpTrigger.delivery_config, - base_endpoint: `${window.location.origin}${base}` - }, - ...gcpTrigger + const data: GcpTriggerData = { + ...gcpTrigger, + base_endpoint: + gcpTrigger.delivery_type === 'push' ? `${window.location.origin}${base}` : undefined } return { data, createFn: GcpTriggerService.createGcpTrigger, updateFn: GcpTriggerService.updateGcpTrigger - } - } - else if (kind === 'postgres') { + } + } else if (kind === 'postgres') { const postgresTrigger = await PostgresTriggerService.getPostgresTrigger({ workspace: workspace!, path: path @@ -321,26 +314,20 @@ export async function getTriggerValue(kind: TriggerKind, path: string, workspace replication_slot_name, publication_name } - } - else if (kind === 'gcp') { - const { - enabled, - script_path, - is_flow, - gcp_resource_path, - } = await GcpTriggerService.getGcpTrigger({ - workspace: workspace!, - path: path - }) + } else if (kind === 'gcp') { + const { enabled, script_path, is_flow, gcp_resource_path } = + await GcpTriggerService.getGcpTrigger({ + workspace: workspace!, + path: path + }) return { enabled, script_path, is_flow, - gcp_resource_path, + gcp_resource_path } - } - else if (kind === 'websockets') { + } else if (kind === 'websockets') { const { enabled, script_path, @@ -511,17 +498,14 @@ export async function getTriggerDependency(kind: TriggerKind, path: string, work }) result = retrieveKindsValues({ resource_path: postgres_resource_path, script_path, is_flow }) - } - else if (kind === 'gcp') { - const { gcp_resource_path, script_path, is_flow } = - await GcpTriggerService.getGcpTrigger({ - workspace: workspace!, - path: path - }) + } else if (kind === 'gcp') { + const { gcp_resource_path, script_path, is_flow } = await GcpTriggerService.getGcpTrigger({ + workspace: workspace!, + path: path + }) result = retrieveKindsValues({ resource_path: gcp_resource_path, script_path, is_flow }) - } - else if (kind === 'websockets') { + } else if (kind === 'websockets') { const { script_path, is_flow, url, initial_messages } = await WebsocketTriggerService.getWebsocketTrigger({ workspace: workspace!, @@ -546,12 +530,17 @@ export async function getTriggerDependency(kind: TriggerKind, path: string, work } }) } else if (kind === 'routes') { - const { script_path, is_flow, authentication_resource_path} = await HttpTriggerService.getHttpTrigger({ - workspace: workspace!, - path: path - }) + const { script_path, is_flow, authentication_resource_path } = + await HttpTriggerService.getHttpTrigger({ + workspace: workspace!, + path: path + }) - result = retrieveKindsValues({ script_path, is_flow, resource_path: authentication_resource_path}) + result = retrieveKindsValues({ + script_path, + is_flow, + resource_path: authentication_resource_path + }) } else if (kind === 'schedules') { const { script_path, is_flow } = await ScheduleService.getSchedule({ workspace: workspace!, diff --git a/frontend/src/routes/(root)/(logged)/gcp_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/gcp_triggers/+page.svelte index c5fadefa4e..9fcaa0f202 100644 --- a/frontend/src/routes/(root)/(logged)/gcp_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/gcp_triggers/+page.svelte @@ -11,7 +11,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -21,7 +22,7 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, usedTriggerKinds, userStore, workspaceStore } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp, ClipboardCopy } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -64,6 +65,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'gcp', $usedTriggerKinds) loading = false } diff --git a/frontend/src/routes/(root)/(logged)/kafka_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/kafka_triggers/+page.svelte index 14a9c4b6f5..5d8c6ba86e 100644 --- a/frontend/src/routes/(root)/(logged)/kafka_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/kafka_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,13 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { userStore, workspaceStore, userWorkspaces, enterpriseLicense } from '$lib/stores' + import { + userStore, + workspaceStore, + userWorkspaces, + enterpriseLicense, + usedTriggerKinds + } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -62,6 +69,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'kafka', $usedTriggerKinds) loading = false } @@ -160,15 +168,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -178,10 +186,10 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set(filteredItems?.map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -380,7 +388,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -427,7 +435,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', diff --git a/frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte index 7c2cc2a87e..4a78f7e35e 100644 --- a/frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,7 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, usedTriggerKinds, userStore, workspaceStore } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -62,6 +63,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'mqtt', $usedTriggerKinds) loading = false } @@ -160,15 +162,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -178,10 +180,10 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set(filteredItems?.map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -360,7 +362,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -407,7 +409,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', diff --git a/frontend/src/routes/(root)/(logged)/nats_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/nats_triggers/+page.svelte index 54d8496cb3..9e18225165 100644 --- a/frontend/src/routes/(root)/(logged)/nats_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/nats_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,13 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { userStore, workspaceStore, userWorkspaces, enterpriseLicense } from '$lib/stores' + import { + userStore, + workspaceStore, + userWorkspaces, + enterpriseLicense, + usedTriggerKinds + } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -61,6 +68,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'nats', $usedTriggerKinds) loading = false } @@ -159,15 +167,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -177,10 +185,10 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set(filteredItems?.map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -379,7 +387,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -426,7 +434,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', diff --git a/frontend/src/routes/(root)/(logged)/postgres_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/postgres_triggers/+page.svelte index 7af681c309..a23c23381e 100644 --- a/frontend/src/routes/(root)/(logged)/postgres_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/postgres_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,7 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, usedTriggerKinds, userStore, workspaceStore } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, Database, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -61,6 +62,7 @@ ).map((x) => { return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } }) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'postgres', $usedTriggerKinds) loading = false } diff --git a/frontend/src/routes/(root)/(logged)/routes/+page.svelte b/frontend/src/routes/(root)/(logged)/routes/+page.svelte index 1a33fae1be..89163b464a 100644 --- a/frontend/src/routes/(root)/(logged)/routes/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/routes/+page.svelte @@ -10,7 +10,8 @@ copyToClipboard, displayDate, getLocalSetting, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,13 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { userStore, workspaceStore, userWorkspaces, enterpriseLicense } from '$lib/stores' + import { + userStore, + workspaceStore, + userWorkspaces, + enterpriseLicense, + usedTriggerKinds + } from '$lib/stores' import { Route, Code, Eye, Pen, Plus, Share, Trash, FileUp, ClipboardCopy } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -60,6 +67,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'routes', $usedTriggerKinds) loading = false } @@ -115,15 +123,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -133,14 +141,14 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set( filteredItems ?.filter((x) => x.script_path) .map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? [] ) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -299,7 +307,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -347,7 +355,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', diff --git a/frontend/src/routes/(root)/(logged)/sqs_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/sqs_triggers/+page.svelte index 91869fc2a5..b5a5522652 100644 --- a/frontend/src/routes/(root)/(logged)/sqs_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/sqs_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,7 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, usedTriggerKinds, userStore, workspaceStore } from '$lib/stores' import { Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -61,6 +62,7 @@ return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } } ) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'sqs', $usedTriggerKinds) loading = false } @@ -159,15 +161,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -177,10 +179,10 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set(filteredItems?.map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -357,7 +359,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -408,7 +410,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', diff --git a/frontend/src/routes/(root)/(logged)/websocket_triggers/+page.svelte b/frontend/src/routes/(root)/(logged)/websocket_triggers/+page.svelte index 9aaa45728f..ceaf3950c4 100644 --- a/frontend/src/routes/(root)/(logged)/websocket_triggers/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/websocket_triggers/+page.svelte @@ -10,7 +10,8 @@ displayDate, getLocalSetting, sendUserToast, - storeLocalSetting + storeLocalSetting, + removeTriggerKindIfUnused } from '$lib/utils' import { base } from '$app/paths' import CenteredPage from '$lib/components/CenteredPage.svelte' @@ -20,7 +21,7 @@ import SharedBadge from '$lib/components/SharedBadge.svelte' import ShareModal from '$lib/components/ShareModal.svelte' import Toggle from '$lib/components/Toggle.svelte' - import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores' + import { enterpriseLicense, usedTriggerKinds, userStore, workspaceStore } from '$lib/stores' import { Unplug, Code, Eye, Pen, Plus, Share, Trash, Circle, FileUp } from 'lucide-svelte' import { goto } from '$lib/navigation' import SearchItems from '$lib/components/SearchItems.svelte' @@ -60,6 +61,7 @@ ).map((x) => { return { canWrite: canWrite(x.path, x.extra_perms!, $userStore), ...x } }) + $usedTriggerKinds = removeTriggerKindIfUnused(triggers.length, 'websockets', $usedTriggerKinds) loading = false } @@ -158,15 +160,15 @@ (x) => x.path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter( (x) => x.script_path.startsWith(ownerFilter + '/') && filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) : triggers?.filter((x) => filterItemsPathsBaseOnUserFilters(x, selectedFilterKind, filterUserFolders) - ) + ) $: if ($workspaceStore) { ownerFilter = undefined @@ -176,10 +178,10 @@ selectedFilterKind === 'trigger' ? Array.from( new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() : Array.from( new Set(filteredItems?.map((x) => x.script_path.split('/').slice(0, 2).join('/')) ?? []) - ).sort() + ).sort() $: items = filter !== '' ? filteredItems : preFilteredItems @@ -304,8 +306,8 @@ {url.startsWith('$script:') ? 'URL: ' + url.replace('$script:', 'result of script ') : url.startsWith('$flow:') - ? 'URL: ' + url.replace('$flow:', 'result of flow ') - : url} + ? 'URL: ' + url.replace('$flow:', 'result of flow ') + : url} {/if}
@@ -370,7 +372,7 @@ ? { icon: Pen } : { icon: Eye - }} + }} color="dark" > {canWrite ? 'Edit' : 'View'} @@ -417,7 +419,7 @@ }) } } - ] + ] : []), { displayName: 'Audit logs', From 60a848af489653bfe0309242fddc0907f5e393d4 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 23 Apr 2025 16:05:34 +0200 Subject: [PATCH 50/53] improve label filtering with wildcards --- ...70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json | 23 ------------------- backend/windmill-api/src/jobs.rs | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json diff --git a/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json b/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json deleted file mode 100644 index f43524a12a..0000000000 --- a/backend/.sqlx/query-264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT jsonb_build_object(\n 'kind', jb.kind,\n 'script_path', jb.runnable_path,\n 'latest_schema', COALESCE(\n (SELECT DISTINCT ON (s.path) s.schema FROM script s WHERE s.path = jb.runnable_path AND jb.kind = 'script' ORDER BY s.path, s.created_at DESC),\n (SELECT flow_version.schema FROM flow LEFT JOIN flow_version ON flow_version.id = flow.versions[array_upper(flow.versions, 1)] WHERE flow.path = jb.runnable_path AND jb.kind = 'flow')\n ),\n 'schemas', ARRAY(\n SELECT jsonb_build_object(\n 'script_hash', LPAD(TO_HEX(COALESCE(s.hash, f.id)), 16, '0'),\n 'job_ids', ARRAY_AGG(DISTINCT j.id),\n 'schema', (ARRAY_AGG(COALESCE(s.schema, f.schema)))[1]\n ) FROM v2_job j\n LEFT JOIN script s ON s.hash = j.runnable_id AND j.kind = 'script'\n LEFT JOIN flow_version f ON f.id = j.runnable_id AND j.kind = 'flow'\n WHERE j.id = ANY(ARRAY_AGG(jb.id))\n GROUP BY COALESCE(s.hash, f.id)\n )\n ) FROM v2_job jb\n WHERE (jb.kind = 'flow' OR jb.kind = 'script')\n AND jb.workspace_id = $1 AND jb.id = ANY($2)\n GROUP BY jb.kind, jb.runnable_path", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "jsonb_build_object", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Text", - "UuidArray" - ] - }, - "nullable": [ - null - ] - }, - "hash": "264da6a89d005aebf4d5cd5f05e70fcffccd5fae8e2e352de3e1eb104e7fc3a6" -} diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index 5317b78fbc..1ed0871a7c 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -5839,7 +5839,7 @@ pub fn filter_list_completed_query( if let Some(label) = &lq.label { if lq.allow_wildcards.unwrap_or(false) { let wh = format!( - "EXISTS (SELECT 1 FROM jsonb_array_elements_text(result->'wm_labels') label WHERE label LIKE '{}')", + "EXISTS (SELECT 1 FROM jsonb_array_elements_text(result->'wm_labels') label WHERE jsonb_typeof(result->'wm_labels') = 'array' AND label LIKE '{}')", &label.replace("*", "%").replace("'", "''") ); sqlb.and_where("result ? 'wm_labels'"); From b146de281b3d6e24a43ca594f4e5cedfcafb0d04 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 23 Apr 2025 19:07:16 +0200 Subject: [PATCH 51/53] improve warning message for self-approval for superadmins --- .../approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte b/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte index 826e0f0bb4..bdb984fdc8 100644 --- a/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte +++ b/frontend/src/routes/approve/[workspace]/[job]/[resume]/[hmac]/+page.svelte @@ -266,7 +266,7 @@ >
{/if} - {#if !completed && !alreadyResumed && job?.raw_flow?.modules?.[approvalStep]?.suspend?.user_auth_required && job?.raw_flow?.modules?.[approvalStep]?.suspend?.self_approval_disabled && $userStore && $userStore.email === job.email && $userStore.is_admin} + {#if !completed && !alreadyResumed && job?.raw_flow?.modules?.[approvalStep]?.suspend?.user_auth_required && job?.raw_flow?.modules?.[approvalStep]?.suspend?.self_approval_disabled && $userStore && $userStore.email === job.email && ($userStore.is_admin || $userStore.is_super_admin)}
As an administrator, by resuming or cancelling this stage of the flow, you bypass the From c41c1eb587bf22364f1202310a0c64b6040ab968 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Wed, 23 Apr 2025 18:20:46 +0100 Subject: [PATCH 52/53] fix(frontend): fix validity check (#5654) --- .../triggers/postgres/PostgresEditorConfigSection.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte index 9ed430bcee..00018eca3c 100644 --- a/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte +++ b/frontend/src/lib/components/triggers/postgres/PostgresEditorConfigSection.svelte @@ -37,7 +37,7 @@ function updateValidity(publication: PublicationData) { isValid = !emptyString(postgres_resource_path) && - (!publication.table_to_track || publication.table_to_track.length === 0) + (!publication.table_to_track || publication.table_to_track.length !== 0) } $: updateValidity(publication) From 8d4d2db5073c52a8b05f2e001445deabe4d0988e Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 23 Apr 2025 19:24:48 +0200 Subject: [PATCH 53/53] chore(main): release 1.483.2 (#5648) * chore(main): release 1.483.2 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> --- CHANGELOG.md | 10 ++ backend/Cargo.lock | 114 +++++++++--------- backend/Cargo.toml | 4 +- backend/windmill-api/openapi.yaml | 2 +- benchmarks/lib.ts | 2 +- cli/main.ts | 2 +- frontend/package-lock.json | 4 +- frontend/package.json | 2 +- lsp/Pipfile | 4 +- openflow.openapi.yaml | 2 +- .../WindmillClient/WindmillClient.psd1 | 2 +- python-client/wmill/pyproject.toml | 2 +- python-client/wmill_pg/pyproject.toml | 2 +- typescript-client/jsr.json | 2 +- typescript-client/package.json | 2 +- version.txt | 2 +- 16 files changed, 84 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c5ee479f4..12c7a5399f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.483.2](https://github.com/windmill-labs/windmill/compare/v1.483.1...v1.483.2) (2025-04-23) + + +### Bug Fixes + +* batch reruns query missing workspace_id check in subquery ([#5652](https://github.com/windmill-labs/windmill/issues/5652)) ([444a6ab](https://github.com/windmill-labs/windmill/commit/444a6abad670114c52e44f3606bf6fefc5d3fd98)) +* **frontend:** fix validity check ([#5654](https://github.com/windmill-labs/windmill/issues/5654)) ([c41c1eb](https://github.com/windmill-labs/windmill/commit/c41c1eb587bf22364f1202310a0c64b6040ab968)) +* improve MySQL datetime parser timezone handling (WIN-1155) ([#5645](https://github.com/windmill-labs/windmill/issues/5645)) ([5bca8f6](https://github.com/windmill-labs/windmill/commit/5bca8f60e970cc67839edb5dc491685f36cf0499)) +* track relative imports in python and ts even if lockfile is provided ([e316dbd](https://github.com/windmill-labs/windmill/commit/e316dbd9bdd5c59e9aaba6a4472bb7d832834e84)) + ## [1.483.1](https://github.com/windmill-labs/windmill/compare/v1.483.0...v1.483.1) (2025-04-19) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 247f2cc5ba..c0256d1816 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -109,7 +109,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "once_cell", "version_check", ] @@ -122,7 +122,7 @@ checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "const-random", - "getrandom 0.2.15", + "getrandom 0.2.16", "once_cell", "version_check", "zerocopy 0.7.35", @@ -793,9 +793,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ddeb19ee86cb16ecfc871e5b0660aff6285760957aaedda6284cf0e790d3769" +checksum = "bfa9b6986f250236c27e5a204062434a773a13243d2ffc2955f37bdba4c5c6a1" dependencies = [ "bindgen 0.69.5", "cc", @@ -1419,9 +1419,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -2133,7 +2133,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "once_cell", "tiny-keccak", ] @@ -5241,9 +5241,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", @@ -6803,9 +6803,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "c9627da5196e5d8ed0b0495e61e518847578da83483c37288316d9b2e03a7f72" [[package]] name = "libproc" @@ -7526,7 +7526,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -7624,7 +7624,7 @@ dependencies = [ "data-encoding", "ed25519", "ed25519-dalek", - "getrandom 0.2.15", + "getrandom 0.2.16", "log", "rand 0.8.5", "signatory", @@ -8018,7 +8018,7 @@ checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d" dependencies = [ "base64 0.22.1", "chrono", - "getrandom 0.2.15", + "getrandom 0.2.16", "http 1.3.1", "rand 0.8.5", "reqwest 0.12.15", @@ -9291,9 +9291,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" +checksum = "bcbafbbdbb0f638fe3f35f3c56739f77a8a1d070cb25603226c83339b391472b" dependencies = [ "bytes", "getrandom 0.3.2", @@ -9402,7 +9402,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -9547,7 +9547,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", "thiserror 1.0.69", ] @@ -9756,7 +9756,7 @@ dependencies = [ "anyhow", "async-trait", "futures", - "getrandom 0.2.15", + "getrandom 0.2.16", "http 1.3.1", "hyper 1.6.0", "parking_lot 0.11.2", @@ -9826,7 +9826,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted 0.9.0", "windows-sys 0.52.0", @@ -10550,9 +10550,9 @@ dependencies = [ [[package]] name = "serde-aux" -version = "4.6.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5290c39c5f6992b9dddbda28541d965dba46468294e6018a408fa297e6c602de" +checksum = "207f67b28fe90fb596503a9bf0bf1ea5e831e21307658e177c5dfcdfc3ab8a0a" dependencies = [ "chrono", "serde", @@ -10820,9 +10820,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] @@ -10870,7 +10870,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "halfbrown", "ref-cast", "serde", @@ -12442,7 +12442,7 @@ dependencies = [ "clap", "derive_builder", "esaxx-rs", - "getrandom 0.2.15", + "getrandom 0.2.16", "indicatif", "itertools 0.11.0", "lazy_static", @@ -12673,16 +12673,16 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", "futures-util", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "pin-project-lite", "slab", "tokio", @@ -13912,7 +13912,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "axum", @@ -13959,7 +13959,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "argon2", @@ -14068,7 +14068,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.483.1" +version = "1.483.2" dependencies = [ "base64 0.22.1", "chrono", @@ -14083,7 +14083,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.483.1" +version = "1.483.2" dependencies = [ "chrono", "serde", @@ -14096,7 +14096,7 @@ dependencies = [ [[package]] name = "windmill-autoscaling" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "serde", @@ -14110,7 +14110,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "async-stream", @@ -14174,7 +14174,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.483.1" +version = "1.483.2" dependencies = [ "regex", "serde", @@ -14188,7 +14188,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "bytes", @@ -14211,7 +14211,7 @@ dependencies = [ [[package]] name = "windmill-macros" -version = "1.483.1" +version = "1.483.2" dependencies = [ "itertools 0.14.0", "lazy_static", @@ -14223,7 +14223,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.483.1" +version = "1.483.2" dependencies = [ "convert_case 0.6.0", "serde", @@ -14232,7 +14232,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "lazy_static", @@ -14244,7 +14244,7 @@ dependencies = [ [[package]] name = "windmill-parser-csharp" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "serde_json", @@ -14256,7 +14256,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "gosyn", @@ -14268,7 +14268,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "lazy_static", @@ -14280,7 +14280,7 @@ dependencies = [ [[package]] name = "windmill-parser-java" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "serde_json", @@ -14292,7 +14292,7 @@ dependencies = [ [[package]] name = "windmill-parser-nu" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "nu-parser", @@ -14303,7 +14303,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14314,7 +14314,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "itertools 0.14.0", @@ -14325,7 +14325,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "async-recursion", @@ -14345,7 +14345,7 @@ dependencies = [ [[package]] name = "windmill-parser-rust" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -14362,7 +14362,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "lazy_static", @@ -14374,7 +14374,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "lazy_static", @@ -14392,10 +14392,10 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", - "getrandom 0.2.15", + "getrandom 0.2.16", "serde_json", "wasm-bindgen", "wasm-bindgen-test", @@ -14416,7 +14416,7 @@ dependencies = [ [[package]] name = "windmill-parser-yaml" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "serde_json", @@ -14426,7 +14426,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "async-recursion", @@ -14459,7 +14459,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.483.1" +version = "1.483.2" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -14469,7 +14469,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.483.1" +version = "1.483.2" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 52f6f39ce6..e1f4403506 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.483.1" +version = "1.483.2" authors.workspace = true edition.workspace = true @@ -32,7 +32,7 @@ members = [ ] [workspace.package] -version = "1.483.1" +version = "1.483.2" authors = ["Ruben Fiszel "] edition = "2021" diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index cd3eea2850..0dae5e223a 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.483.1 + version: 1.483.2 title: Windmill API contact: diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index ee61b90d51..96c5771001 100644 --- a/benchmarks/lib.ts +++ b/benchmarks/lib.ts @@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts"; import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts"; import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts"; -export const VERSION = "v1.483.1"; +export const VERSION = "v1.483.2"; export async function login(email: string, password: string): Promise { return await windmill.UserService.login({ diff --git a/cli/main.ts b/cli/main.ts index ab60532ce1..a5dad4a285 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -63,7 +63,7 @@ export { // } // }); -export const VERSION = "1.483.1"; +export const VERSION = "1.483.2"; const command = new Command() .name("wmill") diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2cea18aab6..3f75cdd606 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.483.1", + "version": "1.483.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.483.1", + "version": "1.483.2", "hasInstallScript": true, "license": "AGPL-3.0", "dependencies": { diff --git a/frontend/package.json b/frontend/package.json index 9ba7dd084d..49c9aab002 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.483.1", + "version": "1.483.2", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/lsp/Pipfile b/lsp/Pipfile index 572e02ad91..a261d308a7 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.483.1" -wmill_pg = ">=1.483.1" +wmill = ">=1.483.2" +wmill_pg = ">=1.483.2" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 560bcad877..1be14fd156 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.483.1 + version: 1.483.2 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index a0f2ebc8b1..9dbaba6de3 100644 --- a/powershell-client/WindmillClient/WindmillClient.psd1 +++ b/powershell-client/WindmillClient/WindmillClient.psd1 @@ -12,7 +12,7 @@ RootModule = 'WindmillClient.psm1' # Version number of this module. - ModuleVersion = '1.483.1' + ModuleVersion = '1.483.2' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index e8e8749dec..58adf9b51e 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.483.1" +version = "1.483.2" description = "A client library for accessing Windmill server wrapping the Windmill client API" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/python-client/wmill_pg/pyproject.toml b/python-client/wmill_pg/pyproject.toml index dcc137a381..1d155b23e0 100644 --- a/python-client/wmill_pg/pyproject.toml +++ b/python-client/wmill_pg/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill-pg" -version = "1.483.1" +version = "1.483.2" description = "An extension client for the wmill client library focused on pg" license = "Apache-2.0" homepage = "https://windmill.dev" diff --git a/typescript-client/jsr.json b/typescript-client/jsr.json index 532504ea0f..071d935988 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.483.1", + "version": "1.483.2", "exports": "./src/index.ts", "publish": { "exclude": ["!src", "./s3Types.ts", "./client.ts"] diff --git a/typescript-client/package.json b/typescript-client/package.json index fb6018f26b..e7c9f89a25 100644 --- a/typescript-client/package.json +++ b/typescript-client/package.json @@ -1,7 +1,7 @@ { "name": "windmill-client", "description": "Windmill SDK client for browsers and Node.js", - "version": "1.483.1", + "version": "1.483.2", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index f4f7573b1b..236eaf0673 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.483.1 +1.483.2