2026-06-12 23:08:14 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-06-12 23:41:03 +02:00
|
|
|
from typing import Literal
|
|
|
|
|
|
2026-06-12 23:08:14 +02:00
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigField(BaseModel):
|
|
|
|
|
env_name: str
|
|
|
|
|
label: str
|
|
|
|
|
value: str
|
|
|
|
|
secret: bool
|
|
|
|
|
input_type: str
|
|
|
|
|
configured: bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigSection(BaseModel):
|
|
|
|
|
name: str
|
|
|
|
|
fields: list[ConfigField]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigResponse(BaseModel):
|
|
|
|
|
sections: list[ConfigSection]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigUpdateRequest(BaseModel):
|
|
|
|
|
"""Flat mapping of env_name → value, mirroring the existing form semantics."""
|
|
|
|
|
|
|
|
|
|
updates: dict[str, str]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigUpdateResponse(BaseModel):
|
|
|
|
|
sections: list[ConfigSection]
|
2026-06-12 23:41:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class SmtpTestResponse(BaseModel):
|
|
|
|
|
"""Response from POST /api/config/smtp/test."""
|
|
|
|
|
|
|
|
|
|
result: Literal["success", "config-error", "failed"]
|
|
|
|
|
message: str
|