@salesforce/core 2.35.0 → 2.35.1
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/CHANGELOG.md +7 -0
- package/lib/scratchOrgSettingsGenerator.js +6 -4
- package/lib/user.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.35.1](https://github.com/forcedotcom/sfdx-core/compare/v2.35.0...v2.35.1) (2022-02-10)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- add error message on failed settings deploy ([e218b1e](https://github.com/forcedotcom/sfdx-core/commit/e218b1e40414ea9e4fec256b74224626d96eff4a))
|
|
10
|
+
- prefer instanceUrl for loginUrl on user:create ([#518](https://github.com/forcedotcom/sfdx-core/issues/518)) ([c070a87](https://github.com/forcedotcom/sfdx-core/commit/c070a871861409dea722e85845eeb91f262ab66f))
|
|
11
|
+
|
|
5
12
|
## [2.35.0](https://github.com/forcedotcom/sfdx-core/compare/v2.34.2...v2.35.0) (2022-01-25)
|
|
6
13
|
|
|
7
14
|
### Bug Fixes
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.RequestStatus = void 0;
|
|
10
|
-
// Node
|
|
11
10
|
const path = require("path");
|
|
12
|
-
// @salesforce
|
|
13
11
|
const kit_1 = require("@salesforce/kit");
|
|
14
12
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
13
|
const js2xmlparser = require("js2xmlparser");
|
|
@@ -77,7 +75,7 @@ class SettingsGenerator {
|
|
|
77
75
|
const pollingOptions = {
|
|
78
76
|
async poll() {
|
|
79
77
|
try {
|
|
80
|
-
result = await connection.metadata.checkDeployStatus(id);
|
|
78
|
+
result = await connection.metadata.checkDeployStatus(id, true);
|
|
81
79
|
logger.debug(`Deploy id: ${id} status: ${result.status}`);
|
|
82
80
|
if (breakPolling.includes(result.status)) {
|
|
83
81
|
return {
|
|
@@ -105,7 +103,11 @@ class SettingsGenerator {
|
|
|
105
103
|
const client = await pollingClient_1.PollingClient.create(pollingOptions);
|
|
106
104
|
const status = (await client.subscribe());
|
|
107
105
|
if (status !== RequestStatus.Succeeded) {
|
|
108
|
-
const
|
|
106
|
+
const componentFailures = ts_types_1.ensureObject(result.details).componentFailures;
|
|
107
|
+
const failures = (Array.isArray(componentFailures) ? componentFailures : [componentFailures])
|
|
108
|
+
.map((failure) => failure.problem)
|
|
109
|
+
.join('\n');
|
|
110
|
+
const error = new sfdxError_1.SfdxError(`A scratch org was created with username ${username}, but the settings failed to deploy due to: \n${failures}`, 'ProblemDeployingSettings');
|
|
109
111
|
error.setData(result);
|
|
110
112
|
throw error;
|
|
111
113
|
}
|
package/lib/user.js
CHANGED
|
@@ -280,6 +280,7 @@ class User extends kit_1.AsyncCreatable {
|
|
|
280
280
|
* ```
|
|
281
281
|
*/
|
|
282
282
|
async createUser(fields) {
|
|
283
|
+
var _a;
|
|
283
284
|
// Create a user and get a refresh token
|
|
284
285
|
const refreshTokenSecret = await this.createUserInternal(fields);
|
|
285
286
|
// Create the initial auth info
|
|
@@ -287,7 +288,8 @@ class User extends kit_1.AsyncCreatable {
|
|
|
287
288
|
const adminUserAuthFields = authInfo.getFields(true);
|
|
288
289
|
// Setup oauth options for the new user
|
|
289
290
|
const oauthOptions = {
|
|
290
|
-
|
|
291
|
+
// Communities users require the instance for auth
|
|
292
|
+
loginUrl: (_a = adminUserAuthFields.instanceUrl) !== null && _a !== void 0 ? _a : adminUserAuthFields.loginUrl,
|
|
291
293
|
refreshToken: refreshTokenSecret.buffer.value((buffer) => buffer.toString('utf8')),
|
|
292
294
|
clientId: adminUserAuthFields.clientId,
|
|
293
295
|
clientSecret: adminUserAuthFields.clientSecret,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "2.35.
|
|
3
|
+
"version": "2.35.1",
|
|
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",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"nyc": "^15.1.0",
|
|
83
83
|
"prettier": "^2.0.5",
|
|
84
84
|
"pretty-quick": "^3.1.0",
|
|
85
|
-
"shelljs": "0.8.
|
|
85
|
+
"shelljs": "0.8.5",
|
|
86
86
|
"sinon": "10.0.0",
|
|
87
87
|
"ts-node": "^10.0.0",
|
|
88
88
|
"typescript": "^4.1.3"
|