Generate Sphinx docs in markdown

This commit is contained in:
Merelden 2025-10-14 16:11:12 +05:00
parent bc4e9caacb
commit 81ff7959f7
84 changed files with 2873 additions and 29 deletions

View file

@ -0,0 +1,85 @@
# models.auth
### *class* models.auth.Token(, access_token: str, token_type: str, session_id: str | None = None, user: UserResponse | None = None)
Bases: `BaseModel`
Токен пользователя
Атрибуты:
: access_token (str): Токен пользователя (захэширован)
token_type (str): Тип токена
session_id (Optional[str]): Идентификатор сессии
user (Optional[UserResponse]): Пользователь на основе проверки наличия пользователя
#### access_token *: str*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### session_id *: str | None*
#### token_type *: str*
#### user *: UserResponse | None*
### *class* models.auth.UserCreate(, username: str, password: str, is_admin: bool = False)
Bases: `BaseModel`
Модель созданного пользователя
Атрибуты:
: username (str): Имя пользователя
password (str): Пароль пользователя
is_admin (bool): Административный доступ
#### is_admin *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### password *: str*
#### username *: str*
### *class* models.auth.UserLogin(, username: str, password: str)
Bases: `BaseModel`
Модель авторизации пользователя
Атрибуты:
: username (str): Имя пользователя
password (str): Пароль пользователя
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### password *: str*
#### username *: str*
### *class* models.auth.UserResponse(, id: int, username: str, is_admin: bool)
Bases: `BaseModel`
Модель проверки наличия пользователя
Атрибуты:
: id (int): Идентификатор
username (str): Имя пользователя
is_admin (bool): Административный доступ
#### id *: int*
#### is_admin *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### username *: str*

View file

