import type { Logger } from '@b64hub/sfpm-core'; import type { Connection } from '@salesforce/core'; import type { PicklistFieldData, PicklistHooksOptions } from './types.js'; /** * Synchronises picklist values from source metadata into a Salesforce org * using the Tooling API. * * Each field is processed individually: * 1. Query `FieldDefinition` to locate the Tooling API `CustomField` record. * 2. Read the current value set from the org. * 3. Compare source and org values. * 4. If different, push the reconciled value set back via * `conn.tooling.sobject('CustomField').update()`. * * Background-job collisions (common with Tooling API picklist updates) * are automatically retried up to {@link MAX_RETRIES} times. */ export declare class PicklistEnabler { private readonly connection; private readonly options?; private readonly logger?; private readonly strategy; constructor(connection: Connection, options?: PicklistHooksOptions | undefined, logger?: Logger | undefined); /** * Process a list of picklist fields — compare source with org and update * where required. * * @returns The number of fields actually updated. */ enablePicklists(fields: PicklistFieldData[]): Promise; /** * Two value sets are identical when they contain the same active values * (fullName + label + default) regardless of order. */ private arePicklistsIdentical; /** * Extract active picklist values from a Tooling API CustomField record. * * Maps the org's `valueName` to our normalised `fullName` and converts * the boolean `default` flag to a string for consistent comparison. */ private extractOrgValues; /** * Locate the Tooling API CustomField record for a given object + field * using the FieldDefinition entity as an index. */ private getPicklistFromOrg; private processField; /** * Strategy `'all'`: replace the org value set entirely with source values. */ private syncAll; /** * Strategy `'new'`: only append values that exist in source but not in the org. */ private syncNew; /** * Push an updated value set to the org via the Tooling API. * * Retries automatically when the org reports a background job collision. */ private updatePicklist; }