washday-sdk 1.1.10 → 1.2.1

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 (162) 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/cashierbox/get.js +3 -4
  8. package/dist/api/cashierbox/post.js +2 -3
  9. package/dist/api/cashierbox/put.js +2 -3
  10. package/dist/api/cashups/delete.js +1 -2
  11. package/dist/api/cashups/get.js +3 -4
  12. package/dist/api/cashups/post.js +1 -2
  13. package/dist/api/cashups/put.js +2 -2
  14. package/dist/api/cfdi/delete.js +1 -2
  15. package/dist/api/cfdi/get.js +6 -7
  16. package/dist/api/cfdi/post.js +2 -3
  17. package/dist/api/cfdi/put.js +2 -2
  18. package/dist/api/companies/get.js +1 -2
  19. package/dist/api/companies/post.js +2 -3
  20. package/dist/api/companies/put.js +3 -4
  21. package/dist/api/countries/get.js +1 -2
  22. package/dist/api/csv/get.js +13 -14
  23. package/dist/api/customers/delete.js +2 -3
  24. package/dist/api/customers/get.js +6 -7
  25. package/dist/api/customers/post.js +2 -3
  26. package/dist/api/customers/put.js +3 -4
  27. package/dist/api/discounts/get.js +7 -8
  28. package/dist/api/discounts/post.js +2 -3
  29. package/dist/api/discounts/put.js +4 -5
  30. package/dist/api/index.js +4 -1
  31. package/dist/api/inventory/delete.js +1 -2
  32. package/dist/api/inventory/get.js +3 -4
  33. package/dist/api/inventory/post.js +1 -2
  34. package/dist/api/inventory/put.js +2 -3
  35. package/dist/api/order/delete.js +2 -3
  36. package/dist/api/order/get.js +8 -9
  37. package/dist/api/order/post.js +7 -8
  38. package/dist/api/order/put.js +13 -14
  39. package/dist/api/outsourcedOrders/delete.js +1 -2
  40. package/dist/api/outsourcedOrders/get.js +3 -4
  41. package/dist/api/outsourcedOrders/post.js +1 -2
  42. package/dist/api/outsourcedOrders/put.js +1 -2
  43. package/dist/api/partners/delete.js +1 -2
  44. package/dist/api/partners/get.js +2 -3
  45. package/dist/api/partners/post.js +1 -2
  46. package/dist/api/partners/put.js +1 -2
  47. package/dist/api/pdf/get.js +1 -2
  48. package/dist/api/products/delete.js +3 -4
  49. package/dist/api/products/get.js +1 -2
  50. package/dist/api/products/post.js +4 -5
  51. package/dist/api/products/put.js +3 -4
  52. package/dist/api/publics/get.js +1 -2
  53. package/dist/api/reports/get.js +15 -16
  54. package/dist/api/reviews/delete.js +1 -1
  55. package/dist/api/reviews/get.js +2 -3
  56. package/dist/api/reviews/post.js +1 -1
  57. package/dist/api/reviews/put.js +2 -2
  58. package/dist/api/routes/delete.js +1 -2
  59. package/dist/api/routes/get.js +5 -6
  60. package/dist/api/routes/post.js +3 -4
  61. package/dist/api/routes/put.js +3 -4
  62. package/dist/api/sections/delete.js +1 -2
  63. package/dist/api/sections/get.js +3 -4
  64. package/dist/api/sections/post.js +1 -2
  65. package/dist/api/sections/put.js +1 -2
  66. package/dist/api/staff/delete.js +1 -2
  67. package/dist/api/staff/get.js +2 -3
  68. package/dist/api/staff/post.js +1 -2
  69. package/dist/api/staff/put.js +1 -2
  70. package/dist/api/stores/get.js +6 -7
  71. package/dist/api/stores/post.js +3 -4
  72. package/dist/api/stores/put.js +2 -3
  73. package/dist/api/stripe/post.js +4 -5
  74. package/dist/api/supplies/delete.js +1 -2
  75. package/dist/api/supplies/get.js +3 -4
  76. package/dist/api/supplies/post.js +1 -2
  77. package/dist/api/supplies/put.js +2 -3
  78. package/dist/api/users/delete.js +1 -2
  79. package/dist/api/users/post.js +1 -2
  80. package/dist/api/users/put.js +1 -2
  81. package/package.json +1 -1
  82. package/src/api/attendance/get.ts +4 -4
  83. package/src/api/attendance/post.ts +2 -2
  84. package/src/api/attendance/put.ts +1 -1
  85. package/src/api/auth/post.ts +13 -13
  86. package/src/api/axiosInstance.ts +51 -40
  87. package/src/api/cashierbox/delete.ts +2 -2
  88. package/src/api/cashierbox/get.ts +3 -3
  89. package/src/api/cashierbox/post.ts +2 -2
  90. package/src/api/cashierbox/put.ts +2 -2
  91. package/src/api/cashups/delete.ts +1 -1
  92. package/src/api/cashups/get.ts +3 -3
  93. package/src/api/cashups/post.ts +1 -1
  94. package/src/api/cashups/put.ts +2 -2
  95. package/src/api/cfdi/delete.ts +1 -1
  96. package/src/api/cfdi/get.ts +6 -6
  97. package/src/api/cfdi/post.ts +2 -2
  98. package/src/api/cfdi/put.ts +2 -2
  99. package/src/api/companies/get.ts +1 -1
  100. package/src/api/companies/post.ts +2 -2
  101. package/src/api/companies/put.ts +3 -3
  102. package/src/api/countries/get.ts +1 -1
  103. package/src/api/csv/get.ts +13 -13
  104. package/src/api/customers/delete.ts +2 -2
  105. package/src/api/customers/get.ts +6 -6
  106. package/src/api/customers/post.ts +2 -2
  107. package/src/api/customers/put.ts +3 -3
  108. package/src/api/discounts/get.ts +7 -7
  109. package/src/api/discounts/post.ts +2 -2
  110. package/src/api/discounts/put.ts +4 -4
  111. package/src/api/index.ts +4 -2
  112. package/src/api/inventory/delete.ts +1 -1
  113. package/src/api/inventory/get.ts +3 -3
  114. package/src/api/inventory/post.ts +1 -1
  115. package/src/api/inventory/put.ts +2 -2
  116. package/src/api/order/delete.ts +2 -2
  117. package/src/api/order/get.ts +8 -8
  118. package/src/api/order/post.ts +7 -7
  119. package/src/api/order/put.ts +13 -13
  120. package/src/api/outsourcedOrders/delete.ts +1 -1
  121. package/src/api/outsourcedOrders/get.ts +3 -3
  122. package/src/api/outsourcedOrders/post.ts +1 -1
  123. package/src/api/outsourcedOrders/put.ts +1 -1
  124. package/src/api/partners/delete.ts +1 -1
  125. package/src/api/partners/get.ts +2 -2
  126. package/src/api/partners/post.ts +1 -1
  127. package/src/api/partners/put.ts +1 -1
  128. package/src/api/pdf/get.ts +1 -1
  129. package/src/api/products/delete.ts +3 -3
  130. package/src/api/products/get.ts +1 -1
  131. package/src/api/products/post.ts +4 -4
  132. package/src/api/products/put.ts +3 -3
  133. package/src/api/publics/get.ts +1 -1
  134. package/src/api/reports/get.ts +15 -15
  135. package/src/api/reviews/delete.ts +1 -1
  136. package/src/api/reviews/get.ts +2 -2
  137. package/src/api/reviews/post.ts +1 -1
  138. package/src/api/reviews/put.ts +2 -2
  139. package/src/api/routes/delete.ts +1 -1
  140. package/src/api/routes/get.ts +5 -5
  141. package/src/api/routes/post.ts +3 -3
  142. package/src/api/routes/put.ts +3 -3
  143. package/src/api/sections/delete.ts +1 -1
  144. package/src/api/sections/get.ts +3 -3
  145. package/src/api/sections/post.ts +1 -1
  146. package/src/api/sections/put.ts +1 -1
  147. package/src/api/staff/delete.ts +1 -1
  148. package/src/api/staff/get.ts +2 -2
  149. package/src/api/staff/post.ts +1 -1
  150. package/src/api/staff/put.ts +1 -1
  151. package/src/api/stores/get.ts +6 -6
  152. package/src/api/stores/post.ts +3 -3
  153. package/src/api/stores/put.ts +2 -2
  154. package/src/api/stripe/post.ts +4 -4
  155. package/src/api/supplies/delete.ts +1 -1
  156. package/src/api/supplies/get.ts +3 -3
  157. package/src/api/supplies/post.ts +1 -1
  158. package/src/api/supplies/put.ts +2 -2
  159. package/src/api/users/delete.ts +1 -1
  160. package/src/api/users/post.ts +1 -1
  161. package/src/api/users/put.ts +1 -1
  162. package/src/interfaces/Api.ts +3 -0
