@salesforce/core 5.2.3 → 5.2.5
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/util/checkLightningDomain.js +2 -2
- package/lib/util/sfdc.d.ts +4 -0
- package/lib/util/sfdc.js +10 -2
- package/package.json +4 -3
|
@@ -9,12 +9,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const url_1 = require("url");
|
|
10
10
|
const kit_1 = require("@salesforce/kit");
|
|
11
11
|
const myDomainResolver_1 = require("../status/myDomainResolver");
|
|
12
|
-
const
|
|
12
|
+
const sfdcUrl_1 = require("./sfdcUrl");
|
|
13
13
|
async function checkLightningDomain(url) {
|
|
14
14
|
const domain = `https://${/https?:\/\/([^.]*)/.exec(url)?.slice(1, 2).pop()}.lightning.force.com`;
|
|
15
15
|
const quantity = new kit_1.Env().getNumber('SFDX_DOMAIN_RETRY', 240) ?? 0;
|
|
16
16
|
const timeout = new kit_1.Duration(quantity, kit_1.Duration.Unit.SECONDS);
|
|
17
|
-
if (
|
|
17
|
+
if (new sfdcUrl_1.SfdcUrl(url).isInternalUrl() || timeout.seconds === 0) {
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
20
|
const resolver = await myDomainResolver_1.MyDomainResolver.create({
|
package/lib/util/sfdc.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare const validateApiVersion: (value: string) => boolean;
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const validateEmail: (value: string) => boolean;
|
|
22
22
|
/**
|
|
23
|
+
*
|
|
24
|
+
* @deprecated use `new SfdcUrl(url).isInternalUrl()`
|
|
23
25
|
* Tests whether a given url is an internal Salesforce domain
|
|
24
26
|
*
|
|
25
27
|
* @param url
|
|
@@ -38,6 +40,8 @@ export declare const validateSalesforceId: (value: string) => boolean;
|
|
|
38
40
|
*/
|
|
39
41
|
export declare const validatePathDoesNotContainInvalidChars: (value: string) => boolean;
|
|
40
42
|
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
* // TODO: move this to a module-scope function in sfProject
|
|
41
45
|
* Returns the first key within the object that has an upper case first letter.
|
|
42
46
|
*
|
|
43
47
|
* @param data The object in which to check key casing.
|
package/lib/util/sfdc.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.matchesAccessToken = exports.sfdxAuthUrlRegex = exports.accessTokenRegex = exports.findUpperCaseKeys = exports.validatePathDoesNotContainInvalidChars = exports.validateSalesforceId = exports.isInternalUrl = exports.validateEmail = exports.validateApiVersion = exports.trimTo15 = void 0;
|
|
10
10
|
const kit_1 = require("@salesforce/kit");
|
|
11
11
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
|
-
const sfdcUrl_1 = require("./sfdcUrl");
|
|
13
12
|
function trimTo15(id) {
|
|
14
13
|
if (!id) {
|
|
15
14
|
return undefined;
|
|
@@ -35,11 +34,18 @@ exports.validateApiVersion = validateApiVersion;
|
|
|
35
34
|
const validateEmail = (value) => /^[^.][^@]*@[^.]+(\.[^.\s]+)+$/.test(value);
|
|
36
35
|
exports.validateEmail = validateEmail;
|
|
37
36
|
/**
|
|
37
|
+
*
|
|
38
|
+
* @deprecated use `new SfdcUrl(url).isInternalUrl()`
|
|
38
39
|
* Tests whether a given url is an internal Salesforce domain
|
|
39
40
|
*
|
|
40
41
|
* @param url
|
|
41
42
|
*/
|
|
42
|
-
const isInternalUrl = (url) =>
|
|
43
|
+
const isInternalUrl = (url) => {
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
|
|
45
|
+
const SfdcUrl = require('./sfdcUrl');
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
47
|
+
return new SfdcUrl(url).isInternalUrl();
|
|
48
|
+
};
|
|
43
49
|
exports.isInternalUrl = isInternalUrl;
|
|
44
50
|
/**
|
|
45
51
|
* Tests whether a Salesforce ID is in the correct format, a 15- or 18-character length string with only letters and numbers
|
|
@@ -58,6 +64,8 @@ const validatePathDoesNotContainInvalidChars = (value) =>
|
|
|
58
64
|
!/[\["\?<>\|\]]+/.test(value);
|
|
59
65
|
exports.validatePathDoesNotContainInvalidChars = validatePathDoesNotContainInvalidChars;
|
|
60
66
|
/**
|
|
67
|
+
* @deprecated
|
|
68
|
+
* // TODO: move this to a module-scope function in sfProject
|
|
61
69
|
* Returns the first key within the object that has an upper case first letter.
|
|
62
70
|
*
|
|
63
71
|
* @param data The object in which to check key casing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.5",
|
|
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",
|
|
@@ -51,10 +51,11 @@
|
|
|
51
51
|
"jsforce": "^2.0.0-beta.27",
|
|
52
52
|
"jsonwebtoken": "9.0.1",
|
|
53
53
|
"jszip": "3.10.1",
|
|
54
|
-
"pino": "^8.
|
|
54
|
+
"pino": "^8.15.0",
|
|
55
55
|
"pino-abstract-transport": "^1.0.0",
|
|
56
56
|
"pino-pretty": "^10.2.0",
|
|
57
57
|
"proper-lockfile": "^4.1.2",
|
|
58
|
+
"semver": "^7.5.4",
|
|
58
59
|
"ts-retry-promise": "^0.7.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"eslint-config-salesforce-license": "^0.2.0",
|
|
80
81
|
"eslint-config-salesforce-typescript": "^1.1.2",
|
|
81
82
|
"eslint-plugin-header": "^3.1.1",
|
|
82
|
-
"eslint-plugin-import": "^2.28.
|
|
83
|
+
"eslint-plugin-import": "^2.28.1",
|
|
83
84
|
"eslint-plugin-jsdoc": "^43.2.0",
|
|
84
85
|
"husky": "^7.0.4",
|
|
85
86
|
"lodash": "^4.17.21",
|