-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjsforce.d.ts
More file actions
167 lines (140 loc) · 6.23 KB
/
jsforce.d.ts
File metadata and controls
167 lines (140 loc) · 6.23 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// Type definitions for jsforce v1.5.1
// Project: https://github.com/jsforce/jsforce
// Definitions by: JohnAaronNelson <https://github.com/celador>
/// <reference path="./typings/main/ambient/node/node.d.ts" />
declare module 'jsforce' {
interface jsforce {
Connection: Connection;
OAuth2: OAuth2;// require('./oauth2');
Promise: Promise;// require('./promise');
registry: FileRegistry;
RecordStream: RecordStream;// require('./record-stream');
SfDate: SfDate;// require("./date");
VERSION: string;// pkg.version;
}
interface Connection extends NodeJS.EventEmitter {
new (options: ConnectionOptions);
analytics: Analytics;
apex: Apex;
bulk: Bulk;
cache: Cache;
chatter: Chatter;
metadata: Metadata;
oauth2: OAuth2;
process: Process;
soap: SoapApi;
streaming: Streaming;
tooling: Tooling;
authorize(authCode: string, callback?: () => {}): PromiseLike<UserInfo>;
create(type: string, records: any | Array<any>, options?: {}, callback?: () => {}): PromiseLike<(RecordResult | Array<RecordResult>)>;
del(type: string, ids: string | Array<string>, options?: {}, callback?: () => {}): PromiseLike<(RecordResult | Array<RecordResult>)>;
delete(type: string, ids: string | Array<string>, options?: {}, callback?: () => {}): PromiseLike<(RecordResult | Array<RecordResult>)>;
destroy(type: string, ids: string | Array<string>, options?: {}, callback?: () => {}): PromiseLike<(RecordResult | Array<RecordResult>)>;
deleted(type: string, start: string | Date, end: string | Date, callback?: () => {}): PromiseLike<DeletedRecordsInfo>;
describe(type: string, callback?: () => {}): PromiseLike<DescribeSObjectResult>;
request(): any;
query(): any;
login(name: string, password: string): any;
}
interface OAuth2 {
new (options: OAuthConfigOptions);
loginUrl?: string; // Salesforce login server URL
authzServiceUrl?: string; // OAuth2 authorization service URL. If not specified, it generates from default by adding to login server URL.
tokenServiceUrl?: string; // OAuth2 token service URL. If not specified it generates from default by adding to login server URL.
clientId: string; // OAuth2 client ID.
clientSecret: string; // OAuth2 client secret.
redirectUri: string; // URI to be callbacked from Salesforce OAuth2 authorization service.
}
interface FileRegistry {
}
interface SfDate {
new ();
toString(): Date;
toJSON(): Date;
parseDate(str: string): Date;
toDateLiteral(date: Date): SfDate
toDateTimeLiteral(date: Date): SfDate
}
interface RecordStream extends NodeJS.ReadableStream {
new ();
filter(fn): {}; // RecordStream.Serializable;
map(fn): {}; // {RecordStream.Serializable}
recordMapStream(record, noeval?): {}; // {RecordStream.Serializable}
}
interface Promise {
new ();
all(promises): PromiseLike<Array<any>>;// {Promise.<Array.<*>>}
defer(): PromiseLike<any>;// {Deferred}
reject(reason): PromiseLike<any>;// {Promise}
resolve(result): PromiseLike<any>;// {Promise}
catch(onRejected): PromiseLike<{}>;// {Promise.<S>}
fail(onRejected): PromiseLike<{}>;// {Promise.<S>}
then(onFulfilled?): PromiseLike<{}>;// {Promise.<(S1)>}
then(onFulfilled?, onRejected?): PromiseLike<{}>;// {Promise.<(S1|S2)>}
thenCall(callback?): PromiseLike<any>;// {Promise}
}
interface OAuthConfigOptions {
loginUrl?: string;// loginUrl string <optional>
authzServiceUrl?: string;// authzServiceUrl string <optional>
tokenServiceUrl?: string;// tokenServiceUrl string <optional>
clientId?: string;// clientId string OAuth2 client ID.
clientSecret?: string;// clientSecret string OAuth2 client secret.
redirectUri?: string;// redirectUri string URI to be callbacked from Salesforce OAuth2 authorization service.
}
interface ConnectionOptions {
oauth2?: OAuth2 | {}; // OAuth2 instance or options to be passed to OAuth2 constructor
logLevel?: string; // Output logging level (DEBUG|INFO|WARN|ERROR|FATAL)
version?: string; // Salesforce API Version (without "v" prefix)
maxRequest?: number; // Max number of requests allowed in parallel call
loginUrl?: string; // Salesforce Login Server URL (e.g. https://login.salesforce.com/)
instanceUrl?: string; // Salesforce Instance URL (e.g. https://na1.salesforce.com/)
serverUrl?: string; // Salesforce SOAP service endpoint URL (e.g. https://na1.salesforce.com/services/Soap/u/28.0)
accessToken?: string; // Salesforce OAuth2 access token
sessionId?: string; // Salesforce session ID
refreshToken?: string; // Salesforce OAuth2 refresh token
signedRequest?: string | {}; // Salesforce Canvas signed request (Raw Base64 string, JSON string, or deserialized JSON)
proxyUrl?: string; // Cross-domain proxy server URL, used in browser client, non Visualforce app.
callOptions?: {}; // Call options used in each SOAP/REST API request. See manual.
}
interface UserInfo {
id: string; // User ID
organizationId: string; // Organization ID
url: string; // Identity URL of the user
}
interface RecordResult {
}
interface Analytics {
}
interface Apex {
}
interface Bulk {
}
interface Cache {
}
interface Chatter {
}
interface Metadata {
}
interface OAuth2 {
}
interface Process {
}
interface SoapApi {
}
interface Streaming {
}
interface Tooling {
}
interface DeletedRecordsInfo {
earliestDateAvailable: string; // The timestamp of the earliest date available
latestDateCovered: string; // The timestamp of the last date covered
deletedRecords: Array<DeletedRecord> // Updated records
}
interface DeletedRecord {
id: string; // Record ID
deletedDate: string; // The timestamp when this record was deleted
}
interface DescribeSObjectResult {
}
export = jsforce;
}