Add an allowed config property.
Get all resolved config property keys, values, locations, and paths.
> console.log(aggregator.getConfigInfo());
[
{ key: 'logLevel', val: 'INFO', location: 'Environment', path: '$SF_LOG_LEVEL'}
{ key: 'target-org', val: '<username>', location: 'Local', path: './.sf/config.json'}
]
Get a resolved config property. If a property is deprecated, it will try to use the the new key, if there is a config there.
The key of the property.
True, if you want an error throw when reading a deprecated config
Gets a resolved config property location.
For example, getLocation('logLevel')
will return:
Location.GLOBAL
if resolved to an environment variable.Location.LOCAL
if resolved to local project config.Location.ENVIRONMENT
if resolved to the global config.The key of the property.
Get a resolved file path or environment variable name of the property.
For example, getPath('logLevel')
will return:
$SF_LOG_LEVEL
if resolved to an environment variable../.sf/config.json
if resolved to the local config.~/.sf/config.json
if resolved to the global config.undefined
, if not resolved.Note: that the path returned may be the absolute path instead of
relative paths such as ./
and ~/
.
The key of the property.
Get a resolved config property meta. If the property is deprecated, it will return the new key's meta, if it exists, with a deprecation warning
Throws SfError{ name: 'UnknownConfigKeyError' } An attempt to get a property that's not supported.
The key of the property.
Get a resolved config property. If you use a deprecated property, a warning will be emitted and it will attempt to resolve the new property's value
Throws SfError{ name: 'UnknownConfigKeyError' } An attempt to get a property that's not supported.
The key of the property.
Re-read all property configurations from disk.
Static
createStatic
getGet the info for a given key. If the ConfigAggregator was not asynchronously created OR the ConfigAggregator.reload was not called, the config value may be encrypted.
The config key.
Aggregate global and local project config files, as well as environment variables for
config.json
. The resolution happens in the following bottom-up order:SF_LOG_LEVEL
)<workspace-root>/.sf/config.json
)$HOME/.sf/config.json
)Use ConfigAggregator.create to instantiate the aggregator.