washday-sdk 1.6.7 → 1.6.9

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.
@@ -373,3 +373,30 @@ export const exportAttendanceReport = function (storeId, params) {
373
373
  }
374
374
  });
375
375
  };
376
+ export const exportScheduledDeliveriesReport = function (companyId, params) {
377
+ return __awaiter(this, void 0, void 0, function* () {
378
+ try {
379
+ const config = {
380
+ headers: {
381
+ Authorization: `Bearer ${this.apiToken}`,
382
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
383
+ 'Content-disposition': 'attachment; filename=[file.xlsx]'
384
+ },
385
+ params: {
386
+ responseType: 'blob'
387
+ }
388
+ };
389
+ const queryParams = generateQueryParamsStr([
390
+ 'storeId',
391
+ 'dateFrom',
392
+ 'dateTo',
393
+ 'includeDelivered'
394
+ ], params);
395
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries/export/csv?${queryParams}`, config);
396
+ }
397
+ catch (error) {
398
+ console.error('Error fetching exportScheduledDeliveriesReport:', error);
399
+ throw error;
400
+ }
401
+ });
402
+ };
package/dist/api/index.js CHANGED
@@ -289,6 +289,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
289
289
  exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
290
290
  exportAttendanceReport: csvExportEndpoints.getModule.exportAttendanceReport,
291
291
  exportCashUpReportsByDateRange: csvExportEndpoints.getModule.exportCashUpReportsByDateRange,
292
+ exportScheduledDeliveriesReport: csvExportEndpoints.getModule.exportScheduledDeliveriesReport,
292
293
  });
293
294
  this.pdf = bindMethods(this, {
294
295
  exportUnpaidOrdersReportPDF: pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -405,4 +405,34 @@ export const exportAttendanceReport = async function (this: WashdayClientInstanc
405
405
  console.error('Error fetching exportAttendanceReport:', error);
406
406
  throw error;
407
407
  }
408
- };
408
+ };
409
+
410
+ export const exportScheduledDeliveriesReport = async function (this: WashdayClientInstance, companyId: string, params: {
411
+ storeId?: string
412
+ dateFrom?: string
413
+ dateTo?: string
414
+ includeDelivered?: string
415
+ }): Promise<any> {
416
+ try {
417
+ const config = {
418
+ headers: {
419
+ Authorization: `Bearer ${this.apiToken}`,
420
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
421
+ 'Content-disposition': 'attachment; filename=[file.xlsx]'
422
+ },
423
+ params: {
424
+ responseType: 'blob'
425
+ }
426
+ };
427
+ const queryParams = generateQueryParamsStr([
428
+ 'storeId',
429
+ 'dateFrom',
430
+ 'dateTo',
431
+ 'includeDelivered'
432
+ ], params);
433
+ return await this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries/export/csv?${queryParams}`, config);
434
+ } catch (error) {
435
+ console.error('Error fetching exportScheduledDeliveriesReport:', error);
436
+ throw error;
437
+ }
438
+ };
package/src/api/index.ts CHANGED
@@ -296,6 +296,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
296
296
  exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
297
297
  exportAttendanceReport: csvExportEndpoints.getModule.exportAttendanceReport,
298
298
  exportCashUpReportsByDateRange: csvExportEndpoints.getModule.exportCashUpReportsByDateRange,
299
+ exportScheduledDeliveriesReport: csvExportEndpoints.getModule.exportScheduledDeliveriesReport,
299
300
  });
300
301
  this.pdf = bindMethods(this, {
301
302
  exportUnpaidOrdersReportPDF: pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF,
@@ -275,6 +275,7 @@ export interface WashdayClientInstance {
275
275
  exportPaymentLinesReport: typeof csvExportEndpoints.getModule.exportPaymentLinesReport;
276
276
  exportUnpaidOrdersReportCSV: typeof csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV;
277
277
  exportCashUpReportsByDateRange: typeof csvExportEndpoints.getModule.exportCashUpReportsByDateRange;
278
+ exportScheduledDeliveriesReport: typeof csvExportEndpoints.getModule.exportScheduledDeliveriesReport;
278
279
  exportOrdersList: typeof csvExportEndpoints.getModule.exportOrdersList,
279
280
  exportProductsList: typeof csvExportEndpoints.getModule.exportProductsList,
280
281
  exportCleanedOrdersReport: typeof csvExportEndpoints.getModule.exportCleanedOrdersReport,