washday-sdk 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/index.js +6 -0
- package/dist/api/integrations/delete.js +1 -0
- package/dist/api/integrations/get.js +23 -0
- package/dist/api/integrations/index.js +3 -0
- package/dist/api/integrations/post.js +36 -0
- package/dist/api/integrations/put.js +1 -0
- 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/index.ts +8 -1
- package/src/api/integrations/delete.ts +0 -0
- package/src/api/integrations/get.ts +15 -0
- package/src/api/integrations/index.ts +3 -0
- package/src/api/integrations/post.ts +30 -0
- package/src/api/integrations/put.ts +0 -0
- 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/src/interfaces/Api.ts +6 -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_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
11
|
export const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
17
|
+
const response = yield this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
19
18
|
return response;
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -30,7 +29,7 @@ export const getCashierboxesById = function (storeId, id, queryParams) {
|
|
|
30
29
|
const config = {
|
|
31
30
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
31
|
};
|
|
33
|
-
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
32
|
+
const response = yield this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}?${queryParams}`, config);
|
|
34
33
|
return response;
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
@@ -52,7 +51,7 @@ export const getCashierBoxMovementsHistory = function (storeId, id, params) {
|
|
|
52
51
|
if (params === null || params === void 0 ? void 0 : params.hasOwnProperty('limit')) {
|
|
53
52
|
queryParams += `&limit=${params === null || params === void 0 ? void 0 : params.limit}`;
|
|
54
53
|
}
|
|
55
|
-
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
54
|
+
const response = yield this.axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}/${id}/history?${queryParams}`, config);
|
|
56
55
|
return response;
|
|
57
56
|
}
|
|
58
57
|
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_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
11
|
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
13
12
|
export const createCashierBox = function (storeId, data) {
|
|
@@ -16,7 +15,7 @@ export const createCashierBox = function (storeId, data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const addCashierBoxMovement = function (storeId, id, data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.post(`${GET_SET_CASHIER_BOX(storeId)}/${id}/add-movement`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
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_CASHIER_BOX = (storeId) => `api/store/${storeId}/cashierbox`;
|
|
12
11
|
const GET_SET_CASHIER_BOX_MOVEMENT = (storeId, cashierBoxId) => `/api/store/cashierbox/movement/${storeId}/${cashierBoxId}`;
|
|
13
12
|
export const updateCashierBoxById = function (storeId, id, data) {
|
|
@@ -16,7 +15,7 @@ export const updateCashierBoxById = function (storeId, id, data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.put(`${GET_SET_CASHIER_BOX(storeId)}/${id}`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const updateCashierBoxMovementById = function (_a, data_1) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.put(`${GET_SET_CASHIER_BOX_MOVEMENT(storeId, cashierBoxId)}/${id}`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
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
|
const REQUEST_PARAMS = {
|
|
13
12
|
token: 'LOGGED_USER_TOKEN',
|
|
@@ -18,7 +17,7 @@ export const getCompanyById = function (companyId) {
|
|
|
18
17
|
const config = {
|
|
19
18
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
20
19
|
};
|
|
21
|
-
const response = yield axiosInstance.get(`${GET_SET_COMPANIES}/${companyId}`, config);
|
|
20
|
+
const response = yield this.axiosInstance.get(`${GET_SET_COMPANIES}/${companyId}`, config);
|
|
22
21
|
return response;
|
|
23
22
|
}
|
|
24
23
|
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 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) {
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -14,7 +14,7 @@ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
|
14
14
|
// const config = {
|
|
15
15
|
// headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
16
16
|
// };
|
|
17
|
-
// 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);
|
|
18
18
|
// return response.data || {}
|
|
19
19
|
// } catch (error) {
|
|
20
20
|
// console.error('Error fetching getStoreById:', error);
|
package/dist/api/index.js
CHANGED
|
@@ -42,6 +42,7 @@ import * as outsourcedOrdersEndpoints from './outsourcedOrders';
|
|
|
42
42
|
import * as publicsEndpoints from './publics';
|
|
43
43
|
import { validateUserPin } from "./users/post";
|
|
44
44
|
import { getAxiosInstance } from "./axiosInstance";
|
|
45
|
+
import * as integrationsEndpoints from './integrations';
|
|
45
46
|
function bindMethods(instance, methods) {
|
|
46
47
|
const boundMethods = {};
|
|
47
48
|
for (const key in methods) {
|
|
@@ -323,5 +324,10 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD') {
|
|
|
323
324
|
clockOut: attendanceEndpoints.postModule.clockOut,
|
|
324
325
|
updateById: attendanceEndpoints.putModule.updateById,
|
|
325
326
|
});
|
|
327
|
+
this.integrations = bindMethods(this, {
|
|
328
|
+
getMPConnectionStatus: integrationsEndpoints.getModule.getMPConnectionStatus,
|
|
329
|
+
startMPOAuthFlow: integrationsEndpoints.postModule.startMPOAuthFlow,
|
|
330
|
+
disconnectMP: integrationsEndpoints.postModule.disconnectMP,
|
|
331
|
+
});
|
|
326
332
|
};
|
|
327
333
|
export default WashdayClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const BASE_ROUTER = 'api/integrations';
|
|
11
|
+
export const getMPConnectionStatus = function () {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
try {
|
|
14
|
+
const config = {
|
|
15
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
16
|
+
};
|
|
17
|
+
return yield this.axiosInstance.get(`${BASE_ROUTER}/mp/connection`, config);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const BASE_ROUTER = 'api/integrations';
|
|
11
|
+
export const startMPOAuthFlow = function (data) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
try {
|
|
14
|
+
const config = {
|
|
15
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
16
|
+
};
|
|
17
|
+
return yield this.axiosInstance.post(`${BASE_ROUTER}/mp/oauth/start`, data, config);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
export const disconnectMP = function () {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
try {
|
|
27
|
+
const config = {
|
|
28
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
29
|
+
};
|
|
30
|
+
return yield this.axiosInstance.post(`${BASE_ROUTER}/mp/disconnect`, {}, config);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -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) {
|
|
@@ -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) {
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import axiosInstance from "../axiosInstance";
|
|
11
10
|
const GET_SET_PRODUCTS = 'api/product';
|
|
12
11
|
const GET_SET_PRODUCTS_SUPPLY = 'api/product-supply';
|
|
13
12
|
export const deleteById = function (id) {
|
|
@@ -45,7 +44,7 @@ export const deletePriceOption = function (productId, optionId) {
|
|
|
45
44
|
const config = {
|
|
46
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
46
|
};
|
|
48
|
-
const response = yield axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
47
|
+
const response = yield this.axiosInstance.delete(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, config);
|
|
49
48
|
return response.data || {};
|
|
50
49
|
}
|
|
51
50
|
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_PRODUCTS_SUPPLY = 'api/product-supply';
|
|
12
11
|
const GET_SET_PRODUCTS = 'api/product';
|
|
13
12
|
export const create = function (data) {
|
|
@@ -16,7 +15,7 @@ export const create = function (data) {
|
|
|
16
15
|
const config = {
|
|
17
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
17
|
};
|
|
19
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
18
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}`, data, config);
|
|
20
19
|
return response;
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
@@ -31,7 +30,7 @@ export const createProductSupply = function (id, data) {
|
|
|
31
30
|
const config = {
|
|
32
31
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
33
32
|
};
|
|
34
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
33
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS_SUPPLY}/${id}`, data, config);
|
|
35
34
|
return response;
|
|
36
35
|
}
|
|
37
36
|
catch (error) {
|
|
@@ -49,7 +48,7 @@ export const bulkCreate = function (storeId, data) {
|
|
|
49
48
|
'Content-Type': 'multipart/form-data' // Let axios handle the boundary
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
51
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
53
52
|
return response.data || {};
|
|
54
53
|
}
|
|
55
54
|
catch (error) {
|
|
@@ -65,7 +64,7 @@ export const createPriceOption = function (productId, data) {
|
|
|
65
64
|
const config = {
|
|
66
65
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
67
66
|
};
|
|
68
|
-
const response = yield axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
67
|
+
const response = yield this.axiosInstance.post(`${GET_SET_PRODUCTS}/${productId}/price-options`, data, config);
|
|
69
68
|
return response.data || {};
|
|
70
69
|
}
|
|
71
70
|
catch (error) {
|
package/dist/api/products/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_PRODUCTS = 'api/product';
|
|
12
11
|
export const bulkUpdate = function (storeId, data) {
|
|
13
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -15,7 +14,7 @@ export const bulkUpdate = function (storeId, data) {
|
|
|
15
14
|
const config = {
|
|
16
15
|
headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
|
|
17
16
|
};
|
|
18
|
-
const response = yield axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
17
|
+
const response = yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${storeId}/bulk`, data, config);
|
|
19
18
|
return response.data || {};
|
|
20
19
|
}
|
|
21
20
|
catch (error) {
|
|
@@ -45,7 +44,7 @@ export const updatePriceOption = function (productId, optionId, data) {
|
|
|
45
44
|
const config = {
|
|
46
45
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
47
46
|
};
|
|
48
|
-
const response = yield axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
47
|
+
const response = yield this.axiosInstance.put(`${GET_SET_PRODUCTS}/${productId}/price-options/${optionId}`, data, config);
|
|
49
48
|
return response.data || {};
|
|
50
49
|
}
|
|
51
50
|
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 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) {
|
package/dist/api/staff/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_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) {
|
package/dist/api/staff/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_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) {
|
package/dist/api/staff/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_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) {
|
package/dist/api/staff/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_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) {
|