sanka-baileyss 2.1.6 → 2.1.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.
@@ -1,24 +1,35 @@
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
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContactAction = exports.Contact = void 0;
4
+
5
+ const Contact = {
6
+ /** ID either in lid or jid format */
7
+ id: '',
8
+ /** ID in Lid (anonymous) format (@lid) */
9
+ lid: undefined,
10
+ /** ID in Phone Number format (@s.whatsapp.net) */
11
+ jid: undefined,
12
+ /** name of the contact, you have saved on your WA */
13
+ name: undefined,
14
+ /** name of the contact, the contact has set on their own on WA */
15
+ notify: undefined,
16
+ /** I have no idea */
17
+ verifiedName: undefined,
18
+ /**
19
+ * Url of the profile picture of the contact
20
+ *
21
+ * 'changed' => if the profile picture has changed
22
+ * null => if the profile picture has not been set (default profile picture)
23
+ * any other string => url of the profile picture
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,59 +1,81 @@
1
1
  import { Contact } from './Contact'
2
- export type GroupParticipant = (Contact & {
3
- isAdmin?: boolean
4
- isSuperAdmin?: boolean
5
- admin?: 'admin' | 'superadmin' | 'member'
6
- })
2
+
3
+ export type GroupParticipant = Contact & {
4
+ isAdmin?: boolean
5
+ isSuperAdmin?: boolean
6
+ admin?: 'admin' | 'superadmin' | 'member' | null
7
+ lid?: string // Added for lid support
8
+ }
9
+
7
10
  export type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote' | 'modify'
11
+
8
12
  export type RequestJoinAction = 'created' | 'revoked' | 'rejected'
13
+
9
14
  export type RequestJoinMethod = 'invite_link' | 'linked_group_join' | 'non_admin_add' | undefined
15
+
10
16
  export interface GroupMetadata {
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
17
+ id: string
18
+ /** group uses 'lid' or 'pn' to send messages */
19
+ addressingMode: 'pn' | 'lid'
20
+ owner: string | undefined
21
+ ownerJid?: string | undefined
22
+ subject: string
23
+ /** group subject owner */
24
+ subjectOwner?: string
25
+ subjectOwnerJid?: string
26
+ /** group subject modification date */
27
+ subjectTime?: number
28
+ creation?: number
29
+ desc?: string
30
+ descOwner?: string
31
+ descOwnerJid?: string
32
+ descId?: string
33
+ descTime?: number
34
+ /** if this group is part of a community, it returns the jid of the community to which it belongs */
35
+ linkedParent?: string
36
+ /** is set when the group only allows admins to change group settings */
37
+ restrict?: boolean
38
+ /** is set when the group only allows admins to write messages */
39
+ announce?: boolean
40
+ /** is set when the group also allows members to add participants */
41
+ memberAddMode?: boolean
42
+ /** Request approval to join the group */
43
+ joinApprovalMode?: boolean
44
+ /** is this a community */
45
+ isCommunity?: boolean
46
+ /** is this the announce of a community */
47
+ isCommunityAnnounce?: boolean
48
+ /** number of group participants */
49
+ size?: number
50
+ // Baileys modified array
51
+ participants: GroupParticipant[]
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
46
59
  }
60
+
47
61
  export interface WAGroupCreateResponse {
48
- status: number
49
- gid?: string
50
- participants?: [{
51
- [key: string]: {}
52
- }]
62
+ status: number
63
+ gid?: string
64
+ participants?: [{ [key: string]: {} }]
53
65
  }
66
+
54
67
  export interface GroupModificationResponse {
55
- status: number
56
- participants?: {
57
- [key: string]: {}
68
+ status: number
69
+ participants?: { [key: string]: {} }
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 })[]
58
77
  }
78
+
79
+ export interface GroupMetadataPn extends GroupMetadata {
80
+ addressingMode: 'pn'
59
81
  }