zaileys 1.1.40-tx.3 → 1.1.40-tx.5

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.
@@ -0,0 +1,255 @@
1
+ import { AuthenticationState } from 'baileys';
2
+ import z, { z as z$1 } from 'zod';
3
+
4
+ declare const useAuthState: (folder: string) => Promise<{
5
+ state: AuthenticationState;
6
+ saveCreds: () => Promise<void>;
7
+ }>;
8
+
9
+ declare const ListenerCallsType: z.ZodObject<{
10
+ callId: z.ZodString;
11
+ roomId: z.ZodString;
12
+ callerId: z.ZodString;
13
+ date: z.ZodDate;
14
+ offline: z.ZodBoolean;
15
+ status: z.ZodEnum<{
16
+ accept: "accept";
17
+ offer: "offer";
18
+ reject: "reject";
19
+ ringing: "ringing";
20
+ terminate: "terminate";
21
+ timeout: "timeout";
22
+ }>;
23
+ isVideo: z.ZodBoolean;
24
+ isGroup: z.ZodBoolean;
25
+ }, z.core.$strip>;
26
+
27
+ declare const ListenerConnectionType: z.ZodObject<{
28
+ status: z.ZodEnum<{
29
+ connecting: "connecting";
30
+ open: "open";
31
+ close: "close";
32
+ reload: "reload";
33
+ syncing: "syncing";
34
+ }>;
35
+ authType: z.ZodEnum<{
36
+ pairing: "pairing";
37
+ qr: "qr";
38
+ }>;
39
+ authTimeout: z.ZodOptional<z.ZodNumber>;
40
+ syncProgress: z.ZodOptional<z.ZodNumber>;
41
+ syncCompleted: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
42
+ qr: z.ZodOptional<z.ZodString>;
43
+ code: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>;
45
+
46
+ declare const ListenerMessagesType: z.ZodObject<{
47
+ channelId: z.ZodString;
48
+ uniqueId: z.ZodString;
49
+ chatId: z.ZodString;
50
+ chatAddress: z.ZodEnum<{
51
+ pn: "pn";
52
+ lid: "lid";
53
+ }>;
54
+ chatType: z.ZodEnum<{
55
+ text: "text";
56
+ image: "image";
57
+ contact: "contact";
58
+ location: "location";
59
+ document: "document";
60
+ audio: "audio";
61
+ video: "video";
62
+ protocol: "protocol";
63
+ contacts: "contacts";
64
+ highlyStructured: "highlyStructured";
65
+ sendPayment: "sendPayment";
66
+ requestPayment: "requestPayment";
67
+ declinePaymentRequest: "declinePaymentRequest";
68
+ cancelPaymentRequest: "cancelPaymentRequest";
69
+ template: "template";
70
+ sticker: "sticker";
71
+ groupInvite: "groupInvite";
72
+ product: "product";
73
+ deviceSent: "deviceSent";
74
+ list: "list";
75
+ viewOnce: "viewOnce";
76
+ order: "order";
77
+ ephemeral: "ephemeral";
78
+ invoice: "invoice";
79
+ buttons: "buttons";
80
+ paymentInvite: "paymentInvite";
81
+ interactive: "interactive";
82
+ reaction: "reaction";
83
+ interactiveResponse: "interactiveResponse";
84
+ pollCreation: "pollCreation";
85
+ pollUpdate: "pollUpdate";
86
+ keepInChat: "keepInChat";
87
+ requestPhoneNumber: "requestPhoneNumber";
88
+ scheduledCallCreation: "scheduledCallCreation";
89
+ groupMentioned: "groupMentioned";
90
+ pinInChat: "pinInChat";
91
+ scheduledCallEdit: "scheduledCallEdit";
92
+ ptv: "ptv";
93
+ botInvoke: "botInvoke";
94
+ callLog: "callLog";
95
+ encComment: "encComment";
96
+ bcall: "bcall";
97
+ lottieSticker: "lottieSticker";
98
+ event: "event";
99
+ comment: "comment";
100
+ placeholder: "placeholder";
101
+ encEventUpdate: "encEventUpdate";
102
+ }>;
103
+ receiverId: z.ZodString;
104
+ receiverName: z.ZodString;
105
+ roomId: z.ZodString;
106
+ roomName: z.ZodString;
107
+ senderLid: z.ZodString;
108
+ senderId: z.ZodString;
109
+ senderName: z.ZodString;
110
+ senderDevice: z.ZodEnum<{
111
+ unknown: "unknown";
112
+ android: "android";
113
+ ios: "ios";
114
+ desktop: "desktop";
115
+ web: "web";
116
+ }>;
117
+ timestamp: z.ZodNumber;
118
+ text: z.ZodNullable<z.ZodString>;
119
+ mentions: z.ZodArray<z.ZodString>;
120
+ links: z.ZodArray<z.ZodString>;
121
+ isPrefix: z.ZodBoolean;
122
+ isSpam: z.ZodBoolean;
123
+ isFromMe: z.ZodBoolean;
124
+ isTagMe: z.ZodBoolean;
125
+ isGroup: z.ZodBoolean;
126
+ isNewsletter: z.ZodBoolean;
127
+ isStory: z.ZodBoolean;
128
+ isViewOnce: z.ZodBoolean;
129
+ isEdited: z.ZodBoolean;
130
+ isDeleted: z.ZodBoolean;
131
+ isPinned: z.ZodBoolean;
132
+ isUnPinned: z.ZodBoolean;
133
+ isBroadcast: z.ZodBoolean;
134
+ isEphemeral: z.ZodBoolean;
135
+ isForwarded: z.ZodBoolean;
136
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
137
+ media: z.ZodNullable<z.ZodObject<{
138
+ buffer: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
139
+ stream: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
140
+ }, z.core.$loose>>;
141
+ message: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>;
142
+ replied: z.ZodNullable<z.ZodObject</*elided*/ any, z.core.$strip>>;
143
+ }, z.core.$strip>;
144
+
145
+ declare const ClientOptionsType: z$1.ZodUnion<readonly [z$1.ZodObject<{
146
+ authType: z$1.ZodLiteral<"pairing">;
147
+ phoneNumber: z$1.ZodNumber;
148
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
149
+ prefix: z$1.ZodOptional<z$1.ZodString>;
150
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
151
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
152
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
153
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
154
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
155
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
156
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
157
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
158
+ }, z$1.core.$strip>, z$1.ZodObject<{
159
+ authType: z$1.ZodLiteral<"qr">;
160
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
161
+ prefix: z$1.ZodOptional<z$1.ZodString>;
162
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
163
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
164
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
165
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
166
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
167
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
168
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
169
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
170
+ }, z$1.core.$strip>]>;
171
+ declare const EventEnumType: z$1.ZodEnum<{
172
+ connection: "connection";
173
+ messages: "messages";
174
+ calls: "calls";
175
+ }>;
176
+ type EventCallbackType = {
177
+ connection: (ctx: z$1.infer<typeof ListenerConnectionType>) => void;
178
+ messages: (ctx: z$1.infer<typeof ListenerMessagesType>) => void;
179
+ calls: (ctx: z$1.infer<typeof ListenerCallsType>) => void;
180
+ };
181
+
182
+ type MiddlewareContextType = {
183
+ messages?: Partial<z.infer<typeof ListenerMessagesType>>;
184
+ calls?: Partial<z.infer<typeof ListenerCallsType>>;
185
+ };
186
+
187
+ type MiddlewareNext = () => Promise<void> | void;
188
+ type MiddlewareHandler<T> = (ctx: MiddlewareContextType, next: MiddlewareNext) => Promise<void> | void;
189
+ declare class Middleware<T> {
190
+ private stack;
191
+ use(handler: MiddlewareHandler<T>): this;
192
+ run(ctx: MiddlewareContextType): Promise<void>;
193
+ }
194
+
195
+ declare class Client {
196
+ options: z.infer<typeof ClientOptionsType>;
197
+ middleware: Middleware<any>;
198
+ constructor(options: z.infer<typeof ClientOptionsType>);
199
+ initialize(): Promise<void>;
200
+ db(path: string): Lowdb;
201
+ on<T extends z.infer<typeof EventEnumType>>(event: T, handler: EventCallbackType[T]): void;
202
+ use<T>(handler: MiddlewareHandler<T>): this;
203
+ }
204
+
205
+ declare const registerAuthCreds: (client: Client) => Promise<void>;
206
+
207
+ type FlushMode = 'manual' | 'sync' | 'debounce';
208
+ declare class Lowdb {
209
+ private data;
210
+ private path;
211
+ private pool;
212
+ private size;
213
+ private chunkDir;
214
+ private replacer;
215
+ private reviver;
216
+ private loaded;
217
+ private flushMode;
218
+ private debounceMs;
219
+ private flushTimer;
220
+ private dirty;
221
+ constructor(path: string, bufferJSON?: any, size?: number, flushMode?: FlushMode, debounceMs?: number);
222
+ private ensureLoaded;
223
+ private scheduleFlush;
224
+ read(): Promise<Map<string, any>>;
225
+ write(): Promise<void>;
226
+ set<T>(key: string, value: T): Promise<void>;
227
+ push<T>(key: string, value: T): Promise<void>;
228
+ get<T>(key: string): Promise<any>;
229
+ delete(key: string): Promise<boolean>;
230
+ private saveChunk;
231
+ private loadChunk;
232
+ private delChunk;
233
+ private isMeta;
234
+ }
235
+ declare const createLowdb: (path: string, options?: {
236
+ BufferJSON?: any;
237
+ size?: number;
238
+ flushMode?: FlushMode;
239
+ debounceMs?: number;
240
+ }) => Lowdb;
241
+
242
+ declare const getLatestLibVersion: () => Promise<any>;
243
+ declare const removeAuthCreds: (session: string) => Promise<void>;
244
+ declare const normalizeText: (text?: string) => string;
245
+
246
+ declare const ignoreLint: (data: any) => any;
247
+ declare const toJson: (object: unknown) => any;
248
+ declare const toString: (object: unknown) => any;
249
+ declare const shuffleString: (str?: string) => any;
250
+ declare const findGlobalWord: (text?: string, word?: string) => any;
251
+ declare const extractUrls: (text?: string) => any;
252
+ declare const randomize: (arr: string[]) => string;
253
+ declare const pickKeysFromArray: (arr: any[], keys: string[]) => any;
254
+
255
+ export { Client, Lowdb, createLowdb, extractUrls, findGlobalWord, getLatestLibVersion, ignoreLint, normalizeText, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, shuffleString, toJson, toString, useAuthState };