/**
 * Cron handlers for scheduled platform jobs.
 *
 * The endpoints in `api/handlers.ts` validate `Authorization: Bearer ${CRON_SECRET}`
 * before invoking these — Vercel Cron sends that header automatically when
 * `CRON_SECRET` is defined in the project's environment. See:
 * https://vercel.com/docs/cron-jobs/manage-cron-jobs#securing-cron-jobs
 *
 * Each handler is **idempotent** and **bounded** — safe to invoke from any
 * scheduler (Vercel Cron, GitHub Actions, EventBridge, k8s CronJob, etc.) and
 * safe to invoke twice in the same window.
 */
import { schedulingCronHandler } from '../scheduling/index.js';
import type { ActuateDB } from '../db/client-types.js';
type PrismaDB = ActuateDB;
export interface CleanupOptions {
    /** Hard-delete revoked / expired sessions older than this. Default: 7d. */
    sessionRetentionMs?: number;
    /** Hard-delete audit log entries older than this. Default: 90d. */
    auditLogRetentionMs?: number;
    /** Hard-delete soft-deleted documents older than this. Default: 30d. */
    trashRetentionMs?: number;
    /** Hard-delete used / expired password reset tokens older than this. Default: 1d. */
    passwordResetRetentionMs?: number;
    /**
     * Hard-delete form submissions older than this (PII retention). Opt-in:
     * `0` (the default) disables forms retention entirely. Wire from
     * `forms.retentionDays` in the CMS config.
     */
    formSubmissionRetentionMs?: number;
    /** Hard-delete document version rows older than this. Default: 90d. */
    versionRetentionMs?: number;
    /** Hard-delete webhook delivery logs older than this. Default: 30d. */
    webhookDeliveryRetentionMs?: number;
    /** Hard-delete API request metric buckets older than this. Default: 30d. */
    apiRequestMetricRetentionMs?: number;
}
export interface CleanupResult {
    sessionsDeleted: number;
    auditLogsDeleted: number;
    documentsDeleted: number;
    passwordResetTokensDeleted: number;
    formSubmissionsDeleted: number;
    versionsDeleted: number;
    webhookDeliveriesDeleted: number;
    apiRequestMetricsDeleted: number;
}
/**
 * Delete stale rows from session, audit log, trash, and password-reset tables.
 *
 * Each deletion is wrapped in its own try/catch so a missing model (e.g. an
 * older Prisma schema without `passwordResetToken`) doesn't fail the entire
 * job — partial cleanup is still useful and the caller logs the count.
 */
export declare function processCleanup(db: PrismaDB, options?: CleanupOptions): Promise<CleanupResult>;
export interface SeoScanIssue {
    documentId: string;
    title: string;
    slug: string;
    problems: string[];
}
export interface SeoScanResult {
    total: number;
    pagesWithIssues: number;
    totalProblems: number;
    issues: SeoScanIssue[];
}
/**
 * Run the same SEO checks as `POST /seo/scan`, but headlessly so a cron
 * (or a CLI / external scheduler) can invoke it without an admin session.
 *
 * Bounded by `maxDocuments` to avoid OOM / timeout on large catalogs —
 * defaults to 5000, which is well above the typical Vercel function memory
 * envelope while staying safely under the 60s cron execution limit.
 */
export declare function processSeoScan(db: PrismaDB, options?: {
    maxDocuments?: number;
    allowedCollections?: string[];
}): Promise<SeoScanResult>;
/** Re-export for convenience so the route handler can import everything from one module. */
export { schedulingCronHandler };
/**
 * Validate a Vercel-style cron Authorization header against `CRON_SECRET`.
 *
 * Returns `false` if the env var is missing — that's deliberately fail-closed
 * so a misconfigured deploy can't silently expose cron endpoints to the public
 * internet. Comparison is constant-time to defeat byte-by-byte timing attacks.
 */
export declare function isAuthorizedCronRequest(authHeader: string | null | undefined): boolean;
//# sourceMappingURL=index.d.ts.map