/** * Shared types for the `sf cuneiform object describe` command result. * * Extracted from the command file so that display formatters (utils layer) * can consume these types without importing from the commands layer. * * @module models/object-describe-types */ import type { FieldTypeCount, NamespaceCount, RecordAgeDistribution } from '../services/ObjectDescribeService.js'; /** * Field information for JSON output. */ export type FieldInfo = { /** Field API name */ apiName: string; /** Field label */ label: string; /** Field type */ type: string; /** Maximum length for text fields */ length?: number; /** Whether this is a custom field */ isCustom: boolean; /** Whether this is a formula field */ isFormula: boolean; /** Whether this field is required */ isRequired: boolean; /** Namespace prefix (null if standard/unmanaged) */ namespace: string | null; /** Reference to object(s) for lookup fields */ referenceTo: string[] | null; }; /** * Object summary for JSON output. */ export type ObjectSummary = { /** Object API name */ apiName: string; /** Object label */ label: string; /** Object plural label */ labelPlural: string; /** Whether this is a custom object */ isCustom: boolean; /** Namespace prefix */ namespace: string | null; /** Record count (null if query failed) */ recordCount: number | null; /** Whether the object is queryable */ queryable: boolean; /** Whether the object can be profiled */ profileable: boolean; /** Whether PersonAccount is enabled (only for Account) */ personAccountEnabled?: boolean; }; /** * Field summary for JSON output. */ export type FieldSummary = { /** Total fields */ total: number; /** Standard fields */ standard: number; /** Custom fields */ custom: number; /** Formula fields */ formula: number; /** Lookup fields */ lookup: number; }; /** * Relationship info for JSON output. */ export type RelationshipInfo = { /** Count of objects that reference this object */ referencedByCount: number; /** Objects that reference this object */ referencedBy: Array<{ objectName: string; fieldName: string; relationshipName: string | null; }>; /** Lookup fields on this object */ lookupFields: Array<{ fieldName: string; targetObject: string; }>; }; /** * Profiling status for JSON output. */ export type ProfilingStatusInfo = { /** Number of profiling definitions */ definitionCount: number; /** Number of profiling summaries */ summaryCount?: number; /** Definition details */ definitions: Array<{ name: string; latestSummaryDate?: string; latestStatus?: string; }>; }; /** * Single object result for JSON output. */ export type ObjectResult = { /** Object summary */ summary: ObjectSummary; /** Record types */ recordTypes: Array<{ id: string; name: string; developerName: string; isActive: boolean; isDefault: boolean; isPersonType?: boolean; recordAgeDistribution?: RecordAgeDistribution; }>; /** Field summary */ fieldSummary: FieldSummary; /** Field type distribution */ fieldTypeDistribution: FieldTypeCount[]; /** Namespace breakdown */ namespaces: NamespaceCount[]; /** Relationships */ relationships: RelationshipInfo; /** Record age distribution */ recordAgeDistribution: RecordAgeDistribution | null; /** Business processes with per-process record age distribution */ businessProcesses: Array<{ id: string; name: string; isActive: boolean; recordTypeCount: number; recordTypeIds: string[]; recordAgeDistribution?: RecordAgeDistribution; }>; /** Profiling status */ profilingStatus: ProfilingStatusInfo; /** Detailed fields (only with --with-fields) */ fields: FieldInfo[] | null; }; /** * Aggregate totals across all described objects. */ export type ObjectDescribeTotals = { /** Number of objects described */ objectsDescribed: number; /** Total fields across all objects */ totalFields: number; /** Total standard fields across all objects */ totalStandardFields: number; /** Total custom fields across all objects */ totalCustomFields: number; /** Total formula fields across all objects */ totalFormulaFields: number; /** Total lookup fields across all objects */ totalLookupFields: number; /** Total active record types across all objects */ totalRecordTypes: number; /** Total records across all objects (null if any object count unavailable) */ totalRecords: number | null; }; /** * Command result type for JSON output. */ export type ObjectDescribeCommandResult = { /** Array of object results */ objects: ObjectResult[]; /** Aggregate totals across all objects */ totals: ObjectDescribeTotals; };