zaileys 2.0.9 → 2.0.11
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 +15 -2
- package/dist/index.d.mts +228 -1
- package/dist/index.d.ts +228 -1
- package/dist/index.js +15 -15
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -113,7 +113,12 @@ import { Client } from 'zaileys';
|
|
|
113
113
|
const { Client } = require('zaileys');
|
|
114
114
|
|
|
115
115
|
const wa = new Client({
|
|
116
|
-
|
|
116
|
+
// qr code
|
|
117
|
+
authType: 'qr',
|
|
118
|
+
|
|
119
|
+
// pairing code
|
|
120
|
+
authType: 'pairing',
|
|
121
|
+
phoneNumber: 628xxxxx
|
|
117
122
|
});
|
|
118
123
|
|
|
119
124
|
wa.on('messages', async (ctx) => {
|
|
@@ -268,7 +273,7 @@ If any of these match a number in your returned array, the citation check return
|
|
|
268
273
|
|
|
269
274
|
## 📫 Sending Messages
|
|
270
275
|
|
|
271
|
-
> **Quick Jump:** [Text](#send-text) · [Reply](#reply-to-message) · [Forward](#forward-message) · [Media](#send-media) · [Banner](#send-with-banner) · [Location](#send-location) · [Contact](#send-contact) · [Poll](#send-poll) · [Reaction](#send-reaction) · [Presence](#update-presence) · [Mentions](#mentions) · [Edit & Delete](#edit--delete-messages) · [Buttons](#interactive-buttons)
|
|
276
|
+
> **Quick Jump:** [Text](#send-text) · [Reply](#reply-to-message) · [Forward](#forward-message) · [Media](#send-media) · [Banner](#send-with-banner) · [Location](#send-location) · [Contact](#send-contact) · [Poll](#send-poll) · [Reaction](#send-reaction) · [Presence](#update-presence) · [Mentions](#mentions) · [Edit & Delete](#edit--delete-messages) · [Buttons](#interactive-buttons) · [Member Label](#member-label)
|
|
272
277
|
|
|
273
278
|
### Send Text
|
|
274
279
|
|
|
@@ -555,6 +560,14 @@ await wa.button(ctx.roomId, {
|
|
|
555
560
|
});
|
|
556
561
|
```
|
|
557
562
|
|
|
563
|
+
### Member Label
|
|
564
|
+
|
|
565
|
+
Labeling user member on group chat (NEW!)
|
|
566
|
+
|
|
567
|
+
```typescript
|
|
568
|
+
await wa.memberLabel(ctx.roomId, 'Fullstack Developer');
|
|
569
|
+
```
|
|
570
|
+
|
|
558
571
|
## 👥 Group Management
|
|
559
572
|
|
|
560
573
|
> **Quick Jump:** [Create](#create-group) · [Participants](#manage-participants) · [Profile](#group-profile) · [Settings](#group-settings) · [Invite Code](#invite-code) · [Metadata](#group-metadata) · [Join Requests](#join-requests) · [Fetch All](#fetch-all-groups) · [Ephemeral](#ephemeral-messages) · [Leave](#leave-group)
|
package/dist/index.d.mts
CHANGED
|
@@ -125,6 +125,7 @@ declare class Signal {
|
|
|
125
125
|
})[]>;
|
|
126
126
|
presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
|
|
127
127
|
reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
|
|
128
|
+
memberLabel(roomId: string, label: string): Promise<string>;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
declare class Group {
|
|
@@ -198,6 +199,62 @@ declare const ListenerConnectionType: z.ZodObject<{
|
|
|
198
199
|
code: z.ZodOptional<z.ZodString>;
|
|
199
200
|
}, z.core.$strip>;
|
|
200
201
|
|
|
202
|
+
declare const DEVICE_ENUM_TYPES: z.ZodEnum<{
|
|
203
|
+
unknown: "unknown";
|
|
204
|
+
android: "android";
|
|
205
|
+
ios: "ios";
|
|
206
|
+
desktop: "desktop";
|
|
207
|
+
web: "web";
|
|
208
|
+
}>;
|
|
209
|
+
declare const MESSAGE_ENUM_TYPES: z.ZodEnum<{
|
|
210
|
+
text: "text";
|
|
211
|
+
image: "image";
|
|
212
|
+
contact: "contact";
|
|
213
|
+
location: "location";
|
|
214
|
+
document: "document";
|
|
215
|
+
audio: "audio";
|
|
216
|
+
video: "video";
|
|
217
|
+
protocol: "protocol";
|
|
218
|
+
contacts: "contacts";
|
|
219
|
+
highlyStructured: "highlyStructured";
|
|
220
|
+
sendPayment: "sendPayment";
|
|
221
|
+
requestPayment: "requestPayment";
|
|
222
|
+
declinePaymentRequest: "declinePaymentRequest";
|
|
223
|
+
cancelPaymentRequest: "cancelPaymentRequest";
|
|
224
|
+
template: "template";
|
|
225
|
+
sticker: "sticker";
|
|
226
|
+
groupInvite: "groupInvite";
|
|
227
|
+
product: "product";
|
|
228
|
+
deviceSent: "deviceSent";
|
|
229
|
+
lists: "lists";
|
|
230
|
+
viewOnce: "viewOnce";
|
|
231
|
+
order: "order";
|
|
232
|
+
ephemeral: "ephemeral";
|
|
233
|
+
invoice: "invoice";
|
|
234
|
+
buttons: "buttons";
|
|
235
|
+
paymentInvite: "paymentInvite";
|
|
236
|
+
interactive: "interactive";
|
|
237
|
+
reaction: "reaction";
|
|
238
|
+
interactiveResponse: "interactiveResponse";
|
|
239
|
+
pollCreation: "pollCreation";
|
|
240
|
+
pollUpdate: "pollUpdate";
|
|
241
|
+
keepInChat: "keepInChat";
|
|
242
|
+
requestPhoneNumber: "requestPhoneNumber";
|
|
243
|
+
scheduledCallCreation: "scheduledCallCreation";
|
|
244
|
+
groupMentioned: "groupMentioned";
|
|
245
|
+
pinInChat: "pinInChat";
|
|
246
|
+
scheduledCallEdit: "scheduledCallEdit";
|
|
247
|
+
ptv: "ptv";
|
|
248
|
+
botInvoke: "botInvoke";
|
|
249
|
+
callLog: "callLog";
|
|
250
|
+
encComment: "encComment";
|
|
251
|
+
bcall: "bcall";
|
|
252
|
+
lottieSticker: "lottieSticker";
|
|
253
|
+
event: "event";
|
|
254
|
+
comment: "comment";
|
|
255
|
+
placeholder: "placeholder";
|
|
256
|
+
encEventUpdate: "encEventUpdate";
|
|
257
|
+
}>;
|
|
201
258
|
declare const ListenerMessagesType: z.ZodObject<{
|
|
202
259
|
channelId: z.ZodString;
|
|
203
260
|
uniqueId: z.ZodString;
|
|
@@ -295,11 +352,66 @@ declare const ListenerMessagesType: z.ZodObject<{
|
|
|
295
352
|
replied: z.ZodNullable<z.ZodObject</*elided*/ any, z.core.$strip>>;
|
|
296
353
|
}, z.core.$strip>;
|
|
297
354
|
|
|
355
|
+
declare const LimiterType: z$1.ZodOptional<z$1.ZodObject<{
|
|
356
|
+
maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
|
|
357
|
+
durationMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
358
|
+
}, z$1.core.$strip>>;
|
|
359
|
+
declare const CitationType: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
|
|
360
|
+
declare const FakeReplyType: z$1.ZodOptional<z$1.ZodObject<{
|
|
361
|
+
provider: z$1.ZodUnion<[z$1.ZodEnum<{
|
|
362
|
+
whatsapp: "whatsapp";
|
|
363
|
+
meta: "meta";
|
|
364
|
+
chatgpt: "chatgpt";
|
|
365
|
+
copilot: "copilot";
|
|
366
|
+
instagram: "instagram";
|
|
367
|
+
tiktok: "tiktok";
|
|
368
|
+
}>, z$1.ZodNumber]>;
|
|
369
|
+
}, z$1.core.$strip>>;
|
|
298
370
|
declare const StickerMetadataType: z$1.ZodOptional<z$1.ZodObject<{
|
|
299
371
|
packageName: z$1.ZodString;
|
|
300
372
|
authorName: z$1.ZodString;
|
|
301
373
|
quality: z$1.ZodNumber;
|
|
302
374
|
}, z$1.core.$strip>>;
|
|
375
|
+
declare const ClientBaseType: z$1.ZodObject<{
|
|
376
|
+
session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
377
|
+
prefix: z$1.ZodOptional<z$1.ZodString>;
|
|
378
|
+
ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
379
|
+
showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
380
|
+
syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
381
|
+
autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
382
|
+
autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
383
|
+
autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
384
|
+
autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
385
|
+
autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
386
|
+
autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
387
|
+
limiter: z$1.ZodOptional<z$1.ZodObject<{
|
|
388
|
+
maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
|
|
389
|
+
durationMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
390
|
+
}, z$1.core.$strip>>;
|
|
391
|
+
citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
|
|
392
|
+
fakeReply: z$1.ZodOptional<z$1.ZodObject<{
|
|
393
|
+
provider: z$1.ZodUnion<[z$1.ZodEnum<{
|
|
394
|
+
whatsapp: "whatsapp";
|
|
395
|
+
meta: "meta";
|
|
396
|
+
chatgpt: "chatgpt";
|
|
397
|
+
copilot: "copilot";
|
|
398
|
+
instagram: "instagram";
|
|
399
|
+
tiktok: "tiktok";
|
|
400
|
+
}>, z$1.ZodNumber]>;
|
|
401
|
+
}, z$1.core.$strip>>;
|
|
402
|
+
sticker: z$1.ZodOptional<z$1.ZodObject<{
|
|
403
|
+
packageName: z$1.ZodString;
|
|
404
|
+
authorName: z$1.ZodString;
|
|
405
|
+
quality: z$1.ZodNumber;
|
|
406
|
+
}, z$1.core.$strip>>;
|
|
407
|
+
}, z$1.core.$strip>;
|
|
408
|
+
declare const ClientAuthPairingType: z$1.ZodObject<{
|
|
409
|
+
authType: z$1.ZodLiteral<"pairing">;
|
|
410
|
+
phoneNumber: z$1.ZodNumber;
|
|
411
|
+
}, z$1.core.$strip>;
|
|
412
|
+
declare const ClientAuthQRType: z$1.ZodObject<{
|
|
413
|
+
authType: z$1.ZodLiteral<"qr">;
|
|
414
|
+
}, z$1.core.$strip>;
|
|
303
415
|
declare const ClientOptionsType: z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
304
416
|
authType: z$1.ZodLiteral<"pairing">;
|
|
305
417
|
phoneNumber: z$1.ZodNumber;
|
|
@@ -379,6 +491,121 @@ type EventCallbackType = {
|
|
|
379
491
|
calls: (ctx: z$1.infer<typeof ListenerCallsType>) => void;
|
|
380
492
|
};
|
|
381
493
|
|
|
494
|
+
declare const ButtonInteractiveReplyType: z.ZodObject<{
|
|
495
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
496
|
+
text: z.ZodString;
|
|
497
|
+
}, z.core.$strip>;
|
|
498
|
+
declare const ButtonInteractiveUrlType: z.ZodObject<{
|
|
499
|
+
type: z.ZodLiteral<"cta_url">;
|
|
500
|
+
url: z.ZodURL;
|
|
501
|
+
text: z.ZodString;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
declare const ButtonInteractiveCopyType: z.ZodObject<{
|
|
504
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
505
|
+
copy: z.ZodString;
|
|
506
|
+
text: z.ZodString;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
declare const ButtonInteractiveCallType: z.ZodObject<{
|
|
509
|
+
type: z.ZodLiteral<"cta_call">;
|
|
510
|
+
text: z.ZodString;
|
|
511
|
+
phoneNumber: z.ZodString;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
declare const ButtonInteractiveSingleSelectType: z.ZodObject<{
|
|
514
|
+
type: z.ZodLiteral<"single_select">;
|
|
515
|
+
text: z.ZodString;
|
|
516
|
+
section: z.ZodArray<z.ZodObject<{
|
|
517
|
+
title: z.ZodString;
|
|
518
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
519
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
520
|
+
id: z.ZodString;
|
|
521
|
+
title: z.ZodString;
|
|
522
|
+
header: z.ZodOptional<z.ZodString>;
|
|
523
|
+
description: z.ZodOptional<z.ZodString>;
|
|
524
|
+
}, z.core.$strip>>;
|
|
525
|
+
}, z.core.$strip>>;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
declare const ButtonInteractiveType: z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"interactive">;
|
|
529
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
530
|
+
data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
531
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
532
|
+
text: z.ZodString;
|
|
533
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
534
|
+
type: z.ZodLiteral<"cta_url">;
|
|
535
|
+
url: z.ZodURL;
|
|
536
|
+
text: z.ZodString;
|
|
537
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
538
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
539
|
+
copy: z.ZodString;
|
|
540
|
+
text: z.ZodString;
|
|
541
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
542
|
+
type: z.ZodLiteral<"cta_call">;
|
|
543
|
+
text: z.ZodString;
|
|
544
|
+
phoneNumber: z.ZodString;
|
|
545
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
546
|
+
type: z.ZodLiteral<"single_select">;
|
|
547
|
+
text: z.ZodString;
|
|
548
|
+
section: z.ZodArray<z.ZodObject<{
|
|
549
|
+
title: z.ZodString;
|
|
550
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
551
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
552
|
+
id: z.ZodString;
|
|
553
|
+
title: z.ZodString;
|
|
554
|
+
header: z.ZodOptional<z.ZodString>;
|
|
555
|
+
description: z.ZodOptional<z.ZodString>;
|
|
556
|
+
}, z.core.$strip>>;
|
|
557
|
+
}, z.core.$strip>>;
|
|
558
|
+
}, z.core.$strip>]>>;
|
|
559
|
+
}, z.core.$strip>;
|
|
560
|
+
declare const ButtonSimpleType: z.ZodObject<{
|
|
561
|
+
type: z.ZodLiteral<"simple">;
|
|
562
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
563
|
+
data: z.ZodArray<z.ZodObject<{
|
|
564
|
+
id: z.ZodString;
|
|
565
|
+
text: z.ZodString;
|
|
566
|
+
}, z.core.$strip>>;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
declare const ButtonType: z.ZodUnion<readonly [z.ZodObject<{
|
|
569
|
+
type: z.ZodLiteral<"simple">;
|
|
570
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
571
|
+
data: z.ZodArray<z.ZodObject<{
|
|
572
|
+
id: z.ZodString;
|
|
573
|
+
text: z.ZodString;
|
|
574
|
+
}, z.core.$strip>>;
|
|
575
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
576
|
+
type: z.ZodLiteral<"interactive">;
|
|
577
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
578
|
+
data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
579
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
580
|
+
text: z.ZodString;
|
|
581
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
582
|
+
type: z.ZodLiteral<"cta_url">;
|
|
583
|
+
url: z.ZodURL;
|
|
584
|
+
text: z.ZodString;
|
|
585
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
586
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
587
|
+
copy: z.ZodString;
|
|
588
|
+
text: z.ZodString;
|
|
589
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
590
|
+
type: z.ZodLiteral<"cta_call">;
|
|
591
|
+
text: z.ZodString;
|
|
592
|
+
phoneNumber: z.ZodString;
|
|
593
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
594
|
+
type: z.ZodLiteral<"single_select">;
|
|
595
|
+
text: z.ZodString;
|
|
596
|
+
section: z.ZodArray<z.ZodObject<{
|
|
597
|
+
title: z.ZodString;
|
|
598
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
599
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
600
|
+
id: z.ZodString;
|
|
601
|
+
title: z.ZodString;
|
|
602
|
+
header: z.ZodOptional<z.ZodString>;
|
|
603
|
+
description: z.ZodOptional<z.ZodString>;
|
|
604
|
+
}, z.core.$strip>>;
|
|
605
|
+
}, z.core.$strip>>;
|
|
606
|
+
}, z.core.$strip>]>>;
|
|
607
|
+
}, z.core.$strip>]>;
|
|
608
|
+
|
|
382
609
|
type ParsedMessage = Partial<z.infer<typeof ListenerMessagesType>>;
|
|
383
610
|
type CollectorFilter = (msg: ParsedMessage) => boolean;
|
|
384
611
|
type CollectorCallback = (messages: ParsedMessage[]) => void;
|
|
@@ -785,4 +1012,4 @@ declare class SessionWatchdog {
|
|
|
785
1012
|
declare const createWatchdog: (options: WatchdogOptions) => SessionWatchdog;
|
|
786
1013
|
declare const getWatchdog: () => SessionWatchdog | null;
|
|
787
1014
|
|
|
788
|
-
export { AudioProcessor, type AudioType, Client, DocumentProcessor, ImageProcessor, Lowdb, MediaProcessor, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, SessionWatchdog, StickerProcessor, VideoProcessor, cleanJid, cleanMediaObject, cleanupSocket, createLowdb, createWatchdog, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getExistingSocket, getLatestLibVersion, getMediaThumbnail, getUsersMentions, getVideoDuration, getVideoThumbnail, getWaAudio, getWaDocument, getWaSticker, getWatchdog, ignoreLint, logColor, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, repairSessionKeys, shuffleString, toBuffer, toJson, toString, useAuthState };
|
|
1015
|
+
export { AudioProcessor, type AudioType, ButtonInteractiveCallType, ButtonInteractiveCopyType, ButtonInteractiveReplyType, ButtonInteractiveSingleSelectType, ButtonInteractiveType, ButtonInteractiveUrlType, ButtonSimpleType, ButtonType, CitationType, Client, ClientAuthPairingType, ClientAuthQRType, ClientBaseType, ClientOptionsType, DEVICE_ENUM_TYPES, DocumentProcessor, type EventCallbackType, EventEnumType, FakeReplyType, ImageProcessor, LimiterType, ListenerCallsType, ListenerConnectionType, ListenerMessagesType, Lowdb, MESSAGE_ENUM_TYPES, MediaProcessor, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, SessionWatchdog, StickerMetadataType, StickerProcessor, VideoProcessor, cleanJid, cleanMediaObject, cleanupSocket, createLowdb, createWatchdog, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getExistingSocket, getLatestLibVersion, getMediaThumbnail, getUsersMentions, getVideoDuration, getVideoThumbnail, getWaAudio, getWaDocument, getWaSticker, getWatchdog, ignoreLint, logColor, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, repairSessionKeys, shuffleString, toBuffer, toJson, toString, useAuthState };
|
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ declare class Signal {
|
|
|
125
125
|
})[]>;
|
|
126
126
|
presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
|
|
127
127
|
reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
|
|
128
|
+
memberLabel(roomId: string, label: string): Promise<string>;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
declare class Group {
|
|
@@ -198,6 +199,62 @@ declare const ListenerConnectionType: z.ZodObject<{
|
|
|
198
199
|
code: z.ZodOptional<z.ZodString>;
|
|
199
200
|
}, z.core.$strip>;
|
|
200
201
|
|
|
202
|
+
declare const DEVICE_ENUM_TYPES: z.ZodEnum<{
|
|
203
|
+
unknown: "unknown";
|
|
204
|
+
android: "android";
|
|
205
|
+
ios: "ios";
|
|
206
|
+
desktop: "desktop";
|
|
207
|
+
web: "web";
|
|
208
|
+
}>;
|
|
209
|
+
declare const MESSAGE_ENUM_TYPES: z.ZodEnum<{
|
|
210
|
+
text: "text";
|
|
211
|
+
image: "image";
|
|
212
|
+
contact: "contact";
|
|
213
|
+
location: "location";
|
|
214
|
+
document: "document";
|
|
215
|
+
audio: "audio";
|
|
216
|
+
video: "video";
|
|
217
|
+
protocol: "protocol";
|
|
218
|
+
contacts: "contacts";
|
|
219
|
+
highlyStructured: "highlyStructured";
|
|
220
|
+
sendPayment: "sendPayment";
|
|
221
|
+
requestPayment: "requestPayment";
|
|
222
|
+
declinePaymentRequest: "declinePaymentRequest";
|
|
223
|
+
cancelPaymentRequest: "cancelPaymentRequest";
|
|
224
|
+
template: "template";
|
|
225
|
+
sticker: "sticker";
|
|
226
|
+
groupInvite: "groupInvite";
|
|
227
|
+
product: "product";
|
|
228
|
+
deviceSent: "deviceSent";
|
|
229
|
+
lists: "lists";
|
|
230
|
+
viewOnce: "viewOnce";
|
|
231
|
+
order: "order";
|
|
232
|
+
ephemeral: "ephemeral";
|
|
233
|
+
invoice: "invoice";
|
|
234
|
+
buttons: "buttons";
|
|
235
|
+
paymentInvite: "paymentInvite";
|
|
236
|
+
interactive: "interactive";
|
|
237
|
+
reaction: "reaction";
|
|
238
|
+
interactiveResponse: "interactiveResponse";
|
|
239
|
+
pollCreation: "pollCreation";
|
|
240
|
+
pollUpdate: "pollUpdate";
|
|
241
|
+
keepInChat: "keepInChat";
|
|
242
|
+
requestPhoneNumber: "requestPhoneNumber";
|
|
243
|
+
scheduledCallCreation: "scheduledCallCreation";
|
|
244
|
+
groupMentioned: "groupMentioned";
|
|
245
|
+
pinInChat: "pinInChat";
|
|
246
|
+
scheduledCallEdit: "scheduledCallEdit";
|
|
247
|
+
ptv: "ptv";
|
|
248
|
+
botInvoke: "botInvoke";
|
|
249
|
+
callLog: "callLog";
|
|
250
|
+
encComment: "encComment";
|
|
251
|
+
bcall: "bcall";
|
|
252
|
+
lottieSticker: "lottieSticker";
|
|
253
|
+
event: "event";
|
|
254
|
+
comment: "comment";
|
|
255
|
+
placeholder: "placeholder";
|
|
256
|
+
encEventUpdate: "encEventUpdate";
|
|
257
|
+
}>;
|
|
201
258
|
declare const ListenerMessagesType: z.ZodObject<{
|
|
202
259
|
channelId: z.ZodString;
|
|
203
260
|
uniqueId: z.ZodString;
|
|
@@ -295,11 +352,66 @@ declare const ListenerMessagesType: z.ZodObject<{
|
|
|
295
352
|
replied: z.ZodNullable<z.ZodObject</*elided*/ any, z.core.$strip>>;
|
|
296
353
|
}, z.core.$strip>;
|
|
297
354
|
|
|
355
|
+
declare const LimiterType: z$1.ZodOptional<z$1.ZodObject<{
|
|
356
|
+
maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
|
|
357
|
+
durationMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
358
|
+
}, z$1.core.$strip>>;
|
|
359
|
+
declare const CitationType: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
|
|
360
|
+
declare const FakeReplyType: z$1.ZodOptional<z$1.ZodObject<{
|
|
361
|
+
provider: z$1.ZodUnion<[z$1.ZodEnum<{
|
|
362
|
+
whatsapp: "whatsapp";
|
|
363
|
+
meta: "meta";
|
|
364
|
+
chatgpt: "chatgpt";
|
|
365
|
+
copilot: "copilot";
|
|
366
|
+
instagram: "instagram";
|
|
367
|
+
tiktok: "tiktok";
|
|
368
|
+
}>, z$1.ZodNumber]>;
|
|
369
|
+
}, z$1.core.$strip>>;
|
|
298
370
|
declare const StickerMetadataType: z$1.ZodOptional<z$1.ZodObject<{
|
|
299
371
|
packageName: z$1.ZodString;
|
|
300
372
|
authorName: z$1.ZodString;
|
|
301
373
|
quality: z$1.ZodNumber;
|
|
302
374
|
}, z$1.core.$strip>>;
|
|
375
|
+
declare const ClientBaseType: z$1.ZodObject<{
|
|
376
|
+
session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
377
|
+
prefix: z$1.ZodOptional<z$1.ZodString>;
|
|
378
|
+
ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
379
|
+
showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
380
|
+
syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
381
|
+
autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
382
|
+
autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
383
|
+
autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
384
|
+
autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
385
|
+
autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
386
|
+
autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
|
|
387
|
+
limiter: z$1.ZodOptional<z$1.ZodObject<{
|
|
388
|
+
maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
|
|
389
|
+
durationMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
390
|
+
}, z$1.core.$strip>>;
|
|
391
|
+
citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
|
|
392
|
+
fakeReply: z$1.ZodOptional<z$1.ZodObject<{
|
|
393
|
+
provider: z$1.ZodUnion<[z$1.ZodEnum<{
|
|
394
|
+
whatsapp: "whatsapp";
|
|
395
|
+
meta: "meta";
|
|
396
|
+
chatgpt: "chatgpt";
|
|
397
|
+
copilot: "copilot";
|
|
398
|
+
instagram: "instagram";
|
|
399
|
+
tiktok: "tiktok";
|
|
400
|
+
}>, z$1.ZodNumber]>;
|
|
401
|
+
}, z$1.core.$strip>>;
|
|
402
|
+
sticker: z$1.ZodOptional<z$1.ZodObject<{
|
|
403
|
+
packageName: z$1.ZodString;
|
|
404
|
+
authorName: z$1.ZodString;
|
|
405
|
+
quality: z$1.ZodNumber;
|
|
406
|
+
}, z$1.core.$strip>>;
|
|
407
|
+
}, z$1.core.$strip>;
|
|
408
|
+
declare const ClientAuthPairingType: z$1.ZodObject<{
|
|
409
|
+
authType: z$1.ZodLiteral<"pairing">;
|
|
410
|
+
phoneNumber: z$1.ZodNumber;
|
|
411
|
+
}, z$1.core.$strip>;
|
|
412
|
+
declare const ClientAuthQRType: z$1.ZodObject<{
|
|
413
|
+
authType: z$1.ZodLiteral<"qr">;
|
|
414
|
+
}, z$1.core.$strip>;
|
|
303
415
|
declare const ClientOptionsType: z$1.ZodUnion<readonly [z$1.ZodObject<{
|
|
304
416
|
authType: z$1.ZodLiteral<"pairing">;
|
|
305
417
|
phoneNumber: z$1.ZodNumber;
|
|
@@ -379,6 +491,121 @@ type EventCallbackType = {
|
|
|
379
491
|
calls: (ctx: z$1.infer<typeof ListenerCallsType>) => void;
|
|
380
492
|
};
|
|
381
493
|
|
|
494
|
+
declare const ButtonInteractiveReplyType: z.ZodObject<{
|
|
495
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
496
|
+
text: z.ZodString;
|
|
497
|
+
}, z.core.$strip>;
|
|
498
|
+
declare const ButtonInteractiveUrlType: z.ZodObject<{
|
|
499
|
+
type: z.ZodLiteral<"cta_url">;
|
|
500
|
+
url: z.ZodURL;
|
|
501
|
+
text: z.ZodString;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
declare const ButtonInteractiveCopyType: z.ZodObject<{
|
|
504
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
505
|
+
copy: z.ZodString;
|
|
506
|
+
text: z.ZodString;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
declare const ButtonInteractiveCallType: z.ZodObject<{
|
|
509
|
+
type: z.ZodLiteral<"cta_call">;
|
|
510
|
+
text: z.ZodString;
|
|
511
|
+
phoneNumber: z.ZodString;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
declare const ButtonInteractiveSingleSelectType: z.ZodObject<{
|
|
514
|
+
type: z.ZodLiteral<"single_select">;
|
|
515
|
+
text: z.ZodString;
|
|
516
|
+
section: z.ZodArray<z.ZodObject<{
|
|
517
|
+
title: z.ZodString;
|
|
518
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
519
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
520
|
+
id: z.ZodString;
|
|
521
|
+
title: z.ZodString;
|
|
522
|
+
header: z.ZodOptional<z.ZodString>;
|
|
523
|
+
description: z.ZodOptional<z.ZodString>;
|
|
524
|
+
}, z.core.$strip>>;
|
|
525
|
+
}, z.core.$strip>>;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
declare const ButtonInteractiveType: z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"interactive">;
|
|
529
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
530
|
+
data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
531
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
532
|
+
text: z.ZodString;
|
|
533
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
534
|
+
type: z.ZodLiteral<"cta_url">;
|
|
535
|
+
url: z.ZodURL;
|
|
536
|
+
text: z.ZodString;
|
|
537
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
538
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
539
|
+
copy: z.ZodString;
|
|
540
|
+
text: z.ZodString;
|
|
541
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
542
|
+
type: z.ZodLiteral<"cta_call">;
|
|
543
|
+
text: z.ZodString;
|
|
544
|
+
phoneNumber: z.ZodString;
|
|
545
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
546
|
+
type: z.ZodLiteral<"single_select">;
|
|
547
|
+
text: z.ZodString;
|
|
548
|
+
section: z.ZodArray<z.ZodObject<{
|
|
549
|
+
title: z.ZodString;
|
|
550
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
551
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
552
|
+
id: z.ZodString;
|
|
553
|
+
title: z.ZodString;
|
|
554
|
+
header: z.ZodOptional<z.ZodString>;
|
|
555
|
+
description: z.ZodOptional<z.ZodString>;
|
|
556
|
+
}, z.core.$strip>>;
|
|
557
|
+
}, z.core.$strip>>;
|
|
558
|
+
}, z.core.$strip>]>>;
|
|
559
|
+
}, z.core.$strip>;
|
|
560
|
+
declare const ButtonSimpleType: z.ZodObject<{
|
|
561
|
+
type: z.ZodLiteral<"simple">;
|
|
562
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
563
|
+
data: z.ZodArray<z.ZodObject<{
|
|
564
|
+
id: z.ZodString;
|
|
565
|
+
text: z.ZodString;
|
|
566
|
+
}, z.core.$strip>>;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
declare const ButtonType: z.ZodUnion<readonly [z.ZodObject<{
|
|
569
|
+
type: z.ZodLiteral<"simple">;
|
|
570
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
571
|
+
data: z.ZodArray<z.ZodObject<{
|
|
572
|
+
id: z.ZodString;
|
|
573
|
+
text: z.ZodString;
|
|
574
|
+
}, z.core.$strip>>;
|
|
575
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
576
|
+
type: z.ZodLiteral<"interactive">;
|
|
577
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
578
|
+
data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
579
|
+
type: z.ZodLiteral<"quick_reply">;
|
|
580
|
+
text: z.ZodString;
|
|
581
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
582
|
+
type: z.ZodLiteral<"cta_url">;
|
|
583
|
+
url: z.ZodURL;
|
|
584
|
+
text: z.ZodString;
|
|
585
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
586
|
+
type: z.ZodLiteral<"cta_copy">;
|
|
587
|
+
copy: z.ZodString;
|
|
588
|
+
text: z.ZodString;
|
|
589
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
590
|
+
type: z.ZodLiteral<"cta_call">;
|
|
591
|
+
text: z.ZodString;
|
|
592
|
+
phoneNumber: z.ZodString;
|
|
593
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
594
|
+
type: z.ZodLiteral<"single_select">;
|
|
595
|
+
text: z.ZodString;
|
|
596
|
+
section: z.ZodArray<z.ZodObject<{
|
|
597
|
+
title: z.ZodString;
|
|
598
|
+
highlight_label: z.ZodOptional<z.ZodString>;
|
|
599
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
600
|
+
id: z.ZodString;
|
|
601
|
+
title: z.ZodString;
|
|
602
|
+
header: z.ZodOptional<z.ZodString>;
|
|
603
|
+
description: z.ZodOptional<z.ZodString>;
|
|
604
|
+
}, z.core.$strip>>;
|
|
605
|
+
}, z.core.$strip>>;
|
|
606
|
+
}, z.core.$strip>]>>;
|
|
607
|
+
}, z.core.$strip>]>;
|
|
608
|
+
|
|
382
609
|
type ParsedMessage = Partial<z.infer<typeof ListenerMessagesType>>;
|
|
383
610
|
type CollectorFilter = (msg: ParsedMessage) => boolean;
|
|
384
611
|
type CollectorCallback = (messages: ParsedMessage[]) => void;
|
|
@@ -785,4 +1012,4 @@ declare class SessionWatchdog {
|
|
|
785
1012
|
declare const createWatchdog: (options: WatchdogOptions) => SessionWatchdog;
|
|
786
1013
|
declare const getWatchdog: () => SessionWatchdog | null;
|
|
787
1014
|
|
|
788
|
-
export { AudioProcessor, type AudioType, Client, DocumentProcessor, ImageProcessor, Lowdb, MediaProcessor, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, SessionWatchdog, StickerProcessor, VideoProcessor, cleanJid, cleanMediaObject, cleanupSocket, createLowdb, createWatchdog, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getExistingSocket, getLatestLibVersion, getMediaThumbnail, getUsersMentions, getVideoDuration, getVideoThumbnail, getWaAudio, getWaDocument, getWaSticker, getWatchdog, ignoreLint, logColor, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, repairSessionKeys, shuffleString, toBuffer, toJson, toString, useAuthState };
|
|
1015
|
+
export { AudioProcessor, type AudioType, ButtonInteractiveCallType, ButtonInteractiveCopyType, ButtonInteractiveReplyType, ButtonInteractiveSingleSelectType, ButtonInteractiveType, ButtonInteractiveUrlType, ButtonSimpleType, ButtonType, CitationType, Client, ClientAuthPairingType, ClientAuthQRType, ClientBaseType, ClientOptionsType, DEVICE_ENUM_TYPES, DocumentProcessor, type EventCallbackType, EventEnumType, FakeReplyType, ImageProcessor, LimiterType, ListenerCallsType, ListenerConnectionType, ListenerMessagesType, Lowdb, MESSAGE_ENUM_TYPES, MediaProcessor, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, SessionWatchdog, StickerMetadataType, StickerProcessor, VideoProcessor, cleanJid, cleanMediaObject, cleanupSocket, createLowdb, createWatchdog, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getExistingSocket, getLatestLibVersion, getMediaThumbnail, getUsersMentions, getVideoDuration, getVideoThumbnail, getWaAudio, getWaDocument, getWaSticker, getWatchdog, ignoreLint, logColor, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, repairSessionKeys, shuffleString, toBuffer, toJson, toString, useAuthState };
|