async def _discover_all_objects(self, client: httpx.AsyncClient) -> Dict[str, List[dict]]:
        """Discover all databases and pages using the search endpoint."""
        logger.info("Phase 1: Discovering all objects via search")

        discovered = {"databases": [], "pages": []}

        # Search for databases
        logger.info("Searching for databases...")
        async for database in self._search_objects(client, "database"):
            discovered["databases"].append(database)
            self._stats["databases_found"] += 1

        # Search for pages
        logger.info("Searching for pages...")
        async for page in self._search_objects(client, "page"):
            discovered["pages"].append(page)
            self._stats["pages_found"] += 1

        logger.info(
            f"Discovery complete: {len(discovered['databases'])} databases, "
            f"{len(discovered['pages'])} pages"
        )
        return discovered
Discover all databases and pages using the search endpoint.
backend/airweave/platform/sources/notion.py