Files
ad/molodetz/schemas/admin.py
T
retoor 9fb4d65787 Member invites, gallery resync, content and operator docs
- Invite flow: admin issue/revoke on join requests, public single-use
  claim links (hash-only tokens, 7-day expiry, no state reveal), claim
  creates the Member account and marks the request accepted
- Gallery: admin status page plus resync endpoint; sync refreshes
  thumbnails whose content changed; tools/gallery contract and checker
- Docs: public content page, admin-only operator runbook, api.md
  invite/gallery sections, all routes in the live API docs, docs
  reachability gate test
- Screenshots cover the new pages; version 1.0.18
2026-10-06 02:56:08 +02:00

101 lines
2.1 KiB
Python

# retoor <retoor@molodetz.nl>
from typing import Any
from molodetz.schemas.base import OutModel, PublicUserOut
from molodetz.schemas.posts import PostOut
class AdminIndexOut(OutModel):
post_count: int = 0
open_joins: int = 0
user_count: int = 0
deleted_count: int = 0
flyer_count: int = 0
meme_count: int = 0
class GalleryStatusOut(OutModel):
flyers: int = 0
memes: int = 0
missing: list[str] = []
class AdminPostsOut(OutModel):
posts: list[PostOut] = []
class ServiceOut(OutModel):
name: str | None = None
title: str | None = None
description: str | None = None
status: str | None = None
enabled: bool = False
last_run: str | None = None
next_run: str | None = None
heartbeat: str | None = None
metrics: dict[str, Any] = {}
logs: list[str] = []
fields: list[dict[str, Any]] = []
class ServicesOut(OutModel):
services: list[ServiceOut] = []
class ServiceDetailOut(OutModel):
service: ServiceOut | None = None
class SettingsOut(OutModel):
settings: dict[str, str] = {}
class AdminUsersOut(OutModel):
users: list[PublicUserOut] = []
class TrashItemOut(OutModel):
table: str | None = None
uid: str | None = None
label: str | None = None
deleted_at: str | None = None
deleted_by: str | None = None
class TrashOut(OutModel):
items: list[TrashItemOut] = []
class AuditRowOut(OutModel):
uid: str | None = None
event_key: str | None = None
category: str | None = None
actor_kind: str | None = None
actor_uid: str | None = None
result: str | None = None
message: str | None = None
created_at: str | None = None
class AuditOut(OutModel):
rows: list[AuditRowOut] = []
class BackupRowOut(OutModel):
uid: str | None = None
target: str | None = None
status: str | None = None
size_bytes: int | None = None
error: str | None = None
created_at: str | None = None
finished_at: str | None = None
class BackupsOut(OutModel):
backups: list[BackupRowOut] = []
class StatsOut(OutModel):
top_paths: list[dict[str, Any]] = []
daily: list[dict[str, Any]] = []