@ -0,0 +1,238 @@
# models.network
### *class* models.network.Activation(, id: int, interfaces: List[NetworkInterface | WiFiDevice], container_x: int, container_y: int, isOpen: bool = True)
Bases: `BaseModel`
Модель активированных интерфейсов
Атрибуты:
: id (int): Идентификатор ноды активированных интерфейсов
interfaces (List[Union[NetworkInterface, WiFiDevice]]): Активированные интерфейсы
container_x (int): Положение по X на холсте
container_y (int): Положение по Y на холсте
isOpen (bool): Флаг скрытия ноды на холсте
#### container_x *: int*
#### container_y *: int*
#### id *: int*
#### interfaces *: List[NetworkInterface | WiFiDevice]*
#### isOpen *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
### *class* models.network.Deactivation(, id: int, interfaces: List[NetworkInterface | WiFiDevice], container_x: int, container_y: int, isOpen: bool = True)
Bases: `BaseModel`
Модель отключенных интерфейсов
Атрибуты:
: id (int): Идентификатор ноды отключенных интерфейсов
interfaces (List[Union[NetworkInterface, WiFiDevice]]): Отключенные интерфейсы
container_x (int): Положение по X на холсте
container_y (int): Положение по Y на холсте
isOpen (bool): Флаг скрытия ноды на холсте
#### container_x *: int*
#### container_y *: int*
#### id *: int*
#### interfaces *: List[NetworkInterface | WiFiDevice]*
#### isOpen *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
### *class* models.network.IPConfig(, configurations: List[IndividualIPConfig])
Bases: `BaseModel`
Модель конфигурации IP (IPv4/IPv6)
Атрибуты:
: configurations (List[IndividualIPConfig]): Список индивидуальных IP-конфигураций
#### configurations *: List[IndividualIPConfig]*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
### *class* models.network.IPv4Route(, destination: str, prefix: int, next_hop: str, metric: int)
Bases: `BaseModel`
Модель маршрута IPv4
Атрибуты:
: destination (str): IP-адрес назначения
prefix (int): Префикс подсети в формате CIDR
next_hop (str): Адрес следующего узла (маршрутизатор)
metric (int): Метрика маршрута
#### destination *: str*
#### metric *: int*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### next_hop *: str*
#### prefix *: int*
### *class* models.network.IPv6Route(, destination: str, prefix: int, next_hop: str, metric: int)
Bases: `BaseModel`
Модель маршрута IPv6
Атрибуты:
: destination (str): IP-адрес назначения
prefix (int): Префикс подсети (CIDR)
next_hop (str): Адрес следующего узла (маршрутизатор)
metric (int): Метрика маршрута
#### destination *: str*
#### metric *: int*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### next_hop *: str*
#### prefix *: int*
### *class* models.network.IndividualIPConfig(, address: str, routes: List[IPv4Route | IPv6Route], method: str | None, gateway: str, dns: List[str])
Bases: `BaseModel`
Модель индивидуальной конфигурации IP-адреса
Атрибуты:
: address (str): IP-адрес интерфейса
routes (List[Union[IPv4Route, IPv6Route]]): Список маршрутов (IPv4/IPv6)
method (Optional[str]): Метод назначения IP
gateway (str): Основной шлюз по умолчанию
dns (List[str]): Список DNS-серверов
#### address *: str*
#### dns *: List[str]*
#### gateway *: str*
#### method *: str | None*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### routes *: List[IPv4Route | IPv6Route]*
### *class* models.network.NetworkInterface(, name: str, type: str, mac_address: str, device_state: str, active_connection: str, device_mtu: str, ipv4: IPConfig, ipv6: IPConfig, container_x: int = 0, container_y: int = 0)
Bases: `BaseModel`
Модель базового сетевого интерфейса
Атрибуты:
: name (str): Название интерфейса
type (str): Тип интерфейса
mac_address (str): MAC-адрес устройства
device_state (str): Состояние устройства
active_connection (str): Название активного соединения
device_mtu (str): MTU устройства
ipv4 (IPConfig): Конфигурация IPv4
ipv6 (IPConfig): Конфигурация IPv6
container_x (int): Положение по X на холсте
container_y (int): Положение по Y на холсте
#### active_connection *: str*
#### container_x *: int*
#### container_y *: int*
#### device_mtu *: str*
#### device_state *: str*
#### ipv4 *: IPConfig*
#### ipv6 *: IPConfig*
#### mac_address *: str*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### name *: str*
#### type *: str*
### *class* models.network.NetworkInterfacesContainer(, interfaces: List[NetworkInterface | WiFiDevice], container_x: int, container_y: int)
Bases: `BaseModel`
Контейнер для группы сетевых интерфейсов с координатами
Атрибуты:
: interfaces (List[Union[NetworkInterface, WiFiDevice]]): Список интерфейсов
container_x (int): Положение по оси X
container_y (int): Положение по оси Y
#### container_x *: int*
#### container_y *: int*
#### interfaces *: List[NetworkInterface | WiFiDevice]*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
### *class* models.network.WiFiDevice(, name: str, type: str, mac_address: str, device_state: str, active_connection: str, device_mtu: str, ipv4: IPConfig, ipv6: IPConfig, container_x: int = 0, container_y: int = 0, ssid: str | None = None, bssid: str | None = None, bitrate: int | None = None, strength: int | None = None, frequency: float | None = None, mode: str | int = None)
Bases: `NetworkInterface`
Модель Wi-Fi устройства (наследуется от NetworkInterface)
Атрибуты:
: ssid (Optional[str]): Название Wi-Fi сети
bssid (Optional[str]): MAC-адрес точки доступа
bitrate (Optional[int]): Скорость соединения
strength (Optional[int]): Уровень сигнала
frequency (Optional[float]): Частота
mode (Union[str, int]): Режим работы
#### bitrate *: int | None*
#### bssid *: str | None*
#### frequency *: float | None*
#### mode *: str | int*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### ssid *: str | None*
#### strength *: int | None*

View file

