@in.pulse-crm/sdk 2.6.6 → 2.6.7
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ApiClient from "./api-client";
|
|
2
2
|
import { InternalChat, InternalChatMember, InternalGroup, InternalMessage, InternalSendMessageData } from "./types/internal.types";
|
|
3
3
|
export default class InternalChatClient extends ApiClient {
|
|
4
|
-
createInternalChat(participants: number[], isGroup?: boolean, groupName?: string): Promise<InternalChat>;
|
|
4
|
+
createInternalChat(participants: number[], isGroup?: boolean, groupName?: string | null, groupId?: string | null): Promise<InternalChat>;
|
|
5
5
|
getInternalChatsBySession(token?: string | null): Promise<{
|
|
6
6
|
chats: (InternalChat & {
|
|
7
7
|
participants: InternalChatMember[];
|
package/dist/internal.client.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const api_client_1 = __importDefault(require("./api-client"));
|
|
7
7
|
const form_data_1 = __importDefault(require("form-data"));
|
|
8
8
|
class InternalChatClient extends api_client_1.default {
|
|
9
|
-
async createInternalChat(participants, isGroup = false, groupName =
|
|
10
|
-
const body = { participants, isGroup, groupName };
|
|
9
|
+
async createInternalChat(participants, isGroup = false, groupName = null, groupId = null) {
|
|
10
|
+
const body = { participants, isGroup, groupName, groupId };
|
|
11
11
|
const { data: res } = await this.httpClient.post(`/api/internal/chats`, body);
|
|
12
12
|
return res.data;
|
|
13
13
|
}
|
package/package.json
CHANGED
package/src/internal.client.ts
CHANGED
|
@@ -17,9 +17,10 @@ export default class InternalChatClient extends ApiClient {
|
|
|
17
17
|
public async createInternalChat(
|
|
18
18
|
participants: number[],
|
|
19
19
|
isGroup: boolean = false,
|
|
20
|
-
groupName: string =
|
|
20
|
+
groupName: string | null = null,
|
|
21
|
+
groupId: string | null = null,
|
|
21
22
|
) {
|
|
22
|
-
const body = { participants, isGroup, groupName };
|
|
23
|
+
const body = { participants, isGroup, groupName, groupId };
|
|
23
24
|
|
|
24
25
|
const { data: res } = await this.httpClient.post<
|
|
25
26
|
DataResponse<InternalChat>
|
|
@@ -92,8 +93,7 @@ export default class InternalChatClient extends ApiClient {
|
|
|
92
93
|
}
|
|
93
94
|
public async getInternalChatsMonitor() {
|
|
94
95
|
const url = `/api/internal/monitor/chats`;
|
|
95
|
-
const { data: res } =
|
|
96
|
-
await this.httpClient.get<GetChatsResponse>(url);
|
|
96
|
+
const { data: res } = await this.httpClient.get<GetChatsResponse>(url);
|
|
97
97
|
|
|
98
98
|
return res.data;
|
|
99
99
|
}
|
package/src/whatsapp.client.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { RequestFilters } from "./types";
|
|
|
3
3
|
import { DataResponse, MessageResponse } from "./types/response.types";
|
|
4
4
|
import {
|
|
5
5
|
CreateScheduleDTO,
|
|
6
|
-
MonitorChat,
|
|
7
6
|
SendMessageData,
|
|
8
7
|
WppChatsAndMessages,
|
|
9
8
|
WppChatWithDetailsAndMessages,
|
|
@@ -19,7 +18,6 @@ type GetChatsResponse = DataResponse<WppChatsAndMessages>;
|
|
|
19
18
|
type GetChatResponse = DataResponse<WppChatWithDetailsAndMessages>;
|
|
20
19
|
type GetMessageResponse = DataResponse<WppMessage>;
|
|
21
20
|
type MarkChatAsReadResponse = DataResponse<WppMessage[]>;
|
|
22
|
-
type GetMonitorChatsResponse = DataResponse<MonitorChat[]>;
|
|
23
21
|
|
|
24
22
|
export default class WhatsappClient extends ApiClient {
|
|
25
23
|
public async getChatsBySession(
|