washday-sdk 0.0.190 → 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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.190",
3
+ "version": "0.0.191",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -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,
@@ -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,