@ -0,0 +1,49 @@
# models.request
### *class* models.request.NoteRequest(, note: str)
Bases: `BaseModel`
Модель добавления заметки к просканированному устройству
Атрибуты:
: note (str): Заметка устройства
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### note *: str*
### *class* models.request.WifiConnectRequest(, ssid: str, password: str)
Bases: `BaseModel`
Модель для подключения к точке доступа Wi-Fi
Атрибуты:
: ssid (str): Название точки доступа Wi-Fi
password (str): Пароль точки доступа Wi-Fi
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### password *: str*
#### ssid *: str*
### *class* models.request.WifiDisconnectRequest(, ssid: str)
Bases: `BaseModel`
Модель для отключения от точки доступа Wi-Fi
Атрибуты:
: ssid (str): Название точки доступа Wi-Fi
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### ssid *: str*

View file

@ -0,0 +1,70 @@
# models.subnet
### *class* models.subnet.Device(, ip: str, mac: str | None = None, hostname: str | None = None, vendor: str | None = None, open_ports: List[str] = [], status: str, last_seen: str | None = None, note: str | None = None)
Bases: `BaseModel`
Сканируемое устройство в подсети
Атрибуты:
: ip (str): IP-адрес устройства
mac (Optional[str]): MAC-адрес устройства
hostname (Optional[str]): Имя хоста
vendor (Optional[str]): Название производителя устройства (По MAC-адресу)
open_ports (List[str]): Открытые порты устройства
status (str): Статус устройства (онлайн/оффлайн)
last_seen (Optional[str]): Последняя активность устройства
note (Optional[str]): Заметка устройства
#### hostname *: str | None*
#### ip *: str*
#### last_seen *: str | None*
#### mac *: str | None*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### note *: str | None*
#### open_ports *: List[str]*
#### status *: str*
#### vendor *: str | None*
### *class* models.subnet.SubnetScanRequest(, subnet: str | None = None)
Bases: `BaseModel`
Параметры для сканирования подсети
Атрибуты:
: subnet (Optional[str]): Подсеть для сканирования (например 192.168.1.0/24), опционально
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### subnet *: str | None*
### *class* models.subnet.SubnetScanResult(, devices: List[Device] = [], error: str | None = None)
Bases: `BaseModel`
Результат сканирования устройств в подсети
Атрибуты:
: devices (List[Device]): Список просканированных устройств
error (Optional[str]): Сообщение об ошибке, если сканирование не удалось
#### devices *: List[Device]*
#### error *: str | None*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

View file

