refactor(routes): drop duplicate /google-maps/* routes (use capability doors)

This commit is contained in:
CREDO23 2026-07-03 17:56:59 +02:00
parent 2c76ef1f57
commit 0844dd581f
2 changed files with 0 additions and 66 deletions

View file

@ -44,7 +44,6 @@ from .google_drive_add_connector_route import (
from .google_gmail_add_connector_route import (
router as google_gmail_add_connector_router,
)
from .google_maps_routes import router as google_maps_router
from .image_generation_routes import router as image_generation_router
from .incentive_tasks_routes import router as incentive_tasks_router
from .jira_add_connector_route import router as jira_add_connector_router
@ -139,7 +138,6 @@ router.include_router(public_chat_router) # Public chat sharing and cloning
router.include_router(incentive_tasks_router) # Incentive tasks for earning free pages
router.include_router(stripe_router) # Stripe checkout for additional page packs
router.include_router(youtube_router) # YouTube playlist resolution
router.include_router(google_maps_router) # Google Maps places + reviews scraper
router.include_router(prompts_router)
router.include_router(memory_router) # User personal memory (memory.md style)
router.include_router(team_memory_router) # Workspace team memory

View file

@ -1,64 +0,0 @@
"""Google Maps scraper routes (Apify actor-compatible)."""
import logging
from fastapi import APIRouter, Depends, HTTPException
from app.auth.context import AuthContext
from app.proprietary.platforms.google_maps import (
GoogleMapsReviewsInput,
GoogleMapsScrapeInput,
scrape_places,
scrape_reviews,
)
from app.proprietary.platforms.google_maps.scraper import SignInRequiredError
from app.users import require_session_context
router = APIRouter()
logger = logging.getLogger(__name__)
@router.post("/google-maps/scrape")
async def scrape_places_route(
payload: GoogleMapsScrapeInput,
_auth: AuthContext = Depends(require_session_context),
) -> list[dict]:
"""Scrape Google Maps places (search terms / URLs / place IDs).
Apify "Google Maps Scraper"-compatible input/output. Runs inline and is
bounded only by the request's own ``maxCrawledPlacesPerSearch``.
"""
try:
return await scrape_places(payload)
except SignInRequiredError as e:
raise HTTPException(
status_code=403, detail=f"Google sign in required: {e!s}"
) from e
except Exception as e:
logger.error("Google Maps scrape failed: %s", e)
raise HTTPException(
status_code=502, detail=f"Google Maps scrape failed: {e!s}"
) from e
@router.post("/google-maps/reviews")
async def scrape_reviews_route(
payload: GoogleMapsReviewsInput,
_auth: AuthContext = Depends(require_session_context),
) -> list[dict]:
"""Scrape Google Maps reviews for the given place URLs / place IDs.
Apify "Google Maps Reviews Scraper"-compatible. Runs inline and is bounded
only by the request's own ``maxReviews``.
"""
try:
return await scrape_reviews(payload)
except SignInRequiredError as e:
raise HTTPException(
status_code=403, detail=f"Google sign in required: {e!s}"
) from e
except Exception as e:
logger.error("Google Maps reviews scrape failed: %s", e)
raise HTTPException(
status_code=502, detail=f"Google Maps reviews scrape failed: {e!s}"
) from e