1 | import { JsonCollection, JsonMap, Optional } from '@salesforce/ts-types';
|
2 | import { Tooling as JSForceTooling } from 'jsforce';
|
3 | import { ExecuteOptions } from 'jsforce';
|
4 | import { QueryResult } from 'jsforce';
|
5 | import { RequestInfo } from 'jsforce';
|
6 | import { ConnectionOptions } from 'jsforce';
|
7 | import { Connection as JSForceConnection } from 'jsforce';
|
8 | import { AuthFields, AuthInfo } from './authInfo';
|
9 | import { ConfigAggregator } from './config/configAggregator';
|
10 | export declare const SFDX_HTTP_HEADERS: {
|
11 | 'content-type': string;
|
12 | 'user-agent': string;
|
13 | };
|
14 | export interface Tooling extends JSForceTooling {
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | autoFetchQuery<T>(soql: string, options?: ExecuteOptions): Promise<QueryResult<T>>;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | export declare class Connection extends JSForceConnection {
|
40 | |
41 |
|
42 |
|
43 |
|
44 | static create(this: new (options: Connection.Options) => Connection, options: Connection.Options): Promise<Connection>;
|
45 | |
46 |
|
47 |
|
48 | tooling: Tooling;
|
49 | private logger;
|
50 | private _logger;
|
51 | private _transport;
|
52 | private _normalizeUrl;
|
53 | private options;
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | constructor(options: Connection.Options);
|
61 | /**
|
62 | * Async initializer.
|
63 | */
|
64 | init(): Promise<void>;
|
65 | /**
|
66 | * Send REST API request with given HTTP request info, with connected session information
|
67 | * and SFDX headers.
|
68 | *
|
69 | * @param request HTTP request object or URL to GET request.
|
70 | * @param options HTTP API request options.
|
71 | */
|
72 | request(request: RequestInfo | string, options?: JsonMap): Promise<JsonCollection>;
|
73 | /**
|
74 | * Send REST API request with given HTTP request info, with connected session information
|
75 | * and SFDX headers. This method returns a raw http response which includes a response body and statusCode.
|
76 | *
|
77 | * @param request HTTP request object or URL to GET request.
|
78 | */
|
79 | requestRaw(request: RequestInfo): Promise<JsonMap>;
|
80 | /**
|
81 | * The Force API base url for the instance.
|
82 | */
|
83 | baseUrl(): string;
|
84 | /**
|
85 | * Retrieves the highest api version that is supported by the target server instance.
|
86 | */
|
87 | retrieveMaxApiVersion(): Promise<string>;
|
88 | /**
|
89 | * Use the latest API version available on `this.instanceUrl`.
|
90 | */
|
91 | useLatestApiVersion(): Promise<void>;
|
92 | /**
|
93 | * Get the API version used for all connection requests.
|
94 | */
|
95 | getApiVersion(): string;
|
96 | /**
|
97 | * Set the API version for all connection requests.
|
98 | *
|
99 | * **Throws** *{@link SfdxError}{ name: 'IncorrectAPIVersion' }* Incorrect API version.
|
100 | * @param version The API version.
|
101 | */
|
102 | setApiVersion(version: string): void;
|
103 | |
104 |
|
105 |
|
106 | getAuthInfoFields(): AuthFields;
|
107 | |
108 |
|
109 |
|
110 | getConnectionOptions(): AuthFields;
|
111 | |
112 |
|
113 |
|
114 | getUsername(): Optional<string>;
|
115 | |
116 |
|
117 |
|
118 | isUsingAccessToken(): boolean;
|
119 | |
120 |
|
121 |
|
122 |
|
123 | normalizeUrl(url: string): string;
|
124 | |
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | autoFetchQuery<T>(soql: string, options?: ExecuteOptions): Promise<QueryResult<T>>;
|
132 | }
|
133 | export declare namespace Connection {
|
134 | |
135 |
|
136 |
|
137 | interface Options {
|
138 | |
139 |
|
140 |
|
141 | authInfo: AuthInfo;
|
142 | |
143 |
|
144 |
|
145 | configAggregator?: ConfigAggregator;
|
146 | |
147 |
|
148 |
|
149 | connectionOptions?: ConnectionOptions;
|
150 | }
|
151 | }
|