Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
feat(sdk): add the status.received event and refresh StatusRecord
Yudhi Armyndharis746e55b76cea
diff --git a/sdk/go/client_test.go b/sdk/go/client_test.goindex ecf0bfb0c..9b8decdc4 100644--- a/sdk/go/client_test.go+++ b/sdk/go/client_test.go@@ -993,6 +993,7 @@ func TestWebhookEventWireValues(t *testing.T) {EventGroupLeave: "group.leave",EventGroupUpdate: "group.update",EventCallReceived: "call.received",+ EventStatusReceived: "status.received",EventAll: "*",}for got, w := range want {diff --git a/sdk/go/types_webhook.go b/sdk/go/types_webhook.goindex 710914528..6118df670 100644--- a/sdk/go/types_webhook.go+++ b/sdk/go/types_webhook.go@@ -25,6 +25,7 @@ const (EventGroupLeave WebhookEvent = "group.leave"EventGroupUpdate WebhookEvent = "group.update"EventCallReceived WebhookEvent = "call.received"+ EventStatusReceived WebhookEvent = "status.received"EventAll WebhookEvent = "*")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 264a6b458..6de646484 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@@ -4,10 +4,6 @@ package com.rmyndharis.openwa.model;* One status/story from the GET status endpoints ({@code list}/{@code fromContact}), which answer a* {@link StatusListResult} envelope. Mirrors the backend {@code Status} — the engine payload is* returned as-is, with no DTO in between. Optional fields are {@code null} when absent.- *- * <p>{@code mediaUrl}, {@code backgroundColor} and {@code font} are declared by the backend but no- * engine populates them on a read yet: whatsapp-web.js maps none of them, and Baileys cannot read- * statuses at all. They are here for forward compatibility — do not expect them on a response today.*/public record StatusRecord(String id,diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/WebhookEvent.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/WebhookEvent.javaindex b224cf888..93bf4752c 100644--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/WebhookEvent.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/WebhookEvent.java@@ -40,6 +40,8 @@ public enum WebhookEvent {GROUP_UPDATE,@SerializedName("call.received")CALL_RECEIVED,+ @SerializedName("status.received")+ STATUS_RECEIVED,@SerializedName("*")ALL}diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.tsindex 75a8d2df8..172d41881 100644--- a/sdk/javascript/src/types.ts+++ b/sdk/javascript/src/types.ts@@ -496,6 +496,7 @@ export type WebhookEvent =| 'group.leave'| 'group.update'| 'call.received'+ | 'status.received'| '*';export interface WebhookFilterCondition {@@ -588,9 +589,6 @@ export interface StatusRecord {type: 'text' | 'image' | 'video';/** Text body for a text status, caption for an image/video one. */caption?: string;- // Declared by the backend `Status`, but no engine populates them on a read yet: whatsapp-web.js- // maps neither, and Baileys does not support reading statuses at all. Present for forward- // compatibility — do not expect them on a response today.mediaUrl?: string;backgroundColor?: string;font?: number;diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.pyindex 3d8f4268a..77354bac5 100644--- a/sdk/python/openwa/types.py+++ b/sdk/python/openwa/types.py@@ -24,7 +24,7 @@ WebhookEvent = Literal["message.received", "message.sent", "message.ack", "message.failed", "message.revoked","message.reaction", "message.edited", "session.status", "session.qr", "session.authenticated","session.disconnected", "session.reconnect_loop",- "group.join", "group.leave", "group.update", "call.received",+ "group.join", "group.leave", "group.update", "call.received", "status.received","*",]@@ -565,9 +565,7 @@ class StatusContact(TypedDict, total=False):# One status/story from the GET status endpoints (``list``/``from_contact``), which# answer a ``{"statuses": [...]}`` envelope. Mirrors the backend ``Status`` — the engine# payload is returned as-is, with no DTO in between. ``timestamp``/``expiresAt`` are-# ISO 8601 strings (``Date`` on the server, serialized). ``mediaUrl``/``backgroundColor``/-# ``font`` are declared by the backend but no engine populates them on a read yet-# (whatsapp-web.js maps none of them; Baileys cannot read statuses at all).+# ISO 8601 strings (``Date`` on the server, serialized).class StatusRecord(TypedDict, total=False):id: strcontact: StatusContact