@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
463 lines • 33.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.envVars = exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = void 0;
/*
* Copyright (c) 2020, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const node_path_1 = require("node:path");
const change_case_1 = require("change-case");
const kit_1 = require("@salesforce/kit");
const messages_1 = require("../messages");
const lifecycleEvents_1 = require("../lifecycleEvents");
;
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."], ["sfdxSourceTrackingBatchSize", "Number of source-tracked file updates to batch after a deploy or retrieve. The default value is 8,000 (Windows) or 15,000 (Linux/macOS)."], ["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", "Whether record types are capitalized on scratch org creation."]]));
var EnvironmentVariable;
(function (EnvironmentVariable) {
EnvironmentVariable["FORCE_OPEN_URL"] = "FORCE_OPEN_URL";
EnvironmentVariable["FORCE_SHOW_SPINNER"] = "FORCE_SHOW_SPINNER";
EnvironmentVariable["FORCE_SPINNER_DELAY"] = "FORCE_SPINNER_DELAY";
EnvironmentVariable["HTTP_PROXY"] = "HTTP_PROXY";
EnvironmentVariable["HTTPS_PROXY"] = "HTTPS_PROXY";
EnvironmentVariable["NODE_EXTRA_CA_CERTS"] = "NODE_EXTRA_CA_CERTS";
EnvironmentVariable["NODE_TLS_REJECT_UNAUTHORIZED"] = "NODE_TLS_REJECT_UNAUTHORIZED";
EnvironmentVariable["SFDX_ACCESS_TOKEN"] = "SFDX_ACCESS_TOKEN";
EnvironmentVariable["SFDX_API_VERSION"] = "SFDX_API_VERSION";
EnvironmentVariable["SFDX_AUDIENCE_URL"] = "SFDX_AUDIENCE_URL";
EnvironmentVariable["SFDX_CONTENT_TYPE"] = "SFDX_CONTENT_TYPE";
EnvironmentVariable["SFDX_DEFAULTDEVHUBUSERNAME"] = "SFDX_DEFAULTDEVHUBUSERNAME";
EnvironmentVariable["SFDX_DEFAULTUSERNAME"] = "SFDX_DEFAULTUSERNAME";
EnvironmentVariable["SFDX_DISABLE_AUTOUPDATE"] = "SFDX_DISABLE_AUTOUPDATE";
EnvironmentVariable["SFDX_AUTOUPDATE_DISABLE"] = "SFDX_AUTOUPDATE_DISABLE";
EnvironmentVariable["SFDX_DISABLE_SOURCE_MEMBER_POLLING"] = "SFDX_DISABLE_SOURCE_MEMBER_POLLING";
EnvironmentVariable["SFDX_SOURCE_TRACKING_BATCH_SIZE"] = "SFDX_SOURCE_TRACKING_BATCH_SIZE";
EnvironmentVariable["SFDX_DISABLE_TELEMETRY"] = "SFDX_DISABLE_TELEMETRY";
EnvironmentVariable["SFDX_DNS_TIMEOUT"] = "SFDX_DNS_TIMEOUT";
EnvironmentVariable["SFDX_DOMAIN_RETRY"] = "SFDX_DOMAIN_RETRY";
EnvironmentVariable["SFDX_IMPROVED_CODE_COVERAGE"] = "SFDX_IMPROVED_CODE_COVERAGE";
EnvironmentVariable["SFDX_INSTANCE_URL"] = "SFDX_INSTANCE_URL";
EnvironmentVariable["SFDX_JSON_TO_STDOUT"] = "SFDX_JSON_TO_STDOUT";
EnvironmentVariable["SFDX_DISABLE_LOG_FILE"] = "SFDX_DISABLE_LOG_FILE";
EnvironmentVariable["SFDX_LOG_LEVEL"] = "SFDX_LOG_LEVEL";
EnvironmentVariable["SFDX_LOG_ROTATION_COUNT"] = "SFDX_LOG_ROTATION_COUNT";
EnvironmentVariable["SFDX_LOG_ROTATION_PERIOD"] = "SFDX_LOG_ROTATION_PERIOD";
EnvironmentVariable["SFDX_MAX_QUERY_LIMIT"] = "SFDX_MAX_QUERY_LIMIT";
EnvironmentVariable["SFDX_MDAPI_TEMP_DIR"] = "SFDX_MDAPI_TEMP_DIR";
EnvironmentVariable["SFDX_NPM_REGISTRY"] = "SFDX_NPM_REGISTRY";
EnvironmentVariable["SFDX_PRECOMPILE_ENABLE"] = "SFDX_PRECOMPILE_ENABLE";
EnvironmentVariable["SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE"] = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE";
EnvironmentVariable["SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE"] = "SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE";
EnvironmentVariable["SFDX_REST_DEPLOY"] = "SFDX_REST_DEPLOY";
EnvironmentVariable["SFDX_SOURCE_MEMBER_POLLING_TIMEOUT"] = "SFDX_SOURCE_MEMBER_POLLING_TIMEOUT";
EnvironmentVariable["SFDX_USE_GENERIC_UNIX_KEYCHAIN"] = "SFDX_USE_GENERIC_UNIX_KEYCHAIN";
EnvironmentVariable["SFDX_USE_PROGRESS_BAR"] = "SFDX_USE_PROGRESS_BAR";
EnvironmentVariable["SFDX_LAZY_LOAD_MODULES"] = "SFDX_LAZY_LOAD_MODULES";
EnvironmentVariable["SFDX_S3_HOST"] = "SFDX_S3_HOST";
EnvironmentVariable["SFDX_UPDATE_INSTRUCTIONS"] = "SFDX_UPDATE_INSTRUCTIONS";
EnvironmentVariable["SFDX_INSTALLER"] = "SFDX_INSTALLER";
EnvironmentVariable["SFDX_ENV"] = "SFDX_ENV";
EnvironmentVariable["SF_TARGET_ORG"] = "SF_TARGET_ORG";
EnvironmentVariable["SF_TARGET_DEV_HUB"] = "SF_TARGET_DEV_HUB";
EnvironmentVariable["SF_ACCESS_TOKEN"] = "SF_ACCESS_TOKEN";
EnvironmentVariable["SF_ORG_API_VERSION"] = "SF_ORG_API_VERSION";
EnvironmentVariable["SF_AUDIENCE_URL"] = "SF_AUDIENCE_URL";
EnvironmentVariable["SF_CONTENT_TYPE"] = "SF_CONTENT_TYPE";
EnvironmentVariable["SF_DISABLE_AUTOUPDATE"] = "SF_DISABLE_AUTOUPDATE";
EnvironmentVariable["SF_AUTOUPDATE_DISABLE"] = "SF_AUTOUPDATE_DISABLE";
EnvironmentVariable["SF_DISABLE_SOURCE_MEMBER_POLLING"] = "SF_DISABLE_SOURCE_MEMBER_POLLING";
EnvironmentVariable["SF_DISABLE_TELEMETRY"] = "SF_DISABLE_TELEMETRY";
EnvironmentVariable["SF_DNS_TIMEOUT"] = "SF_DNS_TIMEOUT";
EnvironmentVariable["SF_DOMAIN_RETRY"] = "SF_DOMAIN_RETRY";
EnvironmentVariable["SF_IMPROVED_CODE_COVERAGE"] = "SF_IMPROVED_CODE_COVERAGE";
EnvironmentVariable["SF_ORG_INSTANCE_URL"] = "SF_ORG_INSTANCE_URL";
EnvironmentVariable["SF_JSON_TO_STDOUT"] = "SF_JSON_TO_STDOUT";
EnvironmentVariable["SF_DISABLE_LOG_FILE"] = "SF_DISABLE_LOG_FILE";
EnvironmentVariable["SF_LOG_LEVEL"] = "SF_LOG_LEVEL";
EnvironmentVariable["SF_LOG_ROTATION_COUNT"] = "SF_LOG_ROTATION_COUNT";
EnvironmentVariable["SF_LOG_ROTATION_PERIOD"] = "SF_LOG_ROTATION_PERIOD";
EnvironmentVariable["SF_ORG_MAX_QUERY_LIMIT"] = "SF_ORG_MAX_QUERY_LIMIT";
EnvironmentVariable["SF_MDAPI_TEMP_DIR"] = "SF_MDAPI_TEMP_DIR";
EnvironmentVariable["SF_NPM_REGISTRY"] = "SF_NPM_REGISTRY";
EnvironmentVariable["SF_PRECOMPILE_ENABLE"] = "SF_PRECOMPILE_ENABLE";
EnvironmentVariable["SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE"] = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE";
EnvironmentVariable["SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE"] = "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE";
EnvironmentVariable["SF_SOURCE_MEMBER_POLLING_TIMEOUT"] = "SF_SOURCE_MEMBER_POLLING_TIMEOUT";
EnvironmentVariable["SF_SOURCE_TRACKING_BATCH_SIZE"] = "SF_SOURCE_TRACKING_BATCH_SIZE";
EnvironmentVariable["SF_USE_GENERIC_UNIX_KEYCHAIN"] = "SF_USE_GENERIC_UNIX_KEYCHAIN";
EnvironmentVariable["SF_USE_PROGRESS_BAR"] = "SF_USE_PROGRESS_BAR";
EnvironmentVariable["SF_LAZY_LOAD_MODULES"] = "SF_LAZY_LOAD_MODULES";
EnvironmentVariable["SF_S3_HOST"] = "SF_S3_HOST";
EnvironmentVariable["SF_UPDATE_INSTRUCTIONS"] = "SF_UPDATE_INSTRUCTIONS";
EnvironmentVariable["SF_INSTALLER"] = "SF_INSTALLER";
EnvironmentVariable["SF_ENV"] = "SF_ENV";
EnvironmentVariable["SF_CAPITALIZE_RECORD_TYPES"] = "SF_CAPITALIZE_RECORD_TYPES";
})(EnvironmentVariable || (exports.EnvironmentVariable = EnvironmentVariable = {}));
const getMessage = (environmentVariable) => messages.getMessage((0, change_case_1.camelCase)(environmentVariable));
exports.SUPPORTED_ENV_VARS = {
[ ]: {
description: getMessage(EnvironmentVariable.FORCE_SHOW_SPINNER),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.FORCE_SPINNER_DELAY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.FORCE_OPEN_URL),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.HTTP_PROXY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.HTTPS_PROXY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.NODE_EXTRA_CA_CERTS),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.NODE_TLS_REJECT_UNAUTHORIZED),
synonymOf: null,
},
// sfdx vars
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_ACCESS_TOKEN),
synonymOf: EnvironmentVariable.SF_ACCESS_TOKEN,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_API_VERSION),
synonymOf: EnvironmentVariable.SF_ORG_API_VERSION,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_AUDIENCE_URL),
synonymOf: EnvironmentVariable.SF_AUDIENCE_URL,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_CONTENT_TYPE),
synonymOf: EnvironmentVariable.SF_CONTENT_TYPE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DEFAULTDEVHUBUSERNAME),
synonymOf: EnvironmentVariable.SF_TARGET_DEV_HUB,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DEFAULTUSERNAME),
synonymOf: EnvironmentVariable.SF_TARGET_ORG,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DISABLE_AUTOUPDATE),
synonymOf: EnvironmentVariable.SF_DISABLE_AUTOUPDATE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_AUTOUPDATE_DISABLE),
synonymOf: EnvironmentVariable.SF_AUTOUPDATE_DISABLE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DISABLE_SOURCE_MEMBER_POLLING),
synonymOf: EnvironmentVariable.SF_DISABLE_SOURCE_MEMBER_POLLING,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_SOURCE_TRACKING_BATCH_SIZE),
synonymOf: EnvironmentVariable.SF_SOURCE_TRACKING_BATCH_SIZE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DISABLE_TELEMETRY),
synonymOf: EnvironmentVariable.SF_DISABLE_TELEMETRY,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DNS_TIMEOUT),
synonymOf: EnvironmentVariable.SF_DNS_TIMEOUT,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DOMAIN_RETRY),
synonymOf: EnvironmentVariable.SF_DOMAIN_RETRY,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_IMPROVED_CODE_COVERAGE),
synonymOf: EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_INSTANCE_URL),
synonymOf: EnvironmentVariable.SF_ORG_INSTANCE_URL,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_JSON_TO_STDOUT),
synonymOf: EnvironmentVariable.SF_JSON_TO_STDOUT,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_DISABLE_LOG_FILE),
synonymOf: EnvironmentVariable.SF_DISABLE_LOG_FILE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_LOG_LEVEL),
synonymOf: EnvironmentVariable.SF_LOG_LEVEL,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_LOG_ROTATION_COUNT),
synonymOf: EnvironmentVariable.SF_LOG_ROTATION_COUNT,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_LOG_ROTATION_PERIOD),
synonymOf: EnvironmentVariable.SF_LOG_ROTATION_PERIOD,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_MAX_QUERY_LIMIT),
synonymOf: EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_MDAPI_TEMP_DIR),
synonymOf: EnvironmentVariable.SF_MDAPI_TEMP_DIR,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_NPM_REGISTRY),
synonymOf: EnvironmentVariable.SF_NPM_REGISTRY,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_PRECOMPILE_ENABLE),
synonymOf: EnvironmentVariable.SF_PRECOMPILE_ENABLE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE),
synonymOf: EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE,
},
[ ]: {
description: messages.getMessage((0, change_case_1.camelCase)(EnvironmentVariable.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE)),
synonymOf: EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_REST_DEPLOY),
// this is not an "official" env var, but it supports the env=>config naming convention for the config that lives in plugin-deploy-retrieve
synonymOf: 'SF_ORG_METADATA_REST_DEPLOY',
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_SOURCE_MEMBER_POLLING_TIMEOUT),
synonymOf: EnvironmentVariable.SF_SOURCE_MEMBER_POLLING_TIMEOUT,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_USE_GENERIC_UNIX_KEYCHAIN),
synonymOf: EnvironmentVariable.SF_USE_GENERIC_UNIX_KEYCHAIN,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_USE_PROGRESS_BAR),
synonymOf: EnvironmentVariable.SF_USE_PROGRESS_BAR,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_USE_PROGRESS_BAR),
synonymOf: EnvironmentVariable.SF_LAZY_LOAD_MODULES,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_S3_HOST),
synonymOf: EnvironmentVariable.SF_S3_HOST,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_UPDATE_INSTRUCTIONS),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_INSTALLER),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_ENV),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_TARGET_ORG),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_TARGET_DEV_HUB),
synonymOf: null,
},
// sf vars
[ ]: {
description: getMessage(EnvironmentVariable.SF_ACCESS_TOKEN),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_ORG_API_VERSION),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_AUDIENCE_URL),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_CONTENT_TYPE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DISABLE_AUTOUPDATE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_AUTOUPDATE_DISABLE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DISABLE_SOURCE_MEMBER_POLLING),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SFDX_SOURCE_TRACKING_BATCH_SIZE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DISABLE_TELEMETRY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DNS_TIMEOUT),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DOMAIN_RETRY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_IMPROVED_CODE_COVERAGE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_ORG_INSTANCE_URL),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_JSON_TO_STDOUT),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_DISABLE_LOG_FILE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_LOG_LEVEL),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_LOG_ROTATION_COUNT),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_LOG_ROTATION_PERIOD),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_ORG_MAX_QUERY_LIMIT),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_MDAPI_TEMP_DIR),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_NPM_REGISTRY),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_PRECOMPILE_ENABLE),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_CREATE),
synonymOf: null,
},
[ ]: {
description: messages.getMessage((0, change_case_1.camelCase)(EnvironmentVariable.SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE)),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_SOURCE_MEMBER_POLLING_TIMEOUT),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_USE_GENERIC_UNIX_KEYCHAIN),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_USE_PROGRESS_BAR),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_LAZY_LOAD_MODULES),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_S3_HOST),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_UPDATE_INSTRUCTIONS),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_INSTALLER),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_ENV),
synonymOf: null,
},
[ ]: {
description: getMessage(EnvironmentVariable.SF_CAPITALIZE_RECORD_TYPES),
synonymOf: null,
},
};
class EnvVars extends kit_1.Env {
constructor(env = process.env) {
super(env);
this.resolve();
}
static propertyToEnvName(property, prefix = EnvVars.defaultPrefix()) {
return `${prefix || ''}${(0, change_case_1.snakeCase)(property).toUpperCase()}`;
}
static defaultPrefix() {
return 'SF_';
}
getPropertyFromEnv(property, prefix = EnvVars.defaultPrefix()) {
const envName = EnvVars.propertyToEnvName(property, prefix);
return this.get(envName);
}
asDictionary() {
return Object.fromEntries(this.entries());
}
asMap() {
return new Map(this.entries());
}
resolve() {
// iterate everything in the real environment
const corrections = new Map();
this.entries().forEach(([key, value]) => {
if (exports.SUPPORTED_ENV_VARS[key]?.synonymOf) {
// we are looking at an "old" key that has a new name
// if the new key has a value set, use that for the old key, too
const newEnvName = exports.SUPPORTED_ENV_VARS[key].synonymOf;
if (newEnvName) {
const valueOfNewName = this.getString(newEnvName);
if (!valueOfNewName) {
void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(messages.getMessage('deprecatedEnv', [key, newEnvName]));
corrections.set(newEnvName, value);
}
else if (valueOfNewName !== value) {
void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(messages.getMessage('deprecatedEnvDisagreement', [key, newEnvName, newEnvName]));
corrections.set(key, valueOfNewName ?? value);
}
}
}
});
corrections.forEach((v, k) => {
this.setString(k, v);
});
}
get(envName) {
return this.asMap().get(envName);
}
}
exports.EnvVars = EnvVars;
exports.envVars = new EnvVars();
//# sourceMappingURL=envVars.js.map