import type { RetryConfig } from '../retry.js'; /** * Configuration for ToolingApiAdapter. */ export type ToolingApiAdapterConfig = { /** Optional logger for debug output */ logger?: Console; /** * Whether to emit @salesforce/core Lifecycle events for telemetry. * When enabled, emits events like 'adapter:tooling:start', 'adapter:tooling:complete'. * Default: false */ emitLifecycleEvents?: boolean; /** * Retry configuration for transient failures. * If not specified, retries are disabled. */ retry?: RetryConfig; }; /** * Custom field metadata from the Tooling API. */ export type CustomField = { /** Salesforce ID of the custom field */ Id: string; /** API name without namespace prefix */ DeveloperName: string; /** The object this field belongs to (can be ID or name) */ TableEnumOrId: string; /** Full name including object prefix */ FullName: string; /** * Additional metadata about the field from the Tooling API. * * Common properties include: * - `type`: Field data type (e.g., 'Text', 'Number', 'Picklist', 'Lookup') * - `label`: User-friendly field label * - `length`: Maximum length for text fields * - `precision`: Total digits for number fields * - `scale`: Decimal places for number fields * - `required`: Whether the field is required * - `unique`: Whether values must be unique * - `externalId`: Whether field is an external ID * - `defaultValue`: Default value expression * - `formula`: Formula expression (for formula fields) * - `referenceTo`: Related object for lookup/master-detail fields * - `relationshipName`: Relationship API name * - `picklistValues`: Array of picklist options (for picklist fields) * * @see https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_customfield.htm */ Metadata: Record; }; /** * Validation rule metadata from the Tooling API. */ export type ValidationRule = { /** Salesforce ID of the validation rule */ Id: string; /** API name of the validation rule */ ValidationName: string; /** ID of the entity definition this rule belongs to */ EntityDefinitionId: string; /** Whether the validation rule is active */ Active: boolean; /** Error message displayed when validation fails */ ErrorMessage: string; }; /** * Tab definition from the Tooling API. */ export type TabDefinition = { /** Salesforce ID of the tab */ Id: string; /** Name of the tab */ Name: string; /** API name of the associated SObject */ SobjectName: string; /** Whether this is a custom tab */ IsCustom: boolean; };