import { type ProfilingDefinition, type ListSummary } from '../../../services/ProfilingDefinitionService.js'; import { CuneiformCommand } from '../../../base/cuneiform-command.js'; /** * Command result type for JSON output. */ export type DefinitionListCommandResult = { /** Whether the command was successful */ success: boolean; /** Total count of definitions matching filters (ignoring pagination) */ totalCount: number; /** The definitions on this page */ definitions: ProfilingDefinition[]; /** * Aggregate bucket counts across the full filtered set (ignoring pagination). * Counts are computed server-side via SOQL GROUP BY — see ListSummary. */ summary: ListSummary; /** Applied filters */ filters?: { status?: string; method?: string; objects?: string[]; pattern?: string; category?: string; namespace?: string; }; /** Pagination info */ pagination?: { limit: number; offset: number; }; /** Error message if failed */ error?: string; }; /** * Lists profiling definitions in a Salesforce org with filtering, sorting, and pagination. * * Use this command to: * - List all definitions with key, name, object, method, category, status, and last profiled date * - Filter by object, status, method, category, namespace, or name pattern * - Sort results by key, name, object name, or last profiled date * - Paginate results with --limit and --offset * * @example * ```bash * # List all definitions * sf cuneiform definition list --target-org myOrg * * # List active definitions only * sf cuneiform definition list --target-org myOrg --status active * * # List definitions for a specific object * sf cuneiform definition list --target-org myOrg --objects Account * ``` */ export default class DefinitionList extends CuneiformCommand { static readonly summary: string; static readonly description: string; static readonly examples: string[]; static readonly flags: { 'target-org': import("@oclif/core/interfaces").OptionFlag; 'api-version': import("@oclif/core/interfaces").OptionFlag; status: import("@oclif/core/interfaces").OptionFlag<"active" | "inactive" | "all", import("@oclif/core/interfaces").CustomOptions>; method: import("@oclif/core/interfaces").OptionFlag<"metadata" | "historical" | "comparative" | undefined, import("@oclif/core/interfaces").CustomOptions>; objects: import("@oclif/core/interfaces").OptionFlag; pattern: import("@oclif/core/interfaces").OptionFlag; category: import("@oclif/core/interfaces").OptionFlag; namespace: import("@oclif/core/interfaces").OptionFlag; limit: import("@oclif/core/interfaces").OptionFlag; offset: import("@oclif/core/interfaces").OptionFlag; sort: import("@oclif/core/interfaces").OptionFlag<"name" | "objectName" | "key" | "lastProfiledDate", import("@oclif/core/interfaces").CustomOptions>; }; /** * Displays the summary statistics section. * * Bucket counts come from the service-provided ListSummary (computed via SOQL * GROUP BY across the full filtered set). The command must NOT derive bucket * counts from the paginated `definitions` array — that was the CLI-3084 bug * where Active/Inactive/Profiled/Not Profiled silently reflected only the * current page instead of the org-wide totals. * * Static because it consumes pre-aggregated values; no instance state needed. */ private static displaySummary; /** * Executes the definition list command. * * @returns DefinitionListCommandResult with definitions, count, and pagination info */ run(): Promise; /** * Displays the full command output following UX guidelines. * * Renders: contextual header -> Org Identity -> Active Filters -> * Definitions table -> Summary -> Limit notice -> Next Steps. */ private displayOutput; /** * Builds a list of human-readable descriptions for active filters. */ private getActiveFilters; /** * Returns active filters as flag strings for empty state display. */ private getSelectiveFilters; /** * Displays contextual next steps based on the listed definitions. */ private displayNextSteps; }