@salesforce/core-bundle 8.18.0 → 8.18.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/lib/index.d.ts +7 -3
- package/lib/index.js +45 -36
- package/messages/config.md +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -369,7 +369,7 @@ declare module '@salesforce/core-bundle/config/configAggregator' {
|
|
|
369
369
|
*/
|
|
370
370
|
export class ConfigAggregator extends AsyncOptionalCreatable<ConfigAggregator.Options> {
|
|
371
371
|
protected static encrypted: boolean;
|
|
372
|
-
protected static
|
|
372
|
+
protected static instances: Map<string, ConfigAggregator>;
|
|
373
373
|
private static readonly mutex;
|
|
374
374
|
private allowedProperties;
|
|
375
375
|
private readonly localConfig?;
|
|
@@ -382,20 +382,22 @@ declare module '@salesforce/core-bundle/config/configAggregator' {
|
|
|
382
382
|
*/
|
|
383
383
|
constructor(options?: ConfigAggregator.Options);
|
|
384
384
|
private get config();
|
|
385
|
+
static create<T extends ConfigAggregator>(this: new (options?: ConfigAggregator.Options) => T, options?: ConfigAggregator.Options): Promise<T>;
|
|
385
386
|
static create<P extends ConfigAggregator.Options, T extends AsyncOptionalCreatable<P>>(this: new (options?: P) => T, options?: P): Promise<T>;
|
|
386
387
|
/**
|
|
387
388
|
* Clear the cache to force reading from disk.
|
|
389
|
+
* If no projectPath is provided, all instances will be cleared.
|
|
388
390
|
*
|
|
389
391
|
* *NOTE: Only call this method if you must and you know what you are doing.*
|
|
390
392
|
*/
|
|
391
|
-
static clearInstance(): Promise<void>;
|
|
393
|
+
static clearInstance(projectPath?: string): Promise<void>;
|
|
392
394
|
/**
|
|
393
395
|
* Get the info for a given key. If the ConfigAggregator was not asynchronously created OR
|
|
394
396
|
* the {@link ConfigAggregator.reload} was not called, the config value may be encrypted.
|
|
395
397
|
*
|
|
396
398
|
* @param key The config key.
|
|
397
399
|
*/
|
|
398
|
-
static getValue(key: string): ConfigInfo;
|
|
400
|
+
static getValue(key: string, projectPath?: string): ConfigInfo;
|
|
399
401
|
/**
|
|
400
402
|
* Get the static ConfigAggregator instance. If one doesn't exist, one will be created with
|
|
401
403
|
* the **encrypted** config values. Encrypted config values need to be resolved
|
|
@@ -535,6 +537,8 @@ declare module '@salesforce/core-bundle/config/configAggregator' {
|
|
|
535
537
|
}
|
|
536
538
|
type Options = {
|
|
537
539
|
customConfigMeta?: ConfigPropertyMeta[];
|
|
540
|
+
/** an absolute path to the project root */
|
|
541
|
+
projectPath?: string;
|
|
538
542
|
};
|
|
539
543
|
}
|
|
540
544
|
|
package/lib/index.js
CHANGED
|
@@ -8364,19 +8364,19 @@ var require_internal3 = __commonJS({
|
|
|
8364
8364
|
var fs = __importStar2(require("node:fs"));
|
|
8365
8365
|
var node_path_1 = require("node:path");
|
|
8366
8366
|
var messages_12 = require_messages();
|
|
8367
|
-
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "
|
|
8367
|
+
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", 'The config file "%s" is not schema valid.\nDue to: %s'], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", 'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'], ["missingPackageDirectory", 'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'], ["invalidPackageDirectory", 'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", 'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
|
|
8368
8368
|
exports2.SFDX_PROJECT_JSON = "sfdx-project.json";
|
|
8369
8369
|
async function resolveProjectPath(dir = process.cwd()) {
|
|
8370
8370
|
const projectPath = await exports2.traverse.forFile(dir, exports2.SFDX_PROJECT_JSON);
|
|
8371
8371
|
if (!projectPath) {
|
|
8372
|
-
throw messages.createError("invalidProjectWorkspace");
|
|
8372
|
+
throw messages.createError("invalidProjectWorkspace", [dir]);
|
|
8373
8373
|
}
|
|
8374
8374
|
return projectPath;
|
|
8375
8375
|
}
|
|
8376
8376
|
function resolveProjectPathSync(dir = process.cwd()) {
|
|
8377
8377
|
const projectPath = exports2.traverse.forFileSync(dir, exports2.SFDX_PROJECT_JSON);
|
|
8378
8378
|
if (!projectPath) {
|
|
8379
|
-
throw messages.createError("invalidProjectWorkspace");
|
|
8379
|
+
throw messages.createError("invalidProjectWorkspace", [dir]);
|
|
8380
8380
|
}
|
|
8381
8381
|
return projectPath;
|
|
8382
8382
|
}
|
|
@@ -12336,7 +12336,7 @@ var require_package2 = __commonJS({
|
|
|
12336
12336
|
"package.json"(exports2, module2) {
|
|
12337
12337
|
module2.exports = {
|
|
12338
12338
|
name: "@salesforce/core-bundle",
|
|
12339
|
-
version: "8.18.
|
|
12339
|
+
version: "8.18.1",
|
|
12340
12340
|
description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
|
12341
12341
|
main: "lib/index",
|
|
12342
12342
|
types: "lib/index.d.ts",
|
|
@@ -84254,7 +84254,7 @@ var require_orgConfigProperties = __commonJS({
|
|
|
84254
84254
|
var messages_12 = require_messages();
|
|
84255
84255
|
var sfdcUrl_12 = require_sfdcUrl();
|
|
84256
84256
|
var sfdc_1 = require_sfdc();
|
|
84257
|
-
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "
|
|
84257
|
+
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", 'The config file "%s" is not schema valid.\nDue to: %s'], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", 'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'], ["missingPackageDirectory", 'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'], ["invalidPackageDirectory", 'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", 'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
|
|
84258
84258
|
var OrgConfigProperties;
|
|
84259
84259
|
(function(OrgConfigProperties2) {
|
|
84260
84260
|
OrgConfigProperties2["TARGET_ORG"] = "target-org";
|
|
@@ -84386,7 +84386,7 @@ var require_config = __commonJS({
|
|
|
84386
84386
|
var lifecycleEvents_12 = require_lifecycleEvents();
|
|
84387
84387
|
var configFile_12 = require_configFile();
|
|
84388
84388
|
var lwwMap_1 = require_lwwMap();
|
|
84389
|
-
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "
|
|
84389
|
+
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", 'The config file "%s" is not schema valid.\nDue to: %s'], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", 'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'], ["missingPackageDirectory", 'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'], ["invalidPackageDirectory", 'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", 'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
|
|
84390
84390
|
var SFDX_CONFIG_FILE_NAME = "sfdx-config.json";
|
|
84391
84391
|
var CONFIG_FILE_NAME = "config.json";
|
|
84392
84392
|
var SfConfigProperties;
|
|
@@ -84800,6 +84800,7 @@ var require_configAggregator = __commonJS({
|
|
|
84800
84800
|
"use strict";
|
|
84801
84801
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
84802
84802
|
exports2.ConfigAggregator = void 0;
|
|
84803
|
+
var node_path_1 = require("node:path");
|
|
84803
84804
|
var kit_1 = require_lib2();
|
|
84804
84805
|
var ts_types_1 = require_lib();
|
|
84805
84806
|
var messages_12 = require_messages();
|
|
@@ -84807,10 +84808,10 @@ var require_configAggregator = __commonJS({
|
|
|
84807
84808
|
var mutex_1 = require_mutex();
|
|
84808
84809
|
var envVars_12 = require_envVars();
|
|
84809
84810
|
var config_12 = require_config();
|
|
84810
|
-
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "
|
|
84811
|
+
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", 'The config file "%s" is not schema valid.\nDue to: %s'], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", 'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'], ["missingPackageDirectory", 'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'], ["invalidPackageDirectory", 'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", 'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
|
|
84811
84812
|
var ConfigAggregator = class _ConfigAggregator extends kit_1.AsyncOptionalCreatable {
|
|
84812
84813
|
static encrypted = true;
|
|
84813
|
-
static
|
|
84814
|
+
static instances = /* @__PURE__ */ new Map();
|
|
84814
84815
|
static mutex = new mutex_1.Mutex();
|
|
84815
84816
|
// Initialized in loadProperties
|
|
84816
84817
|
allowedProperties;
|
|
@@ -84825,7 +84826,10 @@ var require_configAggregator = __commonJS({
|
|
|
84825
84826
|
constructor(options) {
|
|
84826
84827
|
super(options ?? {});
|
|
84827
84828
|
try {
|
|
84828
|
-
this.localConfig = new config_12.Config(
|
|
84829
|
+
this.localConfig = new config_12.Config({
|
|
84830
|
+
...config_12.Config.getDefaultOptions(false),
|
|
84831
|
+
...options?.projectPath ? { rootFolder: options.projectPath } : {}
|
|
84832
|
+
});
|
|
84829
84833
|
} catch (err) {
|
|
84830
84834
|
if (err.name !== "InvalidProjectWorkspaceError") {
|
|
84831
84835
|
throw err;
|
|
@@ -84837,32 +84841,38 @@ var require_configAggregator = __commonJS({
|
|
|
84837
84841
|
get config() {
|
|
84838
84842
|
return this.resolveProperties(this.globalConfig.getContents(), this.localConfig?.getContents());
|
|
84839
84843
|
}
|
|
84840
|
-
// Use typing from AsyncOptionalCreatable to support extending ConfigAggregator.
|
|
84841
|
-
// We really don't want ConfigAggregator extended but typescript doesn't support a final.
|
|
84842
84844
|
static async create(options) {
|
|
84843
84845
|
return _ConfigAggregator.mutex.lock(async () => {
|
|
84844
|
-
|
|
84845
|
-
if (!
|
|
84846
|
-
|
|
84847
|
-
|
|
84846
|
+
const projectPath = options?.projectPath ? (0, node_path_1.resolve)(options.projectPath) : process.cwd();
|
|
84847
|
+
if (!_ConfigAggregator.instances.has(projectPath)) {
|
|
84848
|
+
const agg = new this(options);
|
|
84849
|
+
_ConfigAggregator.instances.set(projectPath, agg);
|
|
84850
|
+
await agg.init();
|
|
84848
84851
|
}
|
|
84852
|
+
const config = _ConfigAggregator.instances.get(projectPath);
|
|
84849
84853
|
if (_ConfigAggregator.encrypted) {
|
|
84850
84854
|
await config.loadProperties();
|
|
84851
84855
|
}
|
|
84852
84856
|
if (options?.customConfigMeta) {
|
|
84853
84857
|
config_12.Config.addAllowedProperties(options.customConfigMeta);
|
|
84854
84858
|
}
|
|
84855
|
-
return
|
|
84859
|
+
return config;
|
|
84856
84860
|
});
|
|
84857
84861
|
}
|
|
84858
84862
|
/**
|
|
84859
84863
|
* Clear the cache to force reading from disk.
|
|
84864
|
+
* If no projectPath is provided, all instances will be cleared.
|
|
84860
84865
|
*
|
|
84861
84866
|
* *NOTE: Only call this method if you must and you know what you are doing.*
|
|
84862
84867
|
*/
|
|
84863
|
-
static async clearInstance() {
|
|
84868
|
+
static async clearInstance(projectPath) {
|
|
84864
84869
|
return _ConfigAggregator.mutex.lock(() => {
|
|
84865
|
-
|
|
84870
|
+
if (projectPath) {
|
|
84871
|
+
const normalizedPath = (0, node_path_1.resolve)(projectPath);
|
|
84872
|
+
_ConfigAggregator.instances.delete(normalizedPath);
|
|
84873
|
+
} else {
|
|
84874
|
+
_ConfigAggregator.instances.clear();
|
|
84875
|
+
}
|
|
84866
84876
|
_ConfigAggregator.encrypted = true;
|
|
84867
84877
|
});
|
|
84868
84878
|
}
|
|
@@ -84872,22 +84882,22 @@ var require_configAggregator = __commonJS({
|
|
|
84872
84882
|
*
|
|
84873
84883
|
* @param key The config key.
|
|
84874
84884
|
*/
|
|
84875
|
-
static getValue(key) {
|
|
84876
|
-
return this.getInstance().getInfo(key);
|
|
84885
|
+
static getValue(key, projectPath) {
|
|
84886
|
+
return this.getInstance(projectPath ?? process.cwd()).getInfo(key);
|
|
84877
84887
|
}
|
|
84878
84888
|
/**
|
|
84879
84889
|
* Get the static ConfigAggregator instance. If one doesn't exist, one will be created with
|
|
84880
84890
|
* the **encrypted** config values. Encrypted config values need to be resolved
|
|
84881
84891
|
* asynchronously by calling {@link ConfigAggregator.reload}
|
|
84882
84892
|
*/
|
|
84883
|
-
|
|
84884
|
-
|
|
84885
|
-
|
|
84886
|
-
|
|
84887
|
-
_ConfigAggregator.instance
|
|
84888
|
-
|
|
84893
|
+
static getInstance(projectPath = process.cwd()) {
|
|
84894
|
+
const normalizedPath = (0, node_path_1.resolve)(projectPath);
|
|
84895
|
+
if (!_ConfigAggregator.instances.has(normalizedPath)) {
|
|
84896
|
+
const instance = new _ConfigAggregator({ projectPath: normalizedPath });
|
|
84897
|
+
_ConfigAggregator.instances.set(normalizedPath, instance);
|
|
84898
|
+
instance.loadPropertiesSync();
|
|
84889
84899
|
}
|
|
84890
|
-
return _ConfigAggregator.
|
|
84900
|
+
return _ConfigAggregator.instances.get(normalizedPath);
|
|
84891
84901
|
}
|
|
84892
84902
|
/**
|
|
84893
84903
|
* Initialize this instances async dependencies.
|
|
@@ -85115,13 +85125,12 @@ var require_configAggregator = __commonJS({
|
|
|
85115
85125
|
if (value)
|
|
85116
85126
|
this.envVars[key] = value;
|
|
85117
85127
|
}
|
|
85118
|
-
|
|
85119
|
-
|
|
85120
|
-
|
|
85121
|
-
|
|
85122
|
-
|
|
85123
|
-
|
|
85124
|
-
return configs.filter(ts_types_1.isJsonMap).reduce((acc, el) => (0, kit_1.merge)(acc, el), json);
|
|
85128
|
+
return [
|
|
85129
|
+
globalConfig,
|
|
85130
|
+
...localConfig ? [localConfig] : [],
|
|
85131
|
+
// We might not be in a project workspace
|
|
85132
|
+
this.envVars
|
|
85133
|
+
].filter(ts_types_1.isJsonMap).reduce((acc, el) => (0, kit_1.merge)(acc, el), {});
|
|
85125
85134
|
}
|
|
85126
85135
|
};
|
|
85127
85136
|
exports2.ConfigAggregator = ConfigAggregator;
|
|
@@ -93395,7 +93404,7 @@ var require_sfProject = __commonJS({
|
|
|
93395
93404
|
var sfError_12 = require_sfError();
|
|
93396
93405
|
var messages_12 = require_messages();
|
|
93397
93406
|
var findUppercaseKeys_1 = require_findUppercaseKeys();
|
|
93398
|
-
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "
|
|
93407
|
+
var messages = new messages_12.Messages("@salesforce/core-bundle", "config", /* @__PURE__ */ new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", 'The config file "%s" is not schema valid.\nDue to: %s'], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", 'In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ "path": "packageDirectory1", "default": true }, { "path": "packageDirectory2" }]`'], ["missingPackageDirectory", 'The path "%s", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root.'], ["invalidPackageDirectory", 'The path "%s", specified in sfdx-project.json, must be indicated as a relative path to the project root.'], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", 'The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `"default": false` key and try again.'], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
|
|
93399
93408
|
var SfProjectJson = class _SfProjectJson extends configFile_12.ConfigFile {
|
|
93400
93409
|
/** json properties that are uppercase, or allow uppercase keys inside them */
|
|
93401
93410
|
static BLOCKLIST = ["packageAliases", "plugins"];
|
|
@@ -123028,7 +123037,7 @@ var require_testSetup = __commonJS({
|
|
|
123028
123037
|
testContext.configStubs = {};
|
|
123029
123038
|
stateAggregator_12.StateAggregator.clearInstance();
|
|
123030
123039
|
sfProject_12.SfProject.clearInstances();
|
|
123031
|
-
|
|
123040
|
+
configAggregator_12.ConfigAggregator.instances.clear();
|
|
123032
123041
|
};
|
|
123033
123042
|
exports2.restoreContext = restoreContext;
|
|
123034
123043
|
exports2.unexpectedResult = new sfError_12.SfError("This code was expected to fail", "UnexpectedResult");
|
package/messages/config.md
CHANGED