washday-sdk 0.0.189 → 0.0.191
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/cashups/get.js +1 -0
- package/dist/api/cfdi/get.js +21 -0
- package/dist/api/index.js +1 -0
- package/package.json +1 -1
- package/src/api/cashups/get.ts +2 -0
- package/src/api/cfdi/get.ts +19 -0
- package/src/api/index.ts +1 -0
- package/src/interfaces/Api.ts +1 -0
package/dist/api/cashups/get.js
CHANGED
package/dist/api/cfdi/get.js
CHANGED
|
@@ -70,6 +70,27 @@ export const downloadCFDIPDF = function (id) {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
+
export const downloadCFDIZIP = function (id) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
try {
|
|
76
|
+
const config = {
|
|
77
|
+
headers: {
|
|
78
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
79
|
+
'Content-Type': 'multipart/form-data',
|
|
80
|
+
'Content-disposition': 'attachment; filename=[file.zip]',
|
|
81
|
+
},
|
|
82
|
+
params: {
|
|
83
|
+
responseType: 'arraybuffer'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
return yield axiosInstance.get(`${GET_SET_CFDI}/${id}/download/zip`, config);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error('Error fetching downloadCFDIZIP:', error);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
};
|
|
73
94
|
export const sendCFDIByEmail = function (id) {
|
|
74
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
96
|
try {
|
package/dist/api/index.js
CHANGED
|
@@ -60,6 +60,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
60
60
|
this.cfdi = bindMethods(this, {
|
|
61
61
|
getList: cfdiEndpoints.getModule.getList,
|
|
62
62
|
downloadCFDIPDF: cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
63
|
+
downloadCFDIZIP: cfdiEndpoints.getModule.downloadCFDIZIP,
|
|
63
64
|
sendCFDIByEmail: cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
64
65
|
getCFDIPreview: cfdiEndpoints.getModule.getCFDIPreview,
|
|
65
66
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
package/package.json
CHANGED
package/src/api/cashups/get.ts
CHANGED
|
@@ -9,6 +9,7 @@ const GET_CASH_UP_REPORTS = 'api/cashupreports';
|
|
|
9
9
|
export const getList = async function (this: WashdayClientInstance, storeId: string, params: {
|
|
10
10
|
pageNum?: string;
|
|
11
11
|
limit?: string;
|
|
12
|
+
cashierBoxId?: string;
|
|
12
13
|
}): Promise<any> {
|
|
13
14
|
try {
|
|
14
15
|
const config = {
|
|
@@ -17,6 +18,7 @@ export const getList = async function (this: WashdayClientInstance, storeId: str
|
|
|
17
18
|
const queryParams = generateQueryParamsStr([
|
|
18
19
|
'pageNum',
|
|
19
20
|
'limit',
|
|
21
|
+
'cashierBoxId'
|
|
20
22
|
], params);
|
|
21
23
|
return await axiosInstance.get(`${GET_CASH_UP_REPORTS}/${storeId}?${queryParams}`, config);
|
|
22
24
|
} catch (error) {
|
package/src/api/cfdi/get.ts
CHANGED
|
@@ -66,6 +66,25 @@ export const downloadCFDIPDF = async function (this: WashdayClientInstance, id:
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
export const downloadCFDIZIP = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
70
|
+
try {
|
|
71
|
+
const config = {
|
|
72
|
+
headers: {
|
|
73
|
+
Authorization: `Bearer ${this.apiToken}`,
|
|
74
|
+
'Content-Type': 'multipart/form-data',
|
|
75
|
+
'Content-disposition': 'attachment; filename=[file.zip]',
|
|
76
|
+
},
|
|
77
|
+
params: {
|
|
78
|
+
responseType: 'arraybuffer'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return await axiosInstance.get(`${GET_SET_CFDI}/${id}/download/zip`, config);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('Error fetching downloadCFDIZIP:', error);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
69
88
|
|
|
70
89
|
export const sendCFDIByEmail = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
71
90
|
try {
|
package/src/api/index.ts
CHANGED
|
@@ -67,6 +67,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
67
67
|
this.cfdi = bindMethods(this, {
|
|
68
68
|
getList: cfdiEndpoints.getModule.getList,
|
|
69
69
|
downloadCFDIPDF: cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
70
|
+
downloadCFDIZIP: cfdiEndpoints.getModule.downloadCFDIZIP,
|
|
70
71
|
sendCFDIByEmail: cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
71
72
|
getCFDIPreview: cfdiEndpoints.getModule.getCFDIPreview,
|
|
72
73
|
getCFDIPreviewByOrderId: cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -52,6 +52,7 @@ export interface WashdayClientInstance {
|
|
|
52
52
|
cfdi: {
|
|
53
53
|
getList: typeof cfdiEndpoints.getModule.getList,
|
|
54
54
|
downloadCFDIPDF: typeof cfdiEndpoints.getModule.downloadCFDIPDF,
|
|
55
|
+
downloadCFDIZIP: typeof cfdiEndpoints.getModule.downloadCFDIZIP,
|
|
55
56
|
sendCFDIByEmail: typeof cfdiEndpoints.getModule.sendCFDIByEmail,
|
|
56
57
|
getCFDIPreview: typeof cfdiEndpoints.getModule.getCFDIPreview,
|
|
57
58
|
getCFDIPreviewByOrderId: typeof cfdiEndpoints.getModule.getCFDIPreviewByOrderId,
|