Changelog
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
1.1.0 (2026-06-15)
Section titled “1.1.0 (2026-06-15)”- Locking (immutability): the built configuration object is now
deep-frozen by default so runtime config can’t be mutated. New
lockoption (defaulttrue) on the constructor, a newisLockedgetter, and adeepFreezeutility. Pass{ lock: false }for a mutable result.
Configuard.serializeFlat(configList, edits, options?): the inverse ofparseFlat()for the admin save flow. Enforceseditable, validates edits againsttype/options, serializes values to DB strings (optionally re-encrypting via anencrypthook), and returns a diff of changed rows (updates+ aggregaterequiresReboot; fullrowswithdiffOnly: false). AddsIConfigUpdate/ISaveResult/ISerializeOptionstypes.- Decryption hook: an optional, synchronous
decryptconstructor option, applied (before templating/parsing) to items flaggedencrypt: true. Crypto-agnostic and opt-in; a failing hook throws aConfiguardError. - Metadata accessors on the instance:
getMeta(key)(a frozen, read-only view of a visible item’s metadata),isEncrypted(key), andrequiresReboot(key). All are ABAC-consistent (answer only for keys visible to the instance’s accessor). ConfiguardError: a dedicated error class (exported from the root) thrown for every configuration fault. Carries an optionalkey(the offending config item) and acause(the underlying error). Lets consumers checkerr instanceof ConfiguardError.
Changed
Section titled “Changed”- All thrown errors are now
ConfiguardErrorinstances; the redundant"Configuard: "message prefix was dropped (the errornameidentifies them). - Fail loud on corrupt config: the constructor now throws immediately
on a corrupt config item — an unparseable
value(or one that resolves toNaN), a missing or circular${...}template reference, or a malformed item (invalidaccessor/listType/type, or a non-stringkey) — instead of silently logging a warning and building a partial object. The original parser error is attached asError.causewhere applicable. Documented via JSDoc@throws.
1.0.0 (2026-06-15)
Section titled “1.0.0 (2026-06-15)”Initial release.
Configuardclass: builds a nested, typed configuration object from a flatIConfigItem[]list.${...}value templating with recursive resolution and circular-reference detection (no infinite recursion).- Accessor-based (ABAC) item filtering via
accessor(system/application/all) and bitwiseappAccessvs the client’sappLevel. - Typed access:
get<T>(path, defaultValue?)andhas(path). listType(none/array/csl): values can be parsed as a single value, an array, or a normalized comma-separated string.- Option lists:
@-prefixed keys define reusable lists of allowed values; other items reference them from theiroptionsfield ("${@name}").@-keys are excluded from the built object. - Static
Configuard.parseFlat(configList): resolves${...}value templates (kept as strings) and expandsoptionsinto string arrays, returning a flat list plus an@map of option lists — intended for admin/editor UIs. AddsIFlatConfig/IFlatConfigItemtypes. - Value types
hexadecimal(validated hex → number),date(date-only, validated string), andtime(HH:mm/HH:mm:ss, validated string);datetimeyields aDate. Adds theisTime()helper. - Self-contained value parser (
parse) and helpers; nolodashruntime dependency. $title/$infosection-marker keys are skipped during build.- Reference schema in
docs/config.sql.
- Scalar by default: values are parsed to their declared
ValueType("gemini"→"gemini"); use thejsontype for objects, orlistTypefor lists.date/timeare kept as validated strings (usedatetimefor aDate). - Built on
notationv3 (ESM, first-class types). - Toolchain: TypeScript 6, ESM-only
tscbuild, Vitest (istanbul coverage), Biome, GitHub Actions. Shared config viatsconfig-oyandbiome-config-oy.