@salesforce/core 3.8.0 → 3.8.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,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
+ ### [3.8.1](https://github.com/forcedotcom/sfdx-core/compare/v3.8.0...v3.8.1) (2022-03-18)
6
+
7
+ ### Bug Fixes
8
+
9
+ - adjust mock org test data to conform to v3 ([38faf50](https://github.com/forcedotcom/sfdx-core/commit/38faf5063931955066312c24b4188b12c40098a5))
10
+ - side effects function should not save when no changes ([#541](https://github.com/forcedotcom/sfdx-core/issues/541)) ([6bfb841](https://github.com/forcedotcom/sfdx-core/commit/6bfb84172fdf74882102b9ffc6e6fbfe58e6ffbc))
11
+
5
12
  ## [3.8.0](https://github.com/forcedotcom/sfdx-core/compare/v3.7.9...v3.8.0) (2022-03-09)
6
13
 
7
14
  ### Features
@@ -232,7 +232,7 @@ export declare class AuthInfo extends AsyncOptionalCreatable<AuthInfo.Options> {
232
232
  getSfdxAuthUrl(): string;
233
233
  /**
234
234
  * Convenience function to handle typical side effects encountered when dealing with an AuthInfo.
235
- * Given the values supplied in parameter sideEffects, this functions will set auth alias, default auth
235
+ * Given the values supplied in parameter sideEffects, this function will set auth alias, default auth
236
236
  * and default dev hub.
237
237
  *
238
238
  * @param sideEffects - instance of AuthSideEffects
@@ -400,19 +400,21 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
400
400
  }
401
401
  /**
402
402
  * Convenience function to handle typical side effects encountered when dealing with an AuthInfo.
403
- * Given the values supplied in parameter sideEffects, this functions will set auth alias, default auth
403
+ * Given the values supplied in parameter sideEffects, this function will set auth alias, default auth
404
404
  * and default dev hub.
405
405
  *
406
406
  * @param sideEffects - instance of AuthSideEffects
407
407
  */
408
408
  async handleAliasAndDefaultSettings(sideEffects) {
409
- if (sideEffects.alias)
410
- await this.setAlias(sideEffects.alias);
411
- if (sideEffects.setDefault)
412
- await this.setAsDefault({ org: true });
413
- if (sideEffects.setDefaultDevHub)
414
- await this.setAsDefault({ devHub: true });
415
- await this.save();
409
+ if (sideEffects.alias || sideEffects.setDefault || sideEffects.setDefaultDevHub) {
410
+ if (sideEffects.alias)
411
+ await this.setAlias(sideEffects.alias);
412
+ if (sideEffects.setDefault)
413
+ await this.setAsDefault({ org: true });
414
+ if (sideEffects.setDefaultDevHub)
415
+ await this.setAsDefault({ devHub: true });
416
+ await this.save();
417
+ }
416
418
  }
417
419
  /**
418
420
  * Set the target-env (default) or the target-dev-hub to the alias if
@@ -377,7 +377,8 @@ export declare class StreamingMockCometClient extends CometClient {
377
377
  */
378
378
  export declare class MockTestOrgData {
379
379
  testId: string;
380
- alias?: string;
380
+ aliases?: string[];
381
+ configs?: string[];
381
382
  username: string;
382
383
  devHubUsername?: string;
383
384
  orgId: string;
@@ -390,6 +391,9 @@ export declare class MockTestOrgData {
390
391
  refreshToken: string;
391
392
  userId: string;
392
393
  redirectUri: string;
394
+ isDevHub?: boolean;
395
+ isScratchOrg?: boolean;
396
+ isExpired?: boolean | 'unknown';
393
397
  constructor(id?: string, options?: {
394
398
  username: string;
395
399
  });
package/lib/testSetup.js CHANGED
@@ -493,12 +493,13 @@ class MockTestOrgData {
493
493
  this.devHubUsername = username;
494
494
  }
495
495
  makeDevHub() {
496
- (0, kit_1.set)(this, 'isDevHub', true);
496
+ this.isDevHub = true;
497
497
  }
498
498
  createUser(user) {
499
499
  const userMock = new MockTestOrgData();
500
500
  userMock.username = user;
501
- userMock.alias = this.alias;
501
+ userMock.aliases = this.aliases;
502
+ userMock.configs = this.configs;
502
503
  userMock.devHubUsername = this.devHubUsername;
503
504
  userMock.orgId = this.orgId;
504
505
  userMock.loginUrl = this.loginUrl;
@@ -506,6 +507,9 @@ class MockTestOrgData {
506
507
  userMock.clientId = this.clientId;
507
508
  userMock.clientSecret = this.clientSecret;
508
509
  userMock.redirectUri = this.redirectUri;
510
+ userMock.isDevHub = this.isDevHub;
511
+ userMock.isScratchOrg = this.isScratchOrg;
512
+ userMock.isExpired = this.isExpired;
509
513
  return userMock;
510
514
  }
511
515
  getMockUserInfo() {
@@ -513,7 +517,8 @@ class MockTestOrgData {
513
517
  Id: this.userId,
514
518
  Username: this.username,
515
519
  LastName: `user_lastname_${this.testId}`,
516
- Alias: this.alias || 'user_alias_blah',
520
+ Alias: this.aliases ? this.aliases[0] : 'user_alias_blah',
521
+ Configs: this.configs,
517
522
  TimeZoneSidKey: `user_timezonesidkey_${this.testId}`,
518
523
  LocaleSidKey: `user_localesidkey_${this.testId}`,
519
524
  EmailEncodingKey: `user_emailencodingkey_${this.testId}`,
@@ -540,14 +545,10 @@ class MockTestOrgData {
540
545
  config.createdOrgInstance = 'CS1';
541
546
  config.created = '1519163543003';
542
547
  config.userId = this.userId;
543
- // config.devHubUsername = 'tn@su-blitz.org';
544
548
  if (this.devHubUsername) {
545
549
  config.devHubUsername = this.devHubUsername;
546
550
  }
547
- const isDevHub = (0, ts_types_1.getBoolean)(this, 'isDevHub');
548
- if (isDevHub) {
549
- config.isDevHub = isDevHub;
550
- }
551
+ config.isDevHub = this.isDevHub;
551
552
  return config;
552
553
  }
553
554
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.8.0",
3
+ "version": "3.8.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",