import { type ServiceResult } from '../models/service-result.js'; import { ProfilingSummaryService, type PurgeSummaryRecord } from '../services/ProfilingSummaryService.js'; import type { BulkSummaryResult } from '../models/summary-bulk-types.js'; /** * Options for the summary reprofile operation. */ export type SummaryReprofileOptions = { /** Specific summary IDs to reprofile — exclusive mode */ ids?: string[]; /** Reprofile all eligible summaries */ all?: boolean; /** Filter by object API names */ objects?: string[]; /** Preview mode — show what would be reprofiled without executing */ dryRun?: boolean; /** Skip interactive confirmation prompt */ noPrompt?: boolean; /** Callback when reprofilable summaries are found */ onSummariesFound?: (count: number) => void; /** Callback for user confirmation before re-profiling */ onConfirm?: (count: number) => Promise; }; /** * Result of a summary reprofile operation. */ export type SummaryReprofileResult = { /** Number of summaries successfully submitted for re-profiling */ submitted: number; /** Number of summaries that failed to submit */ failed: number; /** Total number of summaries processed */ total: number; /** Whether the operation was cancelled by the user */ cancelled?: boolean; /** Whether dry-run mode was active */ dryRun?: boolean; /** Preview data (summaries that would be reprofiled) */ preview?: PurgeSummaryRecord[]; /** Per-item results from the API */ apiResults?: BulkSummaryResult; }; /** * Error codes for summary reprofile operations. * Re-exported from ServiceErrorCodes (E4530-E4537) for convenience. */ export declare const SummaryReprofileErrorCodes: { readonly NO_SELECTION_CRITERIA: "E4530"; readonly MUTUALLY_EXCLUSIVE: "E4531"; readonly QUERY_FAILED: "E4532"; readonly NO_ELIGIBLE_SUMMARIES: "E4533"; readonly REPROFILE_FAILED: "E4534"; readonly USER_CANCELLED: "E4535"; readonly OPERATION_FAILED: "E4536"; readonly INVALID_IDS: "E4537"; }; /** * Orchestrates re-profiling of failed or stopped profiling summaries. * * Supports three selection modes: * 1. ID mode: Reprofile specific summaries by ID * 2. All mode: Reprofile all eligible (failed/stopped) summaries * 3. Object mode: Reprofile summaries for specific objects * * These modes are mutually exclusive. * This is a fire-and-forget operation — no polling. */ export declare class SummaryReprofileOperation { private readonly summaryService; private readonly logger?; constructor(summaryService: ProfilingSummaryService, logger?: Console | undefined); /** * Creates the empty result structure. */ private static emptyResult; /** * Validates selection options and returns a failure result if invalid. * Returns undefined when validation passes. */ private static validateOptions; /** * Executes the summary reprofile operation. */ execute(options: SummaryReprofileOptions): Promise>; /** * Queries reprofilable summaries based on the selection mode. */ private querySummaries; }