Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(search): say the id forms apply to the built-in provider
Yudhi Armyndharisb35241cd5a7f
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.mdindex 83a29a037..96d3f6b5f 100644--- a/docs/06-api-specification.md+++ b/docs/06-api-specification.md@@ -6527,10 +6527,10 @@ Search messages across sessions (active search provider).| ----------- | ------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || `q` | string | **Yes** | — | Search term. Must be non-empty after trim; `400` for whitespace-only, over 1000 characters, or over 32 words (punctuation separates words, a symbol or emoji that stands apart counts as a word, a whitespace-separated word said again counts once). Passed to the active provider's native full-text matcher. || `sessionId` | string | No | — | Restrict to a single session id (intersected with the key's `allowedSessions` scope). |-| `chatId` | string | No | — | Restrict to a single chat id. A phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it). For a key restricted to selected chats this must name an allowed chat (`403` otherwise), and its hits are additionally narrowed to the allowlist. |+| `chatId` | string | No | — | Restrict to a single chat id. With the built-in provider, a phone also matches the chat's other stored forms (the other user dialect, any lid that resolves to it). For a key restricted to selected chats this must name an allowed chat (`403` otherwise), and its hits are also narrowed to the allowlist. || `direction` | enum (`incoming` \| `outgoing`) | No | — | Filter by message direction. || `type` | string | No | — | Filter by stored message `type` (e.g. `text`, `image`, `video`). Compared against `messages.type`; not an enum validation, any string is accepted and unmatched values simply return no hits. |-| `from` | string | No | — | Filter by sender; matches `from` or a group message's `author`. A phone also matches any lid that resolves to it. |+| `from` | string | No | — | Filter by sender; with the built-in provider, matches `from` or a group message's `author`, and a phone also matches any lid that resolves to it. || `dateFrom` | integer (epoch ms) | No | — | Inclusive lower bound on `timestamp`. Must be between -9007199254740991 and 9007199254740991; a non-numeric or out-of-range value is rejected with `400`. || `dateTo` | integer (epoch ms) | No | — | Inclusive upper bound on `timestamp`. Must be between -9007199254740991 and 9007199254740991; a non-numeric or out-of-range value is rejected with `400`. || `limit` | integer (≥ 1) | No | `50` | Max hits to return. Clamped to `SEARCH_LIMIT_MAX` (default `100`). A non-integer value is rejected with `400`. |@@ -6568,7 +6568,9 @@ Search messages across sessions (active search provider).epoch **milliseconds**.- `total` is an exact count for pagination, computed lazily only when the returned page could be full.- `provider` names which backend answered (e.g. `builtin-fts`); it is the registered `SearchProvider`- id, so it changes when a plugin backend is selected via `SEARCH_PROVIDER`.+ id, so it changes when a plugin backend is selected via `SEARCH_PROVIDER`. A plugin provider+ receives `chatId` and `from` as the caller sent them, without the other stored forms the built-in+ provider matches.- `score` is optional and provider-specific (rank ordering is stable within a provider; cross-providerscores are not comparable). The built-in provider on SQLite leaves it out for a key restricted toselected sessions or chats, since it is computed over the whole index.diff --git a/openapi.json b/openapi.jsonindex 2607f94c4..367fec9e9 100644--- a/openapi.json+++ b/openapi.json@@ -17913,7 +17913,7 @@"name": "chatId","required": false,"in": "query",- "description": "Restrict to a single chat id. A phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it).",+ "description": "Restrict to a single chat id. With the built-in search provider, a phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it); a plugin provider receives the id as sent.","schema": {"type": "string"}@@ -17922,7 +17922,7 @@"name": "from","required": false,"in": "query",- "description": "Sender filter. Matches `from` or a group message's `author`; a phone also matches any lid that resolves to it.",+ "description": "Sender filter. With the built-in search provider, matches `from` or a group message's `author`, and a phone also matches any lid that resolves to it; a plugin provider receives the id as sent.","schema": {"type": "string"}diff --git a/src/modules/search/dto/search-query.dto.ts b/src/modules/search/dto/search-query.dto.tsindex 4c2bab7fc..4673eea78 100644--- a/src/modules/search/dto/search-query.dto.ts+++ b/src/modules/search/dto/search-query.dto.ts@@ -37,7 +37,7 @@ export class SearchQueryDto {@ApiPropertyOptional({description:- "Restrict to a single chat id. A phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it).",+ "Restrict to a single chat id. With the built-in search provider, a phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it); a plugin provider receives the id as sent.",})@IsOptional()@ToStrictString()@@ -46,7 +46,7 @@ export class SearchQueryDto {@ApiPropertyOptional({description:- "Sender filter. Matches `from` or a group message's `author`; a phone also matches any lid that resolves to it.",+ "Sender filter. With the built-in search provider, matches `from` or a group message's `author`, and a phone also matches any lid that resolves to it; a plugin provider receives the id as sent.",})@IsOptional()@ToStrictString()diff --git a/src/modules/search/search.controller.ts b/src/modules/search/search.controller.tsindex b06087649..abe1cea0b 100644--- a/src/modules/search/search.controller.ts+++ b/src/modules/search/search.controller.ts@@ -50,7 +50,7 @@ export class SearchController {name: 'chatId',required: false,description:- "Restrict to a single chat id. A phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it).",+ "Restrict to a single chat id. With the built-in search provider, a phone also matches the chat's other stored forms (the other user dialect and any lid that resolves to it); a plugin provider receives the id as sent.",})@ApiQuery({ name: 'direction', required: false, description: 'incoming | outgoing' })@ApiQuery({ name: 'type', required: false, description: 'Message type filter' })@@ -58,7 +58,7 @@ export class SearchController {name: 'from',required: false,description:- "Sender filter. Matches `from` or a group message's `author`; a phone also matches any lid that resolves to it.",+ "Sender filter. With the built-in search provider, matches `from` or a group message's `author`, and a phone also matches any lid that resolves to it; a plugin provider receives the id as sent.",})@ApiQuery({ name: 'dateFrom', required: false, description: 'Epoch-ms lower bound (inclusive)' })@ApiQuery({ name: 'dateTo', required: false, description: 'Epoch-ms upper bound (inclusive)' })