washday-sdk 1.1.10 → 1.2.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.
Files changed (114) hide show
  1. package/dist/api/attendance/get.js +4 -5
  2. package/dist/api/attendance/post.js +2 -3
  3. package/dist/api/attendance/put.js +1 -2
  4. package/dist/api/auth/post.js +13 -14
  5. package/dist/api/axiosInstance.js +47 -36
  6. package/dist/api/cashierbox/delete.js +2 -3
  7. package/dist/api/cashups/delete.js +1 -2
  8. package/dist/api/cashups/get.js +3 -4
  9. package/dist/api/cashups/post.js +1 -2
  10. package/dist/api/cashups/put.js +2 -2
  11. package/dist/api/cfdi/delete.js +1 -2
  12. package/dist/api/cfdi/get.js +6 -7
  13. package/dist/api/cfdi/post.js +2 -3
  14. package/dist/api/cfdi/put.js +2 -2
  15. package/dist/api/csv/get.js +13 -14
  16. package/dist/api/customers/delete.js +2 -3
  17. package/dist/api/customers/get.js +4 -4
  18. package/dist/api/customers/put.js +2 -3
  19. package/dist/api/discounts/get.js +7 -8
  20. package/dist/api/discounts/post.js +2 -3
  21. package/dist/api/discounts/put.js +4 -5
  22. package/dist/api/index.js +4 -1
  23. package/dist/api/inventory/get.js +1 -1
  24. package/dist/api/order/delete.js +2 -3
  25. package/dist/api/order/get.js +8 -9
  26. package/dist/api/order/post.js +7 -8
  27. package/dist/api/order/put.js +13 -14
  28. package/dist/api/outsourcedOrders/delete.js +1 -2
  29. package/dist/api/outsourcedOrders/get.js +3 -4
  30. package/dist/api/outsourcedOrders/post.js +1 -2
  31. package/dist/api/outsourcedOrders/put.js +1 -2
  32. package/dist/api/partners/delete.js +1 -2
  33. package/dist/api/partners/get.js +2 -3
  34. package/dist/api/partners/post.js +1 -2
  35. package/dist/api/partners/put.js +1 -2
  36. package/dist/api/pdf/get.js +1 -2
  37. package/dist/api/products/delete.js +2 -2
  38. package/dist/api/products/get.js +1 -2
  39. package/dist/api/products/put.js +1 -1
  40. package/dist/api/publics/get.js +1 -2
  41. package/dist/api/reports/get.js +15 -16
  42. package/dist/api/reviews/delete.js +1 -1
  43. package/dist/api/reviews/get.js +2 -3
  44. package/dist/api/reviews/post.js +1 -1
  45. package/dist/api/reviews/put.js +2 -2
  46. package/dist/api/routes/delete.js +1 -2
  47. package/dist/api/routes/get.js +5 -6
  48. package/dist/api/routes/post.js +3 -4
  49. package/dist/api/routes/put.js +3 -4
  50. package/dist/api/sections/delete.js +1 -2
  51. package/dist/api/sections/get.js +3 -4
  52. package/dist/api/sections/put.js +1 -2
  53. package/dist/api/staff/get.js +1 -1
  54. package/dist/api/stripe/post.js +1 -1
  55. package/dist/api/supplies/get.js +1 -1
  56. package/dist/api/users/post.js +1 -2
  57. package/package.json +1 -1
  58. package/src/api/attendance/get.ts +4 -4
  59. package/src/api/attendance/post.ts +2 -2
  60. package/src/api/attendance/put.ts +1 -1
  61. package/src/api/auth/post.ts +13 -13
  62. package/src/api/axiosInstance.ts +51 -40
  63. package/src/api/cashierbox/delete.ts +2 -2
  64. package/src/api/cashups/delete.ts +1 -1
  65. package/src/api/cashups/get.ts +3 -3
  66. package/src/api/cashups/post.ts +1 -1
  67. package/src/api/cashups/put.ts +2 -2
  68. package/src/api/cfdi/delete.ts +1 -1
  69. package/src/api/cfdi/get.ts +6 -6
  70. package/src/api/cfdi/post.ts +2 -2
  71. package/src/api/cfdi/put.ts +2 -2
  72. package/src/api/csv/get.ts +13 -13
  73. package/src/api/customers/delete.ts +2 -2
  74. package/src/api/customers/get.ts +4 -4
  75. package/src/api/customers/put.ts +2 -2
  76. package/src/api/discounts/get.ts +7 -7
  77. package/src/api/discounts/post.ts +2 -2
  78. package/src/api/discounts/put.ts +4 -4
  79. package/src/api/index.ts +4 -2
  80. package/src/api/inventory/get.ts +1 -1
  81. package/src/api/order/delete.ts +2 -2
  82. package/src/api/order/get.ts +8 -8
  83. package/src/api/order/post.ts +7 -7
  84. package/src/api/order/put.ts +13 -13
  85. package/src/api/outsourcedOrders/delete.ts +1 -1
  86. package/src/api/outsourcedOrders/get.ts +3 -3
  87. package/src/api/outsourcedOrders/post.ts +1 -1
  88. package/src/api/outsourcedOrders/put.ts +1 -1
  89. package/src/api/partners/delete.ts +1 -1
  90. package/src/api/partners/get.ts +2 -2
  91. package/src/api/partners/post.ts +1 -1
  92. package/src/api/partners/put.ts +1 -1
  93. package/src/api/pdf/get.ts +1 -1
  94. package/src/api/products/delete.ts +2 -2
  95. package/src/api/products/get.ts +1 -1
  96. package/src/api/products/put.ts +1 -1
  97. package/src/api/publics/get.ts +1 -1
  98. package/src/api/reports/get.ts +15 -15
  99. package/src/api/reviews/delete.ts +1 -1
  100. package/src/api/reviews/get.ts +2 -2
  101. package/src/api/reviews/post.ts +1 -1
  102. package/src/api/reviews/put.ts +2 -2
  103. package/src/api/routes/delete.ts +1 -1
  104. package/src/api/routes/get.ts +5 -5
  105. package/src/api/routes/post.ts +3 -3
  106. package/src/api/routes/put.ts +3 -3
  107. package/src/api/sections/delete.ts +1 -1
  108. package/src/api/sections/get.ts +3 -3
  109. package/src/api/sections/put.ts +1 -1
  110. package/src/api/staff/get.ts +1 -1
  111. package/src/api/stripe/post.ts +1 -1
  112. package/src/api/supplies/get.ts +1 -1
  113. package/src/api/users/post.ts +1 -1
  114. package/src/interfaces/Api.ts +3 -0
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
12
11
  const GET_SET_ORDER = 'api/v2/order';
