@neelegirl/baileys 1.5.5 → 1.5.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.
- package/LICENSE +21 -0
- package/README.md +183 -10
- package/WAProto/WAProto.proto +5007 -0
- package/WAProto/index.d.ts +57712 -0
- package/WAProto/index.js +178969 -0
- package/lib/Defaults/baileys-version.json +3 -0
- package/lib/Defaults/index.d.ts +68 -0
- package/lib/Defaults/index.js +137 -0
- package/lib/Defaults/phonenumber-mcc.json +223 -0
- package/lib/Signal/WASignalGroup/GroupProtocol.js +1909 -0
- package/lib/Signal/WASignalGroup/ciphertext_message.js +16 -0
- package/lib/Signal/WASignalGroup/generate-proto.sh +1 -0
- package/lib/Signal/WASignalGroup/group.proto +42 -0
- package/lib/Signal/WASignalGroup/group_cipher.js +120 -0
- package/lib/Signal/WASignalGroup/group_session_builder.js +46 -0
- package/lib/Signal/WASignalGroup/index.js +6 -0
- package/lib/Signal/WASignalGroup/keyhelper.js +21 -0
- package/lib/Signal/WASignalGroup/protobufs.js +3 -0
- package/lib/Signal/WASignalGroup/queue_job.js +69 -0
- package/lib/Signal/WASignalGroup/readme.md +6 -0
- package/lib/Signal/WASignalGroup/sender_chain_key.js +50 -0
- package/lib/Signal/WASignalGroup/sender_key_distribution_message.js +78 -0
- package/lib/Signal/WASignalGroup/sender_key_message.js +92 -0
- package/lib/Signal/WASignalGroup/sender_key_name.js +70 -0
- package/lib/Signal/WASignalGroup/sender_key_record.js +56 -0
- package/lib/Signal/WASignalGroup/sender_key_state.js +129 -0
- package/lib/Signal/WASignalGroup/sender_message_key.js +39 -0
- package/lib/Signal/libsignal.d.ts +4 -0
- package/lib/Signal/libsignal.js +162 -0
- package/lib/Socket/Client/abstract-socket-client.d.ts +15 -0
- package/lib/Socket/Client/abstract-socket-client.js +13 -0
- package/lib/Socket/Client/index.d.ts +2 -0
- package/lib/Socket/Client/index.js +22 -0
- package/lib/Socket/Client/mobile-socket-client.d.ts +12 -0
- package/lib/Socket/Client/mobile-socket-client.js +65 -0
- package/lib/Socket/Client/types.d.ts +16 -0
- package/lib/Socket/Client/types.js +18 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.js +62 -0
- package/lib/Socket/business.d.ts +187 -0
- package/lib/Socket/business.js +268 -0
- package/lib/Socket/chats.d.ts +98 -0
- package/lib/Socket/chats.js +1113 -0
- package/lib/Socket/communities.d.ts +223 -0
- package/lib/Socket/communities.js +433 -0
- package/lib/Socket/groups.d.ts +131 -0
- package/lib/Socket/groups.js +352 -0
- package/lib/Socket/index.d.ts +191 -0
- package/lib/Socket/index.js +23 -0
- package/lib/Socket/messages-recv.d.ts +177 -0
- package/lib/Socket/messages-recv.js +1764 -0
- package/lib/Socket/messages-send.d.ts +168 -0
- package/lib/Socket/messages-send.js +1303 -0
- package/lib/Socket/mex.d.ts +2 -0
- package/lib/Socket/mex.js +47 -0
- package/lib/Socket/newsletter.d.ts +147 -0
- package/lib/Socket/newsletter.js +286 -0
- package/lib/Socket/registration.d.ts +266 -0
- package/lib/Socket/registration.js +166 -0
- package/lib/Socket/socket.d.ts +45 -0
- package/lib/Socket/socket.js +766 -0
- package/lib/Socket/usync.d.ts +37 -0
- package/lib/Socket/usync.js +83 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.js +24 -0
- package/lib/Store/make-cache-manager-store.d.ts +14 -0
- package/lib/Store/make-cache-manager-store.js +90 -0
- package/lib/Store/make-in-memory-store.d.ts +123 -0
- package/lib/Store/make-in-memory-store.js +429 -0
- package/lib/Store/make-ordered-dictionary.d.ts +12 -0
- package/lib/Store/make-ordered-dictionary.js +86 -0
- package/lib/Store/object-repository.d.ts +10 -0
- package/lib/Store/object-repository.js +31 -0
- package/lib/Types/Auth.d.ts +120 -0
- package/lib/Types/Auth.js +3 -0
- package/lib/Types/Call.d.ts +14 -0
- package/lib/Types/Call.js +3 -0
- package/lib/Types/Chat.d.ts +138 -0
- package/lib/Types/Chat.js +9 -0
- package/lib/Types/Contact.d.ts +20 -0
- package/lib/Types/Contact.js +3 -0
- package/lib/Types/Events.d.ts +229 -0
- package/lib/Types/Events.js +3 -0
- package/lib/Types/GroupMetadata.d.ts +66 -0
- package/lib/Types/GroupMetadata.js +3 -0
- package/lib/Types/Label.d.ts +48 -0
- package/lib/Types/Label.js +31 -0
- package/lib/Types/LabelAssociation.d.ts +35 -0
- package/lib/Types/LabelAssociation.js +13 -0
- package/lib/Types/Message.d.ts +473 -0
- package/lib/Types/Message.js +13 -0
- package/lib/Types/MexUpdates.d.ts +9 -0
- package/lib/Types/MexUpdates.js +18 -0
- package/lib/Types/Newsletter.d.ts +109 -0
- package/lib/Types/Newsletter.js +40 -0
- package/lib/Types/Product.d.ts +92 -0
- package/lib/Types/Product.js +3 -0
- package/lib/Types/Signal.d.ts +68 -0
- package/lib/Types/Signal.js +3 -0
- package/lib/Types/Socket.d.ts +122 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/State.d.ts +41 -0
- package/lib/Types/State.js +14 -0
- package/lib/Types/USync.d.ts +26 -0
- package/lib/Types/USync.js +3 -0
- package/lib/Types/index.d.ts +79 -0
- package/lib/Types/index.js +48 -0
- package/lib/Utils/auth-utils.d.ts +21 -0
- package/lib/Utils/auth-utils.js +205 -0
- package/lib/Utils/baileys-event-stream.d.ts +18 -0
- package/lib/Utils/baileys-event-stream.js +70 -0
- package/lib/Utils/business.d.ts +29 -0
- package/lib/Utils/business.js +255 -0
- package/lib/Utils/chat-utils.d.ts +82 -0
- package/lib/Utils/chat-utils.js +781 -0
- package/lib/Utils/check-npm-version.d.ts +15 -0
- package/lib/Utils/check-npm-version.js +52 -0
- package/lib/Utils/crypto.d.ts +56 -0
- package/lib/Utils/crypto.js +179 -0
- package/lib/Utils/decode-wa-message.d.ts +41 -0
- package/lib/Utils/decode-wa-message.js +253 -0
- package/lib/Utils/event-buffer.d.ts +39 -0
- package/lib/Utils/event-buffer.js +565 -0
- package/lib/Utils/generics.d.ts +129 -0
- package/lib/Utils/generics.js +618 -0
- package/lib/Utils/history.d.ts +23 -0
- package/lib/Utils/history.js +110 -0
- package/lib/Utils/index.d.ts +19 -0
- package/lib/Utils/index.js +41 -0
- package/lib/Utils/link-preview.d.ts +23 -0
- package/lib/Utils/link-preview.js +120 -0
- package/lib/Utils/logger.d.ts +13 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.d.ts +14 -0
- package/lib/Utils/lt-hash.js +58 -0
- package/lib/Utils/make-mutex.d.ts +9 -0
- package/lib/Utils/make-mutex.js +49 -0
- package/lib/Utils/message-retry-manager.d.ts +82 -0
- package/lib/Utils/message-retry-manager.js +177 -0
- package/lib/Utils/messages-media.d.ts +129 -0
- package/lib/Utils/messages-media.js +806 -0
- package/lib/Utils/messages.d.ts +103 -0
- package/lib/Utils/messages.js +1579 -0
- package/lib/Utils/noise-handler.d.ts +20 -0
- package/lib/Utils/noise-handler.js +155 -0
- package/lib/Utils/process-message.d.ts +49 -0
- package/lib/Utils/process-message.js +428 -0
- package/lib/Utils/signal.d.ts +42 -0
- package/lib/Utils/signal.js +166 -0
- package/lib/Utils/use-mongo-file-auth-state.d.ts +6 -0
- package/lib/Utils/use-mongo-file-auth-state.js +84 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +18 -0
- package/lib/Utils/use-multi-file-auth-state.js +238 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +13 -0
- package/lib/Utils/use-single-file-auth-state.js +80 -0
- package/lib/Utils/validate-connection.d.ts +13 -0
- package/lib/Utils/validate-connection.js +187 -0
- package/lib/WABinary/constants.d.ts +30 -0
- package/lib/WABinary/constants.js +1316 -0
- package/lib/WABinary/decode.d.ts +9 -0
- package/lib/WABinary/decode.js +288 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.js +265 -0
- package/lib/WABinary/generic-utils.d.ts +28 -0
- package/lib/WABinary/generic-utils.js +142 -0
- package/lib/WABinary/index.d.ts +5 -0
- package/lib/WABinary/index.js +25 -0
- package/lib/WABinary/jid-utils.d.ts +53 -0
- package/lib/WABinary/jid-utils.js +92 -0
- package/lib/WABinary/types.d.ts +22 -0
- package/lib/WABinary/types.js +3 -0
- package/lib/WAM/BinaryInfo.d.ts +16 -0
- package/lib/WAM/BinaryInfo.js +17 -0
- package/lib/WAM/constants.d.ts +47 -0
- package/lib/WAM/constants.js +15371 -0
- package/lib/WAM/encode.d.ts +3 -0
- package/lib/WAM/encode.js +165 -0
- package/lib/WAM/index.d.ts +3 -0
- package/lib/WAM/index.js +23 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +28 -0
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +69 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +36 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +26 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +62 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +14 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +35 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +9 -0
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +14 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +46 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.js +26 -0
- package/lib/WAUSync/USyncQuery.d.ts +31 -0
- package/lib/WAUSync/USyncQuery.js +92 -0
- package/lib/WAUSync/USyncUser.d.ts +12 -0
- package/lib/WAUSync/USyncUser.js +30 -0
- package/lib/WAUSync/index.d.ts +3 -0
- package/lib/WAUSync/index.js +23 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +33 -0
- package/package.json +88 -10
- package/index.js +0 -38
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { UserFacingSocketConfig, ContactAction } from '../Types'
|
|
2
|
+
|
|
3
|
+
declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
4
|
+
logger: import("../Utils/logger").ILogger
|
|
5
|
+
getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>
|
|
6
|
+
getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
|
|
7
|
+
products: import("../Types").Product[]
|
|
8
|
+
nextPageCursor: string | undefined
|
|
9
|
+
}>
|
|
10
|
+
getCollections: (jid?: string | undefined, limit?: number) => Promise<{
|
|
11
|
+
collections: import("../Types").CatalogCollection[]
|
|
12
|
+
}>
|
|
13
|
+
productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>
|
|
14
|
+
productDelete: (productIds: string[]) => Promise<{
|
|
15
|
+
deleted: number
|
|
16
|
+
}>
|
|
17
|
+
productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>
|
|
18
|
+
sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number | undefined) => Promise<void>
|
|
19
|
+
sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>
|
|
20
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
21
|
+
id: any
|
|
22
|
+
to: string
|
|
23
|
+
}>
|
|
24
|
+
nodelogger: (node: BinaryNode) => Promise<void>
|
|
25
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>
|
|
26
|
+
fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAProto.IMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>
|
|
27
|
+
requestPlaceholderResend: (messageKey: import("../Types").WAProto.IMessageKey) => Promise<string | undefined>
|
|
28
|
+
getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>
|
|
29
|
+
assertSessions: (jids: string[], force: boolean) => Promise<boolean>
|
|
30
|
+
relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>
|
|
31
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>
|
|
32
|
+
sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>
|
|
33
|
+
readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>
|
|
34
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>
|
|
35
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction
|
|
36
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
37
|
+
[_: string]: string
|
|
38
|
+
}>
|
|
39
|
+
sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>
|
|
40
|
+
createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
|
|
41
|
+
[key: string]: string
|
|
42
|
+
} | undefined) => Promise<{
|
|
43
|
+
nodes: import("..").BinaryNode[]
|
|
44
|
+
shouldIncludeDeviceIdentity: boolean
|
|
45
|
+
}>
|
|
46
|
+
profilePictureUrl: (jids: string) => Promise<string>
|
|
47
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>
|
|
48
|
+
getEphemeralGroup: (jid: string) => Promise<number>
|
|
49
|
+
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>
|
|
50
|
+
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
51
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>
|
|
52
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
53
|
+
duration: string
|
|
54
|
+
}>
|
|
55
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>
|
|
56
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
57
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>
|
|
58
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
59
|
+
newsletterRemovePicture: (jid: string) => Promise<void>
|
|
60
|
+
newsletterUnfollow: (jid: string) => Promise<void>
|
|
61
|
+
newsletterFollow: (jid: string) => Promise<void>
|
|
62
|
+
newsletterUnmute: (jid: string) => Promise<void>
|
|
63
|
+
newsletterMute: (jid: string) => Promise<void>
|
|
64
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>
|
|
65
|
+
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
66
|
+
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
67
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
68
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
69
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
70
|
+
}>
|
|
71
|
+
newsletterAdminCount: (jid: string) => Promise<number>
|
|
72
|
+
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
73
|
+
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
74
|
+
newsletterDelete: (jid: string) => Promise<void>
|
|
75
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>
|
|
76
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
77
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
78
|
+
groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
79
|
+
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>
|
|
80
|
+
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>
|
|
81
|
+
groupLeave: (id: string) => Promise<void>
|
|
82
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>
|
|
83
|
+
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
84
|
+
[key: string]: string
|
|
85
|
+
}[]>
|
|
86
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
87
|
+
status: string
|
|
88
|
+
jid: string
|
|
89
|
+
}[]>
|
|
90
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
91
|
+
status: string
|
|
92
|
+
jid: string
|
|
93
|
+
content: import("..").BinaryNode
|
|
94
|
+
}[]>
|
|
95
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
96
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>
|
|
97
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>
|
|
98
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>
|
|
99
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>
|
|
100
|
+
groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>
|
|
101
|
+
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>
|
|
102
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
|
|
103
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>
|
|
104
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>
|
|
105
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>
|
|
106
|
+
groupFetchAllParticipating: () => Promise<{
|
|
107
|
+
[_: string]: import("../Types").GroupMetadata
|
|
108
|
+
}>
|
|
109
|
+
processingMutex: {
|
|
110
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>
|
|
111
|
+
}
|
|
112
|
+
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
113
|
+
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
114
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
115
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
116
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
117
|
+
getBotListV2: () => Promise<BotListInfo[]>
|
|
118
|
+
getLidUser: (jid: string) => Promise<{
|
|
119
|
+
lid: string
|
|
120
|
+
id: string
|
|
121
|
+
}[] | undefined>
|
|
122
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
123
|
+
jid: string
|
|
124
|
+
exists: unknown
|
|
125
|
+
}[] | undefined>
|
|
126
|
+
fetchBlocklist: () => Promise<string[]>
|
|
127
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
128
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
129
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
130
|
+
removeProfilePicture: (jid: string) => Promise<void>
|
|
131
|
+
updateProfileStatus: (status: string) => Promise<void>
|
|
132
|
+
updateProfileName: (name: string) => Promise<void>
|
|
133
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
|
|
134
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>
|
|
135
|
+
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
136
|
+
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>
|
|
137
|
+
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
138
|
+
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
139
|
+
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
140
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
141
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
142
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
143
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
144
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
145
|
+
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|
|
146
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>
|
|
147
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>
|
|
148
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
149
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
150
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
151
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
152
|
+
clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
|
|
153
|
+
star: (jid: string, messages: {
|
|
154
|
+
id: string
|
|
155
|
+
fromMe?: boolean | undefined
|
|
156
|
+
}[], star: boolean) => Promise<void>
|
|
157
|
+
addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
|
|
158
|
+
removeContact: (jid: string) => Promise<void>
|
|
159
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>
|
|
160
|
+
type: "md"
|
|
161
|
+
ws: import("./Client").WebSocketClient
|
|
162
|
+
ev: import("../Types").BaileysEventEmitter & {
|
|
163
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
|
|
164
|
+
buffer(): void
|
|
165
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
|
|
166
|
+
flush(force?: boolean | undefined): boolean
|
|
167
|
+
isBuffering(): boolean
|
|
168
|
+
}
|
|
169
|
+
authState: {
|
|
170
|
+
creds: import("../Types").AuthenticationCreds
|
|
171
|
+
keys: import("../Types").SignalKeyStoreWithTransaction
|
|
172
|
+
}
|
|
173
|
+
signalRepository: import("../Types").SignalRepository
|
|
174
|
+
user: import("../Types").Contact | undefined
|
|
175
|
+
generateMessageTag: () => string
|
|
176
|
+
query: (node: import("..").BinaryNode, timeoutMs?: number | undefined) => Promise<import("..").BinaryNode>
|
|
177
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
|
|
178
|
+
waitForSocketOpen: () => Promise<void>
|
|
179
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
|
|
180
|
+
sendNode: (frame: import("..").BinaryNode) => Promise<void>
|
|
181
|
+
logout: (msg?: string | undefined) => Promise<void>
|
|
182
|
+
end: (error: Error | undefined) => void
|
|
183
|
+
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void
|
|
184
|
+
uploadPreKeys: (count?: number) => Promise<void>
|
|
185
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>
|
|
186
|
+
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
187
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
|
|
188
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("..").BinaryNode>
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export default makeWASocket
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
5
|
+
const Defaults_1 = require("../Defaults")
|
|
6
|
+
const community_1= require("./communities");
|
|
7
|
+
// export the last socket layer
|
|
8
|
+
const makeWASocket = (config) => {
|
|
9
|
+
const newConfig = {
|
|
10
|
+
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
11
|
+
...config
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// If the user hasn't provided their own history sync function,
|
|
15
|
+
// let's create a default one that respects the syncFullHistory flag.
|
|
16
|
+
if (config.shouldSyncHistoryMessage === undefined) {
|
|
17
|
+
newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return community_1.makeCommunitiesSocket(newConfig)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.default = makeWASocket
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom'
|
|
2
|
+
import { proto } from '../../WAProto'
|
|
3
|
+
import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey, ContactAction } from '../Types'
|
|
4
|
+
import { BinaryNode } from '../WABinary'
|
|
5
|
+
|
|
6
|
+
export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
7
|
+
sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>
|
|
8
|
+
sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>
|
|
9
|
+
offerCall: (toJid: string, isVideo?: boolean) => Promise<{
|
|
10
|
+
id: any
|
|
11
|
+
to: string
|
|
12
|
+
}>
|
|
13
|
+
nodelogger: (node: BinaryNode) => Promise<void>
|
|
14
|
+
rejectCall: (callId: string, callFrom: string) => Promise<void>
|
|
15
|
+
fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>
|
|
16
|
+
requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>
|
|
17
|
+
getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>
|
|
18
|
+
assertSessions: (jids: string[], force: boolean) => Promise<boolean>
|
|
19
|
+
relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>
|
|
20
|
+
sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>
|
|
21
|
+
sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>
|
|
22
|
+
readMessages: (keys: proto.IMessageKey[]) => Promise<void>
|
|
23
|
+
refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>
|
|
24
|
+
waUploadToServer: import("../Types").WAMediaUploadFunction
|
|
25
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
26
|
+
[_: string]: string
|
|
27
|
+
}>
|
|
28
|
+
sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>
|
|
29
|
+
createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
|
|
30
|
+
[key: string]: string
|
|
31
|
+
} | undefined) => Promise<{
|
|
32
|
+
nodes: BinaryNode[]
|
|
33
|
+
shouldIncludeDeviceIdentity: boolean
|
|
34
|
+
}>
|
|
35
|
+
profilePictureUrl: (jid: string) => Promise<string>
|
|
36
|
+
getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>
|
|
37
|
+
getEphemeralGroup: (jid: string) => Promise<number>
|
|
38
|
+
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>
|
|
39
|
+
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
40
|
+
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>
|
|
41
|
+
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
42
|
+
duration: string
|
|
43
|
+
}>
|
|
44
|
+
newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>
|
|
45
|
+
newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
46
|
+
newsletterUpdateName: (jid: string, name: string) => Promise<void>
|
|
47
|
+
newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
48
|
+
newsletterRemovePicture: (jid: string) => Promise<void>
|
|
49
|
+
newsletterUnfollow: (jid: string) => Promise<void>
|
|
50
|
+
newsletterFollow: (jid: string) => Promise<void>
|
|
51
|
+
newsletterUnmute: (jid: string) => Promise<void>
|
|
52
|
+
newsletterMute: (jid: string) => Promise<void>
|
|
53
|
+
newsletterCreate: (name: string, description?: string, picture?: import("../Types").WAMediaUpload) => Promise<import("../Types").NewsletterMetadata>
|
|
54
|
+
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
55
|
+
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
56
|
+
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
57
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
58
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
59
|
+
}>
|
|
60
|
+
newsletterAdminCount: (jid: string) => Promise<number>
|
|
61
|
+
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
62
|
+
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
63
|
+
newsletterDelete: (jid: string) => Promise<void>
|
|
64
|
+
newsletterReactMessage: (jid: string, server_id: string, code?: string | undefined) => Promise<void>
|
|
65
|
+
newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
66
|
+
newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>
|
|
67
|
+
groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
68
|
+
groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>
|
|
69
|
+
groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>
|
|
70
|
+
groupLeave: (id: string) => Promise<void>
|
|
71
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>
|
|
72
|
+
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
73
|
+
[key: string]: string
|
|
74
|
+
}[]>
|
|
75
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
|
|
76
|
+
status: string
|
|
77
|
+
jid: string
|
|
78
|
+
}[]>
|
|
79
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
|
|
80
|
+
status: string
|
|
81
|
+
jid: string
|
|
82
|
+
content: BinaryNode
|
|
83
|
+
}[]>
|
|
84
|
+
groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>
|
|
85
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>
|
|
86
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>
|
|
87
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>
|
|
88
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>
|
|
89
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>
|
|
90
|
+
groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>
|
|
91
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
|
|
92
|
+
groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>
|
|
93
|
+
groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>
|
|
94
|
+
groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>
|
|
95
|
+
groupFetchAllParticipating: () => Promise<{
|
|
96
|
+
[_: string]: import("../Types").GroupMetadata
|
|
97
|
+
}>
|
|
98
|
+
processingMutex: {
|
|
99
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>
|
|
100
|
+
}
|
|
101
|
+
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
102
|
+
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
103
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
104
|
+
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
105
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
106
|
+
getLidUser: (jid: string) => Promise<{
|
|
107
|
+
lid: string
|
|
108
|
+
id: string
|
|
109
|
+
}[] | undefined>
|
|
110
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
111
|
+
jid: string
|
|
112
|
+
exists: unknown
|
|
113
|
+
}[] | undefined>
|
|
114
|
+
fetchBlocklist: () => Promise<string[]>
|
|
115
|
+
fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
116
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>
|
|
117
|
+
updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>
|
|
118
|
+
removeProfilePicture: (jid: string) => Promise<void>
|
|
119
|
+
updateProfileStatus: (status: string) => Promise<void>
|
|
120
|
+
updateProfileName: (name: string) => Promise<void>
|
|
121
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
|
|
122
|
+
updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>
|
|
123
|
+
updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
124
|
+
updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>
|
|
125
|
+
updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
126
|
+
updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>
|
|
127
|
+
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
128
|
+
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
129
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
130
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
131
|
+
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
132
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
133
|
+
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|
|
134
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>
|
|
135
|
+
addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>
|
|
136
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
137
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
138
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
139
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
140
|
+
clearMessage: (jid: string, key: import("../Types").WAProto.IMessageKey, timeStamp: number | import("long").Long) => Promise<void>
|
|
141
|
+
star: (jid: string, messages: {
|
|
142
|
+
id: string
|
|
143
|
+
fromMe?: boolean | undefined
|
|
144
|
+
}[], star: boolean) => Promise<void>
|
|
145
|
+
addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
|
|
146
|
+
removeContact: (jid: string) => Promise<void>
|
|
147
|
+
executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>
|
|
148
|
+
type: "md"
|
|
149
|
+
ws: import("./Client").WebSocketClient
|
|
150
|
+
ev: import("../Types").BaileysEventEmitter & {
|
|
151
|
+
process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void
|
|
152
|
+
buffer(): void
|
|
153
|
+
createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>
|
|
154
|
+
flush(force?: boolean | undefined): boolean
|
|
155
|
+
isBuffering(): boolean
|
|
156
|
+
}
|
|
157
|
+
authState: {
|
|
158
|
+
creds: import("../Types").AuthenticationCreds
|
|
159
|
+
keys: import("../Types").SignalKeyStoreWithTransaction
|
|
160
|
+
}
|
|
161
|
+
signalRepository: import("../Types").SignalRepository
|
|
162
|
+
user: import("../Types").Contact | undefined
|
|
163
|
+
generateMessageTag: () => string
|
|
164
|
+
query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>
|
|
165
|
+
waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>
|
|
166
|
+
waitForSocketOpen: () => Promise<void>
|
|
167
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
|
|
168
|
+
sendNode: (frame: BinaryNode) => Promise<void>
|
|
169
|
+
logout: (msg?: string | undefined) => Promise<void>
|
|
170
|
+
end: (error: Error | undefined) => void
|
|
171
|
+
onUnexpectedError: (err: Error | Boom<any>, msg: string) => void
|
|
172
|
+
uploadPreKeys: (count?: number) => Promise<void>
|
|
173
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>
|
|
174
|
+
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
175
|
+
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
|
|
176
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
|
|
177
|
+
}
|