Skip to content

Latest commit

 

History

History
134 lines (83 loc) · 3.55 KB

config_manager.md

File metadata and controls

134 lines (83 loc) · 3.55 KB

@-xun/ctl / config-manager

Module: config-manager

Table of contents

Type Aliases

Functions

Type Aliases

Config

Ƭ Config: Object

Available configuration keys and their value types.

Type declaration

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

Defined in

src/config-manager.ts:10

Functions

loadFromCliConfig

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.

Parameters

Name Type
«destructured» Object
› configPath string
› key LiteralUnion<keyof Config, string>

Returns

Promise<JsonValue>

Defined in

src/config-manager.ts:59

loadFromCliConfig(«destructured»): Promise<Config>

Parameters

Name Type
«destructured» Object
› configPath string
› key? undefined

Returns

Promise<Config>

Defined in

src/config-manager.ts:66


saveToCliConfig

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.

Parameters

Name Type
«destructured» Object
› configPath string
› key LiteralUnion<keyof Config, string>
› value undefined | JsonValue

Returns

Promise<void>

Defined in

src/config-manager.ts:113


setCache

setCache(replacementCache): Promise<void>

Overwrites the current configuration cache. Useful while testing.

Parameters

Name Type
replacementCache undefined | Config

Returns

Promise<void>

Defined in

src/config-manager.ts:145