@salesforce/core 3.30.9 → 3.30.10
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/lib/org/connection.js +6 -0
- package/messages/connection.md +8 -0
- package/package.json +1 -1
package/lib/org/connection.js
CHANGED
|
@@ -26,6 +26,7 @@ const messages = messages_1.Messages.load('@salesforce/core', 'connection', [
|
|
|
26
26
|
'incorrectAPIVersionError',
|
|
27
27
|
'domainNotFoundError',
|
|
28
28
|
'noInstanceUrlError',
|
|
29
|
+
'noApiVersionsError',
|
|
29
30
|
]);
|
|
30
31
|
const clientId = `sfdx toolbelt:${process.env.SFDX_SET_CLIENT_IDS || ''}`;
|
|
31
32
|
exports.SFDX_HTTP_HEADERS = {
|
|
@@ -178,6 +179,11 @@ class Connection extends jsforce_1.Connection {
|
|
|
178
179
|
async retrieveMaxApiVersion() {
|
|
179
180
|
await this.isResolvable();
|
|
180
181
|
const versions = await this.request(`${this.instanceUrl}/services/data`);
|
|
182
|
+
// if the server doesn't return a list of versions, it's possibly a instanceUrl issue where the local file is out of date.
|
|
183
|
+
if (!Array.isArray(versions)) {
|
|
184
|
+
this.logger.debug(`server response for retrieveMaxApiVersion: ${versions}`);
|
|
185
|
+
throw messages.createError('noApiVersionsError');
|
|
186
|
+
}
|
|
181
187
|
this.logger.debug(`response for org versions: ${versions.map((item) => item.version).join(',')}`);
|
|
182
188
|
const max = (0, ts_types_1.ensure)((0, kit_1.maxBy)(versions, (version) => version.version));
|
|
183
189
|
return max.version;
|
package/messages/connection.md
CHANGED
|
@@ -20,3 +20,11 @@ Connection has no instanceUrl.
|
|
|
20
20
|
# noInstanceUrlError.actions
|
|
21
21
|
|
|
22
22
|
Make sure the instanceUrl is set in your command or config.
|
|
23
|
+
|
|
24
|
+
# noApiVersionsError
|
|
25
|
+
|
|
26
|
+
Org failed to respond with its list of API versions. This is usually the result of domain changes like activating MyDomain or Enhanced Domains
|
|
27
|
+
|
|
28
|
+
# noApiVersionsError.actions
|
|
29
|
+
|
|
30
|
+
Re-authenticate to the org.
|