@codexverified/baileys 2.7.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/LICENSE +21 -0
- package/README.md +233 -0
- package/WAProto/V +1 -0
- package/WAProto/WAProto.proto +8051 -0
- package/WAProto/index.js +289292 -0
- package/engine-requirements.js +13 -0
- package/lib/Defaults/index.js +158 -0
- package/lib/Signal/Group/ciphertext-message.js +11 -0
- package/lib/Signal/Group/group-session-builder.js +29 -0
- package/lib/Signal/Group/group_cipher.js +81 -0
- package/lib/Signal/Group/index.js +11 -0
- package/lib/Signal/Group/keyhelper.js +17 -0
- package/lib/Signal/Group/sender-chain-key.js +25 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
- package/lib/Signal/Group/sender-key-message.js +65 -0
- package/lib/Signal/Group/sender-key-name.js +47 -0
- package/lib/Signal/Group/sender-key-record.js +40 -0
- package/lib/Signal/Group/sender-key-state.js +83 -0
- package/lib/Signal/Group/sender-message-key.js +25 -0
- package/lib/Signal/libsignal.js +428 -0
- package/lib/Signal/lid-mapping.js +280 -0
- package/lib/Socket/Client/index.js +2 -0
- package/lib/Socket/Client/types.js +10 -0
- package/lib/Socket/Client/websocket.js +53 -0
- package/lib/Socket/aigroups.js +315 -0
- package/lib/Socket/business.js +407 -0
- package/lib/Socket/chats.js +1831 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/graphql.js +899 -0
- package/lib/Socket/groups.js +549 -0
- package/lib/Socket/index.js +79 -0
- package/lib/Socket/interactive-handler.js +600 -0
- package/lib/Socket/interop.js +563 -0
- package/lib/Socket/managed-account.js +208 -0
- package/lib/Socket/messages-recv.js +2144 -0
- package/lib/Socket/messages-send.js +2030 -0
- package/lib/Socket/mex.js +41 -0
- package/lib/Socket/newsletter.js +226 -0
- package/lib/Socket/privacy.js +446 -0
- package/lib/Socket/registration.js +428 -0
- package/lib/Socket/socket.js +1017 -0
- package/lib/Socket/username.js +229 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/make-cache-manager-store.js +89 -0
- package/lib/Store/make-in-memory-store.js +420 -0
- package/lib/Store/make-ordered-dictionary.js +78 -0
- package/lib/Store/object-repository.js +23 -0
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Bussines.js +1 -0
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.js +7 -0
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.js +24 -0
- package/lib/Types/LabelAssociation.js +6 -0
- package/lib/Types/Message.js +17 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Product.js +1 -0
- package/lib/Types/RichType.js +22 -0
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +48 -0
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.js +25 -0
- package/lib/Utils/auth-utils.js +301 -0
- package/lib/Utils/bot-planning-replay.js +169 -0
- package/lib/Utils/browser-utils.js +28 -0
- package/lib/Utils/business.js +230 -0
- package/lib/Utils/chat-utils.js +885 -0
- package/lib/Utils/companion-reg-client-utils.js +32 -0
- package/lib/Utils/consumer-application.js +102 -0
- package/lib/Utils/crypto.js +117 -0
- package/lib/Utils/decode-wa-message.js +484 -0
- package/lib/Utils/event-buffer.js +589 -0
- package/lib/Utils/generics.js +388 -0
- package/lib/Utils/group-history.js +56 -0
- package/lib/Utils/history.js +130 -0
- package/lib/Utils/identity-change-handler.js +48 -0
- package/lib/Utils/index.js +34 -0
- package/lib/Utils/jid-display-normalization.js +209 -0
- package/lib/Utils/link-preview.js +84 -0
- package/lib/Utils/logger.js +2 -0
- package/lib/Utils/lt-hash.js +7 -0
- package/lib/Utils/make-mutex.js +32 -0
- package/lib/Utils/message-composer.js +467 -0
- package/lib/Utils/message-inspect.js +67 -0
- package/lib/Utils/message-retry-manager.js +241 -0
- package/lib/Utils/messages-media.js +1006 -0
- package/lib/Utils/messages.js +1851 -0
- package/lib/Utils/meta-ai-msmsg.js +130 -0
- package/lib/Utils/meta-compositing.js +194 -0
- package/lib/Utils/noise-handler.js +200 -0
- package/lib/Utils/offline-node-processor.js +39 -0
- package/lib/Utils/pre-key-manager.js +105 -0
- package/lib/Utils/process-message.js +527 -0
- package/lib/Utils/reporting-utils.js +257 -0
- package/lib/Utils/rich-message-utils.js +439 -0
- package/lib/Utils/signal.js +200 -0
- package/lib/Utils/stanza-ack.js +37 -0
- package/lib/Utils/sync-action-utils.js +47 -0
- package/lib/Utils/tc-token-utils.js +162 -0
- package/lib/Utils/use-multi-file-auth-state.js +120 -0
- package/lib/Utils/use-single-file-auth-state.js +96 -0
- package/lib/Utils/use-sqlite-auth-state.js +108 -0
- package/lib/Utils/validate-connection.js +206 -0
- package/lib/Utils/voip-rekey.js +20 -0
- package/lib/Utils/welcome-flow.js +217 -0
- package/lib/WABinary/constants.js +1463 -0
- package/lib/WABinary/decode.js +261 -0
- package/lib/WABinary/encode.js +219 -0
- package/lib/WABinary/generic-utils.js +227 -0
- package/lib/WABinary/index.js +5 -0
- package/lib/WABinary/jid-utils.js +95 -0
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.js +9 -0
- package/lib/WAM/constants.js +22852 -0
- package/lib/WAM/encode.js +149 -0
- package/lib/WAM/index.js +3 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +96 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +56 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +70 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +28 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +34 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
- package/lib/WAUSync/Protocols/index.js +12 -0
- package/lib/WAUSync/USyncQuery.js +201 -0
- package/lib/WAUSync/USyncUser.js +54 -0
- package/lib/WAUSync/index.js +3 -0
- package/lib/antiban.cjs +4726 -0
- package/lib/index.d.ts +286 -0
- package/lib/index.js +18 -0
- package/package.json +121 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
export interface WAMessageKey {
|
|
2
|
+
remoteJid?: string | null;
|
|
3
|
+
fromMe?: boolean | null;
|
|
4
|
+
id?: string | null;
|
|
5
|
+
participant?: string | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type StatusFont = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
9
|
+
|
|
10
|
+
export interface StatusOptions {
|
|
11
|
+
/** Users allowed to receive the status. At least one valid user JID is required. */
|
|
12
|
+
statusJidList: string[];
|
|
13
|
+
/** Hex, named, or ARGB status background color. */
|
|
14
|
+
backgroundColor?: string | number;
|
|
15
|
+
font?: StatusFont;
|
|
16
|
+
messageId?: string;
|
|
17
|
+
additionalAttributes?: Record<string, string>;
|
|
18
|
+
additionalNodes?: unknown[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface StatusContent {
|
|
22
|
+
/** Convenience flag; alternatively send to `status@broadcast`. */
|
|
23
|
+
status?: true;
|
|
24
|
+
statusJidList?: string[];
|
|
25
|
+
backgroundColor?: string | number;
|
|
26
|
+
font?: StatusFont;
|
|
27
|
+
text?: string;
|
|
28
|
+
image?: unknown;
|
|
29
|
+
video?: unknown;
|
|
30
|
+
audio?: unknown;
|
|
31
|
+
caption?: string;
|
|
32
|
+
mimetype?: string;
|
|
33
|
+
ptt?: boolean;
|
|
34
|
+
seconds?: number;
|
|
35
|
+
waveform?: Uint8Array;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface GroupStatusContent extends StatusContent {
|
|
40
|
+
groupStatus: true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** One status distribution list entry as returned by `getStatusPrivacy`. */
|
|
44
|
+
export interface StatusPrivacyList {
|
|
45
|
+
type?: string;
|
|
46
|
+
id?: string;
|
|
47
|
+
listname?: string;
|
|
48
|
+
emoji?: string;
|
|
49
|
+
selected?: boolean;
|
|
50
|
+
deleted?: boolean;
|
|
51
|
+
members: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Custom named status list passed to `setStatusPrivacy`. */
|
|
55
|
+
export interface StatusCustomList {
|
|
56
|
+
id: string;
|
|
57
|
+
listname: string;
|
|
58
|
+
emoji?: string;
|
|
59
|
+
selected?: boolean;
|
|
60
|
+
deleted?: boolean;
|
|
61
|
+
members?: string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Result of `fetchBroadcastListQuota`. */
|
|
65
|
+
export interface BroadcastListQuota {
|
|
66
|
+
messagesLeft: number;
|
|
67
|
+
totalLimit: number;
|
|
68
|
+
isHeavySender: boolean;
|
|
69
|
+
startTs: number;
|
|
70
|
+
endTs: number;
|
|
71
|
+
resetTs: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Entry accepted by `storePrivacyTokens`. */
|
|
75
|
+
export interface PrivacyTokenEntry {
|
|
76
|
+
jid: string;
|
|
77
|
+
privacyToken: Buffer;
|
|
78
|
+
privacyModeTs?: number | string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** A bot (persona) entry as returned by `getBotListV2` / `getBotProfile`. */
|
|
82
|
+
export interface BotProfile {
|
|
83
|
+
jid?: string;
|
|
84
|
+
personaId?: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
description?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** A group profile picture as returned by `getGroupProfilePictures`. */
|
|
90
|
+
export interface GroupProfilePicture {
|
|
91
|
+
jid?: string;
|
|
92
|
+
type?: string;
|
|
93
|
+
directPath?: string;
|
|
94
|
+
url?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Result of `groupJoinLinked`. */
|
|
98
|
+
export interface GroupJoinLinkedResult {
|
|
99
|
+
approvalRequested: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Options for `aiGroupCreate`. */
|
|
103
|
+
export interface AIGroupCreateOptions {
|
|
104
|
+
ephemeralExpiration?: number;
|
|
105
|
+
memberAddMode?: string;
|
|
106
|
+
memberShareGroupHistoryMode?: string;
|
|
107
|
+
memberLinkMode?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Options for `aiPrompt`. */
|
|
111
|
+
export interface AIPromptOptions {
|
|
112
|
+
/** ms to wait for the bot response before rejecting (default 60000). */
|
|
113
|
+
timeout?: number;
|
|
114
|
+
/** Best-effort streaming hook called with each bot message edit in the chat. */
|
|
115
|
+
onPartial?: (message: unknown, key: WAMessageKey) => void;
|
|
116
|
+
/** Canonical Meta AI bot JID (default `867051314767696@bot`). */
|
|
117
|
+
botUser?: string;
|
|
118
|
+
/** Extra JIDs to mention alongside the bot in group prompts. */
|
|
119
|
+
mentions?: string[];
|
|
120
|
+
/** Extra options forwarded to `sendMessage` (quoted, linkPreview, ...). */
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface WASocket {
|
|
125
|
+
sendMessage(jid: string | string[], content: StatusContent | GroupStatusContent | Record<string, unknown>, options?: Partial<StatusOptions> & Record<string, unknown>): Promise<unknown>;
|
|
126
|
+
deleteGroupStatus(jid: string, key: WAMessageKey): Promise<unknown>;
|
|
127
|
+
/** Reports the contact and blocks it after WhatsApp accepts the report. */
|
|
128
|
+
reportContact(jid: string, messageKeys?: WAMessageKey[]): Promise<unknown>;
|
|
129
|
+
/** Reports the group and leaves it after WhatsApp accepts the report. */
|
|
130
|
+
reportGroup(jid: string, messageKeys?: WAMessageKey[]): Promise<unknown>;
|
|
131
|
+
|
|
132
|
+
// ---- WA-Web chat features (ported from baron-baileys-v2) ----
|
|
133
|
+
getStatusPrivacy(): Promise<StatusPrivacyList[] | null>;
|
|
134
|
+
setStatusPrivacy(type: 'contacts' | 'whitelist' | 'blacklist' | 'null', jids?: string[], customLists?: StatusCustomList[]): Promise<unknown>;
|
|
135
|
+
fetchBroadcastListQuota(): Promise<BroadcastListQuota | null>;
|
|
136
|
+
getChatBlockingStatus(): Promise<'blocked' | 'unblocked' | undefined>;
|
|
137
|
+
updateChatBlockingStatus(action: 'block' | 'unblock'): Promise<'blocked' | 'unblocked' | undefined>;
|
|
138
|
+
getUserDisclosures(t?: number): Promise<Record<string, string>[]>;
|
|
139
|
+
acceptTosNotice(noticeId: string | number, result?: string | number): Promise<unknown>;
|
|
140
|
+
reportSpam(jid: string, messages?: Array<{ id: string; t: number }>, spamFlow?: string, subject?: string): Promise<unknown>;
|
|
141
|
+
getOptOutList(): Promise<unknown>;
|
|
142
|
+
signPrivateCredential(blindedCredential: Buffer): Promise<Buffer | undefined>;
|
|
143
|
+
getPushConfig(): Promise<unknown>;
|
|
144
|
+
setPushConfig(config: Record<string, string>): Promise<unknown>;
|
|
145
|
+
toggleCallLinkWaitingRoom(linkToken: string, enabled: boolean, media?: 'audio' | 'video'): Promise<Record<string, string> | undefined>;
|
|
146
|
+
storePrivacyTokens(entries: PrivacyTokenEntry[]): Promise<void>;
|
|
147
|
+
updateBioPrivacy(value: string): Promise<unknown>;
|
|
148
|
+
blockBot(botJid: string): Promise<unknown>;
|
|
149
|
+
unblockBot(botJid: string): Promise<unknown>;
|
|
150
|
+
getBotListV2(): Promise<BotProfile[]>;
|
|
151
|
+
getBotProfile(botJid: string): Promise<BotProfile | null>;
|
|
152
|
+
fetchABProps(protocol?: string, hash?: string, refreshId?: string | null, group?: string | null): Promise<Record<string, string>>;
|
|
153
|
+
removeCompanionDevice(jid: string, reason?: string): Promise<unknown>;
|
|
154
|
+
updateKeyIndexList(ts: number | string, content: Buffer): Promise<unknown>;
|
|
155
|
+
sendKeyIndexList(): Promise<void>;
|
|
156
|
+
fetchMediaConn(lastId?: string | null): Promise<unknown>;
|
|
157
|
+
deleteBroadcastList(listId: string | number): Promise<unknown>;
|
|
158
|
+
fetchQRCode(code: string, addressingMode?: 'lid' | null): Promise<unknown>;
|
|
159
|
+
confirmDeviceLogout(id: string | number, approve?: boolean): Promise<unknown>;
|
|
160
|
+
|
|
161
|
+
// ---- Group calls ----
|
|
162
|
+
/** Start a group call in `jid`, ringing each participant JID. Returns { id, to }. */
|
|
163
|
+
groupCall(jid: string, participants?: string[], isVideo?: boolean): Promise<{ id: string; to: string }>;
|
|
164
|
+
/** Cancel / hang up a group call started with `groupCall`. Returns { id, to }. */
|
|
165
|
+
cancelGroupCall(jid: string, callId: string): Promise<{ id: string; to: string }>;
|
|
166
|
+
|
|
167
|
+
// ---- AI groups (ported from baron-baileys-v2) ----
|
|
168
|
+
aiGroupMetadata(jid: string): Promise<unknown>;
|
|
169
|
+
/** Send a prompt to the Meta AI bot and resolve with the decrypted response. */
|
|
170
|
+
aiPrompt(jid: string, prompt: string, options?: AIPromptOptions): Promise<unknown>;
|
|
171
|
+
aiGroupCreate(subject: string, participants?: string[], options?: AIGroupCreateOptions): Promise<unknown>;
|
|
172
|
+
aiGroupAddBot(jid: string, botUser?: string): Promise<unknown>;
|
|
173
|
+
aiGroupLeave(id: string): Promise<unknown>;
|
|
174
|
+
aiGroupParticipantsUpdate(jid: string, participants: string[], action: string): Promise<unknown>;
|
|
175
|
+
aiGroupUpdateSubject(jid: string, subject: string): Promise<unknown>;
|
|
176
|
+
aiGroupInviteCode(jid: string): Promise<unknown>;
|
|
177
|
+
aiGroupRevokeInvite(jid: string): Promise<unknown>;
|
|
178
|
+
aiGroupAcceptInvite(code: string): Promise<unknown>;
|
|
179
|
+
aiGroupSettingUpdate(jid: string, setting: string): Promise<unknown>;
|
|
180
|
+
aiGroupToggleEphemeral(jid: string, ephemeralExpiration: number): Promise<unknown>;
|
|
181
|
+
|
|
182
|
+
// ---- Community / group extensions ----
|
|
183
|
+
groupAcknowledge(jid: string): Promise<unknown>;
|
|
184
|
+
groupGetLinkedParticipants(jid: string): Promise<Array<{ jid: string; phoneNumber?: string }>>;
|
|
185
|
+
groupJoinLinked(parentJid: string, linkedGroupJid: string, type?: string): Promise<GroupJoinLinkedResult>;
|
|
186
|
+
getGroupProfilePictures(jids: string[], type?: 'preview' | 'image'): Promise<GroupProfilePicture[]>;
|
|
187
|
+
groupCreateSubGroupSuggestion(parentJid: string, suggestion: Array<Record<string, unknown>>): Promise<unknown>;
|
|
188
|
+
groupSubGroupSuggestionsAction(parentJid: string, action: 'approve' | 'reject' | 'cancel', suggestions: Array<{ creator?: string; jid?: string }>): Promise<unknown>;
|
|
189
|
+
|
|
190
|
+
// ---- Interop (Matrix bridge) ----
|
|
191
|
+
initInterop(): Promise<unknown>;
|
|
192
|
+
resetInteropSession(): Promise<unknown>;
|
|
193
|
+
fetchIntegrators(): Promise<unknown>;
|
|
194
|
+
acceptInteropTOS(): Promise<unknown>;
|
|
195
|
+
optInIntegrators(): Promise<unknown>;
|
|
196
|
+
optOutIntegrators(): Promise<unknown>;
|
|
197
|
+
resolveInteropUser(jid: string): Promise<unknown>;
|
|
198
|
+
resolveInteropUsers(jids: string[]): Promise<unknown>;
|
|
199
|
+
getReachabilitySettings(): Promise<unknown>;
|
|
200
|
+
setReachabilitySettings(settings: Record<string, unknown>): Promise<unknown>;
|
|
201
|
+
blockInteropUser(jid: string): Promise<unknown>;
|
|
202
|
+
unblockInteropUser(jid: string): Promise<unknown>;
|
|
203
|
+
reportInteropSpam(jid: string): Promise<unknown>;
|
|
204
|
+
trustInteropContact(jid: string): Promise<unknown>;
|
|
205
|
+
createInteropGroup(subject: string, participants?: string[]): Promise<unknown>;
|
|
206
|
+
leaveInteropGroup(jid: string): Promise<unknown>;
|
|
207
|
+
addParticipantsToInteropGroup(jid: string, participants: string[]): Promise<unknown>;
|
|
208
|
+
queryInteropGroupInfo(jid: string): Promise<unknown>;
|
|
209
|
+
queryInteropPrivacySettings(): Promise<unknown>;
|
|
210
|
+
updateInteropPrivacySetting(setting: string, value: string): Promise<unknown>;
|
|
211
|
+
updateInteropPrivacySettingWithContactList(setting: string, value: string, contacts: string[]): Promise<unknown>;
|
|
212
|
+
getInteropGroupAddPrivacy(): Promise<unknown>;
|
|
213
|
+
|
|
214
|
+
// ---- Username / privacy / account layers ----
|
|
215
|
+
checkUsername(username: string): Promise<unknown>;
|
|
216
|
+
checkUsernameMulti(usernames: string[]): Promise<unknown>;
|
|
217
|
+
setUsername(username: string, options?: Record<string, unknown>): Promise<unknown>;
|
|
218
|
+
deleteUsername(): Promise<unknown>;
|
|
219
|
+
getMyUsername(): Promise<unknown>;
|
|
220
|
+
getUsernameRecommendations(): Promise<unknown>;
|
|
221
|
+
setUsernamePin(pin: string): Promise<unknown>;
|
|
222
|
+
findUserByUsername(username: string): Promise<unknown>;
|
|
223
|
+
fetchContactUsernames(jids: string[]): Promise<unknown>;
|
|
224
|
+
|
|
225
|
+
getPrivacySettings(): Promise<unknown>;
|
|
226
|
+
setPrivacySetting(category: string, value: string): Promise<unknown>;
|
|
227
|
+
updatePrivacyContactList(category: string, type: string, jids: string[]): Promise<unknown>;
|
|
228
|
+
getPrivacyContactList(category: string): Promise<unknown>;
|
|
229
|
+
updateTextStatus(status: string): Promise<unknown>;
|
|
230
|
+
getTextStatusList(): Promise<unknown>;
|
|
231
|
+
updateUserStatus(status: string): Promise<unknown>;
|
|
232
|
+
fetchUserPictureInfo(jid: string): Promise<unknown>;
|
|
233
|
+
setProfilePictureMex(jid: string, image: Buffer): Promise<unknown>;
|
|
234
|
+
|
|
235
|
+
hasPassword(): Promise<unknown>;
|
|
236
|
+
setPassword(password: string): Promise<unknown>;
|
|
237
|
+
checkPassword(password: string): Promise<unknown>;
|
|
238
|
+
deletePassword(): Promise<unknown>;
|
|
239
|
+
passkeyExists(): Promise<unknown>;
|
|
240
|
+
getRegistrationUpsells(): Promise<unknown>;
|
|
241
|
+
contactsUpload(contacts: unknown[]): Promise<unknown>;
|
|
242
|
+
submitAge(age: number): Promise<unknown>;
|
|
243
|
+
|
|
244
|
+
managedAccountInitiateLinking(): Promise<unknown>;
|
|
245
|
+
managedAccountValidateLinking(token: string): Promise<unknown>;
|
|
246
|
+
managedAccountAcceptLinking(token: string): Promise<unknown>;
|
|
247
|
+
managedAccountCompleteLinking(token: string): Promise<unknown>;
|
|
248
|
+
managedAccountRevokeLinking(): Promise<unknown>;
|
|
249
|
+
managedAccountSyncActivities(): Promise<unknown>;
|
|
250
|
+
managedAccountUpdatePin(pin: string): Promise<unknown>;
|
|
251
|
+
|
|
252
|
+
// ---- GraphQL layer ----
|
|
253
|
+
setAccessToken(token: string): Promise<void>;
|
|
254
|
+
setWamoAuth(token: string): Promise<void>;
|
|
255
|
+
acquireAccessToken(): Promise<unknown>;
|
|
256
|
+
executeWWWGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
|
|
257
|
+
executeFacebookGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
|
|
258
|
+
executeWamoGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
|
|
259
|
+
|
|
260
|
+
[key: string]: unknown;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface SocketConfig {
|
|
264
|
+
[key: string]: unknown;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface CacheManagerStore {
|
|
268
|
+
get(key: string): Promise<unknown>;
|
|
269
|
+
set(key: string, value: unknown, ttl?: number): Promise<unknown>;
|
|
270
|
+
delete(key: string): Promise<boolean>;
|
|
271
|
+
keys(pattern?: string): Promise<string[]>;
|
|
272
|
+
reset?(): Promise<void>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Build a full auth-state (creds + keys) backed by a cache-manager store. */
|
|
276
|
+
export declare function makeCacheManagerAuthState(store: CacheManagerStore, sessionKey?: string): Promise<{
|
|
277
|
+
state: unknown;
|
|
278
|
+
saveCreds: () => Promise<void>;
|
|
279
|
+
}>;
|
|
280
|
+
|
|
281
|
+
/** Wrap a socket with anti-ban protection (from the baileys-antiban bundle). */
|
|
282
|
+
export declare function wrapSocket(socket: WASocket, config?: unknown): WASocket;
|
|
283
|
+
|
|
284
|
+
declare function makeWASocket(config: SocketConfig): WASocket;
|
|
285
|
+
export { makeWASocket };
|
|
286
|
+
export default makeWASocket;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import makeWASocket from './Socket/index.js';
|
|
2
|
+
export * from '../WAProto/index.js';
|
|
3
|
+
export * from './Utils/index.js';
|
|
4
|
+
export * from './Types/index.js';
|
|
5
|
+
export * from './Defaults/index.js';
|
|
6
|
+
export * from './Store/index.js';
|
|
7
|
+
export * from './WABinary/index.js';
|
|
8
|
+
export * from './WAM/index.js';
|
|
9
|
+
export * from './WAUSync/index.js';
|
|
10
|
+
// Re-export the bundled antiban layer without putting any CJS file in the
|
|
11
|
+
// ESM module graph (mixing `export *` from a .cjs broke require(esm)
|
|
12
|
+
// namespace population on Node versions where it is still experimental)
|
|
13
|
+
import { createRequire } from 'node:module';
|
|
14
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
15
|
+
const antiban = nodeRequire('./antiban.cjs');
|
|
16
|
+
export const { AntiBan, ContactGraphWarmer, ContentVariator, FileStateAdapter, HealthMonitor, JidCanonicalizer, LidFirstResolver, LidResolver, MAC_ERROR_CODES, MessageQueue, MessageRetryReason, PRESETS, PostReconnectThrottle, PresenceChoreographer, RateLimiter, ReplyRatioGuard, RetryReasonTracker, Scheduler, SessionHealthMonitor, StateManager, TimelockGuard, WarmUp, WebhookAlerts, applyFingerprint, applyGroupMultiplier, buildContentSignature, classifyDisconnect, createLidFirstResolver, credsSnapshot, generateFingerprint, getCircadianMultiplier, getRetryReasonDescription, isBroadcast, isGroup, isMacError, isNewsletter, messageRecovery, parseRetryReason, proxyRotator, readReceiptVariance, resolveConfig, shouldUseGroupProfile, wrapSocket, wrapWithSessionStability } = antiban;
|
|
17
|
+
export { makeWASocket };
|
|
18
|
+
export default makeWASocket;
|
package/package.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codexverified/baileys",
|
|
3
|
+
"version": "2.7.5",
|
|
4
|
+
"description": "CODEX TECHNOLOGY a premium Baileys developed and built by Dev Codex, with Meta compositing, bot planning replay, welcome flow, rich messages, interactive messages, albums, and more.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"preinstall": "node ./engine-requirements.js",
|
|
9
|
+
"test": "node --test"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20.0.0"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/codexverified/baileys-"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"lib/**/*",
|
|
20
|
+
"WAProto/**/*",
|
|
21
|
+
"engine-requirements.js"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"automation",
|
|
25
|
+
"baileys",
|
|
26
|
+
"baileys-fork",
|
|
27
|
+
"baileys-mod",
|
|
28
|
+
"codex technology",
|
|
29
|
+
"cody ai",
|
|
30
|
+
"bot-planning-replay",
|
|
31
|
+
"codex",
|
|
32
|
+
"interactive-messages",
|
|
33
|
+
"js-whatsapp",
|
|
34
|
+
"meta-compositing",
|
|
35
|
+
"multi-device",
|
|
36
|
+
"rich-messages",
|
|
37
|
+
"welcome-flow",
|
|
38
|
+
"whatsapp",
|
|
39
|
+
"whatsapp-api",
|
|
40
|
+
"whatsapp-bot",
|
|
41
|
+
"whatsapp-chat",
|
|
42
|
+
"whatsapp-group",
|
|
43
|
+
"whatsapp-web"
|
|
44
|
+
],
|
|
45
|
+
"homepage": "https://github.com/codexverified/baileys-",
|
|
46
|
+
"author": "Dev Codex",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@adiwajshing/keyed-db": "^0.2.4",
|
|
50
|
+
"@cacheable/node-cache": "^1.4.0",
|
|
51
|
+
"@hapi/boom": "^9.1.3",
|
|
52
|
+
"async-mutex": "^0.5.0",
|
|
53
|
+
"cache-manager": "^7.2.8",
|
|
54
|
+
"fflate": "^0.8.2",
|
|
55
|
+
"libsignal": "^6.0.0",
|
|
56
|
+
"long": "^5.2.3",
|
|
57
|
+
"lru-cache": "^11.2.6",
|
|
58
|
+
"music-metadata": "^11.12.3",
|
|
59
|
+
"p-queue": "^9.1.0",
|
|
60
|
+
"pino": "^9.6.0",
|
|
61
|
+
"protobufjs": "^7.5.6",
|
|
62
|
+
"whatsapp-rust-bridge": "0.5.5",
|
|
63
|
+
"ws": "^8.19.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@napi-rs/image": "~1.12.0",
|
|
67
|
+
"audio-decode": "^2.2.3",
|
|
68
|
+
"better-sqlite3": "^11.0.0",
|
|
69
|
+
"jimp": "^1.6.1",
|
|
70
|
+
"link-preview-js": "^3.0.0",
|
|
71
|
+
"sharp": "*"
|
|
72
|
+
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"@napi-rs/image": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"audio-decode": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"better-sqlite3": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"jimp": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"link-preview-js": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"packageManager": "yarn@4.9.2",
|
|
91
|
+
"types": "lib/index.d.ts",
|
|
92
|
+
"resolutions": {
|
|
93
|
+
"ajv@npm:^6.12.4": "^6.14.0",
|
|
94
|
+
"basic-ftp": "^5.2.4",
|
|
95
|
+
"brace-expansion@npm:^1.1.7": "^1.1.13",
|
|
96
|
+
"brace-expansion@npm:^2.0.1": "^2.0.3",
|
|
97
|
+
"flatted": "^3.4.2",
|
|
98
|
+
"glob@npm:^10.2.2": "^10.5.0",
|
|
99
|
+
"glob@npm:^10.3.10": "^10.5.0",
|
|
100
|
+
"glob@npm:^10.5.0": "^10.5.0",
|
|
101
|
+
"handlebars": "^4.7.9",
|
|
102
|
+
"ip-address": "^10.1.1",
|
|
103
|
+
"js-yaml@npm:^3.13.1": "^3.14.2",
|
|
104
|
+
"js-yaml@npm:^4.1.0": "^4.1.1",
|
|
105
|
+
"markdown-it": "^14.1.1",
|
|
106
|
+
"minimatch@npm:^3.0.4": "^3.1.5",
|
|
107
|
+
"minimatch@npm:^3.1.2": "^3.1.5",
|
|
108
|
+
"minimatch@npm:^5.0.1": "^5.1.8",
|
|
109
|
+
"minimatch@npm:^9.0.4": "^9.0.9",
|
|
110
|
+
"minimatch@npm:^9.0.5": "^9.0.9",
|
|
111
|
+
"picomatch@npm:^2.0.4": "^2.3.2",
|
|
112
|
+
"picomatch@npm:^2.3.1": "^2.3.2",
|
|
113
|
+
"picomatch@npm:^4.0.0": "^4.0.4",
|
|
114
|
+
"picomatch@npm:^4.0.2": "^4.0.4",
|
|
115
|
+
"socks": "^2.8.8",
|
|
116
|
+
"tar": "^7.5.11",
|
|
117
|
+
"tmp": "^0.2.5",
|
|
118
|
+
"underscore": "^1.13.8",
|
|
119
|
+
"yaml@npm:^2.6.1": "^2.8.4"
|
|
120
|
+
}
|
|
121
|
+
}
|