@zetagoaurum-socket/decagramton 3.2.4 → 3.2.7

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 (92) hide show
  1. package/README.md +91 -91
  2. package/WAProto/index.js +56886 -17506
  3. package/engine-requirements.js +91 -0
  4. package/lib/Defaults/index.js +47 -2
  5. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  6. package/lib/Signal/Group/ciphertext-message.js +15 -0
  7. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  8. package/lib/Signal/Group/group-session-builder.js +64 -0
  9. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  10. package/lib/Signal/Group/group_cipher.js +96 -0
  11. package/lib/Signal/Group/index.d.ts +11 -0
  12. package/lib/Signal/Group/index.js +57 -0
  13. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  14. package/lib/Signal/Group/keyhelper.js +55 -0
  15. package/lib/Signal/Group/queue-job.d.ts +1 -0
  16. package/lib/Signal/Group/queue-job.js +57 -0
  17. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  18. package/lib/Signal/Group/sender-chain-key.js +34 -0
  19. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  20. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  21. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  22. package/lib/Signal/Group/sender-key-message.js +69 -0
  23. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  24. package/lib/Signal/Group/sender-key-name.js +51 -0
  25. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  26. package/lib/Signal/Group/sender-key-record.js +53 -0
  27. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  28. package/lib/Signal/Group/sender-key-state.js +99 -0
  29. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  30. package/{WASignalGroup/sender_message_key.js → lib/Signal/Group/sender-message-key.js} +6 -16
  31. package/lib/Signal/libsignal.js +51 -29
  32. package/lib/Socket/business.d.ts +3 -2
  33. package/lib/Socket/chats.d.ts +215 -28
  34. package/lib/Socket/chats.js +166 -70
  35. package/lib/Socket/dugong.d.ts +254 -0
  36. package/lib/Socket/dugong.js +432 -141
  37. package/lib/Socket/groups.js +20 -23
  38. package/lib/Socket/index.js +2 -15
  39. package/lib/Socket/messages-recv.d.ts +56 -55
  40. package/lib/Socket/messages-recv.js +367 -131
  41. package/lib/Socket/messages-send.d.ts +3 -2
  42. package/lib/Socket/messages-send.js +423 -380
  43. package/lib/Socket/newsletter.js +147 -21
  44. package/lib/Socket/socket.js +156 -148
  45. package/lib/Socket/usync.d.ts +3 -3
  46. package/lib/Types/GroupMetadata.d.ts +1 -0
  47. package/lib/Types/Newsletter.d.ts +97 -86
  48. package/lib/Types/Newsletter.js +38 -32
  49. package/lib/Types/USync.d.ts +25 -0
  50. package/lib/Types/USync.js +2 -0
  51. package/lib/Utils/anti-crash.js +31 -0
  52. package/lib/Utils/chat-utils.js +6 -1
  53. package/lib/Utils/generics.js +66 -34
  54. package/lib/Utils/history.js +6 -1
  55. package/lib/Utils/index.js +0 -1
  56. package/lib/Utils/link-preview.js +1 -1
  57. package/lib/Utils/messages-media.js +145 -57
  58. package/lib/Utils/messages.js +92 -306
  59. package/lib/Utils/signal.js +48 -46
  60. package/lib/Utils/use-multi-file-auth-state.js +45 -6
  61. package/lib/Utils/validate-connection.js +89 -65
  62. package/lib/WABinary/constants.d.ts +27 -24
  63. package/lib/WABinary/encode.js +160 -123
  64. package/lib/WABinary/generic-utils.d.ts +2 -0
  65. package/lib/WABinary/generic-utils.js +124 -36
  66. package/lib/WABinary/jid-utils.js +5 -26
  67. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  68. package/lib/index.d.ts +1 -0
  69. package/lib/index.js +56 -0
  70. package/package.json +107 -101
  71. package/LICENSE +0 -21
  72. package/WAProto/GenerateStatics.sh +0 -4
  73. package/WAProto/WAProto.proto +0 -3344
  74. package/WAProto/index.d.ts +0 -37016
  75. package/WASignalGroup/GroupProtocol.js +0 -1697
  76. package/WASignalGroup/ciphertext_message.js +0 -16
  77. package/WASignalGroup/group_cipher.js +0 -120
  78. package/WASignalGroup/group_session_builder.js +0 -46
  79. package/WASignalGroup/index.js +0 -5
  80. package/WASignalGroup/keyhelper.js +0 -21
  81. package/WASignalGroup/protobufs.js +0 -3
  82. package/WASignalGroup/queue_job.js +0 -69
  83. package/WASignalGroup/sender_chain_key.js +0 -50
  84. package/WASignalGroup/sender_key_distribution_message.js +0 -78
  85. package/WASignalGroup/sender_key_message.js +0 -92
  86. package/WASignalGroup/sender_key_name.js +0 -70
  87. package/WASignalGroup/sender_key_record.js +0 -56
  88. package/WASignalGroup/sender_key_state.js +0 -129
  89. package/decagramton.jpg +0 -0
  90. package/lib/Utils/rate-limiter.js +0 -55
  91. package/lib/WAUSync/Fall +0 -1
  92. package/lib/WAUSync/Protocols/Fal +0 -1
@@ -0,0 +1,254 @@
1
+ // dugong.d.ts
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;