@salesforce/core 6.7.0 → 6.7.2
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/lib/{exported.js → index.js} +1 -1
- package/lib/org/authInfo.js +4 -2
- package/lib/util/checkLightningDomain.d.ts +1 -0
- package/lib/util/checkLightningDomain.js +1 -0
- package/lib/util/lockRetryOptions.js +2 -2
- package/lib/util/sfdcUrl.js +6 -1
- package/lib/util/time.js +1 -1
- package/lib/webOAuthServer.js +4 -0
- package/package.json +5 -5
- /package/lib/{exported.d.ts → index.d.ts} +0 -0
|
@@ -111,4 +111,4 @@ var scratchOrgCache_1 = require("./org/scratchOrgCache");
|
|
|
111
111
|
Object.defineProperty(exports, "ScratchOrgCache", { enumerable: true, get: function () { return scratchOrgCache_1.ScratchOrgCache; } });
|
|
112
112
|
// Utility sub-modules
|
|
113
113
|
__exportStar(require("./util/sfdc"), exports);
|
|
114
|
-
//# sourceMappingURL=
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
package/lib/org/authInfo.js
CHANGED
|
@@ -210,8 +210,10 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
|
|
|
210
210
|
* @param options The options to generate the URL.
|
|
211
211
|
*/
|
|
212
212
|
static getAuthorizationUrl(options, oauth2) {
|
|
213
|
-
//
|
|
214
|
-
options.useVerifier
|
|
213
|
+
// Unless explicitly turned off, use a code verifier for enhanced security
|
|
214
|
+
if (options.useVerifier !== false) {
|
|
215
|
+
options.useVerifier = true;
|
|
216
|
+
}
|
|
215
217
|
const oauth2Verifier = oauth2 ?? new jsforce_1.OAuth2(options);
|
|
216
218
|
// The state parameter allows the redirectUri callback listener to ignore request
|
|
217
219
|
// that don't contain the state value.
|
|
@@ -10,6 +10,7 @@ const node_url_1 = require("node:url");
|
|
|
10
10
|
const kit_1 = require("@salesforce/kit");
|
|
11
11
|
const myDomainResolver_1 = require("../status/myDomainResolver");
|
|
12
12
|
const sfdcUrl_1 = require("./sfdcUrl");
|
|
13
|
+
/** @deprecated. Use sfdcUrl.checkLightningdomain */
|
|
13
14
|
async function checkLightningDomain(url) {
|
|
14
15
|
const domain = `https://${/https?:\/\/([^.]*)/.exec(url)?.slice(1, 2).pop()}.lightning.force.com`;
|
|
15
16
|
const quantity = new kit_1.Env().getNumber('SFDX_DOMAIN_RETRY', 240) ?? 0;
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.lockRetryOptions = exports.lockOptions = void 0;
|
|
10
10
|
// docs: https://github.com/moxystudio/node-proper-lockfile
|
|
11
|
-
exports.lockOptions = { stale:
|
|
11
|
+
exports.lockOptions = { stale: 10_000 };
|
|
12
12
|
exports.lockRetryOptions = {
|
|
13
13
|
...exports.lockOptions,
|
|
14
|
-
retries: { retries: 10, maxTimeout:
|
|
14
|
+
retries: { retries: 10, maxTimeout: 1_000, factor: 2 },
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=lockRetryOptions.js.map
|
package/lib/util/sfdcUrl.js
CHANGED
|
@@ -90,6 +90,7 @@ class SfdcUrl extends node_url_1.URL {
|
|
|
90
90
|
'.salesforceliveagent.com',
|
|
91
91
|
'.secure.force.com',
|
|
92
92
|
'crmforce.mil',
|
|
93
|
+
'.sfcrmproducts.cn',
|
|
93
94
|
];
|
|
94
95
|
const allowlistOfSalesforceHosts = ['developer.salesforce.com', 'trailhead.salesforce.com'];
|
|
95
96
|
return allowlistOfSalesforceDomainPatterns.some((pattern) => this.hostname.endsWith(pattern) || allowlistOfSalesforceHosts.includes(this.hostname));
|
|
@@ -135,6 +136,10 @@ class SfdcUrl extends node_url_1.URL {
|
|
|
135
136
|
if (this.origin.endsWith('.my-salesforce.com')) {
|
|
136
137
|
return this.origin.replace('.my-salesforce.com', '.my-lightning.com');
|
|
137
138
|
}
|
|
139
|
+
// CN Specific domains for Alibaba Cloud
|
|
140
|
+
if (this.origin.endsWith('.my.sfcrmproducts.cn')) {
|
|
141
|
+
return this.origin.replace('.my.sfcrmproducts.cn', '.lightning.sfcrmapps.cn');
|
|
142
|
+
}
|
|
138
143
|
// all non-mil domains
|
|
139
144
|
return `https://${(0, ts_types_1.ensureArray)(/https?:\/\/([^.]*)/.exec(this.origin))
|
|
140
145
|
.slice(1, 2)
|
|
@@ -185,7 +190,7 @@ class SfdcUrl extends node_url_1.URL {
|
|
|
185
190
|
* @returns {boolean} true if this domain is a lightning domain
|
|
186
191
|
*/
|
|
187
192
|
isLightningDomain() {
|
|
188
|
-
return this.origin.includes('.lightning.force.com') || this.origin.includes('.lightning.crmforce.mil');
|
|
193
|
+
return this.origin.includes('.lightning.force.com') || this.origin.includes('.lightning.crmforce.mil') || this.origin.includes('.lightning.sfcrmapps.cn');
|
|
189
194
|
}
|
|
190
195
|
}
|
|
191
196
|
exports.SfdcUrl = SfdcUrl;
|
package/lib/util/time.js
CHANGED
|
@@ -8,6 +8,6 @@ exports.nowBigInt = void 0;
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
11
|
-
const nowBigInt = () => BigInt((node_perf_hooks_1.performance.now() + node_perf_hooks_1.performance.timeOrigin) *
|
|
11
|
+
const nowBigInt = () => BigInt((node_perf_hooks_1.performance.now() + node_perf_hooks_1.performance.timeOrigin) * 1_000_000);
|
|
12
12
|
exports.nowBigInt = nowBigInt;
|
|
13
13
|
//# sourceMappingURL=time.js.map
|
package/lib/webOAuthServer.js
CHANGED
|
@@ -155,6 +155,9 @@ class WebOAuthServer extends kit_1.AsyncCreatable {
|
|
|
155
155
|
this.oauthConfig.loginUrl = authInfo_1.AuthInfo.getDefaultInstanceUrl();
|
|
156
156
|
if (!this.oauthConfig.redirectUri)
|
|
157
157
|
this.oauthConfig.redirectUri = `http://localhost:${port}/OauthRedirect`;
|
|
158
|
+
// Unless explicitly turned off, use a code verifier as a best practice
|
|
159
|
+
if (this.oauthConfig.useVerifier !== false)
|
|
160
|
+
this.oauthConfig.useVerifier = true;
|
|
158
161
|
this.webServer = await WebServer.create({ port });
|
|
159
162
|
this.oauth2 = new jsforce_1.OAuth2(this.oauthConfig);
|
|
160
163
|
this.authUrl = authInfo_1.AuthInfo.getAuthorizationUrl(this.oauthConfig, this.oauth2);
|
|
@@ -250,6 +253,7 @@ class WebOAuthServer extends kit_1.AsyncCreatable {
|
|
|
250
253
|
this.logger.debug(`oauthConfig.loginUrl: ${this.oauthConfig.loginUrl}`);
|
|
251
254
|
this.logger.debug(`oauthConfig.clientId: ${this.oauthConfig.clientId}`);
|
|
252
255
|
this.logger.debug(`oauthConfig.redirectUri: ${this.oauthConfig.redirectUri}`);
|
|
256
|
+
this.logger.debug(`oauthConfig.useVerifier: ${this.oauthConfig.useVerifier}`);
|
|
253
257
|
return authCode;
|
|
254
258
|
}
|
|
255
259
|
return null;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.2",
|
|
4
4
|
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
|
5
|
-
"main": "lib/
|
|
6
|
-
"types": "lib/
|
|
5
|
+
"main": "lib/index",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=18.0.0"
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"@salesforce/ts-sinon": "^1.4.19",
|
|
63
63
|
"@types/benchmark": "^2.1.5",
|
|
64
64
|
"@types/chai-string": "^1.4.5",
|
|
65
|
-
"@types/jsonwebtoken": "9.0.
|
|
65
|
+
"@types/jsonwebtoken": "9.0.6",
|
|
66
66
|
"@types/proper-lockfile": "^4.1.4",
|
|
67
67
|
"benchmark": "^2.1.4",
|
|
68
68
|
"chai-string": "^1.5.0",
|
|
69
69
|
"ts-node": "^10.9.2",
|
|
70
70
|
"ts-patch": "^3.1.1",
|
|
71
|
-
"typescript": "^5.
|
|
71
|
+
"typescript": "^5.4.2"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|
|
File without changes
|