washday-sdk 0.0.168 → 0.0.169

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
@@ -81,6 +81,7 @@ const WashdayClient = function WashdayClient(apiToken) {
81
81
  closeRouteById: routesEndpoints.putModule.closeRouteById,
82
82
  updateRouteById: routesEndpoints.putModule.updateRouteById,
83
83
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
84
+ startRoute: routesEndpoints.postModule.startRoute,
84
85
  });
85
86
  this.auth = bindMethods(this, {
86
87
  customerLoginToken: authEndpoints.postModule.customerLoginToken,
@@ -51,3 +51,17 @@ export const createRouteV2 = function (data) {
51
51
  }
52
52
  });
53
53
  };
54
+ export const startRoute = function (routeId) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ try {
57
+ const config = {
58
+ headers: { Authorization: `Bearer ${this.apiToken}` }
59
+ };
60
+ return yield axiosInstance.post(`${GET_SET_ROUTES}/${routeId}/start`, {}, config);
61
+ }
62
+ catch (error) {
63
+ console.error('Error fetching startRoute:', error);
64
+ throw error;
65
+ }
66
+ });
67
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.168",
3
+ "version": "0.0.169",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -88,6 +88,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
88
88
  closeRouteById: routesEndpoints.putModule.closeRouteById,
89
89
  updateRouteById: routesEndpoints.putModule.updateRouteById,
90
90
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
91
+ startRoute: routesEndpoints.postModule.startRoute,
91
92
  });
92
93
  this.auth = bindMethods(this, {
93
94
  customerLoginToken: authEndpoints.postModule.customerLoginToken,
@@ -44,4 +44,17 @@ export const createRouteV2 = async function (this: WashdayClientInstance, data:
44
44
  console.error('Error fetching createRouteV2:', error);
45
45
  throw error;
46
46
  }
47
+ };
48
+
49
+
50
+ export const startRoute = async function (this: WashdayClientInstance, routeId: string): Promise<any> {
51
+ try {
52
+ const config = {
53
+ headers: { Authorization: `Bearer ${this.apiToken}` }
54
+ };
55
+ return await axiosInstance.post(`${GET_SET_ROUTES}/${routeId}/start`, {}, config);
56
+ } catch (error) {
57
+ console.error('Error fetching startRoute:', error);
58
+ throw error;
59
+ }
47
60
  };
@@ -88,6 +88,7 @@ export interface WashdayClientInstance {
88
88
  closeRouteById: typeof routesEndpoints.putModule.closeRouteById,
89
89
  updateRouteById: typeof routesEndpoints.putModule.updateRouteById,
90
90
  getRoutesByDriver: typeof routesEndpoints.getModule.getRoutesByDriver,
91
+ startRoute: typeof routesEndpoints.postModule.startRoute,
91
92
  },
92
93
  orders: {
93
94
  getList: typeof ordersEndpoints.getModule.getList;