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

    Class BulkClient

    Salesforce Bulk API 2.0 client that supports both ingest (update, insert, upsert) operations as well as query operations.

    Usage sample for querying account data:

    const bulk = new BulkClient(connection); // Where connection is a Existing `SalesforceConnection` object
    const job = await bulk.query('select Id, Name from Account');

    for await (const record of job.records()) {
    // Results are converted back to JSON objects for easy access
    console.info(JSON.stringify(record, undefined, 4));
    }

    Usage sample for inserting account data:

    const accounts = [
    { Name: 'CB Corp.' }
    ];

    const bulk = new BulkClient(connection); // Where connection is a Existing `SalesforceConnection` object
    const job = await bulk.insert('Account', accounts);

    for (const record of await job.getSuccessfulRecords()) {
    this.logger.info(JSON.stringify(record, undefined, 4));
    }

    for (const record of await job.getUnprocessedRecords()) {
    this.logger.warn(JSON.stringify(record, undefined, 4));
    }

    for (const record of await job.getFailedRecords()) {
    this.logger.error(JSON.stringify(record, undefined, 4));
    }
    Index

    Constructors

    Properties

    apiVersion: string

    Override the APi version used for the bulk requests. When set the apiVersion is preferred over the API version of the current connection SalesforceConnection.version

    ingestEndpoint: "/services/data/v{apiVersion}/jobs/ingest" = ...

    Default ingest endpoint url format where apiVersion is replaced by the API version of the client or connection controlling which fields and objects are accessible through the bulk API

    queryEndpoint: "/services/data/v{apiVersion}/jobs/query" = ...

    Default ingest endpoint url format where apiVersion is replaced by the API version of the client or connection controlling which fields and objects are accessible through the bulk API

    Methods

    • Creates a job representing a bulk operation and its associated data that is sent to Salesforce for asynchronous processing. Provide job data via an Upload Job Data request or as part of a multipart create job request.

      Type Parameters

      • TRecord extends object = any

      Parameters

      • request: IngestJobCreateRequest

        Bulk API request

      • Optionaldata: TRecord[]

        Data to upload

      Returns Promise<BulkIngestJob<TRecord>>