@in.pulse-crm/sdk 2.4.0 → 2.4.2

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.
@@ -42,8 +42,8 @@ class CustomersClient extends api_client_1.default {
42
42
  */
43
43
  async getCustomers(filters) {
44
44
  let baseUrl = `/api/customers`;
45
- const params = new URLSearchParams(filters);
46
- if (params.toString()) {
45
+ if (filters) {
46
+ const params = new URLSearchParams(filters);
47
47
  baseUrl += `?${params.toString()}`;
48
48
  }
49
49
  const response = await this.httpClient.get(baseUrl);
@@ -54,7 +54,7 @@ export interface WppWallet {
54
54
  id: number;
55
55
  name: string;
56
56
  }
57
- export type WppMessageStatus = "PENDING" | "SENT" | "RECEIVED" | "READ" | "DOWNLOADED" | "ERROR";
57
+ export type WppMessageStatus = "PENDING" | "SENT" | "RECEIVED" | "READ" | "DOWNLOADED" | "ERROR" | "REVOKED";
58
58
  export declare enum WppChatType {
59
59
  RECEPTIVE = "RECEPTIVE",
60
60
  ACTIVE = "ACTIVE"
@@ -15,8 +15,8 @@ class UsersClient extends api_client_1.default {
15
15
  */
16
16
  async getUsers(filters) {
17
17
  let baseUrl = `/api/users`;
18
- const params = new URLSearchParams(filters);
19
- if (params.toString()) {
18
+ if (filters) {
19
+ const params = new URLSearchParams(filters);
20
20
  baseUrl += `?${params.toString()}`;
21
21
  }
22
22
  const response = await this.httpClient.get(baseUrl);
@@ -46,7 +46,11 @@ class WhatsappClient extends api_client_1.default {
46
46
  data.sendAsDocument && formData.append("sendAsDocument", "true");
47
47
  data.sendAsChatOwner &&
48
48
  formData.append("sendAsChatOwner", String(data.sendAsChatOwner));
49
- const { data: res } = await this.httpClient.post(url, formData);
49
+ const { data: res } = await this.httpClient.post(url, formData, {
50
+ headers: {
51
+ "Content-Type": "multipart/form-data",
52
+ },
53
+ });
50
54
  return res.data;
51
55
  }
52
56
  setAuth(token) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
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",
@@ -53,9 +53,9 @@ class CustomersClient extends ApiClient {
53
53
  */
54
54
  public async getCustomers(filters?: RequestFilters<Customer>) {
55
55
  let baseUrl = `/api/customers`;
56
- const params = new URLSearchParams(filters);
57
56
 
58
- if (params.toString()) {
57
+ if (filters) {
58
+ const params = new URLSearchParams(filters);
59
59
  baseUrl += `?${params.toString()}`;
60
60
  }
61
61
 
@@ -67,7 +67,8 @@ export type WppMessageStatus =
67
67
  | "RECEIVED"
68
68
  | "READ"
69
69
  | "DOWNLOADED"
70
- | "ERROR";
70
+ | "ERROR"
71
+ | "REVOKED";
71
72
 
72
73
  export enum WppChatType {
73
74
  RECEPTIVE = "RECEPTIVE",
@@ -104,4 +105,4 @@ export interface SendMessageData {
104
105
  text?: string | null;
105
106
  file?: File;
106
107
  fileId?: number;
107
- }
108
+ }
@@ -14,9 +14,9 @@ export default class UsersClient extends ApiClient {
14
14
  */
15
15
  public async getUsers(filters?: RequestFilters<User>) {
16
16
  let baseUrl = `/api/users`;
17
- const params = new URLSearchParams(filters);
18
-
19
- if (params.toString()) {
17
+
18
+ if (filters) {
19
+ const params = new URLSearchParams(filters);
20
20
  baseUrl += `?${params.toString()}`;
21
21
  }
22
22
 
@@ -81,7 +81,11 @@ export default class WhatsappClient extends ApiClient {
81
81
 
82
82
  const { data: res } = await this.httpClient.post<
83
83
  DataResponse<WppMessage>
84
- >(url, formData);
84
+ >(url, formData, {
85
+ headers: {
86
+ "Content-Type": "multipart/form-data",
87
+ },
88
+ });
85
89
 
86
90
  return res.data;
87
91
  }