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.
- package/dist/api/attendance/get.js +4 -5
- package/dist/api/attendance/post.js +2 -3
- package/dist/api/attendance/put.js +1 -2
- package/dist/api/auth/post.js +13 -14
- package/dist/api/axiosInstance.js +47 -36
- package/dist/api/cashierbox/delete.js +2 -3
- package/dist/api/cashierbox/get.js +3 -4
- package/dist/api/cashierbox/post.js +2 -3
- package/dist/api/cashierbox/put.js +2 -3
- package/dist/api/cashups/delete.js +1 -2
- package/dist/api/cashups/get.js +3 -4
- package/dist/api/cashups/post.js +1 -2
- package/dist/api/cashups/put.js +2 -2
- package/dist/api/cfdi/delete.js +1 -2
- package/dist/api/cfdi/get.js +6 -7
- package/dist/api/cfdi/post.js +2 -3
- package/dist/api/cfdi/put.js +2 -2
- package/dist/api/companies/get.js +1 -2
- package/dist/api/companies/post.js +2 -3
- package/dist/api/companies/put.js +3 -4
- package/dist/api/countries/get.js +1 -2
- package/dist/api/csv/get.js +13 -14
- package/dist/api/customers/delete.js +2 -3
- package/dist/api/customers/get.js +6 -7
- package/dist/api/customers/post.js +2 -3
- package/dist/api/customers/put.js +3 -4
- package/dist/api/discounts/get.js +7 -8
- package/dist/api/discounts/post.js +2 -3
- package/dist/api/discounts/put.js +4 -5
- package/dist/api/index.js +4 -1
- package/dist/api/inventory/delete.js +1 -2
- package/dist/api/inventory/get.js +3 -4
- package/dist/api/inventory/post.js +1 -2
- package/dist/api/inventory/put.js +2 -3
- package/dist/api/order/delete.js +2 -3
- package/dist/api/order/get.js +8 -9
- package/dist/api/order/post.js +7 -8
- package/dist/api/order/put.js +13 -14
- package/dist/api/outsourcedOrders/delete.js +1 -2
- package/dist/api/outsourcedOrders/get.js +3 -4
- package/dist/api/outsourcedOrders/post.js +1 -2
- package/dist/api/outsourcedOrders/put.js +1 -2
- package/dist/api/partners/delete.js +1 -2
- package/dist/api/partners/get.js +2 -3
- package/dist/api/partners/post.js +1 -2
- package/dist/api/partners/put.js +1 -2
- package/dist/api/pdf/get.js +1 -2
- package/dist/api/products/delete.js +3 -4
- package/dist/api/products/get.js +1 -2
- package/dist/api/products/post.js +4 -5
- package/dist/api/products/put.js +3 -4
- package/dist/api/publics/get.js +1 -2
- package/dist/api/reports/get.js +15 -16
- package/dist/api/reviews/delete.js +1 -1
- package/dist/api/reviews/get.js +2 -3
- package/dist/api/reviews/post.js +1 -1
- package/dist/api/reviews/put.js +2 -2
- package/dist/api/routes/delete.js +1 -2
- package/dist/api/routes/get.js +5 -6
- package/dist/api/routes/post.js +3 -4
- package/dist/api/routes/put.js +3 -4
- package/dist/api/sections/delete.js +1 -2
- package/dist/api/sections/get.js +3 -4
- package/dist/api/sections/post.js +1 -2
- package/dist/api/sections/put.js +1 -2
- package/dist/api/staff/delete.js +1 -2
- package/dist/api/staff/get.js +2 -3
- package/dist/api/staff/post.js +1 -2
- package/dist/api/staff/put.js +1 -2
- package/dist/api/stores/get.js +6 -7
- package/dist/api/stores/post.js +3 -4
- package/dist/api/stores/put.js +2 -3
- package/dist/api/stripe/post.js +4 -5
- package/dist/api/supplies/delete.js +1 -2
- package/dist/api/supplies/get.js +3 -4
- package/dist/api/supplies/post.js +1 -2
- package/dist/api/supplies/put.js +2 -3
- package/dist/api/users/delete.js +1 -2
- package/dist/api/users/post.js +1 -2
- package/dist/api/users/put.js +1 -2
- package/package.json +1 -1
- package/src/api/attendance/get.ts +4 -4
- package/src/api/attendance/post.ts +2 -2
- package/src/api/attendance/put.ts +1 -1
- package/src/api/auth/post.ts +13 -13
- package/src/api/axiosInstance.ts +51 -40
- package/src/api/cashierbox/delete.ts +2 -2
- package/src/api/cashierbox/get.ts +3 -3
- package/src/api/cashierbox/post.ts +2 -2
- package/src/api/cashierbox/put.ts +2 -2
- package/src/api/cashups/delete.ts +1 -1
- package/src/api/cashups/get.ts +3 -3
- package/src/api/cashups/post.ts +1 -1
- package/src/api/cashups/put.ts +2 -2
- package/src/api/cfdi/delete.ts +1 -1
- package/src/api/cfdi/get.ts +6 -6
- package/src/api/cfdi/post.ts +2 -2
- package/src/api/cfdi/put.ts +2 -2
- package/src/api/companies/get.ts +1 -1
- package/src/api/companies/post.ts +2 -2
- package/src/api/companies/put.ts +3 -3
- package/src/api/countries/get.ts +1 -1
- package/src/api/csv/get.ts +13 -13
- package/src/api/customers/delete.ts +2 -2
- package/src/api/customers/get.ts +6 -6
- package/src/api/customers/post.ts +2 -2
- package/src/api/customers/put.ts +3 -3
- package/src/api/discounts/get.ts +7 -7
- package/src/api/discounts/post.ts +2 -2
- package/src/api/discounts/put.ts +4 -4
- package/src/api/index.ts +4 -2
- package/src/api/inventory/delete.ts +1 -1
- package/src/api/inventory/get.ts +3 -3
- package/src/api/inventory/post.ts +1 -1
- package/src/api/inventory/put.ts +2 -2
- package/src/api/order/delete.ts +2 -2
- package/src/api/order/get.ts +8 -8
- package/src/api/order/post.ts +7 -7
- package/src/api/order/put.ts +13 -13
- package/src/api/outsourcedOrders/delete.ts +1 -1
- package/src/api/outsourcedOrders/get.ts +3 -3
- package/src/api/outsourcedOrders/post.ts +1 -1
- package/src/api/outsourcedOrders/put.ts +1 -1
- package/src/api/partners/delete.ts +1 -1
- package/src/api/partners/get.ts +2 -2
- package/src/api/partners/post.ts +1 -1
- package/src/api/partners/put.ts +1 -1
- package/src/api/pdf/get.ts +1 -1
- package/src/api/products/delete.ts +3 -3
- package/src/api/products/get.ts +1 -1
- package/src/api/products/post.ts +4 -4
- package/src/api/products/put.ts +3 -3
- package/src/api/publics/get.ts +1 -1
- package/src/api/reports/get.ts +15 -15
- package/src/api/reviews/delete.ts +1 -1
- package/src/api/reviews/get.ts +2 -2
- package/src/api/reviews/post.ts +1 -1
- package/src/api/reviews/put.ts +2 -2
- package/src/api/routes/delete.ts +1 -1
- package/src/api/routes/get.ts +5 -5
- package/src/api/routes/post.ts +3 -3
- package/src/api/routes/put.ts +3 -3
- package/src/api/sections/delete.ts +1 -1
- package/src/api/sections/get.ts +3 -3
- package/src/api/sections/post.ts +1 -1
- package/src/api/sections/put.ts +1 -1
- package/src/api/staff/delete.ts +1 -1
- package/src/api/staff/get.ts +2 -2
- package/src/api/staff/post.ts +1 -1
- package/src/api/staff/put.ts +1 -1
- package/src/api/stores/get.ts +6 -6
- package/src/api/stores/post.ts +3 -3
- package/src/api/stores/put.ts +2 -2
- package/src/api/stripe/post.ts +4 -4
- package/src/api/supplies/delete.ts +1 -1
- package/src/api/supplies/get.ts +3 -3
- package/src/api/supplies/post.ts +1 -1
- package/src/api/supplies/put.ts +2 -2
- package/src/api/users/delete.ts +1 -1
- package/src/api/users/post.ts +1 -1
- package/src/api/users/put.ts +1 -1
- 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
|
const GET_SET_COMPANIES = 'api/company';
|
|
12
11
|
export const updateCompanyTaxInfoCertificates = function (companyId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateCompanyTaxInfoCertificates = function (companyId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const updateCFDIOrgLogo = function (companyId, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
32
31
|
};
|
|
33
|
-
const response = yield axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
|
|
32
|
+
const response = yield this.axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
|
|
34
33
|
return response;
|
|
35
34
|
}
|
|
36
35
|
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_COMPANIES = 'api/company';
|
|
12
11
|
export const updateCompanyById = function (companyId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateCompanyById = function (companyId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const updateCompanyLogoById = function (companyId, data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
@@ -46,7 +45,7 @@ export const updateCompanyTaxInfoById = function (companyId, data) {
|
|
|
46
45
|
const config = {
|
|
47
46
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
48
47
|
};
|
|
49
|
-
const response = yield axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
|
|
48
|
+
const response = yield this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
|
|
50
49
|
return response;
|
|
51
50
|
}
|
|
52
51
|
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_COUNTRIES = 'api/country';
|
|
12
11
|
const REQUEST_PARAMS = {
|
|
13
12
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -18,7 +17,7 @@ export const getCountries = function () {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: '' }
|
|
20
19
|
};
|
|
21
|
-
const response = yield axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
|
|
20
|
+
const response = yield this.axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
|
|
22
21
|
return response;
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
package/dist/api/csv/get.js
CHANGED
|
@@ -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
|
const ATTENDANCE_API = 'api/attendance';
|
|
@@ -26,7 +25,7 @@ export const exportCustomersList = function (params) {
|
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
27
|
const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum', 'createdIn'], params);
|
|
29
|
-
return yield axiosInstance.get(`${GENERATE_EXPORT}/export-all-customers?${queryParams}`, config);
|
|
28
|
+
return yield this.axiosInstance.get(`${GENERATE_EXPORT}/export-all-customers?${queryParams}`, config);
|
|
30
29
|
}
|
|
31
30
|
catch (error) {
|
|
32
31
|
console.error('Error fetching exportCustomersList:', error);
|
|
@@ -64,7 +63,7 @@ export const exportOrdersList = function (params) {
|
|
|
64
63
|
'collectedDateTime',
|
|
65
64
|
'q'
|
|
66
65
|
], params);
|
|
67
|
-
return yield axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
|
|
66
|
+
return yield this.axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
|
|
68
67
|
}
|
|
69
68
|
catch (error) {
|
|
70
69
|
console.error('Error fetching exportOrdersList:', error);
|
|
@@ -85,7 +84,7 @@ export const exportProductsList = function (storeId) {
|
|
|
85
84
|
responseType: 'blob'
|
|
86
85
|
}
|
|
87
86
|
};
|
|
88
|
-
return yield axiosInstance.get(`api/product/${storeId}/export`, config);
|
|
87
|
+
return yield this.axiosInstance.get(`api/product/${storeId}/export`, config);
|
|
89
88
|
}
|
|
90
89
|
catch (error) {
|
|
91
90
|
console.error('Error fetching exportProductsList:', error);
|
|
@@ -111,7 +110,7 @@ export const exportCleanedOrdersReport = function (storeId, params) {
|
|
|
111
110
|
'toDate',
|
|
112
111
|
'timezone'
|
|
113
112
|
], params);
|
|
114
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders/export?${queryParams}`, config);
|
|
113
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/cleaned-orders/export?${queryParams}`, config);
|
|
115
114
|
}
|
|
116
115
|
catch (error) {
|
|
117
116
|
console.error('Error fetching exportOrdersList:', error);
|
|
@@ -138,7 +137,7 @@ export const exportSalesReport = function (storeId, params) {
|
|
|
138
137
|
'timezone',
|
|
139
138
|
'type'
|
|
140
139
|
], params);
|
|
141
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/sales/export?${queryParams}`, config);
|
|
140
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/sales/export?${queryParams}`, config);
|
|
142
141
|
}
|
|
143
142
|
catch (error) {
|
|
144
143
|
console.error('Error fetching exportOrdersList:', error);
|
|
@@ -163,7 +162,7 @@ export const exportCustomersReport = function (storeId, params) {
|
|
|
163
162
|
'fromDate',
|
|
164
163
|
'toDate',
|
|
165
164
|
], params);
|
|
166
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/customers/export?${queryParams}`, config);
|
|
165
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/customers/export?${queryParams}`, config);
|
|
167
166
|
}
|
|
168
167
|
catch (error) {
|
|
169
168
|
console.error('Error fetching exportCustomersReport:', error);
|
|
@@ -188,7 +187,7 @@ export const exportSuppliesReport = function (storeId, params) {
|
|
|
188
187
|
'fromDate',
|
|
189
188
|
'toDate',
|
|
190
189
|
], params);
|
|
191
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/supplies/export?${queryParams}`, config);
|
|
190
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/supplies/export?${queryParams}`, config);
|
|
192
191
|
}
|
|
193
192
|
catch (error) {
|
|
194
193
|
console.error('Error fetching exportCustomersReport:', error);
|
|
@@ -210,7 +209,7 @@ export const exportDiscountCodesReport = function (storeId, params) {
|
|
|
210
209
|
}
|
|
211
210
|
};
|
|
212
211
|
const queryParams = generateQueryParamsStr([], params);
|
|
213
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/discountCodes/export?${queryParams}`, config);
|
|
212
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/discountCodes/export?${queryParams}`, config);
|
|
214
213
|
}
|
|
215
214
|
catch (error) {
|
|
216
215
|
console.error('Error fetching exportCustomersReport:', error);
|
|
@@ -235,7 +234,7 @@ export const exportStaffReport = function (storeId, params) {
|
|
|
235
234
|
'fromDate',
|
|
236
235
|
'toDate',
|
|
237
236
|
], params);
|
|
238
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/staff/export?${queryParams}`, config);
|
|
237
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/staff/export?${queryParams}`, config);
|
|
239
238
|
}
|
|
240
239
|
catch (error) {
|
|
241
240
|
console.error('Error fetching exportCustomersReport:', error);
|
|
@@ -261,7 +260,7 @@ export const exportProductSalesReport = function (storeId, params) {
|
|
|
261
260
|
'toDate',
|
|
262
261
|
'timezone'
|
|
263
262
|
], params);
|
|
264
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales/export?${queryParams}`, config);
|
|
263
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales/export?${queryParams}`, config);
|
|
265
264
|
}
|
|
266
265
|
catch (error) {
|
|
267
266
|
console.error('Error fetching exportOrdersList:', error);
|
|
@@ -287,7 +286,7 @@ export const exportPaymentLinesReport = function (storeId, params) {
|
|
|
287
286
|
'toDate',
|
|
288
287
|
'timezone'
|
|
289
288
|
], params);
|
|
290
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/paymentLines/export?${queryParams}`, config);
|
|
289
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/paymentLines/export?${queryParams}`, config);
|
|
291
290
|
}
|
|
292
291
|
catch (error) {
|
|
293
292
|
console.error('Error fetching exportOrdersList:', error);
|
|
@@ -314,7 +313,7 @@ export const exportUnpaidOrdersReportCSV = function (storeId, params) {
|
|
|
314
313
|
'timezone',
|
|
315
314
|
'customerName'
|
|
316
315
|
], params);
|
|
317
|
-
return yield axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export?${queryParams}`, config);
|
|
316
|
+
return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/unpaidOrders/export?${queryParams}`, config);
|
|
318
317
|
}
|
|
319
318
|
catch (error) {
|
|
320
319
|
console.error('Error fetching exportUnpaidOrdersReportCSV:', error);
|
|
@@ -340,7 +339,7 @@ export const exportAttendanceReport = function (storeId, params) {
|
|
|
340
339
|
'toDate',
|
|
341
340
|
'employeeId'
|
|
342
341
|
], params);
|
|
343
|
-
return yield axiosInstance.get(`${ATTENDANCE_API}/store/${storeId}/report/export?${queryParams}`, config);
|
|
342
|
+
return yield this.axiosInstance.get(`${ATTENDANCE_API}/store/${storeId}/report/export?${queryParams}`, config);
|
|
344
343
|
}
|
|
345
344
|
catch (error) {
|
|
346
345
|
console.error('Error fetching exportAttendanceReport:', 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_CUSTOMERS = 'api/customer';
|
|
12
11
|
const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
13
12
|
export const deleteByIdCustomersApp = function (id) {
|
|
@@ -16,7 +15,7 @@ export const deleteByIdCustomersApp = function (id) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.delete(`${GET_SET_CUSTOMERS_APP}/${id}`, config);
|
|
18
|
+
return yield this.axiosInstance.delete(`${GET_SET_CUSTOMERS_APP}/${id}`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching deleteByIdCustomersApp:', error);
|
|
@@ -30,7 +29,7 @@ export const deleteById = function (id) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.delete(`${GET_SET_CUSTOMERS}/${id}`, config);
|
|
32
|
+
return yield this.axiosInstance.delete(`${GET_SET_CUSTOMERS}/${id}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
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_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
13
12
|
const GET_SET_CUSTOMERS = 'api/customer';
|
|
14
13
|
export const getList = function (params, options) {
|
|
@@ -19,7 +18,7 @@ export const getList = function (params, options) {
|
|
|
19
18
|
signal: (options === null || options === void 0 ? void 0 : options.signal) || params.signal || undefined
|
|
20
19
|
};
|
|
21
20
|
const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum', 'createdIn'], params);
|
|
22
|
-
return yield axiosInstance.get(`${GET_SET_CUSTOMERS}?${queryParams}`, config);
|
|
21
|
+
return yield this.axiosInstance.get(`${GET_SET_CUSTOMERS}?${queryParams}`, config);
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
|
25
24
|
if (error instanceof Error && (error.name === 'AbortError' || error.name === 'CanceledError')) {
|
|
@@ -37,7 +36,7 @@ export const getCustomerById = function (customerId) {
|
|
|
37
36
|
const config = {
|
|
38
37
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
38
|
};
|
|
40
|
-
const response = yield axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}`, config);
|
|
39
|
+
const response = yield this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}`, config);
|
|
41
40
|
return response.data;
|
|
42
41
|
}
|
|
43
42
|
catch (error) {
|
|
@@ -52,7 +51,7 @@ export const getCustomerHighlightsById = function (customerId) {
|
|
|
52
51
|
const config = {
|
|
53
52
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
54
53
|
};
|
|
55
|
-
const response = yield axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/highlights`, config);
|
|
54
|
+
const response = yield this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/highlights`, config);
|
|
56
55
|
return response.data;
|
|
57
56
|
}
|
|
58
57
|
catch (error) {
|
|
@@ -68,7 +67,7 @@ export const getCustomerOrders = function (customerId, params) {
|
|
|
68
67
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
69
68
|
};
|
|
70
69
|
const queryParams = generateQueryParamsStr(['limit', 'pageNum'], params);
|
|
71
|
-
return yield axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/orders?${queryParams}`, config);
|
|
70
|
+
return yield this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/orders?${queryParams}`, config);
|
|
72
71
|
}
|
|
73
72
|
catch (error) {
|
|
74
73
|
console.error('Error fetching getCustomerHighlightsById:', error);
|
|
@@ -82,7 +81,7 @@ export const getCustomerByIdCustomersApp = function (customerId) {
|
|
|
82
81
|
const config = {
|
|
83
82
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
84
83
|
};
|
|
85
|
-
return yield axiosInstance.get(`${GET_SET_CUSTOMERS_APP}/${customerId}`, config);
|
|
84
|
+
return yield this.axiosInstance.get(`${GET_SET_CUSTOMERS_APP}/${customerId}`, config);
|
|
86
85
|
}
|
|
87
86
|
catch (error) {
|
|
88
87
|
console.error('Error fetching customer:', error);
|
|
@@ -96,7 +95,7 @@ export const getCustomerLoyaltyHistory = function (customerId) {
|
|
|
96
95
|
const config = {
|
|
97
96
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
98
97
|
};
|
|
99
|
-
return yield axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/loyalty-history`, config);
|
|
98
|
+
return yield this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/loyalty-history`, config);
|
|
100
99
|
}
|
|
101
100
|
catch (error) {
|
|
102
101
|
console.error('Error fetching getCustomerLoyaltyHistory:', 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_CUSTOMERS = 'api/customer';
|
|
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_CUSTOMERS}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.post(`${GET_SET_CUSTOMERS}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const bulkCreate = function (storeId, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
32
31
|
};
|
|
33
|
-
const response = yield axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
32
|
+
const response = yield this.axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
34
33
|
return response.data || {};
|
|
35
34
|
}
|
|
36
35
|
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_CUSTOMERS = 'api/customer';
|
|
12
11
|
const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
13
12
|
// export const bulkUpdate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
|
|
@@ -15,7 +14,7 @@ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
|
15
14
|
// const config = {
|
|
16
15
|
// headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
17
16
|
// };
|
|
18
|
-
// const response = await axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
17
|
+
// const response = await this.axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
19
18
|
// return response.data || {}
|
|
20
19
|
// } catch (error) {
|
|
21
20
|
// console.error('Error fetching getStoreById:', error);
|
|
@@ -28,7 +27,7 @@ export const updateById = function (id, data) {
|
|
|
28
27
|
const config = {
|
|
29
28
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
30
29
|
};
|
|
31
|
-
return yield axiosInstance.put(`${GET_SET_CUSTOMERS}/${id}`, data, config);
|
|
30
|
+
return yield this.axiosInstance.put(`${GET_SET_CUSTOMERS}/${id}`, data, config);
|
|
32
31
|
}
|
|
33
32
|
catch (error) {
|
|
34
33
|
console.error('Error fetching updateById:', error);
|
|
@@ -42,7 +41,7 @@ export const updateByIdCustomersApp = function (id, data) {
|
|
|
42
41
|
const config = {
|
|
43
42
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
44
43
|
};
|
|
45
|
-
return yield axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
|
|
44
|
+
return yield this.axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
|
|
46
45
|
}
|
|
47
46
|
catch (error) {
|
|
48
47
|
console.error('Error fetching updateByIdCustomersApp:', 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_DISCOUNT_CODES = 'api/v2/discountCodes';
|
|
13
12
|
const GET_SET_AUTOMATIC_DISCOUNTS = 'api/discounts';
|
|
14
13
|
const GET_AVAILABLE_AUTOMATIC_DISCOUNTS = 'api/availableDiscounts';
|
|
@@ -23,7 +22,7 @@ export const getDiscountCodes = function (storeId, params) {
|
|
|
23
22
|
const config = {
|
|
24
23
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
25
24
|
};
|
|
26
|
-
return yield axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}?${queryParams}`, config);
|
|
25
|
+
return yield this.axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}?${queryParams}`, config);
|
|
27
26
|
}
|
|
28
27
|
catch (error) {
|
|
29
28
|
console.error('Error fetching getStores:', error);
|
|
@@ -40,7 +39,7 @@ export const getAutomaticDiscounts = function (storeId, params) {
|
|
|
40
39
|
const config = {
|
|
41
40
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
42
41
|
};
|
|
43
|
-
return yield axiosInstance.get(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}?${queryParams}`, config);
|
|
42
|
+
return yield this.axiosInstance.get(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}?${queryParams}`, config);
|
|
44
43
|
}
|
|
45
44
|
catch (error) {
|
|
46
45
|
console.error('Error fetching getStores:', error);
|
|
@@ -54,7 +53,7 @@ export const getDiscountCodeById = function (storeId, discountId) {
|
|
|
54
53
|
const config = {
|
|
55
54
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
56
55
|
};
|
|
57
|
-
return yield axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, config);
|
|
56
|
+
return yield this.axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, config);
|
|
58
57
|
}
|
|
59
58
|
catch (error) {
|
|
60
59
|
console.error('Error fetching getDiscountCodeById:', error);
|
|
@@ -68,7 +67,7 @@ export const getAutomaticDiscountById = function (storeId, discountId) {
|
|
|
68
67
|
const config = {
|
|
69
68
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
70
69
|
};
|
|
71
|
-
return yield axiosInstance.get(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, config);
|
|
70
|
+
return yield this.axiosInstance.get(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, config);
|
|
72
71
|
}
|
|
73
72
|
catch (error) {
|
|
74
73
|
console.error('Error fetching getDiscountCodeById:', error);
|
|
@@ -82,7 +81,7 @@ export const verifyDiscountCode = function (storeId, code) {
|
|
|
82
81
|
const config = {
|
|
83
82
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
84
83
|
};
|
|
85
|
-
return yield axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}/${code}/verify`, config);
|
|
84
|
+
return yield this.axiosInstance.get(`${GET_SET_DISCOUNT_CODES}/${storeId}/${code}/verify`, config);
|
|
86
85
|
}
|
|
87
86
|
catch (error) {
|
|
88
87
|
console.error('Error fetching verifyDiscountCode:', error);
|
|
@@ -96,7 +95,7 @@ export const verifyDiscountCodeCustomersApp = function (storeId, code) {
|
|
|
96
95
|
const config = {
|
|
97
96
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
98
97
|
};
|
|
99
|
-
return yield axiosInstance.get(`${GET_DISCOUNT_CODES_CUSTOMER_APP}/${storeId}/${code}/verify`, config);
|
|
98
|
+
return yield this.axiosInstance.get(`${GET_DISCOUNT_CODES_CUSTOMER_APP}/${storeId}/${code}/verify`, config);
|
|
100
99
|
}
|
|
101
100
|
catch (error) {
|
|
102
101
|
console.error('Error fetching verifyDiscountCodeCustomersApp:', error);
|
|
@@ -110,7 +109,7 @@ export const getAvailableAutomaticDiscounts = function (storeId, date) {
|
|
|
110
109
|
const config = {
|
|
111
110
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
112
111
|
};
|
|
113
|
-
return yield axiosInstance.get(`${GET_AVAILABLE_AUTOMATIC_DISCOUNTS}/${storeId}?currentDate=${date}`, config);
|
|
112
|
+
return yield this.axiosInstance.get(`${GET_AVAILABLE_AUTOMATIC_DISCOUNTS}/${storeId}?currentDate=${date}`, config);
|
|
114
113
|
}
|
|
115
114
|
catch (error) {
|
|
116
115
|
console.error('Error fetching getAvailableAutomaticDiscounts:', 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_DISCOUNT_CODES = 'api/v2/discountCodes';
|
|
12
11
|
const GET_SET_AUTOMATIC_DISCOUNTS = 'api/discounts';
|
|
13
12
|
export const createAutomaticDiscount = function (storeId, data) {
|
|
@@ -16,7 +15,7 @@ export const createAutomaticDiscount = function (storeId, data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.post(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}`, data, config);
|
|
18
|
+
return yield this.axiosInstance.post(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}`, data, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching createAutomaticDiscount:', error);
|
|
@@ -30,7 +29,7 @@ export const createDiscountCode = function (storeId, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.post(`${GET_SET_DISCOUNT_CODES}/${storeId}`, data, config);
|
|
32
|
+
return yield this.axiosInstance.post(`${GET_SET_DISCOUNT_CODES}/${storeId}`, data, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching createAutomaticDiscount:', 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_DISCOUNT_CODES = 'api/v2/discountCodes';
|
|
12
11
|
const GET_SET_AUTOMATIC_DISCOUNTS = 'api/discounts';
|
|
13
12
|
export const deleteDiscountCodeById = function (storeId, discountId) {
|
|
@@ -16,7 +15,7 @@ export const deleteDiscountCodeById = function (storeId, discountId) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.delete(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, config);
|
|
18
|
+
return yield this.axiosInstance.delete(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching deleteDiscountCodeById:', error);
|
|
@@ -30,7 +29,7 @@ export const deleteAutomaticDiscountById = function (storeId, discountId) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.delete(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, config);
|
|
32
|
+
return yield this.axiosInstance.delete(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching deleteAutomaticDiscountById:', error);
|
|
@@ -44,7 +43,7 @@ export const updateAutomaticDiscountById = function (storeId, discountId, data)
|
|
|
44
43
|
const config = {
|
|
45
44
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
46
45
|
};
|
|
47
|
-
return yield axiosInstance.put(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, data, config);
|
|
46
|
+
return yield this.axiosInstance.put(`${GET_SET_AUTOMATIC_DISCOUNTS}/${storeId}/${discountId}`, data, config);
|
|
48
47
|
}
|
|
49
48
|
catch (error) {
|
|
50
49
|
console.error('Error fetching updateById:', error);
|
|
@@ -58,7 +57,7 @@ export const updateDiscountCodeById = function (storeId, discountId, data) {
|
|
|
58
57
|
const config = {
|
|
59
58
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
60
59
|
};
|
|
61
|
-
return yield axiosInstance.put(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, data, config);
|
|
60
|
+
return yield this.axiosInstance.put(`${GET_SET_DISCOUNT_CODES}/${storeId}/${discountId}`, data, config);
|
|
62
61
|
}
|
|
63
62
|
catch (error) {
|
|
64
63
|
console.error('Error fetching updateDiscountCodeById:', error);
|
package/dist/api/index.js
CHANGED
|
@@ -41,6 +41,7 @@ import * as partnersEndpoints from './partners';
|
|
|
41
41
|
import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
42
42
|
import * as publicsEndpoints from './publics';
|
|
43
43
|
import { validateUserPin } from "./users/post";
|
|
44
|
+
import { getAxiosInstance } from "./axiosInstance";
|
|
44
45
|
function bindMethods(instance, methods) {
|
|
45
46
|
const boundMethods = {};
|
|
46
47
|
for (const key in methods) {
|
|
@@ -50,8 +51,10 @@ function bindMethods(instance, methods) {
|
|
|
50
51
|
}
|
|
51
52
|
return boundMethods;
|
|
52
53
|
}
|
|
53
|
-
const WashdayClient = function WashdayClient(apiToken) {
|
|
54
|
+
const WashdayClient = function WashdayClient(apiToken, env = 'PROD') {
|
|
54
55
|
this.apiToken = apiToken;
|
|
56
|
+
this.env = env;
|
|
57
|
+
this.axiosInstance = this.axiosInstance ? this.axiosInstance : getAxiosInstance(env);
|
|
55
58
|
this.cashup = bindMethods(this, {
|
|
56
59
|
getList: cashupsEndpoints.getModule.getList,
|
|
57
60
|
getById: cashupsEndpoints.getModule.getById,
|
|
@@ -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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
|
|
12
11
|
export const deleteById = function (storeId, id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteById = function (storeId, id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, 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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
|
|
12
11
|
export const getInventory = function (storeId, queryParams) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const getInventory = function (storeId, queryParams) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}?${queryParams}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.get(`${GET_SET_INVENTORY(storeId)}?${queryParams}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const getInventoryById = function (storeId, id) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
|
|
32
|
+
return yield this.axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching getInventoryById:', error);
|
|
@@ -51,7 +50,7 @@ export const getHistoryById = function (storeId, id, params) {
|
|
|
51
50
|
if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('limit')) {
|
|
52
51
|
queryParams += `&limit=${params === null || params === void 0 ? void 0 : params.limit}`;
|
|
53
52
|
}
|
|
54
|
-
const response = yield axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
|
|
53
|
+
const response = yield this.axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
|
|
55
54
|
return response;
|
|
56
55
|
}
|
|
57
56
|
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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
|
|
12
11
|
export const create = function (storeId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const create = function (storeId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.post(`${GET_SET_INVENTORY(storeId)}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.post(`${GET_SET_INVENTORY(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_INVENTORY = (storeId) => `api/store/${storeId}/inventory`;
|
|
12
11
|
export const updateById = function (storeId, id, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateById = function (storeId, id, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const addStock = function (storeId, id, data) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
const response = yield axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
|
|
32
|
+
const response = yield this.axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
|
|
34
33
|
return response;
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
package/dist/api/order/delete.js
CHANGED
|
@@ -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_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
12
11
|
const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
|
|
13
12
|
export const deletePaymentLineById = function (orderId, id) {
|
|
@@ -16,7 +15,7 @@ export const deletePaymentLineById = function (orderId, id) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
return yield axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
|
|
18
|
+
return yield this.axiosInstance.delete(`${GET_SET_ORDER_PAYMENTLINES(orderId)}/${id}`, config);
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
22
21
|
console.error('Error fetching deleteById:', error);
|
|
@@ -30,7 +29,7 @@ export const cancelOrderByIdCustomersApp = function (id) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
return yield axiosInstance.delete(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
32
|
+
return yield this.axiosInstance.delete(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
35
|
console.error('Error fetching cancelOrderByIdCustomersApp:', error);
|