Merge branch 'main' into fix-autosize

This commit is contained in:
Ruben Fiszel
2024-04-17 22:38:38 +02:00
committed by GitHub
102 changed files with 1115 additions and 563 deletions
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE queue SET canceled = true, canceled_by = $2, scheduled_for = now(), suspend = 0 WHERE scheduled_for < now() AND workspace_id = $1 AND schedule_path IS NULL RETURNING id, running, is_flow_step",
"query": "SELECT id, running, is_flow_step FROM queue WHERE scheduled_for < now() AND workspace_id = $1 AND schedule_path IS NULL",
"describe": {
"columns": [
{
@@ -21,8 +21,7 @@
],
"parameters": {
"Left": [
"Text",
"Varchar"
"Text"
]
},
"nullable": [
@@ -31,5 +30,5 @@
true
]
},
"hash": "18699cb0eca25b6bde05d81571dfdea8cafd0043634f61b0f652a93767c9c30a"
"hash": "caeb49629b8673c1f1c84a6e40c3e2d2c3bc3fdbde530a0a6b6fd68a22b867c3"
}
@@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE queue SET canceled = true, canceled_by = $1, scheduled_for = now(), suspend = 0 WHERE id = $2 RETURNING 1 as one",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "one",
"type_info": "Int4"
}
],
"parameters": {
"Left": [
"Varchar",
"Uuid"
]
},
"nullable": [
null
]
},
"hash": "d4fb94ee8198592c24e85d29078feb5220ab367e339510ee0e83bb7b5abfd184"
}
@@ -50,6 +50,7 @@ static PYTHON_IMPORTS_REPLACEMENT: phf::Map<&'static str, &'static str> = phf_ma
"mysql" => "mysql-connector-python",
"tenable" => "pytenable",
"ns1" => "ns1-python",
"pymsql" => "PyMySQL",
};
fn replace_import(x: String) -> String {
+38 -10
View File
@@ -5534,6 +5534,27 @@ paths:
flow_status:
$ref: "#/components/schemas/WorkflowStatusRecord"
/w/{workspace}/jobs_u/get_log_file/{path}:
get:
summary: get log file from object store
operationId: getLogFileFromStore
tags:
- job
parameters:
- $ref: "#/components/parameters/WorkspaceId"
- name: path
in: path
required: true
schema:
type: string
responses:
"200":
description: job log
content:
text/plain:
type: string
/w/{workspace}/jobs_u/get_flow_debug_info/{id}:
get:
summary: get flow debug info
@@ -8742,15 +8763,21 @@ components:
- tag
Job:
allOf:
- oneOf:
oneOf:
- allOf:
- $ref: "#/components/schemas/CompletedJob"
- type: object
properties:
type:
type: string
enum: [CompletedJob]
- allOf:
- $ref: "#/components/schemas/QueuedJob"
- type: object
properties:
type:
type: string
enum: [CompletedJob, QueuedJob]
- type: object
properties:
type:
type: string
enum: [QueuedJob]
discriminator:
propertyName: type
@@ -9736,8 +9763,8 @@ components:
type: boolean
extra_perms:
type: object
additionalProperties:
type: boolean
additionalProperties:
type: boolean
starred:
type: boolean
draft_only:
@@ -9911,7 +9938,8 @@ components:
created_at:
type: string
format: date-time
value: {}
value:
type: object
policy:
$ref: "#/components/schemas/Policy"
execution_mode:
+123 -31
View File
@@ -251,6 +251,7 @@ pub fn global_service() -> Router {
get(get_completed_job_result_maybe),
)
.route("/getupdate/:id", get(get_job_update))
.route("/get_log_file/*file_path", get(get_log_file))
.route("/queue/cancel/:id", post(cancel_job_api))
.route(
"/queue/cancel_persistent/*script_path",
@@ -1012,49 +1013,62 @@ async fn cancel_all(
) -> error::JsonResult<Vec<Uuid>> {
require_admin(authed.is_admin, &authed.username)?;
let mut jobs = sqlx::query!(
"UPDATE queue SET canceled = true, canceled_by = $2, scheduled_for = now(), suspend = 0 WHERE scheduled_for < now() AND workspace_id = $1 AND schedule_path IS NULL RETURNING id, running, is_flow_step",
let jobs = sqlx::query!(
"SELECT id, running, is_flow_step FROM queue WHERE scheduled_for < now() AND workspace_id = $1 AND schedule_path IS NULL",
w_id,
authed.username
)
.fetch_all(&db)
.await?;
let username = authed.username;
let mut uuids = vec![];
for j in jobs.iter() {
if !j.running && !j.is_flow_step.unwrap_or(false) {
let e = serde_json::json!({"message": format!("Job canceled: cancel_all by {username}"), "name": "Canceled", "reason": "cancel_all", "canceler": username});
let job_running = get_queued_job(&j.id, &w_id, &db).await?;
let r = sqlx::query!(
"UPDATE queue SET canceled = true, canceled_by = $1, scheduled_for = now(), suspend = 0 WHERE id = $2 RETURNING 1 as one",
username,
j.id,
)
.fetch_optional(&db)
.await;
if let Some(job_running) = job_running {
append_logs(
j.id,
w_id.clone(),
format!("canceled by {username}: cancel_all"),
db.clone(),
)
.await;
let add_job = add_completed_job_error(
&db,
&job_running,
job_running.mem_peak.unwrap_or(0),
Some(CanceledBy {
username: Some(username.to_string()),
reason: Some("cancel_all".to_string()),
}),
e,
rsmq.clone(),
"server",
true,
)
.await;
if let Err(e) = add_job {
tracing::error!("Failed to add canceled job: {}", e);
if r.as_ref().is_ok_and(|x| x.is_some()) {
uuids.push(j.id);
if !j.running && !j.is_flow_step.unwrap_or(false) {
let e = serde_json::json!({"message": format!("Job canceled: cancel_all by {username}"), "name": "Canceled", "reason": "cancel_all", "canceler": username});
let job_running = get_queued_job(&j.id, &w_id, &db).await?;
if let Some(job_running) = job_running {
append_logs(
j.id,
w_id.clone(),
format!("canceled by {username}: cancel_all"),
db.clone(),
)
.await;
let add_job = add_completed_job_error(
&db,
&job_running,
job_running.mem_peak.unwrap_or(0),
Some(CanceledBy {
username: Some(username.to_string()),
reason: Some("cancel_all".to_string()),
}),
e,
rsmq.clone(),
"server",
true,
)
.await;
if let Err(e) = add_job {
tracing::error!("Failed to add canceled job: {}", e);
}
}
}
} else {
tracing::error!("Failed to cancel job: {:?} {:?}", j.id, r.err());
}
}
let uuids = jobs.iter_mut().map(|j| j.id).collect::<Vec<_>>();
Ok(Json(uuids))
}
@@ -3484,6 +3498,84 @@ pub struct JobUpdate {
pub flow_status: Option<serde_json::Value>,
}
// #[cfg(all(feature = "enterprise", feature = "parquet"))]
// async fn get_logs_from_store(
// log_offset: i32,
// logs: &str,
// log_file_index: Option<Vec<String>>,
// ) -> Option<error::Result<Body>> {
// if log_offset > 0 {
// if let Some(file_index) = log_file_index {
// tracing::debug!("Getting logs from store: {file_index:?}");
// if let Some(os) = OBJECT_STORE_CACHE_SETTINGS.read().await.clone() {
// tracing::debug!("object store client present, streaming from there");
// let logs = logs.to_string();
// let stream = async_stream::stream! {
// for file_p in file_index {
// let file_p_2 = file_p.clone();
// let file = os.get(&object_store::path::Path::from(file_p)).await;
// if let Ok(file) = file {
// if let Ok(bytes) = file.bytes().await {
// yield Ok(bytes::Bytes::from(bytes)) as object_store::Result<bytes::Bytes>;
// }
// } else {
// tracing::debug!("error getting file from store: {file_p_2}: {}", file.err().unwrap());
// }
// }
// yield Ok(bytes::Bytes::from(logs))
// };
// return Some(Ok(Body::from_stream(stream)));
// } else {
// tracing::debug!("object store client not present, cannot stream logs from store");
// }
// }
// }
// return None;
// }
#[cfg(all(feature = "enterprise", feature = "parquet"))]
async fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result<Response> {
if let Some(os) = OBJECT_STORE_CACHE_SETTINGS.read().await.clone() {
let file = os
.get(&object_store::path::Path::from(format!("logs/{file_p}")))
.await;
if let Ok(file) = file {
if let Ok(bytes) = file.bytes().await {
use axum::http::header;
let res = Response::builder()
.header(header::CONTENT_TYPE, "text/plain")
.body(Body::from(bytes::Bytes::from(bytes)))
.unwrap();
return Ok(res);
} else {
return Err(error::Error::InternalErr(format!(
"Error getting bytes from file: {}",
file_p
)));
}
} else {
return Err(error::Error::NotFound(format!(
"File not found: {}",
file_p
)));
}
} else {
return Err(error::Error::InternalErr(
"Object store client not present, cannot stream logs from store".to_string(),
));
}
}
#[cfg(not(all(feature = "enterprise", feature = "parquet")))]
async fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result<Response> {
return Err(error::Error::NotFound(format!(
"Get log file is an EE feature: {}",
file_p
)));
}
async fn get_job_update(
Extension(db): Extension<DB>,
Path((w_id, job_id)): Path<(String, Uuid)>,
+10 -2
View File
@@ -645,12 +645,20 @@ async fn compact_logs(
let (excess_prev_logs, current_logs) = if extra_split {
let split_idx = nlogs
.char_indices()
.nth(excess_size_modulo)
.nth(excess_size)
.map(|(i, _)| i)
.unwrap_or(0);
let (excess_prev_logs, current_logs) = nlogs.split_at(split_idx);
// tracing::error!(
// "{:?} {:?} {} {}",
// excess_prev_logs.lines().last(),
// current_logs.lines().next(),
// split_idx,
// excess_size_modulo
// );
(excess_prev_logs, current_logs.to_string())
} else {
// tracing::error!("{:?}", nlogs.lines().last());
("", nlogs.to_string())
};
@@ -668,7 +676,7 @@ async fn compact_logs(
let mut new_current_logs = match compact_kind {
CompactLogs::NoS3 => format!("[windmill] worker {worker_name}: Logs length has exceeded a threshold\n[windmill] Previous logs have been saved to disk at {path}, add object storage in the instance settings to save it on distributed storage and allow direct download from Windmill\n"),
CompactLogs::S3 => format!("[windmill] worker {worker_name}: Logs length has exceeded a threshold\n[windmill] Previous logs have been saved to object storage at {path}\n[windmill] Download logs in expanded drawer to get full logs.\n"),
CompactLogs::S3 => format!("[windmill] Previous logs have been saved to object storage at {path}\n"),
CompactLogs::NotEE => format!("[windmill] worker {worker_name}: Logs length has exceeded a threshold\n[windmill] Previous logs have been saved to disk at {path}\n[windmill] Upgrade to EE and add object storage to save it persistentely on distributed storage and allow direct download from Windmill\n"),
};
new_current_logs.push_str(&current_logs);
+393 -111
View File
@@ -62,6 +62,7 @@
},
"devDependencies": {
"@floating-ui/core": "^1.3.1",
"@hey-api/openapi-ts": "^0.40.0",
"@playwright/test": "^1.34.3",
"@rgossiaux/svelte-headlessui": "^2.0.0",
"@sveltejs/adapter-static": "^3.0.0",
@@ -84,7 +85,6 @@
"eslint": "^8.47.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-svelte": "^2.33.1",
"openapi-typescript-codegen": "^0.25.0",
"path-browserify": "^1.0.1",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
@@ -151,18 +151,6 @@
"node": ">=6.0.0"
}
},
"node_modules/@apidevtools/json-schema-ref-parser": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
"integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==",
"dev": true,
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.6",
"call-me-maybe": "^1.0.1",
"js-yaml": "^4.1.0"
}
},
"node_modules/@aws-crypto/sha256-js": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-4.0.0.tgz",
@@ -962,6 +950,66 @@
"integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==",
"dev": true
},
"node_modules/@hey-api/openapi-ts": {
"version": "0.40.0",
"resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.40.0.tgz",
"integrity": "sha512-v2d8PkLaDq80uQdTMlDpqdj8G0uJYs8CGtfWxrC/TSbjDJcT0O0Vzd3cBepJAYKCo+v2tgKF8/HyuJkh9EkXsw==",
"dev": true,
"dependencies": {
"@apidevtools/json-schema-ref-parser": "11.5.4",
"c12": "1.10.0",
"camelcase": "8.0.0",
"commander": "12.0.0",
"handlebars": "4.7.8"
},
"bin": {
"openapi-ts": "bin/index.js"
},
"engines": {
"node": "^18.0.0 || >=20.0.0"
},
"peerDependencies": {
"typescript": "^5.x"
}
},
"node_modules/@hey-api/openapi-ts/node_modules/@apidevtools/json-schema-ref-parser": {
"version": "11.5.4",
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.5.4.tgz",
"integrity": "sha512-o2fsypTGU0WxRxbax8zQoHiIB4dyrkwYfcm8TxZ+bx9pCzcWZbQtiMqpgBvWA/nJ2TrGjK5adCLfTH8wUeU/Wg==",
"dev": true,
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.15",
"js-yaml": "^4.1.0"
},
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/philsturgeon"
}
},
"node_modules/@hey-api/openapi-ts/node_modules/camelcase": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz",
"integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==",
"dev": true,
"engines": {
"node": ">=16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@hey-api/openapi-ts/node_modules/commander": {
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz",
"integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==",
"dev": true,
"engines": {
"node": ">=18"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.11.13",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",
@@ -2193,9 +2241,9 @@
}
},
"node_modules/acorn": {
"version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
"bin": {
"acorn": "bin/acorn"
},
@@ -2593,6 +2641,26 @@
"node": "*"
}
},
"node_modules/c12": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/c12/-/c12-1.10.0.tgz",
"integrity": "sha512-0SsG7UDhoRWcuSvKWHaXmu5uNjDCDN3nkQLRL4Q42IlFy+ze58FcCoI3uPwINXinkz7ZinbhEgyzYFw9u9ZV8g==",
"dev": true,
"dependencies": {
"chokidar": "^3.6.0",
"confbox": "^0.1.3",
"defu": "^6.1.4",
"dotenv": "^16.4.5",
"giget": "^1.2.1",
"jiti": "^1.21.0",
"mlly": "^1.6.1",
"ohash": "^1.1.3",
"pathe": "^1.1.2",
"perfect-debounce": "^1.0.0",
"pkg-types": "^1.0.3",
"rc9": "^2.1.1"
}
},
"node_modules/call-bind": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz",
@@ -2606,12 +2674,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/call-me-maybe": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz",
"integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==",
"dev": true
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
@@ -2626,6 +2688,7 @@
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
"integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
"dev": true,
"peer": true,
"engines": {
"node": ">=10"
},
@@ -2808,16 +2871,10 @@
}
},
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
],
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
@@ -2830,6 +2887,9 @@
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
@@ -2838,11 +2898,20 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
"optional": true,
"devOptional": true,
"engines": {
"node": ">=10"
}
},
"node_modules/citty": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz",
"integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==",
"dev": true,
"dependencies": {
"consola": "^3.2.3"
}
},
"node_modules/clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
@@ -2907,21 +2976,27 @@
"node": ">= 0.8"
}
},
"node_modules/commander": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
"integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
"dev": true,
"engines": {
"node": ">=16"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"devOptional": true
},
"node_modules/confbox": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.6.tgz",
"integrity": "sha512-ONc4FUXne/1UBN1EuxvQ5rAjjAbo+N4IxrxWI8bzGHbd1PyrFlI/E3G23/yoJZDFBaFFxPGfI0EOq0fa4dgX7A==",
"dev": true
},
"node_modules/consola": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz",
"integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==",
"dev": true,
"engines": {
"node": "^14.18.0 || >=16.10.0"
}
},
"node_modules/console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
@@ -3480,6 +3555,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/defu": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
"dev": true
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
@@ -3502,6 +3583,12 @@
"node": ">=6"
}
},
"node_modules/destr": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz",
"integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==",
"dev": true
},
"node_modules/detect-indent": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz",
@@ -3646,6 +3733,18 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
"node_modules/dotenv": {
"version": "16.4.5",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/driver.js": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/driver.js/-/driver.js-1.3.1.tgz",
@@ -4131,6 +4230,41 @@
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
},
"node_modules/execa": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz",
"integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.3",
"get-stream": "^8.0.1",
"human-signals": "^5.0.0",
"is-stream": "^3.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^5.1.0",
"onetime": "^6.0.0",
"signal-exit": "^4.1.0",
"strip-final-newline": "^3.0.0"
},
"engines": {
"node": ">=16.17"
},
"funding": {
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
"node_modules/execa/node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -4319,25 +4453,11 @@
"url": "https://github.com/sponsors/rawify"
}
},
"node_modules/fs-extra": {
"version": "11.1.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz",
"integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=14.14"
}
},
"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==",
"optional": true,
"devOptional": true,
"dependencies": {
"minipass": "^3.0.0"
},
@@ -4349,7 +4469,7 @@
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
"optional": true,
"devOptional": true,
"dependencies": {
"yallist": "^4.0.0"
},
@@ -4444,6 +4564,37 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-stream": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz",
"integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==",
"dev": true,
"engines": {
"node": ">=16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/giget": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/giget/-/giget-1.2.3.tgz",
"integrity": "sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==",
"dev": true,
"dependencies": {
"citty": "^0.1.6",
"consola": "^3.2.3",
"defu": "^6.1.4",
"node-fetch-native": "^1.6.3",
"nypm": "^0.3.8",
"ohash": "^1.1.3",
"pathe": "^1.1.2",
"tar": "^6.2.0"
},
"bin": {
"giget": "dist/cli.mjs"
}
},
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -4781,6 +4932,15 @@
"node": ">= 6"
}
},
"node_modules/human-signals": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz",
"integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==",
"dev": true,
"engines": {
"node": ">=16.17.0"
}
},
"node_modules/humanize-ms": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
@@ -5075,6 +5235,18 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
"integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==",
"dev": true,
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -5137,19 +5309,6 @@
"dev": true,
"peer": true
},
"node_modules/json-schema-ref-parser": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
"integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==",
"deprecated": "Please switch to @apidevtools/json-schema-ref-parser",
"dev": true,
"dependencies": {
"@apidevtools/json-schema-ref-parser": "9.0.9"
},
"engines": {
"node": ">=10"
}
},
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@@ -5167,17 +5326,11 @@
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-2.0.0.tgz",
"integrity": "sha512-WRitRfs6BGq4q8gTgOy4ek7iPFXjbra0H3PmDLKm2xnZ+Gh1HUhiKGgCZkSPNULlP7mvfu6FV/mOLhCarspADQ=="
},
"node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
"node_modules/jsonc-parser": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz",
"integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==",
"dev": true
},
"node_modules/keyv": {
"version": "4.5.4",
@@ -5859,6 +6012,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
"dev": true
},
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -6435,6 +6594,18 @@
"node": ">= 0.6"
}
},
"node_modules/mimic-fn": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
"integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mimic-response": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
@@ -6504,7 +6675,7 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
"optional": true,
"devOptional": true,
"engines": {
"node": ">=8"
}
@@ -6513,7 +6684,7 @@
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
"optional": true,
"devOptional": true,
"dependencies": {
"minipass": "^3.0.0",
"yallist": "^4.0.0"
@@ -6526,7 +6697,7 @@
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
"optional": true,
"devOptional": true,
"dependencies": {
"yallist": "^4.0.0"
},
@@ -6546,6 +6717,18 @@
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mlly": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz",
"integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==",
"dev": true,
"dependencies": {
"acorn": "^8.11.3",
"pathe": "^1.1.2",
"pkg-types": "^1.0.3",
"ufo": "^1.3.2"
}
},
"node_modules/monaco-editor": {
"name": "@codingame/monaco-editor-treemended",
"version": "1.83.8",
@@ -6724,6 +6907,12 @@
}
}
},
"node_modules/node-fetch-native": {
"version": "1.6.4",
"resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz",
"integrity": "sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==",
"dev": true
},
"node_modules/node-gyp-build": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz",
@@ -6790,6 +6979,33 @@
"node": ">=0.10.0"
}
},
"node_modules/npm-run-path": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz",
"integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==",
"dev": true,
"dependencies": {
"path-key": "^4.0.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/npm-run-path/node_modules/path-key": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
"integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/npmlog": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
@@ -6819,6 +7035,25 @@
"resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz",
"integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw=="
},
"node_modules/nypm": {
"version": "0.3.8",
"resolved": "https://registry.npmjs.org/nypm/-/nypm-0.3.8.tgz",
"integrity": "sha512-IGWlC6So2xv6V4cIDmoV0SwwWx7zLG086gyqkyumteH2fIgCAM4nDVFB2iDRszDvmdSVW9xb1N+2KjQ6C7d4og==",
"dev": true,
"dependencies": {
"citty": "^0.1.6",
"consola": "^3.2.3",
"execa": "^8.0.1",
"pathe": "^1.1.2",
"ufo": "^1.4.0"
},
"bin": {
"nypm": "dist/cli.mjs"
},
"engines": {
"node": "^14.16.0 || >=16.10.0"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -6860,6 +7095,12 @@
"node": ">= 0.4"
}
},
"node_modules/ohash": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.3.tgz",
"integrity": "sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==",
"dev": true
},
"node_modules/ol": {
"version": "7.5.2",
"resolved": "https://registry.npmjs.org/ol/-/ol-7.5.2.tgz",
@@ -6895,6 +7136,21 @@
"wrappy": "1"
}
},
"node_modules/onetime": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz",
"integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==",
"dev": true,
"dependencies": {
"mimic-fn": "^4.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/openai": {
"version": "4.19.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-4.19.0.tgz",
@@ -6922,22 +7178,6 @@
"undici-types": "~5.26.4"
}
},
"node_modules/openapi-typescript-codegen": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.25.0.tgz",
"integrity": "sha512-nN/TnIcGbP58qYgwEEy5FrAAjePcYgfMaCe3tsmYyTgI3v4RR9v8os14L+LEWDvV50+CmqiyTzRkKKtJeb6Ybg==",
"dev": true,
"dependencies": {
"camelcase": "^6.3.0",
"commander": "^11.0.0",
"fs-extra": "^11.1.1",
"handlebars": "^4.7.7",
"json-schema-ref-parser": "^9.0.9"
},
"bin": {
"openapi": "bin/index.js"
}
},
"node_modules/optionator": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
@@ -7098,6 +7338,12 @@
"node": ">=8"
}
},
"node_modules/pathe": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
"integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
"dev": true
},
"node_modules/pbf": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
@@ -7122,6 +7368,12 @@
"path2d-polyfill": "^2.0.1"
}
},
"node_modules/perfect-debounce": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz",
"integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==",
"dev": true
},
"node_modules/periscopic": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
@@ -7179,6 +7431,17 @@
"node": ">= 6"
}
},
"node_modules/pkg-types": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz",
"integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==",
"dev": true,
"dependencies": {
"jsonc-parser": "^3.2.0",
"mlly": "^1.2.0",
"pathe": "^1.1.0"
}
},
"node_modules/playwright": {
"version": "1.40.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.0.tgz",
@@ -7968,6 +8231,16 @@
"quickselect": "^2.0.0"
}
},
"node_modules/rc9": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz",
"integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==",
"dev": true,
"dependencies": {
"defu": "^6.1.4",
"destr": "^2.0.3"
}
},
"node_modules/read-cache": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
@@ -8640,6 +8913,18 @@
"node": ">=8"
}
},
"node_modules/strip-final-newline": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
"integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==",
"dev": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/strip-indent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.0.0.tgz",
@@ -9424,7 +9709,7 @@
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz",
"integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
"optional": true,
"devOptional": true,
"dependencies": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
@@ -9441,7 +9726,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"optional": true,
"devOptional": true,
"bin": {
"mkdirp": "bin/cmd.js"
},
@@ -9612,6 +9897,12 @@
"node": ">=14.17"
}
},
"node_modules/ufo": {
"version": "1.5.3",
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz",
"integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==",
"dev": true
},
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
@@ -9722,15 +10013,6 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/universalify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/update-browserslist-db": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
+5 -5
View File
@@ -10,14 +10,15 @@
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
"package": "svelte-package -o package",
"generate-backend-client": "openapi --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions && sed -i '213 i \\ request.referrerPolicy = \"no-referrer\"\n' src/lib/gen/core/request.ts",
"generate-backend-client-mac": "openapi --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions",
"generate-backend-client": "openapi-ts --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions --enums javascript --format false",
"generate-backend-client-mac": "openapi-ts --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions --enums javascript",
"pretest": "tsc --incremental -p tests/tsconfig.json",
"test": "playwright test --config=tests-out/playwright.config.js",
"filter-classes": "node filterTailwindClasses.js"
},
"devDependencies": {
"@floating-ui/core": "^1.3.1",
"@hey-api/openapi-ts": "^0.40.0",
"@playwright/test": "^1.34.3",
"@rgossiaux/svelte-headlessui": "^2.0.0",
"@sveltejs/adapter-static": "^3.0.0",
@@ -40,7 +41,6 @@
"eslint": "^8.47.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-svelte": "^2.33.1",
"openapi-typescript-codegen": "^0.25.0",
"path-browserify": "^1.0.1",
"postcss": "^8.4.24",
"postcss-load-config": "^4.0.1",
@@ -114,12 +114,12 @@
"highlight.js": "^11.8.0",
"lodash": "^4.17.21",
"lucide-svelte": "^0.293.0",
"ol": "^7.4.0",
"pdfjs-dist": "^3.8.162",
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.83.5 <1.84.0",
"monaco-graphql": "^1.5.1",
"monaco-languageclient": "~7.0.1",
"ol": "^7.4.0",
"openai": "^4.3.0",
"pdfjs-dist": "^3.8.162",
"quill": "^1.3.7",
"svelte-carousel": "^1.0.25",
"svelte-chartjs": "^3.1.5",
+1 -1
View File
@@ -4,7 +4,7 @@ export type OwnerKind = 'group' | 'user' | 'folder'
export type ActionKind = 'Create' | 'Update' | 'Delete' | 'Execute'
export type SupportedLanguage = Script.language
export type SupportedLanguage = Script['language']
export interface PropertyDisplayInfo {
property: SchemaProperty
+1 -1
View File
@@ -26,7 +26,7 @@
let automateUsernameCreation = false
async function getAutomateUsernameCreationSetting() {
automateUsernameCreation =
(await SettingService.getGlobal({ key: 'automate_username_creation' })) ?? false
((await SettingService.getGlobal({ key: 'automate_username_creation' })) as any) ?? false
}
getAutomateUsernameCreationSetting()
@@ -23,14 +23,15 @@
let supabaseWizard = false
async function isSupabaseAvailable() {
supabaseWizard = (await OauthService.listOAuthConnects())['supabase_wizard'] != undefined
supabaseWizard =
((await OauthService.listOauthConnects()) ?? {})['supabase_wizard'] != undefined
}
async function loadSchema() {
if (!resourceTypeInfo) return
rawCode = '{}'
viewJsonSchema = false
try {
schema = resourceTypeInfo.schema
schema = resourceTypeInfo.schema as any
notFound = false
} catch (e) {
notFound = true
@@ -191,7 +191,7 @@
}
async function loadConnects() {
const nconnects = await OauthService.listOAuthConnects()
const nconnects = (await OauthService.listOauthConnects()) as any
if (nconnects['supabase_wizard']) {
delete nconnects['supabase_wizard']
}
@@ -517,8 +517,8 @@
])
diffDrawer.setDiff({
mode: 'simple',
original: values[0],
current: values[1],
original: values?.[0] as any,
current: values?.[1] as any,
title: 'Staging/prod <> Dev'
})
}
+6 -5
View File
@@ -5,16 +5,16 @@
import { WindmillIcon } from '$lib/components/icons'
import LogPanel from '$lib/components/scriptEditor/LogPanel.svelte'
import {
CompletedJob,
Job,
type CompletedJob,
type Job,
JobService,
OpenAPI,
Preview,
type Preview,
type OpenFlow,
type FlowModule,
WorkspaceService,
type InputTransform,
RawScript,
type RawScript,
type PathScript
} from '$lib/gen'
import { inferArgs } from '$lib/infer'
@@ -157,7 +157,7 @@
type LastEditScript = {
content: string
path: string
language: Preview.language
language: Preview['language']
lock?: string
}
@@ -399,6 +399,7 @@
if (selectedIdStore == '') {
return
}
//@ts-ignore
dfs($flowStore.value.modules, async (mod) => {
if (mod.id == selectedIdStore) {
if (
@@ -63,7 +63,7 @@
metadata['content'] = 'check content diff'
}
return {
lang: data.language ? scriptLangToEditorLang(data.language as Script.language) : undefined,
lang: data.language ? scriptLangToEditorLang(data.language as Script['language']) : undefined,
content,
metadata: orderedYamlStringify(metadata)
}
+2 -2
View File
@@ -52,7 +52,7 @@
import type { DocumentUri, MessageTransports } from 'vscode-languageclient'
import { buildWorkerDefinition } from './build_workers'
import { workspaceStore } from '$lib/stores'
import { Preview, UserService } from '$lib/gen'
import { type Preview, UserService } from '$lib/gen'
import type { Text } from 'yjs'
import { initializeMode } from 'monaco-graphql/esm/initializeMode.js'
import type { MonacoGraphQLAPI } from 'monaco-graphql/esm/api.js'
@@ -106,7 +106,7 @@
export let useWebsockets: boolean = true
export let listenEmptyChanges = false
export let small = false
export let scriptLang: Preview.language
export let scriptLang: Preview['language']
export let disabled: boolean = false
const rHash = randomHash()
+32 -27
View File
@@ -3,7 +3,7 @@
</script>
<script lang="ts">
import { ResourceService, VariableService } from '$lib/gen'
import { ResourceService, VariableService, type Script } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import type Editor from './Editor.svelte'
@@ -42,11 +42,10 @@
import ScriptGen from './copilot/ScriptGen.svelte'
import type DiffEditor from './DiffEditor.svelte'
import { getResetCode } from '$lib/script_helpers'
import type { Script } from '$lib/gen'
import CodeCompletionStatus from './copilot/CodeCompletionStatus.svelte'
import Popover from './Popover.svelte'
export let lang: SupportedLanguage
export let lang: SupportedLanguage | undefined
export let editor: Editor | undefined
export let websocketAlive: {
pyright: boolean
@@ -62,7 +61,6 @@
export let template: 'pgsql' | 'mysql' | 'script' | 'docker' | 'powershell' = 'script'
export let collabMode = false
export let collabLive = false
export let formatOnSave = false
export let collabUsers: { name: string }[] = []
export let scriptPath: string | undefined = undefined
export let diffEditor: DiffEditor | undefined = undefined
@@ -81,9 +79,13 @@
let showResourcePicker = false
let showResourceTypePicker = false
$: showContextVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang)
$: showVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang)
$: showResourcePicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang)
$: showContextVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(
lang ?? ''
)
$: showVarPicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(lang ?? '')
$: showResourcePicker = ['python3', 'bash', 'powershell', 'go', 'deno', 'bun'].includes(
lang ?? ''
)
$: showResourceTypePicker =
['typescript', 'javascript'].includes(scriptLangToEditorLang(lang)) || lang === 'python3'
@@ -156,6 +158,27 @@
return rec(schema.properties, true)
}
async function resourceTypePickCallback(name: string) {
if (!editor) return
const resourceType = await ResourceService.getResourceType({
workspace: $workspaceStore ?? 'NO_W',
path: name
})
if (lang == 'python3') {
const pySchema = pythonCompile(resourceType.schema as any)
editor.insertAtCursor(`class ${name}(TypedDict):\n${pySchema}\n`)
const code = editor.getCode()
if (!code.includes('from typing import TypedDict')) {
editor.insertAtBeginning('from typing import TypedDict\n')
}
} else {
const tsSchema = compile(resourceType.schema as any)
editor.insertAtCursor(`type ${toCamel(capitalize(name))} = ${tsSchema}\n`)
}
sendUserToast(`${name} inserted at cursor`)
}
function pythonCompile(schema: Schema) {
let res = ''
const entries = Object.entries(schema.properties)
@@ -187,7 +210,7 @@
function clearContent() {
if (editor) {
const resetCode = getResetCode(lang, kind as Script.kind, template)
const resetCode = getResetCode(lang, kind as Script['kind'], template)
editor.setCode(resetCode)
}
}
@@ -382,25 +405,7 @@
<ItemPicker
bind:this={resourceTypePicker}
pickCallback={async (_, name) => {
if (!editor) return
const resourceType = await ResourceService.getResourceType({
workspace: $workspaceStore ?? 'NO_W',
path: name
})
if (lang == 'python3') {
const pySchema = pythonCompile(resourceType.schema)
editor.insertAtCursor(`class ${name}(TypedDict):\n${pySchema}\n`)
const code = editor.getCode()
if (!code.includes('from typing import TypedDict')) {
editor.insertAtBeginning('from typing import TypedDict\n')
}
} else {
const tsSchema = compile(resourceType.schema)
editor.insertAtCursor(`type ${toCamel(capitalize(name))} = ${tsSchema}\n`)
}
sendUserToast(`${name} inserted at cursor`)
resourceTypePickCallback(name)
}}
tooltip="Resources Types are the schemas associated with a Resource. They define the structure of the data that is returned from a Resource."
documentationLink="https://www.windmill.dev/docs/core_concepts/resources_and_types"
@@ -9,7 +9,7 @@
import {
FlowService,
JobService,
Script,
type Script,
ScriptService,
WorkspaceService,
type Flow
@@ -101,8 +101,8 @@
path: p
})
if (hubScript.schema?.properties) {
schema = hubScript.schema
if ((hubScript.schema as any)?.properties) {
schema = hubScript.schema as any
} else {
await inferArgs(hubScript.language as SupportedLanguage, hubScript.content ?? '', schema)
}
@@ -201,7 +201,7 @@
<ScriptPicker
disabled={!isEditable || !$enterpriseLicense}
initialPath={customInitialScriptPath}
kinds={[Script.kind.SCRIPT, Script.kind.FAILURE]}
kinds={['script', 'failure']}
allowFlow={true}
bind:scriptPath={handlerPath}
bind:itemKind={customHandlerKind}
@@ -7,8 +7,6 @@
DraftService,
type PathScript,
ScriptService,
Script,
type HubScriptKind,
type OpenFlow,
type RawScript,
type InputTransform
@@ -83,7 +81,6 @@
})
| undefined = undefined
export let diffDrawer: DiffDrawer | undefined = undefined
export let gotoEdit: ((path: string, selected: string) => void) | undefined = undefined
const dispatch = createEventDispatcher()
@@ -529,7 +526,7 @@
$copilotModulesStore[idx].hubCompletions = scripts as {
path: string
summary: string
kind: HubScriptKind
kind: string
app: string
ask_id: number
}[]
@@ -669,7 +666,7 @@
value: {
input_transforms: {},
content: '',
language: (module.lang ?? 'bun') as Script.language,
language: module.lang ?? 'bun',
type: 'rawscript'
},
summary: module.description
@@ -789,7 +786,8 @@
const flowInputKey = expr.match(/flow_input\.([A-Za-z0-9_]+)/)?.[1]
if (
flowInputKey !== undefined &&
(!$flowStore.schema || !(flowInputKey in $flowStore.schema.properties)) // prevent overriding flow inputs
(!$flowStore.schema ||
!(flowInputKey in (($flowStore.schema.properties as any) ?? {}))) // prevent overriding flow inputs
) {
if (key in stepSchema.properties) {
copilotFlowInputs[flowInputKey] = stepSchema.properties[key]
@@ -848,7 +846,7 @@
const snakeKey = snakeCase(key)
if (
schemaProperty &&
(!$flowStore.schema || !(snakeKey in $flowStore.schema.properties)) // prevent overriding flow inputs
(!$flowStore.schema || !(snakeKey in ($flowStore.schema.properties as any) ?? {})) // prevent overriding flow inputs
) {
copilotFlowInputs[snakeKey] = schemaProperty
if (schema.required.includes(snakeKey)) {
@@ -1,5 +1,5 @@
<script lang="ts">
import { Job, JobService, type FlowModule, type RestartedFrom } from '$lib/gen'
import { type Job, JobService, type FlowModule, type RestartedFrom } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { Button } from './common'
import { createEventDispatcher, getContext } from 'svelte'
@@ -1,5 +1,5 @@
<script lang="ts">
import { Job, JobService, type Flow, type RestartedFrom, type OpenFlow } from '$lib/gen'
import { type Job, JobService, type Flow, type RestartedFrom, type OpenFlow } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { Badge, Button, Drawer, Popup } from './common'
import { createEventDispatcher, getContext } from 'svelte'
@@ -1,11 +1,11 @@
<script lang="ts">
import {
FlowStatusModule,
Job,
type FlowStatusModule,
type Job,
JobService,
type FlowStatus,
CompletedJob,
QueuedJob,
type CompletedJob,
type QueuedJob,
type FlowModuleValue
} from '$lib/gen'
import { workspaceStore } from '$lib/stores'
@@ -151,13 +151,12 @@
if ($localModuleStates) {
innerModules.forEach((mod, i) => {
if (
mod.type === FlowStatusModule.type.WAITING_FOR_EVENTS &&
$localModuleStates?.[innerModules?.[i - 1]?.id ?? '']?.type ==
FlowStatusModule.type.SUCCESS
mod.type === 'WaitingForEvents' &&
$localModuleStates?.[innerModules?.[i - 1]?.id ?? '']?.type == 'Success'
) {
setModuleState(mod.id ?? '', { type: mod.type, args: job?.args })
} else if (
mod.type === FlowStatusModule.type.WAITING_FOR_EXECUTOR &&
mod.type === 'WaitingForExecutor' &&
$localModuleStates[mod.id ?? '']?.scheduled_for == undefined
) {
JobService.getJob({
@@ -273,7 +272,7 @@
let started_at = job.started_at ? new Date(job.started_at).getTime() : undefined
if (job.type == 'QueuedJob') {
setModuleState(mod.id, {
type: FlowStatusModule.type.IN_PROGRESS,
type: 'InProgress',
job_id: job.id,
logs: job.logs,
args: job.args,
@@ -287,7 +286,7 @@
} else {
setModuleState(mod.id, {
args: job.args,
type: job['success'] ? FlowStatusModule.type.SUCCESS : FlowStatusModule.type.FAILURE,
type: job['success'] ? 'Success' : 'Failure',
logs: job.logs,
result: job['result'],
job_id: job.id,
@@ -347,7 +346,7 @@
if (jobLoaded.type == 'QueuedJob') {
setModuleState(modId, {
type: FlowStatusModule.type.IN_PROGRESS,
type: 'InProgress',
started_at,
logs: jobLoaded.logs,
job_id,
@@ -365,7 +364,7 @@
setModuleState(modId, {
started_at,
args: jobLoaded.args,
type: jobLoaded.success ? FlowStatusModule.type.SUCCESS : FlowStatusModule.type.FAILURE,
type: jobLoaded.success ? 'Success' : 'Failure',
logs: 'All jobs completed',
result: jobResults,
job_id,
@@ -492,7 +491,7 @@
logs={job.logs}
/>
</div>
{:else if job.flow_status?.modules?.[job?.flow_status?.step]?.type === FlowStatusModule.type.WAITING_FOR_EVENTS}
{:else if job.flow_status?.modules?.[job?.flow_status?.step]?.type === 'WaitingForEvents'}
<FlowStatusWaitingForEvents {workspaceId} {job} {isOwner} />
{:else if $suspendStatus && Object.keys($suspendStatus).length > 0}
<div class="flex gap-2 flex-col">
@@ -514,7 +513,7 @@
{:else if innerModules?.length > 0}
<div class="flex flex-col gap-1">
{#each innerModules as mod, i (mod.id)}
{#if mod.type == FlowStatusModule.type.IN_PROGRESS}
{#if mod.type == 'InProgress'}
{@const rawMod = job.raw_flow?.modules[i]}
<div
@@ -651,7 +650,7 @@
<div class="line w-8 h-10" />
{/if}
<li class="w-full border p-6 space-y-2 bg-blue-50/50 dark:bg-frost-900/50">
{#if [FlowStatusModule.type.IN_PROGRESS, FlowStatusModule.type.SUCCESS, FlowStatusModule.type.FAILURE].includes(mod.type)}
{#if ['InProgress', 'Success', 'Failure'].includes(mod.type)}
{#if job.raw_flow?.modules[i]?.value.type == 'flow'}
<svelte:self
globalModuleStates={[]}
@@ -811,9 +810,8 @@
workspaceId={job?.workspace_id}
jobId={node.job_id}
noBorder
loading={node.type != FlowStatusModule.type.SUCCESS &&
node.type != FlowStatusModule.type.FAILURE}
refreshLog={node.type == FlowStatusModule.type.IN_PROGRESS}
loading={node.type != 'Success' && node.type != 'Failure'}
refreshLog={node.type == 'InProgress'}
col
result={node.result}
logs={node.logs}
@@ -1,6 +1,6 @@
<script lang="ts">
import { mergeSchema } from '$lib/common'
import { Job, JobService } from '$lib/gen'
import { type Job, JobService } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { sendUserToast } from '$lib/toast'
import { X } from 'lucide-svelte'
@@ -36,10 +36,10 @@
return {}
}
lastJobId = jobId
let job_result = await JobService.getCompletedJobResult({
let job_result = (await JobService.getCompletedJobResult({
workspace: workspaceId ?? $workspaceStore ?? '',
id: jobId
})
})) as any
const args = job_result?.default_args ?? {}
description = job_result?.description
defaultValues = JSON.parse(JSON.stringify(args))
@@ -81,7 +81,7 @@
await JobService.resumeSuspendedJobPost({
workspace: workspaceId ?? $workspaceStore ?? '',
id: jobId,
requestBody: default_payload,
requestBody: default_payload as any,
resumeId,
signature,
approver
@@ -101,7 +101,7 @@
await JobService.resumeSuspendedFlowAsOwner({
workspace: workspaceId ?? $workspaceStore ?? '',
id: job?.id ?? '',
requestBody: default_payload
requestBody: default_payload as any
})
} else {
await JobService.cancelQueuedJob({
@@ -14,10 +14,10 @@
import { ClipboardCopy } from 'lucide-svelte'
export let code: string = ''
export let language: Script.language | 'frontend' | undefined
export let language: Script['language'] | 'frontend' | undefined
export let lines = false
function getLang(lang: Script.language | 'frontend' | undefined) {
function getLang(lang: Script['language'] | 'frontend' | undefined) {
switch (lang) {
case 'python3':
return python
@@ -54,7 +54,8 @@
}
initialOauths = (await SettingService.getGlobal({ key: 'oauths' })) ?? {}
requirePreexistingUserForOauth =
(await SettingService.getGlobal({ key: 'require_preexisting_user_for_oauth' })) ?? false
((await SettingService.getGlobal({ key: 'require_preexisting_user_for_oauth' })) as any) ??
false
initialRequirePreexistingUserForOauth = requirePreexistingUserForOauth
oauths = JSON.parse(JSON.stringify(initialOauths))
initialValues = Object.fromEntries(
+73 -20
View File
@@ -1,3 +1,7 @@
<script lang="ts" context="module">
const s3LogPrefix = '[windmill] Previous logs have been saved to object storage at logs/'
</script>
<script lang="ts">
import { ClipboardCopy, Download, Expand, Loader2 } from 'lucide-svelte'
import { Button, Drawer, DrawerContent } from './common'
@@ -5,6 +9,7 @@
import { workspaceStore } from '$lib/stores'
import AnsiUp from 'ansi_up'
import NoWorkerWithTagWarning from './runs/NoWorkerWithTagWarning.svelte'
import { JobService } from '$lib/gen'
export let content: string | undefined
export let isLoading: boolean
@@ -21,19 +26,37 @@
let scroll = true
let div: HTMLElement | null = null
// let downloadStartUrl: string | undefined = undefined
let LOG_INC = 10000
let LOG_LIMIT = LOG_INC
let lastJobId = jobId
let loadedFromObjectStore = ''
$: if (jobId !== lastJobId) {
lastJobId = jobId
LOG_LIMIT = LOG_INC
loadedFromObjectStore
}
$: downloadStartUrl = truncatedContent.startsWith(s3LogPrefix)
? truncatedContent.substring(s3LogPrefix.length, truncatedContent.indexOf('\n'))
: undefined
$: truncatedContent = truncateContent(content, loadedFromObjectStore, LOG_LIMIT)
function truncateContent(
jobContent: string | undefined,
loadedFromObjectStore: string,
limit: number
) {
let content = loadedFromObjectStore + jobContent ?? ''
if (content.length > limit) {
return content.substring(content.length - limit)
}
return content
}
$: truncatedContent = content
? (content.length ?? 0) > LOG_LIMIT
? content?.slice(-LOG_LIMIT)
: content
: ''
$: if (content != undefined && isLoading) {
isLoading = false
@@ -41,12 +64,37 @@
$: truncatedContent && scrollToBottom()
$: html = ansi_up.ansi_to_html(truncatedContent ?? '')
$: html = ansi_up.ansi_to_html(
downloadStartUrl
? truncatedContent.substring(truncatedContent.indexOf('\n') + 2, truncatedContent.length)
: truncatedContent
)
export function scrollToBottom() {
scroll && setTimeout(() => div?.scroll({ top: div?.scrollHeight, behavior: 'smooth' }), 100)
}
let logViewer: Drawer
async function getStoreLogs() {
scroll = false
let res = (await JobService.getLogFileFromStore({
workspace: $workspaceStore ?? '',
path: downloadStartUrl
})) as string
downloadStartUrl = undefined
LOG_LIMIT += Math.min(LOG_INC, res.length)
loadedFromObjectStore = res + loadedFromObjectStore
let newC = truncateContent(content, loadedFromObjectStore, LOG_LIMIT)
LOG_LIMIT -= newC.indexOf('\n') + 1
}
function showMoreTruncate(len: number) {
scroll = false
LOG_LIMIT += LOG_INC
console.log(LOG_INC, len, LOG_LIMIT)
let newC = truncateContent(content, loadedFromObjectStore, LOG_LIMIT)
LOG_LIMIT -= newC.indexOf('\n') + 1
}
</script>
<Drawer bind:this={logViewer} size="900px">
@@ -78,11 +126,13 @@
<div>
<pre
class="bg-surface-secondary text-secondary text-xs w-full p-2 whitespace-pre-wrap border rounded-md"
>{#if content}{#if content?.length > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... <button
on:click={() => {
scroll = false
LOG_LIMIT = LOG_LIMIT + Math.min(LOG_INC, content?.length ?? 0 - LOG_LIMIT)
}}>Show more</button
>{#if content}{@const len =
(content?.length ?? 0) +
(loadedFromObjectStore?.length ?? 0)}{#if downloadStartUrl}<button
on:click={getStoreLogs}>Show more...</button
><br
/>{:else if len > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... <button
on:click={() => showMoreTruncate(len)}>Show more</button
>
{/if}{@html html}{:else if isLoading}Waiting for job to start...{:else}No logs are available yet{/if}</pre
>
@@ -91,7 +141,10 @@
</Drawer>
<div class="relative w-full h-full {wrapperClass}">
<div bind:this={div} class="w-full h-full overflow-auto relative bg-surface-secondary">
<div
bind:this={div}
class="w-full h-full overflow-auto relative bg-surface-secondary max-h-screen"
>
<div class="sticky z-10 top-0 right-0 w-full flex flex-row-reverse justify-between text-sm">
<div class="flex gap-2 pl-0.5 bg-surface-secondary">
<div class="flex items-center">
@@ -139,14 +192,14 @@
>
{/if}
<pre class="whitespace-pre-wrap break-words {small ? '!text-2xs' : '!text-xs'} w-full p-2"
>{#if content}{#if content?.length > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... <button
on:click={() => {
scroll = false
LOG_LIMIT = LOG_LIMIT + Math.min(LOG_INC, content?.length ?? 0 - LOG_LIMIT)
}}>Show more</button
>
{/if}<span>{@html html}</span>{:else if !isLoading}<span>No logs are available yet</span
>{/if}</pre
>{#if content}{@const len =
(content?.length ?? 0) +
(loadedFromObjectStore?.length ?? 0)}{#if downloadStartUrl}<button on:click={getStoreLogs}
>Show more...</button
><br />{:else if len > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)<br
/><button on:click={() => showMoreTruncate(len)}>Show more..</button><br />{/if}<span
>{@html html}</span
>{:else if !isLoading}<span>No logs are available yet</span>{/if}</pre
>
</div>
</div>
@@ -1,6 +1,6 @@
<script lang="ts">
import type { Schema } from '$lib/common'
import { ScriptService, type FlowModule, type Job, Script, JobService } from '$lib/gen'
import { ScriptService, type FlowModule, type Job, type Script, JobService } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { getScriptByPath } from '$lib/scripts'
@@ -22,7 +22,7 @@
export let mod: FlowModule
export let schema: Schema
export let pickableProperties: PickableProperties | undefined
export let lang: Script.language
export let lang: Script['language']
export let editor: Editor | undefined
export let diffEditor: DiffEditor | undefined
export let noEditor = false
@@ -149,7 +149,7 @@
result={testJob.result}
>
<svelte:fragment slot="copilot-fix">
{#if lang && editor && diffEditor && stepArgs && testJob?.result?.error}
{#if lang && editor && diffEditor && stepArgs && typeof testJob?.result == 'object' && `error` in testJob?.result && testJob?.result.error}
<ScriptFix
error={JSON.stringify(testJob.result.error)}
{lang}
@@ -1,25 +1,25 @@
<script lang="ts">
import { FlowStatusModule } from '$lib/gen'
import type { FlowStatusModule } from '$lib/gen'
import { Badge } from './common'
import { forLater } from '$lib/forLater'
import { displayDate } from '$lib/utils'
import { Hourglass } from 'lucide-svelte'
export let type: FlowStatusModule.type
export let type: FlowStatusModule['type']
export let scheduled_for: Date | undefined
</script>
{#if type == FlowStatusModule.type.WAITING_FOR_EVENTS}
{#if type == 'WaitingForEvents'}
<span class="italic text-waiting">
<Hourglass />
Waiting to be resumed by resume events such as approvals
</span>
{:else if type == FlowStatusModule.type.WAITING_FOR_PRIOR_STEPS}
{:else if type == 'WaitingForPriorSteps'}
<span class="italic text-tertiary">
<Hourglass />
Waiting for prior steps to complete
</span>
{:else if type == FlowStatusModule.type.WAITING_FOR_EXECUTOR}
{:else if type == 'WaitingForExecutor'}
<span class="italic text-tertiary">
<Hourglass />
{#if scheduled_for && forLater(scheduled_for.toString())}
@@ -28,9 +28,9 @@
Job is waiting for an executor
{/if}
</span>
{:else if type == FlowStatusModule.type.SUCCESS}
{:else if type == 'Success'}
<Badge color="green">Success</Badge>
{:else if type == FlowStatusModule.type.FAILURE}
{:else if type == 'Failure'}
<Badge color="red">Failure</Badge>
{/if}
@@ -18,7 +18,7 @@
getRows: async function (params) {
try {
const searchCol = params.filterModel ? Object.keys(params.filterModel)?.[0] : undefined
const res = await HelpersService.loadParquetPreview({
const res = (await HelpersService.loadParquetPreview({
workspace: $workspaceStore!,
path: s3resource,
offset: params.startRow,
@@ -27,11 +27,11 @@
sortDesc: params.sortModel?.[0]?.sort == 'desc',
searchCol: searchCol,
searchTerm: searchCol ? params.filterModel?.[searchCol]?.filter : undefined
})
})) as any
const data: any[] = []
res.columns.forEach((c) => {
res?.columns?.forEach((c) => {
c.values.forEach((v, i) => {
if (data[i] == undefined) {
data.push({ __index: params.startRow + i })
@@ -52,7 +52,7 @@
description = resourceToEdit!.description ?? ''
selectedResourceType = resourceToEdit!.resource_type
loadResourceType()
args = resourceToEdit!.value
args = resourceToEdit!.value as any
can_write =
resourceToEdit.workspace_id == $workspaceStore &&
canWrite(p, resourceToEdit.extra_perms ?? {}, $userStore)
+13 -5
View File
@@ -1,6 +1,12 @@
<script lang="ts">
import { Button } from '$lib/components/common'
import { InputService, type Input, RunnableType, type CreateInput, Job } from '$lib/gen/index.js'
import {
InputService,
type Input,
type RunnableType,
type CreateInput,
type Job
} from '$lib/gen/index.js'
import { userStore, workspaceStore } from '$lib/stores.js'
import { classNames, displayDate, sendUserToast } from '$lib/utils.js'
import { createEventDispatcher } from 'svelte'
@@ -35,12 +41,14 @@
const dispatch = createEventDispatcher()
$: runnableId = scriptHash || scriptPath || flowPath || undefined
let runnableType: RunnableType | undefined = undefined
$: runnableType = scriptHash
? RunnableType.SCRIPT_HASH
? 'ScriptHash'
: scriptPath
? RunnableType.SCRIPT_PATH
? 'ScriptPath'
: flowPath
? RunnableType.FLOW_PATH
? 'FlowPath'
: undefined
async function loadInputHistory() {
@@ -66,7 +74,7 @@
const requestBody: CreateInput = {
name: 'Saved ' + displayDate(new Date()),
args
args: args as any
}
try {
@@ -14,7 +14,7 @@
import {
FlowService,
ScheduleService,
Script,
type Script,
ScriptService,
type Flow,
SettingService,
@@ -79,12 +79,12 @@
let defaultErrorHandlerMaybe = undefined
let defaultRecoveryHandlerMaybe = undefined
if ($workspaceStore) {
defaultErrorHandlerMaybe = await SettingService.getGlobal({
defaultErrorHandlerMaybe = (await SettingService.getGlobal({
key: 'default_error_handler_' + $workspaceStore!
})
defaultRecoveryHandlerMaybe = await SettingService.getGlobal({
})) as any
defaultRecoveryHandlerMaybe = (await SettingService.getGlobal({
key: 'default_recovery_handler_' + $workspaceStore!
})
})) as any
}
edit = false
@@ -498,7 +498,7 @@
<ScriptPicker
disabled={initialScriptPath != '' || !can_write}
initialPath={initialScriptPath}
kinds={[Script.kind.SCRIPT]}
kinds={['script']}
allowFlow={true}
bind:itemKind
bind:scriptPath={script_path}
@@ -1,11 +1,11 @@
<script lang="ts">
import {
DraftService,
NewScript,
Script,
type NewScript,
ScriptService,
type NewScriptWithDraft,
ScheduleService
ScheduleService,
type Script
} from '$lib/gen'
import { goto } from '$app/navigation'
import { page } from '$app/stores'
@@ -114,33 +114,33 @@
) as [string, SupportedLanguage | 'docker'][]
const scriptKindOptions: {
value: Script.kind
value: Script['kind']
title: string
Icon: any
desc?: string
documentationLink?: string
}[] = [
{
value: Script.kind.SCRIPT,
value: 'script',
title: 'Action',
Icon: Code
},
{
value: Script.kind.TRIGGER,
value: 'trigger',
title: 'Trigger',
desc: 'First module of flows to trigger them based on external changes. These kind of scripts are usually running on a schedule to periodically look for changes.',
documentationLink: 'https://www.windmill.dev/docs/flows/flow_trigger',
Icon: Rocket
},
{
value: Script.kind.APPROVAL,
value: 'approval',
title: 'Approval',
desc: 'Send notifications externally to ask for approval to continue a flow.',
documentationLink: 'https://www.windmill.dev/docs/flows/flow_approval',
Icon: CheckCircle
},
{
value: Script.kind.FAILURE,
value: 'failure',
title: 'Error Handler',
desc: 'Handle errors in flows after all retry attempts have been exhausted.',
documentationLink: 'https://www.windmill.dev/docs/flows/flow_error_handler',
@@ -168,7 +168,7 @@
function initContent(
language: SupportedLanguage,
kind: Script.kind | undefined,
kind: Script['kind'] | undefined,
template: 'pgsql' | 'mysql' | 'script' | 'docker' | 'powershell'
) {
scriptEditor?.disableCollaboration()
@@ -584,7 +584,7 @@
} else {
template = 'script'
}
let language = lang == 'docker' ? Script.language.BASH : lang
let language = lang == 'docker' ? 'bash' : lang
//
initContent(language, script.kind, template)
script.language = language
@@ -763,9 +763,9 @@
<Toggle
disabled={!$enterpriseLicense ||
isCloudHosted() ||
(script.language != Script.language.BUN &&
script.language != Script.language.PYTHON3 &&
script.language != Script.language.DENO)}
(script.language != 'bun' &&
script.language != 'python3' &&
script.language != 'deno')}
size="sm"
checked={Boolean(script.dedicated_worker)}
on:change={() => {
@@ -2,12 +2,11 @@
import { BROWSER } from 'esm-env'
import type { Schema, SupportedLanguage } from '$lib/common'
import { CompletedJob, Job, JobService } from '$lib/gen'
import { type CompletedJob, type Job, JobService, type Preview } from '$lib/gen'
import { enterpriseLicense, userStore, workspaceStore } from '$lib/stores'
import { copyToClipboard, emptySchema, sendUserToast } from '$lib/utils'
import Editor from './Editor.svelte'
import { inferArgs } from '$lib/infer'
import type { Preview } from '$lib/gen/models/Preview'
import { Pane, Splitpanes } from 'svelte-splitpanes'
import SchemaForm from './SchemaForm.svelte'
import LogPanel from './scriptEditor/LogPanel.svelte'
@@ -29,7 +28,7 @@
export let schema: Schema | any = emptySchema()
export let code: string
export let path: string | undefined
export let lang: Preview.language
export let lang: Preview['language']
export let kind: string | undefined = undefined
export let template: 'pgsql' | 'mysql' | 'script' | 'docker' | 'powershell' = 'script'
export let tag: string | undefined
@@ -1,5 +1,5 @@
<script lang="ts">
import { ScriptService, FlowService, Script, AppService } from '$lib/gen'
import { ScriptService, FlowService, type Script, AppService } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { createEventDispatcher } from 'svelte'
@@ -23,7 +23,7 @@
export let scriptPath: string | undefined = undefined
export let allowFlow = false
export let itemKind: 'script' | 'flow' | 'app' = 'script'
export let kinds: Script.kind[] = [Script.kind.SCRIPT]
export let kinds: Script['kind'][] = ['script']
export let disabled = false
export let allowRefresh = false
@@ -1,5 +1,5 @@
<script lang="ts">
import { UserService, GlobalUserInfo, SettingService } from '$lib/gen'
import { UserService, type GlobalUserInfo, SettingService } from '$lib/gen'
import TableCustom from '$lib/components/TableCustom.svelte'
import InviteGlobalUser from '$lib/components/InviteGlobalUser.svelte'
import { Button, Drawer, DrawerContent, Tab, Tabs } from '$lib/components/common'
@@ -58,7 +58,7 @@
let automateUsernameCreation = false
async function getAutomateUsernameCreationSetting() {
automateUsernameCreation =
(await SettingService.getGlobal({ key: 'automate_username_creation' })) ?? false
((await SettingService.getGlobal({ key: 'automate_username_creation' })) as any) ?? false
}
getAutomateUsernameCreationSetting()
let automateUsernameModalOpen = false
@@ -1,5 +1,5 @@
<script lang="ts">
import { CompletedJob, JobService, Preview } from '$lib/gen'
import { type CompletedJob, JobService, type Preview } from '$lib/gen'
import { Database, Loader2 } from 'lucide-svelte'
import Button from './common/button/Button.svelte'
@@ -68,7 +68,7 @@ export async function main(s3: S3) {
additionalCheck: (testResult: CompletedJob) => {
if (
testResult.success &&
(typeof testResult.result !== 'object' || !('__typename' in testResult.result))
(typeof testResult.result !== 'object' || !('__typename' in (testResult.result ?? {})))
) {
return {
...testResult,
@@ -120,7 +120,7 @@ export async function main(bucket: any) {
workspace: workspaceOverride ?? $workspaceStore!,
requestBody: {
path: `testConnection: ${resourceType}`,
language: resourceScript.lang as Preview.language,
language: resourceScript.lang as Preview['language'],
content: resourceScript.code,
args: {
[resourceScript.argName]: args
@@ -1,5 +1,5 @@
<script lang="ts">
import { Job, JobService, type FlowStatus } from '$lib/gen'
import { type Job, JobService, type FlowStatus } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { onDestroy, tick } from 'svelte'
import type { Preview } from '$lib/gen/models/Preview'
@@ -105,7 +105,7 @@
export async function runPreview(
path: string | undefined,
code: string,
lang: SupportedLanguage,
lang: SupportedLanguage | undefined,
args: Record<string, any>,
tag: string | undefined,
lock?: string
@@ -4,7 +4,7 @@
import Multiselect from 'svelte-multiselect'
import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte'
import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte'
import { ConfigService, Preview } from '$lib/gen'
import { ConfigService } from '$lib/gen'
import ConfirmationModal from './common/confirmationModal/ConfirmationModal.svelte'
import { createEventDispatcher } from 'svelte'
import { sendUserToast } from '$lib/toast'
@@ -688,7 +688,7 @@
class="flex flex-1 grow h-full w-full"
automaticLayout
lang="shell"
scriptLang={Preview.language.BASH}
scriptLang={'bash'}
useWebsockets={false}
fixedOverflowWidgets={false}
listenEmptyChanges
@@ -1,5 +1,4 @@
import type { AppInput, RunnableByName } from '$lib/components/apps/inputType'
import { Preview } from '$lib/gen'
import { buildParameters, type DbType } from '../utils'
import { getLanguageByResourceType, type ColumnDef, buildVisibleFieldList } from '../utils'
@@ -120,7 +119,7 @@ function makeCountQuery(
if (
!whereClause &&
(dbType === Preview.language.MYSQL ||
(dbType === 'mysql' ||
dbType === 'postgresql' ||
dbType === 'snowflake' ||
dbType === 'bigquery')
@@ -1,4 +1,4 @@
import { JobService, Preview, ResourceService } from '$lib/gen'
import { JobService, type Preview, ResourceService } from '$lib/gen'
import type { DBSchema, DBSchemas, GraphqlSchema, SQLSchema } from '$lib/stores'
import {
buildClientSchema,
@@ -64,10 +64,10 @@ export async function loadTableMetaData(
let code: string = ''
if (resourceType === 'mysql') {
const resourceObj = await ResourceService.getResourceValue({
const resourceObj = (await ResourceService.getResourceValue({
workspace,
path: resource.split(':')[1]
})
})) as any
code = `
SELECT
COLUMN_NAME as field,
@@ -190,10 +190,10 @@ order by c.ORDINAL_POSITION;`
await new Promise((resolve) => setTimeout(resolve, 3000))
const testResult = await JobService.getCompletedJob({
const testResult = (await JobService.getCompletedJob({
workspace: workspace,
id: job
})
})) as any
if (testResult.success) {
attempts = maxRetries
@@ -434,7 +434,7 @@ export async function getDbSchemas(
const job = await JobService.runScriptPreview({
workspace: workspace,
requestBody: {
language: scripts[resourceType].lang as Preview.language,
language: scripts[resourceType].lang as Preview['language'],
content: scripts[resourceType].code,
args: {
[scripts[resourceType].argName]: '$res:' + resourcePath
@@ -455,7 +455,7 @@ export async function getDbSchemas(
if (resourceType !== undefined) {
if (resourceType !== 'graphql') {
const { processingFn } = scripts[resourceType]
const schema =
const schema: any =
processingFn !== undefined ? processingFn(testResult.result) : testResult.result
const dbSchema = {
@@ -468,7 +468,10 @@ export async function getDbSchemas(
stringified: stringifySchema(dbSchema)
}
} else {
if (typeof testResult.result !== 'object' || !('__schema' in testResult.result)) {
if (
typeof testResult.result !== 'object' ||
!('__schema' in (testResult?.result ?? {}))
) {
console.error('Invalid GraphQL schema')
errorCallback('Invalid GraphQL schema')
@@ -478,8 +481,8 @@ export async function getDbSchemas(
schema: testResult.result
}
dbSchemas[resourcePath] = {
...dbSchema,
stringified: stringifySchema(dbSchema)
...(dbSchema as any),
stringified: stringifySchema(dbSchema as any)
}
}
}
@@ -640,13 +643,13 @@ export function buildVisibleFieldList(columnDefs: ColumnDef[], dbType: DbType) {
})
}
export function getLanguageByResourceType(name: string) {
export function getLanguageByResourceType(name: string): Preview['language'] {
const language = {
postgresql: Preview.language.POSTGRESQL,
mysql: Preview.language.MYSQL,
ms_sql_server: Preview.language.MSSQL,
snowflake: Preview.language.SNOWFLAKE,
bigquery: Preview.language.BIGQUERY
postgresql: 'postgresql',
mysql: 'mysql',
ms_sql_server: 'mssql',
snowflake: 'snowflake',
bigquery: 'bigquery'
}
return language[name]
}
@@ -704,10 +707,10 @@ export async function getTablesByResource(
return paths
}
case 'mysql': {
const resourceObj = await ResourceService.getResourceValue({
const resourceObj = (await ResourceService.getResourceValue({
workspace,
path: resourcePath
})
})) as any
const paths: string[] = []
for (const key in s?.schema) {
for (const subKey in s.schema[key]) {
@@ -11,7 +11,7 @@
import Path from '$lib/components/Path.svelte'
import TestJobLoader from '$lib/components/TestJobLoader.svelte'
import Toggle from '$lib/components/Toggle.svelte'
import { AppService, DraftService, Job, Policy } from '$lib/gen'
import { AppService, DraftService, type Job, type Policy } from '$lib/gen'
import { redo, undo } from '$lib/history'
import { enterpriseLicense, workspaceStore } from '$lib/stores'
import {
@@ -912,9 +912,7 @@
}}
checked={policy.execution_mode == 'anonymous'}
on:change={(e) => {
policy.execution_mode = e.detail
? Policy.execution_mode.ANONYMOUS
: Policy.execution_mode.PUBLISHER
policy.execution_mode = e.detail ? 'anonymous' : 'publisher'
setPublishState()
}}
/>
@@ -11,7 +11,6 @@
import {
FlowService,
JobService,
RawScript,
ScheduleService,
SettingService,
WorkspaceService
@@ -92,8 +91,9 @@
cron: schedule.schedule,
timezone: schedule.timezone
}
appReportingStartupDuration = schedule.args?.startup_duration ?? appReportingStartupDuration
screenshotKind = schedule.args?.kind ?? screenshotKind
appReportingStartupDuration =
(schedule.args?.startup_duration as number) ?? appReportingStartupDuration
screenshotKind = (schedule.args?.kind as 'png' | 'pdf') ?? screenshotKind
args = schedule.args
? Object.fromEntries(
@@ -300,7 +300,7 @@ export async function main(app_path: string, startup_duration = 5, kind: 'pdf' |
type: 'rawscript' as const,
tag: 'chromium',
content: appPreviewScript,
language: RawScript.language.BUN,
language: 'bun' as const,
input_transforms: {
app_path: {
expr: 'flow_input.app_path',
@@ -491,7 +491,8 @@ export async function main(app_path: string, startup_duration = 5, kind: 'pdf' |
</script>
<Drawer bind:open size="800px">
<DrawerContent on:close={() => (open = false)}
<DrawerContent
on:close={() => (open = false)}
title="Schedule Reports"
tooltip="Send a PDF or PNG preview of any app at a given schedule"
documentationLink="https://www.windmill.dev/docs/apps/schedule_reports"
@@ -2,7 +2,7 @@
import { Pane, Splitpanes } from 'svelte-splitpanes'
import PanelSection from './settingsPanel/common/PanelSection.svelte'
import { classNames, displayDate, emptyString } from '$lib/utils'
import { AppService, AppWithLastVersion, type AppHistory } from '$lib/gen'
import { AppService, type AppWithLastVersion, type AppHistory } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import AppPreview from './AppPreview.svelte'
import { Skeleton } from '$lib/components/common'
@@ -16,7 +16,7 @@
let versions: AppHistory[] = []
let selectedVersion: AppHistory | undefined = undefined
let selected: AppWithLastVersion | undefined = undefined
let selected: (AppWithLastVersion & { value: any }) | undefined = undefined
let deploymentMsgUpdateMode = false
let deploymentMsgUpdate: string | undefined = undefined
@@ -25,14 +25,14 @@ export async function getGroup(
workspace: string,
path: string
): Promise<{
name: string,
name: string
value: any
}> {
try {
return ResourceService.getResourceValue({
workspace,
path
})
}) as any
} catch (e) {
sendUserToast(`Group not found ${path}`)
return {
@@ -35,7 +35,7 @@ export async function getTheme(
return AppService.getPublicResource({
workspace,
path
})
}) as any
} catch (e) {
sendUserToast(`Theme not found ${path}`)
return {
@@ -88,7 +88,7 @@ export async function resolveTheme(
path: theme.path
})
css = loadedCss.value ?? ''
css = (loadedCss as any).value ?? ''
}
return css
}
@@ -4,7 +4,6 @@
import FlowScriptPicker from '$lib/components/flows/pickers/FlowScriptPicker.svelte'
import PickHubScript from '$lib/components/flows/pickers/PickHubScript.svelte'
import Tooltip from '$lib/components/Tooltip.svelte'
import { Script, type Preview } from '$lib/gen'
import { inferArgs } from '$lib/infer'
import { initialCode } from '$lib/script_helpers'
import { emptySchema } from '$lib/utils'
@@ -20,6 +19,7 @@
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'
export let name: string
export let componentType: string | undefined = undefined
@@ -33,7 +33,7 @@
const dispatch = createEventDispatcher()
async function inferInlineScriptSchema(
language: Preview.language,
language: Preview['language'],
content: string,
schema: Schema
): Promise<Schema> {
@@ -47,18 +47,18 @@
}
async function createInlineScriptByLanguage(
language: Preview.language,
language: Preview['language'],
path: string,
subkind: 'pgsql' | 'mysql' | 'fetch' | undefined = undefined
) {
const content =
defaultCode(componentType ?? '', subkind || language) ??
initialCode(language, Script.kind.SCRIPT, subkind ?? 'flow')
defaultCode(componentType ?? '', (subkind || language) ?? '') ??
initialCode(language, 'script', subkind ?? 'flow')
return newInlineScript(content, language, path)
}
async function newInlineScript(content: string, language: Preview.language, path: string) {
async function newInlineScript(content: string, language: Preview['language'], path: string) {
const fullPath = `${appPath}/${path}`
let schema: Schema = emptySchema()
@@ -100,7 +100,7 @@
(x) =>
x[1] != 'docker' &&
($defaultScripts?.hidden == undefined || !$defaultScripts.hidden.includes(x[1]))
) as [string, Preview.language][]
) as [string, Preview['language']][]
</script>
<Drawer bind:this={picker} size="1000px">
@@ -41,7 +41,7 @@
let validCode = true
async function inferInlineScriptSchema(
language: Preview.language,
language: Preview['language'],
content: string,
schema: Schema
): Promise<Schema> {
@@ -86,7 +86,7 @@
parent_hash: undefined,
schema: runnable.inlineScript.schema,
is_template: false,
language
language: language!
}
})
@@ -3,7 +3,7 @@
import SearchItems from '$lib/components/SearchItems.svelte'
import NoItemFound from '$lib/components/home/NoItemFound.svelte'
import RowIcon from '$lib/components/common/table/RowIcon.svelte'
import { Script, ScriptService } from '$lib/gen'
import { type Script, ScriptService } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { emptyString } from '$lib/utils'
import { Skeleton } from '$lib/components/common'
+1 -1
View File
@@ -110,7 +110,7 @@ export type GridItem = FilledItem<AppComponent>
export type InlineScript = {
content: string
language: Preview.language | 'frontend'
language: Preview['language'] | 'frontend'
path?: string
schema?: Schema
lock?: string
@@ -1,10 +1,14 @@
<script lang="ts">
import Button from '$lib/components/common/button/Button.svelte'
import { AuditLog } from '$lib/gen'
import { type AuditLog } from '$lib/gen'
import { ArrowRight } from 'lucide-svelte'
export let logs: AuditLog[]
export let selectedId: number | undefined = undefined
const ViewFlowOp: AuditLog['operation'][] = ['jobs.run.flow', 'flows.create', 'flows.update']
const ViewAppOp: AuditLog['operation'][] = ['apps.create', 'apps.update']
</script>
<div class="p-4 flex flex-col gap-2 border-t items-start">
@@ -30,7 +34,7 @@
</Button>
{/if}
{#if log.operation === AuditLog.operation.JOBS_RUN_SCRIPT}
{#if log.operation === 'jobs.run.script'}
<Button
href={`scripts/get/${log.resource}`}
color="dark"
@@ -42,7 +46,7 @@
</Button>
{/if}
{#if [AuditLog.operation.JOBS_RUN_FLOW, AuditLog.operation.FLOWS_CREATE, AuditLog.operation.FLOWS_UPDATE].includes(log.operation)}
{#if ViewFlowOp.includes(log.operation)}
<Button
href={`flows/get/${log.resource}`}
color="dark"
@@ -54,7 +58,7 @@
View flow
</Button>
{/if}
{#if [AuditLog.operation.APPS_UPDATE, AuditLog.operation.APPS_CREATE].includes(log.operation)}
{#if ViewAppOp.includes(log.operation)}
<Button
href={`apps/get/${log.resource}`}
color="dark"
@@ -5,7 +5,7 @@
import Button from '$lib/components/common/button/Button.svelte'
import CalendarPicker from '$lib/components/common/calendarPicker/CalendarPicker.svelte'
import {
AuditLog,
type AuditLog,
AuditService,
ResourceService,
UserService,
@@ -7,7 +7,6 @@
import FetchIcon from './FetchIcon.svelte'
import DockerIcon from '$lib/components/icons/DockerIcon.svelte'
import RestIcon from '$lib/components/icons/RestIcon.svelte'
import { Script } from '$lib/gen'
import PowershellIcon from '$lib/components/icons/PowershellIcon.svelte'
import BigQueryIcon from '$lib/components/icons/BigQueryIcon.svelte'
import SnowflakeIcon from '$lib/components/icons/SnowflakeIcon.svelte'
@@ -15,6 +14,7 @@
import MSSqlServerIcon from '$lib/components/icons/MSSqlServerIcon.svelte'
import BunIcon from '$lib/components/icons/BunIcon.svelte'
import DenoIcon from '$lib/components/icons/DenoIcon.svelte'
import type { Script } from '$lib/gen'
export let lang:
| SupportedLanguage
@@ -29,18 +29,20 @@
export let height = 30
export let scale = 1
const languageLabel = {
[Script.language.PYTHON3]: 'Python',
[Script.language.DENO]: 'TypeScript',
[Script.language.GO]: 'Go',
[Script.language.BASH]: 'Bash',
[Script.language.POWERSHELL]: 'PowerShell',
[Script.language.NATIVETS]: 'HTTP',
[Script.language.GRAPHQL]: 'GraphQL',
[Script.language.POSTGRESQL]: 'Postgresql',
[Script.language.BIGQUERY]: 'BigQuery',
[Script.language.SNOWFLAKE]: 'Snowflake',
[Script.language.MSSQL]: 'MS SQL Server'
const languageLabel: Record<Script['language'], String> = {
python3: 'Python',
deno: 'TypeScript',
go: 'Go',
bash: 'Bash',
powershell: 'PowerShell',
nativets: 'HTTP',
graphql: 'GraphQL',
postgresql: 'Postgresql',
bigquery: 'BigQuery',
snowflake: 'Snowflake',
mysql: 'MySQL',
mssql: 'MS SQL Server',
bun: 'TypeScript'
}
const langToComponent: Record<
@@ -3,7 +3,7 @@
import type MoveDrawer from '$lib/components/MoveDrawer.svelte'
import SharedBadge from '$lib/components/SharedBadge.svelte'
import type ShareModal from '$lib/components/ShareModal.svelte'
import { AppService, AppWithLastVersion, DraftService, type ListableApp } from '$lib/gen'
import { AppService, type AppWithLastVersion, DraftService, type ListableApp } from '$lib/gen'
import { userStore, workspaceStore } from '$lib/stores'
import { createEventDispatcher } from 'svelte'
import Button from '../button/Button.svelte'
@@ -23,10 +23,12 @@
</script>
<Drawer bind:this={$drawerStore}>
<DrawerContent on:close={$drawerStore.closeDrawer}
title="AI Flow Builder"
tooltip="Build flows from prompts"
documentationLink="https://www.windmill.dev/docs/core_concepts/ai_generation#windmill-ai-for-flows">
<DrawerContent
on:close={$drawerStore.closeDrawer}
title="AI Flow Builder"
tooltip="Build flows from prompts"
documentationLink="https://www.windmill.dev/docs/core_concepts/ai_generation#windmill-ai-for-flows"
>
<div class="flex flex-col gap-6">
{#if $flowStore.value.modules.length > 0 && $currentStepStore === undefined}
<Alert type="error" title="Flow not empty">All flow steps will be overriden</Alert>
@@ -36,7 +36,7 @@
// props
export let iconOnly: boolean = false
export let lang: SupportedLanguage | 'frontend'
export let lang: SupportedLanguage | 'frontend' | undefined
export let editor: Editor | SimpleEditor | undefined
export let diffEditor: DiffEditor | undefined
export let inlineScript = false
@@ -70,7 +70,7 @@
if (mode === 'edit') {
await copilot(
{
language: transformer && lang === 'frontend' ? 'transformer' : lang,
language: transformer && lang === 'frontend' ? 'transformer' : lang!,
description: trimmedDesc,
code: editor?.getCode() || '',
dbSchema: dbSchema,
@@ -83,7 +83,7 @@
} else {
await copilot(
{
language: transformer && lang === 'frontend' ? 'transformer' : lang,
language: transformer && lang === 'frontend' ? 'transformer' : lang!,
description: trimmedDesc,
dbSchema: dbSchema,
type: 'gen',
@@ -284,7 +284,7 @@
</div>
{/if}
{/if}
{#if ($generatedCode.length === 0 || genLoading) && SUPPORTED_LANGUAGES.has(lang)}
{#if ($generatedCode.length === 0 || genLoading) && SUPPORTED_LANGUAGES.has(lang ?? '')}
<Popup
floatingConfig={{
middleware: [
@@ -439,7 +439,7 @@
</div>
{/if}
{#if ['postgresql', 'mysql', 'snowflake', 'bigquery', 'mssql', 'graphql'].includes(lang) && dbSchema?.lang === lang}
{#if ['postgresql', 'mysql', 'snowflake', 'bigquery', 'mssql', 'graphql'].includes(lang ?? '') && dbSchema?.lang === lang}
<div class="flex flex-row items-center justify-between gap-2 w-96">
<div class="flex flex-row items-center gap-1">
<p class="text-xs text-secondary">
@@ -448,7 +448,7 @@
<Tooltip placement="top">
We pass the selected schema to GPT-4 Turbo for better script generation.
</Tooltip>
{#if dbSchema.stringified.length > MAX_SCHEMA_LENGTH}
{#if dbSchema && dbSchema.stringified.length > MAX_SCHEMA_LENGTH}
<Popover notClickable placement="top">
<AlertTriangle size={16} class="text-yellow-500" />
<svelte:fragment slot="text">
@@ -460,7 +460,7 @@
</Popover>
{/if}
</div>
{#if dbSchema.lang !== 'graphql' && (dbSchema.schema?.public || dbSchema.schema?.PUBLIC || dbSchema.schema?.dbo)}
{#if dbSchema && dbSchema.lang !== 'graphql' && (dbSchema.schema?.public || dbSchema.schema?.PUBLIC || dbSchema.schema?.dbo)}
<ToggleButtonGroup class="w-auto shrink-0" bind:selected={dbSchema.publicOnly}>
<ToggleButton
value={true}
@@ -3,7 +3,7 @@
import { createEventDispatcher, getContext } from 'svelte'
import type { FlowEditorContext } from '../flows/types'
import type { FlowCopilotContext, FlowCopilotModule } from './flow'
import { ScriptService, type FlowModule, Script } from '$lib/gen'
import { ScriptService, type FlowModule, type Script } from '$lib/gen'
import { APP_TO_ICON_COMPONENT } from '../icons'
import { sendUserToast } from '$lib/toast'
import { nextId } from '../flows/flowModuleNextId'
+7 -8
View File
@@ -1,11 +1,10 @@
import {
type Script,
type FlowModule,
type HubScriptKind,
ScriptService,
RawScript,
type RawScript,
type PathScript,
type InputTransform
type InputTransform,
type Script
} from '$lib/gen'
import { addResourceTypes, deltaCodeCompletion, getNonStreamingCompletion } from './lib'
import type { Writable } from 'svelte/store'
@@ -23,7 +22,7 @@ export type FlowCopilotModule = {
hubCompletions: {
path: string
summary: string
kind: HubScriptKind
kind: string
app: string
ask_id: number
}[]
@@ -31,7 +30,7 @@ export type FlowCopilotModule = {
| {
path: string
summary: string
kind: HubScriptKind
kind: string
app: string
ask_id: number
}
@@ -164,7 +163,7 @@ async function getPreviousStepContent(
const script = await ScriptService.getHubScriptByPath({
path: pastModule.value.path
})
return { prevCode: script.content, prevLang: script.language as Script.language }
return { prevCode: script.content, prevLang: script.language as Script['language'] }
} else if (pastModule.value.hash) {
const script = await ScriptService.getScriptByHash({
workspace,
@@ -225,7 +224,7 @@ export async function stepCopilot(
prompt = await addResourceTypes(
{
type: 'gen',
language: lang as Script.language,
language: lang as Script['language'],
description: module.description,
dbSchema: undefined,
workspace
+2 -2
View File
@@ -1,5 +1,5 @@
import { OpenAI } from 'openai'
import { OpenAPI, ResourceService, Script } from '../../gen'
import { OpenAPI, ResourceService, type Script } from '../../gen'
import type { Writable } from 'svelte/store'
import type { DBSchema, GraphqlSchema, SQLSchema } from '$lib/stores'
@@ -79,7 +79,7 @@ export async function testKey({
}
interface BaseOptions {
language: Script.language | 'frontend' | 'transformer'
language: Script['language'] | 'frontend' | 'transformer'
dbSchema: DBSchema | undefined
workspace: string
}
+4 -2
View File
@@ -69,7 +69,7 @@ export function pythonCompile(schema: Schema) {
export function formatResourceTypes(resourceTypes: ResourceType[], lang: 'python3' | 'typescript') {
if (lang === 'python3') {
const result = resourceTypes.map((resourceType) => {
return `class ${resourceType.name}(TypedDict):\n${pythonCompile(resourceType.schema)}`
return `class ${resourceType.name}(TypedDict):\n${pythonCompile(resourceType.schema as any)}`
})
return '\n' + result.join('\n\n')
} else {
@@ -78,7 +78,9 @@ export function formatResourceTypes(resourceTypes: ResourceType[], lang: 'python
(resourceType) => Boolean(resourceType.schema) && typeof resourceType.schema === 'object'
)
.map((resourceType) => {
return `type ${toCamel(capitalize(resourceType.name))} = ${compile(resourceType.schema)}`
return `type ${toCamel(capitalize(resourceType.name))} = ${compile(
resourceType.schema as any
)}`
})
return '\n' + result.join('\n\n')
}
+1 -1
View File
@@ -1,4 +1,4 @@
import { ScriptService, JobService, Script } from '$lib/gen'
import { ScriptService, JobService, type Script } from '$lib/gen'
export async function deleteScript(hash: string, workspace: string) {
return await ScriptService.deleteScriptByHash({ workspace: workspace, hash })
@@ -1,5 +1,5 @@
<script lang="ts">
import { FlowStatusModule, Job } from '$lib/gen'
import { type Job } from '$lib/gen'
import ProgressBar from '../progressBar/ProgressBar.svelte'
export let job: Job | undefined = undefined
@@ -27,17 +27,14 @@
let maxDone = job?.flow_status?.step ?? 0
if (modules.length > maxDone) {
const nextModule = modules[maxDone]
if (nextModule.type === FlowStatusModule.type.IN_PROGRESS) {
if (nextModule.type === 'InProgress') {
newNextInProgress = true
}
}
let module = modules[maxDone]
if (module) {
if (
module.type === FlowStatusModule.type.FAILURE ||
(module.type === FlowStatusModule.type.SUCCESS && job['success'] === false)
) {
if (module.type === 'Failure' || (module.type === 'Success' && job['success'] === false)) {
newError = maxDone
maxDone = maxDone + 1
}
@@ -2,7 +2,6 @@
import { Alert } from '$lib/components/common'
import ToggleHubWorkspace from '$lib/components/ToggleHubWorkspace.svelte'
import Tooltip from '$lib/components/Tooltip.svelte'
import { Script } from '$lib/gen'
import { createEventDispatcher } from 'svelte'
import FlowScriptPicker from '../pickers/FlowScriptPicker.svelte'
@@ -42,18 +41,14 @@
) as [string, SupportedLanguage | 'docker'][]
function displayLang(lang: SupportedLanguage | 'docker', kind: string) {
if (
lang == Script.language.BUN ||
lang == Script.language.PYTHON3 ||
lang == Script.language.DENO
) {
if (lang == 'bun' || lang == 'python3' || lang == 'deno') {
return true
}
if (lang == Script.language.GO) {
if (lang == 'go') {
return kind == 'script' || kind == 'trigger' || failureModule
}
if (lang == Script.language.BASH || lang == Script.language.NATIVETS) {
if (lang == 'bash' || lang == 'nativets') {
return kind == 'script'
}
return kind == 'script' && !failureModule
@@ -201,7 +196,7 @@
id={`flow-editor-action-script-${lang}`}
disabled={noEditor && (summary == undefined || summary == '')}
{label}
lang={lang == 'docker' ? Script.language.BASH : lang}
lang={lang == 'docker' ? 'bash' : lang}
on:click={() => {
if (lang == 'docker') {
if (isCloudHosted()) {
@@ -222,7 +217,7 @@
}
console.log(lang, kind)
dispatch('new', {
language: lang == 'docker' ? Script.language.BASH : lang,
language: lang == 'docker' ? 'bash' : lang,
kind,
subkind: lang == 'docker' ? 'docker' : 'flow',
summary
@@ -10,7 +10,6 @@
import FlowModuleSuspend from './FlowModuleSuspend.svelte'
// import FlowRetries from './FlowRetries.svelte'
import { Button, Drawer, Tab, TabContent, Tabs, Alert } from '$lib/components/common'
import type { FlowModule } from '$lib/gen/models/FlowModule'
import { Pane, Splitpanes } from 'svelte-splitpanes'
import { getStepPropPicker } from '../previousResults'
import { enterpriseLicense } from '$lib/stores'
@@ -18,7 +17,7 @@
import FlowModuleSleep from './FlowModuleSleep.svelte'
import FlowModuleMock from './FlowModuleMock.svelte'
import { Play } from 'lucide-svelte'
import type { Job } from '$lib/gen'
import type { FlowModule, Job } from '$lib/gen'
import FlowLoopIterationPreview from '$lib/components/FlowLoopIterationPreview.svelte'
import FlowModuleDeleteAfterUse from './FlowModuleDeleteAfterUse.svelte'
import IteratorGen from '$lib/components/copilot/IteratorGen.svelte'
@@ -1,5 +1,5 @@
<script lang="ts">
import { Script, type FlowModule } from '$lib/gen'
import { type FlowModule } from '$lib/gen'
import { getContext } from 'svelte'
import type { FlowEditorContext } from '../types'
@@ -43,11 +43,11 @@
) {
const [module, state] = await pickScript(path, summary, flowModule.id, hash)
if (kind == Script.kind.APPROVAL) {
if (kind == 'approval') {
module.suspend = { required_events: 1, timeout: 1800 }
}
if (kind == Script.kind.TRIGGER) {
if (kind == 'trigger') {
if (!$schedule.cron) {
$schedule.cron = '0 */15 * * *'
}
@@ -116,7 +116,7 @@
scriptKind = kind
scriptTemplate = subkind
if (kind == Script.kind.TRIGGER) {
if (kind == 'trigger') {
if (!$schedule.cron) {
$schedule.cron = '0 */15 * * *'
}
@@ -128,7 +128,7 @@
}
}
if (kind == Script.kind.APPROVAL) {
if (kind == 'approval') {
module.suspend = { required_events: 1, timeout: 1800 }
}
@@ -8,14 +8,13 @@
import FlowModuleSuspend from './FlowModuleSuspend.svelte'
// import FlowRetries from './FlowRetries.svelte'
import { Button, Drawer, Tab, TabContent, Tabs, Alert } from '$lib/components/common'
import type { FlowModule } from '$lib/gen/models/FlowModule'
import { Pane, Splitpanes } from 'svelte-splitpanes'
import { enterpriseLicense } from '$lib/stores'
import FlowModuleSleep from './FlowModuleSleep.svelte'
import FlowModuleMock from './FlowModuleMock.svelte'
import { Play } from 'lucide-svelte'
import type { Job } from '$lib/gen'
import type { FlowModule, Job } from '$lib/gen'
import FlowLoopIterationPreview from '$lib/components/FlowLoopIterationPreview.svelte'
import FlowModuleDeleteAfterUse from './FlowModuleDeleteAfterUse.svelte'
@@ -56,10 +55,17 @@
<Splitpanes horizontal class="!max-h-[calc(100%-48px)]">
<Pane size={60} minSize={20} class="p-4">
{#if !noEditor}
<Alert type="info" title="While loops" class="mb-4" size="xs" documentationLink="https://www.windmill.dev/docs/flows/while_loops">
<Alert
type="info"
title="While loops"
class="mb-4"
size="xs"
documentationLink="https://www.windmill.dev/docs/flows/while_loops"
>
Add steps inside the while loop but have one of them use early stop/break in their
Advanced settings (or do it at the loop level that will watch the last step) to break out of the while loop (otherwise it will loop forever and you
will have to cancel the flow manually).
Advanced settings (or do it at the loop level that will watch the last step) to break
out of the while loop (otherwise it will loop forever and you will have to cancel the
flow manually).
</Alert>
{/if}
@@ -3,7 +3,7 @@
import ConfirmationModal from '$lib/components/common/confirmationModal/ConfirmationModal.svelte'
import DiffDrawer from '$lib/components/DiffDrawer.svelte'
import ScriptEditor from '$lib/components/ScriptEditor.svelte'
import { ScriptService, type Preview, Script } from '$lib/gen'
import { ScriptService, type Preview, type Script } from '$lib/gen'
import { inferArgs } from '$lib/infer'
import { workspaceStore } from '$lib/stores'
import { Loader2, Save, DiffIcon } from 'lucide-svelte'
@@ -39,7 +39,7 @@
description: string
summary: string
hash: string
language: Preview.language
language: Preview['language']
content: string
schema?: any
kind: 'script' | 'failure' | 'trigger' | 'command' | 'approval' | undefined
@@ -56,7 +56,7 @@
description: string
summary: string
hash: string
language: Preview.language
language: Preview['language']
content: string
schema?: any
kind: 'script' | 'failure' | 'trigger' | 'command' | 'approval' | undefined
@@ -84,10 +84,11 @@
workspace: $workspaceStore!,
requestBody: {
...script,
language: script.language!,
description: script.description ?? '',
parent_hash: script.hash != '' ? script.hash : undefined,
is_template: false,
kind: script.kind as Script.kind | undefined,
kind: script.kind as Script['kind'] | undefined,
lock: undefined
}
})
@@ -1,7 +1,6 @@
<script lang="ts">
import HighlightCode from '$lib/components/HighlightCode.svelte'
import Section from '$lib/components/Section.svelte'
import { Script } from '$lib/gen'
import { HelpCircle } from 'lucide-svelte'
import { Button, Drawer, Tab, Tabs } from '../../common'
import DrawerContent from '../../common/drawer/DrawerContent.svelte'
@@ -42,7 +41,7 @@
<svelte:fragment slot="content">
<TabContent value="deno" class="p-2">
<HighlightCode
language={Script.language.DENO}
language={'deno'}
code={`import * as wmill from "npm:windmill-client@^1.158.2"
export async function main() {
@@ -58,7 +57,7 @@ export async function main() {
</TabContent>
<TabContent value="bun" class="p-2">
<HighlightCode
language={Script.language.DENO}
language={'deno'}
code={`import * as wmill from "windmill-client"
export async function main() {
@@ -74,7 +73,7 @@ export async function main() {
</TabContent>
<TabContent value="python" class="p-2">
<HighlightCode
language={Script.language.PYTHON3}
language={'python3'}
code={`import wmill
def main():
@@ -94,7 +93,7 @@ def main():
As one of the return key of this step, return an object `default_args` that contains the
default arguments of the form arguments. e.g:
<HighlightCode
language={Script.language.DENO}
language={'deno'}
code={`//this assumes the Form tab has a string field named "foo" and a checkbox named "bar"
import * as wmill from "npm:windmill-client@^1.158.2"
@@ -118,7 +117,7 @@ export async function main() {
As one of the return key of this step, return an object `enums` that contains the default
arguments of the form arguments. e.g:
<HighlightCode
language={Script.language.DENO}
language={'deno'}
code={`
//this assumes the Form tab has a string field named "foo"
+1 -1
View File
@@ -1,4 +1,4 @@
import type { FlowModule } from '$lib/gen/models/FlowModule'
import type { FlowModule } from '$lib/gen'
export function dfs<T>(modules: FlowModule[], f: (x: FlowModule) => T): T[] {
let result: T[] = []
@@ -1,12 +1,12 @@
import type { Schema } from '$lib/common'
import {
Script,
ScriptService,
type FlowModule,
type PathFlow,
type PathScript,
type RawScript,
type OpenFlow
type OpenFlow,
type Script
} from '$lib/gen'
import { initialCode } from '$lib/script_helpers'
import { userStore, workspaceStore } from '$lib/stores'
@@ -67,8 +67,8 @@ export async function pickFlow(
}
export async function createInlineScriptModule(
language: RawScript.language,
kind: Script.kind,
language: RawScript['language'],
kind: Script['kind'],
subkind: 'pgsql' | 'flow',
id: string,
summary?: string
@@ -187,7 +187,7 @@ async function createInlineScriptModuleFromPath(
id,
value: {
type: 'rawscript',
language: language as RawScript.language,
language: language as RawScript['language'],
content: content,
path,
input_transforms: {}
@@ -1,6 +1,6 @@
<script lang="ts">
import { sugiyama, dagStratify, decrossOpt, coordCenter } from 'd3-dag'
import { type FlowModule, FlowStatusModule } from '../../gen'
import { type FlowModule } from '../../gen'
import {
NODE,
createIdGenerator,
@@ -286,9 +286,9 @@
switch (success) {
case true:
return getStateColor(FlowStatusModule.type.SUCCESS)
return getStateColor('Success')
case false:
return getStateColor(FlowStatusModule.type.FAILURE)
return getStateColor('Failure')
default:
return isDark ? '#2e3440' : '#fff'
}
+1 -1
View File
@@ -44,7 +44,7 @@ export type FlowStatusViewerContext = {
suspendStatus: Writable<Record<string, { nb: number; job: Job }>>
}
export type GraphModuleState = {
type: FlowStatusModule.type
type: FlowStatusModule['type']
args: any
logs?: string
result?: any
+7 -7
View File
@@ -1,4 +1,4 @@
import { FlowStatusModule, type FlowModule } from '$lib/gen'
import type { FlowStatusModule, FlowModule } from '$lib/gen'
import MapItem from '../flows/map/MapItem.svelte'
import type { GraphModuleState } from './model'
@@ -18,18 +18,18 @@ export function* createIdGenerator(): Generator<number, number, unknown> {
}
}
export function getStateColor(state: FlowStatusModule.type | undefined): string {
export function getStateColor(state: FlowStatusModule['type'] | undefined): string {
const isDark = document.documentElement.classList.contains('dark')
switch (state) {
case FlowStatusModule.type.SUCCESS:
case 'Success':
return isDark ? '#059669' : 'rgb(193, 255, 216)'
case FlowStatusModule.type.FAILURE:
case 'Failure':
return isDark ? '#dc2626' : 'rgb(248 113 113)'
case FlowStatusModule.type.IN_PROGRESS:
case 'InProgress':
return isDark ? '#f59e0b' : 'rgb(253, 240, 176)'
case FlowStatusModule.type.WAITING_FOR_EVENTS:
case 'WaitingForEvents':
return isDark ? '#db2777' : 'rgb(229, 176, 253)'
case FlowStatusModule.type.WAITING_FOR_EXECUTOR:
case 'WaitingForExecutor':
return isDark ? '#ea580c' : 'rgb(255, 208, 193)'
default:
return isDark ? '#2e3440' : '#fff'
@@ -5,8 +5,8 @@
import {
AppService,
FlowService,
ListableApp,
Script,
type ListableApp,
type Script,
ScriptService,
type Flow,
type ListableRawApp,
@@ -5,7 +5,7 @@
<script lang="ts">
import { onDestroy, tick } from 'svelte'
import { fade } from 'svelte/transition'
import { Job } from '../../gen'
import { type Job } from '../../gen'
import TestJobLoader from '../TestJobLoader.svelte'
import DisplayResult from '../DisplayResult.svelte'
import JobArgs from '../JobArgs.svelte'
@@ -121,7 +121,7 @@
<div>{new Date(job?.['scheduled_for']).toLocaleString()}</div>
</div>
{/if}
{#if job?.type === Job.type.COMPLETED_JOB}
{#if job?.type === 'CompletedJob'}
<DisplayResult workspaceId={job?.workspace_id} jobId={job?.id} {result} disableExpand />
{:else if job && `running` in job ? job.running : false}
<div class="text-sm font-semibold text-tertiary mb-1"> Job is still running </div>
@@ -1,6 +1,6 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte'
import { JobService, Job, CompletedJob } from '$lib/gen'
import { JobService, type Job, type CompletedJob } from '$lib/gen'
import { sendUserToast } from '$lib/toast'
import { workspaceStore } from '$lib/stores'
@@ -60,15 +60,33 @@
function computeJobKinds(jobKindsCat: string | undefined): string {
if (jobKindsCat == 'all') {
return `${CompletedJob.job_kind.SCRIPT},${CompletedJob.job_kind.FLOW},${CompletedJob.job_kind.DEPENDENCIES},${CompletedJob.job_kind.FLOWDEPENDENCIES},${CompletedJob.job_kind.APPDEPENDENCIES},${CompletedJob.job_kind.PREVIEW},${CompletedJob.job_kind.FLOWPREVIEW},${CompletedJob.job_kind.SCRIPT_HUB}`
let kinds: CompletedJob['job_kind'][] = [
'script',
'flow',
'dependencies',
'flowdependencies',
'appdependencies',
'preview',
'flowpreview',
'script_hub'
]
return kinds.join(',')
} else if (jobKindsCat == 'dependencies') {
return `${CompletedJob.job_kind.DEPENDENCIES},${CompletedJob.job_kind.FLOWDEPENDENCIES},${CompletedJob.job_kind.APPDEPENDENCIES}`
let kinds: CompletedJob['job_kind'][] = [
'dependencies',
'flowdependencies',
'appdependencies'
]
return kinds.join(',')
} else if (jobKindsCat == 'previews') {
return `${CompletedJob.job_kind.PREVIEW},${CompletedJob.job_kind.FLOWPREVIEW}`
let kinds: CompletedJob['job_kind'][] = ['preview', 'flowpreview']
return kinds.join(',')
} else if (jobKindsCat == 'deploymentcallbacks') {
return `${CompletedJob.job_kind.DEPLOYMENTCALLBACK}`
let kinds: CompletedJob['job_kind'][] = ['deploymentcallback']
return kinds.join(',')
} else {
return `${CompletedJob.job_kind.SCRIPT},${CompletedJob.job_kind.FLOW}`
let kinds: CompletedJob['job_kind'][] = ['script', 'flow']
return kinds.join(',')
}
}
@@ -172,10 +190,10 @@
while (cursor < jobs.length && minTs == undefined) {
let invCursor = jobs.length - 1 - cursor
let isQueuedJob = invCursor == 0 || jobs[invCursor].type == Job.type.QUEUED_JOB
let isQueuedJob = invCursor == 0 || jobs[invCursor].type == 'QueuedJob'
if (isQueuedJob) {
if (cursor > 0) {
let inc = invCursor == 0 && jobs[invCursor].type == Job.type.COMPLETED_JOB ? 0 : 1
let inc = invCursor == 0 && jobs[invCursor].type == 'CompletedJob' ? 0 : 1
const date = new Date(
jobs[invCursor + inc]?.started_at ?? jobs[invCursor + inc]?.created_at!
)
@@ -1,5 +1,5 @@
<script lang="ts">
import { Job, type WorkflowStatus } from '../../gen'
import { type Job, type WorkflowStatus } from '../../gen'
import TestJobLoader from '../TestJobLoader.svelte'
import DisplayResult from '../DisplayResult.svelte'
import JobArgs from '../JobArgs.svelte'
@@ -95,7 +95,7 @@
<JobArgs args={job?.args} />
</div>
{#if job?.type === Job.type.COMPLETED_JOB}
{#if job?.type === 'CompletedJob'}
<span class="font-semibold text-xs leading-6">Results</span>
{/if}
@@ -114,7 +114,7 @@
/>
{/if}
{#if job?.type === Job.type.COMPLETED_JOB}
{#if job?.type === 'CompletedJob'}
<Tabs bind:selected={viewTab}>
<Tab size="xs" value="result">Result</Tab>
<Tab size="xs" value="logs">Logs</Tab>
@@ -1,5 +1,5 @@
<script lang="ts">
import { JobService, QueuedJob } from '$lib/gen'
import { JobService, type QueuedJob } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { ExternalLink } from 'lucide-svelte'
import Skeleton from '../common/skeleton/Skeleton.svelte'
@@ -1,5 +1,12 @@
<script lang="ts">
import { CompletedJob, Job, JobService, OpenAPI, Preview, type WorkflowStatus } from '$lib/gen'
import {
type CompletedJob,
type Job,
JobService,
OpenAPI,
type Preview,
type WorkflowStatus
} from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { displayDate } from '$lib/utils'
import Tabs from '../common/tabs/Tabs.svelte'
@@ -20,7 +27,7 @@
import Head from '../table/Head.svelte'
import WorkflowTimeline from '../WorkflowTimeline.svelte'
export let lang: Preview.language | undefined
export let lang: Preview['language'] | undefined
export let previewIsLoading = false
export let previewJob: Job | undefined
export let pastPreviews: CompletedJob[] = []
@@ -29,7 +36,7 @@
export let args: Record<string, any> | undefined = undefined
type DrawerContent = {
mode: 'json' | Preview.language | 'plain'
mode: 'json' | Preview['language'] | 'plain'
title: string
content: any
}
@@ -116,7 +123,7 @@
result={previewJob.result}
>
<svelte:fragment slot="copilot-fix">
{#if lang && editor && diffEditor && args && previewJob?.result?.error}
{#if lang && editor && diffEditor && args && previewJob?.result && typeof previewJob?.result == 'object' && `error` in previewJob?.result && previewJob?.result.error}
<ScriptFix
error={JSON.stringify(previewJob.result.error)}
{lang}
@@ -56,7 +56,9 @@ export function selectOptionsBySelector(selector: string, value: string) {
}
export function isFlowTainted(flow: OpenFlow) {
return flow.value.modules.length > 0 || Object.keys(flow?.schema?.properties).length > 0
return (
flow.value.modules.length > 0 || Object.keys((flow?.schema?.properties as any) ?? {}).length > 0
)
}
export function isAppTainted(app: App) {
+2 -2
View File
@@ -6,8 +6,8 @@ export function scriptToHubUrl(
content: string,
summary: string,
description: string,
kind: Script.kind,
language: Script.language,
kind: Script['kind'],
language: Script['language'],
schema: Schema | any,
lock: string | undefined,
hubBaseUrl: string
+6 -6
View File
@@ -1,4 +1,4 @@
import { ScriptService, type MainArgSignature, FlowService, Script } from '$lib/gen'
import { ScriptService, type MainArgSignature, FlowService, type Script } from '$lib/gen'
import { get, writable } from 'svelte/store'
import type { Schema, SupportedLanguage } from './common.js'
import { emptySchema, sortObject } from './utils.js'
@@ -42,7 +42,7 @@ export function parseDeps(code: string): string[] {
}
export async function inferArgs(
language: SupportedLanguage,
language: SupportedLanguage | undefined,
code: string,
schema: Schema
): Promise<void> {
@@ -57,7 +57,7 @@ export async function inferArgs(
}
let inlineDBResource: string | undefined = undefined
if (['postgresql', 'mysql', 'bigquery', 'snowflake', 'mssql'].includes(language)) {
if (['postgresql', 'mysql', 'bigquery', 'snowflake', 'mssql'].includes(language ?? '')) {
inlineDBResource = parse_db_resource(code)
}
if (language == 'python3') {
@@ -157,7 +157,7 @@ export async function loadSchemaFromPath(path: string, hash?: string): Promise<S
const { content, language, schema } = await ScriptService.getHubScriptByPath({ path })
if (schema && typeof schema === 'object' && 'properties' in schema) {
return schema
return schema as any
} else {
const newSchema = emptySchema()
await inferArgs(language as SupportedLanguage, content ?? '', newSchema)
@@ -220,8 +220,8 @@ export async function loadSchema(
script.schema = emptySchema()
}
await inferArgs(script.language as SupportedLanguage, script.content, script.schema)
return { schema: script.schema, summary: script.summary }
await inferArgs(script.language as SupportedLanguage, script.content, script.schema as any)
return { schema: script.schema as any, summary: script.summary }
}
}
+6 -6
View File
@@ -1,4 +1,4 @@
import { Script } from './gen'
import { type Script } from './gen'
import PYTHON_INIT_CODE from '$lib/init_scripts/python_init_code'
import PYTHON_INIT_CODE_CLEAR from '$lib/init_scripts/python_init_code_clear'
@@ -385,12 +385,12 @@ export function isInitialCode(content: string): boolean {
}
export function initialCode(
language: SupportedLanguage,
kind: Script.kind | undefined,
language: SupportedLanguage | undefined,
kind: Script['kind'] | undefined,
subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | 'fetch' | 'docker' | 'powershell' | undefined
): string {
if (!kind) {
kind = Script.kind.SCRIPT
kind = 'script'
}
if (language === 'deno') {
if (kind === 'trigger') {
@@ -471,8 +471,8 @@ export function initialCode(
}
export function getResetCode(
language: SupportedLanguage,
kind: Script.kind | undefined,
language: SupportedLanguage | undefined,
kind: Script['kind'] | undefined,
subkind: 'pgsql' | 'mysql' | 'flow' | 'script' | 'fetch' | 'docker' | 'powershell' | undefined
) {
if (language === 'deno') {
+20 -17
View File
@@ -1,9 +1,9 @@
import { get } from 'svelte/store'
import type { Schema, SupportedLanguage } from './common'
import { FlowService, Script, ScriptService, ScheduleService } from './gen'
import { FlowService, type Script, ScriptService, ScheduleService } from './gen'
import { workspaceStore } from './stores'
export function scriptLangToEditorLang(lang: Script.language) {
export function scriptLangToEditorLang(lang: Script['language'] | undefined) {
if (lang == 'deno') {
return 'typescript'
} else if (lang == 'bun') {
@@ -30,6 +30,8 @@ export function scriptLangToEditorLang(lang: Script.language) {
return 'powershell'
} else if (lang == 'graphql') {
return 'graphql'
} else if (lang == undefined) {
return 'typescript'
} else {
return lang
}
@@ -87,22 +89,23 @@ export function scriptPathToHref(path: string, hubBaseUrl: string): string {
}
}
export const defaultScriptLanguages = Object.fromEntries([
[Script.language.BUN, 'TypeScript (Bun)'],
[Script.language.PYTHON3, 'Python'],
[Script.language.DENO, 'TypeScript (Deno)'],
[Script.language.BASH, 'Bash'],
[Script.language.GO, 'Go'],
[Script.language.NATIVETS, 'REST'],
[Script.language.POSTGRESQL, 'PostgreSQL'],
[Script.language.MYSQL, 'MySQL'],
[Script.language.BIGQUERY, 'BigQuery'],
[Script.language.SNOWFLAKE, 'Snowflake'],
[Script.language.MSSQL, 'MS SQL Server'],
[Script.language.GRAPHQL, 'GraphQL'],
[Script.language.POWERSHELL, 'PowerShell'],
const scriptLanguagesArray: [SupportedLanguage | 'docker', string][] = [
['bun', 'TypeScript (Bun)'],
['python3', 'Python'],
['deno', 'TypeScript (Deno)'],
['bash', 'Bash'],
['go', 'Go'],
['nativets', 'REST'],
['postgresql', 'PostgreSQL'],
['mysql', 'MySQL'],
['bigquery', 'BigQuery'],
['snowflake', 'Snowflake'],
['mssql', 'MS SQL Server'],
['graphql', 'GraphQL'],
['powershell', 'PowerShell'],
['docker', 'Docker']
])
]
export const defaultScriptLanguages = Object.fromEntries(scriptLanguagesArray)
export async function getScriptByPath(path: string): Promise<{
content: string
+1 -1
View File
@@ -719,7 +719,7 @@ export function roughSizeOfObject(object: object | string) {
}
export type Value = {
language?: Script.language
language?: Script['language']
content?: string
path?: string
draft_only?: boolean
@@ -129,7 +129,8 @@
async function loadHubBaseUrl() {
$hubBaseUrlStore =
(await SettingService.getGlobal({ key: 'hub_base_url' })) ?? 'https://hub.windmill.dev'
((await SettingService.getGlobal({ key: 'hub_base_url' })) as string) ??
'https://hub.windmill.dev'
}
async function loadFavorites() {
@@ -1,5 +1,5 @@
<script lang="ts">
import { AppService, FlowService, Script, type OpenFlow } from '$lib/gen'
import { AppService, FlowService, type OpenFlow, type Script } from '$lib/gen'
import { userStore, workspaceStore } from '$lib/stores'
import { Alert, Button, Drawer, DrawerContent, Tab, Tabs } from '$lib/components/common'
import PageHeader from '$lib/components/PageHeader.svelte'
@@ -43,7 +43,7 @@
let codeViewer: Drawer
let codeViewerContent: string = ''
let codeViewerLanguage: Script.language = 'deno' as Script.language
let codeViewerLanguage: Script['language'] = 'deno'
let codeViewerObj: HubItem | undefined = undefined
const breakpoint = writable<EditorBreakpoint>('lg')
@@ -2,7 +2,7 @@
import { importStore } from '$lib/components/apps/store'
import AppEditor from '$lib/components/apps/editor/AppEditor.svelte'
import { AppService, Policy } from '$lib/gen'
import { AppService, type Policy } from '$lib/gen'
import { page } from '$app/stores'
import { decodeState } from '$lib/utils'
import { userStore, workspaceStore } from '$lib/stores'
@@ -44,7 +44,7 @@
? $userStore?.username
: `u/${$userStore?.username}`,
on_behalf_of_email: $userStore?.email,
execution_mode: Policy.execution_mode.PUBLISHER
execution_mode: 'publisher'
}
loadApp()
@@ -64,7 +64,7 @@
workspace: $workspaceStore!,
path: templatePath
})
value = template.value
value = template.value as any
sendUserToast('App loaded from template')
goto('?', { replaceState: true })
} else if (templateId) {
@@ -72,7 +72,7 @@
workspace: $workspaceStore!,
id: parseInt(templateId)
})
value = template.value
value = template.value as any
sendUserToast('App loaded from template')
goto('?', { replaceState: true })
} else if (hubId) {
@@ -81,7 +81,7 @@
hiddenInlineScripts: [],
unusedInlineScripts: [],
fullscreen: false,
...hub.app.value
...((hub.app.value ?? {}) as any)
}
summary = hub.app.summary
sendUserToast('App loaded from Hub')
@@ -1,16 +1,16 @@
<script lang="ts">
import AppEditor from '$lib/components/apps/editor/AppEditor.svelte'
import { AppService, AppWithLastVersion, DraftService } from '$lib/gen'
import { AppService, type AppWithLastVersion, DraftService } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { page } from '$app/stores'
import { cleanValueProperties, decodeState } from '$lib/utils'
import { cleanValueProperties, decodeState, type Value } from '$lib/utils'
import { goto } from '$app/navigation'
import { sendUserToast, type ToastAction } from '$lib/toast'
import DiffDrawer from '$lib/components/DiffDrawer.svelte'
import type { App } from '$lib/components/apps/types'
import { cloneDeep } from 'lodash'
let app = undefined as (AppWithLastVersion & { draft_only?: boolean }) | undefined
let app = undefined as (AppWithLastVersion & { draft_only?: boolean; value: any }) | undefined
let savedApp:
| {
value: App
@@ -41,12 +41,12 @@
const app_w_draft_ = cloneDeep(app_w_draft)
savedApp = {
summary: app_w_draft_.summary,
value: app_w_draft_.value,
value: app_w_draft_.value as App,
path: app_w_draft_.path,
policy: app_w_draft_.policy,
draft_only: app_w_draft_.draft_only,
draft:
app_w_draft_.draft?.summary !== undefined // backward compatibility for old drafts missing metadata
app_w_draft_.draft?.['summary'] !== undefined // backward compatibility for old drafts missing metadata
? app_w_draft_.draft
: app_w_draft_.draft
? {
@@ -104,7 +104,7 @@
} else {
app = {
...app_w_draft,
value: app_w_draft.draft
value: app_w_draft.draft as any
}
}
@@ -115,7 +115,7 @@
redraw++
}
const deployed = cleanValueProperties(app_w_draft)
const deployed = cleanValueProperties(app_w_draft as Value)
const draft = cleanValueProperties(app ?? {})
sendUserToast('app loaded from latest saved draft', false, [
{
@@ -4,14 +4,14 @@
import type { EditorBreakpoint } from '$lib/components/apps/types'
import { Button, Skeleton } from '$lib/components/common'
import { AppService, AppWithLastVersion } from '$lib/gen'
import { AppService, type AppWithLastVersion } from '$lib/gen'
import { userStore, workspaceStore } from '$lib/stores'
import { canWrite } from '$lib/utils'
import { Pen } from 'lucide-svelte'
import { writable } from 'svelte/store'
import { twMerge } from 'tailwind-merge'
let app: AppWithLastVersion | undefined = undefined
let app: (AppWithLastVersion & { value: any }) | undefined = undefined
let can_write = false
async function loadApp() {
@@ -252,7 +252,7 @@
const rt = await ResourceService.getResourceType({ workspace: $workspaceStore!, path: name })
editResourceType = {
name: rt.name,
schema: rt.schema,
schema: rt.schema as any,
description: rt.description ?? ''
}
editResourceTypeDrawer.openDrawer?.()
@@ -651,6 +651,7 @@
if (linkedRt) {
resourceTypeViewerObj = {
rt: linkedRt.name,
//@ts-ignore
schema: linkedRt.schema,
description: linkedRt.description ?? ''
}
@@ -834,6 +835,7 @@
on:click={() => {
resourceTypeViewerObj = {
rt: name,
//@ts-ignore
schema: schema,
description: description ?? ''
}
@@ -1,6 +1,13 @@
<script lang="ts">
import { page } from '$app/stores'
import { JobService, Job, ScriptService, Script, type WorkflowStatus, NewScript } from '$lib/gen'
import {
JobService,
type Job,
ScriptService,
type Script,
type WorkflowStatus,
type NewScript
} from '$lib/gen'
import {
canWrite,
copyToClipboard,
@@ -246,7 +253,7 @@
let n: NewScript = {
path: job?.script_path + '_fork',
summary: 'Fork of preview of ' + job?.script_path,
language: job?.language as NewScript.language,
language: job?.language as NewScript['language'],
description: '',
content: job?.raw_code ?? ''
}
@@ -1,8 +1,8 @@
<script lang="ts">
import {
JobService,
Job,
CompletedJob,
type Job,
type CompletedJob,
UserService,
FolderService,
ScriptService,
@@ -1,5 +1,5 @@
<script lang="ts">
import { NewScript, Script, ScriptService } from '$lib/gen'
import { type NewScript, ScriptService, type Script } from '$lib/gen'
import { page } from '$app/stores'
import { defaultScripts, workspaceStore } from '$lib/stores'
@@ -42,7 +42,7 @@
$defaultScripts?.order?.filter(
(x) => $defaultScripts?.hidden == undefined || !$defaultScripts.hidden.includes(x)
)?.[0] ?? 'bun',
kind: Script.kind.SCRIPT
kind: 'script'
}
}
@@ -72,7 +72,7 @@
script.description = `Fork of ${hubPath}`
script.content = content
script.summary = summary ?? ''
script.language = language as Script.language
script.language = language as Script['language']
scriptBuilder?.setCode(script.content)
}
}
@@ -1,5 +1,5 @@
<script lang="ts">
import { ScriptService, NewScript, type NewScriptWithDraft, DraftService } from '$lib/gen'
import { ScriptService, type NewScript, type NewScriptWithDraft, DraftService } from '$lib/gen'
import { page } from '$app/stores'
import { runFormStore, workspaceStore } from '$lib/stores'
@@ -49,7 +49,7 @@
let automateUsernameCreation = false
async function getAutomateUsernameCreationSetting() {
automateUsernameCreation =
(await SettingService.getGlobal({ key: 'automate_username_creation' })) ?? false
((await SettingService.getGlobal({ key: 'automate_username_creation' })) as any) ?? false
if (!automateUsernameCreation) {
UserService.globalWhoami().then((x) => {
@@ -117,7 +117,7 @@
let automateUsernameCreation = false
async function getAutomateUsernameCreationSetting() {
automateUsernameCreation =
(await SettingService.getGlobal({ key: 'automate_username_creation' })) ?? false
((await SettingService.getGlobal({ key: 'automate_username_creation' })) as any) ?? false
if (!automateUsernameCreation) {
UserService.globalWhoami().then((x) => {
@@ -141,7 +141,7 @@
}
async function loadLogins() {
const allLogins = await OauthService.listOAuthLogins()
const allLogins = await OauthService.listOauthLogins()
logins = allLogins.oauth
saml = allLogins.saml
@@ -16,9 +16,8 @@
import WorkspaceUserSettings from '$lib/components/settings/WorkspaceUserSettings.svelte'
import { WORKSPACE_SHOW_SLACK_CMD, WORKSPACE_SHOW_WEBHOOK_CLI_SYNC } from '$lib/consts'
import {
LargeFileStorage,
type LargeFileStorage,
OauthService,
Script,
WorkspaceService,
JobService,
ResourceService
@@ -232,16 +231,20 @@
public_resource: s3ResourceSettings.publicResource
}
if (s3ResourceSettings.resourceType === 'azure_blob') {
params['type'] = LargeFileStorage.type.AZURE_BLOB_STORAGE
let typ: LargeFileStorage['type'] = 'AzureBlobStorage'
params['type'] = typ
params['azure_blob_resource_path'] = resourcePathWithPrefix
} else if (s3ResourceSettings.resourceType === 'azure_workload_identity') {
params['type'] = LargeFileStorage.type.AZURE_WORKLOAD_IDENTITY
let typ: LargeFileStorage['type'] = 'AzureWorkloadIdentity'
params['type'] = typ
params['azure_blob_resource_path'] = resourcePathWithPrefix
} else if (s3ResourceSettings.resourceType === 's3_aws_oidc') {
params['type'] = LargeFileStorage.type.S3AWS_OIDC
let typ: LargeFileStorage['type'] = 'S3AwsOidc'
params['type'] = typ
params['s3_resource_path'] = resourcePathWithPrefix
} else {
params['type'] = LargeFileStorage.type.S3STORAGE
let typ: LargeFileStorage['type'] = 'S3Storage'
params['type'] = typ
params['s3_resource_path'] = resourcePathWithPrefix
}
await WorkspaceService.editLargeFileStorageConfig({
@@ -436,27 +439,25 @@
codeCompletionEnabled = settings.code_completion_enabled
workspaceDefaultAppPath = settings.default_app
if (settings.large_file_storage?.type === LargeFileStorage.type.S3STORAGE) {
if (settings.large_file_storage?.type === 'S3Storage') {
s3ResourceSettings = {
resourceType: 's3',
resourcePath: settings.large_file_storage?.s3_resource_path?.replace('$res:', ''),
publicResource: settings.large_file_storage?.public_resource
}
} else if (settings.large_file_storage?.type === LargeFileStorage.type.AZURE_BLOB_STORAGE) {
} else if (settings.large_file_storage?.type === 'AzureBlobStorage') {
s3ResourceSettings = {
resourceType: 'azure_blob',
resourcePath: settings.large_file_storage?.azure_blob_resource_path?.replace('$res:', ''),
publicResource: settings.large_file_storage?.public_resource
}
} else if (
settings.large_file_storage?.type === LargeFileStorage.type.AZURE_WORKLOAD_IDENTITY
) {
} else if (settings.large_file_storage?.type === 'AzureWorkloadIdentity') {
s3ResourceSettings = {
resourceType: 'azure_workload_identity',
resourcePath: settings.large_file_storage?.azure_blob_resource_path?.replace('$res:', ''),
publicResource: settings.large_file_storage?.public_resource
}
} else if (settings.large_file_storage?.type === LargeFileStorage.type.S3AWS_OIDC) {
} else if (settings.large_file_storage?.type === 'S3AwsOidc') {
s3ResourceSettings = {
resourceType: 's3_aws_oidc',
resourcePath: settings.large_file_storage?.s3_resource_path?.replace('$res:', ''),
@@ -792,7 +793,7 @@
<div class="absolute top-0 right-0 bottom-0 left-0 bg-surface-disabled/50 z-40" />
{/if}
<ScriptPicker
kinds={[Script.kind.SCRIPT]}
kinds={['script']}
allowFlow
bind:itemKind
bind:scriptPath
@@ -1068,6 +1069,13 @@
uploads are limited to files {'<'} 50MB. Consider upgrading to Windmill EE to use this feature
with large buckets.
</Alert>
{:else}
<Alert type="info" title="Logs storage is set at the instance level">
This setting is only for storage of large files allowing to upload files directly to
object storage using S3Object and use the wmill sdk to read and write large files backed
by an object storage. The automatics large logs storage is set by the superadmins in the
instance settings UI.
</Alert>
{/if}
{#if s3ResourceSettings}
<div class="mt-5">

Some files were not shown because too many files have changed in this diff Show More