sanka-baileyss 2.3.2 → 2.3.3
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/BotMetadata/BotMetadata.d.ts +594 -1
- package/WAProto/BotMetadata/BotMetadata.js +1910 -148
- package/WAProto/BotMetadata/BotMetadata.proto +36 -0
- package/WAProto/E2E/E2E.d.ts +570 -6
- package/WAProto/E2E/E2E.js +1591 -26
- package/WAProto/E2E/E2E.proto +10 -1
- package/WAProto/HistorySync/HistorySync.d.ts +806 -6
- package/WAProto/HistorySync/HistorySync.js +2193 -29
- package/WAProto/HistorySync/HistorySync.proto +2 -1
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
- package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
- package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
- package/WAProto/SyncAction/SyncAction.d.ts +230 -0
- package/WAProto/SyncAction/SyncAction.js +578 -2
- package/WAProto/SyncAction/SyncAction.proto +13 -1
- package/WAProto/Web/Web.d.ts +570 -6
- package/WAProto/Web/Web.js +1591 -26
- package/lib/Defaults/baileys-version.json +2 -2
- package/lib/Defaults/index.d.ts +42 -25
- package/lib/Defaults/index.js +6 -2
- package/lib/Signal/libsignal.d.ts +1 -0
- package/lib/Socket/Client/index.js +13 -9
- package/lib/Socket/Client/types.d.ts +11 -10
- package/lib/Socket/Client/types.js +11 -7
- package/lib/Socket/Client/websocket.d.ts +9 -8
- package/lib/Socket/Client/websocket.js +52 -47
- package/lib/Socket/business.d.ts +185 -182
- package/lib/Socket/business.js +258 -249
- package/lib/Socket/chats.d.ts +90 -87
- package/lib/Socket/chats.js +1095 -888
- package/lib/Socket/community.d.ts +131 -0
- package/lib/Socket/community.js +369 -0
- package/lib/Socket/groups.d.ts +50 -41
- package/lib/Socket/groups.js +10 -3
- package/lib/Socket/index.d.ts +5 -1
- package/lib/Socket/index.js +19 -5
- package/lib/Socket/messages-recv.d.ts +6 -2
- package/lib/Socket/messages-recv.js +31 -8
- package/lib/Socket/messages-send.d.ts +5 -1
- package/lib/Socket/messages-send.js +1293 -1351
- package/lib/Socket/newsletter.d.ts +142 -135
- package/lib/Socket/newsletter.js +274 -230
- package/lib/Socket/socket.d.ts +37 -35
- package/lib/Socket/usync.d.ts +31 -30
- package/lib/Socket/usync.js +74 -62
- package/lib/Types/Auth.d.ts +89 -72
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Call.d.ts +11 -10
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +85 -62
- package/lib/Types/Chat.js +4 -1
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +209 -191
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +12 -27
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +41 -39
- package/lib/Types/Label.js +24 -21
- package/lib/Types/LabelAssociation.d.ts +18 -12
- package/lib/Types/LabelAssociation.js +6 -3
- package/lib/Types/Message.d.ts +3 -2
- package/lib/Types/Message.js +7 -3
- package/lib/Types/MexUpdates.d.ts +9 -0
- package/lib/Types/MexUpdates.js +18 -0
- package/lib/Types/Newsletter.d.ts +84 -67
- package/lib/Types/Newsletter.js +30 -23
- package/lib/Types/Product.d.ts +70 -56
- package/lib/Types/Product.js +1 -0
- package/lib/Types/Signal.d.ts +46 -35
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +105 -101
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +37 -23
- package/lib/Types/State.js +13 -1
- package/lib/Types/USync.d.ts +21 -20
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +51 -42
- package/lib/Types/index.js +25 -19
- package/lib/Utils/auth-utils.d.ts +14 -11
- package/lib/Utils/auth-utils.js +189 -182
- package/lib/Utils/baileys-event-stream.d.ts +12 -10
- package/lib/Utils/baileys-event-stream.js +52 -46
- package/lib/Utils/business.d.ts +15 -8
- package/lib/Utils/business.js +229 -217
- package/lib/Utils/chat-utils.d.ts +22 -12
- package/lib/Utils/chat-utils.js +57 -27
- package/lib/Utils/crypto.d.ts +31 -15
- package/lib/Utils/crypto.js +136 -107
- package/lib/Utils/decode-wa-message.d.ts +34 -245
- package/lib/Utils/decode-wa-message.js +205 -217
- package/lib/Utils/event-buffer.d.ts +30 -26
- package/lib/Utils/event-buffer.js +519 -515
- package/lib/Utils/history.d.ts +2 -8
- package/lib/Utils/index.js +13 -9
- package/lib/Utils/link-preview.d.ts +16 -14
- package/lib/Utils/link-preview.js +100 -92
- package/lib/Utils/logger.d.ts +9 -7
- package/lib/Utils/logger.js +1 -1
- package/lib/Utils/lt-hash.d.ts +10 -8
- package/lib/Utils/lt-hash.js +49 -44
- package/lib/Utils/make-mutex.d.ts +4 -2
- package/lib/Utils/make-mutex.js +43 -39
- package/lib/Utils/messages-media.d.ts +75 -50
- package/lib/Utils/messages.d.ts +60 -35
- package/lib/Utils/messages.js +87 -8
- package/lib/Utils/noise-handler.d.ts +13 -12
- package/lib/Utils/noise-handler.js +143 -138
- package/lib/Utils/process-message.d.ts +32 -24
- package/lib/Utils/process-message.js +387 -367
- package/lib/Utils/signal.d.ts +24 -15
- package/lib/Utils/signal.js +143 -131
- package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
- package/lib/Utils/use-mongo-file-auth-state.js +72 -63
- package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
- package/lib/Utils/use-multi-file-auth-state.js +110 -102
- package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
- package/lib/Utils/use-single-file-auth-state.js +66 -61
- package/lib/Utils/validate-connection.d.ts +5 -2
- package/lib/Utils/validate-connection.js +7 -6
- package/lib/WABinary/constants.d.ts +24 -21
- package/lib/WABinary/constants.js +1302 -31
- package/lib/WABinary/decode.d.ts +4 -1
- package/lib/WABinary/decode.js +267 -234
- package/lib/WABinary/encode.d.ts +1 -0
- package/lib/WABinary/encode.js +248 -226
- package/lib/WABinary/generic-utils.d.ts +13 -1
- package/lib/WABinary/generic-utils.js +113 -96
- package/lib/WABinary/index.js +13 -9
- package/lib/WABinary/jid-utils.d.ts +23 -4
- package/lib/WABinary/jid-utils.js +58 -39
- package/lib/WABinary/types.d.ts +15 -11
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.d.ts +14 -14
- package/lib/WAM/BinaryInfo.js +11 -8
- package/lib/WAM/constants.d.ts +34 -26
- package/lib/WAM/constants.js +15358 -15349
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +153 -144
- package/lib/WAM/index.js +13 -9
- package/lib/index.js +11 -11
- package/package.json +1 -2
- package/WASignalGroup/GroupProtocol.js +0 -1771
- package/WASignalGroup/ciphertext_message.js +0 -10
- package/WASignalGroup/group_cipher.js +0 -103
- package/WASignalGroup/group_session_builder.js +0 -39
- package/WASignalGroup/index.js +0 -5
- package/WASignalGroup/keyhelper.js +0 -17
- package/WASignalGroup/protobufs.js +0 -2
- package/WASignalGroup/queue_job.js +0 -64
- package/WASignalGroup/sender_chain_key.js +0 -38
- package/WASignalGroup/sender_key_distribution_message.js +0 -68
- package/WASignalGroup/sender_key_message.js +0 -79
- package/WASignalGroup/sender_key_name.js +0 -59
- package/WASignalGroup/sender_key_record.js +0 -47
- package/WASignalGroup/sender_key_state.js +0 -110
- package/WASignalGroup/sender_message_key.js +0 -30
package/lib/Types/Events.d.ts
CHANGED
|
@@ -10,199 +10,217 @@ import { LabelAssociation } from './LabelAssociation'
|
|
|
10
10
|
import { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
|
11
11
|
import { NewsletterViewRole, SubscriberAction, NewsletterSettingsUpdate } from './Newsletter'
|
|
12
12
|
import { ConnectionState } from './State'
|
|
13
|
+
|
|
13
14
|
export type BaileysEventMap = {
|
|
14
|
-
/** connection state has been updated -- WS closed, opened, connecting etc. */
|
|
15
|
-
'connection.update': Partial<ConnectionState>
|
|
16
|
-
/** credentials updated -- some metadata, keys or something */
|
|
17
|
-
'creds.update': Partial<AuthenticationCreds>
|
|
18
|
-
/** set chats (history sync), everything is reverse chronologically sorted */
|
|
19
|
-
'messaging-history.set': {
|
|
20
|
-
chats: Chat[]
|
|
21
|
-
contacts: Contact[]
|
|
22
|
-
messages: WAMessage[]
|
|
23
|
-
isLatest?: boolean
|
|
24
|
-
progress?: number | null
|
|
25
|
-
syncType?: proto.HistorySync.HistorySyncType
|
|
26
|
-
peerDataRequestSessionId?: string | null
|
|
27
|
-
}
|
|
28
|
-
/** upsert chats */
|
|
29
|
-
'chats.upsert': Chat[]
|
|
30
|
-
/** update the given chats */
|
|
31
|
-
'chats.update': ChatUpdate[]
|
|
32
|
-
'chats.phoneNumberShare': {
|
|
33
|
-
lid: string
|
|
34
|
-
jid: string
|
|
35
|
-
}
|
|
36
|
-
/** delete chats with given ID */
|
|
37
|
-
'chats.delete': string[]
|
|
38
|
-
/** presence of contact in a chat updated */
|
|
39
|
-
'presence.update': {
|
|
40
|
-
id: string
|
|
41
|
-
presences: {
|
|
42
|
-
[participant: string]: PresenceData
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
'contacts.upsert': Contact[]
|
|
46
|
-
'contacts.update': Partial<Contact>[]
|
|
47
|
-
'messages.delete': {
|
|
48
|
-
keys: WAMessageKey[]
|
|
49
|
-
} | {
|
|
50
|
-
jid: string
|
|
51
|
-
all: true
|
|
52
|
-
}
|
|
53
|
-
'messages.update': WAMessageUpdate[]
|
|
54
|
-
'messages.media-update': {
|
|
55
|
-
key: WAMessageKey
|
|
56
|
-
media?: {
|
|
57
|
-
ciphertext: Uint8Array
|
|
58
|
-
iv: Uint8Array
|
|
59
|
-
}
|
|
60
|
-
error?: Boom
|
|
61
|
-
}[]
|
|
62
|
-
/**
|
|
63
|
-
* add/update the given messages. If they were received while the connection was online,
|
|
64
|
-
* the update will have type: "notify"
|
|
65
|
-
* if requestId is provided, then the messages was received from the phone due to it being unavailable
|
|
66
|
-
* */
|
|
67
|
-
'messages.upsert': {
|
|
68
|
-
messages: WAMessage[]
|
|
69
|
-
type: MessageUpsertType
|
|
70
|
-
requestId?: string
|
|
71
|
-
}
|
|
72
|
-
// 'messages.poll': {
|
|
73
|
-
// key: WAMessageKey
|
|
74
|
-
// pollUpdates: proto.IPollUpdateMessage
|
|
75
|
-
// }[]
|
|
76
|
-
/** message was reacted to. If reaction was removed -- then "reaction.text" will be falsey */
|
|
77
|
-
'messages.reaction': {
|
|
78
|
-
key: WAMessageKey
|
|
79
|
-
reaction: proto.IReaction
|
|
80
|
-
}[]
|
|
81
|
-
'message-receipt.update': MessageUserReceiptUpdate[]
|
|
82
|
-
'groups.upsert': GroupMetadata[]
|
|
83
|
-
'groups.update': Partial<GroupMetadata>[]
|
|
84
|
-
/** apply an action to participants in a group */
|
|
85
|
-
'group-participants.update': {
|
|
86
|
-
id: string
|
|
87
|
-
author: string
|
|
88
|
-
participants: string[]
|
|
89
|
-
action: ParticipantAction
|
|
90
|
-
}
|
|
91
|
-
'group.join-request': {
|
|
92
|
-
id: string
|
|
93
|
-
author: string
|
|
94
|
-
participant: string
|
|
95
|
-
action: RequestJoinAction
|
|
96
|
-
method: RequestJoinMethod
|
|
97
|
-
}
|
|
98
|
-
'newsletter.reaction': {
|
|
99
|
-
id: string
|
|
100
|
-
newsletter_server_id: string
|
|
101
|
-
reaction: {
|
|
102
|
-
code?: string
|
|
103
|
-
count?: number
|
|
104
|
-
removed?: boolean
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
'newsletter.view': {
|
|
108
|
-
id: string
|
|
109
|
-
newsletter_server_id: string
|
|
110
|
-
count: number
|
|
111
|
-
}
|
|
112
|
-
'newsletter-participants.update': {
|
|
113
|
-
id: string
|
|
114
|
-
author: string
|
|
115
|
-
user: string
|
|
116
|
-
new_role: NewsletterViewRole
|
|
117
|
-
action: SubscriberAction
|
|
118
|
-
}
|
|
119
|
-
'newsletter-settings.update': {
|
|
120
|
-
id: string
|
|
121
|
-
update: NewsletterSettingsUpdate
|
|
122
|
-
}
|
|
123
|
-
'
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
'
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
15
|
+
/** connection state has been updated -- WS closed, opened, connecting etc. */
|
|
16
|
+
'connection.update': Partial<ConnectionState>
|
|
17
|
+
/** credentials updated -- some metadata, keys or something */
|
|
18
|
+
'creds.update': Partial<AuthenticationCreds>
|
|
19
|
+
/** set chats (history sync), everything is reverse chronologically sorted */
|
|
20
|
+
'messaging-history.set': {
|
|
21
|
+
chats: Chat[]
|
|
22
|
+
contacts: Contact[]
|
|
23
|
+
messages: WAMessage[]
|
|
24
|
+
isLatest?: boolean
|
|
25
|
+
progress?: number | null
|
|
26
|
+
syncType?: proto.HistorySync.HistorySyncType
|
|
27
|
+
peerDataRequestSessionId?: string | null
|
|
28
|
+
}
|
|
29
|
+
/** upsert chats */
|
|
30
|
+
'chats.upsert': Chat[]
|
|
31
|
+
/** update the given chats */
|
|
32
|
+
'chats.update': ChatUpdate[]
|
|
33
|
+
'chats.phoneNumberShare': {
|
|
34
|
+
lid: string
|
|
35
|
+
jid: string
|
|
36
|
+
}
|
|
37
|
+
/** delete chats with given ID */
|
|
38
|
+
'chats.delete': string[]
|
|
39
|
+
/** presence of contact in a chat updated */
|
|
40
|
+
'presence.update': {
|
|
41
|
+
id: string
|
|
42
|
+
presences: {
|
|
43
|
+
[participant: string]: PresenceData
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
'contacts.upsert': Contact[]
|
|
47
|
+
'contacts.update': Partial<Contact>[]
|
|
48
|
+
'messages.delete': {
|
|
49
|
+
keys: WAMessageKey[]
|
|
50
|
+
} | {
|
|
51
|
+
jid: string
|
|
52
|
+
all: true
|
|
53
|
+
}
|
|
54
|
+
'messages.update': WAMessageUpdate[]
|
|
55
|
+
'messages.media-update': {
|
|
56
|
+
key: WAMessageKey
|
|
57
|
+
media?: {
|
|
58
|
+
ciphertext: Uint8Array
|
|
59
|
+
iv: Uint8Array
|
|
60
|
+
}
|
|
61
|
+
error?: Boom
|
|
62
|
+
}[]
|
|
63
|
+
/**
|
|
64
|
+
* add/update the given messages. If they were received while the connection was online,
|
|
65
|
+
* the update will have type: "notify"
|
|
66
|
+
* if requestId is provided, then the messages was received from the phone due to it being unavailable
|
|
67
|
+
* */
|
|
68
|
+
'messages.upsert': {
|
|
69
|
+
messages: WAMessage[]
|
|
70
|
+
type: MessageUpsertType
|
|
71
|
+
requestId?: string
|
|
72
|
+
}
|
|
73
|
+
// 'messages.poll': {
|
|
74
|
+
// key: WAMessageKey
|
|
75
|
+
// pollUpdates: proto.IPollUpdateMessage
|
|
76
|
+
// }[]
|
|
77
|
+
/** message was reacted to. If reaction was removed -- then "reaction.text" will be falsey */
|
|
78
|
+
'messages.reaction': {
|
|
79
|
+
key: WAMessageKey
|
|
80
|
+
reaction: proto.IReaction
|
|
81
|
+
}[]
|
|
82
|
+
'message-receipt.update': MessageUserReceiptUpdate[]
|
|
83
|
+
'groups.upsert': GroupMetadata[]
|
|
84
|
+
'groups.update': Partial<GroupMetadata>[]
|
|
85
|
+
/** apply an action to participants in a group */
|
|
86
|
+
'group-participants.update': {
|
|
87
|
+
id: string
|
|
88
|
+
author: string
|
|
89
|
+
participants: string[]
|
|
90
|
+
action: ParticipantAction
|
|
91
|
+
}
|
|
92
|
+
'group.join-request': {
|
|
93
|
+
id: string
|
|
94
|
+
author: string
|
|
95
|
+
participant: string
|
|
96
|
+
action: RequestJoinAction
|
|
97
|
+
method: RequestJoinMethod
|
|
98
|
+
}
|
|
99
|
+
'newsletter.reaction': {
|
|
100
|
+
id: string
|
|
101
|
+
newsletter_server_id: string
|
|
102
|
+
reaction: {
|
|
103
|
+
code?: string
|
|
104
|
+
count?: number
|
|
105
|
+
removed?: boolean
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
'newsletter.view': {
|
|
109
|
+
id: string
|
|
110
|
+
newsletter_server_id: string
|
|
111
|
+
count: number
|
|
112
|
+
}
|
|
113
|
+
'newsletter-participants.update': {
|
|
114
|
+
id: string
|
|
115
|
+
author: string
|
|
116
|
+
user: string
|
|
117
|
+
new_role: NewsletterViewRole
|
|
118
|
+
action: SubscriberAction
|
|
119
|
+
}
|
|
120
|
+
'newsletter-settings.update': {
|
|
121
|
+
id: string
|
|
122
|
+
update: NewsletterSettingsUpdate
|
|
123
|
+
}
|
|
124
|
+
'limit-sharing.update': {
|
|
125
|
+
id: string
|
|
126
|
+
author: string
|
|
127
|
+
action: 'on' | 'off'
|
|
128
|
+
trigger: proto.LimitSharing.TriggerType
|
|
129
|
+
update_time: number
|
|
130
|
+
}
|
|
131
|
+
'community-owner.update': {
|
|
132
|
+
id: string
|
|
133
|
+
author: string
|
|
134
|
+
user: string
|
|
135
|
+
new_role: 'SUPERADMIN_MEMBER'
|
|
136
|
+
update_time: number
|
|
137
|
+
}
|
|
138
|
+
'blocklist.set': {
|
|
139
|
+
blocklist: string[]
|
|
140
|
+
}
|
|
141
|
+
'blocklist.update': {
|
|
142
|
+
blocklist: string[]
|
|
143
|
+
type: 'add' | 'remove'
|
|
144
|
+
}
|
|
145
|
+
/** Receive an update on a call, including when the call was received, rejected, accepted */
|
|
146
|
+
'call': WACallEvent[]
|
|
147
|
+
'labels.edit': Label
|
|
148
|
+
'labels.association': {
|
|
149
|
+
association: LabelAssociation
|
|
150
|
+
type: 'add' | 'remove'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
138
154
|
export type BufferedEventData = {
|
|
139
|
-
historySets: {
|
|
140
|
-
chats: {
|
|
141
|
-
[jid: string]: Chat
|
|
142
|
-
}
|
|
143
|
-
contacts: {
|
|
144
|
-
[jid: string]: Contact
|
|
145
|
-
}
|
|
146
|
-
messages: {
|
|
147
|
-
[uqId: string]: WAMessage
|
|
148
|
-
}
|
|
149
|
-
empty: boolean
|
|
150
|
-
isLatest: boolean
|
|
151
|
-
progress?: number | null
|
|
152
|
-
syncType?: proto.HistorySync.HistorySyncType
|
|
153
|
-
peerDataRequestSessionId?: string
|
|
154
|
-
}
|
|
155
|
-
chatUpserts: {
|
|
156
|
-
[jid: string]: Chat
|
|
157
|
-
}
|
|
158
|
-
chatUpdates: {
|
|
159
|
-
[jid: string]: ChatUpdate
|
|
160
|
-
}
|
|
161
|
-
chatDeletes: Set<string>
|
|
162
|
-
contactUpserts: {
|
|
163
|
-
[jid: string]: Contact
|
|
164
|
-
}
|
|
165
|
-
contactUpdates: {
|
|
166
|
-
[jid: string]: Partial<Contact>
|
|
167
|
-
}
|
|
168
|
-
messageUpserts: {
|
|
169
|
-
[key: string]: {
|
|
170
|
-
type: MessageUpsertType
|
|
171
|
-
message: WAMessage
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
messageUpdates: {
|
|
175
|
-
[key: string]: WAMessageUpdate
|
|
176
|
-
}
|
|
177
|
-
messageDeletes: {
|
|
178
|
-
[key: string]: WAMessageKey
|
|
179
|
-
}
|
|
180
|
-
// messagePollings: {
|
|
181
|
-
// [key: string]: {
|
|
182
|
-
// key: WAMessageKey
|
|
183
|
-
// pollUpdates: proto.IPollUpdateMessage[]
|
|
184
|
-
// }
|
|
185
|
-
// }
|
|
186
|
-
messageReactions: {
|
|
187
|
-
[key: string]: {
|
|
188
|
-
key: WAMessageKey
|
|
189
|
-
reactions: proto.IReaction[]
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
messageReceipts: {
|
|
193
|
-
[key: string]: {
|
|
194
|
-
key: WAMessageKey
|
|
195
|
-
userReceipt: proto.IUserReceipt[]
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
groupUpdates: {
|
|
199
|
-
[jid: string]: Partial<GroupMetadata>
|
|
200
|
-
}
|
|
201
|
-
}
|
|
155
|
+
historySets: {
|
|
156
|
+
chats: {
|
|
157
|
+
[jid: string]: Chat
|
|
158
|
+
}
|
|
159
|
+
contacts: {
|
|
160
|
+
[jid: string]: Contact
|
|
161
|
+
}
|
|
162
|
+
messages: {
|
|
163
|
+
[uqId: string]: WAMessage
|
|
164
|
+
}
|
|
165
|
+
empty: boolean
|
|
166
|
+
isLatest: boolean
|
|
167
|
+
progress?: number | null
|
|
168
|
+
syncType?: proto.HistorySync.HistorySyncType
|
|
169
|
+
peerDataRequestSessionId?: string
|
|
170
|
+
}
|
|
171
|
+
chatUpserts: {
|
|
172
|
+
[jid: string]: Chat
|
|
173
|
+
}
|
|
174
|
+
chatUpdates: {
|
|
175
|
+
[jid: string]: ChatUpdate
|
|
176
|
+
}
|
|
177
|
+
chatDeletes: Set<string>
|
|
178
|
+
contactUpserts: {
|
|
179
|
+
[jid: string]: Contact
|
|
180
|
+
}
|
|
181
|
+
contactUpdates: {
|
|
182
|
+
[jid: string]: Partial<Contact>
|
|
183
|
+
}
|
|
184
|
+
messageUpserts: {
|
|
185
|
+
[key: string]: {
|
|
186
|
+
type: MessageUpsertType
|
|
187
|
+
message: WAMessage
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
messageUpdates: {
|
|
191
|
+
[key: string]: WAMessageUpdate
|
|
192
|
+
}
|
|
193
|
+
messageDeletes: {
|
|
194
|
+
[key: string]: WAMessageKey
|
|
195
|
+
}
|
|
196
|
+
// messagePollings: {
|
|
197
|
+
// [key: string]: {
|
|
198
|
+
// key: WAMessageKey
|
|
199
|
+
// pollUpdates: proto.IPollUpdateMessage[]
|
|
200
|
+
// }
|
|
201
|
+
// }
|
|
202
|
+
messageReactions: {
|
|
203
|
+
[key: string]: {
|
|
204
|
+
key: WAMessageKey
|
|
205
|
+
reactions: proto.IReaction[]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
messageReceipts: {
|
|
209
|
+
[key: string]: {
|
|
210
|
+
key: WAMessageKey
|
|
211
|
+
userReceipt: proto.IUserReceipt[]
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
groupUpdates: {
|
|
215
|
+
[jid: string]: Partial<GroupMetadata>
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
202
219
|
export type BaileysEvent = keyof BaileysEventMap
|
|
220
|
+
|
|
203
221
|
export interface BaileysEventEmitter {
|
|
204
|
-
on<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void
|
|
205
|
-
off<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void
|
|
206
|
-
removeAllListeners<T extends keyof BaileysEventMap>(event: T): void
|
|
207
|
-
emit<T extends keyof BaileysEventMap>(event: T, arg: BaileysEventMap[T]): boolean
|
|
222
|
+
on<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void
|
|
223
|
+
off<T extends keyof BaileysEventMap>(event: T, listener: (arg: BaileysEventMap[T]) => void): void
|
|
224
|
+
removeAllListeners<T extends keyof BaileysEventMap>(event: T): void
|
|
225
|
+
emit<T extends keyof BaileysEventMap>(event: T, arg: BaileysEventMap[T]): boolean
|
|
208
226
|
}
|
package/lib/Types/Events.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Contact } from './Contact'
|
|
2
2
|
|
|
3
|
-
export type GroupParticipant = Contact & {
|
|
3
|
+
export type GroupParticipant = (Contact & {
|
|
4
4
|
isAdmin?: boolean
|
|
5
5
|
isSuperAdmin?: boolean
|
|
6
|
-
admin?: 'admin' | 'superadmin' |
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
admin?: 'admin' | 'superadmin' | null
|
|
7
|
+
})
|
|
9
8
|
|
|
10
9
|
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
|
|
11
10
|
|
|
@@ -15,22 +14,18 @@ export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin
|
|
|
15
14
|
|
|
16
15
|
export interface GroupMetadata {
|
|
17
16
|
id: string
|
|
18
|
-
|
|
19
|
-
addressingMode: 'pn' | 'lid'
|
|
17
|
+
addressingMode: string
|
|
20
18
|
owner: string | undefined
|
|
21
|
-
|
|
19
|
+
ownerCountry: string,
|
|
22
20
|
subject: string
|
|
23
21
|
/** group subject owner */
|
|
24
22
|
subjectOwner?: string
|
|
25
|
-
subjectOwnerJid?: string
|
|
26
23
|
/** group subject modification date */
|
|
27
24
|
subjectTime?: number
|
|
28
25
|
creation?: number
|
|
29
26
|
desc?: string
|
|
30
27
|
descOwner?: string
|
|
31
|
-
descOwnerJid?: string
|
|
32
28
|
descId?: string
|
|
33
|
-
descTime?: number
|
|
34
29
|
/** if this group is part of a community, it returns the jid of the community to which it belongs */
|
|
35
30
|
linkedParent?: string
|
|
36
31
|
/** is set when the group only allows admins to change group settings */
|
|
@@ -47,35 +42,25 @@ export interface GroupMetadata {
|
|
|
47
42
|
isCommunityAnnounce?: boolean
|
|
48
43
|
/** number of group participants */
|
|
49
44
|
size?: number
|
|
50
|
-
// Baileys modified array
|
|
51
45
|
participants: GroupParticipant[]
|
|
46
|
+
picture?: string
|
|
52
47
|
ephemeralDuration?: number
|
|
53
48
|
inviteCode?: string
|
|
54
49
|
/** the person who added you to group or changed some setting in group */
|
|
55
50
|
author?: string
|
|
56
|
-
// New properties added for lid support
|
|
57
|
-
ownerCountry?: string
|
|
58
|
-
picture?: string
|
|
59
51
|
}
|
|
60
52
|
|
|
61
53
|
export interface WAGroupCreateResponse {
|
|
62
54
|
status: number
|
|
63
55
|
gid?: string
|
|
64
|
-
participants?: [{
|
|
56
|
+
participants?: [{
|
|
57
|
+
[key: string]: {}
|
|
58
|
+
}]
|
|
65
59
|
}
|
|
66
60
|
|
|
67
61
|
export interface GroupModificationResponse {
|
|
68
62
|
status: number
|
|
69
|
-
participants?: {
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Additional types for better lid support
|
|
73
|
-
export interface GroupMetadataLid extends GroupMetadata {
|
|
74
|
-
addressingMode: 'lid'
|
|
75
|
-
ownerJid: string
|
|
76
|
-
participants: (GroupParticipant & { lid: string })[]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface GroupMetadataPn extends GroupMetadata {
|
|
80
|
-
addressingMode: 'pn'
|
|
63
|
+
participants?: {
|
|
64
|
+
[key: string]: {}
|
|
65
|
+
}
|
|
81
66
|
}
|
package/lib/Types/Label.d.ts
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
export interface Label {
|
|
2
|
-
/** Label uniq ID */
|
|
3
|
-
id: string
|
|
4
|
-
/** Label name */
|
|
5
|
-
name: string
|
|
6
|
-
/** Label color ID */
|
|
7
|
-
color: number
|
|
8
|
-
/** Is label has been deleted */
|
|
9
|
-
deleted: boolean
|
|
10
|
-
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
|
11
|
-
predefinedId?: string
|
|
2
|
+
/** Label uniq ID */
|
|
3
|
+
id: string
|
|
4
|
+
/** Label name */
|
|
5
|
+
name: string
|
|
6
|
+
/** Label color ID */
|
|
7
|
+
color: number
|
|
8
|
+
/** Is label has been deleted */
|
|
9
|
+
deleted: boolean
|
|
10
|
+
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
|
11
|
+
predefinedId?: string
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
export interface LabelActionBody {
|
|
14
|
-
id: string
|
|
15
|
-
/** Label name */
|
|
16
|
-
name?: string
|
|
17
|
-
/** Label color ID */
|
|
18
|
-
color?: number
|
|
19
|
-
/** Is label has been deleted */
|
|
20
|
-
deleted?: boolean
|
|
21
|
-
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
|
22
|
-
predefinedId?: number
|
|
15
|
+
id: string
|
|
16
|
+
/** Label name */
|
|
17
|
+
name?: string
|
|
18
|
+
/** Label color ID */
|
|
19
|
+
color?: number
|
|
20
|
+
/** Is label has been deleted */
|
|
21
|
+
deleted?: boolean
|
|
22
|
+
/** WhatsApp has 5 predefined labels (New customer, New order & etc) */
|
|
23
|
+
predefinedId?: number
|
|
23
24
|
}
|
|
25
|
+
|
|
24
26
|
/** WhatsApp has 20 predefined colors */
|
|
25
27
|
export declare const enum LabelColor {
|
|
26
|
-
Color1 = 0,
|
|
27
|
-
Color2 = 1,
|
|
28
|
-
Color3 = 2,
|
|
29
|
-
Color4 = 3,
|
|
30
|
-
Color5 = 4,
|
|
31
|
-
Color6 = 5,
|
|
32
|
-
Color7 = 6,
|
|
33
|
-
Color8 = 7,
|
|
34
|
-
Color9 = 8,
|
|
35
|
-
Color10 = 9,
|
|
36
|
-
Color11 = 10,
|
|
37
|
-
Color12 = 11,
|
|
38
|
-
Color13 = 12,
|
|
39
|
-
Color14 = 13,
|
|
40
|
-
Color15 = 14,
|
|
41
|
-
Color16 = 15,
|
|
42
|
-
Color17 = 16,
|
|
43
|
-
Color18 = 17,
|
|
44
|
-
Color19 = 18,
|
|
45
|
-
Color20 = 19
|
|
28
|
+
Color1 = 0,
|
|
29
|
+
Color2 = 1,
|
|
30
|
+
Color3 = 2,
|
|
31
|
+
Color4 = 3,
|
|
32
|
+
Color5 = 4,
|
|
33
|
+
Color6 = 5,
|
|
34
|
+
Color7 = 6,
|
|
35
|
+
Color8 = 7,
|
|
36
|
+
Color9 = 8,
|
|
37
|
+
Color10 = 9,
|
|
38
|
+
Color11 = 10,
|
|
39
|
+
Color12 = 11,
|
|
40
|
+
Color13 = 12,
|
|
41
|
+
Color14 = 13,
|
|
42
|
+
Color15 = 14,
|
|
43
|
+
Color16 = 15,
|
|
44
|
+
Color17 = 16,
|
|
45
|
+
Color18 = 17,
|
|
46
|
+
Color19 = 18,
|
|
47
|
+
Color20 = 19
|
|
46
48
|
}
|
package/lib/Types/Label.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
"use strict"
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
3
5
|
/** WhatsApp has 20 predefined colors */
|
|
4
6
|
const LabelColor = {
|
|
5
|
-
Color1: 0,
|
|
6
|
-
Color2: 1,
|
|
7
|
-
Color3: 2,
|
|
8
|
-
Color4: 3,
|
|
9
|
-
Color5: 4,
|
|
10
|
-
Color6: 5,
|
|
11
|
-
Color7: 6,
|
|
12
|
-
Color8: 7,
|
|
13
|
-
Color9: 8,
|
|
14
|
-
Color10: 9,
|
|
15
|
-
Color11: 10,
|
|
16
|
-
Color12: 11,
|
|
17
|
-
Color13: 12,
|
|
18
|
-
Color14: 13,
|
|
19
|
-
Color15: 14,
|
|
20
|
-
Color16: 15,
|
|
21
|
-
Color17: 16,
|
|
22
|
-
Color18: 17,
|
|
23
|
-
Color19: 18,
|
|
24
|
-
Color20: 19
|
|
7
|
+
Color1: 0,
|
|
8
|
+
Color2: 1,
|
|
9
|
+
Color3: 2,
|
|
10
|
+
Color4: 3,
|
|
11
|
+
Color5: 4,
|
|
12
|
+
Color6: 5,
|
|
13
|
+
Color7: 6,
|
|
14
|
+
Color8: 7,
|
|
15
|
+
Color9: 8,
|
|
16
|
+
Color10: 9,
|
|
17
|
+
Color11: 10,
|
|
18
|
+
Color12: 11,
|
|
19
|
+
Color13: 12,
|
|
20
|
+
Color14: 13,
|
|
21
|
+
Color15: 14,
|
|
22
|
+
Color16: 15,
|
|
23
|
+
Color17: 16,
|
|
24
|
+
Color18: 17,
|
|
25
|
+
Color19: 18,
|
|
26
|
+
Color20: 19
|
|
25
27
|
}
|
|
28
|
+
|
|
26
29
|
module.exports = {
|
|
27
|
-
LabelColor
|
|
30
|
+
LabelColor
|
|
28
31
|
}
|