AI / GEO: - feat(content): lexicalToMarkdown, blocksToMarkdown, createMarkdownRenderer (+markdownResponse) — per-page Markdown for AI agents - feat(content): markdown content negotiation + discovery (prefersMarkdown, markdownHref) - feat(seo): buildRobots aiBots policy (allow/block-training/disallow) - feat(seo): llms-full.txt mode in buildLlmsTxt/createLlmsTxtRoute - feat(mcp): createMcpRoute — read-only MCP server (search_content, get_page) - feat(content): searchContent + createSearchRoute — shared JSON search - feat(seo): buildSpeakableJsonLd + buildSummaryField (aiSummary, auto-fill) Forms: - feat(forms): useForm/useContactForm + validators (logic-only, no markup) - feat(forms): honeypot anti-spam (honeypotInputProps, isHoneypotTripped) Helpers / hardening: - feat(i18n): resolveLocalized — replaces ad-hoc getSafeString - feat(hooks): buildCrossLocaleFieldSync — locales from config, no hardcoded list - feat(seo): buildNoindexField — checkbox → meta.noindex, no - feat(content): resolveRedirect — 301/308 from slugHistory - feat(env): assertEnv + ipalEnvRules — fail-fast env validation - feat(consent): ConsentScript — load third-party only after consent - feat(health): createHealthRoute — Coolify/Docker DB liveness Fixes: - fix(seo): wrap getCachedPayload in try/catch in createManifestHandler (Docker/CI build no longer crashes when DB unreachable) docs: migration.md (20 sections), new env.md/mcp.md, updated agents.md, AGENTS-TEMPLATE.md, forms/hooks/content/seo/consent/deployment/richtext
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import type { BasePayload } from 'payload';
|
||
import type { I18nConfig } from '../i18n/index.js';
|
||
export type SearchResult = {
|
||
description?: string;
|
||
slug: string;
|
||
title: string;
|
||
/** Locale-aware path, prefixed with baseUrl when given. */
|
||
url: string;
|
||
};
|
||
type SearchContentArgs = {
|
||
/** Absolute origin to prefix URLs with. Omit for relative paths. */
|
||
baseUrl?: string;
|
||
/** Pages collection. Default 'pages'. */
|
||
collection?: string;
|
||
config: I18nConfig;
|
||
/** Home slug map/string so the home result collapses to root. */
|
||
homeSlug?: Record<string, string> | string;
|
||
/** Max results. Default 10, clamped 1–50. */
|
||
limit?: number;
|
||
/** Locale to search/return. Defaults to config.defaultLocale; invalid → default. */
|
||
locale?: string;
|
||
payload: BasePayload;
|
||
/** Keywords. */
|
||
query: string;
|
||
/**
|
||
* Field holding a richer AI summary (see buildSummaryField). When set and
|
||
* present on a doc, it's preferred over meta.description for the result's
|
||
* description.
|
||
*/
|
||
summaryField?: string;
|
||
};
|
||
/**
|
||
* Shared content search: title / meta-description keyword match over a
|
||
* collection, returning structured results (published, non-noindex only). One
|
||
* implementation behind BOTH the JSON search route (createSearchRoute) and the
|
||
* MCP server's search_content tool — so site search, API and AI all rank the
|
||
* same way.
|
||
*
|
||
* Degrades to [] (never throws) when the collection's fields aren't queryable —
|
||
* same guard class as the drafts/_status lesson.
|
||
*/
|
||
export declare function searchContent({ baseUrl, collection, config, homeSlug, limit, locale, payload, query, summaryField, }: SearchContentArgs): Promise<SearchResult[]>;
|
||
export {};
|