@-xun/ctl / config-manager
Ƭ Config: Object
Available configuration keys and their value types.
Name | Type | Description |
---|---|---|
cfAccountId |
string |
Cloudflare account token. |
cfApiToken |
string |
Cloudflare API token. |
cfApiUriBase |
string |
Cloudflare API base URI. For example: https://api.cloudflare.com/client/v4 |
cfFirewallPhaseName |
string |
Cloudflare firewall phase name. |
cfHostileIpListId |
string |
Cloudflare hostile IP blocking list ID. |
cfMainZoneId |
string |
The ID of the primary zone where, for instance, ban lists and email-related configurations are stored. |
cfWafBlockHostileIpListName |
string |
Cloudflare hostile IP blocking list name. |
cfWafBlockHostileIpRuleName |
string |
Cloudflare hostile IP blocking rule name. |
doApiToken |
string |
DigitalOcean API token. |
doApiUriBase |
string |
DigitalOcean API base URI. For example: https://api.digitalocean.com/v2 |
▸ loadFromCliConfig(«destructured»
): Promise
<JsonValue
>
Loads and caches a JSON configuration file and returns a key, if available.
If the key is not available, either a default value or undefined
is
returned.
Name | Type |
---|---|
«destructured» |
Object |
› configPath |
string |
› key |
LiteralUnion <keyof Config , string > |
Promise
<JsonValue
>
▸ loadFromCliConfig(«destructured»
): Promise
<Config
>
Name | Type |
---|---|
«destructured» |
Object |
› configPath |
string |
› key? |
undefined |
Promise
<Config
>
▸ saveToCliConfig(«destructured»
): Promise
<void
>
Accepts a key-value pair, serializes it as JSON, and appends/overwrites the result into a JSON configuration file while updating the cache.
Name | Type |
---|---|
«destructured» |
Object |
› configPath |
string |
› key |
LiteralUnion <keyof Config , string > |
› value |
undefined | JsonValue |
Promise
<void
>
▸ setCache(replacementCache
): Promise
<void
>
Overwrites the current configuration cache. Useful while testing.
Name | Type |
---|---|
replacementCache |
undefined | Config |
Promise
<void
>