@alannxd/baileys 6.0.4 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +14017 -0
- package/WAProto/index.js +201 -160
- package/engine-requirements.js +1 -1
- package/lib/Defaults/index.d.ts +37 -15
- package/lib/Defaults/index.js +119 -136
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.js +2 -5
- package/lib/Signal/Group/group-session-builder.d.ts +4 -3
- package/lib/Signal/Group/group-session-builder.js +7 -41
- package/lib/Signal/Group/group_cipher.d.ts +4 -4
- package/lib/Signal/Group/group_cipher.js +37 -51
- package/lib/Signal/Group/index.d.ts +12 -11
- package/lib/Signal/Group/index.js +12 -57
- package/lib/Signal/Group/keyhelper.d.ts +2 -1
- package/lib/Signal/Group/keyhelper.js +7 -44
- package/lib/Signal/Group/sender-chain-key.d.ts +3 -2
- package/lib/Signal/Group/sender-chain-key.js +7 -15
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-distribution-message.js +8 -11
- package/lib/Signal/Group/sender-key-message.d.ts +2 -1
- package/lib/Signal/Group/sender-key-message.js +9 -12
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.js +2 -5
- package/lib/Signal/Group/sender-key-record.d.ts +3 -2
- package/lib/Signal/Group/sender-key-record.js +9 -21
- package/lib/Signal/Group/sender-key-state.d.ts +7 -6
- package/lib/Signal/Group/sender-key-state.js +27 -42
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.js +4 -7
- package/lib/Signal/libsignal.d.ts +5 -3
- package/lib/Signal/libsignal.js +347 -90
- package/lib/Signal/lid-mapping.d.ts +23 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.d.ts +3 -3
- package/lib/Socket/Client/index.js +3 -19
- package/lib/Socket/Client/{abstract-socket-client.d.ts → types.d.ts} +4 -5
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/{web-socket-client.d.ts → websocket.d.ts} +3 -2
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/business.d.ts +154 -108
- package/lib/Socket/business.js +162 -43
- package/lib/Socket/chats.d.ts +96 -239
- package/lib/Socket/chats.js +627 -427
- package/lib/Socket/communities.d.ts +239 -146
- package/lib/Socket/communities.js +90 -80
- package/lib/Socket/groups.d.ts +104 -57
- package/lib/Socket/groups.js +154 -161
- package/lib/Socket/index.d.ts +202 -115
- package/lib/Socket/index.js +11 -10
- package/lib/Socket/luxu.d.ts +22 -266
- package/lib/Socket/luxu.js +422 -465
- package/lib/Socket/messages-recv.d.ts +136 -84
- package/lib/Socket/messages-recv.js +1421 -615
- package/lib/Socket/messages-send.d.ts +142 -126
- package/lib/Socket/messages-send.js +878 -671
- package/lib/Socket/mex.d.ts +3 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/newsletter.d.ts +121 -85
- package/lib/Socket/newsletter.js +147 -272
- package/lib/Socket/socket.d.ts +34 -19
- package/lib/Socket/socket.js +544 -313
- package/lib/Store/index.d.ts +10 -3
- package/lib/Store/index.js +10 -10
- package/lib/Store/keyed-db.d.ts +22 -0
- package/lib/Store/keyed-db.js +108 -0
- package/lib/Store/make-cache-manager-store.d.ts +17 -11
- package/lib/Store/make-cache-manager-store.js +43 -41
- package/lib/Store/make-in-memory-store.d.ts +39 -118
- package/lib/Store/make-in-memory-store.js +112 -341
- package/lib/Store/make-ordered-dictionary.d.ts +11 -10
- package/lib/Store/make-ordered-dictionary.js +14 -20
- package/lib/Store/object-repository.d.ts +10 -9
- package/lib/Store/object-repository.js +11 -6
- package/lib/Types/Auth.d.ts +19 -12
- package/lib/Types/Auth.js +2 -2
- package/lib/Types/Bussines.d.ts +25 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.d.ts +3 -1
- package/lib/Types/Call.js +2 -2
- package/lib/Types/Chat.d.ts +35 -13
- package/lib/Types/Chat.js +8 -4
- package/lib/Types/Contact.d.ts +8 -1
- package/lib/Types/Contact.js +2 -2
- package/lib/Types/Events.d.ts +116 -17
- package/lib/Types/Events.js +2 -2
- package/lib/Types/GroupMetadata.d.ts +21 -5
- package/lib/Types/GroupMetadata.js +2 -2
- package/lib/Types/Label.d.ts +12 -0
- package/lib/Types/Label.js +3 -5
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.js +3 -5
- package/lib/Types/Message.d.ts +105 -58
- package/lib/Types/Message.js +11 -9
- package/lib/Types/Mex.d.ts +141 -0
- package/lib/Types/Mex.js +37 -0
- package/lib/Types/Product.d.ts +2 -1
- package/lib/Types/Product.js +2 -2
- package/lib/Types/Signal.d.ts +32 -2
- package/lib/Types/Signal.js +2 -2
- package/lib/Types/Socket.d.ts +50 -25
- package/lib/Types/Socket.js +3 -2
- package/lib/Types/State.d.ts +72 -2
- package/lib/Types/State.js +56 -2
- package/lib/Types/USync.d.ts +3 -2
- package/lib/Types/USync.js +2 -2
- package/lib/Types/index.d.ts +22 -14
- package/lib/Types/index.js +15 -31
- package/lib/Utils/auth-utils.d.ts +12 -6
- package/lib/Utils/auth-utils.js +239 -143
- package/lib/Utils/browser-utils.d.ts +4 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/business.d.ts +3 -2
- package/lib/Utils/business.js +66 -69
- package/lib/Utils/chat-utils.d.ts +52 -23
- package/lib/Utils/chat-utils.js +396 -253
- package/lib/Utils/companion-reg-client-utils.d.ts +17 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/crypto.d.ts +18 -22
- package/lib/Utils/crypto.js +57 -90
- package/lib/Utils/decode-wa-message.d.ts +55 -8
- package/lib/Utils/decode-wa-message.js +203 -84
- package/lib/Utils/event-buffer.d.ts +9 -8
- package/lib/Utils/event-buffer.js +185 -77
- package/lib/Utils/generics.d.ts +28 -29
- package/lib/Utils/generics.js +180 -210
- package/lib/Utils/history.d.ts +18 -9
- package/lib/Utils/history.js +93 -55
- package/lib/Utils/identity-change-handler.d.ts +44 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.d.ts +22 -17
- package/lib/Utils/index.js +22 -33
- package/lib/Utils/link-preview.d.ts +5 -5
- package/lib/Utils/link-preview.js +16 -24
- package/lib/Utils/logger.d.ts +11 -3
- package/lib/Utils/logger.js +3 -7
- package/lib/Utils/lt-hash.d.ts +8 -12
- package/lib/Utils/lt-hash.js +3 -46
- package/lib/Utils/make-mutex.d.ts +4 -2
- package/lib/Utils/make-mutex.js +24 -34
- package/lib/Utils/message-retry-manager.d.ts +115 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/messages-media.d.ts +61 -44
- package/lib/Utils/messages-media.js +451 -482
- package/lib/Utils/messages.d.ts +32 -18
- package/lib/Utils/messages.js +458 -369
- package/lib/Utils/noise-handler.d.ts +13 -14
- package/lib/Utils/noise-handler.js +145 -99
- package/lib/Utils/offline-node-processor.d.ts +17 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/pre-key-manager.d.ts +28 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.d.ts +31 -12
- package/lib/Utils/process-message.js +459 -150
- package/lib/Utils/reporting-utils.d.ts +11 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/signal.d.ts +20 -5
- package/lib/Utils/signal.js +120 -72
- package/lib/Utils/stanza-ack.d.ts +11 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/sync-action-utils.d.ts +19 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.d.ts +37 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +2 -2
- package/lib/Utils/use-multi-file-auth-state.js +29 -27
- package/lib/Utils/validate-connection.d.ts +7 -7
- package/lib/Utils/validate-connection.js +73 -99
- package/lib/WABinary/constants.d.ts +25 -27
- package/lib/WABinary/constants.js +1281 -20
- package/lib/WABinary/decode.d.ts +5 -5
- package/lib/WABinary/decode.js +52 -42
- package/lib/WABinary/encode.d.ts +3 -3
- package/lib/WABinary/encode.js +110 -155
- package/lib/WABinary/generic-utils.d.ts +8 -7
- package/lib/WABinary/generic-utils.js +48 -49
- package/lib/WABinary/index.d.ts +6 -5
- package/lib/WABinary/index.js +6 -21
- package/lib/WABinary/jid-utils.d.ts +25 -8
- package/lib/WABinary/jid-utils.js +74 -40
- package/lib/WABinary/types.d.ts +2 -1
- package/lib/WABinary/types.js +2 -2
- package/lib/WAM/BinaryInfo.d.ts +3 -11
- package/lib/WAM/BinaryInfo.js +2 -5
- package/lib/WAM/constants.d.ts +5 -3
- package/lib/WAM/constants.js +19071 -11568
- package/lib/WAM/encode.d.ts +3 -3
- package/lib/WAM/encode.js +17 -22
- package/lib/WAM/index.d.ts +4 -3
- package/lib/WAM/index.js +4 -19
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +33 -13
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +11 -14
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +9 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +3 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +9 -13
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +4 -3
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +20 -22
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +5 -3
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +13 -8
- package/lib/WAUSync/Protocols/index.d.ts +6 -4
- package/lib/WAUSync/Protocols/index.js +6 -20
- package/lib/WAUSync/USyncQuery.d.ts +6 -4
- package/lib/WAUSync/USyncQuery.js +44 -35
- package/lib/WAUSync/USyncUser.d.ts +10 -5
- package/lib/WAUSync/USyncUser.js +10 -5
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.js +4 -19
- package/lib/index.d.ts +10 -9
- package/lib/index.js +12 -34
- package/package.json +84 -51
- package/WAProto/fix-import.js +0 -29
- package/lib/Defaults/baileys-version.json +0 -3
- package/lib/Defaults/phonenumber-mcc.json +0 -223
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/queue-job.js +0 -57
- package/lib/Socket/Client/abstract-socket-client.js +0 -13
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/mobile-socket-client.js +0 -65
- package/lib/Socket/Client/web-socket-client.js +0 -62
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/registration.js +0 -166
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Socket/usync.js +0 -70
- package/lib/Types/Newsletter.d.ts +0 -103
- package/lib/Types/Newsletter.js +0 -38
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/baileys-event-stream.js +0 -63
package/lib/Socket/luxu.d.ts
CHANGED
|
@@ -1,266 +1,22 @@
|
|
|
1
|
-
import { proto } from '../../WAProto'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 OrderMessage {
|
|
155
|
-
thumbnail?: Buffer | string,
|
|
156
|
-
itemCount?: string | number,
|
|
157
|
-
message: string,
|
|
158
|
-
orderTitle: string,
|
|
159
|
-
totalAmount1000?: string | number,
|
|
160
|
-
totalCurrencyCode?: string
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
interface GroupStatus {
|
|
164
|
-
message?: any;
|
|
165
|
-
image?: string | Buffer | { url: string };
|
|
166
|
-
video?: string | Buffer | { url: string };
|
|
167
|
-
text?: string;
|
|
168
|
-
caption?: string;
|
|
169
|
-
document?: string | Buffer | { url: string };
|
|
170
|
-
[key: string]: any;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
interface GroupLabel {
|
|
174
|
-
labelText: string;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
interface MessageContent {
|
|
178
|
-
requestPaymentMessage?: PaymentMessage;
|
|
179
|
-
productMessage?: ProductMessage;
|
|
180
|
-
interactiveMessage?: InteractiveMessage;
|
|
181
|
-
albumMessage?: AlbumItem[];
|
|
182
|
-
eventMessage?: EventMessage;
|
|
183
|
-
pollResultMessage?: PollResultMessage;
|
|
184
|
-
groupStatus?: GroupStatus;
|
|
185
|
-
orderMessage?: OrderMessage;
|
|
186
|
-
groupLabel?: GroupLabel;
|
|
187
|
-
sender?: string;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
interface MessageOptions {
|
|
191
|
-
quoted?: proto.IWebMessageInfo;
|
|
192
|
-
filter?: boolean;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
interface Utils {
|
|
196
|
-
prepareWAMessageMedia: (media: any, options: WAMessageContentGenerationOptions) => Promise<any>;
|
|
197
|
-
generateWAMessageContent: (content: any, options: WAMessageContentGenerationOptions) => Promise<any>;
|
|
198
|
-
generateWAMessageFromContent: (jid: string, content: any, options?: any) => Promise<any>;
|
|
199
|
-
generateWAMessage: (jid: string, content: any, options?: any) => Promise<any>;
|
|
200
|
-
generateMessageID: () => string;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
declare class imup {
|
|
205
|
-
constructor(
|
|
206
|
-
utils: imup.Utils,
|
|
207
|
-
waUploadToServer: imup.WAMediaUploadFunction,
|
|
208
|
-
relayMessageFn?: (jid: string, content: any, options?: any) => Promise<any>
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
detectType(content: imup.MessageContent): 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STATUS' | 'ORDER' | 'GROUP_LABEL' |null;
|
|
212
|
-
|
|
213
|
-
handlePayment(
|
|
214
|
-
content: { requestPaymentMessage: imup.PaymentMessage },
|
|
215
|
-
quoted?: proto.IWebMessageInfo
|
|
216
|
-
): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
|
|
217
|
-
|
|
218
|
-
handleProduct(
|
|
219
|
-
content: { productMessage: imup.ProductMessage },
|
|
220
|
-
jid: string,
|
|
221
|
-
quoted?: proto.IWebMessageInfo
|
|
222
|
-
): Promise<{ viewOnceMessage: proto.Message.ViewOnceMessage }>;
|
|
223
|
-
|
|
224
|
-
handleInteractive(
|
|
225
|
-
content: { interactiveMessage: imup.InteractiveMessage },
|
|
226
|
-
jid: string,
|
|
227
|
-
quoted?: proto.IWebMessageInfo
|
|
228
|
-
): Promise<{ interactiveMessage: proto.Message.InteractiveMessage }>;
|
|
229
|
-
|
|
230
|
-
handleAlbum(
|
|
231
|
-
content: { albumMessage: imup.AlbumItem[] },
|
|
232
|
-
jid: string,
|
|
233
|
-
quoted?: proto.IWebMessageInfo
|
|
234
|
-
): Promise<any>;
|
|
235
|
-
|
|
236
|
-
handleEvent(
|
|
237
|
-
content: { eventMessage: imup.EventMessage },
|
|
238
|
-
jid: string,
|
|
239
|
-
quoted?: proto.IWebMessageInfo
|
|
240
|
-
): Promise<any>;
|
|
241
|
-
|
|
242
|
-
handlePollResult(
|
|
243
|
-
content: { pollResultMessage: imup.PollResultMessage },
|
|
244
|
-
jid: string,
|
|
245
|
-
quoted?: proto.IWebMessageInfo
|
|
246
|
-
): Promise<any>;
|
|
247
|
-
|
|
248
|
-
handleOrderMessage(
|
|
249
|
-
content: { orderMessage: imup.OrderMessage },
|
|
250
|
-
jid: string,
|
|
251
|
-
quoted?: proto.IWebMessageInfo
|
|
252
|
-
): Promise<any>;
|
|
253
|
-
|
|
254
|
-
handleGroupStory(
|
|
255
|
-
content: { groupStatus: imup.GroupStatus },
|
|
256
|
-
jid: string,
|
|
257
|
-
quoted?: proto.IWebMessageInfo
|
|
258
|
-
): Promise<any>;
|
|
259
|
-
|
|
260
|
-
handleGbLabel(
|
|
261
|
-
content: { groupLabel: imup.GroupLabel },
|
|
262
|
-
jid: string,
|
|
263
|
-
): Promise<any>;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export = imup;
|
|
1
|
+
import { proto } from '../../WAProto/index.js'
|
|
2
|
+
import { type WAMessageContent, type AnyMessageContent, type MiscMessageGenerationOptions } from '../Types/index.js'
|
|
3
|
+
import { type WAProto as WAProtoType } from '../../WAProto/index.js'
|
|
4
|
+
|
|
5
|
+
export type ContentType = 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'ORDER' | 'GROUP_STATUS' | 'GROUP_LABEL' | null
|
|
6
|
+
|
|
7
|
+
export default class imup {
|
|
8
|
+
constructor(utils: any, waUploadToServer: any, relayMessageFn: (jid: string, message: any, options: any) => Promise<void>)
|
|
9
|
+
utils: any
|
|
10
|
+
relayMessage: (jid: string, message: any, options: any) => Promise<void>
|
|
11
|
+
waUploadToServer: any
|
|
12
|
+
detectType(content: any): ContentType
|
|
13
|
+
handlePayment(content: any, quoted?: any): Promise<{ requestPaymentMessage: proto.Message.IRequestPaymentMessage }>
|
|
14
|
+
handleProduct(content: any, jid: string, quoted?: any): Promise<{ viewOnceMessage: { message: any } }>
|
|
15
|
+
handleInteractive(content: any, jid: string, quoted?: any): Promise<{ interactiveMessage: any }>
|
|
16
|
+
handleAlbum(content: any, jid: string, quoted?: any): Promise<any>
|
|
17
|
+
handleEvent(content: any, jid: string, quoted?: any): Promise<any>
|
|
18
|
+
handlePollResult(content: any, jid: string, quoted?: any): Promise<any>
|
|
19
|
+
handleOrderMessage(content: any, jid: string, quoted?: any): Promise<any>
|
|
20
|
+
handleGroupStory(content: any, jid: string, quoted?: any): Promise<any>
|
|
21
|
+
handleGbLabel(content: any, jid: string): Promise<void>
|
|
22
|
+
}
|