/** * Shared types for the `sf cuneiform user details` 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/user-details-types */ /** * Org context information for JSON output. */ export type OrgContextResult = { /** Organization name */ orgName: string; /** 18-character Organization ID */ orgId: string; /** Instance URL (e.g., https://acme.my.salesforce.com) */ instanceUrl: string; /** Whether this is a sandbox org */ isSandbox: boolean; /** Organization type (e.g., Developer Edition, Enterprise Edition) */ orgType: string; }; /** * User identity information for JSON output. */ export type UserIdentityResult = { /** Salesforce User ID */ id: string; /** User's login username */ username: string; /** User's email address */ email: string; /** Name of the user's assigned Profile */ profileName: string; /** Name of the user's assigned Role (null if not assigned) */ roleName: string | null; }; /** * Prerequisites check result. */ export type PrerequisitesResult = { /** Whether Cuneiform for Salesforce is installed in the org */ cuneiformInstalled: boolean; /** Whether the Admin permission set is assigned */ adminAccessAssigned: boolean; /** Whether all prerequisites passed */ allPassed: boolean; }; /** * Permission set assignment status for JSON output. */ export type PermissionSetAssignmentResult = { /** Full API name with namespace (e.g., pnova__Cuneiform_for_CRM_PRO_Administrative_User) */ apiName: string; /** Human-readable label (e.g., Cuneiform for CRM PRO Administrative User) */ label: string; /** Whether the permission set is assigned */ isAssigned: boolean; /** Whether this permission set is required for profiling */ isRequired: boolean; }; /** * Configuration profile status for JSON output. */ export type ConfigProfileResult = { /** Whether a configuration profile is active */ isConfigured: boolean; /** Label of the active profile (null if not configured) */ profileLabel: string | null; /** Whether API-only profiling is enabled (null if not configured) */ apiOnlyProfilingEnabled: boolean | null; /** Whether CLI self-provisioning is enabled (null if not configured) */ selfRegistrationEnabled: boolean | null; }; /** * Readiness assessment combining permission sets and config profile. */ export type ReadinessResult = { /** Whether the user is ready to use Cuneiform */ isReady: boolean; /** Permission set assignment statuses */ permissionSets: PermissionSetAssignmentResult[]; /** Configuration profile status */ configProfile: ConfigProfileResult; }; /** * Structured resolution guidance item with persona routing. */ export type ResolutionGuidanceItem = { /** What the issue is */ issue: string; /** Itemized detail lines (rendered as indented bullets) */ detail?: string[]; /** What action to take */ action: string; /** Who should take the action */ persona: 'admin' | 'self'; }; /** * Individual configuration action result. */ export type ConfigurationActionResult = { /** Type of action */ type: 'assignPermissionSet' | 'enableApiOnlyProfiling' | 'unassignPermissionSet' | 'disableApiOnlyProfiling'; /** Target identifier (permission set name or profile name) */ target: string; /** Human-readable label for the target */ targetLabel: string; /** Action status */ status: 'applied' | 'skipped' | 'failed' | 'planned'; /** Status message */ message?: string; }; /** * Snapshot of the user's configuration state captured before --configure actions * were planned or applied. Narrowed from the service-level ConfigurationState — * userId and username are intentionally omitted because they are already exposed * via UserDetailsResult.user. Surfaces the CLI-3418 readiness-threading contract * into the JSON output so consumers can verify that the readiness display and * configure previousState derive from a single readiness snapshot. */ export type ConfigurationPreviousState = { /** Whether all required permission sets were assigned at snapshot time */ hasRequiredPermissionSets: boolean; /** Names of missing permission sets at snapshot time (empty if all assigned) */ missingPermissionSets: string[]; /** Whether API-only profiling was enabled at snapshot time */ apiOnlyProfilingEnabled: boolean; /** Active profile developer name at snapshot time (if configured) */ profileDeveloperName?: string; }; /** * Configuration result (only present when --configure is used). */ export type ConfigurationResult = { /** Whether this was a dry-run (no changes applied) */ dryRun: boolean; /** * Configuration state before actions were planned or applied. Surfaces the * CLI-3418 readiness-threading contract: this snapshot is built from the same * readiness data that drives the readiness display, so consumers can verify * agreement between the two surfaces. */ previousState: ConfigurationPreviousState; /** Actions taken or planned */ actions: ConfigurationActionResult[]; /** Summary statistics */ summary: { /** Number of changes required */ changesRequired: number; /** Number of changes successfully applied */ changesApplied: number; /** Number of changes that failed */ changesFailed: number; }; /** Deployment job ID for tracking (if API-only profiling was enabled) */ deploymentJobId?: string; }; /** * Contextual links for the user. */ export type LinksResult = { /** URL to verification documentation */ documentation?: string; /** URL to installation guide */ installationGuide?: string; }; /** * Unified command result type for JSON output. * Used by both diagnostic (default) and configure (--configure) modes. */ export type UserDetailsResult = { /** Org context information */ orgContext: OrgContextResult; /** User identity information */ user: UserIdentityResult; /** Prerequisites check result */ prerequisites: PrerequisitesResult; /** Readiness assessment */ readiness: ReadinessResult; /** Structured resolution guidance (empty if ready) */ resolutionGuidance: ResolutionGuidanceItem[]; /** Configuration result (only present when --configure is used) */ configuration?: ConfigurationResult; /** Contextual links */ links: LinksResult; };