mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-16 23:01:06 +02:00
Brings the three newer verbs to parity with tiktok.scrape everywhere it was wired: MCP tools (+ selfcheck manifest), the chat subagent prompt/description, the playground catalog, the native docs page, and the SEO marketing page. Also adds live e2e stages for comments, user search, and trending. Docs/FAQ now state the real contract: profile metadata is reliable while its video list can be withheld, and keyword video search is walled (use user search for accounts).
96 lines
2.5 KiB
TypeScript
96 lines
2.5 KiB
TypeScript
import type { ComponentType } from "react";
|
|
import {
|
|
GoogleMapsIcon,
|
|
GoogleSearchIcon,
|
|
RedditIcon,
|
|
TikTokIcon,
|
|
WebIcon,
|
|
YouTubeIcon,
|
|
} from "./platform-icons";
|
|
|
|
/** Icon component that accepts a ``className`` (Tabler + Lucide both satisfy this). */
|
|
export type PlatformIcon = ComponentType<{ className?: string }>;
|
|
|
|
/**
|
|
* Static catalog of the platform-native scraper verbs, used to render the
|
|
* playground navigation (sidebar + index grid) without waiting on a fetch.
|
|
* Verb ``name`` mirrors the backend capability registry ``platform.verb`` and
|
|
* maps directly to the REST path ``/scrapers/{platform}/{verb}``.
|
|
*/
|
|
export interface PlaygroundVerb {
|
|
/** Capability name, e.g. ``reddit.scrape``. */
|
|
name: string;
|
|
/** URL segment, e.g. ``scrape``. */
|
|
verb: string;
|
|
label: string;
|
|
}
|
|
|
|
export interface PlaygroundPlatform {
|
|
/** URL segment + REST platform, e.g. ``google_maps``. */
|
|
id: string;
|
|
label: string;
|
|
icon: PlatformIcon;
|
|
verbs: PlaygroundVerb[];
|
|
}
|
|
|
|
export const PLAYGROUND_PLATFORMS: PlaygroundPlatform[] = [
|
|
{
|
|
id: "reddit",
|
|
label: "Reddit",
|
|
icon: RedditIcon,
|
|
verbs: [{ name: "reddit.scrape", verb: "scrape", label: "Scrape" }],
|
|
},
|
|
{
|
|
id: "youtube",
|
|
label: "YouTube",
|
|
icon: YouTubeIcon,
|
|
verbs: [
|
|
{ name: "youtube.scrape", verb: "scrape", label: "Scrape" },
|
|
{ name: "youtube.comments", verb: "comments", label: "Comments" },
|
|
],
|
|
},
|
|
{
|
|
id: "tiktok",
|
|
label: "TikTok",
|
|
icon: TikTokIcon,
|
|
verbs: [
|
|
{ name: "tiktok.scrape", verb: "scrape", label: "Scrape" },
|
|
{ name: "tiktok.comments", verb: "comments", label: "Comments" },
|
|
{
|
|
name: "tiktok.user_search",
|
|
verb: "user_search",
|
|
label: "User Search",
|
|
},
|
|
{ name: "tiktok.trending", verb: "trending", label: "Trending" },
|
|
],
|
|
},
|
|
{
|
|
id: "google_maps",
|
|
label: "Google Maps",
|
|
icon: GoogleMapsIcon,
|
|
verbs: [
|
|
{ name: "google_maps.scrape", verb: "scrape", label: "Scrape" },
|
|
{ name: "google_maps.reviews", verb: "reviews", label: "Reviews" },
|
|
],
|
|
},
|
|
{
|
|
id: "google_search",
|
|
label: "Google Search",
|
|
icon: GoogleSearchIcon,
|
|
verbs: [{ name: "google_search.scrape", verb: "scrape", label: "Scrape" }],
|
|
},
|
|
{
|
|
id: "web",
|
|
label: "Web",
|
|
icon: WebIcon,
|
|
verbs: [{ name: "web.crawl", verb: "crawl", label: "Crawl" }],
|
|
},
|
|
];
|
|
|
|
export function findPlatform(platformId: string): PlaygroundPlatform | undefined {
|
|
return PLAYGROUND_PLATFORMS.find((p) => p.id === platformId);
|
|
}
|
|
|
|
export function findVerb(platformId: string, verb: string): PlaygroundVerb | undefined {
|
|
return findPlatform(platformId)?.verbs.find((v) => v.verb === verb);
|
|
}
|