sanka-baileyss 2.1.4 → 2.1.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/lib/Socket/groups.d.ts +117 -123
- package/lib/Socket/groups.js +355 -305
- package/lib/Socket/socket.js +731 -596
- package/lib/Types/Contact.d.ts +35 -24
- package/lib/Types/GroupMetadata.d.ts +70 -48
- package/lib/Types/Message.d.ts +348 -259
- package/lib/Utils/chat-utils.d.ts +47 -45
- package/lib/Utils/chat-utils.js +731 -723
- package/lib/Utils/decode-wa-message.d.ts +250 -34
- package/lib/Utils/generics.js +2 -2
- package/lib/Utils/history.d.ts +20 -10
- package/lib/Utils/history.js +88 -72
- package/lib/Utils/messages.js +1678 -1658
- package/lib/index.js +14 -54
- package/package.json +1 -1
package/lib/Socket/groups.d.ts
CHANGED
|
@@ -1,128 +1,122 @@
|
|
|
1
1
|
import { proto } from '../../WAProto'
|
|
2
|
-
import { GroupMetadata, ParticipantAction, SocketConfig, ContactAction } from '../Types'
|
|
2
|
+
import { GroupMetadata, ParticipantAction, SocketConfig, ContactAction, WAPrivacyValue, WAPrivacyOnlineValue, WAPrivacyCallValue, WAReadReceiptsValue, WAPrivacyGroupAddValue, WABusinessProfile, WAMessageStubType, MessageUpsertType, WAPresence, WAMediaUpload, USyncQuery, USyncQueryResult, USyncQueryResultList } from '../Types'
|
|
3
3
|
import { BinaryNode } from '../WABinary'
|
|
4
|
+
import { BaileysEventEmitter, AuthenticationCreds, SignalKeyStoreWithTransaction, SignalRepository, Contact, ChatModification, LabelActionBody } from '../Types'
|
|
5
|
+
|
|
4
6
|
export declare const makeGroupsSocket: (config: SocketConfig) => {
|
|
5
|
-
groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
6
|
-
groupMetadata: (jid: string) => Promise<GroupMetadata>
|
|
7
|
-
groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
|
|
8
|
-
groupLeave: (id: string) => Promise<void>
|
|
9
|
-
groupUpdateSubject: (jid: string, subject: string) => Promise<void>
|
|
10
|
-
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
11
|
-
[key: string]: string
|
|
12
|
-
}[]>
|
|
13
|
-
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
|
|
14
|
-
status: string
|
|
15
|
-
jid: string
|
|
16
|
-
}[]>
|
|
17
|
-
groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
|
|
18
|
-
status: string
|
|
19
|
-
jid: string
|
|
20
|
-
content: BinaryNode
|
|
21
|
-
}[]>
|
|
22
|
-
groupUpdateDescription: (jid: string, description?: string) => Promise<void>
|
|
23
|
-
groupInviteCode: (jid: string) => Promise<string | undefined>
|
|
24
|
-
groupRevokeInvite: (jid: string) => Promise<string | undefined>
|
|
25
|
-
groupAcceptInvite: (code: string) => Promise<string | undefined>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
sendNode: (frame: BinaryNode) => Promise<void>
|
|
119
|
-
logout: (msg?: string | undefined) => Promise<void>
|
|
120
|
-
end: (error: Error | undefined) => void
|
|
121
|
-
onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void
|
|
122
|
-
uploadPreKeys: (count?: number) => Promise<void>
|
|
123
|
-
uploadPreKeysToServerIfRequired: () => Promise<void>
|
|
124
|
-
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
125
|
-
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
|
|
126
|
-
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
|
|
7
|
+
groupQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
8
|
+
groupMetadata: (jid: string) => Promise<GroupMetadata>
|
|
9
|
+
groupCreate: (subject: string, participants: string[]) => Promise<GroupMetadata>
|
|
10
|
+
groupLeave: (id: string) => Promise<void>
|
|
11
|
+
groupUpdateSubject: (jid: string, subject: string) => Promise<void>
|
|
12
|
+
groupRequestParticipantsList: (jid: string) => Promise<{
|
|
13
|
+
[key: string]: string
|
|
14
|
+
}[]>
|
|
15
|
+
groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
|
|
16
|
+
status: string
|
|
17
|
+
jid: string
|
|
18
|
+
}[]>
|
|
19
|
+
groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise<{
|
|
20
|
+
status: string
|
|
21
|
+
jid: string
|
|
22
|
+
content: BinaryNode
|
|
23
|
+
}[]>
|
|
24
|
+
groupUpdateDescription: (jid: string, description?: string) => Promise<void>
|
|
25
|
+
groupInviteCode: (jid: string) => Promise<string | undefined>
|
|
26
|
+
groupRevokeInvite: (jid: string) => Promise<string | undefined>
|
|
27
|
+
groupAcceptInvite: (code: string) => Promise<string | undefined>
|
|
28
|
+
groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>
|
|
29
|
+
groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>
|
|
30
|
+
groupGetInviteInfo: (code: string) => Promise<GroupMetadata>
|
|
31
|
+
groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>
|
|
32
|
+
groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>
|
|
33
|
+
groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>
|
|
34
|
+
groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>
|
|
35
|
+
groupFetchAllParticipating: () => Promise<{
|
|
36
|
+
[_: string]: GroupMetadata
|
|
37
|
+
}>
|
|
38
|
+
processingMutex: {
|
|
39
|
+
mutex<T>(code: () => T | Promise<T>): Promise<T>
|
|
40
|
+
}
|
|
41
|
+
fetchPrivacySettings: (force?: boolean) => Promise<{
|
|
42
|
+
[_: string]: string
|
|
43
|
+
}>
|
|
44
|
+
upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>
|
|
45
|
+
appPatch: (patchCreate: WAPatchCreate) => Promise<void>
|
|
46
|
+
sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>
|
|
47
|
+
presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>
|
|
48
|
+
getLidUser: (jid: string) => Promise<{
|
|
49
|
+
lid: string
|
|
50
|
+
id: string
|
|
51
|
+
}[] | undefined>
|
|
52
|
+
onWhatsApp: (...jids: string[]) => Promise<{
|
|
53
|
+
jid: string
|
|
54
|
+
exists: boolean
|
|
55
|
+
}[] | undefined>
|
|
56
|
+
fetchBlocklist: () => Promise<string[]>
|
|
57
|
+
fetchStatus: (...jids: string[]) => Promise<USyncQueryResultList[] | undefined>
|
|
58
|
+
fetchDisappearingDuration: (...jids: string[]) => Promise<USyncQueryResultList[] | undefined>
|
|
59
|
+
updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>
|
|
60
|
+
removeProfilePicture: (jid: string) => Promise<void>
|
|
61
|
+
updateProfileStatus: (status: string) => Promise<void>
|
|
62
|
+
updateProfileName: (name: string) => Promise<void>
|
|
63
|
+
updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>
|
|
64
|
+
updateCallPrivacy: (value: WAPrivacyCallValue) => Promise<void>
|
|
65
|
+
updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>
|
|
66
|
+
updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>
|
|
67
|
+
updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>
|
|
68
|
+
updateStatusPrivacy: (value: WAPrivacyValue) => Promise<void>
|
|
69
|
+
updateReadReceiptsPrivacy: (value: WAReadReceiptsValue) => Promise<void>
|
|
70
|
+
updateGroupsAddPrivacy: (value: WAPrivacyGroupAddValue) => Promise<void>
|
|
71
|
+
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
72
|
+
getBusinessProfile: (jid: string) => Promise<void | WABusinessProfile>
|
|
73
|
+
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
74
|
+
chatModify: (mod: ChatModification, jid: string) => Promise<void>
|
|
75
|
+
cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number) => Promise<void>
|
|
76
|
+
addLabel: (jid: string, labels: LabelActionBody) => Promise<void>
|
|
77
|
+
addChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
78
|
+
removeChatLabel: (jid: string, labelId: string) => Promise<void>
|
|
79
|
+
addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
80
|
+
removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>
|
|
81
|
+
clearMessage: (jid: string, key: proto.IMessageKey, timeStamp: number | Long) => Promise<void>
|
|
82
|
+
star: (jid: string, messages: {
|
|
83
|
+
id: string
|
|
84
|
+
fromMe?: boolean
|
|
85
|
+
}[], star: boolean) => Promise<void>
|
|
86
|
+
addOrEditContact: (jid: string, contact: ContactAction) => Promise<void>
|
|
87
|
+
removeContact: (jid: string) => Promise<void>
|
|
88
|
+
executeUSyncQuery: (usyncQuery: USyncQuery) => Promise<USyncQueryResult | undefined>
|
|
89
|
+
|
|
90
|
+
// Socket properties
|
|
91
|
+
type: "md"
|
|
92
|
+
ws: any // WebSocketClient type would need to be imported/defined
|
|
93
|
+
ev: BaileysEventEmitter & {
|
|
94
|
+
process(handler: (events: Partial<BaileysEventMap>) => void | Promise<void>): () => void
|
|
95
|
+
buffer(): void
|
|
96
|
+
createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>
|
|
97
|
+
flush(force?: boolean): boolean
|
|
98
|
+
isBuffering(): boolean
|
|
99
|
+
}
|
|
100
|
+
authState: {
|
|
101
|
+
creds: AuthenticationCreds
|
|
102
|
+
keys: SignalKeyStoreWithTransaction
|
|
103
|
+
}
|
|
104
|
+
signalRepository: SignalRepository
|
|
105
|
+
user: Contact | undefined
|
|
106
|
+
generateMessageTag: () => string
|
|
107
|
+
query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>
|
|
108
|
+
waitForMessage: <T>(msgId: string, timeoutMs?: number) => Promise<T>
|
|
109
|
+
waitForSocketOpen: () => Promise<void>
|
|
110
|
+
sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>
|
|
111
|
+
sendNode: (frame: BinaryNode) => Promise<void>
|
|
112
|
+
logout: (msg?: string) => Promise<void>
|
|
113
|
+
end: (error: Error | undefined) => void
|
|
114
|
+
onUnexpectedError: (err: Error | Boom<any>, msg: string) => void
|
|
115
|
+
uploadPreKeys: (count?: number) => Promise<void>
|
|
116
|
+
uploadPreKeysToServerIfRequired: () => Promise<void>
|
|
117
|
+
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
118
|
+
waitForConnectionUpdate: (check: (u: Partial<ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>
|
|
119
|
+
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
|
|
127
120
|
}
|
|
121
|
+
|
|
128
122
|
export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata
|