washday-sdk 0.0.151 → 0.0.152
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/cashierbox/get.js +1 -1
- package/dist/api/index.js +2 -1
- package/dist/api/order/delete.js +15 -0
- package/package.json +1 -1
- package/src/api/cashierbox/get.ts +1 -1
- package/src/api/index.ts +2 -1
- package/src/api/order/delete.ts +14 -0
- package/src/interfaces/Api.ts +2 -1
|
@@ -15,7 +15,7 @@ export const getCashierboxesByStoreId = function (storeId, queryParams) {
|
|
|
15
15
|
const config = {
|
|
16
16
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
17
17
|
};
|
|
18
|
-
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
|
|
18
|
+
const response = yield axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
19
19
|
return response;
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
package/dist/api/index.js
CHANGED
|
@@ -110,7 +110,8 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
110
110
|
getRequestedOrdersSummary: ordersEndpoints.getModule.getRequestedOrdersSummary,
|
|
111
111
|
bulkCancel: ordersEndpoints.putModule.bulkCancel,
|
|
112
112
|
bulkClean: ordersEndpoints.putModule.bulkClean,
|
|
113
|
-
bulkCollect: ordersEndpoints.putModule.bulkCollect
|
|
113
|
+
bulkCollect: ordersEndpoints.putModule.bulkCollect,
|
|
114
|
+
cancelOrderByIdCustomersApp: ordersEndpoints.deleteModule.cancelOrderByIdCustomersApp
|
|
114
115
|
});
|
|
115
116
|
this.customers = bindMethods(this, {
|
|
116
117
|
getCustomers: customersEndpoints.getModule.getList,
|
package/dist/api/order/delete.js
CHANGED
|
@@ -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_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymentLines`;
|
|
12
|
+
const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
|
|
12
13
|
export const deletePaymentLineById = function (orderId, id) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
15
|
try {
|
|
@@ -23,3 +24,17 @@ export const deletePaymentLineById = function (orderId, id) {
|
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
};
|
|
27
|
+
export const cancelOrderByIdCustomersApp = function (id) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const config = {
|
|
31
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
32
|
+
};
|
|
33
|
+
return yield axiosInstance.delete(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error fetching cancelOrderByIdCustomersApp:', error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ export const getCashierboxesByStoreId = async function (this: WashdayClientInsta
|
|
|
8
8
|
const config = {
|
|
9
9
|
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
10
|
};
|
|
11
|
-
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams}`, config);
|
|
11
|
+
const response = await axiosInstance.get(`${GET_SET_CASHIER_BOX(storeId)}?${queryParams || ''}`, config);
|
|
12
12
|
return response;
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.error('Error fetching getCashierboxesByStoreId:', error);
|
package/src/api/index.ts
CHANGED
|
@@ -116,7 +116,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
116
116
|
getRequestedOrdersSummary: ordersEndpoints.getModule.getRequestedOrdersSummary,
|
|
117
117
|
bulkCancel: ordersEndpoints.putModule.bulkCancel,
|
|
118
118
|
bulkClean: ordersEndpoints.putModule.bulkClean,
|
|
119
|
-
bulkCollect: ordersEndpoints.putModule.bulkCollect
|
|
119
|
+
bulkCollect: ordersEndpoints.putModule.bulkCollect,
|
|
120
|
+
cancelOrderByIdCustomersApp: ordersEndpoints.deleteModule.cancelOrderByIdCustomersApp
|
|
120
121
|
});
|
|
121
122
|
this.customers = bindMethods(this, {
|
|
122
123
|
getCustomers: customersEndpoints.getModule.getList,
|
package/src/api/order/delete.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId}/paymentLines`;
|
|
4
|
+
const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
|
|
4
5
|
|
|
5
6
|
export const deletePaymentLineById = async function (this: WashdayClientInstance, orderId: string, id: string): Promise<any> {
|
|
6
7
|
try {
|
|
@@ -13,3 +14,16 @@ export const deletePaymentLineById = async function (this: WashdayClientInstance
|
|
|
13
14
|
throw error;
|
|
14
15
|
}
|
|
15
16
|
};
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export const cancelOrderByIdCustomersApp = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
20
|
+
try {
|
|
21
|
+
const config = {
|
|
22
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
23
|
+
};
|
|
24
|
+
return await axiosInstance.delete(`${GET_SET_ORDER_CUSTOMERS_APP}/${id}`, config);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('Error fetching cancelOrderByIdCustomersApp:', error);
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
};
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -102,7 +102,8 @@ export interface WashdayClientInstance {
|
|
|
102
102
|
getRequestedOrdersSummary: typeof ordersEndpoints.getModule.getRequestedOrdersSummary;
|
|
103
103
|
bulkCancel: typeof ordersEndpoints.putModule.bulkCancel,
|
|
104
104
|
bulkClean: typeof ordersEndpoints.putModule.bulkClean,
|
|
105
|
-
bulkCollect: typeof ordersEndpoints.putModule.bulkCollect
|
|
105
|
+
bulkCollect: typeof ordersEndpoints.putModule.bulkCollect,
|
|
106
|
+
cancelOrderByIdCustomersApp: typeof ordersEndpoints.deleteModule.cancelOrderByIdCustomersApp;
|
|
106
107
|
};
|
|
107
108
|
customers: {
|
|
108
109
|
getCustomers: typeof customersEndpoints.getModule.getList;
|