washday-sdk 1.6.6 → 1.6.7

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/index.js CHANGED
@@ -305,6 +305,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
305
305
  getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
306
306
  getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
307
307
  getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
308
+ getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
308
309
  getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
309
310
  getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
310
311
  getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
@@ -319,3 +319,23 @@ export const getCashUpReportsByDateRange = function (storeId, params) {
319
319
  }
320
320
  });
321
321
  };
322
+ export const getScheduledDeliveries = function (companyId, params) {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ try {
325
+ const config = {
326
+ headers: { Authorization: `Bearer ${this.apiToken}` }
327
+ };
328
+ const queryParams = generateQueryParamsStr([
329
+ 'storeId',
330
+ 'dateFrom',
331
+ 'dateTo',
332
+ 'includeDelivered',
333
+ ], params);
334
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries?${queryParams}`, config);
335
+ }
336
+ catch (error) {
337
+ console.error('Error fetching getScheduledDeliveries:', error);
338
+ throw error;
339
+ }
340
+ });
341
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -312,6 +312,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
312
312
  getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
313
313
  getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
314
314
  getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
315
+ getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
315
316
  getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
316
317
  getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
317
318
  getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
@@ -347,4 +347,27 @@ export const getCashUpReportsByDateRange = async function (this: WashdayClientIn
347
347
  console.error('Error fetching getCashUpReportsByDateRange:', error);
348
348
  throw error;
349
349
  }
350
+ };
351
+
352
+ export const getScheduledDeliveries = async function (this: WashdayClientInstance, companyId: string, params: {
353
+ storeId?: string
354
+ dateFrom?: string
355
+ dateTo?: string
356
+ includeDelivered?: string
357
+ }): Promise<any> {
358
+ try {
359
+ const config = {
360
+ headers: { Authorization: `Bearer ${this.apiToken}` }
361
+ };
362
+ const queryParams = generateQueryParamsStr([
363
+ 'storeId',
364
+ 'dateFrom',
365
+ 'dateTo',
366
+ 'includeDelivered',
367
+ ], params);
368
+ return await this.axiosInstance.get(`${GET_SET_REPORTS}/${companyId}/scheduledDeliveries?${queryParams}`, config);
369
+ } catch (error) {
370
+ console.error('Error fetching getScheduledDeliveries:', error);
371
+ throw error;
372
+ }
350
373
  };
@@ -297,6 +297,7 @@ export interface WashdayClientInstance {
297
297
  getProductSalesReport: typeof reportsExportEndpoints.getModule.getProductSalesReport;
298
298
  getPaymentLinesReport: typeof reportsExportEndpoints.getModule.getPaymentLinesReport;
299
299
  getUnpaidOrdersReport: typeof reportsExportEndpoints.getModule.getUnpaidOrdersReport;
300
+ getScheduledDeliveries: typeof reportsExportEndpoints.getModule.getScheduledDeliveries;
300
301
  getAnnualSalesStatistics: typeof reportsExportEndpoints.getModule.getAnnualSalesStatistics;
301
302
  getPaymentMethodStatistics: typeof reportsExportEndpoints.getModule.getPaymentMethodStatistics;
302
303
  getProductsStatistics: typeof reportsExportEndpoints.getModule.getProductsStatistics;