@wemap/routers 12.7.8 → 12.8.3

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/index.js CHANGED
@@ -3333,6 +3333,7 @@ class IdfmRemoteRouter extends RemoteRouter {
3333
3333
  const coreParams = new URLSearchParams();
3334
3334
  coreParams.set("from", `${origin.longitude};${origin.latitude}`);
3335
3335
  coreParams.set("to", `${destination.longitude};${destination.latitude}`);
3336
+ coreParams.set("data_freshness", "realtime");
3336
3337
  if ((_a = routerRequest.itineraryModifiers) == null ? void 0 : _a.avoidStairs) {
3337
3338
  coreParams.set("wheelchair", "true");
3338
3339
  }
@@ -3385,11 +3386,25 @@ class IdfmRemoteRouter extends RemoteRouter {
3385
3386
  return urlSearchParams;
3386
3387
  }
3387
3388
  getSectionCoords(section) {
3388
- const from = section.from.stop_point ? jsonToCoordinates$1(section.from.stop_point.coord) : jsonToCoordinates$1(section.from.address.coord);
3389
- const to = section.to.stop_point ? jsonToCoordinates$1(section.to.stop_point.coord) : jsonToCoordinates$1(section.to.address.coord);
3389
+ let from;
3390
+ let to;
3391
+ if ("stop_point" in section.from) {
3392
+ from = section.from.stop_point.coord;
3393
+ } else if ("address" in section.from) {
3394
+ from = section.from.address.coord;
3395
+ } else {
3396
+ from = section.from.poi.coord;
3397
+ }
3398
+ if ("stop_point" in section.to) {
3399
+ to = section.to.stop_point.coord;
3400
+ } else if ("address" in section.to) {
3401
+ to = section.to.address.coord;
3402
+ } else {
3403
+ to = section.to.poi.coord;
3404
+ }
3390
3405
  return {
3391
- from,
3392
- to
3406
+ from: jsonToCoordinates$1(from),
3407
+ to: jsonToCoordinates$1(to)
3393
3408
  };
3394
3409
  }
3395
3410
  /**