UNPKG

906 BTypeScriptView Raw
1import { Stream } from 'stream';
2
3import { Connection } from './connection';
4import { RecordResult } from './record-result';
5import { Record } from './record';
6import { Job } from './job';
7import { Batch, BatchResultInfo } from './batch';
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(type: string, operation: BulkLoadOperation, options?: BulkOptions, input?: Record[] | Stream | string, callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void): Batch;
30 query(soql: string): any;
31}