import type { Logger } from '@b64hub/sfpm-core'; import { Connection } from '@salesforce/core'; import type { OrgMetadataProvider } from './types.js'; /** * Queries a Salesforce org for metadata component names used during * profile scoping. * * Caches results per profile section so repeated calls (e.g., across * multiple profile files) only query the org once. * * Used to preserve permissions for standard metadata that exists in the * org but is not part of the package source. * * @example * ```typescript * import { OrgMetadataResolver } from '@b64hub/sfpm-hooks'; * import { Connection } from '@salesforce/core'; * * const resolver = new OrgMetadataResolver(connection, logger); * const orgClasses = await resolver.getOrgComponents('classAccesses'); * ``` */ export declare class OrgMetadataResolver implements OrgMetadataProvider { private readonly connection; private readonly logger?; private readonly cache; constructor(connection: Connection, logger?: Logger | undefined); getOrgComponents(section: string): Promise>; /** * Route a section query to the appropriate Salesforce API call. * * Most metadata types use `Metadata.list()`, but some require * specialized queries (objects via describeGlobal, fields via * FieldDefinition SOQL, etc.). */ private queryComponents; /** * Query custom field definitions via the Metadata API. * * Returns qualified names in `Object.Field` format. Standard fields * are not returned — the profile cleaner's `isFieldKnown` check falls * back to the parent object in `objectPermissions` for those. * * Previous implementation used a SOQL query on `FieldDefinition`, but * that entity requires a filter on `EntityDefinitionId` or `DurableId`, * making an unfiltered global query impossible. */ private queryFields; /** * Query metadata components using the Metadata API `list()` method. * Maps the profile section key to the corresponding Salesforce metadata * type via {@link PROFILE_SECTION_TO_METADATA_TYPE}. */ private queryMetadataList; /** * Query all SObject names via describeGlobal. * Returns both standard and custom objects. */ private queryObjects; /** * Query RecordType definitions. * Returns qualified names in `Object.RecordType` format. */ private queryRecordTypes; /** * Query tabs by combining TabDefinition SOQL (standard tabs) with * Metadata API list (custom tabs). */ private queryTabs; }