washday-sdk 0.0.108 → 0.0.110

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.
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_CUSTOMERS = 'api/customer';
12
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
12
13
  // export const bulkUpdate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
13
14
  // try {
14
15
  // const config = {
@@ -35,3 +36,17 @@ export const updateById = function (id, data) {
35
36
  }
36
37
  });
37
38
  };
39
+ export const updateByIdCustomersApp = function (id, data) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ try {
42
+ const config = {
43
+ headers: { Authorization: `Bearer ${this.apiToken}` }
44
+ };
45
+ return yield axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
46
+ }
47
+ catch (error) {
48
+ console.error('Error fetching updateByIdCustomersApp:', error);
49
+ throw error;
50
+ }
51
+ });
52
+ };
package/dist/api/index.js CHANGED
@@ -90,6 +90,7 @@ const WashdayClient = function WashdayClient(apiToken) {
90
90
  createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
91
91
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
92
92
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
93
+ getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
93
94
  });
94
95
  this.customers = bindMethods(this, {
95
96
  getCustomers: customersEndpoints.getModule.getList,
@@ -99,6 +100,7 @@ const WashdayClient = function WashdayClient(apiToken) {
99
100
  create: customersEndpoints.postModule.create,
100
101
  updateById: customersEndpoints.putModule.updateById,
101
102
  deleteById: customersEndpoints.deleteModule.deleteById,
103
+ updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
102
104
  });
103
105
  this.stores = bindMethods(this, {
104
106
  getStores: getStores,
@@ -12,6 +12,7 @@ import axiosInstance from "../axiosInstance";
12
12
  const GET_SET_ORDER = 'api/v2/order';
13
13
  const GET_SET_ORDER_CFDI = 'api/v2/orders';
14
14
  const GET_HEADER_SUMMARY = 'api/orderHeaderSummary';
15
+ const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
15
16
  export const getList = function (params) {
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
18
  try {
@@ -111,3 +112,31 @@ export const fetchOrdersForCFDI = function (params) {
111
112
  }
112
113
  });
113
114
  };
115
+ export const getListCustomersApp = function (params) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ try {
118
+ const config = {
119
+ headers: { Authorization: `Bearer ${this.apiToken}` }
120
+ };
121
+ const queryParams = generateQueryParamsStr([
122
+ 'storeId',
123
+ 'status',
124
+ 'customerId',
125
+ 'fromDate',
126
+ 'toDate',
127
+ 'sequence',
128
+ 'pageNum',
129
+ 'limit',
130
+ 'sequenceSort',
131
+ 'cleanedDateTime',
132
+ 'readyDateTime',
133
+ 'collectedDateTime',
134
+ ], params);
135
+ return yield axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}?${queryParams}`, config);
136
+ }
137
+ catch (error) {
138
+ console.error('Error fetching getListCustomersApp orders:', error);
139
+ throw error;
140
+ }
141
+ });
142
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_CUSTOMERS = 'api/customer';
4
-
4
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
5
5
  // export const bulkUpdate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
6
6
  // try {
7
7
  // const config = {
@@ -42,3 +42,20 @@ export const updateById = async function (this: WashdayClientInstance, id: strin
42
42
  throw error;
43
43
  }
44
44
  };
45
+
46
+ export const updateByIdCustomersApp = async function (this: WashdayClientInstance, id: string, data: {
47
+ name?: string;
48
+ phone?: string;
49
+ address?: string;
50
+ notes?: string;
51
+ }): Promise<any> {
52
+ try {
53
+ const config = {
54
+ headers: { Authorization: `Bearer ${this.apiToken}` }
55
+ };
56
+ return await axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
57
+ } catch (error) {
58
+ console.error('Error fetching updateByIdCustomersApp:', error);
59
+ throw error;
60
+ }
61
+ };
package/src/api/index.ts CHANGED
@@ -96,6 +96,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
96
96
  createPaymentLine: ordersEndpoints.postModule.createPaymentLine,
97
97
  sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
98
98
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
99
+ getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
99
100
  });
100
101
  this.customers = bindMethods(this, {
101
102
  getCustomers: customersEndpoints.getModule.getList,
@@ -105,6 +106,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
105
106
  create: customersEndpoints.postModule.create,
106
107
  updateById: customersEndpoints.putModule.updateById,
107
108
  deleteById: customersEndpoints.deleteModule.deleteById,
109
+ updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
108
110
  });
109
111
  this.stores = bindMethods(this, {
110
112
  getStores: getStores,
@@ -5,6 +5,7 @@ import axiosInstance from "../axiosInstance";
5
5
  const GET_SET_ORDER = 'api/v2/order';
6
6
  const GET_SET_ORDER_CFDI = 'api/v2/orders';
7
7
  const GET_HEADER_SUMMARY = 'api/orderHeaderSummary';
8
+ const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
8
9
 
9
10
  export const getList = async function (this: WashdayClientInstance, params: {
10
11
  store: string | undefined,
@@ -119,4 +120,43 @@ export const fetchOrdersForCFDI = async function (this: WashdayClientInstance, p
119
120
  console.error('Error fetching:', error);
120
121
  throw error;
121
122
  }
122
- }
123
+ }
124
+
125
+ export const getListCustomersApp = async function (this: WashdayClientInstance, params: {
126
+ storeId: string | undefined,
127
+ status: string | undefined,
128
+ customerId: string | undefined,
129
+ fromDate: string | undefined,
130
+ toDate: string | undefined,
131
+ sequence: string | undefined,
132
+ pageNum: string | undefined,
133
+ limit: string | undefined,
134
+ sequenceSort: string,
135
+ cleanedDateTime: string | undefined,
136
+ readyDateTime: string | undefined,
137
+ collectedDateTime: string | undefined,
138
+ }): Promise<any> {
139
+ try {
140
+ const config = {
141
+ headers: { Authorization: `Bearer ${this.apiToken}` }
142
+ };
143
+ const queryParams = generateQueryParamsStr([
144
+ 'storeId',
145
+ 'status',
146
+ 'customerId',
147
+ 'fromDate',
148
+ 'toDate',
149
+ 'sequence',
150
+ 'pageNum',
151
+ 'limit',
152
+ 'sequenceSort',
153
+ 'cleanedDateTime',
154
+ 'readyDateTime',
155
+ 'collectedDateTime',
156
+ ], params);
157
+ return await axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}?${queryParams}`, config);
158
+ } catch (error) {
159
+ console.error('Error fetching getListCustomersApp orders:', error);
160
+ throw error;
161
+ }
162
+ };
@@ -82,6 +82,7 @@ export interface WashdayClientInstance {
82
82
  setOrdeDeliveredBySequence: typeof ordersEndpoints.putModule.setOrdeDeliveredBySequence,
83
83
  createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
84
84
  deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
85
+ getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
85
86
  };
86
87
  customers: {
87
88
  getCustomers: typeof customersEndpoints.getModule.getList;
@@ -91,6 +92,7 @@ export interface WashdayClientInstance {
91
92
  create: typeof customersEndpoints.postModule.create;
92
93
  updateById: typeof customersEndpoints.putModule.updateById;
93
94
  deleteById: typeof customersEndpoints.deleteModule.deleteById;
95
+ updateByIdCustomersApp: typeof customersEndpoints.putModule.updateByIdCustomersApp;
94
96
  };
95
97
  stores: {
96
98
  getStores: typeof getStores;