fix(api): phase6 openapi hardening (4xx declarations, operationId dedup, CommentTreeNode recursion fix, generator --check mode, conventions update)
ZhenYi committed
This change is very large, so some diffs are not shown. Clone the repository to see the full change.
Modified app/openapi/src/main.rs app/openapi/src/main.rs +21 −3 View app/openapi/src/main.rs
@@ -4,9 +4,15 @@
44use webapi::openapi::api_doc;
55
66fn main() -> anyhow::Result<()> {
7 let json = api_doc()
8 .to_pretty_json()
9 .context("serializing openapi doc")?;
7 let json = std::thread::Builder::new()
8 .stack_size(256 * 1024 * 1024)
9 .spawn(|| {
10 let doc = api_doc();
11 doc.to_pretty_json().context("serializing openapi doc")
12 })
13 .context("spawn generator thread")?
14 .join()
15 .map_err(|_| anyhow!("openapi generation panicked (stack overflow?)"))??;
1016
1117 let crate_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
1218 let root = crate_dir
@@ -15,6 +21,18 @@
1521 .ok_or_else(|| anyhow!("workspace root not found above {}", crate_dir.display()))?;
1622 let output = root.join("openapi.json");
1723
24 let check = std::env::args().nth(1).as_deref() == Some("--check");
25 if check {
26 let existing = std::fs::read_to_string(&output)
27 .with_context(|| format!("reading {}", output.display()))?;
28 if existing.trim_end() != json.trim_end() {
29 eprintln!("openapi.json is out of date; run `cargo run -p openapi` to regenerate");
30 std::process::exit(1);
31 }
32 println!("openapi.json is up to date");
33 return Ok(());
34 }
35
1836 std::fs::write(&output, json).with_context(|| format!("writing {}", output.display()))?;
1937 println!("wrote {}", output.display());
2038 Ok(())
Modified lib/auth/src/handlers/accept_agreement.rs lib/auth/src/handlers/accept_agreement.rs +4 −2 View lib/auth/src/handlers/accept_agreement.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::{Path, State};
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use serde::{Deserialize, Serialize};
66use session::Session;
77use utoipa::ToSchema;
@@ -25,7 +25,9 @@
2525 ),
2626 request_body = AcceptAgreementCmd,
2727 responses(
28 (status = 200, description = "agreement acceptance recorded", body = AppResponseData<AcceptAgreementResp>)
28 (status = 200, description = "agreement acceptance recorded", body = AppResponseData<AcceptAgreementResp>),
29 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
30 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2931 )
3032)]
3133pub async fn accept_agreement(
Modified lib/auth/src/handlers/add_ssh_key.rs lib/auth/src/handlers/add_ssh_key.rs +5 −2 View lib/auth/src/handlers/add_ssh_key.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,10 @@
1515 tag = "security",
1616 request_body = AddSshKeyCmd,
1717 responses(
18 (status = 200, description = "ssh key registered", body = AppResponseData<SshKeyDto>)
18 (status = 200, description = "ssh key registered", body = AppResponseData<SshKeyDto>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1922 )
2023)]
2124pub async fn add_ssh_key(
Modified lib/auth/src/handlers/cancel_deletion.rs lib/auth/src/handlers/cancel_deletion.rs +4 −2 View lib/auth/src/handlers/cancel_deletion.rs
@@ -7,11 +7,13 @@
77use session::share::session::require_uid;
88
99#[utoipa::path(
10 post,
10 delete,
1111 path = "/me/deletion",
1212 tag = "deletion",
1313 responses(
14 (status = 200, description = "deletion request cancelled", body = AppResponseData<NoData>)
14 (status = 200, description = "deletion request cancelled", body = AppResponseData<NoData>),
15 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
16 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1517 )
1618)]
1719pub async fn cancel_deletion(
Modified lib/auth/src/handlers/change_password.rs lib/auth/src/handlers/change_password.rs +3 −1 View lib/auth/src/handlers/change_password.rs
@@ -15,7 +15,9 @@
1515 tag = "auth",
1616 request_body = ChangePasswordCmd,
1717 responses(
18 (status = 200, description = "password changed, other sessions invalidated", body = AppResponseData<NoData>)
18 (status = 200, description = "password changed, other sessions invalidated", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn change_password(
Modified lib/auth/src/handlers/confirm_email_change.rs lib/auth/src/handlers/confirm_email_change.rs +2 −1 View lib/auth/src/handlers/confirm_email_change.rs
@@ -23,7 +23,8 @@
2323 tag = "auth",
2424 request_body = ConfirmEmailChangeCmd,
2525 responses(
26 (status = 200, description = "email changed to the ticket address", body = AppResponseData<NoData>)
26 (status = 200, description = "email changed to the ticket address", body = AppResponseData<NoData>),
27 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
2728 )
2829)]
2930pub async fn confirm_email_change(
Modified lib/auth/src/handlers/create_access_key.rs lib/auth/src/handlers/create_access_key.rs +5 −2 View lib/auth/src/handlers/create_access_key.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,10 @@
1515 tag = "security",
1616 request_body = CreateAccessKeyCmd,
1717 responses(
18 (status = 200, description = "access key created, token shown only in this response", body = AppResponseData<CreateAccessKeyResp>)
18 (status = 200, description = "access key created, token shown only in this response", body = AppResponseData<CreateAccessKeyResp>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1922 )
2023)]
2124pub async fn create_access_key(
Modified lib/auth/src/handlers/create_report.rs lib/auth/src/handlers/create_report.rs +5 −2 View lib/auth/src/handlers/create_report.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,10 @@
1515 tag = "reports",
1616 request_body = CreateReportCmd,
1717 responses(
18 (status = 200, description = "report filed", body = AppResponseData<ReportDto>)
18 (status = 200, description = "report filed", body = AppResponseData<ReportDto>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1922 )
2023)]
2124pub async fn create_report(
Modified lib/auth/src/handlers/delete_access_key.rs lib/auth/src/handlers/delete_access_key.rs +2 −1 View lib/auth/src/handlers/delete_access_key.rs
@@ -15,7 +15,8 @@
1515 ("key_id" = Uuid, Path, description = "access key id")
1616 ),
1717 responses(
18 (status = 200, description = "access key deleted", body = AppResponseData<NoData>)
18 (status = 200, description = "access key deleted", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_access_key(
Modified lib/auth/src/handlers/delete_notification.rs lib/auth/src/handlers/delete_notification.rs +2 −1 View lib/auth/src/handlers/delete_notification.rs
@@ -15,7 +15,8 @@
1515 ("notification_id" = Uuid, Path, description = "notification id")
1616 ),
1717 responses(
18 (status = 200, description = "notification deleted", body = AppResponseData<NoData>)
18 (status = 200, description = "notification deleted", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_notification(
Modified lib/auth/src/handlers/delete_ssh_key.rs lib/auth/src/handlers/delete_ssh_key.rs +2 −1 View lib/auth/src/handlers/delete_ssh_key.rs
@@ -15,7 +15,8 @@
1515 ("key_id" = Uuid, Path, description = "ssh key id")
1616 ),
1717 responses(
18 (status = 200, description = "ssh key deleted", body = AppResponseData<NoData>)
18 (status = 200, description = "ssh key deleted", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_ssh_key(
Modified lib/auth/src/handlers/deletion_status.rs lib/auth/src/handlers/deletion_status.rs +4 −2 View lib/auth/src/handlers/deletion_status.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/me/deletion",
1313 tag = "deletion",
1414 responses(
15 (status = 200, description = "latest deletion request for the current user", body = AppResponseData<Option<DeletionDto>>)
15 (status = 200, description = "latest deletion request for the current user", body = AppResponseData<Option<DeletionDto>>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn deletion_status(
Modified lib/auth/src/handlers/devices.rs lib/auth/src/handlers/devices.rs +8 −3 View lib/auth/src/handlers/devices.rs
@@ -16,7 +16,9 @@
1616 tag = "account",
1717 params(ListQuery),
1818 responses(
19 (status = 200, description = "devices seen by your account", body = AppResponseData<Vec<DeviceDto>>)
19 (status = 200, description = "devices seen by your account", body = AppResponseData<Vec<DeviceDto>>),
20 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn list_devices(
@@ -37,7 +39,9 @@
3739 request_body = UpdateDeviceCmd,
3840 responses(
3941 (status = 200, description = "device updated", body = AppResponseData<NoData>),
40 (status = 404, description = "not found", body = AppResponseData<NoData>)
42 (status = 404, description = "not found", body = AppResponseData<NoData>),
43 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
44 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4145 )
4246)]
4347pub async fn update_device(
@@ -61,7 +65,8 @@
6165 params(("device_id" = Uuid, Path)),
6266 responses(
6367 (status = 200, description = "device removed and its sessions revoked", body = AppResponseData<NoData>),
64 (status = 404, description = "not found", body = AppResponseData<NoData>)
68 (status = 404, description = "not found", body = AppResponseData<NoData>),
69 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6570 )
6671)]
6772pub async fn delete_device(
Modified lib/auth/src/handlers/forgot_password.rs lib/auth/src/handlers/forgot_password.rs +3 −2 View lib/auth/src/handlers/forgot_password.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -14,7 +14,8 @@
1414 tag = "auth",
1515 request_body = ForgotPasswordCmd,
1616 responses(
17 (status = 200, description = "reset token issued, delivery is not disclosed", body = AppResponseData<ForgotPasswordResp>)
17 (status = 200, description = "reset token issued, delivery is not disclosed", body = AppResponseData<ForgotPasswordResp>),
18 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn forgot_password(
Modified lib/auth/src/handlers/get_preferences.rs lib/auth/src/handlers/get_preferences.rs +4 −2 View lib/auth/src/handlers/get_preferences.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/me/preferences",
1313 tag = "account",
1414 responses(
15 (status = 200, description = "preferences for the current user, defaults when unset", body = AppResponseData<UserPreferencesDto>)
15 (status = 200, description = "preferences for the current user, defaults when unset", body = AppResponseData<UserPreferencesDto>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn get_preferences(
Modified lib/auth/src/handlers/get_user.rs lib/auth/src/handlers/get_user.rs +3 −2 View lib/auth/src/handlers/get_user.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Path, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44use session::share::session::require_uid;
55use uuid::Uuid;
@@ -16,7 +16,8 @@
1616 ("user_id" = Uuid, Path, description = "user id")
1717 ),
1818 responses(
19 (status = 200, description = "public user identity", body = AppResponseData<UserPublic>)
19 (status = 200, description = "public user identity", body = AppResponseData<UserPublic>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn get_user(
Modified lib/auth/src/handlers/list_access_keys.rs lib/auth/src/handlers/list_access_keys.rs +5 −3 View lib/auth/src/handlers/list_access_keys.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -14,14 +14,16 @@
1414 tag = "security",
1515 params(ListQuery),
1616 responses(
17 (status = 200, description = "access keys for the current user", body = AppResponseData<Vec<AccessKeyDto>>)
17 (status = 200, description = "access keys for the current user", body = AppResponseData<export::pagination::Page<AccessKeyDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn list_access_keys(
2123 State(service): State<AuthService>,
2224 session: Session,
2325 Query(query): Query<ListQuery>,
24) -> Result<AppResponseData<Vec<AccessKeyDto>>, ApiError> {
26) -> Result<AppResponseData<export::pagination::Page<AccessKeyDto>>, ApiError> {
2527 let uid = require_uid(&session)?;
2628 let keys = service
2729 .list_access_keys(uid, query)
Modified lib/auth/src/handlers/list_agreements.rs lib/auth/src/handlers/list_agreements.rs +3 −2 View lib/auth/src/handlers/list_agreements.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33
44use crate::errors::ApiError;
55use crate::services::AuthService;
@@ -10,7 +10,8 @@
1010 path = "/auth/agreements",
1111 tag = "account",
1212 responses(
13 (status = 200, description = "agreement documents from configuration", body = AppResponseData<Vec<AgreementDoc>>)
13 (status = 200, description = "agreement documents from configuration", body = AppResponseData<Vec<AgreementDoc>>),
14 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
1415 )
1516)]
1617pub async fn list_agreements(
Modified lib/auth/src/handlers/list_notifications.rs lib/auth/src/handlers/list_notifications.rs +4 −2 View lib/auth/src/handlers/list_notifications.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use serde::Deserialize;
44use session::Session;
55use utoipa::IntoParams;
@@ -24,7 +24,9 @@
2424 tag = "notifications",
2525 params(ListNotificationsQuery),
2626 responses(
27 (status = 200, description = "notifications for the current user", body = AppResponseData<export::pagination::Page<NotificationDto>>)
27 (status = 200, description = "notifications for the current user", body = AppResponseData<export::pagination::Page<NotificationDto>>),
28 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
29 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2830 )
2931)]
3032pub async fn list_notifications(
Modified lib/auth/src/handlers/list_ssh_keys.rs lib/auth/src/handlers/list_ssh_keys.rs +5 −3 View lib/auth/src/handlers/list_ssh_keys.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -14,14 +14,16 @@
1414 tag = "security",
1515 params(ListQuery),
1616 responses(
17 (status = 200, description = "ssh keys for the current user", body = AppResponseData<Vec<SshKeyDto>>)
17 (status = 200, description = "ssh keys for the current user", body = AppResponseData<export::pagination::Page<SshKeyDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn list_ssh_keys(
2123 State(service): State<AuthService>,
2224 session: Session,
2325 Query(query): Query<ListQuery>,
24) -> Result<AppResponseData<Vec<SshKeyDto>>, ApiError> {
26) -> Result<AppResponseData<export::pagination::Page<SshKeyDto>>, ApiError> {
2527 let uid = require_uid(&session)?;
2628 let keys = service
2729 .list_ssh_keys(uid, query)
Modified lib/auth/src/handlers/login.rs lib/auth/src/handlers/login.rs +4 −2 View lib/auth/src/handlers/login.rs
@@ -2,7 +2,7 @@
22use axum::extract::State;
33use axum::http::HeaderMap;
44
5use export::rest::AppResponseData;
5use export::rest::{AppResponseData, NoData};
66use session::Session;
77
88use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 tag = "auth",
1616 request_body = LoginCmd,
1717 responses(
18 (status = 200, description = "login accepted, session established", body = AppResponseData<LoginResp>)
18 (status = 200, description = "login accepted, session established", body = AppResponseData<LoginResp>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn login(
Modified lib/auth/src/handlers/login_2fa.rs lib/auth/src/handlers/login_2fa.rs +5 −2 View lib/auth/src/handlers/login_2fa.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -14,7 +14,10 @@
1414 tag = "auth",
1515 request_body = TwoFactorLoginCmd,
1616 responses(
17 (status = 200, description = "two-factor challenge accepted, session established", body = AppResponseData<LoginResp>)
17 (status = 200, description = "two-factor challenge accepted, session established", body = AppResponseData<LoginResp>),
18 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1821 )
1922)]
2023pub async fn login_2fa(
Modified lib/auth/src/handlers/logout.rs lib/auth/src/handlers/logout.rs +3 −2 View lib/auth/src/handlers/logout.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -11,7 +11,8 @@
1111 path = "/auth/logout",
1212 tag = "auth",
1313 responses(
14 (status = 200, description = "active user logged out of the session", body = AppResponseData<LogoutResp>)
14 (status = 200, description = "active user logged out of the session", body = AppResponseData<LogoutResp>),
15 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1516 )
1617)]
1718pub async fn logout(
Modified lib/auth/src/handlers/mark_notifications_read.rs lib/auth/src/handlers/mark_notifications_read.rs +2 −1 View lib/auth/src/handlers/mark_notifications_read.rs
@@ -29,7 +29,8 @@
2929 request_body = MarkNotificationsReadCmd,
3030 responses(
3131 (status = 200, description = "notifications marked read", body = AppResponseData<MarkedCountResp>),
32 (status = 400, description = "bad request", body = AppResponseData<NoData>)
32 (status = 400, description = "bad request", body = AppResponseData<NoData>),
33 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
3334 )
3435)]
3536pub async fn mark_notifications_read(
Modified lib/auth/src/handlers/me.rs lib/auth/src/handlers/me.rs +4 −2 View lib/auth/src/handlers/me.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use serde::Serialize;
44use session::Session;
55use utoipa::ToSchema;
@@ -20,7 +20,9 @@
2020 path = "/me",
2121 tag = "account",
2222 responses(
23 (status = 200, description = "identity and profile of the active user", body = AppResponseData<MeResp>)
23 (status = 200, description = "identity and profile of the active user", body = AppResponseData<MeResp>),
24 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
25 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2426 )
2527)]
2628pub async fn me(
Modified lib/auth/src/handlers/pow_challenge.rs lib/auth/src/handlers/pow_challenge.rs +3 −2 View lib/auth/src/handlers/pow_challenge.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use serde::Serialize;
44use session::Session;
55use utoipa::ToSchema;
@@ -20,7 +20,8 @@
2020 path = "/auth/pow/challenge",
2121 tag = "auth",
2222 responses(
23 (status = 200, description = "challenge issued", body = AppResponseData<PowChallengeResp>)
23 (status = 200, description = "challenge issued", body = AppResponseData<PowChallengeResp>),
24 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
2425 )
2526)]
2627pub async fn pow_challenge(
Modified lib/auth/src/handlers/reclaim.rs lib/auth/src/handlers/reclaim.rs +3 −2 View lib/auth/src/handlers/reclaim.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -14,7 +14,8 @@
1414 tag = "auth",
1515 request_body = ReclaimCmd,
1616 responses(
17 (status = 200, description = "inactive account reclaim issued", body = AppResponseData<ReclaimResp>)
17 (status = 200, description = "inactive account reclaim issued", body = AppResponseData<ReclaimResp>),
18 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn reclaim(
Modified lib/auth/src/handlers/recovery_codes.rs lib/auth/src/handlers/recovery_codes.rs +4 −2 View lib/auth/src/handlers/recovery_codes.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/auth/2fa/recovery-codes",
1313 tag = "auth",
1414 responses(
15 (status = 200, description = "recovery code usage summary, codes never returned", body = AppResponseData<RecoveryCodesResp>)
15 (status = 200, description = "recovery code usage summary, codes never returned", body = AppResponseData<RecoveryCodesResp>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn recovery_codes(
Modified lib/auth/src/handlers/regenerate_recovery_codes.rs lib/auth/src/handlers/regenerate_recovery_codes.rs +4 −2 View lib/auth/src/handlers/regenerate_recovery_codes.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 tag = "auth",
1616 request_body = RegenerateRecoveryCodesCmd,
1717 responses(
18 (status = 200, description = "replacement codes issued, shown only in this response", body = AppResponseData<RecoveryCodesResp>)
18 (status = 200, description = "replacement codes issued, shown only in this response", body = AppResponseData<RecoveryCodesResp>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn regenerate_recovery_codes(
Modified lib/auth/src/handlers/register.rs lib/auth/src/handlers/register.rs +3 −2 View lib/auth/src/handlers/register.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -14,7 +14,8 @@
1414 tag = "auth",
1515 request_body = RegisterCmd,
1616 responses(
17 (status = 200, description = "registration pending email verification", body = AppResponseData<RegisterResp>)
17 (status = 200, description = "registration pending email verification", body = AppResponseData<RegisterResp>),
18 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn register(
Modified lib/auth/src/handlers/request_deletion.rs lib/auth/src/handlers/request_deletion.rs +5 −2 View lib/auth/src/handlers/request_deletion.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use serde::{Deserialize, Serialize};
66use session::Session;
77use utoipa::ToSchema;
@@ -23,7 +23,10 @@
2323 tag = "deletion",
2424 request_body = RequestDeletionCmd,
2525 responses(
26 (status = 200, description = "deletion request recorded", body = AppResponseData<DeletionDto>)
26 (status = 200, description = "deletion request recorded", body = AppResponseData<DeletionDto>),
27 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
28 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
29 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2730 )
2831)]
2932pub async fn request_deletion(
Modified lib/auth/src/handlers/request_email_change.rs lib/auth/src/handlers/request_email_change.rs +3 −2 View lib/auth/src/handlers/request_email_change.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,8 @@
1515 tag = "auth",
1616 request_body = RequestEmailChangeCmd,
1717 responses(
18 (status = 200, description = "email change ticket created", body = AppResponseData<EmailChangeTicketDto>)
18 (status = 200, description = "email change ticket created", body = AppResponseData<EmailChangeTicketDto>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn request_email_change(
Modified lib/auth/src/handlers/resend_code.rs lib/auth/src/handlers/resend_code.rs +3 −2 View lib/auth/src/handlers/resend_code.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -14,7 +14,8 @@
1414 tag = "auth",
1515 request_body = ResendCodeCmd,
1616 responses(
17 (status = 200, description = "verification code resent", body = AppResponseData<ResendCodeResp>)
17 (status = 200, description = "verification code resent", body = AppResponseData<ResendCodeResp>),
18 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn resend_code(
Modified lib/auth/src/handlers/reset_password.rs lib/auth/src/handlers/reset_password.rs +2 −1 View lib/auth/src/handlers/reset_password.rs
@@ -12,7 +12,8 @@
1212 tag = "auth",
1313 request_body = ResetPasswordCmd,
1414 responses(
15 (status = 200, description = "password replaced, existing sessions invalidated", body = AppResponseData<NoData>)
15 (status = 200, description = "password replaced, existing sessions invalidated", body = AppResponseData<NoData>),
16 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1617 )
1718)]
1819pub async fn reset_password(
Modified lib/auth/src/handlers/rotate_access_key.rs lib/auth/src/handlers/rotate_access_key.rs +3 −1 View lib/auth/src/handlers/rotate_access_key.rs
@@ -15,7 +15,9 @@
1515 params(("key_id" = Uuid, Path)),
1616 responses(
1717 (status = 200, description = "access key rotated, new token returned", body = AppResponseData<CreateAccessKeyResp>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn rotate_access_key(
Modified lib/auth/src/handlers/totp_disable.rs lib/auth/src/handlers/totp_disable.rs +3 −1 View lib/auth/src/handlers/totp_disable.rs
@@ -15,7 +15,9 @@
1515 tag = "auth",
1616 request_body = TotpCodeCmd,
1717 responses(
18 (status = 200, description = "two-factor authentication disabled and recovery codes removed", body = AppResponseData<NoData>)
18 (status = 200, description = "two-factor authentication disabled and recovery codes removed", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn totp_disable(
Modified lib/auth/src/handlers/totp_enable.rs lib/auth/src/handlers/totp_enable.rs +4 −2 View lib/auth/src/handlers/totp_enable.rs
@@ -1,7 +1,7 @@
11use axum::Json;
22use axum::extract::State;
33
4use export::rest::AppResponseData;
4use export::rest::{AppResponseData, NoData};
55use session::Session;
66
77use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 tag = "auth",
1616 request_body = TotpEnableCmd,
1717 responses(
18 (status = 200, description = "two-factor authentication enabled and recovery codes generated", body = AppResponseData<RecoveryCodesResp>)
18 (status = 200, description = "two-factor authentication enabled and recovery codes generated", body = AppResponseData<RecoveryCodesResp>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn totp_enable(
Modified lib/auth/src/handlers/totp_setup.rs lib/auth/src/handlers/totp_setup.rs +3 −2 View lib/auth/src/handlers/totp_setup.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,8 @@
1212 path = "/auth/2fa/setup",
1313 tag = "auth",
1414 responses(
15 (status = 200, description = "new secret stored, awaiting enable", body = AppResponseData<TotpSetupResp>)
15 (status = 200, description = "new secret stored, awaiting enable", body = AppResponseData<TotpSetupResp>),
16 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1617 )
1718)]
1819pub async fn totp_setup(
Modified lib/auth/src/handlers/totp_status.rs lib/auth/src/handlers/totp_status.rs +4 −2 View lib/auth/src/handlers/totp_status.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/auth/2fa/status",
1313 tag = "auth",
1414 responses(
15 (status = 200, description = "two-factor status for the current user", body = AppResponseData<TotpStatusResp>)
15 (status = 200, description = "two-factor status for the current user", body = AppResponseData<TotpStatusResp>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn totp_status(
Modified lib/auth/src/handlers/unread_notifications_count.rs lib/auth/src/handlers/unread_notifications_count.rs +4 −2 View lib/auth/src/handlers/unread_notifications_count.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use serde::Serialize;
44use session::Session;
55use utoipa::ToSchema;
@@ -18,7 +18,9 @@
1818 path = "/me/notifications/unread-count",
1919 tag = "notifications",
2020 responses(
21 (status = 200, description = "number of unread notifications", body = AppResponseData<UnreadCountResp>)
21 (status = 200, description = "number of unread notifications", body = AppResponseData<UnreadCountResp>),
22 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn unread_notifications_count(
Modified lib/auth/src/handlers/update_access_key.rs lib/auth/src/handlers/update_access_key.rs +3 −1 View lib/auth/src/handlers/update_access_key.rs
@@ -17,7 +17,9 @@
1717 request_body = UpdateAccessKeyCmd,
1818 responses(
1919 (status = 200, description = "access key updated", body = AppResponseData<AccessKeyDto>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2123 )
2224)]
2325pub async fn update_access_key(
Modified lib/auth/src/handlers/update_preferences.rs lib/auth/src/handlers/update_preferences.rs +3 −1 View lib/auth/src/handlers/update_preferences.rs
@@ -15,7 +15,9 @@
1515 tag = "account",
1616 request_body = UpdatePreferencesCmd,
1717 responses(
18 (status = 200, description = "preferences updated", body = AppResponseData<NoData>)
18 (status = 200, description = "preferences updated", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn update_preferences(
Modified lib/auth/src/handlers/update_profile.rs lib/auth/src/handlers/update_profile.rs +3 −1 View lib/auth/src/handlers/update_profile.rs
@@ -15,7 +15,9 @@
1515 tag = "account",
1616 request_body = UpdateProfileCmd,
1717 responses(
18 (status = 200, description = "profile fields updated", body = AppResponseData<NoData>)
18 (status = 200, description = "profile fields updated", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn update_profile(
Modified lib/auth/src/handlers/users.rs lib/auth/src/handlers/users.rs +10 −4 View lib/auth/src/handlers/users.rs
@@ -1,6 +1,6 @@
11use axum::Json;
22use axum::extract::{Path, Query, State};
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use serde::Deserialize;
55use session::Session;
66use session::share::session::require_uid;
@@ -22,7 +22,9 @@
2222 tag = "users",
2323 params(UsersBatchQuery),
2424 responses(
25 (status = 200, description = "resolved public identities", body = AppResponseData<Vec<UserPublic>>)
25 (status = 200, description = "resolved public identities", body = AppResponseData<Vec<UserPublic>>),
26 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
27 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2628 )
2729)]
2830pub async fn list_users_batch(
@@ -44,7 +46,9 @@
4446 tag = "users",
4547 params(("username" = String, Path, description = "username")),
4648 responses(
47 (status = 200, description = "public user identity", body = AppResponseData<UserPublic>)
49 (status = 200, description = "public user identity", body = AppResponseData<UserPublic>),
50 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
51 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4852 )
4953)]
5054pub async fn get_user_by_username(
@@ -71,7 +75,9 @@
7175 tag = "account",
7276 request_body = UpdateUsernameCmd,
7377 responses(
74 (status = 200, description = "username updated", body = AppResponseData<UserPublic>)
78 (status = 200, description = "username updated", body = AppResponseData<UserPublic>),
79 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
80 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
7581 )
7682)]
7783pub async fn update_username(
Modified lib/auth/src/handlers/verify_email.rs lib/auth/src/handlers/verify_email.rs +3 −2 View lib/auth/src/handlers/verify_email.rs
@@ -4,7 +4,7 @@
44use crate::errors::ApiError;
55use crate::services::AuthService;
66use crate::services::email::{VerifyEmailCmd, VerifyEmailResp};
7use export::rest::AppResponseData;
7use export::rest::{AppResponseData, NoData};
88
99#[utoipa::path(
1010 post,
@@ -12,7 +12,8 @@
1212 tag = "auth",
1313 request_body = VerifyEmailCmd,
1414 responses(
15 (status = 200, description = "verification code accepted", body = AppResponseData<VerifyEmailResp>)
15 (status = 200, description = "verification code accepted", body = AppResponseData<VerifyEmailResp>),
16 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1617 )
1718)]
1819pub async fn verify_email(
Modified lib/auth/src/services/access_keys.rs lib/auth/src/services/access_keys.rs +22 −13 View lib/auth/src/services/access_keys.rs
@@ -1,7 +1,7 @@
11use models::users::user_access_keys::AccessKeyScope;
22use models::users::{user, user_access_keys};
33use sea_orm::{
4 ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, QueryOrder, QuerySelect, Set,
4 ActiveModelTrait, ColumnTrait, EntityTrait, PaginatorTrait, QueryFilter, QueryOrder, QuerySelect, Set,
55};
66use serde::{Deserialize, Serialize};
77use time::OffsetDateTime;
@@ -104,8 +104,12 @@
104104 &self,
105105 uid: Uuid,
106106 query: ListQuery,
107 ) -> Result<Vec<AccessKeyDto>, AuthError> {
107 ) -> Result<export::pagination::Page<AccessKeyDto>, AuthError> {
108108 let (limit, offset) = query.page();
109 let total = user_access_keys::Entity::find()
110 .filter(user_access_keys::Column::UserId.eq(uid))
111 .count(self.db().read())
112 .await? as i64;
109113 let rows = user_access_keys::Entity::find()
110114 .filter(user_access_keys::Column::UserId.eq(uid))
111115 .order_by_desc(user_access_keys::Column::CreatedAt)
@@ -113,17 +117,22 @@
113117 .offset(offset)
114118 .all(self.db().read())
115119 .await?;
116 Ok(rows
117 .into_iter()
118 .map(|row| AccessKeyDto {
119 id: row.id,
120 name: row.name,
121 scope: row.scope,
122 created_at: row.created_at,
123 expires_at: row.expires_at,
124 last_used_at: row.last_used_at,
125 })
126 .collect())
120 Ok(export::pagination::Page {
121 items: rows
122 .into_iter()
123 .map(|row| AccessKeyDto {
124 id: row.id,
125 name: row.name,
126 scope: row.scope,
127 created_at: row.created_at,
128 expires_at: row.expires_at,
129 last_used_at: row.last_used_at,
130 })
131 .collect(),
132 total,
133 limit,
134 offset,
135 })
127136 }
128137
129138 pub async fn update_access_key(
Modified lib/auth/src/services/ssh_keys.rs lib/auth/src/services/ssh_keys.rs +13 −4 View lib/auth/src/services/ssh_keys.rs
@@ -1,7 +1,7 @@
11use models::users::user_ssh_keys;
22use models::users::user_ssh_keys::SshKeyType;
33use sea_orm::{
4 ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, QueryOrder, QuerySelect, Set,
4 ActiveModelTrait, ColumnTrait, EntityTrait, PaginatorTrait, QueryFilter, QueryOrder, QuerySelect, Set,
55};
66use serde::{Deserialize, Serialize};
77use ssh_key::{Algorithm, EcdsaCurve, HashAlg};
@@ -92,8 +92,12 @@
9292 &self,
9393 uid: Uuid,
9494 query: ListQuery,
95 ) -> Result<Vec<SshKeyDto>, AuthError> {
95 ) -> Result<export::pagination::Page<SshKeyDto>, AuthError> {
9696 let (limit, offset) = query.page();
97 let total = user_ssh_keys::Entity::find()
98 .filter(user_ssh_keys::Column::UserId.eq(uid))
99 .count(self.db().read())
100 .await? as i64;
97101 let rows = user_ssh_keys::Entity::find()
98102 .filter(user_ssh_keys::Column::UserId.eq(uid))
99103 .order_by_desc(user_ssh_keys::Column::CreatedAt)
@@ -101,7 +105,11 @@
101105 .offset(offset)
102106 .all(self.db().read())
103107 .await?;
104 Ok(rows
108 Ok(export::pagination::Page {
109 total,
110 limit,
111 offset,
112 items: rows
105113 .into_iter()
106114 .map(|row| SshKeyDto {
107115 id: row.id,
@@ -110,7 +118,8 @@
110118 fingerprint: row.fingerprint,
111119 created_at: row.created_at,
112120 })
113 .collect())
121 .collect(),
122 })
114123 }
115124
116125 pub async fn delete_ssh_key(&self, uid: Uuid, key_id: Uuid) -> Result<(), AuthError> {
Modified lib/auth/src/openapi.rs lib/auth/src/openapi.rs +0 −2 View lib/auth/src/openapi.rs
@@ -33,7 +33,6 @@
3333use crate::services::register::{RegisterCmd, RegisterResp};
3434use crate::services::reports::{CreateReportCmd, ReportDto};
3535use crate::services::ssh_keys::{AddSshKeyCmd, SshKeyDto};
36use crate::services::suspensions::SuspensionDto;
3736use crate::services::two_factor::{
3837 RecoveryCodesResp, RegenerateRecoveryCodesCmd, TotpCodeCmd, TotpEnableCmd, TotpSetupResp,
3938 TotpStatusResp,
@@ -151,7 +150,6 @@
151150 UnreadCountResp,
152151 DeletionDto,
153152 RequestDeletionCmd,
154 SuspensionDto,
155153 ProfileVisibility,
156154 Audience,
157155 AccessKeyScope,
Modified lib/auth/src/worker.rs lib/auth/src/worker.rs +1 −1 View lib/auth/src/worker.rs
@@ -9,7 +9,7 @@
99use models::users::user_ssh_keys;
1010use models::users::{user, user_profiles};
1111use sea_orm::sea_query::Expr;
12use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter, QuerySelect, Set};
12use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter, Set};
1313use time::OffsetDateTime;
1414
1515use crate::services::AuthService;
Modified lib/chat/src/handlers/attachments.rs lib/chat/src/handlers/attachments.rs +10 −4 View lib/chat/src/handlers/attachments.rs
@@ -19,7 +19,9 @@
1919 request_body = CreateAttachmentCmd,
2020 responses(
2121 (status = 200, description = "upload intent", body = AppResponseData<UploadIntentDto>),
22 (status = 400, description = "bad request", body = AppResponseData<NoData>)
22 (status = 400, description = "bad request", body = AppResponseData<NoData>),
23 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
24 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2325 )
2426)]
2527pub async fn create_attachment(
@@ -40,7 +42,9 @@
4042 request_body = FinalizeAttachmentCmd,
4143 responses(
4244 (status = 200, description = "attachment finalized", body = AppResponseData<AttachmentDto>),
43 (status = 409, description = "already finalized", body = AppResponseData<NoData>)
45 (status = 409, description = "already finalized", body = AppResponseData<NoData>),
46 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
47 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4448 )
4549)]
4650pub async fn finalize_attachment(
@@ -61,7 +65,8 @@
6165 params(("attachment_id" = Uuid, Path, description = "attachment id")),
6266 responses(
6367 (status = 200, description = "attachment meta", body = AppResponseData<AttachmentDto>),
64 (status = 404, description = "not found", body = AppResponseData<NoData>)
68 (status = 404, description = "not found", body = AppResponseData<NoData>),
69 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6570 )
6671)]
6772pub async fn get_attachment(
@@ -81,7 +86,8 @@
8186 params(("attachment_id" = Uuid, Path, description = "attachment id")),
8287 responses(
8388 (status = 200, description = "file stream"),
84 (status = 404, description = "not found", body = AppResponseData<NoData>)
89 (status = 404, description = "not found", body = AppResponseData<NoData>),
90 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8591 )
8692)]
8793pub async fn download_attachment(
Modified lib/chat/src/handlers/bookmarks.rs lib/chat/src/handlers/bookmarks.rs +10 −4 View lib/chat/src/handlers/bookmarks.rs
@@ -15,7 +15,8 @@
1515 params(("room_id" = Uuid, Path, description = "room id"), export::pagination::PageQuery),
1616 responses(
1717 (status = 200, description = "bookmark list", body = AppResponseData<export::pagination::Page<BookmarkDto>>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_bookmarks(
@@ -37,7 +38,9 @@
3738 request_body = CreateBookmarkCmd,
3839 responses(
3940 (status = 200, description = "bookmark created", body = AppResponseData<BookmarkDto>),
40 (status = 400, description = "bad request", body = AppResponseData<NoData>)
41 (status = 400, description = "bad request", body = AppResponseData<NoData>),
42 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
43 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4144 )
4245)]
4346pub async fn create_bookmark(
@@ -62,7 +65,9 @@
6265 request_body = UpdateBookmarkCmd,
6366 responses(
6467 (status = 200, description = "bookmark updated", body = AppResponseData<BookmarkDto>),
65 (status = 404, description = "not found", body = AppResponseData<NoData>)
68 (status = 404, description = "not found", body = AppResponseData<NoData>),
69 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
70 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6671 )
6772)]
6873pub async fn update_bookmark(
@@ -88,7 +93,8 @@
8893 ),
8994 responses(
9095 (status = 200, description = "bookmark deleted", body = AppResponseData<NoData>),
91 (status = 404, description = "not found", body = AppResponseData<NoData>)
96 (status = 404, description = "not found", body = AppResponseData<NoData>),
97 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
9298 )
9399)]
94100pub async fn delete_bookmark(
Modified lib/chat/src/handlers/dms.rs lib/chat/src/handlers/dms.rs +8 −3 View lib/chat/src/handlers/dms.rs
@@ -17,7 +17,10 @@
1717 responses(
1818 (status = 200, description = "dm opened", body = AppResponseData<DmDto>),
1919 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
22 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2124 )
2225)]
2326pub async fn open_dm(
@@ -37,7 +40,8 @@
3740 params(export::pagination::PageQuery),
3841 responses(
3942 (status = 200, description = "my dms", body = AppResponseData<export::pagination::Page<DmDto>>),
40 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
43 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
44 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
4145 )
4246)]
4347pub async fn list_dms(
@@ -57,7 +61,8 @@
5761 params(("room_id" = Uuid, Path, description = "dm room id")),
5862 responses(
5963 (status = 200, description = "dm closed", body = AppResponseData<NoData>),
60 (status = 404, description = "not found", body = AppResponseData<NoData>)
64 (status = 404, description = "not found", body = AppResponseData<NoData>),
65 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6166 )
6267)]
6368pub async fn close_dm(
Modified lib/chat/src/handlers/drafts.rs lib/chat/src/handlers/drafts.rs +8 −4 View lib/chat/src/handlers/drafts.rs
@@ -21,7 +21,8 @@
2121 request_body = UpsertDraftCmd,
2222 responses(
2323 (status = 200, description = "draft saved", body = AppResponseData<DraftDto>),
24 (status = 400, description = "bad request", body = AppResponseData<NoData>)
24 (status = 400, description = "bad request", body = AppResponseData<NoData>),
25 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2526 )
2627)]
2728pub async fn upsert_draft(
@@ -42,7 +43,8 @@
4243 params(("room_id" = Uuid, Path, description = "room id"), DraftQuery),
4344 responses(
4445 (status = 200, description = "draft", body = AppResponseData<Option<DraftDto>>),
45 (status = 404, description = "not found", body = AppResponseData<NoData>)
46 (status = 404, description = "not found", body = AppResponseData<NoData>),
47 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4648 )
4749)]
4850pub async fn get_draft(
@@ -62,7 +64,8 @@
6264 tag = "chat",
6365 responses(
6466 (status = 200, description = "my drafts", body = AppResponseData<export::pagination::Page<DraftDto>>),
65 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
67 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
68 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
6669 )
6770)]
6871pub async fn list_my_drafts(
@@ -82,7 +85,8 @@
8285 params(("room_id" = Uuid, Path), ("thread_id" = Option<Uuid>, Query, description = "thread scope")),
8386 responses(
8487 (status = 200, description = "draft deleted", body = AppResponseData<NoData>),
85 (status = 404, description = "no draft", body = AppResponseData<NoData>)
88 (status = 404, description = "no draft", body = AppResponseData<NoData>),
89 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8690 )
8791)]
8892pub async fn delete_draft(
Modified lib/chat/src/handlers/emojis.rs lib/chat/src/handlers/emojis.rs +13 −6 View lib/chat/src/handlers/emojis.rs
@@ -1,4 +1,4 @@
1use axum::extract::{Json, Path, Query, State};
1use axum::extract::{Json, Path, State};
22use axum::http::StatusCode;
33use axum::response::{IntoResponse, Response};
44use export::rest::{AppResponseData, NoData};
@@ -18,7 +18,8 @@
1818 params(("space_name" = String, Path, description = "space name")),
1919 responses(
2020 (status = 200, description = "emoji list", body = AppResponseData<export::pagination::Page<EmojiDto>>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn list_emojis(
@@ -39,7 +40,10 @@
3940 request_body = UploadEmojiCmd,
4041 responses(
4142 (status = 200, description = "emoji created", body = AppResponseData<EmojiDto>),
42 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
43 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
44 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
45 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
46 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4347 )
4448)]
4549pub async fn upload_emoji(
@@ -63,7 +67,8 @@
6367 ),
6468 responses(
6569 (status = 200, description = "emoji deleted", body = AppResponseData<NoData>),
66 (status = 404, description = "not found", body = AppResponseData<NoData>)
70 (status = 404, description = "not found", body = AppResponseData<NoData>),
71 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6772 )
6873)]
6974pub async fn delete_emoji(
@@ -86,7 +91,8 @@
8691 ),
8792 responses(
8893 (status = 200, description = "emoji image"),
89 (status = 404, description = "not found", body = AppResponseData<NoData>)
94 (status = 404, description = "not found", body = AppResponseData<NoData>),
95 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
9096 )
9197)]
9298pub async fn emoji_image(
@@ -108,7 +114,8 @@
108114 params(("space_name" = String, Path), ("emoji_id" = Uuid, Path)),
109115 responses(
110116 (status = 200, description = "emoji", body = AppResponseData<EmojiDto>),
111 (status = 404, description = "not found", body = AppResponseData<NoData>)
117 (status = 404, description = "not found", body = AppResponseData<NoData>),
118 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
112119 )
113120)]
114121pub async fn get_emoji(
Modified lib/chat/src/handlers/messages.rs lib/chat/src/handlers/messages.rs +27 −10 View lib/chat/src/handlers/messages.rs
@@ -22,7 +22,9 @@
2222 (status = 200, description = "message sent", body = AppResponseData<MessageDto>),
2323 (status = 202, description = "message scheduled", body = AppResponseData<ScheduledMessageDto>),
2424 (status = 400, description = "bad request", body = AppResponseData<NoData>),
25 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
25 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
26 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
27 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2628 )
2729)]
2830pub async fn send_message(
@@ -50,7 +52,8 @@
5052 params(("room_id" = Uuid, Path, description = "room id"), ListMessageQuery),
5153 responses(
5254 (status = 200, description = "message page", body = AppResponseData<MessagePage>),
53 (status = 404, description = "not found", body = AppResponseData<NoData>)
55 (status = 404, description = "not found", body = AppResponseData<NoData>),
56 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
5457 )
5558)]
5659pub async fn list_messages(
@@ -71,7 +74,8 @@
7174 params(MessagePath),
7275 responses(
7376 (status = 200, description = "message detail", body = AppResponseData<MessageDto>),
74 (status = 404, description = "not found", body = AppResponseData<NoData>)
77 (status = 404, description = "not found", body = AppResponseData<NoData>),
78 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
7579 )
7680)]
7781pub async fn get_message(
@@ -94,7 +98,9 @@
9498 request_body = UpdateMessageCmd,
9599 responses(
96100 (status = 200, description = "message updated", body = AppResponseData<MessageDto>),
97 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
101 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
102 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
103 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
98104 )
99105)]
100106pub async fn update_message(
@@ -117,7 +123,8 @@
117123 params(MessagePath),
118124 responses(
119125 (status = 200, description = "message deleted", body = AppResponseData<NoData>),
120 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
126 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
127 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
121128 )
122129)]
123130pub async fn delete_message(
@@ -140,7 +147,10 @@
140147 request_body = BulkDeleteCmd,
141148 responses(
142149 (status = 200, description = "messages deleted", body = AppResponseData<NoData>),
143 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
150 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
151 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
152 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
153 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
144154 )
145155)]
146156pub async fn bulk_delete_messages(
@@ -162,7 +172,9 @@
162172 request_body = PinCmd,
163173 responses(
164174 (status = 200, description = "pin updated", body = AppResponseData<MessageDto>),
165 (status = 404, description = "not found", body = AppResponseData<NoData>)
175 (status = 404, description = "not found", body = AppResponseData<NoData>),
176 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
177 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
166178 )
167179)]
168180pub async fn set_message_pin(
@@ -185,7 +197,8 @@
185197 params(("room_id" = Uuid, Path, description = "room id")),
186198 responses(
187199 (status = 200, description = "pinned messages", body = AppResponseData<export::pagination::Page<MessageDto>>),
188 (status = 404, description = "not found", body = AppResponseData<NoData>)
200 (status = 404, description = "not found", body = AppResponseData<NoData>),
201 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
189202 )
190203)]
191204pub async fn list_pins(
@@ -206,7 +219,10 @@
206219 request_body = ForwardMessageCmd,
207220 responses(
208221 (status = 200, description = "message forwarded", body = AppResponseData<MessageDto>),
209 (status = 404, description = "not found", body = AppResponseData<NoData>)
222 (status = 404, description = "not found", body = AppResponseData<NoData>),
223 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
224 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
225 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
210226 )
211227)]
212228pub async fn forward_message(
@@ -229,7 +245,8 @@
229245 params(MessagePath),
230246 responses(
231247 (status = 200, description = "edit history", body = AppResponseData<Vec<MessageEditDto>>),
232 (status = 404, description = "not found", body = AppResponseData<NoData>)
248 (status = 404, description = "not found", body = AppResponseData<NoData>),
249 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
233250 )
234251)]
235252pub async fn list_message_history(
Modified lib/chat/src/handlers/presence.rs lib/chat/src/handlers/presence.rs +4 −2 View lib/chat/src/handlers/presence.rs
@@ -15,7 +15,8 @@
1515 request_body = SetPresenceCmd,
1616 responses(
1717 (status = 200, description = "presence updated", body = AppResponseData<PresenceDto>),
18 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
18 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn set_presence(
@@ -55,7 +56,8 @@
5556 params(("space_name" = String, Path, description = "space name")),
5657 responses(
5758 (status = 200, description = "space presences", body = AppResponseData<Vec<PresenceDto>>),
58 (status = 404, description = "not found", body = AppResponseData<NoData>)
59 (status = 404, description = "not found", body = AppResponseData<NoData>),
60 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
5961 )
6062)]
6163pub async fn list_space_presences(
Modified lib/chat/src/handlers/reactions.rs lib/chat/src/handlers/reactions.rs +8 −3 View lib/chat/src/handlers/reactions.rs
@@ -19,7 +19,9 @@
1919 request_body = ReactionCmd,
2020 responses(
2121 (status = 200, description = "reaction added", body = AppResponseData<Vec<ReactionAggDto>>),
22 (status = 404, description = "not found", body = AppResponseData<NoData>)
22 (status = 404, description = "not found", body = AppResponseData<NoData>),
23 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
24 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2325 )
2426)]
2527pub async fn add_reaction(
@@ -44,7 +46,9 @@
4446 request_body = ReactionCmd,
4547 responses(
4648 (status = 200, description = "reaction removed", body = AppResponseData<Vec<ReactionAggDto>>),
47 (status = 404, description = "not found", body = AppResponseData<NoData>)
49 (status = 404, description = "not found", body = AppResponseData<NoData>),
50 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
51 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4852 )
4953)]
5054pub async fn remove_reaction(
@@ -70,7 +74,8 @@
7074 ),
7175 responses(
7276 (status = 200, description = "reaction users", body = AppResponseData<Vec<ReactionUserDto>>),
73 (status = 404, description = "not found", body = AppResponseData<NoData>)
77 (status = 404, description = "not found", body = AppResponseData<NoData>),
78 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
7479 )
7580)]
7681pub async fn list_reactions(
Modified lib/chat/src/handlers/read_state.rs lib/chat/src/handlers/read_state.rs +11 −5 View lib/chat/src/handlers/read_state.rs
@@ -1,4 +1,4 @@
1use axum::extract::{Json, Path, Query, State};
1use axum::extract::{Json, Path, State};
22use export::rest::{AppResponseData, NoData};
33use session::Session;
44use session::share::session::require_uid;
@@ -16,7 +16,9 @@
1616 request_body = MarkReadCmd,
1717 responses(
1818 (status = 200, description = "read state updated", body = AppResponseData<ReadStateDto>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn mark_read(
@@ -37,7 +39,8 @@
3739 params(("room_id" = Uuid, Path, description = "room id")),
3840 responses(
3941 (status = 200, description = "read state", body = AppResponseData<ReadStateDto>),
40 (status = 404, description = "not found", body = AppResponseData<NoData>)
42 (status = 404, description = "not found", body = AppResponseData<NoData>),
43 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4144 )
4245)]
4346pub async fn get_read_state(
@@ -57,7 +60,8 @@
5760 params(("space_name" = String, Path, description = "space name")),
5861 responses(
5962 (status = 200, description = "space read states", body = AppResponseData<SpaceReadStatePage>),
60 (status = 404, description = "not found", body = AppResponseData<NoData>)
63 (status = 404, description = "not found", body = AppResponseData<NoData>),
64 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6165 )
6266)]
6367pub async fn list_space_read_states(
@@ -84,7 +88,9 @@
8488 request_body = MarkThreadReadCmd,
8589 responses(
8690 (status = 200, description = "thread marked read", body = AppResponseData<NoData>),
87 (status = 404, description = "not found", body = AppResponseData<NoData>)
91 (status = 404, description = "not found", body = AppResponseData<NoData>),
92 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
93 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8894 )
8995)]
9096pub async fn mark_thread_read(
Modified lib/chat/src/handlers/reminders.rs lib/chat/src/handlers/reminders.rs +11 −4 View lib/chat/src/handlers/reminders.rs
@@ -19,7 +19,10 @@
1919 request_body = CreateReminderCmd,
2020 responses(
2121 (status = 200, description = "reminder created", body = AppResponseData<ReminderDto>),
22 (status = 404, description = "not found", body = AppResponseData<NoData>)
22 (status = 404, description = "not found", body = AppResponseData<NoData>),
23 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
24 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
25 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2326 )
2427)]
2528pub async fn create_reminder(
@@ -41,7 +44,8 @@
4144 tag = "chat",
4245 responses(
4346 (status = 200, description = "pending reminders", body = AppResponseData<Vec<ReminderDto>>),
44 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
47 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
48 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
4549 )
4650)]
4751pub async fn list_reminders(
@@ -60,7 +64,8 @@
6064 params(("reminder_id" = Uuid, Path, description = "reminder id")),
6165 responses(
6266 (status = 200, description = "reminder cancelled", body = AppResponseData<NoData>),
63 (status = 404, description = "not found", body = AppResponseData<NoData>)
67 (status = 404, description = "not found", body = AppResponseData<NoData>),
68 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6469 )
6570)]
6671pub async fn cancel_reminder(
@@ -81,7 +86,9 @@
8186 request_body = UpdateReminderCmd,
8287 responses(
8388 (status = 200, description = "reminder updated", body = AppResponseData<ReminderDto>),
84 (status = 404, description = "not found", body = AppResponseData<NoData>)
89 (status = 404, description = "not found", body = AppResponseData<NoData>),
90 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
91 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8592 )
8693)]
8794pub async fn update_reminder(
Modified lib/chat/src/handlers/room_admin.rs lib/chat/src/handlers/room_admin.rs +17 −7 View lib/chat/src/handlers/room_admin.rs
@@ -18,7 +18,8 @@
1818 params(("room_id" = Uuid, Path), ("user_id" = Uuid, Path)),
1919 responses(
2020 (status = 200, description = "room member", body = AppResponseData<RoomMemberDto>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn get_room_member(
@@ -39,7 +40,9 @@
3940 request_body = UpdateRoomMemberCmd,
4041 responses(
4142 (status = 200, description = "room member updated", body = AppResponseData<RoomMemberDto>),
42 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
43 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
44 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
45 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4346 )
4447)]
4548pub async fn update_room_member(
@@ -60,7 +63,8 @@
6063 params(("room_id" = Uuid, Path), ("user_id" = Uuid, Path)),
6164 responses(
6265 (status = 200, description = "member removed", body = AppResponseData<NoData>),
63 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
66 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
67 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6468 )
6569)]
6670pub async fn kick_room_member(
@@ -79,7 +83,8 @@
7983 tag = "chat",
8084 params(("room_id" = Uuid, Path), export::pagination::PageQuery),
8185 responses(
82 (status = 200, description = "room bans", body = AppResponseData<export::pagination::Page<RoomBanDto>>)
86 (status = 200, description = "room bans", body = AppResponseData<export::pagination::Page<RoomBanDto>>),
87 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8388 )
8489)]
8590pub async fn list_room_bans(
@@ -101,7 +106,9 @@
101106 request_body = BanRoomMemberCmd,
102107 responses(
103108 (status = 200, description = "member banned", body = AppResponseData<RoomBanDto>),
104 (status = 409, description = "already banned", body = AppResponseData<NoData>)
109 (status = 409, description = "already banned", body = AppResponseData<NoData>),
110 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
111 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
105112 )
106113)]
107114pub async fn ban_room_member(
@@ -122,7 +129,8 @@
122129 params(("room_id" = Uuid, Path), ("user_id" = Uuid, Path)),
123130 responses(
124131 (status = 200, description = "member unbanned", body = AppResponseData<NoData>),
125 (status = 404, description = "not banned", body = AppResponseData<NoData>)
132 (status = 404, description = "not banned", body = AppResponseData<NoData>),
133 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
126134 )
127135)]
128136pub async fn unban_room_member(
@@ -148,7 +156,9 @@
148156 request_body = TransferOwnerCmd,
149157 responses(
150158 (status = 200, description = "ownership transferred", body = AppResponseData<NoData>),
151 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
159 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
160 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
161 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
152162 )
153163)]
154164pub async fn transfer_room_owner(
Modified lib/chat/src/handlers/rooms.rs lib/chat/src/handlers/rooms.rs +27 −10 View lib/chat/src/handlers/rooms.rs
@@ -39,7 +39,8 @@
3939 params(("room_id" = Uuid, Path, description = "room id")),
4040 responses(
4141 (status = 200, description = "room detail", body = AppResponseData<RoomBriefDto>),
42 (status = 404, description = "not found", body = AppResponseData<NoData>)
42 (status = 404, description = "not found", body = AppResponseData<NoData>),
43 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4344 )
4445)]
4546pub async fn get_room(
@@ -60,7 +61,9 @@
6061 request_body = UpdateRoomCmd,
6162 responses(
6263 (status = 200, description = "room updated", body = AppResponseData<RoomBriefDto>),
63 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
64 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
65 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
66 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6467 )
6568)]
6669pub async fn update_room(
@@ -81,7 +84,8 @@
8184 params(("room_id" = Uuid, Path, description = "room id")),
8285 responses(
8386 (status = 200, description = "joined", body = AppResponseData<NoData>),
84 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
87 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
88 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8589 )
8690)]
8791pub async fn join_room(
@@ -101,7 +105,8 @@
101105 params(("room_id" = Uuid, Path, description = "room id")),
102106 responses(
103107 (status = 200, description = "left", body = AppResponseData<NoData>),
104 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
108 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
109 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
105110 )
106111)]
107112pub async fn leave_room(
@@ -122,7 +127,10 @@
122127 request_body = AddMembersCmd,
123128 responses(
124129 (status = 200, description = "members added", body = AppResponseData<NoData>),
125 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
130 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
131 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
132 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
133 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
126134 )
127135)]
128136pub async fn add_room_members(
@@ -143,7 +151,8 @@
143151 params(("room_id" = Uuid, Path, description = "room id"), RoomMemberQuery),
144152 responses(
145153 (status = 200, description = "member list", body = AppResponseData<Vec<RoomMemberDto>>),
146 (status = 404, description = "not found", body = AppResponseData<NoData>)
154 (status = 404, description = "not found", body = AppResponseData<NoData>),
155 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
147156 )
148157)]
149158pub async fn list_room_members(
@@ -165,7 +174,10 @@
165174 request_body = CreateRoomInviteCmd,
166175 responses(
167176 (status = 200, description = "invite created", body = AppResponseData<RoomInviteDto>),
168 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
177 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
178 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
179 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
180 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
169181 )
170182)]
171183pub async fn create_room_invite(
@@ -187,7 +199,10 @@
187199 responses(
188200 (status = 200, description = "joined via invite", body = AppResponseData<RoomBriefDto>),
189201 (status = 404, description = "not found", body = AppResponseData<NoData>),
190 (status = 429, description = "rate limit exceeded", body = AppResponseData<NoData>)
202 (status = 429, description = "rate limit exceeded", body = AppResponseData<NoData>),
203 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
204 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
205 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
191206 )
192207)]
193208pub async fn accept_room_invite(
@@ -206,7 +221,8 @@
206221 tag = "chat",
207222 params(("room_id" = Uuid, Path)),
208223 responses(
209 (status = 200, description = "room invites", body = AppResponseData<Vec<RoomInviteListItemDto>>)
224 (status = 200, description = "room invites", body = AppResponseData<Vec<RoomInviteListItemDto>>),
225 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
210226 )
211227)]
212228pub async fn list_room_invites(
@@ -226,7 +242,8 @@
226242 params(("room_id" = Uuid, Path), ("invite_id" = Uuid, Path)),
227243 responses(
228244 (status = 200, description = "invite revoked", body = AppResponseData<NoData>),
229 (status = 404, description = "not found", body = AppResponseData<NoData>)
245 (status = 404, description = "not found", body = AppResponseData<NoData>),
246 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
230247 )
231248)]
232249pub async fn revoke_room_invite(
Modified lib/chat/src/handlers/search.rs lib/chat/src/handlers/search.rs +2 −1 View lib/chat/src/handlers/search.rs
@@ -14,7 +14,8 @@
1414 params(("space_name" = String, Path, description = "space name"), SearchQuery),
1515 responses(
1616 (status = 200, description = "search results", body = AppResponseData<SearchPage>),
17 (status = 404, description = "not found", body = AppResponseData<NoData>)
17 (status = 404, description = "not found", body = AppResponseData<NoData>),
18 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn search_messages(
Modified lib/chat/src/handlers/settings.rs lib/chat/src/handlers/settings.rs +5 −2 View lib/chat/src/handlers/settings.rs
@@ -15,7 +15,8 @@
1515 params(("room_id" = Uuid, Path, description = "room id")),
1616 responses(
1717 (status = 200, description = "room setting", body = AppResponseData<RoomSettingDto>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_room_setting(
@@ -36,7 +37,9 @@
3637 request_body = UpdateRoomSettingCmd,
3738 responses(
3839 (status = 200, description = "room setting updated", body = AppResponseData<RoomSettingDto>),
39 (status = 404, description = "not found", body = AppResponseData<NoData>)
40 (status = 404, description = "not found", body = AppResponseData<NoData>),
41 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
42 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4043 )
4144)]
4245pub async fn update_room_setting(
Modified lib/chat/src/handlers/threads.rs lib/chat/src/handlers/threads.rs +18 −7 View lib/chat/src/handlers/threads.rs
@@ -21,7 +21,10 @@
2121 request_body = CreateThreadCmd,
2222 responses(
2323 (status = 200, description = "thread created", body = AppResponseData<ThreadDto>),
24 (status = 404, description = "not found", body = AppResponseData<NoData>)
24 (status = 404, description = "not found", body = AppResponseData<NoData>),
25 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
26 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
27 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2528 )
2629)]
2730pub async fn create_thread(
@@ -42,7 +45,8 @@
4245 params(("room_id" = Uuid, Path, description = "room id"), ListThreadQuery),
4346 responses(
4447 (status = 200, description = "thread page", body = AppResponseData<ThreadPage>),
45 (status = 404, description = "not found", body = AppResponseData<NoData>)
48 (status = 404, description = "not found", body = AppResponseData<NoData>),
49 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4650 )
4751)]
4852pub async fn list_threads(
@@ -63,7 +67,8 @@
6367 params(export::pagination::PageQuery),
6468 responses(
6569 (status = 200, description = "my threads", body = AppResponseData<export::pagination::Page<ThreadDto>>),
66 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
70 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
71 (status = 404, description = "resource not found", body = AppResponseData<NoData>)
6772 )
6873)]
6974pub async fn list_my_threads(
@@ -83,7 +88,8 @@
8388 params(("thread_id" = Uuid, Path, description = "thread id")),
8489 responses(
8590 (status = 200, description = "thread detail", body = AppResponseData<ThreadDto>),
86 (status = 404, description = "not found", body = AppResponseData<NoData>)
91 (status = 404, description = "not found", body = AppResponseData<NoData>),
92 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
8793 )
8894)]
8995pub async fn get_thread(
@@ -104,7 +110,9 @@
104110 request_body = UpdateThreadCmd,
105111 responses(
106112 (status = 200, description = "thread updated", body = AppResponseData<ThreadDto>),
107 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
113 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
114 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
115 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
108116 )
109117)]
110118pub async fn update_thread(
@@ -126,7 +134,9 @@
126134 request_body = ThreadMemberCmd,
127135 responses(
128136 (status = 200, description = "followed", body = AppResponseData<NoData>),
129 (status = 404, description = "not found", body = AppResponseData<NoData>)
137 (status = 404, description = "not found", body = AppResponseData<NoData>),
138 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
139 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
130140 )
131141)]
132142pub async fn follow_thread(
@@ -147,7 +157,8 @@
147157 params(("thread_id" = Uuid, Path, description = "thread id")),
148158 responses(
149159 (status = 200, description = "unfollowed", body = AppResponseData<NoData>),
150 (status = 404, description = "not found", body = AppResponseData<NoData>)
160 (status = 404, description = "not found", body = AppResponseData<NoData>),
161 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
151162 )
152163)]
153164pub async fn unfollow_thread(
Modified lib/chat/src/handlers/webhooks.rs lib/chat/src/handlers/webhooks.rs +12 −5 View lib/chat/src/handlers/webhooks.rs
@@ -18,7 +18,9 @@
1818 responses(
1919 (status = 200, description = "webhook created", body = AppResponseData<WebhookSecretDto>),
2020 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
21 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
21 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
22 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn create_webhook(
@@ -39,7 +41,8 @@
3941 params(("room_id" = Uuid, Path, description = "room id"), export::pagination::PageQuery),
4042 responses(
4143 (status = 200, description = "webhook list", body = AppResponseData<export::pagination::Page<WebhookDto>>),
42 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
44 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
45 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4346 )
4447)]
4548pub async fn list_webhooks(
@@ -63,7 +66,8 @@
6366 ),
6467 responses(
6568 (status = 200, description = "webhook deleted", body = AppResponseData<NoData>),
66 (status = 404, description = "not found", body = AppResponseData<NoData>)
69 (status = 404, description = "not found", body = AppResponseData<NoData>),
70 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
6771 )
6872)]
6973pub async fn delete_webhook(
@@ -84,7 +88,8 @@
8488 request_body = WebhookPostCmd,
8589 responses(
8690 (status = 200, description = "message posted", body = AppResponseData<MessageDto>),
87 (status = 401, description = "invalid token", body = AppResponseData<NoData>)
91 (status = 401, description = "invalid token", body = AppResponseData<NoData>),
92 (status = 400, description = "request failed validation", body = AppResponseData<NoData>)
8893 )
8994)]
9095pub async fn post_via_webhook(
@@ -105,7 +110,9 @@
105110 request_body = UpdateWebhookCmd,
106111 responses(
107112 (status = 200, description = "webhook updated", body = AppResponseData<WebhookDto>),
108 (status = 404, description = "not found", body = AppResponseData<NoData>)
113 (status = 404, description = "not found", body = AppResponseData<NoData>),
114 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
115 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
109116 )
110117)]
111118pub async fn update_webhook(
Modified lib/chat/src/handlers/ws.rs lib/chat/src/handlers/ws.rs +2 −1 View lib/chat/src/handlers/ws.rs
@@ -21,7 +21,8 @@
2121 tag = "chat",
2222 responses(
2323 (status = 200, description = "ws ticket issued", body = AppResponseData<WsTicketDto>),
24 (status = 401, description = "unauthorized", body = AppResponseData<NoData>)
24 (status = 401, description = "unauthorized", body = AppResponseData<NoData>),
25 (status = 409, description = "resource already exists", body = AppResponseData<NoData>)
2526 )
2627)]
2728pub async fn issue_ws_ticket(
Modified lib/chat/src/services/room_admin.rs lib/chat/src/services/room_admin.rs +1 −1 View lib/chat/src/services/room_admin.rs
@@ -1,7 +1,7 @@
11use models::room::room_bans;
22use models::room::room_members::{self, RoomMemberRole};
33use models::room::rooms;
4use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, PaginatorTrait, QueryFilter, QueryOrder, Set};
4use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, QueryOrder, Set};
55use serde::{Deserialize, Serialize};
66use space::services::spaces::UserDto;
77use time::OffsetDateTime;
Modified lib/chat/src/ws/mod.rs lib/chat/src/ws/mod.rs +1 −0 View lib/chat/src/ws/mod.rs
@@ -164,6 +164,7 @@
164164 false
165165}
166166
167#[allow(dead_code)]
167168async fn close_with(mut socket: WebSocket, message: &str) -> Result<(), axum::Error> {
168169 let frame = ServerFrame::Bye {
169170 message: message.to_string(),
Modified lib/chat/src/routes.rs lib/chat/src/routes.rs +0 −1 View lib/chat/src/routes.rs
@@ -16,7 +16,6 @@
1616};
1717use crate::handlers::presence::{get_presence, list_space_presences, set_presence};
1818use crate::handlers::reactions::{add_reaction, list_reactions, remove_reaction};
19use crate::handlers::room_admin;
2019use crate::handlers::read_state::{
2120 get_read_state, list_space_read_states, mark_read, mark_thread_read,
2221};
Modified lib/issues/src/handlers/boards/create_board.rs lib/issues/src/handlers/boards/create_board.rs +3 −1 View lib/issues/src/handlers/boards/create_board.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "create board", body = AppResponseData<BoardDto>),
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn create_board(
Modified lib/issues/src/handlers/boards/delete_board.rs lib/issues/src/handlers/boards/delete_board.rs +2 −1 View lib/issues/src/handlers/boards/delete_board.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete board", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_board(
Modified lib/issues/src/handlers/boards/get_board.rs lib/issues/src/handlers/boards/get_board.rs +2 −1 View lib/issues/src/handlers/boards/get_board.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get board", body = AppResponseData<BoardDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_board(
Modified lib/issues/src/handlers/boards/list_boards.rs lib/issues/src/handlers/boards/list_boards.rs +2 −1 View lib/issues/src/handlers/boards/list_boards.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list boards", body = AppResponseData<BoardPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_boards(
Modified lib/issues/src/handlers/boards/update_board.rs lib/issues/src/handlers/boards/update_board.rs +2 −1 View lib/issues/src/handlers/boards/update_board.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "update board", body = AppResponseData<BoardDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_board(
Modified lib/issues/src/handlers/comments/create_comment.rs lib/issues/src/handlers/comments/create_comment.rs +3 −1 View lib/issues/src/handlers/comments/create_comment.rs
@@ -19,7 +19,9 @@
1919 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
2020 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2121 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
22 (status = 404, description = "not found", body = AppResponseData<NoData>)
22 (status = 404, description = "not found", body = AppResponseData<NoData>),
23 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
24 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2325 )
2426)]
2527pub async fn create_comment(
Modified lib/issues/src/handlers/comments/delete_comment.rs lib/issues/src/handlers/comments/delete_comment.rs +2 −1 View lib/issues/src/handlers/comments/delete_comment.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete comment", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_comment(
Modified lib/issues/src/handlers/comments/get_comment.rs lib/issues/src/handlers/comments/get_comment.rs +2 −1 View lib/issues/src/handlers/comments/get_comment.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get comment", body = AppResponseData<CommentDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_comment(
Modified lib/issues/src/handlers/comments/list_comments.rs lib/issues/src/handlers/comments/list_comments.rs +2 −1 View lib/issues/src/handlers/comments/list_comments.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list comments", body = AppResponseData<CommentPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_comments(
Modified lib/issues/src/handlers/comments/list_comments_tree.rs lib/issues/src/handlers/comments/list_comments_tree.rs +2 −1 View lib/issues/src/handlers/comments/list_comments_tree.rs
@@ -15,7 +15,8 @@
1515 params(IssuePath),
1616 responses(
1717 (status = 200, description = "nested comment tree", body = AppResponseData<Vec<CommentTreeNode>>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_comments_tree(
Modified lib/issues/src/handlers/comments/update_comment.rs lib/issues/src/handlers/comments/update_comment.rs +2 −1 View lib/issues/src/handlers/comments/update_comment.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "update comment", body = AppResponseData<CommentDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_comment(
Modified lib/issues/src/handlers/content_history/list_content_history.rs lib/issues/src/handlers/content_history/list_content_history.rs +2 −1 View lib/issues/src/handlers/content_history/list_content_history.rs
@@ -17,7 +17,8 @@
1717 responses(
1818 (status = 200, description = "list content history", body = AppResponseData<ContentHistoryPage>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn list_content_history(
Modified lib/issues/src/handlers/dependencies/create_dependency.rs lib/issues/src/handlers/dependencies/create_dependency.rs +2 −1 View lib/issues/src/handlers/dependencies/create_dependency.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_dependency(
Modified lib/issues/src/handlers/dependencies/delete_dependency.rs lib/issues/src/handlers/dependencies/delete_dependency.rs +2 −1 View lib/issues/src/handlers/dependencies/delete_dependency.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete issue dependency", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_dependency(
Modified lib/issues/src/handlers/dependencies/list_dependencies.rs lib/issues/src/handlers/dependencies/list_dependencies.rs +2 −1 View lib/issues/src/handlers/dependencies/list_dependencies.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list issue dependencies", body = AppResponseData<Vec<DependencyDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_dependencies(
Modified lib/issues/src/handlers/dependencies/list_dependents.rs lib/issues/src/handlers/dependencies/list_dependents.rs +2 −1 View lib/issues/src/handlers/dependencies/list_dependents.rs
@@ -15,7 +15,8 @@
1515 params(IssuePath),
1616 responses(
1717 (status = 200, description = "issues depending on this one", body = AppResponseData<Vec<DependencyDto>>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_dependents(
Modified lib/issues/src/handlers/events/list_events.rs lib/issues/src/handlers/events/list_events.rs +2 −1 View lib/issues/src/handlers/events/list_events.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "list issue events", body = AppResponseData<EventPage>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_events(
Modified lib/issues/src/handlers/issue_users/list_issue_users.rs lib/issues/src/handlers/issue_users/list_issue_users.rs +2 −1 View lib/issues/src/handlers/issue_users/list_issue_users.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list issue user states", body = AppResponseData<IssueUserPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_issue_users(
Modified lib/issues/src/handlers/issue_users/mark_issue_read.rs lib/issues/src/handlers/issue_users/mark_issue_read.rs +3 −1 View lib/issues/src/handlers/issue_users/mark_issue_read.rs
@@ -22,7 +22,9 @@
2222 responses(
2323 (status = 200, description = "mark issue read/unread for caller", body = AppResponseData<IssueUserDto>),
2424 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
25 (status = 404, description = "not found", body = AppResponseData<NoData>)
25 (status = 404, description = "not found", body = AppResponseData<NoData>),
26 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
27 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2628 )
2729)]
2830pub async fn mark_issue_read(
Modified lib/issues/src/handlers/issues/bulk_issues.rs lib/issues/src/handlers/issues/bulk_issues.rs +3 −1 View lib/issues/src/handlers/issues/bulk_issues.rs
@@ -17,7 +17,9 @@
1717 request_body = BulkIssuesCmd,
1818 responses(
1919 (status = 200, description = "bulk result", body = AppResponseData<BulkResultDto>),
20 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
20 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2123 )
2224)]
2325pub async fn bulk_issues(
Modified lib/issues/src/handlers/issues/close_issue.rs lib/issues/src/handlers/issues/close_issue.rs +3 −1 View lib/issues/src/handlers/issues/close_issue.rs
@@ -15,7 +15,9 @@
1515 responses(
1616 (status = 200, description = "close issue", body = AppResponseData<IssueDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn close_issue(
Modified lib/issues/src/handlers/issues/create_issue.rs lib/issues/src/handlers/issues/create_issue.rs +3 −1 View lib/issues/src/handlers/issues/create_issue.rs
@@ -19,7 +19,9 @@
1919 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
2020 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2121 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
22 (status = 404, description = "not found", body = AppResponseData<NoData>)
22 (status = 404, description = "not found", body = AppResponseData<NoData>),
23 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
24 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2325 )
2426)]
2527pub async fn create_issue(
Modified lib/issues/src/handlers/issues/delete_issue.rs lib/issues/src/handlers/issues/delete_issue.rs +2 −1 View lib/issues/src/handlers/issues/delete_issue.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete issue", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_issue(
Modified lib/issues/src/handlers/issues/get_issue.rs lib/issues/src/handlers/issues/get_issue.rs +2 −1 View lib/issues/src/handlers/issues/get_issue.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get issue", body = AppResponseData<IssueDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_issue(
Modified lib/issues/src/handlers/issues/list_issues.rs lib/issues/src/handlers/issues/list_issues.rs +2 −1 View lib/issues/src/handlers/issues/list_issues.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list issues", body = AppResponseData<IssuePage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_issues(
Modified lib/issues/src/handlers/issues/reopen_issue.rs lib/issues/src/handlers/issues/reopen_issue.rs +3 −1 View lib/issues/src/handlers/issues/reopen_issue.rs
@@ -15,7 +15,9 @@
1515 responses(
1616 (status = 200, description = "reopen issue", body = AppResponseData<IssueDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn reopen_issue(
Modified lib/issues/src/handlers/issues/update_issue.rs lib/issues/src/handlers/issues/update_issue.rs +2 −1 View lib/issues/src/handlers/issues/update_issue.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "update issue", body = AppResponseData<IssueDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_issue(
Modified lib/issues/src/handlers/labels/bind_label.rs lib/issues/src/handlers/labels/bind_label.rs +2 −1 View lib/issues/src/handlers/labels/bind_label.rs
@@ -16,7 +16,8 @@
1616 (status = 200, description = "bind label to issue", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
1818 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "conflict", body = AppResponseData<NoData>)
19 (status = 409, description = "conflict", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn bind_label(
Modified lib/issues/src/handlers/labels/create_label.rs lib/issues/src/handlers/labels/create_label.rs +3 −1 View lib/issues/src/handlers/labels/create_label.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "create label", body = AppResponseData<LabelDto>),
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn create_label(
Modified lib/issues/src/handlers/labels/delete_label.rs lib/issues/src/handlers/labels/delete_label.rs +2 −1 View lib/issues/src/handlers/labels/delete_label.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete label", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_label(
Modified lib/issues/src/handlers/labels/get_label.rs lib/issues/src/handlers/labels/get_label.rs +2 −1 View lib/issues/src/handlers/labels/get_label.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get label", body = AppResponseData<LabelDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_label(
Modified lib/issues/src/handlers/labels/list_labels.rs lib/issues/src/handlers/labels/list_labels.rs +2 −1 View lib/issues/src/handlers/labels/list_labels.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list labels", body = AppResponseData<LabelPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_labels(
Modified lib/issues/src/handlers/labels/list_labels_for_issue.rs lib/issues/src/handlers/labels/list_labels_for_issue.rs +2 −1 View lib/issues/src/handlers/labels/list_labels_for_issue.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list labels for issue", body = AppResponseData<Vec<LabelDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_labels_for_issue(
Modified lib/issues/src/handlers/labels/unbind_label.rs lib/issues/src/handlers/labels/unbind_label.rs +2 −1 View lib/issues/src/handlers/labels/unbind_label.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "unbind label from issue", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn unbind_label(
Modified lib/issues/src/handlers/labels/update_label.rs lib/issues/src/handlers/labels/update_label.rs +2 −1 View lib/issues/src/handlers/labels/update_label.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "update label", body = AppResponseData<LabelDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_label(
Modified lib/issues/src/handlers/members/create_member.rs lib/issues/src/handlers/members/create_member.rs +2 −1 View lib/issues/src/handlers/members/create_member.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_member(
Modified lib/issues/src/handlers/members/delete_member.rs lib/issues/src/handlers/members/delete_member.rs +2 −1 View lib/issues/src/handlers/members/delete_member.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete issue member", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_member(
Modified lib/issues/src/handlers/members/list_members.rs lib/issues/src/handlers/members/list_members.rs +3 −2 View lib/issues/src/handlers/members/list_members.rs
@@ -16,10 +16,11 @@
1616 responses(
1717 (status = 200, description = "list issue members", body = AppResponseData<IssueMemberPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
22pub async fn list_members(
23pub async fn list_issue_members(
2324 State(service): State<IssueService>,
2425 session: Session,
2526 Path(path): Path<IssuePath>,
Modified lib/issues/src/handlers/milestones/create_milestone.rs lib/issues/src/handlers/milestones/create_milestone.rs +3 −1 View lib/issues/src/handlers/milestones/create_milestone.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "create milestone", body = AppResponseData<MilestoneDto>),
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn create_milestone(
Modified lib/issues/src/handlers/milestones/delete_milestone.rs lib/issues/src/handlers/milestones/delete_milestone.rs +2 −1 View lib/issues/src/handlers/milestones/delete_milestone.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete milestone", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_milestone(
Modified lib/issues/src/handlers/milestones/get_milestone.rs lib/issues/src/handlers/milestones/get_milestone.rs +2 −1 View lib/issues/src/handlers/milestones/get_milestone.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get milestone", body = AppResponseData<MilestoneDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_milestone(
Modified lib/issues/src/handlers/milestones/list_milestones.rs lib/issues/src/handlers/milestones/list_milestones.rs +2 −1 View lib/issues/src/handlers/milestones/list_milestones.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list milestones", body = AppResponseData<MilestonePage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_milestones(
Modified lib/issues/src/handlers/milestones/update_milestone.rs lib/issues/src/handlers/milestones/update_milestone.rs +2 −1 View lib/issues/src/handlers/milestones/update_milestone.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "update milestone", body = AppResponseData<MilestoneDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_milestone(
Modified lib/issues/src/handlers/pins/create_pin.rs lib/issues/src/handlers/pins/create_pin.rs +2 −1 View lib/issues/src/handlers/pins/create_pin.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_pin(
Modified lib/issues/src/handlers/pins/delete_pin.rs lib/issues/src/handlers/pins/delete_pin.rs +2 −1 View lib/issues/src/handlers/pins/delete_pin.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete pin", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_pin(
Modified lib/issues/src/handlers/pins/list_pins.rs lib/issues/src/handlers/pins/list_pins.rs +3 −2 View lib/issues/src/handlers/pins/list_pins.rs
@@ -16,10 +16,11 @@
1616 responses(
1717 (status = 200, description = "list pinned issues", body = AppResponseData<Vec<PinDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
22pub async fn list_pins(
23pub async fn list_board_pins(
2324 State(service): State<IssueService>,
2425 session: Session,
2526 Path(path): Path<BoardPath>,
Modified lib/issues/src/handlers/pins/update_pin.rs lib/issues/src/handlers/pins/update_pin.rs +3 −1 View lib/issues/src/handlers/pins/update_pin.rs
@@ -16,7 +16,9 @@
1616 request_body = UpdatePinCmd,
1717 responses(
1818 (status = 200, description = "pin updated", body = AppResponseData<PinDto>),
19 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
19 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn update_pin(
Modified lib/issues/src/handlers/reactions/add_comment_reaction.rs lib/issues/src/handlers/reactions/add_comment_reaction.rs +2 −1 View lib/issues/src/handlers/reactions/add_comment_reaction.rs
@@ -18,7 +18,8 @@
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2020 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 409, description = "conflict", body = AppResponseData<NoData>)
21 (status = 409, description = "conflict", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn add_comment_reaction(
Modified lib/issues/src/handlers/reactions/add_reaction.rs lib/issues/src/handlers/reactions/add_reaction.rs +3 −2 View lib/issues/src/handlers/reactions/add_reaction.rs
@@ -19,10 +19,11 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
25pub async fn add_reaction(
26pub async fn add_issue_reaction(
2627 State(service): State<IssueService>,
2728 session: Session,
2829 Path(path): Path<IssuePath>,
Modified lib/issues/src/handlers/reactions/list_comment_reactions.rs lib/issues/src/handlers/reactions/list_comment_reactions.rs +2 −1 View lib/issues/src/handlers/reactions/list_comment_reactions.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "list comment reactions", body = AppResponseData<Vec<ReactionAggDto>>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_comment_reactions(
Modified lib/issues/src/handlers/reactions/list_reactions.rs lib/issues/src/handlers/reactions/list_reactions.rs +3 −2 View lib/issues/src/handlers/reactions/list_reactions.rs
@@ -16,10 +16,11 @@
1616 responses(
1717 (status = 200, description = "list reactions", body = AppResponseData<Vec<ReactionAggDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
22pub async fn list_reactions(
23pub async fn list_issue_reactions(
2324 State(service): State<IssueService>,
2425 session: Session,
2526 Path(path): Path<IssuePath>,
Modified lib/issues/src/handlers/reactions/remove_comment_reaction.rs lib/issues/src/handlers/reactions/remove_comment_reaction.rs +2 −1 View lib/issues/src/handlers/reactions/remove_comment_reaction.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "removed my comment reaction", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn remove_comment_reaction(
Modified lib/issues/src/handlers/reactions/remove_reaction.rs lib/issues/src/handlers/reactions/remove_reaction.rs +3 −2 View lib/issues/src/handlers/reactions/remove_reaction.rs
@@ -16,10 +16,11 @@
1616 responses(
1717 (status = 200, description = "removed my reaction", body = AppResponseData<NoData>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
22pub async fn remove_reaction(
23pub async fn remove_issue_reaction(
2324 State(service): State<IssueService>,
2425 session: Session,
2526 Path(path): Path<IssuePath>,
Modified lib/issues/src/handlers/repo_relations/create_repo_relation.rs lib/issues/src/handlers/repo_relations/create_repo_relation.rs +2 −1 View lib/issues/src/handlers/repo_relations/create_repo_relation.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_repo_relation(
Modified lib/issues/src/handlers/repo_relations/delete_repo_relation.rs lib/issues/src/handlers/repo_relations/delete_repo_relation.rs +2 −1 View lib/issues/src/handlers/repo_relations/delete_repo_relation.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "delete issue repository relation", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_repo_relation(
Modified lib/issues/src/handlers/repo_relations/list_repo_relations.rs lib/issues/src/handlers/repo_relations/list_repo_relations.rs +2 −1 View lib/issues/src/handlers/repo_relations/list_repo_relations.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list issue repository relations", body = AppResponseData<Vec<RepoRelDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_repo_relations(
Modified lib/issues/src/handlers/stopwatch/get_stopwatch.rs lib/issues/src/handlers/stopwatch/get_stopwatch.rs +2 −1 View lib/issues/src/handlers/stopwatch/get_stopwatch.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "get stopwatch status", body = AppResponseData<StopwatchDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_stopwatch(
Modified lib/issues/src/handlers/stopwatch/start_stopwatch.rs lib/issues/src/handlers/stopwatch/start_stopwatch.rs +2 −1 View lib/issues/src/handlers/stopwatch/start_stopwatch.rs
@@ -16,7 +16,8 @@
1616 (status = 200, description = "start stopwatch", body = AppResponseData<StopwatchDto>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
1818 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "conflict", body = AppResponseData<NoData>)
19 (status = 409, description = "conflict", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn start_stopwatch(
Modified lib/issues/src/handlers/stopwatch/stop_stopwatch.rs lib/issues/src/handlers/stopwatch/stop_stopwatch.rs +3 −1 View lib/issues/src/handlers/stopwatch/stop_stopwatch.rs
@@ -15,7 +15,9 @@
1515 responses(
1616 (status = 200, description = "stop stopwatch", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn stop_stopwatch(
Modified lib/issues/src/handlers/tracked_time/create_tracked_time.rs lib/issues/src/handlers/tracked_time/create_tracked_time.rs +3 −1 View lib/issues/src/handlers/tracked_time/create_tracked_time.rs
@@ -16,7 +16,9 @@
1616 request_body = CreateTrackedTimeCmd,
1717 responses(
1818 (status = 200, description = "time logged", body = AppResponseData<TrackedTimeDto>),
19 (status = 400, description = "bad request", body = AppResponseData<NoData>)
19 (status = 400, description = "bad request", body = AppResponseData<NoData>),
20 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn create_tracked_time(
Modified lib/issues/src/handlers/tracked_time/delete_tracked_time.rs lib/issues/src/handlers/tracked_time/delete_tracked_time.rs +2 −1 View lib/issues/src/handlers/tracked_time/delete_tracked_time.rs
@@ -14,7 +14,8 @@
1414 params(TrackedTimeIdPath),
1515 responses(
1616 (status = 200, description = "time removed", body = AppResponseData<NoData>),
17 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
17 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1819 )
1920)]
2021pub async fn delete_tracked_time(
Modified lib/issues/src/handlers/tracked_time/list_tracked_time.rs lib/issues/src/handlers/tracked_time/list_tracked_time.rs +2 −1 View lib/issues/src/handlers/tracked_time/list_tracked_time.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "list tracked times", body = AppResponseData<TrackedTimePage>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_tracked_time(
Modified lib/issues/src/handlers/tracked_time/update_tracked_time.rs lib/issues/src/handlers/tracked_time/update_tracked_time.rs +3 −1 View lib/issues/src/handlers/tracked_time/update_tracked_time.rs
@@ -16,7 +16,9 @@
1616 request_body = UpdateTrackedTimeCmd,
1717 responses(
1818 (status = 200, description = "time updated", body = AppResponseData<TrackedTimeDto>),
19 (status = 403, description = "forbidden", body = AppResponseData<NoData>)
19 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn update_tracked_time(
Modified lib/issues/src/handlers/watches/upsert_watch.rs lib/issues/src/handlers/watches/upsert_watch.rs +3 −2 View lib/issues/src/handlers/watches/upsert_watch.rs
@@ -17,10 +17,11 @@
1717 (status = 200, description = "upsert watch", body = AppResponseData<WatchDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
23pub async fn upsert_watch(
24pub async fn upsert_issue_watch(
2425 State(service): State<IssueService>,
2526 session: Session,
2627 Path(path): Path<WatchPath>,
Modified lib/issues/src/services/comments.rs lib/issues/src/services/comments.rs +1 −0 View lib/issues/src/services/comments.rs
@@ -35,6 +35,7 @@
3535#[derive(Debug, Clone, Serialize, ToSchema)]
3636pub struct CommentTreeNode {
3737 pub comment: CommentDto,
38 #[schema(no_recursion)]
3839 pub replies: Vec<CommentTreeNode>,
3940}
4041
Modified lib/issues/src/openapi.rs lib/issues/src/openapi.rs +8 −8 View lib/issues/src/openapi.rs
@@ -18,9 +18,9 @@
1818 crate::handlers::issues::bulk_issues::bulk_issues,
1919 crate::handlers::dependencies::list_dependents::list_dependents,
2020 crate::handlers::pins::update_pin::update_pin,
21 crate::handlers::comments::list_comments_tree::list_comments_tree,
2221 crate::handlers::issues::reopen_issue::reopen_issue,
2322 crate::handlers::comments::list_comments::list_comments,
23 crate::handlers::comments::list_comments_tree::list_comments_tree,
2424 crate::handlers::comments::create_comment::create_comment,
2525 crate::handlers::comments::get_comment::get_comment,
2626 crate::handlers::comments::update_comment::update_comment,
@@ -38,17 +38,17 @@
3838 crate::handlers::milestones::get_milestone::get_milestone,
3939 crate::handlers::milestones::update_milestone::update_milestone,
4040 crate::handlers::milestones::delete_milestone::delete_milestone,
41 crate::handlers::reactions::list_reactions::list_reactions,
42 crate::handlers::reactions::add_reaction::add_reaction,
43 crate::handlers::reactions::remove_reaction::remove_reaction,
41 crate::handlers::reactions::list_reactions::list_issue_reactions,
42 crate::handlers::reactions::add_reaction::add_issue_reaction,
43 crate::handlers::reactions::remove_reaction::remove_issue_reaction,
4444 crate::handlers::reactions::list_comment_reactions::list_comment_reactions,
4545 crate::handlers::reactions::add_comment_reaction::add_comment_reaction,
4646 crate::handlers::reactions::remove_comment_reaction::remove_comment_reaction,
47 crate::handlers::watches::upsert_watch::upsert_watch,
48 crate::handlers::members::list_members::list_members,
47 crate::handlers::watches::upsert_watch::upsert_issue_watch,
48 crate::handlers::members::list_members::list_issue_members,
4949 crate::handlers::members::create_member::create_member,
5050 crate::handlers::members::delete_member::delete_member,
51 crate::handlers::pins::list_pins::list_pins,
51 crate::handlers::pins::list_pins::list_board_pins,
5252 crate::handlers::pins::create_pin::create_pin,
5353 crate::handlers::pins::delete_pin::delete_pin,
5454 crate::handlers::events::list_events::list_events,
@@ -118,6 +118,7 @@
118118 crate::services::issues::ListIssueQuery,
119119 crate::services::issues::IssuePath,
120120 crate::services::comments::CommentDto,
121 crate::services::comments::CommentTreeNode,
121122 crate::services::comments::CommentPage,
122123 crate::services::comments::CreateCommentCmd,
123124 crate::services::comments::UpdateCommentCmd,
@@ -178,7 +179,6 @@
178179 crate::services::issues::BulkAction,
179180 crate::services::issues::BulkIssuesCmd,
180181 crate::services::issues::BulkResultDto,
181 crate::services::comments::CommentTreeNode,
182182 crate::services::tracked_time::TrackedTimePath,
183183 crate::services::tracked_time::ListTrackedTimeQuery,
184184 crate::services::issue_users::IssueUserDto,
Modified lib/issues/src/routes.rs lib/issues/src/routes.rs +12 −12 View lib/issues/src/routes.rs
@@ -1,5 +1,5 @@
11use axum::Router;
2use axum::routing::{delete, get, patch, post, put};
2use axum::routing::{delete, get, post, put};
33
44use crate::handlers::boards::create_board::create_board;
55use crate::handlers::boards::delete_board::delete_board;
@@ -35,7 +35,7 @@
3535use crate::handlers::labels::update_label::update_label;
3636use crate::handlers::members::create_member::create_member;
3737use crate::handlers::members::delete_member::delete_member;
38use crate::handlers::members::list_members::list_members;
38use crate::handlers::members::list_members::list_issue_members;
3939use crate::handlers::milestones::create_milestone::create_milestone;
4040use crate::handlers::milestones::delete_milestone::delete_milestone;
4141use crate::handlers::milestones::get_milestone::get_milestone;
@@ -43,13 +43,13 @@
4343use crate::handlers::milestones::update_milestone::update_milestone;
4444use crate::handlers::pins::create_pin::create_pin;
4545use crate::handlers::pins::delete_pin::delete_pin;
46use crate::handlers::pins::list_pins::list_pins;
46use crate::handlers::pins::list_pins::list_board_pins;
4747use crate::handlers::reactions::add_comment_reaction::add_comment_reaction;
48use crate::handlers::reactions::add_reaction::add_reaction;
48use crate::handlers::reactions::add_reaction::add_issue_reaction;
4949use crate::handlers::reactions::list_comment_reactions::list_comment_reactions;
50use crate::handlers::reactions::list_reactions::list_reactions;
50use crate::handlers::reactions::list_reactions::list_issue_reactions;
5151use crate::handlers::reactions::remove_comment_reaction::remove_comment_reaction;
52use crate::handlers::reactions::remove_reaction::remove_reaction;
52use crate::handlers::reactions::remove_reaction::remove_issue_reaction;
5353use crate::handlers::repo_relations::create_repo_relation::create_repo_relation;
5454use crate::handlers::repo_relations::delete_repo_relation::delete_repo_relation;
5555use crate::handlers::repo_relations::list_repo_relations::list_repo_relations;
@@ -57,7 +57,7 @@
5757use crate::handlers::stopwatch::start_stopwatch::start_stopwatch;
5858use crate::handlers::stopwatch::stop_stopwatch::stop_stopwatch;
5959use crate::handlers::tracked_time::list_tracked_time::list_tracked_time;
60use crate::handlers::watches::upsert_watch::upsert_watch;
60use crate::handlers::watches::upsert_watch::upsert_issue_watch;
6161use crate::services::service::IssueService;
6262use crate::share::guard::issue_guard;
6363
@@ -130,11 +130,11 @@
130130 )
131131 .route(
132132 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/reactions",
133 get(list_reactions),
133 get(list_issue_reactions),
134134 )
135135 .route(
136136 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/reactions/@me",
137 axum::routing::put(add_reaction).delete(remove_reaction),
137 axum::routing::put(add_issue_reaction).delete(remove_issue_reaction),
138138 )
139139 .route(
140140 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/comments/{comment_id}/reactions",
@@ -146,11 +146,11 @@
146146 )
147147 .route(
148148 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/watch",
149 put(upsert_watch),
149 put(upsert_issue_watch),
150150 )
151151 .route(
152152 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/members",
153 get(list_members).post(create_member),
153 get(list_issue_members).post(create_member),
154154 )
155155 .route(
156156 "/issues/{space_name}/boards/{board_id}/issues/{issue_id}/members/{member_id}",
@@ -158,7 +158,7 @@
158158 )
159159 .route(
160160 "/issues/{space_name}/boards/{board_id}/pins",
161 get(list_pins).post(create_pin),
161 get(list_board_pins).post(create_pin),
162162 )
163163 .route(
164164 "/issues/{space_name}/boards/{board_id}/pins/{pin_id}",
Modified lib/space/src/handlers/accept_invite.rs lib/space/src/handlers/accept_invite.rs +3 −1 View lib/space/src/handlers/accept_invite.rs
@@ -17,7 +17,9 @@
1717 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
1919 (status = 404, description = "invite not found", body = AppResponseData<NoData>),
20 (status = 409, description = "conflict", body = AppResponseData<NoData>)
20 (status = 409, description = "conflict", body = AppResponseData<NoData>),
21 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2123 )
2224)]
2325pub async fn accept_invite(
Modified lib/space/src/handlers/add_member.rs lib/space/src/handlers/add_member.rs +2 −1 View lib/space/src/handlers/add_member.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "already a member", body = AppResponseData<NoData>)
22 (status = 409, description = "already a member", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn add_member(
Modified lib/space/src/handlers/assign_group.rs lib/space/src/handlers/assign_group.rs +3 −1 View lib/space/src/handlers/assign_group.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "group assigned", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2020 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 409, description = "already assigned", body = AppResponseData<NoData>)
21 (status = 409, description = "already assigned", body = AppResponseData<NoData>),
22 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn assign_group(
Modified lib/space/src/handlers/ban_user.rs lib/space/src/handlers/ban_user.rs +3 −1 View lib/space/src/handlers/ban_user.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "user banned", body = AppResponseData<BanDto>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2020 (status = 404, description = "user or space not found", body = AppResponseData<NoData>),
21 (status = 409, description = "already banned", body = AppResponseData<NoData>)
21 (status = 409, description = "already banned", body = AppResponseData<NoData>),
22 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn ban_user(
Modified lib/space/src/handlers/create_dir_node.rs lib/space/src/handlers/create_dir_node.rs +3 −1 View lib/space/src/handlers/create_dir_node.rs
@@ -18,7 +18,9 @@
1818 (status = 200, description = "dir node created", body = AppResponseData<DirNodeDto>),
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 404, description = "space or parent not found", body = AppResponseData<NoData>)
21 (status = 404, description = "space or parent not found", body = AppResponseData<NoData>),
22 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2224 )
2325)]
2426pub async fn create_dir_node(
Modified lib/space/src/handlers/create_group.rs lib/space/src/handlers/create_group.rs +2 −1 View lib/space/src/handlers/create_group.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "space not found", body = AppResponseData<NoData>),
22 (status = 409, description = "group name conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "group name conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_group(
Modified lib/space/src/handlers/create_invite.rs lib/space/src/handlers/create_invite.rs +2 −1 View lib/space/src/handlers/create_invite.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "user or space not found", body = AppResponseData<NoData>),
22 (status = 409, description = "active invite conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "active invite conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_invite(
Modified lib/space/src/handlers/create_join_rule.rs lib/space/src/handlers/create_join_rule.rs +2 −1 View lib/space/src/handlers/create_join_rule.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn create_join_rule(
Modified lib/space/src/handlers/create_room.rs lib/space/src/handlers/create_room.rs +2 −1 View lib/space/src/handlers/create_room.rs
@@ -20,7 +20,8 @@
2020 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2121 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2222 (status = 404, description = "space not found", body = AppResponseData<NoData>),
23 (status = 409, description = "room name conflict", body = AppResponseData<NoData>)
23 (status = 409, description = "room name conflict", body = AppResponseData<NoData>),
24 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2425 )
2526)]
2627pub async fn create_room(
Modified lib/space/src/handlers/create_space.rs lib/space/src/handlers/create_space.rs +2 −1 View lib/space/src/handlers/create_space.rs
@@ -16,7 +16,8 @@
1616 (status = 200, description = "space created", body = AppResponseData<SpaceDto>),
1717 (status = 429, description = "creation quota exceeded", body = AppResponseData<NoData>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
19 (status = 409, description = "space name conflict", body = AppResponseData<NoData>)
19 (status = 409, description = "space name conflict", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn create_space(
Modified lib/space/src/handlers/delete_group.rs lib/space/src/handlers/delete_group.rs +2 −1 View lib/space/src/handlers/delete_group.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "group deleted", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_group(
Modified lib/space/src/handlers/delete_join_rule.rs lib/space/src/handlers/delete_join_rule.rs +2 −1 View lib/space/src/handlers/delete_join_rule.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "join rule deleted", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_join_rule(
Modified lib/space/src/handlers/delete_room.rs lib/space/src/handlers/delete_room.rs +2 −1 View lib/space/src/handlers/delete_room.rs
@@ -17,7 +17,8 @@
1717 responses(
1818 (status = 200, description = "room deleted", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "room or space not found", body = AppResponseData<NoData>)
20 (status = 404, description = "room or space not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn delete_room(
Modified lib/space/src/handlers/delete_space.rs lib/space/src/handlers/delete_space.rs +2 −1 View lib/space/src/handlers/delete_space.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "space deleted", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "space not found", body = AppResponseData<NoData>)
18 (status = 404, description = "space not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_space(
Modified lib/space/src/handlers/delete_space_image.rs lib/space/src/handlers/delete_space_image.rs +2 −1 View lib/space/src/handlers/delete_space_image.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "space image deleted", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "space not found", body = AppResponseData<NoData>)
18 (status = 404, description = "space not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_space_image(
Modified lib/space/src/handlers/get_ban.rs lib/space/src/handlers/get_ban.rs +2 −1 View lib/space/src/handlers/get_ban.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "get ban", body = AppResponseData<BanDto>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "ban not found", body = AppResponseData<NoData>)
19 (status = 404, description = "ban not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn get_ban(
Modified lib/space/src/handlers/get_group.rs lib/space/src/handlers/get_group.rs +2 −1 View lib/space/src/handlers/get_group.rs
@@ -22,7 +22,8 @@
2222 params(GroupPath),
2323 responses(
2424 (status = 200, description = "get group", body = AppResponseData<GroupDto>),
25 (status = 404, description = "group not found", body = AppResponseData<NoData>)
25 (status = 404, description = "group not found", body = AppResponseData<NoData>),
26 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2627 )
2728)]
2829pub async fn get_group(
Modified lib/space/src/handlers/get_member.rs lib/space/src/handlers/get_member.rs +2 −1 View lib/space/src/handlers/get_member.rs
@@ -24,7 +24,8 @@
2424 responses(
2525 (status = 200, description = "get member", body = AppResponseData<MemberDto>),
2626 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
27 (status = 404, description = "member not found", body = AppResponseData<NoData>)
27 (status = 404, description = "member not found", body = AppResponseData<NoData>),
28 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2829 )
2930)]
3031pub async fn get_member(
Modified lib/space/src/handlers/get_space.rs lib/space/src/handlers/get_space.rs +2 −1 View lib/space/src/handlers/get_space.rs
@@ -13,7 +13,8 @@
1313 params(SpaceNamePath),
1414 responses(
1515 (status = 200, description = "get space", body = AppResponseData<SpaceDto>),
16 (status = 404, description = "space not found", body = AppResponseData<NoData>)
16 (status = 404, description = "space not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1718 )
1819)]
1920pub async fn get_space(
Modified lib/space/src/handlers/get_space_dir_tree.rs lib/space/src/handlers/get_space_dir_tree.rs +2 −1 View lib/space/src/handlers/get_space_dir_tree.rs
@@ -22,7 +22,8 @@
2222 responses(
2323 (status = 200, description = "get space dir tree", body = AppResponseData<Vec<DirNodeDto>>),
2424 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
25 (status = 404, description = "space not found", body = AppResponseData<NoData>)
25 (status = 404, description = "space not found", body = AppResponseData<NoData>),
26 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2627 )
2728)]
2829pub async fn get_space_dir_tree(
Modified lib/space/src/handlers/get_space_image.rs lib/space/src/handlers/get_space_image.rs +2 −1 View lib/space/src/handlers/get_space_image.rs
@@ -13,7 +13,8 @@
1313 params(SpaceImageKindPath),
1414 responses(
1515 (status = 200, description = "get space image", body = AppResponseData<Option<SpaceImageDto>>),
16 (status = 404, description = "space not found", body = AppResponseData<NoData>)
16 (status = 404, description = "space not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1718 )
1819)]
1920pub async fn get_space_image(
Modified lib/space/src/handlers/join_group_self.rs lib/space/src/handlers/join_group_self.rs +2 −1 View lib/space/src/handlers/join_group_self.rs
@@ -16,7 +16,8 @@
1616 (status = 200, description = "joined group", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
1818 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 409, description = "already in group", body = AppResponseData<NoData>)
19 (status = 409, description = "already in group", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn join_group_self(
Modified lib/space/src/handlers/leave_group_self.rs lib/space/src/handlers/leave_group_self.rs +2 −1 View lib/space/src/handlers/leave_group_self.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "left group", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn leave_group_self(
Modified lib/space/src/handlers/list_bans.rs lib/space/src/handlers/list_bans.rs +2 −1 View lib/space/src/handlers/list_bans.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list space bans", body = AppResponseData<BanPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "space not found", body = AppResponseData<NoData>)
19 (status = 404, description = "space not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_bans(
Modified lib/space/src/handlers/list_dir_group_overwrites.rs lib/space/src/handlers/list_dir_group_overwrites.rs +2 −1 View lib/space/src/handlers/list_dir_group_overwrites.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "list dir group overwrites", body = AppResponseData<Vec<GroupOverwriteDto>>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "space or dir not found", body = AppResponseData<NoData>)
18 (status = 404, description = "space or dir not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_dir_group_overwrites(
Modified lib/space/src/handlers/list_dir_user_overwrites.rs lib/space/src/handlers/list_dir_user_overwrites.rs +2 −1 View lib/space/src/handlers/list_dir_user_overwrites.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "list dir user overwrites", body = AppResponseData<Vec<UserOverwriteDto>>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "space or dir not found", body = AppResponseData<NoData>)
18 (status = 404, description = "space or dir not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn list_dir_user_overwrites(
Modified lib/space/src/handlers/list_groups.rs lib/space/src/handlers/list_groups.rs +2 −1 View lib/space/src/handlers/list_groups.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list space groups", body = AppResponseData<GroupPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "space not found", body = AppResponseData<NoData>)
19 (status = 404, description = "space not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_groups(
Modified lib/space/src/handlers/list_invites.rs lib/space/src/handlers/list_invites.rs +2 −1 View lib/space/src/handlers/list_invites.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list space invites", body = AppResponseData<InvitePage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "space not found", body = AppResponseData<NoData>)
19 (status = 404, description = "space not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_invites(
Modified lib/space/src/handlers/list_join_rules.rs lib/space/src/handlers/list_join_rules.rs +2 −1 View lib/space/src/handlers/list_join_rules.rs
@@ -16,7 +16,8 @@
1616 responses(
1717 (status = 200, description = "list space join rules", body = AppResponseData<Vec<JoinRuleDto>>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "space not found", body = AppResponseData<NoData>)
19 (status = 404, description = "space not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn list_join_rules(
Modified lib/space/src/handlers/list_members.rs lib/space/src/handlers/list_members.rs +3 −2 View lib/space/src/handlers/list_members.rs
@@ -16,10 +16,11 @@
1616 responses(
1717 (status = 200, description = "list space members", body = AppResponseData<MemberPage>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
22pub async fn list_members(
23pub async fn list_space_members(
2324 State(service): State<SpaceService>,
2425 session: Session,
2526 Path(path): Path<SpaceNamePath>,
Modified lib/space/src/handlers/list_spaces.rs lib/space/src/handlers/list_spaces.rs +4 −2 View lib/space/src/handlers/list_spaces.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -13,7 +13,9 @@
1313 tag = "space",
1414 params(PageQuery),
1515 responses(
16 (status = 200, description = "list owned spaces", body = AppResponseData<SpacePage>)
16 (status = 200, description = "list owned spaces", body = AppResponseData<SpacePage>),
17 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
18 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1719 )
1820)]
1921pub async fn list_spaces(
Modified lib/space/src/handlers/move_dir_node.rs lib/space/src/handlers/move_dir_node.rs +2 −1 View lib/space/src/handlers/move_dir_node.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "dir node moved", body = AppResponseData<DirNodeDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "dir node not found", body = AppResponseData<NoData>)
20 (status = 404, description = "dir node not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn move_dir_node(
Modified lib/space/src/handlers/remove_dir_group_overwrite.rs lib/space/src/handlers/remove_dir_group_overwrite.rs +2 −1 View lib/space/src/handlers/remove_dir_group_overwrite.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "remove dir group overwrite", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn remove_dir_group_overwrite(
Modified lib/space/src/handlers/remove_dir_user_overwrite.rs lib/space/src/handlers/remove_dir_user_overwrite.rs +2 −1 View lib/space/src/handlers/remove_dir_user_overwrite.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "remove dir user overwrite", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "not found", body = AppResponseData<NoData>)
18 (status = 404, description = "not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn remove_dir_user_overwrite(
Modified lib/space/src/handlers/remove_member.rs lib/space/src/handlers/remove_member.rs +2 −1 View lib/space/src/handlers/remove_member.rs
@@ -16,7 +16,8 @@
1616 (status = 200, description = "member removed", body = AppResponseData<NoData>),
1717 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "not found", body = AppResponseData<NoData>)
19 (status = 404, description = "not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn remove_member(
Modified lib/space/src/handlers/repair_dir_parents.rs lib/space/src/handlers/repair_dir_parents.rs +3 −1 View lib/space/src/handlers/repair_dir_parents.rs
@@ -16,7 +16,9 @@
1616 responses(
1717 (status = 200, description = "repair dir parents", body = AppResponseData<RepairDirResp>),
1818 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
19 (status = 404, description = "space not found", body = AppResponseData<NoData>)
19 (status = 404, description = "space not found", body = AppResponseData<NoData>),
20 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn repair_dir_parents(
Modified lib/space/src/handlers/revoke_invite.rs lib/space/src/handlers/revoke_invite.rs +2 −1 View lib/space/src/handlers/revoke_invite.rs
@@ -24,7 +24,8 @@
2424 responses(
2525 (status = 200, description = "invite revoked", body = AppResponseData<InviteDto>),
2626 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
27 (status = 404, description = "invite not found", body = AppResponseData<NoData>)
27 (status = 404, description = "invite not found", body = AppResponseData<NoData>),
28 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2829 )
2930)]
3031pub async fn revoke_invite(
Modified lib/space/src/handlers/self_member.rs lib/space/src/handlers/self_member.rs +5 −2 View lib/space/src/handlers/self_member.rs
@@ -15,7 +15,9 @@
1515 request_body = UpdateMemberCmd,
1616 responses(
1717 (status = 200, description = "your membership settings updated", body = AppResponseData<MemberDto>),
18 (status = 404, description = "not a member", body = AppResponseData<NoData>)
18 (status = 404, description = "not a member", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn update_self_member(
@@ -39,7 +41,8 @@
3941 responses(
4042 (status = 200, description = "left the space", body = AppResponseData<NoData>),
4143 (status = 400, description = "owner cannot leave", body = AppResponseData<NoData>),
42 (status = 404, description = "not a member", body = AppResponseData<NoData>)
44 (status = 404, description = "not a member", body = AppResponseData<NoData>),
45 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
4346 )
4447)]
4548pub async fn leave_space(
Modified lib/space/src/handlers/set_dir_group_overwrite.rs lib/space/src/handlers/set_dir_group_overwrite.rs +2 −1 View lib/space/src/handlers/set_dir_group_overwrite.rs
@@ -27,7 +27,8 @@
2727 (status = 200, description = "set dir group overwrite", body = AppResponseData<GroupOverwriteDto>),
2828 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2929 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
30 (status = 404, description = "not found", body = AppResponseData<NoData>)
30 (status = 404, description = "not found", body = AppResponseData<NoData>),
31 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
3132 )
3233)]
3334pub async fn set_dir_group_overwrite(
Modified lib/space/src/handlers/set_dir_user_overwrite.rs lib/space/src/handlers/set_dir_user_overwrite.rs +2 −1 View lib/space/src/handlers/set_dir_user_overwrite.rs
@@ -27,7 +27,8 @@
2727 (status = 200, description = "set dir user overwrite", body = AppResponseData<UserOverwriteDto>),
2828 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2929 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
30 (status = 404, description = "not found", body = AppResponseData<NoData>)
30 (status = 404, description = "not found", body = AppResponseData<NoData>),
31 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
3132 )
3233)]
3334pub async fn set_dir_user_overwrite(
Modified lib/space/src/handlers/unassign_group.rs lib/space/src/handlers/unassign_group.rs +2 −1 View lib/space/src/handlers/unassign_group.rs
@@ -24,7 +24,8 @@
2424 responses(
2525 (status = 200, description = "group unassigned", body = AppResponseData<NoData>),
2626 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
27 (status = 404, description = "not found", body = AppResponseData<NoData>)
27 (status = 404, description = "not found", body = AppResponseData<NoData>),
28 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2829 )
2930)]
3031pub async fn unassign_group(
Modified lib/space/src/handlers/unban_user.rs lib/space/src/handlers/unban_user.rs +2 −1 View lib/space/src/handlers/unban_user.rs
@@ -15,7 +15,8 @@
1515 responses(
1616 (status = 200, description = "user unbanned", body = AppResponseData<NoData>),
1717 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
18 (status = 404, description = "ban not found", body = AppResponseData<NoData>)
18 (status = 404, description = "ban not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn unban_user(
Modified lib/space/src/handlers/update_ban.rs lib/space/src/handlers/update_ban.rs +3 −1 View lib/space/src/handlers/update_ban.rs
@@ -17,7 +17,9 @@
1717 responses(
1818 (status = 200, description = "ban updated", body = AppResponseData<BanDto>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "ban not found", body = AppResponseData<NoData>)
20 (status = 404, description = "ban not found", body = AppResponseData<NoData>),
21 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2123 )
2224)]
2325pub async fn update_ban(
Modified lib/space/src/handlers/update_dir_node.rs lib/space/src/handlers/update_dir_node.rs +2 −1 View lib/space/src/handlers/update_dir_node.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "dir node updated", body = AppResponseData<DirNodeDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "dir node not found", body = AppResponseData<NoData>)
20 (status = 404, description = "dir node not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn update_dir_node(
Modified lib/space/src/handlers/update_group.rs lib/space/src/handlers/update_group.rs +2 −1 View lib/space/src/handlers/update_group.rs
@@ -19,7 +19,8 @@
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2121 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 409, description = "group name conflict", body = AppResponseData<NoData>)
22 (status = 409, description = "group name conflict", body = AppResponseData<NoData>),
23 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2324 )
2425)]
2526pub async fn update_group(
Modified lib/space/src/handlers/update_join_rule.rs lib/space/src/handlers/update_join_rule.rs +2 −1 View lib/space/src/handlers/update_join_rule.rs
@@ -18,7 +18,8 @@
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2020 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 409, description = "conflict", body = AppResponseData<NoData>)
21 (status = 409, description = "conflict", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn update_join_rule(
Modified lib/space/src/handlers/update_member.rs lib/space/src/handlers/update_member.rs +2 −1 View lib/space/src/handlers/update_member.rs
@@ -18,7 +18,8 @@
1818 (status = 200, description = "member updated", body = AppResponseData<MemberDto>),
1919 (status = 400, description = "bad request", body = AppResponseData<NoData>),
2020 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
21 (status = 404, description = "not found", body = AppResponseData<NoData>)
21 (status = 404, description = "not found", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn update_member(
Modified lib/space/src/handlers/update_space.rs lib/space/src/handlers/update_space.rs +2 −1 View lib/space/src/handlers/update_space.rs
@@ -18,7 +18,8 @@
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
2020 (status = 404, description = "space not found", body = AppResponseData<NoData>),
21 (status = 409, description = "space name conflict", body = AppResponseData<NoData>)
21 (status = 409, description = "space name conflict", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2223 )
2324)]
2425pub async fn update_space(
Modified lib/space/src/handlers/upload_space_image.rs lib/space/src/handlers/upload_space_image.rs +2 −1 View lib/space/src/handlers/upload_space_image.rs
@@ -17,7 +17,8 @@
1717 (status = 200, description = "space image uploaded", body = AppResponseData<SpaceImageDto>),
1818 (status = 400, description = "bad request", body = AppResponseData<NoData>),
1919 (status = 403, description = "forbidden", body = AppResponseData<NoData>),
20 (status = 404, description = "space not found", body = AppResponseData<NoData>)
20 (status = 404, description = "space not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2122 )
2223)]
2324pub async fn upload_space_image(
Modified lib/space/src/openapi.rs lib/space/src/openapi.rs +1 −1 View lib/space/src/openapi.rs
@@ -25,7 +25,7 @@
2525 crate::handlers::set_dir_user_overwrite::set_dir_user_overwrite,
2626 crate::handlers::remove_dir_user_overwrite::remove_dir_user_overwrite,
2727 crate::handlers::add_member::add_member,
28 crate::handlers::list_members::list_members,
28 crate::handlers::list_members::list_space_members,
2929 crate::handlers::get_member::get_member,
3030 crate::handlers::update_member::update_member,
3131 crate::handlers::self_member::update_self_member,
Modified lib/space/src/routes.rs lib/space/src/routes.rs +2 −2 View lib/space/src/routes.rs
@@ -28,7 +28,7 @@
2828use crate::handlers::list_groups::list_groups;
2929use crate::handlers::list_invites::list_invites;
3030use crate::handlers::list_join_rules::list_join_rules;
31use crate::handlers::list_members::list_members;
31use crate::handlers::list_members::list_space_members;
3232use crate::handlers::list_spaces::list_spaces;
3333use crate::handlers::move_dir_node::move_dir_node;
3434use crate::handlers::remove_dir_group_overwrite::remove_dir_group_overwrite;
@@ -98,7 +98,7 @@
9898 )
9999 .route(
100100 "/spaces/{space_name}/members",
101 post(add_member).get(list_members),
101 post(add_member).get(list_space_members),
102102 )
103103 .route(
104104 "/spaces/{space_name}/members/{user_id}",
Modified lib/user/src/handlers/add_email.rs lib/user/src/handlers/add_email.rs +5 −2 View lib/user/src/handlers/add_email.rs
@@ -1,6 +1,6 @@
11use axum::Json;
22use axum::extract::State;
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use session::Session;
55
66use crate::errors::ApiError;
@@ -14,7 +14,10 @@
1414 tag = "user",
1515 request_body = AddEmailCmd,
1616 responses(
17 (status = 200, description = "add email address", body = AppResponseData<AddEmailResp>)
17 (status = 200, description = "add email address", body = AppResponseData<AddEmailResp>),
18 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1821 )
1922)]
2023pub async fn add_email(
Modified lib/user/src/handlers/create_meme.rs lib/user/src/handlers/create_meme.rs +5 −2 View lib/user/src/handlers/create_meme.rs
@@ -1,6 +1,6 @@
11use axum::Json;
22use axum::extract::State;
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use session::Session;
55
66use crate::errors::ApiError;
@@ -14,7 +14,10 @@
1414 tag = "user",
1515 request_body = UpsertMemeCmd,
1616 responses(
17 (status = 200, description = "meme created", body = AppResponseData<MemeDto>)
17 (status = 200, description = "meme created", body = AppResponseData<MemeDto>),
18 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1821 )
1922)]
2023pub async fn create_meme(
Modified lib/user/src/handlers/delete_avatar.rs lib/user/src/handlers/delete_avatar.rs +2 −1 View lib/user/src/handlers/delete_avatar.rs
@@ -11,7 +11,8 @@
1111 path = "/me/avatar",
1212 tag = "user",
1313 responses(
14 (status = 200, description = "avatar deleted", body = AppResponseData<NoData>)
14 (status = 200, description = "avatar deleted", body = AppResponseData<NoData>),
15 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1516 )
1617)]
1718pub async fn delete_avatar(
Modified lib/user/src/handlers/delete_email.rs lib/user/src/handlers/delete_email.rs +2 −1 View lib/user/src/handlers/delete_email.rs
@@ -15,7 +15,8 @@
1515 ("email_id" = Uuid, Path, description = "email id")
1616 ),
1717 responses(
18 (status = 200, description = "delete email", body = AppResponseData<NoData>)
18 (status = 200, description = "delete email", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_email(
Modified lib/user/src/handlers/delete_meme.rs lib/user/src/handlers/delete_meme.rs +2 −1 View lib/user/src/handlers/delete_meme.rs
@@ -15,7 +15,8 @@
1515 ("meme_id" = Uuid, Path, description = "meme id")
1616 ),
1717 responses(
18 (status = 200, description = "meme deleted", body = AppResponseData<NoData>)
18 (status = 200, description = "meme deleted", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_meme(
Modified lib/user/src/handlers/delete_push_subscription.rs lib/user/src/handlers/delete_push_subscription.rs +2 −1 View lib/user/src/handlers/delete_push_subscription.rs
@@ -15,7 +15,8 @@
1515 ("push_id" = Uuid, Path, description = "push subscription id")
1616 ),
1717 responses(
18 (status = 200, description = "push subscription deleted", body = AppResponseData<NoData>)
18 (status = 200, description = "push subscription deleted", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn delete_push_subscription(
Modified lib/user/src/handlers/get_avatar.rs lib/user/src/handlers/get_avatar.rs +4 −2 View lib/user/src/handlers/get_avatar.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/me/avatar",
1313 tag = "user",
1414 responses(
15 (status = 200, description = "current avatar", body = AppResponseData<Option<AvatarDto>>)
15 (status = 200, description = "current avatar", body = AppResponseData<Option<AvatarDto>>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn get_avatar(
Modified lib/user/src/handlers/get_profile_detail.rs lib/user/src/handlers/get_profile_detail.rs +3 −2 View lib/user/src/handlers/get_profile_detail.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Path, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::{Session, SessionUser};
44use uuid::Uuid;
55
@@ -15,7 +15,8 @@
1515 ("user_id" = Uuid, Path, description = "target user id")
1616 ),
1717 responses(
18 (status = 200, description = "user profile detail", body = AppResponseData<ProfileDetailDto>)
18 (status = 200, description = "user profile detail", body = AppResponseData<ProfileDetailDto>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_profile_detail(
Modified lib/user/src/handlers/get_session.rs lib/user/src/handlers/get_session.rs +3 −2 View lib/user/src/handlers/get_session.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Path, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44use uuid::Uuid;
55
@@ -15,7 +15,8 @@
1515 params(("session_id" = Uuid, Path)),
1616 responses(
1717 (status = 200, description = "session detail", body = AppResponseData<SessionDto>),
18 (status = 404, description = "not found")
18 (status = 404, description = "not found"),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn get_session(
Modified lib/user/src/handlers/get_user_avatar.rs lib/user/src/handlers/get_user_avatar.rs +2 −1 View lib/user/src/handlers/get_user_avatar.rs
@@ -15,7 +15,8 @@
1515 params(("user_id" = Uuid, Path, description = "user id")),
1616 responses(
1717 (status = 200, description = "avatar image bytes", content_type = "image/*"),
18 (status = 404, description = "no avatar or user not visible")
18 (status = 404, description = "no avatar or user not visible", body = export::rest::AppResponseData<export::rest::NoData>),
19 (status = 401, description = "authentication required", body = export::rest::AppResponseData<export::rest::NoData>)
1920 )
2021)]
2122pub async fn get_user_avatar(
Modified lib/user/src/handlers/list_emails.rs lib/user/src/handlers/list_emails.rs +4 −2 View lib/user/src/handlers/list_emails.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,9 @@
1212 path = "/me/emails",
1313 tag = "user",
1414 responses(
15 (status = 200, description = "list user emails", body = AppResponseData<Vec<EmailDto>>)
15 (status = 200, description = "list user emails", body = AppResponseData<Vec<EmailDto>>),
16 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
17 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1618 )
1719)]
1820pub async fn list_emails(
Modified lib/user/src/handlers/list_memes.rs lib/user/src/handlers/list_memes.rs +4 −2 View lib/user/src/handlers/list_memes.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 ListLimitQuery,
1616 ),
1717 responses(
18 (status = 200, description = "list memes", body = AppResponseData<Vec<MemeDto>>)
18 (status = 200, description = "list memes", body = AppResponseData<Vec<MemeDto>>),
19 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn list_memes(
Modified lib/user/src/handlers/list_push_subscriptions.rs lib/user/src/handlers/list_push_subscriptions.rs +4 −2 View lib/user/src/handlers/list_push_subscriptions.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -14,7 +14,9 @@
1414 tag = "user",
1515 params(PageQuery),
1616 responses(
17 (status = 200, description = "list push subscriptions", body = AppResponseData<Vec<PushSubscriptionDto>>)
17 (status = 200, description = "list push subscriptions", body = AppResponseData<Vec<PushSubscriptionDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn list_push_subscriptions(
Modified lib/user/src/handlers/list_saved_messages.rs lib/user/src/handlers/list_saved_messages.rs +4 −2 View lib/user/src/handlers/list_saved_messages.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -14,7 +14,9 @@
1414 tag = "user",
1515 params(PageQuery),
1616 responses(
17 (status = 200, description = "list saved messages", body = AppResponseData<Vec<SavedMessageDto>>)
17 (status = 200, description = "list saved messages", body = AppResponseData<Vec<SavedMessageDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn list_saved_messages(
Modified lib/user/src/handlers/list_sessions.rs lib/user/src/handlers/list_sessions.rs +4 −2 View lib/user/src/handlers/list_sessions.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 ListSessionsQuery,
1616 ),
1717 responses(
18 (status = 200, description = "list user sessions", body = AppResponseData<export::pagination::Page<SessionDto>>)
18 (status = 200, description = "list user sessions", body = AppResponseData<export::pagination::Page<SessionDto>>),
19 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn list_sessions(
Modified lib/user/src/handlers/my_reports.rs lib/user/src/handlers/my_reports.rs +6 −4 View lib/user/src/handlers/my_reports.rs
@@ -1,9 +1,9 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
6use crate::services::notifications::ReportDto;
6use crate::services::notifications::UserReportDto;
77use crate::services::service::UserService;
88use crate::share::page::PageQuery;
99use session::share::session::require_uid;
@@ -14,14 +14,16 @@
1414 tag = "user",
1515 params(PageQuery),
1616 responses(
17 (status = 200, description = "my filed reports", body = AppResponseData<Vec<ReportDto>>)
17 (status = 200, description = "my filed reports", body = AppResponseData<Vec<UserReportDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn my_reports(
2123 State(service): State<UserService>,
2224 session: Session,
2325 Query(query): Query<PageQuery>,
24) -> Result<AppResponseData<Vec<ReportDto>>, ApiError> {
26) -> Result<AppResponseData<Vec<UserReportDto>>, ApiError> {
2527 let uid = require_uid(&session)?;
2628 let reports = service.my_reports(uid, query).await?;
2729 Ok(AppResponseData::ok(reports))
Modified lib/user/src/handlers/my_spaces.rs lib/user/src/handlers/my_spaces.rs +4 −2 View lib/user/src/handlers/my_spaces.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -14,7 +14,9 @@
1414 tag = "user",
1515 params(PageQuery),
1616 responses(
17 (status = 200, description = "my spaces", body = AppResponseData<Vec<MySpaceDto>>)
17 (status = 200, description = "my spaces", body = AppResponseData<Vec<MySpaceDto>>),
18 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn my_spaces(
Modified lib/user/src/handlers/my_suspensions.rs lib/user/src/handlers/my_suspensions.rs +4 −2 View lib/user/src/handlers/my_suspensions.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -15,7 +15,9 @@
1515 IncludeRevokedQuery,
1616 ),
1717 responses(
18 (status = 200, description = "my suspensions", body = AppResponseData<Vec<SuspensionDto>>)
18 (status = 200, description = "my suspensions", body = AppResponseData<Vec<SuspensionDto>>),
19 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1921 )
2022)]
2123pub async fn my_suspensions(
Modified lib/user/src/handlers/recent_mentions.rs lib/user/src/handlers/recent_mentions.rs +4 −2 View lib/user/src/handlers/recent_mentions.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Query, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -16,7 +16,9 @@
1616 ListLimitQuery,
1717 ),
1818 responses(
19 (status = 200, description = "recent mentions", body = AppResponseData<Vec<RecentMentionDto>>)
19 (status = 200, description = "recent mentions", body = AppResponseData<Vec<RecentMentionDto>>),
20 (status = 404, description = "resource not found", body = AppResponseData<NoData>),
21 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2022 )
2123)]
2224pub async fn recent_mentions(
Modified lib/user/src/handlers/revoke_all_sessions.rs lib/user/src/handlers/revoke_all_sessions.rs +3 −2 View lib/user/src/handlers/revoke_all_sessions.rs
@@ -1,5 +1,5 @@
11use axum::extract::State;
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44
55use crate::errors::ApiError;
@@ -12,7 +12,8 @@
1212 path = "/me/sessions",
1313 tag = "user",
1414 responses(
15 (status = 200, description = "all sessions revoked", body = AppResponseData<CountResp>)
15 (status = 200, description = "all sessions revoked", body = AppResponseData<CountResp>),
16 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1617 )
1718)]
1819pub async fn revoke_all_sessions(
Modified lib/user/src/handlers/revoke_session.rs lib/user/src/handlers/revoke_session.rs +2 −1 View lib/user/src/handlers/revoke_session.rs
@@ -15,7 +15,8 @@
1515 ("session_id" = Uuid, Path, description = "session id")
1616 ),
1717 responses(
18 (status = 200, description = "session revoked", body = AppResponseData<NoData>)
18 (status = 200, description = "session revoked", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn revoke_session(
Modified lib/user/src/handlers/save_message.rs lib/user/src/handlers/save_message.rs +5 −2 View lib/user/src/handlers/save_message.rs
@@ -1,6 +1,6 @@
11use axum::Json;
22use axum::extract::State;
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use session::Session;
55
66use crate::errors::ApiError;
@@ -14,7 +14,10 @@
1414 tag = "user",
1515 request_body = SaveMessageCmd,
1616 responses(
17 (status = 200, description = "save message", body = AppResponseData<SavedMessageDto>)
17 (status = 200, description = "save message", body = AppResponseData<SavedMessageDto>),
18 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1821 )
1922)]
2023pub async fn save_message(
Modified lib/user/src/handlers/set_primary_email.rs lib/user/src/handlers/set_primary_email.rs +3 −2 View lib/user/src/handlers/set_primary_email.rs
@@ -1,5 +1,5 @@
11use axum::extract::{Path, State};
2use export::rest::AppResponseData;
2use export::rest::{AppResponseData, NoData};
33use session::Session;
44use uuid::Uuid;
55
@@ -16,7 +16,8 @@
1616 ("email_id" = Uuid, Path, description = "email id")
1717 ),
1818 responses(
19 (status = 200, description = "set primary email", body = AppResponseData<EmailDto>)
19 (status = 200, description = "set primary email", body = AppResponseData<EmailDto>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2021 )
2122)]
2223pub async fn set_primary_email(
Modified lib/user/src/handlers/unsave_message.rs lib/user/src/handlers/unsave_message.rs +2 −1 View lib/user/src/handlers/unsave_message.rs
@@ -15,7 +15,8 @@
1515 ("message_id" = Uuid, Path, description = "message id")
1616 ),
1717 responses(
18 (status = 200, description = "unsave message", body = AppResponseData<NoData>)
18 (status = 200, description = "unsave message", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1920 )
2021)]
2122pub async fn unsave_message(
Modified lib/user/src/handlers/update_meme.rs lib/user/src/handlers/update_meme.rs +3 −1 View lib/user/src/handlers/update_meme.rs
@@ -17,7 +17,9 @@
1717 request_body = UpsertMemeCmd,
1818 responses(
1919 (status = 200, description = "meme updated", body = AppResponseData<MemeDto>),
20 (status = 404, description = "not found", body = AppResponseData<NoData>)
20 (status = 404, description = "not found", body = AppResponseData<NoData>),
21 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
22 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2123 )
2224)]
2325pub async fn update_meme(
Modified lib/user/src/handlers/upload_avatar.rs lib/user/src/handlers/upload_avatar.rs +2 −1 View lib/user/src/handlers/upload_avatar.rs
@@ -21,7 +21,8 @@
2121 ),
2222 responses(
2323 (status = 200, description = "avatar uploaded", body = AppResponseData<AvatarDto>),
24 (status = 400, description = "bad request", body = AppResponseData<NoData>)
24 (status = 400, description = "bad request", body = AppResponseData<NoData>),
25 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
2526 )
2627)]
2728pub async fn upload_avatar(
Modified lib/user/src/handlers/upsert_push_subscription.rs lib/user/src/handlers/upsert_push_subscription.rs +5 −2 View lib/user/src/handlers/upsert_push_subscription.rs
@@ -1,6 +1,6 @@
11use axum::Json;
22use axum::extract::State;
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use session::Session;
55
66use crate::errors::ApiError;
@@ -14,7 +14,10 @@
1414 tag = "user",
1515 request_body = UpsertPushCmd,
1616 responses(
17 (status = 200, description = "upsert push subscription", body = AppResponseData<PushSubscriptionDto>)
17 (status = 200, description = "upsert push subscription", body = AppResponseData<PushSubscriptionDto>),
18 (status = 409, description = "resource already exists", body = AppResponseData<NoData>),
19 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
20 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1821 )
1922)]
2023pub async fn upsert_push_subscription(
Modified lib/user/src/handlers/verify_add_email.rs lib/user/src/handlers/verify_add_email.rs +7 −5 View lib/user/src/handlers/verify_add_email.rs
@@ -1,10 +1,10 @@
11use axum::Json;
22use axum::extract::State;
3use export::rest::AppResponseData;
3use export::rest::{AppResponseData, NoData};
44use session::Session;
55
66use crate::errors::ApiError;
7use crate::services::emails::{EmailDto, VerifyEmailCmd};
7use crate::services::emails::{EmailDto, VerifyAddEmailCmd};
88use crate::services::service::UserService;
99use session::share::session::require_uid;
1010
@@ -12,15 +12,17 @@
1212 post,
1313 path = "/me/emails/verify",
1414 tag = "user",
15 request_body = VerifyEmailCmd,
15 request_body = VerifyAddEmailCmd,
1616 responses(
17 (status = 200, description = "verify added email address", body = AppResponseData<EmailDto>)
17 (status = 200, description = "verify added email address", body = AppResponseData<EmailDto>),
18 (status = 400, description = "request failed validation", body = AppResponseData<NoData>),
19 (status = 401, description = "authentication required", body = AppResponseData<NoData>)
1820 )
1921)]
2022pub async fn verify_add_email(
2123 State(service): State<UserService>,
2224 session: Session,
23 Json(cmd): Json<VerifyEmailCmd>,
25 Json(cmd): Json<VerifyAddEmailCmd>,
2426) -> Result<AppResponseData<EmailDto>, ApiError> {
2527 let uid = require_uid(&session)?;
2628 let email = service.verify_add_email(uid, cmd).await?;
Modified lib/user/src/services/avatar.rs lib/user/src/services/avatar.rs +0 −1 View lib/user/src/services/avatar.rs
@@ -1,4 +1,3 @@
1use base64::Engine;
21use models::users::user::ProfileVisibility;
32use models::users::user;
43use sea_orm::{ActiveModelTrait, EntityTrait, Set};
Modified lib/user/src/services/emails.rs lib/user/src/services/emails.rs +2 −2 View lib/user/src/services/emails.rs
@@ -44,7 +44,7 @@
4444}
4545
4646#[derive(Debug, Clone, Deserialize, ToSchema)]
47pub struct VerifyEmailCmd {
47pub struct VerifyAddEmailCmd {
4848 pub email: String,
4949 pub code: String,
5050}
@@ -156,7 +156,7 @@
156156 pub async fn verify_add_email(
157157 &self,
158158 uid: Uuid,
159 cmd: VerifyEmailCmd,
159 cmd: VerifyAddEmailCmd,
160160 ) -> Result<EmailDto, UserError> {
161161 let config = &self.config().user;
162162 let lower = cmd.email.trim().to_lowercase();
Modified lib/user/src/services/notifications.rs lib/user/src/services/notifications.rs +4 −4 View lib/user/src/services/notifications.rs
@@ -33,7 +33,7 @@
3333}
3434
3535#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
36pub struct ReportDto {
36pub struct UserReportDto {
3737 pub id: Uuid,
3838 pub reported_id: Uuid,
3939 pub reason: String,
@@ -44,7 +44,7 @@
4444 pub updated_at: OffsetDateTime,
4545}
4646
47impl From<user_reports::Model> for ReportDto {
47impl From<user_reports::Model> for UserReportDto {
4848 fn from(m: user_reports::Model) -> Self {
4949 Self {
5050 id: m.id,
@@ -100,7 +100,7 @@
100100 Ok(rows.into_iter().map(RecentMentionDto::from).collect())
101101 }
102102
103 pub async fn my_reports(&self, uid: Uuid, q: PageQuery) -> Result<Vec<ReportDto>, UserError> {
103 pub async fn my_reports(&self, uid: Uuid, q: PageQuery) -> Result<Vec<UserReportDto>, UserError> {
104104 let rows = user_reports::Entity::find()
105105 .filter(user_reports::Column::ReporterUid.eq(Some(uid)))
106106 .order_by_desc(user_reports::Column::CreatedAt)
@@ -108,7 +108,7 @@
108108 .offset(q.offset())
109109 .all(self.db().read())
110110 .await?;
111 Ok(rows.into_iter().map(ReportDto::from).collect())
111 Ok(rows.into_iter().map(UserReportDto::from).collect())
112112 }
113113
114114 pub async fn list_saved_messages(
Modified lib/user/src/openapi.rs lib/user/src/openapi.rs +4 −4 View lib/user/src/openapi.rs
@@ -8,9 +8,9 @@
88
99use crate::handlers;
1010use crate::services::avatar::{AvatarDto, AvatarFormat};
11use crate::services::emails::{AddEmailCmd, AddEmailResp, EmailDto, VerifyEmailCmd};
11use crate::services::emails::{AddEmailCmd, AddEmailResp, EmailDto, VerifyAddEmailCmd};
1212use crate::services::notifications::{
13 RecentMentionDto, ReportDto, SaveMessageCmd, SavedMessageDto,
13 RecentMentionDto, UserReportDto, SaveMessageCmd, SavedMessageDto,
1414};
1515use crate::services::profile::{
1616 ListLimitQuery, MemeDto, MySpaceDto, ProfileDetailDto, SpaceDto, UpsertMemeCmd,
@@ -67,14 +67,14 @@
6767 EmailDto,
6868 AddEmailCmd,
6969 AddEmailResp,
70 VerifyEmailCmd,
70 VerifyAddEmailCmd,
7171 SessionDto,
7272 ListSessionsQuery,
7373 CountResp,
7474 PushSubscriptionDto,
7575 UpsertPushCmd,
7676 RecentMentionDto,
77 ReportDto,
77 UserReportDto,
7878 SavedMessageDto,
7979 SaveMessageCmd,
8080 SuspensionDto,
Modified lib/webapi/src/openapi.rs lib/webapi/src/openapi.rs +27 −6 View lib/webapi/src/openapi.rs
@@ -75,16 +75,37 @@
7575### Idempotency
7676- `POST /chat/rooms/{room_id}/messages` accepts `nonce`: unique per room;
7777 retrying with the same nonce returns the original message instead of a duplicate.
78
79### Resource references
80- User references in responses embed a `user` object (`UserDto`) wherever a
81 single person is shown; raw uuid fields are named `*_id` consistently.
82- Viewer-specific state is embedded, not fetched separately: `RepoDto.me`
83 carries `starred`/`watch_mode`, `IssueDto.viewer_watch` carries the caller
84 watch mode. `PUT /repos/{space}/{repo}/star|unstar` style reads do not exist.
85
86### Identifiers
87- Issues are addressable by UUID **or** board-scoped number
88 (e.g. `/issues/{space}/boards/{board}/issues/123`).
89- Binary uploads use raw request bodies with a content-type header
90 (e.g. `PUT /me/avatar` accepts `image/*` bytes, not base64 JSON).
7891"#;
7992
8093pub fn api_doc() -> utoipa::openapi::OpenApi {
8194 let mut doc = WebApiDoc::openapi();
82 doc.merge(auth::openapi::AuthApiDoc::openapi());
83 doc.merge(chat::openapi::ChatApiDoc::openapi());
84 doc.merge(issues::openapi::IssuesApiDoc::openapi());
85 doc.merge(space::openapi::SpaceApiDoc::openapi());
86 doc.merge(user::openapi::UserApiDoc::openapi());
87 doc.merge(git::openapi::GitApiDoc::openapi());
95 let dbg = std::env::var("OPENAPI_DEBUG").is_ok();
96 macro_rules! m {
97 ($name:literal, $expr:expr) => {{
98 if dbg { eprintln!("merge: {}", $name); }
99 doc.merge($expr);
100 if dbg { eprintln!("done: {}", $name); }
101 }};
102 }
103 m!("auth", auth::openapi::AuthApiDoc::openapi());
104 m!("chat", chat::openapi::ChatApiDoc::openapi());
105 m!("issues", issues::openapi::IssuesApiDoc::openapi());
106 m!("space", space::openapi::SpaceApiDoc::openapi());
107 m!("user", user::openapi::UserApiDoc::openapi());
108 m!("git", git::openapi::GitApiDoc::openapi());
88109 doc.servers = Some(vec![utoipa::openapi::Server::new("/api/v1")]);
89110 doc.info.description = Some(CONVENTIONS.to_string());
90111 doc.info.license = None;
Modified openapi.json openapi.json View openapi.json
Diff too large to display.
Added tmp_opencode_fix404_repl.py tmp_opencode_fix404_repl.py +1 −0 View tmp_opencode_fix404_repl.py
@@ -0,0 +1 @@
1PLACEHOLDER
No newline at end of file