washday-sdk 1.6.39 → 1.6.40

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.
@@ -20,10 +20,10 @@ jobs:
20
20
  ref: ${{ github.head_ref }}
21
21
  token: ${{ secrets.GITHUB_TOKEN }}
22
22
 
23
- - name: Use Node.js 22
23
+ - name: Use Node.js 24
24
24
  uses: actions/setup-node@v4
25
25
  with:
26
- node-version: 22
26
+ node-version: 24
27
27
 
28
28
  - name: Configure git identity
29
29
  run: |
@@ -17,13 +17,10 @@ jobs:
17
17
  - name: Checkout
18
18
  uses: actions/checkout@v4
19
19
 
20
- - name: Use Node.js 22
20
+ - name: Use Node.js 24
21
21
  uses: actions/setup-node@v4
22
22
  with:
23
- node-version: 22
24
-
25
- - name: Update npm to latest
26
- run: npm install -g npm@latest
23
+ node-version: 24
27
24
 
28
25
  - name: Install dependencies
29
26
  run: npm ci
package/dist/api/index.js CHANGED
@@ -321,6 +321,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
321
321
  getDiscountCodesReport: reportsExportEndpoints.getModule.getDiscountCodesReport,
322
322
  getStaffReport: reportsExportEndpoints.getModule.getStaffReport,
323
323
  getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
324
+ getProductSalesDrillDown: reportsExportEndpoints.getModule.getProductSalesDrillDown,
324
325
  getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
325
326
  getCashierBoxMovementsReport: reportsExportEndpoints.getModule.getCashierBoxMovementsReport,
326
327
  getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
@@ -164,6 +164,26 @@ export const getProductSalesReport = function (storeId, params) {
164
164
  }
165
165
  });
166
166
  };
