@in.pulse-crm/sdk 2.6.4 → 2.6.5

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.
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.5",
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",
@@ -13,6 +13,8 @@ type GetChatsResponse = DataResponse<{
13
13
  chats: (InternalChat & { participants: InternalChatMember[] })[];
14
14
  messages: InternalMessage[];
15
15
  }>;
16
+ type GetMonitorInternalChatsResponse = DataResponse<[]>;
17
+
16
18
  export default class InternalChatClient extends ApiClient {
17
19
  public async createInternalChat(
18
20
  participants: number[],
@@ -90,6 +92,14 @@ export default class InternalChatClient extends ApiClient {
90
92
  const url = `/api/internal/chat/${chatId}/mark-as-read`;
91
93
  await this.httpClient.patch(url);
92
94
  }
95
+ public async getInternalChatsMonitor() {
96
+ const url = `/api/internal/monitor/chats`;
97
+
98
+ const { data: res } =
99
+ await this.httpClient.get<GetChatsResponse>(url);
100
+
101
+ return res.data;
102
+ }
93
103
 
94
104
  public setAuth(token: string) {
95
105
  this.httpClient.defaults.headers.common["Authorization"] =
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
  }