@wppconnect/wa-js 2.5.1 → 2.6.0
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 +9 -0
- package/dist/chat/functions/getMessages.d.ts +13 -0
- package/dist/chat/functions/sendFileMessage.d.ts +1 -1
- package/dist/conn/functions/isMainLoaded.d.ts +1 -1
- package/dist/conn/functions/isMainReady.d.ts +24 -0
- package/dist/whatsapp/models/ChatModel.d.ts +1 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,7 @@ export interface GetMessagesOptions {
|
|
|
19
19
|
count?: number;
|
|
20
20
|
direction?: 'after' | 'before';
|
|
21
21
|
id?: string;
|
|
22
|
+
onlyUnread?: boolean;
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Fetch messages from a chat
|
|
@@ -35,6 +36,18 @@ export interface GetMessagesOptions {
|
|
|
35
36
|
* count: -1,
|
|
36
37
|
* });
|
|
37
38
|
*
|
|
39
|
+
* // Last 20 unread messages
|
|
40
|
+
* WPP.chat.getMessages('[number]@c.us', {
|
|
41
|
+
* count: 20,
|
|
42
|
+
* onlyUnread: true,
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* // All unread messages
|
|
46
|
+
* WPP.chat.getMessages('[number]@c.us', {
|
|
47
|
+
* count: -1,
|
|
48
|
+
* onlyUnread: true,
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
38
51
|
* // 20 messages before specific message
|
|
39
52
|
* WPP.chat.getMessages('[number]@c.us', {
|
|
40
53
|
* count: 20,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
17
|
import { MessageButtonsOptions } from '.';
|
|
18
18
|
export interface FileMessageOptions extends SendMessageOptions {
|
|
19
|
-
type
|
|
19
|
+
type?: string;
|
|
20
20
|
caption?: string;
|
|
21
21
|
footer?: string;
|
|
22
22
|
filename?: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 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 authenticated, loaded and synced
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const isMainReady = WPP.conn.isMainReady();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function isMainReady(): boolean;
|
|
@@ -22,7 +22,7 @@ import { ModelChatBase, PropsChatBase, SessionChatBase } from './ModelChatBase';
|
|
|
22
22
|
interface Props extends PropsChatBase {
|
|
23
23
|
lastReceivedKey?: MsgKey;
|
|
24
24
|
t?: number;
|
|
25
|
-
unreadCount
|
|
25
|
+
unreadCount: number;
|
|
26
26
|
archive?: any;
|
|
27
27
|
isReadOnly: boolean;
|
|
28
28
|
isAnnounceGrpRestrict: boolean;
|