@@ -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);
@@ -18,7 +18,6 @@ var __rest = (this && this.__rest) || function (s, e) {
18
18
  }
19
19
  return t;
20
20
  };
21
- import axiosInstance from "../axiosInstance";
22
21
  const GET_SET_ROUTES = 'api/routes';
23
22
  const GET_STORE_ROUTES_BY_ID = 'api/stores/:id/routes';
24
23
  //@deprecated
@@ -28,7 +27,7 @@ export const createRoute = function (data) {
28
27
  const config = {
29
28
  headers: { Authorization: `Bearer ${this.apiToken}` }
30
29
  };
31
- return yield axiosInstance.post(GET_SET_ROUTES, data, config);
30
+ return yield this.axiosInstance.post(GET_SET_ROUTES, data, config);
32
31
  }
33
32
  catch (error) {
34
33
  console.error('Error fetching createRoute:', error);
@@ -43,7 +42,7 @@ export const createRouteV2 = function (data) {
43
42
  headers: { Authorization: `Bearer ${this.apiToken}` }
44
43
  };
45
44
  const { storeId } = data, rest = __rest(data, ["storeId"]);
46
- return yield axiosInstance.post(GET_STORE_ROUTES_BY_ID.replace(':id', storeId), rest, config);
45
+ return yield this.axiosInstance.post(GET_STORE_ROUTES_BY_ID.replace(':id', storeId), rest, config);
47
46
  }
