wuzapi 1.6.0 → 1.6.1
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/README.md +35 -26
- package/dist/modules/admin.d.ts +2 -6
- package/dist/modules/admin.js +0 -6
- package/dist/modules/admin.js.map +1 -1
- package/dist/modules/chat.d.ts +3 -3
- package/dist/modules/chat.js +8 -2
- package/dist/modules/chat.js.map +1 -1
- package/dist/modules/group.d.ts +1 -1
- package/dist/modules/group.js +6 -7
- package/dist/modules/group.js.map +1 -1
- package/dist/modules/session.js +1 -1
- package/dist/modules/session.js.map +1 -1
- package/dist/modules/user.d.ts +2 -2
- package/dist/modules/user.js +2 -2
- package/dist/modules/user.js.map +1 -1
- package/dist/modules/webhook.d.ts +3 -3
- package/dist/modules/webhook.js +9 -5
- package/dist/modules/webhook.js.map +1 -1
- package/dist/types/admin.d.ts +40 -7
- package/dist/types/chat.d.ts +2 -4
- package/dist/types/group.d.ts +4 -7
- package/dist/types/index.js.map +1 -1
- package/dist/types/newsletter.d.ts +41 -12
- package/dist/types/session.d.ts +3 -3
- package/dist/types/user.d.ts +4 -1
- package/dist/types/webhook.d.ts +10 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -184,14 +184,21 @@ await client.user.sendPresence("available");
|
|
|
184
184
|
## 🔗 Webhook Setup
|
|
185
185
|
|
|
186
186
|
```typescript
|
|
187
|
-
// Set webhook URL
|
|
188
|
-
await client.webhook.setWebhook("https://your-server.com/webhook"
|
|
187
|
+
// Set webhook URL with events
|
|
188
|
+
await client.webhook.setWebhook("https://your-server.com/webhook", [
|
|
189
|
+
"Message",
|
|
190
|
+
"ReadReceipt",
|
|
191
|
+
]);
|
|
189
192
|
|
|
190
193
|
// Get webhook config
|
|
191
194
|
const config = await client.webhook.getWebhook();
|
|
192
195
|
|
|
193
|
-
// Update webhook
|
|
194
|
-
await client.webhook.updateWebhook(
|
|
196
|
+
// Update webhook with new URL, events, and status
|
|
197
|
+
await client.webhook.updateWebhook(
|
|
198
|
+
"https://new-server.com/webhook",
|
|
199
|
+
["Message", "ReadReceipt"],
|
|
200
|
+
true
|
|
201
|
+
);
|
|
195
202
|
```
|
|
196
203
|
|
|
197
204
|
## 📚 Examples
|
|
@@ -228,7 +235,7 @@ const client = new WuzapiClient({
|
|
|
228
235
|
|
|
229
236
|
// Connect and wait for messages
|
|
230
237
|
await client.session.connect({ Subscribe: ["Message"] });
|
|
231
|
-
await client.webhook.setWebhook("https://your-server.com/webhook");
|
|
238
|
+
await client.webhook.setWebhook("https://your-server.com/webhook", ["Message"]);
|
|
232
239
|
|
|
233
240
|
// In your webhook handler:
|
|
234
241
|
app.post("/webhook", async (req, res) => {
|
|
@@ -425,18 +432,14 @@ await client.chat.sendPoll(
|
|
|
425
432
|
|
|
426
433
|
```typescript
|
|
427
434
|
// Delete a message
|
|
428
|
-
await client.chat.deleteMessage(
|
|
429
|
-
Phone: "5491155554444",
|
|
430
|
-
Id: "message-id-to-delete",
|
|
431
|
-
Remote: true, // Delete for everyone
|
|
432
|
-
});
|
|
435
|
+
await client.chat.deleteMessage("message-id-to-delete");
|
|
433
436
|
|
|
434
437
|
// Edit a message
|
|
435
|
-
await client.chat.editMessage(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
await client.chat.editMessage(
|
|
439
|
+
"message-id-to-edit",
|
|
440
|
+
"5491155554444",
|
|
441
|
+
"This is the updated message text"
|
|
442
|
+
);
|
|
440
443
|
|
|
441
444
|
// React to message
|
|
442
445
|
await client.chat.react({
|
|
@@ -606,16 +609,13 @@ await client.group.updateParticipants(
|
|
|
606
609
|
// List all users
|
|
607
610
|
const users = await client.admin.listUsers({ token: "admin-token" });
|
|
608
611
|
|
|
609
|
-
// Get a specific user by ID
|
|
610
|
-
const user = await client.admin.getUser(2, { token: "admin-token" });
|
|
611
|
-
|
|
612
612
|
// Add new user
|
|
613
613
|
const newUser = await client.admin.addUser(
|
|
614
614
|
{
|
|
615
615
|
name: "John Doe",
|
|
616
616
|
token: "user-token-123",
|
|
617
617
|
webhook: "https://example.com/webhook",
|
|
618
|
-
events: "Message,ReadReceipt",
|
|
618
|
+
events: "Message,ReadReceipt", // optional
|
|
619
619
|
proxyConfig: {
|
|
620
620
|
enabled: true,
|
|
621
621
|
proxyURL: "socks5://user:pass@proxy:port",
|
|
@@ -635,11 +635,13 @@ const newUser = await client.admin.addUser(
|
|
|
635
635
|
{ token: "admin-token" }
|
|
636
636
|
);
|
|
637
637
|
|
|
638
|
-
// Delete user
|
|
639
|
-
await client.admin.deleteUser(
|
|
638
|
+
// Delete user by ID (ID is a string)
|
|
639
|
+
await client.admin.deleteUser("user-id-string", { token: "admin-token" });
|
|
640
640
|
|
|
641
641
|
// Delete user completely (full deletion including all data)
|
|
642
|
-
await client.admin.deleteUserComplete(
|
|
642
|
+
await client.admin.deleteUserComplete("user-id-string", {
|
|
643
|
+
token: "admin-token",
|
|
644
|
+
});
|
|
643
645
|
```
|
|
644
646
|
|
|
645
647
|
</details>
|
|
@@ -648,16 +650,23 @@ await client.admin.deleteUserComplete(2, { token: "admin-token" });
|
|
|
648
650
|
<summary><strong>🔗 Webhook Module</strong> - Webhook configuration</summary>
|
|
649
651
|
|
|
650
652
|
```typescript
|
|
651
|
-
// Set webhook URL
|
|
652
|
-
await client.webhook.setWebhook("https://my-server.com/webhook"
|
|
653
|
+
// Set webhook URL with specific events
|
|
654
|
+
await client.webhook.setWebhook("https://my-server.com/webhook", [
|
|
655
|
+
"Message",
|
|
656
|
+
"ReadReceipt",
|
|
657
|
+
]);
|
|
653
658
|
|
|
654
659
|
// Get current webhook configuration
|
|
655
660
|
const webhookConfig = await client.webhook.getWebhook();
|
|
656
661
|
console.log("Webhook URL:", webhookConfig.webhook);
|
|
657
662
|
console.log("Subscribed events:", webhookConfig.subscribe);
|
|
658
663
|
|
|
659
|
-
// Update webhook URL
|
|
660
|
-
await client.webhook.updateWebhook(
|
|
664
|
+
// Update webhook URL, events, and status
|
|
665
|
+
await client.webhook.updateWebhook(
|
|
666
|
+
"https://my-new-server.com/webhook",
|
|
667
|
+
["Message", "ReadReceipt", "Presence"],
|
|
668
|
+
true
|
|
669
|
+
);
|
|
661
670
|
|
|
662
671
|
// Delete webhook configuration
|
|
663
672
|
await client.webhook.deleteWebhook();
|
package/dist/modules/admin.d.ts
CHANGED
|
@@ -10,16 +10,12 @@ export declare class AdminModule extends BaseClient {
|
|
|
10
10
|
* Add a new user
|
|
11
11
|
*/
|
|
12
12
|
addUser(user: CreateUserRequest, options?: RequestOptions): Promise<CreateUserResponse>;
|
|
13
|
-
/**
|
|
14
|
-
* Get a specific user by ID
|
|
15
|
-
*/
|
|
16
|
-
getUser(id: number, options?: RequestOptions): Promise<User>;
|
|
17
13
|
/**
|
|
18
14
|
* Delete a user by ID
|
|
19
15
|
*/
|
|
20
|
-
deleteUser(id:
|
|
16
|
+
deleteUser(id: string, options?: RequestOptions): Promise<DeleteUserResponse>;
|
|
21
17
|
/**
|
|
22
18
|
* Delete a user completely (full deletion) by ID
|
|
23
19
|
*/
|
|
24
|
-
deleteUserComplete(id:
|
|
20
|
+
deleteUserComplete(id: string, options?: RequestOptions): Promise<DeleteUserResponse>;
|
|
25
21
|
}
|
package/dist/modules/admin.js
CHANGED
|
@@ -14,12 +14,6 @@ class AdminModule extends client.BaseClient {
|
|
|
14
14
|
async addUser(user, options) {
|
|
15
15
|
return this.post("/admin/users", user, options);
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Get a specific user by ID
|
|
19
|
-
*/
|
|
20
|
-
async getUser(id, options) {
|
|
21
|
-
return this.get(`/admin/users/${id}`, options);
|
|
22
|
-
}
|
|
23
17
|
/**
|
|
24
18
|
* Delete a user by ID
|
|
25
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sources":["../../src/modules/admin.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n User,\n CreateUserRequest,\n CreateUserResponse,\n DeleteUserResponse,\n} from \"../types/admin.js\";\n\nexport class AdminModule extends BaseClient {\n /**\n * List all users\n */\n async listUsers(options?: RequestOptions): Promise<User[]> {\n return this.get<User[]>(\"/admin/users\", options);\n }\n\n /**\n * Add a new user\n */\n async addUser(\n user: CreateUserRequest,\n options?: RequestOptions\n ): Promise<CreateUserResponse> {\n return this.post<CreateUserResponse>(\"/admin/users\", user, options);\n }\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"admin.js","sources":["../../src/modules/admin.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n User,\n CreateUserRequest,\n CreateUserResponse,\n DeleteUserResponse,\n} from \"../types/admin.js\";\n\nexport class AdminModule extends BaseClient {\n /**\n * List all users\n */\n async listUsers(options?: RequestOptions): Promise<User[]> {\n return this.get<User[]>(\"/admin/users\", options);\n }\n\n /**\n * Add a new user\n */\n async addUser(\n user: CreateUserRequest,\n options?: RequestOptions\n ): Promise<CreateUserResponse> {\n return this.post<CreateUserResponse>(\"/admin/users\", user, options);\n }\n\n /**\n * Delete a user by ID\n */\n async deleteUser(\n id: string,\n options?: RequestOptions\n ): Promise<DeleteUserResponse> {\n return this.delete<DeleteUserResponse>(`/admin/users/${id}`, options);\n }\n\n /**\n * Delete a user completely (full deletion) by ID\n */\n async deleteUserComplete(\n id: string,\n options?: RequestOptions\n ): Promise<DeleteUserResponse> {\n return this.delete<DeleteUserResponse>(`/admin/users/${id}/full`, options);\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AASO,MAAM,oBAAoBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAI1C,MAAM,UAAU,SAA2C;AACzD,WAAO,KAAK,IAAY,gBAAgB,OAAO;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QACJ,MACA,SAC6B;AAC7B,WAAO,KAAK,KAAyB,gBAAgB,MAAM,OAAO;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WACJ,IACA,SAC6B;AAC7B,WAAO,KAAK,OAA2B,gBAAgB,EAAE,IAAI,OAAO;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,mBACJ,IACA,SAC6B;AAC7B,WAAO,KAAK,OAA2B,gBAAgB,EAAE,SAAS,OAAO;AAAA,EAC3E;AACF;;"}
|
package/dist/modules/chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseClient } from '../client.js';
|
|
2
2
|
import { RequestOptions } from '../types/common.js';
|
|
3
|
-
import { SendMessageResponse, SendTextRequest, SendTemplateRequest, SendAudioRequest, SendImageRequest, SendDocumentRequest, SendVideoRequest, SendStickerRequest, SendLocationRequest, SendContactRequest, ChatPresenceRequest, MarkReadRequest, ReactRequest, DownloadMediaRequest, DownloadMediaResponse,
|
|
3
|
+
import { SendMessageResponse, SendTextRequest, SendTemplateRequest, SendAudioRequest, SendImageRequest, SendDocumentRequest, SendVideoRequest, SendStickerRequest, SendLocationRequest, SendContactRequest, ChatPresenceRequest, MarkReadRequest, ReactRequest, DownloadMediaRequest, DownloadMediaResponse, DeleteMessageResponse, SendButtonsRequest, ListSection } from '../types/chat.js';
|
|
4
4
|
export declare class ChatModule extends BaseClient {
|
|
5
5
|
/**
|
|
6
6
|
* Send a text message
|
|
@@ -69,7 +69,7 @@ export declare class ChatModule extends BaseClient {
|
|
|
69
69
|
/**
|
|
70
70
|
* Delete a message
|
|
71
71
|
*/
|
|
72
|
-
deleteMessage(
|
|
72
|
+
deleteMessage(messageId: string, options?: RequestOptions): Promise<DeleteMessageResponse>;
|
|
73
73
|
/**
|
|
74
74
|
* Send interactive buttons message
|
|
75
75
|
*/
|
|
@@ -85,5 +85,5 @@ export declare class ChatModule extends BaseClient {
|
|
|
85
85
|
/**
|
|
86
86
|
* Edit a message
|
|
87
87
|
*/
|
|
88
|
-
editMessage(
|
|
88
|
+
editMessage(messageId: string, phone: string, newBody: string, options?: RequestOptions): Promise<SendMessageResponse>;
|
|
89
89
|
}
|
package/dist/modules/chat.js
CHANGED
|
@@ -137,7 +137,8 @@ class ChatModule extends client.BaseClient {
|
|
|
137
137
|
/**
|
|
138
138
|
* Delete a message
|
|
139
139
|
*/
|
|
140
|
-
async deleteMessage(
|
|
140
|
+
async deleteMessage(messageId, options) {
|
|
141
|
+
const request = { Id: messageId };
|
|
141
142
|
return this.post("/chat/delete", request, options);
|
|
142
143
|
}
|
|
143
144
|
/**
|
|
@@ -184,7 +185,12 @@ class ChatModule extends client.BaseClient {
|
|
|
184
185
|
/**
|
|
185
186
|
* Edit a message
|
|
186
187
|
*/
|
|
187
|
-
async editMessage(
|
|
188
|
+
async editMessage(messageId, phone, newBody, options) {
|
|
189
|
+
const request = {
|
|
190
|
+
Id: messageId,
|
|
191
|
+
Phone: phone,
|
|
192
|
+
Body: newBody
|
|
193
|
+
};
|
|
188
194
|
return this.post("/chat/send/edit", request, options);
|
|
189
195
|
}
|
|
190
196
|
}
|
package/dist/modules/chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sources":["../../src/modules/chat.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n SendMessageResponse,\n SendTextRequest,\n SendTemplateRequest,\n SendAudioRequest,\n SendImageRequest,\n SendDocumentRequest,\n SendVideoRequest,\n SendStickerRequest,\n SendLocationRequest,\n SendContactRequest,\n ChatPresenceRequest,\n MarkReadRequest,\n ReactRequest,\n DownloadMediaRequest,\n DownloadMediaResponse,\n DeleteMessageRequest,\n DeleteMessageResponse,\n SendButtonsRequest,\n SendListRequest,\n SendPollRequest,\n EditMessageRequest,\n ListSection,\n} from \"../types/chat.js\";\n\nexport class ChatModule extends BaseClient {\n /**\n * Send a text message\n */\n async sendText(\n request: SendTextRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/text\", request, options);\n }\n\n /**\n * Send a template message with buttons\n */\n async sendTemplate(\n request: SendTemplateRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/template\",\n request,\n options\n );\n }\n\n /**\n * Send an audio message\n */\n async sendAudio(\n request: SendAudioRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/audio\", request, options);\n }\n\n /**\n * Send an image message\n */\n async sendImage(\n request: SendImageRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/image\", request, options);\n }\n\n /**\n * Send a document message\n */\n async sendDocument(\n request: SendDocumentRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/document\",\n request,\n options\n );\n }\n\n /**\n * Send a video message\n */\n async sendVideo(\n request: SendVideoRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/video\", request, options);\n }\n\n /**\n * Send a sticker message\n */\n async sendSticker(\n request: SendStickerRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/sticker\",\n request,\n options\n );\n }\n\n /**\n * Send a location message\n */\n async sendLocation(\n request: SendLocationRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/location\",\n request,\n options\n );\n }\n\n /**\n * Send a contact message\n */\n async sendContact(\n request: SendContactRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/contact\",\n request,\n options\n );\n }\n\n /**\n * Send chat presence indication (typing indicator)\n */\n async sendPresence(\n request: ChatPresenceRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.post<void>(\"/chat/presence\", request, options);\n }\n\n /**\n * Mark messages as read\n */\n async markRead(\n request: MarkReadRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.post<void>(\"/chat/markread\", request, options);\n }\n\n /**\n * React to a message\n */\n async react(\n request: ReactRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/react\", request, options);\n }\n\n /**\n * Download an image from a message\n */\n async downloadImage(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadimage\",\n request,\n options\n );\n }\n\n /**\n * Download a video from a message\n */\n async downloadVideo(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadvideo\",\n request,\n options\n );\n }\n\n /**\n * Download an audio from a message\n */\n async downloadAudio(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadaudio\",\n request,\n options\n );\n }\n\n /**\n * Download a document from a message\n */\n async downloadDocument(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloaddocument\",\n request,\n options\n );\n }\n\n /**\n * Delete a message\n */\n async deleteMessage(\n
|
|
1
|
+
{"version":3,"file":"chat.js","sources":["../../src/modules/chat.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n SendMessageResponse,\n SendTextRequest,\n SendTemplateRequest,\n SendAudioRequest,\n SendImageRequest,\n SendDocumentRequest,\n SendVideoRequest,\n SendStickerRequest,\n SendLocationRequest,\n SendContactRequest,\n ChatPresenceRequest,\n MarkReadRequest,\n ReactRequest,\n DownloadMediaRequest,\n DownloadMediaResponse,\n DeleteMessageRequest,\n DeleteMessageResponse,\n SendButtonsRequest,\n SendListRequest,\n SendPollRequest,\n EditMessageRequest,\n ListSection,\n} from \"../types/chat.js\";\n\nexport class ChatModule extends BaseClient {\n /**\n * Send a text message\n */\n async sendText(\n request: SendTextRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/text\", request, options);\n }\n\n /**\n * Send a template message with buttons\n */\n async sendTemplate(\n request: SendTemplateRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/template\",\n request,\n options\n );\n }\n\n /**\n * Send an audio message\n */\n async sendAudio(\n request: SendAudioRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/audio\", request, options);\n }\n\n /**\n * Send an image message\n */\n async sendImage(\n request: SendImageRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/image\", request, options);\n }\n\n /**\n * Send a document message\n */\n async sendDocument(\n request: SendDocumentRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/document\",\n request,\n options\n );\n }\n\n /**\n * Send a video message\n */\n async sendVideo(\n request: SendVideoRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/send/video\", request, options);\n }\n\n /**\n * Send a sticker message\n */\n async sendSticker(\n request: SendStickerRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/sticker\",\n request,\n options\n );\n }\n\n /**\n * Send a location message\n */\n async sendLocation(\n request: SendLocationRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/location\",\n request,\n options\n );\n }\n\n /**\n * Send a contact message\n */\n async sendContact(\n request: SendContactRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/contact\",\n request,\n options\n );\n }\n\n /**\n * Send chat presence indication (typing indicator)\n */\n async sendPresence(\n request: ChatPresenceRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.post<void>(\"/chat/presence\", request, options);\n }\n\n /**\n * Mark messages as read\n */\n async markRead(\n request: MarkReadRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.post<void>(\"/chat/markread\", request, options);\n }\n\n /**\n * React to a message\n */\n async react(\n request: ReactRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\"/chat/react\", request, options);\n }\n\n /**\n * Download an image from a message\n */\n async downloadImage(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadimage\",\n request,\n options\n );\n }\n\n /**\n * Download a video from a message\n */\n async downloadVideo(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadvideo\",\n request,\n options\n );\n }\n\n /**\n * Download an audio from a message\n */\n async downloadAudio(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloadaudio\",\n request,\n options\n );\n }\n\n /**\n * Download a document from a message\n */\n async downloadDocument(\n request: DownloadMediaRequest,\n options?: RequestOptions\n ): Promise<DownloadMediaResponse> {\n return this.post<DownloadMediaResponse>(\n \"/chat/downloaddocument\",\n request,\n options\n );\n }\n\n /**\n * Delete a message\n */\n async deleteMessage(\n messageId: string,\n options?: RequestOptions\n ): Promise<DeleteMessageResponse> {\n const request: DeleteMessageRequest = { Id: messageId };\n return this.post<DeleteMessageResponse>(\"/chat/delete\", request, options);\n }\n\n /**\n * Send interactive buttons message\n */\n async sendButtons(\n request: SendButtonsRequest,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n return this.post<SendMessageResponse>(\n \"/chat/send/buttons\",\n request,\n options\n );\n }\n\n /**\n * Send list message\n */\n async sendList(\n phone: string,\n buttonText: string,\n description: string,\n topText: string,\n sections?: ListSection[],\n footerText?: string,\n id?: string,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n const request: SendListRequest = {\n Phone: phone,\n ButtonText: buttonText,\n Desc: description,\n TopText: topText,\n Sections: sections,\n FooterText: footerText,\n Id: id,\n };\n return this.post<SendMessageResponse>(\"/chat/send/list\", request, options);\n }\n\n /**\n * Send poll message\n */\n async sendPoll(\n groupJID: string,\n header: string,\n options: string[],\n id?: string,\n requestOptions?: RequestOptions\n ): Promise<SendMessageResponse> {\n const request: SendPollRequest = {\n Group: groupJID,\n Header: header,\n Options: options,\n Id: id,\n };\n return this.post<SendMessageResponse>(\n \"/chat/send/poll\",\n request,\n requestOptions\n );\n }\n\n /**\n * Edit a message\n */\n async editMessage(\n messageId: string,\n phone: string,\n newBody: string,\n options?: RequestOptions\n ): Promise<SendMessageResponse> {\n const request: EditMessageRequest = {\n Id: messageId,\n Phone: phone,\n Body: newBody,\n };\n return this.post<SendMessageResponse>(\"/chat/send/edit\", request, options);\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AA2BO,MAAM,mBAAmBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAIzC,MAAM,SACJ,SACA,SAC8B;AAC9B,WAAO,KAAK,KAA0B,mBAAmB,SAAS,OAAO;AAAA,EAC3E;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aACJ,SACA,SAC8B;AAC9B,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UACJ,SACA,SAC8B;AAC9B,WAAO,KAAK,KAA0B,oBAAoB,SAAS,OAAO;AAAA,EAC5E;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UACJ,SACA,SAC8B;AAC9B,WAAO,KAAK,KAA0B,oBAAoB,SAAS,OAAO;AAAA,EAC5E;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aACJ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AAA,EAC3E;AACF;;"}
|
package/dist/modules/group.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class GroupModule extends BaseClient {
|
|
|
9
9
|
/**
|
|
10
10
|
* Get group invite link
|
|
11
11
|
*/
|
|
12
|
-
getInviteLink(groupJID: string, options?: RequestOptions): Promise<GroupInviteLinkResponse>;
|
|
12
|
+
getInviteLink(groupJID: string, reset?: boolean, options?: RequestOptions): Promise<GroupInviteLinkResponse>;
|
|
13
13
|
/**
|
|
14
14
|
* Get group information
|
|
15
15
|
*/
|
package/dist/modules/group.js
CHANGED
|
@@ -11,11 +11,10 @@ class GroupModule extends client.BaseClient {
|
|
|
11
11
|
/**
|
|
12
12
|
* Get group invite link
|
|
13
13
|
*/
|
|
14
|
-
async getInviteLink(groupJID, options) {
|
|
15
|
-
const
|
|
16
|
-
return this.
|
|
17
|
-
|
|
18
|
-
request,
|
|
14
|
+
async getInviteLink(groupJID, reset = false, options) {
|
|
15
|
+
const params = `groupJID=${encodeURIComponent(groupJID)}&reset=${reset}`;
|
|
16
|
+
return this.get(
|
|
17
|
+
`/group/invitelink?${params}`,
|
|
19
18
|
options
|
|
20
19
|
);
|
|
21
20
|
}
|
|
@@ -23,8 +22,8 @@ class GroupModule extends client.BaseClient {
|
|
|
23
22
|
* Get group information
|
|
24
23
|
*/
|
|
25
24
|
async getInfo(groupJID, options) {
|
|
26
|
-
const
|
|
27
|
-
return this.
|
|
25
|
+
const params = `groupJID=${encodeURIComponent(groupJID)}`;
|
|
26
|
+
return this.get(`/group/info?${params}`, options);
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Change group photo (JPEG only)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sources":["../../src/modules/group.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n GroupListResponse,\n
|
|
1
|
+
{"version":3,"file":"group.js","sources":["../../src/modules/group.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n GroupListResponse,\n GroupInviteLinkResponse,\n GroupInfo,\n GroupPhotoRequest,\n GroupPhotoResponse,\n GroupNameRequest,\n GroupNameResponse,\n GroupCreateRequest,\n GroupCreateResponse,\n GroupLockedRequest,\n GroupLockedResponse,\n GroupEphemeralRequest,\n GroupEphemeralResponse,\n GroupPhotoRemoveRequest,\n GroupPhotoRemoveResponse,\n GroupLeaveRequest,\n GroupLeaveResponse,\n GroupTopicRequest,\n GroupTopicResponse,\n GroupAnnounceRequest,\n GroupAnnounceResponse,\n GroupJoinRequest,\n GroupJoinResponse,\n GroupInviteInfoRequest,\n GroupInviteInfoResponse,\n GroupUpdateParticipantsRequest,\n GroupUpdateParticipantsResponse,\n} from \"../types/group.js\";\n\nexport class GroupModule extends BaseClient {\n /**\n * List all subscribed groups\n */\n async list(options?: RequestOptions): Promise<GroupListResponse> {\n return this.get<GroupListResponse>(\"/group/list\", options);\n }\n\n /**\n * Get group invite link\n */\n async getInviteLink(\n groupJID: string,\n reset: boolean = false,\n options?: RequestOptions\n ): Promise<GroupInviteLinkResponse> {\n const params = `groupJID=${encodeURIComponent(groupJID)}&reset=${reset}`;\n return this.get<GroupInviteLinkResponse>(\n `/group/invitelink?${params}`,\n options\n );\n }\n\n /**\n * Get group information\n */\n async getInfo(\n groupJID: string,\n options?: RequestOptions\n ): Promise<GroupInfo> {\n const params = `groupJID=${encodeURIComponent(groupJID)}`;\n return this.get<GroupInfo>(`/group/info?${params}`, options);\n }\n\n /**\n * Change group photo (JPEG only)\n */\n async setPhoto(\n groupJID: string,\n image: string,\n options?: RequestOptions\n ): Promise<GroupPhotoResponse> {\n const request: GroupPhotoRequest = { GroupJID: groupJID, Image: image };\n return this.post<GroupPhotoResponse>(\"/group/photo\", request, options);\n }\n\n /**\n * Change group name\n */\n async setName(\n groupJID: string,\n name: string,\n options?: RequestOptions\n ): Promise<GroupNameResponse> {\n const request: GroupNameRequest = { GroupJID: groupJID, Name: name };\n return this.post<GroupNameResponse>(\"/group/name\", request, options);\n }\n\n /**\n * Create a new group\n */\n async create(\n name: string,\n participants: string[],\n options?: RequestOptions\n ): Promise<GroupCreateResponse> {\n const request: GroupCreateRequest = {\n Name: name,\n Participants: participants,\n };\n return this.post<GroupCreateResponse>(\"/group/create\", request, options);\n }\n\n /**\n * Set group locked status\n */\n async setLocked(\n groupJID: string,\n locked: boolean,\n options?: RequestOptions\n ): Promise<GroupLockedResponse> {\n const request: GroupLockedRequest = { GroupJID: groupJID, Locked: locked };\n return this.post<GroupLockedResponse>(\"/group/locked\", request, options);\n }\n\n /**\n * Set disappearing messages timer\n */\n async setEphemeral(\n groupJID: string,\n duration: \"24h\" | \"7d\" | \"90d\" | \"off\",\n options?: RequestOptions\n ): Promise<GroupEphemeralResponse> {\n const request: GroupEphemeralRequest = {\n GroupJID: groupJID,\n Duration: duration,\n };\n return this.post<GroupEphemeralResponse>(\n \"/group/ephemeral\",\n request,\n options\n );\n }\n\n /**\n * Remove group photo\n */\n async removePhoto(\n groupJID: string,\n options?: RequestOptions\n ): Promise<GroupPhotoRemoveResponse> {\n const request: GroupPhotoRemoveRequest = { GroupJID: groupJID };\n return this.post<GroupPhotoRemoveResponse>(\n \"/group/photo/remove\",\n request,\n options\n );\n }\n\n /**\n * Leave a group\n */\n async leave(\n groupJID: string,\n options?: RequestOptions\n ): Promise<GroupLeaveResponse> {\n const request: GroupLeaveRequest = { GroupJID: groupJID };\n return this.post<GroupLeaveResponse>(\"/group/leave\", request, options);\n }\n\n /**\n * Set group topic/description\n */\n async setTopic(\n groupJID: string,\n topic: string,\n options?: RequestOptions\n ): Promise<GroupTopicResponse> {\n const request: GroupTopicRequest = { GroupJID: groupJID, Topic: topic };\n return this.post<GroupTopicResponse>(\"/group/topic\", request, options);\n }\n\n /**\n * Set group announcement setting (only admins can send messages)\n */\n async setAnnounce(\n groupJID: string,\n announce: boolean,\n options?: RequestOptions\n ): Promise<GroupAnnounceResponse> {\n const request: GroupAnnounceRequest = {\n GroupJID: groupJID,\n Announce: announce,\n };\n return this.post<GroupAnnounceResponse>(\n \"/group/announce\",\n request,\n options\n );\n }\n\n /**\n * Join a group using invite link\n */\n async join(\n inviteCode: string,\n options?: RequestOptions\n ): Promise<GroupJoinResponse> {\n const request: GroupJoinRequest = { Code: inviteCode };\n return this.post<GroupJoinResponse>(\"/group/join\", request, options);\n }\n\n /**\n * Get group invite information\n */\n async getInviteInfo(\n inviteCode: string,\n options?: RequestOptions\n ): Promise<GroupInviteInfoResponse> {\n const request: GroupInviteInfoRequest = { Code: inviteCode };\n return this.post<GroupInviteInfoResponse>(\n \"/group/inviteinfo\",\n request,\n options\n );\n }\n\n /**\n * Update group participants (add/remove/promote/demote)\n */\n async updateParticipants(\n groupJID: string,\n action: \"add\" | \"remove\" | \"promote\" | \"demote\",\n participants: string[],\n options?: RequestOptions\n ): Promise<GroupUpdateParticipantsResponse> {\n const request: GroupUpdateParticipantsRequest = {\n GroupJID: groupJID,\n Action: action,\n Participants: participants,\n };\n return this.post<GroupUpdateParticipantsResponse>(\n \"/group/updateparticipants\",\n request,\n options\n );\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AAgCO,MAAM,oBAAoBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAI1C,MAAM,KAAK,SAAsD;AAC/D,WAAO,KAAK,IAAuB,eAAe,OAAO;AAAA,EAC3D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,cACJ,UACA,QAAiB,OACjB,SACkC;AAClC,UAAM,SAAS,YAAY,mBAAmB,QAAQ,CAAC,UAAU,KAAK;AACtE,WAAO,KAAK;AAAA,MACV,qBAAqB,MAAM;AAAA,MAC3B;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QACJ,UACA,SACoB;AACpB,UAAM,SAAS,YAAY,mBAAmB,QAAQ,CAAC;AACvD,WAAO,KAAK,IAAe,eAAe,MAAM,IAAI,OAAO;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AAA;AAAA,EAKA,MAAM,SACJ,UACA,OACA,SAC6B;AAC7B,UAAM,UAA6B,EAAE,UAAU,UAAU,OAAO,MAAA;AAChE,WAAO,KAAK,KAAyB,gBAAgB,SAAS,OAAO;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,YACJ,UACA,UACA,SACgC;AAChC,UAAM,UAAgC;AAAA,MACpC,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAEZ,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,KACJ,YACA,SAC4B;AAC5B,UAAM,UAA4B,EAAE,MAAM,WAAA;AAC1C,WAAO,KAAK,KAAwB,eAAe,SAAS,OAAO;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,cACJ,YACA,SACkC;AAClC,UAAM,UAAkC,EAAE,MAAM,WAAA;AAChD,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,mBACJ,UACA,QACA,cACA,SAC0C;AAC1C,UAAM,UAA0C;AAAA,MAC9C,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,cAAc;AAAA,IAAA;AAEhB,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AACF;;"}
|
package/dist/modules/session.js
CHANGED
|
@@ -77,7 +77,7 @@ class SessionModule extends client.BaseClient {
|
|
|
77
77
|
* Set proxy configuration
|
|
78
78
|
*/
|
|
79
79
|
async setProxy(proxyURL, enable = true, options) {
|
|
80
|
-
const request = {
|
|
80
|
+
const request = { proxy_url: proxyURL, enable };
|
|
81
81
|
return this.post("/session/proxy", request, options);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sources":["../../src/modules/session.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport {\n ConnectRequest,\n ConnectResponse,\n DisconnectResponse,\n LogoutResponse,\n StatusResponse,\n QRCodeResponse,\n S3ConfigResponse,\n S3TestResponse,\n PairPhoneRequest,\n PairPhoneResponse,\n HistoryResponse,\n ProxyRequest,\n ProxyResponse,\n} from \"../types/session.js\";\nimport { S3Config, RequestOptions } from \"../types/common.js\";\n\nexport class SessionModule extends BaseClient {\n /**\n * Connect to WhatsApp servers\n */\n async connect(\n request: ConnectRequest,\n options?: RequestOptions\n ): Promise<ConnectResponse> {\n return this.post<ConnectResponse>(\"/session/connect\", request, options);\n }\n\n /**\n * Disconnect from WhatsApp servers\n */\n async disconnect(options?: RequestOptions): Promise<DisconnectResponse> {\n return this.post<DisconnectResponse>(\n \"/session/disconnect\",\n undefined,\n options\n );\n }\n\n /**\n * Logout and finish the session\n */\n async logout(options?: RequestOptions): Promise<LogoutResponse> {\n return this.post<LogoutResponse>(\"/session/logout\", undefined, options);\n }\n\n /**\n * Get session status\n */\n async getStatus(options?: RequestOptions): Promise<StatusResponse> {\n return this.get<StatusResponse>(\"/session/status\", options);\n }\n\n /**\n * Get QR code for scanning\n */\n async getQRCode(options?: RequestOptions): Promise<QRCodeResponse> {\n return this.get<QRCodeResponse>(\"/session/qr\", options);\n }\n\n /**\n * Configure S3 storage\n */\n async configureS3(\n config: S3Config,\n options?: RequestOptions\n ): Promise<S3ConfigResponse> {\n return this.post<S3ConfigResponse>(\"/session/s3/config\", config, options);\n }\n\n /**\n * Get S3 configuration\n */\n async getS3Config(options?: RequestOptions): Promise<S3ConfigResponse> {\n return this.get<S3ConfigResponse>(\"/session/s3/config\", options);\n }\n\n /**\n * Test S3 connection\n */\n async testS3(options?: RequestOptions): Promise<S3TestResponse> {\n return this.post<S3TestResponse>(\"/session/s3/test\", undefined, options);\n }\n\n /**\n * Delete S3 configuration\n */\n async deleteS3Config(options?: RequestOptions): Promise<{ Details: string }> {\n return this.delete<{ Details: string }>(\"/session/s3/config\", options);\n }\n\n /**\n * Pair phone using verification code\n */\n async pairPhone(\n phone: string,\n options?: RequestOptions\n ): Promise<PairPhoneResponse> {\n const request: PairPhoneRequest = { Phone: phone };\n return this.post<PairPhoneResponse>(\"/session/pairphone\", request, options);\n }\n\n /**\n * Request history sync from WhatsApp servers\n */\n async requestHistory(options?: RequestOptions): Promise<HistoryResponse> {\n return this.get<HistoryResponse>(\"/session/history\", options);\n }\n\n /**\n * Set proxy configuration\n */\n async setProxy(\n proxyURL: string,\n enable: boolean = true,\n options?: RequestOptions\n ): Promise<ProxyResponse> {\n const request: ProxyRequest = {
|
|
1
|
+
{"version":3,"file":"session.js","sources":["../../src/modules/session.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport {\n ConnectRequest,\n ConnectResponse,\n DisconnectResponse,\n LogoutResponse,\n StatusResponse,\n QRCodeResponse,\n S3ConfigResponse,\n S3TestResponse,\n PairPhoneRequest,\n PairPhoneResponse,\n HistoryResponse,\n ProxyRequest,\n ProxyResponse,\n} from \"../types/session.js\";\nimport { S3Config, RequestOptions } from \"../types/common.js\";\n\nexport class SessionModule extends BaseClient {\n /**\n * Connect to WhatsApp servers\n */\n async connect(\n request: ConnectRequest,\n options?: RequestOptions\n ): Promise<ConnectResponse> {\n return this.post<ConnectResponse>(\"/session/connect\", request, options);\n }\n\n /**\n * Disconnect from WhatsApp servers\n */\n async disconnect(options?: RequestOptions): Promise<DisconnectResponse> {\n return this.post<DisconnectResponse>(\n \"/session/disconnect\",\n undefined,\n options\n );\n }\n\n /**\n * Logout and finish the session\n */\n async logout(options?: RequestOptions): Promise<LogoutResponse> {\n return this.post<LogoutResponse>(\"/session/logout\", undefined, options);\n }\n\n /**\n * Get session status\n */\n async getStatus(options?: RequestOptions): Promise<StatusResponse> {\n return this.get<StatusResponse>(\"/session/status\", options);\n }\n\n /**\n * Get QR code for scanning\n */\n async getQRCode(options?: RequestOptions): Promise<QRCodeResponse> {\n return this.get<QRCodeResponse>(\"/session/qr\", options);\n }\n\n /**\n * Configure S3 storage\n */\n async configureS3(\n config: S3Config,\n options?: RequestOptions\n ): Promise<S3ConfigResponse> {\n return this.post<S3ConfigResponse>(\"/session/s3/config\", config, options);\n }\n\n /**\n * Get S3 configuration\n */\n async getS3Config(options?: RequestOptions): Promise<S3ConfigResponse> {\n return this.get<S3ConfigResponse>(\"/session/s3/config\", options);\n }\n\n /**\n * Test S3 connection\n */\n async testS3(options?: RequestOptions): Promise<S3TestResponse> {\n return this.post<S3TestResponse>(\"/session/s3/test\", undefined, options);\n }\n\n /**\n * Delete S3 configuration\n */\n async deleteS3Config(options?: RequestOptions): Promise<{ Details: string }> {\n return this.delete<{ Details: string }>(\"/session/s3/config\", options);\n }\n\n /**\n * Pair phone using verification code\n */\n async pairPhone(\n phone: string,\n options?: RequestOptions\n ): Promise<PairPhoneResponse> {\n const request: PairPhoneRequest = { Phone: phone };\n return this.post<PairPhoneResponse>(\"/session/pairphone\", request, options);\n }\n\n /**\n * Request history sync from WhatsApp servers\n */\n async requestHistory(options?: RequestOptions): Promise<HistoryResponse> {\n return this.get<HistoryResponse>(\"/session/history\", options);\n }\n\n /**\n * Set proxy configuration\n */\n async setProxy(\n proxyURL: string,\n enable: boolean = true,\n options?: RequestOptions\n ): Promise<ProxyResponse> {\n const request: ProxyRequest = { proxy_url: proxyURL, enable: enable };\n return this.post<ProxyResponse>(\"/session/proxy\", request, options);\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AAkBO,MAAM,sBAAsBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAI5C,MAAM,QACJ,SACA,SAC0B;AAC1B,WAAO,KAAK,KAAsB,oBAAoB,SAAS,OAAO;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAAW,SAAuD;AACtE,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,O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Options } from '../types/common.js';
|
|
3
|
-
import { UserInfoResponse, UserCheckResponse, UserAvatarResponse, ContactsResponse } from '../types/user.js';
|
|
3
|
+
import { UserInfoResponse, UserCheckResponse, UserAvatarResponse, ContactsResponse, UserPresenceResponse } from '../types/user.js';
|
|
4
4
|
export declare class UserModule extends BaseClient {
|
|
5
5
|
/**
|
|
6
6
|
* Get user details for specified phone numbers
|
|
@@ -21,5 +21,5 @@ export declare class UserModule extends BaseClient {
|
|
|
21
21
|
/**
|
|
22
22
|
* Send user presence (available/unavailable status)
|
|
23
23
|
*/
|
|
24
|
-
sendPresence(presenceType: "available" | "unavailable", options?: RequestOptions): Promise<
|
|
24
|
+
sendPresence(presenceType: "available" | "unavailable", options?: RequestOptions): Promise<UserPresenceResponse>;
|
|
25
25
|
}
|
package/dist/modules/user.js
CHANGED
|
@@ -33,8 +33,8 @@ class UserModule extends client.BaseClient {
|
|
|
33
33
|
* Send user presence (available/unavailable status)
|
|
34
34
|
*/
|
|
35
35
|
async sendPresence(presenceType, options) {
|
|
36
|
-
const request = {
|
|
37
|
-
|
|
36
|
+
const request = { type: presenceType };
|
|
37
|
+
return this.post("/user/presence", request, options);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.UserModule = UserModule;
|
package/dist/modules/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sources":["../../src/modules/user.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n UserInfoRequest,\n UserInfoResponse,\n UserCheckRequest,\n UserCheckResponse,\n UserAvatarRequest,\n UserAvatarResponse,\n ContactsResponse,\n UserPresenceRequest,\n} from \"../types/user.js\";\n\nexport class UserModule extends BaseClient {\n /**\n * Get user details for specified phone numbers\n */\n async getInfo(\n phones: string[],\n options?: RequestOptions\n ): Promise<UserInfoResponse> {\n const request: UserInfoRequest = { Phone: phones };\n return this.post<UserInfoResponse>(\"/user/info\", request, options);\n }\n\n /**\n * Check if phone numbers are registered WhatsApp users\n */\n async check(\n phones: string[],\n options?: RequestOptions\n ): Promise<UserCheckResponse> {\n const request: UserCheckRequest = { Phone: phones };\n return this.post<UserCheckResponse>(\"/user/check\", request, options);\n }\n\n /**\n * Get user avatar/profile picture\n */\n async getAvatar(\n phone: string,\n preview: boolean = true,\n options?: RequestOptions\n ): Promise<UserAvatarResponse> {\n const request: UserAvatarRequest = { Phone: phone, Preview: preview };\n return this.post<UserAvatarResponse>(\"/user/avatar\", request, options);\n }\n\n /**\n * Get all contacts\n */\n async getContacts(options?: RequestOptions): Promise<ContactsResponse> {\n return this.get<ContactsResponse>(\"/user/contacts\", options);\n }\n\n /**\n * Send user presence (available/unavailable status)\n */\n async sendPresence(\n presenceType: \"available\" | \"unavailable\",\n options?: RequestOptions\n ): Promise<
|
|
1
|
+
{"version":3,"file":"user.js","sources":["../../src/modules/user.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n UserInfoRequest,\n UserInfoResponse,\n UserCheckRequest,\n UserCheckResponse,\n UserAvatarRequest,\n UserAvatarResponse,\n ContactsResponse,\n UserPresenceRequest,\n UserPresenceResponse,\n} from \"../types/user.js\";\n\nexport class UserModule extends BaseClient {\n /**\n * Get user details for specified phone numbers\n */\n async getInfo(\n phones: string[],\n options?: RequestOptions\n ): Promise<UserInfoResponse> {\n const request: UserInfoRequest = { Phone: phones };\n return this.post<UserInfoResponse>(\"/user/info\", request, options);\n }\n\n /**\n * Check if phone numbers are registered WhatsApp users\n */\n async check(\n phones: string[],\n options?: RequestOptions\n ): Promise<UserCheckResponse> {\n const request: UserCheckRequest = { Phone: phones };\n return this.post<UserCheckResponse>(\"/user/check\", request, options);\n }\n\n /**\n * Get user avatar/profile picture\n */\n async getAvatar(\n phone: string,\n preview: boolean = true,\n options?: RequestOptions\n ): Promise<UserAvatarResponse> {\n const request: UserAvatarRequest = { Phone: phone, Preview: preview };\n return this.post<UserAvatarResponse>(\"/user/avatar\", request, options);\n }\n\n /**\n * Get all contacts\n */\n async getContacts(options?: RequestOptions): Promise<ContactsResponse> {\n return this.get<ContactsResponse>(\"/user/contacts\", options);\n }\n\n /**\n * Send user presence (available/unavailable status)\n */\n async sendPresence(\n presenceType: \"available\" | \"unavailable\",\n options?: RequestOptions\n ): Promise<UserPresenceResponse> {\n const request: UserPresenceRequest = { type: presenceType };\n return this.post<UserPresenceResponse>(\"/user/presence\", request, options);\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AAcO,MAAM,mBAAmBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAIzC,MAAM,QACJ,QACA,SAC2B;AAC3B,UAAM,UAA2B,EAAE,OAAO,OAAA;AAC1C,WAAO,KAAK,KAAuB,cAAc,SAAS,OAAO;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MACJ,QACA,SAC4B;AAC5B,UAAM,UAA4B,EAAE,OAAO,OAAA;AAC3C,WAAO,KAAK,KAAwB,eAAe,SAAS,OAAO;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UACJ,OACA,UAAmB,MACnB,SAC6B;AAC7B,UAAM,UAA6B,EAAE,OAAO,OAAO,SAAS,QAAA;AAC5D,WAAO,KAAK,KAAyB,gBAAgB,SAAS,OAAO;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,YAAY,SAAqD;AACrE,WAAO,KAAK,IAAsB,kBAAkB,OAAO;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aACJ,cACA,SAC+B;AAC/B,UAAM,UAA+B,EAAE,MAAM,aAAA;AAC7C,WAAO,KAAK,KAA2B,kBAAkB,SAAS,OAAO;AAAA,EAC3E;AACF;;"}
|
|
@@ -5,15 +5,15 @@ export declare class WebhookModule extends BaseClient {
|
|
|
5
5
|
/**
|
|
6
6
|
* Set webhook URL and events to subscribe to
|
|
7
7
|
*/
|
|
8
|
-
setWebhook(webhookURL: string, options?: RequestOptions): Promise<SetWebhookResponse>;
|
|
8
|
+
setWebhook(webhookURL: string, events?: string[], options?: RequestOptions): Promise<SetWebhookResponse>;
|
|
9
9
|
/**
|
|
10
10
|
* Get current webhook configuration
|
|
11
11
|
*/
|
|
12
12
|
getWebhook(options?: RequestOptions): Promise<GetWebhookResponse>;
|
|
13
13
|
/**
|
|
14
|
-
* Update webhook URL
|
|
14
|
+
* Update webhook URL, events, and activation status
|
|
15
15
|
*/
|
|
16
|
-
updateWebhook(webhookURL
|
|
16
|
+
updateWebhook(webhookURL?: string, events?: string[], active?: boolean, options?: RequestOptions): Promise<UpdateWebhookResponse>;
|
|
17
17
|
/**
|
|
18
18
|
* Delete webhook configuration
|
|
19
19
|
*/
|
package/dist/modules/webhook.js
CHANGED
|
@@ -5,8 +5,8 @@ class WebhookModule extends client.BaseClient {
|
|
|
5
5
|
/**
|
|
6
6
|
* Set webhook URL and events to subscribe to
|
|
7
7
|
*/
|
|
8
|
-
async setWebhook(webhookURL, options) {
|
|
9
|
-
const request = { webhookURL };
|
|
8
|
+
async setWebhook(webhookURL, events = ["All"], options) {
|
|
9
|
+
const request = { webhook: webhookURL, events };
|
|
10
10
|
return this.post("/webhook", request, options);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -16,10 +16,14 @@ class WebhookModule extends client.BaseClient {
|
|
|
16
16
|
return this.get("/webhook", options);
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Update webhook URL
|
|
19
|
+
* Update webhook URL, events, and activation status
|
|
20
20
|
*/
|
|
21
|
-
async updateWebhook(webhookURL, options) {
|
|
22
|
-
const request = {
|
|
21
|
+
async updateWebhook(webhookURL, events, active, options) {
|
|
22
|
+
const request = {
|
|
23
|
+
webhook: webhookURL,
|
|
24
|
+
events,
|
|
25
|
+
Active: active
|
|
26
|
+
};
|
|
23
27
|
return this.put("/webhook", request, options);
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sources":["../../src/modules/webhook.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n SetWebhookRequest,\n SetWebhookResponse,\n GetWebhookResponse,\n UpdateWebhookRequest,\n UpdateWebhookResponse,\n DeleteWebhookResponse,\n} from \"../types/webhook.js\";\n\nexport class WebhookModule extends BaseClient {\n /**\n * Set webhook URL and events to subscribe to\n */\n async setWebhook(\n webhookURL: string,\n options?: RequestOptions\n ): Promise<SetWebhookResponse> {\n const request: SetWebhookRequest = { webhookURL };\n return this.post<SetWebhookResponse>(\"/webhook\", request, options);\n }\n\n /**\n * Get current webhook configuration\n */\n async getWebhook(options?: RequestOptions): Promise<GetWebhookResponse> {\n return this.get<GetWebhookResponse>(\"/webhook\", options);\n }\n\n /**\n * Update webhook URL\n */\n async updateWebhook(\n webhookURL
|
|
1
|
+
{"version":3,"file":"webhook.js","sources":["../../src/modules/webhook.ts"],"sourcesContent":["import { BaseClient } from \"../client.js\";\nimport { RequestOptions } from \"../types/common.js\";\nimport {\n SetWebhookRequest,\n SetWebhookResponse,\n GetWebhookResponse,\n UpdateWebhookRequest,\n UpdateWebhookResponse,\n DeleteWebhookResponse,\n} from \"../types/webhook.js\";\n\nexport class WebhookModule extends BaseClient {\n /**\n * Set webhook URL and events to subscribe to\n */\n async setWebhook(\n webhookURL: string,\n events: string[] = [\"All\"],\n options?: RequestOptions\n ): Promise<SetWebhookResponse> {\n const request: SetWebhookRequest = { webhook: webhookURL, events };\n return this.post<SetWebhookResponse>(\"/webhook\", request, options);\n }\n\n /**\n * Get current webhook configuration\n */\n async getWebhook(options?: RequestOptions): Promise<GetWebhookResponse> {\n return this.get<GetWebhookResponse>(\"/webhook\", options);\n }\n\n /**\n * Update webhook URL, events, and activation status\n */\n async updateWebhook(\n webhookURL?: string,\n events?: string[],\n active?: boolean,\n options?: RequestOptions\n ): Promise<UpdateWebhookResponse> {\n const request: UpdateWebhookRequest = {\n webhook: webhookURL,\n events,\n Active: active,\n };\n return this.put<UpdateWebhookResponse>(\"/webhook\", request, options);\n }\n\n /**\n * Delete webhook configuration\n */\n async deleteWebhook(\n options?: RequestOptions\n ): Promise<DeleteWebhookResponse> {\n return this.delete<DeleteWebhookResponse>(\"/webhook\", options);\n }\n}\n"],"names":["BaseClient"],"mappings":";;;AAWO,MAAM,sBAAsBA,OAAAA,WAAW;AAAA;AAAA;AAAA;AAAA,EAI5C,MAAM,WACJ,YACA,SAAmB,CAAC,KAAK,GACzB,SAC6B;AAC7B,UAAM,UAA6B,EAAE,SAAS,YAAY,OAAA;AAC1D,WAAO,KAAK,KAAyB,YAAY,SAAS,OAAO;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAAW,SAAuD;AACtE,WAAO,KAAK,IAAwB,YAAY,OAAO;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,cACJ,YACA,QACA,QACA,SACgC;AAChC,UAAM,UAAgC;AAAA,MACpC,SAAS;AAAA,MACT;AAAA,MACA,QAAQ;AAAA,IAAA;AAEV,WAAO,KAAK,IAA2B,YAAY,SAAS,OAAO;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,cACJ,SACgC;AAChC,WAAO,KAAK,OAA8B,YAAY,OAAO;AAAA,EAC/D;AACF;;"}
|
package/dist/types/admin.d.ts
CHANGED
|
@@ -1,26 +1,59 @@
|
|
|
1
|
-
import { ProxyConfig, S3Config } from './common.js';
|
|
2
1
|
export interface User {
|
|
3
|
-
id:
|
|
2
|
+
id: string;
|
|
4
3
|
name: string;
|
|
5
4
|
token: string;
|
|
6
5
|
webhook: string;
|
|
7
6
|
jid: string;
|
|
8
7
|
qrcode: string;
|
|
9
8
|
connected: boolean;
|
|
9
|
+
loggedIn: boolean;
|
|
10
10
|
expiration: number;
|
|
11
11
|
events: string;
|
|
12
|
+
proxy_url: string;
|
|
12
13
|
}
|
|
13
14
|
export interface CreateUserRequest {
|
|
14
15
|
name: string;
|
|
15
16
|
token: string;
|
|
16
17
|
webhook?: string;
|
|
17
|
-
events
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
events?: string;
|
|
19
|
+
proxyConfig?: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
proxyURL: string;
|
|
22
|
+
};
|
|
23
|
+
s3Config?: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
endpoint: string;
|
|
26
|
+
region: string;
|
|
27
|
+
bucket: string;
|
|
28
|
+
accessKey: string;
|
|
29
|
+
secretKey: string;
|
|
30
|
+
pathStyle: boolean;
|
|
31
|
+
publicURL?: string;
|
|
32
|
+
mediaDelivery: "base64" | "s3" | "both";
|
|
33
|
+
retentionDays: number;
|
|
34
|
+
};
|
|
21
35
|
}
|
|
22
36
|
export interface CreateUserResponse {
|
|
23
|
-
id:
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
token: string;
|
|
40
|
+
webhook?: string;
|
|
41
|
+
events?: string;
|
|
42
|
+
proxy_config?: {
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
proxy_url: string;
|
|
45
|
+
};
|
|
46
|
+
s3_config?: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
endpoint: string;
|
|
49
|
+
region: string;
|
|
50
|
+
bucket: string;
|
|
51
|
+
access_key: string;
|
|
52
|
+
path_style: boolean;
|
|
53
|
+
public_url: string;
|
|
54
|
+
media_delivery: string;
|
|
55
|
+
retention_days: number;
|
|
56
|
+
};
|
|
24
57
|
}
|
|
25
58
|
export interface DeleteUserResponse {
|
|
26
59
|
Details: string;
|
package/dist/types/chat.d.ts
CHANGED
|
@@ -94,9 +94,7 @@ export interface DownloadMediaResponse {
|
|
|
94
94
|
[key: string]: unknown;
|
|
95
95
|
}
|
|
96
96
|
export interface DeleteMessageRequest {
|
|
97
|
-
Phone: string;
|
|
98
97
|
Id: string;
|
|
99
|
-
Remote?: boolean;
|
|
100
98
|
}
|
|
101
99
|
export interface DeleteMessageResponse {
|
|
102
100
|
Details: string;
|
|
@@ -144,7 +142,7 @@ export interface SendPollRequest {
|
|
|
144
142
|
Id?: string;
|
|
145
143
|
}
|
|
146
144
|
export interface EditMessageRequest {
|
|
145
|
+
Id: string;
|
|
147
146
|
Phone: string;
|
|
148
|
-
|
|
149
|
-
NewText: string;
|
|
147
|
+
Body: string;
|
|
150
148
|
}
|
package/dist/types/group.d.ts
CHANGED
|
@@ -105,13 +105,10 @@ export interface GroupInviteInfoRequest {
|
|
|
105
105
|
Code: string;
|
|
106
106
|
}
|
|
107
107
|
export interface GroupInviteInfoResponse {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Owner: string;
|
|
113
|
-
Creation: string;
|
|
114
|
-
ParticipantsCount: number;
|
|
108
|
+
InviteInfo: {
|
|
109
|
+
GroupName: string;
|
|
110
|
+
GroupJID: string;
|
|
111
|
+
};
|
|
115
112
|
}
|
|
116
113
|
export interface GroupUpdateParticipantsRequest {
|
|
117
114
|
GroupJID: string;
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/types/webhook.ts","../../src/types/message.ts","../../src/types/events.ts"],"sourcesContent":["// Webhook endpoints types\n\nexport interface SetWebhookRequest {\n webhookURL: string;\n}\n\nexport interface SetWebhookResponse {\n webhook: string;\n}\n\nexport interface GetWebhookResponse {\n subscribe: string[];\n webhook: string;\n}\n\nexport interface UpdateWebhookRequest {\n webhookURL: string;\n}\n\nexport interface UpdateWebhookResponse {\n webhook: string;\n}\n\nexport interface DeleteWebhookResponse {\n Details: string;\n}\n\n// Webhook payload types (what your webhook endpoint receives)\n\nexport interface S3MediaInfo {\n url: string;\n key: string;\n bucket: string;\n size: number;\n mimeType: string;\n fileName: string;\n}\n\nexport interface WebhookPayload<T = unknown> {\n event: T;\n s3?: S3MediaInfo;\n base64?: string;\n mimeType?: string;\n fileName?: string;\n}\n\n// Specific webhook payload types for different media delivery modes\n\n// S3 only delivery\nexport interface S3OnlyWebhookPayload<T = unknown> {\n event: T;\n s3: S3MediaInfo;\n}\n\n// Base64 only delivery\nexport interface Base64OnlyWebhookPayload<T = unknown> {\n event: T;\n base64: string;\n mimeType: string;\n fileName: string;\n}\n\n// Both S3 and Base64 delivery\nexport interface BothMediaWebhookPayload<T = unknown> {\n event: T;\n s3: S3MediaInfo;\n base64: string;\n mimeType: string;\n fileName: string;\n}\n\n// Union type for all possible webhook payloads\nexport type AnyWebhookPayload<T = unknown> =\n | WebhookPayload<T>\n | S3OnlyWebhookPayload<T>\n | Base64OnlyWebhookPayload<T>\n | BothMediaWebhookPayload<T>;\n\n// Helper type guards\nexport function hasS3Media(\n payload: WebhookPayload\n): payload is S3OnlyWebhookPayload | BothMediaWebhookPayload {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return !!(payload as any).s3;\n}\n\nexport function hasBase64Media(\n payload: WebhookPayload\n): payload is Base64OnlyWebhookPayload | BothMediaWebhookPayload {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return !!(payload as any).base64;\n}\n\nexport function hasBothMedia(\n payload: WebhookPayload\n): payload is BothMediaWebhookPayload {\n return hasS3Media(payload) && hasBase64Media(payload);\n}\n","// WhatsApp Message types based on whatsmeow protobuf definitions\n// Reference: https://pkg.go.dev/go.mau.fi/whatsmeow@v0.0.0-20250829123043-72d2ed58e998/proto/waE2E#Message\n\n// Base message context and metadata types\nexport interface ContextInfo {\n stanzaId?: string;\n participant?: string;\n quotedMessage?: Message;\n remoteJid?: string;\n mentionedJid?: string[];\n conversionSource?: string;\n conversionData?: string;\n conversionDelaySeconds?: number;\n forwardingScore?: number;\n isForwarded?: boolean;\n quotedAd?: AdReplyInfo;\n placeholderKey?: MessageKey;\n expiration?: number;\n ephemeralSettingTimestamp?: number;\n ephemeralSharedSecret?: string;\n externalAdReply?: ExternalAdReplyInfo;\n entryPointConversionSource?: string;\n entryPointConversionApp?: string;\n entryPointConversionDelaySeconds?: number;\n disappearingMode?: DisappearingMode;\n actionLink?: ActionLink;\n groupSubject?: string;\n parentGroupJid?: string;\n trustBannerType?: string;\n trustBannerAction?: number;\n isSampled?: boolean;\n utm?: UTMInfo;\n}\n\nexport interface MessageKey {\n remoteJid?: string;\n fromMe?: boolean;\n id?: string;\n participant?: string;\n}\n\nexport interface DisappearingMode {\n initiator?: DisappearingModeInitiator;\n trigger?: DisappearingModeTrigger;\n initiatorDeviceJid?: string;\n}\n\nexport enum DisappearingModeInitiator {\n CHANGED_IN_CHAT = 0,\n INITIATED_BY_ME = 1,\n INITIATED_BY_OTHER = 2,\n}\n\nexport enum DisappearingModeTrigger {\n UNKNOWN = 0,\n CHAT_SETTING = 1,\n ACCOUNT_SETTING = 2,\n BULK_CHANGE = 3,\n}\n\nexport interface AdReplyInfo {\n advertiserName?: string;\n mediaType?: MediaType;\n jpegThumbnail?: Uint8Array;\n caption?: string;\n}\n\nexport interface ExternalAdReplyInfo {\n title?: string;\n body?: string;\n mediaType?: MediaType;\n thumbnailUrl?: string;\n mediaUrl?: string;\n thumbnail?: Uint8Array;\n sourceType?: string;\n sourceId?: string;\n sourceUrl?: string;\n containsAutoReply?: boolean;\n renderLargerThumbnail?: boolean;\n showAdAttribution?: boolean;\n ctwaClid?: string;\n ref?: string;\n}\n\nexport interface ActionLink {\n url?: string;\n buttonTitle?: string;\n}\n\nexport interface UTMInfo {\n utmSource?: string;\n utmCampaign?: string;\n}\n\nexport enum MediaType {\n UNKNOWN = 0,\n IMAGE = 1,\n VIDEO = 2,\n AUDIO = 3,\n DOCUMENT = 4,\n STICKER = 5,\n}\n\n// Interactive elements\nexport interface InteractiveAnnotation {\n polygonVertices?: Point[];\n location?: Location;\n}\n\nexport interface Point {\n xDeprecated?: number;\n yDeprecated?: number;\n x?: number;\n y?: number;\n}\n\n// Location types\nexport interface LocationMessage {\n degreesLatitude?: number;\n degreesLongitude?: number;\n name?: string;\n address?: string;\n url?: string;\n isLiveLocation?: boolean;\n accuracyInMeters?: number;\n speedInMps?: number;\n degreesClockwiseFromMagneticNorth?: number;\n comment?: string;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n}\n\nexport interface LiveLocationMessage {\n degreesLatitude?: number;\n degreesLongitude?: number;\n accuracyInMeters?: number;\n speedInMps?: number;\n degreesClockwiseFromMagneticNorth?: number;\n caption?: string;\n sequenceNumber?: number;\n timeOffset?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n}\n\nexport interface Location {\n degreesLatitude?: number;\n degreesLongitude?: number;\n name?: string;\n}\n\n// Media message types\nexport interface ImageMessage {\n url?: string;\n mimetype?: string;\n caption?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n height?: number;\n width?: number;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n interactiveAnnotations?: InteractiveAnnotation[];\n directPath?: string;\n mediaKeyTimestamp?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n firstScanSidecar?: Uint8Array;\n firstScanLength?: number;\n experimentGroupId?: number;\n scansSidecar?: Uint8Array;\n scanLengths?: number[];\n midQualityFileSha256?: Uint8Array;\n midQualityFileEncSha256?: Uint8Array;\n viewOnce?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n staticUrl?: string;\n annotations?: InteractiveAnnotation[];\n originalFileName?: string;\n}\n\nexport interface VideoMessage {\n url?: string;\n mimetype?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n seconds?: number;\n mediaKey?: Uint8Array;\n caption?: string;\n gifPlayback?: boolean;\n height?: number;\n width?: number;\n fileEncSha256?: Uint8Array;\n interactiveAnnotations?: InteractiveAnnotation[];\n directPath?: string;\n mediaKeyTimestamp?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n streamingSidecar?: Uint8Array;\n gifAttribution?: VideoAttribution;\n viewOnce?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n staticUrl?: string;\n annotations?: InteractiveAnnotation[];\n accessibilityLabel?: string;\n processedVideos?: ProcessedVideo[];\n externalShareFullVideoDurationInSeconds?: number;\n motionPhotoPresentationOffsetMS?: number;\n metadataUrl?: string;\n videoSourceType?: VideoSourceType;\n}\n\nexport enum VideoAttribution {\n NONE = 0,\n GIPHY = 1,\n TENOR = 2,\n KLIPY = 3,\n}\n\nexport enum VideoSourceType {\n USER_VIDEO = 0,\n AI_GENERATED = 1,\n}\n\nexport interface ProcessedVideo {\n url?: string;\n fileLength?: number;\n fileSha256?: Uint8Array;\n fileEncSha256?: Uint8Array;\n}\n\nexport interface AudioMessage {\n url?: string;\n mimetype?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n seconds?: number;\n ptt?: boolean;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKeyTimestamp?: number;\n contextInfo?: ContextInfo;\n streamingSidecar?: Uint8Array;\n waveform?: Uint8Array;\n backgroundArgb?: number;\n viewOnce?: boolean;\n}\n\nexport interface DocumentMessage {\n url?: string;\n mimetype?: string;\n title?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n pageCount?: number;\n mediaKey?: Uint8Array;\n fileName?: string;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKeyTimestamp?: number;\n contactVcard?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n thumbnailHeight?: number;\n thumbnailWidth?: number;\n caption?: string;\n}\n\nexport interface StickerMessage {\n url?: string;\n fileSha256?: Uint8Array;\n fileEncSha256?: Uint8Array;\n mediaKey?: Uint8Array;\n mimetype?: string;\n height?: number;\n width?: number;\n directPath?: string;\n fileLength?: number;\n mediaKeyTimestamp?: number;\n firstFrameLength?: number;\n firstFrameSidecar?: Uint8Array;\n isAnimated?: boolean;\n pngThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n stickerSentTs?: number;\n isAvatar?: boolean;\n isAiSticker?: boolean;\n isLottie?: boolean;\n}\n\n// Contact message types\nexport interface ContactMessage {\n displayName?: string;\n vcard?: string;\n contextInfo?: ContextInfo;\n}\n\nexport interface ContactsArrayMessage {\n displayName?: string;\n contacts?: ContactMessage[];\n contextInfo?: ContextInfo;\n}\n\n// Text and extended text messages\nexport interface ExtendedTextMessage {\n text?: string;\n matchedText?: string;\n canonicalUrl?: string;\n description?: string;\n title?: string;\n textArgb?: number;\n backgroundArgb?: number;\n font?: ExtendedTextMessageFontType;\n previewType?: ExtendedTextMessagePreviewType;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n doNotPlayInline?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n mediaKey?: Uint8Array;\n mediaKeyTimestamp?: number;\n thumbnailHeight?: number;\n thumbnailWidth?: number;\n inviteLinkGroupType?: ExtendedTextMessageInviteLinkGroupType;\n inviteLinkParentGroupSubject?: string;\n inviteLinkParentGroupThumbnailJpeg?: Uint8Array;\n inviteLinkGroupTypeV2?: InviteLinkGroupType;\n viewOnce?: boolean;\n}\n\nexport enum ExtendedTextMessageFontType {\n SANS_SERIF = 0,\n SERIF = 1,\n NORICAN_REGULAR = 2,\n BRYNDAN_WRITE = 3,\n BEBASNEUE_REGULAR = 4,\n OSWALD_HEAVY = 5,\n}\n\nexport enum ExtendedTextMessagePreviewType {\n NONE = 0,\n VIDEO = 1,\n PLACEHOLDER = 4,\n IMAGE = 5,\n}\n\nexport enum ExtendedTextMessageInviteLinkGroupType {\n DEFAULT = 0,\n PARENT = 1,\n SUB = 2,\n DEFAULT_SUB = 3,\n}\n\nexport enum InviteLinkGroupType {\n DEFAULT = 0,\n PARENT = 1,\n SUB = 2,\n DEFAULT_SUB = 3,\n}\n\n// Interactive messages\nexport interface ButtonsMessage {\n contentText?: string;\n footerText?: string;\n contextInfo?: ContextInfo;\n buttons?: Button[];\n headerType?: ButtonsMessageHeaderType;\n text?: string;\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n}\n\nexport interface Button {\n buttonId?: string;\n buttonText?: ButtonText;\n type?: ButtonType;\n nativeFlowInfo?: NativeFlowInfo;\n}\n\nexport interface ButtonText {\n displayText?: string;\n}\n\nexport enum ButtonType {\n UNKNOWN = 0,\n RESPONSE = 1,\n NATIVE_FLOW = 2,\n}\n\nexport interface NativeFlowInfo {\n name?: string;\n paramsJson?: string;\n}\n\nexport enum ButtonsMessageHeaderType {\n UNKNOWN = 0,\n EMPTY = 1,\n TEXT = 2,\n DOCUMENT = 3,\n IMAGE = 4,\n VIDEO = 5,\n LOCATION = 6,\n}\n\nexport interface ListMessage {\n title?: string;\n description?: string;\n buttonText?: string;\n listType?: ListMessageListType;\n sections?: Section[];\n productListInfo?: ProductListInfo;\n footerText?: string;\n contextInfo?: ContextInfo;\n}\n\nexport interface Section {\n title?: string;\n rows?: Row[];\n}\n\nexport interface Row {\n title?: string;\n description?: string;\n rowId?: string;\n}\n\nexport interface ProductListInfo {\n productSections?: ProductSection[];\n headerImage?: ImageMessage;\n businessOwnerJid?: string;\n}\n\nexport interface ProductSection {\n title?: string;\n products?: ProductListItem[];\n}\n\nexport interface ProductListItem {\n productId?: string;\n}\n\nexport enum ListMessageListType {\n UNKNOWN = 0,\n SINGLE_SELECT = 1,\n PRODUCT_LIST = 2,\n}\n\n// Template and interactive response messages\nexport interface TemplateMessage {\n contextInfo?: ContextInfo;\n hydratedTemplate?: HydratedFourRowTemplate;\n templateId?: string;\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n}\n\nexport interface HydratedFourRowTemplate {\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n title?: string;\n hydratedContentText?: string;\n hydratedFooterText?: string;\n hydratedButtons?: HydratedTemplateButton[];\n templateId?: string;\n mask?: string;\n}\n\nexport interface HydratedTemplateButton {\n index?: number;\n quickReplyButton?: HydratedQuickReplyButton;\n urlButton?: HydratedURLButton;\n callButton?: HydratedCallButton;\n}\n\nexport interface HydratedQuickReplyButton {\n displayText?: string;\n id?: string;\n}\n\nexport interface HydratedURLButton {\n displayText?: string;\n url?: string;\n}\n\nexport interface HydratedCallButton {\n displayText?: string;\n phoneNumber?: string;\n}\n\n// Response messages\nexport interface ButtonsResponseMessage {\n selectedButtonId?: string;\n contextInfo?: ContextInfo;\n type?: ButtonsResponseMessageType;\n selectedDisplayText?: string;\n}\n\nexport enum ButtonsResponseMessageType {\n UNKNOWN = 0,\n DISPLAY_TEXT = 1,\n}\n\nexport interface ListResponseMessage {\n title?: string;\n listType?: ListResponseMessageListType;\n singleSelectReply?: SingleSelectReply;\n contextInfo?: ContextInfo;\n description?: string;\n}\n\nexport interface SingleSelectReply {\n selectedRowId?: string;\n}\n\nexport enum ListResponseMessageListType {\n UNKNOWN = 0,\n SINGLE_SELECT = 1,\n}\n\n// Payment and order messages\nexport interface SendPaymentMessage {\n noteMessage?: Message;\n requestMessageKey?: MessageKey;\n background?: PaymentBackground;\n}\n\nexport interface PaymentBackground {\n id?: string;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKey?: Uint8Array;\n type?: PaymentBackgroundType;\n mediaKeyTimestamp?: number;\n}\n\nexport enum PaymentBackgroundType {\n UNKNOWN = 0,\n DEFAULT = 1,\n}\n\nexport interface RequestPaymentMessage {\n noteMessage?: Message;\n currencyCodeIso4217?: string;\n amount1000?: number;\n requestFrom?: string;\n expiryTimestamp?: number;\n background?: PaymentBackground;\n}\n\nexport interface DeclinePaymentRequestMessage {\n key?: MessageKey;\n}\n\nexport interface CancelPaymentRequestMessage {\n key?: MessageKey;\n}\n\n// Group invite message\nexport interface GroupInviteMessage {\n groupJid?: string;\n inviteCode?: string;\n inviteExpiration?: number;\n groupName?: string;\n jpegThumbnail?: Uint8Array;\n caption?: string;\n contextInfo?: ContextInfo;\n}\n\n// Poll message\nexport interface PollCreationMessage {\n name?: string;\n options?: PollOption[];\n selectableOptionsCount?: number;\n contextInfo?: ContextInfo;\n}\n\nexport interface PollOption {\n optionName?: string;\n}\n\nexport interface PollUpdateMessage {\n pollCreationMessageKey?: MessageKey;\n vote?: PollEncValue;\n metadata?: PollUpdateMetadata;\n senderTimestampMs?: number;\n}\n\nexport interface PollEncValue {\n encPayload?: Uint8Array;\n encIv?: Uint8Array;\n}\n\nexport interface PollUpdateMetadata {\n // Metadata about the poll update\n}\n\n// Chat and conversation messages\nexport interface Chat {\n displayName?: string;\n id?: string;\n}\n\nexport interface Call {\n callKey?: Uint8Array;\n conversionSource?: string;\n conversionData?: Uint8Array;\n conversionDelaySeconds?: number;\n}\n\n// Main Message union type\nexport interface Message {\n // Text messages\n conversation?: string;\n extendedTextMessage?: ExtendedTextMessage;\n\n // Media messages\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n audioMessage?: AudioMessage;\n documentMessage?: DocumentMessage;\n stickerMessage?: StickerMessage;\n\n // Location messages\n locationMessage?: LocationMessage;\n liveLocationMessage?: LiveLocationMessage;\n\n // Contact messages\n contactMessage?: ContactMessage;\n contactsArrayMessage?: ContactsArrayMessage;\n\n // Interactive messages\n buttonsMessage?: ButtonsMessage;\n listMessage?: ListMessage;\n templateMessage?: TemplateMessage;\n\n // Response messages\n buttonsResponseMessage?: ButtonsResponseMessage;\n listResponseMessage?: ListResponseMessage;\n\n // Payment messages\n sendPaymentMessage?: SendPaymentMessage;\n requestPaymentMessage?: RequestPaymentMessage;\n declinePaymentRequestMessage?: DeclinePaymentRequestMessage;\n cancelPaymentRequestMessage?: CancelPaymentRequestMessage;\n\n // Group messages\n groupInviteMessage?: GroupInviteMessage;\n\n // Poll messages\n pollCreationMessage?: PollCreationMessage;\n pollUpdateMessage?: PollUpdateMessage;\n\n // System messages\n protocolMessage?: ProtocolMessage;\n ephemeralMessage?: EphemeralMessage;\n viewOnceMessage?: ViewOnceMessage;\n reactionMessage?: ReactionMessage;\n stickerSyncRmrMessage?: StickerSyncRmrMessage;\n\n // Call messages\n call?: Call;\n chat?: Chat;\n\n // MessageContextInfo\n messageContextInfo?: MessageContextInfo;\n}\n\n// System and protocol messages\nexport interface ProtocolMessage {\n key?: MessageKey;\n type?: ProtocolMessageType;\n ephemeralExpiration?: number;\n ephemeralSettingTimestamp?: number;\n historySyncNotification?: HistorySyncNotification;\n appStateSyncKeyShare?: AppStateSyncKeyShare;\n appStateSyncKeyRequest?: AppStateSyncKeyRequest;\n initialSecurityNotificationSettingSync?: InitialSecurityNotificationSettingSync;\n appStateFatalExceptionNotification?: AppStateFatalExceptionNotification;\n disappearingMode?: DisappearingMode;\n editedMessage?: Message;\n timestampMs?: number;\n peerDataOperationRequestMessage?: PeerDataOperationRequestMessage;\n peerDataOperationRequestResponseMessage?: PeerDataOperationRequestResponseMessage;\n}\n\nexport enum ProtocolMessageType {\n REVOKE = 0,\n EPHEMERAL_SETTING = 3,\n EPHEMERAL_SYNC_RESPONSE = 4,\n HISTORY_SYNC_NOTIFICATION = 5,\n APP_STATE_SYNC_KEY_SHARE = 6,\n APP_STATE_SYNC_KEY_REQUEST = 7,\n MSG_FANOUT_BACKFILL_REQUEST = 8,\n INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9,\n APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10,\n SHARE_PHONE_NUMBER = 11,\n MESSAGE_EDIT = 14,\n PEER_DATA_OPERATION_REQUEST_MESSAGE = 16,\n PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE = 17,\n}\n\nexport interface EphemeralMessage {\n message?: Message;\n}\n\nexport interface ViewOnceMessage {\n message?: Message;\n}\n\nexport interface ReactionMessage {\n key?: MessageKey;\n text?: string;\n groupingKey?: string;\n senderTimestampMs?: number;\n unread?: boolean;\n}\n\nexport interface StickerSyncRmrMessage {\n filehash?: string[];\n rmrSource?: string;\n requestTimestamp?: number;\n}\n\nexport interface MessageContextInfo {\n deviceListMetadata?: DeviceListMetadata;\n deviceListMetadataVersion?: number;\n messageSecret?: Uint8Array;\n paddingBytes?: Uint8Array;\n messageAddOnDurationInSecs?: number;\n botMessageInvoker?: BotMessageInvoker;\n botResponseCorrelationId?: string;\n botPluginType?: BotPluginType;\n botPluginReferenceIndex?: number;\n botPluginSearchProvider?: BotPluginSearchProvider;\n botPluginSearchUrl?: string;\n botPluginMaybeParentPluginType?: BotPluginType;\n botReelPluginThumbnailCdnUrl?: string;\n expiredBotResponseCorrelationId?: string;\n}\n\nexport interface DeviceListMetadata {\n senderKeyHash?: Uint8Array;\n senderTimestamp?: number;\n senderKeyIndexes?: number[];\n recipientKeyHash?: Uint8Array;\n recipientTimestamp?: number;\n recipientKeyIndexes?: number[];\n}\n\nexport interface BotMessageInvoker {\n // Bot message invoker details\n}\n\nexport enum BotPluginType {\n REELS = 0,\n SEARCH = 1,\n}\n\nexport enum BotPluginSearchProvider {\n BING = 0,\n GOOGLE = 1,\n}\n\n// Additional system notification types\nexport interface HistorySyncNotification {\n fileSha256?: Uint8Array;\n fileLength?: number;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n syncType?: HistorySyncNotificationHistorySyncType;\n chunkOrder?: number;\n originalMessageId?: string;\n progress?: number;\n oldestMsgInChunkTimestampSec?: number;\n initialHistBootstrapInlinePayload?: Uint8Array;\n peerDataRequestSessionId?: string;\n}\n\nexport enum HistorySyncNotificationHistorySyncType {\n INITIAL_BOOTSTRAP = 0,\n INITIAL_STATUS_V3 = 1,\n FULL = 2,\n RECENT = 3,\n PUSH_NAME = 4,\n NON_BLOCKING_DATA = 5,\n ON_DEMAND = 6,\n}\n\nexport interface AppStateSyncKeyShare {\n keys?: AppStateSyncKey[];\n}\n\nexport interface AppStateSyncKey {\n keyId?: AppStateSyncKeyId;\n keyData?: AppStateSyncKeyData;\n}\n\nexport interface AppStateSyncKeyId {\n keyId?: Uint8Array;\n}\n\nexport interface AppStateSyncKeyData {\n keyData?: Uint8Array;\n fingerprint?: AppStateSyncKeyFingerprint;\n timestamp?: number;\n}\n\nexport interface AppStateSyncKeyFingerprint {\n rawId?: number;\n currentIndex?: number;\n deviceIndexes?: number[];\n}\n\nexport interface AppStateSyncKeyRequest {\n keyIds?: AppStateSyncKeyId[];\n}\n\nexport interface InitialSecurityNotificationSettingSync {\n securityNotificationEnabled?: boolean;\n}\n\nexport interface AppStateFatalExceptionNotification {\n collectionNames?: string[];\n timestamp?: number;\n}\n\nexport interface PeerDataOperationRequestMessage {\n peerDataOperationRequestType?: PeerDataOperationRequestType;\n requestId?: string;\n}\n\nexport interface PeerDataOperationRequestResponseMessage {\n peerDataOperationResult?: PeerDataOperationRequestResponseMessagePeerDataOperationResult;\n stanzaId?: string;\n}\n\nexport enum PeerDataOperationRequestType {\n UPLOAD_STICKER = 0,\n SEND_RECENT_STICKER_BOOTSTRAP = 1,\n GENERATE_LINK_PREVIEW = 2,\n}\n\nexport enum PeerDataOperationRequestResponseMessagePeerDataOperationResult {\n SUCCESS = 0,\n NOT_AUTHORIZED = 1,\n NOT_FOUND = 2,\n THROTTLED = 3,\n UNKNOWN_ERROR = 4,\n}\n\n// Helper type to get the active message type\nexport type MessageContent =\n | { type: \"text\"; content: string }\n | { type: \"extendedText\"; content: ExtendedTextMessage }\n | { type: \"image\"; content: ImageMessage }\n | { type: \"video\"; content: VideoMessage }\n | { type: \"audio\"; content: AudioMessage }\n | { type: \"document\"; content: DocumentMessage }\n | { type: \"sticker\"; content: StickerMessage }\n | { type: \"location\"; content: LocationMessage }\n | { type: \"liveLocation\"; content: LiveLocationMessage }\n | { type: \"contact\"; content: ContactMessage }\n | { type: \"contactsArray\"; content: ContactsArrayMessage }\n | { type: \"buttons\"; content: ButtonsMessage }\n | { type: \"list\"; content: ListMessage }\n | { type: \"template\"; content: TemplateMessage }\n | { type: \"buttonsResponse\"; content: ButtonsResponseMessage }\n | { type: \"listResponse\"; content: ListResponseMessage }\n | { type: \"groupInvite\"; content: GroupInviteMessage }\n | { type: \"poll\"; content: PollCreationMessage }\n | { type: \"pollUpdate\"; content: PollUpdateMessage }\n | { type: \"reaction\"; content: ReactionMessage }\n | { type: \"protocol\"; content: ProtocolMessage }\n | { type: \"ephemeral\"; content: EphemeralMessage }\n | { type: \"viewOnce\"; content: ViewOnceMessage };\n\n// Utility function to extract message content and type\nexport function getMessageContent(message: Message): MessageContent | null {\n if (message.conversation) {\n return { type: \"text\", content: message.conversation };\n }\n if (message.extendedTextMessage) {\n return { type: \"extendedText\", content: message.extendedTextMessage };\n }\n if (message.imageMessage) {\n return { type: \"image\", content: message.imageMessage };\n }\n if (message.videoMessage) {\n return { type: \"video\", content: message.videoMessage };\n }\n if (message.audioMessage) {\n return { type: \"audio\", content: message.audioMessage };\n }\n if (message.documentMessage) {\n return { type: \"document\", content: message.documentMessage };\n }\n if (message.stickerMessage) {\n return { type: \"sticker\", content: message.stickerMessage };\n }\n if (message.locationMessage) {\n return { type: \"location\", content: message.locationMessage };\n }\n if (message.liveLocationMessage) {\n return { type: \"liveLocation\", content: message.liveLocationMessage };\n }\n if (message.contactMessage) {\n return { type: \"contact\", content: message.contactMessage };\n }\n if (message.contactsArrayMessage) {\n return { type: \"contactsArray\", content: message.contactsArrayMessage };\n }\n if (message.buttonsMessage) {\n return { type: \"buttons\", content: message.buttonsMessage };\n }\n if (message.listMessage) {\n return { type: \"list\", content: message.listMessage };\n }\n if (message.templateMessage) {\n return { type: \"template\", content: message.templateMessage };\n }\n if (message.buttonsResponseMessage) {\n return { type: \"buttonsResponse\", content: message.buttonsResponseMessage };\n }\n if (message.listResponseMessage) {\n return { type: \"listResponse\", content: message.listResponseMessage };\n }\n if (message.groupInviteMessage) {\n return { type: \"groupInvite\", content: message.groupInviteMessage };\n }\n if (message.pollCreationMessage) {\n return { type: \"poll\", content: message.pollCreationMessage };\n }\n if (message.pollUpdateMessage) {\n return { type: \"pollUpdate\", content: message.pollUpdateMessage };\n }\n if (message.reactionMessage) {\n return { type: \"reaction\", content: message.reactionMessage };\n }\n if (message.protocolMessage) {\n return { type: \"protocol\", content: message.protocolMessage };\n }\n if (message.ephemeralMessage) {\n return { type: \"ephemeral\", content: message.ephemeralMessage };\n }\n if (message.viewOnceMessage) {\n return { type: \"viewOnce\", content: message.viewOnceMessage };\n }\n\n return null;\n}\n","// WhatsApp events types based on whatsmeow package\n// Reference: https://pkg.go.dev/go.mau.fi/whatsmeow@v0.0.0-20250829123043-72d2ed58e998/types/events\n\nimport { Message } from \"./message.js\";\n\n// Event types enum for all possible WhatsApp events\nexport enum EventType {\n // Core message and communication events\n MESSAGE = \"Message\",\n RECEIPT = \"Receipt\",\n PRESENCE = \"Presence\",\n CHAT_PRESENCE = \"ChatPresence\",\n\n // Connection and session events\n CONNECTED = \"Connected\",\n DISCONNECTED = \"Disconnected\",\n LOGGED_OUT = \"LoggedOut\",\n QR = \"QR\",\n QR_SCANNED_WITHOUT_MULTIDEVICE = \"QRScannedWithoutMultidevice\",\n PAIR_SUCCESS = \"PairSuccess\",\n PAIR_ERROR = \"PairError\",\n MANUAL_LOGIN_RECONNECT = \"ManualLoginReconnect\",\n KEEP_ALIVE_RESTORED = \"KeepAliveRestored\",\n KEEP_ALIVE_TIMEOUT = \"KeepAliveTimeout\",\n\n // Group events\n GROUP_INFO = \"GroupInfo\",\n JOINED_GROUP = \"JoinedGroup\",\n\n // Contact and user events\n CONTACT = \"Contact\",\n PUSH_NAME = \"PushName\",\n PUSH_NAME_SETTING = \"PushNameSetting\",\n PICTURE = \"Picture\",\n USER_ABOUT = \"UserAbout\",\n USER_STATUS_MUTE = \"UserStatusMute\",\n PRIVACY_SETTINGS = \"PrivacySettings\",\n\n // App state and sync events\n APP_STATE = \"AppState\",\n APP_STATE_SYNC_COMPLETE = \"AppStateSyncComplete\",\n HISTORY_SYNC = \"HistorySync\",\n OFFLINE_SYNC_COMPLETED = \"OfflineSyncCompleted\",\n OFFLINE_SYNC_PREVIEW = \"OfflineSyncPreview\",\n IDENTITY_CHANGE = \"IdentityChange\",\n\n // Chat management events\n ARCHIVE = \"Archive\",\n UNARCHIVE_CHATS_SETTING = \"UnarchiveChatsSetting\",\n CLEAR_CHAT = \"ClearChat\",\n DELETE_CHAT = \"DeleteChat\",\n DELETE_FOR_ME = \"DeleteForMe\",\n MARK_CHAT_AS_READ = \"MarkChatAsRead\",\n MUTE = \"Mute\",\n PIN = \"Pin\",\n STAR = \"Star\",\n\n // Label events\n LABEL_ASSOCIATION_CHAT = \"LabelAssociationChat\",\n LABEL_ASSOCIATION_MESSAGE = \"LabelAssociationMessage\",\n LABEL_EDIT = \"LabelEdit\",\n\n // Media events\n MEDIA_RETRY = \"MediaRetry\",\n MEDIA_RETRY_ERROR = \"MediaRetryError\",\n\n // Newsletter events\n NEWSLETTER_JOIN = \"NewsletterJoin\",\n NEWSLETTER_LEAVE = \"NewsletterLeave\",\n NEWSLETTER_LIVE_UPDATE = \"NewsletterLiveUpdate\",\n NEWSLETTER_MESSAGE_META = \"NewsletterMessageMeta\",\n NEWSLETTER_MUTE_CHANGE = \"NewsletterMuteChange\",\n\n // Error and system events\n UNDECRYPTABLE_MESSAGE = \"UndecryptableMessage\",\n STREAM_ERROR = \"StreamError\",\n STREAM_REPLACED = \"StreamReplaced\",\n CONNECT_FAILURE = \"ConnectFailure\",\n CLIENT_OUTDATED = \"ClientOutdated\",\n TEMPORARY_BAN = \"TemporaryBan\",\n CAT_REFRESH_ERROR = \"CATRefreshError\",\n PERMANENT_DISCONNECT = \"PermanentDisconnect\",\n\n // Blocklist events\n BLOCKLIST = \"Blocklist\",\n BLOCKLIST_ACTION = \"BlocklistAction\",\n BLOCKLIST_CHANGE = \"BlocklistChange\",\n\n // Business events\n BUSINESS_NAME = \"BusinessName\",\n\n // Call events\n CALL_ACCEPT = \"CallAccept\",\n CALL_OFFER = \"CallOffer\",\n CALL_OFFER_NOTICE = \"CallOfferNotice\",\n CALL_PRE_ACCEPT = \"CallPreAccept\",\n CALL_REJECT = \"CallReject\",\n CALL_RELAY_LATENCY = \"CallRelayLatency\",\n CALL_TERMINATE = \"CallTerminate\",\n CALL_TRANSPORT = \"CallTransport\",\n UNKNOWN_CALL_EVENT = \"UnknownCallEvent\",\n\n // FB/Meta specific events\n FB_MESSAGE = \"FBMessage\",\n}\n\n// Additional specific types from whatsmeow\nexport interface WaBinaryNode {\n Tag: string;\n Attrs: Record<string, string>;\n Content: unknown;\n}\n\nexport interface SyncAction {\n timestamp: Date;\n action: unknown;\n}\n\nexport interface StarAction extends SyncAction {\n starred: boolean;\n}\n\nexport interface ArchiveAction extends SyncAction {\n archived: boolean;\n}\n\nexport interface ClearChatAction extends SyncAction {\n messageRange?: {\n lastMessageTimestamp?: Date;\n lastSystemMessageTimestamp?: Date;\n };\n}\n\nexport interface DeleteChatAction extends SyncAction {}\n\nexport interface DeleteMessageForMeAction extends SyncAction {}\n\nexport interface MarkChatAsReadAction extends SyncAction {\n read: boolean;\n messageRange?: {\n lastMessageTimestamp?: Date;\n lastSystemMessageTimestamp?: Date;\n };\n}\n\nexport interface MuteAction extends SyncAction {\n muted: boolean;\n muteEndTimestamp?: Date;\n}\n\nexport interface PinAction extends SyncAction {\n pinned: boolean;\n}\n\nexport interface PushNameSettingAction extends SyncAction {\n name: string;\n}\n\nexport interface UnarchiveChatsSettingAction extends SyncAction {\n unarchiveChats: boolean;\n}\n\nexport interface LabelAssociationAction extends SyncAction {\n labeled: boolean;\n}\n\nexport interface LabelEditAction extends SyncAction {\n name: string;\n color: number;\n predefinedId?: string;\n deleted: boolean;\n}\n\nexport interface BusinessNameAction extends SyncAction {\n businessName: string;\n verified: number;\n}\n\nexport interface UserStatusMuteAction extends SyncAction {\n muted: boolean;\n}\n\nexport interface Armadillo {\n payload?: unknown;\n}\n\nexport interface ConsumerApplication {\n metadata?: unknown;\n}\n\nexport interface BasicCallMeta {\n from: JID;\n timestamp: Date;\n callId: string;\n callCreator: JID;\n}\n\nexport interface CallRemoteMeta {\n remoteJid: JID;\n fromMe: boolean;\n}\n\nexport interface EventGroupParticipant {\n JID: JID;\n IsAdmin: boolean;\n IsSuperAdmin: boolean;\n}\n\nexport interface HistorySyncData {\n conversations?: unknown[];\n messages?: unknown[];\n}\n\n// Common types used in events\nexport interface JID {\n User: string;\n Agent: number;\n Device: number;\n Integrator: number;\n Server: string;\n AD: boolean;\n}\n\nexport interface MessageInfo {\n ID: string;\n Type: string;\n PushName: string;\n Timestamp: Date;\n Source: MessageSource;\n DeviceSentMeta?: DeviceSentMeta;\n ServerID?: number;\n Status?: MessageStatus;\n}\n\nexport interface MessageSource {\n Chat: JID;\n Sender: JID;\n IsFromMe: boolean;\n IsGroup: boolean;\n BroadcastListOwner?: JID;\n}\n\nexport interface DeviceSentMeta {\n DestinationJID: string;\n Phash: string;\n}\n\nexport enum MessageStatus {\n ERROR = \"ERROR\",\n PENDING = \"PENDING\",\n SERVER_ACK = \"SERVER_ACK\",\n DELIVERY_ACK = \"DELIVERY_ACK\",\n READ = \"READ\",\n PLAYED = \"PLAYED\",\n}\n\nexport enum ReceiptType {\n UNKNOWN = \"\",\n DELIVERY = \"delivery\",\n READ = \"read\",\n READ_SELF = \"read-self\",\n PLAYED = \"played\",\n SENDER = \"sender\",\n INACTIVE = \"inactive\",\n PEER_MSG = \"peer_msg\",\n}\n\nexport enum DecryptFailMode {\n UNAVAILABLE = \"unavailable\",\n DECRYPT_FAIL = \"decrypt_fail\",\n}\n\nexport enum UnavailableType {\n UNKNOWN = \"\",\n VIEW_ONCE = \"view_once\",\n}\n\nexport enum ConnectFailureReason {\n SOCKET_OPEN_TIMEOUT = 4001,\n SOCKET_PING_TIMEOUT = 4002,\n SOCKET_PONG_TIMEOUT = 4003,\n UNKNOWN_LOGOUT = 4004,\n BAD_MAC = 4005,\n INIT_TIMEOUT = 4006,\n MULTI_DEVICE_MISMATCH = 4007,\n MULTI_DEVICE_DISABLED = 4008,\n TEMP_BANNED = 4009,\n CLIENT_OUTDATED = 4010,\n STREAM_ERROR = 4011,\n DEVICE_GONE = 4012,\n IDENTITY_MISSING = 4013,\n RATE_LIMIT_HIT = 4014,\n MAIN_DEVICE_GONE = 4015,\n}\n\nexport enum TempBanReason {\n SENT_TO_TOO_MANY_PEOPLE = 101,\n BLOCKED_BY_USERS = 102,\n CREATED_TOO_MANY_GROUPS = 103,\n SENT_TOO_MANY_SAME_MESSAGE = 104,\n BROADCAST_LIST = 106,\n}\n\n// Event types\nexport interface AppState {\n name: string;\n version: number;\n hash: string[];\n}\n\nexport interface AppStateSyncComplete {\n name: string;\n}\n\nexport interface Archive {\n JID: JID;\n Timestamp: Date;\n Action: ArchiveAction;\n FromFullSync: boolean;\n}\n\nexport interface Blocklist {\n JID: JID;\n action: string;\n dhash: string;\n}\n\nexport interface BlocklistAction {\n action: string;\n}\n\nexport interface BlocklistChange {\n JID: JID;\n action: BlocklistChangeAction;\n}\n\nexport interface BlocklistChangeAction {\n action: string;\n}\n\nexport interface BusinessName {\n BusinessJID: JID;\n PushName: string;\n VerifiedName: string;\n VerifiedLevel: string;\n Action: BusinessNameAction;\n FromFullSync: boolean;\n}\n\nexport interface CATRefreshError {\n code: string;\n text: string;\n}\n\nexport interface CallAccept {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface CallOffer {\n BasicCallMeta: BasicCallMeta;\n CallRemoteMeta: CallRemoteMeta;\n Data: string;\n}\n\nexport interface CallOfferNotice {\n BasicCallMeta: BasicCallMeta;\n Media: string;\n Type: string;\n Data: string;\n}\n\nexport interface CallPreAccept {\n BasicCallMeta: BasicCallMeta;\n CallRemoteMeta: CallRemoteMeta;\n}\n\nexport interface CallReject {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface CallRelayLatency {\n BasicCallMeta: BasicCallMeta;\n Latency: number;\n}\n\nexport interface CallTerminate {\n BasicCallMeta: BasicCallMeta;\n Reason: string;\n}\n\nexport interface CallTransport {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface ChatPresence {\n MessageSource: MessageSource;\n State: string;\n Media: string;\n}\n\nexport interface ClearChat {\n ChatJID: JID;\n Timestamp: Date;\n Action: ClearChatAction;\n FromFullSync: boolean;\n}\n\nexport interface ClientOutdated {\n // Event indicating the client version is outdated\n}\n\nexport interface ConnectFailure {\n Reason: ConnectFailureReason;\n Raw: WaBinaryNode;\n}\n\nexport interface Connected {\n // Event indicating successful connection\n}\n\nexport interface EventContact {\n JID: JID;\n Found: boolean;\n FirstName: string;\n FullName: string;\n PushName: string;\n BusinessName: string;\n}\n\nexport interface DeleteChat {\n ChatJID: JID;\n Timestamp: Date;\n Action: DeleteChatAction;\n FromFullSync: boolean;\n}\n\nexport interface DeleteForMe {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: DeleteMessageForMeAction;\n FromFullSync: boolean;\n}\n\nexport interface Disconnected {\n // Event indicating disconnection\n}\n\nexport interface FBMessage {\n Info: MessageInfo;\n IsEphemeral: boolean;\n IsViewOnce: boolean;\n IsDocumentWithCaption: boolean;\n IsEdit: boolean;\n Message: Armadillo;\n}\n\nexport interface EventGroupInfo {\n JID: JID;\n GroupName: string;\n GroupTopic: string;\n GroupLocked: boolean;\n GroupAnnounce: boolean;\n GroupEphemeral: boolean;\n GroupParent?: JID;\n GroupLinkedParent?: JID;\n GroupIsDefaultSub: boolean;\n GroupCreated: Date;\n ParticipantVersionID: string;\n Participants: EventGroupParticipant[];\n PendingParticipants: EventGroupParticipant[];\n JoinedAt: Date;\n CreateKey: string;\n Sender: JID;\n Timestamp: Date;\n}\n\nexport interface HistorySync {\n Data: HistorySyncData;\n}\n\nexport interface IdentityChange {\n JID: JID;\n Timestamp: Date;\n Implicit: boolean;\n}\n\nexport interface JoinedGroup {\n Reason: string;\n Type: string;\n CreateKey: string;\n Participants: EventGroupParticipant[];\n}\n\nexport interface KeepAliveRestored {\n // Event indicating keep-alive connection restored\n}\n\nexport interface KeepAliveTimeout {\n // Event indicating keep-alive timeout\n}\n\nexport interface LabelAssociationChat {\n ChatJID: JID;\n LabelID: string;\n Labeled: boolean;\n Timestamp: Date;\n Action: LabelAssociationAction;\n FromFullSync: boolean;\n}\n\nexport interface LabelAssociationMessage {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n LabelID: string;\n Labeled: boolean;\n Timestamp: Date;\n Action: LabelAssociationAction;\n FromFullSync: boolean;\n}\n\nexport interface LabelEdit {\n ID: string;\n Name: string;\n Color: number;\n Deleted: boolean;\n Timestamp: Date;\n Action: LabelEditAction;\n FromFullSync: boolean;\n}\n\nexport interface LoggedOut {\n OnConnect: boolean;\n Reason: string;\n}\n\nexport interface ManualLoginReconnect {\n // Event indicating manual login reconnection required\n}\n\nexport interface MarkChatAsRead {\n ChatJID: JID;\n Timestamp: Date;\n Action: MarkChatAsReadAction;\n FromFullSync: boolean;\n}\n\nexport interface MediaRetry {\n MessageID: string;\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n Timestamp: Date;\n}\n\nexport interface MediaRetryError {\n MessageID: string;\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n Timestamp: Date;\n Error: string;\n}\n\nexport interface MessageEvent {\n Info: MessageInfo;\n Message: Message;\n IsEphemeral: boolean;\n IsViewOnce: boolean;\n IsDocumentWithCaption: boolean;\n IsEdit: boolean;\n RawMessage: WaBinaryNode;\n}\n\nexport interface Mute {\n ChatJID: JID;\n Timestamp: Date;\n Action: MuteAction;\n FromFullSync: boolean;\n}\n\nexport interface NewsletterJoin {\n ID: JID;\n NewsletterMeta: {\n name: string;\n description?: string;\n invite?: string;\n creationTime?: Date;\n };\n}\n\nexport interface NewsletterLeave {\n ID: JID;\n}\n\nexport interface NewsletterLiveUpdate {\n ID: JID;\n Time: Date;\n Messages: unknown[];\n}\n\nexport interface NewsletterMessageMeta {\n ID: JID;\n MessageServerID: number;\n MessageID: string;\n ReactionCounts: Record<string, number>;\n Views: number;\n}\n\nexport interface NewsletterMuteChange {\n ID: JID;\n Mute: string;\n}\n\nexport interface OfflineSyncCompleted {\n Count: number;\n}\n\nexport interface OfflineSyncPreview {\n Messages: unknown[];\n IsLatest: boolean;\n}\n\nexport interface PairError {\n ID: string;\n Error: string;\n}\n\nexport interface PairSuccess {\n ID: string;\n BusinessName: string;\n Platform: string;\n}\n\nexport interface PermanentDisconnect {\n // Event indicating permanent disconnection\n}\n\nexport interface Picture {\n JID: JID;\n Author: JID;\n Timestamp: Date;\n Remove: boolean;\n NewPicture?: {\n id: string;\n type: string;\n directPath: string;\n };\n OldPicture?: {\n id: string;\n type: string;\n directPath: string;\n };\n}\n\nexport interface Pin {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: PinAction;\n FromFullSync: boolean;\n}\n\nexport interface Presence {\n From: JID;\n Unavailable: boolean;\n LastSeen: Date;\n}\n\nexport interface PrivacySettings {\n GroupAddChanged: boolean;\n LastSeenChanged: boolean;\n StatusChanged: boolean;\n ProfileChanged: boolean;\n ReadReceiptsChanged: boolean;\n OnlineChanged: boolean;\n CallAddChanged: boolean;\n}\n\nexport interface PushName {\n JID: JID;\n Message: MessageInfo;\n OldPushName: string;\n NewPushName: string;\n}\n\nexport interface PushNameSetting {\n Timestamp: Date;\n Action: PushNameSettingAction;\n FromFullSync: boolean;\n}\n\nexport interface QR {\n Codes: string[];\n}\n\nexport interface QRScannedWithoutMultidevice {\n // Event indicating QR was scanned but multidevice not enabled\n}\n\nexport interface Receipt {\n MessageSource: MessageSource;\n MessageIDs: string[];\n Timestamp: Date;\n Type: ReceiptType;\n MessageSender: JID;\n}\n\nexport interface Star {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: StarAction;\n FromFullSync: boolean;\n}\n\nexport interface StreamError {\n Code: string;\n Raw: WaBinaryNode;\n}\n\nexport interface StreamReplaced {\n // Event indicating stream was replaced by another connection\n}\n\nexport interface TemporaryBan {\n Code: TempBanReason;\n Expire: number; // Duration in seconds\n}\n\nexport interface UnarchiveChatsSetting {\n Timestamp: Date;\n Action: UnarchiveChatsSettingAction;\n FromFullSync: boolean;\n}\n\nexport interface UndecryptableMessage {\n Info: MessageInfo;\n IsUnavailable: boolean;\n UnavailableType: UnavailableType;\n DecryptFailMode: DecryptFailMode;\n}\n\nexport interface UnknownCallEvent {\n Node: WaBinaryNode;\n}\n\nexport interface UserAbout {\n JID: JID;\n Status: string;\n Timestamp: Date;\n}\n\nexport interface UserStatusMute {\n JID: JID;\n Timestamp: Date;\n Action: UserStatusMuteAction;\n FromFullSync: boolean;\n}\n\n// Union type for all possible events\nexport type WhatsAppEvent =\n | AppState\n | AppStateSyncComplete\n | Archive\n | Blocklist\n | BlocklistAction\n | BlocklistChange\n | BusinessName\n | CATRefreshError\n | CallAccept\n | CallOffer\n | CallOfferNotice\n | CallPreAccept\n | CallReject\n | CallRelayLatency\n | CallTerminate\n | CallTransport\n | ChatPresence\n | ClearChat\n | ClientOutdated\n | ConnectFailure\n | Connected\n | EventContact\n | DeleteChat\n | DeleteForMe\n | Disconnected\n | FBMessage\n | EventGroupInfo\n | HistorySync\n | IdentityChange\n | JoinedGroup\n | KeepAliveRestored\n | KeepAliveTimeout\n | LabelAssociationChat\n | LabelAssociationMessage\n | LabelEdit\n | LoggedOut\n | ManualLoginReconnect\n | MarkChatAsRead\n | MediaRetry\n | MediaRetryError\n | MessageEvent\n | Mute\n | NewsletterJoin\n | NewsletterLeave\n | NewsletterLiveUpdate\n | NewsletterMessageMeta\n | NewsletterMuteChange\n | OfflineSyncCompleted\n | OfflineSyncPreview\n | PairError\n | PairSuccess\n | PermanentDisconnect\n | Picture\n | Pin\n | Presence\n | PrivacySettings\n | PushName\n | PushNameSetting\n | QR\n | QRScannedWithoutMultidevice\n | Receipt\n | Star\n | StreamError\n | StreamReplaced\n | TemporaryBan\n | UnarchiveChatsSetting\n | UndecryptableMessage\n | UnknownCallEvent\n | UserAbout\n | UserStatusMute;\n\n// Event handler type\nexport type EventHandler<T extends WhatsAppEvent = WhatsAppEvent> = (\n event: T\n) => void | Promise<void>;\n\n// Event emitter interface\nexport interface EventEmitter {\n on<T extends WhatsAppEvent>(\n eventType: string,\n handler: EventHandler<T>\n ): void;\n off<T extends WhatsAppEvent>(\n eventType: string,\n handler: EventHandler<T>\n ): void;\n emit<T extends WhatsAppEvent>(eventType: string, event: T): void;\n}\n"],"names":["DisappearingModeInitiator","DisappearingModeTrigger","MediaType","VideoAttribution","VideoSourceType","ExtendedTextMessageFontType","ExtendedTextMessagePreviewType","ExtendedTextMessageInviteLinkGroupType","InviteLinkGroupType","ButtonType","ButtonsMessageHeaderType","ListMessageListType","ButtonsResponseMessageType","ListResponseMessageListType","PaymentBackgroundType","ProtocolMessageType","BotPluginType","BotPluginSearchProvider","HistorySyncNotificationHistorySyncType","PeerDataOperationRequestType","PeerDataOperationRequestResponseMessagePeerDataOperationResult","EventType","MessageStatus","ReceiptType","DecryptFailMode","UnavailableType","ConnectFailureReason","TempBanReason"],"mappings":";;AA+EO,SAAS,WACd,SAC2D;AAE3D,SAAO,CAAC,CAAE,QAAgB;AAC5B;AAEO,SAAS,eACd,SAC+D;AAE/D,SAAO,CAAC,CAAE,QAAgB;AAC5B;AAEO,SAAS,aACd,SACoC;AACpC,SAAO,WAAW,OAAO,KAAK,eAAe,OAAO;AACtD;AClDO,IAAK,8CAAAA,+BAAL;AACLA,6BAAAA,2BAAA,qBAAkB,CAAA,IAAlB;AACAA,6BAAAA,2BAAA,qBAAkB,CAAA,IAAlB;AACAA,6BAAAA,2BAAA,wBAAqB,CAAA,IAArB;AAHU,SAAAA;AAAA,GAAA,6BAAA,CAAA,CAAA;AAML,IAAK,4CAAAC,6BAAL;AACLA,2BAAAA,yBAAA,aAAU,CAAA,IAAV;AAC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IAAV;AACAA,wBAAAA,sBAAA,kBAAe,IAAA,IAAf;AACAA,wBAAAA,sBAAA,2BAAwB,IAAA,IAAxB;AACAA,wBAAAA,sBAAA,2BAAwB,IAAA,IAAxB;AACAA,wBAAAA,sBAAA,iBAAc,IAAA,IAAd;AACAA,wBAAAA,sBAAA,qBAAkB,IAAA,IAAlB;AACAA,wBAAAA,sBAAA,kBAAe,IAAA,IAAf;AACAA,wBAAAA,sBAAA,iBAAc,IAAA,IAAd;AACAA,wBAAAA,sBAAA,sBAAmB,IAAA,IAAnB;AACAA,wBAAAA,sBAAA,oBAAiB,IAAA,IAAjB;AACAA,wBAAAA,sBAAA,sBAAmB,IAAA,IAAnB;AAfU,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AAkBL,IAAK,kCAAAC,mBAAL;AACLA,iBAAAA,eAAA,6BAA0B,GAAA,IAA1B;AACAA,iBAAAA,eAAA,sBAAmB,GAAA,IAAnB;AACAA,iBAAAA,eAAA,6BAA0B,GAAA,IAA1B;AACAA,iBAAAA,eAAA,gCAA6B,GAAA,IAA7B;AACAA,iBAAAA,eAAA,oBAAiB,GAAA,IAAjB;AALU,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/types/webhook.ts","../../src/types/message.ts","../../src/types/events.ts"],"sourcesContent":["// Webhook endpoints types\n\nexport interface SetWebhookRequest {\n webhook: string;\n events: string[];\n}\n\nexport interface SetWebhookResponse {\n WebhookURL: string;\n Events: string[];\n}\n\nexport interface GetWebhookResponse {\n subscribe: string[];\n webhook: string;\n}\n\nexport interface UpdateWebhookRequest {\n webhook?: string;\n events?: string[];\n Active?: boolean;\n}\n\nexport interface UpdateWebhookResponse {\n WebhookURL: string;\n Events: string[];\n active: boolean;\n}\n\nexport interface DeleteWebhookResponse {\n Details: string;\n}\n\n// Webhook payload types (what your webhook endpoint receives)\n\nexport interface S3MediaInfo {\n url: string;\n key: string;\n bucket: string;\n size: number;\n mimeType: string;\n fileName: string;\n}\n\nexport interface WebhookPayload<T = unknown> {\n event: T;\n s3?: S3MediaInfo;\n base64?: string;\n mimeType?: string;\n fileName?: string;\n}\n\n// Specific webhook payload types for different media delivery modes\n\n// S3 only delivery\nexport interface S3OnlyWebhookPayload<T = unknown> {\n event: T;\n s3: S3MediaInfo;\n}\n\n// Base64 only delivery\nexport interface Base64OnlyWebhookPayload<T = unknown> {\n event: T;\n base64: string;\n mimeType: string;\n fileName: string;\n}\n\n// Both S3 and Base64 delivery\nexport interface BothMediaWebhookPayload<T = unknown> {\n event: T;\n s3: S3MediaInfo;\n base64: string;\n mimeType: string;\n fileName: string;\n}\n\n// Union type for all possible webhook payloads\nexport type AnyWebhookPayload<T = unknown> =\n | WebhookPayload<T>\n | S3OnlyWebhookPayload<T>\n | Base64OnlyWebhookPayload<T>\n | BothMediaWebhookPayload<T>;\n\n// Helper type guards\nexport function hasS3Media(\n payload: WebhookPayload\n): payload is S3OnlyWebhookPayload | BothMediaWebhookPayload {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return !!(payload as any).s3;\n}\n\nexport function hasBase64Media(\n payload: WebhookPayload\n): payload is Base64OnlyWebhookPayload | BothMediaWebhookPayload {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return !!(payload as any).base64;\n}\n\nexport function hasBothMedia(\n payload: WebhookPayload\n): payload is BothMediaWebhookPayload {\n return hasS3Media(payload) && hasBase64Media(payload);\n}\n","// WhatsApp Message types based on whatsmeow protobuf definitions\n// Reference: https://pkg.go.dev/go.mau.fi/whatsmeow@v0.0.0-20250829123043-72d2ed58e998/proto/waE2E#Message\n\n// Base message context and metadata types\nexport interface ContextInfo {\n stanzaId?: string;\n participant?: string;\n quotedMessage?: Message;\n remoteJid?: string;\n mentionedJid?: string[];\n conversionSource?: string;\n conversionData?: string;\n conversionDelaySeconds?: number;\n forwardingScore?: number;\n isForwarded?: boolean;\n quotedAd?: AdReplyInfo;\n placeholderKey?: MessageKey;\n expiration?: number;\n ephemeralSettingTimestamp?: number;\n ephemeralSharedSecret?: string;\n externalAdReply?: ExternalAdReplyInfo;\n entryPointConversionSource?: string;\n entryPointConversionApp?: string;\n entryPointConversionDelaySeconds?: number;\n disappearingMode?: DisappearingMode;\n actionLink?: ActionLink;\n groupSubject?: string;\n parentGroupJid?: string;\n trustBannerType?: string;\n trustBannerAction?: number;\n isSampled?: boolean;\n utm?: UTMInfo;\n}\n\nexport interface MessageKey {\n remoteJid?: string;\n fromMe?: boolean;\n id?: string;\n participant?: string;\n}\n\nexport interface DisappearingMode {\n initiator?: DisappearingModeInitiator;\n trigger?: DisappearingModeTrigger;\n initiatorDeviceJid?: string;\n}\n\nexport enum DisappearingModeInitiator {\n CHANGED_IN_CHAT = 0,\n INITIATED_BY_ME = 1,\n INITIATED_BY_OTHER = 2,\n}\n\nexport enum DisappearingModeTrigger {\n UNKNOWN = 0,\n CHAT_SETTING = 1,\n ACCOUNT_SETTING = 2,\n BULK_CHANGE = 3,\n}\n\nexport interface AdReplyInfo {\n advertiserName?: string;\n mediaType?: MediaType;\n jpegThumbnail?: Uint8Array;\n caption?: string;\n}\n\nexport interface ExternalAdReplyInfo {\n title?: string;\n body?: string;\n mediaType?: MediaType;\n thumbnailUrl?: string;\n mediaUrl?: string;\n thumbnail?: Uint8Array;\n sourceType?: string;\n sourceId?: string;\n sourceUrl?: string;\n containsAutoReply?: boolean;\n renderLargerThumbnail?: boolean;\n showAdAttribution?: boolean;\n ctwaClid?: string;\n ref?: string;\n}\n\nexport interface ActionLink {\n url?: string;\n buttonTitle?: string;\n}\n\nexport interface UTMInfo {\n utmSource?: string;\n utmCampaign?: string;\n}\n\nexport enum MediaType {\n UNKNOWN = 0,\n IMAGE = 1,\n VIDEO = 2,\n AUDIO = 3,\n DOCUMENT = 4,\n STICKER = 5,\n}\n\n// Interactive elements\nexport interface InteractiveAnnotation {\n polygonVertices?: Point[];\n location?: Location;\n}\n\nexport interface Point {\n xDeprecated?: number;\n yDeprecated?: number;\n x?: number;\n y?: number;\n}\n\n// Location types\nexport interface LocationMessage {\n degreesLatitude?: number;\n degreesLongitude?: number;\n name?: string;\n address?: string;\n url?: string;\n isLiveLocation?: boolean;\n accuracyInMeters?: number;\n speedInMps?: number;\n degreesClockwiseFromMagneticNorth?: number;\n comment?: string;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n}\n\nexport interface LiveLocationMessage {\n degreesLatitude?: number;\n degreesLongitude?: number;\n accuracyInMeters?: number;\n speedInMps?: number;\n degreesClockwiseFromMagneticNorth?: number;\n caption?: string;\n sequenceNumber?: number;\n timeOffset?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n}\n\nexport interface Location {\n degreesLatitude?: number;\n degreesLongitude?: number;\n name?: string;\n}\n\n// Media message types\nexport interface ImageMessage {\n url?: string;\n mimetype?: string;\n caption?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n height?: number;\n width?: number;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n interactiveAnnotations?: InteractiveAnnotation[];\n directPath?: string;\n mediaKeyTimestamp?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n firstScanSidecar?: Uint8Array;\n firstScanLength?: number;\n experimentGroupId?: number;\n scansSidecar?: Uint8Array;\n scanLengths?: number[];\n midQualityFileSha256?: Uint8Array;\n midQualityFileEncSha256?: Uint8Array;\n viewOnce?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n staticUrl?: string;\n annotations?: InteractiveAnnotation[];\n originalFileName?: string;\n}\n\nexport interface VideoMessage {\n url?: string;\n mimetype?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n seconds?: number;\n mediaKey?: Uint8Array;\n caption?: string;\n gifPlayback?: boolean;\n height?: number;\n width?: number;\n fileEncSha256?: Uint8Array;\n interactiveAnnotations?: InteractiveAnnotation[];\n directPath?: string;\n mediaKeyTimestamp?: number;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n streamingSidecar?: Uint8Array;\n gifAttribution?: VideoAttribution;\n viewOnce?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n staticUrl?: string;\n annotations?: InteractiveAnnotation[];\n accessibilityLabel?: string;\n processedVideos?: ProcessedVideo[];\n externalShareFullVideoDurationInSeconds?: number;\n motionPhotoPresentationOffsetMS?: number;\n metadataUrl?: string;\n videoSourceType?: VideoSourceType;\n}\n\nexport enum VideoAttribution {\n NONE = 0,\n GIPHY = 1,\n TENOR = 2,\n KLIPY = 3,\n}\n\nexport enum VideoSourceType {\n USER_VIDEO = 0,\n AI_GENERATED = 1,\n}\n\nexport interface ProcessedVideo {\n url?: string;\n fileLength?: number;\n fileSha256?: Uint8Array;\n fileEncSha256?: Uint8Array;\n}\n\nexport interface AudioMessage {\n url?: string;\n mimetype?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n seconds?: number;\n ptt?: boolean;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKeyTimestamp?: number;\n contextInfo?: ContextInfo;\n streamingSidecar?: Uint8Array;\n waveform?: Uint8Array;\n backgroundArgb?: number;\n viewOnce?: boolean;\n}\n\nexport interface DocumentMessage {\n url?: string;\n mimetype?: string;\n title?: string;\n fileSha256?: Uint8Array;\n fileLength?: number;\n pageCount?: number;\n mediaKey?: Uint8Array;\n fileName?: string;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKeyTimestamp?: number;\n contactVcard?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n thumbnailHeight?: number;\n thumbnailWidth?: number;\n caption?: string;\n}\n\nexport interface StickerMessage {\n url?: string;\n fileSha256?: Uint8Array;\n fileEncSha256?: Uint8Array;\n mediaKey?: Uint8Array;\n mimetype?: string;\n height?: number;\n width?: number;\n directPath?: string;\n fileLength?: number;\n mediaKeyTimestamp?: number;\n firstFrameLength?: number;\n firstFrameSidecar?: Uint8Array;\n isAnimated?: boolean;\n pngThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n stickerSentTs?: number;\n isAvatar?: boolean;\n isAiSticker?: boolean;\n isLottie?: boolean;\n}\n\n// Contact message types\nexport interface ContactMessage {\n displayName?: string;\n vcard?: string;\n contextInfo?: ContextInfo;\n}\n\nexport interface ContactsArrayMessage {\n displayName?: string;\n contacts?: ContactMessage[];\n contextInfo?: ContextInfo;\n}\n\n// Text and extended text messages\nexport interface ExtendedTextMessage {\n text?: string;\n matchedText?: string;\n canonicalUrl?: string;\n description?: string;\n title?: string;\n textArgb?: number;\n backgroundArgb?: number;\n font?: ExtendedTextMessageFontType;\n previewType?: ExtendedTextMessagePreviewType;\n jpegThumbnail?: Uint8Array;\n contextInfo?: ContextInfo;\n doNotPlayInline?: boolean;\n thumbnailDirectPath?: string;\n thumbnailSha256?: Uint8Array;\n thumbnailEncSha256?: Uint8Array;\n mediaKey?: Uint8Array;\n mediaKeyTimestamp?: number;\n thumbnailHeight?: number;\n thumbnailWidth?: number;\n inviteLinkGroupType?: ExtendedTextMessageInviteLinkGroupType;\n inviteLinkParentGroupSubject?: string;\n inviteLinkParentGroupThumbnailJpeg?: Uint8Array;\n inviteLinkGroupTypeV2?: InviteLinkGroupType;\n viewOnce?: boolean;\n}\n\nexport enum ExtendedTextMessageFontType {\n SANS_SERIF = 0,\n SERIF = 1,\n NORICAN_REGULAR = 2,\n BRYNDAN_WRITE = 3,\n BEBASNEUE_REGULAR = 4,\n OSWALD_HEAVY = 5,\n}\n\nexport enum ExtendedTextMessagePreviewType {\n NONE = 0,\n VIDEO = 1,\n PLACEHOLDER = 4,\n IMAGE = 5,\n}\n\nexport enum ExtendedTextMessageInviteLinkGroupType {\n DEFAULT = 0,\n PARENT = 1,\n SUB = 2,\n DEFAULT_SUB = 3,\n}\n\nexport enum InviteLinkGroupType {\n DEFAULT = 0,\n PARENT = 1,\n SUB = 2,\n DEFAULT_SUB = 3,\n}\n\n// Interactive messages\nexport interface ButtonsMessage {\n contentText?: string;\n footerText?: string;\n contextInfo?: ContextInfo;\n buttons?: Button[];\n headerType?: ButtonsMessageHeaderType;\n text?: string;\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n}\n\nexport interface Button {\n buttonId?: string;\n buttonText?: ButtonText;\n type?: ButtonType;\n nativeFlowInfo?: NativeFlowInfo;\n}\n\nexport interface ButtonText {\n displayText?: string;\n}\n\nexport enum ButtonType {\n UNKNOWN = 0,\n RESPONSE = 1,\n NATIVE_FLOW = 2,\n}\n\nexport interface NativeFlowInfo {\n name?: string;\n paramsJson?: string;\n}\n\nexport enum ButtonsMessageHeaderType {\n UNKNOWN = 0,\n EMPTY = 1,\n TEXT = 2,\n DOCUMENT = 3,\n IMAGE = 4,\n VIDEO = 5,\n LOCATION = 6,\n}\n\nexport interface ListMessage {\n title?: string;\n description?: string;\n buttonText?: string;\n listType?: ListMessageListType;\n sections?: Section[];\n productListInfo?: ProductListInfo;\n footerText?: string;\n contextInfo?: ContextInfo;\n}\n\nexport interface Section {\n title?: string;\n rows?: Row[];\n}\n\nexport interface Row {\n title?: string;\n description?: string;\n rowId?: string;\n}\n\nexport interface ProductListInfo {\n productSections?: ProductSection[];\n headerImage?: ImageMessage;\n businessOwnerJid?: string;\n}\n\nexport interface ProductSection {\n title?: string;\n products?: ProductListItem[];\n}\n\nexport interface ProductListItem {\n productId?: string;\n}\n\nexport enum ListMessageListType {\n UNKNOWN = 0,\n SINGLE_SELECT = 1,\n PRODUCT_LIST = 2,\n}\n\n// Template and interactive response messages\nexport interface TemplateMessage {\n contextInfo?: ContextInfo;\n hydratedTemplate?: HydratedFourRowTemplate;\n templateId?: string;\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n}\n\nexport interface HydratedFourRowTemplate {\n documentMessage?: DocumentMessage;\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n locationMessage?: LocationMessage;\n title?: string;\n hydratedContentText?: string;\n hydratedFooterText?: string;\n hydratedButtons?: HydratedTemplateButton[];\n templateId?: string;\n mask?: string;\n}\n\nexport interface HydratedTemplateButton {\n index?: number;\n quickReplyButton?: HydratedQuickReplyButton;\n urlButton?: HydratedURLButton;\n callButton?: HydratedCallButton;\n}\n\nexport interface HydratedQuickReplyButton {\n displayText?: string;\n id?: string;\n}\n\nexport interface HydratedURLButton {\n displayText?: string;\n url?: string;\n}\n\nexport interface HydratedCallButton {\n displayText?: string;\n phoneNumber?: string;\n}\n\n// Response messages\nexport interface ButtonsResponseMessage {\n selectedButtonId?: string;\n contextInfo?: ContextInfo;\n type?: ButtonsResponseMessageType;\n selectedDisplayText?: string;\n}\n\nexport enum ButtonsResponseMessageType {\n UNKNOWN = 0,\n DISPLAY_TEXT = 1,\n}\n\nexport interface ListResponseMessage {\n title?: string;\n listType?: ListResponseMessageListType;\n singleSelectReply?: SingleSelectReply;\n contextInfo?: ContextInfo;\n description?: string;\n}\n\nexport interface SingleSelectReply {\n selectedRowId?: string;\n}\n\nexport enum ListResponseMessageListType {\n UNKNOWN = 0,\n SINGLE_SELECT = 1,\n}\n\n// Payment and order messages\nexport interface SendPaymentMessage {\n noteMessage?: Message;\n requestMessageKey?: MessageKey;\n background?: PaymentBackground;\n}\n\nexport interface PaymentBackground {\n id?: string;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n mediaKey?: Uint8Array;\n type?: PaymentBackgroundType;\n mediaKeyTimestamp?: number;\n}\n\nexport enum PaymentBackgroundType {\n UNKNOWN = 0,\n DEFAULT = 1,\n}\n\nexport interface RequestPaymentMessage {\n noteMessage?: Message;\n currencyCodeIso4217?: string;\n amount1000?: number;\n requestFrom?: string;\n expiryTimestamp?: number;\n background?: PaymentBackground;\n}\n\nexport interface DeclinePaymentRequestMessage {\n key?: MessageKey;\n}\n\nexport interface CancelPaymentRequestMessage {\n key?: MessageKey;\n}\n\n// Group invite message\nexport interface GroupInviteMessage {\n groupJid?: string;\n inviteCode?: string;\n inviteExpiration?: number;\n groupName?: string;\n jpegThumbnail?: Uint8Array;\n caption?: string;\n contextInfo?: ContextInfo;\n}\n\n// Poll message\nexport interface PollCreationMessage {\n name?: string;\n options?: PollOption[];\n selectableOptionsCount?: number;\n contextInfo?: ContextInfo;\n}\n\nexport interface PollOption {\n optionName?: string;\n}\n\nexport interface PollUpdateMessage {\n pollCreationMessageKey?: MessageKey;\n vote?: PollEncValue;\n metadata?: PollUpdateMetadata;\n senderTimestampMs?: number;\n}\n\nexport interface PollEncValue {\n encPayload?: Uint8Array;\n encIv?: Uint8Array;\n}\n\nexport interface PollUpdateMetadata {\n // Metadata about the poll update\n}\n\n// Chat and conversation messages\nexport interface Chat {\n displayName?: string;\n id?: string;\n}\n\nexport interface Call {\n callKey?: Uint8Array;\n conversionSource?: string;\n conversionData?: Uint8Array;\n conversionDelaySeconds?: number;\n}\n\n// Main Message union type\nexport interface Message {\n // Text messages\n conversation?: string;\n extendedTextMessage?: ExtendedTextMessage;\n\n // Media messages\n imageMessage?: ImageMessage;\n videoMessage?: VideoMessage;\n audioMessage?: AudioMessage;\n documentMessage?: DocumentMessage;\n stickerMessage?: StickerMessage;\n\n // Location messages\n locationMessage?: LocationMessage;\n liveLocationMessage?: LiveLocationMessage;\n\n // Contact messages\n contactMessage?: ContactMessage;\n contactsArrayMessage?: ContactsArrayMessage;\n\n // Interactive messages\n buttonsMessage?: ButtonsMessage;\n listMessage?: ListMessage;\n templateMessage?: TemplateMessage;\n\n // Response messages\n buttonsResponseMessage?: ButtonsResponseMessage;\n listResponseMessage?: ListResponseMessage;\n\n // Payment messages\n sendPaymentMessage?: SendPaymentMessage;\n requestPaymentMessage?: RequestPaymentMessage;\n declinePaymentRequestMessage?: DeclinePaymentRequestMessage;\n cancelPaymentRequestMessage?: CancelPaymentRequestMessage;\n\n // Group messages\n groupInviteMessage?: GroupInviteMessage;\n\n // Poll messages\n pollCreationMessage?: PollCreationMessage;\n pollUpdateMessage?: PollUpdateMessage;\n\n // System messages\n protocolMessage?: ProtocolMessage;\n ephemeralMessage?: EphemeralMessage;\n viewOnceMessage?: ViewOnceMessage;\n reactionMessage?: ReactionMessage;\n stickerSyncRmrMessage?: StickerSyncRmrMessage;\n\n // Call messages\n call?: Call;\n chat?: Chat;\n\n // MessageContextInfo\n messageContextInfo?: MessageContextInfo;\n}\n\n// System and protocol messages\nexport interface ProtocolMessage {\n key?: MessageKey;\n type?: ProtocolMessageType;\n ephemeralExpiration?: number;\n ephemeralSettingTimestamp?: number;\n historySyncNotification?: HistorySyncNotification;\n appStateSyncKeyShare?: AppStateSyncKeyShare;\n appStateSyncKeyRequest?: AppStateSyncKeyRequest;\n initialSecurityNotificationSettingSync?: InitialSecurityNotificationSettingSync;\n appStateFatalExceptionNotification?: AppStateFatalExceptionNotification;\n disappearingMode?: DisappearingMode;\n editedMessage?: Message;\n timestampMs?: number;\n peerDataOperationRequestMessage?: PeerDataOperationRequestMessage;\n peerDataOperationRequestResponseMessage?: PeerDataOperationRequestResponseMessage;\n}\n\nexport enum ProtocolMessageType {\n REVOKE = 0,\n EPHEMERAL_SETTING = 3,\n EPHEMERAL_SYNC_RESPONSE = 4,\n HISTORY_SYNC_NOTIFICATION = 5,\n APP_STATE_SYNC_KEY_SHARE = 6,\n APP_STATE_SYNC_KEY_REQUEST = 7,\n MSG_FANOUT_BACKFILL_REQUEST = 8,\n INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9,\n APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10,\n SHARE_PHONE_NUMBER = 11,\n MESSAGE_EDIT = 14,\n PEER_DATA_OPERATION_REQUEST_MESSAGE = 16,\n PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE = 17,\n}\n\nexport interface EphemeralMessage {\n message?: Message;\n}\n\nexport interface ViewOnceMessage {\n message?: Message;\n}\n\nexport interface ReactionMessage {\n key?: MessageKey;\n text?: string;\n groupingKey?: string;\n senderTimestampMs?: number;\n unread?: boolean;\n}\n\nexport interface StickerSyncRmrMessage {\n filehash?: string[];\n rmrSource?: string;\n requestTimestamp?: number;\n}\n\nexport interface MessageContextInfo {\n deviceListMetadata?: DeviceListMetadata;\n deviceListMetadataVersion?: number;\n messageSecret?: Uint8Array;\n paddingBytes?: Uint8Array;\n messageAddOnDurationInSecs?: number;\n botMessageInvoker?: BotMessageInvoker;\n botResponseCorrelationId?: string;\n botPluginType?: BotPluginType;\n botPluginReferenceIndex?: number;\n botPluginSearchProvider?: BotPluginSearchProvider;\n botPluginSearchUrl?: string;\n botPluginMaybeParentPluginType?: BotPluginType;\n botReelPluginThumbnailCdnUrl?: string;\n expiredBotResponseCorrelationId?: string;\n}\n\nexport interface DeviceListMetadata {\n senderKeyHash?: Uint8Array;\n senderTimestamp?: number;\n senderKeyIndexes?: number[];\n recipientKeyHash?: Uint8Array;\n recipientTimestamp?: number;\n recipientKeyIndexes?: number[];\n}\n\nexport interface BotMessageInvoker {\n // Bot message invoker details\n}\n\nexport enum BotPluginType {\n REELS = 0,\n SEARCH = 1,\n}\n\nexport enum BotPluginSearchProvider {\n BING = 0,\n GOOGLE = 1,\n}\n\n// Additional system notification types\nexport interface HistorySyncNotification {\n fileSha256?: Uint8Array;\n fileLength?: number;\n mediaKey?: Uint8Array;\n fileEncSha256?: Uint8Array;\n directPath?: string;\n syncType?: HistorySyncNotificationHistorySyncType;\n chunkOrder?: number;\n originalMessageId?: string;\n progress?: number;\n oldestMsgInChunkTimestampSec?: number;\n initialHistBootstrapInlinePayload?: Uint8Array;\n peerDataRequestSessionId?: string;\n}\n\nexport enum HistorySyncNotificationHistorySyncType {\n INITIAL_BOOTSTRAP = 0,\n INITIAL_STATUS_V3 = 1,\n FULL = 2,\n RECENT = 3,\n PUSH_NAME = 4,\n NON_BLOCKING_DATA = 5,\n ON_DEMAND = 6,\n}\n\nexport interface AppStateSyncKeyShare {\n keys?: AppStateSyncKey[];\n}\n\nexport interface AppStateSyncKey {\n keyId?: AppStateSyncKeyId;\n keyData?: AppStateSyncKeyData;\n}\n\nexport interface AppStateSyncKeyId {\n keyId?: Uint8Array;\n}\n\nexport interface AppStateSyncKeyData {\n keyData?: Uint8Array;\n fingerprint?: AppStateSyncKeyFingerprint;\n timestamp?: number;\n}\n\nexport interface AppStateSyncKeyFingerprint {\n rawId?: number;\n currentIndex?: number;\n deviceIndexes?: number[];\n}\n\nexport interface AppStateSyncKeyRequest {\n keyIds?: AppStateSyncKeyId[];\n}\n\nexport interface InitialSecurityNotificationSettingSync {\n securityNotificationEnabled?: boolean;\n}\n\nexport interface AppStateFatalExceptionNotification {\n collectionNames?: string[];\n timestamp?: number;\n}\n\nexport interface PeerDataOperationRequestMessage {\n peerDataOperationRequestType?: PeerDataOperationRequestType;\n requestId?: string;\n}\n\nexport interface PeerDataOperationRequestResponseMessage {\n peerDataOperationResult?: PeerDataOperationRequestResponseMessagePeerDataOperationResult;\n stanzaId?: string;\n}\n\nexport enum PeerDataOperationRequestType {\n UPLOAD_STICKER = 0,\n SEND_RECENT_STICKER_BOOTSTRAP = 1,\n GENERATE_LINK_PREVIEW = 2,\n}\n\nexport enum PeerDataOperationRequestResponseMessagePeerDataOperationResult {\n SUCCESS = 0,\n NOT_AUTHORIZED = 1,\n NOT_FOUND = 2,\n THROTTLED = 3,\n UNKNOWN_ERROR = 4,\n}\n\n// Helper type to get the active message type\nexport type MessageContent =\n | { type: \"text\"; content: string }\n | { type: \"extendedText\"; content: ExtendedTextMessage }\n | { type: \"image\"; content: ImageMessage }\n | { type: \"video\"; content: VideoMessage }\n | { type: \"audio\"; content: AudioMessage }\n | { type: \"document\"; content: DocumentMessage }\n | { type: \"sticker\"; content: StickerMessage }\n | { type: \"location\"; content: LocationMessage }\n | { type: \"liveLocation\"; content: LiveLocationMessage }\n | { type: \"contact\"; content: ContactMessage }\n | { type: \"contactsArray\"; content: ContactsArrayMessage }\n | { type: \"buttons\"; content: ButtonsMessage }\n | { type: \"list\"; content: ListMessage }\n | { type: \"template\"; content: TemplateMessage }\n | { type: \"buttonsResponse\"; content: ButtonsResponseMessage }\n | { type: \"listResponse\"; content: ListResponseMessage }\n | { type: \"groupInvite\"; content: GroupInviteMessage }\n | { type: \"poll\"; content: PollCreationMessage }\n | { type: \"pollUpdate\"; content: PollUpdateMessage }\n | { type: \"reaction\"; content: ReactionMessage }\n | { type: \"protocol\"; content: ProtocolMessage }\n | { type: \"ephemeral\"; content: EphemeralMessage }\n | { type: \"viewOnce\"; content: ViewOnceMessage };\n\n// Utility function to extract message content and type\nexport function getMessageContent(message: Message): MessageContent | null {\n if (message.conversation) {\n return { type: \"text\", content: message.conversation };\n }\n if (message.extendedTextMessage) {\n return { type: \"extendedText\", content: message.extendedTextMessage };\n }\n if (message.imageMessage) {\n return { type: \"image\", content: message.imageMessage };\n }\n if (message.videoMessage) {\n return { type: \"video\", content: message.videoMessage };\n }\n if (message.audioMessage) {\n return { type: \"audio\", content: message.audioMessage };\n }\n if (message.documentMessage) {\n return { type: \"document\", content: message.documentMessage };\n }\n if (message.stickerMessage) {\n return { type: \"sticker\", content: message.stickerMessage };\n }\n if (message.locationMessage) {\n return { type: \"location\", content: message.locationMessage };\n }\n if (message.liveLocationMessage) {\n return { type: \"liveLocation\", content: message.liveLocationMessage };\n }\n if (message.contactMessage) {\n return { type: \"contact\", content: message.contactMessage };\n }\n if (message.contactsArrayMessage) {\n return { type: \"contactsArray\", content: message.contactsArrayMessage };\n }\n if (message.buttonsMessage) {\n return { type: \"buttons\", content: message.buttonsMessage };\n }\n if (message.listMessage) {\n return { type: \"list\", content: message.listMessage };\n }\n if (message.templateMessage) {\n return { type: \"template\", content: message.templateMessage };\n }\n if (message.buttonsResponseMessage) {\n return { type: \"buttonsResponse\", content: message.buttonsResponseMessage };\n }\n if (message.listResponseMessage) {\n return { type: \"listResponse\", content: message.listResponseMessage };\n }\n if (message.groupInviteMessage) {\n return { type: \"groupInvite\", content: message.groupInviteMessage };\n }\n if (message.pollCreationMessage) {\n return { type: \"poll\", content: message.pollCreationMessage };\n }\n if (message.pollUpdateMessage) {\n return { type: \"pollUpdate\", content: message.pollUpdateMessage };\n }\n if (message.reactionMessage) {\n return { type: \"reaction\", content: message.reactionMessage };\n }\n if (message.protocolMessage) {\n return { type: \"protocol\", content: message.protocolMessage };\n }\n if (message.ephemeralMessage) {\n return { type: \"ephemeral\", content: message.ephemeralMessage };\n }\n if (message.viewOnceMessage) {\n return { type: \"viewOnce\", content: message.viewOnceMessage };\n }\n\n return null;\n}\n","// WhatsApp events types based on whatsmeow package\n// Reference: https://pkg.go.dev/go.mau.fi/whatsmeow@v0.0.0-20250829123043-72d2ed58e998/types/events\n\nimport { Message } from \"./message.js\";\n\n// Event types enum for all possible WhatsApp events\nexport enum EventType {\n // Core message and communication events\n MESSAGE = \"Message\",\n RECEIPT = \"Receipt\",\n PRESENCE = \"Presence\",\n CHAT_PRESENCE = \"ChatPresence\",\n\n // Connection and session events\n CONNECTED = \"Connected\",\n DISCONNECTED = \"Disconnected\",\n LOGGED_OUT = \"LoggedOut\",\n QR = \"QR\",\n QR_SCANNED_WITHOUT_MULTIDEVICE = \"QRScannedWithoutMultidevice\",\n PAIR_SUCCESS = \"PairSuccess\",\n PAIR_ERROR = \"PairError\",\n MANUAL_LOGIN_RECONNECT = \"ManualLoginReconnect\",\n KEEP_ALIVE_RESTORED = \"KeepAliveRestored\",\n KEEP_ALIVE_TIMEOUT = \"KeepAliveTimeout\",\n\n // Group events\n GROUP_INFO = \"GroupInfo\",\n JOINED_GROUP = \"JoinedGroup\",\n\n // Contact and user events\n CONTACT = \"Contact\",\n PUSH_NAME = \"PushName\",\n PUSH_NAME_SETTING = \"PushNameSetting\",\n PICTURE = \"Picture\",\n USER_ABOUT = \"UserAbout\",\n USER_STATUS_MUTE = \"UserStatusMute\",\n PRIVACY_SETTINGS = \"PrivacySettings\",\n\n // App state and sync events\n APP_STATE = \"AppState\",\n APP_STATE_SYNC_COMPLETE = \"AppStateSyncComplete\",\n HISTORY_SYNC = \"HistorySync\",\n OFFLINE_SYNC_COMPLETED = \"OfflineSyncCompleted\",\n OFFLINE_SYNC_PREVIEW = \"OfflineSyncPreview\",\n IDENTITY_CHANGE = \"IdentityChange\",\n\n // Chat management events\n ARCHIVE = \"Archive\",\n UNARCHIVE_CHATS_SETTING = \"UnarchiveChatsSetting\",\n CLEAR_CHAT = \"ClearChat\",\n DELETE_CHAT = \"DeleteChat\",\n DELETE_FOR_ME = \"DeleteForMe\",\n MARK_CHAT_AS_READ = \"MarkChatAsRead\",\n MUTE = \"Mute\",\n PIN = \"Pin\",\n STAR = \"Star\",\n\n // Label events\n LABEL_ASSOCIATION_CHAT = \"LabelAssociationChat\",\n LABEL_ASSOCIATION_MESSAGE = \"LabelAssociationMessage\",\n LABEL_EDIT = \"LabelEdit\",\n\n // Media events\n MEDIA_RETRY = \"MediaRetry\",\n MEDIA_RETRY_ERROR = \"MediaRetryError\",\n\n // Newsletter events\n NEWSLETTER_JOIN = \"NewsletterJoin\",\n NEWSLETTER_LEAVE = \"NewsletterLeave\",\n NEWSLETTER_LIVE_UPDATE = \"NewsletterLiveUpdate\",\n NEWSLETTER_MESSAGE_META = \"NewsletterMessageMeta\",\n NEWSLETTER_MUTE_CHANGE = \"NewsletterMuteChange\",\n\n // Error and system events\n UNDECRYPTABLE_MESSAGE = \"UndecryptableMessage\",\n STREAM_ERROR = \"StreamError\",\n STREAM_REPLACED = \"StreamReplaced\",\n CONNECT_FAILURE = \"ConnectFailure\",\n CLIENT_OUTDATED = \"ClientOutdated\",\n TEMPORARY_BAN = \"TemporaryBan\",\n CAT_REFRESH_ERROR = \"CATRefreshError\",\n PERMANENT_DISCONNECT = \"PermanentDisconnect\",\n\n // Blocklist events\n BLOCKLIST = \"Blocklist\",\n BLOCKLIST_ACTION = \"BlocklistAction\",\n BLOCKLIST_CHANGE = \"BlocklistChange\",\n\n // Business events\n BUSINESS_NAME = \"BusinessName\",\n\n // Call events\n CALL_ACCEPT = \"CallAccept\",\n CALL_OFFER = \"CallOffer\",\n CALL_OFFER_NOTICE = \"CallOfferNotice\",\n CALL_PRE_ACCEPT = \"CallPreAccept\",\n CALL_REJECT = \"CallReject\",\n CALL_RELAY_LATENCY = \"CallRelayLatency\",\n CALL_TERMINATE = \"CallTerminate\",\n CALL_TRANSPORT = \"CallTransport\",\n UNKNOWN_CALL_EVENT = \"UnknownCallEvent\",\n\n // FB/Meta specific events\n FB_MESSAGE = \"FBMessage\",\n}\n\n// Additional specific types from whatsmeow\nexport interface WaBinaryNode {\n Tag: string;\n Attrs: Record<string, string>;\n Content: unknown;\n}\n\nexport interface SyncAction {\n timestamp: Date;\n action: unknown;\n}\n\nexport interface StarAction extends SyncAction {\n starred: boolean;\n}\n\nexport interface ArchiveAction extends SyncAction {\n archived: boolean;\n}\n\nexport interface ClearChatAction extends SyncAction {\n messageRange?: {\n lastMessageTimestamp?: Date;\n lastSystemMessageTimestamp?: Date;\n };\n}\n\nexport interface DeleteChatAction extends SyncAction {}\n\nexport interface DeleteMessageForMeAction extends SyncAction {}\n\nexport interface MarkChatAsReadAction extends SyncAction {\n read: boolean;\n messageRange?: {\n lastMessageTimestamp?: Date;\n lastSystemMessageTimestamp?: Date;\n };\n}\n\nexport interface MuteAction extends SyncAction {\n muted: boolean;\n muteEndTimestamp?: Date;\n}\n\nexport interface PinAction extends SyncAction {\n pinned: boolean;\n}\n\nexport interface PushNameSettingAction extends SyncAction {\n name: string;\n}\n\nexport interface UnarchiveChatsSettingAction extends SyncAction {\n unarchiveChats: boolean;\n}\n\nexport interface LabelAssociationAction extends SyncAction {\n labeled: boolean;\n}\n\nexport interface LabelEditAction extends SyncAction {\n name: string;\n color: number;\n predefinedId?: string;\n deleted: boolean;\n}\n\nexport interface BusinessNameAction extends SyncAction {\n businessName: string;\n verified: number;\n}\n\nexport interface UserStatusMuteAction extends SyncAction {\n muted: boolean;\n}\n\nexport interface Armadillo {\n payload?: unknown;\n}\n\nexport interface ConsumerApplication {\n metadata?: unknown;\n}\n\nexport interface BasicCallMeta {\n from: JID;\n timestamp: Date;\n callId: string;\n callCreator: JID;\n}\n\nexport interface CallRemoteMeta {\n remoteJid: JID;\n fromMe: boolean;\n}\n\nexport interface EventGroupParticipant {\n JID: JID;\n IsAdmin: boolean;\n IsSuperAdmin: boolean;\n}\n\nexport interface HistorySyncData {\n conversations?: unknown[];\n messages?: unknown[];\n}\n\n// Common types used in events\nexport interface JID {\n User: string;\n Agent: number;\n Device: number;\n Integrator: number;\n Server: string;\n AD: boolean;\n}\n\nexport interface MessageInfo {\n ID: string;\n Type: string;\n PushName: string;\n Timestamp: Date;\n Source: MessageSource;\n DeviceSentMeta?: DeviceSentMeta;\n ServerID?: number;\n Status?: MessageStatus;\n}\n\nexport interface MessageSource {\n Chat: JID;\n Sender: JID;\n IsFromMe: boolean;\n IsGroup: boolean;\n BroadcastListOwner?: JID;\n}\n\nexport interface DeviceSentMeta {\n DestinationJID: string;\n Phash: string;\n}\n\nexport enum MessageStatus {\n ERROR = \"ERROR\",\n PENDING = \"PENDING\",\n SERVER_ACK = \"SERVER_ACK\",\n DELIVERY_ACK = \"DELIVERY_ACK\",\n READ = \"READ\",\n PLAYED = \"PLAYED\",\n}\n\nexport enum ReceiptType {\n UNKNOWN = \"\",\n DELIVERY = \"delivery\",\n READ = \"read\",\n READ_SELF = \"read-self\",\n PLAYED = \"played\",\n SENDER = \"sender\",\n INACTIVE = \"inactive\",\n PEER_MSG = \"peer_msg\",\n}\n\nexport enum DecryptFailMode {\n UNAVAILABLE = \"unavailable\",\n DECRYPT_FAIL = \"decrypt_fail\",\n}\n\nexport enum UnavailableType {\n UNKNOWN = \"\",\n VIEW_ONCE = \"view_once\",\n}\n\nexport enum ConnectFailureReason {\n SOCKET_OPEN_TIMEOUT = 4001,\n SOCKET_PING_TIMEOUT = 4002,\n SOCKET_PONG_TIMEOUT = 4003,\n UNKNOWN_LOGOUT = 4004,\n BAD_MAC = 4005,\n INIT_TIMEOUT = 4006,\n MULTI_DEVICE_MISMATCH = 4007,\n MULTI_DEVICE_DISABLED = 4008,\n TEMP_BANNED = 4009,\n CLIENT_OUTDATED = 4010,\n STREAM_ERROR = 4011,\n DEVICE_GONE = 4012,\n IDENTITY_MISSING = 4013,\n RATE_LIMIT_HIT = 4014,\n MAIN_DEVICE_GONE = 4015,\n}\n\nexport enum TempBanReason {\n SENT_TO_TOO_MANY_PEOPLE = 101,\n BLOCKED_BY_USERS = 102,\n CREATED_TOO_MANY_GROUPS = 103,\n SENT_TOO_MANY_SAME_MESSAGE = 104,\n BROADCAST_LIST = 106,\n}\n\n// Event types\nexport interface AppState {\n name: string;\n version: number;\n hash: string[];\n}\n\nexport interface AppStateSyncComplete {\n name: string;\n}\n\nexport interface Archive {\n JID: JID;\n Timestamp: Date;\n Action: ArchiveAction;\n FromFullSync: boolean;\n}\n\nexport interface Blocklist {\n JID: JID;\n action: string;\n dhash: string;\n}\n\nexport interface BlocklistAction {\n action: string;\n}\n\nexport interface BlocklistChange {\n JID: JID;\n action: BlocklistChangeAction;\n}\n\nexport interface BlocklistChangeAction {\n action: string;\n}\n\nexport interface BusinessName {\n BusinessJID: JID;\n PushName: string;\n VerifiedName: string;\n VerifiedLevel: string;\n Action: BusinessNameAction;\n FromFullSync: boolean;\n}\n\nexport interface CATRefreshError {\n code: string;\n text: string;\n}\n\nexport interface CallAccept {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface CallOffer {\n BasicCallMeta: BasicCallMeta;\n CallRemoteMeta: CallRemoteMeta;\n Data: string;\n}\n\nexport interface CallOfferNotice {\n BasicCallMeta: BasicCallMeta;\n Media: string;\n Type: string;\n Data: string;\n}\n\nexport interface CallPreAccept {\n BasicCallMeta: BasicCallMeta;\n CallRemoteMeta: CallRemoteMeta;\n}\n\nexport interface CallReject {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface CallRelayLatency {\n BasicCallMeta: BasicCallMeta;\n Latency: number;\n}\n\nexport interface CallTerminate {\n BasicCallMeta: BasicCallMeta;\n Reason: string;\n}\n\nexport interface CallTransport {\n BasicCallMeta: BasicCallMeta;\n}\n\nexport interface ChatPresence {\n MessageSource: MessageSource;\n State: string;\n Media: string;\n}\n\nexport interface ClearChat {\n ChatJID: JID;\n Timestamp: Date;\n Action: ClearChatAction;\n FromFullSync: boolean;\n}\n\nexport interface ClientOutdated {\n // Event indicating the client version is outdated\n}\n\nexport interface ConnectFailure {\n Reason: ConnectFailureReason;\n Raw: WaBinaryNode;\n}\n\nexport interface Connected {\n // Event indicating successful connection\n}\n\nexport interface EventContact {\n JID: JID;\n Found: boolean;\n FirstName: string;\n FullName: string;\n PushName: string;\n BusinessName: string;\n}\n\nexport interface DeleteChat {\n ChatJID: JID;\n Timestamp: Date;\n Action: DeleteChatAction;\n FromFullSync: boolean;\n}\n\nexport interface DeleteForMe {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: DeleteMessageForMeAction;\n FromFullSync: boolean;\n}\n\nexport interface Disconnected {\n // Event indicating disconnection\n}\n\nexport interface FBMessage {\n Info: MessageInfo;\n IsEphemeral: boolean;\n IsViewOnce: boolean;\n IsDocumentWithCaption: boolean;\n IsEdit: boolean;\n Message: Armadillo;\n}\n\nexport interface EventGroupInfo {\n JID: JID;\n GroupName: string;\n GroupTopic: string;\n GroupLocked: boolean;\n GroupAnnounce: boolean;\n GroupEphemeral: boolean;\n GroupParent?: JID;\n GroupLinkedParent?: JID;\n GroupIsDefaultSub: boolean;\n GroupCreated: Date;\n ParticipantVersionID: string;\n Participants: EventGroupParticipant[];\n PendingParticipants: EventGroupParticipant[];\n JoinedAt: Date;\n CreateKey: string;\n Sender: JID;\n Timestamp: Date;\n}\n\nexport interface HistorySync {\n Data: HistorySyncData;\n}\n\nexport interface IdentityChange {\n JID: JID;\n Timestamp: Date;\n Implicit: boolean;\n}\n\nexport interface JoinedGroup {\n Reason: string;\n Type: string;\n CreateKey: string;\n Participants: EventGroupParticipant[];\n}\n\nexport interface KeepAliveRestored {\n // Event indicating keep-alive connection restored\n}\n\nexport interface KeepAliveTimeout {\n // Event indicating keep-alive timeout\n}\n\nexport interface LabelAssociationChat {\n ChatJID: JID;\n LabelID: string;\n Labeled: boolean;\n Timestamp: Date;\n Action: LabelAssociationAction;\n FromFullSync: boolean;\n}\n\nexport interface LabelAssociationMessage {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n LabelID: string;\n Labeled: boolean;\n Timestamp: Date;\n Action: LabelAssociationAction;\n FromFullSync: boolean;\n}\n\nexport interface LabelEdit {\n ID: string;\n Name: string;\n Color: number;\n Deleted: boolean;\n Timestamp: Date;\n Action: LabelEditAction;\n FromFullSync: boolean;\n}\n\nexport interface LoggedOut {\n OnConnect: boolean;\n Reason: string;\n}\n\nexport interface ManualLoginReconnect {\n // Event indicating manual login reconnection required\n}\n\nexport interface MarkChatAsRead {\n ChatJID: JID;\n Timestamp: Date;\n Action: MarkChatAsReadAction;\n FromFullSync: boolean;\n}\n\nexport interface MediaRetry {\n MessageID: string;\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n Timestamp: Date;\n}\n\nexport interface MediaRetryError {\n MessageID: string;\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n Timestamp: Date;\n Error: string;\n}\n\nexport interface MessageEvent {\n Info: MessageInfo;\n Message: Message;\n IsEphemeral: boolean;\n IsViewOnce: boolean;\n IsDocumentWithCaption: boolean;\n IsEdit: boolean;\n RawMessage: WaBinaryNode;\n}\n\nexport interface Mute {\n ChatJID: JID;\n Timestamp: Date;\n Action: MuteAction;\n FromFullSync: boolean;\n}\n\nexport interface NewsletterJoin {\n ID: JID;\n NewsletterMeta: {\n name: string;\n description?: string;\n invite?: string;\n creationTime?: Date;\n };\n}\n\nexport interface NewsletterLeave {\n ID: JID;\n}\n\nexport interface NewsletterLiveUpdate {\n ID: JID;\n Time: Date;\n Messages: unknown[];\n}\n\nexport interface NewsletterMessageMeta {\n ID: JID;\n MessageServerID: number;\n MessageID: string;\n ReactionCounts: Record<string, number>;\n Views: number;\n}\n\nexport interface NewsletterMuteChange {\n ID: JID;\n Mute: string;\n}\n\nexport interface OfflineSyncCompleted {\n Count: number;\n}\n\nexport interface OfflineSyncPreview {\n Messages: unknown[];\n IsLatest: boolean;\n}\n\nexport interface PairError {\n ID: string;\n Error: string;\n}\n\nexport interface PairSuccess {\n ID: string;\n BusinessName: string;\n Platform: string;\n}\n\nexport interface PermanentDisconnect {\n // Event indicating permanent disconnection\n}\n\nexport interface Picture {\n JID: JID;\n Author: JID;\n Timestamp: Date;\n Remove: boolean;\n NewPicture?: {\n id: string;\n type: string;\n directPath: string;\n };\n OldPicture?: {\n id: string;\n type: string;\n directPath: string;\n };\n}\n\nexport interface Pin {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: PinAction;\n FromFullSync: boolean;\n}\n\nexport interface Presence {\n From: JID;\n Unavailable: boolean;\n LastSeen: Date;\n}\n\nexport interface PrivacySettings {\n GroupAddChanged: boolean;\n LastSeenChanged: boolean;\n StatusChanged: boolean;\n ProfileChanged: boolean;\n ReadReceiptsChanged: boolean;\n OnlineChanged: boolean;\n CallAddChanged: boolean;\n}\n\nexport interface PushName {\n JID: JID;\n Message: MessageInfo;\n OldPushName: string;\n NewPushName: string;\n}\n\nexport interface PushNameSetting {\n Timestamp: Date;\n Action: PushNameSettingAction;\n FromFullSync: boolean;\n}\n\nexport interface QR {\n Codes: string[];\n}\n\nexport interface QRScannedWithoutMultidevice {\n // Event indicating QR was scanned but multidevice not enabled\n}\n\nexport interface Receipt {\n MessageSource: MessageSource;\n MessageIDs: string[];\n Timestamp: Date;\n Type: ReceiptType;\n MessageSender: JID;\n}\n\nexport interface Star {\n ChatJID: JID;\n SenderJID: JID;\n IsFromMe: boolean;\n MessageID: string;\n Timestamp: Date;\n Action: StarAction;\n FromFullSync: boolean;\n}\n\nexport interface StreamError {\n Code: string;\n Raw: WaBinaryNode;\n}\n\nexport interface StreamReplaced {\n // Event indicating stream was replaced by another connection\n}\n\nexport interface TemporaryBan {\n Code: TempBanReason;\n Expire: number; // Duration in seconds\n}\n\nexport interface UnarchiveChatsSetting {\n Timestamp: Date;\n Action: UnarchiveChatsSettingAction;\n FromFullSync: boolean;\n}\n\nexport interface UndecryptableMessage {\n Info: MessageInfo;\n IsUnavailable: boolean;\n UnavailableType: UnavailableType;\n DecryptFailMode: DecryptFailMode;\n}\n\nexport interface UnknownCallEvent {\n Node: WaBinaryNode;\n}\n\nexport interface UserAbout {\n JID: JID;\n Status: string;\n Timestamp: Date;\n}\n\nexport interface UserStatusMute {\n JID: JID;\n Timestamp: Date;\n Action: UserStatusMuteAction;\n FromFullSync: boolean;\n}\n\n// Union type for all possible events\nexport type WhatsAppEvent =\n | AppState\n | AppStateSyncComplete\n | Archive\n | Blocklist\n | BlocklistAction\n | BlocklistChange\n | BusinessName\n | CATRefreshError\n | CallAccept\n | CallOffer\n | CallOfferNotice\n | CallPreAccept\n | CallReject\n | CallRelayLatency\n | CallTerminate\n | CallTransport\n | ChatPresence\n | ClearChat\n | ClientOutdated\n | ConnectFailure\n | Connected\n | EventContact\n | DeleteChat\n | DeleteForMe\n | Disconnected\n | FBMessage\n | EventGroupInfo\n | HistorySync\n | IdentityChange\n | JoinedGroup\n | KeepAliveRestored\n | KeepAliveTimeout\n | LabelAssociationChat\n | LabelAssociationMessage\n | LabelEdit\n | LoggedOut\n | ManualLoginReconnect\n | MarkChatAsRead\n | MediaRetry\n | MediaRetryError\n | MessageEvent\n | Mute\n | NewsletterJoin\n | NewsletterLeave\n | NewsletterLiveUpdate\n | NewsletterMessageMeta\n | NewsletterMuteChange\n | OfflineSyncCompleted\n | OfflineSyncPreview\n | PairError\n | PairSuccess\n | PermanentDisconnect\n | Picture\n | Pin\n | Presence\n | PrivacySettings\n | PushName\n | PushNameSetting\n | QR\n | QRScannedWithoutMultidevice\n | Receipt\n | Star\n | StreamError\n | StreamReplaced\n | TemporaryBan\n | UnarchiveChatsSetting\n | UndecryptableMessage\n | UnknownCallEvent\n | UserAbout\n | UserStatusMute;\n\n// Event handler type\nexport type EventHandler<T extends WhatsAppEvent = WhatsAppEvent> = (\n event: T\n) => void | Promise<void>;\n\n// Event emitter interface\nexport interface EventEmitter {\n on<T extends WhatsAppEvent>(\n eventType: string,\n handler: EventHandler<T>\n ): void;\n off<T extends WhatsAppEvent>(\n eventType: string,\n handler: EventHandler<T>\n ): void;\n emit<T extends WhatsAppEvent>(eventType: string, event: T): void;\n}\n"],"names":["DisappearingModeInitiator","DisappearingModeTrigger","MediaType","VideoAttribution","VideoSourceType","ExtendedTextMessageFontType","ExtendedTextMessagePreviewType","ExtendedTextMessageInviteLinkGroupType","InviteLinkGroupType","ButtonType","ButtonsMessageHeaderType","ListMessageListType","ButtonsResponseMessageType","ListResponseMessageListType","PaymentBackgroundType","ProtocolMessageType","BotPluginType","BotPluginSearchProvider","HistorySyncNotificationHistorySyncType","PeerDataOperationRequestType","PeerDataOperationRequestResponseMessagePeerDataOperationResult","EventType","MessageStatus","ReceiptType","DecryptFailMode","UnavailableType","ConnectFailureReason","TempBanReason"],"mappings":";;AAqFO,SAAS,WACd,SAC2D;AAE3D,SAAO,CAAC,CAAE,QAAgB;AAC5B;AAEO,SAAS,eACd,SAC+D;AAE/D,SAAO,CAAC,CAAE,QAAgB;AAC5B;AAEO,SAAS,aACd,SACoC;AACpC,SAAO,WAAW,OAAO,KAAK,eAAe,OAAO;AACtD;ACxDO,IAAK,8CAAAA,+BAAL;AACLA,6BAAAA,2BAAA,qBAAkB,CAAA,IAAlB;AACAA,6BAAAA,2BAAA,qBAAkB,CAAA,IAAlB;AACAA,6BAAAA,2BAA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|
8
|
+
description?: {
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
update_time: string;
|
|
12
|
+
};
|
|
13
|
+
invite: string;
|
|
14
|
+
name: {
|
|
15
|
+
id: string;
|
|
16
|
+
text: string;
|
|
17
|
+
update_time: string;
|
|
18
|
+
};
|
|
19
|
+
picture?: {
|
|
20
|
+
direct_path: string;
|
|
21
|
+
id: string;
|
|
22
|
+
type: string;
|
|
23
|
+
url: string;
|
|
24
|
+
};
|
|
25
|
+
preview?: {
|
|
26
|
+
direct_path: string;
|
|
27
|
+
id: string;
|
|
28
|
+
type: string;
|
|
29
|
+
url: string;
|
|
30
|
+
};
|
|
31
|
+
settings: {
|
|
32
|
+
reaction_codes: {
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
subscribers_count: string;
|
|
37
|
+
verification: string;
|
|
38
|
+
};
|
|
39
|
+
viewer_metadata: {
|
|
40
|
+
mute: string;
|
|
41
|
+
role: string;
|
|
13
42
|
};
|
|
14
43
|
}
|
|
15
44
|
export interface NewsletterListResponse {
|
|
16
|
-
|
|
45
|
+
Newsletter: Newsletter[];
|
|
17
46
|
}
|
package/dist/types/session.d.ts
CHANGED
|
@@ -34,14 +34,14 @@ export interface PairPhoneRequest {
|
|
|
34
34
|
Phone: string;
|
|
35
35
|
}
|
|
36
36
|
export interface PairPhoneResponse {
|
|
37
|
-
|
|
37
|
+
LinkingCode: string;
|
|
38
38
|
}
|
|
39
39
|
export interface HistoryResponse {
|
|
40
40
|
Details: string;
|
|
41
41
|
}
|
|
42
42
|
export interface ProxyRequest {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
proxy_url: string;
|
|
44
|
+
enable: boolean;
|
|
45
45
|
}
|
|
46
46
|
export interface ProxyResponse {
|
|
47
47
|
Details: string;
|
package/dist/types/user.d.ts
CHANGED
package/dist/types/webhook.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
export interface SetWebhookRequest {
|
|
2
|
-
|
|
2
|
+
webhook: string;
|
|
3
|
+
events: string[];
|
|
3
4
|
}
|
|
4
5
|
export interface SetWebhookResponse {
|
|
5
|
-
|
|
6
|
+
WebhookURL: string;
|
|
7
|
+
Events: string[];
|
|
6
8
|
}
|
|
7
9
|
export interface GetWebhookResponse {
|
|
8
10
|
subscribe: string[];
|
|
9
11
|
webhook: string;
|
|
10
12
|
}
|
|
11
13
|
export interface UpdateWebhookRequest {
|
|
12
|
-
|
|
14
|
+
webhook?: string;
|
|
15
|
+
events?: string[];
|
|
16
|
+
Active?: boolean;
|
|
13
17
|
}
|
|
14
18
|
export interface UpdateWebhookResponse {
|
|
15
|
-
|
|
19
|
+
WebhookURL: string;
|
|
20
|
+
Events: string[];
|
|
21
|
+
active: boolean;
|
|
16
22
|
}
|
|
17
23
|
export interface DeleteWebhookResponse {
|
|
18
24
|
Details: string;
|