@open-wa/wa-automate-types-only 4.43.2 → 4.43.5
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/dist/api/Client.d.ts +44 -38
- package/package.json +1 -1
package/dist/api/Client.d.ts
CHANGED
@@ -39,6 +39,7 @@ export declare class Client {
|
|
39
39
|
private _page;
|
40
40
|
private _currentlyBeingKilled;
|
41
41
|
private _refreshing;
|
42
|
+
private _loaded;
|
42
43
|
private _prio;
|
43
44
|
private _pageListeners;
|
44
45
|
private _registeredPageListeners;
|
@@ -244,19 +245,19 @@ export declare class Client {
|
|
244
245
|
*/
|
245
246
|
onLabel(fn: (label: Label) => void): Promise<Listener | boolean>;
|
246
247
|
/**
|
247
|
-
*
|
248
|
+
*{@license:insiders@}
|
248
249
|
*
|
249
250
|
* Listens to new orders. Only works on business accounts
|
250
251
|
*/
|
251
252
|
onOrder(fn: (order: Order) => void): Promise<Listener | boolean>;
|
252
253
|
/**
|
253
|
-
*
|
254
|
+
*{@license:insiders@}
|
254
255
|
*
|
255
256
|
* Listens to new orders. Only works on business accounts
|
256
257
|
*/
|
257
258
|
onNewProduct(fn: (product: Product) => void): Promise<Listener | boolean>;
|
258
259
|
/**
|
259
|
-
*
|
260
|
+
* {@license:insiders@}
|
260
261
|
*
|
261
262
|
* Listens to reaction add and change events
|
262
263
|
*
|
@@ -266,7 +267,7 @@ export declare class Client {
|
|
266
267
|
*/
|
267
268
|
onReaction(fn: (reactionEvent: ReactionEvent) => void): Promise<Listener | boolean>;
|
268
269
|
/**
|
269
|
-
*
|
270
|
+
* {@license:insiders@}
|
270
271
|
*
|
271
272
|
* Listens to chat state, including when a specific user is recording and typing within a group chat.
|
272
273
|
*
|
@@ -309,7 +310,7 @@ export declare class Client {
|
|
309
310
|
*/
|
310
311
|
onAddedToGroup(fn: (chat: Chat) => any): Promise<Listener | boolean>;
|
311
312
|
/**
|
312
|
-
*
|
313
|
+
* {@license:insiders@}
|
313
314
|
*
|
314
315
|
* Fires callback with Chat object every time the host phone is removed to a group.
|
315
316
|
*
|
@@ -319,7 +320,7 @@ export declare class Client {
|
|
319
320
|
*/
|
320
321
|
onRemovedFromGroup(fn: (chat: Chat) => any): Promise<Listener | boolean>;
|
321
322
|
/**
|
322
|
-
*
|
323
|
+
* {@license:insiders@}
|
323
324
|
*
|
324
325
|
* Fires callback with the relevant chat id every time the user clicks on a chat. This will only work in headful mode.
|
325
326
|
*
|
@@ -329,7 +330,7 @@ export declare class Client {
|
|
329
330
|
*/
|
330
331
|
onChatOpened(fn: (chat: Chat) => any): Promise<Listener | boolean>;
|
331
332
|
/**
|
332
|
-
*
|
333
|
+
* {@license:insiders@}
|
333
334
|
*
|
334
335
|
* Fires callback with contact id when a new contact is added on the host phone.
|
335
336
|
*
|
@@ -373,7 +374,7 @@ export declare class Client {
|
|
373
374
|
*/
|
374
375
|
setMyStatus(newStatus: string): Promise<boolean | void>;
|
375
376
|
/**
|
376
|
-
*
|
377
|
+
* {@license:insiders@}
|
377
378
|
*
|
378
379
|
* Adds label from chat, message or contact. Only for business accounts.
|
379
380
|
* @param label: The desired text of the new label. id will be something simple like anhy nnumber from 1-10, name is the label of the label if that makes sense.
|
@@ -486,8 +487,13 @@ export declare class Client {
|
|
486
487
|
testButtons(chatId: ChatId): Promise<any>;
|
487
488
|
private link;
|
488
489
|
/**
|
490
|
+
*
|
491
|
+
* {@license:restricted@}
|
492
|
+
*
|
489
493
|
* Sends a text message to given chat
|
490
|
-
*
|
494
|
+
*
|
495
|
+
* A license is **NOT** required to send messages with existing chats/contacts. A license is only required for starting conversations with new numbers.
|
496
|
+
*
|
491
497
|
* @param to chat id: `xxxxx@c.us`
|
492
498
|
* @param content text message
|
493
499
|
*/
|
@@ -515,6 +521,8 @@ export declare class Client {
|
|
515
521
|
*/
|
516
522
|
sendPaymentRequest(to: ChatId, amount: number, currency: string, message?: string): Promise<boolean | MessageId>;
|
517
523
|
/**
|
524
|
+
* {@license:insiders@}
|
525
|
+
*
|
518
526
|
* Send generic quick reply buttons. This is an insiders feature for MD accounts.
|
519
527
|
*
|
520
528
|
* @param {ChatId} to chat id
|
@@ -551,8 +559,6 @@ export declare class Client {
|
|
551
559
|
/**
|
552
560
|
* {@license:insiders@}
|
553
561
|
*
|
554
|
-
* [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
|
555
|
-
*
|
556
562
|
* Send a list message. This will not work when being sent from business accounts!
|
557
563
|
*
|
558
564
|
* @param {ChatId} to
|
@@ -575,7 +581,7 @@ export declare class Client {
|
|
575
581
|
*/
|
576
582
|
sendReplyWithMentions(to: ChatId, content: Content, replyMessageId: MessageId, hideTags?: boolean, mentions?: ContactId[]): Promise<boolean | MessageId>;
|
577
583
|
/**
|
578
|
-
*
|
584
|
+
* {@license:insiders@}
|
579
585
|
*
|
580
586
|
* Tags everyone in the group with a message
|
581
587
|
*
|
@@ -660,7 +666,7 @@ export declare class Client {
|
|
660
666
|
*/
|
661
667
|
reply(to: ChatId, content: Content, quotedMsgId: MessageId, sendSeen?: boolean): Promise<boolean | MessageId>;
|
662
668
|
/**
|
663
|
-
*
|
669
|
+
* {@license:insiders@}
|
664
670
|
*
|
665
671
|
* Check if a recipient has read receipts on.
|
666
672
|
*
|
@@ -692,7 +698,7 @@ export declare class Client {
|
|
692
698
|
*/
|
693
699
|
sendFile(to: ChatId, file: DataURL | FilePath, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
|
694
700
|
/**
|
695
|
-
*
|
701
|
+
* {@license:insiders@}
|
696
702
|
*
|
697
703
|
* Checks whether or not the group id provided is known to be unsafe by the contributors of the library.
|
698
704
|
* @param groupChatId The group chat you want to deteremine is unsafe
|
@@ -812,7 +818,7 @@ export declare class Client {
|
|
812
818
|
sendContact(to: ChatId, contactId: ContactId | ContactId[]): Promise<MessageId | boolean>;
|
813
819
|
/**
|
814
820
|
*
|
815
|
-
*
|
821
|
+
* {@license:insiders@}
|
816
822
|
*
|
817
823
|
* Sends multiple contacts as a single message
|
818
824
|
*
|
@@ -848,7 +854,7 @@ export declare class Client {
|
|
848
854
|
pinChat(id: ChatId, pin: boolean): Promise<boolean>;
|
849
855
|
/**
|
850
856
|
*
|
851
|
-
*
|
857
|
+
* {@license:insiders@}
|
852
858
|
*
|
853
859
|
* Mutes a conversation for a given duration. If already muted, this will update the muted duration. Mute durations are relative from when the method is called.
|
854
860
|
* @param chatId The id of the conversation you want to mute
|
@@ -864,7 +870,7 @@ export declare class Client {
|
|
864
870
|
isChatMuted(chatId: ChatId): Promise<boolean>;
|
865
871
|
/**
|
866
872
|
*
|
867
|
-
*
|
873
|
+
* {@license:insiders@}
|
868
874
|
*
|
869
875
|
* Unmutes a conversation.
|
870
876
|
* @param id The id of the conversation you want to mute
|
@@ -1000,9 +1006,9 @@ export declare class Client {
|
|
1000
1006
|
*/
|
1001
1007
|
contactBlock(id: ContactId): Promise<boolean>;
|
1002
1008
|
/**
|
1003
|
-
*
|
1009
|
+
* {@license:restricted@}
|
1004
1010
|
*
|
1005
|
-
*
|
1011
|
+
* Report a contact for spam, block them and attempt to clear chat.
|
1006
1012
|
*
|
1007
1013
|
* @param {string} id '000000000000@c.us'
|
1008
1014
|
*/
|
@@ -1058,14 +1064,14 @@ export declare class Client {
|
|
1058
1064
|
*/
|
1059
1065
|
getMessageById(messageId: MessageId): Promise<Message>;
|
1060
1066
|
/**
|
1061
|
-
*
|
1067
|
+
* {@license:insiders@}
|
1062
1068
|
*
|
1063
1069
|
* Get the detailed message info for a group message sent out by the host account.
|
1064
1070
|
* @param messageId The message Id
|
1065
1071
|
*/
|
1066
1072
|
getMessageInfo(messageId: MessageId): Promise<MessageInfo>;
|
1067
1073
|
/**
|
1068
|
-
*
|
1074
|
+
* {@license:insiders@}
|
1069
1075
|
*
|
1070
1076
|
* Retrieves an order object
|
1071
1077
|
* @param messageId or OrderId
|
@@ -1073,7 +1079,7 @@ export declare class Client {
|
|
1073
1079
|
*/
|
1074
1080
|
getOrder(id: MessageId | string): Promise<Order>;
|
1075
1081
|
/**
|
1076
|
-
*
|
1082
|
+
* {@license:insiders@}
|
1077
1083
|
*
|
1078
1084
|
* Add a product to your catalog
|
1079
1085
|
*
|
@@ -1089,7 +1095,7 @@ export declare class Client {
|
|
1089
1095
|
*/
|
1090
1096
|
createNewProduct(name: string, price: number, currency: string, images: string[], description: string, url?: string, internalId?: string, isHidden?: boolean): Promise<Product>;
|
1091
1097
|
/**
|
1092
|
-
*
|
1098
|
+
* {@license:insiders@}
|
1093
1099
|
*
|
1094
1100
|
* Edit a product in your catalog
|
1095
1101
|
*
|
@@ -1106,7 +1112,7 @@ export declare class Client {
|
|
1106
1112
|
*/
|
1107
1113
|
editProduct(productId: string, name?: string, price?: number, currency?: string, images?: DataURL[], description?: string, url?: string, internalId?: string, isHidden?: boolean): Promise<Product>;
|
1108
1114
|
/**
|
1109
|
-
*
|
1115
|
+
* {@license:insiders@}
|
1110
1116
|
*
|
1111
1117
|
* Send a product to a chat
|
1112
1118
|
*
|
@@ -1126,9 +1132,9 @@ export declare class Client {
|
|
1126
1132
|
/**
|
1127
1133
|
* Retrieves the last message sent by the host account in any given chat or globally.
|
1128
1134
|
* @param chatId This is optional. If no chat Id is set then the last message sent by the host account will be returned.
|
1129
|
-
* @returns message object
|
1135
|
+
* @returns message object or `undefined` if the host account's last message could not be found.
|
1130
1136
|
*/
|
1131
|
-
getMyLastMessage(chatId?: ChatId): Promise<Message>;
|
1137
|
+
getMyLastMessage(chatId?: ChatId): Promise<Message | undefined>;
|
1132
1138
|
/**
|
1133
1139
|
* Retrieves the starred messages in a given chat
|
1134
1140
|
* @param chatId Chat ID to filter starred messages by
|
@@ -1167,7 +1173,7 @@ export declare class Client {
|
|
1167
1173
|
getStickerDecryptable(messageId: MessageId): Promise<Message | false>;
|
1168
1174
|
/**
|
1169
1175
|
*
|
1170
|
-
*
|
1176
|
+
* {@license:insiders@}
|
1171
1177
|
*
|
1172
1178
|
* If a file is old enough, it will 404 if you try to decrypt it. This will allow you to force the host account to re upload the file and return a decryptable message.
|
1173
1179
|
*
|
@@ -1184,7 +1190,7 @@ export declare class Client {
|
|
1184
1190
|
*/
|
1185
1191
|
getChat(contactId: ContactId): Promise<Chat>;
|
1186
1192
|
/**
|
1187
|
-
*
|
1193
|
+
* {@license:insiders@}
|
1188
1194
|
*
|
1189
1195
|
* Retrieves the groups that you have in common with a contact
|
1190
1196
|
* @param contactId
|
@@ -1252,9 +1258,9 @@ export declare class Client {
|
|
1252
1258
|
}>;
|
1253
1259
|
/**
|
1254
1260
|
*
|
1255
|
-
*
|
1261
|
+
* {@license:insiders@}
|
1256
1262
|
*
|
1257
|
-
* Use a
|
1263
|
+
* Use a raw payload within your open-wa session
|
1258
1264
|
*
|
1259
1265
|
* @param chatId
|
1260
1266
|
* @param payload {any}
|
@@ -1481,7 +1487,7 @@ export declare class Client {
|
|
1481
1487
|
*/
|
1482
1488
|
setGroupDescription(groupId: GroupChatId, description: string): Promise<boolean>;
|
1483
1489
|
/**
|
1484
|
-
*
|
1490
|
+
* {@license:insiders@}
|
1485
1491
|
*
|
1486
1492
|
* Change the group chat title
|
1487
1493
|
* @param groupId '0000000000-00000000@g.us' the group id.
|
@@ -1495,7 +1501,7 @@ export declare class Client {
|
|
1495
1501
|
*/
|
1496
1502
|
getGroupAdmins(groupId: GroupChatId): Promise<ContactId[]>;
|
1497
1503
|
/**
|
1498
|
-
*
|
1504
|
+
* {@license:insiders@}
|
1499
1505
|
*
|
1500
1506
|
* Set the wallpaper background colour
|
1501
1507
|
* @param {string} hex '#FFF123'
|
@@ -1532,7 +1538,7 @@ export declare class Client {
|
|
1532
1538
|
*/
|
1533
1539
|
sendStickerfromUrl(to: ChatId, url: string, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<string | MessageId | boolean>;
|
1534
1540
|
/**
|
1535
|
-
*
|
1541
|
+
* {@license:insiders@}
|
1536
1542
|
*
|
1537
1543
|
* Sends a sticker from a given URL
|
1538
1544
|
* @param to The recipient id.
|
@@ -1544,7 +1550,7 @@ export declare class Client {
|
|
1544
1550
|
*/
|
1545
1551
|
sendStickerfromUrlAsReply(to: ChatId, url: string, messageId: MessageId, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<MessageId | boolean>;
|
1546
1552
|
/**
|
1547
|
-
*
|
1553
|
+
* {@license:insiders@}
|
1548
1554
|
*
|
1549
1555
|
* This function takes an image and sends it as a sticker to the recipient as a reply to another message.
|
1550
1556
|
*
|
@@ -1583,7 +1589,7 @@ export declare class Client {
|
|
1583
1589
|
*
|
1584
1590
|
* @param to ChatId The chat id you want to send the webp sticker to
|
1585
1591
|
* @param file [[DataURL]], [[Base64]], URL (string GET), Relative filepath (string), or Buffer of the mp4 file
|
1586
|
-
* @param messageId message id of the message you want this sticker to reply to.
|
1592
|
+
* @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
|
1587
1593
|
*/
|
1588
1594
|
sendMp4AsSticker(to: ChatId, file: DataURL | Buffer | Base64 | string, processOptions?: Mp4StickerConversionProcessOptions, stickerMetadata?: StickerMetadata, messageId?: MessageId): Promise<MessageId | string | boolean>;
|
1589
1595
|
/**
|
@@ -1591,7 +1597,7 @@ export declare class Client {
|
|
1591
1597
|
*
|
1592
1598
|
* @param to ChatId The chat id you want to send the webp sticker to
|
1593
1599
|
* @param emojiId The discord emoji id without indentifying chars. In discord you would write `:who:`, here use `who`
|
1594
|
-
* @param messageId message id of the message you want this sticker to reply to.
|
1600
|
+
* @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
|
1595
1601
|
*/
|
1596
1602
|
sendEmoji(to: ChatId, emojiId: string, messageId?: MessageId): Promise<MessageId | boolean | string>;
|
1597
1603
|
/**
|
@@ -1602,7 +1608,7 @@ export declare class Client {
|
|
1602
1608
|
*/
|
1603
1609
|
sendRawWebpAsSticker(to: ChatId, webpBase64: Base64, animated?: boolean): Promise<MessageId | string | boolean>;
|
1604
1610
|
/**
|
1605
|
-
*
|
1611
|
+
* {@license:insiders@}
|
1606
1612
|
*
|
1607
1613
|
* You can use this to send a raw webp file.
|
1608
1614
|
* @param to ChatId The chat id you want to send the webp sticker to
|
@@ -1612,7 +1618,7 @@ export declare class Client {
|
|
1612
1618
|
*/
|
1613
1619
|
sendRawWebpAsStickerAsReply(to: ChatId, messageId: MessageId, webpBase64: Base64, animated?: boolean): Promise<MessageId | string | boolean>;
|
1614
1620
|
/**
|
1615
|
-
*
|
1621
|
+
* {@license:insiders@}
|
1616
1622
|
*
|
1617
1623
|
* Turn the ephemeral setting in a chat to on or off
|
1618
1624
|
* @param chatId The ID of the chat
|