48
47
  catch (error) {
49
48
  console.error('Error fetching createRouteV2:', error);
@@ -57,7 +56,7 @@ export const startRoute = function (routeId) {
57
56
  const config = {
58
57
  headers: { Authorization: `Bearer ${this.apiToken}` }
59
58
  };
60
- return yield axiosInstance.post(`${GET_SET_ROUTES}/${routeId}/start`, {}, config);
59
+ return yield this.axiosInstance.post(`${GET_SET_ROUTES}/${routeId}/start`, {}, config);
61
60
  }
62
61
  catch (error) {
63
62
  console.error('Error fetching startRoute:', 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_STORE_ROUTES = 'api/storeRoutes';
12
11
  const GET_ROUTE = 'api/routes';
13
12
  export const closeStoreRoutes = function (storeId, data) {
@@ -16,7 +15,7 @@ export const closeStoreRoutes = function (storeId, data) {
16
15
  const config = {
17
16
  headers: { Authorization: `Bearer ${this.apiToken}` }
18
17
  };
19
- return yield axiosInstance.put(`${GET_STORE_ROUTES}/${storeId}/close`, data, config);
18
+ return yield this.axiosInstance.put(`${GET_STORE_ROUTES}/${storeId}/close`, data, config);
20
19
  }
21
20
  catch (error) {
22
21
  console.error('Error fetching closeStoreRoutes:', error);
@@ -30,7 +29,7 @@ export const closeRouteById = function (routeId) {
30
29
  const config = {
31
30
  headers: { Authorization: `Bearer ${this.apiToken}` }
32
31
  };
33
- return yield axiosInstance.put(`${GET_ROUTE}/${routeId}/close`, {}, config);
32
+ return yield this.axiosInstance.put(`${GET_ROUTE}/${routeId}/close`, {}, config);
34
33
  }
35
34
  catch (error) {
36
35
  console.error('Error fetching closeRouteById:', error);
@@ -44,7 +43,7 @@ export const updateRouteById = function (routeId, data) {
44
43
  const config = {
45
44
  headers: { Authorization: `Bearer ${this.apiToken}` }
46
45
  };
47
- return yield axiosInstance.put(`${GET_ROUTE}/${routeId}`, data, config);
46
+ return yield this.axiosInstance.put(`${GET_ROUTE}/${routeId}`, data, config);
48
47
  }
49
48
  catch (error) {
50
49
  console.error('Error fetching updateRouteById:', 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_SECTIONS = 'api/section';
12
11
  export const deleteById = function (id) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const deleteById = function (id) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.delete(`${GET_SET_SECTIONS}/${id}`, config);
17
+ return yield this.axiosInstance.delete(`${GET_SET_SECTIONS}/${id}`, config);
19
18
  }
20
19
  catch (error) {
21
20
  console.error('Error fetching deleteById:', 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_SECTIONS = 'api/section';
13
12
  const GET_SET_SECTIONS_WASHDAY_APP = 'api/v2/washdayapp/sections';
14
13
  export const getList = function (params) {
@@ -30,7 +29,7 @@ export const getList = function (params) {
30
29
  if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('products')) {
31
30
  queryParams += `&products=${params === null || params === void 0 ? void 0 : params.products}`;
32
31
  }
33
- return yield axiosInstance.get(`${GET_SET_SECTIONS}?${queryParams}`, config);
32
+ return yield this.axiosInstance.get(`${GET_SET_SECTIONS}?${queryParams}`, config);
34
33
  }
35
34
  catch (error) {
36
35
  console.error('Error fetching getStoreStaff:', error);
@@ -44,7 +43,7 @@ export const getById = function (id) {
44
43
  const config = {
45
44
  headers: { Authorization: `Bearer ${this.apiToken}` }
46
45
  };
47
- return yield axiosInstance.get(`${GET_SET_SECTIONS}/${id}`, config);
46
+ return yield this.axiosInstance.get(`${GET_SET_SECTIONS}/${id}`, config);
48
47
  }
49
48
  catch (error) {
50
49
  console.error('Error fetching getSectionById:', error);
@@ -61,7 +60,7 @@ export const getSectionsByStoreCustomersApp = function (params) {
61
60
  const queryParams = generateQueryParamsStr([
62
61
  'storeId',
63
62
  ], params);
64
- return yield axiosInstance.get(`${GET_SET_SECTIONS_WASHDAY_APP}?${queryParams}`, config);
63
+ return yield this.axiosInstance.get(`${GET_SET_SECTIONS_WASHDAY_APP}?${queryParams}`, config);
65
64
  }
66
65
  catch (error) {
67
66
  console.error('Error fetching getSectionsByStoreCustomersApp:', 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_SECTIONS = 'api/section';
12
11
  export const create = function (data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const create = function (data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- const response = yield axiosInstance.post(`${GET_SET_SECTIONS}`, data, config);
17
+ const response = yield this.axiosInstance.post(`${GET_SET_SECTIONS}`, data, config);
19
18
  return response;
20
19
  }
21
20
  catch (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_SECTIONS = 'api/section';
12
11
  export const updateById = function (id, data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const updateById = function (id, data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- return yield axiosInstance.put(`${GET_SET_SECTIONS}/${id}`, data, config);
17
+ return yield this.axiosInstance.put(`${GET_SET_SECTIONS}/${id}`, data, config);
19
18
  }
20
19
  catch (error) {
21
20
  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_SET_STAFF = (storeId) => `api/store/${storeId}/staff`;
12
11
  export const deleteStoreStaffById = function (storeId, staffId) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const deleteStoreStaffById = function (storeId, staffId) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- const response = yield axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
17
+ const response = yield this.axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
19
18
  return response;
20
19
  }
21
20
  catch (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_STAFF = (storeId) => `api/store/${storeId}/staff`;
12
11
  export const getStoreStaff = function (storeId, queryParams) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const getStoreStaff = function (storeId, queryParams) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- const response = yield axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
17
+ const response = yield this.axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
19
18
  return response;
20
19
  }
21
20
  catch (error) {
@@ -30,7 +29,7 @@ export const getStoreStaffById = function (storeId, staffId) {
30
29
  const config = {
31
30
  headers: { Authorization: `Bearer ${this.apiToken}` }
32
31
  };
33
- return yield axiosInstance.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
32
+ return yield this.axiosInstance.get(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
34
33
  }
35
34
  catch (error) {
36
35
  console.error('Error fetching getStoreStaffById:', 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_STAFF = (storeId) => `api/store/${storeId}/staff`;
12
11
  export const createStoreStaff = function (storeId, data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const createStoreStaff = function (storeId, data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- const response = yield axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
17
+ const response = yield this.axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
19
18
  return response;
20
19
  }
21
20
  catch (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_STAFF = (storeId) => `api/store/${storeId}/staff`;
12
11
  export const updateStoreStaffById = function (storeId, staffId, data) {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -15,7 +14,7 @@ export const updateStoreStaffById = function (storeId, staffId, data) {
15
14
  const config = {
16
15
  headers: { Authorization: `Bearer ${this.apiToken}` }
17
16
  };
18
- const response = yield axiosInstance.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
17
+ const response = yield this.axiosInstance.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
19
18
  return response;
20
19
  }
21
20
  catch (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_STORES = 'api/store';
13
12
  const GET_SET_STORE_IMAGE = 'api/store-image';
14
13
  const REQUEST_PARAMS = {
@@ -24,7 +23,7 @@ export const getStores = function (params) {
24
23
  if (params.isActive) {
25
24
  queryParams += `isActive=${params.isActive}`;
26
25
  }
27
- const response = yield axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: Object.assign({}, REQUEST_PARAMS) });
26
+ const response = yield this.axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: Object.assign({}, REQUEST_PARAMS) });
28
27
  return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.stores) || [];
29
28
  }
30
29
  catch (error) {
@@ -39,7 +38,7 @@ export const getStoreReviewLink = function (storeId) {
39
38
  const config = {
40
39
  headers: { Authorization: `Bearer ${this.apiToken}` }
41
40
  };
42
- const response = yield axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
41
+ const response = yield this.axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
43
42
  return response;
44
43
  }
45
44
  catch (error) {
@@ -53,7 +52,7 @@ export const getStoreById = function (storeId) {
53
52
  var _a;
54
53
  try {
55
54
  REQUEST_PARAMS.token = this.apiToken;
56
- const response = yield axiosInstance.get(`${GET_SET_STORES}/${storeId}`, { params: Object.assign({}, REQUEST_PARAMS) });
55
+ const response = yield this.axiosInstance.get(`${GET_SET_STORES}/${storeId}`, { params: Object.assign({}, REQUEST_PARAMS) });
57
56
  return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.data) || {};
58
57
  }
59
58
  catch (error) {
@@ -68,7 +67,7 @@ export const getStoreImages = function (storeId) {
68
67
  const config = {
69
68
  headers: { Authorization: `Bearer ${this.apiToken}` }
70
69
  };
71
- const response = yield axiosInstance.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
70
+ const response = yield this.axiosInstance.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
72
71
  return response;
73
72
  }
74
73
  catch (error) {
@@ -83,7 +82,7 @@ export const getStoresByName = function (query) {
83
82
  try {
84
83
  const config = {};
85
84
  const queryParams = generateQueryParamsStr(['q'], query);
86
- const response = yield axiosInstance.get(`${GET_STORES_WASHDAY_APP}?${queryParams}`, config);
85
+ const response = yield this.axiosInstance.get(`${GET_STORES_WASHDAY_APP}?${queryParams}`, config);
87
86
  return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.stores) || [];
88
87
  }
89
88
  catch (error) {
@@ -99,7 +98,7 @@ export const getStoresByIdCustomersApp = function (id) {
99
98
  const config = {
100
99
  headers: { Authorization: `Bearer ${this.apiToken}` }
101
100
  };
102
- const response = yield axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
101
+ const response = yield this.axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
103
102
  return ((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.store) || [];
104
103
  }
105
104
  catch (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_STORE_IMAGE = 'api/store-image';
12
11
  const GET_SET_STORES = 'api/store';
13
12
  export const createStoreImage = function (data) {
@@ -16,7 +15,7 @@ export const createStoreImage = function (data) {
16
15
  const config = {
17
16
  headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
18
17
  };
19
- const response = yield axiosInstance.post(`${GET_SET_STORE_IMAGE}`, data, config);
18
+ const response = yield this.axiosInstance.post(`${GET_SET_STORE_IMAGE}`, data, config);
20
19
  return response;
21
20
  }
22
21
  catch (error) {
@@ -31,7 +30,7 @@ export const createStore = function (data) {
31
30
  const config = {
32
31
  headers: { Authorization: `Bearer ${this.apiToken}` }
33
32
  };
34
- const response = yield axiosInstance.post(`${GET_SET_STORES}`, data, config);
33
+ const response = yield this.axiosInstance.post(`${GET_SET_STORES}`, data, config);
35
34
  return response;
36
35
  }
37
36
  catch (error) {
@@ -48,7 +47,7 @@ export const copyStore = function (copyStoreId) {
48
47
  const config = {
49
48
  headers: { Authorization: `Bearer ${this.apiToken}` }
50
49
  };
51
- const response = yield axiosInstance.post(`${GET_SET_STORES}/copy`, {
50
+ const response = yield this.axiosInstance.post(`${GET_SET_STORES}/copy`, {
52
51
  fromStoreId: copyStoreId
53
52
  }, config);
54
53
  return response;
@@ -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_STORES = 'api/store';
12
11
  const REQUEST_PARAMS = {
13
12
  token: 'LOGGED_USER_TOKEN',
@@ -18,7 +17,7 @@ export const updateStoreById = function (storeId, data) {
18
17
  const config = {
19
18
  headers: { Authorization: `Bearer ${this.apiToken}` }
20
19
  };
21
- const response = yield axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
20
+ const response = yield this.axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
22
21
  return response.data || {};
23
22
  }
24
23
  catch (error) {
@@ -33,7 +32,7 @@ export const deleteStoreById = function (storeId) {
33
32
  const config = {
34
33
  headers: { Authorization: `Bearer ${this.apiToken}` }
35
34
  };
36
- const response = yield axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
35
+ const response = yield this.axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
37
36
  return response;
38
37
  }
39
38
  catch (error) {