@salesforce/core 3.18.2 → 3.19.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 CHANGED
@@ -2,6 +2,23 @@
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
+ ### [3.19.1](https://github.com/forcedotcom/sfdx-core/compare/v3.19.0...v3.19.1) (2022-05-27)
6
+
7
+ ### Bug Fixes
8
+
9
+ - env var resolution in ConfigAggregator ([#590](https://github.com/forcedotcom/sfdx-core/issues/590)) ([a65cfbd](https://github.com/forcedotcom/sfdx-core/commit/a65cfbdd0e2a6c3806aa4da3270b237f68b37133))
10
+
11
+ ## [3.19.0](https://github.com/forcedotcom/sfdx-core/compare/v3.18.3...v3.19.0) (2022-05-20)
12
+
13
+ ### Features
14
+
15
+ - missing prop and logic correction ([debe97e](https://github.com/forcedotcom/sfdx-core/commit/debe97e08f54bbd55edd2cb5b18e9d14abd3652f))
16
+ - property on org with inteligent defaults and handling of undefined ([e7295d3](https://github.com/forcedotcom/sfdx-core/commit/e7295d38f2b8defdb54a77e61b4ef8862e5398f9))
17
+ - tracking property on AuthFields ([2243d34](https://github.com/forcedotcom/sfdx-core/commit/2243d345c5cc81bd637c889adbe1db6eae6c93fc))
18
+ - tracksSource in TestSetup mock ([7544c60](https://github.com/forcedotcom/sfdx-core/commit/7544c604bd4a32d21d105e8472f41b2d37fbf601))
19
+
20
+ ### [3.18.3](https://github.com/forcedotcom/sfdx-core/compare/v3.18.2...v3.18.3) (2022-05-20)
21
+
5
22
  ### [3.18.2](https://github.com/forcedotcom/sfdx-core/compare/v3.18.1...v3.18.2) (2022-05-17)
6
23
 
7
24
  ### Bug Fixes
@@ -1,5 +1,5 @@
1
1
  import { AsyncOptionalCreatable } from '@salesforce/kit';
2
- import { AnyJson, JsonMap, Optional } from '@salesforce/ts-types';
2
+ import { AnyJson, Dictionary, JsonMap, Optional } from '@salesforce/ts-types';
3
3
  import { Config, ConfigPropertyMeta } from './config';
4
4
  /**
5
5
  * Information about a config property.
@@ -161,7 +161,7 @@ export declare class ConfigAggregator extends AsyncOptionalCreatable<ConfigAggre
161
161
  /**
162
162
  * Get the config properties that are environment variables.
163
163
  */
164
- getEnvVars(): Map<string, string>;
164
+ getEnvVars(): Dictionary<string>;
165
165
  /**
166
166
  * Re-read all property configurations from disk.
167
167
  */
@@ -37,6 +37,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
37
37
  */
38
38
  constructor(options) {
39
39
  super(options || {});
40
+ this.envVars = {};
40
41
  // Don't throw an project error with the aggregator, since it should resolve to global if
41
42
  // there is no project.
42
43
  try {
@@ -107,7 +108,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
107
108
  */
108
109
  getPropertyValue(key) {
109
110
  if (this.getAllowedProperties().some((element) => key === element.key)) {
110
- return this.getConfig()[key] || this.getEnvVars().get(key);
111
+ return this.getConfig()[key];
111
112
  }
112
113
  else {
113
114
  throw messages.createError('unknownConfigKey', [key]);
@@ -164,7 +165,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
164
165
  * @param key The key of the property.
165
166
  */
166
167
  getLocation(key) {
167
- if (this.getEnvVars().get(key) != null) {
168
+ if (this.envVars[key] != null) {
168
169
  return "Environment" /* ENVIRONMENT */;
169
170
  }
170
171
  if (this.localConfig && this.localConfig.get(key)) {
@@ -189,8 +190,8 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
189
190
  * @param key The key of the property.
190
191
  */
191
192
  getPath(key) {
192
- if (this.envVars.getString(key) != null) {
193
- return `$${this.envVars.propertyToEnvName(key)}`;
193
+ if (this.envVars[key] != null) {
194
+ return `$${envVars_1.EnvVars.propertyToEnvName(key)}`;
194
195
  }
195
196
  if (this.localConfig && this.localConfig.getContents()[key] != null) {
196
197
  return this.localConfig.getPath();
@@ -239,7 +240,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
239
240
  * Get the config properties that are environment variables.
240
241
  */
241
242
  getEnvVars() {
242
- return this.envVars.asMap();
243
+ return this.envVars;
243
244
  }
244
245
  /**
245
246
  * Re-read all property configurations from disk.
@@ -287,9 +288,12 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
287
288
  this.resolveProperties(this.globalConfig.readSync(), this.localConfig && this.localConfig.readSync());
288
289
  }
289
290
  resolveProperties(globalConfig, localConfig) {
290
- this.envVars = new envVars_1.EnvVars();
291
+ const envVars = new envVars_1.EnvVars();
291
292
  for (const property of this.getAllowedProperties()) {
292
- this.envVars.setPropertyFromEnv(property.key);
293
+ const key = property.newKey ? property.newKey : property.key;
294
+ const value = envVars.getPropertyFromEnv(property.key);
295
+ if (value)
296
+ this.envVars[key] = value;
293
297
  }
294
298
  // Global config must be read first so it is on the left hand of the
295
299
  // object assign and is overwritten by the local config.
@@ -298,7 +302,7 @@ class ConfigAggregator extends kit_1.AsyncOptionalCreatable {
298
302
  if (localConfig) {
299
303
  configs.push(localConfig);
300
304
  }
301
- configs.push(this.envVars.asDictionary());
305
+ configs.push(this.envVars);
302
306
  const json = {};
303
307
  const reduced = configs.filter(ts_types_1.isJsonMap).reduce((acc, el) => (0, kit_1.merge)(acc, el), json);
304
308
  return reduced;
@@ -87,10 +87,9 @@ declare type EnvType = {
87
87
  export declare const SUPPORTED_ENV_VARS: EnvType;
88
88
  export declare class EnvVars extends Env {
89
89
  constructor(env?: NodeJS.ProcessEnv);
90
+ static propertyToEnvName(property: string, prefix?: string): string;
90
91
  private static defaultPrefix;
91
- propertyToEnvName(property: string, prefix?: string | undefined): string;
92
- setPropertyFromEnv(property: string, prefix?: string | undefined): void;
93
- getPropertyFromEnv<T>(property: string, prefix?: string | undefined): T | undefined;
92
+ getPropertyFromEnv<T>(property: string, prefix?: string): Nullable<T>;
94
93
  asDictionary(): Dictionary<unknown>;
95
94
  asMap(): Map<string, string>;
96
95
  private resolve;
@@ -337,7 +337,7 @@ exports.SUPPORTED_ENV_VARS = {
337
337
  },
338
338
  [EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT]: {
339
339
  description: getMessage(EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT),
340
- synonymOf: null,
340
+ synonymOf: EnvironmentVariable.SFDX_MAX_QUERY_LIMIT,
341
341
  },
342
342
  [EnvironmentVariable.SF_MDAPI_TEMP_DIR]: {
343
343
  description: getMessage(EnvironmentVariable.SF_MDAPI_TEMP_DIR),
@@ -397,6 +397,9 @@ class EnvVars extends kit_1.Env {
397
397
  super(env);
398
398
  this.resolve();
399
399
  }
400
+ static propertyToEnvName(property, prefix = EnvVars.defaultPrefix()) {
401
+ return `${prefix || ''}${(0, change_case_1.snakeCase)(property).toUpperCase()}`;
402
+ }
400
403
  static defaultPrefix() {
401
404
  if (process.argv[0].startsWith('sfdx'))
402
405
  return 'SFDX_';
@@ -404,19 +407,11 @@ class EnvVars extends kit_1.Env {
404
407
  return 'SF_';
405
408
  return 'SFDX_';
406
409
  }
407
- propertyToEnvName(property, prefix = EnvVars.defaultPrefix()) {
408
- return `${prefix || ''}${(0, change_case_1.snakeCase)(property).toUpperCase()}`;
409
- }
410
- setPropertyFromEnv(property, prefix = EnvVars.defaultPrefix()) {
411
- const envName = this.propertyToEnvName(property, prefix);
412
- const value = this.getString(envName);
413
- if (value) {
414
- this.setString(property, value);
415
- }
416
- }
417
410
  getPropertyFromEnv(property, prefix = EnvVars.defaultPrefix()) {
418
- const envName = this.propertyToEnvName(property, prefix);
419
- return this.get(envName);
411
+ var _a;
412
+ const envName = EnvVars.propertyToEnvName(property, prefix);
413
+ const synonym = (_a = exports.SUPPORTED_ENV_VARS[envName]) === null || _a === void 0 ? void 0 : _a.synonymOf;
414
+ return this.get(envName) || this.get(synonym);
420
415
  }
421
416
  asDictionary() {
422
417
  return this.entries().reduce((accumulator, [key, value]) => {
@@ -6,6 +6,7 @@ export declare type SandboxRequestCacheEntry = {
6
6
  prodOrgUsername: string;
7
7
  sandboxProcessObject: Partial<SandboxProcessObject>;
8
8
  sandboxRequest: Partial<SandboxRequest>;
9
+ tracksSource?: boolean;
9
10
  };
10
11
  export declare class SandboxRequestCache extends TTLConfig<TTLConfig.Options, SandboxRequestCacheEntry> {
11
12
  static getDefaultOptions(): TTLConfig.Options;
@@ -37,6 +37,7 @@ export declare type AuthFields = {
37
37
  usernames?: string[];
38
38
  userProfileName?: string;
39
39
  expirationDate?: string;
40
+ tracksSource?: boolean;
40
41
  };
41
42
  export declare type OrgAuthorization = {
42
43
  orgId: string;
@@ -64,6 +65,7 @@ export declare type AuthSideEffects = {
64
65
  alias?: string;
65
66
  setDefault: boolean;
66
67
  setDefaultDevHub: boolean;
68
+ setTracksSource?: boolean;
67
69
  };
68
70
  /**
69
71
  * A function to update a refresh token when the access token is expired.
@@ -463,14 +463,22 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
463
463
  * @param sideEffects - instance of AuthSideEffects
464
464
  */
465
465
  async handleAliasAndDefaultSettings(sideEffects) {
466
- if (sideEffects.alias || sideEffects.setDefault || sideEffects.setDefaultDevHub) {
466
+ if (sideEffects.alias ||
467
+ sideEffects.setDefault ||
468
+ sideEffects.setDefaultDevHub ||
469
+ typeof sideEffects.setTracksSource === 'boolean') {
467
470
  if (sideEffects.alias)
468
471
  await this.setAlias(sideEffects.alias);
469
472
  if (sideEffects.setDefault)
470
473
  await this.setAsDefault({ org: true });
471
474
  if (sideEffects.setDefaultDevHub)
472
475
  await this.setAsDefault({ devHub: true });
473
- await this.save();
476
+ if (typeof sideEffects.setTracksSource === 'boolean') {
477
+ await this.save({ tracksSource: sideEffects.setTracksSource });
478
+ }
479
+ else {
480
+ await this.save();
481
+ }
474
482
  }
475
483
  }
476
484
  /**
@@ -21,6 +21,7 @@ const sfError_1 = require("../sfError");
21
21
  const sfdc_1 = require("../util/sfdc");
22
22
  const messages_1 = require("../messages");
23
23
  const lifecycleEvents_1 = require("../lifecycleEvents");
24
+ const orgConfigProperties_1 = require("./orgConfigProperties");
24
25
  messages_1.Messages.importMessagesDirectory(__dirname);
25
26
  const messages = messages_1.Messages.load('@salesforce/core', 'connection', [
26
27
  'incorrectAPIVersionError',
@@ -332,7 +333,7 @@ class Connection extends jsforce_1.Connection {
332
333
  async autoFetchQuery(soql, queryOptions = {}) {
333
334
  const config = await configAggregator_1.ConfigAggregator.create();
334
335
  // take the limit from the calling function, then the config, then default 10,000
335
- const maxFetch = config.getInfo('org-max-query-limit').value || queryOptions.maxFetch || 10000;
336
+ const maxFetch = config.getInfo(orgConfigProperties_1.OrgConfigProperties.ORG_MAX_QUERY_LIMIT).value || queryOptions.maxFetch || 10000;
336
337
  const options = Object.assign(queryOptions, {
337
338
  autoFetch: true,
338
339
  maxFetch,
package/lib/org/org.d.ts CHANGED
@@ -119,6 +119,17 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
119
119
  interval?: Duration;
120
120
  async?: boolean;
121
121
  }): Promise<SandboxProcessObject>;
122
+ /**
123
+ *
124
+ * @param sandboxReq SandboxRequest options to create the sandbox with
125
+ * @param sandboxName
126
+ * @param options Wait: The amount of time to wait before timing out, defaults to 0, Interval: The time interval between polling defaults to 30 seconds
127
+ * @returns {SandboxProcessObject} the newly created sandbox process object
128
+ */
129
+ cloneSandbox(sandboxReq: SandboxRequest, sandboxName: string, options: {
130
+ wait?: Duration;
131
+ interval?: Duration;
132
+ }): Promise<SandboxProcessObject>;
122
133
  /**
123
134
  * resume a sandbox creation from a production org
124
135
  * 'this' needs to be a production org with sandbox licenses available
@@ -224,6 +235,17 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
224
235
  * scratch org**. If you need accuracy, use the {@link Org.determineIfScratch} method.
225
236
  */
226
237
  isScratch(): boolean;
238
+ /**
239
+ * Returns `true` if the org uses source tracking.
240
+ * Side effect: updates files where the property doesn't currently exist
241
+ */
242
+ tracksSource(): Promise<boolean>;
243
+ /**
244
+ * Set the tracking property on the org's auth file
245
+ *
246
+ * @param value true or false (whether the org should use source tracking or not)
247
+ */
248
+ setTracksSource(value: boolean): Promise<void>;
227
249
  /**
228
250
  * Returns `true` if the org is a scratch org.
229
251
  *
@@ -517,6 +539,11 @@ export declare namespace Org {
517
539
  /**
518
540
  * The snapshot used to create the scratch org.
519
541
  */
520
- SNAPSHOT = "snapshot"
542
+ SNAPSHOT = "snapshot",
543
+ /**
544
+ * true: the org supports and wants source tracking
545
+ * false: the org opted out of tracking or can't support it
546
+ */
547
+ TRACKS_SOURCE = "tracksSource"
521
548
  }
522
549
  }
package/lib/org/org.js CHANGED
@@ -104,14 +104,14 @@ class Org extends kit_1.AsyncOptionalCreatable {
104
104
  async: false,
105
105
  interval: kit_1.Duration.seconds(30),
106
106
  }) {
107
- this.logger.debug('CreateSandbox called with SandboxRequest:', sandboxReq);
107
+ this.logger.debug(`CreateSandbox called with SandboxRequest: ${sandboxReq}`);
108
108
  const createResult = await this.connection.tooling.create('SandboxInfo', sandboxReq);
109
- this.logger.debug('Return from calling tooling.create:', createResult);
109
+ this.logger.debug(`Return from calling tooling.create: ${createResult}`);
110
110
  if (Array.isArray(createResult) || !createResult.success) {
111
111
  throw messages.createError('sandboxInfoCreateFailed', [JSON.stringify(createResult)]);
112
112
  }
113
113
  const sandboxCreationProgress = await this.querySandboxProcessBySandboxInfoId(createResult.id);
114
- this.logger.debug('Return from calling singleRecordQuery with tooling:', sandboxCreationProgress);
114
+ this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
115
115
  const isAsync = !!options.async;
116
116
  if (isAsync) {
117
117
  // The user didn't want us to poll, so simply return the status
@@ -119,13 +119,25 @@ class Org extends kit_1.AsyncOptionalCreatable {
119
119
  return sandboxCreationProgress;
120
120
  }
121
121
  const [wait, pollInterval] = this.validateWaitOptions(options);
122
- this.logger.debug(`create - pollStatusAndAuth sandboxProcessObj, max wait time of ${wait.minutes} minutes`, sandboxCreationProgress);
122
+ this.logger.debug(`create - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
123
123
  return this.pollStatusAndAuth({
124
124
  sandboxProcessObj: sandboxCreationProgress,
125
125
  wait,
126
126
  pollInterval,
127
127
  });
128
128
  }
129
+ /**
130
+ *
131
+ * @param sandboxReq SandboxRequest options to create the sandbox with
132
+ * @param sandboxName
133
+ * @param options Wait: The amount of time to wait before timing out, defaults to 0, Interval: The time interval between polling defaults to 30 seconds
134
+ * @returns {SandboxProcessObject} the newly created sandbox process object
135
+ */
136
+ async cloneSandbox(sandboxReq, sandboxName, options) {
137
+ sandboxReq.SourceId = (await this.querySandboxProcessBySandboxName(sandboxName)).Id;
138
+ this.logger.debug('Clone sandbox sourceId %s', sandboxReq.SourceId);
139
+ return this.createSandbox(sandboxReq, options);
140
+ }
129
141
  /**
130
142
  * resume a sandbox creation from a production org
131
143
  * 'this' needs to be a production org with sandbox licenses available
@@ -140,7 +152,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
140
152
  interval: kit_1.Duration.seconds(30),
141
153
  }) {
142
154
  var _a;
143
- this.logger.debug('ResumeSandbox called with ResumeSandboxRequest:', resumeSandboxRequest);
155
+ this.logger.debug(`ResumeSandbox called with ResumeSandboxRequest: ${resumeSandboxRequest}`);
144
156
  let sandboxCreationProgress;
145
157
  // seed the sandboxCreationProgress via the resumeSandboxRequest options
146
158
  if (resumeSandboxRequest.SandboxName) {
@@ -154,7 +166,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
154
166
  (_a = resumeSandboxRequest.SandboxName) !== null && _a !== void 0 ? _a : resumeSandboxRequest.SandboxProcessObjId,
155
167
  ]);
156
168
  }
157
- this.logger.debug('Return from calling singleRecordQuery with tooling:', sandboxCreationProgress);
169
+ this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
158
170
  await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_RESUME, sandboxCreationProgress);
159
171
  const [wait, pollInterval] = this.validateWaitOptions(options);
160
172
  // if wait is 0, return the sandboxCreationProgress immediately
@@ -165,7 +177,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
165
177
  if (sandboxInfo) {
166
178
  await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_AUTH, sandboxInfo);
167
179
  try {
168
- this.logger.debug('sandbox signup complete with', sandboxInfo);
180
+ this.logger.debug(`sandbox signup complete with ${sandboxInfo}`);
169
181
  await this.writeSandboxAuthFile(sandboxCreationProgress, sandboxInfo);
170
182
  return sandboxCreationProgress;
171
183
  }
@@ -177,7 +189,7 @@ class Org extends kit_1.AsyncOptionalCreatable {
177
189
  await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_ASYNC_RESULT, sandboxCreationProgress);
178
190
  throw messages.createError('sandboxCreateNotComplete');
179
191
  }
180
- this.logger.debug(`resume - pollStatusAndAuth sandboxProcessObj, max wait time of ${wait.minutes} minutes`, sandboxCreationProgress);
192
+ this.logger.debug(`resume - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
181
193
  return this.pollStatusAndAuth({
182
194
  sandboxProcessObj: sandboxCreationProgress,
183
195
  wait,
@@ -406,6 +418,41 @@ class Org extends kit_1.AsyncOptionalCreatable {
406
418
  return false;
407
419
  }
408
420
  }
421
+ /**
422
+ * Returns `true` if the org uses source tracking.
423
+ * Side effect: updates files where the property doesn't currently exist
424
+ */
425
+ async tracksSource() {
426
+ // use the property if it exists
427
+ const tracksSource = this.getField(Org.Fields.TRACKS_SOURCE);
428
+ if ((0, ts_types_1.isBoolean)(tracksSource)) {
429
+ return tracksSource;
430
+ }
431
+ // scratch orgs with no property use tracking by default
432
+ if (await this.determineIfScratch()) {
433
+ // save true for next time to avoid checking again
434
+ await this.setTracksSource(true);
435
+ return true;
436
+ }
437
+ if (await this.determineIfSandbox()) {
438
+ // does the sandbox know about the SourceMember object?
439
+ const supportsSourceMembers = await this.supportsSourceTracking();
440
+ await this.setTracksSource(supportsSourceMembers);
441
+ return supportsSourceMembers;
442
+ }
443
+ // any other non-sandbox, non-scratch orgs won't use tracking
444
+ await this.setTracksSource(false);
445
+ return false;
446
+ }
447
+ /**
448
+ * Set the tracking property on the org's auth file
449
+ *
450
+ * @param value true or false (whether the org should use source tracking or not)
451
+ */
452
+ async setTracksSource(value) {
453
+ const originalAuth = await authInfo_1.AuthInfo.create({ username: this.getUsername() });
454
+ originalAuth.handleAliasAndDefaultSettings({ setDefault: false, setDefaultDevHub: false, setTracksSource: value });
455
+ }
409
456
  /**
410
457
  * Returns `true` if the org is a scratch org.
411
458
  *
@@ -644,9 +691,8 @@ class Org extends kit_1.AsyncOptionalCreatable {
644
691
  if (this.isScratch()) {
645
692
  return true;
646
693
  }
647
- const conn = this.getConnection();
648
694
  try {
649
- await conn.tooling.sobject('SourceMember').describe();
695
+ await this.getConnection().tooling.sobject('SourceMember').describe();
650
696
  return true;
651
697
  }
652
698
  catch (err) {
@@ -1195,6 +1241,11 @@ exports.Org = Org;
1195
1241
  * The snapshot used to create the scratch org.
1196
1242
  */
1197
1243
  Fields["SNAPSHOT"] = "snapshot";
1244
+ /**
1245
+ * true: the org supports and wants source tracking
1246
+ * false: the org opted out of tracking or can't support it
1247
+ */
1248
+ Fields["TRACKS_SOURCE"] = "tracksSource";
1198
1249
  // Should it be on org? Leave it off for now, as it might
1199
1250
  // be confusing to the consumer what this actually is.
1200
1251
  // USERNAMES = 'usernames',
@@ -11,6 +11,7 @@ export declare type CachedOptions = {
11
11
  apiVersion?: string;
12
12
  alias?: string;
13
13
  setDefault?: boolean;
14
+ tracksSource?: boolean;
14
15
  };
15
16
  export declare class ScratchOrgCache extends TTLConfig<TTLConfig.Options, CachedOptions> {
16
17
  static getFileName(): string;
@@ -47,6 +47,8 @@ export interface ScratchOrgCreateOptions {
47
47
  alias?: string;
48
48
  /** after complete, set the org as the default */
49
49
  setDefault?: boolean;
50
+ /** do not use source tracking for this org */
51
+ tracksSource?: boolean;
50
52
  }
51
53
  export declare const scratchOrgResume: (jobId: string) => Promise<ScratchOrgCreateResult>;
52
54
  export declare const scratchOrgCreate: (options: ScratchOrgCreateOptions) => Promise<ScratchOrgCreateResult>;
@@ -67,7 +67,7 @@ const scratchOrgResume = async (jobId) => {
67
67
  if (!cache.has(jobId)) {
68
68
  throw messages.createError('CacheMissError', [jobId]);
69
69
  }
70
- const { hubUsername, apiVersion, clientSecret, signupTargetLoginUrlConfig, definitionjson, alias, setDefault } = cache.get(jobId);
70
+ const { hubUsername, apiVersion, clientSecret, signupTargetLoginUrlConfig, definitionjson, alias, setDefault, tracksSource, } = cache.get(jobId);
71
71
  const hubOrg = await org_1.Org.create({ aliasOrUsername: hubUsername });
72
72
  const soi = await (0, scratchOrgInfoApi_1.queryScratchOrgInfo)(hubOrg, jobId);
73
73
  await (0, scratchOrgErrorCodes_1.validateScratchOrgInfoForResume)({ jobId, scratchOrgInfo: soi, cache, hubUsername });
@@ -99,6 +99,7 @@ const scratchOrgResume = async (jobId) => {
99
99
  alias,
100
100
  setDefault: setDefault !== null && setDefault !== void 0 ? setDefault : false,
101
101
  setDefaultDevHub: false,
102
+ setTracksSource: tracksSource !== null && tracksSource !== void 0 ? tracksSource : true,
102
103
  });
103
104
  cache.unset((_c = soi.Id) !== null && _c !== void 0 ? _c : jobId);
104
105
  const authFields = authInfo.getFields();
@@ -117,7 +118,7 @@ const scratchOrgCreate = async (options) => {
117
118
  const logger = await logger_1.Logger.child('scratchOrgCreate');
118
119
  logger.debug('scratchOrgCreate');
119
120
  await (0, scratchOrgLifecycleEvents_1.emit)({ stage: 'prepare request' });
120
- 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, } = options;
121
+ 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;
121
122
  validateDuration(durationDays);
122
123
  validateRetry(retry);
123
124
  const { scratchOrgInfoPayload, ignoreAncestorIds, warnings } = await (0, scratchOrgInfoGenerator_1.getScratchOrgInfoPayload)({
@@ -153,6 +154,7 @@ const scratchOrgCreate = async (options) => {
153
154
  clientSecret,
154
155
  alias,
155
156
  setDefault,
157
+ tracksSource,
156
158
  });
157
159
  await cache.write();
158
160
  logger.debug(`scratch org has recordId ${scratchOrgInfoId}`);
@@ -185,9 +187,12 @@ const scratchOrgCreate = async (options) => {
185
187
  (0, scratchOrgInfoApi_1.deploySettings)(scratchOrg, settingsGenerator, (_c = apiversion !== null && apiversion !== void 0 ? apiversion : new configAggregator_1.ConfigAggregator().getPropertyValue('org-api-version')) !== null && _c !== void 0 ? _c : (await scratchOrg.retrieveMaxApiVersion())),
186
188
  ]);
187
189
  await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
188
- alias,
189
- setDefault,
190
- setDefaultDevHub: false,
190
+ ...{
191
+ alias,
192
+ setDefault,
193
+ setDefaultDevHub: false,
194
+ setTracksSource: tracksSource === false ? false : true,
195
+ },
191
196
  });
192
197
  cache.unset(scratchOrgInfoId);
193
198
  const authFields = authInfo.getFields();
@@ -389,6 +389,7 @@ export declare class MockTestOrgData {
389
389
  authcode: string;
390
390
  accessToken: string;
391
391
  refreshToken: string;
392
+ tracksSource: boolean | undefined;
392
393
  userId: string;
393
394
  redirectUri: string;
394
395
  isDevHub?: boolean;
package/lib/testSetup.js CHANGED
@@ -543,6 +543,7 @@ class MockTestOrgData {
543
543
  config.createdOrgInstance = 'CS1';
544
544
  config.created = '1519163543003';
545
545
  config.userId = this.userId;
546
+ config.tracksSource = this.tracksSource;
546
547
  if (this.devHubUsername) {
547
548
  config.devHubUsername = this.devHubUsername;
548
549
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.18.2",
3
+ "version": "3.19.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",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@salesforce/bunyan": "^2.0.0",
38
- "@salesforce/kit": "^1.5.34",
38
+ "@salesforce/kit": "^1.5.41",
39
39
  "@salesforce/schemas": "^1.1.0",
40
40
  "@salesforce/ts-types": "^1.5.20",
41
41
  "@types/graceful-fs": "^4.1.5",
@@ -49,7 +49,7 @@
49
49
  "form-data": "^4.0.0",
50
50
  "graceful-fs": "^4.2.9",
51
51
  "js2xmlparser": "^4.0.1",
52
- "jsforce": "2.0.0-beta.9",
52
+ "jsforce": "2.0.0-beta.10",
53
53
  "jsonwebtoken": "8.5.1",
54
54
  "mkdirp": "1.0.4",
55
55
  "ts-retry-promise": "^0.6.0"