@in.pulse-crm/sdk 2.11.0 → 2.11.2
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.
|
@@ -14,7 +14,7 @@ export default class WhatsappClient extends ApiClient {
|
|
|
14
14
|
getUserWallets(instance: string, userId: number): Promise<WppWallet[]>;
|
|
15
15
|
markContactMessagesAsRead(contactId: number): Promise<WppMessage[]>;
|
|
16
16
|
sendMessage(to: string, data: SendMessageData): Promise<WppMessage>;
|
|
17
|
-
editMessage(messageId: string, newText: string): Promise<void>;
|
|
17
|
+
editMessage(messageId: string, newText: string, isInternal?: boolean): Promise<void>;
|
|
18
18
|
finishChatById(id: number, resultId: number): Promise<void>;
|
|
19
19
|
startChatByContactId(contactId: number, template?: any): Promise<void>;
|
|
20
20
|
getResults(): Promise<{
|
package/dist/whatsapp.client.js
CHANGED
|
@@ -54,10 +54,11 @@ class WhatsappClient extends api_client_1.default {
|
|
|
54
54
|
});
|
|
55
55
|
return res.data;
|
|
56
56
|
}
|
|
57
|
-
async editMessage(messageId, newText) {
|
|
58
|
-
const
|
|
57
|
+
async editMessage(messageId, newText, isInternal = false) {
|
|
58
|
+
const type = isInternal ? 'internal' : 'whatsapp';
|
|
59
|
+
const url = `/api/${type}/messages/${messageId}`;
|
|
59
60
|
const body = { newText };
|
|
60
|
-
|
|
61
|
+
await this.ax.put(url, body);
|
|
61
62
|
}
|
|
62
63
|
async finishChatById(id, resultId) {
|
|
63
64
|
const url = `/api/whatsapp/chats/${id}/finish`;
|
package/package.json
CHANGED
package/src/whatsapp.client.ts
CHANGED
|
@@ -103,15 +103,15 @@ export default class WhatsappClient extends ApiClient {
|
|
|
103
103
|
return res.data;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
public async editMessage(messageId: string, newText: string) {
|
|
107
|
-
const
|
|
106
|
+
public async editMessage(messageId: string, newText: string, isInternal = false) {
|
|
107
|
+
const type = isInternal ? 'internal' : 'whatsapp';
|
|
108
|
+
|
|
109
|
+
const url = `/api/${type}/messages/${messageId}`;
|
|
108
110
|
const body = { newText };
|
|
109
|
-
|
|
110
|
-
url,
|
|
111
|
-
body,
|
|
112
|
-
);
|
|
111
|
+
await this.ax.put(url, body);
|
|
113
112
|
}
|
|
114
113
|
|
|
114
|
+
|
|
115
115
|
public async finishChatById(id: number, resultId: number) {
|
|
116
116
|
const url = `/api/whatsapp/chats/${id}/finish`;
|
|
117
117
|
const body = { resultId };
|