@motis-project/motis-client 2.8.3 → 2.9.1

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.
@@ -123,6 +123,53 @@ type Duration = {
123
123
  * duration in seconds if a path was found, otherwise missing
124
124
  */
125
125
  duration?: number;
126
+ /**
127
+ * distance in meters if a path was found and distance computation was requested, otherwise missing
128
+ */
129
+ distance?: number;
130
+ };
131
+ /**
132
+ * Object containing a single element of a ParetoSet
133
+ */
134
+ type ParetoSetEntry = {
135
+ /**
136
+ * duration in seconds for the the best solution using `transfer` transfers
137
+ *
138
+ * Notice that the resolution is currently in minutes, because of implementation details
139
+ *
140
+ */
141
+ duration: number;
142
+ /**
143
+ * The minimal number of transfers required to arrive within `duration` seconds
144
+ *
145
+ * transfers=0: Direct transit connecion without any transfers
146
+ * transfers=1: Transit connection with 1 transfer
147
+ *
148
+ */
149
+ transfers: number;
150
+ };
151
+ /**
152
+ * Pareto set of optimal transit solutions
153
+ */
154
+ type ParetoSet = Array<ParetoSetEntry>;
155
+ /**
156
+ * Object containing the optimal street and transit durations for One-to-Many routing
157
+ */
158
+ type OneToManyIntermodalResponse = {
159
+ /**
160
+ * Fastest durations for street routing
161
+ * The order of the items corresponds to the order of the `many` locations
162
+ * If no street routed connection is found, the corresponding `Duration` will be empty
163
+ *
164
+ */
165
+ street_durations?: Array<Duration>;
166
+ /**
167
+ * Pareto optimal solutions
168
+ * The order of the items corresponds to the order of the `many` locations
169
+ * If no connection using transits is found, the corresponding `ParetoSet` will be empty
170
+ *
171
+ */
172
+ transit_durations?: Array<ParetoSet>;
126
173
  };
127
174
  /**
128
175
  * Administrative area
@@ -186,11 +233,11 @@ type LocationType = 'ADDRESS' | 'PLACE' | 'STOP';
186
233
  * - `AIRPLANE`: airline flights
187
234
  * - `BUS`: short distance buses (does not include `COACH`)
188
235
  * - `COACH`: long distance buses (does not include `BUS`)
189
- * - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL,SUBURBAN,SUBWAY`
236
+ * - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,SUBURBAN,SUBWAY`
190
237
  * - `HIGHSPEED_RAIL`: long distance high speed trains (e.g. TGV)
191
238
  * - `LONG_DISTANCE`: long distance inter city trains
192
239
  * - `NIGHT_RAIL`: long distance night trains
193
- * - `REGIONAL_FAST_RAIL`: regional express routes that skip low traffic stops to be faster
240
+ * - `REGIONAL_FAST_RAIL`: deprecated, `REGIONAL_RAIL` will be used
194
241
  * - `REGIONAL_RAIL`: regional train
195
242
  * - `SUBURBAN`: suburban trains (e.g. S-Bahn, RER, Elizabeth Line, ...)
196
243
  * - `ODM`: demand responsive transport
@@ -201,7 +248,7 @@ type LocationType = 'ADDRESS' | 'PLACE' | 'STOP';
201
248
  * - `CABLE_CAR`: deprecated
202
249
  *
203
250
  */
204
- type Mode = 'WALK' | 'BIKE' | 'RENTAL' | 'CAR' | 'CAR_PARKING' | 'CAR_DROPOFF' | 'ODM' | 'RIDE_SHARING' | 'FLEX' | 'TRANSIT' | 'TRAM' | 'SUBWAY' | 'FERRY' | 'AIRPLANE' | 'BUS' | 'COACH' | 'RAIL' | 'HIGHSPEED_RAIL' | 'LONG_DISTANCE' | 'NIGHT_RAIL' | 'REGIONAL_FAST_RAIL' | 'REGIONAL_RAIL' | 'SUBURBAN' | 'FUNICULAR' | 'AERIAL_LIFT' | 'OTHER' | 'AREAL_LIFT' | 'METRO' | 'CABLE_CAR';
251
+ type Mode = 'WALK' | 'BIKE' | 'RENTAL' | 'CAR' | 'CAR_PARKING' | 'CAR_DROPOFF' | 'ODM' | 'RIDE_SHARING' | 'FLEX' | 'DEBUG_BUS_ROUTE' | 'DEBUG_RAILWAY_ROUTE' | 'DEBUG_FERRY_ROUTE' | 'TRANSIT' | 'TRAM' | 'SUBWAY' | 'FERRY' | 'AIRPLANE' | 'BUS' | 'COACH' | 'RAIL' | 'HIGHSPEED_RAIL' | 'LONG_DISTANCE' | 'NIGHT_RAIL' | 'REGIONAL_FAST_RAIL' | 'REGIONAL_RAIL' | 'SUBURBAN' | 'FUNICULAR' | 'AERIAL_LIFT' | 'OTHER' | 'AREAL_LIFT' | 'METRO' | 'CABLE_CAR';
205
252
  /**
206
253
  * GeoCoding match
207
254
  */