13
12
  const GET_SET_ORDER_OLD = 'api/order';
@@ -18,7 +17,7 @@ export const updateById = function (id, data) {
18
17
  const config = {
19
18
  headers: { Authorization: `Bearer ${this.apiToken}` }
20
19
  };
21
- return yield axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
20
+ return yield this.axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
22
21
  }
23
22
  catch (error) {
24
23
  console.error('Error fetching updateById:', error);
@@ -32,7 +31,7 @@ export const updatePaymentLineById = function (orderId, id, data) {
32
31
  const config = {
33
32
  headers: { Authorization: `Bearer ${this.apiToken}` }
34
33
  };
35
- return yield axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
34
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
36
35
  }
37
36
  catch (error) {
38
37
  console.error('Error fetching updateById:', error);
@@ -46,7 +45,7 @@ export const setOrderCancelledBySequence = function (sequence, storeId, data) {
46
45
  const config = {
47
46
  headers: { Authorization: `Bearer ${this.apiToken}` }
48
47
  };
49
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
48
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
50
49
  }
51
50
  catch (error) {
52
51
  console.error('Error fetching setOrderCancelledBySequence:', error);
@@ -60,7 +59,7 @@ export const setOrderCleaningBySequence = function (sequence, storeId) {
60
59
  const config = {
61
60
  headers: { Authorization: `Bearer ${this.apiToken}` }
62
61
  };
63
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaning`, {}, config);
62
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaning`, {}, config);
64
63
  }
65
64
  catch (error) {
66
65
  console.error('Error fetching setOrderCleaningBySequence:', error);
@@ -77,7 +76,7 @@ export const setOrderCleanedBySequence = function (sequence, storeId, data, para
77
76
  const queryParams = generateQueryParamsStr([
78
77
  'markOutsourcedAsReturned',
79
78
  ], params);
80
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned?${queryParams}`, data, config);
79
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned?${queryParams}`, data, config);
81
80
  }
82
81
  catch (error) {
83
82
  console.error('Error fetching setOrderCleanedBySequence:', error);
@@ -91,7 +90,7 @@ export const setOrderCollectedBySequence = function (sequence, storeId, data) {
91
90
  const config = {
92
91
  headers: { Authorization: `Bearer ${this.apiToken}` }
93
92
  };
94
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
93
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
95
94
  }
96
95
  catch (error) {
97
96
  console.error('Error fetching setOrderCollectedBySequence:', error);
@@ -105,7 +104,7 @@ export const setOrdePickingBySequence = function (sequence, storeId, data) {
105
104
  const config = {
106
105
  headers: { Authorization: `Bearer ${this.apiToken}` }
107
106
  };
108
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
107
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
109
108
  }
110
109
  catch (error) {
111
110
  console.error('Error fetching setOrdePickingBySequence:', error);
@@ -119,7 +118,7 @@ export const setOrdeDeliveringBySequence = function (sequence, storeId, data) {
119
118
  const config = {
120
119
  headers: { Authorization: `Bearer ${this.apiToken}` }
121
120
  };
122
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
121
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
123
122
  }
124
123
  catch (error) {
125
124
  console.error('Error fetching setOrdeDeliveringBySequence:', error);
@@ -133,7 +132,7 @@ export const setOrdeDeliveredBySequence = function (sequence, storeId, data) {
133
132
  const config = {
134
133
  headers: { Authorization: `Bearer ${this.apiToken}` }
135
134
  };
136
- return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
135
+ return yield this.axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
137
136
  }
138
137
  catch (error) {
139
138
  console.error('Error fetching setOrdeDeliveredBySequence:', error);
@@ -147,7 +146,7 @@ export const setOrderAcceptedBySequence = function (sequence, storeId) {
147
146
  const config = {
148
147
  headers: { Authorization: `Bearer ${this.apiToken}` }
149
148
  };
150
- return yield axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/accepted`, {}, config);
149
+ return yield this.axiosInstance.put(`${GET_SET_ORDER}/${sequence}/${storeId}/accepted`, {}, config);
151
150
  }
152
151
  catch (error) {
153
152
  console.error('Error fetching setOrderAcceptedBySequence:', error);
@@ -161,7 +160,7 @@ export const bulkCancel = function (storeId, body) {
161
160
  const config = {
162
161
  headers: { Authorization: `Bearer ${this.apiToken}` }
163
162
  };
164
- return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCancel`, body, config);
163
+ return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCancel`, body, config);
165
164
  }
166
165
  catch (error) {
167
166
  console.error('Error fetching bulkCancel:', error);
@@ -178,7 +177,7 @@ export const bulkClean = function (storeId, body, params) {
178
177
  const queryParams = generateQueryParamsStr([
179
178
  'markOutsourcedAsReturned',
180
179
  ], params);
181
- return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkClean?${queryParams}`, body, config);
180
+ return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkClean?${queryParams}`, body, config);
182
181
  }
183
182
  catch (error) {
184
183
  console.error('Error fetching bulkClean:', error);
@@ -192,7 +191,7 @@ export const bulkCollect = function (storeId, body) {
192
191
  const config = {
193
192
  headers: { Authorization: `Bearer ${this.apiToken}` }
194
193
  };
195
- return yield axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCollect`, body, config);
194
+ return yield this.axiosInstance.put(`${GET_SET_ORDER}/${storeId}/bulkCollect`, body, config);
196
195
  }
197
196
  catch (error) {
198
197
  console.error('Error fetching bulkCollect:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_OUTSOURCED_ORDERS = 'api/outsourced-orders';
12
11
  export const deleteOutsourcedOrderById = function (id) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const deleteOutsourcedOrderById = function (id) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.delete(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
17
+ return yield this.axiosInstance.delete(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching deleteOutsourcedOrderById:', error);
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
- import axiosInstance from "../axiosInstance";
12
11
  const GET_OUTSOURCED_ORDERS_BY_STORE = 'api/store/:storeId/outsourced-orders';
13
12
  const GET_OUTSOURCED_ORDERS_BY_ORDER = 'api/orders/:orderId/outsourced-orders';
14
13
  const GET_SET_OUTSOURCED_ORDERS = 'api/outsourced-orders';
@@ -18,7 +17,7 @@ export const getOutsourcedOrdersByOrder = function (orderId) {
18
17
  const config = {
19
18
  headers: { Authorization: `Bearer ${this.apiToken}` }
20
19
  };
21
- return yield axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_ORDER.replace(':orderId', orderId)}`, config);
20
+ return yield this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_ORDER.replace(':orderId', orderId)}`, config);
22
21
  }
23
22
  catch (error) {
24
23
  console.error('Error fetching getOutsourcedOrdersByOrder:', error);
@@ -38,7 +37,7 @@ export const getOutsourcedOrdersByStore = function (params) {
38
37
  'limit',
39
38
  'sequence'
40
39
  ], params);
41
- return yield axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
40
+ return yield this.axiosInstance.get(`${GET_OUTSOURCED_ORDERS_BY_STORE.replace(':storeId', params.storeId)}?${queryParams}`, config);
42
41
  }
43
42
  catch (error) {
44
43
  console.error('Error fetching getOutsourcedOrdersByStore:', error);
@@ -52,7 +51,7 @@ export const getOutsourcedOrderById = function (id) {
52
51
  const config = {
53
52
  headers: { Authorization: `Bearer ${this.apiToken}` }
54
53
  };
55
- return yield axiosInstance.get(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
54
+ return yield this.axiosInstance.get(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, config);
56
55
  }
57
56
  catch (error) {
58
57
  console.error('Error fetching getOutsourcedOrderById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_OUTSOURCED_ORDERS = 'api/outsourced-orders';
12
11
  export const createOutsourcedOrder = function (data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const createOutsourcedOrder = function (data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.post(GET_SET_OUTSOURCED_ORDERS, data, config);
17
+ return yield this.axiosInstance.post(GET_SET_OUTSOURCED_ORDERS, data, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching createOutsourcedOrder:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_OUTSOURCED_ORDERS = 'api/outsourced-orders';
12
11
  export const updateOutsourcedOrderById = function (id, data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const updateOutsourcedOrderById = function (id, data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.put(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, data, config);
17
+ return yield this.axiosInstance.put(`${GET_SET_OUTSOURCED_ORDERS}/${id}`, data, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching updateOutsourcedOrderById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_PARTNERS = 'api/partners';
12
11
  export const deletePartnerById = function (id) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const deletePartnerById = function (id) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.delete(`${GET_SET_PARTNERS}/${id}`, config);
17
+ return yield this.axiosInstance.delete(`${GET_SET_PARTNERS}/${id}`, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching deletePartnerById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_PARTNERS = 'api/partners';
12
11
  export const getPartners = function () {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -16,7 +15,7 @@ export const getPartners = function () {
16
15
  const config = {
17
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
18
17
  };
19
- return yield axiosInstance.get(`${GET_SET_PARTNERS}`, config);
18
+ return yield this.axiosInstance.get(`${GET_SET_PARTNERS}`, config);
20
19
  }
21
20
  catch (error) {
22
21
  console.error('Error fetching getPartners:', error);
@@ -30,7 +29,7 @@ export const getPartnerById = function (id) {
30
29
  const config = {
31
30
  headers: { Authorization: `Bearer ${this.apiToken}` }
32
31
  };
33
- return yield axiosInstance.get(`${GET_SET_PARTNERS}/${id}`, config);
32
+ return yield this.axiosInstance.get(`${GET_SET_PARTNERS}/${id}`, config);
34
33
  }
35
34
  catch (error) {
36
35
  console.error('Error fetching getPartnerById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_PARTNERS = 'api/partners';
12
11
  export const createPartner = function (data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const createPartner = function (data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.post(GET_SET_PARTNERS, data, config);
17
+ return yield this.axiosInstance.post(GET_SET_PARTNERS, data, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching createPartner:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_PARTNERS = 'api/partners';
12
11
  export const updatePartnerById = function (id, data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const updatePartnerById = function (id, data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.put(`${GET_SET_PARTNERS}/${id}`, data, config);
17
+ return yield this.axiosInstance.put(`${GET_SET_PARTNERS}/${id}`, data, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching updatePartnerById:', error);
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
- import axiosInstance from "../axiosInstance";
12
11
  const GENERATE_EXPORT = 'api/export';
13
12
  const GET_SET_REPORTS = 'api/reports';
14
13
  export const exportUnpaidOrdersReportPDF = function (storeId, params) {
@@ -24,7 +23,7 @@ export const exportUnpaidOrdersReportPDF = function (storeId, params) {
24
23
  // responseType: 'blob', // Important for handling the PDF blob response
25
24
  };
26
25
  const queryParams = generateQueryParamsStr(['store', 'fromDate', 'toDate', 'timezone', 'customerName'], params);
27
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export/pdf?${queryParams}`, config);
26
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export/pdf?${queryParams}`, config);
28
27
  // // Create a link element, trigger a download
29
28
  // const url = window.URL.createObjectURL(new Blob([response.data]));
30
29
  // const link = document.createElement('a');
@@ -16,7 +16,7 @@ export const deleteById = function (id) {
16
16
  const config = {
17
17
  headers: { Authorization: `Bearer ${this.apiToken}` }
18
18
  };
19
- return yield axiosInstance.delete(`${GET_SET_PRODUCTS}/${id}`, config);
19
+ return yield this.axiosInstance.delete(`${GET_SET_PRODUCTS}/${id}`, config);
20
20
  }
21
21
  catch (error) {
22
22
  console.error('Error fetching deleteById:', error);
@@ -30,7 +30,7 @@ export const deleteProductSupplyById = function (id, productSupplyId) {
30
30
  const config = {
31
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
32
32
  };
33
- return yield axiosInstance.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
33
+ return yield this.axiosInstance.delete(`${GET_SET_PRODUCTS_SUPPLY}/${id}/${productSupplyId}`, config);
34
34
  }
35
35
  catch (error) {
36
36
  console.error('Error fetching deleteProductSupplyById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_PRODUCTS = 'api/product';
12
11
  export const getById = function (id) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const getById = function (id) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.get(`${GET_SET_PRODUCTS}/${id}`, config);
17
+ return yield this.axiosInstance.get(`${GET_SET_PRODUCTS}/${id}`, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching getById:', error);
@@ -30,7 +30,7 @@ export const updateById = function (id, data) {
30
30
  const config = {
31
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
32
32
  };
33
- return yield axiosInstance.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
33
+ return yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${id}`, data, config);
34
34
  }
35
35
  catch (error) {
36
36
  console.error('Error fetching updateById:', error);
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_PUBLIC = '/api/public';
12
11
  const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
13
12
  export const getOrderPublicReceipt = function (orderPublicToken) {
@@ -16,7 +15,7 @@ export const getOrderPublicReceipt = function (orderPublicToken) {
16
15
  const config = {
17
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
18
17
  };
19
- return yield axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderPublicToken}/receipt`, config);
18
+ return yield this.axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderPublicToken}/receipt`, config);
20
19
  }
21
20
  catch (error) {
22
21
  console.error('Error fetching getOrderPublicReceipt:', error);
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
- import axiosInstance from "../axiosInstance";
12
11
  const GET_SET_REPORTS = 'api/reports';
13
12
  const GET_SET_STATISTICS = 'api/statistics';
14
13
  export const getCleanedOrdersReport = function (storeId, params) {
@@ -25,7 +24,7 @@ export const getCleanedOrdersReport = function (storeId, params) {
25
24
  'timezone',
26
25
  'includeGraph',
27
26
  ], params);
28
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders?${queryParams}`, config);
27
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders?${queryParams}`, config);
29
28
  }
30
29
  catch (error) {
31
30
  console.error('Error fetching getCleanedOrdersReport:', error);
@@ -44,7 +43,7 @@ export const getCleanedOrdersGraphDataReport = function (storeId, params) {
44
43
  'fromDate',
45
44
  'timezone',
46
45
  ], params);
47
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders-graph?${queryParams}`, config);
46
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders-graph?${queryParams}`, config);
48
47
  }
49
48
  catch (error) {
50
49
  console.error('Error fetching getCleanedOrdersGraphDataReport :', error);
@@ -64,7 +63,7 @@ export const getSalesReport = function (storeId, params) {
64
63
  'timezone',
65
64
  'type',
66
65
  ], params);
67
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/sales?${queryParams}`, config);
66
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/sales?${queryParams}`, config);
68
67
  }
69
68
  catch (error) {
70
69
  console.error('Error fetching getSalesReport:', error);
@@ -83,7 +82,7 @@ export const getCustomersReport = function (storeId, params) {
83
82
  'fromDate',
84
83
  'toDate',
85
84
  ], params);
86
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/customers?${queryParams}`, config);
85
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/customers?${queryParams}`, config);
87
86
  }
88
87
  catch (error) {
89
88
  console.error('Error fetching getCustomersReport:', error);
@@ -102,7 +101,7 @@ export const getSuppliesReport = function (storeId, params) {
102
101
  'fromDate',
103
102
  'toDate',
104
103
  ], params);
105
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/supplies?${queryParams}`, config);
104
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/supplies?${queryParams}`, config);
106
105
  }
107
106
  catch (error) {
108
107
  console.error('Error fetching getSuppliesReport:', error);
@@ -117,7 +116,7 @@ export const getDiscountCodesReport = function (storeId, params) {
117
116
  headers: { Authorization: `Bearer ${this.apiToken}` }
118
117
  };
119
118
  const queryParams = generateQueryParamsStr([], params);
120
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/discountCodes?${queryParams}`, config);
119
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/discountCodes?${queryParams}`, config);
121
120
  }
122
121
  catch (error) {
123
122
  console.error('Error fetching getDiscountCodesReport:', error);
@@ -136,7 +135,7 @@ export const getStaffReport = function (storeId, params) {
136
135
  'fromDate',
137
136
  'toDate',
138
137
  ], params);
139
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/staff?${queryParams}`, config);
138
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/staff?${queryParams}`, config);
140
139
  }
141
140
  catch (error) {
142
141
  console.error('Error fetching getStaffReport:', error);
@@ -155,7 +154,7 @@ export const getProductSalesReport = function (storeId, params) {
155
154
  'fromDate',
156
155
  'timezone',
157
156
  ], params);
158
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales?${queryParams}`, config);
157
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales?${queryParams}`, config);
159
158
  }
160
159
  catch (error) {
161
160
  console.error('Error fetching getProductSalesReport:', error);
@@ -176,7 +175,7 @@ export const getPaymentLinesReport = function (storeId, params) {
176
175
  'limit',
177
176
  'timezone',
178
177
  ], params);
179
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/paymentLines?${queryParams}`, config);
178
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/paymentLines?${queryParams}`, config);
180
179
  }
181
180
  catch (error) {
182
181
  console.error('Error fetching getPaymentLinesReport:', error);
@@ -198,7 +197,7 @@ export const getUnpaidOrdersReport = function (storeId, params) {
198
197
  'timezone',
199
198
  'customerName'
200
199
  ], params);
201
- return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders?${queryParams}`, config);
200
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders?${queryParams}`, config);
202
201
  }
203
202
  catch (error) {
204
203
  console.error('Error fetching getUnpaidOrdersReport:', error);
@@ -217,7 +216,7 @@ export const getAnnualSalesStatistics = function (storeId, params) {
217
216
  'fromDate',
218
217
  'timezone',
219
218
  ], params);
220
- return yield axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/annual?${queryParams}`, config);
219
+ return yield this.axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/annual?${queryParams}`, config);
221
220
  }
222
221
  catch (error) {
223
222
  console.error('Error fetching getAnnualSalesStatistics :', error);
@@ -236,7 +235,7 @@ export const getPaymentMethodStatistics = function (storeId, params) {
236
235
  'fromDate',
237
236
  'timezone',
238
237
  ], params);
239
- return yield axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/ordersPaymentMethod?${queryParams}`, config);
238
+ return yield this.axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/ordersPaymentMethod?${queryParams}`, config);
240
239
  }
241
240
  catch (error) {
242
241
  console.error('Error fetching getPaymentMethodStatistics :', error);
@@ -255,7 +254,7 @@ export const getProductsStatistics = function (storeId, params) {
255
254
  'fromDate',
256
255
  'timezone',
257
256
  ], params);
258
- return yield axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/ordersProduct?${queryParams}`, config);
257
+ return yield this.axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/ordersProduct?${queryParams}`, config);
259
258
  }
260
259
  catch (error) {
261
260
  console.error('Error fetching getProductsStatistics :', error);
@@ -274,7 +273,7 @@ export const getMonthSalesStatistics = function (storeId, params) {
274
273
  'fromDate',
275
274
  'timezone',
276
275
  ], params);
277
- return yield axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/month?${queryParams}`, config);
276
+ return yield this.axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/month?${queryParams}`, config);
278
277
  }
279
278
  catch (error) {
280
279
  console.error('Error fetching getMonthSalesStatistics :', error);
@@ -293,7 +292,7 @@ export const getPopularDaysStatistics = function (storeId, params) {
293
292
  'fromDate',
294
293
  'timezone',
295
294
  ], params);
296
- return yield axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/popularDays?${queryParams}`, config);
295
+ return yield this.axiosInstance.get(`${GET_SET_STATISTICS}/${storeId}/popularDays?${queryParams}`, config);
297
296
  }
298
297
  catch (error) {
299
298
  console.error('Error fetching getPopularDaysStatistics :', error);
@@ -7,7 +7,7 @@
7
7
  // const config = {
8
8
  // headers: { Authorization: `Bearer ${this.apiToken}` }
9
9
  // };
10
- // return await axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
10
+ // return await this.axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
11
11
  // } catch (error) {
12
12
  // console.error('Error fetching deleteById:', error);
13
13
  // throw error;
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
- import axiosInstance from "../axiosInstance";
12
11
  const GET_SET_REVIEWS = 'api/review';
13
12
  export const getList = function (storeId, params) {
14
13
  return __awaiter(this, void 0, void 0, function* () {
@@ -17,7 +16,7 @@ export const getList = function (storeId, params) {
17
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
18
17
  };
19
18
  const queryParams = generateQueryParamsStr(['sortBy'], params);
20
- return yield axiosInstance.get(`${GET_SET_REVIEWS}/${storeId}?${queryParams}`, config);
19
+ return yield this.axiosInstance.get(`${GET_SET_REVIEWS}/${storeId}?${queryParams}`, config);
21
20
  }
22
21
  catch (error) {
23
22
  console.error('Error fetching:', error);
@@ -31,7 +30,7 @@ export const requestStoreReviewByCustomerId = function (storeId, customerId) {
31
30
  const config = {
32
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
33
32
  };
34
- return yield axiosInstance.get(`${GET_SET_REVIEWS}/request/${storeId}/${customerId}`, config);
33
+ return yield this.axiosInstance.get(`${GET_SET_REVIEWS}/request/${storeId}/${customerId}`, config);
35
34
  }
36
35
  catch (error) {
37
36
  console.error('Error fetching:', error);
@@ -12,7 +12,7 @@
12
12
  // const config = {
13
13
  // headers: { Authorization: `Bearer ${this.apiToken}` }
14
14
  // };
15
- // return await axiosInstance.post(`${GET_SET_ORDER_PAYMENTLINES(id)}`, data, config);
15
+ // return await this.axiosInstance.post(`${GET_SET_ORDER_PAYMENTLINES(id)}`, data, config);
16
16
  // } catch (error) {
17
17
  // console.error('Error fetching create:', error);
18
18
  // throw error;
@@ -30,7 +30,7 @@
30
30
  // const config = {
31
31
  // headers: { Authorization: `Bearer ${this.apiToken}` }
32
32
  // };
33
- // return await axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
33
+ // return await this.axiosInstance.put(`${GET_SET_ORDER}/${id}`, data, config);
34
34
  // } catch (error) {
35
35
  // console.error('Error fetching updateById:', error);
36
36
  // throw error;
@@ -44,7 +44,7 @@
44
44
  // const config = {
45
45
  // headers: { Authorization: `Bearer ${this.apiToken}` }
46
46
  // };
47
- // return await axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
47
+ // return await this.axiosInstance.put(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, data, config);
48
48
  // } catch (error) {
49
49
  // console.error('Error fetching updateById:', error);
50
50
  // throw error;
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import axiosInstance from "../axiosInstance";
11
10
  const GET_SET_ROUTES = 'api/routes';
12
11
  export const deleteRouteById = function (id) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const deleteRouteById = function (id) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.delete(`${GET_SET_ROUTES}/${id}`, config);
17
+ return yield this.axiosInstance.delete(`${GET_SET_ROUTES}/${id}`, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching deleteRouteById:', error);
@@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
- import axiosInstance from "../axiosInstance";
12
11
  const GET_SET_ROUTES_ORDERS = 'api/routes/orders';
13
12
  const GET_STORE_ROUTES = 'api/storeRoutes';
14
13
  const GET_STORE_ROUTES_BY_ID = 'api/stores/:id/routes';
@@ -24,7 +23,7 @@ export const getOrdersForRoute = function (params) {
24
23
  'store',
25
24
  'routeDate'
26
25
  ], params);
27
- return yield axiosInstance.get(`${GET_SET_ROUTES_ORDERS}?${queryParams}`, config);
26
+ return yield this.axiosInstance.get(`${GET_SET_ROUTES_ORDERS}?${queryParams}`, config);
28
27
  }
29
28
  catch (error) {
30
29
  console.error('Error fetching getOrdersForRoute:', error);
@@ -39,7 +38,7 @@ export const getStoreRoutesList = function (storeId) {
39
38
  const config = {
40
39
  headers: { Authorization: `Bearer ${this.apiToken}` }
41
40
  };
42
- return yield axiosInstance.get(`${GET_STORE_ROUTES}/${storeId}`, config);
41
+ return yield this.axiosInstance.get(`${GET_STORE_ROUTES}/${storeId}`, config);
43
42
  }
44
43
  catch (error) {
45
44
  console.error('Error fetching getStoreRoutesList:', error);
@@ -54,7 +53,7 @@ export const getRoutesByStore = function (storeId) {
54
53
  const config = {
55
54
  headers: { Authorization: `Bearer ${this.apiToken}` }
56
55
  };
57
- return yield axiosInstance.get(`${GET_STORE_ROUTES_BY_ID.replace(':id', storeId)}`, config);
56
+ return yield this.axiosInstance.get(`${GET_STORE_ROUTES_BY_ID.replace(':id', storeId)}`, config);
58
57
  }
59
58
  catch (error) {
60
59
  console.error('Error fetching getRoutesByStore:', error);
@@ -68,7 +67,7 @@ export const getRouteByIdV2 = function (routeId) {
68
67
  const config = {
69
68
  headers: { Authorization: `Bearer ${this.apiToken}` }
70
69
  };
71
- return yield axiosInstance.get(`${GET_ROUTE}/${routeId}`, config);
70
+ return yield this.axiosInstance.get(`${GET_ROUTE}/${routeId}`, config);
72
71
  }
73
72
  catch (error) {
74
73
  console.error('Error fetching getRouteByIdV2:', error);
@@ -85,7 +84,7 @@ export const getRoutesByDriver = function (query) {
85
84
  const queryParams = generateQueryParamsStr([
86
85
  'status',
87
86
  ], query);
88
- return yield axiosInstance.get(`${GET_ROUTE}?${queryParams}`, config);
87
+ return yield this.axiosInstance.get(`${GET_ROUTE}?${queryParams}`, config);
89
88
  }
90
89
  catch (error) {
91
90
  console.error('Error fetching getRoutesByDriver:', error);