@motis-project/motis-client 2.1.2 → 2.5.0

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.
@@ -199,10 +199,18 @@ type Match = {
199
199
  * house number
200
200
  */
201
201
  houseNumber?: string;
202
+ /**
203
+ * ISO3166-1 country code from OpenStreetMap
204
+ */
205
+ country?: string;
202
206
  /**
203
207
  * zip code
204
208
  */
205
209
  zip?: string;
210
+ /**
211
+ * timezone name (e.g. "Europe/Berlin")
212
+ */
213
+ tz?: string;
206
214
  /**
207
215
  * list of areas
208
216
  */
@@ -226,6 +234,14 @@ type ElevationCosts = 'NONE' | 'LOW' | 'HIGH';
226
234
  * Different accessibility profiles for pedestrians.
227
235
  */
228
236
  type PedestrianProfile = 'FOOT' | 'WHEELCHAIR';
237
+ /**
238
+ * Average speed for pedestrian routing in meters per second
239
+ */
240
+ type PedestrianSpeed = number;
241
+ /**
242
+ * Average speed for bike routing in meters per second
243
+ */
244
+ type CyclingSpeed = number;
229
245
  /**
230
246
  * # Street modes
231
247
  *
@@ -242,13 +258,13 @@ type PedestrianProfile = 'FOOT' | 'WHEELCHAIR';
242
258
  *
243
259
  * - `TRANSIT`: translates to `RAIL,TRAM,BUS,FERRY,AIRPLANE,COACH,CABLE_CAR,FUNICULAR,AREAL_LIFT,OTHER`
244
260
  * - `TRAM`: trams
245
- * - `SUBWAY`: subway trains
261
+ * - `SUBWAY`: subway trains (Paris Metro, London Underground, but also NYC Subway, Hamburger Hochbahn, and other non-underground services)
246
262
  * - `FERRY`: ferries
247
263
  * - `AIRPLANE`: airline flights
248
264
  * - `BUS`: short distance buses (does not include `COACH`)
249
265
  * - `COACH`: long distance buses (does not include `BUS`)
250
- * - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL,METRO,SUBWAY`
251
- * - `METRO`: metro trains
266
+ * - `RAIL`: translates to `HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,REGIONAL_FAST_RAIL,SUBURBAN,SUBWAY`
267
+ * - `SUBURBAN`: suburban trains (e.g. S-Bahn, RER, Elizabeth Line, ...)
252
268
  * - `HIGHSPEED_RAIL`: long distance high speed trains (e.g. TGV)
253
269
  * - `LONG_DISTANCE`: long distance inter city trains
254
270
  * - `NIGHT_RAIL`: long distance night trains
@@ -256,10 +272,12 @@ type PedestrianProfile = 'FOOT' | 'WHEELCHAIR';
256
272
  * - `REGIONAL_RAIL`: regional train
257
273
  * - `CABLE_CAR`: Cable tram. Used for street-level rail cars where the cable runs beneath the vehicle (e.g., cable car in San Francisco).
258
274
  * - `FUNICULAR`: Funicular. Any rail system designed for steep inclines.
259
- * - `AREAL_LIFT`: Aerial lift, suspended cable car (e.g., gondola lift, aerial tramway). Cable transport where cabins, cars, gondolas or open chairs are suspended by means of one or more cables.
275
+ * - `AERIAL_LIFT`: Aerial lift, suspended cable car (e.g., gondola lift, aerial tramway). Cable transport where cabins, cars, gondolas or open chairs are suspended by means of one or more cables.
276
+ * - `AREAL_LIFT`: deprecated
277
+ * - `METRO`: deprecated
260
278
  *
261
279
  */
262
- type Mode = 'WALK' | 'BIKE' | 'RENTAL' | 'CAR' | 'CAR_PARKING' | 'CAR_DROPOFF' | 'ODM' | 'FLEX' | 'TRANSIT' | 'TRAM' | 'SUBWAY' | 'FERRY' | 'AIRPLANE' | 'METRO' | 'BUS' | 'COACH' | 'RAIL' | 'HIGHSPEED_RAIL' | 'LONG_DISTANCE' | 'NIGHT_RAIL' | 'REGIONAL_FAST_RAIL' | 'REGIONAL_RAIL' | 'CABLE_CAR' | 'FUNICULAR' | 'AREAL_LIFT' | 'OTHER';
280
+ type Mode = 'WALK' | 'BIKE' | 'RENTAL' | 'CAR' | 'CAR_PARKING' | 'CAR_DROPOFF' | 'ODM' | 'FLEX' | 'TRANSIT' | 'TRAM' | 'SUBWAY' | 'FERRY' | 'AIRPLANE' | 'SUBURBAN' | 'BUS' | 'COACH' | 'RAIL' | 'HIGHSPEED_RAIL' | 'LONG_DISTANCE' | 'NIGHT_RAIL' | 'REGIONAL_FAST_RAIL' | 'REGIONAL_RAIL' | 'CABLE_CAR' | 'FUNICULAR' | 'AERIAL_LIFT' | 'OTHER' | 'AREAL_LIFT' | 'METRO';
263
281
  /**
264
282
  * - `NORMAL` - latitude / longitude coordinate or address
265
283
  * - `BIKESHARE` - bike sharing station
@@ -294,6 +312,10 @@ type Place = {
294
312
  * level according to OpenStreetMap
295
313
  */
296
314
  level: number;
315
+ /**
316
+ * timezone name (e.g. "Europe/Berlin")
317
+ */
318
+ tz?: string;
297
319
  /**
298
320
  * arrival time
299
321
  */
@@ -413,18 +435,40 @@ type StopTime = {
413
435
  */
414
436
  realTime: boolean;
415
437
  /**
416
- * For transit legs, the headsign of the bus or train being used.
438
+ * The headsign of the bus or train being used.
417
439
  * For non-transit legs, null
418
440
  *
419
441
  */
420
442
  headsign: string;
443
+ /**
444
+ * final stop of this trip
445
+ */
446
+ tripTo: Place;
421
447
  agencyId: string;
422
448
  agencyName: string;
423
449
  agencyUrl: string;
424
450
  routeColor?: string;
425
451
  routeTextColor?: string;
426
452
  tripId: string;
453
+ routeType?: number;
427
454
  routeShortName: string;
455
+ routeLongName: string;
456
+ tripShortName: string;
457
+ displayName: string;
458
+ /**
459
+ * Experimental. Expect unannounced breaking changes (without version bumps).
460
+ *
461
+ * Stops on the trips before this stop. Returned only if `fetchStop` and `arriveBy` are `true`.
462
+ *
463
+ */
464
+ previousStops?: Array<Place>;
465
+ /**
466
+ * Experimental. Expect unannounced breaking changes (without version bumps).
467
+ *
468
+ * Stops on the trips after this stop. Returned only if `fetchStop` is `true` and `arriveBy` is `false`.
469
+ *
470
+ */
471
+ nextStops?: Array<Place>;
428
472
  /**
429
473
  * Type of pickup (for departures) or dropoff (for arrivals), may be disallowed either due to schedule, skipped stops or cancellations
430
474
  */
@@ -451,9 +495,13 @@ type TripInfo = {
451
495
  */
452
496
  tripId: string;
453
497
  /**
454
- * trip display name
498
+ * trip display name (api version < 4)
455
499
  */
456
- routeShortName: string;
500
+ routeShortName?: string;
501
+ /**
502
+ * trip display name (api version >= 4)
503
+ */
504
+ displayName?: string;
457
505
  };
458
506
  /**
459
507
  * trip segment between two stops to show a trip on a map
@@ -684,14 +732,21 @@ type Leg = {
684
732
  *
685
733
  */
686
734
  headsign?: string;
735
+ /**
736
+ * final stop of this trip (can differ from headsign)
737
+ */
738
+ tripTo?: Place;
687
739
  routeColor?: string;
688
740
  routeTextColor?: string;
689
- routeType?: string;
741
+ routeType?: number;
690
742
  agencyName?: string;
691
743
  agencyUrl?: string;
692
744
  agencyId?: string;
693
745
  tripId?: string;
694
746
  routeShortName?: string;
747
+ routeLongName?: string;
748
+ tripShortName?: string;
749
+ displayName?: string;
695
750
  /**
696
751
  * Whether this trip is cancelled
697
752
  */
@@ -895,6 +950,9 @@ type Transfer = {
895
950
  */
896
951
  car?: number;
897
952
  };
953
+ type Error = {
954
+ error?: string;
955
+ };
898
956
  type PlanData = {
899
957
  query: {
900
958
  /**
@@ -904,6 +962,10 @@ type PlanData = {
904
962
  *
905
963
  */
906
964
  additionalTransferTime?: number;
965
+ /**
966
+ * algorithm to use
967
+ */
968
+ algorithm?: 'RAPTOR' | 'TB';
907
969
  /**
908
970
  * Optional. Default is `false`.
909
971
  *
@@ -912,6 +974,13 @@ type PlanData = {
912
974
  *
913
975
  */
914
976
  arriveBy?: boolean;
977
+ /**
978
+ * Optional
979
+ *
980
+ * Average speed for bike routing.
981
+ *
982
+ */
983
+ cyclingSpeed?: CyclingSpeed;
915
984
  /**
916
985
  * - true: Compute transfer polylines and step instructions.
917
986
  * - false: Only return basic information (start time, end time, duration) for transfers.
@@ -998,7 +1067,7 @@ type PlanData = {
998
1067
  /**
999
1068
  * Optional.
1000
1069
  * Factor with which the duration of the fastest slowDirect connection is multiplied.
1001
- * Values > 1.0 allow connections that are slower than the fastest direct connection to be found.
1070
+ * Values > 1.0 allow connections that are slower than the fastest direct transit connection to be found.
1002
1071
  * Values < 1.0 will return all slowDirect connections.
1003
1072
  *
1004
1073
  */
@@ -1068,6 +1137,7 @@ type PlanData = {
1068
1137
  /**
1069
1138
  * Optional. Default is 30min which is `1800`.
1070
1139
  * Maximum time in seconds for direct connections.
1140
+ * Is limited by server config variable `street_routing_max_direct_seconds`.
1071
1141
  *
1072
1142
  */
1073
1143
  maxDirectTime?: number;
@@ -1081,12 +1151,14 @@ type PlanData = {
1081
1151
  /**
1082
1152
  * Optional. Default is 15min which is `900`.
1083
1153
  * Maximum time in seconds for the last street leg.
1154
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1084
1155
  *
1085
1156
  */
1086
1157
  maxPostTransitTime?: number;
1087
1158
  /**
1088
1159
  * Optional. Default is 15min which is `900`.
1089
1160
  * Maximum time in seconds for the first street leg.
1161
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1090
1162
  *
1091
1163
  */
1092
1164
  maxPreTransitTime?: number;
@@ -1155,6 +1227,13 @@ type PlanData = {
1155
1227
  *
1156
1228
  */
1157
1229
  pedestrianProfile?: PedestrianProfile;
1230
+ /**
1231
+ * Optional
1232
+ *
1233
+ * Average speed for pedestrian routing.
1234
+ *
1235
+ */
1236
+ pedestrianSpeed?: PedestrianSpeed;
1158
1237
  /**
1159
1238
  * Optional. Default is `WALK`. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`).
1160
1239
  *
@@ -1315,7 +1394,7 @@ type PlanData = {
1315
1394
  /**
1316
1395
  * Optional. Default is `TRANSIT` which allows all transit modes (no restriction).
1317
1396
  * Allowed modes for the transit part. If empty, no transit connections will be computed.
1318
- * For example, this can be used to allow only `METRO,SUBWAY,TRAM`.
1397
+ * For example, this can be used to allow only `SUBURBAN,SUBWAY,TRAM`.
1319
1398
  *
1320
1399
  */
1321
1400
  transitModes?: Array<Mode>;
@@ -1393,7 +1472,7 @@ type PlanResponse = ({
1393
1472
  */
1394
1473
  nextPageCursor: string;
1395
1474
  });
1396
- type PlanError = unknown;
1475
+ type PlanError = (Error);
1397
1476
  type OneToManyData = {
1398
1477
  query: {
1399
1478
  /**
@@ -1460,6 +1539,13 @@ type OneToAllData = {
1460
1539
  *
1461
1540
  */
1462
1541
  arriveBy?: boolean;
1542
+ /**
1543
+ * Optional
1544
+ *
1545
+ * Average speed for bike routing.
1546
+ *
1547
+ */
1548
+ cyclingSpeed?: CyclingSpeed;
1463
1549
  /**
1464
1550
  * Optional. Default is `NONE`.
1465
1551
  *
@@ -1491,6 +1577,7 @@ type OneToAllData = {
1491
1577
  * Optional. Default is 15min which is `900`.
1492
1578
  * - `arriveBy=true`: Maximum time in seconds for the street leg at `one` location.
1493
1579
  * - `arriveBy=false`: Currently not used
1580
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1494
1581
  *
1495
1582
  */
1496
1583
  maxPostTransitTime?: number;
@@ -1498,6 +1585,7 @@ type OneToAllData = {
1498
1585
  * Optional. Default is 15min which is `900`.
1499
1586
  * - `arriveBy=true`: Currently not used
1500
1587
  * - `arriveBy=false`: Maximum time in seconds for the street leg at `one` location.
1588
+ * Is limited by server config variable `street_routing_max_prepost_transit_seconds`.
1501
1589
  *
1502
1590
  */
1503
1591
  maxPreTransitTime?: number;
@@ -1522,7 +1610,7 @@ type OneToAllData = {
1522
1610
  */
1523
1611
  maxTransfers?: number;
1524
1612
  /**
1525
- * maximum travel time in minutes
1613
+ * The maximum travel time in minutes. Defaults to 90. The limit may be increased by the server administrator using `onetoall_max_travel_minutes` option in `config.yml`. See documentation for details.
1526
1614
  */
1527
1615
  maxTravelTime: number;
1528
1616
  /**
@@ -1551,6 +1639,13 @@ type OneToAllData = {
1551
1639
  *
1552
1640
  */
1553
1641
  pedestrianProfile?: PedestrianProfile;
1642
+ /**
1643
+ * Optional
1644
+ *
1645
+ * Average speed for pedestrian routing.
1646
+ *
1647
+ */
1648
+ pedestrianSpeed?: PedestrianSpeed;
1554
1649
  /**
1555
1650
  * Optional. Default is `WALK`. The behavior depends on whether `arriveBy` is set:
1556
1651
  * - `arriveBy=true`: Only applies if the `one` place is a coordinate (not a transit stop).
@@ -1601,7 +1696,7 @@ type OneToAllData = {
1601
1696
  /**
1602
1697
  * Optional. Default is `TRANSIT` which allows all transit modes (no restriction).
1603
1698
  * Allowed modes for the transit part. If empty, no transit connections will be computed.
1604
- * For example, this can be used to allow only `METRO,SUBWAY,TRAM`.
1699
+ * For example, this can be used to allow only `SUBURBAN,SUBWAY,TRAM`.
1605
1700
  *
1606
1701
  */
1607
1702
  transitModes?: Array<Mode>;
@@ -1615,7 +1710,7 @@ type OneToAllData = {
1615
1710
  };
1616
1711
  };
1617
1712
  type OneToAllResponse = (Reachable);
1618
- type OneToAllError = unknown;
1713
+ type OneToAllError = (Error);
1619
1714
  type ReverseGeocodeData = {
1620
1715
  query: {
1621
1716
  /**
@@ -1633,7 +1728,7 @@ type ReverseGeocodeData = {
1633
1728
  };
1634
1729
  };
1635
1730
  type ReverseGeocodeResponse = (Array<Match>);
1636
- type ReverseGeocodeError = unknown;
1731
+ type ReverseGeocodeError = (Error);
1637
1732
  type GeocodeData = {
1638
1733
  query: {
1639
1734
  /**
@@ -1669,7 +1764,7 @@ type GeocodeData = {
1669
1764
  };
1670
1765
  };
1671
1766
  type GeocodeResponse = (Array<Match>);
1672
- type GeocodeError = unknown;
1767
+ type GeocodeError = (Error);
1673
1768
  type TripData = {
1674
1769
  query: {
1675
1770
  /**
@@ -1699,7 +1794,7 @@ type TripData = {
1699
1794
  };
1700
1795
  };
1701
1796
  type TripResponse = (Itinerary);
1702
- type TripError = unknown;
1797
+ type TripError = (Error);
1703
1798
  type StoptimesData = {
1704
1799
  query: {
1705
1800
  /**
@@ -1731,6 +1826,14 @@ type StoptimesData = {
1731
1826
  *
1732
1827
  */
1733
1828
  exactRadius?: boolean;
1829
+ /**
1830
+ * Experimental. Expect unannounced breaking changes (without version bumps).
1831
+ *
1832
+ * Optional. Default is `false`. If set to `true`, the following stops are returned
1833
+ * for departures and the previous stops are returned for arrivals.
1834
+ *
1835
+ */
1836
+ fetchStops?: boolean;
1734
1837
  /**
1735
1838
  * language tags as used in OpenStreetMap / GTFS
1736
1839
  * (usually BCP-47 / ISO 639-1, or ISO 639-2 if there's no ISO 639-1)
@@ -1803,7 +1906,7 @@ type StoptimesResponse = ({
1803
1906
  */
1804
1907
  nextPageCursor: string;
1805
1908
  });
1806
- type StoptimesError = unknown;
1909
+ type StoptimesError = (Error);
1807
1910
  type TripsData = {
1808
1911
  query: {
1809
1912
  /**
@@ -1829,7 +1932,7 @@ type TripsData = {
1829
1932
  };
1830
1933
  };
1831
1934
  type TripsResponse = (Array<TripSegment>);
1832
- type TripsError = unknown;
1935
+ type TripsError = (Error);
1833
1936
  type InitialResponse = ({
1834
1937
  /**
1835
1938
  * latitude
@@ -1844,7 +1947,7 @@ type InitialResponse = ({
1844
1947
  */
1845
1948
  zoom: number;
1846
1949
  });
1847
- type InitialError = unknown;
1950
+ type InitialError = (Error);
1848
1951
  type StopsData = {
1849
1952
  query: {
1850
1953
  /**
@@ -1858,7 +1961,7 @@ type StopsData = {
1858
1961
  };
1859
1962
  };
1860
1963
  type StopsResponse = (Array<Place>);
1861
- type StopsError = unknown;
1964
+ type StopsError = (Error);
1862
1965
  type LevelsData = {
1863
1966
  query: {
1864
1967
  /**
@@ -1872,7 +1975,7 @@ type LevelsData = {
1872
1975
  };
1873
1976
  };
1874
1977
  type LevelsResponse = (Array<(number)>);
1875
- type LevelsError = unknown;
1978
+ type LevelsError = (Error);
1876
1979
  type TransfersData = {
1877
1980
  query: {
1878
1981
  /**
@@ -1902,4 +2005,4 @@ type TransfersResponse = ({
1902
2005
  });
1903
2006
  type TransfersError = unknown;
1904
2007
 
1905
- export type { Alert, AlertCause, AlertEffect, AlertSeverityLevel, Area, Direction, Duration, ElevationCosts, EncodedPolyline, FareMedia, FareMediaType, FareProduct, FareTransfer, FareTransferRule, GeocodeData, GeocodeError, GeocodeResponse, InitialError, InitialResponse, Itinerary, Leg, LevelsData, LevelsError, LevelsResponse, LocationType, Match, Mode, OneToAllData, OneToAllError, OneToAllResponse, OneToManyData, OneToManyError, OneToManyResponse, PedestrianProfile, PickupDropoffType, Place, PlanData, PlanError, PlanResponse, Reachable, ReachablePlace, Rental, RentalFormFactor, RentalPropulsionType, RentalReturnConstraint, ReverseGeocodeData, ReverseGeocodeError, ReverseGeocodeResponse, RiderCategory, StepInstruction, StopTime, StopsData, StopsError, StopsResponse, StoptimesData, StoptimesError, StoptimesResponse, TimeRange, Token, Transfer, TransfersData, TransfersError, TransfersResponse, TripData, TripError, TripInfo, TripResponse, TripSegment, TripsData, TripsError, TripsResponse, VertexType };
2008
+ 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, OneToAllData, OneToAllError, OneToAllResponse, OneToManyData, OneToManyError, OneToManyResponse, PedestrianProfile, PedestrianSpeed, PickupDropoffType, Place, PlanData, PlanError, PlanResponse, Reachable, ReachablePlace, Rental, RentalFormFactor, RentalPropulsionType, RentalReturnConstraint, ReverseGeocodeData, ReverseGeocodeError, ReverseGeocodeResponse, RiderCategory, StepInstruction, StopTime, StopsData, StopsError, StopsResponse, StoptimesData, StoptimesError, StoptimesResponse, TimeRange, Token, Transfer, TransfersData, TransfersError, TransfersResponse, TripData, TripError, TripInfo, TripResponse, TripSegment, TripsData, TripsError, TripsResponse, VertexType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motis-project/motis-client",
3
- "version": "2.1.2",
3
+ "version": "2.5.0",
4
4
  "description": "A JS client for the MOTIS API.",
5
5
  "public": true,
6
6
  "main": "dist/index.js",