@salesforce/core 3.33.2 → 3.33.4

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.
@@ -103,6 +103,8 @@ const scratchOrgResume = async (jobId) => {
103
103
  exports.scratchOrgResume = scratchOrgResume;
104
104
  const scratchOrgCreate = async (options) => {
105
105
  const logger = await logger_1.Logger.child('scratchOrgCreate');
106
+ /** epoch milliseconds */
107
+ const startTimestamp = Date.now();
106
108
  logger.debug('scratchOrgCreate');
107
109
  await (0, scratchOrgLifecycleEvents_1.emit)({ stage: 'prepare request' });
108
110
  const { hubOrg, connectedAppConsumerKey, durationDays = 1, nonamespace, noancestors, wait = kit_1.Duration.minutes(exports.DEFAULT_STREAM_TIMEOUT_MINUTES), retry = 0, apiversion, definitionjson, definitionfile, orgConfig, clientSecret = undefined, alias, setDefault = false, tracksSource = true, } = options;
@@ -175,7 +177,9 @@ const scratchOrgCreate = async (options) => {
175
177
  (0, scratchOrgInfoApi_1.resolveUrl)(scratchOrgAuthInfo),
176
178
  (0, scratchOrgInfoApi_1.deploySettings)(scratchOrg, settingsGenerator, apiversion ??
177
179
  configAggregator.getPropertyValue(orgConfigProperties_1.OrgConfigProperties.ORG_API_VERSION) ??
178
- (await scratchOrg.retrieveMaxApiVersion())),
180
+ (await scratchOrg.retrieveMaxApiVersion()),
181
+ // some of our "wait" time has already been used. Calculate how much remains that we can spend on the deployment.
182
+ kit_1.Duration.milliseconds(wait.milliseconds - (Date.now() - startTimestamp))),
179
183
  ]);
180
184
  await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
181
185
  ...{
@@ -58,7 +58,7 @@ export declare const pollForScratchOrgInfo: (hubOrg: Org, scratchOrgInfoId: stri
58
58
  * @param orgSettings an instance of the SettingsGenerator class
59
59
  * @param apiVersion the api version (used when created the package.xml)
60
60
  */
61
- export declare const deploySettings: (scratchOrg: Org, orgSettings: SettingsGenerator, apiVersion: string) => Promise<void>;
61
+ export declare const deploySettings: (scratchOrg: Org, orgSettings: SettingsGenerator, apiVersion: string, timeout?: Duration) => Promise<void>;
62
62
  /**
63
63
  *
64
64
  * @param scratchOrgAuthInfo an AuthInfo class from the scratch org
@@ -325,14 +325,14 @@ exports.pollForScratchOrgInfo = pollForScratchOrgInfo;
325
325
  * @param orgSettings an instance of the SettingsGenerator class
326
326
  * @param apiVersion the api version (used when created the package.xml)
327
327
  */
328
- const deploySettings = async (scratchOrg, orgSettings, apiVersion) => {
328
+ const deploySettings = async (scratchOrg, orgSettings, apiVersion, timeout = kit_1.Duration.minutes(10)) => {
329
329
  const logger = await logger_1.Logger.child('scratchOrgInfoApi-deploySettings');
330
330
  if (orgSettings.hasSettings()) {
331
331
  // deploy the settings to the newly created scratch org
332
332
  logger.debug(`deploying scratch org settings with apiVersion ${apiVersion}`);
333
333
  try {
334
334
  await orgSettings.createDeploy();
335
- await orgSettings.deploySettingsViaFolder(scratchOrg, apiVersion);
335
+ await orgSettings.deploySettingsViaFolder(scratchOrg, apiVersion, timeout);
336
336
  // updating the revision num to zero during org:creation if source members are created during org:create.
337
337
  // This only happens for some specific scratch org definition file.
338
338
  await (0, exports.updateRevisionCounterToZero)(scratchOrg);
@@ -1,3 +1,4 @@
1
+ import { Duration } from '@salesforce/kit';
1
2
  import { JsonMap } from '@salesforce/ts-types';
2
3
  import { ScratchOrgInfo, ObjectSetting } from './scratchOrgTypes';
3
4
  import { Org } from './org';
@@ -65,7 +66,7 @@ export default class SettingsGenerator {
65
66
  /**
66
67
  * Deploys the settings to the org.
67
68
  */
68
- deploySettingsViaFolder(scratchOrg: Org, apiVersion: string): Promise<void>;
69
+ deploySettingsViaFolder(scratchOrg: Org, apiVersion: string, timeout?: Duration): Promise<void>;
69
70
  createDeployPackageContents(apiVersion: string): Promise<void>;
70
71
  getShapeDirName(): string;
71
72
  /**
@@ -181,7 +181,7 @@ class SettingsGenerator {
181
181
  /**
182
182
  * Deploys the settings to the org.
183
183
  */
184
- async deploySettingsViaFolder(scratchOrg, apiVersion) {
184
+ async deploySettingsViaFolder(scratchOrg, apiVersion, timeout = kit_1.Duration.minutes(10)) {
185
185
  const username = scratchOrg.getUsername();
186
186
  const logger = await logger_1.Logger.child('deploySettingsViaFolder');
187
187
  await this.createDeployPackageContents(apiVersion);
@@ -215,7 +215,7 @@ class SettingsGenerator {
215
215
  };
216
216
  }
217
217
  },
218
- timeout: kit_1.Duration.minutes(10),
218
+ timeout,
219
219
  frequency: kit_1.Duration.seconds(1),
220
220
  timeoutErrorName: 'DeployingSettingsTimeoutError',
221
221
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.33.2",
3
+ "version": "3.33.4",
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",
@@ -37,10 +37,10 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@salesforce/bunyan": "^2.0.0",
40
- "@salesforce/kit": "^1.8.0",
40
+ "@salesforce/kit": "^1.9.0",
41
41
  "@salesforce/schemas": "^1.4.0",
42
42
  "@salesforce/ts-types": "^1.7.2",
43
- "@types/graceful-fs": "^4.1.5",
43
+ "@types/graceful-fs": "^4.1.6",
44
44
  "@types/semver": "^7.3.13",
45
45
  "ajv": "^8.11.2",
46
46
  "archiver": "^5.3.0",