Tony Moon tonym
  • Joined on 2025-09-14

@otm/rpo-decoder (0.1.0)

Published 2026-07-05 02:31:49 +00:00 by tonym

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.comsrc/lib/decode.ts re-exports this package. Brand registry + generated src/data/<id>-codes.ts tables 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
Details
npm
2026-07-05 02:31:49 +00:00
0
latest
2.1 KiB
Assets (1)
Versions (1) View all
0.1.0 2026-07-05