washday-sdk 0.0.99 → 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/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/order/get.ts +21 -0
- 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/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/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;
|