Rulvar API reference / @rulvar/rulvar / statementFromRows
Function: statementFromRows()
function statementFromRows(input): ProviderStatement;Defined in: packages/core/dist/index.d.ts
Normalizes raw keyed rows (a parsed CSV, a JSON export) into a ProviderStatement under one explicit StatementColumnMap (RV1703). Fail-closed at the cell: a mapped column whose value cannot be evidence (a non-numeric dollar figure, a fractional or negative token count, an empty response id, an unknown component name) refuses typed with the row index and column name instead of flowing a NaN or a guess into the reconciliation. Absent cells (missing key, null, empty string) mean "the export does not carry this figure" and simply omit the field; a requests row that ends up carrying no dollars, no component split, and no usage at all is refused, because a row without evidence cannot reconcile anything.
Parameters
| Parameter | Type |
|---|---|
input | { kind: "requests" | "categories"; map: StatementColumnMap; rows: readonly Record<string, unknown>[]; } |
input.kind | "requests" | "categories" |
input.map | StatementColumnMap |
input.rows | readonly Record<string, unknown>[] |