zaileys 1.1.29 → 1.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -4,6 +4,124 @@ import { z } from 'zod';
4
4
  import * as stream from 'stream';
5
5
  import { Readable } from 'stream';
6
6
 
7
+ declare const AdapterDatabaseType: z.ZodDefault<z.ZodOptional<z.ZodObject<{
8
+ type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
9
+ connection: z.ZodDefault<z.ZodOptional<z.ZodObject<{
10
+ url: z.ZodDefault<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ url: string;
13
+ }, {
14
+ url?: string | undefined;
15
+ }>>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type: "sqlite" | "postgresql" | "mysql";
18
+ connection: {
19
+ url: string;
20
+ };
21
+ }, {
22
+ type?: "sqlite" | "postgresql" | "mysql" | undefined;
23
+ connection?: {
24
+ url?: string | undefined;
25
+ } | undefined;
26
+ }>>>;
27
+ declare const CitationType: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, number[]>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
28
+ declare const ClientClassesBaseType: z.ZodObject<{
29
+ prefix: z.ZodOptional<z.ZodString>;
30
+ ignoreMe: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
31
+ showLogs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
32
+ autoMentions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
33
+ autoOnline: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
34
+ autoRead: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
35
+ autoPresence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
36
+ autoRejectCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
37
+ loadLLMSchemas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
38
+ webhooks: z.ZodOptional<z.ZodObject<{
39
+ url: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ url: string;
42
+ }, {
43
+ url: string;
44
+ }>>;
45
+ limiter: z.ZodOptional<z.ZodObject<{
46
+ durationMs: z.ZodNumber;
47
+ maxMessages: z.ZodNumber;
48
+ }, "strip", z.ZodTypeAny, {
49
+ durationMs: number;
50
+ maxMessages: number;
51
+ }, {
52
+ durationMs: number;
53
+ maxMessages: number;
54
+ }>>;
55
+ database: z.ZodDefault<z.ZodOptional<z.ZodObject<{
56
+ type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
57
+ connection: z.ZodDefault<z.ZodOptional<z.ZodObject<{
58
+ url: z.ZodDefault<z.ZodString>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ url: string;
61
+ }, {
62
+ url?: string | undefined;
63
+ }>>>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ type: "sqlite" | "postgresql" | "mysql";
66
+ connection: {
67
+ url: string;
68
+ };
69
+ }, {
70
+ type?: "sqlite" | "postgresql" | "mysql" | undefined;
71
+ connection?: {
72
+ url?: string | undefined;
73
+ } | undefined;
74
+ }>>>;
75
+ citation: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, number[]>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ citation: Record<string, number[]>;
78
+ ignoreMe: boolean;
79
+ showLogs: boolean;
80
+ autoMentions: boolean;
81
+ autoOnline: boolean;
82
+ autoRead: boolean;
83
+ autoPresence: boolean;
84
+ autoRejectCall: boolean;
85
+ loadLLMSchemas: boolean;
86
+ database: {
87
+ type: "sqlite" | "postgresql" | "mysql";
88
+ connection: {
89
+ url: string;
90
+ };
91
+ };
92
+ webhooks?: {
93
+ url: string;
94
+ } | undefined;
95
+ prefix?: string | undefined;
96
+ limiter?: {
97
+ durationMs: number;
98
+ maxMessages: number;
99
+ } | undefined;
100
+ }, {
101
+ citation?: Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined;
102
+ webhooks?: {
103
+ url: string;
104
+ } | undefined;
105
+ prefix?: string | undefined;
106
+ ignoreMe?: boolean | undefined;
107
+ showLogs?: boolean | undefined;
108
+ autoMentions?: boolean | undefined;
109
+ autoOnline?: boolean | undefined;
110
+ autoRead?: boolean | undefined;
111
+ autoPresence?: boolean | undefined;
112
+ autoRejectCall?: boolean | undefined;
113
+ loadLLMSchemas?: boolean | undefined;
114
+ limiter?: {
115
+ durationMs: number;
116
+ maxMessages: number;
117
+ } | undefined;
118
+ database?: {
119
+ type?: "sqlite" | "postgresql" | "mysql" | undefined;
120
+ connection?: {
121
+ url?: string | undefined;
122
+ } | undefined;
123
+ } | undefined;
124
+ }>;
7
125
  declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
8
126
  authType: z.ZodLiteral<"pairing">;
9
127
  phoneNumber: z.ZodNumber;
@@ -17,6 +135,23 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
17
135
  autoPresence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
18
136
  autoRejectCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
19
137
  loadLLMSchemas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
138
+ webhooks: z.ZodOptional<z.ZodObject<{
139
+ url: z.ZodString;
140
+ }, "strip", z.ZodTypeAny, {
141
+ url: string;
142
+ }, {
143
+ url: string;
144
+ }>>;
145
+ limiter: z.ZodOptional<z.ZodObject<{
146
+ durationMs: z.ZodNumber;
147
+ maxMessages: z.ZodNumber;
148
+ }, "strip", z.ZodTypeAny, {
149
+ durationMs: number;
150
+ maxMessages: number;
151
+ }, {
152
+ durationMs: number;
153
+ maxMessages: number;
154
+ }>>;
20
155
  database: z.ZodDefault<z.ZodOptional<z.ZodObject<{
21
156
  type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
22
157
  connection: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -56,11 +191,21 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
56
191
  url: string;
57
192
  };
58
193
  };
194
+ webhooks?: {
195
+ url: string;
196
+ } | undefined;
59
197
  prefix?: string | undefined;
