wacrm/src/lib/whatsapp
Arnas Donauskas 4fa29b7a45
refactor(inbox): record voice notes client-side, drop server ffmpeg
Follow-up to #259. Voice notes are encoded to Ogg/Opus in the browser via
opus-recorder (small WASM encoder, lazy-loaded on record), so there's no
server-side transcode and nothing to provision on the host. The server
stores the .ogg like any other attachment; WhatsApp renders it as a voice
note.

- Composer: MediaRecorder + /api/whatsapp/transcode-audio replaced with
  opus-recorder. Encoder worker vendored at public/opus/encoderWorker.min.js
  (no install-time download to fail), ignored by eslint + prettier.
- Removed the transcode route, the audio-transcode lib + tests, the
  ffmpeg-static dep + ambient types, the FFMPEG_PATH env doc, and the
  unused transcodeAudio rate limit.
- Added opus-recorder ambient types.

Still behind the 'chat_media' beta flag with per-kind size caps.
typecheck/lint/build green; 414 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 11:27:12 +03:00
..
encryption.test.ts test: foundational Vitest suite for security + critical pure logic 2026-05-18 16:06:02 +03:00
encryption.ts security: switch WhatsApp token encryption from AES-CBC to AES-GCM 2026-04-20 20:25:48 +03:00
meta-api.media.test.ts feat(inbox): send photo, video, document & voice in chat (#213) 2026-06-18 10:07:16 +03:00
meta-api.test.ts feat(flows): foundation for interactive WhatsApp messages (PR 1/4) 2026-05-22 13:12:27 +03:00
meta-api.ts feat(inbox): send photo, video, document & voice in chat (#213) 2026-06-18 10:07:16 +03:00
phone-utils.test.ts test: foundational Vitest suite for security + critical pure logic 2026-05-18 16:06:02 +03:00
phone-utils.ts feat: auto-retry with phone variants on Meta "not in allowed list" 2026-04-16 21:34:53 +03:00
registration.test.ts fix(whatsapp): register phone numbers on Meta + verify subscription state 2026-05-29 18:12:38 +02:00
template-components.test.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-components.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-lifecycle.test.ts feat(templates): edit / resubmit / delete lifecycle endpoints 2026-05-29 15:57:24 +02:00
template-row-guard.ts chore(templates): polish pass from senior backend / FE / UX review 2026-05-29 17:50:11 +02:00
template-send-builder.test.ts feat(templates): media headers + URL/copy-code button params on send 2026-05-29 16:38:15 +02:00
template-send-builder.ts feat(templates): media headers + URL/copy-code button params on send 2026-05-29 16:38:15 +02:00
template-status-normalize.test.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-status-normalize.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-validators.test.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-validators.ts feat(templates): submit-to-Meta endpoint + component-based form builder 2026-05-29 15:34:58 +02:00
template-webhook.test.ts feat(templates): webhook handler for real-time status / quality updates 2026-05-29 16:20:50 +02:00
template-webhook.ts feat(templates): webhook handler for real-time status / quality updates 2026-05-29 16:20:50 +02:00
webhook-signature.test.ts test: foundational Vitest suite for security + critical pure logic 2026-05-18 16:06:02 +03:00
webhook-signature.ts fix(webhook): require META_APP_SECRET, fail closed 2026-04-20 18:54:52 +03:00