washday-sdk 0.0.183 → 0.0.185

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
@@ -38,6 +38,7 @@ import * as cashupsEndpoints from './cashups';
38
38
  import { deleteUserById } from "./users/delete";
39
39
  import * as partnersEndpoints from './partners';
40
40
  import * as outsourcedOrdersEndpoints from './outsourcedOrders';
41
+ import * as publicsEndpoints from './publics';
41
42
  function bindMethods(instance, methods) {
42
43
  const boundMethods = {};
43
44
  for (const key in methods) {
@@ -85,6 +86,9 @@ const WashdayClient = function WashdayClient(apiToken) {
85
86
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
86
87
  startRoute: routesEndpoints.postModule.startRoute,
87
88
  });
89
+ this.publics = bindMethods(this, {
90
+ getOrderPublicReceipt: publicsEndpoints.getModule.getOrderPublicReceipt,
91
+ });
88
92
  this.auth = bindMethods(this, {
89
93
  customerLoginToken: authEndpoints.postModule.customerLoginToken,
90
94
  googleLogin: authEndpoints.postModule.googleLogin,
@@ -254,6 +258,7 @@ const WashdayClient = function WashdayClient(apiToken) {
254
258
  exportCustomersReport: csvExportEndpoints.getModule.exportCustomersReport,
255
259
  exportSuppliesReport: csvExportEndpoints.getModule.exportSuppliesReport,
256
260
  exportDiscountCodesReport: csvExportEndpoints.getModule.exportDiscountCodesReport,
261
+ exportStaffReport: csvExportEndpoints.getModule.exportStaffReport,
257
262
  exportProductSalesReport: csvExportEndpoints.getModule.exportProductSalesReport,
258
263
  exportPaymentLinesReport: csvExportEndpoints.getModule.exportPaymentLinesReport,
259
264
  exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import axiosInstance from "../axiosInstance";
11
+ const GET_PUBLIC = '/api/public';
12
+ const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
13
+ export const getOrderPublicReceipt = function (orderId) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ try {
16
+ const config = {
17
+ headers: { Authorization: `Bearer ${this.apiToken}` }
18
+ };
19
+ return yield axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderId}/receipt`, config);
20
+ }
21
+ catch (error) {
22
+ console.error('Error fetching getOrderPublicReceipt:', error);
23
+ throw error;
24
+ }
25
+ });
26
+ };
@@ -0,0 +1 @@
1
+ export * as getModule from './get';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.183",
3
+ "version": "0.0.185",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -48,6 +48,10 @@ export const updateDiscountCodeById = async function (this: WashdayClientInstanc
48
48
  products?: string[];
49
49
  buyAndGetConditions?: any;
50
50
  freeProductSetting?: any;
51
+ name?: string;
52
+ code?: string;
53
+ fromDate?: string;
54
+ toDate?: string;
51
55
  }): Promise<any> {
52
56
  try {
53
57
  const config = {
package/src/api/index.ts CHANGED
@@ -40,6 +40,7 @@ import { deleteUserById } from "./users/delete";
40
40
  import { customersAppChangePassword } from './auth/post';
41
41
  import * as partnersEndpoints from './partners';
42
42
  import * as outsourcedOrdersEndpoints from './outsourcedOrders';
43
+ import * as publicsEndpoints from './publics';
43
44
 
44
45
  type WashdayClientConstructor = {
45
46
  new(apiToken: string): WashdayClientInstance
@@ -92,6 +93,9 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
92
93
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
93
94
  startRoute: routesEndpoints.postModule.startRoute,
94
95
  });
96
+ this.publics = bindMethods(this, {
97
+ getOrderPublicReceipt: publicsEndpoints.getModule.getOrderPublicReceipt,
98
+ });
95
99
  this.auth = bindMethods(this, {
96
100
  customerLoginToken: authEndpoints.postModule.customerLoginToken,
97
101
  googleLogin: authEndpoints.postModule.googleLogin,
@@ -261,6 +265,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
261
265
  exportCustomersReport: csvExportEndpoints.getModule.exportCustomersReport,
262
266
  exportSuppliesReport: csvExportEndpoints.getModule.exportSuppliesReport,
263
267
  exportDiscountCodesReport: csvExportEndpoints.getModule.exportDiscountCodesReport,
268
+ exportStaffReport: csvExportEndpoints.getModule.exportStaffReport,
264
269
  exportProductSalesReport: csvExportEndpoints.getModule.exportProductSalesReport,
265
270
  exportPaymentLinesReport: csvExportEndpoints.getModule.exportPaymentLinesReport,
266
271
  exportUnpaidOrdersReportCSV: csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV,
@@ -26,6 +26,7 @@ export const create = async function (this: WashdayClientInstance, data: {
26
26
  productSupplies: Array<any>
27
27
  isOutsourced?: boolean
28
28
  outsourcingPartner?: string
29
+ barcode?: string
29
30
  }): Promise<any> {
30
31
  try {
31
32
  const config = {
@@ -34,7 +34,8 @@ export const updateById = async function (this: WashdayClientInstance, id: strin
34
34
  invoice_product_unit_key?: string
35
35
  invoice_product_unit_name?: string
36
36
  isOutsourced?: boolean
37
- outsourcingPartner?: string
37
+ outsourcingPartner?: string,
38
+ barcode?: string
38
39
  }): Promise<any> {
39
40
  try {
40
41
  const config = {
@@ -0,0 +1,16 @@
1
+ import { WashdayClientInstance } from "../../interfaces/Api";
2
+ import axiosInstance from "../axiosInstance";
3
+ const GET_PUBLIC = '/api/public';
4
+ const GET_PUBLIC_ORDERS_ROUTES = '/api/public/orders';
5
+
6
+ export const getOrderPublicReceipt = async function (this: WashdayClientInstance, orderId: string): Promise<any> {
7
+ try {
8
+ const config = {
9
+ headers: { Authorization: `Bearer ${this.apiToken}` }
10
+ };
11
+ return await axiosInstance.get(`${GET_PUBLIC_ORDERS_ROUTES}/${orderId}/receipt`, config);
12
+ } catch (error) {
13
+ console.error('Error fetching getOrderPublicReceipt:', error);
14
+ throw error;
15
+ }
16
+ };
@@ -0,0 +1 @@
1
+ export * as getModule from './get';
@@ -17,6 +17,9 @@ interface userDTO {
17
17
  email?: string
18
18
  name?: string
19
19
  phoneNumber?: string
20
+ currentPassword?: string;
21
+ newPassword?: string;
22
+ confirmNewPassword?: string;
20
23
  }
21
24
 
22
25
  export const updateUserById = async function (this: WashdayClientInstance, userId: string, data: userDTO): Promise<any> {
@@ -38,6 +38,7 @@ import * as authEndpoints from '../api/auth';
38
38
  import { deleteUserById } from "../api/users/delete";
39
39
  import * as partnersEndpoints from '../api/partners';
40
40
  import * as outsourcedOrdersEndpoints from '../api/outsourcedOrders';
41
+ import * as publicsEndpoints from '../api/publics';
41
42
 
42
43
  export interface WashdayClientInstance {
43
44
  apiToken: string;
@@ -92,6 +93,9 @@ export interface WashdayClientInstance {
92
93
  getRoutesByDriver: typeof routesEndpoints.getModule.getRoutesByDriver,
93
94
  startRoute: typeof routesEndpoints.postModule.startRoute,
94
95
  },
96
+ publics: {
97
+ getOrderPublicReceipt: typeof publicsEndpoints.getModule.getOrderPublicReceipt,
98
+ },
95
99
  orders: {
96
100
  getList: typeof ordersEndpoints.getModule.getList;
97
101
  getOrdersHeaderSummary: typeof ordersEndpoints.getModule.getOrdersHeaderSummary;
@@ -245,6 +249,11 @@ export interface WashdayClientInstance {
245
249
  exportProductSalesReport: typeof csvExportEndpoints.getModule.exportProductSalesReport;
246
250
  exportPaymentLinesReport: typeof csvExportEndpoints.getModule.exportPaymentLinesReport;
247
251
  exportUnpaidOrdersReportCSV: typeof csvExportEndpoints.getModule.exportUnpaidOrdersReportCSV;
252
+ exportOrdersList: typeof csvExportEndpoints.getModule.exportOrdersList,
253
+ exportProductsList: typeof csvExportEndpoints.getModule.exportProductsList,
254
+ exportCleanedOrdersReport: typeof csvExportEndpoints.getModule.exportCleanedOrdersReport,
255
+ exportSalesReport: typeof csvExportEndpoints.getModule.exportSalesReport,
256
+ exportStaffReport: typeof csvExportEndpoints.getModule.exportStaffReport,
248
257
  };
249
258
  pdf: {
250
259
  exportUnpaidOrdersReportPDF: typeof pdfExportEndpoints.getModule.exportUnpaidOrdersReportPDF;
package/tsconfig.json CHANGED
@@ -5,7 +5,10 @@
5
5
  "strict": true,
6
6
  "esModuleInterop": true,
7
7
  "moduleResolution": "node",
8
- "outDir": "dist" // Specify the output directory for JavaScript files
8
+ "outDir": "dist",
9
+ "skipLibCheck": true,
10
+ "lib": ["esnext"]
9
11
  },
10
- "include": ["src/**/*.ts"]
12
+ "include": ["src/**/*.ts"],
13
+ "exclude": ["node_modules"]
11
14
  }