UNPKG

953 BTypeScriptView Raw
1import { Stream } from "stream";
2
3import { Batch, BatchResultInfo } from "./batch";
4import { Connection } from "./connection";
5import { Job } from "./job";
6import { Record } from "./record";
7import { RecordResult } from "./record-result";
8
9export interface BulkOptions {
10 extIdField: string;
11 concurrencyMode?: "Serial" | "Parallel" | undefined;
12}
13
14type BulkLoadOperation =
15 | "insert"
16 | "update"
17 | "upsert"
18 | "delete"
19 | "hardDelete";
20
21export 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}