washday-sdk 0.0.122 → 0.0.123
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/axiosInstance.js +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/order/get.js +14 -0
- package/package.json +1 -1
- package/src/api/axiosInstance.ts +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/order/get.ts +12 -0
- package/src/interfaces/Api.ts +1 -0
- package/src/interfaces/Store.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
// Define the type for the Axios instance
|
|
3
3
|
let axiosInstance = null;
|
|
4
|
-
//const BASE_URL: string = 'http://localhost:5555/';
|
|
4
|
+
// const BASE_URL: string = 'http://localhost:5555/';
|
|
5
5
|
const BASE_URL = 'https://washday-backend.herokuapp.com/';
|
|
6
6
|
// Function to create or return the singleton instance
|
|
7
7
|
const getAxiosInstance = () => {
|
package/dist/api/index.js
CHANGED
|
@@ -99,6 +99,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
99
99
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
100
100
|
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
101
101
|
setOrderAcceptedBySequence: ordersEndpoints.putModule.setOrderAcceptedBySequence,
|
|
102
|
+
getRequestedOrdersSummary: ordersEndpoints.getModule.getRequestedOrdersSummary,
|
|
102
103
|
});
|
|
103
104
|
this.customers = bindMethods(this, {
|
|
104
105
|
getCustomers: customersEndpoints.getModule.getList,
|
package/dist/api/order/get.js
CHANGED
|
@@ -154,3 +154,17 @@ export const getByIdCustomersApp = function (id) {
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
};
|
|
157
|
+
export const getRequestedOrdersSummary = function (storeIds) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
try {
|
|
160
|
+
const config = {
|
|
161
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
162
|
+
};
|
|
163
|
+
return yield axiosInstance.get(`${GET_SET_ORDER}/requested-summary?storeIds=${storeIds}`, config);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error('Error fetching:', error);
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
};
|
package/package.json
CHANGED
package/src/api/axiosInstance.ts
CHANGED
|
@@ -3,7 +3,7 @@ import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
3
3
|
// Define the type for the Axios instance
|
|
4
4
|
let axiosInstance: AxiosInstance | null = null;
|
|
5
5
|
|
|
6
|
-
//const BASE_URL: string = 'http://localhost:5555/';
|
|
6
|
+
// const BASE_URL: string = 'http://localhost:5555/';
|
|
7
7
|
const BASE_URL: string = 'https://washday-backend.herokuapp.com/';
|
|
8
8
|
|
|
9
9
|
// Function to create or return the singleton instance
|
package/src/api/index.ts
CHANGED
|
@@ -105,6 +105,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
105
105
|
getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
|
|
106
106
|
getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
|
|
107
107
|
setOrderAcceptedBySequence: ordersEndpoints.putModule.setOrderAcceptedBySequence,
|
|
108
|
+
getRequestedOrdersSummary: ordersEndpoints.getModule.getRequestedOrdersSummary,
|
|
108
109
|
});
|
|
109
110
|
this.customers = bindMethods(this, {
|
|
110
111
|
getCustomers: customersEndpoints.getModule.getList,
|
package/src/api/order/get.ts
CHANGED
|
@@ -171,4 +171,16 @@ export const getByIdCustomersApp = async function (this: WashdayClientInstance,
|
|
|
171
171
|
console.error('Error fetching:', error);
|
|
172
172
|
throw error;
|
|
173
173
|
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export const getRequestedOrdersSummary = async function (this: WashdayClientInstance, storeIds: string): Promise<any> {
|
|
177
|
+
try {
|
|
178
|
+
const config = {
|
|
179
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
180
|
+
};
|
|
181
|
+
return await axiosInstance.get(`${GET_SET_ORDER}/requested-summary?storeIds=${storeIds}`, config);
|
|
182
|
+
} catch (error) {
|
|
183
|
+
console.error('Error fetching:', error);
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
174
186
|
}
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -91,6 +91,7 @@ export interface WashdayClientInstance {
|
|
|
91
91
|
getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
|
|
92
92
|
getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;
|
|
93
93
|
setOrderAcceptedBySequence: typeof ordersEndpoints.putModule.setOrderAcceptedBySequence,
|
|
94
|
+
getRequestedOrdersSummary: typeof ordersEndpoints.getModule.getRequestedOrdersSummary;
|
|
94
95
|
};
|
|
95
96
|
customers: {
|
|
96
97
|
getCustomers: typeof customersEndpoints.getModule.getList;
|
package/src/interfaces/Store.ts
CHANGED