32 lines
581 B
Python
32 lines
581 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
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]
|