@ostyado/baileys 1.1.9 → 2.0.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 (110) hide show
  1. package/LICENSE +21 -0
  2. package/WAProto/index.js +131281 -59270
  3. package/lib/Defaults/baileys-version.json +1 -1
  4. package/lib/Defaults/index.js +6 -6
  5. package/lib/Socket/chats.js +48 -16
  6. package/lib/Socket/dugong.js +637 -0
  7. package/lib/Socket/groups.js +0 -64
  8. package/lib/Socket/messages-send.js +146 -301
  9. package/lib/Socket/newsletter.js +135 -23
  10. package/lib/Socket/socket.js +2 -73
  11. package/lib/Utils/generics.js +80 -5
  12. package/lib/Utils/messages.js +4 -33
  13. package/lib/Utils/validate-connection.js +2 -2
  14. package/lib/index.js +15 -13
  15. package/package.json +14 -13
  16. package/WAProto/fix-import.js +0 -29
  17. package/lib/Defaults/index.d.ts +0 -53
  18. package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
  19. package/lib/Signal/Group/group-session-builder.d.ts +0 -14
  20. package/lib/Signal/Group/group_cipher.d.ts +0 -17
  21. package/lib/Signal/Group/index.d.ts +0 -11
  22. package/lib/Signal/Group/keyhelper.d.ts +0 -10
  23. package/lib/Signal/Group/queue-job.d.ts +0 -1
  24. package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
  25. package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
  26. package/lib/Signal/Group/sender-key-message.d.ts +0 -18
  27. package/lib/Signal/Group/sender-key-name.d.ts +0 -17
  28. package/lib/Signal/Group/sender-key-record.d.ts +0 -30
  29. package/lib/Signal/Group/sender-key-state.d.ts +0 -38
  30. package/lib/Signal/Group/sender-message-key.d.ts +0 -11
  31. package/lib/Signal/libsignal.d.ts +0 -3
  32. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
  33. package/lib/Socket/Client/index.d.ts +0 -3
  34. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
  35. package/lib/Socket/Client/web-socket-client.d.ts +0 -12
  36. package/lib/Socket/business.d.ts +0 -171
  37. package/lib/Socket/chats.d.ts +0 -267
  38. package/lib/Socket/groups.d.ts +0 -115
  39. package/lib/Socket/index.d.ts +0 -173
  40. package/lib/Socket/luxu.d.ts +0 -278
  41. package/lib/Socket/luxu.js +0 -620
  42. package/lib/Socket/messages-recv.d.ts +0 -161
  43. package/lib/Socket/messages-send.d.ts +0 -149
  44. package/lib/Socket/newsletter.d.ts +0 -134
  45. package/lib/Socket/registration.d.ts +0 -267
  46. package/lib/Socket/socket.d.ts +0 -44
  47. package/lib/Socket/usync.d.ts +0 -36
  48. package/lib/Store/index.d.ts +0 -3
  49. package/lib/Store/make-cache-manager-store.d.ts +0 -13
  50. package/lib/Store/make-in-memory-store.d.ts +0 -118
  51. package/lib/Store/make-ordered-dictionary.d.ts +0 -13
  52. package/lib/Store/object-repository.d.ts +0 -10
  53. package/lib/Types/Auth.d.ts +0 -110
  54. package/lib/Types/Call.d.ts +0 -13
  55. package/lib/Types/Chat.d.ts +0 -102
  56. package/lib/Types/Contact.d.ts +0 -19
  57. package/lib/Types/Events.d.ts +0 -157
  58. package/lib/Types/GroupMetadata.d.ts +0 -55
  59. package/lib/Types/Label.d.ts +0 -35
  60. package/lib/Types/LabelAssociation.d.ts +0 -29
  61. package/lib/Types/Message.d.ts +0 -273
  62. package/lib/Types/Newsletter.d.ts +0 -103
  63. package/lib/Types/Product.d.ts +0 -78
  64. package/lib/Types/Signal.d.ts +0 -57
  65. package/lib/Types/Socket.d.ts +0 -111
  66. package/lib/Types/State.d.ts +0 -27
  67. package/lib/Types/USync.d.ts +0 -25
  68. package/lib/Types/index.d.ts +0 -57
  69. package/lib/Utils/auth-utils.d.ts +0 -18
  70. package/lib/Utils/baileys-event-stream.d.ts +0 -16
  71. package/lib/Utils/business.d.ts +0 -22
  72. package/lib/Utils/chat-utils.d.ts +0 -71
  73. package/lib/Utils/crypto.d.ts +0 -41
  74. package/lib/Utils/decode-wa-message.d.ts +0 -19
  75. package/lib/Utils/event-buffer.d.ts +0 -35
  76. package/lib/Utils/generics.d.ts +0 -92
  77. package/lib/Utils/history.d.ts +0 -15
  78. package/lib/Utils/index.d.ts +0 -17
  79. package/lib/Utils/link-preview.d.ts +0 -21
  80. package/lib/Utils/logger.d.ts +0 -4
  81. package/lib/Utils/lt-hash.d.ts +0 -12
  82. package/lib/Utils/make-mutex.d.ts +0 -7
  83. package/lib/Utils/messages-media.d.ts +0 -116
  84. package/lib/Utils/messages.d.ts +0 -77
  85. package/lib/Utils/noise-handler.d.ts +0 -21
  86. package/lib/Utils/process-message.d.ts +0 -41
  87. package/lib/Utils/signal.d.ts +0 -32
  88. package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
  89. package/lib/Utils/validate-connection.d.ts +0 -11
  90. package/lib/WABinary/constants.d.ts +0 -30
  91. package/lib/WABinary/decode.d.ts +0 -7
  92. package/lib/WABinary/encode.d.ts +0 -3
  93. package/lib/WABinary/generic-utils.d.ts +0 -17
  94. package/lib/WABinary/index.d.ts +0 -5
  95. package/lib/WABinary/jid-utils.d.ts +0 -31
  96. package/lib/WABinary/types.d.ts +0 -18
  97. package/lib/WAM/BinaryInfo.d.ts +0 -17
  98. package/lib/WAM/constants.d.ts +0 -38
  99. package/lib/WAM/encode.d.ts +0 -3
  100. package/lib/WAM/index.d.ts +0 -3
  101. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
  102. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
  103. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
  104. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
  105. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
  106. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
  107. package/lib/WAUSync/Protocols/index.d.ts +0 -4
  108. package/lib/WAUSync/USyncQuery.d.ts +0 -28
  109. package/lib/WAUSync/USyncUser.d.ts +0 -12
  110. package/lib/index.d.ts +0 -12
