@salesforce/core 3.30.12 → 3.30.13

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.
@@ -148,7 +148,9 @@ export declare class Connection<S extends Schema = Schema> extends JSForceConnec
148
148
  * @param soql The SOQL string.
149
149
  * @param queryOptions The query options. NOTE: the autoFetch option will always be true.
150
150
  */
151
- autoFetchQuery<T extends Schema = S>(soql: string, queryOptions?: Partial<QueryOptions>): Promise<QueryResult<T>>;
151
+ autoFetchQuery<T extends Schema = S>(soql: string, queryOptions?: Partial<QueryOptions & {
152
+ tooling: boolean;
153
+ }>): Promise<QueryResult<T>>;
152
154
  /**
153
155
  * Executes a query using either standard REST or Tooling API, returning a single record.
154
156
  * Will throw if either zero records are found OR multiple records are found.
@@ -289,15 +289,16 @@ class Connection extends jsforce_1.Connection {
289
289
  * @param soql The SOQL string.
290
290
  * @param queryOptions The query options. NOTE: the autoFetch option will always be true.
291
291
  */
292
- async autoFetchQuery(soql, queryOptions = {}) {
292
+ async autoFetchQuery(soql, queryOptions = { tooling: false }) {
293
293
  const config = await configAggregator_1.ConfigAggregator.create();
294
294
  // take the limit from the calling function, then the config, then default 10,000
295
295
  const maxFetch = (config.getInfo(orgConfigProperties_1.OrgConfigProperties.ORG_MAX_QUERY_LIMIT).value || queryOptions.maxFetch) ?? 10000;
296
- const options = Object.assign(queryOptions, {
296
+ const { tooling, ...queryOptionsWithoutTooling } = queryOptions;
297
+ const options = Object.assign(queryOptionsWithoutTooling, {
297
298
  autoFetch: true,
298
299
  maxFetch,
299
300
  });
300
- const query = await this.query(soql, options);
301
+ const query = tooling ? await this.tooling.query(soql, options) : await this.query(soql, options);
301
302
  if (query.records.length && query.totalSize > query.records.length) {
302
303
  void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(`The query result is missing ${query.totalSize - query.records.length} records due to a ${maxFetch} record limit. Increase the number of records returned by setting the config value "maxQueryLimit" or the environment variable "SFDX_MAX_QUERY_LIMIT" to ${query.totalSize} or greater than ${maxFetch}.`);
303
304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.30.12",
3
+ "version": "3.30.13",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",