Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
feat(contract): remove the send-catalog route no engine can fulfil
Yudhi Armyndharis89966a52bc09
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdindex 51dd7874e..b51da232d 100644--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -1434,7 +1434,7 @@ Get the processing status and progress of a bulk batch.### Send pacing (opt-in, `429 SEND_PACING_LIMITED`)Every outbound message send — the `messages/send-*` routes, `messages/edit`, `messages/forward`,-bulk batches, status posts and both catalog sends (`messages/send-product`, `messages/send-catalog`) — passes an optional pacing governor before+bulk batches, status posts and the catalog send (`messages/send-product`) — passes an optional pacing governor beforeit reaches WhatsApp. Actions on existing messages (react, vote, pin, star) are not sends and arenot paced. It is **off by default**: unless `SEND_PACING_ENABLED=true`, nothing is refused and noextra work is done.@@ -1562,7 +1562,7 @@ Nine `send-*` routes accept an optional `quotedMessageId`: `send-text` above, ana contact card or a poll — not only text. `POST .../messages/reply` is unchanged and remains the textshorthand.-`send-template`, `send-bulk`, `send-product` and `send-catalog` do NOT accept the field, and reject it+`send-template`, `send-bulk` and `send-product` do NOT accept the field, and reject itas an unknown property.```json@@ -3489,49 +3489,6 @@ On whatsapp-web.js the readiness guard runs before the refusal, so a session tha**Errors:** `400` missing `chatId`/`productId`, wrong types, or any field not on the DTO · `401` missing/invalid API key · `403` API-key role below OPERATOR · `404` `Session <sessionId> not found or not connected` · `409` session present but not READY (whatsapp-web.js only) · `500` engine error-#### POST /api/sessions/:sessionId/messages/send-catalog--Send the business catalog link to a chat. Note: this route lives under the `/messages` path but belongs to the catalog module.--**Auth:** API key (OPERATOR)--**Path parameters**--| Name | Type | Description |-| ----------- | ------ | -------------------- |-| `sessionId` | string | WhatsApp session id. |--**Request body** — `SendCatalogDto`--| Field | Type | Required | Constraints | Description |-| -------- | ------ | -------- | ----------- | ------------------------------ |-| `chatId` | string | Yes | `@IsString` | Target chat/recipient id. |-| `body` | string | No | `@IsString` | Optional message body/caption. |--```json-{- "chatId": "[email protected]",- "body": "Browse our full catalog here"-}-```--**Response** `501` (not implemented on either engine)--```json-{- "statusCode": 501,- "message": "Operation not supported by the active engine: sendCatalog",- "error": "Not Implemented"-}-```--No engine implements this. whatsapp-web.js and Baileys both raise `EngineNotSupportedError`, so the-route cannot return a success body on any deployment; it is documented here because it is mounted.-On whatsapp-web.js the readiness guard runs before the refusal, so a session that exists but is not-`READY` gets `409` instead of `501`; Baileys refuses unconditionally.--**Errors:** `400` missing/invalid `chatId` or any non-DTO field · `401` missing/invalid API key · `403` API-key role below OPERATOR · `404` `Session <sessionId> not found or not connected` · `409` session present but not READY (whatsapp-web.js only) · `500` engine error-#### GET /api/sessions/:sessionId/channelsList all channels/newsletters the session is subscribed to.diff --git a/docs/07-api-collection.md b/docs/07-api-collection.mdindex 08bef3f0a..0a704da1b 100644--- a/docs/07-api-collection.md+++ b/docs/07-api-collection.md@@ -907,7 +907,7 @@ curl -X DELETE "$BASE/api/sessions/$SESSION_ID/templates/$TEMPLATE_ID" \### 07.8 Catalog & Channels-The catalog routes work on the **Baileys** engine (WhatsApp Business accounts) — `getCatalog`/`getProducts`/`getProduct` read the session's own catalog and `sendProduct` sends a native product card. On **whatsapp-web.js** they raise `EngineNotSupportedError` (`501 Not Implemented`) — the library has no catalog API at all; on that engine the readiness check runs first, so a session that exists but is not yet READY returns `409` instead. The exception is `send-catalog`, which returns `501` on **both** engines (no catalog-share message type exists in either library). The per-engine gaps are listed in `docs/29-engine-capability-matrix.md`. The channel routes that follow are a separate group with real engine support.+The catalog routes work on the **Baileys** engine (WhatsApp Business accounts) — `getCatalog`/`getProducts`/`getProduct` read the session's own catalog and `sendProduct` sends a native product card. On **whatsapp-web.js** they raise `EngineNotSupportedError` (`501 Not Implemented`) — the library has no catalog API at all; on that engine the readiness check runs first, so a session that exists but is not yet READY returns `409` instead. The per-engine gaps are listed in `docs/29-engine-capability-matrix.md`. The channel routes that follow are a separate group with real engine support.#### GET /api/sessions/:sessionId/catalog@@ -947,17 +947,6 @@ curl -X POST "$BASE/api/sessions/$SESSION_ID/messages/send-product" \-d '{ "chatId": "[email protected]", "productId": "PROD_12345", "body": "Check out this item!" }'```-#### POST /api/sessions/:sessionId/messages/send-catalog--Send the business catalog link to a chat (OPERATOR key required). Returns `501` on both engines.--```bash-curl -X POST "$BASE/api/sessions/$SESSION_ID/messages/send-catalog" \- -H "X-API-Key: $API_KEY" \- -H "Content-Type: application/json" \- -d '{ "chatId": "[email protected]", "body": "Browse our full catalog here" }'-```-#### GET /api/sessions/:sessionId/channelsList subscribed channels/newsletters.diff --git a/docs/18-sdk-design.md b/docs/18-sdk-design.mdindex 0d5f2e5ec..ec960690c 100644--- a/docs/18-sdk-design.md+++ b/docs/18-sdk-design.md@@ -36,7 +36,7 @@ All five SDKs expose the same fluent surface:| `chats` | list, subscribePresence, getPresence, markRead, markUnread, archive, pin, mute, clearMessages, delete, sendState || `labels` | list, get, chats, upsert, delete, forChat, addToChat, removeFromChat _(WhatsApp Business)_ || `channels` | list, get, messages, create, delete, mute, subscribe, unsubscribe, demoteAdmin, transferOwnership _(Newsletters)_ |-| `catalog` | info, products, product, sendProduct, sendCatalog _(WhatsApp Business)_ |+| `catalog` | info, products, product, sendProduct _(WhatsApp Business)_ || `status` | list, fromContact, media, sendText, sendImage, sendVideo, sendVoice, delete _(Stories)_ || `search` | search || `templates` | list, get, create, update, delete |@@ -282,7 +282,6 @@ Media bodies share the `SendMediaRequest` shape: `{ chatId, url? | base64?, mime| `products` | `products(sessionId, query?)` | List catalog products; returns `{ products, pagination }`. || `product` | `product(sessionId, productId)` | Get a single product by id. || `sendProduct` | `sendProduct(sessionId, body)` | Send a product message. **OPERATOR** |-| `sendCatalog` | `sendCatalog(sessionId, body)` | Send a catalog link message. **OPERATOR** |#### `status` _(Stories)_@@ -645,13 +644,12 @@ Resources are accessed as properties on the client (e.g. `client.messages`). All#### `client.catalog` _(WhatsApp Business)_-| Method | Signature | Description |-| -------------- | ------------------------------------------------------- | ----------------------------------------- |-| `info` | `info(session_id) -> CatalogInfo` | Get catalog info. |-| `products` | `products(session_id, query=None) -> PaginatedProducts` | List products (paginated). |-| `product` | `product(session_id, product_id) -> CatalogProduct` | Get one product. |-| `send_product` | `send_product(session_id, body) -> MessageResponse` | Send a product message. **OPERATOR** |-| `send_catalog` | `send_catalog(session_id, body) -> MessageResponse` | Send a catalog link message. **OPERATOR** |+| Method | Signature | Description |+| -------------- | ------------------------------------------------------- | ------------------------------------ |+| `info` | `info(session_id) -> CatalogInfo` | Get catalog info. |+| `products` | `products(session_id, query=None) -> PaginatedProducts` | List products (paginated). |+| `product` | `product(session_id, product_id) -> CatalogProduct` | Get one product. |+| `send_product` | `send_product(session_id, body) -> MessageResponse` | Send a product message. **OPERATOR** |#### `client.status` _(Stories)_@@ -993,7 +991,6 @@ All payloads are associative arrays; all listed methods are synchronous and retu| `products` | `products(string $sessionId, array $query = []): array` | List products (e.g. `['page' => 1, 'limit' => 20]`). || `product` | `product(string $sessionId, string $productId): array` | Get one product. || `sendProduct` | `sendProduct(string $sessionId, array $body): array` | Send a product message (`chatId` + `productId`). **OPERATOR** |-| `sendCatalog` | `sendCatalog(string $sessionId, array $body): array` | Send a catalog link (`chatId`). **OPERATOR** |#### `status` _(Stories)_diff --git a/docs/29-engine-capability-matrix.md b/docs/29-engine-capability-matrix.mdindex e0c2aaba1..fd682fc0d 100644--- a/docs/29-engine-capability-matrix.md+++ b/docs/29-engine-capability-matrix.md@@ -229,7 +229,7 @@ socket is caught by the transport instead. No REST route: the session watchdog p| `sendLocationMessage` | ✅ | ✅ | ✅ || `sendPollMessage` | ✅ | ✅ | ✅ || `sendProduct` | ✅ | ❌ lib | ⚠️ baileys only |-| `sendCatalog` | ❌ lib | ❌ lib | ❌ 501 |+| `sendCatalog` | ❌ lib | ❌ lib | ❌ not exposed || `replyToMessage` | ✅ | ✅ | ✅ || `forwardMessage` | ✅ | ✅ | ✅ || `sendChatState` | ✅ | ✅ | ✅ |@@ -381,7 +381,8 @@ answers 501.**Totals:** 112 methods → 224 adapter cells: **199 ✅, 25 ❌** (2 adapter-gaps, 23library-limitations, 0 uncertain) across 24 methods. From the REST caller's side: **90** methodswork on any engine (89 fully supported + 2 store-backed status reads), **11** are Baileys-only,-**9** are wwjs-only (the 2 store-backed rows excluded), **1** (`sendCatalog`) is 501 on both.+**9** are wwjs-only (the 2 store-backed rows excluded); `sendCatalog`, unavailable on both engines,+is not exposed.## 29.5 Full engine method inventory — every library method, mapped to OpenWA@@ -921,7 +922,7 @@ adapter sources — re-derive the same way when anything changes:depends on 🔧¹, the whole Baileys column on 🔧⁵ — so every row rests on a patch on each side,even though no row carries a row-level mark on both.- REST caller's view: **90** engine-neutral (88 + 2 store-backed status reads), **12** Baileys-only,- **9** wwjs-only, **1** unavailable on both (`sendCatalog`).+ **9** wwjs-only; `sendCatalog` (unavailable on both engines) is not exposed.- Full engine inventory (29.5), split by the exposure legend rather than lumped: Baileys **152**socket methods — 48 wired into interface methods, 5 internal wiring, 29 plumbing, **70 ❌ notexposed** (incl. the whole 23-method community cluster); wwjs **81** Client methods — 44 wired,diff --git a/openapi.json b/openapi.jsonindex 46ceb5d2f..33445b6ef 100644--- a/openapi.json+++ b/openapi.json@@ -8112,46 +8112,6 @@]}},- "/api/sessions/{sessionId}/messages/send-catalog": {- "post": {- "operationId": "CatalogController_sendCatalog",- "parameters": [- {- "name": "sessionId",- "required": true,- "in": "path",- "schema": {- "type": "string"- }- }- ],- "requestBody": {- "required": true,- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/SendCatalogDto"- }- }- }- },- "responses": {- "404": {- "description": "No session is running under that id — it was never started, was stopped, or does not exist. These routes report an unstarted session as `404`, where the message and group routes report it as `400`."- },- "409": {- "description": "The session is not connected — an engine exists for it but is not `ready`: disconnected, reconnecting, or still initializing, so the request never reached WhatsApp. Wait for `ready` and retry. A session that was never started answers `400` instead, and the session lifecycle routes answer `409` for a conflicting state rather than this. One window answers this while the session still reads `ready`: WhatsApp Web periodically reloads its own page and the engine re-injects into it — for those few seconds the answer is a `409` naming the reload; retry shortly."- },- "501": {- "description": "Not supported by the active engine: no engine can send catalog links."- }- },- "summary": "Send catalog link (not supported by any engine)",- "tags": [- "catalog"- ]- }- },"/api/plugins": {"get": {"operationId": "PluginsController_findAll",@@ -15931,24 +15891,6 @@"timestamp"]},- "SendCatalogDto": {- "type": "object",- "properties": {- "chatId": {- "type": "string",- "description": "Chat to send the catalog to (@c.us or @g.us).",- "example": "[email protected]"- },- "body": {- "type": "string",- "description": "Optional body text accompanying the catalog.",- "example": "Browse our full catalog"- }- },- "required": [- "chatId"- ]- },"PluginDto": {"type": "object","properties": {diff --git a/sdk/README.md b/sdk/README.mdindex 88725997f..0f2139fa6 100644--- a/sdk/README.md+++ b/sdk/README.md@@ -32,7 +32,7 @@ All five SDKs expose the same fluent resource surface:| `chats` | list, markRead, markUnread, archive, pin, mute, 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, demoteAdmin, transferOwnership _(Newsletters)_ |-| `catalog` | info, products, product, sendProduct, sendCatalog _(WhatsApp Business)_ |+| `catalog` | info, products, product, sendProduct _(WhatsApp Business)_ || `status` | list, fromContact, media, sendText, sendImage, sendVideo, sendVoice, delete _(Stories)_ || `search` | search _(Operator)_ || `templates` | list, get, create, update, delete |diff --git a/sdk/go/catalog.go b/sdk/go/catalog.goindex a37c19e80..14e424ab8 100644--- a/sdk/go/catalog.go+++ b/sdk/go/catalog.go@@ -2,9 +2,9 @@ package openwaimport "context"-// CatalogService reads the WhatsApp Business catalog and sends product/catalog-// messages. Catalog reads live under /catalog; product/catalog SENDS share the-// messages namespace (/messages/send-product, /messages/send-catalog).+// CatalogService reads the WhatsApp Business catalog and sends product+// messages. Catalog reads live under /catalog; product sends share the+// messages namespace (/messages/send-product).// Backed by src/modules/catalog/catalog.controller.ts.type CatalogService struct{ client *Client }@@ -51,13 +51,3 @@ func (s *CatalogService) SendProduct(ctx context.Context, sessionID string, body}return &out, nil}--// SendCatalog sends a catalog link message. Requires an OPERATOR-level key.-func (s *CatalogService) SendCatalog(ctx context.Context, sessionID string, body SendCatalogRequest) (*MessageResponse, error) {- var out MessageResponse- err := s.client.do(ctx, "POST", s.sessionBase(sessionID)+"/messages/send-catalog", nil, body, &out)- if err != nil {- return nil, err- }- return &out, nil-}diff --git a/sdk/go/routing_test.go b/sdk/go/routing_test.goindex 8965938b3..11c8ce24c 100644--- a/sdk/go/routing_test.go+++ b/sdk/go/routing_test.go@@ -143,7 +143,6 @@ func TestRouting(t *testing.T) {{"Catalog.Products", func(c *Client) { c.Catalog.Products(ctx, "s1", nil) }, "GET", "/api/sessions/s1/catalog/products"},{"Catalog.Product", func(c *Client) { c.Catalog.Product(ctx, "s1", "p1") }, "GET", "/api/sessions/s1/catalog/products/p1"},{"Catalog.SendProduct", func(c *Client) { c.Catalog.SendProduct(ctx, "s1", SendProductRequest{}) }, "POST", "/api/sessions/s1/messages/send-product"},- {"Catalog.SendCatalog", func(c *Client) { c.Catalog.SendCatalog(ctx, "s1", SendCatalogRequest{}) }, "POST", "/api/sessions/s1/messages/send-catalog"},{"Templates.List", func(c *Client) { c.Templates.List(ctx, "s1") }, "GET", "/api/sessions/s1/templates"},{"Templates.Get", func(c *Client) { c.Templates.Get(ctx, "s1", "t1") }, "GET", "/api/sessions/s1/templates/t1"},diff --git a/sdk/go/types_catalog.go b/sdk/go/types_catalog.goindex 34587b837..7b85b1d17 100644--- a/sdk/go/types_catalog.go+++ b/sdk/go/types_catalog.go@@ -58,9 +58,3 @@ type SendProductRequest struct {ProductID string `json:"productId"`Body string `json:"body,omitempty"`}--// SendCatalogRequest sends a catalog link message.-type SendCatalogRequest struct {- ChatID string `json:"chatId"`- Body string `json:"body,omitempty"`-}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendCatalogRequest.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendCatalogRequest.javadeleted file mode 100644index e49e85cc3..000000000--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendCatalogRequest.java+++ /dev/null@@ -1,28 +0,0 @@-package com.rmyndharis.openwa.model;--/** Request body for sending a catalog link message. Requires an OPERATOR-level key. */-public record SendCatalogRequest(String chatId, String body) {- public static Builder builder() {- return new Builder();- }-- public static final class Builder {- private String chatId;- private String body;-- public Builder chatId(String v) {- this.chatId = v;- return this;- }-- /** Optional body/caption text. */- public Builder body(String v) {- this.body = v;- return this;- }-- public SendCatalogRequest build() {- return new SendCatalogRequest(chatId, body);- }- }-}diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/CatalogResource.java b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/CatalogResource.javaindex 104dd9887..ea656cd1b 100644--- a/sdk/java/src/main/java/com/rmyndharis/openwa/resources/CatalogResource.java+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/resources/CatalogResource.java@@ -7,18 +7,16 @@ import com.rmyndharis.openwa.http.HttpMethod;import com.rmyndharis.openwa.model.CatalogInfo;import com.rmyndharis.openwa.model.CatalogProduct;import com.rmyndharis.openwa.model.CatalogProductsQuery;-import com.rmyndharis.openwa.model.MessageResponse;import com.rmyndharis.openwa.model.PaginatedProducts;-import com.rmyndharis.openwa.model.SendCatalogRequest;import com.rmyndharis.openwa.model.ProductMessageResponse;import com.rmyndharis.openwa.model.SendProductRequest;/**- * Catalog resource — WhatsApp Business catalog, products, and product/catalog sends.+ * Catalog resource — WhatsApp Business catalog, products, and product sends.** <p>The catalog controller is mounted under the session root, so catalog reads are- * {@code /catalog...} while product/catalog SENDS share the messages namespace- * ({@code /messages/send-product}, {@code /messages/send-catalog}). Write operations+ * {@code /catalog...} while product sends share the messages namespace+ * ({@code /messages/send-product}). Write operations* require an OPERATOR-level key.*/public final class CatalogResource {@@ -63,14 +61,4 @@ public final class CatalogResource {body,ProductMessageResponse.class);}-- /** Send a catalog link message. Requires an OPERATOR-level key. Shares the messages path. */- public MessageResponse sendCatalog(String sessionId, SendCatalogRequest body) {- return client.request(- HttpMethod.POST,- "/api/sessions/" + encodeSegment(sessionId) + "/messages/send-catalog",- null,- body,- MessageResponse.class);- }}diff --git a/sdk/java/src/test/java/com/rmyndharis/openwa/resources/CatalogResourceTest.java b/sdk/java/src/test/java/com/rmyndharis/openwa/resources/CatalogResourceTest.javaindex f7759085b..8def65e24 100644--- a/sdk/java/src/test/java/com/rmyndharis/openwa/resources/CatalogResourceTest.java+++ b/sdk/java/src/test/java/com/rmyndharis/openwa/resources/CatalogResourceTest.java@@ -7,7 +7,6 @@ import com.rmyndharis.openwa.ClientConfig;import com.rmyndharis.openwa.OpenWAClient;import com.rmyndharis.openwa.http.HttpMethod;import com.rmyndharis.openwa.model.CatalogProductsQuery;-import com.rmyndharis.openwa.model.SendCatalogRequest;import com.rmyndharis.openwa.model.SendProductRequest;import com.rmyndharis.openwa.support.MockTransport;import org.junit.jupiter.api.Test;@@ -61,13 +60,4 @@ class CatalogResourceTest {assertEquals(HttpMethod.POST, tx.lastRequest().method());assertTrue(tx.lastRequest().body().contains("prod-9"));}-- @Test- void sendCatalogSendsBody() {- tx.respond(200, "{\"messageId\":\"m2\",\"timestamp\":456}");- catalog.sendCatalog("s", SendCatalogRequest.builder().chatId("[email protected]").body("Check this out").build());- assertEquals("http://h/api/sessions/s/messages/send-catalog", tx.lastRequest().url());- assertEquals(HttpMethod.POST, tx.lastRequest().method());- assertTrue(tx.lastRequest().body().contains("Check this out"));- }}diff --git a/sdk/javascript/src/resources/catalog.ts b/sdk/javascript/src/resources/catalog.tsindex 58d20d0be..032717701 100644--- a/sdk/javascript/src/resources/catalog.ts+++ b/sdk/javascript/src/resources/catalog.ts@@ -1,10 +1,10 @@/**- * Catalog resource — WhatsApp Business catalog, products, and product/catalog sends.+ * Catalog resource — WhatsApp Business catalog, products, and product sends.** Backed by `src/modules/catalog/catalog.controller.ts` (`@Controller('sessions/:sessionId')`).* NOTE: the catalog controller is mounted under the session root, so catalog- * reads are `/catalog...` while product/catalog SENDS share the messages- * namespace (`/messages/send-product`, `/messages/send-catalog`). All require+ * reads are `/catalog...` while product sends share the messages+ * namespace (`/messages/send-product`). All require* an OPERATOR-level key for write operations.* @packageDocumentation*/@@ -15,9 +15,7 @@ import type {CatalogInfo,CatalogProduct,CatalogProductsQuery,- MessageResponse,PaginatedProducts,- SendCatalogRequest,ProductMessageResponse,SendProductRequest,} from '../types.js';@@ -58,13 +56,4 @@ export class CatalogResource {body,});}-- /** Send a catalog link message. Requires an OPERATOR-level key. Shares the messages path. */- sendCatalog(sessionId: string, body: SendCatalogRequest): Promise<MessageResponse> {- return this.client.request<MessageResponse>({- method: 'POST',- path: `/api/sessions/${encodeSegment(sessionId)}/messages/send-catalog`,- body,- });- }}diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.tsindex 8764ec110..47d2b3c85 100644--- a/sdk/javascript/src/types.ts+++ b/sdk/javascript/src/types.ts@@ -1181,12 +1181,6 @@ export interface SendProductRequest {body?: string;}-export interface SendCatalogRequest {- chatId: Jid;- /** Optional body/caption text. */- body?: string;-}-// ── Search ────────────────────────────────────────────────────────/** Query parameters for `GET /search`. Only `q` is required; all filters are optional. */diff --git a/sdk/javascript/test/labels-channels-catalog.test.ts b/sdk/javascript/test/labels-channels-catalog.test.tsindex f2f78d96a..85d619d24 100644--- a/sdk/javascript/test/labels-channels-catalog.test.ts+++ b/sdk/javascript/test/labels-channels-catalog.test.ts@@ -76,17 +76,13 @@ describe('CatalogResource — exact paths (note: catalog controller is session-rexpect(t.lastCall!.url).toBe('http://localhost:2785/api/sessions/s/catalog/products/p1');});- it('sendProduct / sendCatalog share the messages path', async () => {+ it('sendProduct shares the messages path', async () => {const t = new MockTransport()- .on('POST', /\/messages\/send-product$/, { body: { messageId: 'm', timestamp: 1 } })- .on('POST', /\/messages\/send-catalog$/, { body: { messageId: 'm', timestamp: 1 } });+ .on('POST', /\/messages\/send-product$/, { body: { messageId: 'm', timestamp: 1 } });const c = client(t);await c.catalog.sendProduct('s', { chatId: '[email protected]', productId: 'p1', body: 'see this' });expect(t.lastCall!.url).toBe('http://localhost:2785/api/sessions/s/messages/send-product');expect(t.lastCall!.body).toEqual({ chatId: '[email protected]', productId: 'p1', body: 'see this' });- await c.catalog.sendCatalog('s', { chatId: '[email protected]', body: 'our catalog' });- expect(t.lastCall!.url).toBe('http://localhost:2785/api/sessions/s/messages/send-catalog');- expect(t.lastCall!.body).toEqual({ chatId: '[email protected]', body: 'our catalog' });});});diff --git a/sdk/php/src/Resources/CatalogResource.php b/sdk/php/src/Resources/CatalogResource.phpindex d5594d6b3..07c7b2eb5 100644--- a/sdk/php/src/Resources/CatalogResource.php+++ b/sdk/php/src/Resources/CatalogResource.php@@ -7,12 +7,12 @@ namespace OpenWA\Resources;use OpenWA\Http\HttpExecutor;/**- * Catalog resource — WhatsApp Business catalog, products, and product/catalog sends.+ * Catalog resource — WhatsApp Business catalog, products, and product sends.** Backed by src/modules/catalog/catalog.controller.ts (@Controller('sessions/:sessionId')).* NOTE: the catalog controller is mounted under the session root, so catalog- * reads are /catalog... while product/catalog SENDS share the messages namespace- * (/messages/send-product, /messages/send-catalog).+ * reads are /catalog... while product sends share the messages namespace+ * (/messages/send-product).*/class CatalogResource{@@ -59,15 +59,4 @@ class CatalogResource{return $this->http->request('POST', "/api/sessions/{$this->http->encodeSegment($sessionId)}/messages/send-product", [], $body);}-- /**- * Send a catalog link message. Requires an OPERATOR-level key. Shares the messages path.- *- * @param array<string,mixed> $body chatId required; body optional.- * @return array<string,mixed>- */- public function sendCatalog(string $sessionId, array $body): array- {- return $this->http->request('POST', "/api/sessions/{$this->http->encodeSegment($sessionId)}/messages/send-catalog", [], $body);- }}diff --git a/sdk/php/tests/LabelsChannelsCatalogTest.php b/sdk/php/tests/LabelsChannelsCatalogTest.phpindex 59e3e7228..b5b081935 100644--- a/sdk/php/tests/LabelsChannelsCatalogTest.php+++ b/sdk/php/tests/LabelsChannelsCatalogTest.php@@ -57,7 +57,6 @@ class LabelsChannelsCatalogTest extends TestCase$backend->on(200, [['id' => 'p1', 'name' => 'Widget']]);$backend->on(200, ['id' => 'p1', 'name' => 'Widget']);$backend->on(201, ['messageId' => 'm', 'timestamp' => 1]);- $backend->on(201, ['messageId' => 'm', 'timestamp' => 1]);$client = $backend->makeClient();$client->catalog->info('s');$this->assertStringContainsString('/sessions/s/catalog', $backend->calls()[0]['path']);@@ -67,8 +66,6 @@ class LabelsChannelsCatalogTest extends TestCase$client->catalog->sendProduct('s', ['chatId' => '[email protected]', 'productId' => 'p1', 'body' => 'x']);$this->assertStringContainsString('/messages/send-product', $backend->calls()[3]['path']);$this->assertSame(['chatId' => '[email protected]', 'productId' => 'p1', 'body' => 'x'], $backend->calls()[3]['body']);- $client->catalog->sendCatalog('s', ['chatId' => '[email protected]', 'body' => 'cat']);- $this->assertStringContainsString('/messages/send-catalog', $backend->calls()[4]['path']);}public function testClientExposesAll11Resources(): voiddiff --git a/sdk/python/openwa/resources/catalog.py b/sdk/python/openwa/resources/catalog.pyindex fb41a3e39..33522d9df 100644--- a/sdk/python/openwa/resources/catalog.py+++ b/sdk/python/openwa/resources/catalog.py@@ -1,10 +1,10 @@-"""Catalog resource — WhatsApp Business catalog, products, and product/catalog sends.+"""Catalog resource — WhatsApp Business catalog, products, and product sends.Backed by ``src/modules/catalog/catalog.controller.ts``(``@Controller('sessions/:sessionId')``). NOTE: the catalog controller ismounted under the session root, so catalog reads are ``/catalog...`` while-product/catalog SENDS share the messages namespace-(``/messages/send-product``, ``/messages/send-catalog``).+product sends share the messages namespace+(``/messages/send-product``)."""from __future__ import annotations@@ -16,9 +16,7 @@ from ..types import (CatalogInfo,CatalogProduct,CatalogProductsQuery,- MessageResponse,PaginatedProducts,- SendCatalogRequest,ProductMessageResponse,SendProductRequest,)@@ -51,9 +49,3 @@ class CatalogResource:return self._http.request("POST", f"/api/sessions/{quote_segment(session_id)}/messages/send-product", body=body)-- def send_catalog(self, session_id: str, body: SendCatalogRequest) -> MessageResponse:- """Send a catalog link message. Requires an OPERATOR-level key. Shares the messages path."""- return self._http.request(- "POST", f"/api/sessions/{quote_segment(session_id)}/messages/send-catalog", body=body- )diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.pyindex 93edbdb41..97092962e 100644--- a/sdk/python/openwa/types.py+++ b/sdk/python/openwa/types.py@@ -1190,12 +1190,6 @@ class SendProductRequest(TypedDict, total=False):body: str-# chatId required; body optional. See SendProductRequest note.-class SendCatalogRequest(TypedDict, total=False):- chatId: Jid- body: str--# ── Search ────────────────────────────────────────────────────────# `q` is required; the remaining fields are optional. `from` is a Pythondiff --git a/sdk/python/tests/test_sdk.py b/sdk/python/tests/test_sdk.pyindex e06c66ec3..5a22fea13 100644--- a/sdk/python/tests/test_sdk.py+++ b/sdk/python/tests/test_sdk.py@@ -799,7 +799,6 @@ class TestLabelsChannelsCatalog:})backend.on("GET", "/catalog/products/p1", body={"id": "p1", "name": "Widget"})backend.on("POST", "/messages/send-product", body={"messageId": "m", "timestamp": 1})- backend.on("POST", "/messages/send-catalog", body={"messageId": "m", "timestamp": 1})client = make_client(backend)client.catalog.info("s")assert "/sessions/s/catalog" in backend.calls[-1].url@@ -810,8 +809,6 @@ class TestLabelsChannelsCatalog:client.catalog.send_product("s", {"chatId": "[email protected]", "productId": "p1", "body": "x"})assert "/messages/send-product" in backend.calls[-1].urlassert backend.calls[-1].body == {"chatId": "[email protected]", "productId": "p1", "body": "x"}- client.catalog.send_catalog("s", {"chatId": "[email protected]", "body": "cat"})- assert "/messages/send-catalog" in backend.calls[-1].urldef test_templates_crud(self):tpl = {"id": "t1", "sessionId": "s", "name": "welcome", "body": "Hi {{name}}", "createdAt": "", "updatedAt": ""}diff --git a/src/modules/catalog/catalog.controller.spec.ts b/src/modules/catalog/catalog.controller.spec.tsindex 09fb3b0e5..eaba05b9f 100644--- a/src/modules/catalog/catalog.controller.spec.ts+++ b/src/modules/catalog/catalog.controller.spec.ts@@ -1,12 +1,10 @@import { CatalogController } from './catalog.controller';import type { CatalogService } from './catalog.service';-import { EngineNotSupportedError } from '../../common/errors/engine-not-supported.error';import type { Catalog, PaginatedProducts, Product } from '../../engine/interfaces/whatsapp-engine.interface';/*** The controller is a thin map from route params/DTOs onto CatalogService's positional arguments.- * What is worth pinning here is the wiring itself (which field lands in which argument slot) and- * that the deliberate 501 from send-catalog reaches the caller instead of being swallowed.+ * What is worth pinning here is the wiring itself (which field lands in which argument slot).*/describe('CatalogController', () => {const service = {@@ -14,7 +12,6 @@ describe('CatalogController', () => {getProducts: jest.fn(),getProduct: jest.fn(),sendProduct: jest.fn(),- sendCatalog: jest.fn(),};const controller = new CatalogController(service as unknown as CatalogService);@@ -52,13 +49,4 @@ describe('CatalogController', () => {await expect(controller.sendProduct('s1', dto)).resolves.toBe(sent);expect(service.sendProduct).toHaveBeenCalledWith('s1', '[email protected]', 'prod-1', 'Back in stock!');});-- it('sendCatalog lets the deliberate 501 through — no engine can send catalog links', async () => {- const unsupported = new EngineNotSupportedError('sendCatalog');- service.sendCatalog.mockRejectedValue(unsupported);-- await expect(controller.sendCatalog('s1', { chatId: '[email protected]', body: 'hi' })).rejects.toBe(unsupported);- expect(unsupported.getStatus()).toBe(501);- expect(service.sendCatalog).toHaveBeenCalledWith('s1', '[email protected]', 'hi');- });});diff --git a/src/modules/catalog/catalog.controller.ts b/src/modules/catalog/catalog.controller.tsindex 84ae0e71d..804398865 100644--- a/src/modules/catalog/catalog.controller.ts+++ b/src/modules/catalog/catalog.controller.ts@@ -1,7 +1,7 @@import { Controller, Get, Post, Param, Body, Query } from '@nestjs/common';import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';import { CatalogService } from './catalog.service';-import { SendProductDto, SendCatalogDto, ProductQueryDto } from './dto/send-product.dto';+import { SendProductDto, ProductQueryDto } from './dto/send-product.dto';import { RequireRole } from '../auth/decorators/auth.decorators';import { ApiKeyRole } from '../auth/entities/api-key.entity';import { CatalogDto, PaginatedProductsDto, ProductDto, ProductMessageResponseDto } from './dto/catalog-response.dto';@@ -84,14 +84,4 @@ export class CatalogController {async sendProduct(@Param('sessionId') sessionId: string, @Body() dto: SendProductDto) {return this.catalogService.sendProduct(sessionId, dto.chatId, dto.productId, dto.body);}-- @Post('messages/send-catalog')- @RequireRole(ApiKeyRole.OPERATOR)- @ApiOperation({ summary: 'Send catalog link (not supported by any engine)' })- @ApiResponse({ status: 501, description: 'Not supported by the active engine: no engine can send catalog links.' })- @ApiResponse({ status: 409, description: ENGINE_NOT_READY_409 })- @ApiResponse({ status: 404, description: SESSION_NOT_STARTED_404 })- async sendCatalog(@Param('sessionId') sessionId: string, @Body() dto: SendCatalogDto) {- return this.catalogService.sendCatalog(sessionId, dto.chatId, dto.body);- }}diff --git a/src/modules/catalog/dto/send-product.dto.ts b/src/modules/catalog/dto/send-product.dto.tsindex 701f87b73..8e6505676 100644--- a/src/modules/catalog/dto/send-product.dto.ts+++ b/src/modules/catalog/dto/send-product.dto.ts@@ -17,20 +17,6 @@ export class SendProductDto {body?: string;}-export class SendCatalogDto {- @ApiProperty({ description: 'Chat to send the catalog to (@c.us or @g.us).', example: '[email protected]' })- @IsString()- chatId!: string;-- @ApiPropertyOptional({- description: 'Optional body text accompanying the catalog.',- example: 'Browse our full catalog',- })- @IsOptional()- @IsString()- body?: string;-}-export class ProductQueryDto {@ApiPropertyOptional({ description: 'Result page (1-based).', example: 1, minimum: 1 })@IsOptional()