From 071a0ae92728c1a13a61ad3283cf0a680bdfd079 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 17 Apr 2024 21:37:18 +0200 Subject: [PATCH 1/4] feat: show more for logs on s3 directly possible from browser log viewer --- backend/src/ee.rs | 17 +- backend/windmill-api/openapi.yaml | 48 +- backend/windmill-api/src/ee.rs | 7 +- backend/windmill-api/src/job_helpers_ee.rs | 6 +- backend/windmill-api/src/jobs.rs | 79 +++ backend/windmill-api/src/oauth2_ee.rs | 200 +------ backend/windmill-api/src/oidc_ee.rs | 18 +- backend/windmill-api/src/saml_ee.rs | 26 +- backend/windmill-api/src/scim_ee.rs | 24 +- backend/windmill-api/src/stripe_ee.rs | 8 +- backend/windmill-audit/src/audit_ee.rs | 49 +- backend/windmill-common/src/ee.rs | 21 +- .../windmill-common/src/job_s3_helpers_ee.rs | 19 +- backend/windmill-common/src/stats_ee.rs | 36 +- backend/windmill-git-sync/src/git_sync_ee.rs | 18 +- backend/windmill-worker/src/common.rs | 12 +- frontend/package-lock.json | 504 ++++++++++++++---- frontend/package.json | 10 +- frontend/src/lib/common.ts | 2 +- frontend/src/lib/components/AddUser.svelte | 2 +- .../src/lib/components/ApiConnectForm.svelte | 5 +- frontend/src/lib/components/AppConnect.svelte | 2 +- .../src/lib/components/DeployWorkspace.svelte | 4 +- frontend/src/lib/components/Dev.svelte | 11 +- frontend/src/lib/components/DiffDrawer.svelte | 2 +- frontend/src/lib/components/Editor.svelte | 4 +- frontend/src/lib/components/EditorBar.svelte | 59 +- .../components/ErrorOrRecoveryHandler.svelte | 8 +- .../src/lib/components/FlowBuilder.svelte | 12 +- .../FlowLoopIterationPreview.svelte | 2 +- .../lib/components/FlowPreviewContent.svelte | 2 +- .../components/FlowStatusViewerInner.svelte | 34 +- .../FlowStatusWaitingForEvents.svelte | 10 +- .../src/lib/components/HighlightCode.svelte | 4 +- .../lib/components/InstanceSettings.svelte | 3 +- frontend/src/lib/components/LogViewer.svelte | 93 +++- .../src/lib/components/ModulePreview.svelte | 6 +- .../src/lib/components/ModuleStatus.svelte | 14 +- .../lib/components/ParqetTableRenderer.svelte | 6 +- .../src/lib/components/ResourceEditor.svelte | 2 +- .../src/lib/components/SavedInputs.svelte | 18 +- .../lib/components/ScheduleEditorInner.svelte | 12 +- .../src/lib/components/ScriptBuilder.svelte | 26 +- .../src/lib/components/ScriptEditor.svelte | 5 +- .../src/lib/components/ScriptPicker.svelte | 4 +- .../lib/components/SuperadminSettings.svelte | 4 +- .../src/lib/components/TestConnection.svelte | 6 +- .../src/lib/components/TestJobLoader.svelte | 4 +- .../src/lib/components/WorkspaceGroup.svelte | 4 +- .../display/dbtable/queries/count.ts | 3 +- .../apps/components/display/dbtable/utils.ts | 39 +- .../apps/editor/AppEditorHeader.svelte | 6 +- .../apps/editor/AppReportsDrawer.svelte | 11 +- .../apps/editor/DeploymentHistory.svelte | 4 +- .../apps/editor/componentsPanel/groupUtils.ts | 4 +- .../apps/editor/componentsPanel/themeUtils.ts | 4 +- .../EmptyInlineScript.svelte | 14 +- .../InlineScriptEditor.svelte | 2 +- .../InlineScriptsPanel.svelte | 2 +- .../mainInput/WorkspaceScriptList.svelte | 2 +- frontend/src/lib/components/apps/types.ts | 2 +- .../auditLogs/AuditLogDetails.svelte | 12 +- .../auditLogs/AuditLogsFilters.svelte | 2 +- .../common/languageIcons/LanguageIcon.svelte | 28 +- .../lib/components/common/table/AppRow.svelte | 2 +- .../copilot/FlowCopilotDrawer.svelte | 10 +- .../lib/components/copilot/ScriptGen.svelte | 14 +- .../src/lib/components/copilot/StepGen.svelte | 2 +- frontend/src/lib/components/copilot/flow.ts | 15 +- frontend/src/lib/components/copilot/lib.ts | 4 +- frontend/src/lib/components/copilot/utils.ts | 6 +- frontend/src/lib/components/details/utils.ts | 2 +- .../components/flows/FlowProgressBar.svelte | 9 +- .../flows/content/FlowInputs.svelte | 15 +- .../components/flows/content/FlowLoop.svelte | 3 +- .../flows/content/FlowModuleWrapper.svelte | 10 +- .../flows/content/FlowWhileLoop.svelte | 16 +- .../flows/content/ScriptEditorDrawer.svelte | 9 +- .../flows/content/SuspendDrawer.svelte | 11 +- frontend/src/lib/components/flows/dfs.ts | 2 +- .../lib/components/flows/flowStateUtils.ts | 10 +- .../src/lib/components/graph/FlowGraph.svelte | 6 +- frontend/src/lib/components/graph/model.ts | 2 +- frontend/src/lib/components/graph/util.ts | 14 +- .../src/lib/components/home/ItemsList.svelte | 4 +- .../src/lib/components/jobs/JobPreview.svelte | 4 +- .../src/lib/components/runs/JobLoader.svelte | 34 +- .../src/lib/components/runs/JobPreview.svelte | 6 +- .../lib/components/runs/QueuePopover.svelte | 2 +- .../components/scriptEditor/LogPanel.svelte | 15 +- .../src/lib/components/tutorials/utils.ts | 4 +- frontend/src/lib/hub.ts | 4 +- frontend/src/lib/infer.ts | 12 +- frontend/src/lib/script_helpers.ts | 12 +- frontend/src/lib/scripts.ts | 37 +- frontend/src/lib/utils.ts | 2 +- .../src/routes/(root)/(logged)/+layout.svelte | 3 +- .../src/routes/(root)/(logged)/+page.svelte | 4 +- .../(root)/(logged)/apps/add/+page.svelte | 10 +- .../(logged)/apps/edit/[...path]/+page.svelte | 14 +- .../(logged)/apps/get/[...path]/+page.svelte | 4 +- .../(root)/(logged)/resources/+page.svelte | 4 +- .../(root)/(logged)/run/[...run]/+page.svelte | 11 +- .../(logged)/runs/[...path]/+page.svelte | 4 +- .../(root)/(logged)/scripts/add/+page.svelte | 6 +- .../scripts/edit/[...path]/+page.svelte | 2 +- .../user/(user)/accept_invite/+page.svelte | 2 +- .../user/(user)/create_workspace/+page.svelte | 2 +- .../(logged)/user/(user)/login/+page.svelte | 2 +- .../(logged)/workspace_settings/+page.svelte | 34 +- .../[job]/[resume]/[hmac]/+page.svelte | 6 +- .../[workspace]/[...secret]/+page.svelte | 8 +- 112 files changed, 1057 insertions(+), 964 deletions(-) mode change 100644 => 120000 backend/src/ee.rs mode change 100644 => 120000 backend/windmill-api/src/ee.rs mode change 100644 => 120000 backend/windmill-api/src/job_helpers_ee.rs mode change 100644 => 120000 backend/windmill-api/src/oauth2_ee.rs mode change 100644 => 120000 backend/windmill-api/src/oidc_ee.rs mode change 100644 => 120000 backend/windmill-api/src/saml_ee.rs mode change 100644 => 120000 backend/windmill-api/src/scim_ee.rs mode change 100644 => 120000 backend/windmill-api/src/stripe_ee.rs mode change 100644 => 120000 backend/windmill-audit/src/audit_ee.rs mode change 100644 => 120000 backend/windmill-common/src/ee.rs mode change 100644 => 120000 backend/windmill-common/src/job_s3_helpers_ee.rs mode change 100644 => 120000 backend/windmill-common/src/stats_ee.rs mode change 100644 => 120000 backend/windmill-git-sync/src/git_sync_ee.rs diff --git a/backend/src/ee.rs b/backend/src/ee.rs deleted file mode 100644 index ef944b984b..0000000000 --- a/backend/src/ee.rs +++ /dev/null @@ -1,16 +0,0 @@ -use anyhow::anyhow; -#[cfg(feature = "enterprise")] -use windmill_common::error::{Error, Result}; - -pub async fn set_license_key(_license_key: String) -> anyhow::Result<()> { - // Implementation is not open source - Err(anyhow!("License cannot be set in Windmill CE")) -} - -#[cfg(feature = "enterprise")] -pub async fn verify_license_key() -> Result<()> { - // Implementation is not open source - Err(Error::InternalErr( - "License always invalid in Windmill CE".to_string(), - )) -} diff --git a/backend/src/ee.rs b/backend/src/ee.rs new file mode 120000 index 0000000000..ca288038c6 --- /dev/null +++ b/backend/src/ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/src/ee.rs \ No newline at end of file diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 215dec831f..f67d648a30 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -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: diff --git a/backend/windmill-api/src/ee.rs b/backend/windmill-api/src/ee.rs deleted file mode 100644 index a9d170a3ac..0000000000 --- a/backend/windmill-api/src/ee.rs +++ /dev/null @@ -1,6 +0,0 @@ -use anyhow::anyhow; - -pub async fn validate_license_key(_license_key: String) -> anyhow::Result { - // Implementation is not open source - Err(anyhow!("License can't be validated in Windmill CE")) -} diff --git a/backend/windmill-api/src/ee.rs b/backend/windmill-api/src/ee.rs new file mode 120000 index 0000000000..0267c6e6fd --- /dev/null +++ b/backend/windmill-api/src/ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/job_helpers_ee.rs b/backend/windmill-api/src/job_helpers_ee.rs deleted file mode 100644 index 61a946bb84..0000000000 --- a/backend/windmill-api/src/job_helpers_ee.rs +++ /dev/null @@ -1,5 +0,0 @@ -use axum::Router; - -pub fn workspaced_service() -> Router { - Router::new() -} diff --git a/backend/windmill-api/src/job_helpers_ee.rs b/backend/windmill-api/src/job_helpers_ee.rs new file mode 120000 index 0000000000..8cc4fbe8bf --- /dev/null +++ b/backend/windmill-api/src/job_helpers_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/job_helpers_ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index be25a89bd6..b9851bc99a 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -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", @@ -3484,6 +3485,84 @@ pub struct JobUpdate { pub flow_status: Option, } +// #[cfg(all(feature = "enterprise", feature = "parquet"))] +// async fn get_logs_from_store( +// log_offset: i32, +// logs: &str, +// log_file_index: Option>, +// ) -> Option> { +// 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; +// } +// } 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 { + 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 { + return Err(error::Error::NotFound(format!( + "Get log file is an EE feature: {}", + file_p + ))); +} + async fn get_job_update( Extension(db): Extension, Path((w_id, job_id)): Path<(String, Uuid)>, diff --git a/backend/windmill-api/src/oauth2_ee.rs b/backend/windmill-api/src/oauth2_ee.rs deleted file mode 100644 index caf9881c15..0000000000 --- a/backend/windmill-api/src/oauth2_ee.rs +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Author: Ruben Fiszel - * Copyright: Windmill Labs, Inc 2022 - * This file and its contents are licensed under the AGPLv3 License. - * Please see the included NOTICE for copyright information and - * LICENSE-AGPL for a copy of the license. - */ - -use std::{collections::HashMap, fmt::Debug}; - -use axum::{routing::get, Json, Router}; -use hmac::Mac; -use hyper::HeaderMap; - -use oauth2::{Client as OClient, *}; -use serde::{Deserialize, Serialize}; -use sqlx::{Postgres, Transaction}; -use windmill_common::more_serde::maybe_number_opt; - -use crate::OAUTH_CLIENTS; -use windmill_common::error; -use windmill_common::oauth2::*; - -use crate::db::DB; -use std::str; - -pub fn global_service() -> Router { - Router::new() - .route("/list_supabase", get(list_supabase)) - .route("/list_logins", get(list_logins)) - .route("/list_connects", get(list_connects)) -} - -pub fn workspaced_service() -> Router { - Router::new() -} - -#[derive(Serialize)] -#[serde(tag = "type")] -pub enum InstanceEvent { - UserAdded { email: String }, - // UserDeleted { email: String }, - // UserDeletedWorkspace { workspace: String, email: String }, - UserAddedWorkspace { workspace: String, email: String }, - UserInvitedWorkspace { workspace: String, email: String }, - UserJoinedWorkspace { workspace: String, email: String, username: String }, -} - -#[derive(Debug, Clone)] -pub struct ClientWithScopes { - _client: OClient, - scopes: Vec, - extra_params: Option>, - _extra_params_callback: Option>, - _allowed_domains: Option>, - _userinfo_url: Option, -} - -pub type BasicClientsMap = HashMap; - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct OAuthConfig { - auth_url: String, - token_url: String, - userinfo_url: Option, - scopes: Option>, - extra_params: Option>, - extra_params_callback: Option>, - req_body_auth: Option, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct OAuthClient { - id: String, - secret: String, - allowed_domains: Option>, - connect_config: Option, - login_config: Option, -} - -#[derive(Debug)] -pub struct AllClients { - pub logins: BasicClientsMap, - pub connects: BasicClientsMap, - pub slack: Option, -} - -pub fn build_oauth_clients( - _base_url: &str, - _oauths_from_config: Option>, -) -> anyhow::Result { - // Implementation is not open source - return Ok(AllClients { - logins: HashMap::default(), - connects: HashMap::default(), - slack: None, - }); -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct TokenResponse { - access_token: AccessToken, - #[serde(deserialize_with = "maybe_number_opt")] - #[serde(default)] - expires_in: Option, - refresh_token: Option, - #[serde(deserialize_with = "helpers::deserialize_space_delimited_vec")] - #[serde(serialize_with = "helpers::serialize_space_delimited_vec")] - #[serde(default)] - scope: Option>, -} - -#[derive(Serialize)] -struct Logins { - oauth: Vec, - saml: Option, -} -async fn list_logins() -> error::JsonResult { - // Implementation is not open source - return Ok(Json(Logins { oauth: vec![], saml: None })); -} - -#[derive(Serialize)] -struct ScopesAndParams { - scopes: Vec, - extra_params: Option>, -} -async fn list_connects() -> error::JsonResult> { - Ok(Json( - (&OAUTH_CLIENTS.read().await.connects) - .into_iter() - .map(|(k, v)| { - ( - k.to_owned(), - ScopesAndParams { - scopes: v.scopes.clone(), - extra_params: v.extra_params.clone(), - }, - ) - }) - .collect::>(), - )) -} - -pub async fn _refresh_token<'c>( - _tx: Transaction<'c, Postgres>, - _path: &str, - _w_id: &str, - _id: i32, -) -> error::Result { - // Implementation is not open source - Err(error::Error::BadRequest( - "Not implemented in Windmill's Open Source repository".to_string(), - )) -} - -async fn list_supabase(_headers: HeaderMap) -> error::Result { - // Implementation is not open source - Err(error::Error::BadRequest( - "Not implemented in Windmill's Open Source repository".to_string(), - )) -} - -pub async fn check_nb_of_user(db: &DB) -> error::Result<()> { - let nb_users_sso = - sqlx::query_scalar!("SELECT COUNT(*) FROM password WHERE login_type != 'password'",) - .fetch_one(db) - .await?; - if nb_users_sso.unwrap_or(0) >= 10 { - return Err(error::Error::BadRequest( - "You have reached the maximum number of oauth users accounts (10) without an enterprise license" - .to_string(), - )); - } - - let nb_users = sqlx::query_scalar!("SELECT COUNT(*) FROM password",) - .fetch_one(db) - .await?; - if nb_users.unwrap_or(0) >= 50 { - return Err(error::Error::BadRequest( - "You have reached the maximum number of accounts (50) without an enterprise license" - .to_string(), - )); - } - return Ok(()); -} - -#[derive(Clone, Debug)] -pub struct SlackVerifier { - _mac: HmacSha256, -} - -impl SlackVerifier { - pub fn new>(secret: S) -> anyhow::Result { - HmacSha256::new_from_slice(secret.as_ref()) - .map(|mac| SlackVerifier { _mac: mac }) - .map_err(|_| anyhow::anyhow!("invalid secret")) - } -} diff --git a/backend/windmill-api/src/oauth2_ee.rs b/backend/windmill-api/src/oauth2_ee.rs new file mode 120000 index 0000000000..1ab1665454 --- /dev/null +++ b/backend/windmill-api/src/oauth2_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/oauth2_ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/oidc_ee.rs b/backend/windmill-api/src/oidc_ee.rs deleted file mode 100644 index 248b990f54..0000000000 --- a/backend/windmill-api/src/oidc_ee.rs +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: Ruben Fiszel - * Copyright: Windmill Labs, Inc 2023 - * This file and its contents are licensed under the AGPLv3 License. - * Please see the included NOTICE for copyright information and - * LICENSE-AGPL for a copy of the license. - */ - -use axum::Router; - -pub fn global_service() -> Router { - Router::new() -} - -pub fn workspaced_service() -> Router { - Router::new() -} diff --git a/backend/windmill-api/src/oidc_ee.rs b/backend/windmill-api/src/oidc_ee.rs new file mode 120000 index 0000000000..1e902de563 --- /dev/null +++ b/backend/windmill-api/src/oidc_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/oidc_ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/saml_ee.rs b/backend/windmill-api/src/saml_ee.rs deleted file mode 100644 index b3f1d4653c..0000000000 --- a/backend/windmill-api/src/saml_ee.rs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: Ruben Fiszel - * Copyright: Windmill Labs, Inc 2023 - * This file and its contents are licensed under the AGPLv3 License. - * Please see the included NOTICE for copyright information and - * LICENSE-AGPL for a copy of the license. - */ -#![allow(non_snake_case)] - -use axum::{routing::post, Router}; - -pub struct ServiceProviderExt(); - -pub async fn build_sp_extension() -> anyhow::Result { - return Ok(ServiceProviderExt()); -} - -pub fn global_service() -> Router { - Router::new().route("/acs", post(acs)) -} - -pub async fn acs() -> String { - // Implementation is not open source as it is a Windmill Enterprise Edition feature - "SAML available only in enterprise version".to_string() -} diff --git a/backend/windmill-api/src/saml_ee.rs b/backend/windmill-api/src/saml_ee.rs new file mode 120000 index 0000000000..65286e3f12 --- /dev/null +++ b/backend/windmill-api/src/saml_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/saml_ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/scim_ee.rs b/backend/windmill-api/src/scim_ee.rs deleted file mode 100644 index f11097f874..0000000000 --- a/backend/windmill-api/src/scim_ee.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Author: Ruben Fiszel - * Copyright: Windmill Labs, Inc 2023 - * This file and its contents are licensed under the AGPLv3 License. - * Please see the included NOTICE for copyright information and - * LICENSE-AGPL for a copy of the license. - */ - -use axum::{middleware::Next, response::Response, routing::get, Router}; -use hyper::Request; - -pub fn global_service() -> Router { - Router::new().route("/ee", get(ee)) -} - -pub async fn ee() -> String { - return "Enterprise Edition".to_string(); -} - -pub async fn has_scim_token(_request: Request, _next: Next) -> Response { - //Not implemented in open-source version - todo!() -} diff --git a/backend/windmill-api/src/scim_ee.rs b/backend/windmill-api/src/scim_ee.rs new file mode 120000 index 0000000000..cd27dc4526 --- /dev/null +++ b/backend/windmill-api/src/scim_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/scim_ee.rs \ No newline at end of file diff --git a/backend/windmill-api/src/stripe_ee.rs b/backend/windmill-api/src/stripe_ee.rs deleted file mode 100644 index 1aea2ecd2d..0000000000 --- a/backend/windmill-api/src/stripe_ee.rs +++ /dev/null @@ -1,7 +0,0 @@ -#[cfg(feature = "stripe")] -use axum::Router; - -#[cfg(feature = "stripe")] -pub fn add_stripe_routes(router: Router) -> Router { - return router; -} diff --git a/backend/windmill-api/src/stripe_ee.rs b/backend/windmill-api/src/stripe_ee.rs new file mode 120000 index 0000000000..a6c7d1230e --- /dev/null +++ b/backend/windmill-api/src/stripe_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-api/src/stripe_ee.rs \ No newline at end of file diff --git a/backend/windmill-audit/src/audit_ee.rs b/backend/windmill-audit/src/audit_ee.rs deleted file mode 100644 index 5bb52e7b3f..0000000000 --- a/backend/windmill-audit/src/audit_ee.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: Ruben Fiszel - * Copyright: Windmill Labs, Inc 2022 - * This file and its contents are licensed under the AGPLv3 License. - * Please see the included NOTICE for copyright information and - * LICENSE-AGPL for a copy of the license. - */ -use std::collections::HashMap; - -use windmill_common::{ - error::{Error, Result}, - utils::Pagination, -}; - -use crate::{ActionKind, AuditLog, ListAuditLogQuery}; -use sqlx::{Postgres, Transaction}; - -#[tracing::instrument(level = "trace", skip_all)] -pub async fn audit_log<'c, E: sqlx::Executor<'c, Database = Postgres>>( - _db: E, - _username: &str, - mut _operation: &str, - _action_kind: ActionKind, - _w_id: &str, - mut _resource: Option<&str>, - _parameters: Option>, -) -> Result<()> { - // Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature - Ok(()) -} - -pub async fn list_audit( - _tx: Transaction<'_, Postgres>, - _w_id: String, - _pagination: Pagination, - _lq: ListAuditLogQuery, -) -> Result> { - // Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature - return Ok(vec![]); -} - -pub async fn get_audit(tx: Transaction<'_, Postgres>, _id: i32, _w_id: &str) -> Result { - // Implementation is not open source as Audit logs is a Windmill Enterprise Edition feature - tx.commit().await?; - Err(Error::NotFound( - "Audit log not not available in Windmill Community edition".to_string(), - )) -} diff --git a/backend/windmill-audit/src/audit_ee.rs b/backend/windmill-audit/src/audit_ee.rs new file mode 120000 index 0000000000..f8d4a81d03 --- /dev/null +++ b/backend/windmill-audit/src/audit_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-audit/src/audit_ee.rs \ No newline at end of file diff --git a/backend/windmill-common/src/ee.rs b/backend/windmill-common/src/ee.rs deleted file mode 100644 index c942447bbc..0000000000 --- a/backend/windmill-common/src/ee.rs +++ /dev/null @@ -1,20 +0,0 @@ -use crate::ee::LicensePlan::Community; -use std::sync::Arc; -use tokio::sync::RwLock; - -lazy_static::lazy_static! { - pub static ref LICENSE_KEY_VALID: Arc> = Arc::new(RwLock::new(true)); - pub static ref LICENSE_KEY_ID: Arc> = Arc::new(RwLock::new("".to_string())); - pub static ref LICENSE_KEY: Arc> = Arc::new(RwLock::new("".to_string())); -} - -pub enum LicensePlan { - Community, - Pro, - Enterprise, -} - -pub async fn get_license_plan() -> LicensePlan { - // Implementation is not open source - return Community; -} diff --git a/backend/windmill-common/src/ee.rs b/backend/windmill-common/src/ee.rs new file mode 120000 index 0000000000..3220066a5d --- /dev/null +++ b/backend/windmill-common/src/ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-common/src/ee.rs \ No newline at end of file diff --git a/backend/windmill-common/src/job_s3_helpers_ee.rs b/backend/windmill-common/src/job_s3_helpers_ee.rs deleted file mode 100644 index b00c00a583..0000000000 --- a/backend/windmill-common/src/job_s3_helpers_ee.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::future::Future; - -use crate::{ - error::Error, - s3_helpers::{ObjectStoreResource, StorageResourceType}, -}; - -pub async fn get_s3_resource_internal<'c, F, Fut>( - _resource_type: StorageResourceType, - _s3_resource_value_raw: serde_json::Value, - _gen_token: F, -) -> crate::error::Result -where - F: FnOnce(String) -> Fut, - Fut: Future> + Send + 'static, -{ - todo!() -} diff --git a/backend/windmill-common/src/job_s3_helpers_ee.rs b/backend/windmill-common/src/job_s3_helpers_ee.rs new file mode 120000 index 0000000000..6c8430be70 --- /dev/null +++ b/backend/windmill-common/src/job_s3_helpers_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-common/src/job_s3_helpers_ee.rs \ No newline at end of file diff --git a/backend/windmill-common/src/stats_ee.rs b/backend/windmill-common/src/stats_ee.rs deleted file mode 100644 index 7fa3950276..0000000000 --- a/backend/windmill-common/src/stats_ee.rs +++ /dev/null @@ -1,35 +0,0 @@ -use crate::{error::Result, scripts::ScriptLang, utils::Mode, DB}; - -pub async fn get_disable_stats_setting(_db: &DB) -> bool { - // stats details are closed source - - false -} - -pub async fn schedule_stats( - _instance_name: String, - _mode: Mode, - _db: &DB, - _http_client: &reqwest::Client, - _is_enterprise: bool, -) -> () { - // stats details are closed source -} - -#[derive(Debug, sqlx::FromRow, serde::Serialize)] -struct JobsUsage { - language: Option, - total_duration: i64, - count: i64, -} - -pub async fn send_stats( - _instance_name: &String, - _mode: &Mode, - _http_client: &reqwest::Client, - _db: &DB, - _is_enterprise: bool, -) -> Result<()> { - // stats details are closed source - Ok(()) -} diff --git a/backend/windmill-common/src/stats_ee.rs b/backend/windmill-common/src/stats_ee.rs new file mode 120000 index 0000000000..d0ddc5bd1d --- /dev/null +++ b/backend/windmill-common/src/stats_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-common/src/stats_ee.rs \ No newline at end of file diff --git a/backend/windmill-git-sync/src/git_sync_ee.rs b/backend/windmill-git-sync/src/git_sync_ee.rs deleted file mode 100644 index 4be2858c27..0000000000 --- a/backend/windmill-git-sync/src/git_sync_ee.rs +++ /dev/null @@ -1,17 +0,0 @@ -use windmill_common::error::Result; - -use crate::{DeployedObject, DB}; - -pub async fn handle_deployment_metadata<'c, R: rsmq_async::RsmqConnection + Send + Clone + 'c>( - _email: &str, - _created_by: &str, - _db: &DB, - _w_id: &str, - _obj: DeployedObject, - _deployment_message: Option, - _rsmq: Option, - _skip_db_insert: bool, -) -> Result<()> { - // Git sync is an enterprise feature and not part of the open-source version - return Ok(()); -} diff --git a/backend/windmill-git-sync/src/git_sync_ee.rs b/backend/windmill-git-sync/src/git_sync_ee.rs new file mode 120000 index 0000000000..0824f2c28c --- /dev/null +++ b/backend/windmill-git-sync/src/git_sync_ee.rs @@ -0,0 +1 @@ +/git/windmill/../windmill-ee-private/windmill-git-sync/src/git_sync_ee.rs \ No newline at end of file diff --git a/backend/windmill-worker/src/common.rs b/backend/windmill-worker/src/common.rs index ea6f96846f..764300076b 100644 --- a/backend/windmill-worker/src/common.rs +++ b/backend/windmill-worker/src/common.rs @@ -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(¤t_logs); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 142a62b29d..bb5978e784 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -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", diff --git a/frontend/package.json b/frontend/package.json index dda8abde58..ea3a8a3ff8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", diff --git a/frontend/src/lib/common.ts b/frontend/src/lib/common.ts index b7a47704e6..3e11745a99 100644 --- a/frontend/src/lib/common.ts +++ b/frontend/src/lib/common.ts @@ -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 diff --git a/frontend/src/lib/components/AddUser.svelte b/frontend/src/lib/components/AddUser.svelte index 7a0454792a..e6bb6be627 100644 --- a/frontend/src/lib/components/AddUser.svelte +++ b/frontend/src/lib/components/AddUser.svelte @@ -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() diff --git a/frontend/src/lib/components/ApiConnectForm.svelte b/frontend/src/lib/components/ApiConnectForm.svelte index a4e23f874b..a1a687b668 100644 --- a/frontend/src/lib/components/ApiConnectForm.svelte +++ b/frontend/src/lib/components/ApiConnectForm.svelte @@ -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 diff --git a/frontend/src/lib/components/AppConnect.svelte b/frontend/src/lib/components/AppConnect.svelte index 0d02a11881..0a6d13a8dd 100644 --- a/frontend/src/lib/components/AppConnect.svelte +++ b/frontend/src/lib/components/AppConnect.svelte @@ -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'] } diff --git a/frontend/src/lib/components/DeployWorkspace.svelte b/frontend/src/lib/components/DeployWorkspace.svelte index deb1ba4fb8..a746f1bcf8 100644 --- a/frontend/src/lib/components/DeployWorkspace.svelte +++ b/frontend/src/lib/components/DeployWorkspace.svelte @@ -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' }) } diff --git a/frontend/src/lib/components/Dev.svelte b/frontend/src/lib/components/Dev.svelte index bad2532823..cc80709daf 100644 --- a/frontend/src/lib/components/Dev.svelte +++ b/frontend/src/lib/components/Dev.svelte @@ -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 ( diff --git a/frontend/src/lib/components/DiffDrawer.svelte b/frontend/src/lib/components/DiffDrawer.svelte index ac01e49882..dce8e12ffa 100644 --- a/frontend/src/lib/components/DiffDrawer.svelte +++ b/frontend/src/lib/components/DiffDrawer.svelte @@ -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) } diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index aaa8f52688..993805d61e 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -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() diff --git a/frontend/src/lib/components/EditorBar.svelte b/frontend/src/lib/components/EditorBar.svelte index 63451d69be..a74d23d9ec 100644 --- a/frontend/src/lib/components/EditorBar.svelte +++ b/frontend/src/lib/components/EditorBar.svelte @@ -3,7 +3,7 @@ + @@ -78,11 +126,13 @@
{#if content}{#if content?.length > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... {#if content}{@const len =
+						(content?.length ?? 0) +
+						(loadedFromObjectStore?.length ?? 0)}{#if downloadStartUrl}
{:else if len > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... {/if}{@html html}{:else if isLoading}Waiting for job to start...{:else}No logs are available yet{/if}
@@ -91,7 +141,10 @@
-
+
@@ -139,14 +192,14 @@ > {/if}
{#if content}{#if content?.length > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)... 
-				{/if}{@html html}{:else if !isLoading}No logs are available yet{/if}
{#if content}{@const len = + (content?.length ?? 0) + + (loadedFromObjectStore?.length ?? 0)}{#if downloadStartUrl}
{:else if len > LOG_LIMIT}(truncated to the last {LOG_LIMIT} characters)

{/if}{@html html}{:else if !isLoading}No logs are available yet{/if}
diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index 91531113b8..16efd6585f 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -1,6 +1,6 @@ -{#if type == FlowStatusModule.type.WAITING_FOR_EVENTS} +{#if type == 'WaitingForEvents'} Waiting to be resumed by resume events such as approvals -{:else if type == FlowStatusModule.type.WAITING_FOR_PRIOR_STEPS} +{:else if type == 'WaitingForPriorSteps'} Waiting for prior steps to complete -{:else if type == FlowStatusModule.type.WAITING_FOR_EXECUTOR} +{:else if type == 'WaitingForExecutor'} {#if scheduled_for && forLater(scheduled_for.toString())} @@ -28,9 +28,9 @@ Job is waiting for an executor {/if} -{:else if type == FlowStatusModule.type.SUCCESS} +{:else if type == 'Success'} Success -{:else if type == FlowStatusModule.type.FAILURE} +{:else if type == 'Failure'} Failure {/if} diff --git a/frontend/src/lib/components/ParqetTableRenderer.svelte b/frontend/src/lib/components/ParqetTableRenderer.svelte index 7f2d25feb3..f3714080c7 100644 --- a/frontend/src/lib/components/ParqetTableRenderer.svelte +++ b/frontend/src/lib/components/ParqetTableRenderer.svelte @@ -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 }) diff --git a/frontend/src/lib/components/ResourceEditor.svelte b/frontend/src/lib/components/ResourceEditor.svelte index 6afe100309..daeb030dba 100644 --- a/frontend/src/lib/components/ResourceEditor.svelte +++ b/frontend/src/lib/components/ResourceEditor.svelte @@ -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) diff --git a/frontend/src/lib/components/SavedInputs.svelte b/frontend/src/lib/components/SavedInputs.svelte index 7ff2558152..1af6a54cef 100644 --- a/frontend/src/lib/components/SavedInputs.svelte +++ b/frontend/src/lib/components/SavedInputs.svelte @@ -1,6 +1,12 @@ - (open = false)} + (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" diff --git a/frontend/src/lib/components/apps/editor/DeploymentHistory.svelte b/frontend/src/lib/components/apps/editor/DeploymentHistory.svelte index c90fffb3e6..2f7ca4ed99 100644 --- a/frontend/src/lib/components/apps/editor/DeploymentHistory.svelte +++ b/frontend/src/lib/components/apps/editor/DeploymentHistory.svelte @@ -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 diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/groupUtils.ts b/frontend/src/lib/components/apps/editor/componentsPanel/groupUtils.ts index ab2440d069..0ea8aadff1 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/groupUtils.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/groupUtils.ts @@ -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 { diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/themeUtils.ts b/frontend/src/lib/components/apps/editor/componentsPanel/themeUtils.ts index f780ee91a9..b6dddcc25f 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/themeUtils.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/themeUtils.ts @@ -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 } diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte index fe01bdbd6c..a4b8bf06e5 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte @@ -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 { @@ -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']][] diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte index 1bb9e09daa..ea91dbf397 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte @@ -41,7 +41,7 @@ let validCode = true async function inferInlineScriptSchema( - language: Preview.language, + language: Preview['language'], content: string, schema: Schema ): Promise { diff --git a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte index d556b00797..6b903f461e 100644 --- a/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte +++ b/frontend/src/lib/components/apps/editor/inlineScriptsPanel/InlineScriptsPanel.svelte @@ -86,7 +86,7 @@ parent_hash: undefined, schema: runnable.inlineScript.schema, is_template: false, - language + language: language! } }) diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte index 62b6806e37..47494ea210 100644 --- a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte +++ b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte @@ -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' diff --git a/frontend/src/lib/components/apps/types.ts b/frontend/src/lib/components/apps/types.ts index 5ae3f995c4..a7056bd9b7 100644 --- a/frontend/src/lib/components/apps/types.ts +++ b/frontend/src/lib/components/apps/types.ts @@ -110,7 +110,7 @@ export type GridItem = FilledItem export type InlineScript = { content: string - language: Preview.language | 'frontend' + language: Preview['language'] | 'frontend' path?: string schema?: Schema lock?: string diff --git a/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte b/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte index cc65c019f2..7e1e546ac0 100644 --- a/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte +++ b/frontend/src/lib/components/auditLogs/AuditLogDetails.svelte @@ -1,10 +1,14 @@
@@ -30,7 +34,7 @@ {/if} - {#if log.operation === AuditLog.operation.JOBS_RUN_SCRIPT} + {#if log.operation === 'jobs.run.script'}