@ -0,0 +1,195 @@
# models.ufw
### *class* models.ufw.Action(\*values)
Bases: `str`, `Enum`
Enum для действий UFW.
#### ALLOW
Разрешить трафик
#### DENY
Запретить трафик без уведомления
#### REJECT
Запретить трафик с уведомлением отправителю
#### ALLOW *= 'allow'*
#### DENY *= 'deny'*
#### REJECT *= 'reject'*
### *class* models.ufw.Direction(\*values)
Bases: `str`, `Enum`
Enum для направления трафика UFW.
#### IN
Входящий трафик
#### OUT
Исходящий трафик
#### IN *= 'in'*
#### OUT *= 'out'*
### *class* models.ufw.Protocol(\*values)
Bases: `str`, `Enum`
Enum для сетевых протоколов UFW.
#### BOTH *= 'both'*
#### TCP *= 'tcp'*
#### UDP *= 'udp'*
#### *property* protocols *: List[str]*
Возвращает список протоколов для использования в команде UFW.
### *class* models.ufw.UFWRule(, action: Action, direction: Direction, from_ip: str, to_ip: str, port: int | str, protocol: Protocol, comment: str | None = None)
Bases: `BaseModel`
Модель правила UFW
#### action *: Action*
#### comment *: str | None*
#### direction *: Direction*
#### from_ip *: str*
#### *classmethod* from_ufw_output(line: str) → UFWRule
Создает экземпляр UFWRule из строки вывода команды ‘ufw status numbered’.
* **Parameters:**
**line** – Строка вывода UFW (например, “[1] 80/tcp ALLOW IN 192.168.1.0/24 # Web Server”)
* **Returns:**
Новый экземпляр правила
* **Return type:**
UFWRule
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### port *: int | str*
#### protocol *: Protocol*
#### to_ip *: str*
#### to_ufw_command() → str
Преобразует правило в команду UFW.
#### *classmethod* validate_action(v)
Приводит значение action к нижнему регистру перед валидацией
#### *classmethod* validate_ip(v)
Проверяет корректность IP адреса
#### *classmethod* validate_ip_version_compatibility(v, values)
Проверяет совместимость версий IP адресов
#### *classmethod* validate_port(v)
Проверяет корректность порта или диапазона портов.
* **Parameters:**
**v** – Порт (число) или диапазон портов (строка вида “3000:3999”)
* **Returns:**
Валидированное значение порта
* **Return type:**
Union[int, str]
* **Raises:**
**ValueError** – Если порт или диапазон портов некорректен
#### *classmethod* validate_protocol(v)
Приводит значение protocol к нижнему регистру перед валидацией
### *class* models.ufw.UFWRulesResponse(\*, enabled: bool, rules: ~typing.List[~models.ufw.UFWRule] = <factory>)
Bases: `BaseModel`
Модель для представления списка правил UFW.
#### enabled
Включен ли UFW
* **Type:**
bool
#### rules
Список правил UFW
* **Type:**
List[models.ufw.UFWRule]
#### total_rules
Общее количество правил
#### enabled *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### rules *: List[UFWRule]*
#### *property* total_rules *: int*
Возвращает общее количество правил.
### *class* models.ufw.UFWStatus(, enabled: bool, message: str)
Bases: `BaseModel`
Модель для представления статуса UFW.
#### enabled
Включен ли UFW
* **Type:**
bool
#### message
Сообщение о статусе
* **Type:**
str
#### last_checked
Время последней проверки статуса
#### enabled *: bool*
#### message *: str*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

View file

@ -0,0 +1,55 @@
# models.wifi
### *class* models.wifi.WifiAccessPoint(, ssid: str | None = None, bssid: str, channel: int | None = None, signal: int | None = None, encryption: str | None = None, frequency: str | None = None, vendor: str | None = None, hidden: bool = False, note: str | None = None)
Bases: `BaseModel`
Модель точки доступа Wi-Fi
Атрибуты:
: ssid (Optional[str]): Название точки доступа. Может быть скрытым
bssid (str): Уникальный идентификатор точки доступа (по типу MAC-адреса)
channel (Optional[int]): Канал, на котором работает точка доступа
signal (Optional[int]): Уровень сигнала (dBm)
encryption (Optional[str]): Тип шифрования (WPA2, WPA3, открытая и т.д.)
frequency (Optional[str]): Частота вещания (2.4GHz/5GHz)
vendor (Optional[str]): Производитель точки доступа (определяется по MAC-адресу)
hidden (bool): Флаг скрытия названия точки доступа (ssid)
note (Optional[str]): Заметка для точки доступа
#### bssid *: str*
#### channel *: int | None*
#### encryption *: str | None*
#### frequency *: str | None*
#### hidden *: bool*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
#### note *: str | None*
#### signal *: int | None*
#### ssid *: str | None*
#### vendor *: str | None*
### *class* models.wifi.WifiScanResult(, access_points: List[WifiAccessPoint])
Bases: `BaseModel`
Результат сканирования Wi-Fi
Атрибуты:
: access_points (List[WifiAccessPoint]): Список найденных Wi-Fi точек доступа
#### access_points *: List[WifiAccessPoint]*
#### model_config *: ClassVar[ConfigDict]* *= {}*
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].