@open-wa/wa-automate 4.32.9 → 4.32.12
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/model/chat.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { ContactId, GroupChatId } from './aliases';
|
2
2
|
import { Contact } from './contact';
|
3
3
|
import { GroupMetadata } from './group-metadata';
|
4
|
-
export interface
|
4
|
+
export interface BaseChat {
|
5
5
|
archive: boolean;
|
6
6
|
changeNumberNewJid: any;
|
7
7
|
changeNumberOldJid: any;
|
@@ -13,10 +13,6 @@ export interface Chat {
|
|
13
13
|
* Group metadata for this chat
|
14
14
|
*/
|
15
15
|
groupMetadata: GroupMetadata;
|
16
|
-
/**
|
17
|
-
* The id of the chat
|
18
|
-
*/
|
19
|
-
id: ChatId;
|
20
16
|
/**
|
21
17
|
* If the chat is a group chat is restricted
|
22
18
|
*/
|
@@ -29,10 +25,6 @@ export interface Chat {
|
|
29
25
|
* Whether your host account is able to send messages to this chat
|
30
26
|
*/
|
31
27
|
canSend?: boolean;
|
32
|
-
/**
|
33
|
-
* Whether the chat is a group chat
|
34
|
-
*/
|
35
|
-
isGroup: boolean;
|
36
28
|
/**
|
37
29
|
* Whether the chat is a group chat and the group is restricted
|
38
30
|
*/
|
@@ -93,6 +85,27 @@ export interface Chat {
|
|
93
85
|
*/
|
94
86
|
lastSeen?: any;
|
95
87
|
}
|
88
|
+
export interface SingleChat extends BaseChat {
|
89
|
+
/**
|
90
|
+
* The id of the chat
|
91
|
+
*/
|
92
|
+
id: ContactId;
|
93
|
+
/**
|
94
|
+
* Whether the chat is a group chat
|
95
|
+
*/
|
96
|
+
isGroup: false;
|
97
|
+
}
|
98
|
+
export interface GroupChat extends BaseChat {
|
99
|
+
/**
|
100
|
+
* The id of the chat
|
101
|
+
*/
|
102
|
+
id: GroupChatId;
|
103
|
+
/**
|
104
|
+
* Whether the chat is a group chat
|
105
|
+
*/
|
106
|
+
isGroup: true;
|
107
|
+
}
|
108
|
+
export declare type Chat = SingleChat | GroupChat;
|
96
109
|
export interface LiveLocationChangedEvent {
|
97
110
|
id: string;
|
98
111
|
lat: number;
|
@@ -132,7 +132,7 @@ const setupChatwootOutgoingMessageHandler = (cliConfig, client) => __awaiter(voi
|
|
132
132
|
const getContactConversation = (number) => __awaiter(void 0, void 0, void 0, function* () {
|
133
133
|
try {
|
134
134
|
const { data } = yield cwReq(`contacts/${contactReg[number]}/conversations`, 'get');
|
135
|
-
return data.payload.sort((a, b) => a.id - b.id)[0];
|
135
|
+
return data.payload.filter(c => c.inbox_id === resolvedInbox).sort((a, b) => a.id - b.id)[0];
|
136
136
|
}
|
137
137
|
catch (error) {
|
138
138
|
return;
|
package/package.json
CHANGED