import { type ServiceResult } from '../models/service-result.js'; import { ProfilingDefinitionService } from '../services/ProfilingDefinitionService.js'; import { ProfileRequestService } from '../services/ProfileRequestService.js'; /** * Default name pattern for NUT-created definitions. * Matches definitions created by NUT tests with the `[NUT-` prefix. */ export declare const DEFAULT_NUT_PATTERN = "[NUT-%"; /** * Options for the org reset operation. */ export type OrgResetOptions = { /** Target org username or alias */ targetOrg: string; /** SOQL LIKE pattern for definition names to purge (default: '[NUT-%') */ pattern?: string; /** Preview mode — show what would be deleted without making changes */ dryRun?: boolean; /** Skip interactive confirmation prompt */ noPrompt?: boolean; /** Progress callback for per-step status updates */ onProgress?: (event: ResetProgressEvent) => void; }; /** * Progress event emitted during each reset step. */ export type ResetProgressEvent = { /** Current step being executed */ step: 'query-definitions' | 'cancel-requests' | 'delete-requests' | 'delete-definitions'; /** Human-readable description of current action */ message: string; /** Count of items processed in this step */ count?: number; }; /** * Per-category counts for the reset result. */ export type ResetCategoryCounts = { /** Items successfully processed */ deleted: number; /** Items skipped (blocked or ineligible) */ skipped: number; /** Items that failed to process */ failed: number; /** Total items found */ total: number; }; /** * Result of an org reset operation. */ export type OrgResetResult = { /** Definition purge counts */ definitions: ResetCategoryCounts; /** Profiling request cancel/delete counts */ requests: { cancelled: number; deleted: number; failed: number; total: number; }; /** Whether this was a dry-run (no changes made) */ dryRun: boolean; /** SOQL LIKE pattern used to match definitions */ pattern: string; }; /** * Error codes specific to org reset operations. * Range: E4950-E4959. */ export declare const ResetErrorCodes: { /** Query for definitions failed */ readonly DEFINITION_QUERY_FAILED: "E4950"; /** Definition deletion failed */ readonly DEFINITION_DELETE_FAILED: "E4951"; /** Request cancellation failed */ readonly REQUEST_CANCEL_FAILED: "E4952"; /** Request deletion failed */ readonly REQUEST_DELETE_FAILED: "E4953"; /** Operation failed unexpectedly */ readonly OPERATION_FAILED: "E4954"; }; /** * Orchestrates a full org reset by purging NUT-created test data. * * The reset sequence is: * 1. Query definitions matching the name pattern (default: `[NUT-%`) * 2. Cancel any active profiling requests linked to those definitions * 3. Delete cancelled/rejected profiling requests * 4. Delete definitions that have no related summaries * * Follows the 4-layer architecture: Command → Operation → Service → API */ export declare class OrgResetOperation { private readonly definitionService; private readonly requestService; private readonly logger?; constructor(definitionService: ProfilingDefinitionService, requestService: ProfileRequestService, logger?: Console | undefined); /** * Creates an empty result structure. */ private static emptyResult; /** * Executes the org reset operation. */ execute(options: OrgResetOptions): Promise>; /** * Handles profiling request cancellation and deletion for matched definitions. */ private handleRequests; /** * Handles definition deletion for deletable definitions. */ private handleDefinitions; }