washday-sdk 0.0.103 → 0.0.104

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,3 +70,24 @@ export const exportOrdersList = function (params) {
70
70
  }
71
71
  });
72
72
  };
73
+ export const exportProductsList = function (storeId) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ try {
76
+ const config = {
77
+ headers: {
78
+ Authorization: `Bearer ${this.apiToken}`,
79
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
80
+ 'Content-disposition': 'attachment; filename=[file.csv]'
81
+ },
82
+ params: {
83
+ responseType: 'blob'
84
+ }
85
+ };
86
+ return yield axiosInstance.get(`api/product/${storeId}/export`, config);
87
+ }
88
+ catch (error) {
89
+ console.error('Error fetching exportProductsList:', error);
90
+ throw error;
91
+ }
92
+ });
93
+ };
package/dist/api/index.js CHANGED
@@ -192,7 +192,8 @@ const WashdayClient = function WashdayClient(apiToken) {
192
192
  });
193
193
  this.csv = bindMethods(this, {
194
194
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
195
- exportOrdersList: csvExportEndpoints.getModule.exportOrdersList
195
+ exportOrdersList: csvExportEndpoints.getModule.exportOrdersList,
196
+ exportProductsList: csvExportEndpoints.getModule.exportProductsList
196
197
  });
197
198
  };
198
199
  export default WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.103",
3
+ "version": "0.0.104",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -83,4 +83,23 @@ export const exportOrdersList = async function (this: WashdayClientInstance, par
83
83
  console.error('Error fetching exportOrdersList:', error);
84
84
  throw error;
85
85
  }
86
+ };
87
+
88
+ export const exportProductsList = async function (this: WashdayClientInstance, storeId: string): Promise<any> {
89
+ try {
90
+ const config = {
91
+ headers: {
92
+ Authorization: `Bearer ${this.apiToken}`,
93
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
94
+ 'Content-disposition': 'attachment; filename=[file.csv]'
95
+ },
96
+ params: {
97
+ responseType: 'blob'
98
+ }
99
+ };
100
+ return await axiosInstance.get(`api/product/${storeId}/export`, config);
101
+ } catch (error) {
102
+ console.error('Error fetching exportProductsList:', error);
103
+ throw error;
104
+ }
86
105
  };
package/src/api/index.ts CHANGED
@@ -198,7 +198,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
198
198
  });
199
199
  this.csv = bindMethods(this, {
200
200
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
201
- exportOrdersList: csvExportEndpoints.getModule.exportOrdersList
201
+ exportOrdersList: csvExportEndpoints.getModule.exportOrdersList,
202
+ exportProductsList: csvExportEndpoints.getModule.exportProductsList
202
203
  });
203
204
  } as any;
204
205