@@ -1,278 +0,0 @@
1
- import { proto } from '../../WAProto';
2
-
3
- declare namespace imup {
4
- interface MediaUploadOptions {
5
- fileEncSha256?: Buffer;
6
- mediaType?: string;
7
- newsletter?: boolean;
8
- }
9
-
10
- type WAMediaUploadFunction = (
11
- stream: Buffer | NodeJS.ReadableStream,
12
- options?: MediaUploadOptions
13
- ) => Promise<{ url: string; directPath: string }>;
14
-
15
- interface WAMessageContentGenerationOptions {
16
- upload?: WAMediaUploadFunction;
17
- mediaCache?: any;
18
- options?: any;
19
- logger?: any;
20
- }
21
-
22
- interface StickerMessage {
23
- url: string;
24
- fileSha256: Buffer | string;
25
- fileEncSha256: Buffer | string;
26
- mediaKey: Buffer | string;
27
- mimetype: string;
28
- directPath: string;
29
- fileLength: number | string;
30
- mediaKeyTimestamp: number | string;
31
- isAnimated?: boolean;
32
- stickerSentTs?: number | string;
33
- isAvatar?: boolean;
34
- isAiSticker?: boolean;
35
- isLottie?: boolean;
36
- }
37
-
38
- interface PaymentMessage {
39
- amount: number;
40
- currency?: string;
41
- from?: string;
42
- expiry?: number;
43
- sticker?: { stickerMessage: StickerMessage };
44
- note?: string;
45
- background?: {
46
- id?: string;
47
- fileLength?: string;
48
- width?: number;
49
- height?: number;
50
- mimetype?: string;
51
- placeholderArgb?: number;
52
- textArgb?: number;
53
- subtextArgb?: number;
54
- };
55
- }
56
-
57
- interface ProductMessage {
58
- title: string;
59
- description: string;
60
- thumbnail: Buffer | { url: string };
61
- productId: string;
62
- retailerId: string;
63
- url: string;
64
- body?: string;
65
- footer?: string;
66
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
67
- priceAmount1000?: number | null;
68
- currencyCode?: string;
69
- }
70
-
71
- interface InteractiveMessage {
72
- title: string;
73
- footer?: string;
74
- thumbnail?: string;
75
- image?: string | Buffer | { url: string };
76
- video?: string | Buffer | { url: string };
77
- document?: Buffer;
78
- mimetype?: string;
79
- fileName?: string;
80
- jpegThumbnail?: Buffer;
81
- contextInfo?: {
82
- mentionedJid?: string[];
83
- forwardingScore?: number;
84
- isForwarded?: boolean;
85
- forwardedNewsletterMessageInfo?: proto.Message.ContextInfo.ForwardedNewsletterMessageInfo;
86
- externalAdReply?: {
87
- title?: string;
88
- body?: string;
89
- mediaType?: number;
90
- thumbnailUrl?: string;
91
- mediaUrl?: string;
92
- sourceUrl?: string;
93
- showAdAttribution?: boolean;
94
- renderLargerThumbnail?: boolean;
95
- [key: string]: any;
96
- };
97
- [key: string]: any;
98
- };
99
- externalAdReply?: {
100
- title?: string;
101
- body?: string;
102
- mediaType?: number;
103
- thumbnailUrl?: string;
104
- mediaUrl?: string;
105
- sourceUrl?: string;
106
- showAdAttribution?: boolean;
107
- renderLargerThumbnail?: boolean;
108
- [key: string]: any;
109
- };
110
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
111
- nativeFlowMessage?: {
112
- messageParamsJson?: string;
113
- buttons?: proto.Message.InteractiveMessage.INativeFlowButton[];
114
- [key: string]: any;
115
- };
116
- }
117
-
118
- interface AlbumItem {
119
- image?: { url: string; caption?: string };
120
- video?: { url: string; caption?: string };
121
- }
122
-
123
- interface EventMessageLocation {
124
- degreesLatitude: number;
125
- degreesLongitude: number;
126
- name: string;
127
- }
128
-
129
- interface EventMessage {
130
- isCanceled?: boolean;
131
- name: string;
132
- description: string;
133
- location?: EventMessageLocation;
134
- joinLink?: string;
135
- startTime?: string | number;
136
- endTime?: string | number;
137
- extraGuestsAllowed?: boolean;
138
- }
139
-
140
- interface PollVote {
141
- optionName: string;
142
- optionVoteCount: string | number;
143
- }
144
-
145
- interface PollResultMessage {
146
- name: string;
147
- pollVotes: PollVote[];
148
- newsletter?: {
149
- newsletterName: string;
150
- newsletterJid: string;
151
- };
152
- }
153
-
154
- interface StatusMentionMessage {
155
- image?: { url: string } | string;
156
- video?: { url: string } | string;
157
- mentions: string[];
158
- }
159
-
160
- interface OrderMessage {
161
- thumbnail?: Buffer | string,
162
- itemCount?: string | number,
163
- message: string,
164
- orderTitle: string,
165
- totalAmount1000?: string | number,
166
- totalCurrencyCode?: string
167
- }
168
-
169
- interface GroupStatus {
170
- message?: any;
171
- image?: string | Buffer | { url: string };
172
- video?: string | Buffer | { url: string };
173
- text?: string;
174
- caption?: string;
175
- document?: string | Buffer | { url: string };
176
- [key: string]: any;
177
- }
178
-
179
- interface GroupLabel {
180
- labelText: string;
181
- }
182
-
183
- interface MessageContent {
184
- requestPaymentMessage?: PaymentMessage;
185
- productMessage?: ProductMessage;
186
- interactiveMessage?: InteractiveMessage;
187
- albumMessage?: AlbumItem[];
188
- eventMessage?: EventMessage;
189
- pollResultMessage?: PollResultMessage;
190
- groupStatus?: GroupStatus;
191
- orderMessage?: OrderMessage;
192
- groupLabel?: GroupLabel;
193
- sender?: string;
194
- }
195
-
196
- interface MessageOptions {
197
- quoted?: proto.IWebMessageInfo;
198
- filter?: boolean;
199
- }
200
-
201
- interface Utils {
202
- prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
203
- generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
204
- generateWAMessageFromContent: (jid: string, content: any, options?: any) => Promise<any>;
205
- generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
206
- generateMessageID: () => string;
207
- }
208
- }
209
-
210
- declare class imup {
211
- constructor(
212
- utils: imup.Utils,
213
- waUploadToServer: imup.WAMediaUploadFunction,
214
- relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
215
- );
216
-
217
- detectType(content: imup.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STATUS' | 'ORDER' | 'GROUP_LABEL' |null;
218
-
219
- handlePayment(
220
- content: { requestPaymentMessage: imup.PaymentMessage },
221
- quoted?: proto.IWebMessageInfo
222
- ): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
223
-
224
- handleProduct(
225
- content: { productMessage: imup.ProductMessage },
226
- jid: string,
227
- quoted?: proto.IWebMessageInfo
228
- ): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
229
-
230
- handleInteractive(
231
- content: { interactiveMessage: imup.InteractiveMessage },
232
- jid: string,
233
- quoted?: proto.IWebMessageInfo
234
- ): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
235
-
236
- handleAlbum(
237
- content: { albumMessage: imup.AlbumItem[] },
238
- jid: string,
239
- quoted?: proto.IWebMessageInfo
240
- ): Promise<any>;
241
-
242
- handleEvent(
243
- content: { eventMessage: imup.EventMessage },
244
- jid: string,
245
- quoted?: proto.IWebMessageInfo
246
- ): Promise<any>;
247
-
248
- handlePollResult(
249
- content: { pollResultMessage: imup.PollResultMessage },
250
- jid: string,
251
- quoted?: proto.IWebMessageInfo
252
- ): Promise<any>;
253
-
254
- handleStMention(
255
- content: { statusMentionMessage: imup.StatusMentionMessage },
256
- jid: string,
257
- quoted?: proto.IWebMessageInfo
258
- ): Promise<any>;
259
-
260
- handleOrderMessage(
261
- content: { orderMessage: imup.OrderMessage },
262
- jid: string,
263
- quoted?: proto.IWebMessageInfo
264
- ): Promise<any>;
265
-
266
- handleGroupStory(
267
- content: { groupStatus: imup.GroupStatus },
268
- jid: string,
269
- quoted?: proto.IWebMessageInfo
270
- ): Promise<any>;
271
-
272
- handleGbLabel(
273
- content: { groupLabel: imup.GroupLabel },
274
- jid: string,
275
- ): Promise<any>;
276
- }
277
-
278
- export = imup;