@open-wa/schema 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/generated/index.cjs +1 -1
  2. package/dist/generated/index.cjs.map +1 -1
  3. package/dist/generated/index.d.cts +1 -3
  4. package/dist/generated/index.d.cts.map +1 -1
  5. package/dist/generated/index.d.mts +1 -3
  6. package/dist/generated/index.d.mts.map +1 -1
  7. package/dist/generated/index.mjs +1 -1
  8. package/dist/generated/index.mjs.map +1 -1
  9. package/dist/{index-DH0WRSA7.d.mts → index-DlfSVhzo.d.mts} +3 -4
  10. package/dist/index-DlfSVhzo.d.mts.map +1 -0
  11. package/dist/{index-BETdayaV.d.cts → index-JLPIa9s-.d.cts} +3 -4
  12. package/dist/index-JLPIa9s-.d.cts.map +1 -0
  13. package/dist/index.cjs +14 -8
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +1 -1
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +14 -8
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/methods/index.cjs +1 -1
  20. package/dist/methods/index.d.cts +1 -1
  21. package/dist/methods/index.d.mts +1 -1
  22. package/dist/methods/index.mjs +1 -1
  23. package/dist/{methods-9kRJiEdZ.cjs → methods-CILSsPyT.cjs} +16 -17
  24. package/dist/methods-CILSsPyT.cjs.map +1 -0
  25. package/dist/{methods-NixIgGkq.mjs → methods-L7ijqbZM.mjs} +16 -17
  26. package/dist/methods-L7ijqbZM.mjs.map +1 -0
  27. package/package.json +3 -3
  28. package/src/__tests__/generators.contract.test.ts +82 -45
  29. package/src/events/asyncapi.ts +2 -2
  30. package/src/events/contracts.ts +10 -3
  31. package/src/events/polls.ts +1 -1
  32. package/src/generated/BaseClient.ts +12 -12
  33. package/src/generated/asyncapi.json +16 -7
  34. package/src/generated/openapi.json +29 -32
  35. package/src/methods/calls.ts +2 -2
  36. package/src/methods/contacts.ts +1 -1
  37. package/src/methods/groups.ts +2 -2
  38. package/src/methods/messaging.ts +7 -7
  39. package/src/methods/session.ts +1 -1
  40. package/src/methods/whatsapp-events.ts +1 -1
  41. package/src/parameters.ts +2 -2
  42. package/src/return-types.ts +1 -1
  43. package/dist/index-BETdayaV.d.cts.map +0 -1
  44. package/dist/index-DH0WRSA7.d.mts.map +0 -1
  45. package/dist/methods-9kRJiEdZ.cjs.map +0 -1
  46. package/dist/methods-NixIgGkq.mjs.map +0 -1
