washday-sdk 0.0.102 → 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.
- package/dist/api/csv/get.js +21 -0
- package/dist/api/index.js +2 -1
- package/dist/api/order/get.js +2 -1
- package/package.json +1 -1
- package/src/api/csv/get.ts +19 -0
- package/src/api/index.ts +2 -1
- package/src/api/order/get.ts +2 -1
package/dist/api/csv/get.js
CHANGED
|
@@ -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/dist/api/order/get.js
CHANGED
|
@@ -35,7 +35,8 @@ export const getList = function (params) {
|
|
|
35
35
|
'readyDateTime',
|
|
36
36
|
'collectedDateTime',
|
|
37
37
|
'q',
|
|
38
|
-
],
|
|
38
|
+
], params);
|
|
39
|
+
// ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
|
|
39
40
|
return yield axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
package/package.json
CHANGED
package/src/api/csv/get.ts
CHANGED
|
@@ -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
|
|
package/src/api/order/get.ts
CHANGED
|
@@ -45,7 +45,8 @@ export const getList = async function (this: WashdayClientInstance, params: {
|
|
|
45
45
|
'readyDateTime',
|
|
46
46
|
'collectedDateTime',
|
|
47
47
|
'q',
|
|
48
|
-
],
|
|
48
|
+
], params);
|
|
49
|
+
// ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
|
|
49
50
|
return await axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
|
|
50
51
|
} catch (error) {
|
|
51
52
|
console.error('Error fetching getList orders:', error);
|