zaileys 4.7.2 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/client.d.ts +31 -1
- package/dist/client/types.d.ts +15 -0
- package/dist/cloud/errors.d.ts +14 -0
- package/dist/cloud/graph-client.d.ts +15 -0
- package/dist/cloud/index.d.ts +6 -0
- package/dist/cloud/media.d.ts +15 -0
- package/dist/cloud/module.d.ts +147 -0
- package/dist/cloud/translate/inbound.d.ts +119 -0
- package/dist/cloud/translate/interactive.d.ts +2 -0
- package/dist/cloud/translate/outbound.d.ts +21 -0
- package/dist/cloud/transport.d.ts +51 -0
- package/dist/cloud/types.d.ts +17 -0
- package/dist/cloud/webhook.d.ts +11 -0
- package/dist/index.cjs +20 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +20 -15
- package/dist/transport/index.d.ts +1 -0
- package/dist/transport/types.d.ts +18 -0
- package/package.json +3 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Transport, TransportEventBus } from './types.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AnyMessageContent, MiscMessageGenerationOptions, WAMessage } from 'baileys';
|
|
2
|
+
/** Minimal event-bus shape both baileys `ev` and the cloud synthetic emitter satisfy. */
|
|
3
|
+
export interface TransportEventBus {
|
|
4
|
+
on(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
5
|
+
off(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Messaging seam shared by both providers. The baileys socket satisfies this structurally
|
|
9
|
+
* (asserted in tests); CloudTransport implements it by translating content to Graph calls.
|
|
10
|
+
* Provider identity lives on the Client, not the transport, so the raw socket qualifies as-is.
|
|
11
|
+
*/
|
|
12
|
+
export interface Transport {
|
|
13
|
+
sendMessage(jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions): Promise<WAMessage | undefined>;
|
|
14
|
+
user?: {
|
|
15
|
+
id?: string | null;
|
|
16
|
+
} | null;
|
|
17
|
+
ev: TransportEventBus;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zaileys",
|
|
3
3
|
"description": "Zaileys - Simplified WhatsApp Node.js TypeScript/JavaScript API",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@changesets/cli": "^2.30.0",
|
|
59
59
|
"@commitlint/cli": "^20.5.0",
|
|
60
60
|
"@commitlint/config-conventional": "^20.5.0",
|
|
61
|
+
"@hono/node-server": "^2.0.8",
|
|
61
62
|
"@size-limit/file": "^12.1.0",
|
|
62
63
|
"@types/better-sqlite3": "^7.6.13",
|
|
63
64
|
"@types/express": "^5.0.6",
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"@vitest/coverage-v8": "4.1.7",
|
|
68
69
|
"better-sqlite3": "^11.10.0",
|
|
69
70
|
"express": "^5.2.1",
|
|
71
|
+
"hono": "^4.12.30",
|
|
70
72
|
"husky": "^9.1.7",
|
|
71
73
|
"pg": "8.21.0",
|
|
72
74
|
"pg-mem": "^3.0.14",
|