@wppconnect/wa-js 1.0.16 → 1.1.3
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 +26 -0
- package/README.md +68 -0
- package/dist/auth/eventEmitter.d.ts +52 -0
- package/dist/{blocklist/Blocklist.d.ts → auth/events/index.d.ts} +3 -11
- package/dist/{contact/types.d.ts → auth/events/registerChangeEvent.d.ts} +1 -3
- package/dist/auth/events/registerIdleEvent.d.ts +16 -0
- package/dist/auth/events/registerLogoutEvent.d.ts +16 -0
- package/dist/auth/functions/getAuthCode.d.ts +22 -0
- package/dist/{contact/Contact.d.ts → auth/functions/index.d.ts} +7 -11
- package/dist/auth/functions/isAuthenticated.d.ts +16 -0
- package/dist/auth/functions/isIdle.d.ts +16 -0
- package/dist/auth/functions/isMultiDevice.d.ts +16 -0
- package/dist/auth/functions/logout.d.ts +16 -0
- package/dist/auth/functions/poke.d.ts +16 -0
- package/dist/auth/functions/setMultiDevice.d.ts +23 -0
- package/dist/auth/index.d.ts +3 -4
- package/dist/auth/types.d.ts +0 -5
- package/dist/blocklist/eventEmitter.d.ts +49 -0
- package/dist/blocklist/events/index.d.ts +16 -0
- package/dist/blocklist/events/registerSyncedEvent.d.ts +16 -0
- package/dist/blocklist/functions/all.d.ts +17 -0
- package/dist/blocklist/functions/blockContact.d.ts +18 -0
- package/dist/blocklist/functions/index.d.ts +19 -0
- package/dist/blocklist/functions/isBlocked.d.ts +17 -0
- package/dist/blocklist/functions/unblockContact.d.ts +18 -0
- package/dist/blocklist/index.d.ts +3 -5
- package/dist/blocklist/types.d.ts +0 -3
- package/dist/chat/defaultSendMessageOptions.d.ts +19 -0
- package/dist/chat/eventEmitter.d.ts +107 -0
- package/dist/chat/events/index.d.ts +18 -0
- package/dist/chat/events/registerAckMessageEvent.d.ts +16 -0
- package/dist/chat/events/registerLiveLocationUpdateEvent.d.ts +16 -0
- package/dist/chat/events/registerRevokeMessageEvent.d.ts +16 -0
- package/dist/chat/functions/clear.d.ts +26 -0
- package/dist/chat/functions/delete.d.ts +26 -0
- package/dist/chat/functions/deleteMessage.d.ts +35 -0
- package/dist/chat/functions/downloadMedia.d.ts +21 -0
- package/dist/chat/functions/find.d.ts +24 -0
- package/dist/chat/functions/generateMessageID.d.ts +22 -0
- package/dist/chat/functions/get.d.ts +22 -0
- package/dist/chat/functions/getMessageById.d.ts +35 -0
- package/dist/chat/functions/getMessages.d.ts +48 -0
- package/dist/chat/functions/index.d.ts +37 -0
- package/dist/chat/functions/markIsComposing.d.ts +31 -0
- package/dist/chat/functions/markIsPaused.d.ts +27 -0
- package/dist/chat/functions/markIsRead.d.ts +30 -0
- package/dist/chat/functions/markIsRecording.d.ts +31 -0
- package/dist/chat/functions/markIsUnread.d.ts +29 -0
- package/dist/chat/functions/prepareLinkPreview.d.ts +53 -0
- package/dist/chat/functions/prepareMessageButtons.d.ts +40 -0
- package/dist/chat/functions/prepareRawMessage.d.ts +23 -0
- package/dist/chat/functions/sendFileMessage.d.ts +116 -0
- package/dist/{group/types.d.ts → chat/functions/sendListMessage.d.ts} +26 -25
- package/dist/chat/functions/sendRawMessage.d.ts +22 -0
- package/dist/chat/functions/sendTextMessage.d.ts +23 -0
- package/dist/chat/functions/sendVCardContactMessage.d.ts +27 -0
- package/dist/chat/index.d.ts +4 -4
- package/dist/chat/types.d.ts +0 -105
- package/dist/contact/eventEmitter.d.ts +48 -0
- package/dist/contact/functions/index.d.ts +16 -0
- package/dist/contact/functions/queryExists.d.ts +20 -0
- package/dist/contact/index.d.ts +2 -5
- package/dist/group/eventEmitter.d.ts +48 -0
- package/dist/group/functions/addParticipants.d.ts +17 -0
- package/dist/group/functions/canAdd.d.ts +17 -0
- package/dist/group/functions/canDemote.d.ts +17 -0
- package/dist/group/functions/canPromote.d.ts +17 -0
- package/dist/group/functions/canRemove.d.ts +17 -0
- package/dist/group/functions/create.d.ts +25 -0
- package/dist/group/functions/demoteParticipants.d.ts +17 -0
- package/dist/group/functions/ensureGroup.d.ts +17 -0
- package/dist/group/functions/ensureGroupAndParticipants.d.ts +20 -0
- package/dist/group/functions/getParticipants.d.ts +25 -0
- package/dist/group/functions/iAmAdmin.d.ts +17 -0
- package/dist/group/functions/iAmMember.d.ts +17 -0
- package/dist/group/functions/iAmRestrictedMember.d.ts +17 -0
- package/dist/group/functions/iAmSuperAdmin.d.ts +17 -0
- package/dist/group/functions/index.d.ts +31 -0
- package/dist/group/functions/promoteParticipants.d.ts +17 -0
- package/dist/group/functions/removeParticipants.d.ts +17 -0
- package/dist/group/index.d.ts +2 -5
- package/dist/index.d.ts +8 -8
- package/dist/labels/eventEmitter.d.ts +48 -0
- package/dist/labels/functions/addNewLabel.d.ts +35 -0
- package/dist/{auth/Auth.d.ts → labels/functions/addOrRemoveLabels.d.ts} +15 -16
- package/dist/labels/functions/colorIsInLabelPalette.d.ts +26 -0
- package/dist/labels/functions/deleteAllLabels.d.ts +17 -0
- package/dist/labels/functions/deleteLabel.d.ts +21 -0
- package/dist/labels/functions/getAllLabels.d.ts +17 -0
- package/dist/labels/functions/getLabelColorPalette.d.ts +19 -0
- package/dist/labels/functions/getNewLabelColor.d.ts +19 -0
- package/dist/labels/functions/index.d.ts +23 -0
- package/dist/labels/index.d.ts +2 -4
- package/dist/labels/types.d.ts +5 -6
- package/dist/status/{types.d.ts → defaultSendStatusOptions.d.ts} +3 -12
- package/dist/status/eventEmitter.d.ts +49 -0
- package/dist/status/events/index.d.ts +16 -0
- package/dist/status/events/registerSyncedEvent.d.ts +16 -0
- package/dist/status/functions/get.d.ts +17 -0
- package/dist/status/functions/getMyStatus.d.ts +17 -0
- package/dist/status/functions/index.d.ts +19 -0
- package/dist/status/functions/sendRawStatus.d.ts +20 -0
- package/dist/status/functions/sendTextStatus.d.ts +31 -0
- package/dist/status/index.d.ts +4 -5
- package/dist/util/blobToBase64.d.ts +16 -0
- package/dist/util/convertToFile.d.ts +16 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/webpack.d.ts +2 -1
- package/dist/whatsapp/collections/BaseCollection.d.ts +3 -3
- 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 +4 -3
- 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 +3 -5
- package/dist/whatsapp/collections/LabelCollection.d.ts +3 -2
- package/dist/whatsapp/collections/LabelItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LiveLocationCollection.d.ts +3 -4
- 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/LogoutReason.d.ts +1 -1
- package/dist/whatsapp/enums/OUTWARD_TYPES.d.ts +1 -1
- package/dist/whatsapp/enums/SendMsgResult.d.ts +1 -1
- package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/blockContact.d.ts +2 -2
- package/dist/whatsapp/functions/fetchLinkPreview.d.ts +29 -0
- package/dist/whatsapp/functions/findChat.d.ts +1 -1
- package/dist/whatsapp/functions/findFirstWebLink.d.ts +17 -0
- 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 +21 -0
- package/dist/whatsapp/functions/index.d.ts +3 -0
- 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/randomId.d.ts +2 -2
- 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/sendQueryExists.d.ts +1 -1
- package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +1 -1
- 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 +1 -1
- 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 +30 -0
- package/dist/whatsapp/misc/MediaObject.d.ts +2 -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 +1 -1
- package/dist/whatsapp/misc/MsgLoadState.d.ts +2 -2
- package/dist/whatsapp/misc/OpaqueData.d.ts +3 -3
- package/dist/whatsapp/misc/State.d.ts +1 -1
- package/dist/whatsapp/misc/UserPrefs.d.ts +1 -1
- package/dist/whatsapp/misc/VCard.d.ts +1 -1
- 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 +1 -0
- 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 +4 -3
- 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 +1 -1
- 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 +25 -15
- 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 +2 -2
- 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/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/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 +14 -14
- package/dist/chat/Chat.d.ts +0 -225
- package/dist/group/Group.d.ts +0 -45
- package/dist/labels/Labels.d.ts +0 -52
- package/dist/status/Status.d.ts +0 -37
|
@@ -0,0 +1,107 @@
|
|
|
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 Emittery from 'emittery';
|
|
17
|
+
import { MsgKey, Wid } from '../whatsapp';
|
|
18
|
+
export declare type UnsubscribeFn = () => void;
|
|
19
|
+
export interface EventTypes {
|
|
20
|
+
msg_revoke: {
|
|
21
|
+
/**
|
|
22
|
+
* Author of message, only for groups
|
|
23
|
+
*/
|
|
24
|
+
author?: Wid;
|
|
25
|
+
from: Wid;
|
|
26
|
+
/**
|
|
27
|
+
* Message id of revoke event
|
|
28
|
+
*/
|
|
29
|
+
id: MsgKey;
|
|
30
|
+
/**
|
|
31
|
+
* Message id of revoked message
|
|
32
|
+
*/
|
|
33
|
+
refId: MsgKey;
|
|
34
|
+
to: Wid;
|
|
35
|
+
};
|
|
36
|
+
msg_ack_change: {
|
|
37
|
+
ack: number;
|
|
38
|
+
/**
|
|
39
|
+
* Who sended the ack, only for groups, broadcast and status
|
|
40
|
+
*/
|
|
41
|
+
sender?: Wid;
|
|
42
|
+
/**
|
|
43
|
+
* The chat that sended the messeage
|
|
44
|
+
*/
|
|
45
|
+
chat: Wid;
|
|
46
|
+
/**
|
|
47
|
+
* Message id of revoke event
|
|
48
|
+
*/
|
|
49
|
+
ids: MsgKey[];
|
|
50
|
+
};
|
|
51
|
+
live_location_start: {
|
|
52
|
+
id: Wid;
|
|
53
|
+
msgId: MsgKey;
|
|
54
|
+
chat: Wid;
|
|
55
|
+
lat: number;
|
|
56
|
+
lng: number;
|
|
57
|
+
accuracy?: number;
|
|
58
|
+
speed?: number;
|
|
59
|
+
degrees?: number;
|
|
60
|
+
shareDuration: number;
|
|
61
|
+
};
|
|
62
|
+
live_location_update: {
|
|
63
|
+
id: Wid;
|
|
64
|
+
lastUpdated: number;
|
|
65
|
+
elapsed: number;
|
|
66
|
+
lat: number;
|
|
67
|
+
lng: number;
|
|
68
|
+
accuracy?: number;
|
|
69
|
+
speed?: number;
|
|
70
|
+
degrees?: number;
|
|
71
|
+
comment: string;
|
|
72
|
+
};
|
|
73
|
+
live_location_end: {
|
|
74
|
+
id: Wid;
|
|
75
|
+
chat: Wid;
|
|
76
|
+
seq: number;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
80
|
+
/**
|
|
81
|
+
* Subscribe to one event.
|
|
82
|
+
* @event
|
|
83
|
+
* @returns An unsubscribe method.
|
|
84
|
+
*/
|
|
85
|
+
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
86
|
+
/**
|
|
87
|
+
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
88
|
+
* @event
|
|
89
|
+
*/
|
|
90
|
+
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
91
|
+
/**
|
|
92
|
+
* @event
|
|
93
|
+
*/
|
|
94
|
+
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
95
|
+
/**
|
|
96
|
+
* Clear all event listeners on the instance.
|
|
97
|
+
*
|
|
98
|
+
* If `eventName` is given, only the listeners for that event are cleared.
|
|
99
|
+
*
|
|
100
|
+
* @event
|
|
101
|
+
*/
|
|
102
|
+
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* The number of listeners for the `eventName` or all events if not specified.
|
|
105
|
+
* @event
|
|
106
|
+
*/
|
|
107
|
+
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 './registerAckMessageEvent';
|
|
17
|
+
import './registerRevokeMessageEvent';
|
|
18
|
+
import './registerLiveLocationUpdateEvent';
|
|
@@ -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 {};
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Clear a chat message
|
|
19
|
+
*
|
|
20
|
+
* @category Chat
|
|
21
|
+
*/
|
|
22
|
+
export declare function clear(chatId: string | Wid, keepStarred?: boolean): Promise<{
|
|
23
|
+
wid: Wid;
|
|
24
|
+
status: number;
|
|
25
|
+
keepStarred: boolean;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Delete a chat
|
|
19
|
+
*
|
|
20
|
+
* @category Chat
|
|
21
|
+
*/
|
|
22
|
+
declare function _delete(chatId: string | Wid): Promise<{
|
|
23
|
+
wid: Wid;
|
|
24
|
+
status: number;
|
|
25
|
+
}>;
|
|
26
|
+
export { _delete as delete };
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
import { SendMsgResult } from '../../whatsapp/enums';
|
|
18
|
+
export interface DeleteMessageReturn {
|
|
19
|
+
id: string;
|
|
20
|
+
sendMsgResult: Promise<SendMsgResult>;
|
|
21
|
+
isRevoked: boolean;
|
|
22
|
+
isDeleted: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Delete a message
|
|
26
|
+
*
|
|
27
|
+
* @category Message
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteMessage(chatId: string | Wid, id: string, deleteMediaInDevice: boolean, revoke: boolean): Promise<DeleteMessageReturn>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete a list of messages
|
|
32
|
+
*
|
|
33
|
+
* @category Message
|
|
34
|
+
*/
|
|
35
|
+
export declare function deleteMessage(chatId: string | Wid, ids: string[], deleteMediaInDevice: boolean, revoke: boolean): Promise<DeleteMessageReturn[]>;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Download the blob of a media message
|
|
18
|
+
*
|
|
19
|
+
* @category Message
|
|
20
|
+
*/
|
|
21
|
+
export declare function downloadMedia(id: string): Promise<Blob>;
|
|
@@ -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
|
+
import { ChatModel, Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Find a chat by id
|
|
19
|
+
*
|
|
20
|
+
* This create a new chat if no one was found
|
|
21
|
+
*
|
|
22
|
+
* @category Chat
|
|
23
|
+
*/
|
|
24
|
+
export declare function find(chatId: string | Wid): Promise<ChatModel>;
|
|
@@ -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 { ChatModel, MsgKey, Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Generate a new message ID
|
|
19
|
+
*
|
|
20
|
+
* @category Message
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateMessageID(chat: string | ChatModel | Wid): MsgKey;
|
|
@@ -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 { ChatModel, Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Find a chat by id
|
|
19
|
+
*
|
|
20
|
+
* @category Chat
|
|
21
|
+
*/
|
|
22
|
+
export declare function get(chatId: string | Wid): ChatModel | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { MsgKey, MsgModel } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Get message by a single ID or array of IDs
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Single message
|
|
23
|
+
* WPP.chat.getMessageById('true_<number>@c.us_ABCDEF');
|
|
24
|
+
*
|
|
25
|
+
* // List of messages
|
|
26
|
+
* WPP.chat.getMessageById(['true_<number>@c.us_ABCDEF', 'false_<number>@c.us_789456']);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @category Message
|
|
30
|
+
* @return {Promise<MsgModel> | Promise<MsgModel[]>} List of raw messages
|
|
31
|
+
*/
|
|
32
|
+
export declare function getMessageById(id: string | MsgKey): Promise<MsgModel>;
|
|
33
|
+
export declare function getMessageById(ids: (string | MsgKey)[]): Promise<MsgModel[]>;
|
|
34
|
+
export declare function getMessageById(notUsed: any, id: string): Promise<MsgModel>;
|
|
35
|
+
export declare function getMessageById(notUsed: any, ids: string[]): Promise<MsgModel[]>;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
import { RawMessage } from '..';
|
|
18
|
+
export interface GetMessagesOptions {
|
|
19
|
+
count?: number;
|
|
20
|
+
direction?: 'after' | 'before';
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fetch messages from a chat
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```javascript
|
|
28
|
+
* // Some messages
|
|
29
|
+
* WPP.chat.getMessages('<number>@c.us', {
|
|
30
|
+
* count: 20,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // All messages
|
|
34
|
+
* WPP.chat.getMessages('<number>@c.us', {
|
|
35
|
+
* count: -1,
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // 20 messages before specific message
|
|
39
|
+
* WPP.chat.getMessages('<number>@c.us', {
|
|
40
|
+
* count: 20,
|
|
41
|
+
* direction: 'before',
|
|
42
|
+
* id: '<full message id>'
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
* @category Message
|
|
46
|
+
* @return {RawMessage[]} List of raw messages
|
|
47
|
+
*/
|
|
48
|
+
export declare function getMessages(chatId: string | Wid, options?: GetMessagesOptions): Promise<RawMessage[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { clear } from './clear';
|
|
17
|
+
export { delete } from './delete';
|
|
18
|
+
export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
|
|
19
|
+
export { downloadMedia } from './downloadMedia';
|
|
20
|
+
export { find } from './find';
|
|
21
|
+
export { generateMessageID } from './generateMessageID';
|
|
22
|
+
export { get } from './get';
|
|
23
|
+
export { getMessageById } from './getMessageById';
|
|
24
|
+
export { getMessages, GetMessagesOptions } from './getMessages';
|
|
25
|
+
export { markIsComposing } from './markIsComposing';
|
|
26
|
+
export { markIsPaused } from './markIsPaused';
|
|
27
|
+
export { markIsRead } from './markIsRead';
|
|
28
|
+
export { markIsRecording } from './markIsRecording';
|
|
29
|
+
export { markIsUnread } from './markIsUnread';
|
|
30
|
+
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
31
|
+
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
32
|
+
export { prepareRawMessage } from './prepareRawMessage';
|
|
33
|
+
export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
|
|
34
|
+
export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
35
|
+
export { sendRawMessage } from './sendRawMessage';
|
|
36
|
+
export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
|
|
37
|
+
export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Mark a chat to composing state
|
|
19
|
+
* and keep sending "is writting a message"
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```javascript
|
|
23
|
+
* // Mark is composing
|
|
24
|
+
* WPP.chat.markIsComposing('<number>@c.us');
|
|
25
|
+
*
|
|
26
|
+
* // Mark is composing for 5 seconds
|
|
27
|
+
* WPP.chat.markIsComposing('<number>@c.us', 5000);
|
|
28
|
+
* ```
|
|
29
|
+
* @category Chat
|
|
30
|
+
*/
|
|
31
|
+
export declare function markIsComposing(chatId: string | Wid, duration?: number): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Mark a chat is paused state
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Mark as recording
|
|
23
|
+
* WPP.chat.markIsPaused('<number>@c.us');
|
|
24
|
+
* ```
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function markIsPaused(chatId: string | Wid): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Mark a chat as read and send SEEN event
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Some messages
|
|
23
|
+
* WPP.chat.markIsRead('<number>@c.us');
|
|
24
|
+
* ```
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function markIsRead(chatId: string | Wid): Promise<{
|
|
28
|
+
wid: Wid;
|
|
29
|
+
unreadCount: number;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Mark a chat to recording state
|
|
19
|
+
* and keep sending "is recording"
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```javascript
|
|
23
|
+
* // Mark is recording
|
|
24
|
+
* WPP.chat.markIsRecording('<number>@c.us');
|
|
25
|
+
*
|
|
26
|
+
* // Mark is recording for 5 seconds
|
|
27
|
+
* WPP.chat.markIsRecording('<number>@c.us', 5000);
|
|
28
|
+
* ```
|
|
29
|
+
* @category Chat
|
|
30
|
+
*/
|
|
31
|
+
export declare function markIsRecording(chatId: string | Wid, duration?: number): Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Mark a chat as unread
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Some messages
|
|
23
|
+
* WPP.chat.markIsUnread('<number>@c.us');
|
|
24
|
+
* ```
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function markIsUnread(chatId: string | Wid): Promise<{
|
|
28
|
+
wid: Wid;
|
|
29
|
+
}>;
|