@mostlyrightmd/core/validator
Interfaces
Section titled “Interfaces”ValidateOptions
Section titled “ValidateOptions”Properties
Section titled “Properties”allowSourceDrift?
Section titled “allowSourceDrift?”
readonlyoptionalallowSourceDrift:string
Non-empty reason string. Presence skips the source-identity check.
retrievedAt?
Section titled “retrievedAt?”
readonlyoptionalretrievedAt:string
Producer-stamped retrieval timestamp. Falls back to rows[i].retrieved_at.
source?
Section titled “source?”
readonlyoptionalsource:string
Producer-stamped source string. Falls back to rows[0].source if absent.
ValidateResult
Section titled “ValidateResult”Properties
Section titled “Properties”retrievedAt
Section titled “retrievedAt”
readonlyretrievedAt:string
rowCount
Section titled “rowCount”
readonlyrowCount:number
source
Section titled “source”
readonlysource:string
Functions
Section titled “Functions”registerValidators()
Section titled “registerValidators()”registerValidators(
validators,formats):void
Contribute compiled validators for schema ids core does not ship.
Idempotent, and it never replaces a core validator: a domain package cannot shadow a canonical schema by registering the same id. Call it once from the domain barrel that owns those schemas.
Parameters
Section titled “Parameters”validators
Section titled “validators”Readonly<Record<string, AjvValidator>>
formats
Section titled “formats”Readonly<Record<string, Readonly<Record<string, FormatKind>>>> = {}
Returns
Section titled “Returns”void
validateRows()
Section titled “validateRows()”validateRows<
Row>(rows,schemaId,opts):ValidateResult
Validate rows against the named canonical schema.
Returns { rowCount, source, retrievedAt } on success.
Throws SchemaValidationError (with Python-vocabulary violations[]) on
structural / dtype / enum / required-column failures, OR
SourceMismatchError when per-row source identity drifts.
Type Parameters
Section titled “Type Parameters”• Row extends Record<string, unknown> = Record<string, unknown>
Parameters
Section titled “Parameters”readonly Row[]
schemaId
Section titled “schemaId”string
ValidateOptions = {}
Returns
Section titled “Returns”Throws
Section titled “Throws”SchemaValidationError — see violations vocabulary in the module header.
Throws
Section titled “Throws”SourceMismatchError — per-row source column doesn’t match resolved source.
Throws
Section titled “Throws”TypeError — allowSourceDrift is non-string.
Throws
Section titled “Throws”RangeError — allowSourceDrift is empty after trim.