@in.pulse-crm/sdk 2.3.2 → 2.3.4
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.
|
@@ -5,6 +5,6 @@ export default class WhatsappClient extends ApiClient {
|
|
|
5
5
|
getChatById(id: number): Promise<WppChatWithDetailsAndMessages>;
|
|
6
6
|
getMessageById(id: string): Promise<WppMessage>;
|
|
7
7
|
getUserWallets(instance: string, userId: number): Promise<WppWallet[]>;
|
|
8
|
-
|
|
8
|
+
markContactMessagesAsRead(contactId: number): Promise<WppMessage[]>;
|
|
9
9
|
setAuth(token: string): void;
|
|
10
10
|
}
|
package/dist/whatsapp.client.js
CHANGED
|
@@ -26,10 +26,10 @@ class WhatsappClient extends api_client_1.default {
|
|
|
26
26
|
const { data: res } = await this.httpClient.get(`/api/wallets?instance=${instance}&userId=${userId}`);
|
|
27
27
|
return res.data;
|
|
28
28
|
}
|
|
29
|
-
async
|
|
29
|
+
async markContactMessagesAsRead(contactId) {
|
|
30
30
|
const url = "/api/whatsapp/messages/mark-as-read";
|
|
31
|
-
const body = {
|
|
32
|
-
const { data: res } = await this.httpClient.
|
|
31
|
+
const body = { contactId };
|
|
32
|
+
const { data: res } = await this.httpClient.patch(url, body);
|
|
33
33
|
return res.data;
|
|
34
34
|
}
|
|
35
35
|
setAuth(token) {
|
package/package.json
CHANGED
package/src/whatsapp.client.ts
CHANGED
|
@@ -53,11 +53,11 @@ export default class WhatsappClient extends ApiClient {
|
|
|
53
53
|
return res.data;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
public async
|
|
56
|
+
public async markContactMessagesAsRead(contactId: number) {
|
|
57
57
|
const url = "/api/whatsapp/messages/mark-as-read";
|
|
58
|
-
const body = {
|
|
58
|
+
const body = { contactId };
|
|
59
59
|
const { data: res } =
|
|
60
|
-
await this.httpClient.
|
|
60
|
+
await this.httpClient.patch<MarkChatAsReadResponse>(url, body);
|
|
61
61
|
|
|
62
62
|
return res.data;
|
|
63
63
|
}
|