(Admin) Today's and this month's counters, straight from Redis. Pass user_id for one user (direct reads, no scan); omit it for everyone active today. emails=true labels users by email at the cost of one Auth0 lookup each. Requires a valid X-Admin-Key header.
(
user_id: str | None = None,
emails: bool = False,
is_admin: bool = Depends(get_admin_access),
)
| 59 | |
| 60 | @tools_router.get("/admin/usage", tags=["Admin"], summary="Daily and monthly usage counters") |
| 61 | async def admin_usage( |
| 62 | user_id: str | None = None, |
| 63 | emails: bool = False, |
| 64 | is_admin: bool = Depends(get_admin_access), |
| 65 | ): |
| 66 | """ |
| 67 | (Admin) Today's and this month's counters, straight from Redis. Pass |
| 68 | user_id for one user (direct reads, no scan); omit it for everyone active |
| 69 | today. emails=true labels users by email at the cost of one Auth0 lookup |
| 70 | each. Requires a valid X-Admin-Key header. |
| 71 | """ |
| 72 | return await get_usage(user_id=user_id, emails=emails) |
| 73 | |
| 74 | |
| 75 | @tools_router.post("/tools/send-email", tags=["Tools"]) |
nothing calls this directly
no test coverage detected