@hansaka02/baileys 7.3.2 → 7.3.4
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/README.md +247 -203
- package/lib/Defaults/connection.js +51 -0
- package/lib/Defaults/constants.js +62 -0
- package/lib/Defaults/history.js +17 -0
- package/lib/Defaults/index.js +36 -142
- package/lib/Defaults/media.js +48 -0
- package/lib/Defaults/prefix.js +18 -0
- package/lib/Signal/Group/group-session-builder.js +10 -42
- package/lib/Signal/Group/group_cipher.js +9 -6
- package/lib/Signal/Group/index.js +39 -53
- package/lib/Signal/Group/keyhelper.js +8 -41
- package/lib/Signal/Group/sender-chain-key.js +4 -4
- package/lib/Signal/Group/sender-key-distribution-message.js +5 -5
- package/lib/Signal/Group/sender-key-message.js +12 -8
- package/lib/Signal/Group/sender-key-record.js +7 -7
- package/lib/Signal/Group/sender-key-state.js +4 -4
- package/lib/Signal/Group/sender-message-key.js +2 -2
- package/lib/Signal/libsignal.js +45 -69
- package/lib/Signal/lid-mapping.js +15 -11
- package/lib/Socket/Client/types.js +2 -2
- package/lib/Socket/Client/websocket.js +16 -14
- package/lib/Socket/business.js +41 -32
- package/lib/Socket/chats.js +123 -98
- package/lib/Socket/community.js +50 -40
- package/lib/Socket/groups.js +59 -47
- package/lib/Socket/index.js +4 -4
- package/lib/Socket/messages-recv.js +219 -172
- package/lib/Socket/messages-send.js +187 -143
- package/lib/Socket/newsletter.js +61 -47
- package/lib/Socket/socket.js +133 -90
- package/lib/Socket/usync.js +6 -6
- package/lib/Store/index.js +27 -11
- package/lib/Store/make-cache-manager-store.js +14 -15
- package/lib/Store/make-in-memory-store.js +28 -24
- package/lib/Types/LabelAssociation.js +2 -2
- package/lib/Types/Message.js +6 -6
- package/lib/Types/MexUpdates.js +5 -5
- package/lib/Types/State.js +4 -4
- package/lib/Types/index.js +28 -12
- package/lib/Utils/auth-utils.js +28 -26
- package/lib/Utils/baileys-event-stream.js +68 -69
- package/lib/Utils/business.js +63 -53
- package/lib/Utils/chat-utils.js +81 -71
- package/lib/Utils/crypto.js +25 -45
- package/lib/Utils/decode-wa-message.js +319 -311
- package/lib/Utils/event-buffer.js +21 -22
- package/lib/Utils/generics.js +65 -82
- package/lib/Utils/history.js +21 -21
- package/lib/Utils/index.js +27 -13
- package/lib/Utils/link-preview.js +7 -30
- package/lib/Utils/logger.js +5 -5
- package/lib/Utils/lt-hash.js +3 -3
- package/lib/Utils/message-retry-manager.js +4 -4
- package/lib/Utils/messages-media.js +104 -109
- package/lib/Utils/messages.js +203 -171
- package/lib/Utils/noise-handler.js +28 -19
- package/lib/Utils/process-message.js +111 -96
- package/lib/Utils/signal.js +36 -25
- package/lib/Utils/use-multi-file-auth-state.js +18 -22
- package/lib/Utils/validate-connection.js +52 -45
- package/lib/WABinary/decode.js +6 -32
- package/lib/WABinary/encode.js +3 -29
- package/lib/WABinary/generic-utils.js +4 -4
- package/lib/WABinary/index.js +27 -11
- package/lib/WAM/encode.js +16 -8
- package/lib/WAM/index.js +27 -11
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.js +20 -16
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +7 -4
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +2 -2
- package/lib/WAUSync/Protocols/USyncLIDProtocol.js +0 -2
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +2 -2
- package/lib/WAUSync/Protocols/index.js +27 -11
- package/lib/WAUSync/USyncQuery.js +17 -10
- package/lib/WAUSync/index.js +27 -11
- package/lib/index.js +60 -31
- package/package.json +8 -14
- package/WAProto/AICommon/AICommon.d.ts +0 -11702
- package/WAProto/Adv/Adv.d.ts +0 -643
- package/WAProto/BotMetadata/BotMetadata.d.ts +0 -5654
- package/WAProto/Cert/Cert.d.ts +0 -613
- package/WAProto/ChatLockSettings/ChatLockSettings.d.ts +0 -476
- package/WAProto/CompanionReg/CompanionReg.d.ts +0 -1361
- package/WAProto/DeviceCapabilities/DeviceCapabilities.d.ts +0 -577
- package/WAProto/E2E/E2E.d.ts +0 -41724
- package/WAProto/Ephemeral/Ephemeral.d.ts +0 -114
- package/WAProto/HistorySync/HistorySync.d.ts +0 -51700
- package/WAProto/LidMigrationSyncPayload/LidMigrationSyncPayload.d.ts +0 -229
- package/WAProto/MdStorageChatRowOpaqueData/MdStorageChatRowOpaqueData.d.ts +0 -583
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +0 -42897
- package/WAProto/MmsRetry/MmsRetry.d.ts +0 -243
- package/WAProto/Protocol/Protocol.d.ts +0 -270
- package/WAProto/Reporting/Reporting.d.ts +0 -371
- package/WAProto/ServerSync/ServerSync.d.ts +0 -1285
- package/WAProto/SignalLocalStorageProtocol/SignalLocalStorageProtocol.d.ts +0 -1868
- package/WAProto/SignalWhisperTextProtocol/SignalWhisperTextProtocol.d.ts +0 -767
- package/WAProto/StatusAttributions/StatusAttributions.d.ts +0 -1027
- package/WAProto/SyncAction/SyncAction.d.ts +0 -11193
- package/WAProto/UserPassword/UserPassword.d.ts +0 -363
- package/WAProto/VnameCert/VnameCert.d.ts +0 -821
- package/WAProto/Wa6/Wa6.d.ts +0 -2128
- package/WAProto/Web/Web.d.ts +0 -46383
- package/WAProto/index.d.ts +0 -55
- package/lib/Defaults/index.d.ts +0 -77
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
- package/lib/Signal/Group/group-session-builder.d.ts +0 -17
- package/lib/Signal/Group/group_cipher.d.ts +0 -19
- package/lib/Signal/Group/index.d.ts +0 -11
- package/lib/Signal/Group/keyhelper.d.ts +0 -16
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -14
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -17
- package/lib/Signal/Group/sender-key-message.d.ts +0 -19
- package/lib/Signal/Group/sender-key-name.d.ts +0 -19
- package/lib/Signal/Group/sender-key-record.d.ts +0 -32
- package/lib/Signal/Group/sender-key-state.d.ts +0 -44
- package/lib/Signal/Group/sender-message-key.d.ts +0 -11
- package/lib/Signal/libsignal.d.ts +0 -8
- package/lib/Signal/lid-mapping.d.ts +0 -28
- package/lib/Socket/Client/index.d.ts +0 -2
- package/lib/Socket/Client/types.d.ts +0 -16
- package/lib/Socket/Client/websocket.d.ts +0 -13
- package/lib/Socket/business.d.ts +0 -187
- package/lib/Socket/chats.d.ts +0 -97
- package/lib/Socket/community.d.ts +0 -129
- package/lib/Socket/groups.d.ts +0 -129
- package/lib/Socket/index.d.ts +0 -191
- package/lib/Socket/messages-recv.d.ts +0 -174
- package/lib/Socket/messages-send.d.ts +0 -165
- package/lib/Socket/newsletter.d.ts +0 -145
- package/lib/Socket/socket.d.ts +0 -45
- package/lib/Socket/usync.d.ts +0 -37
- package/lib/Store/index.d.ts +0 -4
- package/lib/Store/make-cache-manager-store.d.ts +0 -14
- package/lib/Store/make-in-memory-store.d.ts +0 -123
- package/lib/Store/make-ordered-dictionary.d.ts +0 -12
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Types/Auth.d.ts +0 -121
- package/lib/Types/Bussiness.d.ts +0 -28
- package/lib/Types/Call.d.ts +0 -14
- package/lib/Types/Chat.d.ts +0 -143
- package/lib/Types/Contact.d.ts +0 -23
- package/lib/Types/Events.d.ts +0 -226
- package/lib/Types/GroupMetadata.d.ts +0 -66
- package/lib/Types/Label.d.ts +0 -48
- package/lib/Types/LabelAssociation.d.ts +0 -35
- package/lib/Types/Message.d.ts +0 -484
- package/lib/Types/MexUpdates.d.ts +0 -9
- package/lib/Types/Newsletter.d.ts +0 -109
- package/lib/Types/Product.d.ts +0 -92
- package/lib/Types/Signal.d.ts +0 -98
- package/lib/Types/Socket.d.ts +0 -141
- package/lib/Types/State.d.ts +0 -41
- package/lib/Types/USync.d.ts +0 -26
- package/lib/Types/index.d.ts +0 -80
- package/lib/Utils/auth-utils.d.ts +0 -21
- package/lib/Utils/baileys-event-stream.d.ts +0 -18
- package/lib/Utils/business.d.ts +0 -29
- package/lib/Utils/chat-utils.d.ts +0 -82
- package/lib/Utils/crypto.d.ts +0 -56
- package/lib/Utils/decode-wa-message.d.ts +0 -53
- package/lib/Utils/event-buffer.d.ts +0 -39
- package/lib/Utils/generics.d.ts +0 -117
- package/lib/Utils/history.d.ts +0 -23
- package/lib/Utils/index.d.ts +0 -20
- package/lib/Utils/link-preview.d.ts +0 -23
- package/lib/Utils/logger.d.ts +0 -13
- package/lib/Utils/lt-hash.d.ts +0 -14
- package/lib/Utils/make-mutex.d.ts +0 -9
- package/lib/Utils/message-retry-manager.d.ts +0 -88
- package/lib/Utils/messages-media.d.ts +0 -135
- package/lib/Utils/messages.d.ts +0 -105
- package/lib/Utils/noise-handler.d.ts +0 -20
- package/lib/Utils/process-message.d.ts +0 -49
- package/lib/Utils/signal.d.ts +0 -42
- package/lib/Utils/use-mongo-file-auth-state.d.ts +0 -6
- package/lib/Utils/use-mongo-file-auth-state.js +0 -84
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
- package/lib/Utils/use-single-file-auth-state.d.ts +0 -13
- package/lib/Utils/use-single-file-auth-state.js +0 -80
- package/lib/Utils/validate-connection.d.ts +0 -13
- package/lib/WABinary/constants.d.ts +0 -30
- package/lib/WABinary/decode.d.ts +0 -9
- package/lib/WABinary/encode.d.ts +0 -3
- package/lib/WABinary/generic-utils.d.ts +0 -28
- package/lib/WABinary/index.d.ts +0 -5
- package/lib/WABinary/jid-utils.d.ts +0 -58
- package/lib/WABinary/types.d.ts +0 -22
- package/lib/WAM/BinaryInfo.d.ts +0 -16
- package/lib/WAM/constants.d.ts +0 -47
- package/lib/WAM/encode.d.ts +0 -3
- package/lib/WAM/index.d.ts +0 -3
- package/lib/WAUSync/Protocols/USyncBotProfileProtocol.d.ts +0 -28
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -26
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -14
- package/lib/WAUSync/Protocols/USyncLIDProtocol.d.ts +0 -10
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -14
- package/lib/WAUSync/Protocols/index.d.ts +0 -6
- package/lib/WAUSync/USyncQuery.d.ts +0 -31
- package/lib/WAUSync/USyncUser.d.ts +0 -12
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/index.d.ts +0 -13
package/lib/Types/Events.d.ts
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import type { Boom } from '@hapi/boom'
|
|
2
|
-
import { proto } from '../../WAProto'
|
|
3
|
-
import { AuthenticationCreds } from './Auth'
|
|
4
|
-
import { WACallEvent } from './Call'
|
|
5
|
-
import { Chat, ChatUpdate, PresenceData } from './Chat'
|
|
6
|
-
import { Contact } from './Contact'
|
|
7
|
-
import { GroupMetadata, ParticipantAction, RequestJoinAction, RequestJoinMethod } from './GroupMetadata'
|
|
8
|
-
import { Label } from './Label'
|
|
9
|
-
import { LabelAssociation } from './LabelAssociation'
|
|
10
|
-
import { MessageUpsertType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'
|
|
11
|
-
import { NewsletterViewRole, SubscriberAction, NewsletterSettingsUpdate } from './Newsletter'
|
|
12
|
-
import { ConnectionState } from './State'
|
|
13
|
-
|
|
14
|
-
export type BaileysEventMap = {
|
|
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
|
-
'lid-mapping.update': {
|
|
34
|
-
lid: string
|
|
35
|
-
pn: 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
|
-
|
|
154
|
-
export type BufferedEventData = {
|
|
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
|
-
|
|
219
|
-
export type BaileysEvent = keyof BaileysEventMap
|
|
220
|
-
|
|
221
|
-
export interface BaileysEventEmitter {
|
|
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
|
|
226
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Contact } from './Contact'
|
|
2
|
-
|
|
3
|
-
export type GroupParticipant = (Contact & {
|
|
4
|
-
isAdmin?: boolean
|
|
5
|
-
isSuperAdmin?: boolean
|
|
6
|
-
admin?: 'admin' | 'superadmin' | null
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
|
|
10
|
-
|
|
11
|
-
export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
|
|
12
|
-
|
|
13
|
-
export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined
|
|
14
|
-
|
|
15
|
-
export interface GroupMetadata {
|
|
16
|
-
id: string
|
|
17
|
-
addressingMode: string
|
|
18
|
-
owner: string | undefined
|
|
19
|
-
ownerCountry: string,
|
|
20
|
-
subject: string
|
|
21
|
-
/** group subject owner */
|
|
22
|
-
subjectOwner?: string
|
|
23
|
-
/** group subject modification date */
|
|
24
|
-
subjectTime?: number
|
|
25
|
-
creation?: number
|
|
26
|
-
desc?: string
|
|
27
|
-
descOwner?: string
|
|
28
|
-
descId?: string
|
|
29
|
-
/** if this group is part of a community, it returns the jid of the community to which it belongs */
|
|
30
|
-
linkedParent?: string
|
|
31
|
-
/** is set when the group only allows admins to change group settings */
|
|
32
|
-
restrict?: boolean
|
|
33
|
-
/** is set when the group only allows admins to write messages */
|
|
34
|
-
announce?: boolean
|
|
35
|
-
/** is set when the group also allows members to add participants */
|
|
36
|
-
memberAddMode?: boolean
|
|
37
|
-
/** Request approval to join the group */
|
|
38
|
-
joinApprovalMode?: boolean
|
|
39
|
-
/** is this a community */
|
|
40
|
-
isCommunity?: boolean
|
|
41
|
-
/** is this the announce of a community */
|
|
42
|
-
isCommunityAnnounce?: boolean
|
|
43
|
-
/** number of group participants */
|
|
44
|
-
size?: number
|
|
45
|
-
participants: GroupParticipant[]
|
|
46
|
-
picture?: string
|
|
47
|
-
ephemeralDuration?: number
|
|
48
|
-
inviteCode?: string
|
|
49
|
-
/** the person who added you to group or changed some setting in group */
|
|
50
|
-
author?: string
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface WAGroupCreateResponse {
|
|
54
|
-
status: number
|
|
55
|
-
gid?: string
|
|
56
|
-
participants?: [{
|
|
57
|
-
[key: string]: {}
|
|
58
|
-
}]
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface GroupModificationResponse {
|
|
62
|
-
status: number
|
|
63
|
-
participants?: {
|
|
64
|
-
[key: string]: {}
|
|
65
|
-
}
|
|
66
|
-
}
|
package/lib/Types/Label.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface LabelActionBody {
|
|
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
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** WhatsApp has 20 predefined colors */
|
|
27
|
-
export declare const enum LabelColor {
|
|
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
|
|
48
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** Association type */
|
|
2
|
-
export declare const enum LabelAssociationType {
|
|
3
|
-
Chat = "label_jid",
|
|
4
|
-
Message = "label_message"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type LabelAssociationTypes = LabelAssociationType
|
|
8
|
-
|
|
9
|
-
/** Association for chat */
|
|
10
|
-
export interface ChatLabelAssociation {
|
|
11
|
-
type: LabelAssociationType.Chat
|
|
12
|
-
chatId: string
|
|
13
|
-
labelId: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Association for message */
|
|
17
|
-
export interface MessageLabelAssociation {
|
|
18
|
-
type: LabelAssociationType.Message
|
|
19
|
-
chatId: string
|
|
20
|
-
messageId: string
|
|
21
|
-
labelId: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type LabelAssociation = ChatLabelAssociation | MessageLabelAssociation
|
|
25
|
-
|
|
26
|
-
/** Body for add/remove chat label association action */
|
|
27
|
-
export interface ChatLabelAssociationActionBody {
|
|
28
|
-
labelId: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** body for add/remove message label association action */
|
|
32
|
-
export interface MessageLabelAssociationActionBody {
|
|
33
|
-
labelId: string
|
|
34
|
-
messageId: string
|
|
35
|
-
}
|