alipclutch-baileys 6.7.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/LICENSE +1 -1
  2. package/WAProto/index.js +77698 -117050
  3. package/engine-requirements.js +3 -3
  4. package/lib/Defaults/baileys-version.json +3 -0
  5. package/lib/Defaults/index.d.ts +6 -4
  6. package/lib/Defaults/index.js +118 -78
  7. package/lib/Defaults/phonenumber-mcc.json +223 -0
  8. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  9. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  10. package/lib/Socket/Client/index.d.ts +3 -2
  11. package/lib/Socket/Client/index.js +3 -2
  12. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  13. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  14. package/lib/Socket/Client/types.d.ts +1 -0
  15. package/lib/Socket/Client/types.js +1 -0
  16. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  17. package/lib/Socket/Client/web-socket-client.js +62 -0
  18. package/lib/Socket/Client/websocket.d.ts +1 -0
  19. package/lib/Socket/Client/websocket.js +1 -0
  20. package/lib/Socket/business.d.ts +58 -59
  21. package/lib/Socket/chats.d.ts +230 -45
  22. package/lib/Socket/chats.js +238 -139
  23. package/lib/Socket/dugong.d.ts +254 -0
  24. package/lib/Socket/dugong.js +483 -0
  25. package/lib/Socket/groups.d.ts +32 -41
  26. package/lib/Socket/groups.js +23 -38
  27. package/lib/Socket/index.d.ts +64 -63
  28. package/lib/Socket/index.js +3 -2
  29. package/lib/Socket/messages-recv.js +65 -9
  30. package/lib/Socket/messages-send.d.ts +47 -49
  31. package/lib/Socket/messages-send.js +420 -382
  32. package/lib/Socket/newsletter.d.ts +37 -39
  33. package/lib/Socket/newsletter.js +124 -71
  34. package/lib/Socket/registration.d.ts +267 -0
  35. package/lib/Socket/registration.js +166 -0
  36. package/lib/Socket/socket.d.ts +10 -10
  37. package/lib/Socket/socket.js +38 -62
  38. package/lib/Socket/usync.d.ts +4 -3
  39. package/lib/Socket/usync.js +1 -0
  40. package/lib/Store/index.d.ts +2 -1
  41. package/lib/Store/index.js +3 -1
  42. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  43. package/lib/Store/make-cache-manager-store.js +83 -0
  44. package/lib/Store/make-in-memory-store.d.ts +24 -24
  45. package/lib/Store/make-in-memory-store.js +14 -26
  46. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  47. package/lib/Store/make-ordered-dictionary.js +2 -2
  48. package/lib/Types/Auth.d.ts +7 -0
  49. package/lib/Types/Call.d.ts +1 -1
  50. package/lib/Types/Chat.d.ts +7 -14
  51. package/lib/Types/Contact.d.ts +1 -5
  52. package/lib/Types/Events.d.ts +2 -44
  53. package/lib/Types/GroupMetadata.d.ts +2 -11
  54. package/lib/Types/Label.js +1 -1
  55. package/lib/Types/LabelAssociation.js +1 -1
  56. package/lib/Types/Message.d.ts +21 -148
  57. package/lib/Types/Message.js +2 -0
  58. package/lib/Types/Newsletter.d.ts +97 -73
  59. package/lib/Types/Newsletter.js +38 -18
  60. package/lib/Types/Socket.d.ts +9 -17
  61. package/lib/Types/index.d.ts +1 -8
  62. package/lib/Types/index.js +2 -2
  63. package/lib/Utils/auth-utils.d.ts +3 -3
  64. package/lib/Utils/auth-utils.js +13 -6
  65. package/lib/Utils/business.js +2 -2
  66. package/lib/Utils/chat-utils.d.ts +16 -15
  67. package/lib/Utils/chat-utils.js +35 -36
  68. package/lib/Utils/crypto.d.ts +16 -15
  69. package/lib/Utils/crypto.js +29 -71
  70. package/lib/Utils/decode-wa-message.d.ts +6 -22
  71. package/lib/Utils/decode-wa-message.js +56 -65
  72. package/lib/Utils/event-buffer.d.ts +2 -2
  73. package/lib/Utils/event-buffer.js +7 -11
  74. package/lib/Utils/generics.d.ts +20 -17
  75. package/lib/Utils/generics.js +76 -96
  76. package/lib/Utils/history.d.ts +0 -4
  77. package/lib/Utils/history.js +6 -4
  78. package/lib/Utils/link-preview.d.ts +2 -2
  79. package/lib/Utils/link-preview.js +1 -34
  80. package/lib/Utils/logger.d.ts +3 -10
  81. package/lib/Utils/lt-hash.d.ts +2 -2
  82. package/lib/Utils/lt-hash.js +6 -6
  83. package/lib/Utils/make-mutex.d.ts +2 -2
  84. package/lib/Utils/messages-media.d.ts +24 -28
  85. package/lib/Utils/messages-media.js +236 -296
  86. package/lib/Utils/messages.d.ts +10 -13
  87. package/lib/Utils/messages.js +92 -325
  88. package/lib/Utils/noise-handler.d.ts +12 -10
  89. package/lib/Utils/noise-handler.js +23 -18
  90. package/lib/Utils/process-message.d.ts +4 -5
  91. package/lib/Utils/process-message.js +25 -108
  92. package/lib/Utils/signal.d.ts +1 -2
  93. package/lib/Utils/signal.js +26 -26
  94. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
  95. package/lib/Utils/use-multi-file-auth-state.js +6 -51
  96. package/lib/Utils/validate-connection.d.ts +4 -3
  97. package/lib/Utils/validate-connection.js +52 -20
  98. package/lib/WABinary/constants.d.ts +27 -24
  99. package/lib/WABinary/constants.js +13 -1276
  100. package/lib/WABinary/decode.d.ts +4 -3
  101. package/lib/WABinary/decode.js +13 -26
  102. package/lib/WABinary/encode.d.ts +2 -1
  103. package/lib/WABinary/encode.js +152 -137
  104. package/lib/WABinary/generic-utils.d.ts +4 -1
  105. package/lib/WABinary/generic-utils.js +125 -37
  106. package/lib/WABinary/jid-utils.d.ts +5 -11
  107. package/lib/WABinary/jid-utils.js +5 -28
  108. package/lib/WAM/BinaryInfo.d.ts +11 -2
  109. package/lib/WAM/encode.d.ts +2 -1
  110. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  111. package/lib/index.d.ts +1 -0
  112. package/lib/index.js +36 -43
  113. package/package.json +1 -1
  114. package/WAProto/GenerateStatics.sh +0 -4
  115. package/WAProto/WAProto.proto +0 -4775
  116. package/WAProto/index.d.ts +0 -55057
  117. package/WAProto/index.ts.ts +0 -53473
  118. package/WAProto/p.html +0 -1
  119. package/lib/Defaults/wileys-version.json +0 -3
  120. package/lib/WABinary/jid-utils.js.bak +0 -83
  121. /package/{README.MD → README.md} +0 -0
