@otm/rpo-decoder (0.1.0)
Installation
@otm:registry=npm install @otm/rpo-decoder@0.1.0"@otm/rpo-decoder": "0.1.0"About this package
@otm/rpo-decoder
The canonical shared option-code decode engine for the OTM stack. Brand-agnostic: parse a pasted or OCR'd blob into 3-character option codes, look each up in a brand's table, and group the results by category. Zero runtime dependencies.
Published to the Gitea npm registry (@otm:registry in each consumer's
.npmrc). Raw-TypeScript package (no build step) — consumers transpile it via
Next's transpilePackages, exactly like @otm/account-panel / @otm/vin-decoder.
Engine only — data lives in the consumer
The per-brand code tables (GM RPO ~17k, VAG PR ~14k, BMW/Mercedes/Mopar) are
generated data and are intentionally not in this package — they'd bloat it and
break the consumer's lazy-loaded-per-brand chunking. This package is the stable
engine + types; the caller supplies the CodeTable.
Consumers (single source of truth — do NOT fork the logic back)
- rpo.poweredbyotm.com —
src/lib/decode.tsre-exports this package. Brand registry + generatedsrc/data/<id>-codes.tstables stay in the app.
API
import { decodeBlob, groupByCategory, type CodeTable } from "@otm/rpo-decoder";
const table: CodeTable = await loadBrandTable("gm"); // app supplies the data
const results = decodeBlob(table, "GU6 L83 Z71 NHT");
const grouped = groupByCategory(results); // by category, Unknown last
Also exports parseCodes (blob → deduped 3-char tokens) and lookup
(single-code resolve).
Publish
cd packages/rpo-decoder
npm publish
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| typescript | 5.5.3 |