@in.pulse-crm/sdk 2.8.8 → 2.8.10
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/types/files.types.d.ts +0 -2
- package/dist/types/whatsapp.types.d.ts +1 -9
- package/dist/whatsapp.client.d.ts +2 -0
- package/dist/whatsapp.client.js +11 -0
- package/package.json +1 -1
- package/src/types/whatsapp.types.ts +1 -10
- package/src/whatsapp.client.ts +15 -0
- 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
|
@@ -8,14 +8,6 @@ export interface WppContact {
|
|
|
8
8
|
isBlocked: boolean;
|
|
9
9
|
isOnlyAdmin: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface WppSchedule {
|
|
12
|
-
id: number;
|
|
13
|
-
instance: string;
|
|
14
|
-
contactId: number;
|
|
15
|
-
scheduleDate: string;
|
|
16
|
-
scheduledBy: string;
|
|
17
|
-
scheduledFor: string;
|
|
18
|
-
}
|
|
19
11
|
export interface WppContactWithCustomer {
|
|
20
12
|
id: number;
|
|
21
13
|
name: string;
|
|
@@ -131,7 +123,7 @@ export interface CreateScheduleDTO {
|
|
|
131
123
|
scheduledFor: number;
|
|
132
124
|
sectorId: number;
|
|
133
125
|
}
|
|
134
|
-
export interface
|
|
126
|
+
export interface WppSchedule {
|
|
135
127
|
id: number;
|
|
136
128
|
instance: string;
|
|
137
129
|
sectorId: number;
|
|
@@ -27,6 +27,8 @@ export default class WhatsappClient extends ApiClient {
|
|
|
27
27
|
setAuth(token: string): void;
|
|
28
28
|
getChatsMonitor(): Promise<WppChatsAndMessages>;
|
|
29
29
|
transferAttendance(id: number, userId: number): Promise<void>;
|
|
30
|
+
getNotifications(): Promise<any>;
|
|
31
|
+
markAllAsReadNotification(): Promise<any>;
|
|
30
32
|
/**
|
|
31
33
|
* Obtém os detalhes de um agendamento.
|
|
32
34
|
* @param filters - keys de WppSchedule.
|
package/dist/whatsapp.client.js
CHANGED
|
@@ -122,6 +122,17 @@ class WhatsappClient extends api_client_1.default {
|
|
|
122
122
|
const body = { userId };
|
|
123
123
|
await this.ax.post(url, body);
|
|
124
124
|
}
|
|
125
|
+
async getNotifications() {
|
|
126
|
+
const url = `/api/whatsapp/notifications`;
|
|
127
|
+
const { data: res } = await this.ax.get(url);
|
|
128
|
+
return res.data;
|
|
129
|
+
}
|
|
130
|
+
async markAllAsReadNotification() {
|
|
131
|
+
const url = `/api/whatsapp/notifications/mark-all-read`;
|
|
132
|
+
const { data: res } = await this.ax.get(url);
|
|
133
|
+
return res.data;
|
|
134
|
+
}
|
|
135
|
+
;
|
|
125
136
|
/**
|
|
126
137
|
* Obtém os detalhes de um agendamento.
|
|
127
138
|
* @param filters - keys de WppSchedule.
|
package/package.json
CHANGED
|
@@ -10,15 +10,6 @@ export interface WppContact {
|
|
|
10
10
|
isOnlyAdmin: boolean;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export interface WppSchedule {
|
|
14
|
-
id: number;
|
|
15
|
-
instance: string;
|
|
16
|
-
contactId: number;
|
|
17
|
-
scheduleDate: string;
|
|
18
|
-
scheduledBy: string;
|
|
19
|
-
scheduledFor: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
13
|
export interface WppContactWithCustomer {
|
|
23
14
|
id: number;
|
|
24
15
|
name: string;
|
|
@@ -153,7 +144,7 @@ export interface CreateScheduleDTO {
|
|
|
153
144
|
sectorId: number;
|
|
154
145
|
}
|
|
155
146
|
|
|
156
|
-
export interface
|
|
147
|
+
export interface WppSchedule {
|
|
157
148
|
id: number;
|
|
158
149
|
instance: string;
|
|
159
150
|
sectorId: number;
|
package/src/whatsapp.client.ts
CHANGED
|
@@ -214,6 +214,21 @@ export default class WhatsappClient extends ApiClient {
|
|
|
214
214
|
|
|
215
215
|
await this.ax.post<MessageResponse>(url, body);
|
|
216
216
|
}
|
|
217
|
+
public async getNotifications() {
|
|
218
|
+
const url = `/api/whatsapp/notifications`;
|
|
219
|
+
const { data: res } =
|
|
220
|
+
await this.ax.get<DataResponse<any>>(url);
|
|
221
|
+
|
|
222
|
+
return res.data;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public async markAllAsReadNotification () {
|
|
226
|
+
const url = `/api/whatsapp/notifications/mark-all-read`;
|
|
227
|
+
const { data: res } =
|
|
228
|
+
await this.ax.get<DataResponse<any>>(url);
|
|
229
|
+
|
|
230
|
+
return res.data;
|
|
231
|
+
};
|
|
217
232
|
|
|
218
233
|
/**
|
|
219
234
|
* Obtém os detalhes de um agendamento.
|
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
|
}
|