Merge remote-tracking branch 'origin/main' into di/flow-input-redesign

This commit is contained in:
Diego Imbert
2025-09-24 11:29:06 +02:00
55 changed files with 349 additions and 504 deletions
+13
View File
@@ -1,5 +1,18 @@
# Changelog
## [1.547.0](https://github.com/windmill-labs/windmill/compare/v1.546.1...v1.547.0) (2025-09-23)
### Features
* add dyn select for flow step [#6662](https://github.com/windmill-labs/windmill/issues/6662) ([b64e509](https://github.com/windmill-labs/windmill/commit/b64e509e60fadc631ccd6090654d523d08c06e35))
### Bug Fixes
* **cli:** improve result printing of the CLI ([a7cbc28](https://github.com/windmill-labs/windmill/commit/a7cbc289af1eaacbb50d53f2bcb4a14f50d420ef))
* improve scripts duplicity error in global search ([2de7134](https://github.com/windmill-labs/windmill/commit/2de7134b85d8249f661e3db34ff43c29b13fa0aa))
## [1.546.1](https://github.com/windmill-labs/windmill/compare/v1.546.0...v1.546.1) (2025-09-23)
@@ -46,11 +46,11 @@
]
},
"nullable": [
true,
true,
true,
true,
true,
false,
false,
false,
false,
false,
true,
true
]
@@ -1,23 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT hash FROM script WHERE path = $1 AND workspace_id = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "hash",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false
]
},
"hash": "16e4b1bead9fc77fd98658b8cb8cc6d6bf1df758b30e99bd661da866062ef14f"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "SELECT\n result AS \"result: sqlx::types::Json<Box<RawValue>>\",\n result_columns,\n status = 'success' AS \"success!\"\n FROM v2_job_completed\n WHERE id = $1 AND workspace_id = $2",
"query": "\n SELECT\n result AS \"result: sqlx::types::Json<Box<RawValue>>\",\n result_columns,\n status = 'success' AS \"success!\"\n FROM \n v2_job_completed\n WHERE \n id = $1 AND \n workspace_id = $2\n ",
"describe": {
"columns": [
{
@@ -31,5 +31,5 @@
null
]
},
"hash": "d6f62e25faf271876874fc09ee460313159bb6ad91227f5dec37cd28006e2add"
"hash": "79d6b757c9556cfcf0c98f52035b5f1a9036b6005764b79c415373a5d39c3211"
}
@@ -1,51 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO script (summary, description, dedicated_worker, content, workspace_id, path, hash, language, tag, created_by, lock) VALUES ('', '', true, $1, $2, $3, $4, $5, $6, $7, '') ON CONFLICT (workspace_id, hash) DO NOTHING",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Varchar",
"Varchar",
"Int8",
{
"Custom": {
"name": "script_lang",
"kind": {
"Enum": [
"python3",
"deno",
"go",
"bash",
"postgresql",
"nativets",
"bun",
"mysql",
"bigquery",
"snowflake",
"graphql",
"powershell",
"mssql",
"php",
"bunnative",
"rust",
"ansible",
"csharp",
"oracledb",
"nu",
"java",
"duckdb",
"ruby"
]
}
}
},
"Varchar",
"Varchar"
]
},
"nullable": []
},
"hash": "804fc11e35f4afc0db194b6fe2594f91df7e588d4d2431bc85f4d8734920c8bf"
}
@@ -1,16 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO v2_job_queue (id, workspace_id, scheduled_for, tag) SELECT unnest($1::uuid[]), $2, now(), $3",
"describe": {
"columns": [],
"parameters": {
"Left": [
"UuidArray",
"Varchar",
"Varchar"
]
},
"nullable": []
},
"hash": "85705fc3d7f8ba5f1b12d5fb222c38fc64deb1226aab9dc3bc4465324fce37d1"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO websocket_trigger (\n workspace_id,\n path,\n url,\n script_path,\n is_flow,\n enabled,\n filters,\n initial_messages,\n url_runnable_args,\n edited_by,\n can_return_message,\n email,\n edited_at,\n error_handler_path,\n error_handler_args,\n retry\n ) VALUES (\n $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, now(), $13, $14, $15\n )\n ",
"query": "\n INSERT INTO websocket_trigger (\n workspace_id,\n path,\n url,\n script_path,\n is_flow,\n enabled,\n filters,\n initial_messages,\n url_runnable_args,\n edited_by,\n can_return_message,\n can_return_error_result,\n email,\n edited_at,\n error_handler_path,\n error_handler_args,\n retry\n ) VALUES (\n $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, now(), $14, $15, $16\n )\n ",
"describe": {
"columns": [],
"parameters": {
@@ -16,6 +16,7 @@
"Jsonb",
"Varchar",
"Bool",
"Bool",
"Varchar",
"Varchar",
"Jsonb",
@@ -24,5 +25,5 @@
},
"nullable": []
},
"hash": "23eb4d45bf2df21e22fc6c9590b96b0a7dbdd27f85c7d886eded79b3af83731a"
"hash": "9ebf262393fc4a29e8f09b304dd99e786fe78dd21721e8f54dc943dd571a7e08"
}
@@ -1,15 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO v2_job_status (id, flow_status) SELECT unnest($1::uuid[]), $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"UuidArray",
"Jsonb"
]
},
"nullable": []
},
"hash": "a0b3e10e077d30c1da135dff9feca3761d400391f1f46a8294da3e6c9af63887"
}
@@ -1,89 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO v2_job (id, runnable_id, runnable_path, kind, script_lang, tag, created_by, permissioned_as, permissioned_as_email, workspace_id, raw_flow) (SELECT gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10 FROM generate_series(1, 1)) RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Int8",
"Varchar",
{
"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",
"aiagent"
]
}
}
},
{
"Custom": {
"name": "script_lang",
"kind": {
"Enum": [
"python3",
"deno",
"go",
"bash",
"postgresql",
"nativets",
"bun",
"mysql",
"bigquery",
"snowflake",
"graphql",
"powershell",
"mssql",
"php",
"bunnative",
"rust",
"ansible",
"csharp",
"oracledb",
"nu",
"java",
"duckdb",
"ruby"
]
}
}
},
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Jsonb"
]
},
"nullable": [
false
]
},
"hash": "ab04cda71f8e2be9acbecabe1ee5ef756b8e5c1955fbe111df9ee171dc262338"
}
@@ -18,8 +18,8 @@
"Left": []
},
"nullable": [
true,
false
false,
true
]
},
"hash": "b3dbdfb50ee8118bdaed3164b210cb549a34b96554ae1872355b90304f5dcb76"
@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO v2_job_runtime (id) SELECT unnest($1::uuid[])",
"describe": {
"columns": [],
"parameters": {
"Left": [
"UuidArray"
]
},
"nullable": []
},
"hash": "b4a9abcb38997587b28655b0f4a212a5bd4039b57fab20b163617e33a4c9dd46"
}
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE \n websocket_trigger\n SET\n url = $1,\n script_path = $2,\n path = $3,\n is_flow = $4,\n filters = $5,\n initial_messages = $6,\n url_runnable_args = $7,\n edited_by = $8,\n email = $9,\n can_return_message = $10,\n edited_at = now(),\n server_id = NULL,\n error = NULL,\n error_handler_path = $13,\n error_handler_args = $14,\n retry = $15\n WHERE\n workspace_id = $11 AND path = $12\n ",
"query": "\n UPDATE \n websocket_trigger\n SET\n url = $1,\n script_path = $2,\n path = $3,\n is_flow = $4,\n filters = $5,\n initial_messages = $6,\n url_runnable_args = $7,\n edited_by = $8,\n email = $9,\n can_return_message = $10,\n can_return_error_result = $11,\n edited_at = now(),\n server_id = NULL,\n error = NULL,\n error_handler_path = $14,\n error_handler_args = $15,\n retry = $16\n WHERE\n workspace_id = $12 AND path = $13\n ",
"describe": {
"columns": [],
"parameters": {
@@ -15,6 +15,7 @@
"Varchar",
"Varchar",
"Bool",
"Bool",
"Text",
"Text",
"Varchar",
@@ -24,5 +25,5 @@
},
"nullable": []
},
"hash": "35b211d19e53da4b64b0bd097284de3236ab939e47a1fc2b15ffc9607b552f8d"
"hash": "b5f6870444fc97d8beab3cf61c91e58936138d80a97b423c17338ba069b6a3aa"
}
@@ -1,89 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO v2_job (id, runnable_id, runnable_path, kind, script_lang, tag, created_by, permissioned_as, permissioned_as_email, workspace_id) (SELECT gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9 FROM generate_series(1, $10)) RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Int8",
"Varchar",
{
"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",
"aiagent"
]
}
}
},
{
"Custom": {
"name": "script_lang",
"kind": {
"Enum": [
"python3",
"deno",
"go",
"bash",
"postgresql",
"nativets",
"bun",
"mysql",
"bigquery",
"snowflake",
"graphql",
"powershell",
"mssql",
"php",
"bunnative",
"rust",
"ansible",
"csharp",
"oracledb",
"nu",
"java",
"duckdb",
"ruby"
]
}
}
},
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Varchar",
"Int4"
]
},
"nullable": [
false
]
},
"hash": "ff0403790674cdb07022af71c2377afbd8b3a660b3be27514b517c077c63c238"
}
+33 -61
View File
@@ -5812,20 +5812,6 @@ dependencies = [
"seq-macro",
]
[[package]]
name = "generator"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
dependencies = [
"cc",
"cfg-if",
"libc",
"log",
"rustversion",
"windows 0.61.3",
]
[[package]]
name = "generic-array"
version = "0.14.7"
@@ -7582,9 +7568,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.175"
version = "0.2.176"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
[[package]]
name = "libffi"
@@ -7762,19 +7748,6 @@ dependencies = [
"prost-types",
]
[[package]]
name = "loom"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
dependencies = [
"cfg-if",
"generator",
"scoped-tls",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "lru"
version = "0.12.5"
@@ -8199,20 +8172,19 @@ dependencies = [
[[package]]
name = "moka"
version = "0.12.10"
version = "0.12.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926"
checksum = "8261cd88c312e0004c1d51baad2980c66528dfdb2bee62003e643a4d8f86b077"
dependencies = [
"crossbeam-channel",
"crossbeam-epoch",
"crossbeam-utils",
"loom",
"equivalent",
"parking_lot 0.12.4",
"portable-atomic",
"rustc_version 0.4.1",
"smallvec",
"tagptr",
"thiserror 1.0.69",
"uuid",
]
@@ -15135,7 +15107,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windmill"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"aws-sdk-config",
@@ -15195,7 +15167,7 @@ dependencies = [
[[package]]
name = "windmill-api"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"argon2",
@@ -15315,7 +15287,7 @@ dependencies = [
[[package]]
name = "windmill-api-client"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"base64 0.22.1",
"chrono",
@@ -15330,7 +15302,7 @@ dependencies = [
[[package]]
name = "windmill-audit"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"chrono",
"serde",
@@ -15343,7 +15315,7 @@ dependencies = [
[[package]]
name = "windmill-autoscaling"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"axum",
@@ -15362,7 +15334,7 @@ dependencies = [
[[package]]
name = "windmill-common"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"async-recursion",
@@ -15446,7 +15418,7 @@ dependencies = [
[[package]]
name = "windmill-git-sync"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"regex",
"serde",
@@ -15461,7 +15433,7 @@ dependencies = [
[[package]]
name = "windmill-indexer"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"bytes",
@@ -15485,7 +15457,7 @@ dependencies = [
[[package]]
name = "windmill-macros"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"itertools 0.14.0",
"lazy_static",
@@ -15497,7 +15469,7 @@ dependencies = [
[[package]]
name = "windmill-parser"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"convert_case 0.6.0",
"serde",
@@ -15506,7 +15478,7 @@ dependencies = [
[[package]]
name = "windmill-parser-bash"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"lazy_static",
@@ -15518,7 +15490,7 @@ dependencies = [
[[package]]
name = "windmill-parser-csharp"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"serde_json",
@@ -15530,7 +15502,7 @@ dependencies = [
[[package]]
name = "windmill-parser-go"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"gosyn",
@@ -15542,7 +15514,7 @@ dependencies = [
[[package]]
name = "windmill-parser-graphql"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"lazy_static",
@@ -15554,7 +15526,7 @@ dependencies = [
[[package]]
name = "windmill-parser-java"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"serde_json",
@@ -15566,7 +15538,7 @@ dependencies = [
[[package]]
name = "windmill-parser-nu"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"nu-parser",
@@ -15577,7 +15549,7 @@ dependencies = [
[[package]]
name = "windmill-parser-php"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"itertools 0.14.0",
@@ -15588,7 +15560,7 @@ dependencies = [
[[package]]
name = "windmill-parser-py"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"itertools 0.14.0",
@@ -15600,7 +15572,7 @@ dependencies = [
[[package]]
name = "windmill-parser-py-imports"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"async-recursion",
@@ -15623,7 +15595,7 @@ dependencies = [
[[package]]
name = "windmill-parser-ruby"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"lazy_static",
@@ -15637,7 +15609,7 @@ dependencies = [
[[package]]
name = "windmill-parser-rust"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"convert_case 0.6.0",
@@ -15654,7 +15626,7 @@ dependencies = [
[[package]]
name = "windmill-parser-sql"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"lazy_static",
@@ -15668,7 +15640,7 @@ dependencies = [
[[package]]
name = "windmill-parser-ts"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"lazy_static",
@@ -15686,7 +15658,7 @@ dependencies = [
[[package]]
name = "windmill-parser-wasm"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"getrandom 0.2.16",
@@ -15711,7 +15683,7 @@ dependencies = [
[[package]]
name = "windmill-parser-yaml"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"serde_json",
@@ -15721,7 +15693,7 @@ dependencies = [
[[package]]
name = "windmill-queue"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"async-recursion",
@@ -15754,7 +15726,7 @@ dependencies = [
[[package]]
name = "windmill-sql-datatype-parser-wasm"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"wasm-bindgen",
"wasm-bindgen-test",
@@ -15764,7 +15736,7 @@ dependencies = [
[[package]]
name = "windmill-worker"
version = "1.546.1"
version = "1.547.0"
dependencies = [
"anyhow",
"async-once-cell",
+2 -2
View File
@@ -1,6 +1,6 @@
[package]
name = "windmill"
version = "1.546.1"
version = "1.547.0"
authors.workspace = true
edition.workspace = true
@@ -34,7 +34,7 @@ members = [
exclude = ["./windmill-duckdb-ffi-internal"]
[workspace.package]
version = "1.546.1"
version = "1.547.0"
authors = ["Ruben Fiszel <ruben@windmill.dev>"]
edition = "2021"
@@ -0,0 +1,2 @@
-- Add down migration script here
ALTER TABLE websocket_trigger DROP COLUMN can_return_error_result;
@@ -0,0 +1,2 @@
-- Add up migration script here
ALTER TABLE websocket_trigger ADD COLUMN can_return_error_result BOOLEAN NOT NULL DEFAULT FALSE;
+10 -1
View File
@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.546.1
version: 1.547.0
title: Windmill API
contact:
@@ -16426,6 +16426,8 @@ components:
$ref: "#/components/schemas/ScriptArgs"
can_return_message:
type: boolean
can_return_error_result:
type: boolean
error_handler_path:
type: string
error_handler_args:
@@ -16438,6 +16440,7 @@ components:
- enabled
- filters
- can_return_message
- can_return_error_result
NewWebsocketTrigger:
type: object
@@ -16471,6 +16474,8 @@ components:
$ref: "#/components/schemas/ScriptArgs"
can_return_message:
type: boolean
can_return_error_result:
type: boolean
error_handler_path:
type: string
error_handler_args:
@@ -16485,6 +16490,7 @@ components:
- is_flow
- filters
- can_return_message
- can_return_error_result
EditWebsocketTrigger:
type: object
@@ -16516,6 +16522,8 @@ components:
$ref: "#/components/schemas/ScriptArgs"
can_return_message:
type: boolean
can_return_error_result:
type: boolean
error_handler_path:
type: string
error_handler_args:
@@ -16530,6 +16538,7 @@ components:
- is_flow
- filters
- can_return_message
- can_return_error_result
WebsocketTriggerInitialMessage:
anyOf:
- type: object
+8 -3
View File
@@ -4523,12 +4523,17 @@ pub async fn run_wait_result_internal(
if result.is_none() {
let row = sqlx::query!(
"SELECT
"
SELECT
result AS \"result: sqlx::types::Json<Box<RawValue>>\",
result_columns,
status = 'success' AS \"success!\"
FROM v2_job_completed
WHERE id = $1 AND workspace_id = $2",
FROM
v2_job_completed
WHERE
id = $1 AND
workspace_id = $2
",
uuid,
&w_id
)
@@ -623,7 +623,7 @@ pub async fn trigger_runnable_and_wait_for_raw_result(
error_handler_path: Option<&str>,
error_handler_args: Option<&sqlx::types::Json<HashMap<String, serde_json::Value>>>,
trigger_path: String,
) -> Result<Box<RawValue>> {
) -> Result<(Box<RawValue>, bool)> {
let username = authed.username.clone();
let (uuid, delete_after_use, early_return) = trigger_runnable_inner(
db,
@@ -656,6 +656,36 @@ pub async fn trigger_runnable_and_wait_for_raw_result(
delete_job_metadata_after_use(&db, uuid).await?;
}
Ok((result, success))
}
pub async fn trigger_runnable_and_wait_for_raw_result_with_error_ctx(
db: &DB,
user_db: Option<UserDB>,
authed: ApiAuthed,
workspace_id: &str,
runnable_path: &str,
is_flow: bool,
args: PushArgsOwned,
retry: Option<&sqlx::types::Json<Retry>>,
error_handler_path: Option<&str>,
error_handler_args: Option<&sqlx::types::Json<HashMap<String, serde_json::Value>>>,
trigger_path: String,
) -> Result<Box<RawValue>> {
let (result, success) = trigger_runnable_and_wait_for_raw_result(
db,
user_db,
authed,
workspace_id,
runnable_path,
is_flow,
args,
retry,
error_handler_path,
error_handler_args,
trigger_path,
).await?;
if !success {
Err(windmill_common::error::Error::internal_err(format!(
"{} {runnable_path} failed: {:?}",
@@ -40,6 +40,7 @@ impl TriggerCrud for WebsocketTrigger {
"initial_messages",
"url_runnable_args",
"can_return_message",
"can_return_error_result",
];
const IS_ALLOWED_ON_CLOUD: bool = false;
@@ -105,13 +106,14 @@ impl TriggerCrud for WebsocketTrigger {
url_runnable_args,
edited_by,
can_return_message,
can_return_error_result,
email,
edited_at,
error_handler_path,
error_handler_args,
retry
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, now(), $13, $14, $15
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, now(), $14, $15, $16
)
"#,
w_id,
@@ -128,6 +130,7 @@ impl TriggerCrud for WebsocketTrigger {
.map(|v| SqlxJson(serde_json::value::to_raw_value(&v).unwrap())) as _,
authed.username,
trigger.config.can_return_message,
trigger.config.can_return_error_result,
authed.email,
trigger.error_handling.error_handler_path,
trigger.error_handling.error_handler_args as _,
@@ -177,14 +180,15 @@ impl TriggerCrud for WebsocketTrigger {
edited_by = $8,
email = $9,
can_return_message = $10,
can_return_error_result = $11,
edited_at = now(),
server_id = NULL,
error = NULL,
error_handler_path = $13,
error_handler_args = $14,
retry = $15
error_handler_path = $14,
error_handler_args = $15,
retry = $16
WHERE
workspace_id = $11 AND path = $12
workspace_id = $12 AND path = $13
",
trigger.config.url,
trigger.base.script_path,
@@ -200,6 +204,7 @@ impl TriggerCrud for WebsocketTrigger {
&authed.username,
&authed.email,
trigger.config.can_return_message,
trigger.config.can_return_error_result,
w_id,
path,
trigger.error_handling.error_handler_path,
@@ -1,7 +1,10 @@
use super::WebsocketTrigger;
use crate::triggers::{
listener::ListeningTrigger,
trigger_helpers::{trigger_runnable, trigger_runnable_and_wait_for_raw_result, TriggerJobArgs},
trigger_helpers::{
trigger_runnable, trigger_runnable_and_wait_for_raw_result,
trigger_runnable_and_wait_for_raw_result_with_error_ctx, TriggerJobArgs,
},
websocket::WebsocketConfig,
Listener,
};
@@ -42,7 +45,7 @@ impl ListeningTrigger<WebsocketConfig> {
self.trigger_config.url_runnable_args.as_ref().map(|r| &r.0),
)?;
let result = trigger_runnable_and_wait_for_raw_result(
let result = trigger_runnable_and_wait_for_raw_result_with_error_ctx(
db,
None,
authed,
@@ -116,7 +119,7 @@ impl ListeningTrigger<WebsocketConfig> {
}
let authed = authed_o.clone().unwrap();
let result = trigger_runnable_and_wait_for_raw_result(
let result = trigger_runnable_and_wait_for_raw_result_with_error_ctx(
db,
None,
authed.clone(),
@@ -404,6 +407,7 @@ impl Listener for WebsocketTrigger {
let error_handler_path = error_handler_path.map(|s| s.to_string());
let error_handler_args = error_handler_args.cloned();
let trigger_path = path.clone();
let can_return_error_result = trigger_config.can_return_error_result;
let handle_response_f = async move {
tokio::select! {
_ = killpill_rx.recv() => {
@@ -422,7 +426,11 @@ impl Listener for WebsocketTrigger {
error_handler_args.as_ref(),
format!("websocket_trigger/{}", trigger_path),
) => {
if let Ok(result) = result.map(|r| r.get().to_owned()) {
if let Ok((result, success)) = result {
if !success && !can_return_error_result {
return;
}
let result = result.get().to_owned();
// only send the result if it's not null
if result != "null" {
tracing::info!("Sending job result to WebSocket {}", url);
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use crate::{
db::ApiAuthed,
triggers::trigger_helpers::{trigger_runnable_and_wait_for_raw_result, TriggerJobArgs},
triggers::trigger_helpers::{trigger_runnable_and_wait_for_raw_result_with_error_ctx, TriggerJobArgs},
};
use serde::{Deserialize, Serialize};
use serde_json::value::RawValue;
@@ -40,6 +40,8 @@ pub struct WebsocketConfig {
pub url_runnable_args: Option<SqlxJson<Box<RawValue>>>,
#[serde(default)]
pub can_return_message: bool,
#[serde(default)]
pub can_return_error_result: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -49,6 +51,7 @@ pub struct WebsocketConfigRequest {
initial_messages: Option<Vec<serde_json::Value>>,
url_runnable_args: Option<serde_json::Value>,
can_return_message: bool,
can_return_error_result: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -97,7 +100,7 @@ pub async fn get_url_from_runnable_value(
let args = value_to_args_hashmap(args)?;
let result = trigger_runnable_and_wait_for_raw_result(
let result = trigger_runnable_and_wait_for_raw_result_with_error_ctx(
db,
None,
authed,
@@ -2054,6 +2054,13 @@ pub async fn handle_python_reqs(
.unwrap_or(Err(anyhow!("Problem by joining handle")))
{
failed = true;
append_logs(
&job_id,
w_id,
format!("\nEnv installation failed: {:?}", e),
conn,
)
.await;
tracing::warn!(
workspace_id = %w_id,
"Env installation failed: {:?}",
+1 -1
View File
@@ -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.546.1";
export const VERSION = "v1.547.0";
export async function login(email: string, password: string): Promise<string> {
return await windmill.UserService.login({
+31 -7
View File
@@ -14,7 +14,6 @@ import { FSFSElement, elementsToMap, ignoreF } from "../sync/sync.ts";
import { Flow } from "../../../gen/types.gen.ts";
import { replaceInlineScripts } from "../../../windmill-utils-internal/src/inline-scripts/replacer.ts";
export interface FlowFile {
summary: string;
description?: string;
@@ -55,7 +54,7 @@ export async function pushFlow(
async (path: string) => await Deno.readTextFile(localPath + path),
log,
localPath,
SEP,
SEP
);
if (flow) {
@@ -191,7 +190,7 @@ async function run(
workspace: workspace.workspaceId,
id,
});
log.info(jobInfo.result ?? {});
log.info(JSON.stringify(jobInfo.result ?? {}, null, 2));
}
async function generateLocks(
@@ -201,14 +200,23 @@ async function generateLocks(
} & SyncOptions,
folder: string | undefined
) {
const useRawReqs = opts.useRawRequirements || Deno.env.get("USE_RAW_REQUIREMENTS") === "true";
const useRawReqs =
opts.useRawRequirements || Deno.env.get("USE_RAW_REQUIREMENTS") === "true";
const workspace = await resolveWorkspace(opts);
await requireLogin(opts);
opts = await mergeConfigWithConfigFile(opts);
if (folder) {
// read script metadata file
await generateFlowLockInternal(folder, false, workspace, opts, undefined, undefined, useRawReqs);
await generateFlowLockInternal(
folder,
false,
workspace,
opts,
undefined,
undefined,
useRawReqs
);
} else {
const ignore = await ignoreF(opts);
const elems = Object.keys(
@@ -229,7 +237,15 @@ async function generateLocks(
let hasAny = false;
for (const folder of elems) {
const candidate = await generateFlowLockInternal(folder, true, workspace, opts, undefined, undefined, useRawReqs);
const candidate = await generateFlowLockInternal(
folder,
true,
workspace,
opts,
undefined,
undefined,
useRawReqs
);
if (candidate) {
hasAny = true;
log.info(colors.green(`+ ${candidate}`));
@@ -251,7 +267,15 @@ async function generateLocks(
return;
}
for (const folder of elems) {
await generateFlowLockInternal(folder, false, workspace, opts,undefined, undefined, useRawReqs);
await generateFlowLockInternal(
folder,
false,
workspace,
opts,
undefined,
undefined,
useRawReqs
);
}
}
}
+21 -11
View File
@@ -29,7 +29,7 @@ import {
parseMetadataFile,
} from "../../utils/metadata.ts";
import {
LanguageWithRawReqsSupport,
LanguageWithRawReqsSupport,
ScriptLanguage,
inferContentTypeFromFilePath,
languagesWithRawReqsSupport,
@@ -114,8 +114,14 @@ export async function findResourceFile(path: string) {
if (currentBranch) {
// Add branch-specific candidates at the beginning (higher priority)
const branchSpecificJSON = specificItems.toBranchSpecificPath(contentBasePathJSON, currentBranch);
const branchSpecificYAML = specificItems.toBranchSpecificPath(contentBasePathYAML, currentBranch);
const branchSpecificJSON = specificItems.toBranchSpecificPath(
contentBasePathJSON,
currentBranch
);
const branchSpecificYAML = specificItems.toBranchSpecificPath(
contentBasePathYAML,
currentBranch
);
candidates.unshift(branchSpecificJSON, branchSpecificYAML);
}
@@ -624,7 +630,7 @@ export const exts = [
".nu",
".playbook.yml",
".java",
".rb"
".rb",
// for related places search: ADD_NEW_LANG
];
@@ -727,7 +733,7 @@ async function run(
if (opts.silent) {
console.log(result);
} else {
log.info(result);
log.info(JSON.stringify(result, null, 2));
}
break;
@@ -885,7 +891,10 @@ async function bootstrap(
);
}
export type GlobalDeps = Map<LanguageWithRawReqsSupport, Record<string, string>>;
export type GlobalDeps = Map<
LanguageWithRawReqsSupport,
Record<string, string>
>;
export async function findGlobalDeps(): Promise<GlobalDeps> {
var globalDeps: GlobalDeps = new Map();
@@ -895,9 +904,8 @@ export async function findGlobalDeps(): Promise<GlobalDeps> {
return (
!isDir &&
// Skip if the filename is not one of lockfile names
!(languagesWithRawReqsSupport.some(
lockfile =>
p.endsWith(SEP + lockfile.rrFilename))
!languagesWithRawReqsSupport.some((lockfile) =>
p.endsWith(SEP + lockfile.rrFilename)
)
);
}, els)) {
@@ -906,9 +914,11 @@ export async function findGlobalDeps(): Promise<GlobalDeps> {
// Iterate over available languages to find which lockfile
languagesWithRawReqsSupport.map((lock) => {
if (entry.path.endsWith(lock.rrFilename)){
if (entry.path.endsWith(lock.rrFilename)) {
const current = globalDeps.get(lock) ?? {};
current[entry.path.substring(0, entry.path.length - lock.rrFilename.length)] = content;
current[
entry.path.substring(0, entry.path.length - lock.rrFilename.length)
] = content;
globalDeps.set(lock, current);
}
});
+2 -2
View File
@@ -68,7 +68,7 @@ export {
// }
// });
export const VERSION = "1.546.1";
export const VERSION = "1.547.0";
export const WM_FORK_PREFIX = "wm-fork";
@@ -187,7 +187,7 @@ async function main() {
log.setup({
handlers: {
console: new log.ConsoleHandler(LOG_LEVEL, {
formatter: ({ msg }) => `${msg}`,
formatter: ({ msg }) => msg,
useColors: isWin ? false : true,
}),
},
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "windmill-components",
"version": "1.546.1",
"version": "1.547.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "windmill-components",
"version": "1.546.1",
"version": "1.547.0",
"hasInstallScript": true,
"license": "AGPL-3.0",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "windmill-components",
"version": "1.546.1",
"version": "1.547.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
@@ -9,7 +9,7 @@
<script lang="ts">
import type { Schema } from '$lib/common'
import type { InputCat } from '$lib/utils'
import type { InputCat, DynamicInput as DynamicInputTypes } from '$lib/utils'
import { createEventDispatcher, getContext, untrack } from 'svelte'
import { computeShow } from '$lib/utils'
@@ -61,6 +61,7 @@
class?: string
editor?: SimpleEditor | undefined
otherArgs?: Record<string, InputTransform>
helperScript?: DynamicInputTypes.HelperScript | undefined
}
let {
@@ -83,7 +84,8 @@
hideHelpButton = false,
class: className = '',
editor = $bindable(undefined),
otherArgs = {}
otherArgs = {},
helperScript = undefined
}: Props = $props()
let monaco: SimpleEditor | undefined = $state(undefined)
@@ -645,6 +647,7 @@
</Button>
{:else}
<ToggleButton
disabled={inputCat === 'dynamic'}
small
light
tooltip="JavaScript expression ('flow_input' or 'results')."
@@ -738,6 +741,13 @@
nullable={schema.properties[argName].nullable}
bind:title={schema.properties[argName].title}
bind:placeholder={schema.properties[argName].placeholder}
{helperScript}
otherArgs={Object.fromEntries(
Object.entries(otherArgs).map(([key, transform]) => [
key,
transform?.type === 'static' ? transform.value : transform?.expr
])
)}
>
{#snippet innerBottomSnippet()}
{#if shouldShowS3ArrayHelper}
@@ -2,7 +2,7 @@
import type { Schema } from '$lib/common'
import { VariableService, type InputTransform } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { allTrue } from '$lib/utils'
import { allTrue, type DynamicInput as DynamicInputTypes } from '$lib/utils'
import { untrack } from 'svelte'
import { Button } from './common'
import StepInputsGen from './copilot/StepInputsGen.svelte'
@@ -24,6 +24,7 @@
pickableProperties?: PickableProperties | undefined
enableAi?: boolean
class?: string
helperScript?: DynamicInputTypes.HelperScript
}
let {
@@ -36,7 +37,8 @@
noDynamicToggle = false,
pickableProperties = undefined,
enableAi = false,
class: clazz = ''
class: clazz = '',
helperScript = undefined
}: Props = $props()
let inputCheck: { [id: string]: boolean } = $state({})
@@ -116,6 +118,7 @@
{noDynamicToggle}
{pickableProperties}
{enableAi}
{helperScript}
otherArgs={Object.fromEntries(
Object.entries(args ?? {}).filter(([key]) => key !== argName)
)}
+3 -1
View File
@@ -81,13 +81,15 @@ ${Object.entries(args)
</Head>
<tbody class="divide-y w-full">
{#if args && Object.keys(args).length > 0}
{#if args && typeof args === 'object' && Object.keys(args).length > 0}
{#each Object.entries(args).sort((a, b) => a[0].localeCompare(b[0])) as [arg, value]}
<Row>
<Cell first>{arg}</Cell>
<Cell><ArgInfo {value} /></Cell>
</Row>
{/each}
{:else if args && typeof args !== 'object'}
<Row><Cell>Argument is not an object (type: {typeof args})</Cell></Row>
{:else if args}
<Row><Cell>No arguments</Cell></Row>
{:else}
@@ -21,6 +21,7 @@
import InitializeComponent from '../../helpers/InitializeComponent.svelte'
import DebouncedInput from '../../helpers/DebouncedInput.svelte'
import RunnableComponent from '../../helpers/RunnableComponent.svelte'
import { CancelablePromise } from '$lib/gen'
interface Props {
id: string
@@ -163,6 +164,8 @@
$effect(() => {
searchValue !== undefined && untrack(() => updateSearchInOutputs())
})
let ignoreFirst = true
</script>
{#each Object.keys(components['aggridinfinitecomponent'].initialData.configuration) as key (key)}
@@ -194,10 +197,17 @@
bind:result
bind:loading
bind:runnableComponent
on:recompute={() => {
console.log('recompute')
clear()
}}
preventDefaultRefresh
overrideCallback={() =>
new CancelablePromise(async (resolve) => {
if (ignoreFirst) {
ignoreFirst = false
resolve()
return
}
clear()
resolve()
})}
{render}
autoRefresh={true}
allowConcurentRequests
@@ -118,11 +118,12 @@
}
})
let keys = $derived(Object.keys(result[0] ?? []).filter((x) => x !== '__index'))
async function syncColumns() {
const gridItem = findGridItem($app, id)
if (gridItem && result) {
const keys = Object.keys(result[0] ?? {}) ?? []
const conf = gridItem.data.configuration.columnDefs as ColumnDefsConfiguration
const newColumns: WindmillColumnDef[] = keys.map((key) => ({
@@ -171,7 +172,7 @@
<div class="flex flex-col items-start gap-2">
<div class="text-xs"> No columns definition found. Columns found in data: </div>
<div class="text-sm flex flex-row gap-2">
{#each Object.keys(result[0] ?? []) as key}
{#each keys as key}
<Badge small color="dark-gray">{key}</Badge>
{/each}
</div>
@@ -32,13 +32,17 @@
color="light"
size="xs2"
btnClasses={twMerge(loading ? ' bg-blue-100 dark:bg-blue-400' : '', 'transition-all')}
on:click={() => {
on:click={(e) => {
if (buttonHover && loading) {
cancelCallbacks?.forEach((cb) => cb.cancel())
} else {
cancelCallbacks = $runnableComponents[id]?.cb?.map((cb) => cb())
}
}}
on:pointerdown={(e) => {
e.preventDefault()
e.stopPropagation()
}}
iconOnly
/>
{#snippet text()}
@@ -163,48 +163,8 @@
}
}
// $: sendUserToast('args' + JSON.stringify(runnableInputValues) + Boolean(extraQueryParams) || args)
// $: console.log(runnableInputValues)
let firstRefresh = true
// on:started={(e) => {
// console.log('started', e.detail)
// loading = true
// setJobId(e.detail)
// dispatch('started', e.detail)
// }}
// on:done={(e) => {
// lastJobId = e.detail.id
// setResult(e.detail.result, e.detail.id)
// loading = false
// dispatch('done', { id: e.detail?.id, result: e.detail?.result })
// }}
// on:cancel={(e) => {
// let jobId = e.detail
// console.debug('cancel', jobId)
// let job = $jobsById[jobId]
// if (job && job.created_at && !job.duration_ms) {
// $jobsById[jobId] = {
// ...job,
// started_at: job.started_at ?? Date.now(),
// duration_ms: Date.now() - (job.started_at ?? job.created_at)
// }
// }
// dispatch('cancel', { id: e.detail })
// }}
// on:running={(e) => {
// let jobId = e.detail
// let job = $jobsById[jobId]
// if (job && !job.started_at) {
// $jobsById[jobId] = { ...job, started_at: Date.now() }
// }
// }}
// on:doneError={(e) => {
// setResult({ error: e.detail.error }, e.detail.id)
// loading = false
// dispatch('doneError', { id: e.detail.id, result: e.detail.result })
// }}
type RunnableCallback = {
onDone?: (r: any) => void
onCancel?: () => void
@@ -91,6 +91,7 @@
onSuccess?: (result: any) => void
children?: import('svelte').Snippet
nonRenderedPlaceholder?: import('svelte').Snippet
preventDefaultRefresh?: boolean
}
let {
@@ -1,10 +1,22 @@
<script lang="ts">
import { twMerge } from 'tailwind-merge'
export let horizontal: boolean = false
export let gap: 'none' | 'sm' | 'md' | 'lg' = 'sm'
export let justify: 'start' | 'center' | 'end' | 'between' = 'start'
export let wFull = true
export let hFull = true
interface Props {
horizontal?: boolean
gap?: 'none' | 'sm' | 'md' | 'lg'
justify?: 'start' | 'center' | 'end' | 'between'
wFull?: boolean
hFull?: boolean
children?: import('svelte').Snippet
}
let {
horizontal = false,
gap = 'sm',
justify = 'start',
wFull = true,
hFull = true,
children
}: Props = $props()
const gapMap = {
none: '',
@@ -27,7 +39,7 @@
justify
]}"
>
<slot />
{@render children?.()}
</div>
{:else}
<div
@@ -39,6 +51,6 @@
justifyMap[justify]
)}
>
<slot />
{@render children?.()}
</div>
{/if}
@@ -570,6 +570,14 @@
}
extraLib={stepPropPicker.extraLib}
{enableAi}
helperScript={(flowModule?.value as RawScript).content &&
(flowModule?.value as RawScript).language
? {
source: 'inline',
code: (flowModule?.value as RawScript).content ?? '',
lang: (flowModule?.value as RawScript).language ?? 'deno'
}
: undefined}
/>
</PropPickerWrapper>
</div>
@@ -1,3 +1,7 @@
<script lang="ts" module>
let refreshCount = $state({ val: 0 })
</script>
<script lang="ts">
import { createEventDispatcher, getContext } from 'svelte'
import StepGenQuick from '$lib/components/copilot/StepGenQuick.svelte'
@@ -36,8 +40,6 @@
let width = $state(0)
let height = $state(0)
let refreshCount = $state(0)
let displayPath = $derived(width > 650 || height > 400)
</script>
@@ -67,7 +69,7 @@
{#if selectedKind != 'preprocessor' && selectedKind != 'flow'}
<ToggleHubWorkspaceQuick bind:selected={preFilter} />
{/if}
<RefreshButton {loading} on:click={() => (refreshCount += 1)} />
<RefreshButton {loading} on:click={() => (refreshCount.val += 1)} />
</div>
<div class="flex flex-row grow min-h-0">
@@ -169,7 +171,7 @@
{preFilter}
{small}
{displayPath}
{refreshCount}
refreshCount={refreshCount.val}
/>
</div>
</div>
@@ -2,7 +2,7 @@
let listHubIntegrationsCached = createCache(
({ kind }: { kind: HubScriptKind & string; refreshCount?: number }) =>
IntegrationService.listHubIntegrations({ kind }),
{ initial: { kind: 'script', refreshCount: 0 } }
{ initial: { kind: 'script', refreshCount: 0 }, invalidateMs: 1000 * 60 }
)
let listHubScriptsCached = createCache(
async ({
@@ -18,7 +18,10 @@
filter.length > 0
? await ScriptService.queryHubScripts({ text: filter, limit: 40, kind })
: ((await ScriptService.getTopHubScripts({ limit: 40, kind, app: appFilter })).asks ?? []),
{ initial: { filter: '', kind: 'script', appFilter: undefined, refreshCount: 0 } }
{
initial: { filter: '', kind: 'script', appFilter: undefined, refreshCount: 0 },
invalidateMs: 1000 * 60
}
)
</script>
@@ -67,7 +70,15 @@
apps = $bindable([]),
refreshCount = 0
}: Props = $props()
let allApps: string[] = []
let allApps: string[] = $state([])
$effect(() => {
if (filter.length > 0) {
apps = Array.from(new Set(items?.map((x) => x.app) ?? [])).sort()
} else {
apps = allApps
}
})
async function getAllApps(filterKind: typeof kind) {
try {
@@ -75,11 +86,9 @@
allApps = (await listHubIntegrationsCached({ kind: filterKind, refreshCount })).map(
(x) => x.name
)
apps = allApps
} catch (err) {
console.error('Hub is not available')
allApps = []
apps = []
hubNotAvailable = true
}
}
@@ -93,7 +102,6 @@
hubScriptsFilteredPromise.refresh()
})
$effect(() => {
// TODO: these should be derived ...
loading = hubScriptsFilteredPromise.status === 'loading'
hubNotAvailable = !!hubScriptsFilteredPromise.error
const scripts = hubScriptsFilteredPromise.value
@@ -113,11 +121,6 @@
summary: `${x.summary} (${x.app})`
})
)
if (filter.length > 0) {
apps = Array.from(new Set(mappedItems?.map((x) => x.app) ?? [])).sort()
} else {
apps = allApps
}
items = appFilter ? mappedItems.filter((x) => x.app === appFilter) : mappedItems
})
@@ -23,7 +23,8 @@
kind: 'script',
isTemplate: undefined,
refreshCount: 0
}
},
invalidateMs: 1000 * 60
}
: {}
)
@@ -52,7 +53,7 @@
let items = usePromise(
async () =>
await loadItemsCached({ workspace: $workspaceStore!, kind, isTemplate, refreshCount }),
{ loadInit: false }
{ loadInit: false, clearValueOnRefresh: false }
)
let filteredItems: (Item & { marked?: string })[] | undefined = $state(undefined)
@@ -56,6 +56,7 @@
time?: number
starred?: boolean
has_draft?: boolean
hash?: string
}
type TableScript = TableItem<Script, 'script'>
@@ -553,7 +554,7 @@
/>
{:else}
<div class="border rounded-md">
{#each (items ?? []).slice(0, nbDisplayed) as item (item.type + '/' + item.path)}
{#each (items ?? []).slice(0, nbDisplayed) as item (item.type + '/' + item.path + (item.hash ? '/' + item.hash : ''))}
<Item
{item}
on:scriptChanged={() => loadScripts(includeWithoutMain)}
@@ -92,6 +92,7 @@
let initial_messages: WebsocketTriggerInitialMessage[] = $state([])
let url_runnable_args: Record<string, any> | undefined = $state({})
let can_return_message = $state(false)
let can_return_error_result = $state(false)
let dirtyPath = $state(false)
let can_write = $state(true)
let drawerLoading = $state(true)
@@ -128,6 +129,12 @@
is_flow = itemKind === 'flow'
})
$effect(() => {
if (!can_return_message) {
can_return_error_result = false
}
})
export async function openEdit(
ePath: string,
isFlow: boolean,
@@ -183,6 +190,7 @@
url_runnable_args = defaultValues?.url_runnable_args ?? {}
dirtyPath = false
can_return_message = false
can_return_error_result = false
error_handler_path = defaultValues?.error_handler_path ?? undefined
error_handler_args = defaultValues?.error_handler_args ?? {}
retry = defaultValues?.retry ?? undefined
@@ -205,6 +213,7 @@
initial_messages = cfg?.initial_messages ?? []
url_runnable_args = cfg?.url_runnable_args
can_return_message = cfg?.can_return_message
can_return_error_result = cfg?.can_return_error_result
can_write = canWrite(path, cfg?.extra_perms, $userStore)
error_handler_path = cfg?.error_handler_path
error_handler_args = cfg?.error_handler_args ?? {}
@@ -223,6 +232,7 @@
initial_messages,
url_runnable_args,
can_return_message,
can_return_error_result,
enabled,
error_handler_path,
error_handler_args,
@@ -463,6 +473,19 @@
}}
disabled={!can_write}
/>
<Toggle
checked={can_return_error_result}
on:change={() => {
can_return_error_result = !can_return_error_result
}}
options={{
right: 'Send result on error',
rightTooltip:
'Allows the runnable result to be sent as a message to the WebSocket server if the result is a non-null error.'
}}
disabled={!can_write || !can_return_message}
/>
</Section>
<WebsocketEditorConfigSection
@@ -28,6 +28,7 @@ export async function saveWebsocketTriggerFromCfg(
initial_messages: triggerCfg.initial_messages,
url_runnable_args: triggerCfg.url_runnable_args,
can_return_message: triggerCfg.can_return_message,
can_return_error_result: triggerCfg.can_return_error_result,
...errorHandlerAndRetries
}
try {
+13 -5
View File
@@ -1587,22 +1587,30 @@ export function assert(msg: string, condition: boolean, value?: any) {
export function createCache<Keys extends Record<string, any>, T, InitialKeys extends Keys = Keys>(
compute: (keys: Keys) => T,
params?: { maxSize?: number; initial?: InitialKeys }
params?: { maxSize?: number; initial?: InitialKeys; invalidateMs?: number }
): (keys: Keys) => T {
let cache = new Map<string, T>()
let cache = new Map<string, { value: T; timestamp: number }>()
const maxSize = params?.maxSize ?? 15
if (params?.initial) {
let key = JSON.stringify(params.initial, Object.keys(params.initial).sort())
let value = compute(params.initial)
cache.set(key, value)
cache.set(key, { value, timestamp: Date.now() })
}
return (keys: Keys) => {
if (typeof params?.invalidateMs === 'number') {
for (const [key, entry] of cache.entries()) {
if (Date.now() - entry.timestamp > params.invalidateMs) {
cache.delete(key)
}
}
}
let key = JSON.stringify(keys, Object.keys(keys).sort())
if (!cache.get(key)) {
let value = compute(keys)
cache.set(key, value)
cache.set(key, { value, timestamp: Date.now() })
if (cache.size > maxSize) {
// remove the oldest entry (first inserted)
@@ -1610,6 +1618,6 @@ export function createCache<Keys extends Record<string, any>, T, InitialKeys ext
cache.delete(oldestKey)
}
}
return cache.get(key)!
return cache.get(key)!.value
}
}
+2 -2
View File
@@ -4,8 +4,8 @@ verify_ssl = true
name = "pypi"
[packages]
wmill = ">=1.546.1"
wmill_pg = ">=1.546.1"
wmill = ">=1.547.0"
wmill_pg = ">=1.547.0"
sendgrid = "*"
mysql-connector-python = "*"
pymongo = "*"
+1 -1
View File
@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.546.1
version: 1.547.0
title: OpenFlow Spec
contact:
name: Ruben Fiszel
@@ -12,7 +12,7 @@
RootModule = 'WindmillClient.psm1'
# Version number of this module.
ModuleVersion = '1.546.1'
ModuleVersion = '1.547.0'
# Supported PSEditions
# CompatiblePSEditions = @()
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill"
version = "1.546.1"
version = "1.547.0"
description = "A client library for accessing Windmill server wrapping the Windmill client API"
license = "Apache-2.0"
homepage = "https://windmill.dev"
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill-pg"
version = "1.546.1"
version = "1.547.0"
description = "An extension client for the wmill client library focused on pg"
license = "Apache-2.0"
homepage = "https://windmill.dev"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@windmill/windmill",
"version": "1.546.1",
"version": "1.547.0",
"exports": "./src/index.ts",
"publish": {
"exclude": ["!src", "./s3Types.ts", "./client.ts"]
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "windmill-client",
"description": "Windmill SDK client for browsers and Node.js",
"version": "1.546.1",
"version": "1.547.0",
"author": "Ruben Fiszel",
"license": "Apache 2.0",
"devDependencies": {
+1 -1
View File
@@ -1 +1 @@
1.546.1
1.547.0