Skip to main content

Interface: FieldMapping

Defined in: packages/core/src/domain/value-objects/extractor.ts:21

Declares how to extract a single field from a nested structure within a matched AST node. Used by structured extractors (e.g. scenarios) where each matched node produces an object with multiple fields.

Properties

capture?

readonly optional capture?: string

Defined in: packages/core/src/domain/value-objects/extractor.ts:27

Regex with capture group(s) applied to the extracted text.


childSelector?

readonly optional childSelector?: Selector

Defined in: packages/core/src/domain/value-objects/extractor.ts:25

Selector applied within the matched node to find child values.


followSiblings?

readonly optional followSiblings?: string

Defined in: packages/core/src/domain/value-objects/extractor.ts:38

Regex matching sibling nodes that follow a childSelector match. Matched siblings are appended to the preceding field's result array until a non-matching sibling (or another field's childSelector) is hit. If the pattern contains a capture group, the captured text is used; otherwise the full node text is returned as-is. Enables sequential grouping (e.g. AND/OR items after GIVEN/WHEN/THEN).


from?

readonly optional from?: "content" | "label" | "parentLabel"

Defined in: packages/core/src/domain/value-objects/extractor.ts:23

Source of the field value relative to the matched node.


strip?

readonly optional strip?: string

Defined in: packages/core/src/domain/value-objects/extractor.ts:29

Regex removed from the extracted text.


transform?

readonly optional transform?: ExtractorTransformDeclaration

Defined in: packages/core/src/domain/value-objects/extractor.ts:40

Named post-processing callback applied to each extracted field value.