Documentation
    Preparing search index...

    Class ConfigContainer

    Isolated configuration container managing prioritized sources for a specific namespace or scope.

    Index

    Constructors

    • Construct a new ConfigContainer.

      Parameters

      • namespace: string = '@default'

        Namespace or tool identifier (e.g. '@default', 'odoo', 'supabase').

      • initialSources: AbstractConfigSource[] = []

        Optional initial array of configuration sources.

      Returns ConfigContainer

    Properties

    _memorySource: MemoryConfigSource
    namespace: string

    Methods

    • Registers an additional configuration source into this container. Sources are automatically sorted by priority descending.

      Parameters

      Returns this

      This container instance for fluent chaining.

    • Retrieves a value across all sources by descending priority order.

      Type Parameters

      • T = unknown

      Parameters

      • path: string

        Property key or dot-notation path.

      • Optionalfallback: T

        Optional fallback value if not found.

      Returns T | undefined

      The resolved value or fallback.

    • Retrieves an optional boolean parameter.

      Parameters

      • path: string
      • Optionalfallback: boolean

      Returns boolean | undefined

    • Retrieves an optional number parameter.

      Parameters

      • path: string
      • Optionalfallback: number

      Returns number | undefined

    • Retrieves an optional string parameter.

      Parameters

      • path: string
      • Optionalfallback: string

      Returns string | undefined

    • Checks whether a value exists across any registered source.

      Parameters

      • path: string

        Property key or dot-notation path.

      Returns boolean

      True if defined in at least one source.

    • Requires a parameter to exist and not be null or empty string. Throws ConfigurationError immediately on missing values (Fail-Fast).

      Type Parameters

      • T = unknown

      Parameters

      • path: string

        Property key or dot-notation path.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns T

      The resolved value typed as T.

      If parameter is missing or empty string.

    • Requires an array parameter (Fail-Fast).

      Type Parameters

      • T = unknown

      Parameters

      • path: string

        Property key or dot-notation path.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns T[]

      The resolved array.

    • Requires a boolean parameter (Fail-Fast). Accepts true, false, "true", "false", "1", "0".

      Parameters

      • path: string

        Property key or dot-notation path.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns boolean

      The resolved boolean.

    • Requires a value matching an allowed set of enum values (Fail-Fast).

      Type Parameters

      • T extends string

      Parameters

      • path: string

        Property key or dot-notation path.

      • allowedValues: readonly T[]

        Array of allowed string constants.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns T

      The validated enum string.

    • Requires a numeric parameter (Fail-Fast). Supports string representations of numbers (e.g. "8080" -> 8080).

      Parameters

      • path: string

        Property key or dot-notation path.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns number

      The resolved number.

    • Requires a non-empty string parameter (Fail-Fast).

      Parameters

      • path: string

        Property key or dot-notation path.

      • OptionalhelpText: string

        Optional remediation guidance.

      Returns string

      The resolved trimmed string.

    • Creates a scoped sub-container focused on a specific sub-path. Accesses to 'port' in scope('api') automatically query 'api.port'.

      Parameters

      • subPath: string

        Dot-notation prefix path.

      Returns ConfigContainer

      A new ConfigContainer scoped to the subPath.

    • Sets a configuration value directly in the highest-priority memory store.

      Parameters

      • path: string

        Property key or dot-notation path.

      • value: unknown

        Value to set.

      Returns void

    • Collapses all sources into a single merged key-value record snapshot.

      Returns Record<string, unknown>