@jsforce/jsforce-node 3.10.4 → 3.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/lib/VERSION.d.ts +1 -1
- package/lib/VERSION.js +1 -1
- package/lib/api/analytics.d.ts +2 -2
- package/lib/api/apex.d.ts +6 -6
- package/lib/api/bulk.d.ts +1 -1
- package/lib/api/chatter.d.ts +1 -1
- package/lib/api/tooling.d.ts +5 -5
- package/lib/connection.d.ts +4 -1
- package/lib/connection.js +7 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/process.d.ts +2 -2
- package/lib/query.d.ts +5 -0
- package/lib/query.js +41 -0
- package/lib/sobject.d.ts +5 -5
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -55,6 +55,9 @@ See [license](LICENSE) (MIT License).
|
|
|
55
55
|
|
|
56
56
|
## Notes
|
|
57
57
|
|
|
58
|
+
### SOAP Login API Deprecation Notice
|
|
59
|
+
The SOAP login() API will be retired in Summer '27 (API version 65.0). If you are using the `loginBySoap` method, please migrate to OAuth 2.0 Username-Password Flow instead. For more information, see [Salesforce Release Notes](https://help.salesforce.com/s/articleView?id=release-notes.rn_api_upcoming_retirement_258rn.htm&release=258&type=5).
|
|
60
|
+
|
|
58
61
|
If you have any questions first file it on [issues](https://github.com/jsforce/jsforce/issues) before contacting authors via e-mail.
|
|
59
62
|
|
|
60
63
|
## How to build/run tests:
|
package/lib/VERSION.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "3.10.
|
|
1
|
+
declare const _default: "3.10.6";
|
|
2
2
|
export default _default;
|
package/lib/VERSION.js
CHANGED
package/lib/api/analytics.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export declare class Analytics<S extends Schema> {
|
|
|
150
150
|
/**
|
|
151
151
|
* Get recent report list
|
|
152
152
|
*/
|
|
153
|
-
reports(): import("../
|
|
153
|
+
reports(): import("../types").StreamPromise<ReportInfo[]>;
|
|
154
154
|
/**
|
|
155
155
|
* Get dashboard object of Analytics API
|
|
156
156
|
*/
|
|
@@ -158,6 +158,6 @@ export declare class Analytics<S extends Schema> {
|
|
|
158
158
|
/**
|
|
159
159
|
* Get recent dashboard list
|
|
160
160
|
*/
|
|
161
|
-
dashboards(): import("../
|
|
161
|
+
dashboards(): import("../types").StreamPromise<DashboardInfo[]>;
|
|
162
162
|
}
|
|
163
163
|
export default Analytics;
|
package/lib/api/apex.d.ts
CHANGED
|
@@ -19,26 +19,26 @@ export declare class Apex<S extends Schema> {
|
|
|
19
19
|
/**
|
|
20
20
|
* Call Apex REST service in GET request
|
|
21
21
|
*/
|
|
22
|
-
get<R = unknown>(path: string, options?: Object): import("../
|
|
22
|
+
get<R = unknown>(path: string, options?: Object): import("../types").StreamPromise<R>;
|
|
23
23
|
/**
|
|
24
24
|
* Call Apex REST service in POST request
|
|
25
25
|
*/
|
|
26
|
-
post<R = unknown>(path: string, body?: Object, options?: Object): import("../
|
|
26
|
+
post<R = unknown>(path: string, body?: Object, options?: Object): import("../types").StreamPromise<R>;
|
|
27
27
|
/**
|
|
28
28
|
* Call Apex REST service in PUT request
|
|
29
29
|
*/
|
|
30
|
-
put<R = unknown>(path: string, body?: Object, options?: Object): import("../
|
|
30
|
+
put<R = unknown>(path: string, body?: Object, options?: Object): import("../types").StreamPromise<R>;
|
|
31
31
|
/**
|
|
32
32
|
* Call Apex REST service in PATCH request
|
|
33
33
|
*/
|
|
34
|
-
patch<R = unknown>(path: string, body?: Object, options?: Object): import("../
|
|
34
|
+
patch<R = unknown>(path: string, body?: Object, options?: Object): import("../types").StreamPromise<R>;
|
|
35
35
|
/**
|
|
36
36
|
* Call Apex REST service in DELETE request
|
|
37
37
|
*/
|
|
38
|
-
delete<R = unknown>(path: string, options?: Object): import("../
|
|
38
|
+
delete<R = unknown>(path: string, options?: Object): import("../types").StreamPromise<R>;
|
|
39
39
|
/**
|
|
40
40
|
* Synonym of Apex#delete()
|
|
41
41
|
*/
|
|
42
|
-
del: <R = unknown>(path: string, options?: Object) => import("../
|
|
42
|
+
del: <R = unknown>(path: string, options?: Object) => import("../types").StreamPromise<R>;
|
|
43
43
|
}
|
|
44
44
|
export default Apex;
|
package/lib/api/bulk.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ export declare class Bulk<S extends Schema> {
|
|
|
220
220
|
/**
|
|
221
221
|
*
|
|
222
222
|
*/
|
|
223
|
-
_request<T>(request_: BulkRequest): import("../
|
|
223
|
+
_request<T>(request_: BulkRequest): import("../types").StreamPromise<T>;
|
|
224
224
|
/**
|
|
225
225
|
* Create and start bulkload job and batch
|
|
226
226
|
*
|
package/lib/api/chatter.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export declare class Chatter<S extends Schema> {
|
|
|
109
109
|
* Sending request to API endpoint
|
|
110
110
|
* @private
|
|
111
111
|
*/
|
|
112
|
-
_request<R>(req_: ChatterRequestParams): import("../
|
|
112
|
+
_request<R>(req_: ChatterRequestParams): import("../types").StreamPromise<R>;
|
|
113
113
|
/**
|
|
114
114
|
* Convert path to site root relative url
|
|
115
115
|
* @private
|
package/lib/api/tooling.d.ts
CHANGED
|
@@ -263,22 +263,22 @@ export declare class Tooling<S extends Schema> {
|
|
|
263
263
|
/**
|
|
264
264
|
*
|
|
265
265
|
*/
|
|
266
|
-
request<R = unknown>(request: string | HttpRequest, options?: Object): import("../
|
|
266
|
+
request<R = unknown>(request: string | HttpRequest, options?: Object): import("../types").StreamPromise<R>;
|
|
267
267
|
/**
|
|
268
268
|
* Executes Apex code anonymously
|
|
269
269
|
*/
|
|
270
|
-
executeAnonymous(body: string): import("../
|
|
270
|
+
executeAnonymous(body: string): import("../types").StreamPromise<ExecuteAnonymousResult>;
|
|
271
271
|
/**
|
|
272
272
|
* Executes Apex tests asynchronously
|
|
273
273
|
*/
|
|
274
|
-
runTestsAsynchronous(req: RunTestsAsyncRequest): import("../
|
|
274
|
+
runTestsAsynchronous(req: RunTestsAsyncRequest): import("../types").StreamPromise<string | null>;
|
|
275
275
|
/**
|
|
276
276
|
* Executes Apex tests synchronously
|
|
277
277
|
*/
|
|
278
|
-
runTestsSynchronous(req: RunTestsRequest): import("../
|
|
278
|
+
runTestsSynchronous(req: RunTestsRequest): import("../types").StreamPromise<RunTestsResult | null>;
|
|
279
279
|
/**
|
|
280
280
|
* Retrieves available code completions of the referenced type
|
|
281
281
|
*/
|
|
282
|
-
completions(type?: 'apex' | 'visualforce'): import("../
|
|
282
|
+
completions(type?: 'apex' | 'visualforce'): import("../types").StreamPromise<CompletionsResult>;
|
|
283
283
|
}
|
|
284
284
|
export default Tooling;
|
package/lib/connection.d.ts
CHANGED
|
@@ -129,7 +129,10 @@ export declare class Connection<S extends Schema = Schema> extends EventEmitter
|
|
|
129
129
|
*/
|
|
130
130
|
loginByOAuth2(username: string, password: string): Promise<UserInfo>;
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
132
|
+
* Login by SOAP protocol
|
|
133
|
+
* @deprecated The SOAP login() API will be retired in Summer '27 (API version 65.0).
|
|
134
|
+
* Please use OAuth 2.0 Username-Password Flow instead.
|
|
135
|
+
* For more information, see https://help.salesforce.com/s/articleView?id=release-notes.rn_api_upcoming_retirement_258rn.htm&release=258&type=5
|
|
133
136
|
*/
|
|
134
137
|
loginBySoap(username: string, password: string): Promise<UserInfo>;
|
|
135
138
|
/**
|
package/lib/connection.js
CHANGED
|
@@ -383,9 +383,15 @@ class Connection extends events_1.EventEmitter {
|
|
|
383
383
|
return userInfo;
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
|
-
*
|
|
386
|
+
* Login by SOAP protocol
|
|
387
|
+
* @deprecated The SOAP login() API will be retired in Summer '27 (API version 65.0).
|
|
388
|
+
* Please use OAuth 2.0 Username-Password Flow instead.
|
|
389
|
+
* For more information, see https://help.salesforce.com/s/articleView?id=release-notes.rn_api_upcoming_retirement_258rn.htm&release=258&type=5
|
|
387
390
|
*/
|
|
388
391
|
async loginBySoap(username, password) {
|
|
392
|
+
this._logger.warn('DEPRECATION WARNING: The SOAP login() API will be retired in Summer \'27 (API version 65.0). ' +
|
|
393
|
+
'Please use OAuth 2.0 Username-Password Flow instead. ' +
|
|
394
|
+
'For more information, see https://help.salesforce.com/s/articleView?id=release-notes.rn_api_upcoming_retirement_258rn.htm&release=258&type=5');
|
|
389
395
|
if (!username || !password) {
|
|
390
396
|
return Promise.reject(new Error('no username password given'));
|
|
391
397
|
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/process.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class ProcessRule<S extends Schema> {
|
|
|
39
39
|
/**
|
|
40
40
|
* Trigger process rule for given entities
|
|
41
41
|
*/
|
|
42
|
-
trigger(contextIds: string | string[]): import("./
|
|
42
|
+
trigger(contextIds: string | string[]): import("./types").StreamPromise<{
|
|
43
43
|
errors: null;
|
|
44
44
|
success: true;
|
|
45
45
|
} | {
|
|
@@ -98,7 +98,7 @@ export declare class ApprovalProcess<S extends Schema> {
|
|
|
98
98
|
/**
|
|
99
99
|
* Send bulk requests for approval process
|
|
100
100
|
*/
|
|
101
|
-
request(requests: Array<ApprovalProcessRequestConfig | ApprovalProcessRequest<S>>): import("./
|
|
101
|
+
request(requests: Array<ApprovalProcessRequestConfig | ApprovalProcessRequest<S>>): import("./types").StreamPromise<ApprovalProcessRequestResult[]>;
|
|
102
102
|
/**
|
|
103
103
|
* Create approval process request
|
|
104
104
|
*
|
package/lib/query.d.ts
CHANGED
|
@@ -288,6 +288,11 @@ export declare class Query<S extends Schema, N extends SObjectNames<S>, R extend
|
|
|
288
288
|
update<UR extends SObjectInputRecord<S, N>>(mapping: ((rec: R) => UR) | UR, type: N, options?: QueryUpdateOptions): Promise<SaveResult[]>;
|
|
289
289
|
update<UR extends SObjectInputRecord<S, N>>(mapping: ((rec: R) => UR) | UR, options?: QueryUpdateOptions): Promise<SaveResult[]>;
|
|
290
290
|
private mapBulkV2ResultsToSaveResults;
|
|
291
|
+
/**
|
|
292
|
+
* Fetches all records for a subquery field by following nextRecordsUrl
|
|
293
|
+
* @private
|
|
294
|
+
*/
|
|
295
|
+
private _fetchAllSubqueryRecords;
|
|
291
296
|
}
|
|
292
297
|
/**
|
|
293
298
|
* SubQuery object for representing child relationship query
|
package/lib/query.js
CHANGED
|
@@ -373,6 +373,23 @@ class Query extends events_1.EventEmitter {
|
|
|
373
373
|
const data = await this._conn.request({ method: 'GET', url, headers });
|
|
374
374
|
this.emit('fetch');
|
|
375
375
|
this.totalSize = data.totalSize;
|
|
376
|
+
// If autoFetch is true, fetch all records for any subqueries
|
|
377
|
+
if (autoFetch && data.records.length > 0) {
|
|
378
|
+
const recordKeys = Object.keys(data.records[0]);
|
|
379
|
+
for (const record of data.records) {
|
|
380
|
+
for (const key of recordKeys) {
|
|
381
|
+
const field = record[key];
|
|
382
|
+
if (field && typeof field === 'object' && 'records' in field && 'nextRecordsUrl' in field) {
|
|
383
|
+
record[key] = {
|
|
384
|
+
...field,
|
|
385
|
+
records: await this._fetchAllSubqueryRecords(record, key, headers),
|
|
386
|
+
done: true,
|
|
387
|
+
nextRecordsUrl: undefined
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
376
393
|
this.records = this.records?.concat(maxFetch - this.records.length > data.records.length
|
|
377
394
|
? data.records
|
|
378
395
|
: data.records.slice(0, maxFetch - this.records.length));
|
|
@@ -741,6 +758,30 @@ class Query extends events_1.EventEmitter {
|
|
|
741
758
|
});
|
|
742
759
|
return [...successSaveResults, ...failedSaveResults];
|
|
743
760
|
}
|
|
761
|
+
/**
|
|
762
|
+
* Fetches all records for a subquery field by following nextRecordsUrl
|
|
763
|
+
* @private
|
|
764
|
+
*/
|
|
765
|
+
async _fetchAllSubqueryRecords(record, fieldName, headers) {
|
|
766
|
+
const subqueryField = record[fieldName];
|
|
767
|
+
if (!subqueryField || !subqueryField.records) {
|
|
768
|
+
return [];
|
|
769
|
+
}
|
|
770
|
+
let allRecords = [...subqueryField.records];
|
|
771
|
+
let nextRecordsUrl = subqueryField.nextRecordsUrl;
|
|
772
|
+
while (nextRecordsUrl) {
|
|
773
|
+
// When following nextRecordsUrl for a subquery, we need to preserve the relationship context
|
|
774
|
+
// by using the full URL as-is rather than trying to reconstruct it
|
|
775
|
+
const data = await this._conn.request({
|
|
776
|
+
method: 'GET',
|
|
777
|
+
url: nextRecordsUrl,
|
|
778
|
+
headers
|
|
779
|
+
});
|
|
780
|
+
allRecords = allRecords.concat(data.records);
|
|
781
|
+
nextRecordsUrl = data.nextRecordsUrl;
|
|
782
|
+
}
|
|
783
|
+
return allRecords;
|
|
784
|
+
}
|
|
744
785
|
}
|
|
745
786
|
exports.Query = Query;
|
|
746
787
|
/*--------------------------------------------*/
|
package/lib/sobject.d.ts
CHANGED
|
@@ -198,7 +198,7 @@ export declare class SObject<S extends Schema, N extends SObjectNames<S>, FieldN
|
|
|
198
198
|
* @param {Callback.<ListViewsInfo>} [callback] - Callback function
|
|
199
199
|
* @returns {Promise.<ListViewsInfo>}
|
|
200
200
|
*/
|
|
201
|
-
listviews(): import("./
|
|
201
|
+
listviews(): import("./types").StreamPromise<unknown>;
|
|
202
202
|
/**
|
|
203
203
|
* Returns the list view info in specifed view id
|
|
204
204
|
*
|
|
@@ -212,7 +212,7 @@ export declare class SObject<S extends Schema, N extends SObjectNames<S>, FieldN
|
|
|
212
212
|
* @param {Callback.<Array.<QuickAction~QuickActionInfo>>} [callback] - Callback function
|
|
213
213
|
* @returns {Promise.<Array.<QuickAction~QuickActionInfo>>}
|
|
214
214
|
*/
|
|
215
|
-
quickActions(): import("./
|
|
215
|
+
quickActions(): import("./types").StreamPromise<unknown>;
|
|
216
216
|
/**
|
|
217
217
|
* Get reference for specified quick aciton in the SObject
|
|
218
218
|
*
|
|
@@ -241,7 +241,7 @@ declare class ListView {
|
|
|
241
241
|
/**
|
|
242
242
|
* Executes query for the list view and returns the resulting data and presentation information.
|
|
243
243
|
*/
|
|
244
|
-
results(): import("./
|
|
244
|
+
results(): import("./types").StreamPromise<unknown>;
|
|
245
245
|
/**
|
|
246
246
|
* Returns detailed information about a list view
|
|
247
247
|
*/
|
|
@@ -249,10 +249,10 @@ declare class ListView {
|
|
|
249
249
|
headers?: {
|
|
250
250
|
[name: string]: string;
|
|
251
251
|
};
|
|
252
|
-
}): import("./
|
|
252
|
+
}): import("./types").StreamPromise<unknown>;
|
|
253
253
|
/**
|
|
254
254
|
* Explain plan for executing list view
|
|
255
255
|
*/
|
|
256
|
-
explain(): import("./
|
|
256
|
+
explain(): import("./types").StreamPromise<any>;
|
|
257
257
|
}
|
|
258
258
|
export default SObject;
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.js
CHANGED
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"database.com"
|
|
11
11
|
],
|
|
12
12
|
"homepage": "http://github.com/jsforce/jsforce",
|
|
13
|
-
"version": "3.10.
|
|
13
|
+
"version": "3.10.6",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git://github.com/jsforce/jsforce.git"
|
|
@@ -243,6 +243,7 @@
|
|
|
243
243
|
"karma-sourcemap-loader": "^0.4.0",
|
|
244
244
|
"karma-webpack": "^5.0.0",
|
|
245
245
|
"nock": "^13.4.0",
|
|
246
|
+
"os-browserify": "^0.3.0",
|
|
246
247
|
"path-browserify": "^1.0.1",
|
|
247
248
|
"power-assert": "^1.6.1",
|
|
248
249
|
"prettier": "^2.2.1",
|