| """V1 API router aggregator. |
| |
| The strangle: new v1 routes are added here as domains migrate. The legacy |
| main.py still mounts all old routes; we ADD new v1 routes on top so they |
| co-exist until cutover. |
| |
| To add a new domain: |
| 1. Create app/api/v1/<group>/<domain>.py with APIRouter |
| 2. Import and append it to `api_v1_router` below |
| 3. Mount the route prefix in the domain's __init__.py |
| """ |
| from __future__ import annotations |
|
|
| from fastapi import APIRouter |
|
|
| |
| |
| api_v1_router: list[APIRouter] = [] |
|
|
| |
| |
| |
| |
| router = APIRouter(prefix="/api/v1", tags=["v1"]) |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| from app.api.v1.auth.alerts import router as alerts_router |
|
|
| api_v1_router.append(alerts_router) |
|
|
| from app.api.v1.public.wallet import router as wallet_router |
|
|
| api_v1_router.append(wallet_router) |
|
|
| from app.api.v1.public.token import router as token_router |
|
|
| api_v1_router.append(token_router) |
|
|
| from app.api.v1.public.scanner import router as scanner_router |
|
|
| api_v1_router.append(scanner_router) |
|
|
| |
| |
|
|
| from app.api.v1.rag.search import router as rag_v2_router |
|
|
| api_v1_router.append(rag_v2_router) |
|
|
| from app.api.v1.admin.alerts_webhook import router as admin_alerts_webhook_router |
|
|
| api_v1_router.append(admin_alerts_webhook_router) |
|
|
| from app.api.v1.catalog import router as catalog_router |
|
|
| api_v1_router.append(catalog_router) |
|
|
|
|
| def build_v1_router() -> APIRouter: |
| """Construct the v1 aggregator with all migrated routes mounted.""" |
| aggregated = APIRouter(prefix="/api/v1") |
| for r in api_v1_router: |
| aggregated.include_router(r) |
| return aggregated |
|
|