@salesforce/core 3.20.1 → 3.21.0

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,24 @@
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.21.0](https://github.com/forcedotcom/sfdx-core/compare/v3.20.3...v3.21.0) (2022-06-15)
6
+
7
+ ### Features
8
+
9
+ - add getConnection method to MockTestOrgData ([#600](https://github.com/forcedotcom/sfdx-core/issues/600)) ([a642f28](https://github.com/forcedotcom/sfdx-core/commit/a642f28dc1179552ba5c646c96d2d55f5b6f3f61))
10
+
11
+ ### [3.20.3](https://github.com/forcedotcom/sfdx-core/compare/v3.20.2...v3.20.3) (2022-06-15)
12
+
13
+ ### Bug Fixes
14
+
15
+ - **url:** support sandboxes with enhanced domains enabled ([7c958d1](https://github.com/forcedotcom/sfdx-core/commit/7c958d1f59efc6ef55a7b4c60126603616b21794))
16
+
17
+ ### [3.20.2](https://github.com/forcedotcom/sfdx-core/compare/v3.20.1...v3.20.2) (2022-06-13)
18
+
19
+ ### Bug Fixes
20
+
21
+ - instanceUrl config now using org-instance-url ([54cb450](https://github.com/forcedotcom/sfdx-core/commit/54cb450c53f3db5352d9f0fdb83d33dce1da728e))
22
+
5
23
  ### [3.20.1](https://github.com/forcedotcom/sfdx-core/compare/v3.19.5...v3.20.1) (2022-06-08)
6
24
 
7
25
  ### Features
@@ -562,7 +562,8 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
562
562
  }
563
563
  }
564
564
  getInstanceUrl(options, aggregator) {
565
- const instanceUrl = (0, ts_types_1.getString)(options, 'instanceUrl') || aggregator.getPropertyValue('instanceUrl');
565
+ const instanceUrl = (0, ts_types_1.getString)(options, 'instanceUrl') ||
566
+ aggregator.getPropertyValue(orgConfigProperties_1.OrgConfigProperties.ORG_INSTANCE_URL);
566
567
  return instanceUrl || sfdcUrl_1.SfdcUrl.PRODUCTION;
567
568
  }
568
569
  /**
@@ -3,6 +3,7 @@ import { EventEmitter } from 'events';
3
3
  import * as sinonType from 'sinon';
4
4
  import { AnyJson, JsonMap, Optional } from '@salesforce/ts-types';
5
5
  import { ConfigContents } from './config/configStore';
6
+ import { Connection } from './org/connection';
6
7
  import { Logger } from './logger';
7
8
  import { SfError } from './sfError';
8
9
  import { CometClient, CometSubscription, Message, StreamingExtension } from './status/streamingClient';
@@ -414,6 +415,7 @@ export declare class MockTestOrgData {
414
415
  createUser(user: string): MockTestOrgData;
415
416
  getMockUserInfo(): JsonMap;
416
417
  getConfig(): Promise<AuthFields>;
418
+ getConnection(): Promise<Connection>;
417
419
  }
418
420
  export declare class MockTestSandboxData {
419
421
  id: string;
package/lib/testSetup.js CHANGED
@@ -25,6 +25,7 @@ const sfError_1 = require("./sfError");
25
25
  const sfProject_1 = require("./sfProject");
26
26
  const streamingClient_1 = require("./status/streamingClient");
27
27
  const stateAggregator_1 = require("./stateAggregator");
28
+ const org_1 = require("./org");
28
29
  const sandboxAccessor_1 = require("./stateAggregator/accessors/sandboxAccessor");
29
30
  const aliasesConfig_1 = require("./config/aliasesConfig");
30
31
  const global_1 = require("./global");
@@ -600,6 +601,9 @@ class MockTestOrgData {
600
601
  config.isDevHub = this.isDevHub;
601
602
  return config;
602
603
  }
604
+ async getConnection() {
605
+ return (await org_1.Org.create({ aliasOrUsername: this.username })).getConnection();
606
+ }
603
607
  }
604
608
  exports.MockTestOrgData = MockTestOrgData;
605
609
  class MockTestSandboxData {
@@ -127,6 +127,10 @@ class SfdcUrl extends url_1.URL {
127
127
  if (this.origin.endsWith('.my.salesforce.mil')) {
128
128
  return this.origin.replace('.my.salesforce.mil', '.lightning.crmforce.mil');
129
129
  }
130
+ // enhanced domains
131
+ if (this.origin.endsWith('sandbox.my.salesforce.com')) {
132
+ return this.origin.replace('sandbox.my.salesforce.com', 'sandbox.lightning.force.com');
133
+ }
130
134
  // all non-mil domains
131
135
  return `https://${(0, ts_types_1.ensureArray)(/https?:\/\/([^.]*)/.exec(this.origin))
132
136
  .slice(1, 2)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.20.1",
3
+ "version": "3.21.0",
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",