@salesforce/core 6.4.7 → 6.4.8-dev.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/lib/config/envVars.d.ts +2 -1
- package/lib/config/envVars.js +6 -1
- package/lib/org/orgConfigProperties.d.ts +5 -1
- package/lib/org/orgConfigProperties.js +8 -0
- package/lib/org/scratchOrgCreate.js +3 -1
- package/lib/org/scratchOrgSettingsGenerator.d.ts +3 -1
- package/lib/org/scratchOrgSettingsGenerator.js +14 -9
- package/messages/envVars.md +4 -0
- package/package.json +1 -1
package/lib/config/envVars.d.ts
CHANGED
|
@@ -77,7 +77,8 @@ export declare enum EnvironmentVariable {
|
|
|
77
77
|
'SF_S3_HOST' = "SF_S3_HOST",
|
|
78
78
|
'SF_UPDATE_INSTRUCTIONS' = "SF_UPDATE_INSTRUCTIONS",
|
|
79
79
|
'SF_INSTALLER' = "SF_INSTALLER",
|
|
80
|
-
'SF_ENV' = "SF_ENV"
|
|
80
|
+
'SF_ENV' = "SF_ENV",
|
|
81
|
+
'SF_CAPITALIZE_RECORD_TYPES' = "SF_CAPITALIZE_RECORD_TYPES"
|
|
81
82
|
}
|
|
82
83
|
type EnvMetaData = {
|
|
83
84
|
description: string;
|
package/lib/config/envVars.js
CHANGED
|
@@ -13,7 +13,7 @@ const kit_1 = require("@salesforce/kit");
|
|
|
13
13
|
const messages_1 = require("../messages");
|
|
14
14
|
const lifecycleEvents_1 = require("../lifecycleEvents");
|
|
15
15
|
;
|
|
16
|
-
const messages = new messages_1.Messages('@salesforce/core', 'envVars', new Map([["forceOpenUrl", "Web page that opens in your browser when you connect to an org. For example, to open Lightning Experience, set to \"lightning\"."], ["forceShowSpinner", "Set to true to show a spinner animation on the command line when running asynchronous CLI commands. Default is false."], ["forceSpinnerDelay", "Speed of the spinner in milliseconds. Default is 60."], ["httpProxy", "HTTP URL and port of the proxy server when using Salesforce CLI behind a corporate firewall or web proxy."], ["httpsProxy", "HTTPS URL and port of the proxy server when using Salesforce CLI behind a corporate firewall or web proxy."], ["nodeExtraCaCerts", "Fully qualified path to your self-signed certificate. Will be installed after you run \"sfdx update\"."], ["nodeTlsRejectUnauthorized", "Set to 0 to allow Node.js to use the self-signed certificate in the certificate chain."], ["sfdxAccessToken", "Specifies an access token when using the auth:accesstoken:store command."], ["sfdxApiVersion", "The API version for a specific project or all projects. Default value is the API version of your Dev Hub. Overrides the apiVersion config value."], ["sfdxAudienceUrl", "URL that overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you\u2019re logging into."], ["sfdxCodeCoverageRequirement", "Code coverage percentages that are displayed in green when you run force:apex:test:\\* with the --codecoverage parameter."], ["sfdxContentType", "Set to JSON so that all CLI commands output results in JSON format."], ["sfdxDefaultdevhubusername", "Username or alias of your default Dev Hub org. Overrides the defaultdevhubusername configuration value."], ["sfdxDefaultusername", "Username or alias of your default org. Overrides the defaultusername configuration value."], ["sfdxDisableAutoupdate", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfdxAutoupdateDisable", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfdxDisableSourceMemberPolling", "Set to true to disable polling of your org\u2019s SourceMember object when you run the force:source:push|pull commands. Default value is false."], ["sfdxDisableTelemetry", "Set to true to disable Salesforce CLI from collecting usage information, user environment information, and crash reports. Default value is false. Overrides the disableTelemetry configration variable."], ["sfdxDnsTimeout", "Number of seconds that the force:org:\\* commands wait for a response when checking whether an org is connected. Default value is 3."], ["sfdxDomainRetry", "Time, in seconds, that Salesforce CLI waits for the Lightning Experience custom domain to resolve and become available in a scratch org. Default value is 240."], ["sfdxImprovedCodeCoverage", "Set to true to scope Apex test results to the classes entered during a test run when running force:apex:test:\\*."], ["sfdxInstanceUrl", "URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. Overrides the instanceUrl configuration value."], ["sfdxJsonToStdout", "Set to true to send messages resulting from failed Salesforce CLI commands to stdout instead of stderr."], ["sfdxDisableLogFile", "Set to true to disable log file writing"], ["sfdxLogLevel", "Level of messages that the CLI writes to the log file. Valid values are trace, debug, info, warn, error, fatal. Default value is warn."], ["sfdxLogRotationCount", "The default rotation period for logs. Example '1d' will rotate logs daily (at midnight)."], ["sfdxLogRotationPeriod", "The number of backup rotated log files to keep. Example: '3' will have the base sf.log file, and the past 3 (period) log files."], ["sfdxMaxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default value is 10,000. Overrides the maxQueryLimit configuration value."], ["sfdxMdapiTempDir", "Directory that contains files (in metadata format) when running certain Salesforce CLI commands, such as force:source:\\*."], ["sfdxNpmRegistry", "URL to a private npm server, where all packages that you publish are private."], ["sfdxPrecompileEnable", "Set to true to enable Apex pre-compile before the tests are run with the force:apex:test:run command. Default is false."], ["sfdxProjectAutoupdateDisableForPackageCreate", "Set to true to disable automatic updates to sfdx-project.json when running force:package:create."], ["sfdxProjectAutoupdateDisableForPackageVersionCreate", "Set to true to disable automatic updates to sfdx-project.json when running force:package:version:create."], ["sfdxRestDeploy", "Set to true to make Salesforce CLI use the Metadata REST API for deployments. By default, the CLI uses SOAP."], ["sfdxSourceMemberPollingTimeout", "Number of seconds you want the force:source:push command to keep polling the SourceMember object before the command times out."], ["sfdxUseGenericUnixKeychain", "(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain."], ["sfdxUseProgressBar", "Set to false to disable the progress bar when running force:mdapi:deploy, force:source:deploy, or force:source:push."], ["sfdxLazyLoadModules", "Set to true to enable lazy loading of sfdx modules"], ["sfdxS3Host", "URL to S3 host"], ["sfdxUpdateInstructions", "Text that describes how to update sfdx"], ["sfdxInstaller", "Boolean indicating that the installer is running"], ["sfdxEnv", "Describes if sfdx is in \"demo\" mode"], ["sfTargetOrg", "Username or alias of your default org. Overrides the target-org configuration variable."], ["sfTargetDevHub", "Username or alias of your default Dev Hub org. Overrides the target-dev-hub configuration variable."], ["sfAccessToken", "Specifies an access token when using a login command that uses access tokens."], ["sfOrgApiVersion", "API version for a specific project or all projects. Default value is the API version of your Dev Hub. Overrides the apiVersion configuration variable."], ["sfAudienceUrl", "URL that overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you\u2019re logging into."], ["sfCodeCoverageRequirement", "Code coverage percentages that are displayed in green when you run the Apex test CLIcommands with the --code-coverage flag."], ["sfContentType", "Set to JSON so that all CLI commands output results in JSON format."], ["sfDisableAutoupdate", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfAutoupdateDisable", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfDisableSourceMemberPolling", "Set to true to disable polling of your org\u2019s SourceMember object when you run the commands to push and pull source. Default value is false."], ["sfDisableTelemetry", "Set to true to disable Salesforce CLI from collecting usage information, user environment information, and crash reports. Default value is false. Overrides the disableTelemetry configration variable."], ["sfDnsTimeout", "Number of seconds that the env commands wait for a response when checking whether an org is connected. Default value is 3."], ["sfDomainRetry", "Time, in seconds, that Salesforce CLI waits for the Lightning Experience custom domain to resolve and become available in a scratch org. Default value is 240."], ["sfImprovedCodeCoverage", "Set to true to scope Apex test results to the classes entered during a test run when running the Apex test commands."], ["sfOrgInstanceUrl", "URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. Overrides the instanceUrl configuration variable."], ["sfJsonToStdout", "Set to true to send messages resulting from failed Salesforce CLI commands to stdout instead of stderr."], ["sfDisableLogFile", "Set to true to disable log file writing"], ["sfLogLevel", "Level of messages that the CLI writes to the log file. Valid values are trace, debug, info, warn, error, fatal. Default value is warn."], ["sfLogRotationCount", "The default rotation period for logs. Example '1d' will rotate logs daily (at midnight)."], ["sfLogRotationPeriod", "The number of backup rotated log files to keep. Example: '3' will have the base sf.log file, and the past 3 (period) log files."], ["sfOrgMaxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default value is 10,000. Overrides the maxQueryLimit configuration variable."], ["sfMdapiTempDir", "Directory that contains files (in metadata format) when running certain Salesforce CLI commands."], ["sfNpmRegistry", "URL to a private npm server, where all packages that you publish are private."], ["sfPrecompileEnable", "Set to true to enable Apex pre-compile before the tests are run with the Apex test run command. Default is false."], ["sfProjectAutoupdateDisableForPackageCreate", "Set to true to disable automatic updates to sfdx-project.json when running the package create command."], ["sfProjectAutoupdateDisableForPackageVersionCreate", "Set to true to disable automatic updates to sfdx-project.json when running the package version create command."], ["sfSourceMemberPollingTimeout", "Number of seconds you want the source push command to keep polling the SourceMember object before the command times out."], ["sfUseGenericUnixKeychain", "(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain."], ["sfUseProgressBar", "Set to false to disable the progress bar when running the metadata deploy command."], ["sfLazyLoadModules", "Set to true to enable lazy loading of sf modules"], ["sfS3Host", "URL to S3 host"], ["sfUpdateInstructions", "Text that describes how to update sf"], ["sfInstaller", "Boolean indicating that the installer is running"], ["sfEnv", "Describes if sf is in \"demo\" mode"], ["deprecatedEnv", "Deprecated environment variable: %s. Please use %s instead."], ["deprecatedEnvDisagreement", "Deprecated environment variable: %s. Please use %s instead.\n\nYour environment has both variables populated, and with different values. The value from %s will be used."]]));
|
|
16
|
+
const messages = new messages_1.Messages('@salesforce/core', 'envVars', new Map([["forceOpenUrl", "Web page that opens in your browser when you connect to an org. For example, to open Lightning Experience, set to \"lightning\"."], ["forceShowSpinner", "Set to true to show a spinner animation on the command line when running asynchronous CLI commands. Default is false."], ["forceSpinnerDelay", "Speed of the spinner in milliseconds. Default is 60."], ["httpProxy", "HTTP URL and port of the proxy server when using Salesforce CLI behind a corporate firewall or web proxy."], ["httpsProxy", "HTTPS URL and port of the proxy server when using Salesforce CLI behind a corporate firewall or web proxy."], ["nodeExtraCaCerts", "Fully qualified path to your self-signed certificate. Will be installed after you run \"sfdx update\"."], ["nodeTlsRejectUnauthorized", "Set to 0 to allow Node.js to use the self-signed certificate in the certificate chain."], ["sfdxAccessToken", "Specifies an access token when using the auth:accesstoken:store command."], ["sfdxApiVersion", "The API version for a specific project or all projects. Default value is the API version of your Dev Hub. Overrides the apiVersion config value."], ["sfdxAudienceUrl", "URL that overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you\u2019re logging into."], ["sfdxCodeCoverageRequirement", "Code coverage percentages that are displayed in green when you run force:apex:test:\\* with the --codecoverage parameter."], ["sfdxContentType", "Set to JSON so that all CLI commands output results in JSON format."], ["sfdxDefaultdevhubusername", "Username or alias of your default Dev Hub org. Overrides the defaultdevhubusername configuration value."], ["sfdxDefaultusername", "Username or alias of your default org. Overrides the defaultusername configuration value."], ["sfdxDisableAutoupdate", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfdxAutoupdateDisable", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfdxDisableSourceMemberPolling", "Set to true to disable polling of your org\u2019s SourceMember object when you run the force:source:push|pull commands. Default value is false."], ["sfdxDisableTelemetry", "Set to true to disable Salesforce CLI from collecting usage information, user environment information, and crash reports. Default value is false. Overrides the disableTelemetry configration variable."], ["sfdxDnsTimeout", "Number of seconds that the force:org:\\* commands wait for a response when checking whether an org is connected. Default value is 3."], ["sfdxDomainRetry", "Time, in seconds, that Salesforce CLI waits for the Lightning Experience custom domain to resolve and become available in a scratch org. Default value is 240."], ["sfdxImprovedCodeCoverage", "Set to true to scope Apex test results to the classes entered during a test run when running force:apex:test:\\*."], ["sfdxInstanceUrl", "URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. Overrides the instanceUrl configuration value."], ["sfdxJsonToStdout", "Set to true to send messages resulting from failed Salesforce CLI commands to stdout instead of stderr."], ["sfdxDisableLogFile", "Set to true to disable log file writing"], ["sfdxLogLevel", "Level of messages that the CLI writes to the log file. Valid values are trace, debug, info, warn, error, fatal. Default value is warn."], ["sfdxLogRotationCount", "The default rotation period for logs. Example '1d' will rotate logs daily (at midnight)."], ["sfdxLogRotationPeriod", "The number of backup rotated log files to keep. Example: '3' will have the base sf.log file, and the past 3 (period) log files."], ["sfdxMaxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default value is 10,000. Overrides the maxQueryLimit configuration value."], ["sfdxMdapiTempDir", "Directory that contains files (in metadata format) when running certain Salesforce CLI commands, such as force:source:\\*."], ["sfdxNpmRegistry", "URL to a private npm server, where all packages that you publish are private."], ["sfdxPrecompileEnable", "Set to true to enable Apex pre-compile before the tests are run with the force:apex:test:run command. Default is false."], ["sfdxProjectAutoupdateDisableForPackageCreate", "Set to true to disable automatic updates to sfdx-project.json when running force:package:create."], ["sfdxProjectAutoupdateDisableForPackageVersionCreate", "Set to true to disable automatic updates to sfdx-project.json when running force:package:version:create."], ["sfdxRestDeploy", "Set to true to make Salesforce CLI use the Metadata REST API for deployments. By default, the CLI uses SOAP."], ["sfdxSourceMemberPollingTimeout", "Number of seconds you want the force:source:push command to keep polling the SourceMember object before the command times out."], ["sfdxUseGenericUnixKeychain", "(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain."], ["sfdxUseProgressBar", "Set to false to disable the progress bar when running force:mdapi:deploy, force:source:deploy, or force:source:push."], ["sfdxLazyLoadModules", "Set to true to enable lazy loading of sfdx modules"], ["sfdxS3Host", "URL to S3 host"], ["sfdxUpdateInstructions", "Text that describes how to update sfdx"], ["sfdxInstaller", "Boolean indicating that the installer is running"], ["sfdxEnv", "Describes if sfdx is in \"demo\" mode"], ["sfTargetOrg", "Username or alias of your default org. Overrides the target-org configuration variable."], ["sfTargetDevHub", "Username or alias of your default Dev Hub org. Overrides the target-dev-hub configuration variable."], ["sfAccessToken", "Specifies an access token when using a login command that uses access tokens."], ["sfOrgApiVersion", "API version for a specific project or all projects. Default value is the API version of your Dev Hub. Overrides the apiVersion configuration variable."], ["sfAudienceUrl", "URL that overrides the aud (audience) field used for JWT authentication so that it matches the expected value of the authorization server URL for the org you\u2019re logging into."], ["sfCodeCoverageRequirement", "Code coverage percentages that are displayed in green when you run the Apex test CLIcommands with the --code-coverage flag."], ["sfContentType", "Set to JSON so that all CLI commands output results in JSON format."], ["sfDisableAutoupdate", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfAutoupdateDisable", "Set to true to disable the auto-update feature of Salesforce CLI. Default value is false."], ["sfDisableSourceMemberPolling", "Set to true to disable polling of your org\u2019s SourceMember object when you run the commands to push and pull source. Default value is false."], ["sfDisableTelemetry", "Set to true to disable Salesforce CLI from collecting usage information, user environment information, and crash reports. Default value is false. Overrides the disableTelemetry configration variable."], ["sfDnsTimeout", "Number of seconds that the env commands wait for a response when checking whether an org is connected. Default value is 3."], ["sfDomainRetry", "Time, in seconds, that Salesforce CLI waits for the Lightning Experience custom domain to resolve and become available in a scratch org. Default value is 240."], ["sfImprovedCodeCoverage", "Set to true to scope Apex test results to the classes entered during a test run when running the Apex test commands."], ["sfOrgInstanceUrl", "URL of the Salesforce instance that is hosting your org. Default value is https://login.salesforce.com. Overrides the instanceUrl configuration variable."], ["sfJsonToStdout", "Set to true to send messages resulting from failed Salesforce CLI commands to stdout instead of stderr."], ["sfDisableLogFile", "Set to true to disable log file writing"], ["sfLogLevel", "Level of messages that the CLI writes to the log file. Valid values are trace, debug, info, warn, error, fatal. Default value is warn."], ["sfLogRotationCount", "The default rotation period for logs. Example '1d' will rotate logs daily (at midnight)."], ["sfLogRotationPeriod", "The number of backup rotated log files to keep. Example: '3' will have the base sf.log file, and the past 3 (period) log files."], ["sfOrgMaxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default value is 10,000. Overrides the maxQueryLimit configuration variable."], ["sfMdapiTempDir", "Directory that contains files (in metadata format) when running certain Salesforce CLI commands."], ["sfNpmRegistry", "URL to a private npm server, where all packages that you publish are private."], ["sfPrecompileEnable", "Set to true to enable Apex pre-compile before the tests are run with the Apex test run command. Default is false."], ["sfProjectAutoupdateDisableForPackageCreate", "Set to true to disable automatic updates to sfdx-project.json when running the package create command."], ["sfProjectAutoupdateDisableForPackageVersionCreate", "Set to true to disable automatic updates to sfdx-project.json when running the package version create command."], ["sfSourceMemberPollingTimeout", "Number of seconds you want the source push command to keep polling the SourceMember object before the command times out."], ["sfUseGenericUnixKeychain", "(Linux and macOS only) Set to true if you want to use the generic UNIX keychain instead of the Linux libsecret library or macOS keychain."], ["sfUseProgressBar", "Set to false to disable the progress bar when running the metadata deploy command."], ["sfLazyLoadModules", "Set to true to enable lazy loading of sf modules"], ["sfS3Host", "URL to S3 host"], ["sfUpdateInstructions", "Text that describes how to update sf"], ["sfInstaller", "Boolean indicating that the installer is running"], ["sfEnv", "Describes if sf is in \"demo\" mode"], ["deprecatedEnv", "Deprecated environment variable: %s. Please use %s instead."], ["deprecatedEnvDisagreement", "Deprecated environment variable: %s. Please use %s instead.\n\nYour environment has both variables populated, and with different values. The value from %s will be used."], ["sfCapitalizeRecordTypes", "Boolean indicating whether or not to capitalize object settings."]]));
|
|
17
17
|
var EnvironmentVariable;
|
|
18
18
|
(function (EnvironmentVariable) {
|
|
19
19
|
EnvironmentVariable["FORCE_OPEN_URL"] = "FORCE_OPEN_URL";
|
|
@@ -92,6 +92,7 @@ var EnvironmentVariable;
|
|
|
92
92
|
EnvironmentVariable["SF_UPDATE_INSTRUCTIONS"] = "SF_UPDATE_INSTRUCTIONS";
|
|
93
93
|
EnvironmentVariable["SF_INSTALLER"] = "SF_INSTALLER";
|
|
94
94
|
EnvironmentVariable["SF_ENV"] = "SF_ENV";
|
|
95
|
+
EnvironmentVariable["SF_CAPITALIZE_RECORD_TYPES"] = "SF_CAPITALIZE_RECORD_TYPES";
|
|
95
96
|
})(EnvironmentVariable || (exports.EnvironmentVariable = EnvironmentVariable = {}));
|
|
96
97
|
const getMessage = (environmentVariable) => messages.getMessage((0, change_case_1.camelCase)(environmentVariable));
|
|
97
98
|
exports.SUPPORTED_ENV_VARS = {
|
|
@@ -402,6 +403,10 @@ exports.SUPPORTED_ENV_VARS = {
|
|
|
402
403
|
description: getMessage(EnvironmentVariable.SF_ENV),
|
|
403
404
|
synonymOf: null,
|
|
404
405
|
},
|
|
406
|
+
[EnvironmentVariable.SF_CAPITALIZE_RECORD_TYPES]: {
|
|
407
|
+
description: getMessage(EnvironmentVariable.SF_CAPITALIZE_RECORD_TYPES),
|
|
408
|
+
synonymOf: null,
|
|
409
|
+
},
|
|
405
410
|
};
|
|
406
411
|
class EnvVars extends kit_1.Env {
|
|
407
412
|
constructor(env = process.env) {
|
|
@@ -31,7 +31,11 @@ export declare enum OrgConfigProperties {
|
|
|
31
31
|
/**
|
|
32
32
|
* The url for the debugger configuration.
|
|
33
33
|
*/
|
|
34
|
-
ORG_ISV_DEBUGGER_URL = "org-isv-debugger-url"
|
|
34
|
+
ORG_ISV_DEBUGGER_URL = "org-isv-debugger-url",
|
|
35
|
+
/**
|
|
36
|
+
* Capitalize record types when deploying scratch org settings
|
|
37
|
+
*/
|
|
38
|
+
ORG_CAPITALIZE_RECORD_TYPES = "org-capitalize-record-types"
|
|
35
39
|
}
|
|
36
40
|
export declare const ORG_CONFIG_ALLOWED_PROPERTIES: ({
|
|
37
41
|
key: OrgConfigProperties;
|
|
@@ -48,8 +48,16 @@ var OrgConfigProperties;
|
|
|
48
48
|
* The url for the debugger configuration.
|
|
49
49
|
*/
|
|
50
50
|
OrgConfigProperties["ORG_ISV_DEBUGGER_URL"] = "org-isv-debugger-url";
|
|
51
|
+
/**
|
|
52
|
+
* Capitalize record types when deploying scratch org settings
|
|
53
|
+
*/
|
|
54
|
+
OrgConfigProperties["ORG_CAPITALIZE_RECORD_TYPES"] = "org-capitalize-record-types";
|
|
51
55
|
})(OrgConfigProperties || (exports.OrgConfigProperties = OrgConfigProperties = {}));
|
|
52
56
|
exports.ORG_CONFIG_ALLOWED_PROPERTIES = [
|
|
57
|
+
{
|
|
58
|
+
key: OrgConfigProperties.ORG_CAPITALIZE_RECORD_TYPES,
|
|
59
|
+
description: messages.getMessage(OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES),
|
|
60
|
+
},
|
|
53
61
|
{
|
|
54
62
|
key: OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES,
|
|
55
63
|
description: messages.getMessage(OrgConfigProperties.ORG_CUSTOM_METADATA_TEMPLATES),
|
|
@@ -127,7 +127,9 @@ const scratchOrgCreate = async (options) => {
|
|
|
127
127
|
ignoreAncestorIds,
|
|
128
128
|
});
|
|
129
129
|
// gets the scratch org settings (will use in both signup paths AND to deploy the settings)
|
|
130
|
-
const settingsGenerator = new scratchOrgSettingsGenerator_1.default(
|
|
130
|
+
const settingsGenerator = new scratchOrgSettingsGenerator_1.default({
|
|
131
|
+
capitalizeRecordTypes: (0, kit_1.toBoolean)((await configAggregator_1.ConfigAggregator.create()).getInfo('org-capitalize-record-types').value ?? true),
|
|
132
|
+
});
|
|
131
133
|
const settings = await settingsGenerator.extract(scratchOrgInfo);
|
|
132
134
|
logger.debug(`the scratch org def file has settings: ${settingsGenerator.hasSettings()}`);
|
|
133
135
|
const [scratchOrgInfoRequestResult, signupTargetLoginUrlConfig] = await Promise.all([
|
|
@@ -31,7 +31,7 @@ export declare const createObjectFileContent: ({ allRecordTypes, allBusinessProc
|
|
|
31
31
|
[objectName: string]: ObjectSetting;
|
|
32
32
|
} | undefined;
|
|
33
33
|
}) => PackageFile;
|
|
34
|
-
export declare const createRecordTypeAndBusinessProcessFileContent: (objectName: string, json: Record<string, unknown>, allRecordTypes: string[], allBusinessProcesses: string[]) => JsonMap;
|
|
34
|
+
export declare const createRecordTypeAndBusinessProcessFileContent: (objectName: string, json: Record<string, unknown>, allRecordTypes: string[], allBusinessProcesses: string[], capitalizeRecordTypes: boolean) => JsonMap;
|
|
35
35
|
/**
|
|
36
36
|
* Helper class for dealing with the settings that are defined in a scratch definition file. This class knows how to extract the
|
|
37
37
|
* settings from the definition, how to expand them into a MD directory and how to generate a package.xml.
|
|
@@ -45,10 +45,12 @@ export default class SettingsGenerator {
|
|
|
45
45
|
private allBusinessProcesses;
|
|
46
46
|
private readonly shapeDirName;
|
|
47
47
|
private readonly packageFilePath;
|
|
48
|
+
private readonly capitalizeRecordTypes;
|
|
48
49
|
constructor(options?: {
|
|
49
50
|
mdApiTmpDir?: string;
|
|
50
51
|
shapeDirName?: string;
|
|
51
52
|
asDirectory?: boolean;
|
|
53
|
+
capitalizeRecordTypes?: boolean;
|
|
52
54
|
});
|
|
53
55
|
/** extract the settings from the scratch def file, if they are present. */
|
|
54
56
|
extract(scratchDef: ScratchOrgInfo): Promise<{
|
|
@@ -51,13 +51,15 @@ const createObjectFileContent = ({ allRecordTypes = [], allBusinessProcesses = [
|
|
|
51
51
|
return { ...output, ...{ version: apiVersion } };
|
|
52
52
|
};
|
|
53
53
|
exports.createObjectFileContent = createObjectFileContent;
|
|
54
|
-
const calculateBusinessProcess = (objectName, defaultRecordType) => {
|
|
54
|
+
const calculateBusinessProcess = (objectName, defaultRecordType, capitalizeBusinessProcess) => {
|
|
55
55
|
let businessProcessName = null;
|
|
56
56
|
let businessProcessPicklistVal = null;
|
|
57
57
|
// These four objects require any record type to specify a "business process"--
|
|
58
58
|
// a restricted set of items from a standard picklist on the object.
|
|
59
59
|
if (['Case', 'Lead', 'Opportunity', 'Solution'].includes(objectName)) {
|
|
60
|
-
businessProcessName =
|
|
60
|
+
businessProcessName = capitalizeBusinessProcess
|
|
61
|
+
? `${(0, kit_1.upperFirst)(defaultRecordType)}Process`
|
|
62
|
+
: `${defaultRecordType}Process`;
|
|
61
63
|
switch (objectName) {
|
|
62
64
|
case 'Case':
|
|
63
65
|
businessProcessPicklistVal = 'New';
|
|
@@ -74,7 +76,7 @@ const calculateBusinessProcess = (objectName, defaultRecordType) => {
|
|
|
74
76
|
}
|
|
75
77
|
return [businessProcessName, businessProcessPicklistVal];
|
|
76
78
|
};
|
|
77
|
-
const createRecordTypeAndBusinessProcessFileContent = (objectName, json, allRecordTypes, allBusinessProcesses) => {
|
|
79
|
+
const createRecordTypeAndBusinessProcessFileContent = (objectName, json, allRecordTypes, allBusinessProcesses, capitalizeRecordTypes) => {
|
|
78
80
|
let output = {
|
|
79
81
|
'@': {
|
|
80
82
|
xmlns: 'http://soap.sforce.com/2006/04/metadata',
|
|
@@ -88,15 +90,17 @@ const createRecordTypeAndBusinessProcessFileContent = (objectName, json, allReco
|
|
|
88
90
|
sharingModel: (0, kit_1.upperFirst)(sharingModel),
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
|
-
const defaultRecordType =
|
|
93
|
+
const defaultRecordType = capitalizeRecordTypes
|
|
94
|
+
? (0, kit_1.upperFirst)(json.defaultRecordType)
|
|
95
|
+
: json.defaultRecordType;
|
|
92
96
|
if (typeof defaultRecordType === 'string') {
|
|
93
97
|
// We need to keep track of these globally for when we generate the package XML.
|
|
94
|
-
allRecordTypes.push(`${name}.${
|
|
95
|
-
const [businessProcessName, businessProcessPicklistVal] = calculateBusinessProcess(name, defaultRecordType);
|
|
98
|
+
allRecordTypes.push(`${name}.${defaultRecordType}`);
|
|
99
|
+
const [businessProcessName, businessProcessPicklistVal] = calculateBusinessProcess(name, defaultRecordType, capitalizeRecordTypes);
|
|
96
100
|
// Create the record type
|
|
97
101
|
const recordTypes = {
|
|
98
|
-
fullName:
|
|
99
|
-
label:
|
|
102
|
+
fullName: defaultRecordType,
|
|
103
|
+
label: defaultRecordType,
|
|
100
104
|
active: true,
|
|
101
105
|
};
|
|
102
106
|
output = {
|
|
@@ -140,6 +144,7 @@ class SettingsGenerator {
|
|
|
140
144
|
this.allRecordTypes = [];
|
|
141
145
|
this.allBusinessProcesses = [];
|
|
142
146
|
this.logger = logger_1.Logger.childFromRoot('SettingsGenerator');
|
|
147
|
+
this.capitalizeRecordTypes = options?.capitalizeRecordTypes ?? false;
|
|
143
148
|
// If SFDX_MDAPI_TEMP_DIR is set, copy settings to that dir for people to inspect.
|
|
144
149
|
const mdApiTmpDir = options?.mdApiTmpDir ?? kit_1.env.getString('SFDX_MDAPI_TEMP_DIR');
|
|
145
150
|
this.shapeDirName = options?.shapeDirName ?? `shape_${Date.now()}`;
|
|
@@ -256,7 +261,7 @@ class SettingsGenerator {
|
|
|
256
261
|
async writeObjectSettingsIfNeeded(objectsDir, allRecordTypes, allbusinessProcesses) {
|
|
257
262
|
if (this.objectSettingsData) {
|
|
258
263
|
await Promise.all(Object.entries(this.objectSettingsData).map(([item, value]) => {
|
|
259
|
-
const fileContent = (0, exports.createRecordTypeAndBusinessProcessFileContent)(item, value, allRecordTypes, allbusinessProcesses);
|
|
264
|
+
const fileContent = (0, exports.createRecordTypeAndBusinessProcessFileContent)(item, value, allRecordTypes, allbusinessProcesses, this.capitalizeRecordTypes);
|
|
260
265
|
const xml = js2xmlparser.parse('CustomObject', fileContent);
|
|
261
266
|
return this.writer.addToStore(xml, path.join(objectsDir, (0, kit_1.upperFirst)(item) + '.object'));
|
|
262
267
|
}));
|
package/messages/envVars.md
CHANGED
|
@@ -311,3 +311,7 @@ Deprecated environment variable: %s. Please use %s instead.
|
|
|
311
311
|
Deprecated environment variable: %s. Please use %s instead.
|
|
312
312
|
|
|
313
313
|
Your environment has both variables populated, and with different values. The value from %s will be used.
|
|
314
|
+
|
|
315
|
+
# sfCapitalizeRecordTypes
|
|
316
|
+
|
|
317
|
+
Boolean indicating whether or not to capitalize object settings.
|