Api docs updates (#20388)

* Update classification API docs

* Add information to events api

* Fix tag

* Add exports

* Add generic response to model for classification apis

* Add preview API information

* Cleanup

* Cleanup
This commit is contained in:
Nicolas Mowen
2025-10-08 14:55:38 -05:00
committed by GitHub
parent 28e3f83ae3
commit 3c7e36fb16
11 changed files with 1932 additions and 618 deletions
+14 -2
View File
@@ -19,7 +19,13 @@ logger = logging.getLogger(__name__)
router = APIRouter(tags=[Tags.notifications])
@router.get("/notifications/pubkey")
@router.get(
"/notifications/pubkey",
summary="Get VAPID public key",
description="""Gets the VAPID public key for the notifications.
Returns the public key or an error if notifications are not enabled.
""",
)
def get_vapid_pub_key(request: Request):
config = request.app.frigate_config
notifications_enabled = config.notifications.enabled
@@ -39,7 +45,13 @@ def get_vapid_pub_key(request: Request):
return JSONResponse(content=utils.b64urlencode(raw_pub), status_code=200)
@router.post("/notifications/register")
@router.post(
"/notifications/register",
summary="Register notifications",
description="""Registers a notifications subscription.
Returns a success message or an error if the subscription is not provided.
""",
)
def register_notifications(request: Request, body: dict = None):
if request.app.frigate_config.auth.enabled:
# FIXME: For FastAPI the remote-user is not being populated