washday-sdk 0.0.109 → 0.0.111
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/customers/put.js +15 -0
- package/dist/api/index.js +2 -0
- package/dist/api/order/get.js +14 -0
- package/package.json +1 -1
- package/src/api/customers/put.ts +18 -1
- package/src/api/index.ts +2 -0
- package/src/api/order/get.ts +12 -0
- package/src/interfaces/Api.ts +2 -0
|
@@ -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
|
@@ -91,6 +91,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
91
91
|
sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
|
|
92
92
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
93
93
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
94
|
+
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
94
95
|
});
|
|
95
96
|
this.customers = bindMethods(this, {
|
|
96
97
|
getCustomers: customersEndpoints.getModule.getList,
|
|
@@ -100,6 +101,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
100
101
|
create: customersEndpoints.postModule.create,
|
|
101
102
|
updateById: customersEndpoints.putModule.updateById,
|
|
102
103
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
104
|
+
updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
|
|
103
105
|
});
|
|
104
106
|
this.stores = bindMethods(this, {
|
|
105
107
|
getStores: getStores,
|
package/dist/api/order/get.js
CHANGED
|
@@ -140,3 +140,17 @@ export const getListCustomersApp = function (params) {
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
+
export const getByIdCustomersApp = function (id) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
try {
|
|
146
|
+
const config = {
|
|
147
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
148
|
+
};
|
|
149
|
+
return yield axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
console.error('Error fetching:', error);
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
};
|
package/package.json
CHANGED
package/src/api/customers/put.ts
CHANGED
|
@@ -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
|
@@ -97,6 +97,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
97
97
|
sendEmailReceipt: ordersEndpoints.postModule.sendEmailReceipt,
|
|
98
98
|
deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
|
|
99
99
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
100
|
+
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
100
101
|
});
|
|
101
102
|
this.customers = bindMethods(this, {
|
|
102
103
|
getCustomers: customersEndpoints.getModule.getList,
|
|
@@ -106,6 +107,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
106
107
|
create: customersEndpoints.postModule.create,
|
|
107
108
|
updateById: customersEndpoints.putModule.updateById,
|
|
108
109
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
110
|
+
updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
|
|
109
111
|
});
|
|
110
112
|
this.stores = bindMethods(this, {
|
|
111
113
|
getStores: getStores,
|
package/src/api/order/get.ts
CHANGED
|
@@ -160,3 +160,15 @@ export const getListCustomersApp = async function (this: WashdayClientInstance,
|
|
|
160
160
|
throw error;
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
+
|
|
164
|
+
export const getByIdCustomersApp = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
|
|
165
|
+
try {
|
|
166
|
+
const config = {
|
|
167
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
168
|
+
};
|
|
169
|
+
return await axiosInstance.get(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
console.error('Error fetching:', error);
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
}
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -83,6 +83,7 @@ export interface WashdayClientInstance {
|
|
|
83
83
|
createPaymentLine: typeof ordersEndpoints.postModule.createPaymentLine;
|
|
84
84
|
deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
|
|
85
85
|
getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
|
|
86
|
+
getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;
|
|
86
87
|
};
|
|
87
88
|
customers: {
|
|
88
89
|
getCustomers: typeof customersEndpoints.getModule.getList;
|
|
@@ -92,6 +93,7 @@ export interface WashdayClientInstance {
|
|
|
92
93
|
create: typeof customersEndpoints.postModule.create;
|
|
93
94
|
updateById: typeof customersEndpoints.putModule.updateById;
|
|
94
95
|
deleteById: typeof customersEndpoints.deleteModule.deleteById;
|
|
96
|
+
updateByIdCustomersApp: typeof customersEndpoints.putModule.updateByIdCustomersApp;
|
|
95
97
|
};
|
|
96
98
|
stores: {
|
|
97
99
|
getStores: typeof getStores;
|