From ee4887a303ae95bd0f0899548fcd785242c8ef22 Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Wed, 26 Mar 2025 18:38:47 +0100 Subject: [PATCH] feat: remove stripe dep (#5508) * remove automatic_billing * fix build * fix build * update ee ref * Update frontend/src/lib/components/settings/PremiumInfo.svelte Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- ...8234ca7d1efeee9661f3901f298da375e73f7.json | 22 +- ...2d3881fa44468ed5330a501daa0d61c84cb71.json | 14 - ...2fa84fefbb3df8bb1bc9996c40a86d464b8a1.json | 14 - ...2e60c9c24decb2a6b41125247bbf741e9c25.json} | 12 +- ...dcc40f463cbc52d94ed9315cf9a547d4c89f2.json | 22 +- ...0abf7531b2542a2da225152e19144400f950.json} | 18 +- backend/Cargo.lock | 291 +++--------------- backend/Cargo.toml | 7 +- backend/ee-repo-ref.txt | 2 +- ...5126_remove_automatic_billing_col.down.sql | 1 + ...105126_remove_automatic_billing_col.up.sql | 1 + backend/windmill-api/Cargo.toml | 3 +- backend/windmill-api/openapi.yaml | 43 +-- backend/windmill-api/src/lib.rs | 21 +- backend/windmill-api/src/stripe_ee.rs | 2 - backend/windmill-api/src/workspaces.rs | 5 +- .../components/settings/PremiumInfo.svelte | 172 +++-------- 17 files changed, 133 insertions(+), 517 deletions(-) delete mode 100644 backend/.sqlx/query-1e659916501e668913e591eb7282d3881fa44468ed5330a501daa0d61c84cb71.json delete mode 100644 backend/.sqlx/query-2d4d4564108376ab310cb4a50fa2fa84fefbb3df8bb1bc9996c40a86d464b8a1.json rename backend/.sqlx/{query-f8f893fb4f6f8c16bffb233a585df0b8c007c24993979fdc013aa57583905f50.json => query-4b8132b04e454eddfe6724c6cc3a2e60c9c24decb2a6b41125247bbf741e9c25.json} (57%) rename backend/.sqlx/{query-096ebf082d5e48b75ea7b9b6790ab25ecb4448717d6baf0d4b8b0a070eac47ff.json => query-71a040866adbd192080da165eb120abf7531b2542a2da225152e19144400f950.json} (90%) create mode 100644 backend/migrations/20250326105126_remove_automatic_billing_col.down.sql create mode 100644 backend/migrations/20250326105126_remove_automatic_billing_col.up.sql diff --git a/backend/.sqlx/query-08f288d2781d823e109a9e5b8848234ca7d1efeee9661f3901f298da375e73f7.json b/backend/.sqlx/query-08f288d2781d823e109a9e5b8848234ca7d1efeee9661f3901f298da375e73f7.json index f88791991d..388fd55418 100644 --- a/backend/.sqlx/query-08f288d2781d823e109a9e5b8848234ca7d1efeee9661f3901f298da375e73f7.json +++ b/backend/.sqlx/query-08f288d2781d823e109a9e5b8848234ca7d1efeee9661f3901f298da375e73f7.json @@ -100,51 +100,46 @@ }, { "ordinal": 19, - "name": "automatic_billing", - "type_info": "Bool" - }, - { - "ordinal": 20, "name": "default_scripts", "type_info": "Jsonb" }, { - "ordinal": 21, + "ordinal": 20, "name": "deploy_ui", "type_info": "Jsonb" }, { - "ordinal": 22, + "ordinal": 21, "name": "mute_critical_alerts", "type_info": "Bool" }, { - "ordinal": 23, + "ordinal": 22, "name": "color", "type_info": "Varchar" }, { - "ordinal": 24, + "ordinal": 23, "name": "operator_settings", "type_info": "Jsonb" }, { - "ordinal": 25, + "ordinal": 24, "name": "teams_command_script", "type_info": "Text" }, { - "ordinal": 26, + "ordinal": 25, "name": "teams_team_id", "type_info": "Text" }, { - "ordinal": 27, + "ordinal": 26, "name": "teams_team_name", "type_info": "Text" }, { - "ordinal": 28, + "ordinal": 27, "name": "git_app_installations", "type_info": "Jsonb" } @@ -174,7 +169,6 @@ true, true, true, - false, true, true, true, diff --git a/backend/.sqlx/query-1e659916501e668913e591eb7282d3881fa44468ed5330a501daa0d61c84cb71.json b/backend/.sqlx/query-1e659916501e668913e591eb7282d3881fa44468ed5330a501daa0d61c84cb71.json deleted file mode 100644 index 2cb0d351da..0000000000 --- a/backend/.sqlx/query-1e659916501e668913e591eb7282d3881fa44468ed5330a501daa0d61c84cb71.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE workspace_settings SET automatic_billing = false WHERE workspace_id = $1", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [] - }, - "hash": "1e659916501e668913e591eb7282d3881fa44468ed5330a501daa0d61c84cb71" -} diff --git a/backend/.sqlx/query-2d4d4564108376ab310cb4a50fa2fa84fefbb3df8bb1bc9996c40a86d464b8a1.json b/backend/.sqlx/query-2d4d4564108376ab310cb4a50fa2fa84fefbb3df8bb1bc9996c40a86d464b8a1.json deleted file mode 100644 index 8c26257ef8..0000000000 --- a/backend/.sqlx/query-2d4d4564108376ab310cb4a50fa2fa84fefbb3df8bb1bc9996c40a86d464b8a1.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE workspace_settings SET automatic_billing = TRUE WHERE workspace_id = $1", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [] - }, - "hash": "2d4d4564108376ab310cb4a50fa2fa84fefbb3df8bb1bc9996c40a86d464b8a1" -} diff --git a/backend/.sqlx/query-f8f893fb4f6f8c16bffb233a585df0b8c007c24993979fdc013aa57583905f50.json b/backend/.sqlx/query-4b8132b04e454eddfe6724c6cc3a2e60c9c24decb2a6b41125247bbf741e9c25.json similarity index 57% rename from backend/.sqlx/query-f8f893fb4f6f8c16bffb233a585df0b8c007c24993979fdc013aa57583905f50.json rename to backend/.sqlx/query-4b8132b04e454eddfe6724c6cc3a2e60c9c24decb2a6b41125247bbf741e9c25.json index 759f91c962..ab5b04afc6 100644 --- a/backend/.sqlx/query-f8f893fb4f6f8c16bffb233a585df0b8c007c24993979fdc013aa57583905f50.json +++ b/backend/.sqlx/query-4b8132b04e454eddfe6724c6cc3a2e60c9c24decb2a6b41125247bbf741e9c25.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT owner, premium, usage.usage as \"usage?\", workspace_settings.customer_id, workspace_settings.plan, workspace_settings.automatic_billing FROM workspace LEFT JOIN workspace_settings ON workspace_settings.workspace_id = $1 LEFT JOIN usage ON usage.id = $1 AND month_ = EXTRACT(YEAR FROM current_date) * 12 + EXTRACT(MONTH FROM current_date) AND usage.is_workspace IS true WHERE workspace.id = $1", + "query": "SELECT owner, premium, usage.usage as \"usage?\", workspace_settings.customer_id, workspace_settings.plan FROM workspace LEFT JOIN workspace_settings ON workspace_settings.workspace_id = $1 LEFT JOIN usage ON usage.id = $1 AND month_ = EXTRACT(YEAR FROM current_date) * 12 + EXTRACT(MONTH FROM current_date) AND usage.is_workspace IS true WHERE workspace.id = $1", "describe": { "columns": [ { @@ -27,11 +27,6 @@ "ordinal": 4, "name": "plan", "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "automatic_billing", - "type_info": "Bool" } ], "parameters": { @@ -44,9 +39,8 @@ false, false, true, - true, - false + true ] }, - "hash": "f8f893fb4f6f8c16bffb233a585df0b8c007c24993979fdc013aa57583905f50" + "hash": "4b8132b04e454eddfe6724c6cc3a2e60c9c24decb2a6b41125247bbf741e9c25" } diff --git a/backend/.sqlx/query-55cb03040bc2a8c53dd7fbb42bbdcc40f463cbc52d94ed9315cf9a547d4c89f2.json b/backend/.sqlx/query-55cb03040bc2a8c53dd7fbb42bbdcc40f463cbc52d94ed9315cf9a547d4c89f2.json index bc84f2a58a..009d9fe5d1 100644 --- a/backend/.sqlx/query-55cb03040bc2a8c53dd7fbb42bbdcc40f463cbc52d94ed9315cf9a547d4c89f2.json +++ b/backend/.sqlx/query-55cb03040bc2a8c53dd7fbb42bbdcc40f463cbc52d94ed9315cf9a547d4c89f2.json @@ -100,51 +100,46 @@ }, { "ordinal": 19, - "name": "automatic_billing", - "type_info": "Bool" - }, - { - "ordinal": 20, "name": "default_scripts", "type_info": "Jsonb" }, { - "ordinal": 21, + "ordinal": 20, "name": "deploy_ui", "type_info": "Jsonb" }, { - "ordinal": 22, + "ordinal": 21, "name": "mute_critical_alerts", "type_info": "Bool" }, { - "ordinal": 23, + "ordinal": 22, "name": "color", "type_info": "Varchar" }, { - "ordinal": 24, + "ordinal": 23, "name": "operator_settings", "type_info": "Jsonb" }, { - "ordinal": 25, + "ordinal": 24, "name": "teams_command_script", "type_info": "Text" }, { - "ordinal": 26, + "ordinal": 25, "name": "teams_team_id", "type_info": "Text" }, { - "ordinal": 27, + "ordinal": 26, "name": "teams_team_name", "type_info": "Text" }, { - "ordinal": 28, + "ordinal": 27, "name": "git_app_installations", "type_info": "Jsonb" } @@ -174,7 +169,6 @@ true, true, true, - false, true, true, true, diff --git a/backend/.sqlx/query-096ebf082d5e48b75ea7b9b6790ab25ecb4448717d6baf0d4b8b0a070eac47ff.json b/backend/.sqlx/query-71a040866adbd192080da165eb120abf7531b2542a2da225152e19144400f950.json similarity index 90% rename from backend/.sqlx/query-096ebf082d5e48b75ea7b9b6790ab25ecb4448717d6baf0d4b8b0a070eac47ff.json rename to backend/.sqlx/query-71a040866adbd192080da165eb120abf7531b2542a2da225152e19144400f950.json index 855f79f6ce..d17cf3c524 100644 --- a/backend/.sqlx/query-096ebf082d5e48b75ea7b9b6790ab25ecb4448717d6baf0d4b8b0a070eac47ff.json +++ b/backend/.sqlx/query-71a040866adbd192080da165eb120abf7531b2542a2da225152e19144400f950.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT workspace_id, slack_team_id, teams_team_id, teams_team_name, slack_name, slack_command_script, teams_command_script, slack_email, auto_invite_domain, auto_invite_operator, auto_add, customer_id, plan, webhook, deploy_to, ai_config, error_handler, error_handler_extra_args, error_handler_muted_on_cancel, large_file_storage, git_sync, deploy_ui, default_app, automatic_billing, default_scripts, mute_critical_alerts, color, operator_settings, git_app_installations FROM workspace_settings WHERE workspace_id = $1", + "query": "SELECT workspace_id, slack_team_id, teams_team_id, teams_team_name, slack_name, slack_command_script, teams_command_script, slack_email, auto_invite_domain, auto_invite_operator, auto_add, customer_id, plan, webhook, deploy_to, ai_config, error_handler, error_handler_extra_args, error_handler_muted_on_cancel, large_file_storage, git_sync, deploy_ui, default_app, default_scripts, mute_critical_alerts, color, operator_settings, git_app_installations FROM workspace_settings WHERE workspace_id = $1", "describe": { "columns": [ { @@ -120,31 +120,26 @@ }, { "ordinal": 23, - "name": "automatic_billing", - "type_info": "Bool" - }, - { - "ordinal": 24, "name": "default_scripts", "type_info": "Jsonb" }, { - "ordinal": 25, + "ordinal": 24, "name": "mute_critical_alerts", "type_info": "Bool" }, { - "ordinal": 26, + "ordinal": 25, "name": "color", "type_info": "Varchar" }, { - "ordinal": 27, + "ordinal": 26, "name": "operator_settings", "type_info": "Jsonb" }, { - "ordinal": 28, + "ordinal": 27, "name": "git_app_installations", "type_info": "Jsonb" } @@ -178,7 +173,6 @@ true, true, true, - false, true, true, true, @@ -186,5 +180,5 @@ false ] }, - "hash": "096ebf082d5e48b75ea7b9b6790ab25ecb4448717d6baf0d4b8b0a070eac47ff" + "hash": "71a040866adbd192080da165eb120abf7531b2542a2da225152e19144400f950" } diff --git a/backend/Cargo.lock b/backend/Cargo.lock index cfff91f203..28bf1a4088 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -554,17 +554,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-compression" version = "0.4.19" @@ -678,31 +667,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "async-stripe" -version = "0.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d670cf4d47a1b8ffef54286a5625382e360a34ee76902fd93ad8c7032a0c30" -dependencies = [ - "chrono", - "futures-util", - "hex", - "hmac", - "http-types", - "hyper 0.14.32", - "hyper-tls 0.5.0", - "serde", - "serde_json", - "serde_path_to_error", - "serde_qs 0.10.1", - "sha2 0.10.8", - "smart-default", - "smol_str", - "thiserror 1.0.69", - "tokio", - "uuid 0.8.2", -] - [[package]] name = "async-trait" version = "0.1.88" @@ -723,7 +687,7 @@ dependencies = [ "async-compression", "chrono", "crc32fast", - "futures-lite 2.6.0", + "futures-lite", "pin-project", "thiserror 1.0.69", "tokio", @@ -783,7 +747,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.3.0", + "fastrand", "hex", "http 1.3.1", "ring 0.17.14", @@ -844,14 +808,14 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.3.0", + "fastrand", "http 0.2.12", "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -1057,7 +1021,7 @@ dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.3.0", + "fastrand", "http 0.2.12", "http 1.3.1", "http-body 0.4.6", @@ -1203,7 +1167,7 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "970d91570c01a8a5959b36ad7dd1c30642df24b6b3068710066f6809f7033bb7" dependencies = [ - "fastrand 2.3.0", + "fastrand", "gloo-timers", "tokio", ] @@ -2657,7 +2621,7 @@ dependencies = [ "tokio", "tokio-util", "url", - "uuid 1.16.0", + "uuid", "xz2", "zstd", ] @@ -2757,7 +2721,7 @@ dependencies = [ "regex", "sha2 0.10.8", "unicode-segmentation", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -2924,7 +2888,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -2980,7 +2944,7 @@ dependencies = [ "deno_error", "thiserror 2.0.12", "tokio", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -3175,7 +3139,7 @@ dependencies = [ "spki", "thiserror 2.0.12", "tokio", - "uuid 1.16.0", + "uuid", "x25519-dalek", ] @@ -3350,7 +3314,7 @@ dependencies = [ "pin-project", "rand 0.8.5", "tokio", - "uuid 1.16.0", + "uuid", "winapi", "windows-sys 0.59.0", ] @@ -3797,7 +3761,7 @@ dependencies = [ "tokio", "tokio-metrics", "twox-hash 1.6.3", - "uuid 1.16.0", + "uuid", "which 6.0.3", "winapi", "windows-sys 0.59.0", @@ -3917,7 +3881,7 @@ dependencies = [ "serde", "thiserror 2.0.12", "tokio", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -4006,7 +3970,7 @@ dependencies = [ "num-bigint", "prost", "serde", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -4032,7 +3996,7 @@ dependencies = [ "tokio", "tokio-util", "url", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -4056,7 +4020,7 @@ dependencies = [ "thiserror 2.0.12", "tokio", "tokio-stream", - "uuid 1.16.0", + "uuid", "v8_valueserializer", ] @@ -4623,12 +4587,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.4.0" @@ -4684,15 +4642,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.3.0" @@ -5017,28 +4966,13 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ - "fastrand 2.3.0", + "fastrand", "futures-core", "futures-io", "parking", @@ -5272,17 +5206,6 @@ dependencies = [ "unicode-width 0.1.14", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -5835,27 +5758,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-types" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" -dependencies = [ - "anyhow", - "async-channel", - "base64 0.13.1", - "futures-lite 1.13.0", - "http 0.2.12", - "infer", - "pin-project-lite", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs 0.8.5", - "serde_urlencoded", - "url", -] - [[package]] name = "httparse" version = "1.10.1" @@ -6300,12 +6202,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - [[package]] name = "inotify" version = "0.9.6" @@ -7322,7 +7218,7 @@ dependencies = [ "smallvec", "tagptr", "thiserror 1.0.69", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -7459,7 +7355,7 @@ dependencies = [ "sha2 0.10.8", "subprocess", "thiserror 1.0.69", - "uuid 1.16.0", + "uuid", "zstd", ] @@ -8858,7 +8754,7 @@ dependencies = [ "postgres-protocol 0.6.8", "serde", "serde_json", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -9285,19 +9181,6 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -9320,16 +9203,6 @@ dependencies = [ "zerocopy 0.8.23", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -9350,15 +9223,6 @@ dependencies = [ "rand_core 0.9.3", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - [[package]] name = "rand_core" version = "0.6.4" @@ -9387,15 +9251,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - [[package]] name = "range-alloc" version = "0.1.4" @@ -9773,7 +9628,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -10287,7 +10142,7 @@ dependencies = [ "serde", "thiserror 1.0.69", "url", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -10570,28 +10425,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "serde_qs" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cac3f1e2ca2fe333923a1ae72caca910b98ed0630bb35ef6f8c8517d6e81afa" -dependencies = [ - "percent-encoding", - "serde", - "thiserror 1.0.69", -] - [[package]] name = "serde_repr" version = "0.1.20" @@ -10893,17 +10726,6 @@ dependencies = [ "serde", ] -[[package]] -name = "smart-default" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "smartstring" version = "1.0.1" @@ -10915,15 +10737,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "smol_str" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad6c857cbab2627dcf01ec85a623ca4e7dcb5691cbaa3d7fb7653671f0d09c9" -dependencies = [ - "serde", -] - [[package]] name = "smtp-proto" version = "0.1.6" @@ -11114,7 +10927,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.4.0", + "event-listener", "futures-core", "futures-intrusive", "futures-io", @@ -11137,7 +10950,7 @@ dependencies = [ "tokio-stream", "tracing", "url", - "uuid 1.16.0", + "uuid", "webpki-roots", ] @@ -11221,7 +11034,7 @@ dependencies = [ "stringprep", "thiserror 2.0.12", "tracing", - "uuid 1.16.0", + "uuid", "whoami", ] @@ -11262,7 +11075,7 @@ dependencies = [ "stringprep", "thiserror 2.0.12", "tracing", - "uuid 1.16.0", + "uuid", "whoami", ] @@ -11288,7 +11101,7 @@ dependencies = [ "sqlx-core", "tracing", "url", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -12016,7 +11829,7 @@ dependencies = [ "tempfile", "thiserror 1.0.69", "time", - "uuid 1.16.0", + "uuid", "winapi", ] @@ -12133,7 +11946,7 @@ version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ - "fastrand 2.3.0", + "fastrand", "getrandom 0.3.2", "once_cell", "rustix 1.0.3", @@ -12265,7 +12078,7 @@ dependencies = [ "tokio-rustls 0.24.1", "tokio-util", "tracing", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -13097,7 +12910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "470dbf6591da1b39d43c14523b2b469c86879a53e8b758c8e090a470fe7b1fbe" dependencies = [ "rand 0.9.0", - "uuid 1.16.0", + "uuid", "web-time", ] @@ -13384,15 +13197,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.15", -] - [[package]] name = "uuid" version = "1.16.0" @@ -13480,12 +13284,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -13505,12 +13303,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -13884,7 +13676,7 @@ dependencies = [ "tokio", "tracing", "url", - "uuid 1.16.0", + "uuid", "v8", "windmill-api", "windmill-api-client", @@ -13906,7 +13698,6 @@ dependencies = [ "async-oauth2", "async-recursion", "async-stream", - "async-stripe", "async_zip", "aws-config", "aws-sdk-sqs", @@ -13983,7 +13774,7 @@ dependencies = [ "ulid", "url", "urlencoding", - "uuid 1.16.0", + "uuid", "windmill-audit", "windmill-common", "windmill-git-sync", @@ -14006,7 +13797,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "uuid 1.16.0", + "uuid", ] [[package]] @@ -14031,7 +13822,7 @@ dependencies = [ "serde_json", "sqlx", "tracing", - "uuid 1.16.0", + "uuid", "windmill-common", "windmill-queue", ] @@ -14093,7 +13884,7 @@ dependencies = [ "tracing-loki", "tracing-opentelemetry", "tracing-subscriber", - "uuid 1.16.0", + "uuid", "windmill-macros", ] @@ -14106,7 +13897,7 @@ dependencies = [ "serde_json", "sqlx", "tracing", - "uuid 1.16.0", + "uuid", "windmill-common", "windmill-queue", ] @@ -14130,7 +13921,7 @@ dependencies = [ "tokio", "tokio-tar", "tracing", - "uuid 1.16.0", + "uuid", "windmill-common", ] @@ -14364,7 +14155,7 @@ dependencies = [ "tokio", "tracing", "ulid", - "uuid 1.16.0", + "uuid", "windmill-audit", "windmill-common", ] @@ -14442,7 +14233,7 @@ dependencies = [ "tokio-util", "tracing", "urlencoding", - "uuid 1.16.0", + "uuid", "winapi", "windmill-audit", "windmill-common", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index c001db30c2..b3f4758aa6 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -50,7 +50,7 @@ lto = "thin" default = [] enterprise = ["windmill-worker/enterprise", "windmill-queue/enterprise", "windmill-api/enterprise", "dep:windmill-autoscaling", "windmill-autoscaling/enterprise", "windmill-git-sync/enterprise", "windmill-common/prometheus", "windmill-common/enterprise"] enterprise_saml = ["windmill-api/enterprise_saml", "oauth2"] -stripe = ["windmill-api/stripe", "enterprise"] +stripe = ["windmill-api/stripe"] benchmark = ["windmill-api/benchmark", "windmill-worker/benchmark", "windmill-queue/benchmark", "windmill-common/benchmark"] loki = ["windmill-common/loki"] embedding = ["windmill-api/embedding"] @@ -268,11 +268,6 @@ serde_derive = "1.0.147" const_format = { version = "0.2", features = ["rust_1_64", "rust_1_51"] } dyn-iter = "0.2.0" rsa = "^0" -async-stripe = { version = "0.39.1", features = [ - "runtime-tokio-hyper", - "checkout", - "billing", -] } async_zip = { version = "0.0.17", features = ["tokio", "tokio-fs", "deflate", "chrono"] } once_cell = "1.17.1" gosyn = "0.2.6" diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index a4914894d8..61f5197e74 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -32e85d0bd0ae71dfa1a96db2331448825d3ef517 +a46cb7b7c88c3fb22964db37994c0b26d67b6d5b \ No newline at end of file diff --git a/backend/migrations/20250326105126_remove_automatic_billing_col.down.sql b/backend/migrations/20250326105126_remove_automatic_billing_col.down.sql new file mode 100644 index 0000000000..b49aa205d9 --- /dev/null +++ b/backend/migrations/20250326105126_remove_automatic_billing_col.down.sql @@ -0,0 +1 @@ +ALTER TABLE workspace_settings ADD COLUMN automatic_billing BOOLEAN NOT NULL DEFAULT TRUE; \ No newline at end of file diff --git a/backend/migrations/20250326105126_remove_automatic_billing_col.up.sql b/backend/migrations/20250326105126_remove_automatic_billing_col.up.sql new file mode 100644 index 0000000000..776f1da82f --- /dev/null +++ b/backend/migrations/20250326105126_remove_automatic_billing_col.up.sql @@ -0,0 +1 @@ +ALTER TABLE workspace_settings DROP COLUMN automatic_billing; \ No newline at end of file diff --git a/backend/windmill-api/Cargo.toml b/backend/windmill-api/Cargo.toml index 97928baa19..d7e3eac0a2 100644 --- a/backend/windmill-api/Cargo.toml +++ b/backend/windmill-api/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" [features] default = [] enterprise = ["windmill-queue/enterprise", "windmill-audit/enterprise", "windmill-git-sync/enterprise", "windmill-common/enterprise"] -stripe = ["dep:async-stripe"] +stripe = [] enterprise_saml = ["dep:samael"] benchmark = [] embedding = ["dep:tinyvector", "dep:hf-hub", "dep:tokenizers", "dep:candle-core", "dep:candle-transformers", "dep:candle-nn", "dep:half"] @@ -86,7 +86,6 @@ hmac.workspace = true cookie.workspace = true sha2.workspace = true urlencoding.workspace = true -async-stripe = { workspace = true, optional = true } lazy_static.workspace = true prometheus = { workspace = true, optional = true } async_zip = { workspace = true, optional = true } diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index c31bf45d09..960b07462a 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1842,8 +1842,6 @@ paths: type: boolean plan: type: string - automatic_billing: - type: boolean customer_id: type: string webhook: @@ -1875,7 +1873,6 @@ paths: operator_settings: $ref: "#/components/schemas/OperatorSettings" required: - - automatic_billing - error_handler_muted_on_cancel /w/{workspace}/workspaces/get_deploy_to: @@ -1936,48 +1933,14 @@ paths: type: boolean usage: type: number - seats: - type: number - automatic_billing: - type: boolean owner: type: string + status: + type: string required: - premium - - automatic_billing - owner - /w/{workspace}/workspaces/set_automatic_billing: - post: - summary: set automatic billing - operationId: setAutomaticBilling - tags: - - workspace - parameters: - - $ref: "#/components/parameters/WorkspaceId" - requestBody: - description: automatic billing - required: true - content: - application/json: - schema: - type: object - properties: - automatic_billing: - type: boolean - seats: - type: number - required: - - automatic_billing - - responses: - "200": - description: status - content: - text/plain: - schema: - type: string - - + /w/{workspace}/workspaces/threshold_alert: get: summary: get threshold alert info diff --git a/backend/windmill-api/src/lib.rs b/backend/windmill-api/src/lib.rs index c4089c2850..37bcd80761 100644 --- a/backend/windmill-api/src/lib.rs +++ b/backend/windmill-api/src/lib.rs @@ -83,6 +83,8 @@ mod postgres_triggers; #[cfg(feature = "enterprise")] mod apps_ee; +#[cfg(feature = "enterprise")] +mod git_sync_ee; #[cfg(feature = "parquet")] mod job_helpers_ee; pub mod job_metrics; @@ -109,9 +111,8 @@ mod slack_approvals; mod smtp_server_ee; #[cfg(all(feature = "enterprise", feature = "sqs_trigger"))] mod sqs_triggers_ee; -#[cfg(feature = "enterprise")] -mod git_sync_ee; mod static_assets; +#[cfg(all(feature = "stripe", feature = "enterprise"))] mod stripe_ee; mod teams_ee; mod tracing_init; @@ -471,7 +472,7 @@ pub async fn run_server( .nest("/nats_triggers", nats_triggers_service) .nest("/mqtt_triggers", mqtt_triggers_service) .nest("/sqs_triggers", sqs_triggers_service) - .nest("/postgres_triggers", postgres_triggers_service) + .nest("/postgres_triggers", postgres_triggers_service), ) .nest("/workspaces", workspaces::global_service()) .nest( @@ -548,14 +549,14 @@ pub async fn run_server( get(slack_approvals::request_slack_approval), ) .nest("/w/:workspace_id/github_app", { - #[cfg(feature = "enterprise")] - { - git_sync_ee::workspaced_service() - } + #[cfg(feature = "enterprise")] + { + git_sync_ee::workspaced_service() + } - #[cfg(not(feature = "enterprise"))] - Router::new() - }) + #[cfg(not(feature = "enterprise"))] + Router::new() + }) .nest("/github_app", { #[cfg(feature = "enterprise")] { diff --git a/backend/windmill-api/src/stripe_ee.rs b/backend/windmill-api/src/stripe_ee.rs index 1aea2ecd2d..6934cad3bc 100644 --- a/backend/windmill-api/src/stripe_ee.rs +++ b/backend/windmill-api/src/stripe_ee.rs @@ -1,7 +1,5 @@ -#[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/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 52145cf861..f82a3a29c6 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -146,7 +146,7 @@ pub fn workspaced_service() -> Router { .route("/critical_alerts/mute", post(mute_critical_alerts)) .route("/operator_settings", post(update_operator_settings)); - #[cfg(feature = "stripe")] + #[cfg(all(feature = "stripe", feature = "enterprise"))] { crate::stripe_ee::add_stripe_routes(router) } @@ -229,7 +229,6 @@ pub struct WorkspaceSettings { pub deploy_ui: Option, // effectively: WorkspaceDeploymentUISettings #[serde(skip_serializing_if = "Option::is_none")] pub default_app: Option, - pub automatic_billing: bool, #[serde(skip_serializing_if = "Option::is_none")] pub default_scripts: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -444,7 +443,7 @@ async fn get_settings( let mut tx = user_db.begin(&authed).await?; let settings = sqlx::query_as!( WorkspaceSettings, - "SELECT workspace_id, slack_team_id, teams_team_id, teams_team_name, slack_name, slack_command_script, teams_command_script, slack_email, auto_invite_domain, auto_invite_operator, auto_add, customer_id, plan, webhook, deploy_to, ai_config, error_handler, error_handler_extra_args, error_handler_muted_on_cancel, large_file_storage, git_sync, deploy_ui, default_app, automatic_billing, default_scripts, mute_critical_alerts, color, operator_settings, git_app_installations FROM workspace_settings WHERE workspace_id = $1", + "SELECT workspace_id, slack_team_id, teams_team_id, teams_team_name, slack_name, slack_command_script, teams_command_script, slack_email, auto_invite_domain, auto_invite_operator, auto_add, customer_id, plan, webhook, deploy_to, ai_config, error_handler, error_handler_extra_args, error_handler_muted_on_cancel, large_file_storage, git_sync, deploy_ui, default_app, default_scripts, mute_critical_alerts, color, operator_settings, git_app_installations FROM workspace_settings WHERE workspace_id = $1", &w_id ) .fetch_one(&mut *tx) diff --git a/frontend/src/lib/components/settings/PremiumInfo.svelte b/frontend/src/lib/components/settings/PremiumInfo.svelte index 55d755cf4b..e16a0579d0 100644 --- a/frontend/src/lib/components/settings/PremiumInfo.svelte +++ b/frontend/src/lib/components/settings/PremiumInfo.svelte @@ -7,9 +7,7 @@ import { workspaceStore } from '$lib/stores' import { Button } from '../common' import Tooltip from '../Tooltip.svelte' - import { ExternalLink, Loader2, Pen, X } from 'lucide-svelte' - import { twMerge } from 'tailwind-merge' - import Toggle from '../Toggle.svelte' + import { ExternalLink, Pen, X } from 'lucide-svelte' import Section from '../Section.svelte' import Range from '../Range.svelte' import Label from '../Label.svelte' @@ -25,13 +23,12 @@ | { premium: boolean usage: number - seats: number + status?: string developerNb: number operatorNb: number seatsFromUsers: number seatsFromExtraComps: number usedSeats: number - automatic_billing: boolean owner: string } | undefined = undefined @@ -78,7 +75,6 @@ premiumInfo = { ...info, usage: info.usage ?? 0, - seats: info.seats ?? 1, owner: info.owner, developerNb, operatorNb, @@ -88,25 +84,6 @@ } } - let billingModeLoading = false - async function setAutomaticBilling(ev) { - try { - billingModeLoading = true - await WorkspaceService.setAutomaticBilling({ - workspace: $workspaceStore!, - requestBody: { - automatic_billing: ev.detail, - seats: premiumInfo?.usedSeats - } - }) - } catch (err) { - sendUserToast("Couldn't update billing mode: " + err, true) - } finally { - await loadPremiumInfo() - billingModeLoading = false - } - } - let thresholdAlert: | { threshold_alert_amount?: number @@ -173,15 +150,17 @@
{#if premiumInfo?.premium && plan} - Plan: {capitalize(plan)} plan{plan === 'team' && premiumInfo.automatic_billing - ? ' (usage-based)' - : plan === 'team' - ? ` (${premiumInfo.seats} seat${premiumInfo.seats > 1 ? 's' : ''})` - : ''} + Plan: {capitalize(plan)} plan{plan === 'team' ? ' (usage-based)' : ''} {:else} Plan: Free plan {/if}
+ {#if premiumInfo?.status === 'past_due'} +

+ Your last invoice is unpaid. Please update your payment method in the customer portal to + prevent account downgrade and the interruption of your job executions. +

+ {/if}
{#if customer_id} @@ -201,79 +180,52 @@ {#if premiumInfo?.premium}
{#if plan} - {#if plan === 'team' && !premiumInfo?.automatic_billing} -
- +

Billing threshold email alert

+
+

{thresholdAlert?.threshold_alert_amount + ? thresholdAlert?.threshold_alert_amount + '$' + : 'Not set'}

+
- {/if} - {:else} -
Current plan: Free plan
- {/if} - - {#if plan} - {#if premiumInfo?.automatic_billing} -
-

Billing threshold email alert

-
-

{thresholdAlert?.threshold_alert_amount - ? thresholdAlert?.threshold_alert_amount + '$' - : 'Not set'}

+ {#if thresholdAlert?.threshold_alert_amount}
-

- An email notification will be sent to {premiumInfo.owner} if the specified threshold amount - is exceeded during a given month. -

+ {/if}
- {/if} +

+ An email notification will be sent to {premiumInfo.owner} if the specified threshold amount + is exceeded during a given month. +

+
@@ -342,52 +294,20 @@
premiumInfo.seats && - !premiumInfo.automatic_billing - ? 'text-red-500' - : '' - )} + >
Used seats Highest between seats from developers + operators and seats from computations - {plan === 'team' && - premiumInfo.usedSeats > premiumInfo.seats && - !premiumInfo.automatic_billing - ? ' > Paid seats' - : ''}
-
premiumInfo.seats && - !premiumInfo.automatic_billing - ? 'text-red-500' - : '' - )} - > - u + c = {premiumInfo.usedSeats}{plan === 'team' && - premiumInfo.usedSeats > premiumInfo.seats && - !premiumInfo.automatic_billing - ? ` > ${premiumInfo.seats}` - : ''} +
+ u + c = {premiumInfo.usedSeats}
- - {#if plan === 'team' && premiumInfo.usedSeats > premiumInfo.seats && !premiumInfo.automatic_billing} -

You have exceeded your allowed number of seats, please update your plan in the - customer portal. -

- {/if}
{/if}