File size: 2,716 Bytes
4c34106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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
/*
 * This file is part of WPPConnect.
 *
 * WPPConnect is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WPPConnect is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with WPPConnect.  If not, see <https://www.gnu.org/licenses/>.
 */

import { Wid } from './wid';

export interface GroupMetadata {
  /** unique identifier for the group */
  id: Wid;
  /** timestamp of when the group was created */
  creation: number;
  owner: Wid;
  /** title/name of the group */
  subject: string;
  subjectTime: number;
  /** description of the group */
  desc: string;
  descId: string;
  descTime: number;
  descOwner: Wid;
  restrict: boolean;
  /** whether it is an announcement channel of a community */
  announce: boolean;
  noFrequentlyForwarded: boolean;
  ephemeralDuration: number;
  membershipApprovalMode: boolean;
  memberAddMode: 'admin_add' | string; //TODO: complete the union type and then remove `strong`
  reportToAdminMode: boolean;
  /** current amount of members including admins */
  size: number;
  support: boolean;
  suspended: boolean;
  terminated: boolean;
  uniqueShortNameMap: Object; //TODO: type is too generic
  isLidAddressingMode: boolean;
  isParentGroup: boolean;
  isParentGroupClosed: boolean;
  /** serialized chat ID of the parent group (community) */
  parentGroup: string | undefined;
  defaultSubgroup: boolean;
  generalSubgroup: boolean;
  generalChatAutoAddDisabled: boolean;
  allowNonAdminSubGroupCreation: boolean;
  lastActivityTimestamp: number;
  lastSeenActivityTimestamp: number;
  incognito: boolean;
  hasCapi: boolean;
  displayCadminPromotion: boolean;
  /** Current members of the group. See `pastParticipants` for former members. */
  participants: {
    id: Wid;
    isAdmin: boolean;
    isSuperAdmin: boolean;
  }[];
  /** members who applied for membership but still need admin approval */
  pendingParticipants: any[];
  /** former members who left the group or were kicked out */
  pastParticipants: {
    id: Wid;
    /** UNIX timestamp in seconds of when the leaving occurred */
    leaveTs: number;
    /** was leaving volumtary (`"Left"`) or forceful (`"Removed"`) */
    leaveReason: 'Left' | 'Removed';
  }[];
  membershipApprovalRequests: any[];
  subgroupSuggestions: any[];
}