This interface describes objects that can provide JSForce connections, it provides some abstraction from whom the class that providing the connection which is usefull

Hierarchy

  • SalesforceService

Implements

Constructors

Properties

connectionProvider: SalesforceConnectionProvider
logger: Logger
metadataRegistry: MetadataRegistry
namespaceService: NamespaceService
queryService: QueryService

Methods

  • Delete one or more records by ID

    Parameters

    • ids: Iterable<string | SObjectRecord>

      list of IDs

    • chunkSize: number = 200

    Returns Promise<{
        error?: string;
        id: string;
        success: boolean;
    }[]>

  • Delete one or more records based on a SOQL filter condition. Returns array of deleted record-ids

    Parameters

    • type: string

      SObject type to delete

    • Optional filter: string | object | (string | object)[]

      Object filter or where-conditional selecting the records to delete

    • chunkSize: number = 200

      Number of records to delete in a single call

    Returns Promise<{
        error?: string;
        id: string;
        success: boolean;
    }[]>

  • Executes the specified APEX using the SOAP API and returns the result.

    Parameters

    • apex: string

      APEX code to execute

    • Optional options: {
          logLevels?: SoapDebuggingHeader;
          updateNamespace?: boolean;
      }
      • Optional logLevels?: SoapDebuggingHeader

        Optional debug log levels to use

      • Optional updateNamespace?: boolean

        Replace namespace placeholders with the actual namespace

    Returns Promise<ExecuteAnonymousResult & {
        debugLog?: string;
    }>

  • Gets basic details about the user for the current connection

    Returns Promise<{
        id: string;
        profileId: any;
        type: string;
        username: string;
    }>

  • Get the content of the specified content version object based on the content version Id

    Parameters

    • versionId: string

      Content Version object Id

    Returns Promise<string>

  • Parameters

    • metadataInfo: {
          componentName: string;
          componentType: string;
      }
      • componentName: string
      • componentType: string

    Returns {
        name: string;
        namespace?: string;
    }

    • name: string
    • Optional namespace?: string
  • Parameters

    • page: string
    • Optional ops: {
          namespacePrefix?: string;
          useFrontdoor?: boolean;
      }
      • Optional namespacePrefix?: string
      • Optional useFrontdoor?: boolean

    Returns Promise<string>

  • Get all static resources matching the specified name, the body of the resource is retrieved when required. The body of the static resource is cached

    Parameters

    • resourceName: string

      Name of the static resource

    Returns Promise<{
        getBody: (() => Promise<Buffer>);
        id: any;
        name: any;
        namespace: any;
    }[]>

  • Insert one or more records into Salesforce; by default uses the standard collections api but switches to bulk API when there are more then 50 records to be inserted.

    Parameters

    • type: string

      Record types to insert

    • records: {
          ref: string;
          values: any;
      }[]

      record data and references

    • Optional cancelToken: CancellationToken

      optional cancellation token

    Returns AsyncGenerator<BatchResultRecord, void, unknown>

    Remarks

    For more control ove the operation users can also directly create a record batch offering more control.

  • Query multiple records based on the where condition. The filter condition can either be a string or a complex filter object.

    Type Parameters

    • T extends object

    • K extends PropertyKey = keyof T

    Parameters

    • type: string

      SObject type

    • Optional filter: string | T | (string | T)[]

      Object filter or Where conditional string

    • Optional lookupFields: "all" | K[]

      fields to lookup on the record

    • Optional limit: number

      limit the number of results

    • Optional useCache: boolean

      use the query cache

    Returns Promise<QueryResult<T, K>[]>

  • Returns a list of records. All records are mapped to record proxy object

    Type Parameters

    Parameters

    • query: string

      SOQL Query to execute

    • Optional useCache: boolean

    Returns Promise<T[]>

  • Parameters

    • page: string

      Name of the APEX page which exposes the requested class/controller

    • action: string

      Name of the class including namespace when a namespace is required

    • method: HttpMethod

      Name of the method to call on the controller

    • data: any

      Data to pass to the controller

    Returns Promise<any>

  • Update one or more records in Salesforce using the ID field as foreign key; by default uses the standard collections api but switches to bulk API when there.

    Parameters

    • type: string

      Record types to updated; all data should have an ID field

    • records: {
          id: string;
          [key: string]: any;
      }[]

      record data and references

    • Optional options: Partial<{
          bulkApiThreshold: number;
          chunkSize: number;
          useBulkApi: boolean;
      }> & {
          cancelToken?: CancellationToken;
      }

    Returns AsyncGenerator<BatchResultRecord, void, unknown>

    Remarks

    For more control ove the operation users can also directly create a record batch offering more control.