@salesforce/core 2.28.0 → 2.28.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
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
+ ### [2.28.4](https://github.com/forcedotcom/sfdx-core/compare/v2.28.3...v2.28.4) (2021-11-10)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * bump jsforce types and run unit tests on Windows ([#485](https://github.com/forcedotcom/sfdx-core/issues/485)) ([3952c8f](https://github.com/forcedotcom/sfdx-core/commit/3952c8fe248531a0597477ed12240f611048caba))
11
+
12
+ ### [2.28.3](https://github.com/forcedotcom/sfdx-core/compare/v2.28.2...v2.28.3) (2021-11-08)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * fix unit test ([d903c04](https://github.com/forcedotcom/sfdx-core/commit/d903c04e5f3e4f01fccb3f00b91560c443013ddf))
18
+ * force new release ([124bb74](https://github.com/forcedotcom/sfdx-core/commit/124bb744c5ecc28cb8babf285c6d8c3032eb7ef6))
19
+ * improve error message when providing an invalid username ([2ab4bbd](https://github.com/forcedotcom/sfdx-core/commit/2ab4bbdefd962283d88ccb735de88c88fe189d39))
20
+
21
+ ### [2.28.2](https://github.com/forcedotcom/sfdx-core/compare/v2.28.1...v2.28.2) (2021-10-13)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * support for .mil sandboxes ([9ef35c7](https://github.com/forcedotcom/sfdx-core/commit/9ef35c7b1ef0fe974c3bd3b89b862a436e00f7d9))
27
+
28
+ ### [2.28.1](https://github.com/forcedotcom/sfdx-core/compare/v2.28.0...v2.28.1) (2021-10-06)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * crmforce.mil ([e263d5d](https://github.com/forcedotcom/sfdx-core/commit/e263d5d74be9c0651e5c2676d6eec1c31fca05e4))
34
+
5
35
  ## [2.28.0](https://github.com/forcedotcom/sfdx-core/compare/v2.27.2...v2.28.0) (2021-09-16)
6
36
 
7
37
 
package/lib/authInfo.d.ts CHANGED
@@ -343,5 +343,6 @@ export declare namespace AuthInfo {
343
343
  * creation.
344
344
  */
345
345
  parentUsername?: string;
346
+ isDevHub?: boolean;
346
347
  }
347
348
  }
package/lib/authInfo.js CHANGED
@@ -664,7 +664,10 @@ class AuthInfo extends kit_1.AsyncCreatable {
664
664
  }
665
665
  catch (e) {
666
666
  if (e.code === 'ENOENT') {
667
- throw sfdxError_1.SfdxError.create('@salesforce/core', 'core', 'NamedOrgNotFound', [username]);
667
+ throw sfdxError_1.SfdxError.create('@salesforce/core', 'core', 'NamedOrgNotFound', [
668
+ this.options.isDevHub ? 'devhub username' : 'username',
669
+ username,
670
+ ]);
668
671
  }
669
672
  else {
670
673
  throw e;
package/lib/org.js CHANGED
@@ -402,6 +402,7 @@ class Org extends kit_1.AsyncCreatable {
402
402
  // If no username is provided or resolvable from an alias, AuthInfo will throw an SfdxError.
403
403
  authInfo: await authInfo_1.AuthInfo.create({
404
404
  username: (username != null && (await aliases_1.Aliases.fetch(username))) || username,
405
+ isDevHub: this.options.isDevHub,
405
406
  }),
406
407
  });
407
408
  }
@@ -35,9 +35,10 @@ export declare class SfdcUrl extends URL {
35
35
  * @returns {boolean} true if this is a local machine
36
36
  */
37
37
  isLocalUrl(): boolean;
38
+ toLightningDomain(): string;
38
39
  /**
39
40
  * Tests whether this url has the lightning domain extension
40
- * This method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again untill timeout
41
+ * This method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again until timeout
41
42
  * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
42
43
  *
43
44
  * @returns {Promise<true | never>} The resolved ip address or never
@@ -61,6 +61,7 @@ class SfdcUrl extends url_1.URL {
61
61
  '.salesforce.com',
62
62
  '.salesforceliveagent.com',
63
63
  '.secure.force.com',
64
+ 'crmforce.mil',
64
65
  ];
65
66
  const allowlistOfSalesforceHosts = ['developer.salesforce.com', 'trailhead.salesforce.com'];
66
67
  return allowlistOfSalesforceDomainPatterns.some((pattern) => {
@@ -95,25 +96,31 @@ class SfdcUrl extends url_1.URL {
95
96
  const LOCAL_PARTS = ['localhost.sfdcdev.', '.internal.'];
96
97
  return LOCAL_PARTS.some((part) => this.origin.includes(part));
97
98
  }
99
+ toLightningDomain() {
100
+ if (this.origin.endsWith('.my.salesforce.mil')) {
101
+ return this.origin.replace('.my.salesforce.mil', '.lightning.crmforce.mil');
102
+ }
103
+ // all non-mil domains
104
+ return `https://${ts_types_1.ensureArray(/https?:\/\/([^.]*)/.exec(this.origin))
105
+ .slice(1, 2)
106
+ .pop()}.lightning.force.com`;
107
+ }
98
108
  /**
99
109
  * Tests whether this url has the lightning domain extension
100
- * This method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again untill timeout
110
+ * This method that performs the dns lookup of the host. If the lookup fails the internal polling (1 second), client will try again until timeout
101
111
  * If SFDX_DOMAIN_RETRY environment variable is set (number) it overrides the default timeout duration (240 seconds)
102
112
  *
103
113
  * @returns {Promise<true | never>} The resolved ip address or never
104
114
  * @throws {@link SfdxError} If can't resolve DNS.
105
115
  */
106
116
  async checkLightningDomain() {
107
- const domain = `https://${ts_types_1.ensureArray(/https?:\/\/([^.]*)/.exec(this.origin))
108
- .slice(1, 2)
109
- .pop()}.lightning.force.com`;
110
117
  const quantity = ts_types_1.ensureNumber(new kit_1.Env().getNumber('SFDX_DOMAIN_RETRY', 240));
111
118
  const timeout = new kit_1.Duration(quantity, kit_1.Duration.Unit.SECONDS);
112
119
  if (this.isInternalUrl() || timeout.seconds === 0) {
113
120
  return true;
114
121
  }
115
122
  const resolver = await myDomainResolver_1.MyDomainResolver.create({
116
- url: new url_1.URL(domain),
123
+ url: new url_1.URL(this.toLightningDomain()),
117
124
  timeout,
118
125
  frequency: new kit_1.Duration(1, kit_1.Duration.Unit.SECONDS),
119
126
  });
@@ -145,6 +152,7 @@ class SfdcUrl extends url_1.URL {
145
152
  */
146
153
  isSandboxUrl(createdOrgInstance) {
147
154
  return ((createdOrgInstance && /^cs|s$/gi.test(createdOrgInstance)) ||
155
+ this.origin.endsWith('sandbox.my.salesforce.mil') ||
148
156
  /sandbox\.my\.salesforce\.com/gi.test(this.origin) || // enhanced domains >= 230
149
157
  /(cs[0-9]+(\.my|)\.salesforce\.com)/gi.test(this.origin) || // my domains on CS instance OR CS instance without my domain
150
158
  /([a-z]{3}[0-9]+s\.sfdc-.+\.salesforce\.com)/gi.test(this.origin) || // falcon sandbox ex: usa2s.sfdc-whatever.salesforce.com
@@ -12,9 +12,9 @@
12
12
  "OrgDataNotAvailableErrorAction2": "Use `sfdx force:config:set` to update the defaultusername.",
13
13
  "OrgDataNotAvailableErrorAction3": "Use `sfdx force:org:create` to create a new org.",
14
14
  "OrgDataNotAvailableErrorAction4": "Use `sfdx force:auth` to authenticate an existing org.",
15
- "NamedOrgNotFound": "No AuthInfo found for name %s",
16
- "NoAliasesFound": "Nothing to set",
17
- "InvalidFormat": "Setting aliases must be in the format <key>=<value> but found: [%s]",
15
+ "NamedOrgNotFound": "No authorization information found for %s %s.",
16
+ "NoAliasesFound": "Nothing to set.",
17
+ "InvalidFormat": "Setting aliases must be in the format <key>=<value> but found: [%s].",
18
18
  "NoAuthInfoFound": "No authorization information can be found.",
19
19
  "InvalidJsonCasing": "All JSON input must have heads down camelcase keys. E.g., { sfdcLoginUrl: \"https://login.salesforce.com\" }\nFound \"%s\" at %s"
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "2.28.0",
3
+ "version": "2.28.4",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "license": "BSD-3-Clause",
@@ -8,13 +8,13 @@
8
8
  "build": "sf-build",
9
9
  "ci-docs": "yarn sf-ci-docs",
10
10
  "clean": "sf-clean",
11
- "clean-all": "-clean all",
11
+ "clean-all": "sf-clean all",
12
12
  "compile": "sf-compile",
13
13
  "docs": "sf-docs",
14
14
  "format": "sf-format",
15
15
  "lint": "sf-lint",
16
16
  "lint-fix": "yarn sf-lint --fix",
17
- "postcompile": "tsc -p test; tsc -p typedocExamples",
17
+ "postcompile": "tsc -p test && tsc -p typedocExamples",
18
18
  "prepack": "sf-build",
19
19
  "pretest": "sf-compile-test",
20
20
  "test": "sf-test"
@@ -44,7 +44,7 @@
44
44
  "@salesforce/schemas": "^1.0.1",
45
45
  "@salesforce/ts-types": "^1.5.13",
46
46
  "@types/graceful-fs": "^4.1.5",
47
- "@types/jsforce": "^1.9.29",
47
+ "@types/jsforce": "^1.9.35",
48
48
  "@types/mkdirp": "^1.0.1",
49
49
  "debug": "^3.1.0",
50
50
  "graceful-fs": "^4.2.4",
@@ -57,8 +57,8 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@salesforce/dev-config": "^2.0.0",
60
- "@salesforce/dev-scripts": "^0.6.2",
61
- "@salesforce/prettier-config": "^0.0.1",
60
+ "@salesforce/dev-scripts": "^0.9.18",
61
+ "@salesforce/prettier-config": "^0.0.2",
62
62
  "@salesforce/ts-sinon": "^1.3.15",
63
63
  "@types/debug": "0.0.30",
64
64
  "@types/jsen": "0.0.19",