Interface: AstmMessage
A parsed ASTM message: the header, the ordered records (the header is also
records[0]), the resolved delimiters, and the accumulated warnings.
Example
import { parseAstmRecords } from "@cosyte/astm";
const msg = parseAstmRecords("H|\\^&\rL|1\r");
msg.header.delimiters.field; // "|"
msg.records.length; // 2
Properties
classification
readonlyclassification:AstmMessageClassification
The host-query classification of this message - whether it is a request (Q
present), a result upload, an order download, or indeterminate. Gate on
AstmMessageClassification.isHostQueryRequest before reading records as
results.
delimiters
readonlydelimiters:Delimiters
The delimiters the first header declared.
A stream may carry several messages (H … L), and a later header may declare a different set,
which is honored from that header onward. So this is not necessarily the set every record was
read with - each header reports its own on HeaderRecord.delimiters, and a change is
flagged ASTM_RECORD_DELIMITERS_REDECLARED.
header
readonlyheader:HeaderRecord
The first header in the stream. A multi-header stream's later headers are in AstmMessage.records.
profile?
readonlyoptionalprofile?:object
The vendor profile that was active for this parse, when one applied - its
name and resolved lineage (attribution only; the profile object itself is
not embedded). Absent when no profile applied. A profile that tolerated a
deviation shows up as a PROFILE_QUIRK_APPLIED entry in warnings, not
here.
lineage
readonlylineage: readonlystring[]
name
readonlyname:string
records
readonlyrecords: readonlyAstmRecord[]
warnings
readonlywarnings: readonlyAstmRecordWarning[]