@salesforce/core-bundle 7.4.0 → 7.4.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/lib/index.d.ts CHANGED
@@ -3942,6 +3942,7 @@ declare module '@salesforce/core-bundle/org/scratchOrgInfoApi' {
3942
3942
  */
3943
3943
  export const deploySettings: (scratchOrg: Org, orgSettings: SettingsGenerator, apiVersion: string, timeout?: Duration) => Promise<void>;
3944
3944
  /**
3945
+ * Makes sure the scratch org's instanceUrl is resolvable (that is, DNS is ready)
3945
3946
  *
3946
3947
  * @param scratchOrgAuthInfo an AuthInfo class from the scratch org
3947
3948
  * @returns AuthInfo
package/lib/index.js CHANGED
@@ -12075,7 +12075,7 @@ var require_package2 = __commonJS({
12075
12075
  "package.json"(exports2, module2) {
12076
12076
  module2.exports = {
12077
12077
  name: "@salesforce/core-bundle",
12078
- version: "7.4.0",
12078
+ version: "7.4.1",
12079
12079
  description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
12080
12080
  main: "lib/index",
12081
12081
  types: "lib/index.d.ts",
@@ -94672,13 +94672,14 @@ var require_scratchOrgInfoApi = __commonJS({
94672
94672
  const logger = await logger_12.Logger.child("scratchOrgInfoApi-resolveUrl");
94673
94673
  const { instanceUrl } = scratchOrgAuthInfo.getFields();
94674
94674
  if (!instanceUrl) {
94675
- const sfError = new sfError_12.SfError("Org does not have instanceUrl");
94676
- sfError.setData({
94677
- orgId: scratchOrgAuthInfo.getFields().orgId,
94678
- username: scratchOrgAuthInfo.getFields().username,
94679
- instanceUrl
94675
+ throw sfError_12.SfError.create({
94676
+ message: "Org does not have instanceUrl",
94677
+ data: {
94678
+ orgId: scratchOrgAuthInfo.getFields().orgId,
94679
+ username: scratchOrgAuthInfo.getFields().username,
94680
+ instanceUrl
94681
+ }
94680
94682
  });
94681
- throw sfError;
94682
94683
  }
94683
94684
  logger.debug(`processScratchOrgInfoResult - resultData.instanceUrl: ${instanceUrl}`);
94684
94685
  const options = {
@@ -107099,10 +107100,12 @@ var require_scratchOrgSettingsGenerator = __commonJS({
107099
107100
  if (status !== RequestStatus.Succeeded.toString()) {
107100
107101
  const componentFailures = (0, ts_types_1.ensureObject)(result.details).componentFailures;
107101
107102
  const failures = (Array.isArray(componentFailures) ? componentFailures : [componentFailures]).map((failure) => `[${failure.problemType}] ${failure.fullName} : ${failure.problem} `).join("\n");
107102
- const error = new sfError_12.SfError(`A scratch org was created with username ${username}, but the settings failed to deploy due to:
107103
- ${failures}`, "ProblemDeployingSettings");
107104
- error.setData(result);
107105
- throw error;
107103
+ throw sfError_12.SfError.create({
107104
+ message: `A scratch org was created with username ${username}, but the settings failed to deploy due to:
107105
+ ${failures}`,
107106
+ name: "ProblemDeployingSettings",
107107
+ data: { ...result, username }
107108
+ });
107106
107109
  }
107107
107110
  }
107108
107111
  async createDeployPackageContents(apiVersion) {
@@ -107426,6 +107429,7 @@ var require_scratchOrgCreate = __commonJS({
107426
107429
  var orgConfigProperties_12 = require_orgConfigProperties();
107427
107430
  var sfProject_12 = require_sfProject();
107428
107431
  var stateAggregator_12 = require_stateAggregator();
107432
+ var sfError_12 = require_sfError();
107429
107433
  var org_12 = require_org();
107430
107434
  var scratchOrgInfoApi_1 = require_scratchOrgInfoApi();
107431
107435
  var scratchOrgSettingsGenerator_12 = __importDefault3(require_scratchOrgSettingsGenerator());
@@ -107479,6 +107483,12 @@ var require_scratchOrgCreate = __commonJS({
107479
107483
  signupTargetLoginUrlConfig,
107480
107484
  retry: 0
107481
107485
  });
107486
+ await setExitCodeIfError(68)(scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107487
+ alias,
107488
+ setDefault: setDefault ?? false,
107489
+ setDefaultDevHub: false,
107490
+ setTracksSource: tracksSource ?? true
107491
+ }));
107482
107492
  const scratchOrg = await org_12.Org.create({ aliasOrUsername: username });
107483
107493
  const configAggregator = await configAggregator_12.ConfigAggregator.create();
107484
107494
  await (0, scratchOrgLifecycleEvents_12.emit)({ stage: "deploy settings", scratchOrgInfo: soi });
@@ -107487,16 +107497,10 @@ var require_scratchOrgCreate = __commonJS({
107487
107497
  capitalizeRecordTypes
107488
107498
  });
107489
107499
  await settingsGenerator.extract({ ...soi, ...definitionjson });
107490
- const [authInfo] = await Promise.all([
107500
+ const [authInfo] = await setExitCodeIfError(68)(Promise.all([
107491
107501
  (0, scratchOrgInfoApi_1.resolveUrl)(scratchOrgAuthInfo),
107492
107502
  (0, scratchOrgInfoApi_1.deploySettings)(scratchOrg, settingsGenerator, apiVersion ?? configAggregator.getPropertyValue(orgConfigProperties_12.OrgConfigProperties.ORG_API_VERSION) ?? await scratchOrg.retrieveMaxApiVersion())
107493
- ]);
107494
- await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107495
- alias,
107496
- setDefault: setDefault ?? false,
107497
- setDefaultDevHub: false,
107498
- setTracksSource: tracksSource ?? true
107499
- });
107503
+ ]));
107500
107504
  cache.unset(soi.Id ?? jobId);
107501
107505
  const authFields = authInfo.getFields();
107502
107506
  await Promise.all([(0, scratchOrgLifecycleEvents_12.emit)({ stage: "done", scratchOrgInfo: soi }), cache.write(), (0, scratchOrgLifecycleEvents_12.emitPostOrgCreate)(authFields)]);
@@ -107573,14 +107577,20 @@ var require_scratchOrgCreate = __commonJS({
107573
107577
  signupTargetLoginUrlConfig,
107574
107578
  retry: retry || 0
107575
107579
  });
107576
- const scratchOrg = await org_12.Org.create({
107577
- aliasOrUsername: soi.Username ?? soi.SignupUsername
107578
- });
107580
+ await setExitCodeIfError(68)(scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107581
+ ...{
107582
+ alias,
107583
+ setDefault,
107584
+ setDefaultDevHub: false,
107585
+ setTracksSource: tracksSource === false ? false : true
107586
+ }
107587
+ }));
107588
+ const scratchOrg = await org_12.Org.create({ aliasOrUsername: soi.Username ?? soi.SignupUsername });
107579
107589
  const username = scratchOrg.getUsername();
107580
107590
  logger.debug(`scratch org username ${username}`);
107581
107591
  await (0, scratchOrgLifecycleEvents_12.emit)({ stage: "deploy settings", scratchOrgInfo: soi });
107582
107592
  const configAggregator = await configAggregator_12.ConfigAggregator.create();
107583
- const [authInfo] = await Promise.all([
107593
+ const [authInfo] = await setExitCodeIfError(68)(Promise.all([
107584
107594
  (0, scratchOrgInfoApi_1.resolveUrl)(scratchOrgAuthInfo),
107585
107595
  (0, scratchOrgInfoApi_1.deploySettings)(
107586
107596
  scratchOrg,
@@ -107589,15 +107599,7 @@ var require_scratchOrgCreate = __commonJS({
107589
107599
  // some of our "wait" time has already been used. Calculate how much remains that we can spend on the deployment.
107590
107600
  kit_1.Duration.milliseconds(wait.milliseconds - (Date.now() - startTimestamp))
107591
107601
  )
107592
- ]);
107593
- await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107594
- ...{
107595
- alias,
107596
- setDefault,
107597
- setDefaultDevHub: false,
107598
- setTracksSource: tracksSource === false ? false : true
107599
- }
107600
- });
107602
+ ]));
107601
107603
  cache.unset(scratchOrgInfoId);
107602
107604
  const authFields = authInfo.getFields();
107603
107605
  await Promise.all([(0, scratchOrgLifecycleEvents_12.emit)({ stage: "done", scratchOrgInfo: soi }), cache.write(), (0, scratchOrgLifecycleEvents_12.emitPostOrgCreate)(authFields)]);
@@ -107621,10 +107623,17 @@ var require_scratchOrgCreate = __commonJS({
107621
107623
  async function getCapitalizeRecordTypesConfig() {
107622
107624
  const configAgg = await configAggregator_12.ConfigAggregator.create();
107623
107625
  const value = configAgg.getInfo("org-capitalize-record-types").value;
107624
- if (value !== void 0)
107625
- return (0, kit_1.toBoolean)(value);
107626
- return value;
107626
+ return value !== void 0 ? (0, kit_1.toBoolean)(value) : void 0;
107627
107627
  }
107628
+ var setExitCodeIfError = (exitCode) => async (p) => {
107629
+ try {
107630
+ return await p;
107631
+ } catch (e) {
107632
+ const sfError = sfError_12.SfError.wrap(e);
107633
+ sfError.exitCode = exitCode;
107634
+ throw sfError;
107635
+ }
107636
+ };
107628
107637
  }
107629
107638
  });
107630
107639
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core-bundle",
3
- "version": "7.4.0",
3
+ "version": "7.4.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",