Repository navigation
feat(media): normalized media download (S3 + on-demand endpoint, per tenant) - #14
Conversation
…-tenant storage, on-demand endpoint - types: media download pointers in inboundMedia; downloadMediaInput; tenant media-storage mode - core: WaEngine.downloadMedia; MediaService (resolveForDispatch s3 + download on-demand); MediaStorage interface; TenantRepository (cached) - engines: stateless downloadMedia (baileys downloadContentFromMessage, zapo downloadMediaMessage); mappers emit base64 media pointers - db: migration 0003 tenants.media_storage - api: S3 storage (@aws-sdk/client-s3, public URL), POST /sessions/:id/media/download, GET/PATCH /tenant/settings, dispatch resolves media before webhook, OpenAPI docs - config: MEDIA_STORAGE + S3_* env vars and .env.example - sdk: media.download + tenant settings - tests across packages; branch coverage >=70% Closes #6
|
Warning Review limit reached
More reviews will be available in 46 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (32)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implementa download de mídia recebida, normalizado entre as duas engines, com dois modos por tenant. Closes #6.
Modos (por tenant:
default|none|s3)messageentrega os ponteiros da mídia (directPath,url,mediaKey,fileEncSha256,fileSha256em base64). O cliente fazPOST /sessions/:id/media/downloadcom{ type, media }e recebe os bytes.media.urlpúblico +stored:'s3'(ponteiros removidos).Download é stateless nas duas engines (baileys
downloadContentFromMessage, zapodownloadMediaMessage).Principais mudanças
@multi-wa/types: ponteiros eminboundMedia;downloadMediaInput;mediaStorageMode/tenantSettings.@multi-wa/core:WaEngine.downloadMedia;MediaService(resolveForDispatch+download);MediaStorage;TenantRepository(cache).downloadMedia+ mappers emitindo ponteiros base64.0003tenants.media_storage.@aws-sdk/client-s3, URL pública),POST /sessions/:id/media/download,GET/PATCH /tenant/settings, resolução de mídia antes do dispatch, OpenAPI.MEDIA_STORAGE+S3_*no.env.example.wa.media.download+wa.tenant.getSettings/updateSettings.Verificação
test:coveragebranches 76% (>70%), 27 test files./docs/json: rotasmedia/download(resposta binária) etenant/settings;WebhookDeliverycom campos de mídia.tenants.media_storagedefault'default').