@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.
- package/dist/generated/index.cjs +1 -1
- package/dist/generated/index.cjs.map +1 -1
- package/dist/generated/index.d.cts +1 -3
- package/dist/generated/index.d.cts.map +1 -1
- package/dist/generated/index.d.mts +1 -3
- package/dist/generated/index.d.mts.map +1 -1
- package/dist/generated/index.mjs +1 -1
- package/dist/generated/index.mjs.map +1 -1
- package/dist/{index-DH0WRSA7.d.mts → index-DlfSVhzo.d.mts} +3 -4
- package/dist/index-DlfSVhzo.d.mts.map +1 -0
- package/dist/{index-BETdayaV.d.cts → index-JLPIa9s-.d.cts} +3 -4
- package/dist/index-JLPIa9s-.d.cts.map +1 -0
- package/dist/index.cjs +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +14 -8
- package/dist/index.mjs.map +1 -1
- package/dist/methods/index.cjs +1 -1
- package/dist/methods/index.d.cts +1 -1
- package/dist/methods/index.d.mts +1 -1
- package/dist/methods/index.mjs +1 -1
- package/dist/{methods-9kRJiEdZ.cjs → methods-CILSsPyT.cjs} +16 -17
- package/dist/methods-CILSsPyT.cjs.map +1 -0
- package/dist/{methods-NixIgGkq.mjs → methods-L7ijqbZM.mjs} +16 -17
- package/dist/methods-L7ijqbZM.mjs.map +1 -0
- package/package.json +3 -3
- package/src/__tests__/generators.contract.test.ts +82 -45
- package/src/events/asyncapi.ts +2 -2
- package/src/events/contracts.ts +10 -3
- package/src/events/polls.ts +1 -1
- package/src/generated/BaseClient.ts +12 -12
- package/src/generated/asyncapi.json +16 -7
- package/src/generated/openapi.json +29 -32
- package/src/methods/calls.ts +2 -2
- package/src/methods/contacts.ts +1 -1
- package/src/methods/groups.ts +2 -2
- package/src/methods/messaging.ts +7 -7
- package/src/methods/session.ts +1 -1
- package/src/methods/whatsapp-events.ts +1 -1
- package/src/parameters.ts +2 -2
- package/src/return-types.ts +1 -1
- package/dist/index-BETdayaV.d.cts.map +0 -1
- package/dist/index-DH0WRSA7.d.mts.map +0 -1
- package/dist/methods-9kRJiEdZ.cjs.map +0 -1
- 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
|
|
100
|
+
const referenceMetaPath = path.join(clientDocsDir, '../meta.json');
|
|
101
101
|
const messagesPath = path.join(clientDocsDir, 'messages.mdx');
|
|
102
102
|
|
|
103
|
-
it('should create
|
|
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(
|
|
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(
|
|
108
|
+
const meta = JSON.parse(fs.readFileSync(referenceMetaPath, 'utf-8'));
|
|
109
109
|
|
|
110
|
-
expect(indexContent).toContain('
|
|
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="
|
|
114
|
-
expect(indexContent).toContain('client
|
|
115
|
-
expect(
|
|
116
|
-
expect(meta.
|
|
117
|
-
expect(meta.pages).
|
|
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
|
|
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('
|
|
135
|
-
expect(content
|
|
136
|
-
expect(content
|
|
137
|
-
expect(content).
|
|
138
|
-
expect(content).toContain('
|
|
139
|
-
|
|
140
|
-
expect(content).toContain('
|
|
141
|
-
expect(content).toContain('
|
|
142
|
-
expect(content).toContain('
|
|
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="
|
|
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('
|
|
156
|
-
expect(content).toContain('
|
|
157
|
-
expect(content).toContain('
|
|
158
|
-
expect(content).toContain('
|
|
159
|
-
expect(content).
|
|
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
|
|
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('
|
|
167
|
-
expect(content).toContain('
|
|
168
|
-
expect(
|
|
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
|
|
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('
|
|
178
|
-
expect(content).toContain('
|
|
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
|
});
|
package/src/events/asyncapi.ts
CHANGED
|
@@ -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
|
|
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 } } : {}),
|
package/src/events/contracts.ts
CHANGED
|
@@ -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?: {
|
|
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'}.
|
|
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
|
}));
|
package/src/events/polls.ts
CHANGED
|
@@ -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: '
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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":
|
|
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":
|
|
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":
|
|
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.
|
|
6
|
-
"description": "API definition for open-wa v5.
|
|
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": "
|
|
21
|
-
"description": "
|
|
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": "
|
|
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": "
|
|
507
|
-
"description": "
|
|
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": "
|
|
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": "
|
|
1286
|
-
"description": "
|
|
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": "
|
|
4080
|
-
"description": "
|
|
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": "
|
|
4479
|
-
"description": "
|
|
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": "
|
|
12545
|
-
"description": "
|
|
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
|
|
17523
|
-
"description": "Share the
|
|
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
|
|
20370
|
-
"description": "Get
|
|
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": "
|
|
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": "
|
|
30551
|
-
"description": "
|
|
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
|
|
35416
|
-
"description": "Get the current call
|
|
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
|
|
36428
|
-
"description": "Reject
|
|
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
|
|
40492
|
-
"description": "RSVP
|
|
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": {
|