167
+ export const getProductSalesDrillDown = function (storeId, params) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ try {
170
+ const config = {
171
+ headers: { Authorization: `Bearer ${this.apiToken}` }
172
+ };
173
+ const queryParams = generateQueryParamsStr([
174
+ 'storeProductId',
175
+ 'fromDate',
176
+ 'toDate',
177
+ 'timezone',
178
+ ], params);
179
+ return yield this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales/drill-down?${queryParams}`, config);
180
+ }
181
+ catch (error) {
182
+ console.error('Error fetching getProductSalesDrillDown:', error);
183
+ throw error;
184
+ }
185
+ });
186
+ };
167
187
  export const getPaymentLinesReport = function (storeId, params) {
168
188
  return __awaiter(this, void 0, void 0, function* () {
169
189
  try {
@@ -0,0 +1,60 @@
1
+ const folioPreset = "large";
2
+ const spacingPreset = "medium";
3
+ const ticketStructure = {
4
+ showTotalPieces: false,
5
+ showEmisionDate: true,
6
+ showEmisionTime: true,
7
+ showLegend: true,
8
+ showPaymentMethod: true,
9
+ showStorePhone: true,
10
+ showCustomerPoints: false,
11
+ showDeliveryDate: true,
12
+ showDeliveryTime: true,
13
+ ticketLegendText: "Gracias",
14
+ showStoreName: true,
15
+ showCustomerName: true,
16
+ showCreatedByName: true,
17
+ showOrderNotes: false,
18
+ showTaxes: false,
19
+ showDiscounts: true,
20
+ showCredit: true,
21
+ customerNameFontSize: "small",
22
+ orderFolioFontSizePreset: folioPreset,
23
+ ticketLineSpacingPreset: spacingPreset,
24
+ ticketPrintFormat: "escpos",
25
+ };
26
+ const labelTicketStructure = Object.assign({}, ticketStructure);
27
+ const ticketForLaundryStructure = {
28
+ showTotalPieces: false,
29
+ showEmisionDate: true,
30
+ showEmisionTime: true,
31
+ showLegend: true,
32
+ showPaymentMethod: true,
33
+ showStorePhone: true,
34
+ showCustomerPoints: false,
35
+ showDeliveryDate: true,
36
+ showDeliveryTime: true,
37
+ ticketLegendText: "Gracias",
38
+ printLogoOnTicket: false,
39
+ showStoreName: true,
40
+ showCustomerName: true,
41
+ showCreatedByName: true,
42
+ showOrderNotes: false,
43
+ showTaxes: false,
44
+ showDiscounts: true,
45
+ showCredit: true,
46
+ customerNameFontSize: "medium",
47
+ orderFolioFontSizePreset: "large",
48
+ ticketLineSpacingPreset: "small",
49
+ ticketPrintFormat: "html",
50
+ };
51
+ if (ticketStructure.orderFolioFontSizePreset !== "large") {
52
+ throw new Error("Ticket structure folio preset was not preserved");
53
+ }
54
+ if (labelTicketStructure.ticketLineSpacingPreset !== "medium") {
55
+ throw new Error("Label ticket structure spacing preset was not preserved");
56
+ }
57
+ if (ticketForLaundryStructure.customerNameFontSize !== "medium") {
58
+ throw new Error("Laundry ticket structure customer font size was not preserved");
59
+ }
60
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.39",
3
+ "version": "1.6.40",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -328,6 +328,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
328
328
  getDiscountCodesReport: reportsExportEndpoints.getModule.getDiscountCodesReport,
329
329
  getStaffReport: reportsExportEndpoints.getModule.getStaffReport,
330
330
  getProductSalesReport: reportsExportEndpoints.getModule.getProductSalesReport,
331
+ getProductSalesDrillDown: reportsExportEndpoints.getModule.getProductSalesDrillDown,
331
332
  getPaymentLinesReport: reportsExportEndpoints.getModule.getPaymentLinesReport,
332
333
  getCashierBoxMovementsReport: reportsExportEndpoints.getModule.getCashierBoxMovementsReport,
333
334
  getUnpaidOrdersReport: reportsExportEndpoints.getModule.getUnpaidOrdersReport,
@@ -175,6 +175,29 @@ export const getProductSalesReport = async function (this: WashdayClientInstance
175
175
  }
176
176
  };
177
177
 
178
+ export const getProductSalesDrillDown = async function (this: WashdayClientInstance, storeId: string, params: {
179
+ storeProductId: string
180
+ fromDate?: string
181
+ toDate?: string
182
+ timezone?: string
183
+ }): Promise<any> {
184
+ try {
185
+ const config = {
186
+ headers: { Authorization: `Bearer ${this.apiToken}` }
187
+ };
188
+ const queryParams = generateQueryParamsStr([
189
+ 'storeProductId',
190
+ 'fromDate',
191
+ 'toDate',
192
+ 'timezone',
193
+ ], params);
194
+ return await this.axiosInstance.get(`${GET_SET_REPORTS}/${storeId}/productSales/drill-down?${queryParams}`, config);
195
+ } catch (error) {
196
+ console.error('Error fetching getProductSalesDrillDown:', error);
197
+ throw error;
198
+ }
199
+ };
200
+
178
201
  export const getPaymentLinesReport = async function (this: WashdayClientInstance, storeId: string, params: {
179
202
  fromDate?: string
180
203
  toDate?: string
@@ -313,6 +313,7 @@ export interface WashdayClientInstance {
313
313
  getDiscountCodesReport: typeof reportsExportEndpoints.getModule.getDiscountCodesReport;
314
314
  getStaffReport: typeof reportsExportEndpoints.getModule.getStaffReport;
315
315
  getProductSalesReport: typeof reportsExportEndpoints.getModule.getProductSalesReport;
316
+ getProductSalesDrillDown: typeof reportsExportEndpoints.getModule.getProductSalesDrillDown;
316
317
  getPaymentLinesReport: typeof reportsExportEndpoints.getModule.getPaymentLinesReport;
317
318
  getCashierBoxMovementsReport: typeof reportsExportEndpoints.getModule.getCashierBoxMovementsReport;
318
319
  getUnpaidOrdersReport: typeof reportsExportEndpoints.getModule.getUnpaidOrdersReport;
@@ -0,0 +1,74 @@
1
+ import {
2
+ ILabelTicketStructure,
3
+ ITicketForLaundryStructure,
4
+ ITicketStructure,
5
+ TicketVisualPreset,
6
+ } from "./Store";
7
+
8
+ const folioPreset: TicketVisualPreset = "large";
9
+ const spacingPreset: TicketVisualPreset = "medium";
10
+
11
+ const ticketStructure: ITicketStructure = {
12
+ showTotalPieces: false,
13
+ showEmisionDate: true,
14
+ showEmisionTime: true,
15
+ showLegend: true,
16
+ showPaymentMethod: true,
17
+ showStorePhone: true,
18
+ showCustomerPoints: false,
19
+ showDeliveryDate: true,
20
+ showDeliveryTime: true,
21
+ ticketLegendText: "Gracias",
22
+ showStoreName: true,
23
+ showCustomerName: true,
24
+ showCreatedByName: true,
25
+ showOrderNotes: false,
26
+ showTaxes: false,
27
+ showDiscounts: true,
28
+ showCredit: true,
29
+ customerNameFontSize: "small",
30
+ orderFolioFontSizePreset: folioPreset,
31
+ ticketLineSpacingPreset: spacingPreset,
32
+ ticketPrintFormat: "escpos",
33
+ };
34
+
35
+ const labelTicketStructure: ILabelTicketStructure = {
36
+ ...ticketStructure,
37
+ };
38
+
39
+ const ticketForLaundryStructure: ITicketForLaundryStructure = {
40
+ showTotalPieces: false,
41
+ showEmisionDate: true,
42
+ showEmisionTime: true,
43
+ showLegend: true,
44
+ showPaymentMethod: true,
45
+ showStorePhone: true,
46
+ showCustomerPoints: false,
47
+ showDeliveryDate: true,
48
+ showDeliveryTime: true,
49
+ ticketLegendText: "Gracias",
50
+ printLogoOnTicket: false,
51
+ showStoreName: true,
52
+ showCustomerName: true,
53
+ showCreatedByName: true,
54
+ showOrderNotes: false,
55
+ showTaxes: false,
56
+ showDiscounts: true,
57
+ showCredit: true,
58
+ customerNameFontSize: "medium",
59
+ orderFolioFontSizePreset: "large",
60
+ ticketLineSpacingPreset: "small",
61
+ ticketPrintFormat: "html",
62
+ };
63
+
64
+ if (ticketStructure.orderFolioFontSizePreset !== "large") {
65
+ throw new Error("Ticket structure folio preset was not preserved");
66
+ }
67
+
68
+ if (labelTicketStructure.ticketLineSpacingPreset !== "medium") {
69
+ throw new Error("Label ticket structure spacing preset was not preserved");
70
+ }
71
+
72
+ if (ticketForLaundryStructure.customerNameFontSize !== "medium") {
73
+ throw new Error("Laundry ticket structure customer font size was not preserved");
74
+ }
@@ -291,6 +291,7 @@ export interface IOrderPageConfig {
291
291
  }
292
292
 
293
293
  export type TicketPrintFormat = 'html' | 'escpos';
294
+ export type TicketVisualPreset = 'small' | 'medium' | 'large';
294
295
 
295
296
  export interface ITicketStructure {
296
297
  showTotalPieces: Boolean,
@@ -310,6 +311,9 @@ export interface ITicketStructure {
310
311
  showTaxes: Boolean,
311
312
  showDiscounts: Boolean,
312
313
  showCredit: Boolean,
314
+ customerNameFontSize?: TicketVisualPreset,
315
+ orderFolioFontSizePreset?: TicketVisualPreset,
316
+ ticketLineSpacingPreset?: TicketVisualPreset,
313
317
  ticketPrintFormat?: TicketPrintFormat,
314
318
  }
315
319
 
@@ -333,6 +337,9 @@ export interface ITicketForLaundryStructure {
333
337
  showTaxes: Boolean,
334
338
  showDiscounts: Boolean,
335
339
  showCredit: Boolean,
340
+ customerNameFontSize?: TicketVisualPreset,
341
+ orderFolioFontSizePreset?: TicketVisualPreset,
342
+ ticketLineSpacingPreset?: TicketVisualPreset,
336
343
  ticketPrintFormat?: TicketPrintFormat,
337
344
  }
338
345