1 | import { Stream } from "stream";
|
2 |
|
3 | import { Batch, BatchResultInfo } from "./batch";
|
4 | import { Connection } from "./connection";
|
5 | import { Job } from "./job";
|
6 | import { Record } from "./record";
|
7 | import { RecordResult } from "./record-result";
|
8 |
|
9 | export interface BulkOptions {
|
10 | extIdField: string;
|
11 | concurrencyMode?: "Serial" | "Parallel" | undefined;
|
12 | }
|
13 |
|
14 | type BulkLoadOperation =
|
15 | | "insert"
|
16 | | "update"
|
17 | | "upsert"
|
18 | | "delete"
|
19 | | "hardDelete";
|
20 |
|
21 | export class Bulk {
|
22 | constructor(connection: Connection);
|
23 |
|
24 | pollInterval: number;
|
25 | pollTimeout: number;
|
26 |
|
27 | createJob(type: string, operation: string, options?: BulkOptions): Job;
|
28 | job(id: string): Job;
|
29 | load(
|
30 | type: string,
|
31 | operation: BulkLoadOperation,
|
32 | options?: BulkOptions,
|
33 | input?: Record[] | Stream | string,
|
34 | callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void,
|
35 | ): Batch;
|
36 | query(soql: string): any;
|
37 | }
|