@in.pulse-crm/sdk 2.2.7 → 2.2.8
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 +2 -0
- package/dist/types/files.types.d.ts +2 -0
- package/dist/whatsapp.client.d.ts +1 -1
- package/dist/whatsapp.client.js +7 -2
- package/package.json +1 -1
- package/src/whatsapp.client.ts +12 -4
- 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
|
@@ -5,7 +5,7 @@ type GetChatsResponse = DataResponse<WppChatsAndMessages>;
|
|
|
5
5
|
type GetChatResponse = DataResponse<WppChatWithDetailsAndMessages>;
|
|
6
6
|
type GetMessageResponse = DataResponse<WppMessage>;
|
|
7
7
|
export default class WhatsappClient extends ApiClient {
|
|
8
|
-
|
|
8
|
+
getChatsBySession(token: string, messages?: boolean, contact?: boolean): Promise<GetChatsResponse>;
|
|
9
9
|
getChatById(id: number): Promise<GetChatResponse>;
|
|
10
10
|
getMessageById(id: string): Promise<GetMessageResponse>;
|
|
11
11
|
setAuth(token: string): void;
|
package/dist/whatsapp.client.js
CHANGED
|
@@ -5,8 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const api_client_1 = __importDefault(require("./api-client"));
|
|
7
7
|
class WhatsappClient extends api_client_1.default {
|
|
8
|
-
async
|
|
9
|
-
const
|
|
8
|
+
async getChatsBySession(token, messages = false, contact = false) {
|
|
9
|
+
const url = `/api/whatsapp/session/chats?messages=${messages}&contact=${contact}`;
|
|
10
|
+
const { data } = await this.httpClient.get(url, {
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${token}`,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
10
15
|
return data;
|
|
11
16
|
}
|
|
12
17
|
async getChatById(id) {
|
package/package.json
CHANGED
package/src/whatsapp.client.ts
CHANGED
|
@@ -11,10 +11,18 @@ type GetChatResponse = DataResponse<WppChatWithDetailsAndMessages>;
|
|
|
11
11
|
type GetMessageResponse = DataResponse<WppMessage>;
|
|
12
12
|
|
|
13
13
|
export default class WhatsappClient extends ApiClient {
|
|
14
|
-
public async
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
public async getChatsBySession(
|
|
15
|
+
token: string,
|
|
16
|
+
messages = false,
|
|
17
|
+
contact = false,
|
|
18
|
+
) {
|
|
19
|
+
const url = `/api/whatsapp/session/chats?messages=${messages}&contact=${contact}`;
|
|
20
|
+
|
|
21
|
+
const { data } = await this.httpClient.get<GetChatsResponse>(url, {
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: `Bearer ${token}`,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
18
26
|
|
|
19
27
|
return data;
|
|
20
28
|
}
|
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
|
}
|