From 1178bb7ebf83c8baeec94c58cd80d5ed2ed46d62 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 18 Mar 2026 22:49:04 -0400 Subject: [PATCH] update utoipa and swagger doc gen (#1171) --- Cargo.lock | 74 +++++++++++-------- Cargo.toml | 2 +- .../src/common/responses/cover_image_links.rs | 3 +- .../media_file_cover_image_details.rs | 5 +- .../common/responses/user_details_light.rs | 5 +- .../deprecated/http_server_common/Cargo.toml | 1 + .../src/response/response_success_helpers.rs | 2 +- .../schema/database/redis_schema/Cargo.toml | 1 + .../style_transfer_progress_state.rs | 5 +- .../tokens/src/tokens/user_subscriptions.rs | 3 +- crates/service/web/storyteller_web/Cargo.toml | 2 +- .../common_responses/common_web_error.rs | 2 +- .../analytics/log_app_active_user_handler.rs | 2 +- .../log_app_active_user_json_handler.rs | 2 +- .../comments/delete_comment_handler.rs | 1 + .../delete_featured_item_handler.rs | 1 + .../get_is_featured_item_handler.rs | 2 +- ...enerate_hunyuan_2_0_image_to_3d_handler.rs | 4 +- .../change_media_file_visibility_handler.rs | 2 +- .../edit/rename_media_file_handler.rs | 1 + .../set_media_file_cover_image_handler.rs | 1 + .../info/moderator_token_info_handler.rs | 2 +- .../jobs/user/list_user_jobs_handler.rs | 1 + .../edit_user_feature_flags_handler.rs | 1 + ...wallet_ledger_entries_by_wallet_handler.rs | 1 + ...derator_get_wallet_ledger_entry_handler.rs | 1 + .../wallets/list_user_wallets_handler.rs | 1 + ...or_add_banked_balance_to_wallet_handler.rs | 1 + .../wallets/moderator_get_wallet_handler.rs | 1 + .../tags/list_tags_for_entity_handler.rs | 2 +- .../delete_user_bookmark_handler.rs | 1 + .../enqueue_seed_vc_inference_handler.rs | 4 +- .../weights/delete/delete_weight_handler.rs | 1 + .../weights/update/update_weight_handler.rs | 2 +- frontend/api_docs.html | 6 +- 35 files changed, 91 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3a22ffa12..003a62907b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -619,9 +619,9 @@ checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] @@ -3077,9 +3077,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", @@ -4170,6 +4170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", + "libz-rs-sys", "miniz_oxide", ] @@ -5288,6 +5289,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "utoipa", "workspace-build-acceleration", ] @@ -6442,6 +6444,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10501e7805cee23da17c7790e59df2870c0d4043ec6d03f67d31e2b53e77415" +dependencies = [ + "zlib-rs", +] + [[package]] name = "libz-sys" version = "1.1.22" @@ -9322,6 +9333,7 @@ dependencies = [ "serde", "tokens", "url", + "utoipa", "workspace-build-acceleration", ] @@ -13320,9 +13332,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utoipa" -version = "4.1.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ff05e3bac2c9428f57ade702667753ca3f5cf085e2011fe697de5bfd49aa72d" +checksum = "2fcc29c80c21c31608227e0912b2d7fddba57ad76b606890627ba8ee7964e993" dependencies = [ "indexmap 2.13.0", "serde", @@ -13332,33 +13344,33 @@ dependencies = [ [[package]] name = "utoipa-gen" -version = "4.1.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0b6f4667edd64be0e820d6631a60433a269710b6ee89ac39525b872b76d61d" +checksum = "6d79d08d92ab8af4c5e8a6da20c47ae3f61a0f1dabc1997cdf2d082b757ca08b" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", "regex", "syn 2.0.117", + "url", ] [[package]] name = "utoipa-swagger-ui" -version = "7.1.0" +version = "9.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943e0ff606c6d57d410fd5663a4d7c074ab2c5f14ab903b9514565e59fa1189e" +checksum = "d047458f1b5b65237c2f6dc6db136945667f40a7668627b3490b9513a3d43a55" dependencies = [ "actix-web", + "base64 0.22.1", "mime_guess", "regex", - "reqwest 0.12.23", "rust-embed", "serde", "serde_json", "url", "utoipa", - "zip 1.1.4", + "zip 3.0.0", ] [[package]] @@ -15268,22 +15280,6 @@ dependencies = [ "zstd 0.11.2+zstd.1.5.2", ] -[[package]] -name = "zip" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" -dependencies = [ - "arbitrary", - "crc32fast", - "crossbeam-utils", - "displaydoc", - "flate2", - "indexmap 2.13.0", - "num_enum 0.7.2", - "thiserror 1.0.63", -] - [[package]] name = "zip" version = "2.1.3" @@ -15313,6 +15309,20 @@ dependencies = [ "zstd 0.13.3", ] +[[package]] +name = "zip" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" +dependencies = [ + "arbitrary", + "crc32fast", + "flate2", + "indexmap 2.13.0", + "memchr", + "zopfli", +] + [[package]] name = "zip_archives" version = "0.0.1" @@ -15322,6 +15332,12 @@ dependencies = [ "zip 0.6.6", ] +[[package]] +name = "zlib-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3" + [[package]] name = "zmij" version = "1.0.21" diff --git a/Cargo.toml b/Cargo.toml index e33bcc5e91..7548891910 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -333,7 +333,7 @@ tokio = { version = "1.50.0", features = ["macros"] } tokio-util = "0.7.12" toml = "1.0.7+spec-1.1.0" url = { version = "2.5.8", features = ["serde"] } -utoipa = { version = "4", features = ["chrono", "actix_extras"] } +utoipa = { version = "5.4.0", features = ["chrono", "actix_extras", "url"] } uuid = "1.22.0" walkdir = "2.4.0" diff --git a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/cover_image_links.rs b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/cover_image_links.rs index 9f6d6e2e8d..452c8179e0 100644 --- a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/cover_image_links.rs +++ b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/cover_image_links.rs @@ -1,11 +1,12 @@ use serde_derive::{Deserialize, Serialize}; use url::Url; +use utoipa::ToSchema; // TODO(bt,2025-08-20): Replace the storyteller-web version of this. // All it needs is the impl ported into a builder. /// Cover image links can only be jpg, png, etc. No videos. -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, ToSchema, Debug)] pub struct CoverImageLinks { /// Primary link to the cover image via the CDN. pub cdn_url: Url, diff --git a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/media_file_cover_image_details.rs b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/media_file_cover_image_details.rs index d7754b66c9..38f1765b4e 100644 --- a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/media_file_cover_image_details.rs +++ b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/media_file_cover_image_details.rs @@ -1,5 +1,6 @@ use crate::common::responses::cover_image_links::CoverImageLinks; use serde_derive::{Deserialize, Serialize}; +use utoipa::ToSchema; // TODO(bt,2025-08-20): Replace the storyteller-web version of this. // We can't drop the old version just yet due to the `impl` (easy) @@ -8,7 +9,7 @@ use serde_derive::{Deserialize, Serialize}; /// Everything we need to create a cover image. /// Cover images are small descriptive images that can be set for any media file. /// If a cover image is set, this is the path to the asset. -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, ToSchema, Debug)] pub struct MediaFileCoverImageDetails { // /// (DEPRECATED) URL path to the media file // #[deprecated(note="This field doesn't point to the full URL. Use media_links instead to leverage the CDN.")] @@ -36,7 +37,7 @@ pub struct MediaFileCoverImageDetails { /// The default cover is composed of an image and color pair that are /// predefined by the frontend. -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, ToSchema, Debug)] pub struct MediaFileDefaultCover { pub image_index: u8, pub color_index: u8, diff --git a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/user_details_light.rs b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/user_details_light.rs index 0a6cd607ef..dc40ec346b 100644 --- a/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/user_details_light.rs +++ b/crates/api_clients/artcraft/artcraft_api_defs/src/common/responses/user_details_light.rs @@ -1,8 +1,9 @@ use serde_derive::{Deserialize, Serialize}; use tokens::tokens::users::UserToken; +use utoipa::ToSchema; /// Everything we need to refer to a user on the public web interface. -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, ToSchema, Debug)] pub struct UserDetailsLight { /// The token for the user pub user_token: UserToken, @@ -26,7 +27,7 @@ pub struct UserDetailsLight { // In the future, we'll also support user-uploaded avatars that we store on our servers. } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, ToSchema, Debug)] pub struct UserDefaultAvatarInfo { pub image_index: u8, pub color_index: u8, diff --git a/crates/lib/deprecated/http_server_common/Cargo.toml b/crates/lib/deprecated/http_server_common/Cargo.toml index 24476b6a15..5d0bb752ab 100644 --- a/crates/lib/deprecated/http_server_common/Cargo.toml +++ b/crates/lib/deprecated/http_server_common/Cargo.toml @@ -38,6 +38,7 @@ language-tags = "0.3.2" # Parsing single tags richly serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } +utoipa = { workspace = true } [dev-dependencies] # (None yet) \ No newline at end of file diff --git a/crates/lib/deprecated/http_server_common/src/response/response_success_helpers.rs b/crates/lib/deprecated/http_server_common/src/response/response_success_helpers.rs index e2009a67b8..af5ebff53b 100644 --- a/crates/lib/deprecated/http_server_common/src/response/response_success_helpers.rs +++ b/crates/lib/deprecated/http_server_common/src/response/response_success_helpers.rs @@ -1,7 +1,7 @@ use actix_web::HttpResponse; use actix_web::web::Json; -#[derive(Serialize)] +#[derive(Serialize, utoipa::ToSchema)] pub struct SimpleGenericJsonSuccess { pub success: bool, } diff --git a/crates/schema/database/redis_schema/Cargo.toml b/crates/schema/database/redis_schema/Cargo.toml index 3a91588f41..1e776cee7b 100644 --- a/crates/schema/database/redis_schema/Cargo.toml +++ b/crates/schema/database/redis_schema/Cargo.toml @@ -33,6 +33,7 @@ r2d2.workspace = true redis.workspace = true url.workspace = true serde.workspace = true +utoipa.workspace = true [dev-dependencies] # None yet diff --git a/crates/schema/database/redis_schema/src/payloads/inference_job/style_transfer_progress_state.rs b/crates/schema/database/redis_schema/src/payloads/inference_job/style_transfer_progress_state.rs index 10b6d7a515..f8a2530207 100644 --- a/crates/schema/database/redis_schema/src/payloads/inference_job/style_transfer_progress_state.rs +++ b/crates/schema/database/redis_schema/src/payloads/inference_job/style_transfer_progress_state.rs @@ -2,13 +2,14 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use url::Url; +use utoipa::ToSchema; use errors::{anyhow, AnyhowResult}; use tokens::tokens::generic_inference_jobs::InferenceJobToken; use crate::keys::inference_job::style_transfer_progress_key::StyleTransferProgressKey; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct InferenceStageDetails { pub stage_progress: u32, pub expected_frame_count: u32, @@ -17,7 +18,7 @@ pub struct InferenceStageDetails { } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct InferenceProgressDetailsResponse { pub expected_stages: u32, pub currently_active_stage: u32, diff --git a/crates/schema/public/tokens/src/tokens/user_subscriptions.rs b/crates/schema/public/tokens/src/tokens/user_subscriptions.rs index 68dc0f3c95..4930b62ad7 100644 --- a/crates/schema/public/tokens/src/tokens/user_subscriptions.rs +++ b/crates/schema/public/tokens/src/tokens/user_subscriptions.rs @@ -2,11 +2,12 @@ use std::fmt::Debug; use serde::Deserialize; use serde::Serialize; +use utoipa::ToSchema; use crate::prefixes::TokenPrefix; /// Primary key for the `user_subscriptions` table. -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize)] +#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize, ToSchema)] #[cfg_attr(feature = "database", derive(sqlx::Type))] #[cfg_attr(feature = "database", sqlx(transparent))] pub struct UserSubscriptionToken(pub String); diff --git a/crates/service/web/storyteller_web/Cargo.toml b/crates/service/web/storyteller_web/Cargo.toml index 3e5bd5c8ad..46a5301dd9 100644 --- a/crates/service/web/storyteller_web/Cargo.toml +++ b/crates/service/web/storyteller_web/Cargo.toml @@ -178,7 +178,7 @@ toml.workspace = true async-trait = "0.1.58" utoipa.workspace = true -utoipa-swagger-ui = { version = "7", features = ["actix-web"] } +utoipa-swagger-ui = { version = "9", features = ["actix-web"] } # TODO: move zip pieces into a separate library that encapsulates calls to this lib zip = "0.6.6" diff --git a/crates/service/web/storyteller_web/src/http_server/common_responses/common_web_error.rs b/crates/service/web/storyteller_web/src/http_server/common_responses/common_web_error.rs index 3e585a1131..e151b63521 100644 --- a/crates/service/web/storyteller_web/src/http_server/common_responses/common_web_error.rs +++ b/crates/service/web/storyteller_web/src/http_server/common_responses/common_web_error.rs @@ -5,7 +5,7 @@ use mysql_queries::errors::mysql_error::{MysqlCrateErrorSubtype, MysqlError}; use std::error::Error; use std::fmt::{Display, Formatter}; -#[derive(Debug)] +#[derive(Debug, utoipa::ToSchema)] pub enum CommonWebError { // TODO: Bad input with error fields vector. /// Bad input with a user-facing error message. diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_handler.rs index d9a954f72d..ce6ccc1598 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_handler.rs @@ -23,7 +23,7 @@ const CLIENT_WAIT_FOR_RETRY_MILLIS: u64 = 1_000 * 60 * 1; // Every minute tag = "Analytics", path = "/v1/analytics/active_user", responses( - (status = 200, description = "Success", body = LogAppActiveUserSuccessResponse), + (status = 200, description = "Success", body = LogAppActiveUserResponse), ), params( ("request" = LogAppActiveUserRequest, description = "Payload for Request"), diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_json_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_json_handler.rs index 3efae57f6d..1c885da0f2 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_json_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/analytics/log_app_active_user_json_handler.rs @@ -22,7 +22,7 @@ const CLIENT_WAIT_FOR_RETRY_MILLIS: u64 = 1_000 * 60 * 1; // Every minute path = "/v1/analytics/active_user_v2", request_body = LogAppActiveUserRequest, responses( - (status = 200, description = "Success", body = LogAppActiveUserSuccessResponse), + (status = 200, description = "Success", body = LogAppActiveUserResponse), ), )] pub async fn log_app_active_user_json_handler( diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/comments/delete_comment_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/comments/delete_comment_handler.rs index 3508edf07f..931c5d86eb 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/comments/delete_comment_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/comments/delete_comment_handler.rs @@ -17,6 +17,7 @@ use mysql_queries::queries::comments::delete_comment::{delete_comment, DeleteCom use mysql_queries::queries::comments::get_comment::get_comment; use tokens::tokens::comments::CommentToken; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_error_helpers::to_simple_json_error; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/delete_featured_item_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/delete_featured_item_handler.rs index 4c063c49d0..98630dceb2 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/delete_featured_item_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/delete_featured_item_handler.rs @@ -19,6 +19,7 @@ use tokens::tokens::media_files::MediaFileToken; use tokens::tokens::model_weights::ModelWeightToken; use tokens::tokens::users::UserToken; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_error_helpers::to_simple_json_error; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/get_is_featured_item_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/get_is_featured_item_handler.rs index 650a2810f9..1eb042f3b3 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/get_is_featured_item_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/featured_items/get_is_featured_item_handler.rs @@ -70,7 +70,7 @@ impl fmt::Display for GetIsFeaturedItemError { get, tag = "Featured Items", path = "/v1/featured_item/is_featured/{entity_type}/{entity_token}", - request_body = GetIsFeaturedItemRequest, + request_body = GetIsFeaturedItemPathInfo, responses( (status = 200, body = GetIsFeaturedItemSuccessResponse), (status = 400, body = GetIsFeaturedItemError), diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs index c7a88703aa..3f778ec0ed 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/generate/object/generate_hunyuan_2_0_image_to_3d_handler.rs @@ -28,10 +28,10 @@ use utoipa::ToSchema; tag = "Generate Objects", path = "/v1/generate/object/hunyuan_2.0_image_to_3d", responses( - (status = 200, description = "Success", body = GenerateHunyuan2ImageTo3dResponse), + (status = 200, description = "Success", body = GenerateHunyuan20ImageTo3dResponse), ), params( - ("request" = GenerateHunyuan2ImageTo3dRequest, description = "Payload for Request"), + ("request" = GenerateHunyuan20ImageTo3dRequest, description = "Payload for Request"), ) )] pub async fn generate_hunyuan_2_0_image_to_3d_handler( diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/change_media_file_visibility_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/change_media_file_visibility_handler.rs index e8e79545d0..34c676c80c 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/change_media_file_visibility_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/change_media_file_visibility_handler.rs @@ -10,7 +10,7 @@ use utoipa::ToSchema; use enums::common::visibility::Visibility; use http_server_common::request::get_request_ip::get_request_ip; -use http_server_common::response::response_success_helpers::simple_json_success; +use http_server_common::response::response_success_helpers::{simple_json_success, SimpleGenericJsonSuccess}; use http_server_common::response::serialize_as_json_error::serialize_as_json_error; use mysql_queries::queries::media_files::edit::update_media_file_visibility::{update_media_file_visibility, UpdateMediaFileArgs}; use mysql_queries::queries::media_files::get::get_media_file::get_media_file; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/rename_media_file_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/rename_media_file_handler.rs index cd82db8e8d..07bb5155ea 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/rename_media_file_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/rename_media_file_handler.rs @@ -9,6 +9,7 @@ use log::warn; use utoipa::ToSchema; use crate::http_server::common_requests::media_file_token_path_info::MediaFileTokenPathInfo; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; use http_server_common::response::serialize_as_json_error::serialize_as_json_error; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/set_media_file_cover_image_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/set_media_file_cover_image_handler.rs index 7df39a5740..2e0b978b72 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/set_media_file_cover_image_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/media_files/edit/set_media_file_cover_image_handler.rs @@ -15,6 +15,7 @@ use mysql_queries::queries::media_files::get::get_media_file::get_media_file; use tokens::tokens::media_files::MediaFileToken; use crate::http_server::common_requests::media_file_token_path_info::MediaFileTokenPathInfo; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/info/moderator_token_info_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/info/moderator_token_info_handler.rs index c5f0038da6..eef15a1728 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/info/moderator_token_info_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/info/moderator_token_info_handler.rs @@ -40,7 +40,7 @@ pub struct ModeratorTokenInfoResponse { pub maybe_payload: Option, } -#[derive(Debug, Serialize)] +#[derive(Debug, Serialize, ToSchema)] pub enum ModeratorTokenInfoError { ServerError, Unauthorized, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/jobs/user/list_user_jobs_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/jobs/user/list_user_jobs_handler.rs index 5feeac4359..b687f87a12 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/jobs/user/list_user_jobs_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/jobs/user/list_user_jobs_handler.rs @@ -11,6 +11,7 @@ use artcraft_api_defs::moderation::jobs::user::list_user_jobs::{ }; use mysql_queries::queries::generic_inference::web::list_user_jobs_for_moderation::list_user_jobs_for_moderation; +use tokens::tokens::users::UserToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/user_feature_flags/edit_user_feature_flags_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/user_feature_flags/edit_user_feature_flags_handler.rs index cd605dd7fc..036de5b244 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/user_feature_flags/edit_user_feature_flags_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/user_feature_flags/edit_user_feature_flags_handler.rs @@ -19,6 +19,7 @@ use mysql_queries::queries::users::user_profiles::get_user_profile_by_token::get use tokens::tokens::users::UserToken; use crate::http_server::session::lookup::user_session_feature_flags::UserSessionFeatureFlags; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_error_helpers::to_simple_json_error; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/list_wallet_ledger_entries_by_wallet_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/list_wallet_ledger_entries_by_wallet_handler.rs index 3e606df66d..98bb950ff5 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/list_wallet_ledger_entries_by_wallet_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/list_wallet_ledger_entries_by_wallet_handler.rs @@ -11,6 +11,7 @@ use artcraft_api_defs::moderation::wallet_ledger_entries::list_wallet_ledger_ent }; use mysql_queries::queries::wallet_ledger_entries::list_wallet_ledger_entries_by_wallet::list_wallet_ledger_entries_by_wallet; +use tokens::tokens::wallets::WalletToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/moderator_get_wallet_ledger_entry_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/moderator_get_wallet_ledger_entry_handler.rs index 02c217c83a..50debe1d08 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/moderator_get_wallet_ledger_entry_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallet_ledger_entries/moderator_get_wallet_ledger_entry_handler.rs @@ -11,6 +11,7 @@ use artcraft_api_defs::moderation::wallet_ledger_entries::moderator_get_wallet_l }; use mysql_queries::queries::wallet_ledger_entries::get_wallet_ledger_entry_for_moderation::get_wallet_ledger_entry_for_moderation; +use tokens::tokens::wallet_ledger_entries::WalletLedgerEntryToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/list_user_wallets_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/list_user_wallets_handler.rs index 371c974c17..bf787701d9 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/list_user_wallets_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/list_user_wallets_handler.rs @@ -11,6 +11,7 @@ use artcraft_api_defs::moderation::wallets::list_user_wallets::{ }; use mysql_queries::queries::wallets::list_user_wallets_for_moderation::list_user_wallets_for_moderation; +use tokens::tokens::users::UserToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_add_banked_balance_to_wallet_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_add_banked_balance_to_wallet_handler.rs index 575b1dab66..135d456554 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_add_banked_balance_to_wallet_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_add_banked_balance_to_wallet_handler.rs @@ -12,6 +12,7 @@ use artcraft_api_defs::moderation::wallets::moderator_add_banked_balance_to_wall use enums::by_table::wallet_ledger_entries::wallet_ledger_entry_type::WalletLedgerEntryType; use mysql_queries::queries::wallets::add_durable_banked_balance_to_wallet::add_durable_banked_balance_to_wallet; +use tokens::tokens::wallets::WalletToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_get_wallet_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_get_wallet_handler.rs index 34b66f4f5b..51ac688e97 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_get_wallet_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/moderation/wallets/moderator_get_wallet_handler.rs @@ -11,6 +11,7 @@ use artcraft_api_defs::moderation::wallets::moderator_get_wallet::{ }; use mysql_queries::queries::wallets::get_wallet_for_moderation::get_wallet_for_moderation; +use tokens::tokens::wallets::WalletToken; use crate::http_server::common_responses::common_web_error::CommonWebError; use crate::http_server::web_utils::user_session::require_moderator::{require_moderator, UseDatabase}; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/tags/list_tags_for_entity_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/tags/list_tags_for_entity_handler.rs index aec672cb12..4aaa3c4918 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/tags/list_tags_for_entity_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/tags/list_tags_for_entity_handler.rs @@ -81,7 +81,7 @@ impl fmt::Display for ListTagsForEntityError { (status = 500, description = "Server error", body = ListTagsForEntityError), ), params( - ("request" = ListTagsForEntityRequest, description = "Payload for Request"), + ("request" = ListTagsForEntityPathInfo, description = "Payload for Request"), ) )] pub async fn list_tags_for_entity_handler( diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/delete_user_bookmark_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/delete_user_bookmark_handler.rs index e6295cce29..b86ba95adc 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/delete_user_bookmark_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/user_bookmarks/delete_user_bookmark_handler.rs @@ -20,6 +20,7 @@ use mysql_queries::queries::users::user_bookmarks::delete_user_bookmark::delete_ use mysql_queries::queries::users::user_bookmarks::get_user_bookmark_transactional_locking::{get_user_bookmark_transactional_locking, BookmarkIdentifier}; use tokens::tokens::user_bookmarks::UserBookmarkToken; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_error_helpers::to_simple_json_error; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_conversion/enqueue_seed_vc_inference_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_conversion/enqueue_seed_vc_inference_handler.rs index f6f1687ac2..43f779648c 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_conversion/enqueue_seed_vc_inference_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_conversion/enqueue_seed_vc_inference_handler.rs @@ -108,13 +108,13 @@ impl fmt::Display for InferSeedVcError { tag = "Voice Conversion", path = "/v1/voice_conversion/seed_vc_inference", responses( - (status = 200, description = "Success response", body = InferTtsSuccessResponse), + (status = 200, description = "Success response", body = InferSeedVcSuccessResponse), (status = 400, description = "Bad input", body = InferSeedVcError), (status = 401, description = "Not authorized", body = InferSeedVcError), (status = 429, description = "Rate limited", body = InferSeedVcError), (status = 500, description = "Server error", body = InferSeedVcError) ), - params(("request" = InferTtsRequest, description = "Payload for Request")) + params(("request" = InferSeedVcRequest, description = "Payload for Request")) )] pub async fn enqueue_infer_seed_vc_handler( http_request: HttpRequest, diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/weights/delete/delete_weight_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/weights/delete/delete_weight_handler.rs index e192027072..ce13550727 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/weights/delete/delete_weight_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/weights/delete/delete_weight_handler.rs @@ -17,6 +17,7 @@ use mysql_queries::queries::model_weights::delete_weights::{ use mysql_queries::queries::model_weights::get::get_weight::get_weight_by_token; use tokens::tokens::model_weights::ModelWeightToken; +use artcraft_api_defs::common::responses::simple_generic_json_success::SimpleGenericJsonSuccess; use crate::http_server::web_utils::response_success_helpers::simple_json_success; use crate::state::server_state::ServerState; use crate::util::delete_role_disambiguation::{delete_role_disambiguation, DeleteRole}; diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/weights/update/update_weight_handler.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/weights/update/update_weight_handler.rs index 978b565b3a..5575f6faa8 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/weights/update/update_weight_handler.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/weights/update/update_weight_handler.rs @@ -16,7 +16,7 @@ use crate::state::server_state::ServerState; use enums::by_table::media_files::media_file_type::MediaFileType; use enums::by_table::model_weights::weights_types::WeightsType; use enums::common::visibility::Visibility; -use http_server_common::response::response_success_helpers::simple_json_success; +use http_server_common::response::response_success_helpers::{simple_json_success, SimpleGenericJsonSuccess}; use http_server_common::response::serialize_as_json_error::serialize_as_json_error; use markdown::simple_markdown_to_html::simple_markdown_to_html; use mysql_queries::queries::media_files::get::get_media_file::get_media_file; diff --git a/frontend/api_docs.html b/frontend/api_docs.html index 0d06557e51..a5c0ebb87b 100644 --- a/frontend/api_docs.html +++ b/frontend/api_docs.html @@ -5,14 +5,14 @@ Storyteller API - +
- - + +