| 42-wallpapers-social-format-conversion-voice |
03 |
api |
| sharp |
| ffmpeg-static |
| xlsx |
| csv-parse |
| file-type |
| convert-renderer |
| multipart |
| magic-byte |
| content-jobs |
| typescript |
|
| phase |
plan |
provides |
| 42-wallpapers-social-format-conversion-voice |
01 |
ConvertBundle type, convert case in renderContent switch, converter-capabilities service |
|
| phase |
provides |
| 40-content-job-infra |
contentJobStore, contentJobRunner, async job pattern |
|
|
| server/src/services/renderers/convert-renderer.ts — full format conversion router (sharp/ffmpeg/xlsx/AI-bridge) |
| server/src/routes/convert.ts — POST /api/companies/:companyId/convert (multipart, 202) |
| server/src/routes/convert.ts — GET /api/system/converters (capability map) |
| convert route mounted in app.ts |
|
| 42-06 (UI wiring — ConvertPanel calls these endpoints) |
|
| added |
patterns |
|
|
| ffmpeg-static stdin/stdout pipe pattern for audio/video conversion |
| csv-parse/sync for synchronous CSV parsing with column headers |
| xlsx.read/write for XLSX ↔ JSON ↔ CSV round-trips |
| fileTypeFromBuffer magic-byte MIME validation with text-based extension allowlist |
| multer memoryStorage + runSingleFileUpload wrapper (follows chat-files.ts pattern) |
|
|
| created |
modified |
| server/src/routes/convert.ts |
|
| server/src/services/renderers/convert-renderer.ts |
| server/src/app.ts |
|
|
| ffmpegPath cast as unknown as string required — ffmpeg-static typings return string|null but binary is always present; matches documented Pitfall 3 from research |
| TEXT_BASED_EXTENSIONS allowlist prevents false 422 rejections for CSV/JSON/SVG which have no magic bytes |
| sourceMime resolved from extension map rather than multer claim to avoid browser MIME inconsistencies |
| StorageService passed through to convertRoutes for future asset storage but not used in job dispatch path (job runner handles storage) |
|
3min |
2026-04-04 |