@@ -0,0 +1,254 @@
1
+ // Baileys By Denzy ZeroDay
2
+ import { proto } from '../../WAProto';
3
+
4
+ declare namespace kikyy {
5
+ interface MediaUploadOptions {
6
+ fileEncSha256?: Buffer;
7
+ mediaType?: string;
8
+ newsletter?: boolean;
9
+ }
10
+
11
+ type WAMediaUploadFunction = (
12
+ stream: Buffer | NodeJS.ReadableStream,
13
+ options?: MediaUploadOptions
14
+ ) => Promise<{ url: string; directPath: string }>;
15
+
16
+ interface WAMessageContentGenerationOptions {
17
+ upload?: WAMediaUploadFunction;
18
+ mediaCache?: any;
19
+ options?: any;
20
+ logger?: any;
21
+ }
22
+
23
+ interface StickerMessage {
24
+ url: string;
25
+ fileSha256: Buffer | string;
26
+ fileEncSha256: Buffer | string;
27
+ mediaKey: Buffer | string;
28
+ mimetype: string;
29
+ directPath: string;
30
+ fileLength: number | string;
31
+ mediaKeyTimestamp: number | string;
32
+ isAnimated?: boolean;
33
+ stickerSentTs?: number | string;
34
+ isAvatar?: boolean;
35
+ isAiSticker?: boolean;
36
+ isLottie?: boolean;
37
+ }
38
+
39
+ interface PaymentMessage {
40
+ amount: number;
41
+ currency?: string;
42
+ from?: string;
43
+ expiry?: number;
44
+ sticker?: { stickerMessage: StickerMessage };
45
+ note?: string;
46
+ background?: {
47
+ id?: string;
48
+ fileLength?: string;
49
+ width?: number;
50
+ height?: number;
51
+ mimetype?: string;
52
+ placeholderArgb?: number;
53
+ textArgb?: number;
54
+ subtextArgb?: number;
55
+ };
56
+ }
57
+
58
+ interface ProductMessage {
59
+ title: string;
60
+ description: string;
61
+ thumbnail: Buffer | { url: string };
62
+ productId: string;
63
+ retailerId: string;
64
+ url: string;
65
+ body?: string;
66
+ footer?: string;
67
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
68
+ priceAmount1000?: number | null;
69
+ currencyCode?: string;
70
+ }
71
+
72
+ interface InteractiveMessage {
73
+ header?: string;
74
+ title: string;
75
+ footer?: string;
76
+ thumbnail?: string;
77
+ image?: string | Buffer | { url: string };
78
+ video?: string | Buffer | { url: string };
79
+ document?: string | Buffer | { url: string };
80
+ mimetype?: string;
81
+ fileName?: string;
82
+ jpegThumbnail?: string | Buffer | { url: string };
83
+ contextInfo?: {
84
+ mentionedJid?: string[];
85
+ forwardingScore?: number;
86
+ isForwarded?: boolean;
87
+ externalAdReply?: {
88
+ title?: string;
89
+ body?: string;
90
+ mediaType?: number;
91
+ thumbnailUrl?: string;
92
+ mediaUrl?: string;
93
+ sourceUrl?: string;
94
+ showAdAttribution?: boolean;
95
+ renderLargerThumbnail?: boolean;
96
+ [key: string]: any;
97
+ };
98
+ [key: string]: any;
99
+ };
100
+ externalAdReply?: {
101
+ title?: string;
102
+ body?: string;
103
+ mediaType?: number;
104
+ thumbnailUrl?: string;
105
+ mediaUrl?: string;
106
+ sourceUrl?: string;
107
+ showAdAttribution?: boolean;
108
+ renderLargerThumbnail?: boolean;
109
+ [key: string]: any;
110
+ };
111
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
112
+ nativeFlowMessage?: {
113
+ messageParamsJson?: string;
114
+ buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
115
+ [key: string]: any;
116
+ };
117
+ }
118
+
119
+ interface AlbumItem {
120
+ image?: string | Buffer | { url: string; caption?: string };
121
+ video?: string | Buffer | { url: string; caption?: string };
122
+ }
123
+
124
+ interface EventMessageLocation {
125
+ degreesLatitude: number;
126
+ degreesLongitude: number;
127
+ name: string;
128
+ }
129
+
130
+ interface EventMessage {
131
+ isCanceled?: boolean;
132
+ name: string;
133
+ description: string;
134
+ location?: EventMessageLocation;
135
+ joinLink?: string;
136
+ startTime?: string | number;
137
+ endTime?: string | number;
138
+ extraGuestsAllowed?: boolean;
139
+ }
140
+
141
+ interface PollVote {
142
+ optionName: string;
143
+ optionVoteCount: string | number;
144
+ }
145
+
146
+ interface PollResultMessage {
147
+ name: string;
148
+ pollVotes: PollVote[];
149
+ }
150
+
151
+ interface GroupStatusMessage {
152
+ message?: any;
153
+ image?: string | Buffer | { url: string };
154
+ video?: string | Buffer | { url: string };
155
+ text?: string;
156
+ caption?: string;
157
+ document?: string | Buffer | { url: string };
158
+ [key: string]: any;
159
+ }
160
+
161
+ interface MessageContent {
162
+ requestPaymentMessage?: PaymentMessage;
163
+ productMessage?: ProductMessage;
164
+ interactiveMessage?: InteractiveMessage;
165
+ albumMessage?: AlbumItem[];
166
+ eventMessage?: EventMessage;
167
+ pollResultMessage?: PollResultMessage;
168
+ groupStatusMessage?: GroupStatusMessage;
169
+ sender?: string;
170
+ }
171
+
172
+ interface MessageOptions {
173
+ quoted?: proto.IWebMessageInfo;
174
+ filter?: boolean;
175
+ }
176
+
177
+ interface Utils {
178
+ prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
179
+ generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
180
+ generateWAMessageFromContent: (jid: string, content: any, options?: any) => Promise<any>;
181
+ generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
182
+ generateMessageID: () => string;
183
+ prepareMessageContent?: (content: any, options?: any) => Promise<any>;
184
+ }
185
+
186
+ interface BailUtils {
187
+ generateWAMessageContent?: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
188
+ generateMessageID: () => string;
189
+ getContentType: (msg: any) => string;
190
+ }
191
+ }
192
+
193
+ declare class kikyy {
194
+ constructor(
195
+ utils: kikyy.Utils,
196
+ waUploadToServer: kikyy.WAMediaUploadFunction,
197
+ relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
198
+ );
199
+
200
+ detectType(content: kikyy.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STORY' | null;
201
+
202
+ handlePayment(
203
+ content: { requestPaymentMessage: kikyy.PaymentMessage },
204
+ quoted?: proto.IWebMessageInfo
205
+ ): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
206
+
207
+ handleProduct(
208
+ content: { productMessage: kikyy.ProductMessage },
209
+ jid: string,
210
+ quoted?: proto.IWebMessageInfo
211
+ ): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
212
+
213
+ handleInteractive(
214
+ content: { interactiveMessage: kikyy.InteractiveMessage },
215
+ jid: string,
216
+ quoted?: proto.IWebMessageInfo
217
+ ): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
218
+
219
+ handleAlbum(
220
+ content: { albumMessage: kikyy.AlbumItem[] },
221
+ jid: string,
222
+ quoted?: proto.IWebMessageInfo
223
+ ): Promise<any>;
224
+
225
+ handleEvent(
226
+ content: { eventMessage: kikyy.EventMessage },
227
+ jid: string,
228
+ quoted?: proto.IWebMessageInfo
229
+ ): Promise<any>;
230
+
231
+ handlePollResult(
232
+ content: { pollResultMessage: kikyy.PollResultMessage },
233
+ jid: string,
234
+ quoted?: proto.IWebMessageInfo
235
+ ): Promise<any>;
236
+
237
+ handleGroupStory(
238
+ content: { groupStatusMessage: kikyy.GroupStatusMessage },
239
+ jid: string,
240
+ quoted?: proto.IWebMessageInfo
241
+ ): Promise<any>;
242
+
243
+ buildMessageContent(
244
+ content: any,
245
+ opts?: kikyy.WAMessageContentGenerationOptions
246
+ ): Promise<any>;
247
+
248
+ utils: kikyy.Utils;
249
+ relayMessage: (jid: string, content: any, options?: any) => Promise<any>;
250
+ waUploadToServer: kikyy.WAMediaUploadFunction;
251
+ bail: kikyy.BailUtils;
252
+ }
253
+
254
+ export = kikyy;