import { type HygieneCommonOptions } from "../shared.js"; export interface AuditStaleWorkflowOptions extends HygieneCommonOptions { /** Days since last update to qualify as stale. Default 30. */ days?: number; /** Scope to descendants of this content path. Default `/sitecore/content`. */ root?: string; /** Override the search index. */ index?: string; /** Cap on the number of items inspected. Default 5000. */ limit?: number; /** Include system items in the scan. Off by default. */ includeSystem?: boolean; /** Workflow concurrency. Default 4. */ concurrency?: number; } export interface StaleWorkflowReport { itemId: string; path: string; language: string | null; templateName?: string | null; workflowName: string | null; stateName: string | null; stateIsFinal: boolean; daysSinceUpdate: number; updatedDate: string | null; } /** * Audit items currently in a non-final workflow state whose last update * is older than `--days N`. * * Strategy: * 1. Search-index pass over `--root` (default `/sitecore/content`) * collects every item plus its indexed `updatedDate`. We filter * *here* by `updatedDate < (now - N days)` — efficient because the * index has the date directly. The "is in workflow" check needs * the Authoring API (search index does not expose `__Workflow * state` reliably across XM Cloud tenants). * 2. For each stale candidate, call `getItemWorkflow(itemId)`. Skip * items that aren't on a workflow or are already in a final state. * * Notes: * - "In a workflow" means `Item.workflow.workflow` resolves and the * `workflowState.final` is false. Items past the final state (e.g. * "Approved") are considered not stale. * - The N-days threshold uses the search index's `updatedDate`. If * that field isn't populated for some items (rare; mostly platform * items), they're skipped — and platform items are skipped by * default anyway. */ export declare const runAuditStaleWorkflow: (options: AuditStaleWorkflowOptions) => Promise;