@in.pulse-crm/sdk 2.3.93 → 2.4.0

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,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import ApiClient from "./api-client";
2
4
  import { File, UploadFileOptions } from "./types/files.types";
3
5
  declare class FilesClient extends ApiClient {
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  export interface UploadFileOptions {
2
4
  /**
3
5
  * Nome da instância onde o arquivo está armazenado.
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const api_client_1 = __importDefault(require("./api-client"));
7
+ const form_data_1 = __importDefault(require("form-data"));
7
8
  class WhatsappClient extends api_client_1.default {
8
9
  async getChatsBySession(token, messages = false, contact = false) {
9
10
  const url = `/api/whatsapp/session/chats?messages=${messages}&contact=${contact}`;
@@ -34,7 +35,7 @@ class WhatsappClient extends api_client_1.default {
34
35
  }
35
36
  async sendMessage(to, data) {
36
37
  const url = "/api/whatsapp/messages";
37
- const formData = new FormData();
38
+ const formData = new form_data_1.default();
38
39
  formData.append("to", to);
39
40
  data.text && formData.append("text", data.text);
40
41
  data.file && formData.append("file", data.file);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "2.3.93",
3
+ "version": "2.4.0",
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",
@@ -25,6 +25,7 @@
25
25
  "dependencies": {
26
26
  "@in.pulse-crm/utils": "^1.3.0",
27
27
  "axios": "^1.8.3",
28
+ "form-data": "^4.0.2",
28
29
  "socket.io-client": "^4.8.1",
29
30
  "tsc": "^2.0.4"
30
31
  },
@@ -7,6 +7,7 @@ import {
7
7
  WppMessage,
8
8
  WppWallet,
9
9
  } from "./types/whatsapp.types";
10
+ import FormData from "form-data";
10
11
 
11
12
  type GetChatsResponse = DataResponse<WppChatsAndMessages>;
12
13
  type GetChatResponse = DataResponse<WppChatWithDetailsAndMessages>;
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
  }