pediatric-ai-scribe-v3/src/routes
Daniel 5ebabb633a refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe
Same CJS-compatible pattern as batch 1 (import express = require;
const {...} = require for internal utils; export = router). No
behavior change — TS only strips annotations during compile.

AI route touchpoints:
  /api/generate-hpi-encounter, /generate-hpi-dictation  → hpi.ts
  /api/generate-soap                                    → soap.ts
  /api/refine, /shorten, /clarify                       → refine.ts
  /api/text-to-speech                                   → tts.ts
  /api/transcribe, /transcribe/status                   → transcribe.ts

All five handlers retain identical request/response shapes; the
shared/types.ts contract was defined on day 2 from these very files.

One fetch() typing fix: the transcribe route's LiteLLM branch uses
DOM fetch, but the file imports Express's Response type, so the
`.then((r: Response) => ...)` annotation was shadowing the global
Response. Removed the explicit annotation — tsc infers correctly.

Progress: 9 of 54 files migrated. tsc --noEmit green.
2026-04-23 19:36:43 +02:00
..
admin.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
adminConfig.js fix: auth/API logging to Loki, TTS voice auto-detection, STT ElevenLabs support 2026-04-19 21:26:49 +02:00
adminMilestones.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
audioBackups.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
auth.js fix(security): timing-safe forgot-password + redact log file writer 2026-04-22 01:01:00 +02:00
billing.js Batch of security + scale fixes 2026-04-14 05:24:40 +02:00
chartReview.js Prompt-injection wrap: remaining AI routes 2026-04-14 05:31:54 +02:00
documents.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
encounters.js feat(security): AES-256-GCM at-rest encryption for encounters and memories 2026-04-22 01:01:00 +02:00
extensions.ts refactor(ts): day 3 batch 1 — convert 4 small route files 2026-04-23 19:31:20 +02:00
hospitalCourse.js Prompt-injection wrap: remaining AI routes 2026-04-14 05:31:54 +02:00
hpi.ts refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
learningAdmin.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
learningAI.js feat: neonatal calculator, DOCX/PPTX/ODT/EPUB support, gateway-agnostic URL helper, TTS/STT fixes 2026-04-19 02:17:06 +02:00
learningHub.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
logs.ts refactor(ts): day 3 batch 1 — convert 4 small route files 2026-04-23 19:31:20 +02:00
memories.js feat(security): AES-256-GCM at-rest encryption for encounters and memories 2026-04-22 01:01:00 +02:00
milestones.js Prompt-injection wrap: remaining AI routes 2026-04-14 05:31:54 +02:00
nextcloud.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
oidc.js Fix local-auth sections not showing for normal users + backup-code modal signature 2026-04-14 04:43:07 +02:00
peGuide.js fix(pe-guide): correct route imports (prod 500 regression) 2026-04-23 18:58:38 +02:00
refine.ts refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
sessions.ts refactor(ts): day 3 batch 1 — convert 4 small route files 2026-04-23 19:31:20 +02:00
sickVisit.js Prompt-injection wrap: remaining AI routes 2026-04-14 05:31:54 +02:00
soap.ts refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
transcribe.ts refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
tts.ts refactor(ts): day 3 batch 2 — hpi, soap, refine, tts, transcribe 2026-04-23 19:36:43 +02:00
userPreferences.ts refactor(ts): day 3 batch 1 — convert 4 small route files 2026-04-23 19:31:20 +02:00
wellVisit.js Prompt-injection wrap: remaining AI routes 2026-04-14 05:31:54 +02:00