washday-sdk 1.6.6 → 1.6.8
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 +27 -0
- package/dist/api/index.js +2 -0
- package/dist/api/reports/get.js +20 -0
- package/package.json +1 -1
- package/src/api/csv/get.ts +31 -1
- package/src/api/index.ts +2 -0
- package/src/api/reports/get.ts +23 -0
- package/src/interfaces/Api.ts +2 -0
package/dist/api/csv/get.js
CHANGED
|
@@ -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': 'text/csv; charset=utf-8',
|
|
383
|
+
'Content-disposition': 'attachment; filename=[file.csv]'
|
|
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,
|
|
@@ -305,6 +306,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
|
|
|
305
306
|
getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
|
|
306
307
|
getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
|
|
307
308
|
getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
|
|
309
|
+
getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
|
|
308
310
|
getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
|
|
309
311
|
getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
|
|
310
312
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
package/dist/api/reports/get.js
CHANGED
|
@@ -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
package/src/api/csv/get.ts
CHANGED
|
@@ -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': 'text/csv; charset=utf-8',
|
|
421
|
+
'Content-disposition': 'attachment; filename=[file.csv]'
|
|
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,
|
|
@@ -312,6 +313,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
312
313
|
getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
|
|
313
314
|
getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
|
|
314
315
|
getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
|
|
316
|
+
getScheduledDeliveries: reportsExportEndpoints.getModule.getScheduledDeliveries,
|
|
315
317
|
getAnnualSalesStatistics: reportsExportEndpoints.getModule.getAnnualSalesStatistics,
|
|
316
318
|
getPaymentMethodStatistics: reportsExportEndpoints.getModule.getPaymentMethodStatistics,
|
|
317
319
|
getProductsStatistics: reportsExportEndpoints.getModule.getProductsStatistics,
|
package/src/api/reports/get.ts
CHANGED
|
@@ -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
|
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -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,
|
|
@@ -297,6 +298,7 @@ export interface WashdayClientInstance {
|
|
|
297
298
|
getProductSalesReport: typeof reportsExportEndpoints.getModule.getProductSalesReport;
|
|
298
299
|
getPaymentLinesReport: typeof reportsExportEndpoints.getModule.getPaymentLinesReport;
|
|
299
300
|
getUnpaidOrdersReport: typeof reportsExportEndpoints.getModule.getUnpaidOrdersReport;
|
|
301
|
+
getScheduledDeliveries: typeof reportsExportEndpoints.getModule.getScheduledDeliveries;
|
|
300
302
|
getAnnualSalesStatistics: typeof reportsExportEndpoints.getModule.getAnnualSalesStatistics;
|
|
301
303
|
getPaymentMethodStatistics: typeof reportsExportEndpoints.getModule.getPaymentMethodStatistics;
|
|
302
304
|
getProductsStatistics: typeof reportsExportEndpoints.getModule.getProductsStatistics;
|