Files
wehub-resource-sync 6ede33ccdb
Build and Push Docker Images / create_manifest (web, surfsense-web, , cpu) (push) Has been cancelled
Build and Push Docker Images / finalize_release (push) Has been cancelled
Obsidian Plugin Lint / lint (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / compute_version (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / verify_digests (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, , cpu) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda, cuda) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda126, cuda126) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:33:44 +08:00

81 lines
2.1 KiB
TypeScript

import type { ComponentType } from "react";
import {
GoogleMapsIcon,
GoogleSearchIcon,
RedditIcon,
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: "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);
}