@wppconnect/wa-js 1.1.18 → 1.2.1
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/CHANGELOG.md +17 -0
- package/dist/chat/functions/canMute.d.ts +1 -1
- package/dist/chat/functions/getMessageById.d.ts +2 -2
- package/dist/chat/functions/getMessages.d.ts +3 -3
- package/dist/chat/functions/markIsComposing.d.ts +2 -2
- package/dist/chat/functions/markIsPaused.d.ts +1 -1
- package/dist/chat/functions/markIsRead.d.ts +1 -1
- package/dist/chat/functions/markIsRecording.d.ts +2 -2
- package/dist/chat/functions/markIsUnread.d.ts +1 -1
- package/dist/chat/functions/mute.d.ts +3 -3
- package/dist/chat/functions/openChatAt.d.ts +1 -1
- package/dist/chat/functions/openChatBottom.d.ts +1 -1
- package/dist/chat/functions/openChatFromUnread.d.ts +1 -1
- package/dist/chat/functions/prepareLinkPreview.d.ts +2 -2
- package/dist/chat/functions/sendFileMessage.d.ts +5 -5
- package/dist/chat/functions/sendListMessage.d.ts +1 -1
- package/dist/chat/functions/unmute.d.ts +1 -1
- package/dist/chat/types.d.ts +8 -8
- package/dist/{auth → conn}/eventEmitter.d.ts +37 -3
- package/dist/conn/events/index.d.ts +22 -0
- package/dist/{auth/events/registerChangeEvent.d.ts → conn/events/registerAuthCodeChangeEvent.d.ts} +0 -0
- package/dist/{auth/events/registerIdleEvent.d.ts → conn/events/registerAuthenticatedEvent.d.ts} +0 -0
- package/dist/{auth → conn}/events/registerLogoutEvent.d.ts +0 -0
- package/dist/{auth/functions/poke.d.ts → conn/events/registerMainLoadedEvent.d.ts} +1 -1
- package/dist/conn/events/registerMainReadyEvent.d.ts +16 -0
- package/dist/conn/events/registerQRCodeIdleEvent.d.ts +16 -0
- package/dist/conn/events/registerRequireAuthEvent.d.ts +16 -0
- package/dist/{auth → conn}/functions/getAuthCode.d.ts +0 -0
- package/dist/{auth → conn}/functions/index.d.ts +2 -1
- package/dist/{auth → conn}/functions/isAuthenticated.d.ts +0 -0
- package/dist/{auth → conn}/functions/isIdle.d.ts +0 -0
- package/dist/conn/functions/isMainLoaded.d.ts +24 -0
- package/dist/{auth → conn}/functions/isMultiDevice.d.ts +0 -0
- package/dist/{auth → conn}/functions/logout.d.ts +0 -0
- package/dist/conn/functions/refreshQR.d.ts +28 -0
- package/dist/{auth → conn}/functions/setMultiDevice.d.ts +1 -1
- package/dist/{auth → conn}/index.d.ts +0 -0
- package/dist/{auth → conn}/types.d.ts +0 -0
- package/dist/contact/functions/getStatus.d.ts +1 -1
- package/dist/contact/functions/queryExists.d.ts +1 -1
- package/dist/group/functions/getInviteCode.d.ts +1 -1
- package/dist/group/functions/getParticipants.d.ts +1 -1
- package/dist/group/functions/leave.d.ts +1 -1
- package/dist/group/functions/revokeInviteCode.d.ts +1 -1
- package/dist/group/functions/setDescription.d.ts +1 -1
- package/dist/group/functions/setProperty.d.ts +8 -8
- package/dist/group/functions/setSubject.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/labels/functions/addOrRemoveLabels.d.ts +1 -1
- package/dist/whatsapp/collections/BaseCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BlocklistCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BusinessCategoriesResultCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BusinessProfileCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ButtonCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CallCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CartCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CartItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CatalogCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ChatCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ChatstateCollection.d.ts +1 -1
- package/dist/whatsapp/collections/Collection.d.ts +2 -2
- package/dist/whatsapp/collections/ContactCollection.d.ts +1 -1
- package/dist/whatsapp/collections/EmojiVariantCollection.d.ts +1 -1
- package/dist/whatsapp/collections/GroupMetadataCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LabelCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LabelItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LiveLocationCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MsgCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MsgInfoCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MuteCollection.d.ts +1 -1
- package/dist/whatsapp/collections/OrderCollection.d.ts +1 -1
- package/dist/whatsapp/collections/OrderItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ParticipantCollection.d.ts +1 -1
- package/dist/whatsapp/collections/PresenceCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductCollCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductImageCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductMessageListCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProfilePicThumbCollection.d.ts +1 -1
- package/dist/whatsapp/collections/QuickReplyCollection.d.ts +1 -1
- package/dist/whatsapp/collections/RecentEmojiCollection.d.ts +1 -1
- package/dist/whatsapp/collections/RecentStickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StarredMsgCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StarredStickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StatusCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StatusV3Collection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerPackCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerSearchCollection.d.ts +1 -1
- package/dist/whatsapp/collections/TemplateButtonCollection.d.ts +1 -1
- package/dist/whatsapp/enums/ACK.d.ts +46 -0
- package/dist/whatsapp/enums/GROUP_SETTING_TYPE.d.ts +1 -1
- package/dist/whatsapp/enums/LogoutReason.d.ts +1 -1
- package/dist/whatsapp/enums/MSG_TYPE.d.ts +54 -0
- package/dist/whatsapp/enums/OUTWARD_TYPES.d.ts +1 -1
- package/dist/whatsapp/enums/SOCKET_STATE.d.ts +42 -0
- package/dist/whatsapp/enums/SendMsgResult.d.ts +1 -1
- package/dist/whatsapp/enums/index.d.ts +2 -0
- package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/blockContact.d.ts +2 -2
- package/dist/whatsapp/functions/createMsgProtobuf.d.ts +1 -1
- package/dist/whatsapp/functions/fetchLinkPreview.d.ts +1 -1
- package/dist/whatsapp/functions/findChat.d.ts +1 -1
- package/dist/whatsapp/functions/findFirstWebLink.d.ts +1 -1
- package/dist/whatsapp/functions/getOrGenerate.d.ts +1 -1
- package/dist/whatsapp/functions/groupParticipants.d.ts +4 -4
- package/dist/whatsapp/functions/handleAck.d.ts +3 -3
- package/dist/whatsapp/functions/isAuthenticated.d.ts +1 -1
- package/dist/whatsapp/functions/markSeen.d.ts +3 -3
- package/dist/whatsapp/functions/msgFindQuery.d.ts +1 -1
- package/dist/whatsapp/functions/products.d.ts +4 -4
- package/dist/whatsapp/functions/profilePic.d.ts +1 -1
- package/dist/whatsapp/functions/randomId.d.ts +1 -3
- package/dist/whatsapp/functions/sendCallSignalingMsg.d.ts +1 -1
- package/dist/whatsapp/functions/sendClear.d.ts +1 -1
- package/dist/whatsapp/functions/sendCreateGroup.d.ts +1 -1
- package/dist/whatsapp/functions/sendDelete.d.ts +1 -1
- package/dist/whatsapp/functions/sendExitGroup.d.ts +1 -1
- package/dist/whatsapp/functions/sendJoinGroupViaInvite.d.ts +1 -1
- package/dist/whatsapp/functions/sendQueryExists.d.ts +1 -1
- package/dist/whatsapp/functions/sendQueryGroupInvite.d.ts +1 -1
- package/dist/whatsapp/functions/sendRevokeGroupInviteCode.d.ts +1 -1
- package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/setGroup.d.ts +3 -3
- package/dist/whatsapp/functions/status.d.ts +2 -2
- package/dist/whatsapp/functions/uploadProductImage.d.ts +1 -1
- package/dist/whatsapp/misc/Base64.d.ts +1 -1
- package/dist/whatsapp/misc/Browser.d.ts +1 -1
- package/dist/whatsapp/misc/ChatPresence.d.ts +1 -1
- package/dist/whatsapp/misc/Clock.d.ts +2 -2
- package/dist/whatsapp/misc/Cmd.d.ts +2 -2
- package/dist/whatsapp/misc/Conn.d.ts +1 -1
- package/dist/whatsapp/misc/Constants.d.ts +28 -432
- package/dist/whatsapp/misc/EventEmitter.d.ts +1 -1
- package/dist/whatsapp/misc/Features.d.ts +1 -1
- package/dist/whatsapp/misc/ImageUtils.d.ts +1 -1
- package/dist/whatsapp/misc/Locale.d.ts +1 -1
- package/dist/whatsapp/misc/MediaBlobCache.d.ts +2 -2
- package/dist/whatsapp/misc/MediaObject.d.ts +1 -1
- package/dist/whatsapp/misc/MediaObjectUtil.d.ts +1 -1
- package/dist/whatsapp/misc/MediaPrep.d.ts +1 -1
- package/dist/whatsapp/misc/MediaUtils.d.ts +1 -1
- package/dist/whatsapp/misc/MsgKey.d.ts +5 -1
- package/dist/whatsapp/misc/MsgLoadState.d.ts +2 -2
- package/dist/whatsapp/misc/OpaqueData.d.ts +2 -2
- package/dist/whatsapp/misc/Socket.d.ts +18 -0
- package/dist/{auth/events/index.d.ts → whatsapp/misc/Stream.d.ts} +3 -3
- package/dist/whatsapp/misc/UserPrefs.d.ts +1 -1
- package/dist/whatsapp/misc/VCard.d.ts +1 -1
- package/dist/whatsapp/misc/Wap.d.ts +2 -2
- package/dist/whatsapp/misc/Wid.d.ts +1 -1
- package/dist/whatsapp/misc/WidFactory.d.ts +1 -1
- package/dist/whatsapp/misc/index.d.ts +2 -1
- package/dist/whatsapp/models/AttachMediaModel.d.ts +2 -2
- package/dist/whatsapp/models/BlocklistModel.d.ts +2 -2
- package/dist/whatsapp/models/BusinessCategoriesResultModel.d.ts +2 -2
- package/dist/whatsapp/models/BusinessProfileModel.d.ts +2 -2
- package/dist/whatsapp/models/CallModel.d.ts +2 -2
- package/dist/whatsapp/models/CallParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/CartItemModel.d.ts +2 -2
- package/dist/whatsapp/models/CartModel.d.ts +2 -2
- package/dist/whatsapp/models/CatalogModel.d.ts +2 -2
- package/dist/whatsapp/models/ChatModel.d.ts +2 -2
- package/dist/whatsapp/models/ChatPreferenceModel.d.ts +2 -2
- package/dist/whatsapp/models/ChatstateModel.d.ts +2 -2
- package/dist/whatsapp/models/ConnModel.d.ts +2 -2
- package/dist/whatsapp/models/ContactModel.d.ts +2 -2
- package/dist/whatsapp/models/ConversionTupleModel.d.ts +2 -2
- package/dist/whatsapp/models/EmojiVariantModel.d.ts +2 -2
- package/dist/whatsapp/models/GroupMetadataModel.d.ts +2 -2
- package/dist/whatsapp/models/LabelItemModel.d.ts +2 -2
- package/dist/whatsapp/models/LabelModel.d.ts +2 -2
- package/dist/whatsapp/models/LiveLocationModel.d.ts +2 -2
- package/dist/whatsapp/models/LiveLocationParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/MediaDataModel.d.ts +2 -2
- package/dist/whatsapp/models/Model.d.ts +3 -3
- package/dist/whatsapp/models/ModelChatBase.d.ts +1 -1
- package/dist/whatsapp/models/MsgButtonReplyMsgModel.d.ts +2 -2
- package/dist/whatsapp/models/MsgInfoModel.d.ts +2 -2
- package/dist/whatsapp/models/MsgModel.d.ts +2 -2
- package/dist/whatsapp/models/MuteModel.d.ts +2 -2
- package/dist/whatsapp/models/OrderItemModel.d.ts +2 -2
- package/dist/whatsapp/models/OrderModel.d.ts +2 -2
- package/dist/whatsapp/models/ParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductCollModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductImageModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductMessageListModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductModel.d.ts +2 -2
- package/dist/whatsapp/models/ProfilePicThumbModel.d.ts +2 -2
- package/dist/whatsapp/models/QuickReplyModel.d.ts +2 -2
- package/dist/whatsapp/models/RecentEmojiModel.d.ts +2 -2
- package/dist/whatsapp/models/RecentStickerModel.d.ts +2 -2
- package/dist/whatsapp/models/ReplyButtonModel.d.ts +2 -2
- package/dist/whatsapp/models/{StateModel.d.ts → SocketModel.d.ts} +5 -5
- package/dist/whatsapp/models/StatusModel.d.ts +2 -2
- package/dist/whatsapp/models/StatusV3Model.d.ts +2 -2
- package/dist/whatsapp/models/StickerModel.d.ts +2 -2
- package/dist/whatsapp/models/StickerPackModel.d.ts +2 -2
- package/dist/whatsapp/models/StreamModel.d.ts +61 -0
- package/dist/whatsapp/models/TemplateButtonModel.d.ts +2 -2
- package/dist/whatsapp/models/UnreadMentionModel.d.ts +2 -2
- package/dist/whatsapp/models/WebCallModel.d.ts +2 -2
- package/dist/whatsapp/models/index.d.ts +2 -1
- package/dist/whatsapp/multidevice/adv.d.ts +1 -1
- package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +1 -1
- package/dist/whatsapp/multidevice/waSignalStore.d.ts +1 -1
- package/dist/whatsapp/stores.d.ts +29 -29
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +18 -23
- package/tests/check-auth.ts +2 -2
- package/tests/prepare.ts +3 -3
- package/dist/internal.d.ts +0 -21
- package/dist/whatsapp/misc/State.d.ts +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 1.2.1 (2022-03-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Fixed compatibility with WhatsApp 2.2208.7 ([3bcac63](https://github.com/wppconnect-team/wa-js/commit/3bcac63b1b88fd36ae9c512cb1a944ee79292ffe))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# 1.2.0 (2022-03-03)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.1.19 (2022-02-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
1
18
|
## 1.1.18 (2022-02-17)
|
|
2
19
|
|
|
3
20
|
|
|
@@ -20,10 +20,10 @@ import { MsgKey, MsgModel } from '../../whatsapp';
|
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
22
|
* // Single message
|
|
23
|
-
* WPP.chat.getMessageById('true_
|
|
23
|
+
* WPP.chat.getMessageById('true_[number]@c.us_ABCDEF');
|
|
24
24
|
*
|
|
25
25
|
* // List of messages
|
|
26
|
-
* WPP.chat.getMessageById(['true_
|
|
26
|
+
* WPP.chat.getMessageById(['true_[number]@c.us_ABCDEF', 'false_[number]@c.us_789456']);
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
29
|
* @category Message
|
|
@@ -26,17 +26,17 @@ export interface GetMessagesOptions {
|
|
|
26
26
|
* @example
|
|
27
27
|
* ```javascript
|
|
28
28
|
* // Some messages
|
|
29
|
-
* WPP.chat.getMessages('
|
|
29
|
+
* WPP.chat.getMessages('[number]@c.us', {
|
|
30
30
|
* count: 20,
|
|
31
31
|
* });
|
|
32
32
|
*
|
|
33
33
|
* // All messages
|
|
34
|
-
* WPP.chat.getMessages('
|
|
34
|
+
* WPP.chat.getMessages('[number]@c.us', {
|
|
35
35
|
* count: -1,
|
|
36
36
|
* });
|
|
37
37
|
*
|
|
38
38
|
* // 20 messages before specific message
|
|
39
|
-
* WPP.chat.getMessages('
|
|
39
|
+
* WPP.chat.getMessages('[number]@c.us', {
|
|
40
40
|
* count: 20,
|
|
41
41
|
* direction: 'before',
|
|
42
42
|
* id: '<full message id>'
|
|
@@ -21,10 +21,10 @@ import { Wid } from '../../whatsapp';
|
|
|
21
21
|
* @example
|
|
22
22
|
* ```javascript
|
|
23
23
|
* // Mark is composing
|
|
24
|
-
* WPP.chat.markIsComposing('
|
|
24
|
+
* WPP.chat.markIsComposing('[number]@c.us');
|
|
25
25
|
*
|
|
26
26
|
* // Mark is composing for 5 seconds
|
|
27
|
-
* WPP.chat.markIsComposing('
|
|
27
|
+
* WPP.chat.markIsComposing('[number]@c.us', 5000);
|
|
28
28
|
* ```
|
|
29
29
|
* @category Chat
|
|
30
30
|
*/
|
|
@@ -21,10 +21,10 @@ import { Wid } from '../../whatsapp';
|
|
|
21
21
|
* @example
|
|
22
22
|
* ```javascript
|
|
23
23
|
* // Mark is recording
|
|
24
|
-
* WPP.chat.markIsRecording('
|
|
24
|
+
* WPP.chat.markIsRecording('[number]@c.us');
|
|
25
25
|
*
|
|
26
26
|
* // Mark is recording for 5 seconds
|
|
27
|
-
* WPP.chat.markIsRecording('
|
|
27
|
+
* WPP.chat.markIsRecording('[number]@c.us', 5000);
|
|
28
28
|
* ```
|
|
29
29
|
* @category Chat
|
|
30
30
|
*/
|
|
@@ -22,14 +22,14 @@ import { Wid } from '../../whatsapp';
|
|
|
22
22
|
* @example
|
|
23
23
|
* ```javascript
|
|
24
24
|
* // Mute for 60 seconds
|
|
25
|
-
* WPP.chat.mute('
|
|
25
|
+
* WPP.chat.mute('[number]@c.us', {duration: 60});
|
|
26
26
|
*
|
|
27
27
|
* // Mute util 2021-01-01
|
|
28
|
-
* WPP.chat.mute('
|
|
28
|
+
* WPP.chat.mute('[number]@c.us', {expiration: 1641006000});
|
|
29
29
|
*
|
|
30
30
|
* // or using date
|
|
31
31
|
* const expiration = new Date('2022-01-01 00:00:00');
|
|
32
|
-
* WPP.chat.mute('
|
|
32
|
+
* WPP.chat.mute('[number]@c.us', {expiration: expiration});
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* @category Chat
|
|
@@ -23,10 +23,10 @@ export interface LinkPreviewOptions {
|
|
|
23
23
|
* @example
|
|
24
24
|
* ```javascript
|
|
25
25
|
* // Automatic detection
|
|
26
|
-
* WPP.chat.sendTextMessage('
|
|
26
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8');
|
|
27
27
|
*
|
|
28
28
|
* // Overriding the title and description
|
|
29
|
-
* WPP.chat.sendTextMessage('
|
|
29
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8', {
|
|
30
30
|
* linkPreview: {
|
|
31
31
|
* title: 'Another text',
|
|
32
32
|
* description: 'Another description'
|
|
@@ -49,7 +49,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
49
49
|
* ```javascript
|
|
50
50
|
* // Single document
|
|
51
51
|
* WPP.chat.sendFileMessage(
|
|
52
|
-
* '
|
|
52
|
+
* '[number]@c.us',
|
|
53
53
|
* 'data:image/jpeg;base64,<a long base64 file...>',
|
|
54
54
|
* {
|
|
55
55
|
* type: 'document',
|
|
@@ -61,7 +61,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
61
61
|
*
|
|
62
62
|
* // Image with view once
|
|
63
63
|
* WPP.chat.sendFileMessage(
|
|
64
|
-
* '
|
|
64
|
+
* '[number]@c.us',
|
|
65
65
|
* 'data:image/jpeg;base64,<a long base64 file...>',
|
|
66
66
|
* {
|
|
67
67
|
* type: 'image',
|
|
@@ -72,7 +72,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
72
72
|
*
|
|
73
73
|
* // PTT audio
|
|
74
74
|
* WPP.chat.sendFileMessage(
|
|
75
|
-
* '
|
|
75
|
+
* '[number]@c.us',
|
|
76
76
|
* 'data:audio/mp3;base64,<a long base64 file...>',
|
|
77
77
|
* {
|
|
78
78
|
* type: 'audio',
|
|
@@ -82,7 +82,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
82
82
|
*
|
|
83
83
|
* // Image with view buttons
|
|
84
84
|
* WPP.chat.sendFileMessage(
|
|
85
|
-
* '
|
|
85
|
+
* '[number]@c.us',
|
|
86
86
|
* 'data:image/jpeg;base64,<a long base64 file...>',
|
|
87
87
|
* {
|
|
88
88
|
* type: 'image',
|
|
@@ -103,7 +103,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
103
103
|
*
|
|
104
104
|
* // Image as Sticker
|
|
105
105
|
* WPP.chat.sendFileMessage(
|
|
106
|
-
* '
|
|
106
|
+
* '[number]@c.us',
|
|
107
107
|
* 'data:image/png;base64,<a long base64 file...>',
|
|
108
108
|
* {
|
|
109
109
|
* type: 'sticker'
|
|
@@ -31,7 +31,7 @@ export interface ListMessageOptions extends SendMessageOptions {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```javascript
|
|
34
|
-
* WPP.chat.sendListMessage('
|
|
34
|
+
* WPP.chat.sendListMessage('[number]@c.us', {
|
|
35
35
|
* buttonText: 'Click Me!',
|
|
36
36
|
* description: "Hello it's list message",
|
|
37
37
|
* sections: [{
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -23,20 +23,20 @@ export interface SendMessageOptions {
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```javascript
|
|
26
|
-
* WPP.chat.sendTextMessage('
|
|
26
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello new contact', {
|
|
27
27
|
* createChat: true
|
|
28
28
|
* });
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
createChat?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Automatic detect and add the mentioned contacts with
|
|
33
|
+
* Automatic detect and add the mentioned contacts with @[number]
|
|
34
34
|
*
|
|
35
35
|
* @default true
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```javascript
|
|
39
|
-
* WPP.chat.sendTextMessage('
|
|
39
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello @123 and @456', {
|
|
40
40
|
* detectMentioned: true
|
|
41
41
|
* });
|
|
42
42
|
* ```
|
|
@@ -49,7 +49,7 @@ export interface SendMessageOptions {
|
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* ```javascript
|
|
52
|
-
* WPP.chat.sendTextMessage('
|
|
52
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Replying your message', {
|
|
53
53
|
* markIsRead: true
|
|
54
54
|
* });
|
|
55
55
|
* ```
|
|
@@ -65,7 +65,7 @@ export interface SendMessageOptions {
|
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```javascript
|
|
68
|
-
* WPP.chat.sendTextMessage('
|
|
68
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello @123 and @456', {
|
|
69
69
|
* mentionedList: ['123@c.us', '456@c.us']
|
|
70
70
|
* })
|
|
71
71
|
* ```
|
|
@@ -76,8 +76,8 @@ export interface SendMessageOptions {
|
|
|
76
76
|
*
|
|
77
77
|
* @example
|
|
78
78
|
* ```javascript
|
|
79
|
-
* WPP.chat.sendTextMessage('
|
|
80
|
-
* quotedMsg: 'true_
|
|
79
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'This is a reply', {
|
|
80
|
+
* quotedMsg: 'true_[number]@c.us_3EB0F435D95D32C4C638'
|
|
81
81
|
* })
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
@@ -89,7 +89,7 @@ export interface SendMessageOptions {
|
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* ```javascript
|
|
92
|
-
* WPP.chat.sendTextMessage('
|
|
92
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Wait for sent', {
|
|
93
93
|
* waitForAck: true
|
|
94
94
|
* })
|
|
95
95
|
* ```
|
|
@@ -17,11 +17,45 @@ import Emittery from 'emittery';
|
|
|
17
17
|
import { AuthCode } from '.';
|
|
18
18
|
export declare type UnsubscribeFn = () => void;
|
|
19
19
|
export interface EventTypes {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
auth_code_change: AuthCode | null;
|
|
21
|
+
/**
|
|
22
|
+
* Triggered afted a success QR code scan
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* WPP.conn.on('authenticated', () => {
|
|
27
|
+
* // Your code
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
authenticated: undefined;
|
|
22
32
|
logout: undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Triggered when the main interface is loaded, but is syncing
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```javascript
|
|
38
|
+
* WPP.conn.on('main_loaded', () => {
|
|
39
|
+
* // Your code
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
main_loaded: undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Triggered when the main interface is loaded, authenticated and ready to send message
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```javascript
|
|
49
|
+
* WPP.conn.on('main_ready', () => {
|
|
50
|
+
* // Your code
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
main_ready: undefined;
|
|
55
|
+
qrcode_idle: undefined;
|
|
56
|
+
require_auth: undefined;
|
|
23
57
|
}
|
|
24
|
-
export declare const eventEmitter: Emittery<EventTypes, EventTypes, "
|
|
58
|
+
export declare const eventEmitter: Emittery<EventTypes, EventTypes, "authenticated" | "logout" | "main_loaded" | "main_ready" | "qrcode_idle" | "require_auth">;
|
|
25
59
|
/**
|
|
26
60
|
* Subscribe to one event.
|
|
27
61
|
* @event
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import './registerAuthCodeChangeEvent';
|
|
17
|
+
import './registerAuthenticatedEvent';
|
|
18
|
+
import './registerLogoutEvent';
|
|
19
|
+
import './registerMainLoadedEvent';
|
|
20
|
+
import './registerMainReadyEvent';
|
|
21
|
+
import './registerQRCodeIdleEvent';
|
|
22
|
+
import './registerRequireAuthEvent';
|
package/dist/{auth/events/registerChangeEvent.d.ts → conn/events/registerAuthCodeChangeEvent.d.ts}
RENAMED
|
File without changes
|
package/dist/{auth/events/registerIdleEvent.d.ts → conn/events/registerAuthenticatedEvent.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
File without changes
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
export { getAuthCode } from './getAuthCode';
|
|
17
17
|
export { isAuthenticated } from './isAuthenticated';
|
|
18
18
|
export { isIdle } from './isIdle';
|
|
19
|
+
export { isMainLoaded } from './isMainLoaded';
|
|
19
20
|
export { isMultiDevice } from './isMultiDevice';
|
|
20
21
|
export { logout } from './logout';
|
|
21
|
-
export {
|
|
22
|
+
export { refreshQR } from './refreshQR';
|
|
22
23
|
export { setMultiDevice } from './setMultiDevice';
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Check is main interface is loaded and authenticated
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const isMainLoaded = WPP.conn.isMainLoaded();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function isMainLoaded(): boolean;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { AuthCode } from '..';
|
|
17
|
+
/**
|
|
18
|
+
* Refresh the current QRCode when is waiting for scan and return the current code
|
|
19
|
+
*
|
|
20
|
+
* For legacy: It will wait for next code
|
|
21
|
+
* For multidevice: It will generate a new one
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* await WPP.conn.refreshQR();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function refreshQR(): Promise<AuthCode | null>;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @param md If it's true, WhatsApp WEB will switch to MD. If it's false, WhatsApp WEB will switch to Legacy.
|
|
18
18
|
* @example
|
|
19
19
|
* ```javascript
|
|
20
|
-
* WPP.
|
|
20
|
+
* WPP.conn.setMultiDevice(true)
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export declare function setMultiDevice(md?: boolean): boolean;
|
|
File without changes
|
|
File without changes
|
|
@@ -38,7 +38,7 @@ export interface QueryExistsResult {
|
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```javascript
|
|
41
|
-
* const result = await WPP.contact.queryExists('
|
|
41
|
+
* const result = await WPP.contact.queryExists('[number]@c.us');
|
|
42
42
|
* console.log(result.wid); // Correct ID
|
|
43
43
|
* ```
|
|
44
44
|
*
|
|
@@ -19,7 +19,7 @@ import { Wid } from '../../whatsapp';
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
|
-
* const code = WPP.group.getInviteCode('
|
|
22
|
+
* const code = WPP.group.getInviteCode('[group-id]@g.us');
|
|
23
23
|
* const link = 'https://chat.whatsapp.com/' + code;
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
@@ -19,7 +19,7 @@ import { Wid } from '../../whatsapp';
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
|
-
* WPP.group.getParticipants('
|
|
22
|
+
* WPP.group.getParticipants('[group-id]@g.us');
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare function getParticipants(groupId: string | Wid): Promise<import("../../whatsapp").ParticipantModel[]>;
|
|
@@ -19,7 +19,7 @@ import { Wid } from '../../whatsapp';
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
|
-
* const code = WPP.group.revokeInviteCode('
|
|
22
|
+
* const code = WPP.group.revokeInviteCode('[group-id]@g.us');
|
|
23
23
|
* const link = 'https://chat.whatsapp.com/' + code;
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -19,7 +19,7 @@ import { Wid } from '../../whatsapp';
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
|
-
* await WPP.group.setDescription('
|
|
22
|
+
* await WPP.group.setDescription('[group-id]@g.us', 'new group description');
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
25
|
* @category Group
|