@@ -486,6 +533,7 @@ type StopTime = {
486
533
  agencyName: string;
487
534
  agencyUrl: string;
488
535
  routeId: string;
536
+ routeUrl?: string;
489
537
  directionId: string;
490
538
  routeColor?: string;
491
539
  routeTextColor?: string;
@@ -1022,6 +1070,16 @@ type RentalZone = {
1022
1070
  area: MultiPolygon;
1023
1071
  rules: Array<RentalZoneRestrictions>;
1024
1072
  };
1073
+ /**
1074
+ * not available for GTFS datasets by default
1075
+ * For NeTEx it contains information about the vehicle category, e.g. IC/InterCity
1076
+ *
1077
+ */
1078
+ type Category = {
1079
+ id: string;
1080
+ name: string;
1081
+ shortName: string;
1082
+ };
1025
1083
  type Leg = {
1026
1084
  /**
1027
1085
  * Transport mode for this leg
@@ -1093,7 +1151,9 @@ type Leg = {
1093
1151
  * final stop of this trip (can differ from headsign)
1094
1152
  */
1095
1153
  tripTo?: Place;
1154
+ category?: Category;
1096
1155
  routeId?: string;
1156
+ routeUrl?: string;
1097
1157
  directionId?: string;
1098
1158
  routeColor?: string;
1099
1159
  routeTextColor?: string;
@@ -1120,10 +1180,17 @@ type Leg = {
1120
1180
  *
1121
1181
  */
1122
1182
  intermediateStops?: Array<Place>;
1183
+ /**
1184
+ * Encoded geometry of the leg.
1185
+ * If detailed leg output is disabled, this is returned as an empty
1186
+ * polyline.
1187
+ *
1188
+ */
1123
1189
  legGeometry: EncodedPolyline;
1124
1190
  /**
1125
1191
  * A series of turn by turn instructions
1126
1192
  * used for walking, biking and driving.
1193
+ * This field is omitted if the request disables detailed leg output.
1127
1194
  *
1128
1195
  */
1129
1196
  steps?: Array<StepInstruction>;
@@ -1321,6 +1388,9 @@ type OneToManyParams = {
1321
1388
  one: string;
1322
1389
  /**
1323
1390
  * geo locations as latitude;longitude,latitude;longitude,...
1391
+ *
1392
+ * The number of accepted locations is limited by server config variable `onetomany_max_many`.
1393
+ *
1324
1394
  */
1325
1395
  many: Array<(string)>;
1326
1396
  /**
@@ -1329,7 +1399,7 @@ type OneToManyParams = {
1329
1399
  */
1330
1400
  mode: Mode;
1331
1401
  /**
1332
- * maximum travel time in seconds
1402
+ * maximum travel time in seconds. Is limited by server config variable `street_routing_max_direct_seconds`.
1333
1403
  */
1334
1404
  max: number;
1335
1405
  /**
@@ -1353,15 +1423,250 @@ type OneToManyParams = {
1353
1423
  * - `BIKE`
1354
1424
  *
1355
1425
  */
1356
- elevationCosts: ElevationCosts;
1426
+ elevationCosts?: ElevationCosts;
1357
1427
  /**
1358
1428
  * true = many to one
1359
1429
  * false = one to many
1360
1430
  *
1361
1431
  */
1362
1432
  arriveBy: boolean;
1433
+ /**
1434
+ * If true, the response includes the distance in meters
1435
+ * for each path. This requires path reconstruction and
1436
+ * may be slower than duration-only queries.
1437
+ *
1438
+ */
1439
+ withDistance?: boolean;
1440
+ };
1441
+ type OneToManyIntermodalParams = {
1442
+ /**
1443
+ * \`latitude,longitude[,level]\` tuple with
1444
+ * - latitude and longitude in degrees
1445
+ * - (optional) level: the OSM level (default: 0)
1446
+ *
1447
+ * OR
1448
+ *
1449
+ * stop id
1450
+ *
1451
+ */
1452
+ one: string;
1453
+ /**
1454
+ * array of:
1455
+ *
1456
+ * \`latitude,longitude[,level]\` tuple with
1457
+ * - latitude and longitude in degrees
1458
+ * - (optional) level: the OSM level (default: 0)
1459
+ *
1460
+ * OR
1461
+ *
1462
+ * stop id
1463
+ *
1464
+ * The number of accepted locations is limited by server config variable `onetomany_max_many`.
1465
+ *
1466
+ */
1467
+ many: Array<(string)>;
1468
+ /**
1469
+ * Optional. Defaults to the current time.
1470
+ *
1471
+ * Departure time ($arriveBy=false) / arrival date ($arriveBy=true),
1472
+ *
1473
+ */
1474
+ time?: string;
1475
+ /**
1476
+ * The maximum travel time in minutes.
1477
+ * If not provided, the routing uses the value
1478
+ * hardcoded in the server which is usually quite high.
1479
+ *
1480
+ * *Warning*: Use with care. Setting this too low can lead to
1481
+ * optimal (e.g. the least transfers) journeys not being found.
1482
+ * If this value is too low to reach the destination at all,
1483
+ * it can lead to slow routing performance.
1484
+ *
1485
+ */
1486
+ maxTravelTime?: number;
1487
+ /**
1488
+ * maximum matching distance in meters to match geo coordinates to the street network
1489
+ */
1490
+ maxMatchingDistance?: number;
1491
+ /**
1492
+ * Optional. Defaults to false, i.e. one to many search
1493
+ *
1494
+ * true = many to one
1495
+ * false = one to many
1496
+ *
1497
+ */
1498
+ arriveBy?: boolean;
1499
+ /**
1500
+ * The maximum number of allowed transfers (i.e. interchanges between transit legs,
1501
+ * pre- and postTransit do not count as transfers).
1502
+ * `maxTransfers=0` searches for direct transit connections without any transfers.
1503
+ * If you want to search only for non-transit connections (`FOOT`, `CAR`, etc.),
1504
+ * send an empty `transitModes` parameter instead.
1505
+ *
1506
+ * If not provided, the routing uses the server-side default value
1507
+ * which is hardcoded and very high to cover all use cases.
1508
+ *
1509
+ * *Warning*: Use with care. Setting this too low can lead to
1510
+ * optimal (e.g. the fastest) journeys not being found.
1511
+ * If this value is too low to reach the destination at all,
1512
+ * it can lead to slow routing performance.
1513
+ *
1514
+ */
1515
+ maxTransfers?: number;
1516
+ /**
1517
+ * Optional. Default is 0 minutes.
1518
+ *
1519
+ * Minimum transfer time for each transfer in minutes.
1520
+ *
1521
+ */
1522
+ minTransferTime?: number;
1523
+ /**
1524
+ * Optional. Default is 0 minutes.
1525
+ *
1526
+ * Additional transfer time reserved for each transfer in minutes.
1527
+ *
1528
+ */
1529
+ additionalTransferTime?: number;
1530
+ /**
1531
+ * Optional. Default is 1.0
1532
+ *
1533
+ * Factor to multiply minimum required transfer times with.
1534
+ * Values smaller than 1.0 are not supported.
1535
+ *
1536
+ */
1537
+ transferTimeFactor?: number;
1538
+ /**
1539
+ * Optional. Default is `false`.
1540
+ *
1541
+ * Whether to use transfers routed on OpenStreetMap data.
1542
+ *
1543
+ */
1544
+ useRoutedTransfers?: boolean;
1545
+ /**
1546
+ * Optional. Default is `FOOT`.
1547
+ *
1548
+ * Accessibility profile to use for pedestrian routing in transfers
1549
+ * between transit connections and the first and last mile respectively.
1550
+ *
1551
+ */
1552
+ pedestrianProfile?: PedestrianProfile;
1553
+ /**
1554
+ * Optional
1555
+ *
1556
+ * Average speed for pedestrian routing.
1557
+ *
1558
+ */
1559
+ pedestrianSpeed?: PedestrianSpeed;
1560
+ /**
1561
+ * Optional
1562
+ *
1563
+ * Average speed for bike routing.
1564
+ *
1565
+ */
1566
+ cyclingSpeed?: CyclingSpeed;
1567
+ /**
1568
+ * Optional. Default is `NONE`.
1569
+ *
1570
+ * Set an elevation cost profile, to penalize routes with incline.
1571
+ * - `NONE`: No additional costs for elevations. This is the default behavior
1572
+ * - `LOW`: Add a low cost for increase in elevation and incline along the way. This will prefer routes with less ascent, if small detours are required.
1573
+ * - `HIGH`: Add a high cost for increase in elevation and incline along the way. This will prefer routes with less ascent, if larger detours are required.
1574
+ *
1575
+ * As using an elevation costs profile will increase the travel duration,
1576
+ * routing through steep terrain may exceed the maximal allowed duration,
1577
+ * causing a location to appear unreachable.
1578
+ * Increasing the maximum travel time for these segments may resolve this issue.
1579
+ *
1580
+ * The profile is used for routing on both the first and last mile.
1581
+ *
1582
+ * Elevation cost profiles are currently used by following street modes:
1583
+ * - `BIKE`
1584
+ *
1585
+ */
1586
+ elevationCosts?: ElevationCosts;
1587
+ /**
1588
+ * Optional. Default is `TRANSIT` which allows all transit modes (no restriction).
1589
+ * Allowed modes for the transit part. If empty, no transit connections will be computed.
1590
+ * For example, this can be used to allow only `SUBURBAN,SUBWAY,TRAM`.
1591
+ *
1592
+ */
1593
+ transitModes?: Array<Mode>;
1594
+ /**
1595
+ * Optional. Default is `WALK`. Does not apply to direct connections (see `directMode`).
1596
+ *
1597
+ * A list of modes that are allowed to be used for the first mile, i.e. from the coordinates to the first transit stop. Example: `WALK,BIKE_SHARING`.
1598
+ *
1599
+ */
1600
+ preTransitModes?: Array<Mode>;
1601
+ /**
1602
+ * Optional. Default is `WALK`. Does not apply to direct connections (see `directMode`).
1603
+ *
1604
+ * A list of modes that are allowed to be used for the last mile, i.e. from the last transit stop to the target coordinates. Example: `WALK,BIKE_SHARING`.
1605
+ *
1606
+ */
1607
+ postTransitModes?: Array<Mode>;
1608
+ /**
1609
+ * Default is `WALK` which will compute walking routes as direct connections.
1610
+ *
1611
+ * Mode used for direction connections from start to destination without using transit.
1612
+ *
1613
+ * Currently supported non-transit modes: \`WALK\`, \`BIKE\`, \`CAR\`
1614
+ *
1615
+ */
1616
+ directMode?: Mode;
1617
+ /**
1618
+ * Optional. Default is 15min which is `900`.
1619
+ * Maximum time in seconds for the first street leg.
1620
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1621
+ *
1622
+ */
1623
+ maxPreTransitTime?: number;
1624
+ /**
1625
+ * Optional. Default is 15min which is `900`.
1626
+ * Maximum time in seconds for the last street leg.
1627
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1628
+ *
1629
+ */
1630
+ maxPostTransitTime?: number;
1631
+ /**
1632
+ * Optional. Default is 30min which is `1800`.
1633
+ * Maximum time in seconds for direct connections.
1634
+ *
1635
+ * If a value smaller than either `maxPreTransitTime` or
1636
+ * `maxPostTransitTime` is used, their maximum is set instead.
1637
+ * Is limited by server config variable `street_routing_max_direct_seconds`.
1638
+ *
1639
+ */
1640
+ maxDirectTime?: number;
1641
+ /**
1642
+ * If true, the response includes the distance in meters
1643
+ * for each path. This requires path reconstruction and
1644
+ * may be slower than duration-only queries.
1645
+ *
1646
+ * `withDistance` is currently limited to street routing.
1647
+ *
1648
+ */
1649
+ withDistance?: boolean;
1650
+ /**
1651
+ * Optional. Default is `false`.
1652
+ *
1653
+ * If set to `true`, all used transit trips are required to allow bike carriage.
1654
+ *
1655
+ */
1656
+ requireBikeTransport?: boolean;
1657
+ /**
1658
+ * Optional. Default is `false`.
1659
+ *
1660
+ * If set to `true`, all used transit trips are required to allow car carriage.
1661
+ *
1662
+ */
1663
+ requireCarTransport?: boolean;
1363
1664
  };
1364
1665
  type ServerConfig = {
1666
+ /**
1667
+ * the version of this MOTIS server
1668
+ */
1669
+ motisVersion: string;
1365
1670
  /**
1366
1671
  * true if elevation is loaded
1367
1672
  */
@@ -1374,10 +1679,15 @@ type ServerConfig = {
1374
1679
  * true if street routing is available
1375
1680
  */
1376
1681
  hasStreetRouting: boolean;
1682
+ /**
1683
+ * limit for the number of `many` locations for one-to-many requests
1684
+ *
1685
+ */
1686
+ maxOneToManySize: number;
1377
1687
  /**
1378
1688
  * limit for maxTravelTime API param in minutes
1379
1689
  */
1380
- maxOneToAllTravelTimeLimit?: number;
1690
+ maxOneToAllTravelTimeLimit: number;
1381
1691
  /**
1382
1692
  * limit for maxPrePostTransitTime API param in seconds
1383
1693
  */
@@ -1386,6 +1696,10 @@ type ServerConfig = {
1386
1696
  * limit for maxDirectTime API param in seconds
1387
1697
  */
1388
1698
  maxDirectTimeLimit: number;
1699
+ /**
1700
+ * true if experimental route shapes debug download API is enabled
1701
+ */
1702
+ shapesDebugEnabled: boolean;
1389
1703
  };
1390
1704
  type Error = {
1391
1705
  /**
@@ -1393,6 +1707,66 @@ type Error = {
1393
1707
  */
1394
1708
  error: string;
1395
1709
  };
1710
+ /**
1711
+ * Route segment between two stops to show a route on a map
1712
+ */
1713
+ type RouteSegment = {
1714
+ /**
1715
+ * Index into the top-level route stops array
1716
+ */
1717
+ from: number;
1718
+ /**
1719
+ * Index into the top-level route stops array
1720
+ */
1721
+ to: number;
1722
+ /**
1723
+ * Index into the top-level route polylines array
1724
+ */
1725
+ polyline: number;
1726
+ };
1727
+ /**
1728
+ * Shared polyline used by one or more route segments
1729
+ */
1730
+ type RoutePolyline = {
1731
+ polyline: EncodedPolyline;
1732
+ /**
1733
+ * Unique route colors of routes containing this segment
1734
+ */
1735
+ colors: Array<(string)>;
1736
+ /**
1737
+ * Indexes into the top-level routes array for routes containing this segment
1738
+ */
1739
+ routeIndexes: Array<(number)>;
1740
+ };
1741
+ type RouteColor = {
1742
+ color: string;
1743
+ textColor: string;
1744
+ };
1745
+ type RoutePathSource = 'NONE' | 'TIMETABLE' | 'ROUTED';
1746
+ type TransitRouteInfo = {
1747
+ id: string;
1748
+ shortName: string;
1749
+ longName: string;
1750
+ color?: string;
1751
+ textColor?: string;
1752
+ };
1753
+ type RouteInfo = {
1754
+ /**
1755
+ * Transport mode for this route
1756
+ */
1757
+ mode: Mode;
1758
+ transitRoutes: Array<TransitRouteInfo>;
1759
+ /**
1760
+ * Number of stops along this route
1761
+ */
1762
+ numStops: number;
1763
+ /**
1764
+ * Internal route index for debugging purposes
1765
+ */
1766
+ routeIdx: number;
1767
+ pathSource: RoutePathSource;
1768
+ segments: Array<RouteSegment>;
1769
+ };
1396
1770
  type PlanData = {
1397
1771
  query: {
1398
1772
  /**
@@ -1422,8 +1796,18 @@ type PlanData = {
1422
1796
  */
1423
1797
  cyclingSpeed?: CyclingSpeed;
1424
1798
  /**
1799
+ * Controls if `legGeometry` and `steps` are returned for direct legs,
1800
+ * pre-/post-transit legs and transit legs.
1801
+ *
1802
+ */
1803
+ detailedLegs?: boolean;
1804
+ /**
1805
+ * Controls if transfer polylines and step instructions are returned.
1806
+ *
1807
+ * If not set, this parameter inherits the value of `detailedLegs`.
1808
+ *
1425
1809
  * - true: Compute transfer polylines and step instructions.
1426
- * - false: Only return basic information (start time, end time, duration) for transfers.
1810
+ * - false: Return empty `legGeometry` and omit `steps` for transfers.
1427
1811
  *
1428
1812
  */
1429
1813
  detailedTransfers?: boolean;
@@ -1988,10 +2372,13 @@ type OneToManyData = {
1988
2372
  elevationCosts?: ElevationCosts;
1989
2373
  /**
1990
2374
  * geo locations as latitude;longitude,latitude;longitude,...
2375
+ *
2376
+ * The number of accepted locations is limited by server config variable `onetomany_max_many`.
2377
+ *
1991
2378
  */
1992
2379
  many: Array<(string)>;
1993
2380
  /**
1994
- * maximum travel time in seconds
2381
+ * maximum travel time in seconds. Is limited by server config variable `street_routing_max_direct_seconds`.
1995
2382
  */
1996
2383
  max: number;
1997
2384
  /**
@@ -2007,10 +2394,242 @@ type OneToManyData = {
2007
2394
  * geo location as latitude;longitude
2008
2395
  */
2009
2396
  one: string;
2397
+ /**
2398
+ * Optional. Default is `false`.
2399
+ * If true, the response includes the distance in meters
2400
+ * for each path. This requires path reconstruction and
2401
+ * is slower than duration-only queries.
2402
+ *
2403
+ */
2404
+ withDistance?: boolean;
2010
2405
  };
2011
2406
  };
2012
2407
  type OneToManyResponse = (Array<Duration>);
2013
- type OneToManyError = unknown;
2408
+ type OneToManyError = (Error);
2409
+ type OneToManyPostData = {
2410
+ body: OneToManyParams;
2411
+ };
2412
+ type OneToManyPostResponse = (Array<Duration>);
2413
+ type OneToManyPostError = (Error);
2414
+ type OneToManyIntermodalData = {
2415
+ query: {
2416
+ /**
2417
+ * Optional. Default is 0 minutes.
2418
+ *
2419
+ * Additional transfer time reserved for each transfer in minutes.
2420
+ *
2421
+ */
2422
+ additionalTransferTime?: number;
2423
+ /**
2424
+ * Optional. Defaults to false, i.e. one to many search
2425
+ *
2426
+ * true = many to one
2427
+ * false = one to many
2428
+ *
2429
+ */
2430
+ arriveBy?: boolean;
2431
+ /**
2432
+ * Optional
2433
+ *
2434
+ * Average speed for bike routing.
2435
+ *
2436
+ */
2437
+ cyclingSpeed?: CyclingSpeed;
2438
+ /**
2439
+ * Default is `WALK` which will compute walking routes as direct connections.
2440
+ *
2441
+ * Mode used for direction connections from start to destination without using transit.
2442
+ *
2443
+ * Currently supported non-transit modes: \`WALK\`, \`BIKE\`, \`CAR\`
2444
+ *
2445
+ */
2446
+ directMode?: Mode;
2447
+ /**
2448
+ * Optional. Default is `NONE`.
2449
+ *
2450
+ * Set an elevation cost profile, to penalize routes with incline.
2451
+ * - `NONE`: No additional costs for elevations. This is the default behavior
2452
+ * - `LOW`: Add a low cost for increase in elevation and incline along the way. This will prefer routes with less ascent, if small detours are required.
2453
+ * - `HIGH`: Add a high cost for increase in elevation and incline along the way. This will prefer routes with less ascent, if larger detours are required.
2454
+ *
2455
+ * As using an elevation costs profile will increase the travel duration,
2456
+ * routing through steep terrain may exceed the maximal allowed duration,
2457
+ * causing a location to appear unreachable.
2458
+ * Increasing the maximum travel time for these segments may resolve this issue.
2459
+ *
2460
+ * The profile is used for routing on both the first and last mile.
2461
+ *
2462
+ * Elevation cost profiles are currently used by following street modes:
2463
+ * - `BIKE`
2464
+ *
2465
+ */
2466
+ elevationCosts?: ElevationCosts;
2467
+ /**
2468
+ * geo locations as latitude;longitude,latitude;longitude,...
2469
+ *
2470
+ * The number of accepted locations is limited by server config variable `onetomany_max_many`.
2471
+ *
2472
+ */
2473
+ many: Array<(string)>;
2474
+ /**
2475
+ * Optional. Default is 30min which is `1800`.
2476
+ * Maximum time in seconds for direct connections.
2477
+ *
2478
+ * If a value smaller than either `maxPreTransitTime` or
2479
+ * `maxPostTransitTime` is used, their maximum is set instead.
2480
+ * Is limited by server config variable `street_routing_max_direct_seconds`.
2481
+ *
2482
+ */
2483
+ maxDirectTime?: number;
2484
+ /**
2485
+ * maximum matching distance in meters to match geo coordinates to the street network
2486
+ */
2487
+ maxMatchingDistance?: number;
2488
+ /**
2489
+ * Optional. Default is 15min which is `900`.
2490
+ * Maximum time in seconds for the last street leg.
2491
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
2492
+ *
2493
+ */
2494
+ maxPostTransitTime?: number;
2495
+ /**
2496
+ * Optional. Default is 15min which is `900`.
2497
+ * Maximum time in seconds for the first street leg.
2498
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
2499
+ *
2500
+ */
2501
+ maxPreTransitTime?: number;
2502
+ /**
2503
+ * The maximum number of allowed transfers (i.e. interchanges between transit legs,
2504
+ * pre- and postTransit do not count as transfers).
2505
+ * `maxTransfers=0` searches for direct transit connections without any transfers.
2506
+ * If you want to search only for non-transit connections (`FOOT`, `CAR`, etc.),
2507
+ * send an empty `transitModes` parameter instead.
2508
+ *
2509
+ * If not provided, the routing uses the server-side default value
2510
+ * which is hardcoded and very high to cover all use cases.
2511
+ *
2512
+ * *Warning*: Use with care. Setting this too low can lead to
2513
+ * optimal (e.g. the fastest) journeys not being found.
2514
+ * If this value is too low to reach the destination at all,
2515
+ * it can lead to slow routing performance.
2516
+ *
2517
+ */
2518
+ maxTransfers?: number;
2519
+ /**
2520
+ * The maximum travel time in minutes.
2521
+ * If not provided, the routing uses the value
2522
+ * hardcoded in the server which is usually quite high.
2523
+ *
2524
+ * *Warning*: Use with care. Setting this too low can lead to
2525
+ * optimal (e.g. the least transfers) journeys not being found.
2526
+ * If this value is too low to reach the destination at all,
2527
+ * it can lead to slow routing performance.
2528
+ *
2529
+ */
2530
+ maxTravelTime?: number;
2531
+ /**
2532
+ * Optional. Default is 0 minutes.
2533
+ *
2534
+ * Minimum transfer time for each transfer in minutes.
2535
+ *
2536
+ */
2537
+ minTransferTime?: number;
2538
+ /**
2539
+ * geo location as latitude;longitude
2540
+ */
2541
+ one: string;
2542
+ /**
2543
+ * Optional. Default is `FOOT`.
2544
+ *
2545
+ * Accessibility profile to use for pedestrian routing in transfers
2546
+ * between transit connections and the first and last mile respectively.
2547
+ *
2548
+ */
2549
+ pedestrianProfile?: PedestrianProfile;
2550
+ /**
2551
+ * Optional
2552
+ *
2553
+ * Average speed for pedestrian routing.
2554
+ *
2555
+ */
2556
+ pedestrianSpeed?: PedestrianSpeed;
2557
+ /**
2558
+ * Optional. Default is `WALK`. Does not apply to direct connections (see `directMode`).
2559
+ *
2560
+ * A list of modes that are allowed to be used for the last mile, i.e. from the last transit stop to the target coordinates. Example: `WALK,BIKE_SHARING`.
2561
+ *
2562
+ */
2563
+ postTransitModes?: Array<Mode>;
2564
+ /**
2565
+ * Optional. Default is `WALK`. Does not apply to direct connections (see `directMode`).
2566
+ *
2567
+ * A list of modes that are allowed to be used for the first mile, i.e. from the coordinates to the first transit stop. Example: `WALK,BIKE_SHARING`.
2568
+ *
2569
+ */
2570
+ preTransitModes?: Array<Mode>;
2571
+ /**
2572
+ * Optional. Default is `false`.
2573
+ *
2574
+ * If set to `true`, all used transit trips are required to allow bike carriage.
2575
+ *
2576
+ */
2577
+ requireBikeTransport?: boolean;
2578
+ /**
2579
+ * Optional. Default is `false`.
2580
+ *
2581
+ * If set to `true`, all used transit trips are required to allow car carriage.
2582
+ *
2583
+ */
2584
+ requireCarTransport?: boolean;
2585
+ /**
2586
+ * Optional. Defaults to the current time.
2587
+ *
2588
+ * Departure time ($arriveBy=false) / arrival date ($arriveBy=true),
2589
+ *
2590
+ */
2591
+ time?: string;
2592
+ /**
2593
+ * Optional. Default is 1.0
2594
+ *
2595
+ * Factor to multiply minimum required transfer times with.
2596
+ * Values smaller than 1.0 are not supported.
2597
+ *
2598
+ */
2599
+ transferTimeFactor?: number;
2600
+ /**
2601
+ * Optional. Default is `TRANSIT` which allows all transit modes (no restriction).
2602
+ * Allowed modes for the transit part. If empty, no transit connections will be computed.
2603
+ * For example, this can be used to allow only `SUBURBAN,SUBWAY,TRAM`.
2604
+ *
2605
+ */
2606
+ transitModes?: Array<Mode>;
2607
+ /**
2608
+ * Optional. Default is `false`.
2609
+ *
2610
+ * Whether to use transfers routed on OpenStreetMap data.
2611
+ *
2612
+ */
2613
+ useRoutedTransfers?: boolean;
2614
+ /**
2615
+ * Optional. Default is `false`.
2616
+ * If true, the response includes the distance in meters
2617
+ * for each path. This requires path reconstruction and
2618
+ * is slower than duration-only queries.
2619
+ *
2620
+ * `withDistance` is currently limited to street routing.
2621
+ *
2622
+ */
2623
+ withDistance?: boolean;
2624
+ };
2625
+ };
2626
+ type OneToManyIntermodalResponse2 = (OneToManyIntermodalResponse);
2627
+ type OneToManyIntermodalError = (Error);
2628
+ type OneToManyIntermodalPostData = {
2629
+ body: OneToManyIntermodalParams;
2630
+ };
2631
+ type OneToManyIntermodalPostResponse = (OneToManyIntermodalResponse);
2632
+ type OneToManyIntermodalPostError = (Error);
2014
2633
  type OneToAllData = {
2015
2634
  query: {
2016
2635
  /**
@@ -2260,6 +2879,13 @@ type GeocodeResponse = (Array<Match>);
2260
2879
  type GeocodeError = (Error);
2261
2880
  type TripData = {
2262
2881
  query: {
2882
+ /**
2883
+ * Controls if `legGeometry` is returned for transit legs.
2884
+ *
2885
+ * The default value is `true`.
2886
+ *
2887
+ */
2888
+ detailedLegs?: boolean;
2263
2889
  /**
2264
2890
  * Optional. Default is `true`.
2265
2891
  *
@@ -2289,7 +2915,7 @@ type TripData = {
2289
2915
  type TripResponse = (Itinerary);
2290
2916
  type TripError = (Error);
2291
2917
  type StoptimesData = {
2292
- query: {
2918
+ query?: {
2293
2919
  /**
2294
2920
  * Optional. Default is `false`.
2295
2921
  *
@@ -2298,6 +2924,15 @@ type StoptimesData = {
2298
2924
  *
2299
2925
  */
2300
2926
  arriveBy?: boolean;
2927
+ /**
2928
+ * Anchor coordinate. Format: latitude,longitude pair.
2929
+ * Used as fallback when "stopId" is missing or can't be found.
2930
+ * If both are provided and "stopId" resolves, "stopId" is used.
2931
+ * If "stopId" does not resolve, "center" is used instead. "radius" is
2932
+ * required when querying by "center" (i.e. without a valid "stopId").
2933
+ *
2934
+ */
2935
+ center?: string;
2301
2936
  /**
2302
2937
  * This parameter will be ignored in case `pageCursor` is set.
2303
2938
  *
@@ -2341,9 +2976,11 @@ type StoptimesData = {
2341
2976
  */
2342
2977
  mode?: Array<Mode>;
2343
2978
  /**
2344
- * the number of events
2979
+ * Minimum number of events to return. If both `n` and `window`
2980
+ * are provided, the API uses whichever returns more events.
2981
+ *
2345
2982
  */
2346
- n: number;
2983
+ n?: number;
2347
2984
  /**
2348
2985
  * Use the cursor to go to the next "page" of stop times.
2349
2986
  * Copy the cursor from the last response and keep the original request as is.
@@ -2365,12 +3002,19 @@ type StoptimesData = {
2365
3002
  /**
2366
3003
  * stop id of the stop to retrieve departures/arrivals for
2367
3004
  */
2368
- stopId: string;
3005
+ stopId?: string;
2369
3006
  /**
2370
3007
  * Optional. Defaults to the current time.
2371
3008
  *
2372
3009
  */
2373
3010
  time?: string;
3011
+ /**
3012
+ * Optional. Window in seconds around `time`.
3013
+ * Limiting the response to those that are at most `window` seconds aways in time.
3014
+ * If both `n` and `window` are set, it uses whichever returns more.
3015
+ *
3016
+ */
3017
+ window?: number;
2374
3018
  /**
2375
3019
  * Optional. Default is `true`. If set to `false`, alerts are omitted in the metadata of place for all stopTimes.
2376
3020
  */
@@ -2424,6 +3068,10 @@ type TripsData = {
2424
3068
  * latitude,longitude pair of the lower right coordinate
2425
3069
  */
2426
3070
  min: string;
3071
+ /**
3072
+ * precision of returned polylines. Recommended to set based on zoom: `zoom >= 11 ? 5 : zoom >= 8 ? 4 : zoom >= 5 ? 3 : 2`
3073
+ */
3074
+ precision?: number;
2427
3075
  /**
2428
3076
  * start of the time window
2429
3077
  */
@@ -2449,7 +3097,7 @@ type InitialResponse = ({
2449
3097
  * zoom level
2450
3098
  */
2451
3099
  zoom: number;
2452
- serverConfig?: ServerConfig;
3100
+ serverConfig: ServerConfig;
2453
3101
  });
2454
3102
  type InitialError = (Error);
2455
3103
  type StopsData = {
@@ -2486,6 +3134,40 @@ type LevelsData = {
2486
3134
  };
2487
3135
  type LevelsResponse = (Array<(number)>);
2488
3136
  type LevelsError = (Error);
3137
+ type RoutesData = {
3138
+ query: {
3139
+ /**
3140
+ * language tags as used in OpenStreetMap / GTFS
3141
+ * (usually BCP-47 / ISO 639-1, or ISO 639-2 if there's no ISO 639-1)
3142
+ *
3143
+ */
3144
+ language?: Array<(string)>;
3145
+ /**
3146
+ * latitude,longitude pair of the upper left coordinate
3147
+ */
3148
+ max: string;
3149
+ /**
3150
+ * latitude,longitude pair of the lower right coordinate
3151
+ */
3152
+ min: string;
3153
+ /**
3154
+ * current zoom level
3155
+ */
3156
+ zoom: number;
3157
+ };
3158
+ };
3159
+ type RoutesResponse = ({
3160
+ routes: Array<RouteInfo>;
3161
+ polylines: Array<RoutePolyline>;
3162
+ stops: Array<Place>;
3163
+ /**
3164
+ * Indicates whether some routes were filtered out due to
3165
+ * the zoom level.
3166
+ *
3167
+ */
3168
+ zoomFiltered: boolean;
3169
+ });
3170
+ type RoutesError = (Error);
2489
3171
  type RentalsData = {
2490
3172
  query?: {
2491
3173
  /**
@@ -2587,4 +3269,4 @@ type TransfersResponse = ({
2587
3269
  });
2588
3270
  type TransfersError = unknown;
2589
3271
 
2590
- export type { Alert, AlertCause, AlertEffect, AlertSeverityLevel, Area, CyclingSpeed, Direction, Duration, ElevationCosts, EncodedPolyline, Error, FareMedia, FareMediaType, FareProduct, FareTransfer, FareTransferRule, GeocodeData, GeocodeError, GeocodeResponse, InitialError, InitialResponse, Itinerary, Leg, LevelsData, LevelsError, LevelsResponse, LocationType, Match, Mode, MultiPolygon, OneToAllData, OneToAllError, OneToAllResponse, OneToManyData, OneToManyError, OneToManyParams, OneToManyResponse, PedestrianProfile, PedestrianSpeed, PickupDropoffType, Place, PlanData, PlanError, PlanResponse, Reachable, ReachablePlace, Rental, RentalFormFactor, RentalPropulsionType, RentalProvider, RentalProviderGroup, RentalReturnConstraint, RentalStation, RentalVehicle, RentalVehicleType, RentalZone, RentalZoneRestrictions, RentalsData, RentalsError, RentalsResponse, ReverseGeocodeData, ReverseGeocodeError, ReverseGeocodeResponse, RiderCategory, ServerConfig, StepInstruction, StopTime, StopsData, StopsError, StopsResponse, StoptimesData, StoptimesError, StoptimesResponse, TimeRange, Token, Transfer, TransfersData, TransfersError, TransfersResponse, TripData, TripError, TripInfo, TripResponse, TripSegment, TripsData, TripsError, TripsResponse, VertexType };
3272
+ export type { Alert, AlertCause, AlertEffect, AlertSeverityLevel, Area, Category, CyclingSpeed, Direction, Duration, ElevationCosts, EncodedPolyline, Error, FareMedia, FareMediaType, FareProduct, FareTransfer, FareTransferRule, GeocodeData, GeocodeError, GeocodeResponse, InitialError, InitialResponse, Itinerary, Leg, LevelsData, LevelsError, LevelsResponse, LocationType, Match, Mode, MultiPolygon, OneToAllData, OneToAllError, OneToAllResponse, OneToManyData, OneToManyError, OneToManyIntermodalData, OneToManyIntermodalError, OneToManyIntermodalParams, OneToManyIntermodalPostData, OneToManyIntermodalPostError, OneToManyIntermodalPostResponse, OneToManyIntermodalResponse, OneToManyIntermodalResponse2, OneToManyParams, OneToManyPostData, OneToManyPostError, OneToManyPostResponse, OneToManyResponse, ParetoSet, ParetoSetEntry, PedestrianProfile, PedestrianSpeed, PickupDropoffType, Place, PlanData, PlanError, PlanResponse, Reachable, ReachablePlace, Rental, RentalFormFactor, RentalPropulsionType, RentalProvider, RentalProviderGroup, RentalReturnConstraint, RentalStation, RentalVehicle, RentalVehicleType, RentalZone, RentalZoneRestrictions, RentalsData, RentalsError, RentalsResponse, ReverseGeocodeData, ReverseGeocodeError, ReverseGeocodeResponse, RiderCategory, RouteColor, RouteInfo, RoutePathSource, RoutePolyline, RouteSegment, RoutesData, RoutesError, RoutesResponse, ServerConfig, StepInstruction, StopTime, StopsData, StopsError, StopsResponse, StoptimesData, StoptimesError, StoptimesResponse, TimeRange, Token, Transfer, TransfersData, TransfersError, TransfersResponse, TransitRouteInfo, TripData, TripError, TripInfo, TripResponse, TripSegment, TripsData, TripsError, TripsResponse, VertexType };