washday-sdk 1.2.0 → 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/cashierbox/get.js +3 -4
- package/dist/api/cashierbox/post.js +2 -3
- package/dist/api/cashierbox/put.js +2 -3
- 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/customers/get.js +2 -3
- package/dist/api/customers/post.js +2 -3
- package/dist/api/customers/put.js +1 -1
- package/dist/api/inventory/delete.js +1 -2
- package/dist/api/inventory/get.js +2 -3
- package/dist/api/inventory/post.js +1 -2
- package/dist/api/inventory/put.js +2 -3
- package/dist/api/products/delete.js +1 -2
- package/dist/api/products/post.js +4 -5
- package/dist/api/products/put.js +2 -3
- package/dist/api/sections/post.js +1 -2
- package/dist/api/staff/delete.js +1 -2
- package/dist/api/staff/get.js +1 -2
- 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 +3 -4
- package/dist/api/supplies/delete.js +1 -2
- package/dist/api/supplies/get.js +2 -3
- 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/put.js +1 -2
- package/package.json +1 -1
- 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/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/customers/get.ts +2 -2
- package/src/api/customers/post.ts +2 -2
- package/src/api/customers/put.ts +1 -1
- package/src/api/inventory/delete.ts +1 -1
- package/src/api/inventory/get.ts +2 -2
- package/src/api/inventory/post.ts +1 -1
- package/src/api/inventory/put.ts +2 -2
- package/src/api/products/delete.ts +1 -1
- package/src/api/products/post.ts +4 -4
- package/src/api/products/put.ts +2 -2
- package/src/api/sections/post.ts +1 -1
- package/src/api/staff/delete.ts +1 -1
- package/src/api/staff/get.ts +1 -1
- 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 +3 -3
- package/src/api/supplies/delete.ts +1 -1
- package/src/api/supplies/get.ts +2 -2
- 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/put.ts +1 -1
package/dist/api/stripe/post.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_STRIPE = 'api/stripe';
|
|
12
11
|
const GENERATE_CHECKOUT_SESSION = 'api/orders/create-checkout-session';
|
|
13
12
|
export const createCreateSuscriptionCheckoutSession = function (data) {
|
|
@@ -16,7 +15,7 @@ export const createCreateSuscriptionCheckoutSession = function (data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-subscription-checkout-session`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-subscription-checkout-session`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const createCustomerPortalSession = function (data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-customer-portal-session`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-customer-portal-session`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
@@ -46,7 +45,7 @@ export const createCFDISuscrptionCheckoutSession = function (data) {
|
|
|
46
45
|
const config = {
|
|
47
46
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
48
47
|
};
|
|
49
|
-
const response = yield axiosInstance.post(`${GET_SET_STRIPE}/create-cfdi-subscription-checkout-session`, data, config);
|
|
48
|
+
const response = yield this.axiosInstance.post(`${GET_SET_STRIPE}/create-cfdi-subscription-checkout-session`, 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_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const deleteSupplyById = function (storeId, id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteSupplyById = function (storeId, id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.delete(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_SUPPLY(storeId)}/${id}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/supplies/get.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_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const getSupplies = function (storeId, queryParams) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const getSupplies = function (storeId, queryParams) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.get(`${GET_SET_SUPPLY(storeId)}?${queryParams}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.get(`${GET_SET_SUPPLY(storeId)}?${queryParams}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -51,7 +50,7 @@ export const getSupplyHistory = 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_SUPPLY(storeId)}/${id}/history?${queryParams}`, config);
|
|
53
|
+
const response = yield this.axiosInstance.get(`${GET_SET_SUPPLY(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_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const createSupply = function (storeId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const createSupply = function (storeId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.post(`${GET_SET_SUPPLY(storeId)}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.post(`${GET_SET_SUPPLY(storeId)}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/supplies/put.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_SUPPLY = (storeId) => `api/store/${storeId}/supply`;
|
|
12
11
|
export const updateSupplyById = function (storeId, id, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const updateSupplyById = 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_SUPPLY(storeId)}/${id}`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}`, data, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const addSupplyStock = 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_SUPPLY(storeId)}/${id}/addStock`, data, config);
|
|
32
|
+
const response = yield this.axiosInstance.put(`${GET_SET_SUPPLY(storeId)}/${id}/addStock`, data, config);
|
|
34
33
|
return response;
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
package/dist/api/users/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_USER = 'api/user';
|
|
12
11
|
export const deleteUserById = function (id) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const deleteUserById = function (id) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_USER}/${id}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
package/dist/api/users/put.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_USER = 'api/user';
|
|
12
11
|
const REQUEST_PARAMS = {
|
|
13
12
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -18,7 +17,7 @@ export const updateUserById = function (userId, data) {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
20
19
|
};
|
|
21
|
-
const response = yield axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
|
|
20
|
+
const response = yield this.axiosInstance.put(`${GET_SET_USER}/${userId}`, data, config);
|
|
22
21
|
return response.data || {};
|
|
23
22
|
}
|
|
24
23
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export const getCashierboxesByStoreId = async function (this: WashdayClientInsta
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
11
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getCashierboxesByStoreId:', error);
|
|
@@ -21,7 +21,7 @@ export const getCashierboxesById = async function (this: WashdayClientInstance,
|
|
|
21
21
|
const config = {
|
|
22
22
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
23
|
};
|
|
24
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
24
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
25
25
|
return response;
|
|
26
26
|
} catch (error) {
|
|
27
27
|
console.error('Error fetching getCashierboxesById:', error);
|
|
@@ -44,7 +44,7 @@ export const getCashierBoxMovementsHistory = async function (this: WashdayClient
|
|
|
44
44
|
if (params?.hasOwnProperty('limit')) {
|
|
45
45
|
queryParams += `&limit=${params?.limit}`
|
|
46
46
|
}
|
|
47
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
47
|
+
const response = await this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
48
48
|
return response;
|
|
49
49
|
} catch (error) {
|
|
50
50
|
console.error('Error fetching getCashierBoxMovementsHistory:', error);
|
|
@@ -11,7 +11,7 @@ export const createCashierBox = async function (this: WashdayClientInstance, sto
|
|
|
11
11
|
const config = {
|
|
12
12
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
13
13
|
};
|
|
14
|
-
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
14
|
+
const response = await this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
15
15
|
return response;
|
|
16
16
|
} catch (error) {
|
|
17
17
|
console.error('Error fetching getStoreStaff:', error);
|
|
@@ -30,7 +30,7 @@ export const addCashierBoxMovement = async function (this: WashdayClientInstance
|
|
|
30
30
|
const config = {
|
|
31
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
32
|
};
|
|
33
|
-
const response = await axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
33
|
+
const response = await this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
34
34
|
return response;
|
|
35
35
|
} catch (error) {
|
|
36
36
|
console.error('Error fetching createStoreImage:', error);
|
|
@@ -9,7 +9,7 @@ export const updateCashierBoxById = async function (this: WashdayClientInstance,
|
|
|
9
9
|
const config = {
|
|
10
10
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
11
11
|
};
|
|
12
|
-
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
12
|
+
const response = await this.axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
13
13
|
return response;
|
|
14
14
|
} catch (error) {
|
|
15
15
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -22,7 +22,7 @@ export const updateCashierBoxMovementById = async function (this: WashdayClientI
|
|
|
22
22
|
const config = {
|
|
23
23
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
24
24
|
};
|
|
25
|
-
const response = await axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
25
|
+
const response = await this.axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
26
26
|
return response;
|
|
27
27
|
} catch (error) {
|
|
28
28
|
console.error('Error fetching getStoreById:', error);
|
package/src/api/companies/get.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const getCompanyById = async function (this: WashdayClientInstance, compa
|
|
|
14
14
|
const config = {
|
|
15
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
16
16
|
};
|
|
17
|
-
const response = await axiosInstance.get(`${GET_SET_COMPANIES}/${companyId}`, config);
|
|
17
|
+
const response = await this.axiosInstance.get(`${GET_SET_COMPANIES}/${companyId}`, config);
|
|
18
18
|
return response;
|
|
19
19
|
} catch (error) {
|
|
20
20
|
console.error('Error fetching getCompanyById:', error);
|
|
@@ -7,7 +7,7 @@ export const updateCompanyTaxInfoCertificates = async function (this: WashdayCli
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
|
|
10
|
+
const response = await this.axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/certificates`, data, config);
|
|
11
11
|
return response;
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching updateCompanyTaxInfoById:', error);
|
|
@@ -20,7 +20,7 @@ export const updateCFDIOrgLogo = async function (this: WashdayClientInstance, co
|
|
|
20
20
|
const config = {
|
|
21
21
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
22
22
|
}
|
|
23
|
-
const response = await axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
|
|
23
|
+
const response = await this.axiosInstance.post(`${GET_SET_COMPANIES}/${companyId}/taxInfo/logo`, data, config);
|
|
24
24
|
return response;
|
|
25
25
|
} catch (error) {
|
|
26
26
|
console.error('Error fetching updateCFDIOrgLogo:', error);
|
package/src/api/companies/put.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const updateCompanyById = async function (this: WashdayClientInstance, co
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
10
|
+
const response = await this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
11
11
|
return response;
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching updateCompanyById:', error);
|
|
@@ -21,7 +21,7 @@ export const updateCompanyLogoById = async function (this: WashdayClientInstance
|
|
|
21
21
|
const config = {
|
|
22
22
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
23
23
|
};
|
|
24
|
-
const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
24
|
+
const response = await this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}`, data, config);
|
|
25
25
|
return response;
|
|
26
26
|
} catch (error) {
|
|
27
27
|
console.error('Error fetching updateCompanyLogoById:', error);
|
|
@@ -34,7 +34,7 @@ export const updateCompanyTaxInfoById = async function (this: WashdayClientInsta
|
|
|
34
34
|
const config = {
|
|
35
35
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
36
36
|
};
|
|
37
|
-
const response = await axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
|
|
37
|
+
const response = await this.axiosInstance.put(`${GET_SET_COMPANIES}/${companyId}/taxInfo`, data, config);
|
|
38
38
|
return response;
|
|
39
39
|
} catch (error) {
|
|
40
40
|
console.error('Error fetching updateCompanyTaxInfoById:', error);
|
package/src/api/countries/get.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const getCountries = async function (this: WashdayClientInstance): Promis
|
|
|
14
14
|
const config = {
|
|
15
15
|
headers: { Authorization: '' }
|
|
16
16
|
};
|
|
17
|
-
const response = await axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
|
|
17
|
+
const response = await this.axiosInstance.get(`${GET_SET_COUNTRIES}`, config);
|
|
18
18
|
return response;
|
|
19
19
|
} catch (error) {
|
|
20
20
|
console.error('Error fetching getCountries:', error);
|
package/src/api/customers/get.ts
CHANGED
|
@@ -41,7 +41,7 @@ export const getCustomerById = async function (this: WashdayClientInstance, cust
|
|
|
41
41
|
const config = {
|
|
42
42
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
43
43
|
};
|
|
44
|
-
const response = await axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}`, config);
|
|
44
|
+
const response = await this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}`, config);
|
|
45
45
|
return response.data;
|
|
46
46
|
} catch (error) {
|
|
47
47
|
console.error('Error fetching customer:', error);
|
|
@@ -54,7 +54,7 @@ export const getCustomerHighlightsById = async function (this: WashdayClientInst
|
|
|
54
54
|
const config = {
|
|
55
55
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
56
56
|
};
|
|
57
|
-
const response = await axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/highlights`, config);
|
|
57
|
+
const response = await this.axiosInstance.get(`${GET_SET_CUSTOMERS}/${customerId}/highlights`, config);
|
|
58
58
|
return response.data;
|
|
59
59
|
} catch (error) {
|
|
60
60
|
console.error('Error fetching getCustomerHighlightsById:', error);
|
|
@@ -27,7 +27,7 @@ export const create = async function (this: WashdayClientInstance, data: {
|
|
|
27
27
|
const config = {
|
|
28
28
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
29
29
|
};
|
|
30
|
-
const response = await axiosInstance.post(`${GET_SET_CUSTOMERS}`, data, config);
|
|
30
|
+
const response = await this.axiosInstance.post(`${GET_SET_CUSTOMERS}`, data, config);
|
|
31
31
|
return response;
|
|
32
32
|
} catch (error) {
|
|
33
33
|
console.error('Error fetching create:', error);
|
|
@@ -40,7 +40,7 @@ export const bulkCreate = async function (this: WashdayClientInstance, storeId:
|
|
|
40
40
|
const config = {
|
|
41
41
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
42
42
|
};
|
|
43
|
-
const response = await axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
43
|
+
const response = await this.axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
|
|
44
44
|
return response.data || {}
|
|
45
45
|
} catch (error) {
|
|
46
46
|
console.error('Error fetching customers bulkCreate:', error);
|
package/src/api/customers/put.ts
CHANGED
|
@@ -7,7 +7,7 @@ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
|
7
7
|
// const config = {
|
|
8
8
|
// headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
9
9
|
// };
|
|
10
|
-
// const response = await axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
10
|
+
// const response = await this.axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
11
11
|
// return response.data || {}
|
|
12
12
|
// } catch (error) {
|
|
13
13
|
// console.error('Error fetching getStoreById:', error);
|
|
@@ -7,7 +7,7 @@ export const deleteById = async function (this: WashdayClientInstance, storeId:
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
|
|
10
|
+
const response = await this.axiosInstance.delete(`${GET_SET_INVENTORY(storeId)}/${id}`, config);
|
|
11
11
|
return response;
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching deleteById:', error);
|
package/src/api/inventory/get.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const getInventory = async function (this: WashdayClientInstance, storeId
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(`${GET_SET_INVENTORY(storeId)}?${queryParams}`, config);
|
|
11
|
+
const response = await this.axiosInstance.get(`${GET_SET_INVENTORY(storeId)}?${queryParams}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getInventory:', error);
|
|
@@ -43,7 +43,7 @@ export const getHistoryById = async function (this: WashdayClientInstance, store
|
|
|
43
43
|
if (params?.hasOwnProperty('limit')) {
|
|
44
44
|
queryParams += `&limit=${params?.limit}`
|
|
45
45
|
}
|
|
46
|
-
const response = await axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
|
|
46
|
+
const response = await this.axiosInstance.get(`${GET_SET_INVENTORY(storeId)}/${id}/history?${queryParams}`, config);
|
|
47
47
|
return response;
|
|
48
48
|
} catch (error) {
|
|
49
49
|
console.error('Error fetching getInventoryHistory:', error);
|
|
@@ -13,7 +13,7 @@ export const create = async function (this: WashdayClientInstance, storeId: stri
|
|
|
13
13
|
const config = {
|
|
14
14
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
15
15
|
};
|
|
16
|
-
const response = await axiosInstance.post(`${GET_SET_INVENTORY(storeId)}`, data, config);
|
|
16
|
+
const response = await this.axiosInstance.post(`${GET_SET_INVENTORY(storeId)}`, data, config);
|
|
17
17
|
return response;
|
|
18
18
|
} catch (error) {
|
|
19
19
|
console.error('Error fetching create:', error);
|
package/src/api/inventory/put.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const updateById = async function (this: WashdayClientInstance, storeId:
|
|
|
10
10
|
const config = {
|
|
11
11
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
12
12
|
};
|
|
13
|
-
const response = await axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
|
|
13
|
+
const response = await this.axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}`, data, config);
|
|
14
14
|
return response;
|
|
15
15
|
} catch (error) {
|
|
16
16
|
console.error('Error fetching updateById:', error);
|
|
@@ -26,7 +26,7 @@ export const addStock = async function (this: WashdayClientInstance, storeId: st
|
|
|
26
26
|
const config = {
|
|
27
27
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
28
28
|
};
|
|
29
|
-
const response = await axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
|
|
29
|
+
const response = await this.axiosInstance.put(`${GET_SET_INVENTORY(storeId)}/${id}/add-stock`, data, config);
|
|
30
30
|
return response;
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error('Error fetching addStock:', error);
|
|
@@ -33,7 +33,7 @@ export const deletePriceOption = async function (this: WashdayClientInstance, pr
|
|
|
33
33
|
const config = {
|
|
34
34
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
35
35
|
};
|
|
36
|
-
const response = await axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
36
|
+
const response = await this.axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
37
37
|
return response.data || {};
|
|
38
38
|
} catch (error) {
|
|
39
39
|
console.error('Error deleting price option:', error);
|
package/src/api/products/post.ts
CHANGED
|
@@ -32,7 +32,7 @@ export const create = async function (this: WashdayClientInstance, data: {
|
|
|
32
32
|
const config = {
|
|
33
33
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
34
34
|
};
|
|
35
|
-
const response = await axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
35
|
+
const response = await this.axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
36
36
|
return response;
|
|
37
37
|
} catch (error) {
|
|
38
38
|
console.error('Error fetching create:', error);
|
|
@@ -48,7 +48,7 @@ export const createProductSupply = async function (this: WashdayClientInstance,
|
|
|
48
48
|
const config = {
|
|
49
49
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
50
50
|
};
|
|
51
|
-
const response = await axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
51
|
+
const response = await this.axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
52
52
|
return response;
|
|
53
53
|
} catch (error) {
|
|
54
54
|
console.error('Error fetching createProductSupply:', error);
|
|
@@ -64,7 +64,7 @@ export const bulkCreate = async function (this: WashdayClientInstance, storeId:
|
|
|
64
64
|
'Content-Type': 'multipart/form-data' // Let axios handle the boundary
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
const response = await axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
67
|
+
const response = await this.axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
68
68
|
return response.data || {};
|
|
69
69
|
} catch (error) {
|
|
70
70
|
console.error('Error fetching products bulkCreate:', error);
|
|
@@ -84,7 +84,7 @@ export const createPriceOption = async function (this: WashdayClientInstance, pr
|
|
|
84
84
|
const config = {
|
|
85
85
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
86
86
|
};
|
|
87
|
-
const response = await axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
87
|
+
const response = await this.axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
88
88
|
return response.data || {};
|
|
89
89
|
} catch (error) {
|
|
90
90
|
console.error('Error creating price option:', error);
|
package/src/api/products/put.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const bulkUpdate = async function (this: WashdayClientInstance, storeId:
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
10
|
+
const response = await this.axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
11
11
|
return response.data || {}
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -60,7 +60,7 @@ export const updatePriceOption = async function (this: WashdayClientInstance, pr
|
|
|
60
60
|
const config = {
|
|
61
61
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
62
62
|
};
|
|
63
|
-
const response = await axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
63
|
+
const response = await this.axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
64
64
|
return response.data || {};
|
|
65
65
|
} catch (error) {
|
|
66
66
|
console.error('Error updating price option:', error);
|
package/src/api/sections/post.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const create = async function (this: WashdayClientInstance, data: {
|
|
|
13
13
|
const config = {
|
|
14
14
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
15
15
|
};
|
|
16
|
-
const response = await axiosInstance.post(`${GET_SET_SECTIONS}`, data, config);
|
|
16
|
+
const response = await this.axiosInstance.post(`${GET_SET_SECTIONS}`, data, config);
|
|
17
17
|
return response;
|
|
18
18
|
} catch (error) {
|
|
19
19
|
console.error('Error fetching create:', error);
|
package/src/api/staff/delete.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const deleteStoreStaffById = async function (this: WashdayClientInstance,
|
|
|
7
7
|
const config = {
|
|
8
8
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
9
9
|
};
|
|
10
|
-
const response = await axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
10
|
+
const response = await this.axiosInstance.delete(`${GET_SET_STAFF(storeId)}/${staffId}`, config);
|
|
11
11
|
return response;
|
|
12
12
|
} catch (error) {
|
|
13
13
|
console.error('Error fetching getStoreStaff:', error);
|
package/src/api/staff/get.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const getStoreStaff = async function (this: WashdayClientInstance, storeI
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
|
|
11
|
+
const response = await this.axiosInstance.get(`${GET_SET_STAFF(storeId)}?${queryParams}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getStoreStaff:', error);
|
package/src/api/staff/post.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const createStoreStaff = async function (this: WashdayClientInstance, sto
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
|
|
11
|
+
const response = await this.axiosInstance.post(`${GET_SET_STAFF(storeId)}`, data, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching createStoreImage:', error);
|
package/src/api/staff/put.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const updateStoreStaffById = async function (this: WashdayClientInstance,
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
|
|
11
|
+
const response = await this.axiosInstance.put(`${GET_SET_STAFF(storeId)}/${staffId}`, data, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getStoreById:', error);
|
package/src/api/stores/get.ts
CHANGED
|
@@ -19,7 +19,7 @@ export const getStores = async function (this: WashdayClientInstance, params: {
|
|
|
19
19
|
if (params.isActive) {
|
|
20
20
|
queryParams += `isActive=${params.isActive}`
|
|
21
21
|
}
|
|
22
|
-
const response = await axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: { ...REQUEST_PARAMS } });
|
|
22
|
+
const response = await this.axiosInstance.get(`${GET_SET_STORES}?${queryParams}`, { params: { ...REQUEST_PARAMS } });
|
|
23
23
|
return response.data?.data?.stores || [];
|
|
24
24
|
} catch (error) {
|
|
25
25
|
console.error('Error fetching getStores:', error);
|
|
@@ -33,7 +33,7 @@ export const getStoreReviewLink = async function (this: WashdayClientInstance, s
|
|
|
33
33
|
const config = {
|
|
34
34
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
35
35
|
};
|
|
36
|
-
const response = await axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
|
|
36
|
+
const response = await this.axiosInstance.get(`${GET_SET_STORES}/review-link/${storeId}`, config);
|
|
37
37
|
return response;
|
|
38
38
|
} catch (error) {
|
|
39
39
|
console.error('Error fetching getStoreReviewLink:', error);
|
|
@@ -44,7 +44,7 @@ export const getStoreReviewLink = async function (this: WashdayClientInstance, s
|
|
|
44
44
|
export const getStoreById = async function (this: WashdayClientInstance, storeId: string): Promise<{ store: IStore }> {
|
|
45
45
|
try {
|
|
46
46
|
REQUEST_PARAMS.token = this.apiToken;
|
|
47
|
-
const response = await axiosInstance.get(`${GET_SET_STORES}/${storeId}`, { params: { ...REQUEST_PARAMS } });
|
|
47
|
+
const response = await this.axiosInstance.get(`${GET_SET_STORES}/${storeId}`, { params: { ...REQUEST_PARAMS } });
|
|
48
48
|
return response.data?.data || {}
|
|
49
49
|
} catch (error) {
|
|
50
50
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -57,7 +57,7 @@ export const getStoreImages = async function (this: WashdayClientInstance, store
|
|
|
57
57
|
const config = {
|
|
58
58
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
59
59
|
};
|
|
60
|
-
const response = await axiosInstance.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
|
|
60
|
+
const response = await this.axiosInstance.get(`${GET_SET_STORE_IMAGE}?store=${storeId}`, config);
|
|
61
61
|
return response;
|
|
62
62
|
} catch (error) {
|
|
63
63
|
console.error('Error fetching getStoreImages:', error);
|
|
@@ -71,7 +71,7 @@ export const getStoresByName = async function (this: WashdayClientInstance, quer
|
|
|
71
71
|
try {
|
|
72
72
|
const config = {};
|
|
73
73
|
const queryParams = generateQueryParamsStr(['q'], query);
|
|
74
|
-
const response = await axiosInstance.get(`${GET_STORES_WASHDAY_APP}?${queryParams}`, config);
|
|
74
|
+
const response = await this.axiosInstance.get(`${GET_STORES_WASHDAY_APP}?${queryParams}`, config);
|
|
75
75
|
return response.data?.data?.stores || [];
|
|
76
76
|
} catch (error) {
|
|
77
77
|
console.error('Error fetching getStoresByName:', error);
|
|
@@ -84,7 +84,7 @@ export const getStoresByIdCustomersApp = async function (this: WashdayClientInst
|
|
|
84
84
|
const config = {
|
|
85
85
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
86
86
|
};
|
|
87
|
-
const response = await axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
|
|
87
|
+
const response = await this.axiosInstance.get(`${GET_STORES_WASHDAY_APP}/${id}`, config);
|
|
88
88
|
return response.data?.data?.store || [];
|
|
89
89
|
} catch (error) {
|
|
90
90
|
console.error('Error fetching getStoresByIdCustomersApp:', error);
|
package/src/api/stores/post.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const createStoreImage = async function (this: WashdayClientInstance, dat
|
|
|
10
10
|
const config = {
|
|
11
11
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
12
12
|
};
|
|
13
|
-
const response = await axiosInstance.post(`${GET_SET_STORE_IMAGE}`, data, config);
|
|
13
|
+
const response = await this.axiosInstance.post(`${GET_SET_STORE_IMAGE}`, data, config);
|
|
14
14
|
return response;
|
|
15
15
|
} catch (error) {
|
|
16
16
|
console.error('Error fetching createStoreImage:', error);
|
|
@@ -23,7 +23,7 @@ export const createStore = async function (this: WashdayClientInstance, data: an
|
|
|
23
23
|
const config = {
|
|
24
24
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
25
25
|
};
|
|
26
|
-
const response = await axiosInstance.post(`${GET_SET_STORES}`, data, config);
|
|
26
|
+
const response = await this.axiosInstance.post(`${GET_SET_STORES}`, data, config);
|
|
27
27
|
return response;
|
|
28
28
|
} catch (error) {
|
|
29
29
|
console.error('Error fetching createStore:', error);
|
|
@@ -37,7 +37,7 @@ export const copyStore = async function (this: WashdayClientInstance, copyStoreI
|
|
|
37
37
|
const config = {
|
|
38
38
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
39
39
|
};
|
|
40
|
-
const response = await axiosInstance.post(`${GET_SET_STORES}/copy`, {
|
|
40
|
+
const response = await this.axiosInstance.post(`${GET_SET_STORES}/copy`, {
|
|
41
41
|
fromStoreId: copyStoreId
|
|
42
42
|
}, config);
|
|
43
43
|
return response;
|
package/src/api/stores/put.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const updateStoreById = async function (this: WashdayClientInstance, stor
|
|
|
12
12
|
const config = {
|
|
13
13
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
14
14
|
};
|
|
15
|
-
const response = await axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
|
|
15
|
+
const response = await this.axiosInstance.put(`${GET_SET_STORES}/${storeId}`, data, config);
|
|
16
16
|
return response.data || {}
|
|
17
17
|
} catch (error) {
|
|
18
18
|
console.error('Error fetching getStoreById:', error);
|
|
@@ -26,7 +26,7 @@ export const deleteStoreById = async function (this: WashdayClientInstance, stor
|
|
|
26
26
|
const config = {
|
|
27
27
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
28
28
|
};
|
|
29
|
-
const response = await axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
29
|
+
const response = await this.axiosInstance.delete(`${GET_SET_STORES}/${storeId}`, config);
|
|
30
30
|
return response;
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error('Error fetching deleteStoreById:', error);
|