import type { ICaseHistoryEdge, ICaseHistoryItem, ICaseHistoryNode, SFValue } from '../models/caseHistory'; /** * Maps Salesforce field identifiers to human-readable display names. * * Contains two distinct key categories: * - Real SF API field names (e.g. `ContactId`, `RH_Product__c`, `FolderId__c`) * - Synthetic lifecycle pseudo-fields produced by the SF History API (e.g. `created`, * `closed`, `ownerAssignment`). These are not custom Salesforce fields — they represent * case lifecycle events that appear as history entries with no OldValue/NewValue. */ export declare const FIELD_NAME_DISPLAY_MAP: Record; export declare function getFieldDisplayName(fieldName: string): string | undefined; export declare function isSfdcId(value: string): boolean; /** * Extracts a string representation from a polymorphic SF value union. * * Property names (`stringValue`, `booleanValue`, etc.) correspond to GraphQL * inline-fragment aliases defined in the `GET_CASE_HISTORY` query. Changing those * aliases without updating this function will silently break value extraction. * * The check order is safe because the union discriminants are mutually exclusive. * Note: empty string `''` is a valid return value (distinct from `null`). */ export declare function extractStringValue(val: SFValue): string | null; /** * Lifecycle pseudo-field names from the SF History API mapped to human-readable action * sentences. Fields not listed here fall back to using the raw `fieldName` as output text * in {@link normalizeNodeToHistoryItem}. */ export declare const SPECIAL_FIELD_ACTIONS: Record; export declare const DEFAULT_AVATAR_SRC = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Crect width='36' height='36' fill='%23f0f0f0'/%3E%3Cpath fill='%23d2d2d2' d='M17.7 20.1c-3.5 0-6.4-2.9-6.4-6.4s2.9-6.4 6.4-6.4 6.4 2.9 6.4 6.4-2.8 6.4-6.4 6.4z'/%3E%3Cpath fill='%23d2d2d2' d='M30.6 36c-.4-3.9-1.3-9-2.9-11-1.1-1.4-2.3-2.2-3.5-2.6s-1.8-.6-6.3-.6-6.1.7-6.1.7c-1.2.4-2.4 1.2-3.4 2.6-1.7 1.9-2.6 7.1-3 10.9h25.2z'/%3E%3C/svg%3E"; /** * Only SF `UserType === 'Standard'` is treated as an internal (Red Hat) user. * All other types — including `null`, `undefined`, and unknown portal types — default * to customer. This conservative default ensures external users are never accidentally * styled as internal. */ export declare function deriveIsCustomer(userType: string | null | undefined): boolean; /** * Filters out history entries whose values are raw Salesforce IDs that cannot be * decoded into human-readable display strings. * * Filtering rules: * - Both values null → **keep** (lifecycle action events carry no values) * - `newValue` is an SFDC ID and `oldValue` is null or also an ID → **drop** * (unresolvable reference change with no readable side) * - `oldValue` is an SFDC ID and `newValue` is null → **drop** * (ID removal with no display name) * - At least one side is a human-readable string → **keep** */ export declare function filterSfdcIdEntries(edges: ICaseHistoryEdge[]): ICaseHistoryNode[]; /** * Field names whose history entries are internal-only and should be hidden * from customer/external viewers in the History tab. * * Includes both real SF API field names and synthetic lifecycle pseudo-fields * produced by the SF History API. */ export declare const INTERNAL_ONLY_FIELDS: ReadonlySet; /** * Removes history items that represent internal-only case activity. * * Filters by field name rather than by author, because internal activity * (ownership transfers, status changes, routing) can be triggered by system * processes whose `CreatedBy.UserType` varies. * * Used when the viewer is an external/customer user to prevent internal case * activities from leaking to customers. */ export declare function filterInternalOnlyEntries(items: ICaseHistoryItem[]): ICaseHistoryItem[]; /** * Converts a raw SF history node into a normalized `ICaseHistoryItem`. * * Classifies each entry as either: * - **Action** (`!oldValue && !newValue`): lifecycle events like "created", "closed". * `outputText` is set here from {@link SPECIAL_FIELD_ACTIONS}, or falls back to the * raw `fieldName` for unknown actions. * - **Change**: field-value mutations. `outputText` is left empty because the Timeline * layer formats change text via `applyReplacements` / `handleFieldChange`. * * Display name fallback chain: `FIELD_NAME_DISPLAY_MAP` → SF `label` → SF * `displayValue` → raw `fieldName`. */ export declare function normalizeNodeToHistoryItem(node: ICaseHistoryNode): ICaseHistoryItem; //# sourceMappingURL=caseHistoryUtils.d.ts.map