-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.d.ts
55 lines (49 loc) · 2.39 KB
/
query.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// http://jsforce.github.io/jsforce/doc/Query.html
import { Readable } from 'stream';
import { SalesforceId } from './salesforce-id';
import { RecordResult } from './record-result';
export interface ExecuteOptions {
autoFetch?: boolean;
maxFetch?: number;
scanAll?: number;
}
export interface QueryResult<T> {
done: boolean;
nextRecordsUrl?: string;
totalSize: number;
records: T[];
}
export class Query<T> extends Readable implements Promise<T> {
end(): Query<T>;
filter(filter: Object): Query<T>;
include(include: string): Query<T>;
hint(hint: Object): Query<T>;
limit(value: number): Query<T>;
maxFetch(value: number): Query<T>;
offset(value: number): Query<T>;
skip(value: number): Query<T>;
sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query<T>;
run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query<T>;
execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query<T>;
exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query<T>;
del(type?: string, callback?: (err: Error, ret: RecordResult) => void): any;
del(callback?: (err: Error, ret: RecordResult) => void): any;
delete(type?: string, callback?: (err: Error, ret: RecordResult) => void): any;
delete(callback?: (err: Error, ret: RecordResult) => void): any;
destroy(type?: string, callback?: (err: Error, ret: RecordResult) => void): Promise<RecordResult[]>;
destroy(callback?: (err: Error, ret: RecordResult) => void): Promise<RecordResult[]>;
destroy(error?: Error): void;
explain(callback?: (err: Error, info: ExplainInfo) => void): Promise<ExplainInfo>;
map(callback: (currentValue: Object) => void): Promise<any>;
scanAll(value: boolean): Query<T>;
select(fields: Object | string[] | string): Query<T>;
thenCall(callback?: (err: Error, records: T) => void): Query<T>;
toSOQL(callback: (err: Error, soql: string) => void): Promise<string>;
update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise<RecordResult[]>;
where(conditions: Object | string): Query<T>;
// Implementing promise methods
then<T, never>(onfulfilled?: any): Promise<T | never>;
catch<never>(onrejected?: any): Promise<T>;
[Symbol.toStringTag]: "Promise";
}
export class ExplainInfo { }