washday-sdk 0.0.98 → 0.0.100
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/index.js +1 -0
- package/dist/api/order/get.js +19 -0
- package/dist/api/order/put.js +7 -6
- package/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/order/get.ts +21 -0
- package/src/api/order/put.ts +7 -6
- package/src/interfaces/Api.ts +1 -0
package/dist/api/index.js
CHANGED
|
@@ -64,6 +64,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
64
64
|
});
|
|
65
65
|
this.orders = bindMethods(this, {
|
|
66
66
|
getList: ordersEndpoints.getModule.getList,
|
|
67
|
+
getOrdersHeaderSummary: ordersEndpoints.getModule.getOrdersHeaderSummary,
|
|
67
68
|
getById: ordersEndpoints.getModule.getById,
|
|
68
69
|
fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
|
|
69
70
|
updateById: ordersEndpoints.putModule.updateById,
|
package/dist/api/order/get.js
CHANGED
|
@@ -11,6 +11,7 @@ import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
|
11
11
|
import axiosInstance from "../axiosInstance";
|
|
12
12
|
const GET_SET_ORDER = 'api/v2/order';
|
|
13
13
|
const GET_SET_ORDER_CFDI = 'api/v2/orders';
|
|
14
|
+
const GET_HEADER_SUMMARY = 'api/orderHeaderSummary';
|
|
14
15
|
export const getList = function (params) {
|
|
15
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
17
|
try {
|
|
@@ -43,6 +44,24 @@ export const getList = function (params) {
|
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
};
|
|
47
|
+
export const getOrdersHeaderSummary = function (params) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
try {
|
|
50
|
+
const config = {
|
|
51
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
52
|
+
};
|
|
53
|
+
const queryParams = generateQueryParamsStr([
|
|
54
|
+
'store',
|
|
55
|
+
'status',
|
|
56
|
+
], params);
|
|
57
|
+
return yield axiosInstance.get(`${GET_HEADER_SUMMARY}?${queryParams}`, config);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('Error fetching getOrdersHeaderSummary :', error);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
46
65
|
export const getById = function (id) {
|
|
47
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
67
|
try {
|
package/dist/api/order/put.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
11
|
const GET_SET_ORDER = 'api/v2/order';
|
|
12
|
+
const GET_SET_ORDER_OLD = 'api/order';
|
|
12
13
|
const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
13
14
|
export const updateById = function (id, data) {
|
|
14
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -44,7 +45,7 @@ export const setOrderCancelledBySequence = function (sequence, storeId, data) {
|
|
|
44
45
|
const config = {
|
|
45
46
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
46
47
|
};
|
|
47
|
-
return yield axiosInstance.put(`${
|
|
48
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
|
|
48
49
|
}
|
|
49
50
|
catch (error) {
|
|
50
51
|
console.error('Error fetching setOrderCancelledBySequence:', error);
|
|
@@ -58,7 +59,7 @@ export const setOrderCleanedBySequence = function (sequence, storeId, data) {
|
|
|
58
59
|
const config = {
|
|
59
60
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
60
61
|
};
|
|
61
|
-
return yield axiosInstance.put(`${
|
|
62
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned`, data, config);
|
|
62
63
|
}
|
|
63
64
|
catch (error) {
|
|
64
65
|
console.error('Error fetching setOrderCleanedBySequence:', error);
|
|
@@ -72,7 +73,7 @@ export const setOrderCollectedBySequence = function (sequence, storeId, data) {
|
|
|
72
73
|
const config = {
|
|
73
74
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
74
75
|
};
|
|
75
|
-
return yield axiosInstance.put(`${
|
|
76
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
|
|
76
77
|
}
|
|
77
78
|
catch (error) {
|
|
78
79
|
console.error('Error fetching setOrderCollectedBySequence:', error);
|
|
@@ -86,7 +87,7 @@ export const setOrdePickingBySequence = function (sequence, storeId, data) {
|
|
|
86
87
|
const config = {
|
|
87
88
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
88
89
|
};
|
|
89
|
-
return yield axiosInstance.put(`${
|
|
90
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
|
|
90
91
|
}
|
|
91
92
|
catch (error) {
|
|
92
93
|
console.error('Error fetching setOrdePickingBySequence:', error);
|
|
@@ -100,7 +101,7 @@ export const setOrdeDeliveringBySequence = function (sequence, storeId, data) {
|
|
|
100
101
|
const config = {
|
|
101
102
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
102
103
|
};
|
|
103
|
-
return yield axiosInstance.put(`${
|
|
104
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
|
|
104
105
|
}
|
|
105
106
|
catch (error) {
|
|
106
107
|
console.error('Error fetching setOrdeDeliveringBySequence:', error);
|
|
@@ -114,7 +115,7 @@ export const setOrdeDeliveredBySequence = function (sequence, storeId, data) {
|
|
|
114
115
|
const config = {
|
|
115
116
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
116
117
|
};
|
|
117
|
-
return yield axiosInstance.put(`${
|
|
118
|
+
return yield axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
|
|
118
119
|
}
|
|
119
120
|
catch (error) {
|
|
120
121
|
console.error('Error fetching setOrdeDeliveredBySequence:', error);
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -70,6 +70,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
70
70
|
});
|
|
71
71
|
this.orders = bindMethods(this, {
|
|
72
72
|
getList: ordersEndpoints.getModule.getList,
|
|
73
|
+
getOrdersHeaderSummary: ordersEndpoints.getModule.getOrdersHeaderSummary,
|
|
73
74
|
getById: ordersEndpoints.getModule.getById,
|
|
74
75
|
fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
|
|
75
76
|
updateById: ordersEndpoints.putModule.updateById,
|
package/src/api/order/get.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { generateQueryParamsStr } from "../../utils/apiUtils";
|
|
|
4
4
|
import axiosInstance from "../axiosInstance";
|
|
5
5
|
const GET_SET_ORDER = 'api/v2/order';
|
|
6
6
|
const GET_SET_ORDER_CFDI = 'api/v2/orders';
|
|
7
|
+
const GET_HEADER_SUMMARY = 'api/orderHeaderSummary';
|
|
7
8
|
|
|
8
9
|
export const getList = async function (this: WashdayClientInstance, params: {
|
|
9
10
|
store: string | undefined,
|
|
@@ -52,6 +53,26 @@ export const getList = async function (this: WashdayClientInstance, params: {
|
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
|
|
56
|
+
export const getOrdersHeaderSummary = async function (this: WashdayClientInstance, params: {
|
|
57
|
+
store?: string,
|
|
58
|
+
status?: string,
|
|
59
|
+
}): Promise<any> {
|
|
60
|
+
try {
|
|
61
|
+
const config = {
|
|
62
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
63
|
+
};
|
|
64
|
+
const queryParams = generateQueryParamsStr([
|
|
65
|
+
'store',
|
|
66
|
+
'status',
|
|
67
|
+
], params);
|
|
68
|
+
|
|
69
|
+
return await axiosInstance.get(`${GET_HEADER_SUMMARY}?${queryParams}`, config);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
console.error('Error fetching getOrdersHeaderSummary :', error);
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
55
76
|
export const getById = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
|
|
56
77
|
try {
|
|
57
78
|
const config = {
|
package/src/api/order/put.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
const GET_SET_ORDER = 'api/v2/order';
|
|
4
|
+
const GET_SET_ORDER_OLD = 'api/order';
|
|
4
5
|
const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
|
|
5
6
|
|
|
6
7
|
export const updateById = async function (this: WashdayClientInstance, id: string, data: {
|
|
@@ -59,7 +60,7 @@ export const setOrderCancelledBySequence = async function (this: WashdayClientIn
|
|
|
59
60
|
const config = {
|
|
60
61
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
61
62
|
};
|
|
62
|
-
return await axiosInstance.put(`${
|
|
63
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cancelled`, data, config);
|
|
63
64
|
} catch (error) {
|
|
64
65
|
console.error('Error fetching setOrderCancelledBySequence:', error);
|
|
65
66
|
throw error;
|
|
@@ -74,7 +75,7 @@ export const setOrderCleanedBySequence = async function (this: WashdayClientInst
|
|
|
74
75
|
const config = {
|
|
75
76
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
76
77
|
};
|
|
77
|
-
return await axiosInstance.put(`${
|
|
78
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/cleaned`, data, config);
|
|
78
79
|
} catch (error) {
|
|
79
80
|
console.error('Error fetching setOrderCleanedBySequence:', error);
|
|
80
81
|
throw error;
|
|
@@ -88,7 +89,7 @@ export const setOrderCollectedBySequence = async function (this: WashdayClientIn
|
|
|
88
89
|
const config = {
|
|
89
90
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
90
91
|
};
|
|
91
|
-
return await axiosInstance.put(`${
|
|
92
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/collected`, data, config);
|
|
92
93
|
} catch (error) {
|
|
93
94
|
console.error('Error fetching setOrderCollectedBySequence:', error);
|
|
94
95
|
throw error;
|
|
@@ -102,7 +103,7 @@ export const setOrdePickingBySequence = async function (this: WashdayClientInsta
|
|
|
102
103
|
const config = {
|
|
103
104
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
104
105
|
};
|
|
105
|
-
return await axiosInstance.put(`${
|
|
106
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/picking`, data, config);
|
|
106
107
|
} catch (error) {
|
|
107
108
|
console.error('Error fetching setOrdePickingBySequence:', error);
|
|
108
109
|
throw error;
|
|
@@ -116,7 +117,7 @@ export const setOrdeDeliveringBySequence = async function (this: WashdayClientIn
|
|
|
116
117
|
const config = {
|
|
117
118
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
118
119
|
};
|
|
119
|
-
return await axiosInstance.put(`${
|
|
120
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivering`, data, config);
|
|
120
121
|
} catch (error) {
|
|
121
122
|
console.error('Error fetching setOrdeDeliveringBySequence:', error);
|
|
122
123
|
throw error;
|
|
@@ -130,7 +131,7 @@ export const setOrdeDeliveredBySequence = async function (this: WashdayClientIns
|
|
|
130
131
|
const config = {
|
|
131
132
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
132
133
|
};
|
|
133
|
-
return await axiosInstance.put(`${
|
|
134
|
+
return await axiosInstance.put(`${GET_SET_ORDER_OLD}/${sequence}/${storeId}/delivered`, data, config);
|
|
134
135
|
} catch (error) {
|
|
135
136
|
console.error('Error fetching setOrdeDeliveredBySequence:', error);
|
|
136
137
|
throw error;
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -56,6 +56,7 @@ export interface WashdayClientInstance {
|
|
|
56
56
|
}
|
|
57
57
|
orders: {
|
|
58
58
|
getList: typeof ordersEndpoints.getModule.getList;
|
|
59
|
+
getOrdersHeaderSummary: typeof ordersEndpoints.getModule.getOrdersHeaderSummary;
|
|
59
60
|
getById: typeof ordersEndpoints.getModule.getById;
|
|
60
61
|
fetchOrdersForCFDI: typeof ordersEndpoints.getModule.fetchOrdersForCFDI;
|
|
61
62
|
updateById: typeof ordersEndpoints.putModule.updateById;
|