Provides access to Database Schema methods like describe.

Hierarchy

  • SalesforceSchemaService

Implements

Constructors

Properties

connectionProvider: SalesforceConnectionProvider
fieldMatchingStrategies: ((field, name) => boolean)[] = ...

Type declaration

    • (field, name): boolean
    • Parameters

      • field: Field
      • name: string

      Returns boolean

logger: Logger
nsService: NamespaceService
schemaAccess: CompositeSchemaAccess

Methods

  • Filters a list of Salesforce IDs based on the provided filter function.

    This method groups IDs by their 3-character prefix, determines the corresponding SObject type for each prefix, and then applies the filter function to each ID based on its SObject type.

    Parameters

    • ids: string | string[]

      A single Salesforce ID or an array of Salesforce IDs to filter

    • predicate: ((type, id) => boolean)

      A function that determines whether an ID should be included based on its SObject type

    Returns Promise<string[]>

    A Promise that resolves to an array of filtered Salesforce IDs

    Example

    // Filter only Contact IDs
    const contactIds = await filterIds(mixedIds, (type) => type.name === 'Contact');
  • Retrieves the API name of the name field for a specific Salesforce object type.

    Parameters

    • type: string

      The API name of the Salesforce object type (e.g., 'Account', 'Contact')

    Returns Promise<undefined | string>

    A Promise that resolves to the API name of the name field, or undefined if no name field is found