@open-wa/wa-automate-types-only 4.58.0 → 4.59.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/api/Client.d.ts
CHANGED
@@ -328,6 +328,14 @@ export declare class Client {
|
|
328
328
|
* @returns `true` if the callback was registered
|
329
329
|
*/
|
330
330
|
onGlobalParticipantsChanged(fn: (participantChangedEvent: ParticipantChangedEventModel) => void): Promise<Listener | boolean>;
|
331
|
+
/**
|
332
|
+
* Listents to group approval requests. Emits a message object. Use it with `message.isGroupApprovalRequest()` to check if it is a group approval request.
|
333
|
+
*
|
334
|
+
* @event
|
335
|
+
* @param fn callback function that handles a [[Message]] as the first and only parameter.
|
336
|
+
* @returns `true` if the callback was registered
|
337
|
+
*/
|
338
|
+
onGroupApprovalRequest(fn: (groupApprovalRequestMessage: Message) => void): Promise<Listener | boolean>;
|
331
339
|
/**
|
332
340
|
* Listens to all group (gp2) events. This can be useful if you want to catch when a group title, subject or picture is changed.
|
333
341
|
*
|
@@ -1443,6 +1451,26 @@ export declare class Client {
|
|
1443
1451
|
* @returns `Promise<boolean>`
|
1444
1452
|
*/
|
1445
1453
|
revokeGroupInviteLink(chatId: ChatId): Promise<boolean | string>;
|
1454
|
+
/**
|
1455
|
+
* Gets the contact IDs of members requesting approval to join the group
|
1456
|
+
* @param groupChatId
|
1457
|
+
* @returns `Promise<ContactId[]>`
|
1458
|
+
*/
|
1459
|
+
getGroupApprovalRequests(groupChatId: GroupChatId): Promise<ContactId[]>;
|
1460
|
+
/**
|
1461
|
+
* Approves a group join request
|
1462
|
+
* @param groupChatId The group chat id
|
1463
|
+
* @param contactId The contact id of the person who is requesting to join the group
|
1464
|
+
* @returns `Promise<boolean>`
|
1465
|
+
*/
|
1466
|
+
approveGroupJoinRequest(groupChatId: GroupChatId, contactId: ContactId): Promise<boolean | string>;
|
1467
|
+
/**
|
1468
|
+
* Rejects a group join request
|
1469
|
+
* @param groupChatId The group chat id
|
1470
|
+
* @param contactId The contact id of the person who is requesting to join the group
|
1471
|
+
* @returns `Promise<boolean>`
|
1472
|
+
*/
|
1473
|
+
rejectGroupJoinRequest(groupChatId: GroupChatId, contactId: ContactId): Promise<boolean | string>;
|
1446
1474
|
/**
|
1447
1475
|
* Deletes message of given message id
|
1448
1476
|
* @param chatId The chat id from which to delete the message.
|
@@ -1622,6 +1650,14 @@ export declare class Client {
|
|
1622
1650
|
* @returns boolean true if action completed successfully.
|
1623
1651
|
*/
|
1624
1652
|
setGroupEditToAdminsOnly(groupId: GroupChatId, onlyAdmins: boolean): Promise<boolean>;
|
1653
|
+
/**
|
1654
|
+
*
|
1655
|
+
* Turn on or off the approval requirement for new members to join a group
|
1656
|
+
* @param groupId '0000000000-00000000@g.us' the group id.
|
1657
|
+
* @param requireApproval set to true to turn on the approval requirement, false to turn off
|
1658
|
+
* @returns boolean true if action completed successfully.
|
1659
|
+
*/
|
1660
|
+
setGroupApprovalMode(groupId: GroupChatId, requireApproval: boolean): Promise<boolean>;
|
1625
1661
|
/**
|
1626
1662
|
* Change the group chant description
|
1627
1663
|
* @param groupId '0000000000-00000000@g.us' the group id.
|
package/dist/api/model/chat.d.ts
CHANGED
@@ -84,6 +84,10 @@ export interface BaseChat {
|
|
84
84
|
* @deprecated This is unreliable. Use the method [`getLastSeen`](https://open-wa.github.io/wa-automate-nodejs/classes/client.html#getlastseen) instead.
|
85
85
|
*/
|
86
86
|
lastSeen?: any;
|
87
|
+
/**
|
88
|
+
* URL of the chat picture if available
|
89
|
+
*/
|
90
|
+
pic?: string;
|
87
91
|
}
|
88
92
|
export interface SingleChat extends BaseChat {
|
89
93
|
/**
|
@@ -46,6 +46,10 @@ export declare enum SimpleListener {
|
|
46
46
|
* Represents [[onGlobalParticipantsChanged]]
|
47
47
|
*/
|
48
48
|
GlobalParticipantsChanged = "onGlobalParticipantsChanged",
|
49
|
+
/**
|
50
|
+
* Represents [[onGroupApprovalRequest]]
|
51
|
+
*/
|
52
|
+
GroupApprovalRequest = "onGroupApprovalRequest",
|
49
53
|
/**
|
50
54
|
* Represents [[onChatState]]
|
51
55
|
*/
|
package/dist/utils/tools.d.ts
CHANGED
@@ -142,3 +142,11 @@ export declare const pathExists: (_path: string, failSilent?: boolean) => Promis
|
|
142
142
|
* @returns string
|
143
143
|
*/
|
144
144
|
export declare const fixPath: (_path: string) => string;
|
145
|
+
/**
|
146
|
+
*
|
147
|
+
* Accented filenames break file sending in docker containers. This is used to replace accented chars in strings to prevent file sending failures.
|
148
|
+
*
|
149
|
+
* @param input The raw string
|
150
|
+
* @returns A sanitized string with all accented chars removed
|
151
|
+
*/
|
152
|
+
export declare const sanitizeAccentedChars: (input: string) => string;
|