Skip to main content
Version: v0.0.6

Interface: AstmMessageClassification

The message-level classification from the host-query flow. isHostQueryRequest is the single boolean a consumer should gate on before treating records as results: it is true iff a Q record is present.

Example

import { parseAstmRecords } from "@cosyte/astm";
const req = parseAstmRecords("H|\\^&\rP|1\rQ|1|^SPEC-7||ALL\rL|1\r");
req.classification.kind; // "host-query"
req.classification.isHostQueryRequest; // true, never read its records as results

Properties

hasOrders

readonly hasOrders: boolean

At least one O (order) record is present.


hasQuery

readonly hasQuery: boolean

At least one Q (request-information) record is present.


hasResults

readonly hasResults: boolean

At least one R (result) record is present.


isHostQueryRequest

readonly isHostQueryRequest: boolean

true iff kind === "host-query" (a Q record is present), the safety surface: gate on this before treating records as results, so a query is never misread as a result upload.


kind

readonly kind: AstmMessageKind

The message kind.