feat: add Google Maps → Email pipeline (Tab 4)

- New Maps page with keyword + region chips, German city presets, query preview, enrichment toggle
- Google Maps Places API (New) service with pagination and deduplication
- maps-enrich job route: Maps search → store raw leads → optional Anymailfinder bulk enrichment
- Settings: Google Maps API key credential card with Places API instructions
- Sidebar: MapPin nav item + googlemaps credential status indicator
- Results: maps job type with MapPin icon (text-green-400)
- Credentials API: added googlemaps to SERVICES array and test endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Timo Uttenweiler
2026-03-17 11:40:08 +01:00
parent aa50f46748
commit 7486517827
9 changed files with 787 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import { prisma } from "@/lib/db";
import { encrypt, decrypt } from "@/lib/utils/encryption";
const SERVICES = ["anymailfinder", "apify", "vayne", "airscale"] as const;
const SERVICES = ["anymailfinder", "apify", "vayne", "airscale", "googlemaps"] as const;
export async function GET() {
try {
@@ -14,7 +14,7 @@ export async function GET() {
return NextResponse.json(result);
} catch (err) {
console.error("GET /api/credentials error:", err);
return NextResponse.json({ anymailfinder: false, apify: false, vayne: false, airscale: false });
return NextResponse.json({ anymailfinder: false, apify: false, vayne: false, airscale: false, googlemaps: false });
}
}

View File

@@ -38,6 +38,21 @@ export async function GET(req: NextRequest) {
});
return NextResponse.json({ ok: res.status === 200 });
}
case "googlemaps": {
const res = await axios.post(
"https://places.googleapis.com/v1/places:searchText",
{ textQuery: "restaurant", maxResultCount: 1 },
{
headers: {
"X-Goog-Api-Key": key,
"X-Goog-FieldMask": "places.id",
"Content-Type": "application/json",
},
timeout: 10000,
}
);
return NextResponse.json({ ok: res.status === 200 });
}
default:
return NextResponse.json({ ok: false, error: "Unknown service" });
}