46 lines
1.8 KiB
Markdown
46 lines
1.8 KiB
Markdown
# OpenSpec Change: enterprise-qrcode
|
|
|
|
- **Change ID**: enterprise-qrcode
|
|
- **Package**: `@suaveplan/qrcode`
|
|
- **Category**: universal
|
|
- **Target path**: `universal/media/qrcode`
|
|
- **Status**: PROPOSED
|
|
- **Date**: 2026-04-19
|
|
- **Reference spec**: `/mnt/s/web/suaveplan/enterprise/qrcode.md`
|
|
|
|
## Summary
|
|
|
|
QR code generator + reader: numeric / alphanumeric / byte modes, ECC levels L/M/Q/H, module-shape styling, colour gradients, logo overlay with quiet-zone preservation, SVG / PNG / Data URL export, and batch generation with progress reporting.
|
|
|
|
## Current-state audit (genesis)
|
|
|
|
Package does not exist yet — fresh build.
|
|
|
|
## Dependencies
|
|
|
|
- Workspace: `@suaveplan/error`, `@suaveplan/types`
|
|
- External (via catalog): `zod`, `tslib`, `@opentelemetry/api`
|
|
- Dev (via catalog): `vitest`, `@vitest/coverage-istanbul`, `fast-check`, `mitata`
|
|
|
|
## Preserved public surface
|
|
|
|
- `QrGenerator`, `QrError`, `QrErrorCode`
|
|
- `QrReader`
|
|
- `generateBatch`, `generateBatchAsync`, `generateBatchWithProgress`
|
|
- `toDataUrl`, `toSvg`
|
|
- `generateStyledSvg`, `getLogoModuleArea`
|
|
- Codes: `QrCodeErrorCode`, `registerQrErrorCodes`
|
|
- Types: `AlignmentPatternPositions`, `BatchItem`, `BatchOptions`, `BatchProgressCallback`, `EcInfo`, `ErrorCorrectionLevel`, `ModuleShape`, `QrCode`, `QrExportOptions`, `QrGradient`, `QrImageData`, `QrLogoOptions`, `QrMatrix`, `QrMode`, `QrOptions`, `QrSegment`, `StyledQrOptions`
|
|
|
|
## New genesis additions
|
|
|
|
- Codes: `QRCODE.ENCODE_FAILED`, `QRCODE.DECODE_FAILED`, `QRCODE.CAPACITY_EXCEEDED`, `QRCODE.LOGO_TOO_LARGE`.
|
|
- Zod schemas for every option type.
|
|
- OTel histograms `qrcode.encode.duration_ms`, `qrcode.decode.duration_ms`; counters.
|
|
- Property tests: `QrReader.read(QrGenerator.generate(x)) === x` at ECC level H.
|
|
|
|
## Impact
|
|
|
|
- Adds one new package: `universal/media/qrcode`
|
|
- Adds one new spec capability: `qrcode`
|