@salesforce/core
Advanced tools
Comparing version 0.16.13 to 0.16.14
@@ -71,3 +71,3 @@ "use strict"; | ||
async jwtAuthorize(innerToken, callback) { | ||
return super._postParams({ | ||
return super['_postParams']({ | ||
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', | ||
@@ -111,3 +111,3 @@ assertion: innerToken | ||
_.set(params, 'code_verifier', this.codeVerifier); | ||
return super._postParams(params, callback); | ||
return super['_postParams'](params, callback); | ||
} | ||
@@ -114,0 +114,0 @@ } |
import { Logger } from './logger'; | ||
import { AuthInfo } from './authInfo'; | ||
import { SfdxConfigAggregator } from './config/sfdxConfigAggregator'; | ||
import { Connection as JSForceConnection, ConnectionOptions, RequestInfo } from 'jsforce'; | ||
import { Connection as JSForceConnection } from 'jsforce'; | ||
import { Tooling as JSForceTooling } from 'jsforce'; | ||
import { ConnectionOptions } from 'jsforce'; | ||
import { RequestInfo } from 'jsforce'; | ||
import { QueryResult } from 'jsforce'; | ||
import { ExecuteOptions } from 'jsforce'; | ||
export declare const SFDX_HTTP_HEADERS: { | ||
@@ -9,2 +14,13 @@ 'content-type': string; | ||
}; | ||
export interface Tooling extends JSForceTooling { | ||
/** | ||
* Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially | ||
* useful with large query result sizes, such as over 2000 records. The default maximum | ||
* fetch size is 10,000 records. Modify this via the options argument. | ||
* @param {string} soql The SOQL string. | ||
* @param {ExecuteOptions} options The query options. NOTE: the autoFetch option will always be true. | ||
* @returns {Promise.<QueryResult<T>>} | ||
*/ | ||
autoFetchQuery<T>(soql: string, options?: ExecuteOptions): Promise<QueryResult<T>>; | ||
} | ||
/** | ||
@@ -34,2 +50,3 @@ * Handles connections and requests to Salesforce Orgs. | ||
static create(authInfo: AuthInfo, configAggregator?: SfdxConfigAggregator): Promise<Connection>; | ||
tooling: Tooling; | ||
private logger; | ||
@@ -84,2 +101,11 @@ private _logger; | ||
getUsername(): string; | ||
/** | ||
* Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially | ||
* useful with large query result sizes, such as over 2000 records. The default maximum | ||
* fetch size is 10,000 records. Modify this via the options argument. | ||
* @param {string} soql The SOQL string. | ||
* @param {ExecuteOptions} options The query options. NOTE: the autoFetch option will always be true. | ||
* @returns {Promise.<QueryResult<T>>} | ||
*/ | ||
autoFetchQuery<T>(soql: string, options?: ExecuteOptions): Promise<QueryResult<T>>; | ||
} |
@@ -13,2 +13,3 @@ "use strict"; | ||
const jsforce_1 = require("jsforce"); | ||
const jsforce_2 = require("jsforce"); | ||
const util_1 = require("./util"); | ||
@@ -20,3 +21,3 @@ const sfdxError_1 = require("./sfdxError"); | ||
*/ | ||
Promise.prototype['thenCall'] = jsforce_1.Promise.prototype.thenCall; | ||
Promise.prototype['thenCall'] = jsforce_2.Promise.prototype.thenCall; | ||
const clientId = `sfdx toolbelt:${process.env.SFDX_SET_CLIENT_IDS || ''}`; | ||
@@ -72,2 +73,3 @@ exports.SFDX_HTTP_HEADERS = { | ||
super(options); | ||
this.tooling.autoFetchQuery = Connection.prototype.autoFetchQuery; | ||
this.authInfo = authInfo; | ||
@@ -156,4 +158,26 @@ // Set the jsForce connection logger to be our Bunyan logger. | ||
} | ||
/** | ||
* Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially | ||
* useful with large query result sizes, such as over 2000 records. The default maximum | ||
* fetch size is 10,000 records. Modify this via the options argument. | ||
* @param {string} soql The SOQL string. | ||
* @param {ExecuteOptions} options The query options. NOTE: the autoFetch option will always be true. | ||
* @returns {Promise.<QueryResult<T>>} | ||
*/ | ||
async autoFetchQuery(soql, options = {}) { | ||
const _options = Object.assign(options, { autoFetch: true }); | ||
const records = []; | ||
this._logger.debug(`Auto-fetching query: ${soql}`); | ||
return new Promise((resolve, reject) => this.query(soql, _options) // tslint:disable-line no-any TODO: REMOVE "as any" when connection.query() arg types are updated | ||
.on('record', ((rec) => records.push(rec))) | ||
.on('error', (err) => reject(err)) | ||
.on('end', () => resolve({ | ||
done: true, | ||
nextRecordsUrl: null, | ||
totalSize: records.length, | ||
records | ||
}))); | ||
} | ||
} | ||
exports.Connection = Connection; | ||
//# sourceMappingURL=connection.js.map |
{ | ||
"name": "@salesforce/core", | ||
"version": "0.16.13", | ||
"version": "0.16.14", | ||
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.", | ||
@@ -37,5 +37,5 @@ "main": "dist/exported", | ||
"bunyan-sfdx-no-dtrace": "1.8.2", | ||
"chalk": "2.3.0", | ||
"chalk": "2.4.0", | ||
"cli-ux": "3.3.25", | ||
"jsforce": "1.8.0", | ||
"jsforce": "1.8.4", | ||
"jsonwebtoken": "7.0.0", | ||
@@ -46,3 +46,3 @@ "lodash": "4.17.4", | ||
"devDependencies": { | ||
"@types/jsforce": "1.8.9", | ||
"@types/jsforce": "1.8.10", | ||
"@salesforce/dev-config": "1.0.4", | ||
@@ -49,0 +49,0 @@ "@types/chai": "4.0.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1819799
8881
+ Addedchalk@2.4.0(transitive)
+ Addedcoffeescript@1.12.7(transitive)
+ Addedjsforce@1.8.4(transitive)
- Removedchalk@2.3.0(transitive)
- Removedcoffee-script@1.12.7(transitive)
- Removedhas-flag@2.0.0(transitive)
- Removedjsforce@1.8.0(transitive)
- Removedsupports-color@4.5.0(transitive)
Updatedchalk@2.4.0
Updatedjsforce@1.8.4