@x4r1s3/baileys 1.0.0 → 1.0.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 +24 -41
- package/assets/x4r1s3-banner.svg +2 -2
- package/lib/Call/astralena-v3.mjs +96 -0
- package/lib/Call/audio-feeder.mjs +22 -0
- package/lib/Call/index.mjs +28 -1
- package/lib/Call/signaling.mjs +19 -0
- package/lib/Call/voip-resources.mjs +259 -0
- package/lib/Socket/messages-recv.js +2 -0
- package/lib/Socket/messages-send.js +38 -1
- package/lib/Socket/socket.js +71 -58
- package/lib/Utils/companion-reg-client-utils.js +61 -1
- package/lib/Utils/validate-connection.js +2 -1
- package/lib/index.d.ts +760 -150
- package/lib/index.js +11 -0
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -10,6 +10,218 @@
|
|
|
10
10
|
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
11
|
* from this source without explicit written permission.
|
|
12
12
|
*/
|
|
13
|
+
export const CallState: {
|
|
14
|
+
readonly Idle: 0;
|
|
15
|
+
readonly Calling: 1;
|
|
16
|
+
readonly PreacceptReceived: 2;
|
|
17
|
+
readonly ReceivedCall: 3;
|
|
18
|
+
readonly AcceptSent: 4;
|
|
19
|
+
readonly AcceptReceived: 5;
|
|
20
|
+
readonly Active: 6;
|
|
21
|
+
readonly ActiveElsewhere: 7;
|
|
22
|
+
readonly Ending: 13;
|
|
23
|
+
};
|
|
24
|
+
export type CallState = (typeof CallState)[keyof typeof CallState];
|
|
25
|
+
|
|
26
|
+
export interface VoipAutoRecordingOptions {
|
|
27
|
+
/** Required destination directory; no recording occurs unless this is configured. */
|
|
28
|
+
directory: string;
|
|
29
|
+
/** Maximum queued audio bytes per WAV track (default 2 MiB). */
|
|
30
|
+
maxQueuedBytes?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface CallRecordingFiles {
|
|
33
|
+
inbound: string;
|
|
34
|
+
outbound: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CallRecordingResult {
|
|
37
|
+
callId: string;
|
|
38
|
+
startedAt: Date;
|
|
39
|
+
endedAt: Date;
|
|
40
|
+
sampleRate: number;
|
|
41
|
+
channels: number;
|
|
42
|
+
formats: {
|
|
43
|
+
inbound: { sampleRate: number; channels: number };
|
|
44
|
+
outbound: { sampleRate: number; channels: number };
|
|
45
|
+
};
|
|
46
|
+
files: CallRecordingFiles;
|
|
47
|
+
bytesWritten: { inbound: number; outbound: number };
|
|
48
|
+
complete: boolean;
|
|
49
|
+
errors: Array<{ direction: 'inbound' | 'outbound'; error: string }>;
|
|
50
|
+
}
|
|
51
|
+
export interface CallRecordingError {
|
|
52
|
+
callId: string;
|
|
53
|
+
direction: 'inbound' | 'outbound' | 'both';
|
|
54
|
+
error: Error;
|
|
55
|
+
}
|
|
56
|
+
export interface VoipResourceManifest {
|
|
57
|
+
wasmUrl?: string;
|
|
58
|
+
workerUrl?: string;
|
|
59
|
+
wasmBinary?: Uint8Array | ArrayBuffer | ArrayBufferView;
|
|
60
|
+
workerModulesCode?: string;
|
|
61
|
+
loaderCode?: string;
|
|
62
|
+
wasm?: { url?: string; bytes?: Uint8Array | ArrayBuffer | ArrayBufferView };
|
|
63
|
+
worker?: { url?: string; code?: string };
|
|
64
|
+
loader?: { code?: string };
|
|
65
|
+
}
|
|
66
|
+
export interface VoipResourceStatus {
|
|
67
|
+
resourcesPath: string;
|
|
68
|
+
wasm: boolean;
|
|
69
|
+
worker: boolean;
|
|
70
|
+
loader: boolean;
|
|
71
|
+
complete: boolean;
|
|
72
|
+
files: { wasm: string; worker: string; loader: string };
|
|
73
|
+
source?: 'cache' | 'provider' | 'session' | 'runtime-package' | 'remote-url' | 'browser';
|
|
74
|
+
}
|
|
75
|
+
export interface VoipSessionResourceCapability {
|
|
76
|
+
supported: boolean;
|
|
77
|
+
method?: 'fetchVoipResources' | 'voipResources';
|
|
78
|
+
reason?: string;
|
|
79
|
+
}
|
|
80
|
+
export type VoipResourceProvider = (context: { sock?: WASocket }) => VoipResourceManifest | Promise<VoipResourceManifest>;
|
|
81
|
+
export interface VoipResourceUrls {
|
|
82
|
+
wasmUrl: string;
|
|
83
|
+
workerUrl: string;
|
|
84
|
+
loaderUrl?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface EnsureVoipResourcesOptions {
|
|
87
|
+
resourcesPath?: string;
|
|
88
|
+
sock?: WASocket;
|
|
89
|
+
resourceProvider?: VoipResourceProvider;
|
|
90
|
+
runtimePackage?: string;
|
|
91
|
+
resourceUrls?: VoipResourceUrls;
|
|
92
|
+
debuggerUrl?: string;
|
|
93
|
+
wasmId?: string;
|
|
94
|
+
force?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export class VoipResourceError extends Error {
|
|
97
|
+
code: string;
|
|
98
|
+
capabilities?: VoipSessionResourceCapability;
|
|
99
|
+
}
|
|
100
|
+
export const VOIP_RESOURCE_FILES: Readonly<{ wasm: string; worker: string; loader: string }>;
|
|
101
|
+
export function inspectVoipResources(resourcesPath?: string): VoipResourceStatus;
|
|
102
|
+
export function inspectSessionVoipResources(sock?: WASocket): VoipSessionResourceCapability;
|
|
103
|
+
export function ensureVoipResources(options?: EnsureVoipResourcesOptions): Promise<VoipResourceStatus>;
|
|
104
|
+
export function fetchVoipResourcesFromBrowser(options?: { debuggerUrl?: string; wasmId?: string }): Promise<VoipResourceManifest>;
|
|
105
|
+
export function fetchVoipResourcesFromUrls(urls: VoipResourceUrls): Promise<VoipResourceManifest>;
|
|
106
|
+
export function loadVoipResourcesFromPackage(packageName: string): Promise<VoipResourceManifest>;
|
|
107
|
+
|
|
108
|
+
export interface IncomingCallInfo {
|
|
109
|
+
callId: string;
|
|
110
|
+
peerJid: string;
|
|
111
|
+
callerJid: string;
|
|
112
|
+
isVideo: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface VoipClientEvents {
|
|
115
|
+
incomingCall: [call: IncomingCallInfo];
|
|
116
|
+
incomingCallEnded: [info: { callId: string; reason: string }];
|
|
117
|
+
recordingStarted: [info: { callId: string; files: CallRecordingFiles }];
|
|
118
|
+
recordingComplete: [result: CallRecordingResult];
|
|
119
|
+
recordingError: [details: CallRecordingError];
|
|
120
|
+
videoError: [details: { callId: string; error: Error }];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface VoipSdkConfig {
|
|
124
|
+
/** Reuse a connected Baileys socket; this client will not close it on disconnect. */
|
|
125
|
+
sock?: WASocket;
|
|
126
|
+
/** Required only when creating a separate Baileys socket instead of supplying `sock`. */
|
|
127
|
+
authDir?: string;
|
|
128
|
+
/** Directory containing `assets/wasm/whatsapp.wasm` and `assets/wasm/worker-modules.js`. */
|
|
129
|
+
resourcesPath?: string;
|
|
130
|
+
wasmPath?: string;
|
|
131
|
+
wasmBinary?: Uint8Array;
|
|
132
|
+
workerModulesCode?: string;
|
|
133
|
+
loaderCode?: string;
|
|
134
|
+
/** Resolve missing resources before connecting; disabled by default. */
|
|
135
|
+
autoFetchResources?: boolean;
|
|
136
|
+
resourceProvider?: VoipResourceProvider;
|
|
137
|
+
runtimePackage?: string;
|
|
138
|
+
resourceUrls?: VoipResourceUrls;
|
|
139
|
+
debuggerUrl?: string;
|
|
140
|
+
wasmId?: string;
|
|
141
|
+
/** Automatically record both audio directions for calls; omitted/false keeps recording disabled. */
|
|
142
|
+
recording?: false | VoipAutoRecordingOptions;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type VoipAudioSource = string | NodeJS.ReadableStream;
|
|
146
|
+
export interface VoipCallOptions {
|
|
147
|
+
/** File path, `lavfi:<filter>`, or a Readable emitting little-endian Float32 PCM. */
|
|
148
|
+
audioSource?: VoipAudioSource;
|
|
149
|
+
/** Set true for outgoing video; requires videoSource. A supplied videoSource also enables video. */
|
|
150
|
+
isVideo?: boolean;
|
|
151
|
+
/** Async iterable of tightly packed NV12 frames for local video capture. */
|
|
152
|
+
videoSource?: AsyncIterable<VoipVideoFrameInput>;
|
|
153
|
+
/** Auto-hangup after this many milliseconds (default 120000). */
|
|
154
|
+
durationMs?: number;
|
|
155
|
+
/** Disable client-level automatic recording for this call. */
|
|
156
|
+
recording?: false;
|
|
157
|
+
}
|
|
158
|
+
export interface VoipVideoFrameInput {
|
|
159
|
+
/** NV12 bytes: Y plane followed by interleaved UV, exactly width * height * 1.5 bytes. */
|
|
160
|
+
data: Uint8Array | ArrayBuffer | ArrayBufferView;
|
|
161
|
+
width: number;
|
|
162
|
+
height: number;
|
|
163
|
+
/** Frame rate metadata, 1–60 (default 30). */
|
|
164
|
+
fps?: number;
|
|
165
|
+
/** WASM video format enum (default 0, NV12). */
|
|
166
|
+
format?: number;
|
|
167
|
+
orientation?: number;
|
|
168
|
+
/** Timestamp in microseconds; defaults to current time. */
|
|
169
|
+
timestamp?: number;
|
|
170
|
+
}
|
|
171
|
+
export interface VoipVideoFrame {
|
|
172
|
+
userJid: string;
|
|
173
|
+
frameBuffer: Uint8Array;
|
|
174
|
+
width: number;
|
|
175
|
+
height: number;
|
|
176
|
+
orientation: number;
|
|
177
|
+
format: number;
|
|
178
|
+
timestamp: number;
|
|
179
|
+
isKeyFrame: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface VoipCallEvents {
|
|
182
|
+
ringing: [];
|
|
183
|
+
connected: [];
|
|
184
|
+
audio: [pcm: Float32Array];
|
|
185
|
+
/** Decoded remote video frame bytes and metadata from the WASM callback. */
|
|
186
|
+
videoFrame: [frame: VoipVideoFrame];
|
|
187
|
+
videoError: [error: Error];
|
|
188
|
+
ended: [reason: string];
|
|
189
|
+
recordingComplete: [result: CallRecordingResult];
|
|
190
|
+
recordingError: [details: CallRecordingError];
|
|
191
|
+
}
|
|
192
|
+
export type VoipVideoUpgradeResult = 'accepted' | 'rejected' | 'rejected_by_timeout' | 'timeout' | 'cancelled' | 'failed';
|
|
193
|
+
export class ActiveCall {
|
|
194
|
+
readonly callId: string;
|
|
195
|
+
readonly state: CallState;
|
|
196
|
+
readonly direction: 'incoming' | 'outgoing';
|
|
197
|
+
readonly isVideo: boolean;
|
|
198
|
+
readonly peerJid: string;
|
|
199
|
+
readonly recordingDone: Promise<CallRecordingResult | undefined>;
|
|
200
|
+
end(): void;
|
|
201
|
+
mute(muted: boolean): void;
|
|
202
|
+
/** Queue interleaved Float32 PCM for playback on the active call. */
|
|
203
|
+
writeAudio(pcm: Float32Array | ArrayBuffer | ArrayBufferView): void;
|
|
204
|
+
/** Request local video on an active audio call; frames are sent only after acceptance. */
|
|
205
|
+
requestVideoUpgrade(videoSource: AsyncIterable<VoipVideoFrameInput>): Promise<VoipVideoUpgradeResult>;
|
|
206
|
+
waitForEnd(): Promise<string>;
|
|
207
|
+
waitForRecording(): Promise<CallRecordingResult | undefined>;
|
|
208
|
+
on<K extends keyof VoipCallEvents>(event: K, listener: (...args: VoipCallEvents[K]) => void): this;
|
|
209
|
+
once<K extends keyof VoipCallEvents>(event: K, listener: (...args: VoipCallEvents[K]) => void): this;
|
|
210
|
+
off<K extends keyof VoipCallEvents>(event: K, listener: (...args: VoipCallEvents[K]) => void): this;
|
|
211
|
+
}
|
|
212
|
+
/** Experimental 1:1 audio/video media client using WhatsApp Web's VoIP WASM stack. */
|
|
213
|
+
export class VoipClient {
|
|
214
|
+
constructor(config: VoipSdkConfig);
|
|
215
|
+
connect(): Promise<void>;
|
|
216
|
+
call(phoneNumber: string, options?: VoipCallOptions): Promise<ActiveCall>;
|
|
217
|
+
answerIncomingCall(callId: string, options?: VoipCallOptions): Promise<ActiveCall>;
|
|
218
|
+
rejectIncomingCall(callId: string): void;
|
|
219
|
+
disconnect(): Promise<void>;
|
|
220
|
+
on<K extends keyof VoipClientEvents>(event: K, listener: (...args: VoipClientEvents[K]) => void): this;
|
|
221
|
+
once<K extends keyof VoipClientEvents>(event: K, listener: (...args: VoipClientEvents[K]) => void): this;
|
|
222
|
+
off<K extends keyof VoipClientEvents>(event: K, listener: (...args: VoipClientEvents[K]) => void): this;
|
|
223
|
+
}
|
|
224
|
+
|
|
13
225
|
export interface WAMessageKey {
|
|
14
226
|
remoteJid?: string | null;
|
|
15
227
|
fromMe?: boolean | null;
|
|
@@ -17,6 +229,138 @@ export interface WAMessageKey {
|
|
|
17
229
|
participant?: string | null;
|
|
18
230
|
}
|
|
19
231
|
|
|
232
|
+
export type GroupThemeScope = 'everyone' | 'me';
|
|
233
|
+
|
|
234
|
+
export interface GroupWallpaperOptions {
|
|
235
|
+
/** 'everyone' publishes a group message; 'me' is rejected because no verified local-only operation exists. */
|
|
236
|
+
scope?: GroupThemeScope;
|
|
237
|
+
dimLevel?: number;
|
|
238
|
+
mediaUploadTimeoutMs?: number;
|
|
239
|
+
settingTimestampMs?: number;
|
|
240
|
+
messageId?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface GroupWallpaperResetOptions {
|
|
244
|
+
/** 'everyone' publishes a group message; 'me' is rejected because no verified local-only operation exists. */
|
|
245
|
+
scope?: GroupThemeScope;
|
|
246
|
+
isDoodleEnabled?: boolean;
|
|
247
|
+
settingTimestampMs?: number;
|
|
248
|
+
messageId?: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface DirectChatWallpaperOptions {
|
|
252
|
+
/** 'me' is rejected; WAProto has no per-chat You/Everyone scope field. */
|
|
253
|
+
scope?: GroupThemeScope;
|
|
254
|
+
dimLevel?: number;
|
|
255
|
+
mediaUploadTimeoutMs?: number;
|
|
256
|
+
settingTimestampMs?: number;
|
|
257
|
+
messageId?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface DirectChatWallpaperResetOptions {
|
|
261
|
+
/** 'me' is rejected; WAProto has no per-chat You/Everyone scope field. */
|
|
262
|
+
scope?: GroupThemeScope;
|
|
263
|
+
isDoodleEnabled?: boolean;
|
|
264
|
+
settingTimestampMs?: number;
|
|
265
|
+
messageId?: string;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface ChatThemeResult {
|
|
269
|
+
key: WAMessageKey;
|
|
270
|
+
message: Record<string, unknown>;
|
|
271
|
+
/** The stanza was written to the socket; this does not mean WhatsApp accepted or applied it. */
|
|
272
|
+
submissionStatus: 'written';
|
|
273
|
+
/** Always unconfirmed when this helper resolves; later negative ACKs are emitted as messages.update errors. */
|
|
274
|
+
serverOutcome: 'unconfirmed';
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export interface GroupWallpaperResult extends ChatThemeResult {}
|
|
278
|
+
|
|
279
|
+
export interface GroupColorSchemeOptions {
|
|
280
|
+
/** Must be explicitly set to 'everyone'; 'me' is unsupported and does not fall back. */
|
|
281
|
+
scope: GroupThemeScope;
|
|
282
|
+
/** Required acknowledgement that preserving the omitted wallpaper field is not verified. */
|
|
283
|
+
allowUnverifiedPartialUpdate: true;
|
|
284
|
+
settingTimestampMs?: number;
|
|
285
|
+
messageId?: string;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface DirectChatColorSchemeOptions {
|
|
289
|
+
/** Must be explicitly set to 'everyone'; 'me' is rejected and scope is not serialized. */
|
|
290
|
+
scope: GroupThemeScope;
|
|
291
|
+
/** Required acknowledgement that preserving the omitted wallpaper field is not verified. */
|
|
292
|
+
allowUnverifiedPartialUpdate: true;
|
|
293
|
+
settingTimestampMs?: number;
|
|
294
|
+
messageId?: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export function setGroupWallpaper(sock: WASocket, jid: string, image: Buffer | string | { url: string }, options?: GroupWallpaperOptions): Promise<GroupWallpaperResult>;
|
|
298
|
+
export function setGroupWallpaper(sock: WASocket, jid: string, image: null, options?: GroupWallpaperResetOptions): Promise<GroupWallpaperResult>;
|
|
299
|
+
/** Reset a group's wallpaper to the WhatsApp default for everyone in the group. */
|
|
300
|
+
export function resetGroupWallpaper(sock: WASocket, jid: string, options?: GroupWallpaperResetOptions): Promise<GroupWallpaperResult>;
|
|
301
|
+
/** Request a colorSchemeId-only group update. Requires explicit scope and opt-in to unverified partial-update semantics. */
|
|
302
|
+
export function setGroupColorScheme(sock: WASocket, jid: string, colorSchemeId: string, options: GroupColorSchemeOptions): Promise<GroupWallpaperResult>;
|
|
303
|
+
/** Upload and request a custom wallpaper for a one-to-one chat; protocol scope and server application remain unconfirmed. */
|
|
304
|
+
export function setDirectChatWallpaper(sock: WASocket, jid: string, image: Buffer | string | { url: string }, options?: DirectChatWallpaperOptions): Promise<ChatThemeResult>;
|
|
305
|
+
export function setDirectChatWallpaper(sock: WASocket, jid: string, image: null, options?: DirectChatWallpaperResetOptions): Promise<ChatThemeResult>;
|
|
306
|
+
/** Request the default wallpaper for a one-to-one chat; protocol scope and server application remain unconfirmed. */
|
|
307
|
+
export function resetDirectChatWallpaper(sock: WASocket, jid: string, options?: DirectChatWallpaperResetOptions): Promise<ChatThemeResult>;
|
|
308
|
+
/** Request a colorSchemeId-only direct-chat update; requires opt-in to unverified partial-update semantics. */
|
|
309
|
+
export function setDirectChatColorScheme(sock: WASocket, jid: string, colorSchemeId: string, options: DirectChatColorSchemeOptions): Promise<ChatThemeResult>;
|
|
310
|
+
|
|
311
|
+
export interface CFCMessageOptions {
|
|
312
|
+
participant: string;
|
|
313
|
+
timestamp: number;
|
|
314
|
+
fromMe?: boolean;
|
|
315
|
+
messageId?: string;
|
|
316
|
+
pushName?: string;
|
|
317
|
+
quoted?: string | CFCMessageEntry | Record<string, unknown>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface CFCMessageEntry {
|
|
321
|
+
key: WAMessageKey;
|
|
322
|
+
message: Record<string, unknown>;
|
|
323
|
+
messageTimestamp: number;
|
|
324
|
+
participant: string;
|
|
325
|
+
pushName?: string;
|
|
326
|
+
addText(text: string, options: CFCMessageOptions): CFCMessageEntry;
|
|
327
|
+
addImage(source: unknown, options: CFCMessageOptions & { caption?: string }): Promise<CFCMessageEntry>;
|
|
328
|
+
addRaw(options: CFCMessageOptions & { message: Record<string, unknown> }): CFCMessageEntry;
|
|
329
|
+
addReaction(emoji: string, options: CFCMessageOptions): CFCMessageEntry;
|
|
330
|
+
send(groupJid: string, targetJid: string): Promise<CFCResult>;
|
|
331
|
+
builder: CFCBuilder;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface CFCGroupHistoryMedia {
|
|
335
|
+
mimetype: string;
|
|
336
|
+
fileSha256: Uint8Array;
|
|
337
|
+
mediaKey: Uint8Array;
|
|
338
|
+
fileEncSha256: Uint8Array;
|
|
339
|
+
directPath: string;
|
|
340
|
+
mediaKeyTimestamp: number;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface CFCGroupHistoryMetadata {
|
|
344
|
+
historyReceivers: string[];
|
|
345
|
+
nonHistoryReceivers: string[];
|
|
346
|
+
messageCount: number;
|
|
347
|
+
oldestMessageTimestampInWindow: number;
|
|
348
|
+
oldestMessageTimestampInBundle: number;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface CFCResult {
|
|
352
|
+
id: string;
|
|
353
|
+
key?: WAMessageKey;
|
|
354
|
+
group: string;
|
|
355
|
+
target: string;
|
|
356
|
+
messages: number;
|
|
357
|
+
reactions: number;
|
|
358
|
+
media: CFCGroupHistoryMedia;
|
|
359
|
+
metadata: CFCGroupHistoryMetadata;
|
|
360
|
+
encodedBytes: number;
|
|
361
|
+
compressedBytes: number;
|
|
362
|
+
}
|
|
363
|
+
|
|
20
364
|
export type StatusFont = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
21
365
|
|
|
22
366
|
export interface StatusOptions {
|
|
@@ -60,53 +404,84 @@ export interface StatusContent {
|
|
|
60
404
|
[key: string]: unknown;
|
|
61
405
|
}
|
|
62
406
|
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export interface
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export interface
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export interface
|
|
407
|
+
export interface DraftMessageSyncInput {
|
|
408
|
+
chatJid: string;
|
|
409
|
+
altChatJid?: string;
|
|
410
|
+
action: number;
|
|
411
|
+
editTimestampMs: number;
|
|
412
|
+
draft?: Record<string, unknown>;
|
|
413
|
+
clearReason?: number;
|
|
414
|
+
}
|
|
415
|
+
export interface ConversationDraftInput {
|
|
416
|
+
content: Record<string, unknown>;
|
|
417
|
+
editTimestampMs: number | bigint | string;
|
|
418
|
+
editorDeviceId?: number;
|
|
419
|
+
}
|
|
420
|
+
export interface GroupMembershipFormQuestion {
|
|
421
|
+
text: string;
|
|
422
|
+
[key: string]: unknown;
|
|
423
|
+
}
|
|
424
|
+
export interface GroupMembershipFormInput {
|
|
425
|
+
questions: GroupMembershipFormQuestion[];
|
|
426
|
+
memberTagPrompt?: string;
|
|
427
|
+
schemaVersion?: number;
|
|
428
|
+
}
|
|
429
|
+
export interface GroupMembershipFormSubmissionInput {
|
|
430
|
+
questionAnswers?: Array<{ question: GroupMembershipFormQuestion; answer: string; [key: string]: unknown }>;
|
|
431
|
+
memberTagAnswer?: { prompt: string; memberTag: string; [key: string]: unknown };
|
|
432
|
+
schemaVersion?: number;
|
|
433
|
+
}
|
|
434
|
+
export interface StatusTemplateAttributionInput {
|
|
435
|
+
templateId: string;
|
|
436
|
+
templateName?: string;
|
|
437
|
+
thumbnailUrl?: string;
|
|
438
|
+
}
|
|
439
|
+
export interface MembershipFormPublicKeysInput {
|
|
440
|
+
mlKemPublicKey: Uint8Array;
|
|
441
|
+
x25519PublicKey: Uint8Array;
|
|
442
|
+
}
|
|
443
|
+
export interface EncryptedJoinRequestPayloadInput {
|
|
444
|
+
encryptedAnswers: Uint8Array;
|
|
445
|
+
encIv: Uint8Array;
|
|
446
|
+
signalIdentityPublicKey: Uint8Array;
|
|
447
|
+
kemCiphertext: Uint8Array;
|
|
448
|
+
}
|
|
449
|
+
/** Build protocolMessage.draftMessageSync only; no WhatsApp transport is implied. */
|
|
86
450
|
export function buildDraftMessageSync(input: DraftMessageSyncInput): Record<string, unknown>;
|
|
451
|
+
/** Build ConversationDraft only; no app-state persistence or WhatsApp transport is implied. */
|
|
87
452
|
export function buildConversationDraft(input: ConversationDraftInput): Record<string, unknown>;
|
|
453
|
+
/** Build a group membership form protobuf only; no publish transport is implied. */
|
|
88
454
|
export function buildGroupMembershipForm(input: GroupMembershipFormInput): Record<string, unknown>;
|
|
455
|
+
/** Build a group membership form submission protobuf only; no submission transport is implied. */
|
|
89
456
|
export function buildGroupMembershipFormSubmission(input: GroupMembershipFormSubmissionInput): Record<string, unknown>;
|
|
457
|
+
/** Build the membership public-key container; does not generate or exchange keys. */
|
|
90
458
|
export function buildMembershipFormPublicKeys(input: MembershipFormPublicKeysInput): Record<string, unknown>;
|
|
459
|
+
/** Build an already-encrypted membership payload; does not perform encryption. */
|
|
91
460
|
export function buildEncryptedJoinRequestPayload(input: EncryptedJoinRequestPayloadInput): Record<string, unknown>;
|
|
461
|
+
/** Build experimental MusicMessage lyrics metadata; client rendering is unverified. */
|
|
92
462
|
export function buildMusicLyrics(input: { lines: MusicMessageLyricLine[] }): Record<string, unknown>;
|
|
463
|
+
/** Build a MusicMessage with experimental styles/lyrics; client rendering is unverified. */
|
|
93
464
|
export function buildMusicMessage(input: MusicMessageContent): Record<string, unknown>;
|
|
465
|
+
/** Build schema-backed experimental status-template attribution metadata. */
|
|
94
466
|
export function buildStatusTemplateAttribution(input: StatusTemplateAttributionInput): Record<string, unknown>;
|
|
467
|
+
/** Return a shallow copy of status content with template attribution appended to contextInfo. */
|
|
95
468
|
export function withStatusTemplateAttribution(content: StatusContent, template: StatusTemplateAttributionInput): StatusContent;
|
|
469
|
+
|
|
96
470
|
export interface NewsletterStatusContent {
|
|
97
471
|
text?: string;
|
|
98
472
|
backgroundColor?: string | number;
|
|
473
|
+
/** Optional voice-note tile color; defaults to 0xff1e88e5 for PTT audio. */
|
|
99
474
|
backgroundArgb?: number;
|
|
100
475
|
font?: StatusFont;
|
|
101
476
|
image?: unknown;
|
|
102
477
|
video?: unknown;
|
|
103
478
|
audio?: unknown;
|
|
479
|
+
/** Set true with `audio` to post a voice-note status. Ordinary audio is unsupported. */
|
|
104
480
|
ptt?: boolean;
|
|
105
481
|
caption?: string;
|
|
106
482
|
mimetype?: string;
|
|
107
483
|
seconds?: number;
|
|
108
484
|
contextInfo?: Record<string, unknown>;
|
|
109
|
-
messageContextInfo?: Record<string, unknown>;
|
|
110
485
|
[key: string]: unknown;
|
|
111
486
|
}
|
|
112
487
|
|
|
@@ -119,15 +494,38 @@ export interface NewsletterStatusSendOptions {
|
|
|
119
494
|
resolveServerId?: boolean;
|
|
120
495
|
/** Maximum echo wait after ACK when resolveServerId is enabled. Defaults to 8 seconds. */
|
|
121
496
|
serverIdTimeoutMs?: number;
|
|
122
|
-
/** Maximum time for media upload, when content contains
|
|
497
|
+
/** Maximum time for media upload, when content contains image, video, or PTT audio. */
|
|
123
498
|
mediaUploadTimeoutMs?: number;
|
|
124
499
|
}
|
|
125
500
|
|
|
126
501
|
export interface NewsletterStatusEligibility {
|
|
502
|
+
/** True only when the server reports CHANNEL_STATUS_PRODUCER for this account and channel. */
|
|
127
503
|
canPost: boolean;
|
|
504
|
+
/** Server-reported admin capabilities for the authenticated account on this channel. */
|
|
128
505
|
capabilities: string[];
|
|
129
506
|
}
|
|
130
507
|
|
|
508
|
+
export interface NewsletterLiveUpdateMessage {
|
|
509
|
+
serverId: number;
|
|
510
|
+
forwardsCount?: number;
|
|
511
|
+
reactions?: Array<{ code: string; count: number }>;
|
|
512
|
+
/** Hex SHA-256 of the voted option's text. */
|
|
513
|
+
votes?: Array<{ optionHash: string; count: number }>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
export interface NewsletterLiveUpdate {
|
|
517
|
+
newsletter: string;
|
|
518
|
+
/** First event after subscribing is a snapshot; subsequent events contain changed messages only. */
|
|
519
|
+
messages: NewsletterLiveUpdateMessage[];
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** Advisory alert when a direct-chat delivery/read/played receipt references IDs absent from the recent sent-ID store. */
|
|
523
|
+
export interface FakeChatEvent {
|
|
524
|
+
jid: string;
|
|
525
|
+
ids: string[];
|
|
526
|
+
type: 'delivery' | 'read' | 'played';
|
|
527
|
+
}
|
|
528
|
+
|
|
131
529
|
export interface GroupStatusContent extends StatusContent {
|
|
132
530
|
groupStatus: true;
|
|
133
531
|
/** Select the legacy groupStatusMessage envelope for compatibility testing. */
|
|
@@ -298,25 +696,46 @@ export interface WhatsAppFlowResponse {
|
|
|
298
696
|
isFlow: boolean;
|
|
299
697
|
flowId?: string;
|
|
300
698
|
flowToken?: string;
|
|
699
|
+
flowTokenPayload?: Record<string, unknown>;
|
|
700
|
+
flowName?: string;
|
|
701
|
+
flowTitle?: string;
|
|
702
|
+
flowCreationSource?: string;
|
|
301
703
|
screen?: string;
|
|
302
704
|
action?: string;
|
|
303
705
|
actionPayload: Record<string, unknown>;
|
|
304
706
|
data: Record<string, unknown>;
|
|
707
|
+
flowResponse?: Record<string, unknown>;
|
|
708
|
+
screens: unknown[];
|
|
709
|
+
formData: Record<string, unknown>;
|
|
305
710
|
buttonId?: string;
|
|
306
711
|
displayText?: string;
|
|
307
712
|
raw: Record<string, unknown>;
|
|
308
713
|
}
|
|
309
714
|
|
|
310
715
|
export interface WhatsAppFeedbackResponse extends WhatsAppFlowResponse {
|
|
311
|
-
feedback: {
|
|
716
|
+
feedback: {
|
|
717
|
+
satisfactionLevel?: string;
|
|
718
|
+
questionAnswered?: string;
|
|
719
|
+
improvementSuggestion?: string;
|
|
720
|
+
};
|
|
312
721
|
}
|
|
313
|
-
|
|
722
|
+
|
|
723
|
+
/** Decode a native-flow response, including Meta's nested appointment-flow response envelope. */
|
|
314
724
|
export declare function parseWhatsAppFlowResponse(message: unknown): WhatsAppFlowResponse | null;
|
|
725
|
+
/** Decode a submitted WhatsApp support/CSAT feedback Flow. */
|
|
315
726
|
export declare function parseWhatsAppFeedbackResponse(message: unknown): WhatsAppFeedbackResponse | null;
|
|
316
|
-
|
|
317
|
-
export declare function
|
|
318
|
-
|
|
319
|
-
|
|
727
|
+
/** Build WhatsApp's native booking_confirmation button payload. */
|
|
728
|
+
export declare function buildBookingConfirmationButton(booking: {
|
|
729
|
+
location: string;
|
|
730
|
+
startDatetime: string;
|
|
731
|
+
endDatetime: string;
|
|
732
|
+
email?: string;
|
|
733
|
+
}): { name: 'booking_confirmation'; buttonParamsJson: string };
|
|
734
|
+
/** Build WhatsApp's native request_contact_info button payload. */
|
|
735
|
+
export declare function buildRequestContactInfoButton(content?: {
|
|
736
|
+
buttonParams?: Record<string, unknown>;
|
|
737
|
+
}): { name: 'request_contact_info'; buttonParamsJson?: string };
|
|
738
|
+
|
|
320
739
|
export interface RelayMessageOptions {
|
|
321
740
|
messageId?: string;
|
|
322
741
|
/** Recipient-only delivery: skip the sender's own devices in a one-to-one chat. */
|
|
@@ -358,6 +777,25 @@ export interface AnimatedWallpaperInput {
|
|
|
358
777
|
opacity?: number;
|
|
359
778
|
}
|
|
360
779
|
|
|
780
|
+
export interface ChatThemeInput {
|
|
781
|
+
settingTimestampMs?: number;
|
|
782
|
+
clearTheme?: boolean;
|
|
783
|
+
colorSchemeId?: string;
|
|
784
|
+
chatThemeId?: string;
|
|
785
|
+
dimLevel?: number;
|
|
786
|
+
defaultWallpaper?: boolean | { isDoodleEnabled?: boolean };
|
|
787
|
+
solidColor?: string | number | {
|
|
788
|
+
color?: string | number;
|
|
789
|
+
colorLight?: string | number;
|
|
790
|
+
colorDark?: string | number;
|
|
791
|
+
doodleColorLight?: string | number;
|
|
792
|
+
doodleColorDark?: string | number;
|
|
793
|
+
isDoodleEnabled?: boolean;
|
|
794
|
+
};
|
|
795
|
+
stockImage?: { id?: string; stockImageId?: string; dimLevel?: number; opacity?: number };
|
|
796
|
+
animatedWallpaper?: AnimatedWallpaperInput;
|
|
797
|
+
}
|
|
798
|
+
|
|
361
799
|
export interface A2UIMessageContent {
|
|
362
800
|
image?: unknown;
|
|
363
801
|
bloksWidget?: { type?: string; data?: unknown; fallback?: string };
|
|
@@ -536,9 +974,15 @@ export interface RichMapContent {
|
|
|
536
974
|
verificationMetadata?: Record<string, unknown>;
|
|
537
975
|
}
|
|
538
976
|
|
|
977
|
+
export interface BotPromptSuggestionInput {
|
|
978
|
+
prompt?: string;
|
|
979
|
+
promptId?: string;
|
|
980
|
+
text?: string;
|
|
981
|
+
id?: string;
|
|
982
|
+
}
|
|
539
983
|
export interface BotPromptSuggestionsContent {
|
|
540
984
|
text?: string;
|
|
541
|
-
suggestions: string
|
|
985
|
+
suggestions: Array<string | BotPromptSuggestionInput>;
|
|
542
986
|
selectedPromptIndex?: number;
|
|
543
987
|
selectedPromptId?: string;
|
|
544
988
|
verificationMetadata?: Record<string, unknown>;
|
|
@@ -611,16 +1055,16 @@ export interface MetaCompositedOptions {
|
|
|
611
1055
|
export declare function editMetaMessage(sock: WASocket, jid: string, key: WAMessageKey, content: Record<string, unknown>, sendOptions?: Record<string, unknown>, streamContext?: Record<string, unknown>): Promise<unknown>;
|
|
612
1056
|
export declare function sendMetaComposited(sock: WASocket, jid: string, content: Record<string, unknown>, options?: MetaCompositedOptions): Promise<unknown>;
|
|
613
1057
|
|
|
614
|
-
export type
|
|
615
|
-
export interface
|
|
1058
|
+
export type PlogmeSimpleTable = unknown[][];
|
|
1059
|
+
export interface PlogmeRichTable {
|
|
616
1060
|
title?: string;
|
|
617
1061
|
headers: unknown[];
|
|
618
1062
|
rows: unknown[][];
|
|
619
1063
|
headerText?: string;
|
|
620
1064
|
footer?: string;
|
|
621
1065
|
}
|
|
622
|
-
export type
|
|
623
|
-
export interface
|
|
1066
|
+
export type PlogmeTableInput = PlogmeSimpleTable | PlogmeRichTable;
|
|
1067
|
+
export interface PlogmeCalendarWidgetAction {
|
|
624
1068
|
label: string;
|
|
625
1069
|
state?: string;
|
|
626
1070
|
kind?: string;
|
|
@@ -629,35 +1073,26 @@ export interface X4R1S3CalendarWidgetAction {
|
|
|
629
1073
|
tool_call_id?: string;
|
|
630
1074
|
toast?: string | { label?: string };
|
|
631
1075
|
}
|
|
632
|
-
export interface
|
|
1076
|
+
export interface PlogmeCalendarWidget {
|
|
633
1077
|
title?: string;
|
|
634
1078
|
/** Pass-through GenAI calendar event-list section objects; the exact event schema is not yet documented. */
|
|
635
1079
|
sections?: Array<Record<string, unknown>>;
|
|
636
|
-
actions?:
|
|
1080
|
+
actions?: PlogmeCalendarWidgetAction[];
|
|
637
1081
|
}
|
|
638
|
-
export interface
|
|
1082
|
+
export interface PlogmeEmbeddedScreenTab {
|
|
639
1083
|
id?: string;
|
|
640
1084
|
tab_header?: string;
|
|
641
1085
|
title?: string;
|
|
642
1086
|
sections: Array<Record<string, unknown>>;
|
|
1087
|
+
/** Native image/video items appended to this tab using the standard media primitive builders. */
|
|
643
1088
|
media?: RichMediaItem | string | Array<RichMediaItem | string>;
|
|
644
1089
|
step_entries?: unknown[];
|
|
645
1090
|
}
|
|
646
|
-
export interface
|
|
1091
|
+
export interface PlogmeEmbeddedScreen extends Record<string, unknown> {
|
|
647
1092
|
title?: string;
|
|
648
1093
|
/** Pass a complete embedded-screen content array, or use tabs for a FOAIDNixelButtonSheets wrapper. */
|
|
649
1094
|
content?: Array<Record<string, unknown>>;
|
|
650
|
-
tabs?:
|
|
651
|
-
}
|
|
652
|
-
export type X4R1S3ReminderAction = 'NOTIFY' | 'CREATE' | 'DELETE' | 'UPDATE' | 1 | 2 | 3 | 4;
|
|
653
|
-
export type X4R1S3ReminderFrequency = 'ONCE' | 'DAILY' | 'WEEKLY' | 'BIWEEKLY' | 'MONTHLY' | 1 | 2 | 3 | 4 | 5;
|
|
654
|
-
export interface X4R1S3ReminderMetadata {
|
|
655
|
-
requestMessageKey?: Record<string, unknown>;
|
|
656
|
-
action?: X4R1S3ReminderAction;
|
|
657
|
-
name?: string;
|
|
658
|
-
/** Raw non-negative protobuf uint64; timestamp units are not inferred by this library. */
|
|
659
|
-
nextTriggerTimestamp?: number | string;
|
|
660
|
-
frequency?: X4R1S3ReminderFrequency;
|
|
1095
|
+
tabs?: PlogmeEmbeddedScreenTab[];
|
|
661
1096
|
}
|
|
662
1097
|
export interface RichMediaItem extends Record<string, unknown> {
|
|
663
1098
|
type?: 'image' | 'photo' | 'video' | string;
|
|
@@ -693,62 +1128,123 @@ export interface RichMediaMessageContent extends Record<string, unknown> {
|
|
|
693
1128
|
trustedSources?: string[];
|
|
694
1129
|
verificationMetadata?: Record<string, unknown>;
|
|
695
1130
|
}
|
|
696
|
-
export
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
1131
|
+
export type PlogmeReminderAction = 'NOTIFY' | 'CREATE' | 'DELETE' | 'UPDATE' | 1 | 2 | 3 | 4;
|
|
1132
|
+
export type PlogmeReminderFrequency = 'ONCE' | 'DAILY' | 'WEEKLY' | 'BIWEEKLY' | 'MONTHLY' | 1 | 2 | 3 | 4 | 5;
|
|
1133
|
+
export interface PlogmeReminderMetadata {
|
|
1134
|
+
requestMessageKey?: Record<string, unknown>;
|
|
1135
|
+
action?: PlogmeReminderAction;
|
|
1136
|
+
name?: string;
|
|
1137
|
+
/** Raw non-negative protobuf uint64; timestamp units are not inferred by this library. */
|
|
1138
|
+
nextTriggerTimestamp?: number | string;
|
|
1139
|
+
frequency?: PlogmeReminderFrequency;
|
|
700
1140
|
}
|
|
1141
|
+
export type RichAIImageURL = string | {
|
|
1142
|
+
imagePreviewUrl?: string;
|
|
1143
|
+
imageHighResUrl?: string;
|
|
1144
|
+
sourceUrl?: string;
|
|
1145
|
+
url?: string;
|
|
1146
|
+
[key: string]: unknown;
|
|
1147
|
+
};
|
|
1148
|
+
export type RichAIResponseSection =
|
|
1149
|
+
| { type: 'table'; title?: string; headers?: unknown[]; rows?: unknown[][]; headerText?: string; footer?: string; value?: unknown; options?: Record<string, unknown> }
|
|
1150
|
+
| { type: 'list'; title?: string; items?: unknown[]; headerText?: string; footer?: string; value?: unknown; options?: Record<string, unknown> }
|
|
1151
|
+
| { type: 'codeBlock'; code?: string; language?: string; title?: string; footer?: string; value?: unknown; options?: Record<string, unknown> }
|
|
1152
|
+
| { type: 'latex'; text?: string; expressions?: Array<Record<string, unknown>>; headerText?: string; footer?: string; value?: string | Record<string, unknown>; options?: Record<string, unknown> }
|
|
1153
|
+
| { type: 'plain' | 'text'; text?: string; messageText?: string; inlineEntities?: Array<Record<string, unknown>>; value?: string; options?: Record<string, unknown> }
|
|
1154
|
+
| { type: 'gridImage'; imageUrls?: RichAIImageURL[]; images?: RichAIImageURL[]; gridImageUrl?: RichAIImageURL; value?: RichAIImageURL[] | Record<string, unknown>; options?: Record<string, unknown> }
|
|
1155
|
+
| { type: 'inlineImage'; imageUrl?: RichAIImageURL; url?: string; image?: RichAIImageURL; imageText?: string; text?: string; alignment?: number | string; tapLinkUrl?: string; value?: RichAIImageURL | Record<string, unknown>; options?: Record<string, unknown> }
|
|
1156
|
+
| { type: 'dynamic'; url?: string; imageUrl?: string; mediaUrl?: string; mediaType?: 'IMAGE' | 'GIF'; dynamicType?: 'IMAGE' | 'GIF'; kind?: 'IMAGE' | 'GIF'; version?: number; loopCount?: number; value?: string | Record<string, unknown>; options?: Record<string, unknown> }
|
|
1157
|
+
| { type: 'map'; centerLatitude?: number; centerLongitude?: number; latitudeDelta?: number; longitudeDelta?: number; annotations?: Array<Record<string, unknown>>; showInfoList?: boolean; text?: string; value?: Record<string, unknown>; options?: Record<string, unknown> }
|
|
1158
|
+
| { type: 'contentItems'; items?: Array<Record<string, unknown>>; itemsMetadata?: Array<Record<string, unknown>>; contentType?: number | string; value?: Array<Record<string, unknown>> | Record<string, unknown>; options?: Record<string, unknown> };
|
|
701
1159
|
export interface RichAIResponseContent extends Record<string, unknown> {
|
|
1160
|
+
/** Ordered mixed rich blocks. Use this array when the order matters. */
|
|
702
1161
|
sections?: RichAIResponseSection[];
|
|
703
|
-
table
|
|
704
|
-
|
|
705
|
-
codeBlock?: { code?: string; language?: string; [key: string]: unknown };
|
|
706
|
-
latex?: string | Record<string, unknown>;
|
|
707
|
-
plain?: string | Record<string, unknown>;
|
|
708
|
-
text?: string | Record<string, unknown>;
|
|
709
|
-
gridImage?: unknown;
|
|
710
|
-
inlineImage?: unknown;
|
|
711
|
-
dynamic?: unknown;
|
|
712
|
-
map?: unknown;
|
|
713
|
-
contentItems?: unknown;
|
|
714
|
-
}
|
|
715
|
-
export interface X4R1S3MessageContent extends Record<string, unknown> {
|
|
716
|
-
/** RichAI sections are composed in order and can be combined with other AIRich fields. */
|
|
717
|
-
sections?: Array<RichAIResponseSection | Record<string, unknown>>;
|
|
718
|
-
/** Already-composed RichAI submessages to append to the unified response. */
|
|
719
|
-
richResponse?: Array<Record<string, unknown>>;
|
|
1162
|
+
/** Legacy shorthand forms; multiple supplied keys are composed in table/list/codeBlock/latex/plain/text/gridImage/inlineImage/dynamic/map/contentItems order. */
|
|
1163
|
+
table?: { title?: string; headers?: unknown[]; rows?: unknown[][]; headerText?: string; footer?: string };
|
|
720
1164
|
list?: { title?: string; items?: unknown[]; headerText?: string; footer?: string };
|
|
721
1165
|
codeBlock?: { code?: string; language?: string; title?: string; footer?: string };
|
|
722
|
-
latex?:
|
|
723
|
-
plain?:
|
|
724
|
-
text?:
|
|
725
|
-
gridImage?:
|
|
726
|
-
inlineImage?:
|
|
727
|
-
dynamic?:
|
|
728
|
-
map?:
|
|
729
|
-
contentItems?:
|
|
1166
|
+
latex?: string | { text?: string; expressions?: Array<Record<string, unknown>>; headerText?: string; footer?: string; [key: string]: unknown };
|
|
1167
|
+
plain?: string | { text?: string; messageText?: string; inlineEntities?: Array<Record<string, unknown>> };
|
|
1168
|
+
text?: string | { text?: string; messageText?: string; inlineEntities?: Array<Record<string, unknown>> };
|
|
1169
|
+
gridImage?: { imageUrls?: RichAIImageURL[]; images?: RichAIImageURL[]; gridImageUrl?: RichAIImageURL } | RichAIImageURL[];
|
|
1170
|
+
inlineImage?: RichAIImageURL | { imageUrl?: RichAIImageURL; url?: string; image?: RichAIImageURL; imageText?: string; text?: string; alignment?: number | string; tapLinkUrl?: string };
|
|
1171
|
+
dynamic?: { url?: string; imageUrl?: string; mediaUrl?: string; mediaType?: 'IMAGE' | 'GIF'; dynamicType?: 'IMAGE' | 'GIF'; kind?: 'IMAGE' | 'GIF'; version?: number; loopCount?: number } | string;
|
|
1172
|
+
map?: { centerLatitude: number; centerLongitude: number; latitudeDelta?: number; longitudeDelta?: number; annotations?: Array<Record<string, unknown>>; showInfoList?: boolean; text?: string };
|
|
1173
|
+
contentItems?: { items?: Array<Record<string, unknown>>; itemsMetadata?: Array<Record<string, unknown>>; contentType?: number | string } | Array<Record<string, unknown>>;
|
|
1174
|
+
}
|
|
1175
|
+
export interface PlogmeMessageContent extends Record<string, unknown> {
|
|
730
1176
|
/** Exclusive A2UI mode routed to sendA2UIMessage; do not combine with AIRich sections. */
|
|
731
1177
|
a2ui?: A2UIMessageContent;
|
|
732
|
-
table?:
|
|
733
|
-
richTable?:
|
|
734
|
-
tables?:
|
|
1178
|
+
table?: PlogmeTableInput;
|
|
1179
|
+
richTable?: PlogmeRichTable;
|
|
1180
|
+
tables?: PlogmeTableInput[];
|
|
735
1181
|
/** Experimental calendar-event-list widget, composable with other AIRich sections. */
|
|
736
|
-
calendarWidget?:
|
|
1182
|
+
calendarWidget?: PlogmeCalendarWidget;
|
|
737
1183
|
/** Add one or more embedded screens alongside ordinary AIRich sections. */
|
|
738
|
-
embeddedScreen?:
|
|
739
|
-
embeddedScreens?:
|
|
1184
|
+
embeddedScreen?: PlogmeEmbeddedScreen;
|
|
1185
|
+
embeddedScreens?: PlogmeEmbeddedScreen[];
|
|
740
1186
|
/** Experimental BotReminderMetadata attached to the AIRich bot envelope. */
|
|
741
|
-
reminderMetadata?:
|
|
742
|
-
/** Compose
|
|
1187
|
+
reminderMetadata?: PlogmeReminderMetadata;
|
|
1188
|
+
/** Compose one or more colored GenAI label primitives into the same unified AIRich response as other sections. */
|
|
743
1189
|
richLabel?: {
|
|
744
1190
|
text?: string;
|
|
745
1191
|
variant?: string;
|
|
746
1192
|
backgroundColor?: string;
|
|
747
1193
|
textColor?: string;
|
|
748
1194
|
responseId?: string;
|
|
749
|
-
}
|
|
1195
|
+
} | Array<{
|
|
1196
|
+
text?: string;
|
|
1197
|
+
variant?: string;
|
|
1198
|
+
backgroundColor?: string;
|
|
1199
|
+
textColor?: string;
|
|
1200
|
+
responseId?: string;
|
|
1201
|
+
}>;
|
|
1202
|
+
/** Alias for supplying multiple colored labels without overloading richLabel. */
|
|
1203
|
+
richLabels?: Array<{
|
|
1204
|
+
text?: string;
|
|
1205
|
+
variant?: string;
|
|
1206
|
+
backgroundColor?: string;
|
|
1207
|
+
textColor?: string;
|
|
1208
|
+
responseId?: string;
|
|
1209
|
+
}>;
|
|
1210
|
+
/** Compose one or more native bot prompt suggestion sets in the unified response. */
|
|
1211
|
+
suggestedPrompt?: BotPromptSuggestionsContent | BotPromptSuggestionsContent[];
|
|
1212
|
+
/** Legacy alias; object form is rendered as real prompt metadata, while true is ignored rather than shown as a sentinel. */
|
|
1213
|
+
suggested?: boolean | BotPromptSuggestionsContent | BotPromptSuggestionsContent[];
|
|
1214
|
+
}
|
|
1215
|
+
export interface SendPlogmeContent extends PlogmeMessageContent {
|
|
1216
|
+
/** RichAI blocks use sendRichAIResponse's submessage composer and preserve this order. */
|
|
1217
|
+
sections?: Array<RichAIResponseSection | Record<string, unknown>>;
|
|
1218
|
+
list?: { title?: string; items?: unknown[]; headerText?: string; footer?: string };
|
|
1219
|
+
codeBlock?: { code?: string; language?: string; title?: string; footer?: string };
|
|
1220
|
+
latex?: RichAIResponseContent['latex'];
|
|
1221
|
+
plain?: RichAIResponseContent['plain'];
|
|
1222
|
+
text?: RichAIResponseContent['text'];
|
|
1223
|
+
gridImage?: RichAIResponseContent['gridImage'];
|
|
1224
|
+
inlineImage?: RichAIResponseContent['inlineImage'];
|
|
1225
|
+
dynamic?: RichAIResponseContent['dynamic'];
|
|
1226
|
+
map?: RichAIResponseContent['map'];
|
|
1227
|
+
contentItems?: RichAIResponseContent['contentItems'];
|
|
1228
|
+
richResponse?: Array<Record<string, unknown>>;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/** Fluent native-flow card builder. Reminder actions use relayMessage and a view-once envelope; client support may vary. */
|
|
1232
|
+
export declare class Button {
|
|
1233
|
+
constructor(socket: Pick<WASocket, 'sendMessage'> & Partial<Pick<WASocket, 'relayMessage'>>);
|
|
1234
|
+
setImage(source: unknown, options?: Record<string, unknown>): this;
|
|
1235
|
+
setVideo(source: unknown, options?: Record<string, unknown>): this;
|
|
1236
|
+
setTitle(title: string): this;
|
|
1237
|
+
setSubtitle(subtitle: string): this;
|
|
1238
|
+
setBody(body: string): this;
|
|
1239
|
+
setFooter(footer: string): this;
|
|
1240
|
+
addUrl(displayText: string, url: string, useWebview?: boolean): this;
|
|
1241
|
+
addReply(displayText: string, id: string): this;
|
|
1242
|
+
addReminder(displayText: string, id: string, options?: Record<string, unknown>): this;
|
|
1243
|
+
addCancelReminder(displayText: string, id: string, options?: Record<string, unknown>): this;
|
|
1244
|
+
toCard(): Promise<Record<string, unknown>>;
|
|
1245
|
+
send(jid: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
750
1246
|
}
|
|
751
|
-
export interface UnifiedThemedMessageContent extends
|
|
1247
|
+
export interface UnifiedThemedMessageContent extends PlogmeMessageContent {
|
|
752
1248
|
/** Title displayed at the top of the themed unified-response card. */
|
|
753
1249
|
title?: string;
|
|
754
1250
|
/** Optional secondary line displayed below the title. */
|
|
@@ -763,29 +1259,6 @@ export interface UnifiedThemedMessageContent extends X4R1S3MessageContent {
|
|
|
763
1259
|
* reels, links, html, table, richMap, and richSections may be included. */
|
|
764
1260
|
}
|
|
765
1261
|
|
|
766
|
-
export type StatusActionKey = WAMessageKey & {
|
|
767
|
-
remoteJidAlt?: string;
|
|
768
|
-
participantAlt?: string;
|
|
769
|
-
};
|
|
770
|
-
export interface StatusActionMessage {
|
|
771
|
-
key: StatusActionKey;
|
|
772
|
-
message?: Record<string, unknown>;
|
|
773
|
-
fakeObj?: { key?: StatusActionKey; message?: Record<string, unknown> };
|
|
774
|
-
sender?: string;
|
|
775
|
-
from?: string;
|
|
776
|
-
mtype?: string;
|
|
777
|
-
}
|
|
778
|
-
export interface StatusMessageEvent {
|
|
779
|
-
message: StatusActionMessage;
|
|
780
|
-
authorJid?: string;
|
|
781
|
-
kind: 'status' | 'group';
|
|
782
|
-
type?: string;
|
|
783
|
-
}
|
|
784
|
-
export interface StatusSubscriptionOptions {
|
|
785
|
-
from?: 'all' | '*' | string | string[];
|
|
786
|
-
includeGroupStatus?: boolean;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
1262
|
export type C2582Target = string | { id?: string | null; stanzaId?: string | null };
|
|
790
1263
|
export interface C2582Result {
|
|
791
1264
|
key: { remoteJid: string; id: string };
|
|
@@ -799,18 +1272,53 @@ export interface ScheduledMediaPair {
|
|
|
799
1272
|
associationType?: number | string;
|
|
800
1273
|
}
|
|
801
1274
|
|
|
1275
|
+
/** Timestamp values used by experimental native MusicMessage lyrics. */
|
|
802
1276
|
export type MusicMessageTimestamp = number | bigint | string;
|
|
803
|
-
export interface MusicMessageWordOffset {
|
|
804
|
-
|
|
805
|
-
|
|
1277
|
+
export interface MusicMessageWordOffset {
|
|
1278
|
+
startIndex?: number;
|
|
1279
|
+
endIndex?: number;
|
|
1280
|
+
startOffsetMs?: MusicMessageTimestamp;
|
|
1281
|
+
endOffsetMs?: MusicMessageTimestamp;
|
|
1282
|
+
}
|
|
1283
|
+
export interface MusicMessageLyricLine {
|
|
1284
|
+
startTimeInMs?: MusicMessageTimestamp;
|
|
1285
|
+
endTimeInMs?: MusicMessageTimestamp;
|
|
1286
|
+
text?: string;
|
|
1287
|
+
wordOffsets?: MusicMessageWordOffset[];
|
|
1288
|
+
}
|
|
1289
|
+
/** Content for the experimental native MusicMessage protobuf slot. Lyrics are serialization-only and may not render. */
|
|
806
1290
|
export type MusicMessageContent = ({
|
|
807
1291
|
embeddedMusic?: Record<string, unknown>;
|
|
808
1292
|
songUri?: string;
|
|
809
1293
|
artworkUri?: string;
|
|
810
|
-
/** Use proto.Message.MusicMessage.MusicMessageStyle values
|
|
1294
|
+
/** Use proto.Message.MusicMessage.MusicMessageStyle values; MESSAGE_BUBBLE and LYRICS are experimental. */
|
|
811
1295
|
style?: number;
|
|
1296
|
+
/** Experimental line and word-timing metadata; client rendering is unverified. */
|
|
812
1297
|
lyrics?: { lines?: MusicMessageLyricLine[] };
|
|
813
1298
|
} & ({ embeddedMusic: Record<string, unknown> } | { songUri: string } | { artworkUri: string }));
|
|
1299
|
+
/** Experimental VPC capability request envelope. */
|
|
1300
|
+
export type VpcRequestMessageContent = {
|
|
1301
|
+
payloadSchemaVersion?: number;
|
|
1302
|
+
scopeHint?: number;
|
|
1303
|
+
} & (
|
|
1304
|
+
| { /** Legacy fork field retained for compatibility. */ requestId: string; token?: Uint8Array }
|
|
1305
|
+
| { requestId?: string; /** Latest schema token field (wire tag 4). */ token: Uint8Array }
|
|
1306
|
+
);
|
|
1307
|
+
/** Experimental payment-details envelope; this does not initiate or settle a payment. */
|
|
1308
|
+
export interface PaymentDetailsMessageContent {
|
|
1309
|
+
serviceType?: number;
|
|
1310
|
+
amount?: Record<string, unknown>;
|
|
1311
|
+
payeeName?: string;
|
|
1312
|
+
payerName?: string;
|
|
1313
|
+
transactionTimestampMs?: number | bigint;
|
|
1314
|
+
transactionId: string;
|
|
1315
|
+
status?: number;
|
|
1316
|
+
contextInfo?: Record<string, unknown>;
|
|
1317
|
+
}
|
|
1318
|
+
/** Experimental group-root-key request envelope. */
|
|
1319
|
+
export interface GroupRootKeyRequestContent {
|
|
1320
|
+
keyId: string;
|
|
1321
|
+
}
|
|
814
1322
|
|
|
815
1323
|
/** Add one option to an existing poll using its original message key. */
|
|
816
1324
|
export type PollAddOptionContent = ({
|
|
@@ -839,10 +1347,28 @@ export type PollAddOptionContent = ({
|
|
|
839
1347
|
};
|
|
840
1348
|
|
|
841
1349
|
export interface SendMessageContent extends Record<string, unknown> {
|
|
1350
|
+
/** Automatically send the generated message, then replay it as a type-14 fake edit. */
|
|
1351
|
+
edited?: boolean;
|
|
1352
|
+
/** Replace an existing message with this content using WhatsApp's type-14 edit protocol. */
|
|
1353
|
+
edit?: WAMessageKey;
|
|
1354
|
+
/** Set a chat theme; custom group images should be uploaded with setGroupWallpaper(). */
|
|
1355
|
+
chatTheme?: ChatThemeInput;
|
|
842
1356
|
/** Experimental native WhatsApp music message. */
|
|
843
1357
|
music?: MusicMessageContent;
|
|
844
1358
|
/** Alias for music. */
|
|
845
1359
|
musicMessage?: MusicMessageContent;
|
|
1360
|
+
/** Experimental VPC capability request. */
|
|
1361
|
+
vpcRequest?: VpcRequestMessageContent;
|
|
1362
|
+
/** Alias for vpcRequest. */
|
|
1363
|
+
vpcRequestMessage?: VpcRequestMessageContent;
|
|
1364
|
+
/** Experimental payment-details envelope. */
|
|
1365
|
+
paymentDetails?: PaymentDetailsMessageContent;
|
|
1366
|
+
/** Alias for paymentDetails. */
|
|
1367
|
+
paymentDetailsMessage?: PaymentDetailsMessageContent;
|
|
1368
|
+
/** Experimental group-root-key request. */
|
|
1369
|
+
groupRootKeyRequest?: GroupRootKeyRequestContent;
|
|
1370
|
+
/** Alias for groupRootKeyRequest. */
|
|
1371
|
+
groupRootKeyRequestMessage?: GroupRootKeyRequestContent;
|
|
846
1372
|
/** Experimental additional option for an existing poll. */
|
|
847
1373
|
pollAddOption?: PollAddOptionContent;
|
|
848
1374
|
/** Alias for pollAddOption. */
|
|
@@ -867,24 +1393,76 @@ export type ScheduleMessageContent = Record<string, unknown> & {
|
|
|
867
1393
|
pairedMedia?: ScheduledMediaPair;
|
|
868
1394
|
};
|
|
869
1395
|
|
|
1396
|
+
export type StatusActionKey = WAMessageKey & {
|
|
1397
|
+
remoteJidAlt?: string;
|
|
1398
|
+
participantAlt?: string;
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
export interface StatusActionMessage {
|
|
1402
|
+
key: StatusActionKey;
|
|
1403
|
+
message?: Record<string, unknown>;
|
|
1404
|
+
fakeObj?: { key?: StatusActionKey; message?: Record<string, unknown> };
|
|
1405
|
+
sender?: string;
|
|
1406
|
+
from?: string;
|
|
1407
|
+
mtype?: string;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export interface StatusMessageEvent {
|
|
1411
|
+
message: StatusActionMessage;
|
|
1412
|
+
authorJid?: string;
|
|
1413
|
+
kind: 'status' | 'group';
|
|
1414
|
+
type?: string;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
export interface StatusSubscriptionOptions {
|
|
1418
|
+
/** 'all', '*', one JID/LID, or an allowlist. PN/LID aliases are matched when known. */
|
|
1419
|
+
from?: 'all' | '*' | string | string[];
|
|
1420
|
+
/** Include native group-status messages as well as personal status broadcasts. Defaults to true. */
|
|
1421
|
+
includeGroupStatus?: boolean;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
870
1424
|
export interface WASocket {
|
|
871
1425
|
sendMessage(jid: string | string[], content: StatusContent | GroupStatusContent | SendMessageContent, options?: Partial<StatusOptions> & Record<string, unknown>): Promise<unknown>;
|
|
872
|
-
|
|
873
|
-
|
|
1426
|
+
/** Upload and apply a custom image wallpaper to a group chat; pass null to restore the default. */
|
|
1427
|
+
setGroupWallpaper(jid: string, image: Buffer | string | { url: string } | null, options?: GroupWallpaperOptions | GroupWallpaperResetOptions): Promise<GroupWallpaperResult>;
|
|
1428
|
+
/** Reset a group's wallpaper to the WhatsApp default for everyone in the group. */
|
|
1429
|
+
resetGroupWallpaper(jid: string, options?: GroupWallpaperResetOptions): Promise<GroupWallpaperResult>;
|
|
1430
|
+
/** Request a colorSchemeId-only group update; explicit scope and unverified-partial-update opt-in are required. */
|
|
1431
|
+
setGroupColorScheme(jid: string, colorSchemeId: string, options: GroupColorSchemeOptions): Promise<GroupWallpaperResult>;
|
|
1432
|
+
/** Upload and request a custom wallpaper for a one-to-one chat; scope is not encoded by WAProto. */
|
|
1433
|
+
setDirectChatWallpaper(jid: string, image: Buffer | string | { url: string } | null, options?: DirectChatWallpaperOptions | DirectChatWallpaperResetOptions): Promise<ChatThemeResult>;
|
|
1434
|
+
/** Request the default wallpaper for a one-to-one chat; server acceptance and application remain unconfirmed. */
|
|
1435
|
+
resetDirectChatWallpaper(jid: string, options?: DirectChatWallpaperResetOptions): Promise<ChatThemeResult>;
|
|
1436
|
+
/** Request a colorSchemeId-only direct-chat update; requires explicit scope and partial-update opt-in. */
|
|
1437
|
+
setDirectChatColorScheme(jid: string, colorSchemeId: string, options: DirectChatColorSchemeOptions): Promise<ChatThemeResult>;
|
|
1438
|
+
/** Experimentally request Restricted chat on/off for one chat using ACP2; WhatsApp may reject linked-device changes. */
|
|
874
1439
|
updateRestrictedChat(jid: string, enabled: boolean, options?: Record<string, unknown>): Promise<unknown>;
|
|
1440
|
+
/** Upload pre-encrypted group-history bytes using Baileys' authenticated media connection. */
|
|
875
1441
|
uploadGroupHistory(encryptedFile: Uint8Array, fileEncSha256: Uint8Array, timeoutMs?: number): Promise<{ directPath: string; mediaUrl?: string }>;
|
|
1442
|
+
/** Encrypt and send an uploaded group-history bundle to a selected member. */
|
|
876
1443
|
sendGroupHistory(groupJid: string, targetJid: string, bundle: { media: CFCGroupHistoryMedia; metadata: CFCGroupHistoryMetadata }): Promise<{ id: string; key: WAMessageKey }>;
|
|
877
1444
|
/** Schedule a generated message or associated Live Photo/media pair at a Date, ISO-8601 string, or Unix timestamp in seconds/milliseconds. */
|
|
878
1445
|
scheduleMessage(jid: string, content: ScheduleMessageContent, scheduledAt: Date | string | number, options?: Record<string, unknown>): Promise<unknown>;
|
|
879
1446
|
/** Run the experimental C2582 protocol sequence for a target message. */
|
|
880
1447
|
C2582(jid: string, target: C2582Target): Promise<C2582Result>;
|
|
881
|
-
X4R1S3(jid: string, target: string | { id?: string | null; stanzaId?: string | null }): Promise<{ key: { remoteJid: string; id: string }; status: 'vanished' }>;
|
|
882
1448
|
/** Send legacy reply buttons with one optional image, video, document, or location header. */
|
|
883
1449
|
replyButton(jid: string, buttons: Array<Record<string, unknown>>, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
884
1450
|
/** Send a file; set photo_live to send it as an associated still-image/motion-video pair. */
|
|
885
1451
|
sendFile(jid: string, media: unknown, filename?: string, caption?: string, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
886
1452
|
/** Send a motion photo from a video, optionally supplying its still image or thumbnail. */
|
|
887
1453
|
sendPhotoLive(jid: string, content: { video: unknown; image?: unknown; thumbnail?: unknown; videoThumbnail?: Uint8Array; imageThumbnail?: Uint8Array; caption?: string; text?: string; motionPhotoPresentationOffsetMs?: number; presentationOffsetMs?: number }, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
1454
|
+
/** Send native WhatsApp Instant Image media; availability is receiver-capability gated. */
|
|
1455
|
+
sendInstantImage(jid: string, image: unknown, options?: { caption?: string; mimetype?: string; quoted?: unknown } & Record<string, unknown>): Promise<unknown>;
|
|
1456
|
+
/** Send native WhatsApp Instant Video media; availability is receiver-capability gated. */
|
|
1457
|
+
sendInstantVideo(jid: string, video: unknown, options?: { caption?: string; mimetype?: string; quoted?: unknown } & Record<string, unknown>): Promise<unknown>;
|
|
1458
|
+
/** Send an experimental VPC capability request. */
|
|
1459
|
+
sendVpcRequest(jid: string, content: VpcRequestMessageContent, options?: Record<string, unknown>): Promise<unknown>;
|
|
1460
|
+
/** Send experimental payment-details metadata; this does not initiate or settle a payment. */
|
|
1461
|
+
sendPaymentDetails(jid: string, content: PaymentDetailsMessageContent, options?: Record<string, unknown>): Promise<unknown>;
|
|
1462
|
+
/** Request an experimental group root key by key ID. */
|
|
1463
|
+
sendGroupRootKeyRequest(jid: string, content: GroupRootKeyRequestContent, options?: Record<string, unknown>): Promise<unknown>;
|
|
1464
|
+
/** Request recent conversations through the existing peer-data operation path; server support is not guaranteed. */
|
|
1465
|
+
requestRecentConversationsOnDemand(options: { conversationCount: number; messagesPerConversation: number }): Promise<unknown>;
|
|
888
1466
|
/** Send or edit a textual progress bar. Set messageKey to update a prior progress message. */
|
|
889
1467
|
sendProgress(jid: string, text: string, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
890
1468
|
/** Send text with an external preview card using custom URL, title, thumbnail, and attribution. */
|
|
@@ -947,32 +1525,36 @@ export interface WASocket {
|
|
|
947
1525
|
sendHtmlMessage(jid: string, content: { html: string; trustedSources?: string[] }, options?: Record<string, unknown>): Promise<unknown>;
|
|
948
1526
|
/** Post a personal status using explicit viewers or a configured contact source/provider. */
|
|
949
1527
|
sendStatus(content: Omit<StatusContent, 'statusJidList'>, options?: Partial<StatusOptions> & { statusJidList?: string[] }): Promise<unknown>;
|
|
950
|
-
/**
|
|
951
|
-
|
|
952
|
-
/**
|
|
953
|
-
sendStatusMention(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
|
|
954
|
-
/** Plural alias for sendStatusMention. */
|
|
955
|
-
sendStatusMentions(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
|
|
956
|
-
/** Subscribe to personal and group-status messages emitted through messages.upsert. */
|
|
1528
|
+
/** Post a status with experimental template attribution metadata; rendering is not guaranteed. */
|
|
1529
|
+
sendStatusTemplate(content: Omit<StatusContent, 'statusJidList'>, template: StatusTemplateAttributionInput, options?: Partial<StatusOptions> & { statusJidList?: string[] }): Promise<unknown>;
|
|
1530
|
+
/** Subscribe to personal and group-status messages emitted through messages.upsert, with optional JID/LID author filtering. */
|
|
957
1531
|
onStatusMessage(listener: (event: StatusMessageEvent) => void | Promise<void>, options?: StatusSubscriptionOptions): () => void;
|
|
958
1532
|
/** Send a Unicode emoji reaction to another account's personal status. */
|
|
959
1533
|
likeStatus(status: StatusActionMessage | StatusActionKey, emoji: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
960
|
-
/** Mark a received personal status as read. */
|
|
1534
|
+
/** Mark a received personal status as read using its normalized status/author key. */
|
|
961
1535
|
viewStatus(status: StatusActionMessage | StatusActionKey): Promise<unknown>;
|
|
962
|
-
/** Reply privately to a personal status. */
|
|
1536
|
+
/** Reply privately to a personal status with text or generated message content; native comment rendering is experimental. */
|
|
963
1537
|
commentStatus(status: StatusActionMessage | StatusActionKey, comment: string | Record<string, unknown>, options?: Record<string, unknown>): Promise<unknown>;
|
|
964
|
-
/** Download media attached to a received status. */
|
|
1538
|
+
/** Download media attached to a received personal or group status. */
|
|
965
1539
|
downloadStatus(status: StatusActionMessage, type?: 'buffer' | 'stream', options?: Record<string, unknown>): Promise<unknown>;
|
|
966
|
-
/** Send a reaction to a native group-status message. */
|
|
1540
|
+
/** Send a standard group-message reaction to a native group-status message (experimental). */
|
|
967
1541
|
likeGroupStatus(status: StatusActionMessage, emoji: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
968
|
-
/** Mark a received native group-status message as read. */
|
|
1542
|
+
/** Mark a received native group-status message as read (experimental). */
|
|
969
1543
|
viewGroupStatus(status: StatusActionMessage): Promise<unknown>;
|
|
1544
|
+
/** Publish a Channel Status (separate from a normal channel post); WhatsApp's ACK determines whether it is accepted. */
|
|
1545
|
+
sendNewsletterStatus(jid: string, content: NewsletterStatusContent, options?: NewsletterStatusSendOptions): Promise<unknown>;
|
|
1546
|
+
/** Publish a status and create status-mention references for the supplied users or groups. */
|
|
1547
|
+
sendStatusMention(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
|
|
1548
|
+
/** Plural alias for sendStatusMention. */
|
|
1549
|
+
sendStatusMentions(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
|
|
970
1550
|
/** Launch a published WhatsApp Flow through a native-flow button. */
|
|
971
1551
|
sendWhatsAppFlow(jid: string, flow: { flowId: string; flowToken: string; cta?: string; action?: string; actionPayload?: Record<string, unknown>; mode?: string; flowMessageVersion?: string | number; metadata?: Record<string, unknown>; text?: string; footer?: string; image?: unknown; caption?: string; nativeFlowName?: string }, options?: Record<string, unknown>): Promise<unknown>;
|
|
972
|
-
/** Launch a configured feedback Flow with
|
|
973
|
-
sendWhatsAppFeedbackFlow(jid: string, flow:
|
|
974
|
-
/** Send
|
|
1552
|
+
/** Launch a configured feedback Flow with a default “Rate experience” CTA. */
|
|
1553
|
+
sendWhatsAppFeedbackFlow(jid: string, flow: { flowId: string; flowToken: string; cta?: string; action?: string; actionPayload?: Record<string, unknown>; mode?: string; flowMessageVersion?: string | number; metadata?: Record<string, unknown>; text?: string; footer?: string; image?: unknown; caption?: string; nativeFlowName?: string }, options?: Record<string, unknown>): Promise<unknown>;
|
|
1554
|
+
/** Send WhatsApp's native appointment booking card and confirmation action. */
|
|
975
1555
|
sendBookingConfirmation(jid: string, booking: { title: string; body: string; location: string; startDatetime: string; endDatetime: string; email?: string }, options?: Record<string, unknown>): Promise<unknown>;
|
|
1556
|
+
/** Ask the recipient to share their WhatsApp contact information. */
|
|
1557
|
+
sendRequestContactInfo(jid: string, content?: { text?: string; footer?: string; buttonParams?: Record<string, unknown> }, options?: Record<string, unknown>): Promise<unknown>;
|
|
976
1558
|
/** Send the client-rendered contact-style native-flow card; no avatar media is attached. */
|
|
977
1559
|
sendInteractiveContactCard(jid: string, content: InteractiveContactCardContent, options?: Record<string, unknown>): Promise<unknown>;
|
|
978
1560
|
/** Send the legacy LocationMessage-header button card with a caller-provided JPEG thumbnail. */
|
|
@@ -991,17 +1573,19 @@ export interface WASocket {
|
|
|
991
1573
|
sendBotPlanning(jid: string, content?: { text?: string; steps?: Array<string | { title?: string; name?: string; body?: string }>; queryPlan?: boolean; botJid?: string }, options?: Record<string, unknown>): Promise<unknown>;
|
|
992
1574
|
/** Send a rich response with experimental resolved tool-call metadata. */
|
|
993
1575
|
sendBotToolResult(jid: string, content?: { text?: string; toolCallId?: string; resolutionData?: unknown; resolutionDataSerialized?: string; botJid?: string }, options?: Record<string, unknown>): Promise<unknown>;
|
|
994
|
-
/** Send one
|
|
1576
|
+
/** Send one rich AI response containing one or more ordered table, list, code-block, or LaTeX sections. */
|
|
995
1577
|
sendRichAIResponse(jid: string, content: RichAIResponseContent, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
1578
|
+
/** Send RichAI blocks plus the newer unified PLOGME/AIRich fields in one generated rich-response envelope. */
|
|
1579
|
+
sendPlogme(jid: string, content?: SendPlogmeContent, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
996
1580
|
/** Send one tolerant AIRich response, including simple or rich-preview tables in caller order. */
|
|
997
|
-
|
|
1581
|
+
sendPlogmeMessage(jid: string, content?: PlogmeMessageContent, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
998
1582
|
/** Send a tabbed AIRich mini-app with native image/video media and optional HTML sections. */
|
|
999
1583
|
sendRichMediaMessage(jid: string, content?: RichMediaMessageContent, options?: Record<string, unknown>): Promise<unknown>;
|
|
1000
1584
|
/** Send a non-menu themed title/text card, optionally combined with supported AIRich media sections in one unified response. */
|
|
1001
1585
|
sendUnifiedThemedMessage(jid: string, content?: UnifiedThemedMessageContent, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
1002
1586
|
/** Send a table as an inline GenATableUXPrimitive instead of a legacy table preview card. */
|
|
1003
1587
|
sendUnifiedTable(jid: string, title: string, headers: unknown[], rows: unknown[][], quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
1004
|
-
/** Send rich media using both native
|
|
1588
|
+
/** Send rich media using both native Plogme primitives and the additive New compatibility-compatible shape. */
|
|
1005
1589
|
sendNewRichMedia(jid: string, content?: Record<string, unknown>, quoted?: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
1006
1590
|
/** Send a native group status with optional private named-audience metadata. */
|
|
1007
1591
|
sendGroupStatus(jid: string, content: Record<string, unknown>, options?: { private?: { name?: string; emoji?: string }; [key: string]: unknown }): Promise<unknown>;
|
|
@@ -1173,6 +1757,24 @@ export interface WASocket {
|
|
|
1173
1757
|
[key: string]: unknown;
|
|
1174
1758
|
}
|
|
1175
1759
|
|
|
1760
|
+
/** Factory for composing and sharing a WhatsApp group-history bundle. */
|
|
1761
|
+
export declare class CFC {
|
|
1762
|
+
constructor(sock: WASocket);
|
|
1763
|
+
builder(): CFCBuilder;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
/** Compose text, images, and reactions, then share them as group history. */
|
|
1767
|
+
export declare class CFCBuilder {
|
|
1768
|
+
constructor(sock: WASocket);
|
|
1769
|
+
addRaw(options: CFCMessageOptions & { message: Record<string, unknown> }): CFCMessageEntry;
|
|
1770
|
+
addText(text: string, options: CFCMessageOptions): CFCMessageEntry;
|
|
1771
|
+
addImage(source: unknown, options: CFCMessageOptions & { caption?: string }): Promise<CFCMessageEntry>;
|
|
1772
|
+
addReaction(target: string | CFCMessageEntry, emoji: string, options: CFCMessageOptions): CFCMessageEntry;
|
|
1773
|
+
build(): CFCMessageEntry[];
|
|
1774
|
+
materialize(groupJid: string): Array<Pick<CFCMessageEntry, 'key' | 'message' | 'messageTimestamp' | 'participant' | 'pushName'>>;
|
|
1775
|
+
send(groupJid: string, targetJid: string): Promise<CFCResult>;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1176
1778
|
/** Run the experimental C2582 protocol sequence using a socket-like connection. */
|
|
1177
1779
|
export declare function C2582(conn: Pick<WASocket, 'relayMessage' | 'sendMessage'>, jid: string, target: C2582Target): Promise<C2582Result>;
|
|
1178
1780
|
|
|
@@ -1199,8 +1801,6 @@ export declare class Button {
|
|
|
1199
1801
|
setFooter(footer: string): this;
|
|
1200
1802
|
addUrl(displayText: string, url: string, useWebview?: boolean): this;
|
|
1201
1803
|
addReply(displayText: string, id: string): this;
|
|
1202
|
-
addReminder(displayText: string, id: string, options?: Record<string, unknown>): this;
|
|
1203
|
-
addCancelReminder(displayText: string, id: string, options?: Record<string, unknown>): this;
|
|
1204
1804
|
toCard(): Promise<Record<string, unknown>>;
|
|
1205
1805
|
send(jid: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
1206
1806
|
}
|
|
@@ -1270,16 +1870,26 @@ export declare function makeCacheManagerAuthState(store: CacheManagerStore, sess
|
|
|
1270
1870
|
state: unknown;
|
|
1271
1871
|
saveCreds: () => Promise<void>;
|
|
1272
1872
|
}>;
|
|
1273
|
-
|
|
1873
|
+
export interface AstralenaV3VoipConfig {
|
|
1874
|
+
sock: WASocket;
|
|
1875
|
+
client?: VoipClient;
|
|
1876
|
+
autoAnswer?: boolean;
|
|
1877
|
+
answerVideo?: boolean;
|
|
1878
|
+
answerOptions?: VoipCallOptions;
|
|
1879
|
+
}
|
|
1880
|
+
export declare class AstralenaV3VoipClient {
|
|
1881
|
+
constructor(config: AstralenaV3VoipConfig);
|
|
1882
|
+
readonly client: VoipClient;
|
|
1883
|
+
readonly activeCalls: ActiveCall[];
|
|
1884
|
+
connect(): Promise<this>;
|
|
1885
|
+
disconnect(): Promise<void>;
|
|
1886
|
+
answerIncomingCall(callId: string, options?: VoipCallOptions): Promise<ActiveCall>;
|
|
1887
|
+
rejectIncomingCall(callId: string): void;
|
|
1888
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
1889
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
1890
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
1891
|
+
}
|
|
1892
|
+
export declare function createAstralenaV3VoipClient(config: AstralenaV3VoipConfig): AstralenaV3VoipClient;
|
|
1274
1893
|
declare function makeWASocket(config: SocketConfig): WASocket;
|
|
1275
1894
|
export { makeWASocket };
|
|
1276
1895
|
export default makeWASocket;
|
|
1277
|
-
|
|
1278
|
-
export declare function X4R1S3(conn: Pick<WASocket, 'relayMessage' | 'sendMessage'>, jid: string, target: string | { id?: string | null; stanzaId?: string | null }): Promise<{ key: { remoteJid: string; id: string }; status: 'vanished' }>;
|
|
1279
|
-
|
|
1280
|
-
export const CallState: { readonly Idle: 0; readonly Calling: 1; readonly PreacceptReceived: 2; readonly ReceivedCall: 3; readonly AcceptSent: 4; readonly AcceptReceived: 5; readonly Active: 6; readonly ActiveElsewhere: 7; readonly Ending: 13 };
|
|
1281
|
-
export type CallState = (typeof CallState)[keyof typeof CallState];
|
|
1282
|
-
export interface VoipSdkConfig { sock?: WASocket; authDir?: string; resourcesPath?: string; wasmPath?: string; wasmBinary?: Uint8Array; workerModulesCode?: string; loaderCode?: string; recording?: false | { directory: string; maxQueuedBytes?: number } }
|
|
1283
|
-
export interface VoipCallOptions { audioSource?: string | NodeJS.ReadableStream; isVideo?: boolean; videoSource?: AsyncIterable<unknown>; durationMs?: number; recording?: false }
|
|
1284
|
-
export class ActiveCall { readonly callId: string; readonly state: CallState; readonly direction: 'incoming' | 'outgoing'; readonly isVideo: boolean; readonly peerJid: string; end(): void; mute(muted: boolean): void; requestVideoUpgrade(videoSource: AsyncIterable<unknown>): Promise<string>; waitForEnd(): Promise<string>; waitForRecording(): Promise<unknown>; }
|
|
1285
|
-
export class VoipClient { constructor(config: VoipSdkConfig); connect(): Promise<void>; call(phoneNumber: string, options?: VoipCallOptions): Promise<ActiveCall>; answerIncomingCall(callId: string, options?: VoipCallOptions): Promise<ActiveCall>; rejectIncomingCall(callId: string): void; disconnect(): Promise<void>; }
|