washday-sdk 0.0.90 → 0.0.92
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/cfdi/get.js +1 -0
- package/dist/api/index.js +3 -1
- package/dist/api/order/get.js +34 -0
- package/package.json +1 -1
- package/src/api/cfdi/get.ts +1 -1
- package/src/api/index.ts +3 -1
- package/src/api/order/get.ts +35 -0
- package/src/interfaces/Api.ts +2 -0
package/dist/api/cfdi/get.js
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -55,7 +55,8 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
55
55
|
getGlobalCFDIPreview: cfdiEndpoints.getModule.getGlobalCFDIPreview,
|
|
56
56
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
57
57
|
createCFDI: cfdiEndpoints.postModule.createCFDI,
|
|
58
|
-
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI
|
|
58
|
+
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI,
|
|
59
|
+
cancelCFDI: cfdiEndpoints.deleteModule.cancelCFDI
|
|
59
60
|
});
|
|
60
61
|
this.review = bindMethods(this, {
|
|
61
62
|
getList: reviewsEndpoints.getModule.getList,
|
|
@@ -64,6 +65,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
64
65
|
this.orders = bindMethods(this, {
|
|
65
66
|
getList: ordersEndpoints.getModule.getList,
|
|
66
67
|
getById: ordersEndpoints.getModule.getById,
|
|
68
|
+
fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
|
|
67
69
|
updateById: ordersEndpoints.putModule.updateById,
|
|
68
70
|
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
69
71
|
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
package/dist/api/order/get.js
CHANGED
|
@@ -56,3 +56,37 @@ export const getById = function (id) {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
+
export const getCFDIOrdersByDateAndStore = function (id) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
try {
|
|
62
|
+
const config = {
|
|
63
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
64
|
+
};
|
|
65
|
+
return yield axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('Error fetching:', error);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export const fetchOrdersForCFDI = function (params) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
try {
|
|
76
|
+
const config = {
|
|
77
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
78
|
+
};
|
|
79
|
+
const queryParams = generateQueryParamsStr([
|
|
80
|
+
"fromDate",
|
|
81
|
+
"toDate",
|
|
82
|
+
"storeID",
|
|
83
|
+
"customerID"
|
|
84
|
+
], params);
|
|
85
|
+
return yield axiosInstance.get(`${GET_SET_ORDER}/cfdiPreview?${queryParams}`, config);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error('Error fetching:', error);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
package/package.json
CHANGED
package/src/api/cfdi/get.ts
CHANGED
|
@@ -77,7 +77,7 @@ export const sendCFDIByEmail = async function (this: WashdayClientInstance, id:
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
// THIS IS FOR WHEN MODAL OPENS AND WE WANT TO GET PREVIEW DATA
|
|
81
81
|
export const getGlobalCFDIPreview = async function (this: WashdayClientInstance, params: {
|
|
82
82
|
ordersID?: string[];
|
|
83
83
|
customerId?: string
|
package/src/api/index.ts
CHANGED
|
@@ -61,7 +61,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
61
61
|
getGlobalCFDIPreview: cfdiEndpoints.getModule.getGlobalCFDIPreview,
|
|
62
62
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
63
63
|
createCFDI: cfdiEndpoints.postModule.createCFDI,
|
|
64
|
-
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI
|
|
64
|
+
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI,
|
|
65
|
+
cancelCFDI: cfdiEndpoints.deleteModule.cancelCFDI
|
|
65
66
|
});
|
|
66
67
|
this.review = bindMethods(this, {
|
|
67
68
|
getList: reviewsEndpoints.getModule.getList,
|
|
@@ -70,6 +71,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
70
71
|
this.orders = bindMethods(this, {
|
|
71
72
|
getList: ordersEndpoints.getModule.getList,
|
|
72
73
|
getById: ordersEndpoints.getModule.getById,
|
|
74
|
+
fetchOrdersForCFDI: ordersEndpoints.getModule.fetchOrdersForCFDI,
|
|
73
75
|
updateById: ordersEndpoints.putModule.updateById,
|
|
74
76
|
updatePaymentLineById: ordersEndpoints.putModule.updatePaymentLineById,
|
|
75
77
|
createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
|
package/src/api/order/get.ts
CHANGED
|
@@ -61,4 +61,39 @@ export const getById = async function (this: WashdayClientInstance, id: string):
|
|
|
61
61
|
console.error('Error fetching:', error);
|
|
62
62
|
throw error;
|
|
63
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const getCFDIOrdersByDateAndStore = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
|
|
67
|
+
try {
|
|
68
|
+
const config = {
|
|
69
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
70
|
+
};
|
|
71
|
+
return await axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error('Error fetching:', error);
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const fetchOrdersForCFDI = async function (this: WashdayClientInstance, params: {
|
|
79
|
+
fromDate: string
|
|
80
|
+
toDate: string
|
|
81
|
+
storeID: string
|
|
82
|
+
customerID?: string
|
|
83
|
+
}): Promise<any> {
|
|
84
|
+
try {
|
|
85
|
+
const config = {
|
|
86
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
87
|
+
};
|
|
88
|
+
const queryParams = generateQueryParamsStr([
|
|
89
|
+
"fromDate",
|
|
90
|
+
"toDate",
|
|
91
|
+
"storeID",
|
|
92
|
+
"customerID"
|
|
93
|
+
], params);
|
|
94
|
+
return await axiosInstance.get(`${GET_SET_ORDER}/cfdiPreview?${queryParams}`, config);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.error('Error fetching:', error);
|
|
97
|
+
throw error;
|
|
98
|
+
}
|
|
64
99
|
}
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -48,6 +48,7 @@ export interface WashdayClientInstance {
|
|
|
48
48
|
getCFDIPreviewByOrderId: typeof cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
49
49
|
createCFDI: typeof cfdiEndpoints.postModule.createCFDI,
|
|
50
50
|
createGlobalCFDI: typeof cfdiEndpoints.postModule.createGlobalCFDI
|
|
51
|
+
cancelCFDI: typeof cfdiEndpoints.deleteModule.cancelCFDI
|
|
51
52
|
}
|
|
52
53
|
review: {
|
|
53
54
|
getList: typeof reviewsEndpoints.getModule.getList;
|
|
@@ -56,6 +57,7 @@ export interface WashdayClientInstance {
|
|
|
56
57
|
orders: {
|
|
57
58
|
getList: typeof ordersEndpoints.getModule.getList;
|
|
58
59
|
getById: typeof ordersEndpoints.getModule.getById;
|
|
60
|
+
fetchOrdersForCFDI: typeof ordersEndpoints.getModule.fetchOrdersForCFDI;
|
|
59
61
|
updateById: typeof ordersEndpoints.putModule.updateById;
|
|
60
62
|
updatePaymentLineById: typeof ordersEndpoints.putModule.updatePaymentLineById;
|
|
61
63
|
createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
|