washday-sdk 0.0.186 → 0.0.187
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 +4 -2
- package/dist/api/cfdi/post.js +3 -3
- package/dist/api/index.js +1 -1
- package/package.json +1 -1
- package/src/api/cfdi/get.ts +4 -2
- package/src/api/cfdi/post.ts +18 -9
- package/src/api/index.ts +1 -1
- package/src/interfaces/Api.ts +1 -1
package/dist/api/cfdi/get.js
CHANGED
|
@@ -33,6 +33,8 @@ export const getList = function (params) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
+
//todo: remove
|
|
37
|
+
//@DEPRECATED USE getCFDIPreview instead
|
|
36
38
|
export const getCFDIPreviewByOrderId = function (id) {
|
|
37
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
40
|
try {
|
|
@@ -83,7 +85,7 @@ export const sendCFDIByEmail = function (id) {
|
|
|
83
85
|
});
|
|
84
86
|
};
|
|
85
87
|
// THIS IS FOR WHEN MODAL OPENS AND WE WANT TO GET PREVIEW DATA
|
|
86
|
-
export const
|
|
88
|
+
export const getCFDIPreview = function (params) {
|
|
87
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
90
|
try {
|
|
89
91
|
const config = {
|
|
@@ -93,7 +95,7 @@ export const getGlobalCFDIPreview = function (params) {
|
|
|
93
95
|
'ordersID',
|
|
94
96
|
'customer',
|
|
95
97
|
], params);
|
|
96
|
-
return yield axiosInstance.get(`${GET_SET_CFDI}/
|
|
98
|
+
return yield axiosInstance.get(`${GET_SET_CFDI}/preview?${queryParams}`, config);
|
|
97
99
|
}
|
|
98
100
|
catch (error) {
|
|
99
101
|
console.error('Error fetching:', error);
|
package/dist/api/cfdi/post.js
CHANGED
|
@@ -10,16 +10,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import axiosInstance from "../axiosInstance";
|
|
11
11
|
const GET_SET_CFDI = 'api/cfdi';
|
|
12
12
|
const GET_SET_ORDERS_CFDI = (orderID) => `api/order/${orderID}/cfdi`;
|
|
13
|
-
export const createCFDI = function (
|
|
13
|
+
export const createCFDI = function (data) {
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
15
|
try {
|
|
16
16
|
const config = {
|
|
17
17
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
18
|
};
|
|
19
|
-
return yield axiosInstance.post(
|
|
19
|
+
return yield axiosInstance.post(GET_SET_CFDI, data, config);
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
|
-
console.error('Error
|
|
22
|
+
console.error('Error createCFDI:', error);
|
|
23
23
|
throw error;
|
|
24
24
|
}
|
|
25
25
|
});
|
package/dist/api/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
61
61
|
getList: cfdiEndpoints.getModule.getList,
|
|
62
62
|
downloadCFDIPDF: cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
63
63
|
sendCFDIByEmail: cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
64
|
-
|
|
64
|
+
getCFDIPreview: cfdiEndpoints.getModule.getCFDIPreview,
|
|
65
65
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
66
66
|
createCFDI: cfdiEndpoints.postModule.createCFDI,
|
|
67
67
|
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI,
|
package/package.json
CHANGED
package/src/api/cfdi/get.ts
CHANGED
|
@@ -32,6 +32,8 @@ export const getList = async function (this: WashdayClientInstance, params: {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
//todo: remove
|
|
36
|
+
//@DEPRECATED USE getCFDIPreview instead
|
|
35
37
|
export const getCFDIPreviewByOrderId = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
36
38
|
try {
|
|
37
39
|
const config = {
|
|
@@ -78,7 +80,7 @@ export const sendCFDIByEmail = async function (this: WashdayClientInstance, id:
|
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
// THIS IS FOR WHEN MODAL OPENS AND WE WANT TO GET PREVIEW DATA
|
|
81
|
-
export const
|
|
83
|
+
export const getCFDIPreview = async function (this: WashdayClientInstance, params: {
|
|
82
84
|
ordersID?: string[];
|
|
83
85
|
customer?: string
|
|
84
86
|
}): Promise<any> {
|
|
@@ -90,7 +92,7 @@ export const getGlobalCFDIPreview = async function (this: WashdayClientInstance,
|
|
|
90
92
|
'ordersID',
|
|
91
93
|
'customer',
|
|
92
94
|
], params);
|
|
93
|
-
return await axiosInstance.get(`${GET_SET_CFDI}/
|
|
95
|
+
return await axiosInstance.get(`${GET_SET_CFDI}/preview?${queryParams}`, config);
|
|
94
96
|
} catch (error) {
|
|
95
97
|
console.error('Error fetching:', error);
|
|
96
98
|
throw error;
|
package/src/api/cfdi/post.ts
CHANGED
|
@@ -3,21 +3,30 @@ import axiosInstance from "../axiosInstance";
|
|
|
3
3
|
const GET_SET_CFDI = 'api/cfdi';
|
|
4
4
|
const GET_SET_ORDERS_CFDI = (orderID: string) => `api/order/${orderID}/cfdi`;
|
|
5
5
|
|
|
6
|
-
export const createCFDI = async function (this: WashdayClientInstance,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export const createCFDI = async function (this: WashdayClientInstance, data: {
|
|
7
|
+
ordersID: string,
|
|
8
|
+
CFDIInfo: {
|
|
9
|
+
use: string
|
|
10
|
+
payment_method: string
|
|
11
|
+
payment_form: string
|
|
12
|
+
sendEmailInvoice?: boolean
|
|
13
|
+
date: string
|
|
14
|
+
env?: 'prod' | 'dev'
|
|
15
|
+
global?: {
|
|
16
|
+
periodicity: '',
|
|
17
|
+
months: '',
|
|
18
|
+
year: ''
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
customer?: string
|
|
13
22
|
}): Promise<any> {
|
|
14
23
|
try {
|
|
15
24
|
const config = {
|
|
16
25
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
26
|
};
|
|
18
|
-
return await axiosInstance.post(
|
|
27
|
+
return await axiosInstance.post(GET_SET_CFDI, data, config);
|
|
19
28
|
} catch (error) {
|
|
20
|
-
console.error('Error
|
|
29
|
+
console.error('Error createCFDI:', error);
|
|
21
30
|
throw error;
|
|
22
31
|
}
|
|
23
32
|
};
|
package/src/api/index.ts
CHANGED
|
@@ -68,7 +68,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
68
68
|
getList: cfdiEndpoints.getModule.getList,
|
|
69
69
|
downloadCFDIPDF: cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
70
70
|
sendCFDIByEmail: cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
71
|
-
|
|
71
|
+
getCFDIPreview: cfdiEndpoints.getModule.getCFDIPreview,
|
|
72
72
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
73
73
|
createCFDI: cfdiEndpoints.postModule.createCFDI,
|
|
74
74
|
createGlobalCFDI: cfdiEndpoints.postModule.createGlobalCFDI,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface WashdayClientInstance {
|
|
|
53
53
|
getList: typeof cfdiEndpoints.getModule.getList,
|
|
54
54
|
downloadCFDIPDF: typeof cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
55
55
|
sendCFDIByEmail: typeof cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
56
|
-
|
|
56
|
+
getCFDIPreview: typeof cfdiEndpoints.getModule.getCFDIPreview,
|
|
57
57
|
getCFDIPreviewByOrderId: typeof cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
|
58
58
|
createCFDI: typeof cfdiEndpoints.postModule.createCFDI,
|
|
59
59
|
createGlobalCFDI: typeof cfdiEndpoints.postModule.createGlobalCFDI
|