@motis-project/motis-client 2.9.2 → 2.10.2

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Cause of this alert.
3
3
  */
4
- type AlertCause = 'UNKNOWN_CAUSE' | 'OTHER_CAUSE' | 'TECHNICAL_PROBLEM' | 'STRIKE' | 'DEMONSTRATION' | 'ACCIDENT' | 'HOLIDAY' | 'WEATHER' | 'MAINTENANCE' | 'CONSTRUCTION' | 'POLICE_ACTIVITY' | 'MEDICAL_EMERGENCY';
4
+ type AlertCause = 'UNKNOWN_CAUSE' | 'OTHER_CAUSE' | 'TECHNICAL_PROBLEM' | 'STRIKE' | 'DEMONSTRATION' | 'ACCIDENT' | 'HOLIDAY' | 'WEATHER' | 'MAINTENANCE' | 'CONSTRUCTION' | 'POLICE_ACTIVITY' | 'MEDICAL_EMERGENCY' | 'SPECIAL_EVENT';
5
5
  /**
6
6
  * The effect of this problem on the affected entity.
7
7
  */
@@ -226,7 +226,7 @@ type LocationType = 'ADDRESS' | 'PLACE' | 'STOP';
226
226
  *
227
227
  * # Transit modes
228
228
  *
229
- * - `TRANSIT`: translates to `TRAM,FERRY,AIRPLANE,BUS,COACH,RAIL,ODM,FUNICULAR,AERIAL_LIFT,OTHER`
229
+ * - `TRANSIT`: translates to `TRAM,FERRY,AIRPLANE,BUS,COACH,RAIL,ODM,RIDE_SHARING,FUNICULAR,AERIAL_LIFT,OTHER`
230
230
  * - `TRAM`: trams
231
231
  * - `SUBWAY`: subway trains (Paris Metro, London Underground, but also NYC Subway, Hamburger Hochbahn, and other non-underground services)
232
232
  * - `FERRY`: ferries
@@ -241,6 +241,7 @@ type LocationType = 'ADDRESS' | 'PLACE' | 'STOP';
241
241
  * - `REGIONAL_RAIL`: regional train
242
242
  * - `SUBURBAN`: suburban trains (e.g. S-Bahn, RER, Elizabeth Line, ...)
243
243
  * - `ODM`: demand responsive transport
244
+ * - `RIDE_SHARING`: ride sharing
244
245
  * - `FUNICULAR`: Funicular. Any rail system designed for steep inclines.
