vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Class SalesforceSchemaService

    Provides access to Database Schema methods like describe.

    Implements

    Index

    Constructors

    Properties

    connectionProvider: SalesforceConnectionProvider
    fieldMatchingStrategies: ((field: Field, name: string) => 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: DescribeSObjectResult, id: string) => 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

      // 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