@@ -97,24 +97,26 @@ describe('generator outputs', () => {
97
97
 
98
98
  describe('Client API reference docs', () => {
99
99
  const indexPath = path.join(clientDocsDir, 'index.mdx');
100
- const metaPath = path.join(clientDocsDir, 'meta.json');
100
+ const referenceMetaPath = path.join(clientDocsDir, '../meta.json');
101
101
  const messagesPath = path.join(clientDocsDir, 'messages.mdx');
102
102
 
103
- it('should create client docs index and navigation metadata', () => {
103
+ it('should create the overview page and list namespaces first in the sidebar', () => {
104
104
  expect(fs.existsSync(indexPath)).toBe(true);
105
- expect(fs.existsSync(metaPath)).toBe(true);
105
+ expect(fs.existsSync(referenceMetaPath)).toBe(true);
106
106
 
107
107
  const indexContent = fs.readFileSync(indexPath, 'utf-8');
108
- const meta = JSON.parse(fs.readFileSync(metaPath, 'utf-8'));
108
+ const meta = JSON.parse(fs.readFileSync(referenceMetaPath, 'utf-8'));
109
109
 
110
- expect(indexContent).toContain('Generated file warning');
111
- expect(indexContent).toContain('packages/schema/scripts/gen-client-reference-docs.ts');
110
+ expect(indexContent).toContain('title: "Overview"');
112
111
  expect(indexContent).toContain('<Cards>');
113
- expect(indexContent).toContain('<Card title="Messages" href="./messages">');
114
- expect(indexContent).toContain('client methods');
115
- expect(meta.title).toBe('Client API');
116
- expect(meta.icon).toBe('BookOpen');
117
- expect(meta.pages).toContain('messages');
112
+ expect(indexContent).toContain('<Card title="Messages" href="/docs/reference/client/messages">');
113
+ expect(indexContent).not.toContain('gen-client-reference-docs');
114
+ expect(indexContent).not.toMatch(/schema[- ]registry/i);
115
+ expect(meta.title).toBe('API reference');
116
+ expect(meta.pages.slice(0, 3)).toEqual(['!index', 'client/index', 'client/messages']);
117
+ expect(meta.pages.indexOf('client/messages')).toBeLessThan(meta.pages.indexOf('create'));
118
+ expect(meta.pages.at(-1)).toBe('client/send-text-worked-example');
119
+ expect(meta.pages).not.toContain('workspaces');
118
120
  });
119
121
 
120
122
  it('should create a generated MDX page for every namespace', () => {
@@ -124,58 +126,93 @@ describe('generator outputs', () => {
124
126
  .filter((fileName) => fileName.endsWith('.mdx') && fileName !== 'index.mdx' && fileName !== 'client.mdx')
125
127
  .sort();
126
128
 
127
- expect(mdxFiles).toEqual(expect.arrayContaining(namespaces.map((namespace) => `${namespace.toLowerCase()}.mdx`)));
129
+ expect(mdxFiles).toEqual(expect.arrayContaining(namespaces.map((namespace) => `${namespace === 'events' ? 'whatsapp-events' : namespace.toLowerCase()}.mdx`)));
128
130
  });
129
131
 
130
- it('should include sendText method details from the schema registry', () => {
132
+ it('should order methods by use and render sendText details', () => {
131
133
  expect(fs.existsSync(messagesPath)).toBe(true);
132
134
  const content = fs.readFileSync(messagesPath, 'utf-8');
133
135
 
134
- expect(content).toContain('Generated file warning');
135
- expect(content).toContain('packages/schema/scripts/gen-client-reference-docs.ts');
136
- expect(content).toContain('## `sendText`');
137
- expect(content).toContain('### Overview');
138
- expect(content).toContain('| Prop | Value |');
139
- expect(content).toContain('| Namespace | `messages` |');
140
- expect(content).toContain('| Action | `send` |');
141
- expect(content).toContain('| Positional parameter order | `to`, `content`, `options` |');
142
- expect(content).toContain('| Aliases | `messages.sendText` |');
143
- expect(content).toContain('### Routes');
144
- expect(content).toContain('| Type | Method | Path | Name | Status |');
145
- expect(content).toContain('| Primary | `POST` | `/api/messages/sendText` | `sendText` | Active |');
146
- expect(content).toContain('| Alias | `POST` | `/api/sendText` | `sendText` | Active |');
147
- expect(content).toContain('### Usage');
148
- expect(content).toContain('<InterfaceTabs>');
149
- expect(content).toContain('<InterfaceTab value="Embedded">');
150
- expect(content).toContain('const result = await client.sendText({');
151
- expect(content).toContain('// namespaced form: client.messages.sendText(...)');
136
+ expect(content).toContain('title: "Messages"');
137
+ expect(content.indexOf('## `sendText`')).toBeGreaterThan(-1);
138
+ expect(content.indexOf('## `sendText`')).toBeLessThan(content.indexOf('## `sendImage`'));
139
+ expect(content.indexOf('## `sendImage`')).toBeLessThan(content.indexOf('## `deleteMessage`'));
140
+ expect(content).toContain('```ts\nclient.sendText(to: string, content: string, options?: unknown): Promise<MessageId>\n```');
141
+ // Sub-headings are literal <h3> elements: out of the TOC, with no copy-link button.
142
+ expect(content).toContain('<h3 id="sendtext-usage" className="scroll-m-28">Usage</h3>');
143
+ expect(content).not.toContain('[!toc]');
144
+ expect(content).toContain('<InterfaceTab value="SDK">');
152
145
  expect(content).toContain('<InterfaceTab value="SocketClient">');
153
- expect(content).toContain('<InterfaceTab value="Easy API">');
146
+ expect(content).toContain('<InterfaceTab value="HTTP">');
154
147
  expect(content).toContain('curl -X POST "http://localhost:8080/api/messages/sendText"');
155
- expect(content).toContain('### Parameters');
156
- expect(content).toContain('<AutoTypeTable path="./generated-method-params.ts" name="SendTextParams" />');
157
- expect(content).toContain('### Output');
158
- expect(content).toContain('| Return type | `object &#123; _serialized &#125; \\| boolean \\| string` |');
159
- expect(content).not.toContain('Returns: `');
148
+ expect(content).toContain('<h3 id="sendtext-parameters" className="scroll-m-28">Parameters</h3>');
149
+ expect(content).toContain('| `to` | `string` | Recipient chat ID. The target chat for a send operation. Also accepts `chatId`. |');
150
+ expect(content).not.toContain('AutoTypeTable');
151
+ expect(content).toContain('<h3 id="sendtext-returns" className="scroll-m-28">Returns</h3>');
152
+ expect(content).toContain('Resolves to [`MessageId`](/docs/reference/client/return-types#messageid).');
153
+ expect(content).toContain('**HTTP:** `POST /api/messages/sendText`, or `/api/sendText`. **Also named:** `messages.sendText`.');
154
+ expect(content).not.toContain('<details>');
155
+ expect(content).not.toContain('"options": {}');
156
+ expect(content).not.toContain('**Signature**');
157
+ });
158
+
159
+ it('should render licensed methods inside the tier treatment with a license sentence', () => {
160
+ expect(fs.existsSync(messagesPath)).toBe(true);
161
+ const content = fs.readFileSync(messagesPath, 'utf-8');
162
+
163
+ expect(content).toContain('<LicensedMethodSection tier="insiders">');
164
+ expect(content).toContain('## `sendButtons`');
165
+ expect(content).toContain('Needs an Insiders license.');
160
166
  });
161
167
 
162
- it('should render licensed methods with callouts and visible heading indicators', () => {
163
- expect(fs.existsSync(messagesPath)).toBe(true);
168
+ it('should link documented parameter types to Return types instead of expanding them', () => {
164
169
  const content = fs.readFileSync(messagesPath, 'utf-8');
165
170
 
166
- expect(content).toContain('## `sendButtons` - insiders');
167
- expect(content).toContain('<LicensedFeatureCallout tier="insiders" />');
168
- expect(content).toContain('| License | `insiders` |');
171
+ expect(content).toContain('client.sendInteractive(to: string, content: InteractiveContent): Promise<string>');
172
+ expect(content).toContain('| `content` | [`InteractiveContent`](/docs/reference/client/return-types#interactivecontent) |');
173
+ expect(fs.readFileSync(path.join(clientDocsDir, 'media.mdx'), 'utf-8')).toContain('client.decryptMedia(message: Message): Promise<DataURL>');
174
+ });
175
+
176
+ it('should make the A–Z page a lookup that links to namespace anchors', () => {
177
+ const content = fs.readFileSync(path.join(clientDocsDir, 'client.mdx'), 'utf-8');
178
+ const count = clientRegistry.getAll().length;
179
+
180
+ expect(content).toContain(`<ClientReference total={${count}}>`);
181
+ expect(content).toContain('| [`sendText`](/docs/reference/client/messages#sendtext) | Messages |');
182
+ expect(content.match(/^\| \[`/gm)).toHaveLength(count);
183
+ expect(content).not.toContain('<details>');
184
+ expect(content).not.toContain('```');
185
+ });
186
+
187
+ it('should keep Return types declarations without repeating shared fields', () => {
188
+ const content = fs.readFileSync(path.join(clientDocsDir, 'return-types.mdx'), 'utf-8');
189
+ const story = content.slice(content.indexOf('## Story'), content.indexOf('\n## ', content.indexOf('## Story') + 1));
190
+
191
+ expect(content).toContain('<TypeDeclaration name="Message" code={"type Message = {');
192
+ expect(story).toContain('Story has the same fields as [Message](/docs/reference/client/return-types#message), apart from these.');
193
+ expect(story).not.toContain('| `body` |');
194
+ });
195
+
196
+ it('should title the media method page apart from the media guide', () => {
197
+ expect(fs.readFileSync(path.join(clientDocsDir, 'media.mdx'), 'utf-8')).toContain('title: "Media methods"');
198
+ });
199
+
200
+ it('should keep implementation mechanisms out of the generated pages', () => {
201
+ const pages = fs.readdirSync(clientDocsDir).filter((fileName) => fileName.endsWith('.mdx'));
202
+ for (const page of pages) {
203
+ const content = fs.readFileSync(path.join(clientDocsDir, page), 'utf-8');
204
+ expect(content, page).not.toMatch(/private patch|installed patch|\bwapi|webpack|inject|donor|schema-registry|Client API/i);
205
+ }
169
206
  });
170
207
 
171
- it('should visibly label deprecated alias routes in route tables', () => {
208
+ it('should visibly label deprecated alias routes', () => {
172
209
  const contactsPath = path.join(clientDocsDir, 'contacts.mdx');
173
210
  expect(fs.existsSync(contactsPath)).toBe(true);
174
211
  const content = fs.readFileSync(contactsPath, 'utf-8');
175
212
 
176
213
  expect(content).toContain('## `blockContact`');
177
- expect(content).toContain('| Deprecated alias | `PUT` | `/api/contactBlock` | `contactBlock` | **Deprecated** |');
178
- expect(content).toContain('| Deprecated alias | `PUT` | `/api/contacts/contactBlock` | `contacts.contactBlock` | **Deprecated** |');
214
+ expect(content).toContain('Deprecated routes: `/api/contactBlock`, `/api/contacts/contactBlock`.');
215
+ expect(content).toContain('Deprecated names: `contactBlock`, `contacts.contactBlock`.');
179
216
  });
180
217
  });
181
218
  });
@@ -21,7 +21,7 @@ export function createAsyncApiDocument(options: AsyncApiOptions = {}) {
21
21
  ? { id: { type: 'string' }, event: { const: contract.name }, payload: payloadRef, ts: { type: 'number' }, sessionId: { type: 'string' } }
22
22
  : transport === 'webhook'
23
23
  ? { webhookId: { type: 'string' }, sessionId: { type: 'string' }, event: { const: contract.name }, payload: payloadRef, timestamp: { type: 'number' }, idempotencyKey: { type: 'string' } }
24
- : { eventId: { type: 'string' }, name: { const: contract.name }, timestamp: { type: 'string', format: 'date-time' }, data: payloadRef, cursor: { type: 'null' } };
24
+ : { eventId: { type: 'string' }, name: { const: contract.name }, timestamp: { type: 'string', format: 'date-time' }, data: payloadRef, cursor: { type: ['string', 'null'] } };
25
25
  messages[id] = {
26
26
  name: contract.name, title: contract.name, summary: contract.description,
27
27
  contentType: 'application/json',
@@ -38,7 +38,7 @@ export function createAsyncApiDocument(options: AsyncApiOptions = {}) {
38
38
  ? 'SSE event frame: id, event and JSON data; optional topics query filters exact runtime names. Keepalive every 20 seconds; reconnect hint 3000 ms. No history replay. API key in X-API-Key or api_key/key query.'
39
39
  : transport === 'webhook'
40
40
  ? 'Outbound HTTP POST to the configured destination. Public non-sensitive events pass through the plugin gateway. Optional event-name filter; default 3 retries with exponential delay from 1000 ms. Optional durable journal adds Idempotency-Key and retries pending deliveries after restart. No exactly-once guarantee.'
41
- : `Verified subscriber-provided HTTPS callback. Subscribe through ${basePath}${options.mcpPath ?? '/mcp'} using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and bounded transient retries. No retry on 410/413; cursor:null means no historical replay.`,
41
+ : `Verified subscriber-provided HTTPS callback. Subscribe through ${basePath}${options.mcpPath ?? '/mcp'} using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and transient retries for up to 15 minutes. No retry on 410/413. The same events are available through events/poll and events/stream; cursors replay events retained on the server (15 minutes by default).`,
42
42
  messages: { event: { $ref: `#/components/messages/${id}` } },
43
43
  'x-openwa-transport': transport,
44
44
  ...(transport === 'sse' ? { servers: [{ $ref: '#/servers/easyApi' }], 'x-openwa-sse': { event: contract.name, contentType: 'text/event-stream', topics: contract.name } } : {}),
@@ -35,7 +35,12 @@ export interface EventContract {
35
35
  optionalRuntimeListener: boolean;
36
36
  payloadSchema: z.ZodType;
37
37
  transports: readonly ('sse' | 'webhook' | 'mcp')[];
38
- mcp?: { inputSchema: z.ZodType; payloadSchema: z.ZodType; project(payload: unknown, sessionId: string): unknown };
38
+ mcp?: {
39
+ inputSchema: z.ZodType; payloadSchema: z.ZodType;
40
+ project(payload: unknown, sessionId: string): unknown;
41
+ /** Stable upstream identity, so the same WhatsApp event deduplicates across delivery paths. */
42
+ eventId?(data: Record<string, unknown>): string | undefined;
43
+ };
39
44
  }
40
45
 
41
46
  const record = (value: unknown): Record<string, unknown> =>
@@ -62,6 +67,7 @@ export const eventContracts: readonly EventContract[] = [
62
67
  const body = text(m.body);
63
68
  return { sessionId, messageId: m.id, chatId: text(m.chatId), from: text(m.from), body: body?.slice(0, 4000), truncated: (body?.length ?? 0) > 4000 };
64
69
  },
70
+ eventId: data => text(data.messageId),
65
71
  },
66
72
  }),
67
73
  defineContract('anyMessage', {
@@ -77,6 +83,7 @@ export const eventContracts: readonly EventContract[] = [
77
83
  const a = record(record(payload).ack);
78
84
  return { sessionId, messageId: a.id, ack: a.ack, chatId: text(a.chatId) };
79
85
  },
86
+ eventId: data => typeof data.messageId === 'string' ? `${data.messageId}:${String(data.ack)}` : undefined,
80
87
  },
81
88
  }),
82
89
  defineContract('stateChanged', {
@@ -111,8 +118,8 @@ export function eventJsonSchema(schema: z.ZodType): Record<string, unknown> {
111
118
  export function getMcpEventDefinitions() {
112
119
  return eventContracts.filter(contract => contract.mcp).map(contract => ({
113
120
  name: contract.name,
114
- description: `${contract.description}. Compact summary${contract.name === 'session.state.changed' ? '' : '; use messages.get with messageId to read a full message'}. No history replay.`,
115
- delivery: ['webhook'] as 'webhook'[],
121
+ description: `${contract.description}. Compact summary${contract.name === 'session.state.changed' ? '' : '; use messages.get with messageId to read a full message'}. Cursors replay recent events within the server's retention window.`,
122
+ delivery: ['poll', 'push', 'webhook'] as ('poll' | 'push' | 'webhook')[],
116
123
  inputSchema: eventJsonSchema(contract.mcp!.inputSchema),
117
124
  payloadSchema: eventJsonSchema(contract.mcp!.payloadSchema),
118
125
  }));
@@ -5,7 +5,7 @@ export const pollVoteEvent = defineListenerV2('pollVote', {
5
5
  legacyName: 'onPollVote',
6
6
  meta: {
7
7
  namespace: 'messages', license: 'none', status: 'beta',
8
- description: 'A decrypted poll vote added or changed in the synced store. Hydration can emit old votes. Hidden-voter polls omit sender and message identifiers. Deduplicate ordinary votes by id and timestamp; refresh getPollResults for current totals.',
8
+ description: 'Someone voted on a poll or changed their vote. Older votes can arrive again after the session starts, so deduplicate by id and timestamp and call getPollResults for current totals. Polls with hidden voters leave out sender and message IDs.',
9
9
  },
10
10
  payload: PollVoteSchema, defaultQueueOptions: { concurrency: 1 },
11
11
  });
@@ -14,7 +14,7 @@ export abstract class BaseClient {
14
14
  }
15
15
 
16
16
  /**
17
- * Render a sticker locally using automatic whole-job backend selection and ordered effects, then submit through the private donor finalizer. Author and pack labels are configurable; donor app links are owned by the installed patch. Returns a submitted message ID, not a delivery receipt. Unknown send outcomes must be reconciled before retrying.
17
+ * Turn an image or video into a sticker, apply optional effects and author and pack labels, and send it. Resolves to the message ID once WhatsApp accepts it, not a delivery receipt. If the outcome is unknown, check the chat before you retry.
18
18
  */
19
19
  public sendSticker = implementMethod(Methods.sendSticker);
20
20
 
@@ -24,7 +24,7 @@ export abstract class BaseClient {
24
24
  public sendAlbum = implementMethod(Methods.sendAlbum);
25
25
 
26
26
  /**
27
- * Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.
27
+ * Send a text message to a chat. Starting a chat with a number that has never messaged you needs a Restricted or Premium license.
28
28
  */
29
29
  public sendText = implementMethod(Methods.sendText);
30
30
 
@@ -44,7 +44,7 @@ export abstract class BaseClient {
44
44
  public sendPaymentRequest = implementMethod(Methods.sendPaymentRequest);
45
45
 
46
46
  /**
47
- * Sends media through the native attachment pipeline, including images and videos. Options select presentation, view once, GIF playback or circular video notes; media is not transcoded. Returns submission status, not a delivery receipt.
47
+ * Send an image or video, or any other media file, as a WhatsApp attachment. Options set the caption, view once, GIF playback or a round video note. Media is sent as is, without conversion. Resolves to the send result, not a delivery receipt.
48
48
  */
49
49
  public sendImage = implementMethod(Methods.sendImage);
50
50
 
@@ -107,7 +107,7 @@ export abstract class BaseClient {
107
107
  public sendListMessage = implementMethod(Methods.sendListMessage);
108
108
 
109
109
  /**
110
- * Sends a text poll with a selection limit, quote, optional closing time in Unix milliseconds and hidden voter names. Closing time and hidden names require native WhatsApp support for the sending account/chat. These fields select the native V6 poll payload.
110
+ * Send a poll with a selection limit, an optional quoted message, an optional closing time in Unix milliseconds and optionally hidden voter names. Closing times and hidden names only work where WhatsApp supports them for the sending account and chat.
111
111
  */
112
112
  public sendPoll = implementMethod(Methods.sendPoll);
113
113
 
@@ -117,7 +117,7 @@ export abstract class BaseClient {
117
117
  public voteOnPoll = implementMethod(Methods.voteOnPoll);
118
118
 
119
119
  /**
120
- * Hydrates the local poll vote store and returns synced counts, choices and votes. Hidden-voter polls omit voter identities and the votes array. Unsynced votes may be absent.
120
+ * Get the current counts, choices and votes for a poll. Polls with hidden voters leave out voter identities and the votes array, and very recent votes may not appear yet.
121
121
  */
122
122
  public getPollResults = implementMethod(Methods.getPollResults);
123
123
 
@@ -223,7 +223,7 @@ export abstract class BaseClient {
223
223
  public unstarMessage = implementMethod(Methods.unstarMessage);
224
224
 
225
225
  /**
226
- * Edits the text of a message through the installed private patch
226
+ * Edit the text of a message you sent
227
227
  */
228
228
  public editMessage = implementMethod(Methods.editMessage);
229
229
 
@@ -337,7 +337,7 @@ export abstract class BaseClient {
337
337
  public requestPhoneNumber = implementMethod(Methods.requestPhoneNumber);
338
338
 
339
339
  /**
340
- * Share the signed-in account’s own phone number with a direct LID chat using WhatsApp’s native protocol. No arbitrary phone number is accepted.
340
+ * Share the logged-in account’s own phone number in a one-to-one chat that only shows a LID. You can’t share any other number.
341
341
  */
342
342
  public sharePhoneNumber = implementMethod(Methods.sharePhoneNumber);
343
343
 
@@ -414,7 +414,7 @@ export abstract class BaseClient {
414
414
  public getGroupMembersId = implementMethod(Methods.getGroupMembersId);
415
415
 
416
416
  /**
417
- * Get the group title and description through the installed private patch
417
+ * Get a group title and description
418
418
  */
419
419
  public getGroupInfo = implementMethod(Methods.getGroupInfo);
420
420
 
@@ -661,7 +661,7 @@ export abstract class BaseClient {
661
661
  public getLicenseType = implementMethod(Methods.getLicenseType);
662
662
 
663
663
  /**
664
- * Get enabled and disabled licensed features from the accepted licence patch. This reports licence access; actions check runtime availability automatically.
664
+ * List which licensed features your license key turns on. Each method still checks availability when you call it.
665
665
  */
666
666
  public getLicenseFeatures = implementMethod(Methods.getLicenseFeatures);
667
667
 
@@ -737,7 +737,7 @@ export abstract class BaseClient {
737
737
  public getCallCapabilities = implementMethod(Methods.getCallCapabilities);
738
738
 
739
739
  /**
740
- * Get the current call snapshot. SDK clients hydrate its bound methods.
740
+ * Get the current call, if there is one. In the SDK the result also has methods to control the call.
741
741
  */
742
742
  public getActiveCall = implementMethod(Methods.getActiveCall);
743
743
 
@@ -752,7 +752,7 @@ export abstract class BaseClient {
752
752
  public startCall = implementMethod(Methods.startCall);
753
753
 
754
754
  /**
755
- * Reject this call with native state confirmation.
755
+ * Reject an incoming call and wait for WhatsApp to confirm it.
756
756
  */
757
757
  public rejectCall = implementMethod(Methods.rejectCall);
758
758
 
@@ -817,7 +817,7 @@ export abstract class BaseClient {
817
817
  public cancelEvent = implementMethod(Methods.cancelEvent);
818
818
 
819
819
  /**
820
- * RSVP through WhatsApp’s native encrypted event-response action.
820
+ * Send your RSVP to a WhatsApp event.
821
821
  */
822
822
  public respondToEvent = implementMethod(Methods.respondToEvent);
823
823
 
@@ -2,7 +2,7 @@
2
2
  "asyncapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "OpenWA events",
5
- "version": "5.10.0",
5
+ "version": "5.11.0",
6
6
  "description": "Initial public wire contracts for six runtime events. This is not an exhaustive list of internal lifecycle events. SSE and webhook policies differ; MCP provides compact summaries for three events."
7
7
  },
8
8
  "servers": {
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "mcp_ack_changed": {
51
51
  "address": null,
52
- "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and bounded transient retries. No retry on 410/413; cursor:null means no historical replay.",
52
+ "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and transient retries for up to 15 minutes. No retry on 410/413. The same events are available through events/poll and events/stream; cursors replay events retained on the server (15 minutes by default).",
53
53
  "messages": {
54
54
  "event": {
55
55
  "$ref": "#/components/messages/mcp_ack_changed"
@@ -160,7 +160,7 @@
160
160
  },
161
161
  "mcp_message_received": {
162
162
  "address": null,
163
- "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and bounded transient retries. No retry on 410/413; cursor:null means no historical replay.",
163
+ "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and transient retries for up to 15 minutes. No retry on 410/413. The same events are available through events/poll and events/stream; cursors replay events retained on the server (15 minutes by default).",
164
164
  "messages": {
165
165
  "event": {
166
166
  "$ref": "#/components/messages/mcp_message_received"
@@ -241,7 +241,7 @@
241
241
  },
242
242
  "mcp_session_state_changed": {
243
243
  "address": null,
244
- "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and bounded transient retries. No retry on 410/413; cursor:null means no historical replay.",
244
+ "description": "Verified subscriber-provided HTTPS callback. Subscribe through /mcp using MCP 2026-07-28. Standard Webhooks signatures, stable event IDs and transient retries for up to 15 minutes. No retry on 410/413. The same events are available through events/poll and events/stream; cursors replay events retained on the server (15 minutes by default).",
245
245
  "messages": {
246
246
  "event": {
247
247
  "$ref": "#/components/messages/mcp_session_state_changed"
@@ -2403,7 +2403,10 @@
2403
2403
  "$ref": "#/components/schemas/ack_changed_mcp"
2404
2404
  },
2405
2405
  "cursor": {
2406
- "type": "null"
2406
+ "type": [
2407
+ "string",
2408
+ "null"
2409
+ ]
2407
2410
  }
2408
2411
  },
2409
2412
  "required": [
@@ -2709,7 +2712,10 @@
2709
2712
  "$ref": "#/components/schemas/message_received_mcp"
2710
2713
  },
2711
2714
  "cursor": {
2712
- "type": "null"
2715
+ "type": [
2716
+ "string",
2717
+ "null"
2718
+ ]
2713
2719
  }
2714
2720
  },
2715
2721
  "required": [
@@ -2934,7 +2940,10 @@
2934
2940
  "$ref": "#/components/schemas/session_state_changed_mcp"
2935
2941
  },
2936
2942
  "cursor": {
2937
- "type": "null"
2943
+ "type": [
2944
+ "string",
2945
+ "null"
2946
+ ]
2938
2947
  }
2939
2948
  },
2940
2949
  "required": [
@@ -2,8 +2,8 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "open-wa API",
5
- "version": "5.10.0",
6
- "description": "API definition for open-wa v5.10.0"
5
+ "version": "5.11.0",
6
+ "description": "API definition for open-wa v5.11.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -17,8 +17,8 @@
17
17
  "messages"
18
18
  ],
19
19
  "operationId": "sendSticker",
20
- "summary": "Render a sticker locally using automatic whole-job backend selection and ordered effects, then submit through the private donor finalizer. Author and pack labels are configurable; donor app links are owned by the installed patch. Returns a submitted message ID, not a delivery receipt. Unknown send outcomes must be reconciled before retrying.",
21
- "description": "Render a sticker locally using automatic whole-job backend selection and ordered effects, then submit through the private donor finalizer. Author and pack labels are configurable; donor app links are owned by the installed patch. Returns a submitted message ID, not a delivery receipt. Unknown send outcomes must be reconciled before retrying.",
20
+ "summary": "Turn an image or video into a sticker, apply optional effects and author and pack labels, and send it. Resolves to the message ID once WhatsApp accepts it, not a delivery receipt. If the outcome is unknown, check the chat before you retry.",
21
+ "description": "Turn an image or video into a sticker, apply optional effects and author and pack labels, and send it. Resolves to the message ID once WhatsApp accepts it, not a delivery receipt. If the outcome is unknown, check the chat before you retry.",
22
22
  "requestBody": {
23
23
  "required": true,
24
24
  "content": {
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  "backend": {
69
- "description": "Defaults to browser when it supports the entire job; otherwise the entire job runs standalone.",
69
+ "description": "Where the sticker is rendered. `auto` (the default) picks the best option for the whole job.",
70
70
  "type": "string",
71
71
  "enum": [
72
72
  "auto",
@@ -503,8 +503,8 @@
503
503
  "messages"
504
504
  ],
505
505
  "operationId": "sendText",
506
- "summary": "Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.",
507
- "description": "Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.",
506
+ "summary": "Send a text message to a chat. Starting a chat with a number that has never messaged you needs a Restricted or Premium license.",
507
+ "description": "Send a text message to a chat. Starting a chat with a number that has never messaged you needs a Restricted or Premium license.",
508
508
  "requestBody": {
509
509
  "required": true,
510
510
  "content": {
@@ -522,7 +522,7 @@
522
522
  "description": "Message content"
523
523
  },
524
524
  "options": {
525
- "description": "Reserved for compatibility with legacy request shapes. The current sendText Client implementation ignores this argument; use reply() or sendTextWithMentions() for quoted replies and mentions."
525
+ "description": "Not used. Leave it out; use reply() for quoted replies and sendTextWithMentions() for mentions."
526
526
  }
527
527
  },
528
528
  "required": [
@@ -1282,8 +1282,8 @@
1282
1282
  "messages"
1283
1283
  ],
1284
1284
  "operationId": "sendImage",
1285
- "summary": "Sends media through the native attachment pipeline, including images and videos. Options select presentation, view once, GIF playback or circular video notes; media is not transcoded. Returns submission status, not a delivery receipt.",
1286
- "description": "Sends media through the native attachment pipeline, including images and videos. Options select presentation, view once, GIF playback or circular video notes; media is not transcoded. Returns submission status, not a delivery receipt.",
1285
+ "summary": "Send an image or video, or any other media file, as a WhatsApp attachment. Options set the caption, view once, GIF playback or a round video note. Media is sent as is, without conversion. Resolves to the send result, not a delivery receipt.",
1286
+ "description": "Send an image or video, or any other media file, as a WhatsApp attachment. Options set the caption, view once, GIF playback or a round video note. Media is sent as is, without conversion. Resolves to the send result, not a delivery receipt.",
1287
1287
  "requestBody": {
1288
1288
  "required": true,
1289
1289
  "content": {
@@ -4076,8 +4076,8 @@
4076
4076
  "messages"
4077
4077
  ],
4078
4078
  "operationId": "sendPoll",
4079
- "summary": "Sends a text poll with a selection limit, quote, optional closing time in Unix milliseconds and hidden voter names. Closing time and hidden names require native WhatsApp support for the sending account/chat. These fields select the native V6 poll payload.",
4080
- "description": "Sends a text poll with a selection limit, quote, optional closing time in Unix milliseconds and hidden voter names. Closing time and hidden names require native WhatsApp support for the sending account/chat. These fields select the native V6 poll payload.",
4079
+ "summary": "Send a poll with a selection limit, an optional quoted message, an optional closing time in Unix milliseconds and optionally hidden voter names. Closing times and hidden names only work where WhatsApp supports them for the sending account and chat.",
4080
+ "description": "Send a poll with a selection limit, an optional quoted message, an optional closing time in Unix milliseconds and optionally hidden voter names. Closing times and hidden names only work where WhatsApp supports them for the sending account and chat.",
4081
4081
  "requestBody": {
4082
4082
  "required": true,
4083
4083
  "content": {
@@ -4475,8 +4475,8 @@
4475
4475
  "messages"
4476
4476
  ],
4477
4477
  "operationId": "getPollResults",
4478
- "summary": "Hydrates the local poll vote store and returns synced counts, choices and votes. Hidden-voter polls omit voter identities and the votes array. Unsynced votes may be absent.",
4479
- "description": "Hydrates the local poll vote store and returns synced counts, choices and votes. Hidden-voter polls omit voter identities and the votes array. Unsynced votes may be absent.",
4478
+ "summary": "Get the current counts, choices and votes for a poll. Polls with hidden voters leave out voter identities and the votes array, and very recent votes may not appear yet.",
4479
+ "description": "Get the current counts, choices and votes for a poll. Polls with hidden voters leave out voter identities and the votes array, and very recent votes may not appear yet.",
4480
4480
  "requestBody": {
4481
4481
  "required": true,
4482
4482
  "content": {
@@ -12541,8 +12541,8 @@
12541
12541
  "messages"
12542
12542
  ],
12543
12543
  "operationId": "editMessage",
12544
- "summary": "Edits the text of a message through the installed private patch",
12545
- "description": "Edits the text of a message through the installed private patch",
12544
+ "summary": "Edit the text of a message you sent",
12545
+ "description": "Edit the text of a message you sent",
12546
12546
  "requestBody": {
12547
12547
  "required": true,
12548
12548
  "content": {
@@ -17519,8 +17519,8 @@
17519
17519
  "contacts"
17520
17520
  ],
17521
17521
  "operationId": "sharePhoneNumber",
17522
- "summary": "Share the signed-in account’s own phone number with a direct LID chat using WhatsApp’s native protocol. No arbitrary phone number is accepted.",
17523
- "description": "Share the signed-in account’s own phone number with a direct LID chat using WhatsApp’s native protocol. No arbitrary phone number is accepted.",
17522
+ "summary": "Share the logged-in account’s own phone number in a one-to-one chat that only shows a LID. You can’t share any other number.",
17523
+ "description": "Share the logged-in account’s own phone number in a one-to-one chat that only shows a LID. You can’t share any other number.",
17524
17524
  "requestBody": {
17525
17525
  "required": true,
17526
17526
  "content": {
@@ -20366,8 +20366,8 @@
20366
20366
  "groups"
20367
20367
  ],
20368
20368
  "operationId": "getGroupInfo",
20369
- "summary": "Get the group title and description through the installed private patch",
20370
- "description": "Get the group title and description through the installed private patch",
20369
+ "summary": "Get a group title and description",
20370
+ "description": "Get a group title and description",
20371
20371
  "parameters": [
20372
20372
  {
20373
20373
  "name": "groupId",
@@ -20419,7 +20419,7 @@
20419
20419
  "title"
20420
20420
  ],
20421
20421
  "additionalProperties": {},
20422
- "description": "Group title and description returned by the private getGroupInfo patch."
20422
+ "description": "The group title and description."
20423
20423
  },
20424
20424
  {
20425
20425
  "type": "string"
@@ -30547,8 +30547,8 @@
30547
30547
  "session"
30548
30548
  ],
30549
30549
  "operationId": "getLicenseFeatures",
30550
- "summary": "Get enabled and disabled licensed features from the accepted licence patch. This reports licence access; actions check runtime availability automatically.",
30551
- "description": "Get enabled and disabled licensed features from the accepted licence patch. This reports licence access; actions check runtime availability automatically.",
30550
+ "summary": "List which licensed features your license key turns on. Each method still checks availability when you call it.",
30551
+ "description": "List which licensed features your license key turns on. Each method still checks availability when you call it.",
30552
30552
  "parameters": [],
30553
30553
  "x-openwa-aliases": [
30554
30554
  "GET /api/getLicenseFeatures"
@@ -31442,9 +31442,6 @@
31442
31442
  "isHere": {
31443
31443
  "type": "boolean"
31444
31444
  },
31445
- "wapiInjected": {
31446
- "type": "boolean"
31447
- },
31448
31445
  "online": {
31449
31446
  "type": "boolean"
31450
31447
  },
@@ -35412,8 +35409,8 @@
35412
35409
  "calls"
35413
35410
  ],
35414
35411
  "operationId": "getActiveCall",
35415
- "summary": "Get the current call snapshot. SDK clients hydrate its bound methods.",
35416
- "description": "Get the current call snapshot. SDK clients hydrate its bound methods.",
35412
+ "summary": "Get the current call, if there is one. In the SDK the result also has methods to control the call.",
35413
+ "description": "Get the current call, if there is one. In the SDK the result also has methods to control the call.",
35417
35414
  "requestBody": {
35418
35415
  "required": false,
35419
35416
  "content": {
@@ -36424,8 +36421,8 @@
36424
36421
  "calls"
36425
36422
  ],
36426
36423
  "operationId": "rejectCall",
36427
- "summary": "Reject this call with native state confirmation.",
36428
- "description": "Reject this call with native state confirmation.",
36424
+ "summary": "Reject an incoming call and wait for WhatsApp to confirm it.",
36425
+ "description": "Reject an incoming call and wait for WhatsApp to confirm it.",
36429
36426
  "requestBody": {
36430
36427
  "required": true,
36431
36428
  "content": {
@@ -40488,8 +40485,8 @@
40488
40485
  "events"
40489
40486
  ],
40490
40487
  "operationId": "respondToEvent",
40491
- "summary": "RSVP through WhatsApp’s native encrypted event-response action.",
40492
- "description": "RSVP through WhatsApp’s native encrypted event-response action.",
40488
+ "summary": "Send your RSVP to a WhatsApp event.",
40489
+ "description": "Send your RSVP to a WhatsApp event.",
40493
40490
  "requestBody": {
40494
40491
  "required": true,
40495
40492
  "content": {