@in.pulse-crm/sdk 2.6.4 → 2.6.6

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/.prettierrc CHANGED
@@ -1,4 +1,4 @@
1
- {
2
- "tabWidth": 4,
3
- "useTabs": true
4
- }
1
+ {
2
+ "tabWidth": 4,
3
+ "useTabs": true
4
+ }
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import ApiClient from "./api-client";
4
2
  import { File, UploadFileOptions } from "./types/files.types";
5
3
  declare class FilesClient extends ApiClient {
@@ -15,5 +15,11 @@ export default class InternalChatClient extends ApiClient {
15
15
  participants: number[];
16
16
  }): Promise<InternalGroup>;
17
17
  markChatMessagesAsRead(chatId: number): Promise<void>;
18
+ getInternalChatsMonitor(): Promise<{
19
+ chats: (InternalChat & {
20
+ participants: InternalChatMember[];
21
+ })[];
22
+ messages: InternalMessage[];
23
+ }>;
18
24
  setAuth(token: string): void;
19
25
  }
@@ -53,6 +53,11 @@ class InternalChatClient extends api_client_1.default {
53
53
  const url = `/api/internal/chat/${chatId}/mark-as-read`;
54
54
  await this.httpClient.patch(url);
55
55
  }
56
+ async getInternalChatsMonitor() {
57
+ const url = `/api/internal/monitor/chats`;
58
+ const { data: res } = await this.httpClient.get(url);
59
+ return res.data;
60
+ }
56
61
  setAuth(token) {
57
62
  this.httpClient.defaults.headers.common["Authorization"] =
58
63
  `Bearer ${token}`;
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  export interface UploadFileOptions {
4
2
  /**
5
3
  * Nome da instância onde o arquivo está armazenado.
@@ -1,6 +1,6 @@
1
1
  import ApiClient from "./api-client";
2
2
  import { RequestFilters } from "./types";
3
- import { CreateScheduleDTO, MonitorChat, SendMessageData, WppChatsAndMessages, WppChatWithDetailsAndMessages, WppContact, WppContactWithCustomer, WppMessage, WppSchedule, WppWallet } from "./types/whatsapp.types";
3
+ import { CreateScheduleDTO, SendMessageData, WppChatsAndMessages, WppChatWithDetailsAndMessages, WppContact, WppContactWithCustomer, WppMessage, WppSchedule, WppWallet } from "./types/whatsapp.types";
4
4
  export default class WhatsappClient extends ApiClient {
5
5
  getChatsBySession(messages?: boolean, contact?: boolean, token?: string | null): Promise<WppChatsAndMessages>;
6
6
  getChatById(id: number): Promise<WppChatWithDetailsAndMessages>;
@@ -24,7 +24,7 @@ export default class WhatsappClient extends ApiClient {
24
24
  name: string;
25
25
  }[]>;
26
26
  setAuth(token: string): void;
27
- getChatsMonitor(): Promise<MonitorChat[]>;
27
+ getChatsMonitor(): Promise<WppChatsAndMessages>;
28
28
  transferAttendance(id: number, userId: number): Promise<void>;
29
29
  /**
30
30
  * Obtém os detalhes de um agendamento.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "2.6.4",
3
+ "version": "2.6.6",
4
4
  "description": "SDKs for abstraction of api consumption of in.pulse-crm application",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -90,7 +90,13 @@ export default class InternalChatClient extends ApiClient {
90
90
  const url = `/api/internal/chat/${chatId}/mark-as-read`;
91
91
  await this.httpClient.patch(url);
92
92
  }
93
+ public async getInternalChatsMonitor() {
94
+ const url = `/api/internal/monitor/chats`;
95
+ const { data: res } =
96
+ await this.httpClient.get<GetChatsResponse>(url);
93
97
 
98
+ return res.data;
99
+ }
94
100
  public setAuth(token: string) {
95
101
  this.httpClient.defaults.headers.common["Authorization"] =
96
102
  `Bearer ${token}`;
@@ -194,7 +194,7 @@ export default class WhatsappClient extends ApiClient {
194
194
  const url = `/api/whatsapp/session/monitor`;
195
195
 
196
196
  const { data: res } =
197
- await this.httpClient.get<GetMonitorChatsResponse>(url);
197
+ await this.httpClient.get<GetChatsResponse>(url);
198
198
 
199
199
  return res.data;
200
200
  }
package/tsconfig.json CHANGED
@@ -1,17 +1,17 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
4
- "module": "commonjs" /* Specify what module code is generated. */,
5
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
6
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
7
- "strict": true /* Enable all strict type-checking options. */,
8
- "skipLibCheck": true /* Skip type checking all .d.ts files. */,
9
- "noUnusedLocals": false,
10
- "outDir": "./dist", /* Redirect output structure to the directory. */
11
- "declaration": true
12
- },
13
- "include": [
14
- "src/index.ts",
15
- "src/**/*.{ts}"
16
- ]
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
4
+ "module": "commonjs" /* Specify what module code is generated. */,
5
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
6
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
7
+ "strict": true /* Enable all strict type-checking options. */,
8
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */,
9
+ "noUnusedLocals": false,
10
+ "outDir": "./dist", /* Redirect output structure to the directory. */
11
+ "declaration": true
12
+ },
13
+ "include": [
14
+ "src/index.ts",
15
+ "src/**/*.{ts}"
16
+ ]
17
17
  }