198
+ limiter?: {
199
+ durationMs: number;
200
+ maxMessages: number;
201
+ } | undefined;
60
202
  }, {
61
203
  authType: "pairing";
62
204
  phoneNumber: number;
63
205
  citation?: Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined;
206
+ webhooks?: {
207
+ url: string;
208
+ } | undefined;
64
209
  prefix?: string | undefined;
65
210
  ignoreMe?: boolean | undefined;
66
211
  showLogs?: boolean | undefined;
@@ -70,6 +215,10 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
70
215
  autoPresence?: boolean | undefined;
71
216
  autoRejectCall?: boolean | undefined;
72
217
  loadLLMSchemas?: boolean | undefined;
218
+ limiter?: {
219
+ durationMs: number;
220
+ maxMessages: number;
221
+ } | undefined;
73
222
  database?: {
74
223
  type?: "sqlite" | "postgresql" | "mysql" | undefined;
75
224
  connection?: {
@@ -89,6 +238,23 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
89
238
  autoPresence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
90
239
  autoRejectCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
91
240
  loadLLMSchemas: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
241
+ webhooks: z.ZodOptional<z.ZodObject<{
242
+ url: z.ZodString;
243
+ }, "strip", z.ZodTypeAny, {
244
+ url: string;
245
+ }, {
246
+ url: string;
247
+ }>>;
248
+ limiter: z.ZodOptional<z.ZodObject<{
249
+ durationMs: z.ZodNumber;
250
+ maxMessages: z.ZodNumber;
251
+ }, "strip", z.ZodTypeAny, {
252
+ durationMs: number;
253
+ maxMessages: number;
254
+ }, {
255
+ durationMs: number;
256
+ maxMessages: number;
257
+ }>>;
92
258
  database: z.ZodDefault<z.ZodOptional<z.ZodObject<{
93
259
  type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
94
260
  connection: z.ZodDefault<z.ZodOptional<z.ZodObject<{
@@ -127,11 +293,21 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
127
293
  url: string;
128
294
  };
129
295
  };
296
+ webhooks?: {
297
+ url: string;
298
+ } | undefined;
130
299
  phoneNumber?: undefined;
131
300
  prefix?: string | undefined;
301
+ limiter?: {
302
+ durationMs: number;
303
+ maxMessages: number;
304
+ } | undefined;
132
305
  }, {
133
306
  authType: "qr";
134
307
  citation?: Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined;
308
+ webhooks?: {
309
+ url: string;
310
+ } | undefined;
135
311
  phoneNumber?: undefined;
136
312
  prefix?: string | undefined;
137
313
  ignoreMe?: boolean | undefined;
@@ -142,6 +318,10 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
142
318
  autoPresence?: boolean | undefined;
143
319
  autoRejectCall?: boolean | undefined;
144
320
  loadLLMSchemas?: boolean | undefined;
321
+ limiter?: {
322
+ durationMs: number;
323
+ maxMessages: number;
324
+ } | undefined;
145
325
  database?: {
146
326
  type?: "sqlite" | "postgresql" | "mysql" | undefined;
147
327
  connection?: {
@@ -150,6 +330,57 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
150
330
  } | undefined;
151
331
  }>]>;
152
332
 
333
+ declare const WebhooksParserBaseType: z.ZodObject<{
334
+ id: z.ZodString;
335
+ method: z.ZodEnum<["GET", "POST"]>;
336
+ host: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
337
+ referer: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
338
+ date: z.ZodString;
339
+ size: z.ZodUnion<[z.ZodNumber, z.ZodUndefined]>;
340
+ data: z.ZodObject<{
341
+ query: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull]>;
342
+ json: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull]>;
343
+ form: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull]>;
344
+ raw: z.ZodUnion<[z.ZodString, z.ZodNull]>;
345
+ }, "strip", z.ZodTypeAny, {
346
+ query: Record<string, any> | null;
347
+ json: Record<string, any> | null;
348
+ form: Record<string, any> | null;
349
+ raw: string | null;
350
+ }, {
351
+ query: Record<string, any> | null;
352
+ json: Record<string, any> | null;
353
+ form: Record<string, any> | null;
354
+ raw: string | null;
355
+ }>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ id: string;
358
+ date: string;
359
+ method: "GET" | "POST";
360
+ data: {
361
+ query: Record<string, any> | null;
362
+ json: Record<string, any> | null;
363
+ form: Record<string, any> | null;
364
+ raw: string | null;
365
+ };
366
+ host?: string | undefined;
367
+ referer?: string | undefined;
368
+ size?: number | undefined;
369
+ }, {
370
+ id: string;
371
+ date: string;
372
+ method: "GET" | "POST";
373
+ data: {
374
+ query: Record<string, any> | null;
375
+ json: Record<string, any> | null;
376
+ form: Record<string, any> | null;
377
+ raw: string | null;
378
+ };
379
+ host?: string | undefined;
380
+ referer?: string | undefined;
381
+ size?: number | undefined;
382
+ }>;
383
+
153
384
  declare const EventConnectionType: z.ZodObject<{
154
385
  status: z.ZodEnum<["connecting", "open", "close"]>;
155
386
  }, "strip", z.ZodTypeAny, {
@@ -174,6 +405,7 @@ declare const EventMessagesType: z.ZodObject<{
174
405
  text: z.ZodNullable<z.ZodString>;
175
406
  links: z.ZodArray<z.ZodString, "many">;
176
407
  isPrefix: z.ZodBoolean;
408
+ isSpam: z.ZodBoolean;
177
409
  isFromMe: z.ZodBoolean;
178
410
  isTagMe: z.ZodBoolean;
179
411
  isGroup: z.ZodBoolean;
@@ -217,6 +449,7 @@ declare const EventMessagesType: z.ZodObject<{
217
449
  text: z.ZodNullable<z.ZodString>;
218
450
  links: z.ZodArray<z.ZodString, "many">;
219
451
  isPrefix: z.ZodBoolean;
452
+ isSpam: z.ZodBoolean;
220
453
  isFromMe: z.ZodBoolean;
221
454
  isTagMe: z.ZodBoolean;
222
455
  isGroup: z.ZodBoolean;
@@ -261,6 +494,7 @@ declare const EventMessagesType: z.ZodObject<{
261
494
  mentions: string[];
262
495
  links: string[];
263
496
  isPrefix: boolean;
497
+ isSpam: boolean;
264
498
  isFromMe: boolean;
265
499
  isTagMe: boolean;
266
500
  isStory: boolean;
@@ -297,6 +531,7 @@ declare const EventMessagesType: z.ZodObject<{
297
531
  mentions: string[];
298
532
  links: string[];
299
533
  isPrefix: boolean;
534
+ isSpam: boolean;
300
535
  isFromMe: boolean;
301
536
  isTagMe: boolean;
302
537
  isStory: boolean;
@@ -334,6 +569,7 @@ declare const EventMessagesType: z.ZodObject<{
334
569
  mentions: string[];
335
570
  links: string[];
336
571
  isPrefix: boolean;
572
+ isSpam: boolean;
337
573
  isFromMe: boolean;
338
574
  isTagMe: boolean;
339
575
  isStory: boolean;
@@ -370,6 +606,7 @@ declare const EventMessagesType: z.ZodObject<{
370
606
  mentions: string[];
371
607
  links: string[];
372
608
  isPrefix: boolean;
609
+ isSpam: boolean;
373
610
  isFromMe: boolean;
374
611
  isTagMe: boolean;
375
612
  isStory: boolean;
@@ -407,6 +644,7 @@ declare const EventMessagesType: z.ZodObject<{
407
644
  mentions: string[];
408
645
  links: string[];
409
646
  isPrefix: boolean;
647
+ isSpam: boolean;
410
648
  isFromMe: boolean;
411
649
  isTagMe: boolean;
412
650
  isStory: boolean;
@@ -443,6 +681,7 @@ declare const EventMessagesType: z.ZodObject<{
443
681
  mentions: string[];
444
682
  links: string[];
445
683
  isPrefix: boolean;
684
+ isSpam: boolean;
446
685
  isFromMe: boolean;
447
686
  isTagMe: boolean;
448
687
  isStory: boolean;
@@ -490,130 +729,449 @@ declare const EventCallType: z.ZodObject<{
490
729
  isVideo: boolean;
491
730
  isGroup: boolean;
492
731
  }>;
493
- declare const EventEnumType: z.ZodEnum<["connection", "messages", "calls"]>;
732
+ declare const EventEnumType: z.ZodEnum<["connection", "messages", "calls", "webhooks"]>;
494
733
  type EventEnumType = z.infer<typeof EventEnumType>;
495
734
  type EventCallbackType = {
496
735
  connection: (ctx: z.infer<typeof EventConnectionType>) => void;
497
736
  messages: (ctx: z.infer<typeof EventMessagesType>) => void;
498
737
  calls: (ctx: z.infer<typeof EventCallType>) => void;
738
+ webhooks: (ctx: z.infer<typeof WebhooksParserBaseType>) => void;
499
739
  };
500
740
 
501
- declare const llmMessagesTable: z.ZodObject<{
741
+ declare const chatsGetMessage: z.ZodObject<{
742
+ chatId: z.ZodString;
502
743
  channelId: z.ZodString;
503
744
  uniqueId: z.ZodString;
504
- model: z.ZodNullable<z.ZodOptional<z.ZodString>>;
505
- role: z.ZodString;
506
- content: z.ZodString;
507
- additional: z.ZodNullable<z.ZodOptional<z.ZodString>>;
508
- }, "strip", z.ZodTypeAny, {
509
- channelId: string;
510
- uniqueId: string;
511
- role: string;
512
- content: string;
513
- model?: string | null | undefined;
514
- additional?: string | null | undefined;
515
- }, {
516
- channelId: string;
517
- uniqueId: string;
518
- role: string;
519
- content: string;
520
- model?: string | null | undefined;
521
- additional?: string | null | undefined;
522
- }>;
523
- declare const llmPersonalizationTable: z.ZodObject<{
524
- uniqueId: z.ZodString;
745
+ receiverId: z.ZodString;
746
+ receiverName: z.ZodString;
747
+ roomId: z.ZodString;
748
+ roomName: z.ZodString;
525
749
  senderId: z.ZodString;
526
- content: z.ZodString;
527
- }, "strip", z.ZodTypeAny, {
528
- uniqueId: string;
529
- content: string;
530
- senderId: string;
531
- }, {
532
- uniqueId: string;
533
- content: string;
534
- senderId: string;
535
- }>;
536
- declare const llmRAGTable: z.ZodObject<{
537
- metadata: z.ZodDefault<z.ZodObject<{
538
- id: z.ZodDefault<z.ZodString>;
539
- }, "strip", z.ZodTypeAny, {
540
- id: string;
541
- }, {
542
- id?: string | undefined;
543
- }>>;
544
- pageContent: z.ZodString;
545
- }, "strip", z.ZodTypeAny, {
546
- metadata: {
547
- id: string;
548
- };
549
- pageContent: string;
550
- }, {
551
- pageContent: string;
552
- metadata?: {
553
- id?: string | undefined;
554
- } | undefined;
555
- }>;
556
- declare const addRAGType: z.ZodObject<Pick<{
557
- metadata: z.ZodDefault<z.ZodObject<{
558
- id: z.ZodDefault<z.ZodString>;
750
+ senderName: z.ZodString;
751
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
752
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
753
+ timestamp: z.ZodNumber;
754
+ mentions: z.ZodArray<z.ZodString, "many">;
755
+ text: z.ZodNullable<z.ZodString>;
756
+ links: z.ZodArray<z.ZodString, "many">;
757
+ isPrefix: z.ZodBoolean;
758
+ isSpam: z.ZodBoolean;
759
+ isFromMe: z.ZodBoolean;
760
+ isTagMe: z.ZodBoolean;
761
+ isGroup: z.ZodBoolean;
762
+ isStory: z.ZodBoolean;
763
+ isViewOnce: z.ZodBoolean;
764
+ isEdited: z.ZodBoolean;
765
+ isDeleted: z.ZodBoolean;
766
+ isPinned: z.ZodBoolean;
767
+ isUnPinned: z.ZodBoolean;
768
+ isChannel: z.ZodBoolean;
769
+ isBroadcast: z.ZodBoolean;
770
+ isEphemeral: z.ZodBoolean;
771
+ isForwarded: z.ZodBoolean;
772
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
773
+ media: z.ZodNullable<z.ZodObject<{
774
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
775
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
776
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
777
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
778
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
779
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
780
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
781
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
782
+ }, z.ZodTypeAny, "passthrough">>>;
783
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
784
+ } & {
785
+ replied: z.ZodNullable<z.ZodObject<{
786
+ chatId: z.ZodString;
787
+ channelId: z.ZodString;
788
+ uniqueId: z.ZodString;
789
+ receiverId: z.ZodString;
790
+ receiverName: z.ZodString;
791
+ roomId: z.ZodString;
792
+ roomName: z.ZodString;
793
+ senderId: z.ZodString;
794
+ senderName: z.ZodString;
795
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
796
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
797
+ timestamp: z.ZodNumber;
798
+ mentions: z.ZodArray<z.ZodString, "many">;
799
+ text: z.ZodNullable<z.ZodString>;
800
+ links: z.ZodArray<z.ZodString, "many">;
801
+ isPrefix: z.ZodBoolean;
802
+ isSpam: z.ZodBoolean;
803
+ isFromMe: z.ZodBoolean;
804
+ isTagMe: z.ZodBoolean;
805
+ isGroup: z.ZodBoolean;
806
+ isStory: z.ZodBoolean;
807
+ isViewOnce: z.ZodBoolean;
808
+ isEdited: z.ZodBoolean;
809
+ isDeleted: z.ZodBoolean;
810
+ isPinned: z.ZodBoolean;
811
+ isUnPinned: z.ZodBoolean;
812
+ isChannel: z.ZodBoolean;
813
+ isBroadcast: z.ZodBoolean;
814
+ isEphemeral: z.ZodBoolean;
815
+ isForwarded: z.ZodBoolean;
816
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
817
+ media: z.ZodNullable<z.ZodObject<{
818
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
819
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
820
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
821
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
822
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
823
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
824
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
825
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
826
+ }, z.ZodTypeAny, "passthrough">>>;
827
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
559
828
  }, "strip", z.ZodTypeAny, {
560
- id: string;
561
- }, {
562
- id?: string | undefined;
563
- }>>;
564
- pageContent: z.ZodString;
565
- }, "pageContent">, "strip", z.ZodTypeAny, {
566
- pageContent: string;
829
+ channelId: string;
830
+ uniqueId: string;
831
+ message: (...args: unknown[]) => Record<string, any>;
832
+ senderId: string;
833
+ roomId: string;
834
+ isGroup: boolean;
835
+ text: string | null;
836
+ chatId: string;
837
+ receiverId: string;
838
+ receiverName: string;
839
+ roomName: string;
840
+ senderName: string;
841
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
842
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
843
+ timestamp: number;
844
+ mentions: string[];
845
+ links: string[];
846
+ isPrefix: boolean;
847
+ isSpam: boolean;
848
+ isFromMe: boolean;
849
+ isTagMe: boolean;
850
+ isStory: boolean;
851
+ isViewOnce: boolean;
852
+ isEdited: boolean;
853
+ isDeleted: boolean;
854
+ isPinned: boolean;
855
+ isUnPinned: boolean;
856
+ isChannel: boolean;
857
+ isBroadcast: boolean;
858
+ isEphemeral: boolean;
859
+ isForwarded: boolean;
860
+ citation: Record<string, boolean> | null;
861
+ media: z.objectOutputType<{
862
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
863
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
864
+ }, z.ZodTypeAny, "passthrough"> | null;
865
+ }, {
866
+ channelId: string;
867
+ uniqueId: string;
868
+ message: (...args: unknown[]) => Record<string, any>;
869
+ senderId: string;
870
+ roomId: string;
871
+ isGroup: boolean;
872
+ text: string | null;
873
+ chatId: string;
874
+ receiverId: string;
875
+ receiverName: string;
876
+ roomName: string;
877
+ senderName: string;
878
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
879
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
880
+ timestamp: number;
881
+ mentions: string[];
882
+ links: string[];
883
+ isPrefix: boolean;
884
+ isSpam: boolean;
885
+ isFromMe: boolean;
886
+ isTagMe: boolean;
887
+ isStory: boolean;
888
+ isViewOnce: boolean;
889
+ isEdited: boolean;
890
+ isDeleted: boolean;
891
+ isPinned: boolean;
892
+ isUnPinned: boolean;
893
+ isChannel: boolean;
894
+ isBroadcast: boolean;
895
+ isEphemeral: boolean;
896
+ isForwarded: boolean;
897
+ citation: Record<string, boolean> | null;
898
+ media: z.objectInputType<{
899
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
900
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
901
+ }, z.ZodTypeAny, "passthrough"> | null;
902
+ }>>;
903
+ }, "strip", z.ZodTypeAny, {
904
+ channelId: string;
905
+ uniqueId: string;
906
+ message: (...args: unknown[]) => Record<string, any>;
907
+ senderId: string;
908
+ roomId: string;
909
+ isGroup: boolean;
910
+ text: string | null;
911
+ chatId: string;
912
+ receiverId: string;
913
+ receiverName: string;
914
+ roomName: string;
915
+ senderName: string;
916
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
917
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
918
+ timestamp: number;
919
+ mentions: string[];
920
+ links: string[];
921
+ isPrefix: boolean;
922
+ isSpam: boolean;
923
+ isFromMe: boolean;
924
+ isTagMe: boolean;
925
+ isStory: boolean;
926
+ isViewOnce: boolean;
927
+ isEdited: boolean;
928
+ isDeleted: boolean;
929
+ isPinned: boolean;
930
+ isUnPinned: boolean;
931
+ isChannel: boolean;
932
+ isBroadcast: boolean;
933
+ isEphemeral: boolean;
934
+ isForwarded: boolean;
935
+ citation: Record<string, boolean> | null;
936
+ media: z.objectOutputType<{
937
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
938
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
939
+ }, z.ZodTypeAny, "passthrough"> | null;
940
+ replied: {
941
+ channelId: string;
942
+ uniqueId: string;
943
+ message: (...args: unknown[]) => Record<string, any>;
944
+ senderId: string;
945
+ roomId: string;
946
+ isGroup: boolean;
947
+ text: string | null;
948
+ chatId: string;
949
+ receiverId: string;
950
+ receiverName: string;
951
+ roomName: string;
952
+ senderName: string;
953
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
954
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
955
+ timestamp: number;
956
+ mentions: string[];
957
+ links: string[];
958
+ isPrefix: boolean;
959
+ isSpam: boolean;
960
+ isFromMe: boolean;
961
+ isTagMe: boolean;
962
+ isStory: boolean;
963
+ isViewOnce: boolean;
964
+ isEdited: boolean;
965
+ isDeleted: boolean;
966
+ isPinned: boolean;
967
+ isUnPinned: boolean;
968
+ isChannel: boolean;
969
+ isBroadcast: boolean;
970
+ isEphemeral: boolean;
971
+ isForwarded: boolean;
972
+ citation: Record<string, boolean> | null;
973
+ media: z.objectOutputType<{
974
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
975
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
976
+ }, z.ZodTypeAny, "passthrough"> | null;
977
+ } | null;
567
978
  }, {
568
- pageContent: string;
979
+ channelId: string;
980
+ uniqueId: string;
981
+ message: (...args: unknown[]) => Record<string, any>;
982
+ senderId: string;
983
+ roomId: string;
984
+ isGroup: boolean;
985
+ text: string | null;
986
+ chatId: string;
987
+ receiverId: string;
988
+ receiverName: string;
989
+ roomName: string;
990
+ senderName: string;
991
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
992
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
993
+ timestamp: number;
994
+ mentions: string[];
995
+ links: string[];
996
+ isPrefix: boolean;
997
+ isSpam: boolean;
998
+ isFromMe: boolean;
999
+ isTagMe: boolean;
1000
+ isStory: boolean;
1001
+ isViewOnce: boolean;
1002
+ isEdited: boolean;
1003
+ isDeleted: boolean;
1004
+ isPinned: boolean;
1005
+ isUnPinned: boolean;
1006
+ isChannel: boolean;
1007
+ isBroadcast: boolean;
1008
+ isEphemeral: boolean;
1009
+ isForwarded: boolean;
1010
+ citation: Record<string, boolean> | null;
1011
+ media: z.objectInputType<{
1012
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1013
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1014
+ }, z.ZodTypeAny, "passthrough"> | null;
1015
+ replied: {
1016
+ channelId: string;
1017
+ uniqueId: string;
1018
+ message: (...args: unknown[]) => Record<string, any>;
1019
+ senderId: string;
1020
+ roomId: string;
1021
+ isGroup: boolean;
1022
+ text: string | null;
1023
+ chatId: string;
1024
+ receiverId: string;
1025
+ receiverName: string;
1026
+ roomName: string;
1027
+ senderName: string;
1028
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1029
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1030
+ timestamp: number;
1031
+ mentions: string[];
1032
+ links: string[];
1033
+ isPrefix: boolean;
1034
+ isSpam: boolean;
1035
+ isFromMe: boolean;
1036
+ isTagMe: boolean;
1037
+ isStory: boolean;
1038
+ isViewOnce: boolean;
1039
+ isEdited: boolean;
1040
+ isDeleted: boolean;
1041
+ isPinned: boolean;
1042
+ isUnPinned: boolean;
1043
+ isChannel: boolean;
1044
+ isBroadcast: boolean;
1045
+ isEphemeral: boolean;
1046
+ isForwarded: boolean;
1047
+ citation: Record<string, boolean> | null;
1048
+ media: z.objectInputType<{
1049
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1050
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1051
+ }, z.ZodTypeAny, "passthrough"> | null;
1052
+ } | null;
569
1053
  }>;
570
- type llmsAdapter = {
571
- addCompletion: (props: z.infer<typeof llmMessagesTable>) => Promise<z.infer<typeof llmMessagesTable>>;
572
- deleteCompletion: (uniqueId: string) => Promise<boolean>;
573
- updateCompletion: (uniqueId: string, props: Partial<z.infer<typeof llmMessagesTable>>) => Promise<z.infer<typeof llmMessagesTable>>;
574
- clearCompletions: (channelId: string) => Promise<boolean>;
575
- getCompletion: (uniqueId: string) => Promise<z.infer<typeof llmMessagesTable> | null>;
576
- getCompletions: (channelId: string) => Promise<z.infer<typeof llmMessagesTable>[]>;
577
- addPersonalization: (props: z.infer<typeof llmPersonalizationTable>) => Promise<z.infer<typeof llmPersonalizationTable>>;
578
- deletePersonalization: (uniqueId: string) => Promise<boolean>;
579
- clearPersonalization: (senderId: string) => Promise<boolean>;
580
- getPersonalization: (senderId: string) => Promise<z.infer<typeof llmPersonalizationTable>[]>;
581
- addRAG: (props: z.infer<typeof addRAGType>) => Promise<z.infer<typeof llmRAGTable>>;
582
- deleteRAG: (id: string) => Promise<boolean>;
583
- updateRAG: (id: string) => Promise<z.infer<typeof llmRAGTable>>;
584
- clearRAGs: () => Promise<boolean>;
585
- getRAG: (id: string) => Promise<z.infer<typeof llmRAGTable> | null>;
586
- getRAGs: (keyword: string) => Promise<z.infer<typeof llmRAGTable>[]>;
1054
+ type chatsAdapter = {
1055
+ getMessage: (chatId: string) => Promise<z.infer<typeof chatsGetMessage> | null>;
587
1056
  };
588
1057
 
589
- declare const TextWorkerBaseType: z.ZodUnion<[z.ZodString, z.ZodObject<{
590
- image: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
591
- text: z.ZodOptional<z.ZodString>;
1058
+ declare const llmMessagesTable: z.ZodObject<{
1059
+ channelId: z.ZodString;
1060
+ uniqueId: z.ZodString;
1061
+ model: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1062
+ role: z.ZodString;
1063
+ content: z.ZodString;
1064
+ additional: z.ZodNullable<z.ZodOptional<z.ZodString>>;
592
1065
  }, "strip", z.ZodTypeAny, {
593
- image: string | Buffer<ArrayBufferLike> | Readable;
594
- text?: string | undefined;
1066
+ channelId: string;
1067
+ uniqueId: string;
1068
+ role: string;
1069
+ content: string;
1070
+ model?: string | null | undefined;
1071
+ additional?: string | null | undefined;
595
1072
  }, {
596
- image: string | Buffer<ArrayBufferLike> | Readable;
597
- text?: string | undefined;
1073
+ channelId: string;
1074
+ uniqueId: string;
1075
+ role: string;
1076
+ content: string;
1077
+ model?: string | null | undefined;
1078
+ additional?: string | null | undefined;
1079
+ }>;
1080
+ declare const llmPersonalizationTable: z.ZodObject<{
1081
+ uniqueId: z.ZodString;
1082
+ senderId: z.ZodString;
1083
+ content: z.ZodString;
1084
+ }, "strip", z.ZodTypeAny, {
1085
+ uniqueId: string;
1086
+ content: string;
1087
+ senderId: string;
1088
+ }, {
1089
+ uniqueId: string;
1090
+ content: string;
1091
+ senderId: string;
1092
+ }>;
1093
+ declare const llmRAGTable: z.ZodObject<{
1094
+ metadata: z.ZodDefault<z.ZodObject<{
1095
+ id: z.ZodDefault<z.ZodString>;
1096
+ }, "strip", z.ZodTypeAny, {
1097
+ id: string;
1098
+ }, {
1099
+ id?: string | undefined;
1100
+ }>>;
1101
+ pageContent: z.ZodString;
1102
+ }, "strip", z.ZodTypeAny, {
1103
+ metadata: {
1104
+ id: string;
1105
+ };
1106
+ pageContent: string;
1107
+ }, {
1108
+ pageContent: string;
1109
+ metadata?: {
1110
+ id?: string | undefined;
1111
+ } | undefined;
1112
+ }>;
1113
+ declare const addRAGType: z.ZodObject<Pick<{
1114
+ metadata: z.ZodDefault<z.ZodObject<{
1115
+ id: z.ZodDefault<z.ZodString>;
1116
+ }, "strip", z.ZodTypeAny, {
1117
+ id: string;
1118
+ }, {
1119
+ id?: string | undefined;
1120
+ }>>;
1121
+ pageContent: z.ZodString;
1122
+ }, "pageContent">, "strip", z.ZodTypeAny, {
1123
+ pageContent: string;
1124
+ }, {
1125
+ pageContent: string;
1126
+ }>;
1127
+ type llmsAdapter = {
1128
+ addCompletion: (props: z.infer<typeof llmMessagesTable>) => Promise<z.infer<typeof llmMessagesTable>>;
1129
+ deleteCompletion: (uniqueId: string) => Promise<boolean>;
1130
+ updateCompletion: (uniqueId: string, props: Partial<z.infer<typeof llmMessagesTable>>) => Promise<z.infer<typeof llmMessagesTable>>;
1131
+ clearCompletions: (channelId: string) => Promise<boolean>;
1132
+ getCompletion: (uniqueId: string) => Promise<z.infer<typeof llmMessagesTable> | null>;
1133
+ getCompletions: (channelId: string) => Promise<z.infer<typeof llmMessagesTable>[]>;
1134
+ addPersonalization: (props: z.infer<typeof llmPersonalizationTable>) => Promise<z.infer<typeof llmPersonalizationTable>>;
1135
+ deletePersonalization: (uniqueId: string) => Promise<boolean>;
1136
+ clearPersonalization: (senderId: string) => Promise<boolean>;
1137
+ getPersonalization: (senderId: string) => Promise<z.infer<typeof llmPersonalizationTable>[]>;
1138
+ addRAG: (props: z.infer<typeof addRAGType>) => Promise<z.infer<typeof llmRAGTable>>;
1139
+ deleteRAG: (id: string) => Promise<boolean>;
1140
+ updateRAG: (id: string) => Promise<z.infer<typeof llmRAGTable>>;
1141
+ clearRAGs: () => Promise<boolean>;
1142
+ getRAG: (id: string) => Promise<z.infer<typeof llmRAGTable> | null>;
1143
+ getRAGs: (keyword: string) => Promise<z.infer<typeof llmRAGTable>[]>;
1144
+ };
1145
+
1146
+ declare const MediaInputWorkerType: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
1147
+ declare const TextWorkerBaseType: z.ZodUnion<[z.ZodString, z.ZodObject<{
1148
+ image: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
1149
+ text: z.ZodOptional<z.ZodString>;
1150
+ }, "strict", z.ZodTypeAny, {
1151
+ image: string | Buffer<ArrayBufferLike> | Readable;
1152
+ text?: string | undefined;
1153
+ }, {
1154
+ image: string | Buffer<ArrayBufferLike> | Readable;
1155
+ text?: string | undefined;
598
1156
  }>, z.ZodObject<{
599
1157
  video: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
600
1158
  text: z.ZodOptional<z.ZodString>;
601
- }, "strip", z.ZodTypeAny, {
1159
+ }, "strict", z.ZodTypeAny, {
602
1160
  video: string | Buffer<ArrayBufferLike> | Readable;
603
1161
  text?: string | undefined;
604
1162
  }, {
605
1163
  video: string | Buffer<ArrayBufferLike> | Readable;
606
1164
  text?: string | undefined;
607
1165
  }>, z.ZodObject<{
608
- videoNote: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
609
- }, "strip", z.ZodTypeAny, {
610
- videoNote: string | Buffer<ArrayBufferLike> | Readable;
1166
+ note: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
1167
+ }, "strict", z.ZodTypeAny, {
1168
+ note: string | Buffer<ArrayBufferLike> | Readable;
611
1169
  }, {
612
- videoNote: string | Buffer<ArrayBufferLike> | Readable;
1170
+ note: string | Buffer<ArrayBufferLike> | Readable;
613
1171
  }>, z.ZodObject<{
614
1172
  gif: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
615
1173
  text: z.ZodOptional<z.ZodString>;
616
- }, "strip", z.ZodTypeAny, {
1174
+ }, "strict", z.ZodTypeAny, {
617
1175
  gif: string | Buffer<ArrayBufferLike> | Readable;
618
1176
  text?: string | undefined;
619
1177
  }, {
@@ -621,19 +1179,19 @@ declare const TextWorkerBaseType: z.ZodUnion<[z.ZodString, z.ZodObject<{
621
1179
  text?: string | undefined;
622
1180
  }>, z.ZodObject<{
623
1181
  audio: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
624
- }, "strip", z.ZodTypeAny, {
1182
+ }, "strict", z.ZodTypeAny, {
625
1183
  audio: string | Buffer<ArrayBufferLike> | Readable;
626
1184
  }, {
627
1185
  audio: string | Buffer<ArrayBufferLike> | Readable;
628
1186
  }>, z.ZodObject<{
629
- audioNote: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
630
- }, "strip", z.ZodTypeAny, {
631
- audioNote: string | Buffer<ArrayBufferLike> | Readable;
1187
+ voice: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
1188
+ }, "strict", z.ZodTypeAny, {
1189
+ voice: string | Buffer<ArrayBufferLike> | Readable;
632
1190
  }, {
633
- audioNote: string | Buffer<ArrayBufferLike> | Readable;
1191
+ voice: string | Buffer<ArrayBufferLike> | Readable;
634
1192
  }>, z.ZodObject<{
635
1193
  sticker: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
636
- }, "strip", z.ZodTypeAny, {
1194
+ }, "strict", z.ZodTypeAny, {
637
1195
  sticker: string | Buffer<ArrayBufferLike> | Readable;
638
1196
  }, {
639
1197
  sticker: string | Buffer<ArrayBufferLike> | Readable;
@@ -642,18 +1200,21 @@ declare const TextWorkerOptionsType: z.ZodObject<{
642
1200
  roomId: z.ZodString;
643
1201
  asForwarded: z.ZodOptional<z.ZodBoolean>;
644
1202
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1203
+ asAI: z.ZodOptional<z.ZodBoolean>;
645
1204
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
646
1205
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
647
1206
  }, "strip", z.ZodTypeAny, {
648
1207
  roomId: string;
649
1208
  asForwarded?: boolean | undefined;
650
1209
  asViewOnce?: boolean | undefined;
1210
+ asAI?: boolean | undefined;
651
1211
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
652
1212
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
653
1213
  }, {
654
1214
  roomId: string;
655
1215
  asForwarded?: boolean | undefined;
656
1216
  asViewOnce?: boolean | undefined;
1217
+ asAI?: boolean | undefined;
657
1218
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
658
1219
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
659
1220
  }>;
@@ -661,18 +1222,21 @@ declare const LocationWorkerOptionsType: z.ZodObject<{
661
1222
  roomId: z.ZodString;
662
1223
  asForwarded: z.ZodOptional<z.ZodBoolean>;
663
1224
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1225
+ asAI: z.ZodOptional<z.ZodBoolean>;
664
1226
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
665
1227
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
666
1228
  }, "strip", z.ZodTypeAny, {
667
1229
  roomId: string;
668
1230
  asForwarded?: boolean | undefined;
669
1231
  asViewOnce?: boolean | undefined;
1232
+ asAI?: boolean | undefined;
670
1233
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
671
1234
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
672
1235
  }, {
673
1236
  roomId: string;
674
1237
  asForwarded?: boolean | undefined;
675
1238
  asViewOnce?: boolean | undefined;
1239
+ asAI?: boolean | undefined;
676
1240
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
677
1241
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
678
1242
  }>;
@@ -696,18 +1260,21 @@ declare const ContactWorkerOptionsType: z.ZodObject<{
696
1260
  roomId: z.ZodString;
697
1261
  asForwarded: z.ZodOptional<z.ZodBoolean>;
698
1262
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1263
+ asAI: z.ZodOptional<z.ZodBoolean>;
699
1264
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
700
1265
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
701
1266
  }, "strip", z.ZodTypeAny, {
702
1267
  roomId: string;
703
1268
  asForwarded?: boolean | undefined;
704
1269
  asViewOnce?: boolean | undefined;
1270
+ asAI?: boolean | undefined;
705
1271
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
706
1272
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
707
1273
  }, {
708
1274
  roomId: string;
709
1275
  asForwarded?: boolean | undefined;
710
1276
  asViewOnce?: boolean | undefined;
1277
+ asAI?: boolean | undefined;
711
1278
  verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
712
1279
  quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
713
1280
  }>;
@@ -780,6 +1347,7 @@ declare const PollWorkerOptionsType: z.ZodObject<Pick<{
780
1347
  roomId: z.ZodString;
781
1348
  asForwarded: z.ZodOptional<z.ZodBoolean>;
782
1349
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1350
+ asAI: z.ZodOptional<z.ZodBoolean>;
783
1351
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
784
1352
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
785
1353
  }, "roomId">, "strip", z.ZodTypeAny, {
@@ -829,6 +1397,7 @@ declare const MuteWorkerOptionsType: z.ZodObject<Pick<{
829
1397
  roomId: z.ZodString;
830
1398
  asForwarded: z.ZodOptional<z.ZodBoolean>;
831
1399
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1400
+ asAI: z.ZodOptional<z.ZodBoolean>;
832
1401
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
833
1402
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
834
1403
  }, "roomId">, "strip", z.ZodTypeAny, {
@@ -936,6 +1505,7 @@ declare const PresenceWorkerOptionsType: z.ZodObject<Pick<{
936
1505
  roomId: z.ZodString;
937
1506
  asForwarded: z.ZodOptional<z.ZodBoolean>;
938
1507
  asViewOnce: z.ZodOptional<z.ZodBoolean>;
1508
+ asAI: z.ZodOptional<z.ZodBoolean>;
939
1509
  verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
940
1510
  quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
941
1511
  }, "roomId">, "strip", z.ZodTypeAny, {
@@ -955,7 +1525,311 @@ declare class Worker {
955
1525
  socket: Client["socket"];
956
1526
  });
957
1527
  private sendMessage;
958
- text(text: z.infer<typeof TextWorkerBaseType>, options: z.infer<typeof TextWorkerOptionsType>): Promise<{
1528
+ text(input: z.infer<typeof TextWorkerBaseType>, options: z.infer<typeof TextWorkerOptionsType>): Promise<{
1529
+ channelId: string;
1530
+ uniqueId: string;
1531
+ message: (...args: unknown[]) => Record<string, any>;
1532
+ senderId: string;
1533
+ roomId: string;
1534
+ isGroup: boolean;
1535
+ text: string | null;
1536
+ chatId: string;
1537
+ receiverId: string;
1538
+ receiverName: string;
1539
+ roomName: string;
1540
+ senderName: string;
1541
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1542
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1543
+ timestamp: number;
1544
+ mentions: string[];
1545
+ links: string[];
1546
+ isPrefix: boolean;
1547
+ isSpam: boolean;
1548
+ isFromMe: boolean;
1549
+ isTagMe: boolean;
1550
+ isStory: boolean;
1551
+ isViewOnce: boolean;
1552
+ isEdited: boolean;
1553
+ isDeleted: boolean;
1554
+ isPinned: boolean;
1555
+ isUnPinned: boolean;
1556
+ isChannel: boolean;
1557
+ isBroadcast: boolean;
1558
+ isEphemeral: boolean;
1559
+ isForwarded: boolean;
1560
+ citation: Record<string, boolean> | null;
1561
+ media: z.objectOutputType<{
1562
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1563
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1564
+ }, z.ZodTypeAny, "passthrough"> | null;
1565
+ replied: {
1566
+ channelId: string;
1567
+ uniqueId: string;
1568
+ message: (...args: unknown[]) => Record<string, any>;
1569
+ senderId: string;
1570
+ roomId: string;
1571
+ isGroup: boolean;
1572
+ text: string | null;
1573
+ chatId: string;
1574
+ receiverId: string;
1575
+ receiverName: string;
1576
+ roomName: string;
1577
+ senderName: string;
1578
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1579
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1580
+ timestamp: number;
1581
+ mentions: string[];
1582
+ links: string[];
1583
+ isPrefix: boolean;
1584
+ isSpam: boolean;
1585
+ isFromMe: boolean;
1586
+ isTagMe: boolean;
1587
+ isStory: boolean;
1588
+ isViewOnce: boolean;
1589
+ isEdited: boolean;
1590
+ isDeleted: boolean;
1591
+ isPinned: boolean;
1592
+ isUnPinned: boolean;
1593
+ isChannel: boolean;
1594
+ isBroadcast: boolean;
1595
+ isEphemeral: boolean;
1596
+ isForwarded: boolean;
1597
+ citation: Record<string, boolean> | null;
1598
+ media: z.objectOutputType<{
1599
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1600
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1601
+ }, z.ZodTypeAny, "passthrough"> | null;
1602
+ } | null;
1603
+ } | null>;
1604
+ location(loc: z.infer<typeof LocationWorkerBaseType>, options: z.infer<typeof LocationWorkerOptionsType>): Promise<{
1605
+ channelId: string;
1606
+ uniqueId: string;
1607
+ message: (...args: unknown[]) => Record<string, any>;
1608
+ senderId: string;
1609
+ roomId: string;
1610
+ isGroup: boolean;
1611
+ text: string | null;
1612
+ chatId: string;
1613
+ receiverId: string;
1614
+ receiverName: string;
1615
+ roomName: string;
1616
+ senderName: string;
1617
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1618
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1619
+ timestamp: number;
1620
+ mentions: string[];
1621
+ links: string[];
1622
+ isPrefix: boolean;
1623
+ isSpam: boolean;
1624
+ isFromMe: boolean;
1625
+ isTagMe: boolean;
1626
+ isStory: boolean;
1627
+ isViewOnce: boolean;
1628
+ isEdited: boolean;
1629
+ isDeleted: boolean;
1630
+ isPinned: boolean;
1631
+ isUnPinned: boolean;
1632
+ isChannel: boolean;
1633
+ isBroadcast: boolean;
1634
+ isEphemeral: boolean;
1635
+ isForwarded: boolean;
1636
+ citation: Record<string, boolean> | null;
1637
+ media: z.objectOutputType<{
1638
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1639
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1640
+ }, z.ZodTypeAny, "passthrough"> | null;
1641
+ replied: {
1642
+ channelId: string;
1643
+ uniqueId: string;
1644
+ message: (...args: unknown[]) => Record<string, any>;
1645
+ senderId: string;
1646
+ roomId: string;
1647
+ isGroup: boolean;
1648
+ text: string | null;
1649
+ chatId: string;
1650
+ receiverId: string;
1651
+ receiverName: string;
1652
+ roomName: string;
1653
+ senderName: string;
1654
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1655
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1656
+ timestamp: number;
1657
+ mentions: string[];
1658
+ links: string[];
1659
+ isPrefix: boolean;
1660
+ isSpam: boolean;
1661
+ isFromMe: boolean;
1662
+ isTagMe: boolean;
1663
+ isStory: boolean;
1664
+ isViewOnce: boolean;
1665
+ isEdited: boolean;
1666
+ isDeleted: boolean;
1667
+ isPinned: boolean;
1668
+ isUnPinned: boolean;
1669
+ isChannel: boolean;
1670
+ isBroadcast: boolean;
1671
+ isEphemeral: boolean;
1672
+ isForwarded: boolean;
1673
+ citation: Record<string, boolean> | null;
1674
+ media: z.objectOutputType<{
1675
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1676
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1677
+ }, z.ZodTypeAny, "passthrough"> | null;
1678
+ } | null;
1679
+ } | null>;
1680
+ contact(vcard: z.infer<typeof ContactWorkerBaseType>, options: z.infer<typeof ContactWorkerOptionsType>): Promise<{
1681
+ channelId: string;
1682
+ uniqueId: string;
1683
+ message: (...args: unknown[]) => Record<string, any>;
1684
+ senderId: string;
1685
+ roomId: string;
1686
+ isGroup: boolean;
1687
+ text: string | null;
1688
+ chatId: string;
1689
+ receiverId: string;
1690
+ receiverName: string;
1691
+ roomName: string;
1692
+ senderName: string;
1693
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1694
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1695
+ timestamp: number;
1696
+ mentions: string[];
1697
+ links: string[];
1698
+ isPrefix: boolean;
1699
+ isSpam: boolean;
1700
+ isFromMe: boolean;
1701
+ isTagMe: boolean;
1702
+ isStory: boolean;
1703
+ isViewOnce: boolean;
1704
+ isEdited: boolean;
1705
+ isDeleted: boolean;
1706
+ isPinned: boolean;
1707
+ isUnPinned: boolean;
1708
+ isChannel: boolean;
1709
+ isBroadcast: boolean;
1710
+ isEphemeral: boolean;
1711
+ isForwarded: boolean;
1712
+ citation: Record<string, boolean> | null;
1713
+ media: z.objectOutputType<{
1714
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1715
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1716
+ }, z.ZodTypeAny, "passthrough"> | null;
1717
+ replied: {
1718
+ channelId: string;
1719
+ uniqueId: string;
1720
+ message: (...args: unknown[]) => Record<string, any>;
1721
+ senderId: string;
1722
+ roomId: string;
1723
+ isGroup: boolean;
1724
+ text: string | null;
1725
+ chatId: string;
1726
+ receiverId: string;
1727
+ receiverName: string;
1728
+ roomName: string;
1729
+ senderName: string;
1730
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1731
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1732
+ timestamp: number;
1733
+ mentions: string[];
1734
+ links: string[];
1735
+ isPrefix: boolean;
1736
+ isSpam: boolean;
1737
+ isFromMe: boolean;
1738
+ isTagMe: boolean;
1739
+ isStory: boolean;
1740
+ isViewOnce: boolean;
1741
+ isEdited: boolean;
1742
+ isDeleted: boolean;
1743
+ isPinned: boolean;
1744
+ isUnPinned: boolean;
1745
+ isChannel: boolean;
1746
+ isBroadcast: boolean;
1747
+ isEphemeral: boolean;
1748
+ isForwarded: boolean;
1749
+ citation: Record<string, boolean> | null;
1750
+ media: z.objectOutputType<{
1751
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1752
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1753
+ }, z.ZodTypeAny, "passthrough"> | null;
1754
+ } | null;
1755
+ } | null>;
1756
+ reaction(emoticon: z.infer<typeof ReactionWorkerBaseType>, options: z.infer<typeof ReactionWorkerOptionsType>): Promise<{
1757
+ channelId: string;
1758
+ uniqueId: string;
1759
+ message: (...args: unknown[]) => Record<string, any>;
1760
+ senderId: string;
1761
+ roomId: string;
1762
+ isGroup: boolean;
1763
+ text: string | null;
1764
+ chatId: string;
1765
+ receiverId: string;
1766
+ receiverName: string;
1767
+ roomName: string;
1768
+ senderName: string;
1769
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1770
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1771
+ timestamp: number;
1772
+ mentions: string[];
1773
+ links: string[];
1774
+ isPrefix: boolean;
1775
+ isSpam: boolean;
1776
+ isFromMe: boolean;
1777
+ isTagMe: boolean;
1778
+ isStory: boolean;
1779
+ isViewOnce: boolean;
1780
+ isEdited: boolean;
1781
+ isDeleted: boolean;
1782
+ isPinned: boolean;
1783
+ isUnPinned: boolean;
1784
+ isChannel: boolean;
1785
+ isBroadcast: boolean;
1786
+ isEphemeral: boolean;
1787
+ isForwarded: boolean;
1788
+ citation: Record<string, boolean> | null;
1789
+ media: z.objectOutputType<{
1790
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1791
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1792
+ }, z.ZodTypeAny, "passthrough"> | null;
1793
+ replied: {
1794
+ channelId: string;
1795
+ uniqueId: string;
1796
+ message: (...args: unknown[]) => Record<string, any>;
1797
+ senderId: string;
1798
+ roomId: string;
1799
+ isGroup: boolean;
1800
+ text: string | null;
1801
+ chatId: string;
1802
+ receiverId: string;
1803
+ receiverName: string;
1804
+ roomName: string;
1805
+ senderName: string;
1806
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1807
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1808
+ timestamp: number;
1809
+ mentions: string[];
1810
+ links: string[];
1811
+ isPrefix: boolean;
1812
+ isSpam: boolean;
1813
+ isFromMe: boolean;
1814
+ isTagMe: boolean;
1815
+ isStory: boolean;
1816
+ isViewOnce: boolean;
1817
+ isEdited: boolean;
1818
+ isDeleted: boolean;
1819
+ isPinned: boolean;
1820
+ isUnPinned: boolean;
1821
+ isChannel: boolean;
1822
+ isBroadcast: boolean;
1823
+ isEphemeral: boolean;
1824
+ isForwarded: boolean;
1825
+ citation: Record<string, boolean> | null;
1826
+ media: z.objectOutputType<{
1827
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1828
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1829
+ }, z.ZodTypeAny, "passthrough"> | null;
1830
+ } | null;
1831
+ } | null>;
1832
+ pin(pin: z.infer<typeof PinWorkerBaseType>, options: z.infer<typeof PinWorkerOptionsType>): Promise<{
959
1833
  channelId: string;
960
1834
  uniqueId: string;
961
1835
  message: (...args: unknown[]) => Record<string, any>;
@@ -974,6 +1848,7 @@ declare class Worker {
974
1848
  mentions: string[];
975
1849
  links: string[];
976
1850
  isPrefix: boolean;
1851
+ isSpam: boolean;
977
1852
  isFromMe: boolean;
978
1853
  isTagMe: boolean;
979
1854
  isStory: boolean;
@@ -1010,6 +1885,7 @@ declare class Worker {
1010
1885
  mentions: string[];
1011
1886
  links: string[];
1012
1887
  isPrefix: boolean;
1888
+ isSpam: boolean;
1013
1889
  isFromMe: boolean;
1014
1890
  isTagMe: boolean;
1015
1891
  isStory: boolean;
@@ -1028,8 +1904,307 @@ declare class Worker {
1028
1904
  stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1029
1905
  }, z.ZodTypeAny, "passthrough"> | null;
1030
1906
  } | null;
1031
- } | null | undefined>;
1032
- location(loc: z.infer<typeof LocationWorkerBaseType>, options: z.infer<typeof LocationWorkerOptionsType>): Promise<{
1907
+ } | null>;
1908
+ poll(poll: z.infer<typeof PollWorkerBaseType>, options: z.infer<typeof PollWorkerOptionsType>): Promise<{
1909
+ channelId: string;
1910
+ uniqueId: string;
1911
+ message: (...args: unknown[]) => Record<string, any>;
1912
+ senderId: string;
1913
+ roomId: string;
1914
+ isGroup: boolean;
1915
+ text: string | null;
1916
+ chatId: string;
1917
+ receiverId: string;
1918
+ receiverName: string;
1919
+ roomName: string;
1920
+ senderName: string;
1921
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1922
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1923
+ timestamp: number;
1924
+ mentions: string[];
1925
+ links: string[];
1926
+ isPrefix: boolean;
1927
+ isSpam: boolean;
1928
+ isFromMe: boolean;
1929
+ isTagMe: boolean;
1930
+ isStory: boolean;
1931
+ isViewOnce: boolean;
1932
+ isEdited: boolean;
1933
+ isDeleted: boolean;
1934
+ isPinned: boolean;
1935
+ isUnPinned: boolean;
1936
+ isChannel: boolean;
1937
+ isBroadcast: boolean;
1938
+ isEphemeral: boolean;
1939
+ isForwarded: boolean;
1940
+ citation: Record<string, boolean> | null;
1941
+ media: z.objectOutputType<{
1942
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1943
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1944
+ }, z.ZodTypeAny, "passthrough"> | null;
1945
+ replied: {
1946
+ channelId: string;
1947
+ uniqueId: string;
1948
+ message: (...args: unknown[]) => Record<string, any>;
1949
+ senderId: string;
1950
+ roomId: string;
1951
+ isGroup: boolean;
1952
+ text: string | null;
1953
+ chatId: string;
1954
+ receiverId: string;
1955
+ receiverName: string;
1956
+ roomName: string;
1957
+ senderName: string;
1958
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1959
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1960
+ timestamp: number;
1961
+ mentions: string[];
1962
+ links: string[];
1963
+ isPrefix: boolean;
1964
+ isSpam: boolean;
1965
+ isFromMe: boolean;
1966
+ isTagMe: boolean;
1967
+ isStory: boolean;
1968
+ isViewOnce: boolean;
1969
+ isEdited: boolean;
1970
+ isDeleted: boolean;
1971
+ isPinned: boolean;
1972
+ isUnPinned: boolean;
1973
+ isChannel: boolean;
1974
+ isBroadcast: boolean;
1975
+ isEphemeral: boolean;
1976
+ isForwarded: boolean;
1977
+ citation: Record<string, boolean> | null;
1978
+ media: z.objectOutputType<{
1979
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1980
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1981
+ }, z.ZodTypeAny, "passthrough"> | null;
1982
+ } | null;
1983
+ } | null>;
1984
+ edit(text: z.infer<typeof EditWorkerBaseType>, options: z.infer<typeof EditWorkerOptionsType>): Promise<{
1985
+ channelId: string;
1986
+ uniqueId: string;
1987
+ message: (...args: unknown[]) => Record<string, any>;
1988
+ senderId: string;
1989
+ roomId: string;
1990
+ isGroup: boolean;
1991
+ text: string | null;
1992
+ chatId: string;
1993
+ receiverId: string;
1994
+ receiverName: string;
1995
+ roomName: string;
1996
+ senderName: string;
1997
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1998
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1999
+ timestamp: number;
2000
+ mentions: string[];
2001
+ links: string[];
2002
+ isPrefix: boolean;
2003
+ isSpam: boolean;
2004
+ isFromMe: boolean;
2005
+ isTagMe: boolean;
2006
+ isStory: boolean;
2007
+ isViewOnce: boolean;
2008
+ isEdited: boolean;
2009
+ isDeleted: boolean;
2010
+ isPinned: boolean;
2011
+ isUnPinned: boolean;
2012
+ isChannel: boolean;
2013
+ isBroadcast: boolean;
2014
+ isEphemeral: boolean;
2015
+ isForwarded: boolean;
2016
+ citation: Record<string, boolean> | null;
2017
+ media: z.objectOutputType<{
2018
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2019
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2020
+ }, z.ZodTypeAny, "passthrough"> | null;
2021
+ replied: {
2022
+ channelId: string;
2023
+ uniqueId: string;
2024
+ message: (...args: unknown[]) => Record<string, any>;
2025
+ senderId: string;
2026
+ roomId: string;
2027
+ isGroup: boolean;
2028
+ text: string | null;
2029
+ chatId: string;
2030
+ receiverId: string;
2031
+ receiverName: string;
2032
+ roomName: string;
2033
+ senderName: string;
2034
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2035
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2036
+ timestamp: number;
2037
+ mentions: string[];
2038
+ links: string[];
2039
+ isPrefix: boolean;
2040
+ isSpam: boolean;
2041
+ isFromMe: boolean;
2042
+ isTagMe: boolean;
2043
+ isStory: boolean;
2044
+ isViewOnce: boolean;
2045
+ isEdited: boolean;
2046
+ isDeleted: boolean;
2047
+ isPinned: boolean;
2048
+ isUnPinned: boolean;
2049
+ isChannel: boolean;
2050
+ isBroadcast: boolean;
2051
+ isEphemeral: boolean;
2052
+ isForwarded: boolean;
2053
+ citation: Record<string, boolean> | null;
2054
+ media: z.objectOutputType<{
2055
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2056
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2057
+ }, z.ZodTypeAny, "passthrough"> | null;
2058
+ } | null;
2059
+ } | null>;
2060
+ delete(del: z.infer<typeof DeleteWorkerBaseType>): Promise<{
2061
+ channelId: string;
2062
+ uniqueId: string;
2063
+ message: (...args: unknown[]) => Record<string, any>;
2064
+ senderId: string;
2065
+ roomId: string;
2066
+ isGroup: boolean;
2067
+ text: string | null;
2068
+ chatId: string;
2069
+ receiverId: string;
2070
+ receiverName: string;
2071
+ roomName: string;
2072
+ senderName: string;
2073
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2074
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2075
+ timestamp: number;
2076
+ mentions: string[];
2077
+ links: string[];
2078
+ isPrefix: boolean;
2079
+ isSpam: boolean;
2080
+ isFromMe: boolean;
2081
+ isTagMe: boolean;
2082
+ isStory: boolean;
2083
+ isViewOnce: boolean;
2084
+ isEdited: boolean;
2085
+ isDeleted: boolean;
2086
+ isPinned: boolean;
2087
+ isUnPinned: boolean;
2088
+ isChannel: boolean;
2089
+ isBroadcast: boolean;
2090
+ isEphemeral: boolean;
2091
+ isForwarded: boolean;
2092
+ citation: Record<string, boolean> | null;
2093
+ media: z.objectOutputType<{
2094
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2095
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2096
+ }, z.ZodTypeAny, "passthrough"> | null;
2097
+ replied: {
2098
+ channelId: string;
2099
+ uniqueId: string;
2100
+ message: (...args: unknown[]) => Record<string, any>;
2101
+ senderId: string;
2102
+ roomId: string;
2103
+ isGroup: boolean;
2104
+ text: string | null;
2105
+ chatId: string;
2106
+ receiverId: string;
2107
+ receiverName: string;
2108
+ roomName: string;
2109
+ senderName: string;
2110
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2111
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2112
+ timestamp: number;
2113
+ mentions: string[];
2114
+ links: string[];
2115
+ isPrefix: boolean;
2116
+ isSpam: boolean;
2117
+ isFromMe: boolean;
2118
+ isTagMe: boolean;
2119
+ isStory: boolean;
2120
+ isViewOnce: boolean;
2121
+ isEdited: boolean;
2122
+ isDeleted: boolean;
2123
+ isPinned: boolean;
2124
+ isUnPinned: boolean;
2125
+ isChannel: boolean;
2126
+ isBroadcast: boolean;
2127
+ isEphemeral: boolean;
2128
+ isForwarded: boolean;
2129
+ citation: Record<string, boolean> | null;
2130
+ media: z.objectOutputType<{
2131
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2132
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2133
+ }, z.ZodTypeAny, "passthrough"> | null;
2134
+ } | null;
2135
+ } | null>;
2136
+ rejectCall(call: z.infer<typeof RejectCallWorkerBaseType>): Promise<void | undefined>;
2137
+ mute(mute: z.infer<typeof MuteWorkerBaseType>, options: z.infer<typeof MuteWorkerOptionsType>): Promise<void | undefined>;
2138
+ profile(roomId: z.infer<typeof ProfileWorkerBaseType>): Promise<z.infer<typeof ProfileWorkerBaseOutputType> | null>;
2139
+ presence(action: z.infer<typeof PresenceWorkerBaseType>, options: z.infer<typeof PresenceWorkerOptionsType>): Promise<void | undefined>;
2140
+ addCompletion(props: z.infer<typeof llmMessagesTable>): Promise<{
2141
+ channelId: string;
2142
+ uniqueId: string;
2143
+ role: string;
2144
+ content: string;
2145
+ model?: string | null | undefined;
2146
+ additional?: string | null | undefined;
2147
+ }>;
2148
+ deleteCompletion(uniqueId: string): Promise<boolean>;
2149
+ updateCompletion(uniqueId: string, props: Partial<z.infer<typeof llmMessagesTable>>): Promise<{
2150
+ channelId: string;
2151
+ uniqueId: string;
2152
+ role: string;
2153
+ content: string;
2154
+ model?: string | null | undefined;
2155
+ additional?: string | null | undefined;
2156
+ }>;
2157
+ clearCompletions(channelId: string): Promise<boolean>;
2158
+ getCompletion(uniqueId: string): Promise<{
2159
+ channelId: string;
2160
+ uniqueId: string;
2161
+ role: string;
2162
+ content: string;
2163
+ model?: string | null | undefined;
2164
+ additional?: string | null | undefined;
2165
+ } | null>;
2166
+ getCompletions(channelId: string): Promise<{
2167
+ channelId: string;
2168
+ uniqueId: string;
2169
+ role: string;
2170
+ content: string;
2171
+ model?: string | null | undefined;
2172
+ additional?: string | null | undefined;
2173
+ }[]>;
2174
+ addPersonalization(props: z.infer<typeof llmPersonalizationTable>): Promise<{
2175
+ uniqueId: string;
2176
+ content: string;
2177
+ senderId: string;
2178
+ }>;
2179
+ deletePersonalization(uniqueId: string): Promise<boolean>;
2180
+ clearPersonalization(senderId: string): Promise<boolean>;
2181
+ getPersonalization(senderId: string): Promise<{
2182
+ uniqueId: string;
2183
+ content: string;
2184
+ senderId: string;
2185
+ }[]>;
2186
+ addRAG(props: z.infer<typeof addRAGType>): Promise<any>;
2187
+ deleteRAG(id: string): Promise<boolean>;
2188
+ updateRAG(id: string): Promise<{
2189
+ metadata: {
2190
+ id: string;
2191
+ };
2192
+ pageContent: string;
2193
+ }>;
2194
+ clearRAGs(): Promise<boolean>;
2195
+ getRAG(id: string): Promise<{
2196
+ metadata: {
2197
+ id: string;
2198
+ };
2199
+ pageContent: string;
2200
+ } | null>;
2201
+ getRAGs(keyword: string): Promise<{
2202
+ metadata: {
2203
+ id: string;
2204
+ };
2205
+ pageContent: string;
2206
+ }[]>;
2207
+ getMessage(chatId: string): Promise<{
1033
2208
  channelId: string;
1034
2209
  uniqueId: string;
1035
2210
  message: (...args: unknown[]) => Record<string, any>;
@@ -1048,6 +2223,7 @@ declare class Worker {
1048
2223
  mentions: string[];
1049
2224
  links: string[];
1050
2225
  isPrefix: boolean;
2226
+ isSpam: boolean;
1051
2227
  isFromMe: boolean;
1052
2228
  isTagMe: boolean;
1053
2229
  isStory: boolean;
@@ -1084,6 +2260,7 @@ declare class Worker {
1084
2260
  mentions: string[];
1085
2261
  links: string[];
1086
2262
  isPrefix: boolean;
2263
+ isSpam: boolean;
1087
2264
  isFromMe: boolean;
1088
2265
  isTagMe: boolean;
1089
2266
  isStory: boolean;
@@ -1103,155 +2280,342 @@ declare class Worker {
1103
2280
  }, z.ZodTypeAny, "passthrough"> | null;
1104
2281
  } | null;
1105
2282
  } | null>;
1106
- contact(vcard: z.infer<typeof ContactWorkerBaseType>, options: z.infer<typeof ContactWorkerOptionsType>): Promise<{
1107
- channelId: string;
1108
- uniqueId: string;
1109
- message: (...args: unknown[]) => Record<string, any>;
1110
- senderId: string;
1111
- roomId: string;
1112
- isGroup: boolean;
1113
- text: string | null;
1114
- chatId: string;
1115
- receiverId: string;
1116
- receiverName: string;
1117
- roomName: string;
1118
- senderName: string;
1119
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1120
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1121
- timestamp: number;
1122
- mentions: string[];
1123
- links: string[];
1124
- isPrefix: boolean;
1125
- isFromMe: boolean;
1126
- isTagMe: boolean;
1127
- isStory: boolean;
1128
- isViewOnce: boolean;
1129
- isEdited: boolean;
1130
- isDeleted: boolean;
1131
- isPinned: boolean;
1132
- isUnPinned: boolean;
1133
- isChannel: boolean;
1134
- isBroadcast: boolean;
1135
- isEphemeral: boolean;
1136
- isForwarded: boolean;
1137
- citation: Record<string, boolean> | null;
1138
- media: z.objectOutputType<{
2283
+ llms: llmsAdapter;
2284
+ chats: chatsAdapter;
2285
+ }
2286
+
2287
+ declare class Client {
2288
+ private props;
2289
+ options: z.infer<typeof ClientClassesType>;
2290
+ cache: NodeCache;
2291
+ private chatId;
2292
+ private logger;
2293
+ private db;
2294
+ private socket;
2295
+ private events;
2296
+ private spinners;
2297
+ private worker;
2298
+ constructor(props: z.input<typeof ClientClassesType>);
2299
+ initialize(): Promise<void>;
2300
+ startSpinner(key: string, message: string): Ora;
2301
+ stopSpinner(key: string, succeed: boolean, message?: string): void;
2302
+ failSpinner(key: string, message?: string): void;
2303
+ on<T extends EventEnumType>(event: T, handler: EventCallbackType[T]): void;
2304
+ emit<T extends EventEnumType>(event: T, ...args: Parameters<EventCallbackType[T]>): void;
2305
+ }
2306
+ interface Client extends Worker {
2307
+ }
2308
+
2309
+ declare const CallsParserBaseType: z.ZodObject<{
2310
+ callId: z.ZodString;
2311
+ roomId: z.ZodString;
2312
+ callerId: z.ZodString;
2313
+ date: z.ZodDate;
2314
+ offline: z.ZodBoolean;
2315
+ status: z.ZodEnum<["accept", "offer", "reject", "ringing", "terminate", "timeout"]>;
2316
+ isVideo: z.ZodBoolean;
2317
+ isGroup: z.ZodBoolean;
2318
+ }, "strip", z.ZodTypeAny, {
2319
+ status: "accept" | "offer" | "reject" | "ringing" | "terminate" | "timeout";
2320
+ callId: string;
2321
+ roomId: string;
2322
+ callerId: string;
2323
+ date: Date;
2324
+ offline: boolean;
2325
+ isVideo: boolean;
2326
+ isGroup: boolean;
2327
+ }, {
2328
+ status: "accept" | "offer" | "reject" | "ringing" | "terminate" | "timeout";
2329
+ callId: string;
2330
+ roomId: string;
2331
+ callerId: string;
2332
+ date: Date;
2333
+ offline: boolean;
2334
+ isVideo: boolean;
2335
+ isGroup: boolean;
2336
+ }>;
2337
+
2338
+ declare const MessagesMediaType: {
2339
+ readonly text: "text";
2340
+ readonly conversation: "text";
2341
+ readonly imageMessage: "image";
2342
+ readonly contactMessage: "contact";
2343
+ readonly locationMessage: "location";
2344
+ readonly documentMessage: "document";
2345
+ readonly audioMessage: "audio";
2346
+ readonly videoMessage: "video";
2347
+ readonly protocolMessage: "protocol";
2348
+ readonly contactsArrayMessage: "contactsArray";
2349
+ readonly highlyStructuredMessage: "highlyStructured";
2350
+ readonly sendPaymentMessage: "sendPayment";
2351
+ readonly liveLocationMessage: "liveLocation";
2352
+ readonly requestPaymentMessage: "requestPayment";
2353
+ readonly declinePaymentRequestMessage: "declinePaymentRequest";
2354
+ readonly cancelPaymentRequestMessage: "cancelPaymentRequest";
2355
+ readonly templateMessage: "template";
2356
+ readonly stickerMessage: "sticker";
2357
+ readonly groupInviteMessage: "groupInvite";
2358
+ readonly templateButtonReplyMessage: "templateButtonReply";
2359
+ readonly productMessage: "product";
2360
+ readonly deviceSentMessage: "deviceSent";
2361
+ readonly listMessage: "list";
2362
+ readonly viewOnceMessage: "viewOnce";
2363
+ readonly orderMessage: "order";
2364
+ readonly listResponseMessage: "listResponse";
2365
+ readonly ephemeralMessage: "ephemeral";
2366
+ readonly invoiceMessage: "invoice";
2367
+ readonly buttonsMessage: "buttons";
2368
+ readonly buttonsResponseMessage: "buttonsResponse";
2369
+ readonly paymentInviteMessage: "paymentInvite";
2370
+ readonly interactiveMessage: "interactive";
2371
+ readonly reactionMessage: "reaction";
2372
+ readonly stickerSyncRmrMessage: "sticker";
2373
+ readonly interactiveResponseMessage: "interactiveResponse";
2374
+ readonly pollCreationMessage: "pollCreation";
2375
+ readonly pollUpdateMessage: "pollUpdate";
2376
+ readonly keepInChatMessage: "keepInChat";
2377
+ readonly documentWithCaptionMessage: "document";
2378
+ readonly requestPhoneNumberMessage: "requestPhoneNumber";
2379
+ readonly viewOnceMessageV2: "viewOnce";
2380
+ readonly encReactionMessage: "reaction";
2381
+ readonly editedMessage: "text";
2382
+ readonly viewOnceMessageV2Extension: "viewOnce";
2383
+ readonly pollCreationMessageV2: "pollCreation";
2384
+ readonly scheduledCallCreationMessage: "scheduledCallCreation";
2385
+ readonly groupMentionedMessage: "groupMentioned";
2386
+ readonly pinInChatMessage: "pinInChat";
2387
+ readonly pollCreationMessageV3: "pollCreation";
2388
+ readonly scheduledCallEditMessage: "scheduledCallEdit";
2389
+ readonly ptvMessage: "ptv";
2390
+ readonly botInvokeMessage: "botInvoke";
2391
+ readonly callLogMesssage: "callLog";
2392
+ readonly encCommentMessage: "encComment";
2393
+ readonly bcallMessage: "bcall";
2394
+ readonly lottieStickerMessage: "lottieSticker";
2395
+ readonly eventMessage: "event";
2396
+ readonly commentMessage: "comment";
2397
+ readonly newsletterAdminInviteMessage: "text";
2398
+ readonly extendedTextMessageWithParentKey: "text";
2399
+ readonly extendedTextMessage: "text";
2400
+ readonly placeholderMessage: "placeholder";
2401
+ readonly encEventUpdateMessage: "encEventUpdate";
2402
+ };
2403
+ declare const MessagesVerifiedPlatformType: {
2404
+ readonly whatsapp: "0@s.whatsapp.net";
2405
+ readonly meta: "13135550002@s.whatsapp.net";
2406
+ readonly chatgpt: "18002428478@s.whatsapp.net";
2407
+ readonly copilot: "18772241042@s.whatsapp.net";
2408
+ readonly instagram: "447723442971@s.whatsapp.net";
2409
+ readonly tiktok: "6285574670498@s.whatsapp.net";
2410
+ };
2411
+ declare const MessagesEnumType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
2412
+ declare const MessagesDeviceEnumType: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
2413
+ declare const MessagesParserBaseType: z.ZodObject<{
2414
+ chatId: z.ZodString;
2415
+ channelId: z.ZodString;
2416
+ uniqueId: z.ZodString;
2417
+ receiverId: z.ZodString;
2418
+ receiverName: z.ZodString;
2419
+ roomId: z.ZodString;
2420
+ roomName: z.ZodString;
2421
+ senderId: z.ZodString;
2422
+ senderName: z.ZodString;
2423
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
2424
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
2425
+ timestamp: z.ZodNumber;
2426
+ mentions: z.ZodArray<z.ZodString, "many">;
2427
+ text: z.ZodNullable<z.ZodString>;
2428
+ links: z.ZodArray<z.ZodString, "many">;
2429
+ isPrefix: z.ZodBoolean;
2430
+ isSpam: z.ZodBoolean;
2431
+ isFromMe: z.ZodBoolean;
2432
+ isTagMe: z.ZodBoolean;
2433
+ isGroup: z.ZodBoolean;
2434
+ isStory: z.ZodBoolean;
2435
+ isViewOnce: z.ZodBoolean;
2436
+ isEdited: z.ZodBoolean;
2437
+ isDeleted: z.ZodBoolean;
2438
+ isPinned: z.ZodBoolean;
2439
+ isUnPinned: z.ZodBoolean;
2440
+ isChannel: z.ZodBoolean;
2441
+ isBroadcast: z.ZodBoolean;
2442
+ isEphemeral: z.ZodBoolean;
2443
+ isForwarded: z.ZodBoolean;
2444
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2445
+ media: z.ZodNullable<z.ZodObject<{
2446
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2447
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2448
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2449
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2450
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2451
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2452
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2453
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2454
+ }, z.ZodTypeAny, "passthrough">>>;
2455
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
2456
+ }, "strip", z.ZodTypeAny, {
2457
+ channelId: string;
2458
+ uniqueId: string;
2459
+ message: (...args: unknown[]) => Record<string, any>;
2460
+ senderId: string;
2461
+ roomId: string;
2462
+ isGroup: boolean;
2463
+ text: string | null;
2464
+ chatId: string;
2465
+ receiverId: string;
2466
+ receiverName: string;
2467
+ roomName: string;
2468
+ senderName: string;
2469
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2470
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2471
+ timestamp: number;
2472
+ mentions: string[];
2473
+ links: string[];
2474
+ isPrefix: boolean;
2475
+ isSpam: boolean;
2476
+ isFromMe: boolean;
2477
+ isTagMe: boolean;
2478
+ isStory: boolean;
2479
+ isViewOnce: boolean;
2480
+ isEdited: boolean;
2481
+ isDeleted: boolean;
2482
+ isPinned: boolean;
2483
+ isUnPinned: boolean;
2484
+ isChannel: boolean;
2485
+ isBroadcast: boolean;
2486
+ isEphemeral: boolean;
2487
+ isForwarded: boolean;
2488
+ citation: Record<string, boolean> | null;
2489
+ media: z.objectOutputType<{
2490
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2491
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2492
+ }, z.ZodTypeAny, "passthrough"> | null;
2493
+ }, {
2494
+ channelId: string;
2495
+ uniqueId: string;
2496
+ message: (...args: unknown[]) => Record<string, any>;
2497
+ senderId: string;
2498
+ roomId: string;
2499
+ isGroup: boolean;
2500
+ text: string | null;
2501
+ chatId: string;
2502
+ receiverId: string;
2503
+ receiverName: string;
2504
+ roomName: string;
2505
+ senderName: string;
2506
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2507
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2508
+ timestamp: number;
2509
+ mentions: string[];
2510
+ links: string[];
2511
+ isPrefix: boolean;
2512
+ isSpam: boolean;
2513
+ isFromMe: boolean;
2514
+ isTagMe: boolean;
2515
+ isStory: boolean;
2516
+ isViewOnce: boolean;
2517
+ isEdited: boolean;
2518
+ isDeleted: boolean;
2519
+ isPinned: boolean;
2520
+ isUnPinned: boolean;
2521
+ isChannel: boolean;
2522
+ isBroadcast: boolean;
2523
+ isEphemeral: boolean;
2524
+ isForwarded: boolean;
2525
+ citation: Record<string, boolean> | null;
2526
+ media: z.objectInputType<{
2527
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2528
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2529
+ }, z.ZodTypeAny, "passthrough"> | null;
2530
+ }>;
2531
+ declare const MessagesParserType: z.ZodObject<{
2532
+ chatId: z.ZodString;
2533
+ channelId: z.ZodString;
2534
+ uniqueId: z.ZodString;
2535
+ receiverId: z.ZodString;
2536
+ receiverName: z.ZodString;
2537
+ roomId: z.ZodString;
2538
+ roomName: z.ZodString;
2539
+ senderId: z.ZodString;
2540
+ senderName: z.ZodString;
2541
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
2542
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
2543
+ timestamp: z.ZodNumber;
2544
+ mentions: z.ZodArray<z.ZodString, "many">;
2545
+ text: z.ZodNullable<z.ZodString>;
2546
+ links: z.ZodArray<z.ZodString, "many">;
2547
+ isPrefix: z.ZodBoolean;
2548
+ isSpam: z.ZodBoolean;
2549
+ isFromMe: z.ZodBoolean;
2550
+ isTagMe: z.ZodBoolean;
2551
+ isGroup: z.ZodBoolean;
2552
+ isStory: z.ZodBoolean;
2553
+ isViewOnce: z.ZodBoolean;
2554
+ isEdited: z.ZodBoolean;
2555
+ isDeleted: z.ZodBoolean;
2556
+ isPinned: z.ZodBoolean;
2557
+ isUnPinned: z.ZodBoolean;
2558
+ isChannel: z.ZodBoolean;
2559
+ isBroadcast: z.ZodBoolean;
2560
+ isEphemeral: z.ZodBoolean;
2561
+ isForwarded: z.ZodBoolean;
2562
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2563
+ media: z.ZodNullable<z.ZodObject<{
2564
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2565
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2566
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2567
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2568
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2569
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2570
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2571
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2572
+ }, z.ZodTypeAny, "passthrough">>>;
2573
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
2574
+ } & {
2575
+ replied: z.ZodNullable<z.ZodObject<{
2576
+ chatId: z.ZodString;
2577
+ channelId: z.ZodString;
2578
+ uniqueId: z.ZodString;
2579
+ receiverId: z.ZodString;
2580
+ receiverName: z.ZodString;
2581
+ roomId: z.ZodString;
2582
+ roomName: z.ZodString;
2583
+ senderId: z.ZodString;
2584
+ senderName: z.ZodString;
2585
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
2586
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
2587
+ timestamp: z.ZodNumber;
2588
+ mentions: z.ZodArray<z.ZodString, "many">;
2589
+ text: z.ZodNullable<z.ZodString>;
2590
+ links: z.ZodArray<z.ZodString, "many">;
2591
+ isPrefix: z.ZodBoolean;
2592
+ isSpam: z.ZodBoolean;
2593
+ isFromMe: z.ZodBoolean;
2594
+ isTagMe: z.ZodBoolean;
2595
+ isGroup: z.ZodBoolean;
2596
+ isStory: z.ZodBoolean;
2597
+ isViewOnce: z.ZodBoolean;
2598
+ isEdited: z.ZodBoolean;
2599
+ isDeleted: z.ZodBoolean;
2600
+ isPinned: z.ZodBoolean;
2601
+ isUnPinned: z.ZodBoolean;
2602
+ isChannel: z.ZodBoolean;
2603
+ isBroadcast: z.ZodBoolean;
2604
+ isEphemeral: z.ZodBoolean;
2605
+ isForwarded: z.ZodBoolean;
2606
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2607
+ media: z.ZodNullable<z.ZodObject<{
1139
2608
  buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1140
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1141
- }, z.ZodTypeAny, "passthrough"> | null;
1142
- replied: {
1143
- channelId: string;
1144
- uniqueId: string;
1145
- message: (...args: unknown[]) => Record<string, any>;
1146
- senderId: string;
1147
- roomId: string;
1148
- isGroup: boolean;
1149
- text: string | null;
1150
- chatId: string;
1151
- receiverId: string;
1152
- receiverName: string;
1153
- roomName: string;
1154
- senderName: string;
1155
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1156
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1157
- timestamp: number;
1158
- mentions: string[];
1159
- links: string[];
1160
- isPrefix: boolean;
1161
- isFromMe: boolean;
1162
- isTagMe: boolean;
1163
- isStory: boolean;
1164
- isViewOnce: boolean;
1165
- isEdited: boolean;
1166
- isDeleted: boolean;
1167
- isPinned: boolean;
1168
- isUnPinned: boolean;
1169
- isChannel: boolean;
1170
- isBroadcast: boolean;
1171
- isEphemeral: boolean;
1172
- isForwarded: boolean;
1173
- citation: Record<string, boolean> | null;
1174
- media: z.objectOutputType<{
1175
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1176
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1177
- }, z.ZodTypeAny, "passthrough"> | null;
1178
- } | null;
1179
- } | null>;
1180
- reaction(emoticon: z.infer<typeof ReactionWorkerBaseType>, options: z.infer<typeof ReactionWorkerOptionsType>): Promise<{
1181
- channelId: string;
1182
- uniqueId: string;
1183
- message: (...args: unknown[]) => Record<string, any>;
1184
- senderId: string;
1185
- roomId: string;
1186
- isGroup: boolean;
1187
- text: string | null;
1188
- chatId: string;
1189
- receiverId: string;
1190
- receiverName: string;
1191
- roomName: string;
1192
- senderName: string;
1193
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1194
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1195
- timestamp: number;
1196
- mentions: string[];
1197
- links: string[];
1198
- isPrefix: boolean;
1199
- isFromMe: boolean;
1200
- isTagMe: boolean;
1201
- isStory: boolean;
1202
- isViewOnce: boolean;
1203
- isEdited: boolean;
1204
- isDeleted: boolean;
1205
- isPinned: boolean;
1206
- isUnPinned: boolean;
1207
- isChannel: boolean;
1208
- isBroadcast: boolean;
1209
- isEphemeral: boolean;
1210
- isForwarded: boolean;
1211
- citation: Record<string, boolean> | null;
1212
- media: z.objectOutputType<{
2609
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2610
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1213
2611
  buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1214
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1215
- }, z.ZodTypeAny, "passthrough"> | null;
1216
- replied: {
1217
- channelId: string;
1218
- uniqueId: string;
1219
- message: (...args: unknown[]) => Record<string, any>;
1220
- senderId: string;
1221
- roomId: string;
1222
- isGroup: boolean;
1223
- text: string | null;
1224
- chatId: string;
1225
- receiverId: string;
1226
- receiverName: string;
1227
- roomName: string;
1228
- senderName: string;
1229
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1230
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1231
- timestamp: number;
1232
- mentions: string[];
1233
- links: string[];
1234
- isPrefix: boolean;
1235
- isFromMe: boolean;
1236
- isTagMe: boolean;
1237
- isStory: boolean;
1238
- isViewOnce: boolean;
1239
- isEdited: boolean;
1240
- isDeleted: boolean;
1241
- isPinned: boolean;
1242
- isUnPinned: boolean;
1243
- isChannel: boolean;
1244
- isBroadcast: boolean;
1245
- isEphemeral: boolean;
1246
- isForwarded: boolean;
1247
- citation: Record<string, boolean> | null;
1248
- media: z.objectOutputType<{
1249
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1250
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1251
- }, z.ZodTypeAny, "passthrough"> | null;
1252
- } | null;
1253
- } | null>;
1254
- pin(pin: z.infer<typeof PinWorkerBaseType>, options: z.infer<typeof PinWorkerOptionsType>): Promise<{
2612
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2613
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2614
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2615
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2616
+ }, z.ZodTypeAny, "passthrough">>>;
2617
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
2618
+ }, "strip", z.ZodTypeAny, {
1255
2619
  channelId: string;
1256
2620
  uniqueId: string;
1257
2621
  message: (...args: unknown[]) => Record<string, any>;
@@ -1270,6 +2634,7 @@ declare class Worker {
1270
2634
  mentions: string[];
1271
2635
  links: string[];
1272
2636
  isPrefix: boolean;
2637
+ isSpam: boolean;
1273
2638
  isFromMe: boolean;
1274
2639
  isTagMe: boolean;
1275
2640
  isStory: boolean;
@@ -1285,47 +2650,9 @@ declare class Worker {
1285
2650
  citation: Record<string, boolean> | null;
1286
2651
  media: z.objectOutputType<{
1287
2652
  buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1288
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2653
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
1289
2654
  }, z.ZodTypeAny, "passthrough"> | null;
1290
- replied: {
1291
- channelId: string;
1292
- uniqueId: string;
1293
- message: (...args: unknown[]) => Record<string, any>;
1294
- senderId: string;
1295
- roomId: string;
1296
- isGroup: boolean;
1297
- text: string | null;
1298
- chatId: string;
1299
- receiverId: string;
1300
- receiverName: string;
1301
- roomName: string;
1302
- senderName: string;
1303
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1304
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1305
- timestamp: number;
1306
- mentions: string[];
1307
- links: string[];
1308
- isPrefix: boolean;
1309
- isFromMe: boolean;
1310
- isTagMe: boolean;
1311
- isStory: boolean;
1312
- isViewOnce: boolean;
1313
- isEdited: boolean;
1314
- isDeleted: boolean;
1315
- isPinned: boolean;
1316
- isUnPinned: boolean;
1317
- isChannel: boolean;
1318
- isBroadcast: boolean;
1319
- isEphemeral: boolean;
1320
- isForwarded: boolean;
1321
- citation: Record<string, boolean> | null;
1322
- media: z.objectOutputType<{
1323
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1324
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1325
- }, z.ZodTypeAny, "passthrough"> | null;
1326
- } | null;
1327
- } | null>;
1328
- poll(poll: z.infer<typeof PollWorkerBaseType>, options: z.infer<typeof PollWorkerOptionsType>): Promise<{
2655
+ }, {
1329
2656
  channelId: string;
1330
2657
  uniqueId: string;
1331
2658
  message: (...args: unknown[]) => Record<string, any>;
@@ -1344,6 +2671,7 @@ declare class Worker {
1344
2671
  mentions: string[];
1345
2672
  links: string[];
1346
2673
  isPrefix: boolean;
2674
+ isSpam: boolean;
1347
2675
  isFromMe: boolean;
1348
2676
  isTagMe: boolean;
1349
2677
  isStory: boolean;
@@ -1356,50 +2684,50 @@ declare class Worker {
1356
2684
  isBroadcast: boolean;
1357
2685
  isEphemeral: boolean;
1358
2686
  isForwarded: boolean;
1359
- citation: Record<string, boolean> | null;
1360
- media: z.objectOutputType<{
1361
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1362
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1363
- }, z.ZodTypeAny, "passthrough"> | null;
1364
- replied: {
1365
- channelId: string;
1366
- uniqueId: string;
1367
- message: (...args: unknown[]) => Record<string, any>;
1368
- senderId: string;
1369
- roomId: string;
1370
- isGroup: boolean;
1371
- text: string | null;
1372
- chatId: string;
1373
- receiverId: string;
1374
- receiverName: string;
1375
- roomName: string;
1376
- senderName: string;
1377
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1378
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1379
- timestamp: number;
1380
- mentions: string[];
1381
- links: string[];
1382
- isPrefix: boolean;
1383
- isFromMe: boolean;
1384
- isTagMe: boolean;
1385
- isStory: boolean;
1386
- isViewOnce: boolean;
1387
- isEdited: boolean;
1388
- isDeleted: boolean;
1389
- isPinned: boolean;
1390
- isUnPinned: boolean;
1391
- isChannel: boolean;
1392
- isBroadcast: boolean;
1393
- isEphemeral: boolean;
1394
- isForwarded: boolean;
1395
- citation: Record<string, boolean> | null;
1396
- media: z.objectOutputType<{
1397
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1398
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1399
- }, z.ZodTypeAny, "passthrough"> | null;
1400
- } | null;
1401
- } | null>;
1402
- edit(text: z.infer<typeof EditWorkerBaseType>, options: z.infer<typeof EditWorkerOptionsType>): Promise<{
2687
+ citation: Record<string, boolean> | null;
2688
+ media: z.objectInputType<{
2689
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2690
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2691
+ }, z.ZodTypeAny, "passthrough"> | null;
2692
+ }>>;
2693
+ }, "strip", z.ZodTypeAny, {
2694
+ channelId: string;
2695
+ uniqueId: string;
2696
+ message: (...args: unknown[]) => Record<string, any>;
2697
+ senderId: string;
2698
+ roomId: string;
2699
+ isGroup: boolean;
2700
+ text: string | null;
2701
+ chatId: string;
2702
+ receiverId: string;
2703
+ receiverName: string;
2704
+ roomName: string;
2705
+ senderName: string;
2706
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2707
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2708
+ timestamp: number;
2709
+ mentions: string[];
2710
+ links: string[];
2711
+ isPrefix: boolean;
2712
+ isSpam: boolean;
2713
+ isFromMe: boolean;
2714
+ isTagMe: boolean;
2715
+ isStory: boolean;
2716
+ isViewOnce: boolean;
2717
+ isEdited: boolean;
2718
+ isDeleted: boolean;
2719
+ isPinned: boolean;
2720
+ isUnPinned: boolean;
2721
+ isChannel: boolean;
2722
+ isBroadcast: boolean;
2723
+ isEphemeral: boolean;
2724
+ isForwarded: boolean;
2725
+ citation: Record<string, boolean> | null;
2726
+ media: z.objectOutputType<{
2727
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2728
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2729
+ }, z.ZodTypeAny, "passthrough"> | null;
2730
+ replied: {
1403
2731
  channelId: string;
1404
2732
  uniqueId: string;
1405
2733
  message: (...args: unknown[]) => Record<string, any>;
@@ -1418,6 +2746,7 @@ declare class Worker {
1418
2746
  mentions: string[];
1419
2747
  links: string[];
1420
2748
  isPrefix: boolean;
2749
+ isSpam: boolean;
1421
2750
  isFromMe: boolean;
1422
2751
  isTagMe: boolean;
1423
2752
  isStory: boolean;
@@ -1433,47 +2762,47 @@ declare class Worker {
1433
2762
  citation: Record<string, boolean> | null;
1434
2763
  media: z.objectOutputType<{
1435
2764
  buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1436
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2765
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
1437
2766
  }, z.ZodTypeAny, "passthrough"> | null;
1438
- replied: {
1439
- channelId: string;
1440
- uniqueId: string;
1441
- message: (...args: unknown[]) => Record<string, any>;
1442
- senderId: string;
1443
- roomId: string;
1444
- isGroup: boolean;
1445
- text: string | null;
1446
- chatId: string;
1447
- receiverId: string;
1448
- receiverName: string;
1449
- roomName: string;
1450
- senderName: string;
1451
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1452
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1453
- timestamp: number;
1454
- mentions: string[];
1455
- links: string[];
1456
- isPrefix: boolean;
1457
- isFromMe: boolean;
1458
- isTagMe: boolean;
1459
- isStory: boolean;
1460
- isViewOnce: boolean;
1461
- isEdited: boolean;
1462
- isDeleted: boolean;
1463
- isPinned: boolean;
1464
- isUnPinned: boolean;
1465
- isChannel: boolean;
1466
- isBroadcast: boolean;
1467
- isEphemeral: boolean;
1468
- isForwarded: boolean;
1469
- citation: Record<string, boolean> | null;
1470
- media: z.objectOutputType<{
1471
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1472
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1473
- }, z.ZodTypeAny, "passthrough"> | null;
1474
- } | null;
1475
- } | null>;
1476
- delete(del: z.infer<typeof DeleteWorkerBaseType>): Promise<{
2767
+ } | null;
2768
+ }, {
2769
+ channelId: string;
2770
+ uniqueId: string;
2771
+ message: (...args: unknown[]) => Record<string, any>;
2772
+ senderId: string;
2773
+ roomId: string;
2774
+ isGroup: boolean;
2775
+ text: string | null;
2776
+ chatId: string;
2777
+ receiverId: string;
2778
+ receiverName: string;
2779
+ roomName: string;
2780
+ senderName: string;
2781
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
2782
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
2783
+ timestamp: number;
2784
+ mentions: string[];
2785
+ links: string[];
2786
+ isPrefix: boolean;
2787
+ isSpam: boolean;
2788
+ isFromMe: boolean;
2789
+ isTagMe: boolean;
2790
+ isStory: boolean;
2791
+ isViewOnce: boolean;
2792
+ isEdited: boolean;
2793
+ isDeleted: boolean;
2794
+ isPinned: boolean;
2795
+ isUnPinned: boolean;
2796
+ isChannel: boolean;
2797
+ isBroadcast: boolean;
2798
+ isEphemeral: boolean;
2799
+ isForwarded: boolean;
2800
+ citation: Record<string, boolean> | null;
2801
+ media: z.objectInputType<{
2802
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
2803
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
2804
+ }, z.ZodTypeAny, "passthrough"> | null;
2805
+ replied: {
1477
2806
  channelId: string;
1478
2807
  uniqueId: string;
1479
2808
  message: (...args: unknown[]) => Record<string, any>;
@@ -1492,6 +2821,7 @@ declare class Worker {
1492
2821
  mentions: string[];
1493
2822
  links: string[];
1494
2823
  isPrefix: boolean;
2824
+ isSpam: boolean;
1495
2825
  isFromMe: boolean;
1496
2826
  isTagMe: boolean;
1497
2827
  isStory: boolean;
@@ -1505,142 +2835,11 @@ declare class Worker {
1505
2835
  isEphemeral: boolean;
1506
2836
  isForwarded: boolean;
1507
2837
  citation: Record<string, boolean> | null;
1508
- media: z.objectOutputType<{
2838
+ media: z.objectInputType<{
1509
2839
  buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1510
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
2840
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Readable, z.ZodTypeDef, Readable>>;
1511
2841
  }, z.ZodTypeAny, "passthrough"> | null;
1512
- replied: {
1513
- channelId: string;
1514
- uniqueId: string;
1515
- message: (...args: unknown[]) => Record<string, any>;
1516
- senderId: string;
1517
- roomId: string;
1518
- isGroup: boolean;
1519
- text: string | null;
1520
- chatId: string;
1521
- receiverId: string;
1522
- receiverName: string;
1523
- roomName: string;
1524
- senderName: string;
1525
- senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1526
- chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1527
- timestamp: number;
1528
- mentions: string[];
1529
- links: string[];
1530
- isPrefix: boolean;
1531
- isFromMe: boolean;
1532
- isTagMe: boolean;
1533
- isStory: boolean;
1534
- isViewOnce: boolean;
1535
- isEdited: boolean;
1536
- isDeleted: boolean;
1537
- isPinned: boolean;
1538
- isUnPinned: boolean;
1539
- isChannel: boolean;
1540
- isBroadcast: boolean;
1541
- isEphemeral: boolean;
1542
- isForwarded: boolean;
1543
- citation: Record<string, boolean> | null;
1544
- media: z.objectOutputType<{
1545
- buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>>;
1546
- stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodType<stream.Readable, z.ZodTypeDef, stream.Readable>>;
1547
- }, z.ZodTypeAny, "passthrough"> | null;
1548
- } | null;
1549
- } | null>;
1550
- rejectCall(call: z.infer<typeof RejectCallWorkerBaseType>): Promise<void | undefined>;
1551
- mute(mute: z.infer<typeof MuteWorkerBaseType>, options: z.infer<typeof MuteWorkerOptionsType>): Promise<void | undefined>;
1552
- profile(roomId: z.infer<typeof ProfileWorkerBaseType>): Promise<z.infer<typeof ProfileWorkerBaseOutputType> | null>;
1553
- presence(action: z.infer<typeof PresenceWorkerBaseType>, options: z.infer<typeof PresenceWorkerOptionsType>): Promise<void | undefined>;
1554
- addCompletion(props: z.infer<typeof llmMessagesTable>): Promise<{
1555
- channelId: string;
1556
- uniqueId: string;
1557
- role: string;
1558
- content: string;
1559
- model?: string | null | undefined;
1560
- additional?: string | null | undefined;
1561
- }>;
1562
- deleteCompletion(uniqueId: string): Promise<boolean>;
1563
- updateCompletion(uniqueId: string, props: Partial<z.infer<typeof llmMessagesTable>>): Promise<{
1564
- channelId: string;
1565
- uniqueId: string;
1566
- role: string;
1567
- content: string;
1568
- model?: string | null | undefined;
1569
- additional?: string | null | undefined;
1570
- }>;
1571
- clearCompletions(channelId: string): Promise<boolean>;
1572
- getCompletion(uniqueId: string): Promise<{
1573
- channelId: string;
1574
- uniqueId: string;
1575
- role: string;
1576
- content: string;
1577
- model?: string | null | undefined;
1578
- additional?: string | null | undefined;
1579
- } | null>;
1580
- getCompletions(channelId: string): Promise<{
1581
- channelId: string;
1582
- uniqueId: string;
1583
- role: string;
1584
- content: string;
1585
- model?: string | null | undefined;
1586
- additional?: string | null | undefined;
1587
- }[]>;
1588
- addPersonalization(props: z.infer<typeof llmPersonalizationTable>): Promise<{
1589
- uniqueId: string;
1590
- content: string;
1591
- senderId: string;
1592
- }>;
1593
- deletePersonalization(uniqueId: string): Promise<boolean>;
1594
- clearPersonalization(senderId: string): Promise<boolean>;
1595
- getPersonalization(senderId: string): Promise<{
1596
- uniqueId: string;
1597
- content: string;
1598
- senderId: string;
1599
- }[]>;
1600
- addRAG(props: z.infer<typeof addRAGType>): Promise<any>;
1601
- deleteRAG(id: string): Promise<boolean>;
1602
- updateRAG(id: string): Promise<{
1603
- metadata: {
1604
- id: string;
1605
- };
1606
- pageContent: string;
1607
- }>;
1608
- clearRAGs(): Promise<boolean>;
1609
- getRAG(id: string): Promise<{
1610
- metadata: {
1611
- id: string;
1612
- };
1613
- pageContent: string;
1614
- } | null>;
1615
- getRAGs(keyword: string): Promise<{
1616
- metadata: {
1617
- id: string;
1618
- };
1619
- pageContent: string;
1620
- }[]>;
1621
- llms: llmsAdapter;
1622
- }
1623
-
1624
- declare class Client {
1625
- private props;
1626
- options: z.infer<typeof ClientClassesType>;
1627
- cache: NodeCache;
1628
- private chatId;
1629
- private logger;
1630
- private db;
1631
- private socket;
1632
- private events;
1633
- private spinners;
1634
- private worker;
1635
- constructor(props: z.input<typeof ClientClassesType>);
1636
- initialize(): Promise<void>;
1637
- startSpinner(key: string, message: string): Ora;
1638
- stopSpinner(key: string, succeed: boolean, message?: string): void;
1639
- failSpinner(key: string, message?: string): void;
1640
- on<T extends EventEnumType>(event: T, handler: EventCallbackType[T]): void;
1641
- emit<T extends EventEnumType>(event: T, ...args: Parameters<EventCallbackType[T]>): void;
1642
- }
1643
- interface Client extends Worker {
1644
- }
2842
+ } | null;
2843
+ }>;
1645
2844
 
1646
- export { Client };
2845
+ export { AdapterDatabaseType, CallsParserBaseType, CitationType, Client, ClientClassesBaseType, ClientClassesType, ContactWorkerBaseType, ContactWorkerOptionsType, DeleteWorkerBaseType, EditWorkerBaseType, EditWorkerOptionsType, type EventCallbackType, EventEnumType, LocationWorkerBaseType, LocationWorkerOptionsType, MediaInputWorkerType, MessagesDeviceEnumType, MessagesEnumType, MessagesMediaType, MessagesParserBaseType, MessagesParserType, MessagesVerifiedPlatformType, MuteWorkerBaseType, MuteWorkerOptionsType, PinWorkerBaseType, PinWorkerOptionsType, PollWorkerBaseType, PollWorkerOptionsType, PresenceWorkerBaseType, PresenceWorkerOptionsType, ProfileWorkerBaseOutputType, ProfileWorkerBaseType, ReactionWorkerBaseType, ReactionWorkerOptionsType, RejectCallWorkerBaseType, TextWorkerBaseType, TextWorkerOptionsType, addRAGType, llmMessagesTable, llmPersonalizationTable, llmRAGTable, type llmsAdapter };