Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(sdk): voice-status drift — JS type union, dashboard playback, stale SDK docs
Yudhi Armyndharisedf8739641d3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a1b02a7a7..95100d241 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- A media-storage root the app cannot write to is caught at boot with a clear error, instead of failing on the first write (#1066).- The bundled `docker-compose.yml` now forwards the `SEND_PACING_*`, `MEDIA_CONVERSION_*`/`FFMPEG_PATH` and session-ownership (`NODE_ID`, `NODE_URL`, lease/sweep) variables — previously these features could not be enabled from `.env` in a compose deployment at all.- The four label write tools (`LabelUpsert`, `LabelDelete`, `LabelAddToChat`, `LabelRemoveFromChat`) answered `Internal error` over MCP even though the write had succeeded on WhatsApp, prompting agents to retry a completed operation; they now return `{ success: true }`.+- The dashboard status viewer now plays a voice status with an audio player instead of rendering it as a broken image, the JS SDK's `StatusRecord.type` includes `'voice'`, and the SDK README's method tables and three misplaced doc comments were brought back in line with the actual surface.- Fetching a status's media that S3 retention already removed answers 404 instead of 500 (the local-storage miss already did), and server-side media conversion is bounded to `MEDIA_CONVERSION_CONCURRENCY` (default 2) concurrent `ffmpeg` processes with a short queue — saturation answers 503 instead of stacking processes.- **Baileys message-action targeting:** star/pin/unpin/react/delete now verify the stored message belongs to the requested chat (a mismatched pair answered success while writing under the wrong conversation), pin/unpin/react/delete resolve LID-migrated contacts like every other send, and tagging/untagging a chat's label folds the neutral id to the engine form so the write lands on the real chat instead of a phantom index.- **whatsapp-web.js raw-id extraction hardening:** listing a label's chats no longer 500s when a labelled chat was deleted, and the channel list, channel creation and group-invite preview now read the `$1` fallback for the WA Web property rename — previously a renamed build returned channel ids as the literal string `"undefined"` and turned every valid invite preview into a false 404.diff --git a/dashboard/src/components/chats/StatusMedia.tsx b/dashboard/src/components/chats/StatusMedia.tsxindex 364d732bc..10d30a1f7 100644--- a/dashboard/src/components/chats/StatusMedia.tsx+++ b/dashboard/src/components/chats/StatusMedia.tsx@@ -12,7 +12,7 @@ function StatusMedia({}: {sessionId: string | null;statusId: string;- type: 'image' | 'video';+ type: 'image' | 'video' | 'audio';}) {const { t } = useTranslation();const [src, setSrc] = useState<string | null>(null);@@ -43,6 +43,8 @@ function StatusMedia({if (error) return <span className="status-media-placeholder">{t('chats.status.mediaUnavailable')}</span>;if (!src) return null;if (type === 'video') return <video className="channel-media" src={src} controls />;+ // Voice statuses: the blob is an Ogg/Opus voice note — an <img> would render as a broken image.+ if (type === 'audio') return <audio className="channel-media" src={src} controls />;return <img className="channel-media" src={src} alt="" />;}diff --git a/dashboard/src/pages/Chats.tsx b/dashboard/src/pages/Chats.tsxindex 925d53476..e25f64062 100644--- a/dashboard/src/pages/Chats.tsx+++ b/dashboard/src/pages/Chats.tsx@@ -1003,7 +1003,7 @@ export function Chats() {<StatusMediasessionId={selectedSessionId || null}statusId={item.id}- type={item.type === 'video' ? 'video' : 'image'}+ type={item.type === 'video' ? 'video' : item.type === 'voice' ? 'audio' : 'image'}/>)}{item.caption && <MessageBody text={item.caption} className="message-text" />}diff --git a/sdk/README.md b/sdk/README.mdindex f70790afa..a22d884c1 100644--- a/sdk/README.md+++ b/sdk/README.md@@ -10,36 +10,36 @@ The wire types live in a dedicated module (`types.ts` / `types.py` / `model/`)so they can later be regenerated by an OpenAPI codegen pass without touching thehand-written resource methods.-| Language | Package | Notes |-| ----------------------- | ------------------------------- | --------------------------- |-| JavaScript / TypeScript | [`@rmyndharis/openwa`](javascript/) | dual ESM/CJS, bundled types |-| Python | [`rmyndharis-openwa`](python/) | sync (httpx), PEP 561 typed |-| PHP | [`rmyndharis/openwa`](php/) | sync (Guzzle, PHP 8.1+) |-| Java | [`com.rmyndharis:openwa`](java/) | sync (java.net.http + Gson, Java 17) |+| Language | Package | Notes |+| ----------------------- | -------------------------------------------- | ----------------------------------------------------------- |+| JavaScript / TypeScript | [`@rmyndharis/openwa`](javascript/) | dual ESM/CJS, bundled types |+| Python | [`rmyndharis-openwa`](python/) | sync (httpx), PEP 561 typed |+| PHP | [`rmyndharis/openwa`](php/) | sync (Guzzle, PHP 8.1+) |+| Java | [`com.rmyndharis:openwa`](java/) | sync (java.net.http + Gson, Java 17) || Go | [`github.com/rmyndharis/OpenWA/sdk/go`](go/) | stdlib-only, context-first, injectable transport (Go 1.22+) |## CoverageAll five SDKs expose the same fluent resource surface:-| Resource | Methods |-| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `sessions` | list, get, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, stats |-| `messages` | list, sendText, sendImage/Video/Audio/Document/Sticker, sendLocation, sendContact, sendTemplate, sendPoll, reply, forward, react, delete, editMessage, history, reactions, media, pin, unpin, star, votePoll, sendBulk, batchStatus, cancelBatch |-| `contacts` | list, get, check, profilePicture, profilePictures, phone, upsert, delete, block, unblock |-| `groups` | list, get, create, joinGroup, add/remove/promote/demoteParticipants, setSubject, setDescription, get/updateGroupSettings, leave, getPicture, setPicture, deletePicture, inviteCode, revokeInviteCode |-| `webhooks` | list, get, create, update, delete, test |-| `chats` | list, markRead, markUnread, archive, clearMessages, delete, sendState |-| `labels` | list, get, forChat, addToChat, removeFromChat _(WhatsApp Business)_ |-| `channels` | list, get, messages, subscribe, unsubscribe _(Newsletters)_ |-| `catalog` | info, products, product, sendProduct, sendCatalog _(WhatsApp Business)_ |-| `status` | list, fromContact, media, sendText, sendImage, sendVideo, sendVoice, delete _(Stories)_ |-| `search` | search _(Operator)_ |-| `templates`| list, get, create, update, delete |-| `profile` | setProfileName, setProfileStatus, setProfilePicture _(OPERATOR)_ |-| `calls` | rejectCall _(OPERATOR)_ |-| `media` | conversionStatus, convertVoice, convertVideo _(OPERATOR)_ |-| `health` | check, live, ready |+| Resource | Methods |+| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |+| `sessions` | list, get, create, delete, start, stop, logout, forceKill, getQrCode, requestPairingCode, stats |+| `messages` | list, sendText, sendImage/Video/Audio/Document/Sticker, sendLocation, sendContact, sendTemplate, sendPoll, reply, forward, react, delete, editMessage, history, reactions, media, pin, unpin, star, votePoll, sendBulk, batchStatus, cancelBatch |+| `contacts` | list, get, check, profilePicture, profilePictures, phone, upsert, delete, block, unblock |+| `groups` | list, get, create, joinGroup, joinInfo, add/remove/promote/demoteParticipants, setSubject, setDescription, get/updateGroupSettings, leave, getPicture, setPicture, deletePicture, inviteCode, revokeInviteCode |+| `webhooks` | list, get, create, update, delete, test |+| `chats` | list, markRead, markUnread, archive, clearMessages, delete, sendState, subscribePresence, getPresence |+| `labels` | list, get, chats, forChat, upsert, delete, addToChat, removeFromChat _(WhatsApp Business)_ |+| `channels` | list, get, messages, create, delete, mute, subscribe, unsubscribe _(Newsletters)_ |+| `catalog` | info, products, product, sendProduct, sendCatalog _(WhatsApp Business)_ |+| `status` | list, fromContact, media, sendText, sendImage, sendVideo, sendVoice, delete _(Stories)_ |+| `search` | search _(Operator)_ |+| `templates` | list, get, create, update, delete |+| `profile` | setProfileName, setProfileStatus, setProfilePicture _(OPERATOR)_ |+| `calls` | rejectCall _(OPERATOR)_ |+| `media` | conversionStatus, convertVoice, convertVideo _(OPERATOR)_ |+| `health` | check, live, ready |> ⚠️ Endpoints requiring an `OPERATOR`-level API key are noted in the inline> docs. Operator-only modules (`docker`, `metrics`, `infra`, `plugins`, `mcp`,diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/StatusRecord.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/StatusRecord.javaindex 6de646484..a14532ca0 100644--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/StatusRecord.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/StatusRecord.java@@ -9,7 +9,7 @@ public record StatusRecord(String id,/** Whose story this is. */StatusContact contact,- /** One of {@code text}, {@code image} or {@code video}. */+ /** One of {@code text}, {@code image}, {@code video} or {@code voice}. */String type,/** Text body for a text status, caption for an image/video one. */String caption,diff --git a/sdk/javascript/src/resources/channels.ts b/sdk/javascript/src/resources/channels.tsindex 8191a5ae4..8e6a993e9 100644--- a/sdk/javascript/src/resources/channels.ts+++ b/sdk/javascript/src/resources/channels.ts@@ -45,7 +45,6 @@ export class ChannelsResource {});}- /** Subscribe to a channel using its invite code. Requires an OPERATOR-level key. *//** Create a channel. The account owns it, which is what makes `delete` possible later. */create(sessionId: string, body: CreateChannelRequest): Promise<ChannelRecord> {return this.client.request<ChannelRecord>({@@ -77,6 +76,7 @@ export class ChannelsResource {});}+ /** Subscribe to a channel using its invite code. Requires an OPERATOR-level key. */subscribe(sessionId: string, body: SubscribeChannelRequest): Promise<ChannelRecord> {return this.client.request<ChannelRecord>({method: 'POST',diff --git a/sdk/javascript/src/resources/groups.ts b/sdk/javascript/src/resources/groups.tsindex 719680205..7bdf9f6c5 100644--- a/sdk/javascript/src/resources/groups.ts+++ b/sdk/javascript/src/resources/groups.ts@@ -161,7 +161,6 @@ export class GroupsResource {});}- /** Get the group invite code and link. *//** Get the group's picture URL (null when it has none). */getPicture(sessionId: string, groupId: string): Promise<{ url: string | null }> {return this.client.request<{ url: string | null }>({@@ -187,6 +186,7 @@ export class GroupsResource {});}+ /** Get the group invite code and link. */inviteCode(sessionId: string, groupId: string): Promise<InviteCodeResponse> {return this.client.request<InviteCodeResponse>({method: 'GET',diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.tsindex 107cd9632..0d9ce63bf 100644--- a/sdk/javascript/src/types.ts+++ b/sdk/javascript/src/types.ts@@ -614,10 +614,10 @@ export interface JoinGroupResponse {groupId: Jid;}-/** Group settings as returned by `GET /sessions/:id/groups/:groupId/settings`. *//** Who may add participants to a group. */export type GroupMemberAddMode = 'all' | 'admins';+/** Group settings as returned by `GET /sessions/:id/groups/:groupId/settings`. */export interface GroupSettingsResponse {/** Only admins can send messages (announce group). */announce?: boolean;@@ -779,7 +779,7 @@ export interface StatusRecord {name?: string;pushName?: string;};- type: 'text' | 'image' | 'video';+ type: 'text' | 'image' | 'video' | 'voice';/** Text body for a text status, caption for an image/video one. */caption?: string;mediaUrl?: string;