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

    Class SalesforceService

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

    Implements

    Index

    Constructors

    Properties

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

    Accessors

    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

      • Optionalfilter: 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

      • Optionaloptions: { logLevels?: SoapDebuggingHeader; updateNamespace?: boolean }
        • OptionallogLevels?: SoapDebuggingHeader

          Optional debug log levels to use

        • OptionalupdateNamespace?: 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

      • packageName: string | RegExp

      Returns Promise<
          | undefined
          | {
              id: string;
              name: string;
              namespace: undefined
              | string;
              version: string;
              versionName: string;
          },
      >

    • Returns Promise<
          {
              id: string;
              name: string;
              namespace: undefined
              | string;
              version: string;
              versionName: string;
          }[],
      >

    • Get metadata info about any file; returns metadata type and name or undefined if the specified type is not a Metadata source.

      Parameters

      Returns Promise<undefined | MetadataInfo>

    • Get metadata info about any file; returns metadata type and name or undefined if the specified type is not a Metadata source.

      Parameters

      Returns Promise<(undefined | MetadataInfo)[]>

    • Parameters

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

      Returns { name: string; namespace?: string }

    • Parameters

      • page: string
      • Optionaloptions: { namespacePrefix?: string; 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

      • Optionalfilter: { contentType?: string; namespace?: string }

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

    • 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

      • Optionalfilter: string | T | (string | T)[]

        Object filter or Where conditional string

      • OptionallookupFields: "all" | K[]

        fields to lookup on the record

      • Optionallimit: number

        limit the number of results

      • OptionaluseCache: boolean

        use the query cache

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

    • 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]: unknown }[]

        record data and references

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

        Optional record batch options

        • cancelToken

          Optional cancellation token

      Returns AwaitableAsyncGenerator<BatchResultRecord>

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

    • Updates the namespace used for Salesforce operations.

      Parameters

      • value: string

        The new namespace value to set

      Returns string

      A promise that resolves when the namespace has been updated