245
246
  * - `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.
246
247
  * - `AREAL_LIFT`: deprecated
@@ -387,8 +388,13 @@ type Place = {
387
388
  lon: number;
388
389
  /**
389
390
  * level according to OpenStreetMap
391
+ * If no level is given, the field will be unset.
392
+ *
393
+ * For older versions (v1-v5), this field is mandatory and therefore set to 0.
394
+ * Affected endpoints: plan, trip, stoptimes, one-to-all, map/stops, map/trips
395
+ *
390
396
  */
391
- level: number;
397
+ level?: number;
392
398
  /**
393
399
  * timezone name (e.g. "Europe/Berlin")
394
400
  */
@@ -419,6 +425,13 @@ type Place = {
419
425
  *
420
426
  */
421
427
  track?: string;
428
+ /**
429
+ * Short, abbreviated identifier of the stop intended for users
430
+ * (e.g. printed on signage, used in SMS / passenger info systems).
431
+ * Comes from the GTFS `stop_code` field.
432
+ *
433
+ */
434
+ stopCode?: string;
422
435
  /**
423
436
  * description of the location that provides more detailed information
424
437
  */
@@ -710,6 +723,7 @@ type StepInstruction = {
710
723
  */
711
724
  elevationDown?: number;
712
725
  };
726
+ type WheelchairAccessibility = 'ACCESSIBLE' | 'NOT_ACCESSIBLE';
713
727
  type RentalFormFactor = 'BICYCLE' | 'CARGO_BICYCLE' | 'CAR' | 'MOPED' | 'SCOOTER_STANDING' | 'SCOOTER_SEATED' | 'OTHER';
714
728
  type RentalPropulsionType = 'HUMAN' | 'ELECTRIC_ASSIST' | 'ELECTRIC' | 'COMBUSTION' | 'COMBUSTION_DIESEL' | 'HYBRID' | 'PLUG_IN_HYBRID' | 'HYDROGEN_FUEL_CELL';
715
729
  type RentalReturnConstraint = 'NONE' | 'ANY_STATION' | 'ROUNDTRIP_STATION';
@@ -1223,6 +1237,34 @@ type Leg = {
1223
1237
  *
1224
1238
  */
1225
1239
  bikesAllowed?: boolean;
1240
+ /**
1241
+ * Whether wheelchairs can be transported on this leg.
1242
+ *
1243
+ */
1244
+ wheelchairAccessible?: WheelchairAccessibility;
1245
+ /**
1246
+ * Alternative connections that can replace this transit leg.
1247
+ * Each alternative is normally a sequence of 3 legs:
1248
+ * `[ingress footpath, transit, egress footpath]`.
1249
+ * Only populated when the request sets `numLegAlternatives` > 0
1250
+ * (capped to that value).
1251
+ *
1252
+ * Interlined legs:
1253
+ * `alternatives` is populated only on the first (main) leg of
1254
+ * an interlined chain. Subsequent interlined legs (carrying
1255
+ * `interlineWithPreviousLeg=true`) leave `alternatives` unset.
1256
+ * Alternatives are valid for the whole interlined segment.
1257
+ *
1258
+ * An alternative may itself cover an interlined segment:
1259
+ * the alternative's middle transit then expands into multiple
1260
+ * interlined legs when `joinInterlinedLegs=false`. In that
1261
+ * case the alternative contains more than 3 legs: ingress
1262
+ * footpath, followed by N interlined transit legs (the
1263
+ * secondary ones carrying `interlineWithPreviousLeg=true`),
1264
+ * followed by an egress footpath.
1265
+ *
1266
+ */
1267
+ alternatives?: Array<Array<Leg>>;
1226
1268
  };
1227
1269
  type RiderCategory = {
1228
1270
  /**
@@ -1307,6 +1349,77 @@ type FareTransfer = {
1307
1349
  */
1308
1350
  effectiveFareLegProducts: Array<Array<Array<FareProduct>>>;
1309
1351
  };
1352
+ type LegId = {
1353
+ displayName: string;
1354
+ tripId: string;
1355
+ /**
1356
+ * from stop stopId
1357
+ */
1358
+ fromId: string;
1359
+ /**
1360
+ * latitude of the leg's from endpoint
1361
+ */
1362
+ fromLat: number;
1363
+ /**
1364
+ * longitude of the leg's from endpoint
1365
+ */
1366
+ fromLon: number;
1367
+ /**
1368
+ * Optional level (floor) of the leg's from endpoint for indoor routing.
1369
+ */
1370
+ fromLevel?: number;
1371
+ /**
1372
+ * to stop stopId
1373
+ */
1374
+ toId: string;
1375
+ /**
1376
+ * latitude of the leg's to endpoint
1377
+ */
1378
+ toLat: number;
1379
+ /**
1380
+ * longitude of the leg's to endpoint
1381
+ */
1382
+ toLon: number;
1383
+ /**
1384
+ * Optional level (floor) of the leg's to endpoint for indoor routing.
1385
+ */
1386
+ toLevel?: number;
1387
+ /**
1388
+ * Scheduled departure time as a Unix timestamp in seconds.
1389
+ */
1390
+ schedStart: number;
1391
+ /**
1392
+ * Scheduled arrival time as a Unix timestamp in seconds.
1393
+ */
1394
+ schedEnd: number;
1395
+ mode: Mode;
1396
+ scheduled: boolean;
1397
+ };
1398
+ type ItineraryId = {
1399
+ legs: Array<LegId>;
1400
+ };
1401
+ /**
1402
+ * Body for the `refreshItineraryPost` endpoint. All fields mirror the
1403
+ * parameters of the `plan` endpoint - see the `plan` endpoint for their
1404
+ * descriptions.
1405
+ *
1406
+ */
1407
+ type RefreshItineraryPostBody = {
1408
+ id: ItineraryId;
1409
+ requireDisplayNameMatch?: boolean;
1410
+ joinInterlinedLegs?: boolean;
1411
+ detailedTransfers?: boolean;
1412
+ detailedLegs?: boolean;
1413
+ withFares?: boolean;
1414
+ withScheduledSkippedStops?: boolean;
1415
+ numLegAlternatives?: number;
1416
+ transitModes?: Array<Mode>;
1417
+ pedestrianProfile?: PedestrianProfile;
1418
+ useRoutedTransfers?: boolean;
1419
+ requireBikeTransport?: boolean;
1420
+ requireCarTransport?: boolean;
1421
+ language?: Array<(string)>;
1422
+ };
1310
1423
  type Itinerary = {
1311
1424
  /**
1312
1425
  * journey duration in seconds
@@ -1324,6 +1437,12 @@ type Itinerary = {
1324
1437
  * The number of transfers this trip has.
1325
1438
  */
1326
1439
  transfers: number;
1440
+ /**
1441
+ * Experimental (format might change). Opaque itinerary identifier.
1442
+ * Pass it as `itineraryId` to `refresh-itinerary` endpoint for reconstruction using the new schedule/realtime data.
1443
+ *
1444
+ */
1445
+ id: string;
1327
1446
  /**
1328
1447
  * Journey legs
1329
1448
  */
@@ -1767,6 +1886,16 @@ type RouteInfo = {
1767
1886
  pathSource: RoutePathSource;
1768
1887
  segments: Array<RouteSegment>;
1769
1888
  };
1889
+ type HealthResponse = {
1890
+ /**
1891
+ * GTFSRT, SIRI Lite, VDV AUS, VDV454 feeds.
1892
+ */
1893
+ rt?: boolean;
1894
+ /**
1895
+ * GBFS feeds.
1896
+ */
1897
+ gbfs?: boolean;
1898
+ };
1770
1899
  type PlanData = {
1771
1900
  query: {
1772
1901
  /**
@@ -2059,6 +2188,18 @@ type PlanData = {
2059
2188
  *
2060
2189
  */
2061
2190
  numItineraries?: number;
2191
+ /**
2192
+ * Optional. Maximum number of alternatives to return per transit
2193
+ * leg. `0` disables alternatives. When greater than zero, each
2194
+ * transit leg in the response is annotated with up to N
2195
+ * `alternatives`: connections that can replace the leg while still
2196
+ * matching the surrounding journey context (i.e. arriving in time
2197
+ * for the next transit leg / departing after the previous transit
2198
+ * leg's arrival). Each alternative is a 3-leg sequence
2199
+ * `[ingress footpath, transit, egress footpath]`.
2200
+ *
2201
+ */
2202
+ numLegAlternatives?: number;
2062
2203
  /**
2063
2204
  * Use the cursor to go to the next "page" of itineraries.
2064
2205
  * Copy the cursor from the last response and keep the original request as is.
@@ -2183,6 +2324,14 @@ type PlanData = {
2183
2324
  *
2184
2325
  */
2185
2326
  preTransitRentalProviders?: Array<(string)>;
2327
+ /**
2328
+ * Experimental. Search radius in meters around the `fromPlace` / `toPlace` coordinates.
2329
+ * When set and the place is given as coordinates, all transit stops within
2330
+ * this radius are used as start/end points with zero pre-transit/post-transit time.
2331
+ * Works without OSM/street routing data loaded.
2332
+ *
2333
+ */
2334
+ radius?: number;
2186
2335
  /**
2187
2336
  * Optional. Default is `false`.
2188
2337
  *
@@ -2819,6 +2968,14 @@ type OneToAllResponse = (Reachable);
2819
2968
  type OneToAllError = (Error);
2820
2969
  type ReverseGeocodeData = {
2821
2970
  query: {
2971
+ /**
2972
+ * Optional. Number of results to return.
2973
+ *
2974
+ * If omitted, 5 results are returned by default.
2975
+ * Must be <= server config variable `reverse_geocode_max_results`.
2976
+ *
2977
+ */
2978
+ numResults?: number;
2822
2979
  /**
2823
2980
  * latitude, longitude in degrees
2824
2981
  */
@@ -2826,11 +2983,11 @@ type ReverseGeocodeData = {
2826
2983
  /**
2827
2984
  * Optional. Default is all types.
2828
2985
  *
2829
- * Only return results of the given type.
2986
+ * Only return results matching one of the given types.
2830
2987
  * For example, this can be used to allow only `ADDRESS` and `STOP` results.
2831
2988
  *
2832
2989
  */
2833
- type?: LocationType;
2990
+ type?: Array<LocationType>;
2834
2991
  };
2835
2992
  };
2836
2993
  type ReverseGeocodeResponse = (Array<Match>);
@@ -2849,6 +3006,14 @@ type GeocodeData = {
2849
3006
  *
2850
3007
  */
2851
3008
  mode?: Array<Mode>;
3009
+ /**
3010
+ * Optional. Number of suggestions to return.
3011
+ *
3012
+ * If omitted, 10 suggestions are returned by default.
3013
+ * Must be <= server config variable `geocode_max_suggestions`.
3014
+ *
3015
+ */
3016
+ numResults?: number;
2852
3017
  /**
2853
3018
  * Optional. Used for biasing results towards the coordinate.
2854
3019
  *
@@ -2868,11 +3033,11 @@ type GeocodeData = {
2868
3033
  /**
2869
3034
  * Optional. Default is all types.
2870
3035
  *
2871
- * Only return results of the given types.
3036
+ * Only return results matching one of the given types.
2872
3037
  * For example, this can be used to allow only `ADDRESS` and `STOP` results.
2873
3038
  *
2874
3039
  */
2875
- type?: LocationType;
3040
+ type?: Array<LocationType>;
2876
3041
  };
2877
3042
  };
2878
3043
  type GeocodeResponse = (Array<Match>);
@@ -2914,6 +3079,31 @@ type TripData = {
2914
3079
  };
2915
3080
  type TripResponse = (Itinerary);
2916
3081
  type TripError = (Error);
3082
+ type RefreshItineraryData = {
3083
+ query: {
3084
+ detailedLegs?: boolean;
3085
+ detailedTransfers?: boolean;
3086
+ itineraryId: string;
3087
+ joinInterlinedLegs?: boolean;
3088
+ language?: Array<(string)>;
3089
+ numLegAlternatives?: number;
3090
+ pedestrianProfile?: PedestrianProfile;
3091
+ requireBikeTransport?: boolean;
3092
+ requireCarTransport?: boolean;
3093
+ requireDisplayNameMatch?: boolean;
3094
+ transitModes?: Array<Mode>;
3095
+ useRoutedTransfers?: boolean;
3096
+ withFares?: boolean;
3097
+ withScheduledSkippedStops?: boolean;
3098
+ };
3099
+ };
3100
+ type RefreshItineraryResponse = (Itinerary);
3101
+ type RefreshItineraryError = (Error);
3102
+ type RefreshItineraryPostData = {
3103
+ body: RefreshItineraryPostBody;
3104
+ };
3105
+ type RefreshItineraryPostResponse = (Itinerary);
3106
+ type RefreshItineraryPostError = (Error);
2917
3107
  type StoptimesData = {
2918
3108
  query?: {
2919
3109
  /**
@@ -3102,6 +3292,10 @@ type InitialResponse = ({
3102
3292
  type InitialError = (Error);
3103
3293
  type StopsData = {
3104
3294
  query: {
3295
+ /**
3296
+ * Optional. Return grouped stops
3297
+ */
3298
+ grouped?: boolean;
3105
3299
  /**
3106
3300
  * language tags as used in OpenStreetMap / GTFS
3107
3301
  * (usually BCP-47 / ISO 639-1, or ISO 639-2 if there's no ISO 639-1)
@@ -3116,6 +3310,10 @@ type StopsData = {
3116
3310
  * latitude,longitude pair of the lower right coordinate
3117
3311
  */
3118
3312
  min: string;
3313
+ /**
3314
+ * Optional. Stop modes
3315
+ */
3316
+ modes?: Array<Mode>;
3119
3317
  };
3120
3318
  };
3121
3319
  type StopsResponse = (Array<Place>);
@@ -3168,6 +3366,30 @@ type RoutesResponse = ({
3168
3366
  zoomFiltered: boolean;
3169
3367
  });
3170
3368
  type RoutesError = (Error);
3369
+ type RouteDetailsData = {
3370
+ query: {
3371
+ /**
3372
+ * language tags as used in OpenStreetMap / GTFS
3373
+ * (usually BCP-47 / ISO 639-1, or ISO 639-2 if there's no ISO 639-1)
3374
+ *
3375
+ */
3376
+ language?: Array<(string)>;
3377
+ /**
3378
+ * Internal route index
3379
+ */
3380
+ routeIdx: number;
3381
+ };
3382
+ };
3383
+ type RouteDetailsResponse = ({
3384
+ routes: Array<RouteInfo>;
3385
+ polylines: Array<RoutePolyline>;
3386
+ stops: Array<Place>;
3387
+ /**
3388
+ * Always false for this endpoint.
3389
+ */
3390
+ zoomFiltered: boolean;
3391
+ });
3392
+ type RouteDetailsError = (Error);
3171
3393
  type RentalsData = {
3172
3394
  query?: {
3173
3395
  /**
@@ -3238,6 +3460,8 @@ type RentalsResponse = ({
3238
3460
  zones: Array<RentalZone>;
3239
3461
  });
3240
3462
  type RentalsError = (Error);
3463
+ type HealthResponse2 = (HealthResponse);
3464
+ type HealthError = (HealthResponse);
3241
3465
  type TransfersData = {
3242
3466
  query: {
3243
3467
  /**
@@ -3269,4 +3493,4 @@ type TransfersResponse = ({
3269
3493
  });
3270
3494
  type TransfersError = unknown;
3271
3495
 
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 };
3496
+ export type { Alert, AlertCause, AlertEffect, AlertSeverityLevel, Area, Category, CyclingSpeed, Direction, Duration, ElevationCosts, EncodedPolyline, Error, FareMedia, FareMediaType, FareProduct, FareTransfer, FareTransferRule, GeocodeData, GeocodeError, GeocodeResponse, HealthError, HealthResponse, HealthResponse2, InitialError, InitialResponse, Itinerary, ItineraryId, Leg, LegId, 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, RefreshItineraryData, RefreshItineraryError, RefreshItineraryPostBody, RefreshItineraryPostData, RefreshItineraryPostError, RefreshItineraryPostResponse, RefreshItineraryResponse, Rental, RentalFormFactor, RentalPropulsionType, RentalProvider, RentalProviderGroup, RentalReturnConstraint, RentalStation, RentalVehicle, RentalVehicleType, RentalZone, RentalZoneRestrictions, RentalsData, RentalsError, RentalsResponse, ReverseGeocodeData, ReverseGeocodeError, ReverseGeocodeResponse, RiderCategory, RouteColor, RouteDetailsData, RouteDetailsError, RouteDetailsResponse, 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, WheelchairAccessibility };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motis-project/motis-client",
3
- "version": "2.9.2",
3
+ "version": "2.10.2",
4
4
  "description": "A JS client for the MOTIS API.",
5
5
  "public": true,
6
6
  "main": "dist/index.js",