sanka-baileyss 2.0.8 → 2.1.0
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 +123 -117
- package/lib/Socket/groups.js +305 -355
- package/lib/Types/Contact.d.ts +24 -35
- package/lib/Types/GroupMetadata.d.ts +48 -70
- package/lib/Types/Message.d.ts +259 -348
- package/lib/Utils/chat-utils.d.ts +45 -47
- package/lib/Utils/chat-utils.js +723 -731
- package/lib/Utils/decode-wa-message.d.ts +34 -250
- package/lib/Utils/generics.js +2 -2
- package/lib/Utils/history.d.ts +10 -20
- package/lib/Utils/history.js +72 -88
- package/lib/Utils/messages.js +74 -54
- package/lib/index.js +54 -14
- package/package.json +1 -1
package/lib/Types/Contact.d.ts
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
imgUrl: undefined,
|
|
26
|
-
status: undefined
|
|
27
|
-
};
|
|
28
|
-
exports.Contact = Contact;
|
|
29
|
-
|
|
30
|
-
const ContactAction = {
|
|
31
|
-
firstName: '',
|
|
32
|
-
fullName: '',
|
|
33
|
-
saveOnPrimaryAddressbook: false
|
|
34
|
-
};
|
|
35
|
-
exports.ContactAction = ContactAction;
|
|
1
|
+
export interface Contact {
|
|
2
|
+
id: string
|
|
3
|
+
lid?: string
|
|
4
|
+
/** name of the contact, you have saved on your WA */
|
|
5
|
+
name?: string
|
|
6
|
+
/** name of the contact, the contact has set on their own on WA */
|
|
7
|
+
notify?: string
|
|
8
|
+
/** I have no idea */
|
|
9
|
+
verifiedName?: string
|
|
10
|
+
/**
|
|
11
|
+
* Url of the profile picture of the contact
|
|
12
|
+
*
|
|
13
|
+
* 'changed' => if the profile picture has changed
|
|
14
|
+
* null => if the profile picture has not been set (default profile picture)
|
|
15
|
+
* any other string => url of the profile picture
|
|
16
|
+
*/
|
|
17
|
+
imgUrl?: string | null
|
|
18
|
+
status?: string
|
|
19
|
+
}
|
|
20
|
+
export type ContactAction = {
|
|
21
|
+
firstName: string
|
|
22
|
+
fullName: string
|
|
23
|
+
saveOnPrimaryAddressbook: boolean
|
|
24
|
+
}
|
|
@@ -1,81 +1,59 @@
|
|
|
1
1
|
import { Contact } from './Contact'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
lid?: string // Added for lid support
|
|
8
|
-
}
|
|
9
|
-
|
|
2
|
+
export type GroupParticipant = (Contact & {
|
|
3
|
+
isAdmin?: boolean
|
|
4
|
+
isSuperAdmin?: boolean
|
|
5
|
+
admin?: 'admin' | 'superadmin' | 'member'
|
|
6
|
+
})
|
|
10
7
|
export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
|
|
11
|
-
|
|
12
8
|
export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
|
|
13
|
-
|
|
14
9
|
export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined
|
|
15
|
-
|
|
16
10
|
export interface GroupMetadata {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
ephemeralDuration?: number
|
|
53
|
-
inviteCode?: string
|
|
54
|
-
/** the person who added you to group or changed some setting in group */
|
|
55
|
-
author?: string
|
|
56
|
-
// New properties added for lid support
|
|
57
|
-
ownerCountry?: string
|
|
58
|
-
picture?: string
|
|
11
|
+
id: string
|
|
12
|
+
addressingMode: string
|
|
13
|
+
owner: string | undefined
|
|
14
|
+
ownerCountry: string,
|
|
15
|
+
subject: string
|
|
16
|
+
/** group subject owner */
|
|
17
|
+
subjectOwner?: string
|
|
18
|
+
/** group subject modification date */
|
|
19
|
+
subjectTime?: number
|
|
20
|
+
creation?: number
|
|
21
|
+
desc?: string
|
|
22
|
+
descOwner?: string
|
|
23
|
+
descId?: string
|
|
24
|
+
/** if this group is part of a community, it returns the jid of the community to which it belongs */
|
|
25
|
+
linkedParent?: string
|
|
26
|
+
/** is set when the group only allows admins to change group settings */
|
|
27
|
+
restrict?: boolean
|
|
28
|
+
/** is set when the group only allows admins to write messages */
|
|
29
|
+
announce?: boolean
|
|
30
|
+
/** is set when the group also allows members to add participants */
|
|
31
|
+
memberAddMode?: boolean
|
|
32
|
+
/** Request approval to join the group */
|
|
33
|
+
joinApprovalMode?: boolean
|
|
34
|
+
/** is this a community */
|
|
35
|
+
isCommunity?: boolean
|
|
36
|
+
/** is this the announce of a community */
|
|
37
|
+
isCommunityAnnounce?: boolean
|
|
38
|
+
/** number of group participants */
|
|
39
|
+
size?: number
|
|
40
|
+
participants: GroupParticipant[]
|
|
41
|
+
picture?: string
|
|
42
|
+
ephemeralDuration?: number
|
|
43
|
+
inviteCode?: string
|
|
44
|
+
/** the person who added you to group or changed some setting in group */
|
|
45
|
+
author?: string
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
export interface WAGroupCreateResponse {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
status: number
|
|
49
|
+
gid?: string
|
|
50
|
+
participants?: [{
|
|
51
|
+
[key: string]: {}
|
|
52
|
+
}]
|
|
65
53
|
}
|
|
66
|
-
|
|
67
54
|
export interface GroupModificationResponse {
|
|
68
|
-
|
|
69
|
-
|
|
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 })[]
|
|
55
|
+
status: number
|
|
56
|
+
participants?: {
|
|
57
|
+
[key: string]: {}
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
export interface GroupMetadataPn extends GroupMetadata {
|
|
80
|
-
addressingMode: 'pn'
|
|
81
59
|
}
|