diff --git a/src/api/layers/group.layer.ts b/src/api/layers/group.layer.ts index 9c8196667..f3526b84d 100644 --- a/src/api/layers/group.layer.ts +++ b/src/api/layers/group.layer.ts @@ -91,7 +91,7 @@ export class GroupLayer extends RetrieverLayer { } /** - * Revokes group-invite link and generate new one. + * Revokes group-invite link and generates a new one. * @category Group * @param chatId * @returns Invitation link @@ -107,10 +107,12 @@ export class GroupLayer extends RetrieverLayer { } /** - * Generates group-invite link + * Displays group info from an invitation link (or invitation ID) * @category Group * @param inviteCode - * @returns Invite code from group link. Example: CMJYfPFqRyE2GxrnkldYED + * @returns Invite code or group link. Example: CMJYfPFqRyE2GxrnkldYED + * @example getGroupInfoFromInviteLink('https://chat.whatsapp.com/invite/CMJYfPFqRyE2GxrnkldYED') + * @example getGroupInfoFromInviteLink('CMJYfPFqRyE2GxrnkldYED') */ public async getGroupInfoFromInviteLink(inviteCode: string) { inviteCode = inviteCode.replace('chat.whatsapp.com/', ''); @@ -232,9 +234,11 @@ export class GroupLayer extends RetrieverLayer { return participants.filter((p) => p.isAdmin).map((p) => p.id); } /** - * Join a group with invite code + * Join a group with an invite code or link * @category Group * @param inviteCode + * @example joinGroup('https://chat.whatsapp.com/invite/CMJYfPFqRyE2GxrnkldYED') + * @example joinGroup('CMJYfPFqRyE2GxrnkldYED') */ public async joinGroup(inviteCode: string) { inviteCode = inviteCode.replace('chat.whatsapp.com/', ''); diff --git a/src/api/layers/sender.layer.ts b/src/api/layers/sender.layer.ts index 74c9f2fa2..79c237fc4 100644 --- a/src/api/layers/sender.layer.ts +++ b/src/api/layers/sender.layer.ts @@ -235,7 +235,7 @@ export class SenderLayer extends ListenerLayer { * Sends image message * @category Chat * @param to ID of the chat to send the image to - * @param base64 File path, HTTP link, or a base64-encoded data URI (with mime type) + * @param base64 A base64-encoded data URI (with mime type) * @param filename * @param caption * @param quotedMessageId Quoted message id diff --git a/src/api/model/group-metadata.ts b/src/api/model/group-metadata.ts index 40f29484a..3f20da588 100644 --- a/src/api/model/group-metadata.ts +++ b/src/api/model/group-metadata.ts @@ -18,9 +18,15 @@ 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; @@ -29,13 +35,32 @@ export interface GroupMetadata { 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; defaultSubgroup: boolean; + generalSubgroup: boolean; + generalChatAutoAddDisabled: boolean; + allowNonAdminSubGroupCreation: boolean; + lastActivityTimestamp: number; + lastSeenActivityTimestamp: number; + incognito: boolean; + hasCapi: boolean; displayCadminPromotion: boolean; participants: any[]; + /** members who applied for membership but still need admin approval */ pendingParticipants: any[]; + /** former members who left the group or were kicked out */ + pastParticipants: any[]; + membershipApprovalRequests: any[]; + subgroupSuggestions: any[]; }