/** * Templates router — backs GET /api/templates and GET /api/templates/:id. * * Relays the Sapiom core gallery (the same catalog the dashboard's Template * library renders) to the SPA. The API key is held server-side and never * forwarded to the browser — the router fetches on the dialog's behalf via * {@link createTemplateCatalog}, exactly as the runs router does for live run * state. That is also why this can't be a direct browser fetch of core: the * `sk_…` key would have to reach the page, and core sends no CORS headers for * the harness's origin. */ import { Router } from "express"; import { type ApiKeyProvider } from "../core/api-key-provider.js"; export interface TemplatesRouterOpts { /** The Sapiom API key (`sk_…`), NOT the local boot token. Pass a provider so a * rejected key can refresh + retry instead of locking the gallery. */ apiKey: string | null | ApiKeyProvider; /** Override the core base URL (resolved from env by default). Test seam. */ baseUrl?: string; /** Injectable fetch. Test seam. */ fetchImpl?: typeof fetch; } export declare function createTemplatesRouter(opts: TemplatesRouterOpts): Router; //# sourceMappingURL=templates.d.ts.map