diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b6e5e93a0..cdc9a619c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [1.376.1](https://github.com/windmill-labs/windmill/compare/v1.376.0...v1.376.1) (2024-08-07) + + +### Bug Fixes + +* email triggers sqlx CE and improve email parsing ([#4203](https://github.com/windmill-labs/windmill/issues/4203)) ([6e9c350](https://github.com/windmill-labs/windmill/commit/6e9c350b4aa27355d03cb409da36e8f44ff548dc)) +* mysql params starting with underscore ([#4201](https://github.com/windmill-labs/windmill/issues/4201)) ([e7148f6](https://github.com/windmill-labs/windmill/commit/e7148f672303ccf2b5c49bd9d75ee9764657490e)) + +## [1.376.0](https://github.com/windmill-labs/windmill/compare/v1.375.0...v1.376.0) (2024-08-06) + + +### Features + +* email triggers ([#4163](https://github.com/windmill-labs/windmill/issues/4163)) ([a87f34f](https://github.com/windmill-labs/windmill/commit/a87f34fb4a5e54da38e2dbabf2ac551d35b021ee)) +* secure ctx variables in runnable inputs ([#4142](https://github.com/windmill-labs/windmill/issues/4142)) ([b54edf1](https://github.com/windmill-labs/windmill/commit/b54edf153ec90b9bafad9ed7bc92c29345951fe6)) +* Tag filter on Runs page ([#4193](https://github.com/windmill-labs/windmill/issues/4193)) ([7b31281](https://github.com/windmill-labs/windmill/commit/7b3128171ea7193efea569297a099bb9ee6935e1)) + + +### Bug Fixes + +* fix native scripts access to reserved variables ([7886f8f](https://github.com/windmill-labs/windmill/commit/7886f8f471bcb33f7cc640eab64ffc0dd3cb1726)) +* **frontend:** disable email triggers by default ([#4199](https://github.com/windmill-labs/windmill/issues/4199)) ([5e3a3e2](https://github.com/windmill-labs/windmill/commit/5e3a3e2103ce6218a60c570546355ef6ca574df2)) +* **frontend:** fix the app created from a script or flow with the new topbar ([#4194](https://github.com/windmill-labs/windmill/issues/4194)) ([657f03b](https://github.com/windmill-labs/windmill/commit/657f03bc67f84a8593b28483684c2ad8ad432865)) +* **frontend:** Fr/improve suspend drawer ([#4189](https://github.com/windmill-labs/windmill/issues/4189)) ([5104dba](https://github.com/windmill-labs/windmill/commit/5104dba63140e2186dc1eed7f0bf4e14e357bf3d)) +* **frontend:** Hide AgChart background to make styling work ([#4197](https://github.com/windmill-labs/windmill/issues/4197)) ([b9b30e6](https://github.com/windmill-labs/windmill/commit/b9b30e66ec485cc019561b092fc27d08aa4666b3)) +* **frontend:** Remove full height for the event handlers of runnables ([#4196](https://github.com/windmill-labs/windmill/issues/4196)) ([6749f2c](https://github.com/windmill-labs/windmill/commit/6749f2c1367bdbecb12941baaa87b63c4b4c6f20)) +* mysql support for underscore in named param ([#4200](https://github.com/windmill-labs/windmill/issues/4200)) ([cfa20ae](https://github.com/windmill-labs/windmill/commit/cfa20ae0d740014baea2e534cea5f787acaeb028)) + ## [1.375.0](https://github.com/windmill-labs/windmill/compare/v1.374.0...v1.375.0) (2024-08-05) diff --git a/backend/.sqlx/query-4e6e4ecaa7a874b07b6599b6b7b3f307eb201534aa25d8a2049d1949f4ec9e77.json b/backend/.sqlx/query-4e6e4ecaa7a874b07b6599b6b7b3f307eb201534aa25d8a2049d1949f4ec9e77.json new file mode 100644 index 0000000000..afb8a2aada --- /dev/null +++ b/backend/.sqlx/query-4e6e4ecaa7a874b07b6599b6b7b3f307eb201534aa25d8a2049d1949f4ec9e77.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT value FROM metrics WHERE id = 'email_trigger_usage' AND created_at > NOW() - INTERVAL '1 day' ORDER BY created_at DESC LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "value", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "4e6e4ecaa7a874b07b6599b6b7b3f307eb201534aa25d8a2049d1949f4ec9e77" +} diff --git a/backend/.sqlx/query-43cc4e7d9846dbce81b61a25e8ceca636a08451db3288969ed9105fa0cb4e5b8.json b/backend/.sqlx/query-a51007ca7b509b92faa6fe7aa59fa738594a2b7eaab8e38f3ca30e548f9a49a7.json similarity index 89% rename from backend/.sqlx/query-43cc4e7d9846dbce81b61a25e8ceca636a08451db3288969ed9105fa0cb4e5b8.json rename to backend/.sqlx/query-a51007ca7b509b92faa6fe7aa59fa738594a2b7eaab8e38f3ca30e548f9a49a7.json index c9e2657ddd..7e1f008dba 100644 --- a/backend/.sqlx/query-43cc4e7d9846dbce81b61a25e8ceca636a08451db3288969ed9105fa0cb4e5b8.json +++ b/backend/.sqlx/query-a51007ca7b509b92faa6fe7aa59fa738594a2b7eaab8e38f3ca30e548f9a49a7.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT worker, worker_instance, vcpus, memory, ping_at, started_at FROM worker_ping WHERE ping_at > now() - interval '30 days'", + "query": "SELECT worker, worker_instance, vcpus, memory, ping_at, started_at FROM worker_ping WHERE ping_at > now() - interval '30 days' ORDER BY started_at", "describe": { "columns": [ { @@ -46,5 +46,5 @@ false ] }, - "hash": "43cc4e7d9846dbce81b61a25e8ceca636a08451db3288969ed9105fa0cb4e5b8" + "hash": "a51007ca7b509b92faa6fe7aa59fa738594a2b7eaab8e38f3ca30e548f9a49a7" } diff --git a/backend/.sqlx/query-a7d107fbeb8749d16ea3fea091573324cd5cbae2c3b77f24027802ea3896ef26.json b/backend/.sqlx/query-a7d107fbeb8749d16ea3fea091573324cd5cbae2c3b77f24027802ea3896ef26.json new file mode 100644 index 0000000000..9e26d239af --- /dev/null +++ b/backend/.sqlx/query-a7d107fbeb8749d16ea3fea091573324cd5cbae2c3b77f24027802ea3896ef26.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO metrics (id, value) VALUES ('email_trigger_usage', to_jsonb(1))", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "a7d107fbeb8749d16ea3fea091573324cd5cbae2c3b77f24027802ea3896ef26" +} diff --git a/backend/.sqlx/query-ad8d9c00bd2d3515ad4afa87aa24b243615484bbad5a793438e23908c3f20c2f.json b/backend/.sqlx/query-ad8d9c00bd2d3515ad4afa87aa24b243615484bbad5a793438e23908c3f20c2f.json deleted file mode 100644 index 830194da26..0000000000 --- a/backend/.sqlx/query-ad8d9c00bd2d3515ad4afa87aa24b243615484bbad5a793438e23908c3f20c2f.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH active_users as (SELECT distinct username as email FROM audit WHERE timestamp > NOW() - INTERVAL '1 month' AND (operation = 'users.login' OR operation = 'oauth.login')),\n active_user_count as (SELECT count(email)::INT as count from active_users),\n active_author_count as (SELECT count(distinct email)::INT as count FROM usr WHERE usr.operator IS false AND email IN (SELECT email FROM active_users))\n SELECT active_author_count.count as author_count, active_user_count.count - active_author_count.count as operator_count FROM active_user_count, active_author_count", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "author_count", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "operator_count", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null, - null - ] - }, - "hash": "ad8d9c00bd2d3515ad4afa87aa24b243615484bbad5a793438e23908c3f20c2f" -} diff --git a/backend/.sqlx/query-cce991f582bc9d2ba28a5b2b41c679366bb07bc6a100727721a787160ac6910c.json b/backend/.sqlx/query-cce991f582bc9d2ba28a5b2b41c679366bb07bc6a100727721a787160ac6910c.json new file mode 100644 index 0000000000..f5d905a157 --- /dev/null +++ b/backend/.sqlx/query-cce991f582bc9d2ba28a5b2b41c679366bb07bc6a100727721a787160ac6910c.json @@ -0,0 +1,38 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH active_users as (SELECT distinct username as email FROM audit WHERE timestamp > NOW() - INTERVAL '1 month' AND (operation = 'users.login' OR operation = 'oauth.login')),\n active_authors as (SELECT distinct email FROM usr WHERE usr.operator IS false AND email IN (SELECT email FROM active_users)),\n active_authors_agg as (SELECT array_agg(email) as authors FROM active_authors),\n active_ops_agg as (SELECT array_agg(email) as operators from active_users WHERE email NOT IN (SELECT email FROM active_authors))\n SELECT active_authors_agg.authors, active_ops_agg.operators, array_length(active_authors_agg.authors, 1) as author_count, array_length(active_ops_agg.operators, 1) as operator_count FROM active_authors_agg, active_ops_agg", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "authors", + "type_info": "VarcharArray" + }, + { + "ordinal": 1, + "name": "operators", + "type_info": "VarcharArray" + }, + { + "ordinal": 2, + "name": "author_count", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "operator_count", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null, + null, + null, + null + ] + }, + "hash": "cce991f582bc9d2ba28a5b2b41c679366bb07bc6a100727721a787160ac6910c" +} diff --git a/backend/.sqlx/query-f4942f502ba7f66bafb0b2de6979601723de8092796f3bbeb78191c1da30d225.json b/backend/.sqlx/query-f4942f502ba7f66bafb0b2de6979601723de8092796f3bbeb78191c1da30d225.json new file mode 100644 index 0000000000..25510e4150 --- /dev/null +++ b/backend/.sqlx/query-f4942f502ba7f66bafb0b2de6979601723de8092796f3bbeb78191c1da30d225.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE metrics SET value = $1 WHERE id = 'email_trigger_usage' AND created_at > NOW() - INTERVAL '1 day'", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "f4942f502ba7f66bafb0b2de6979601723de8092796f3bbeb78191c1da30d225" +} diff --git a/backend/Cargo.lock b/backend/Cargo.lock index d9bf8090b5..032c31bb65 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -5412,9 +5412,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -7170,9 +7170,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-tokio-stream" @@ -7280,9 +7280,9 @@ checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" [[package]] name = "safetensors" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ced76b22c7fba1162f11a5a75d9d8405264b467a07ae0c9c29be119b9297db9" +checksum = "7725d4d98fa515472f43a6e2bbf956c48e06b89bb50593a040e5945160214450" dependencies = [ "serde", "serde_json", @@ -9013,15 +9013,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand 2.1.0", "once_cell", "rustix 0.38.34", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10393,7 +10393,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windmill" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "axum", @@ -10433,7 +10433,7 @@ dependencies = [ [[package]] name = "windmill-api" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "argon2", @@ -10516,7 +10516,7 @@ dependencies = [ [[package]] name = "windmill-api-client" -version = "1.375.0" +version = "1.376.1" dependencies = [ "base64 0.21.7", "chrono", @@ -10534,7 +10534,7 @@ dependencies = [ [[package]] name = "windmill-audit" -version = "1.375.0" +version = "1.376.1" dependencies = [ "chrono", "serde", @@ -10547,7 +10547,7 @@ dependencies = [ [[package]] name = "windmill-common" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "async-stream", @@ -10588,7 +10588,7 @@ dependencies = [ [[package]] name = "windmill-git-sync" -version = "1.375.0" +version = "1.376.1" dependencies = [ "regex", "rsmq_async", @@ -10603,7 +10603,7 @@ dependencies = [ [[package]] name = "windmill-indexer" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "bytes", @@ -10624,7 +10624,7 @@ dependencies = [ [[package]] name = "windmill-parser" -version = "1.375.0" +version = "1.376.1" dependencies = [ "serde", "serde_json", @@ -10632,7 +10632,7 @@ dependencies = [ [[package]] name = "windmill-parser-bash" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "lazy_static", @@ -10643,7 +10643,7 @@ dependencies = [ [[package]] name = "windmill-parser-go" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "gosyn", @@ -10655,7 +10655,7 @@ dependencies = [ [[package]] name = "windmill-parser-graphql" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "lazy_static", @@ -10666,7 +10666,7 @@ dependencies = [ [[package]] name = "windmill-parser-php" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -10680,7 +10680,7 @@ dependencies = [ [[package]] name = "windmill-parser-py" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "itertools 0.13.0", @@ -10691,7 +10691,7 @@ dependencies = [ [[package]] name = "windmill-parser-py-imports" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "async-recursion", @@ -10708,7 +10708,7 @@ dependencies = [ [[package]] name = "windmill-parser-sql" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "lazy_static", @@ -10719,7 +10719,7 @@ dependencies = [ [[package]] name = "windmill-parser-ts" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -10738,7 +10738,7 @@ dependencies = [ [[package]] name = "windmill-parser-wasm" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "getrandom 0.2.15", @@ -10757,7 +10757,7 @@ dependencies = [ [[package]] name = "windmill-queue" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "async-recursion", @@ -10790,7 +10790,7 @@ dependencies = [ [[package]] name = "windmill-sql-datatype-parser-wasm" -version = "1.375.0" +version = "1.376.1" dependencies = [ "wasm-bindgen", "wasm-bindgen-test", @@ -10800,7 +10800,7 @@ dependencies = [ [[package]] name = "windmill-worker" -version = "1.375.0" +version = "1.376.1" dependencies = [ "anyhow", "async-recursion", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index e8f53be76f..baedb4461e 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windmill" -version = "1.375.0" +version = "1.376.1" authors.workspace = true edition.workspace = true @@ -25,7 +25,7 @@ members = [ ] [workspace.package] -version = "1.375.0" +version = "1.376.1" authors = ["Ruben Fiszel "] edition = "2021" @@ -54,6 +54,7 @@ openidconnect = ["windmill-api/openidconnect"] cloud = ["windmill-queue/cloud", "windmill-worker/cloud"] jemalloc = ["windmill-common/jemalloc", "dep:tikv-jemallocator", "dep:tikv-jemalloc-sys", "dep:tikv-jemalloc-ctl"] tantivy = ["dep:windmill-indexer", "windmill-api/tantivy"] +sqlx = ["windmill-worker/sqlx"] [dependencies] anyhow.workspace = true diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index e02e4aa6a6..c9273eec97 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -70e475a5cec356d2fe992038f303aea8988b5046 \ No newline at end of file +86cfcdef47f8b740cbbdf568f7a2282984ea7460 \ No newline at end of file diff --git a/backend/parsers/windmill-parser-sql/src/lib.rs b/backend/parsers/windmill-parser-sql/src/lib.rs index c97e291648..8f22bd1faa 100644 --- a/backend/parsers/windmill-parser-sql/src/lib.rs +++ b/backend/parsers/windmill-parser-sql/src/lib.rs @@ -336,12 +336,12 @@ pub fn parse_sql_statement_named_params(code: &str, prefix: char) -> HashSet, + pub edited_by: Option, + pub edited_at: Option>, pub archived: bool, pub extra_perms: serde_json::Value, pub starred: bool, diff --git a/backend/windmill-worker/Cargo.toml b/backend/windmill-worker/Cargo.toml index 36e8bfcedd..c4e59197fe 100644 --- a/backend/windmill-worker/Cargo.toml +++ b/backend/windmill-worker/Cargo.toml @@ -17,6 +17,7 @@ flamegraph = [] parquet = ["windmill-common/parquet", "dep:object_store"] flow_testing = [] cloud = [] +sqlx = [] [dependencies] windmill-queue.workspace = true diff --git a/backend/windmill-worker/src/go_executor.rs b/backend/windmill-worker/src/go_executor.rs index 3a71170cb7..3fe964a211 100644 --- a/backend/windmill-worker/src/go_executor.rs +++ b/backend/windmill-worker/src/go_executor.rs @@ -12,7 +12,7 @@ use windmill_common::{ error::{self, Error}, jobs::QueuedJob, utils::calculate_hash, - worker::{save_cache, CLOUD_HOSTED}, + worker::save_cache, }; use windmill_parser_go::{parse_go_imports, REQUIRE_PARSE}; use windmill_queue::{append_logs, CanceledBy}; @@ -301,12 +301,6 @@ func Run(req Req) (interface{{}}, error){{ ) .await?; - if cache && *CLOUD_HOSTED { - //do not keep the binary in the cache if it is cloud hosted to avoid filling up the disk - if let Err(e) = tokio::fs::remove_file(&bin_path).await { - tracing::error!("could not remove {bin_path} from go cache: {e:?}"); - } - } read_result(job_dir).await } diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index af4b4a9234..7120510f0f 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -2278,7 +2278,7 @@ async fn handle_queued_job( return Err(Error::ExecutionErr(e.to_string())); } - #[cfg(not(feature = "enterprise"))] + #[cfg(any(not(feature = "enterprise"), feature = "sqlx"))] if job.created_by.starts_with("email-trigger-") { let daily_count = sqlx::query!( "SELECT value FROM metrics WHERE id = 'email_trigger_usage' AND created_at > NOW() - INTERVAL '1 day' ORDER BY created_at DESC LIMIT 1" diff --git a/benchmarks/lib.ts b/benchmarks/lib.ts index c629f44710..5ff1a9d861 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.375.0"; +export const VERSION = "v1.376.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 6cff625beb..fe301285d8 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -34,7 +34,7 @@ addEventListener("error", (event) => { } }); -export const VERSION = "v1.375.0"; +export const VERSION = "v1.376.1"; let command: any = new Command() .name("wmill") diff --git a/cli/script.ts b/cli/script.ts index 4e130be7ea..f1d3444749 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -166,6 +166,9 @@ export async function handleFile( platform: "node", packages: "bundle", target: "node20.15.1", + loader: { + ".node": "file", + }, }); bundleContent = out.outputFiles[0].text; if (Array.isArray(codebase.assets) && codebase.assets.length > 0) { diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2a2350d556..57eae979bf 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "windmill-components", - "version": "1.375.0", + "version": "1.376.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "windmill-components", - "version": "1.375.0", + "version": "1.376.1", "license": "AGPL-3.0", "dependencies": { "@aws-crypto/sha256-js": "^4.0.0", diff --git a/frontend/package.json b/frontend/package.json index 9d7fc279b3..c4aa8a8847 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "windmill-components", - "version": "1.375.0", + "version": "1.376.1", "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/frontend/src/lib/components/AppConnectDrawer.svelte b/frontend/src/lib/components/AppConnectDrawer.svelte index 9cbd28edbd..28cb801616 100644 --- a/frontend/src/lib/components/AppConnectDrawer.svelte +++ b/frontend/src/lib/components/AppConnectDrawer.svelte @@ -6,6 +6,8 @@ import AppConnectInner from './AppConnectInner.svelte' import DarkModeObserver from './DarkModeObserver.svelte' + let expressOAuthSetup = false + let drawer: Drawer let resourceType = '' let step = 1 @@ -16,12 +18,17 @@ let appConnectInner: AppConnectInner | undefined = undefined let rtToLoad: string | undefined = '' - export async function open(rt?: string) { + export async function open(rt?: string, express?: boolean) { + expressOAuthSetup = express ?? false rtToLoad = rt drawer.openDrawer?.() } - $: appConnectInner?.open(rtToLoad) + $: appConnectInner && onRtToLoadChange(rtToLoad) + + function onRtToLoadChange(rtToLoad: string | undefined) { + appConnectInner?.open(rtToLoad, expressOAuthSetup) + } const dispatch = createEventDispatcher() diff --git a/frontend/src/lib/components/AppConnectInner.svelte b/frontend/src/lib/components/AppConnectInner.svelte index a1556bf7fc..848fb69922 100644 --- a/frontend/src/lib/components/AppConnectInner.svelte +++ b/frontend/src/lib/components/AppConnectInner.svelte @@ -1,5 +1,5 @@ + +{#each Object.keys(components['userresourcecomponent'].initialData.configuration) as key (key)} + +{/each} + +{#each Object.keys(css ?? {}) as key (key)} + +{/each} + + +{#if render} + +
+ { + assignValue(e.detail) + }} + disabled={resolvedConfig.disabled} + resourceType={resolvedConfig.resourceType} + /> +
+
+{/if} diff --git a/frontend/src/lib/components/apps/editor/component/Component.svelte b/frontend/src/lib/components/apps/editor/component/Component.svelte index e6d04022b1..d67708e65c 100644 --- a/frontend/src/lib/components/apps/editor/component/Component.svelte +++ b/frontend/src/lib/components/apps/editor/component/Component.svelte @@ -79,6 +79,7 @@ import AppDateSelect from '../../components/inputs/AppDateSelect.svelte' import AppDisplayComponentByJobId from '../../components/display/AppRecomputeAll.svelte' import AppRecomputeAll from '../../components/display/AppRecomputeAll.svelte' + import AppUserResource from '../../components/inputs/AppUserResource.svelte' export let component: AppComponent export let selected: boolean @@ -434,6 +435,14 @@ onSelect={component.onSelect} {render} /> + {:else if component.type === 'userresourcecomponent'} + {:else if component.type === 'multiselectcomponent'} & RecomputeOthersSource & { onSelect?: string[] } +export type ResourceConnectComponent = BaseComponent<'userresourcecomponent'> & + RecomputeOthersSource & { + onSelect?: string[] + } export type MultiSelectComponent = BaseComponent<'multiselectcomponent'> export type MultiSelectComponentV2 = BaseComponent<'multiselectcomponentv2'> export type CheckboxComponent = BaseComponent<'checkboxcomponent'> & @@ -361,6 +365,7 @@ export type TypedComponent = | DateSelectComponent | JobIdDisplayComponent | RecomputeAllComponent + | ResourceConnectComponent export type AppComponent = BaseAppComponent & TypedComponent @@ -2216,7 +2221,7 @@ This is a paragraph. } }, resourceselectcomponent: { - name: 'Resource Select', + name: 'Static Resource Select', icon: List, documentationLink: `${documentationBaseUrl}/resource_select`, dims: '2:1-3:1' as AppComponentDimensions, @@ -2254,6 +2259,38 @@ This is a paragraph. } } }, + userresourcecomponent: { + name: 'User Resource Input', + icon: List, + documentationLink: `${documentationBaseUrl}/resource_select`, + dims: '2:1-3:1' as AppComponentDimensions, + customCss: { + input: { style: '' } + }, + initialData: { + verticalAlignment: 'center', + componentInput: undefined, + configuration: { + resourceType: { + type: 'static', + fieldType: 'text', + value: 'postgresql' + }, + expressOauthSetup: { + type: 'static', + fieldType: 'boolean', + value: false, + tooltip: + 'If enabled, skip some steps while adding oauth resources: No scopes to set prior to OAuth sign-in, and no path to set after OAuth sign-in' + }, + disabled: { + type: 'static', + fieldType: 'boolean', + value: false + } + } + } + }, numberinputcomponent: { name: 'Number', icon: Binary, diff --git a/frontend/src/lib/components/apps/editor/component/sets.ts b/frontend/src/lib/components/apps/editor/component/sets.ts index 9113a3d404..dc11ce9268 100644 --- a/frontend/src/lib/components/apps/editor/component/sets.ts +++ b/frontend/src/lib/components/apps/editor/component/sets.ts @@ -54,6 +54,7 @@ const inputs: ComponentSet = { 'checkboxcomponent', 'selectcomponent', 'resourceselectcomponent', + 'userresourcecomponent', 'multiselectcomponentv2', 'selecttabcomponent', 'selectstepcomponent' diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts b/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts index 29d17948ad..847075de5a 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/quickStyleProperties.ts @@ -748,6 +748,9 @@ export const quickStyleProperties: Record< resourceselectcomponent: { input: inputDefaultProps }, + userresourcecomponent: { + input: inputDefaultProps + }, verticaldividercomponent: { divider: dividerDefaultProps, container: containerDefaultProps diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte index ce49fc7578..a048a4fb20 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/EventHandlers.svelte @@ -17,6 +17,7 @@ 'formbuttoncomponent', 'checkboxcomponent', 'resourceselectcomponent', + 'userresourcecomponent', 'selectcomponent', 'tabscomponent', 'conditionalwrapper', @@ -64,7 +65,7 @@ bind:value={item.data.onToggle} /> {/if} - {#if item.data.type === 'resourceselectcomponent' || item.data.type === 'selectcomponent'} + {#if item.data.type === 'resourceselectcomponent' || item.data.type === 'selectcomponent' || item.data.type == 'userresourcecomponent'} void showToast?: (message: string, error?: boolean) => void recompute?: () => void + askNewResource?: () => void } > > diff --git a/frontend/src/lib/components/apps/utils.ts b/frontend/src/lib/components/apps/utils.ts index b0a542f5e2..76cb92ec01 100644 --- a/frontend/src/lib/components/apps/utils.ts +++ b/frontend/src/lib/components/apps/utils.ts @@ -267,6 +267,11 @@ declare function showToast(message: string, error?: boolean): void; declare async function waitJob(id: string): Promise; +/** + * ask user resource on a UserResourceComponent + */ +declare async function askNewResource(id: string): void; + ` : '' } diff --git a/frontend/src/lib/components/copilot/PredicateGen.svelte b/frontend/src/lib/components/copilot/PredicateGen.svelte index eb82d4b3d7..fb50cc11f9 100644 --- a/frontend/src/lib/components/copilot/PredicateGen.svelte +++ b/frontend/src/lib/components/copilot/PredicateGen.svelte @@ -52,7 +52,7 @@ Here's the user's request: ${instructions} You can find the details of all the steps below: ${flowDetails} -Determine for the user the javascript expression for the branching condition composed of the previous results or the flow inputs. +Determine for the user the JavaScript expression for the branching condition composed of the previous results or the flow inputs. All inputs start with either results. or flow_input. and are followed by the key of the input. Here's a summary of the available data: diff --git a/frontend/src/lib/components/details/WebhooksPanel.svelte b/frontend/src/lib/components/details/WebhooksPanel.svelte index c1722be2fa..d345fee292 100644 --- a/frontend/src/lib/components/details/WebhooksPanel.svelte +++ b/frontend/src/lib/components/details/WebhooksPanel.svelte @@ -20,6 +20,7 @@ import HighlightTheme from '../HighlightTheme.svelte' import Alert from '../common/alert/Alert.svelte' import { SettingService } from '$lib/gen' + import { base } from '$lib/base' let userSettings: UserSettings @@ -56,16 +57,16 @@ $: webhooks = isFlow ? computeFlowWebhooks(path) : computeScriptWebhooks(hash, path) function computeScriptWebhooks(hash: string | undefined, path: string) { - let base = `${$page.url.origin}/api/w/${$workspaceStore}/jobs` + let webhookBase = `${$page.url.origin}${base}/api/w/${$workspaceStore}/jobs` return { async: { - hash: `${base}/run/h/${hash}`, - path: `${base}/run/p/${path}` + hash: `${webhookBase}/run/h/${hash}`, + path: `${webhookBase}/run/p/${path}` }, sync: { - hash: `${base}/run_wait_result/h/${hash}`, - path: `${base}/run_wait_result/p/${path}`, - get_path: `${base}/run_wait_result/p/${path}` + hash: `${webhookBase}/run_wait_result/h/${hash}`, + path: `${webhookBase}/run_wait_result/p/${path}`, + get_path: `${webhookBase}/run_wait_result/p/${path}` } } } diff --git a/frontend/src/lib/components/flows/content/DynamicInputHelpBox.svelte b/frontend/src/lib/components/flows/content/DynamicInputHelpBox.svelte index 38cb462338..1f649d205a 100644 --- a/frontend/src/lib/components/flows/content/DynamicInputHelpBox.svelte +++ b/frontend/src/lib/components/flows/content/DynamicInputHelpBox.svelte @@ -27,7 +27,7 @@ role="alert" id="dynamic-input-help-box" > - Single javascript expression. The following functions and objects are available: + Single JavaScript expression. The following functions and objects are available:
  • {'results.'}: the result of step at id 'id'
  • flow_input: the object containing the flow input arguments
  • diff --git a/frontend/src/lib/components/tutorials/FlowBuilderTutorialsForLoop.svelte b/frontend/src/lib/components/tutorials/FlowBuilderTutorialsForLoop.svelte index fe3fe2ffb2..3c26131df1 100644 --- a/frontend/src/lib/components/tutorials/FlowBuilderTutorialsForLoop.svelte +++ b/frontend/src/lib/components/tutorials/FlowBuilderTutorialsForLoop.svelte @@ -88,7 +88,7 @@ popover: { title: 'Iterator expression', description: - 'The iterator expression is a javascript expression that respresents the array to iterate on. Here we will iterate on the firstname input letter by letter', + 'The iterator expression is a JavaScript expression that respresents the array to iterate on. Here we will iterate on the firstname input letter by letter', onNextClick: () => { updateFlowModuleById($flowStore, id, (module) => { if (module.value.type === 'forloopflow') { diff --git a/frontend/src/lib/navigation.ts b/frontend/src/lib/navigation.ts index 8a677e5eff..5c140a677e 100644 --- a/frontend/src/lib/navigation.ts +++ b/frontend/src/lib/navigation.ts @@ -2,7 +2,7 @@ import { goto as svelteGoto } from '$app/navigation' import { base as svelteBase } from '$app/paths' export function goto(path, options = {}) { - if (svelteBase == '') { + if (svelteBase == '' || path.startsWith('?')) { return svelteGoto(path, options) } else { const fullPath = path.startsWith(svelteBase) ? path : `${svelteBase}${path}` @@ -22,9 +22,7 @@ export async function setQuery( url.searchParams.delete(key) } - await goto( - currentHash - ? `?${url.searchParams.toString()}${currentHash}` - : `?${url.searchParams.toString()}` - ) + let searchParams = url.searchParams.toString() + + await goto(currentHash ? `?${searchParams}${currentHash}` : `?${searchParams}`) } diff --git a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte index 37e64e0268..f9cb5d4f3d 100644 --- a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte @@ -565,7 +565,7 @@ } let jobId = await JobService.runScriptByPath({ workspace: $workspaceStore!, - path: 'hub/7925/git-repo-test-read-write-windmill', + path: 'hub/8944/git-repo-test-read-write-windmill', requestBody: { repo_url_resource_path: gitSyncRepository.git_repo_resource_path.replace('$res:', '') } diff --git a/lsp/Pipfile b/lsp/Pipfile index 7924887c17..80710f4c6d 100644 --- a/lsp/Pipfile +++ b/lsp/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -wmill = ">=1.375.0" -wmill_pg = ">=1.375.0" +wmill = ">=1.376.1" +wmill_pg = ">=1.376.1" sendgrid = "*" mysql-connector-python = "*" pymongo = "*" diff --git a/openflow.openapi.yaml b/openflow.openapi.yaml index 01eeae0f75..30eeb80577 100644 --- a/openflow.openapi.yaml +++ b/openflow.openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: - version: 1.375.0 + version: 1.376.1 title: OpenFlow Spec contact: name: Ruben Fiszel diff --git a/powershell-client/WindmillClient/WindmillClient.psd1 b/powershell-client/WindmillClient/WindmillClient.psd1 index e628559e72..b286acd527 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.375.0' +ModuleVersion = '1.376.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/python-client/wmill/pyproject.toml b/python-client/wmill/pyproject.toml index ed3db69b78..a02c2100c6 100644 --- a/python-client/wmill/pyproject.toml +++ b/python-client/wmill/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wmill" -version = "1.375.0" +version = "1.376.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 48810c656e..d31c92eee6 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.375.0" +version = "1.376.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 3acba7e342..cf13daaaee 100644 --- a/typescript-client/jsr.json +++ b/typescript-client/jsr.json @@ -1,6 +1,6 @@ { "name": "@windmill/windmill", - "version": "1.375.0", + "version": "1.376.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 3919f550c6..da85c99d50 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.375.0", + "version": "1.376.1", "author": "Ruben Fiszel", "license": "Apache 2.0", "devDependencies": { diff --git a/version.txt b/version.txt index e5fd72985a..39fedcb679 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.375.0 +1.376.1