@in.pulse-crm/sdk 2.6.3 → 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 +4 -4
- package/dist/files.client.d.ts +0 -2
- package/dist/internal.client.d.ts +6 -0
- package/dist/internal.client.js +5 -0
- package/dist/types/files.types.d.ts +0 -2
- package/dist/types/socket-events.types.d.ts +2 -2
- package/package.json +1 -1
- package/src/internal.client.ts +10 -0
- package/src/types/socket-events.types.ts +2 -2
- package/tsconfig.json +16 -16
package/.prettierrc
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tabWidth": 4,
|
|
3
|
-
"useTabs": true
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"tabWidth": 4,
|
|
3
|
+
"useTabs": true
|
|
4
|
+
}
|
package/dist/files.client.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/internal.client.js
CHANGED
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { SocketServerAdminRoom, SocketServerChatRoom, SocketServerInternalChatRoom, SocketServerReportsRoom, SocketServerRoom } from "./socket-rooms.types";
|
|
2
2
|
import { MessageResponse } from "./response.types";
|
|
3
3
|
import { WppMessage, WppMessageStatus } from "./whatsapp.types";
|
|
4
|
-
import { InternalChat, InternalMessage } from "./internal.types";
|
|
4
|
+
import { InternalChat, InternalChatMember, InternalMessage } from "./internal.types";
|
|
5
5
|
export declare enum SocketEventType {
|
|
6
6
|
WppChatStarted = "wpp_chat_started",
|
|
7
7
|
WppChatFinished = "wpp_chat_finished",
|
|
@@ -82,7 +82,7 @@ export interface WppMessageReactionEventData {
|
|
|
82
82
|
}
|
|
83
83
|
export interface InternalChatStartedEventData {
|
|
84
84
|
chat: InternalChat & {
|
|
85
|
-
participants:
|
|
85
|
+
participants: InternalChatMember[];
|
|
86
86
|
messages: InternalMessage[];
|
|
87
87
|
};
|
|
88
88
|
}
|
package/package.json
CHANGED
package/src/internal.client.ts
CHANGED
|
@@ -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"] =
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./socket-rooms.types";
|
|
8
8
|
import { MessageResponse } from "./response.types";
|
|
9
9
|
import { WppMessage, WppMessageStatus } from "./whatsapp.types";
|
|
10
|
-
import { InternalChat, InternalMessage } from "./internal.types";
|
|
10
|
+
import { InternalChat, InternalChatMember, InternalMessage } from "./internal.types";
|
|
11
11
|
|
|
12
12
|
export enum SocketEventType {
|
|
13
13
|
WppChatStarted = "wpp_chat_started",
|
|
@@ -184,7 +184,7 @@ export interface WppMessageReactionEventData {
|
|
|
184
184
|
reaction: string;
|
|
185
185
|
}
|
|
186
186
|
export interface InternalChatStartedEventData {
|
|
187
|
-
chat: InternalChat & { participants:
|
|
187
|
+
chat: InternalChat & { participants: InternalChatMember[], messages: InternalMessage[] };
|
|
188
188
|
}
|
|
189
189
|
export interface InternalChatFinishedEventData {
|
|
190
190
|
chatId: number;
|
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
|
}
|