washday-sdk 1.6.52 → 1.6.53

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
@@ -102,6 +102,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
102
102
  closeRouteByIdV2: routesEndpoints.putModule.closeRouteByIdV2,
103
103
  updateRouteById: routesEndpoints.putModule.updateRouteById,
104
104
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
105
+ getRoutes: routesEndpoints.getModule.getRoutes,
105
106
  startRoute: routesEndpoints.postModule.startRoute,
106
107
  reorderRouteOrders: routesEndpoints.patchModule.reorderRouteOrders,
107
108
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.52",
3
+ "version": "1.6.53",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -109,6 +109,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
109
109
  closeRouteByIdV2: routesEndpoints.putModule.closeRouteByIdV2,
110
110
  updateRouteById: routesEndpoints.putModule.updateRouteById,
111
111
  getRoutesByDriver: routesEndpoints.getModule.getRoutesByDriver,
112
+ getRoutes: routesEndpoints.getModule.getRoutes,
112
113
  startRoute: routesEndpoints.postModule.startRoute,
113
114
  reorderRouteOrders: routesEndpoints.patchModule.reorderRouteOrders,
114
115
  });
@@ -111,6 +111,7 @@ export interface WashdayClientInstance {
111
111
  closeRouteByIdV2: typeof routesEndpoints.putModule.closeRouteByIdV2,
112
112
  updateRouteById: typeof routesEndpoints.putModule.updateRouteById,
113
113
  getRoutesByDriver: typeof routesEndpoints.getModule.getRoutesByDriver,
114
+ getRoutes: typeof routesEndpoints.getModule.getRoutes,
114
115
  startRoute: typeof routesEndpoints.postModule.startRoute,
115
116
  reorderRouteOrders: typeof routesEndpoints.patchModule.reorderRouteOrders,
116
117
  },
@@ -1,5 +1,6 @@
1
1
  import { getRoutes, getRoutesByDriver } from "../src/api/routes/get";
2
2
  import { createRouteV2 } from "../src/api/routes/post";
3
+ import { WashdayClient } from "../src";
3
4
 
4
5
  describe("routes multi-store api", () => {
5
6
  it("creates multi-store routes through the root routes endpoint", async () => {
@@ -93,4 +94,18 @@ describe("routes multi-store api", () => {
93
94
  }
94
95
  );
95
96
  });
97
+
98
+ it("exposes getRoutes through the WashdayClient routes module", async () => {
99
+ const get = jest.fn().mockResolvedValue({ data: { data: [] } });
100
+ const client = new WashdayClient("token-123", "DEV") as any;
101
+ client.axiosInstance = { get };
102
+
103
+ expect(typeof client.routes.getRoutes).toBe("function");
104
+
105
+ await client.routes.getRoutes({ scope: "company" });
106
+
107
+ expect(get).toHaveBeenCalledWith("api/routes?scope=company", {
108
+ headers: { Authorization: "Bearer token-123" },
109
+ });
110
+ });
96
111
  });