@lizzythelizard/whatsapp-mcp 0.4.0 → 0.5.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 +157 -33
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +78 -0
- package/dist/cli.js.map +1 -0
- package/dist/dataDir.d.ts +4 -0
- package/dist/dataDir.d.ts.map +1 -0
- package/dist/dataDir.js +20 -0
- package/dist/dataDir.js.map +1 -0
- package/dist/extTypes.d.ts +41 -0
- package/dist/extTypes.d.ts.map +1 -0
- package/dist/extTypes.js +222 -0
- package/dist/extTypes.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +10 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +15 -0
- package/dist/logger.js.map +1 -0
- package/dist/{main.d.ts → mcp.d.ts} +1 -1
- package/dist/mcp.d.ts.map +1 -0
- package/dist/{main.js → mcp.js} +8 -24
- package/dist/mcp.js.map +1 -0
- package/dist/store.d.ts +17 -21
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +44 -32
- package/dist/store.js.map +1 -1
- package/dist/sync.d.ts +9 -4
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +51 -17
- package/dist/sync.js.map +1 -1
- package/dist/tools/authTools.d.ts.map +1 -1
- package/dist/tools/authTools.js +31 -23
- package/dist/tools/authTools.js.map +1 -1
- package/dist/tools/chatTools.d.ts.map +1 -1
- package/dist/tools/chatTools.js +15 -6
- package/dist/tools/chatTools.js.map +1 -1
- package/dist/tools/common.d.ts +3 -3
- package/dist/tools/common.d.ts.map +1 -1
- package/dist/tools/common.js +16 -8
- package/dist/tools/common.js.map +1 -1
- package/dist/tools/contactTools.d.ts.map +1 -1
- package/dist/tools/contactTools.js +8 -2
- package/dist/tools/contactTools.js.map +1 -1
- package/dist/tools/messageTools.d.ts.map +1 -1
- package/dist/tools/messageTools.js +18 -5
- package/dist/tools/messageTools.js.map +1 -1
- package/package.json +10 -16
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,62 +1,186 @@
|
|
|
1
1
|
# WhatsApp MCP Server
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server
|
|
3
|
+
An MCP (Model Context Protocol) server that bridges WhatsApp and AI assistants. It maps internal WhatsApp (Baileys) event types to clean, exported types (`Chat`, `Contact`, `Message`) and exposes functionality through **MCP-Tools**
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Tools
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The server exposes the following MCP tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
| ---- | ----------- |
|
|
11
|
+
| `get_status` | Get the current server status |
|
|
12
|
+
| `get_auth_qr` | Get a QR code to authenticate with WhatsApp |
|
|
13
|
+
| `get_all_chats` | Retrieve all WhatsApp chats with their metadata |
|
|
14
|
+
| `set_chat_archived` | Set a WhatsApp chat as archived or unarchived |
|
|
15
|
+
| `set_chat_read` | Set a WhatsApp chat as read or unread |
|
|
16
|
+
| `get_all_contacts` | Retrieve all WhatsApp contacts |
|
|
17
|
+
| `send_message` | Send a WhatsApp message to a given JID |
|
|
18
|
+
| `get_all_messages` | Retrieve all WhatsApp messages across all chats |
|
|
19
|
+
| `get_all_messages_for_chat` | Retrieve all WhatsApp messages for a specific chat |
|
|
9
20
|
|
|
10
|
-
##
|
|
21
|
+
## Quickstart
|
|
22
|
+
|
|
23
|
+
You can start the WhatsApp MCP server standalone via npm, use the pre-built Docker image, or import it into Claude Desktop using the MCPB plugin format.
|
|
24
|
+
|
|
25
|
+
### npm
|
|
11
26
|
|
|
12
27
|
```bash
|
|
13
|
-
|
|
28
|
+
npx @lizzythelizard/whatsapp-mcp
|
|
29
|
+
|
|
30
|
+
#Or install globally
|
|
31
|
+
npm install -g @lizzythelizard/whatsapp-mcp
|
|
32
|
+
whatsapp-mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Docker
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
docker run --rm -v ./data:/app/data lizzythelizard/whatsapp-mcp
|
|
14
39
|
```
|
|
15
40
|
|
|
16
|
-
|
|
41
|
+
### Claude MCPB Plugin
|
|
17
42
|
|
|
18
|
-
|
|
43
|
+
Download `whatsapp-mcp.mcpb` from the [latest GitHub release](https://github.com/lizzyTheLizard/whatsapp-mcp/releases/latest) and install it:
|
|
19
44
|
|
|
20
45
|
```bash
|
|
21
|
-
|
|
22
|
-
npm start
|
|
46
|
+
npx @anthropic-ai/mcpb add whatsapp-mcp.mcpb
|
|
23
47
|
```
|
|
24
48
|
|
|
25
|
-
|
|
49
|
+
## Library
|
|
50
|
+
|
|
51
|
+
You can use WhatsApp MCP directly in your own Node.js applications. The package exports `createStore`, `createHandler`, and the types `Chat`, `Contact`, `Message`.
|
|
52
|
+
|
|
53
|
+
Data persistence is handled via the `DataStore` interface. Load existing data on startup and provide a `writeData` callback that gets called when data changes:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { createStore, createHandler } from '@lizzythelizard/whatsapp-mcp'
|
|
57
|
+
|
|
58
|
+
// Load previously saved data (e.g. from files)
|
|
59
|
+
const initialData = {
|
|
60
|
+
chats: await fs.readFile('data/chats.json', 'utf-8'),
|
|
61
|
+
contacts: await fs.readFile('data/contacts.json', 'utf-8'),
|
|
62
|
+
messages: await fs.readFile('data/messages.json', 'utf-8'),
|
|
63
|
+
auth: await fs.readFile('data/auth.json', 'utf-8'),
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const store = createStore(initialData, {
|
|
67
|
+
writeData: async (data) => {
|
|
68
|
+
await fs.writeFile('data/chats.json', data.chats)
|
|
69
|
+
await fs.writeFile('data/contacts.json', data.contacts)
|
|
70
|
+
await fs.writeFile('data/messages.json', data.messages)
|
|
71
|
+
await fs.writeFile('data/auth.json', data.auth)
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const handler = createHandler(store)
|
|
76
|
+
await handler.start()
|
|
77
|
+
|
|
78
|
+
// Send a message
|
|
79
|
+
const msg = await handler.sendMessage('41791234567@s.whatsapp.net', 'Hello!')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
### Prerequisites
|
|
85
|
+
|
|
86
|
+
- Node.js >= 20
|
|
87
|
+
- npm
|
|
88
|
+
|
|
89
|
+
### Getting Started
|
|
26
90
|
|
|
27
91
|
```bash
|
|
92
|
+
git clone https://github.com/lizzyTheLizard/whatsapp-mcp.git
|
|
93
|
+
cd whatsapp-mcp
|
|
94
|
+
npm install
|
|
28
95
|
npm run dev
|
|
29
96
|
```
|
|
30
97
|
|
|
31
|
-
The server runs on **stdio** transport and communicates via the MCP protocol.
|
|
98
|
+
The server runs on **stdio** transport by default and communicates via the MCP protocol.
|
|
32
99
|
|
|
33
|
-
|
|
100
|
+
### Architecture
|
|
34
101
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
102
|
+
| File | Purpose |
|
|
103
|
+
| ---- | ------- |
|
|
104
|
+
| `src/mcp.ts` | Entry point for the MCP server. Creates store & handler, registers tools, connects transport (stdio or HTTP). |
|
|
105
|
+
| `src/cli.ts` | Standalone CLI for testing WhatsApp sync without an MCP client. |
|
|
106
|
+
| `src/store.ts` | In-memory data store that receives Baileys events and persists them. |
|
|
107
|
+
| `src/sync.ts` | WhatsApp sync layer using `@whiskeysockets/baileys`. Manages connection state, QR auth, and message sending. |
|
|
108
|
+
| `src/auth.ts` | Serializable authentication state for Baileys. |
|
|
109
|
+
| `src/tools/` | Tool registration files grouped by domain (`chatTools`, `messageTools`, `contactTools`, `authTools`). |
|
|
110
|
+
| `src/extTypes.ts` | Public type definitions (`Chat`, `Contact`, `Message`) and mapping functions from Baileys types. |
|
|
111
|
+
| `src/dataDir.ts` | File-based persistence helpers for reading/writing store data to disk. |
|
|
44
112
|
|
|
45
|
-
|
|
113
|
+
### Adding a New Tool
|
|
114
|
+
|
|
115
|
+
1. Create a file in `src/tools/` (or add to an existing one)
|
|
116
|
+
2. Define a Zod schema for the tool's input/output
|
|
117
|
+
3. Register the tool on the `McpServer` instance using `server.registerTool()`
|
|
118
|
+
4. Import and call the registration function from `src/mcp.ts`
|
|
119
|
+
|
|
120
|
+
### Scripts
|
|
121
|
+
|
|
122
|
+
| Command | Description |
|
|
123
|
+
| ------- | ----------- |
|
|
124
|
+
| `npm run build` | Compile TypeScript to `dist/` |
|
|
125
|
+
| `npm start` | Run compiled server |
|
|
126
|
+
| `npm run dev` | Run with auto-reload on file changes |
|
|
127
|
+
| `npm test` | Run tests |
|
|
128
|
+
| `npm run test:watch` | Run tests in watch mode |
|
|
129
|
+
| `npm run lint` | Lint source code |
|
|
130
|
+
| `npm run cli` | Run the standalone CLI tool |
|
|
131
|
+
| `npm run inspect` | Open the MCP Inspector |
|
|
132
|
+
| `npm run mcpb` | Build the `.mcpb` plugin package |
|
|
133
|
+
|
|
134
|
+
## Repository Structure
|
|
135
|
+
|
|
136
|
+
A quick overview of the important files and directories in this repository.
|
|
46
137
|
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
138
|
+
```
|
|
139
|
+
whatsapp-mcp/
|
|
140
|
+
├── .github/ # CI workflows and dependabot config
|
|
141
|
+
├── scripts/ # Build scripts (create-mcpb)
|
|
142
|
+
├── test/ # Test files
|
|
143
|
+
├── dist/ # Compiled output (generated)
|
|
144
|
+
├── data/ # Runtime data directory (development only)
|
|
145
|
+
├── package.json # Package manifest and scripts
|
|
146
|
+
├── tsconfig.json # TypeScript configuration
|
|
147
|
+
├── Dockerfile # Docker image definition
|
|
148
|
+
├── AGENTS.md # Guidance for AI coding agents
|
|
149
|
+
└── LICENSE # MIT license
|
|
50
150
|
```
|
|
51
151
|
|
|
52
|
-
##
|
|
152
|
+
## Releases
|
|
153
|
+
|
|
154
|
+
Every merge to `main` triggers an automatic release via the CI pipeline. The version number must be incremented in `package.json` **before** merging to `main`.
|
|
155
|
+
|
|
156
|
+
The CI workflow:
|
|
157
|
+
|
|
158
|
+
1. Runs checks (build, lint, test)
|
|
159
|
+
2. Publishes to npm (`@lizzythelizard/whatsapp-mcp`)
|
|
160
|
+
3. Builds and pushes Docker image to Docker Hub (`lizzythelizard/whatsapp-mcp`)
|
|
161
|
+
4. Creates a GitHub Release with auto-generated notes and attaches `whatsapp-mcp.mcpb`
|
|
162
|
+
|
|
163
|
+
Release notes are auto-generated and should be edited on GitHub after the release is created to provide a clear changelog.
|
|
164
|
+
|
|
165
|
+
## Credits
|
|
166
|
+
|
|
167
|
+
- Built on [`@whiskeysockets/baileys`](https://github.com/WhiskeySockets/Baileys) — the WhatsApp Web protocol implementation
|
|
168
|
+
- Uses the [Model Context Protocol](https://modelcontextprotocol.io) SDK by Anthropic
|
|
169
|
+
|
|
170
|
+
## Contribute
|
|
171
|
+
|
|
172
|
+
Contributions are welcome! Please open an issue or pull request on [GitHub](https://github.com/lizzyTheLizard/whatsapp-mcp).
|
|
173
|
+
|
|
174
|
+
Before submitting, make sure to run:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm run lint
|
|
178
|
+
npm run build
|
|
179
|
+
npm test
|
|
180
|
+
```
|
|
53
181
|
|
|
54
|
-
|
|
55
|
-
| ----------------- | ------------------------------------ |
|
|
56
|
-
| `send_message` | Send a WhatsApp message |
|
|
57
|
-
| `list_chats` | List recent WhatsApp chats |
|
|
58
|
-
| `read_messages` | Read messages from a WhatsApp chat |
|
|
182
|
+
Follow the existing code patterns and keep tool definitions in `src/tools/`.
|
|
59
183
|
|
|
60
184
|
## License
|
|
61
185
|
|
|
62
|
-
MIT
|
|
186
|
+
MIT — see [LICENSE](LICENSE).
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createStore } from './store.js';
|
|
3
|
+
import { createHandler } from './sync.js';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
import { readDataFromFile, writeDataToFile } from './dataDir.js';
|
|
7
|
+
async function waitForStartup(handler, timeoutMs = 15000) {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const start = Date.now();
|
|
10
|
+
const poll = () => {
|
|
11
|
+
const status = handler.getStatus();
|
|
12
|
+
if (status.type !== 'connecting')
|
|
13
|
+
resolve(status);
|
|
14
|
+
else if (Date.now() - start < timeoutMs)
|
|
15
|
+
setTimeout(poll, 100);
|
|
16
|
+
else
|
|
17
|
+
reject(new Error(`Timed out waiting for ready, got ${status.type}`));
|
|
18
|
+
};
|
|
19
|
+
poll();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function waitForAuthentication(handler, timeoutMs = 120000) {
|
|
23
|
+
const intialStatus = handler.getStatus();
|
|
24
|
+
if (intialStatus.type !== 'needAuth')
|
|
25
|
+
return intialStatus;
|
|
26
|
+
let qrCode = intialStatus.qr;
|
|
27
|
+
console.log(`Scan the following QR code with your WhatsApp mobile app to authenticate: https://public-api.qr-code-generator.com/v1/create/extended?image_format=PNG&image_width=300&qr_code_text=${encodeURIComponent(qrCode)}&foreground_color=%23000000&background_color=%23FFFFFF&frame_name=no-frame`);
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
const start = Date.now();
|
|
30
|
+
const poll = () => {
|
|
31
|
+
const status = handler.getStatus();
|
|
32
|
+
if (status.type === 'ready')
|
|
33
|
+
resolve(status);
|
|
34
|
+
else if (status.type === 'closed')
|
|
35
|
+
resolve(status);
|
|
36
|
+
else if (Date.now() - start > timeoutMs)
|
|
37
|
+
reject(new Error(`Timed out waiting for ready, got ${status.type}`));
|
|
38
|
+
else {
|
|
39
|
+
if (status.type === 'needAuth' && status.qr !== qrCode) {
|
|
40
|
+
qrCode = status.qr;
|
|
41
|
+
console.log(`Scan the following QR code with your WhatsApp mobile app to authenticate: https://public-api.qr-code-generator.com/v1/create/extended?image_format=PNG&image_width=300&qr_code_text=${encodeURIComponent(qrCode)}&foreground_color=%23000000&background_color=%23FFFFFF&frame_name=no-frame`);
|
|
42
|
+
}
|
|
43
|
+
setTimeout(poll, 100);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
poll();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async function cli() {
|
|
50
|
+
console.log('Starting WhatsApp sync CLI. This is a very simple CLI, only for testing purposes. For production, use the MCP server.');
|
|
51
|
+
const inputData = await readDataFromFile();
|
|
52
|
+
const store = createStore(inputData, { writeData: async (data) => { await writeDataToFile(data); } });
|
|
53
|
+
const sync = createHandler(store);
|
|
54
|
+
await sync.start();
|
|
55
|
+
let status = await waitForStartup(sync);
|
|
56
|
+
if (status.type === 'needAuth')
|
|
57
|
+
status = await waitForAuthentication(sync);
|
|
58
|
+
if (status.type !== 'ready') {
|
|
59
|
+
console.error(`WhatsApp sync failed to start, status: ${status.type}`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
// Convert everything to see if there is an error
|
|
63
|
+
const messages = store.getMessages();
|
|
64
|
+
const chats = store.getChats();
|
|
65
|
+
const contacts = store.getContacts();
|
|
66
|
+
console.log(`WhatsApp sync started with ${messages.length.toString()} messages, ${chats.length.toString()} chats, and ${contacts.length.toString()} contacts`);
|
|
67
|
+
// keep open until user presses Ctrl+C
|
|
68
|
+
console.log('Press Ctrl+C to exit');
|
|
69
|
+
await new Promise(() => { });
|
|
70
|
+
}
|
|
71
|
+
const isMain = resolve(fileURLToPath(import.meta.url)) === resolve(process.argv[1]);
|
|
72
|
+
if (isMain) {
|
|
73
|
+
cli().catch((error) => {
|
|
74
|
+
console.error('Server error:', error);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAA+B,MAAM,WAAW,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEhE,KAAK,UAAU,cAAc,CAAC,OAAwB,EAAE,SAAS,GAAG,KAAK;IACvE,OAAO,IAAI,OAAO,CAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACxB,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAA;YAClC,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY;gBAAE,OAAO,CAAC,MAAM,CAAC,CAAA;iBAC5C,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,SAAS;gBAAE,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;;gBACzD,MAAM,CAAC,IAAI,KAAK,CAAC,oCAAoC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;QAC3E,CAAC,CAAA;QACD,IAAI,EAAE,CAAA;IACR,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,U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AED,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AACnF,IAAI,MAAM,EAAE,CAAC;IACX,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataDir.d.ts","sourceRoot":"","sources":["../src/dataDir.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAItC,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAQvE;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpE"}
|
package/dist/dataDir.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { promises as fsp } from 'fs';
|
|
2
|
+
const dataDir = process.env.DATA_DIR ?? './data';
|
|
3
|
+
export async function readDataFromFile() {
|
|
4
|
+
const canAccess = await fsp.access(dataDir).then(() => true).catch(() => false);
|
|
5
|
+
if (!canAccess)
|
|
6
|
+
return undefined;
|
|
7
|
+
const chats = await fsp.readFile(`${dataDir}/chats.json`, 'utf-8');
|
|
8
|
+
const messages = await fsp.readFile(`${dataDir}/messages.json`, 'utf-8');
|
|
9
|
+
const contacts = await fsp.readFile(`${dataDir}/contacts.json`, 'utf-8');
|
|
10
|
+
const auth = await fsp.readFile(`${dataDir}/auth.json`, 'utf-8');
|
|
11
|
+
return { chats, messages, contacts, auth };
|
|
12
|
+
}
|
|
13
|
+
export async function writeDataToFile(data) {
|
|
14
|
+
await fsp.mkdir(dataDir, { recursive: true });
|
|
15
|
+
await fsp.writeFile(`${dataDir}/chats.json`, data.chats, 'utf-8');
|
|
16
|
+
await fsp.writeFile(`${dataDir}/messages.json`, data.messages, 'utf-8');
|
|
17
|
+
await fsp.writeFile(`${dataDir}/contacts.json`, data.contacts, 'utf-8');
|
|
18
|
+
await fsp.writeFile(`${dataDir}/auth.json`, data.auth, 'utf-8');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=dataDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataDir.js","sourceRoot":"","sources":["../src/dataDir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,IAAI,CAAA;AAGpC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,QAAQ,CAAA;AAEhD,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;IAC/E,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAA;IAChC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,aAAa,EAAE,OAAO,CAAC,CAAA;IAClE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,gBAAgB,EAAE,OAAO,CAAC,CAAA;IACxE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,gBAAgB,EAAE,OAAO,CAAC,CAAA;IACxE,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,YAAY,EAAE,OAAO,CAAC,CAAA;IAChE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;AAC5C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAe;IACnD,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7C,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,aAAa,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACjE,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvE,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvE,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Chat as WAChat, Contact as WAContact, WAMessage, WAMessageKey } from '@whiskeysockets/baileys';
|
|
2
|
+
import { ILogger } from './logger.js';
|
|
3
|
+
export interface WAContactWithId extends WAContact {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Contact {
|
|
7
|
+
jid: string;
|
|
8
|
+
name: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function toContactExt(contact: WAContactWithId | undefined, logger: ILogger): Contact | undefined;
|
|
12
|
+
export interface WAChatWithId extends WAChat {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Chat {
|
|
16
|
+
jid: string;
|
|
17
|
+
unreadCount: number;
|
|
18
|
+
readOnly: boolean;
|
|
19
|
+
name: string;
|
|
20
|
+
archived: boolean;
|
|
21
|
+
lastMessageTimestamp: number;
|
|
22
|
+
isGroup: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function toChatExt(chat: WAChatWithId | undefined, contacts: Map<string, WAContactWithId>, logger: ILogger): Chat | undefined;
|
|
25
|
+
export interface Message {
|
|
26
|
+
id: string;
|
|
27
|
+
from?: {
|
|
28
|
+
jid: string;
|
|
29
|
+
name: string;
|
|
30
|
+
phone?: string;
|
|
31
|
+
};
|
|
32
|
+
message: string;
|
|
33
|
+
messageTimestamp: number;
|
|
34
|
+
}
|
|
35
|
+
export interface WAMessageWithId extends WAMessage {
|
|
36
|
+
key: WAMessageKey & {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export declare function toMessageExt(message: WAMessageWithId | undefined, contacts: Map<string, WAContactWithId>, logger: ILogger): Message | undefined;
|
|
41
|
+
//# sourceMappingURL=extTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extTypes.d.ts","sourceRoot":"","sources":["../src/extTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,IAAI,MAAM,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC9G,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAAG,EAAE,EAAE,MAAM,CAAA;CAAE;AAEjE,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAmBvG;AAeD,MAAM,WAAW,YAAa,SAAQ,MAAM;IAAG,EAAE,EAAE,MAAM,CAAA;CAAE;AAE3D,MAAM,WAAW,IAAI;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CA2BnI;AA2BD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAAG,GAAG,EAAE,YAAY,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE;AAEzF,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAqB/I"}
|
package/dist/extTypes.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
export function toContactExt(contact, logger) {
|
|
2
|
+
if (!contact)
|
|
3
|
+
return undefined;
|
|
4
|
+
// If they have no name, they are not actually stored contacts but rather just people you have chatted with, so we don't want to return them
|
|
5
|
+
if (!contact.name)
|
|
6
|
+
return undefined;
|
|
7
|
+
// Do not return groups
|
|
8
|
+
if (contact.id.endsWith('@g.us'))
|
|
9
|
+
return undefined;
|
|
10
|
+
// Do not return those weirs contact, we do not want them
|
|
11
|
+
if (contact.name == 'Meta AI')
|
|
12
|
+
return undefined;
|
|
13
|
+
if (contact.id == '0@s.whatsapp.net')
|
|
14
|
+
return undefined;
|
|
15
|
+
// For all the others, this should not happen, but if it does, we want to know about it
|
|
16
|
+
if (!contact.phoneNumber) {
|
|
17
|
+
logger.warn(`Contact ${contact.id} has no phone number`);
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
jid: contact.id,
|
|
22
|
+
name: contact.name,
|
|
23
|
+
phone: whatsAppNameToPhomeNumber(contact.phoneNumber, logger),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function whatsAppNameToPhomeNumber(whatsappid, logger) {
|
|
27
|
+
// Format the number as +<country code> <area code> <local number>
|
|
28
|
+
const match = /^(41)(\d{2})(\d{3})(\d{2})(\d{2})@s\.whatsapp\.net$/.exec(whatsappid);
|
|
29
|
+
if (match) {
|
|
30
|
+
return `+${match[1]} ${match[2]} ${match[3]} ${match[4]} ${match[5]}`;
|
|
31
|
+
}
|
|
32
|
+
if (whatsappid.endsWith('@s.whatsapp.net')) {
|
|
33
|
+
return `+${whatsappid.slice(0, -15)}`;
|
|
34
|
+
}
|
|
35
|
+
logger.warn(`Unknown WhatsApp ID format: ${whatsappid}`);
|
|
36
|
+
return whatsappid;
|
|
37
|
+
}
|
|
38
|
+
export function toChatExt(chat, contacts, logger) {
|
|
39
|
+
if (!chat)
|
|
40
|
+
return undefined;
|
|
41
|
+
// Chats without messages are not relevant
|
|
42
|
+
if (!chat.messages)
|
|
43
|
+
return undefined;
|
|
44
|
+
if (chat.messages.length === 0)
|
|
45
|
+
return undefined;
|
|
46
|
+
// Do not return those weirs contact, we do not want them
|
|
47
|
+
if (chat.id.endsWith('@bot'))
|
|
48
|
+
return undefined;
|
|
49
|
+
if (chat.id == '0@s.whatsapp.net')
|
|
50
|
+
return undefined;
|
|
51
|
+
// WhatsApp AI
|
|
52
|
+
if (chat.id === '13135550002@s.whatsapp.net')
|
|
53
|
+
return undefined;
|
|
54
|
+
// Skip ones where archived is undefined. Not sure what those are, but they are not relevant
|
|
55
|
+
if (chat.archived === undefined)
|
|
56
|
+
return undefined;
|
|
57
|
+
const isGroup = chat.id.endsWith('@g.us');
|
|
58
|
+
const name = isGroup ? chat.name : getChatName(chat, contacts, logger);
|
|
59
|
+
const lastMessageTimestamp = getLastMessageTimestamp(chat, chat.messages[0], logger);
|
|
60
|
+
// Now sure that those actually are, but thy are not relevant
|
|
61
|
+
if (!name)
|
|
62
|
+
return undefined;
|
|
63
|
+
if (!lastMessageTimestamp)
|
|
64
|
+
return undefined;
|
|
65
|
+
return {
|
|
66
|
+
jid: chat.id,
|
|
67
|
+
unreadCount: chat.unreadCount ?? 0,
|
|
68
|
+
readOnly: chat.readOnly ?? false,
|
|
69
|
+
name: name,
|
|
70
|
+
archived: chat.archived ?? false,
|
|
71
|
+
isGroup: isGroup,
|
|
72
|
+
lastMessageTimestamp,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function getLastMessageTimestamp(chat, message, logger) {
|
|
76
|
+
// There are different ways to get the last message timestamp...
|
|
77
|
+
let lastMessageTimestamp = chat.lastMessageRecvTimestamp
|
|
78
|
+
?? chat.lastMsgTimestamp
|
|
79
|
+
?? message.message?.messageTimestamp;
|
|
80
|
+
// This should not happen, but if it does, we want to know about it
|
|
81
|
+
if (lastMessageTimestamp === undefined || lastMessageTimestamp === null) {
|
|
82
|
+
logger.warn(`chat ${chat.id}) has no last message timestamp`);
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
// This is not in the data model but apparently happes...
|
|
86
|
+
if (typeof lastMessageTimestamp === 'string')
|
|
87
|
+
lastMessageTimestamp = parseInt(lastMessageTimestamp);
|
|
88
|
+
if (typeof lastMessageTimestamp !== 'number')
|
|
89
|
+
lastMessageTimestamp = lastMessageTimestamp.toNumber();
|
|
90
|
+
return lastMessageTimestamp;
|
|
91
|
+
}
|
|
92
|
+
function getChatName(chat, contacts, logger) {
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
94
|
+
if (chat.id.endsWith('@g.us'))
|
|
95
|
+
return chat.name;
|
|
96
|
+
const contact = Array.from(contacts.values()).find(c => ((!!c.lid && c.lid === chat.id) || c.id === chat.id || (!!chat.accountLid && c.id === chat.accountLid) || (!!c.lid && !!chat.accountLid && c.lid === chat.accountLid)));
|
|
97
|
+
if (contact?.name)
|
|
98
|
+
return contact.name;
|
|
99
|
+
if (contact?.phoneNumber)
|
|
100
|
+
return whatsAppNameToPhomeNumber(contact.phoneNumber, logger);
|
|
101
|
+
return 'Unknown Contact';
|
|
102
|
+
}
|
|
103
|
+
export function toMessageExt(message, contacts, logger) {
|
|
104
|
+
if (!message)
|
|
105
|
+
return undefined;
|
|
106
|
+
// Only messages with content are relevant
|
|
107
|
+
if (!message.message) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
// Status updates are not relevant
|
|
111
|
+
if (message.key.remoteJid === 'status@broadcast') {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
// This should not happen, but if it does, we want to know about it
|
|
115
|
+
const messageTimestamp = getMessageTimestamp(message);
|
|
116
|
+
if (!messageTimestamp) {
|
|
117
|
+
logger.warn(`Message ${message.key.id} has no message timestamp`);
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const messageContent = getMessageContent(message.message, logger);
|
|
121
|
+
if (!messageContent)
|
|
122
|
+
return undefined;
|
|
123
|
+
const from = getFrom(message, contacts, logger);
|
|
124
|
+
return {
|
|
125
|
+
id: message.key.id,
|
|
126
|
+
from: from,
|
|
127
|
+
message: messageContent,
|
|
128
|
+
messageTimestamp: messageTimestamp,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function getMessageTimestamp(message) {
|
|
132
|
+
if (!message.messageTimestamp)
|
|
133
|
+
return undefined;
|
|
134
|
+
let messageTimestamp = message.messageTimestamp;
|
|
135
|
+
// This should not happen, but apparently it does
|
|
136
|
+
if (typeof messageTimestamp === 'string')
|
|
137
|
+
messageTimestamp = parseInt(messageTimestamp);
|
|
138
|
+
// This should not happen, but apparently it does
|
|
139
|
+
if (typeof messageTimestamp === 'object') {
|
|
140
|
+
if ('high' in messageTimestamp && 'low' in messageTimestamp) {
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-plus-operands
|
|
142
|
+
messageTimestamp = messageTimestamp.high * 0x100000000 + messageTimestamp.low;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (typeof messageTimestamp !== 'number')
|
|
146
|
+
messageTimestamp = messageTimestamp.toNumber();
|
|
147
|
+
return messageTimestamp;
|
|
148
|
+
}
|
|
149
|
+
function getFrom(message, contacts, logger) {
|
|
150
|
+
if (message.key.fromMe)
|
|
151
|
+
return undefined;
|
|
152
|
+
const from = message.participant ?? message.key.participant ?? message.key.remoteJid;
|
|
153
|
+
if (!from) {
|
|
154
|
+
logger.warn(`Message ${message.key.id} has no from or participant`);
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
if (from.endsWith('@g.us')) {
|
|
158
|
+
logger.warn(`Message ${message.key.id} is from a group, not a personal number, from: ${from}`);
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
const contact = Array.from(contacts.values()).find(c => ((!!c.lid && c.lid === from) || c.id === from));
|
|
162
|
+
if (!contact && from.endsWith('@lid')) {
|
|
163
|
+
// TODO: It might be possible to get the phone number from the lid, using lid mappings, but for now we will just return the lid as the id
|
|
164
|
+
return { jid: from, name: from };
|
|
165
|
+
}
|
|
166
|
+
if (!contact && from.endsWith('@s.whatsapp.net')) {
|
|
167
|
+
const phone = whatsAppNameToPhomeNumber(from, logger);
|
|
168
|
+
return { jid: from, name: phone, phone };
|
|
169
|
+
}
|
|
170
|
+
if (!contact) {
|
|
171
|
+
logger.warn(`Message ${message.key.id} is from an unknown contact, from: ${from}`);
|
|
172
|
+
return { jid: from, name: from };
|
|
173
|
+
}
|
|
174
|
+
const phone = contact.phoneNumber
|
|
175
|
+
? whatsAppNameToPhomeNumber(contact.phoneNumber, logger)
|
|
176
|
+
: (from.endsWith('@s.whatsapp.net') ? whatsAppNameToPhomeNumber(from, logger) : undefined);
|
|
177
|
+
const name = contact.name ?? contact.notify ?? contact.username ?? phone;
|
|
178
|
+
if (!name && from.endsWith('@lid')) {
|
|
179
|
+
// TODO: It might be possible to get the phone number from the lid, using lid mappings, but for now we will just return the lid as the id
|
|
180
|
+
return { jid: from, name: from };
|
|
181
|
+
}
|
|
182
|
+
else if (!name) {
|
|
183
|
+
logger.warn(`Message ${message.key.id} is from a contact with no name, from: ${from}`);
|
|
184
|
+
return { jid: from, name: from, phone };
|
|
185
|
+
}
|
|
186
|
+
return { jid: from, name, phone: phone };
|
|
187
|
+
}
|
|
188
|
+
function getMessageContent(message, logger) {
|
|
189
|
+
if (message.protocolMessage)
|
|
190
|
+
return undefined;
|
|
191
|
+
if (message.conversation)
|
|
192
|
+
return message.conversation;
|
|
193
|
+
if (message.associatedChildMessage)
|
|
194
|
+
return undefined;
|
|
195
|
+
if (message.reactionMessage)
|
|
196
|
+
return undefined;
|
|
197
|
+
if (message.extendedTextMessage)
|
|
198
|
+
return message.extendedTextMessage.text ?? '[Extended text message]';
|
|
199
|
+
if (message.imageMessage)
|
|
200
|
+
return '[Image: ' + (message.imageMessage.caption ?? 'no text') + ']';
|
|
201
|
+
if (message.videoMessage)
|
|
202
|
+
return '[Video: ' + (message.videoMessage.caption ?? 'no text') + ']';
|
|
203
|
+
if (message.documentMessage)
|
|
204
|
+
return '[Document: ' + (message.documentMessage.caption ?? 'no text') + ']';
|
|
205
|
+
if (message.locationMessage)
|
|
206
|
+
return '[Location: ' + (message.locationMessage.comment ?? 'no text') + ']';
|
|
207
|
+
if (message.liveLocationMessage)
|
|
208
|
+
return '[LiveLocation: ' + (message.liveLocationMessage.caption ?? 'no text') + ']';
|
|
209
|
+
if (message.stickerMessage)
|
|
210
|
+
return '[Sticker]';
|
|
211
|
+
if (message.albumMessage)
|
|
212
|
+
return '[Album]';
|
|
213
|
+
if (message.audioMessage)
|
|
214
|
+
return '[Audio]';
|
|
215
|
+
if (message.pollCreationMessageV3)
|
|
216
|
+
return '[Poll: ' + (message.pollCreationMessageV3.name ?? 'no text') + ']';
|
|
217
|
+
if (message.templateMessage)
|
|
218
|
+
return '[Template]';
|
|
219
|
+
logger.warn(`Unknown message type: ${Object.keys(message).join(', ')}`);
|
|
220
|
+
return '[Unknown message type]';
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=extTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extTypes.js","sourceRoot":"","sources":["../src/extTypes.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,YAAY,CAAC,OAAoC,EAAE,MAAe;IAChF,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAC9B,4IAA4I;IAC5I,IAAI,CAAC,OAAO,CAAC,IAAI;QAAE,OAAO,SAAS,CAAA;IACnC,uBAAuB;IACvB,IAAI,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAA;IAClD,yDAAyD;IACzD,IAAI,OAAO,CAAC,IAAI,IAAI,SAAS;QAAE,OAAO,SAAS,CAAA;IAC/C,IAAI,OAAO,CAAC,EAAE,IAAI,kBAAkB;QAAE,OAAO,SAAS,CAAA;IACtD,uFAAuF;IACvF,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAA;QACxD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,yBAAyB,CAAC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AAY;QAAE,OAAO,SAAS,CAAA;IAC1C,IAAI,OAAO,CAAC,qBAAqB;QAAE,OAAO,SAAS,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,IAAI,SAAS,CAAC,GAAG,GAAG,CAAA;IAC7G,IAAI,OAAO,CAAC,eAAe;QAAE,OAAO,YAAY,CAAA;IAChD,MAAM,CAAC,IAAI,CAAC,yBAAyB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACvE,OAAO,wBAAwB,CAAA;AACjC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createStore, DataStore, WhatsAppStore,
|
|
1
|
+
export { createStore, DataStore, WhatsAppStore, Emitter } from './store.js';
|
|
2
2
|
export { createHandler, WhatsAppHandler, SyncStatus } from './sync.js';
|
|
3
|
-
export { Chat, Contact,
|
|
3
|
+
export { Chat, Contact, Message } from './extTypes.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqC,MAAM,YAAY,CAAA;AAC3E,OAAO,EAAE,aAAa,EAA+B,MAAM,WAAW,CAAA"}
|