From 210e0998d94ec3a9f0b2f67e363a31671a75f8de Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 23 Nov 2023 08:06:09 +0200 Subject: [PATCH 1/6] enable matka map --- src/monitorConfig.js | 2 +- src/util/mqttUtils.ts | 9 +++++---- src/util/realTimeUtils.ts | 41 ++++++++++----------------------------- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/src/monitorConfig.js b/src/monitorConfig.js index 6298ee77..150d81c0 100644 --- a/src/monitorConfig.js +++ b/src/monitorConfig.js @@ -92,7 +92,7 @@ export default { name: 'matka', uri: 'routing/v2/routers/finland/index/graphql', map: { - inUse: false, + inUse: true, }, stopSearchFilter: stop => { const props = stop.properties; diff --git a/src/util/mqttUtils.ts b/src/util/mqttUtils.ts index ec318287..991503e1 100644 --- a/src/util/mqttUtils.ts +++ b/src/util/mqttUtils.ts @@ -23,7 +23,7 @@ export const startMqtt = (routes, setState, setClient, topicRef) => { } const feed = routes[0]?.feedId; - if (feed.toLowerCase() === 'hsl' || feed.toLowerCase() === 'digitraffic') { + if (feed.toLowerCase() === 'hsl') { //Unsupported at the moment return; } @@ -114,12 +114,13 @@ export const parseFeedMQTT = (feedParser, data, topic, agency) => { shortName, color, ] = topic.split('/'); + const entities = feed.entity ? feed.entity : feed; const messages = []; - feed.entity.forEach(entity => { + entities.forEach(entity => { const vehiclePos = entity.vehicle; if (vehiclePos) { - const { trip, position, vehicle } = vehiclePos; - if (trip && position && vehicle) { + const { trip, position } = vehiclePos; + if (trip && position) { const message = { id: `${agency}:${vehicleId}`, route: `${agency}:${routeId}`, diff --git a/src/util/realTimeUtils.ts b/src/util/realTimeUtils.ts index 3f383b12..5538f2d2 100644 --- a/src/util/realTimeUtils.ts +++ b/src/util/realTimeUtils.ts @@ -78,8 +78,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -91,8 +89,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -104,8 +100,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -117,8 +111,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -130,8 +122,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -173,8 +163,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -186,8 +174,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -199,8 +185,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -212,8 +196,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -225,8 +207,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -238,8 +218,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -251,8 +229,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -264,8 +240,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -277,8 +251,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -290,8 +262,6 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, - gtfsrt: true, routeSelector: defaultRouteSelector, @@ -303,7 +273,16 @@ export default { mqtt: 'wss://mqtt.waltti.fi/mqtt', - credentials: { username: 'user', password: 'userpass' }, + gtfsrt: true, + + routeSelector: defaultRouteSelector, + + active: true, + }, + digitraffic: { + mqttTopicResolver: walttiTopicResolver, + + mqtt: 'wss://mqtt.waltti.fi/mqtt', gtfsrt: true, From f7c0e2df7ee0867ed2d58a0b6a864e3d7ed9bf4b Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Tue, 5 Dec 2023 14:08:20 +0200 Subject: [PATCH 2/6] HSL Area vehicles --- src/MonitorMapContainer.tsx | 3 + src/generated.ts | 465 +++++++++++++++++-- src/queries/GetDeparturesForStations.graphql | 5 + src/queries/GetDeparturesForStops.graphql | 5 + src/ui/CarouselContainer.tsx | 28 +- src/ui/Monitor.tsx | 1 + src/ui/monitorMap.tsx | 57 ++- src/util/monitorUtils.ts | 2 + src/util/mqttUtils.ts | 116 ++++- src/util/realTimeUtils.ts | 38 +- 10 files changed, 649 insertions(+), 71 deletions(-) diff --git a/src/MonitorMapContainer.tsx b/src/MonitorMapContainer.tsx index 9d0fe31b..7424c37c 100644 --- a/src/MonitorMapContainer.tsx +++ b/src/MonitorMapContainer.tsx @@ -10,6 +10,7 @@ interface IProps { modal?: boolean; updateMap?: (settings: IMapSettings) => void; topics?: string[]; + departures?: any; } const MonitorMapContainer: FC = ({ preview, @@ -17,6 +18,7 @@ const MonitorMapContainer: FC = ({ modal, updateMap, topics, + departures, }) => { const [state, setState] = useMergeState({ client: undefined, @@ -68,6 +70,7 @@ const MonitorMapContainer: FC = ({ clientRef={clientRef} newTopics={topics} topicRef={topicRef} + departures={departures} /> ); diff --git a/src/generated.ts b/src/generated.ts index e8fe5e01..9589e75c 100644 --- a/src/generated.ts +++ b/src/generated.ts @@ -13,6 +13,7 @@ export type Scalars = { Float: number; Duration: any; GeoJson: any; + Grams: any; Long: any; Polyline: any; }; @@ -342,21 +343,36 @@ export enum BikesAllowed { NoInformation = 'NO_INFORMATION' } +/** + * Booking information for a stop time which has special requirements to use, like calling ahead or + * using an app. + */ export type BookingInfo = { __typename?: 'BookingInfo'; + /** Contact information for reaching the service provider */ contactInfo?: Maybe; + /** A message specific to the drop off */ dropOffMessage?: Maybe; + /** When is the earliest time the service can be booked. */ earliestBookingTime?: Maybe; + /** When is the latest time the service can be booked */ latestBookingTime?: Maybe; + /** Maximum number of seconds before travel to make the request */ maximumBookingNoticeSeconds?: Maybe; + /** A general message for those booking the service */ message?: Maybe; + /** Minimum number of seconds before travel to make the request */ minimumBookingNoticeSeconds?: Maybe; + /** A message specific to the pick up */ pickupMessage?: Maybe; }; +/** Temporal restriction for a booking */ export type BookingTime = { __typename?: 'BookingTime'; + /** How many days before the booking */ daysPrior?: Maybe; + /** Time of the booking */ time?: Maybe; }; @@ -411,14 +427,22 @@ export type Cluster = Node & { stops?: Maybe>; }; +/** Contact information for booking an on-demand or flexible service. */ export type ContactInfo = { __typename?: 'ContactInfo'; + /** Additional notes about the contacting the service provider */ additionalDetails?: Maybe; + /** URL to the booking systems of the service */ bookingUrl?: Maybe; + /** Name of the person to contact */ contactPerson?: Maybe; + /** Email to contact */ eMail?: Maybe; + /** Fax number to contact */ faxNumber?: Maybe; + /** URL containing general information about the service */ infoUrl?: Maybe; + /** Phone number to contact */ phoneNumber?: Maybe; }; @@ -449,9 +473,34 @@ export type Currency = { }; /** - * Departure row is a location, which lists departures of a certain pattern from a - * stop. Departure rows are identified with the pattern, so querying departure rows - * will return only departures from one stop per pattern + * The standard case of a fare product: it only has a single price to be paid by the passenger + * and no discounts are applied. + */ +export type DefaultFareProduct = FareProduct & { + __typename?: 'DefaultFareProduct'; + /** Identifier for the fare product. */ + id: Scalars['String']; + /** + * The 'medium' that this product applies to, for example "Oyster Card" or "Berlin Ticket App". + * + * This communicates to riders that a specific way of buying or keeping this product is required. + */ + medium?: Maybe; + /** Human readable name of the product, for example example "Day pass" or "Single ticket". */ + name: Scalars['String']; + /** The price of the product */ + price: Money; + /** The category of riders this product applies to, for example students or pensioners. */ + riderCategory?: Maybe; +}; + +/** + * Departure row is a combination of a pattern and a stop of that pattern. + * + * They are de-duplicated so for each pattern there will only be a single departure row. + * + * This is useful if you want to show a list of stop/pattern combinations but want each pattern to be + * listed only once. */ export type DepartureRow = Node & PlaceInterface & { __typename?: 'DepartureRow'; @@ -471,9 +520,12 @@ export type DepartureRow = Node & PlaceInterface & { /** - * Departure row is a location, which lists departures of a certain pattern from a - * stop. Departure rows are identified with the pattern, so querying departure rows - * will return only departures from one stop per pattern + * Departure row is a combination of a pattern and a stop of that pattern. + * + * They are de-duplicated so for each pattern there will only be a single departure row. + * + * This is useful if you want to show a list of stop/pattern combinations but want each pattern to be + * listed only once. */ export type DepartureRowStoptimesArgs = { numberOfDepartures?: InputMaybe; @@ -483,6 +535,99 @@ export type DepartureRowStoptimesArgs = { timeRange?: InputMaybe; }; +export type Emissions = { + __typename?: 'Emissions'; + /** CO₂ emissions in grams. */ + co2?: Maybe; +}; + +/** A 'medium' that a fare product applies to, for example cash, 'Oyster Card' or 'DB Navigator App'. */ +export type FareMedium = { + __typename?: 'FareMedium'; + /** ID of the medium */ + id: Scalars['String']; + /** Human readable name of the medium. */ + name?: Maybe; +}; + +/** A fare product (a ticket) to be bought by a passenger */ +export type FareProduct = { + /** Identifier for the fare product. */ + id: Scalars['String']; + /** + * The 'medium' that this product applies to, for example "Oyster Card" or "Berlin Ticket App". + * + * This communicates to riders that a specific way of buying or keeping this product is required. + */ + medium?: Maybe; + /** Human readable name of the product, for example example "Day pass" or "Single ticket". */ + name: Scalars['String']; + /** The category of riders this product applies to, for example students or pensioners. */ + riderCategory?: Maybe; +}; + +/** A container for both a fare product (a ticket) and its relationship to the itinerary. */ +export type FareProductUse = { + __typename?: 'FareProductUse'; + /** + * Represents the use of a single instance of a fare product throughout the itinerary. It can + * be used to cross-reference and de-duplicate fare products that are applicable for more than one + * leg. + * + * If you want to uniquely identify the fare product itself (not its use) use the product's `id`. + * + * ### Example: Day pass + * + * The day pass is valid for both legs in the itinerary. It is listed as the applicable `product` for each leg, + * and the same FareProductUse id is shown, indicating that only one pass was used/bought. + * + * **Illustration** + * ```yaml + * itinerary: + * leg1: + * fareProducts: + * id: "AAA" // id of a FareProductUse instance + * product: + * id: "day-pass" // product id + * name: "Day Pass" + * leg2: + * fareProducts: + * id: "AAA" // identical to leg1. the passenger needs to buy ONE pass, not two. + * product: + * id: "day-pass" // product id + * name: "Day Pass" + * ``` + * + * **It is the responsibility of the API consumers to display the day pass as a product for the + * entire itinerary rather than two day passes!** + * + * ### Example: Several single tickets + * + * If you have two legs and need to buy two single tickets they will appear in each leg with the + * same `FareProduct.id` but different `FareProductUse.id`. + * + * **Illustration** + * ```yaml + * itinerary: + * leg1: + * fareProducts: + * id: "AAA" // id of a FareProductUse instance, not product id + * product: + * id: "single-ticket" // product id + * name: "Single Ticket" + * leg2: + * fareProducts: + * id: "BBB" // different to leg1. the passenger needs to buy two single tickets. + * product: + * id: "single-ticket" // product id + * name: "Single Ticket" + * ``` + */ + id: Scalars['String']; + /** The purchasable fare product */ + product?: Maybe; +}; + /** A feed provides routing data (stops, routes, timetables, etc.) from one or more public transport agencies. */ export type Feed = { __typename?: 'Feed'; @@ -676,6 +821,15 @@ export type InputUnpreferred = { export type Itinerary = { __typename?: 'Itinerary'; + /** + * Computes a numeric accessibility score between 0 and 1. + * + * The closer the value is to 1 the better the wheelchair-accessibility of this itinerary is. + * A value of `null` means that no score has been computed, not that the leg is inaccessible. + * + * More information is available in the [feature documentation](https://docs.opentripplanner.org/en/dev-2.x/sandbox/IBIAccessibilityScore/). + */ + accessibilityScore?: Maybe; /** Does the itinerary end without dropping off the rented bicycle: */ arrivedAtDestinationWithRentedBicycle?: Maybe; /** Duration of the trip on this itinerary, in seconds. */ @@ -684,9 +838,15 @@ export type Itinerary = { elevationGained?: Maybe; /** How much elevation is lost, in total, over the course of the itinerary, in meters. */ elevationLost?: Maybe; + /** Emissions of this itinerary per traveler. */ + emissionsPerPerson?: Maybe; /** Time when the user arrives to the destination.. Format: Unix timestamp in milliseconds. */ endTime?: Maybe; - /** Information about the fares for this itinerary */ + /** + * Information about the fares for this itinerary. This is primarily a GTFS Fares V1 interface + * will be removed in the future. + * @deprecated Use the leg's `fareProducts`. + */ fares?: Maybe>>; /** Generalized cost of the itinerary. Used for debugging search results. */ generalizedCost?: Maybe; @@ -697,6 +857,14 @@ export type Itinerary = { * destination, has four legs. */ legs: Array>; + /** + * How many transfers are part of this itinerary. + * + * Notes: + * - Interlined/stay-seated transfers do not increase this count. + * - Transferring from a flex to a fixed schedule trip and vice versa increases this count. + */ + numberOfTransfers: Scalars['Int']; /** Time when the user leaves from the origin. Format: Unix timestamp in milliseconds. */ startTime?: Maybe; /** @@ -716,6 +884,15 @@ export type Itinerary = { export type Leg = { __typename?: 'Leg'; + /** + * Computes a numeric accessibility score between 0 and 1. + * + * The closer the value is to 1 the better the wheelchair-accessibility of this leg is. + * A value of `null` means that no score has been computed, not that the itinerary is inaccessible. + * + * More information is available in the [feature documentation](https://docs.opentripplanner.org/en/dev-2.x/sandbox/IBIAccessibilityScore/). + */ + accessibilityScore?: Maybe; /** For transit legs, the transit agency that operates the service used for this leg. For non-transit legs, `null`. */ agency?: Maybe; /** Applicable alerts for this leg. */ @@ -734,6 +911,10 @@ export type Leg = { departureDelay?: Maybe; /** The distance traveled while traversing the leg in meters. */ distance?: Maybe; + /** + * Special booking information for the drop off stop of this leg if, for example, it needs + * to be booked in advance. This could be due to a flexible or on-demand service. + */ dropOffBookingInfo?: Maybe; /** This is used to indicate if alighting from this leg is possible only with special arrangements. */ dropoffType?: Maybe; @@ -741,10 +922,23 @@ export type Leg = { duration?: Maybe; /** The date and time when this leg ends. Format: Unix timestamp in milliseconds. */ endTime?: Maybe; + /** + * Fare products are purchasable tickets which may have an optional fare container or rider + * category that limits who can buy them or how. + * + * Please read the documentation of `id` very carefully to learn how a single fare product + * that applies to multiple legs can appear several times. + */ + fareProducts?: Maybe>>; /** The Place where the leg originates. */ from: Place; /** Generalized cost of the leg. Used for debugging search results. */ generalizedCost?: Maybe; + /** + * For transit legs, the headsign that the vehicle shows at the stop where the passenger boards. + * For non-transit legs, null. + */ + headsign?: Maybe; /** * Interlines with previous leg. * This is true when the same vehicle is used for the previous leg as for this leg @@ -770,6 +964,10 @@ export type Leg = { mode?: Maybe; /** Future legs with same origin and destination stops or stations */ nextLegs?: Maybe>; + /** + * Special booking information for the pick up stop of this leg if, for example, it needs + * to be booked in advance. This could be due to a flexible or on-demand service. + */ pickupBookingInfo?: Maybe; /** This is used to indicate if boarding this leg is possible only with special arrangements. */ pickupType?: Maybe; @@ -787,6 +985,7 @@ export type Leg = { serviceDate?: Maybe; /** The date and time when this leg begins. Format: Unix timestamp in milliseconds. */ startTime?: Maybe; + /** The turn-by-turn navigation instructions. */ steps?: Maybe>>; /** The Place where the leg ends. */ to: Place; @@ -860,7 +1059,10 @@ export enum Mode { Funicular = 'FUNICULAR', /** GONDOLA */ Gondola = 'GONDOLA', - /** Only used internally. No use for API users. */ + /** + * Only used internally. No use for API users. + * @deprecated No longer supported + */ LegSwitch = 'LEG_SWITCH', /** Railway in which the track consists of a single rail or a beam. */ Monorail = 'MONORAIL', @@ -886,10 +1088,12 @@ export enum Mode { export type Money = { __typename?: 'Money'; /** - * Money amount in cents. **Note:** this value is dependent on the currency used, - * as one cent is not necessarily ¹/₁₀₀ of the basic monetary unit. + * Money in the major currency unit, so 3.10 USD is represented as `3.1`. + * + * If you want to get the minor currency unit (310 cents), multiply with + * (10 to the power of `currency.digits`). */ - amount: Scalars['Int']; + amount: Scalars['Float']; /** The currency of this money amount. */ currency: Currency; }; @@ -900,6 +1104,59 @@ export type Node = { id: Scalars['ID']; }; +/** Occupancy status of a vehicle. */ +export enum OccupancyStatus { + /** + * The vehicle or carriage can currently accommodate only standing passengers and has limited + * space for them. There isn't a big difference between this and FULL so it's possible to handle + * them as the same value, if one wants to limit the number of different values. + * SIRI nordic profile: merge into `STANDING_ROOM_ONLY`. + */ + CrushedStandingRoomOnly = 'CRUSHED_STANDING_ROOM_ONLY', + /** + * The vehicle is considered empty by most measures, and has few or no passengers onboard, but is + * still accepting passengers. There isn't a big difference between this and MANY_SEATS_AVAILABLE + * so it's possible to handle them as the same value, if one wants to limit the number of different + * values. + * SIRI nordic profile: merge these into `MANY_SEATS_AVAILABLE`. + */ + Empty = 'EMPTY', + /** + * The vehicle or carriage has a small number of seats available. The amount of free seats out of + * the total seats available to be considered small enough to fall into this category is + * determined at the discretion of the producer. + * SIRI nordic profile: less than ~50% of seats available. + */ + FewSeatsAvailable = 'FEW_SEATS_AVAILABLE', + /** + * The vehicle is considered full by most measures, but may still be allowing passengers to + * board. + */ + Full = 'FULL', + /** + * The vehicle or carriage has a large number of seats available. The amount of free seats out of + * the total seats available to be considered large enough to fall into this category is + * determined at the discretion of the producer. There isn't a big difference between this and + * EMPTY so it's possible to handle them as the same value, if one wants to limit the number of + * different values. + * SIRI nordic profile: more than ~50% of seats available. + */ + ManySeatsAvailable = 'MANY_SEATS_AVAILABLE', + /** + * The vehicle or carriage is not accepting passengers. + * SIRI nordic profile: if vehicle/carriage is not in use / unavailable, or passengers are only allowed + * to alight due to e.g. crowding. + */ + NotAcceptingPassengers = 'NOT_ACCEPTING_PASSENGERS', + /** Default. There is no occupancy-data on this departure. */ + NoDataAvailable = 'NO_DATA_AVAILABLE', + /** + * The vehicle or carriage can currently accommodate only standing passengers. + * SIRI nordic profile: less than ~10% of seats available. + */ + StandingRoomOnly = 'STANDING_ROOM_ONLY' +} + export type OpeningHours = { __typename?: 'OpeningHours'; /** @@ -1116,6 +1373,21 @@ export type Place = { rentalVehicle?: Maybe; /** The stop related to the place. */ stop?: Maybe; + /** + * The position of the stop in the pattern. This is not required to start from 0 or be consecutive - any + * increasing integer sequence along the stops is valid. + * + * The purpose of this field is to identify the stop within the pattern so it can be cross-referenced + * between it and the itinerary. It is safe to cross-reference when done quickly, i.e. within seconds. + * However, it should be noted that realtime updates can change the values, so don't store it for + * longer amounts of time. + * + * Depending on the source data, this might not be the GTFS `stop_sequence` but another value, perhaps + * even generated. + * + * The position can be either at a certain stop or in between two for trips where this is possible. + */ + stopPosition?: Maybe; /** The vehicle parking related to the place */ vehicleParking?: Maybe; /** The vehicle rental station related to the place */ @@ -1196,6 +1468,22 @@ export type Plan = { to: Place; }; +/** Stop position at a specific stop. */ +export type PositionAtStop = { + __typename?: 'PositionAtStop'; + /** Position of the stop in the pattern. Positions are not required to start from 0 or be consecutive. */ + position?: Maybe; +}; + +/** The board/alight position in between two stops of the pattern of a trip with continuous pickup/drop off. */ +export type PositionBetweenStops = { + __typename?: 'PositionBetweenStops'; + /** Position of the next stop in the pattern. Positions are not required to start from 0 or be consecutive. */ + nextPosition?: Maybe; + /** Position of the previous stop in the pattern. Positions are not required to start from 0 or be consecutive. */ + previousPosition?: Maybe; +}; + export enum PropulsionType { /** Powered by gasoline combustion engine */ Combustion = 'COMBUSTION', @@ -1487,19 +1775,14 @@ export type QueryTypePlanArgs = { bikeSwitchTime?: InputMaybe; bikeWalkingReluctance?: InputMaybe; boardSlack?: InputMaybe; - carParkCarLegWeight?: InputMaybe; carReluctance?: InputMaybe; date?: InputMaybe; debugItineraryFilter?: InputMaybe; from?: InputMaybe; fromPlace?: InputMaybe; - heuristicStepsPerMainStep?: InputMaybe; ignoreRealtimeUpdates?: InputMaybe; - intermediatePlaces?: InputMaybe>>; - itineraryFiltering?: InputMaybe; keepingRentedBicycleAtDestinationCost?: InputMaybe; locale?: InputMaybe; - maxPreTransitTime?: InputMaybe; maxTransfers?: InputMaybe; minTransferTime?: InputMaybe; modeWeight?: InputMaybe; @@ -1512,7 +1795,6 @@ export type QueryTypePlanArgs = { preferred?: InputMaybe; searchWindow?: InputMaybe; startTransitStopId?: InputMaybe; - startTransitTripId?: InputMaybe; time?: InputMaybe; to?: InputMaybe; toPlace?: InputMaybe; @@ -1648,6 +1930,9 @@ export enum RelativeDirection { Continue = 'CONTINUE', Depart = 'DEPART', Elevator = 'ELEVATOR', + EnterStation = 'ENTER_STATION', + ExitStation = 'EXIT_STATION', + FollowSigns = 'FOLLOW_SIGNS', HardLeft = 'HARD_LEFT', HardRight = 'HARD_RIGHT', Left = 'LEFT', @@ -1683,6 +1968,14 @@ export type RentalVehicle = Node & PlaceInterface & { vehicleType?: Maybe; }; +export type RentalVehicleEntityCounts = { + __typename?: 'RentalVehicleEntityCounts'; + /** The number of entities by type */ + byType: Array; + /** The total number of entities (e.g. vehicles, spaces). */ + total: Scalars['Int']; +}; + export type RentalVehicleType = { __typename?: 'RentalVehicleType'; /** The vehicle's general form factor */ @@ -1691,6 +1984,14 @@ export type RentalVehicleType = { propulsionType?: Maybe; }; +export type RentalVehicleTypeCount = { + __typename?: 'RentalVehicleTypeCount'; + /** The number of vehicles of this type */ + count: Scalars['Int']; + /** The type of the rental vehicle (scooter, bicycle, car...) */ + vehicleType: RentalVehicleType; +}; + /** An estimate for a ride on a hailed vehicle, like an Uber car. */ export type RideHailingEstimate = { __typename?: 'RideHailingEstimate'; @@ -1712,6 +2013,15 @@ export type RideHailingProvider = { id: Scalars['String']; }; +/** Category of riders a fare product applies to, for example students or pensioners. */ +export type RiderCategory = { + __typename?: 'RiderCategory'; + /** ID of the category */ + id: Scalars['String']; + /** Human readable name of the category. */ + name?: Maybe; +}; + /** * Route represents a public transportation service, usually from point A to point * B and *back*, shown to customers under a single name, e.g. bus 550. Routes @@ -1844,21 +2154,52 @@ export type RoutingError = { }; export enum RoutingErrorCode { - /** The specified location is not close to any streets or transit stops */ + /** + * The specified location is not close to any streets or transit stops currently loaded into the + * system, even though it is generally within its bounds. + * + * This can happen when there is only transit but no street data coverage at the location in + * question. + */ LocationNotFound = 'LOCATION_NOT_FOUND', - /** No stops are reachable from the location specified. You can try searching using a different access or egress mode */ + /** + * No stops are reachable from the start or end locations specified. + * + * You can try searching using a different access or egress mode, for example cycling instead of walking, + * increase the walking/cycling/driving speed or have an administrator change the system's configuration + * so that stops further away are considered. + */ NoStopsInRange = 'NO_STOPS_IN_RANGE', - /** No transit connection was found between the origin and destination withing the operating day or the next day */ + /** + * No transit connection was found between the origin and destination within the operating day or + * the next day, not even sub-optimal ones. + */ NoTransitConnection = 'NO_TRANSIT_CONNECTION', - /** Transit connection was found, but it was outside the search window, see metadata for the next search window */ + /** + * A transit connection was found, but it was outside the search window. See the metadata for a token + * for retrieving the result outside the search window. + */ NoTransitConnectionInSearchWindow = 'NO_TRANSIT_CONNECTION_IN_SEARCH_WINDOW', - /** The coordinates are outside the bounds of the data currently loaded into the system */ + /** + * The coordinates are outside the geographic bounds of the transit and street data currently loaded + * into the system and therefore cannot return any results. + */ OutsideBounds = 'OUTSIDE_BOUNDS', - /** The date specified is outside the range of data currently loaded into the system */ + /** + * The date specified is outside the range of data currently loaded into the system as it is too + * far into the future or the past. + * + * The specific date range of the system is configurable by an administrator and also depends on + * the input data provided. + */ OutsideServicePeriod = 'OUTSIDE_SERVICE_PERIOD', - /** An unknown error happened during the search. The details have been logged to the server logs */ - SystemError = 'SYSTEM_ERROR', - /** The origin and destination are so close to each other, that walking is always better, but no direct mode was specified for the search */ + /** + * Transit connections were requested and found but because it is easier to just walk all the way + * to the destination they were removed. + * + * If you want to still show the transit results, you need to make walking less desirable by + * increasing the walk reluctance. + */ WalkingBetterThanTransit = 'WALKING_BETTER_THAN_TRANSIT' } @@ -2104,6 +2445,8 @@ export type StopOnTrip = { trip: Trip; }; +export type StopPosition = PositionAtStop | PositionBetweenStops; + /** Upcoming or current stop and how close the vehicle is to it. */ export type StopRelationship = { __typename?: 'StopRelationship'; @@ -2157,6 +2500,19 @@ export type Stoptime = { serviceDay?: Maybe; /** The stop where this arrival/departure happens */ stop?: Maybe; + /** + * The sequence of the stop in the pattern. This is not required to start from 0 or be consecutive - any + * increasing integer sequence along the stops is valid. + * + * The purpose of this field is to identify the stop within the pattern so it can be cross-referenced + * between it and the itinerary. It is safe to cross-reference when done quickly, i.e. within seconds. + * However, it should be noted that realtime updates can change the values, so don't store it for + * longer amounts of time. + * + * Depending on the source data, this might not be the GTFS `stop_sequence` but another value, perhaps + * even generated. + */ + stopPosition?: Maybe; /** true, if this stop is used as a time equalization stop. false otherwise. */ timepoint?: Maybe; /** Trip which this stoptime is for */ @@ -2288,6 +2644,11 @@ export type Trip = Node & { gtfsId: Scalars['String']; /** Global object ID provided by Relay. This value can be used to refetch this object using **node** query. */ id: Scalars['ID']; + /** + * The latest realtime occupancy information for the latest occurance of this + * trip. + */ + occupancy?: Maybe; /** The pattern the trip is running on */ pattern?: Maybe; /** The route the trip is running on */ @@ -2361,6 +2722,16 @@ export enum TripAlertType { Trip = 'TRIP' } +/** + * Occupancy of a vehicle on a trip. This should include the most recent occupancy information + * available for a trip. Historic data might not be available. + */ +export type TripOccupancy = { + __typename?: 'TripOccupancy'; + /** Occupancy information mapped to a limited set of descriptive states. */ + occupancyStatus?: Maybe; +}; + /** This is used for alert entities that we don't explicitly handle or they are missing. */ export type Unknown = { __typename?: 'Unknown'; @@ -2519,6 +2890,10 @@ export type VehicleRentalStation = Node & PlaceInterface & { allowPickup?: Maybe; /** If true, vehicles can be currently picked up from this station. */ allowPickupNow?: Maybe; + /** Number of free spaces currently available on the rental station, grouped by vehicle type. */ + availableSpaces?: Maybe; + /** Number of vehicles currently available on the rental station, grouped by vehicle type. */ + availableVehicles?: Maybe; /** Nominal capacity (number of racks) of the rental station. */ capacity?: Maybe; /** Global object ID provided by Relay. This value can be used to refetch this object using **node** query. */ @@ -2547,6 +2922,7 @@ export type VehicleRentalStation = Node & PlaceInterface & { * to this station, as for example it might be possible to leave the vehicle in the vicinity of * the rental station, even if the vehicle racks don't have any spaces available. * See field `allowDropoffNow` to know if is currently possible to return a vehicle. + * @deprecated Use `availableSpaces` instead, which also contains the space vehicle types */ spacesAvailable?: Maybe; /** ID of the vehicle in the format of network:id */ @@ -2554,6 +2930,7 @@ export type VehicleRentalStation = Node & PlaceInterface & { /** * Number of vehicles currently available on the rental station. * See field `allowPickupNow` to know if is currently possible to pick up a vehicle. + * @deprecated Use `availableVehicles` instead, which also contains vehicle types */ vehiclesAvailable?: Maybe; }; @@ -2632,12 +3009,20 @@ export type Fare = { /** * Fare price in cents. **Note:** this value is dependent on the currency used, * as one cent is not necessarily ¹/₁₀₀ of the basic monerary unit. + * @deprecated No longer supported */ cents?: Maybe; - /** Components which this fare is composed of */ + /** + * Components which this fare is composed of + * @deprecated No longer supported + */ components?: Maybe>>; - /** ISO 4217 currency code */ + /** + * ISO 4217 currency code + * @deprecated No longer supported + */ currency?: Maybe; + /** @deprecated No longer supported */ type?: Maybe; }; @@ -2647,13 +3032,23 @@ export type FareComponent = { /** * Fare price in cents. **Note:** this value is dependent on the currency used, * as one cent is not necessarily ¹/₁₀₀ of the basic monerary unit. + * @deprecated No longer supported */ cents?: Maybe; - /** ISO 4217 currency code */ + /** + * ISO 4217 currency code + * @deprecated No longer supported + */ currency?: Maybe; - /** ID of the ticket type. Corresponds to `fareId` in **TicketType**. */ + /** + * ID of the ticket type. Corresponds to `fareId` in **TicketType**. + * @deprecated No longer supported + */ fareId?: Maybe; - /** List of routes which use this fare component */ + /** + * List of routes which use this fare component + * @deprecated No longer supported + */ routes?: Maybe>>; }; @@ -2770,7 +3165,7 @@ export type GetDeparturesForStationsQueryVariables = Exact<{ }>; -export type GetDeparturesForStationsQuery = { __typename?: 'QueryType', stations?: Array<{ __typename?: 'Stop', name: string, code?: string | null, lat?: number | null, lon?: number | null, gtfsId: string, stops?: Array<{ __typename?: 'Stop', gtfsId: string, patterns?: Array<{ __typename?: 'Pattern', headsign?: string | null } | null> | null, routes?: Array<{ __typename?: 'Route', longName?: string | null, id: string, longNamefi?: string | null, longNamesv?: string | null, longNameen?: string | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null }> | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null } | null> | null, stoptimesForPatterns?: Array<{ __typename?: 'StoptimesInPattern', pattern?: { __typename?: 'Pattern', code: string, directionId?: number | null, headsign?: string | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null, stoptimes?: Array<{ __typename?: 'Stoptime', realtime?: boolean | null, pickupType?: PickupDropoffType | null, serviceDay?: any | null, scheduledDeparture?: number | null, realtimeDeparture?: number | null, realtimeState?: RealtimeState | null, headsign?: string | null, headsignfi?: string | null, headsignsv?: string | null, headsignen?: string | null, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null, platformCode?: string | null, parentStation?: { __typename?: 'Stop', gtfsId: string } | null } | null, trip?: { __typename?: 'Trip', tripHeadsign?: string | null, directionId?: string | null, gtfsId: string, id: string, tripHeadsignfi?: string | null, tripHeadsignsv?: string | null, tripHeadsignen?: string | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null } | null> | null } | null> | null } | null> | null }; +export type GetDeparturesForStationsQuery = { __typename?: 'QueryType', stations?: Array<{ __typename?: 'Stop', name: string, code?: string | null, lat?: number | null, lon?: number | null, gtfsId: string, stops?: Array<{ __typename?: 'Stop', gtfsId: string, patterns?: Array<{ __typename?: 'Pattern', headsign?: string | null } | null> | null, routes?: Array<{ __typename?: 'Route', longName?: string | null, id: string, longNamefi?: string | null, longNamesv?: string | null, longNameen?: string | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null }> | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null } | null> | null, stoptimesForPatterns?: Array<{ __typename?: 'StoptimesInPattern', pattern?: { __typename?: 'Pattern', code: string, directionId?: number | null, headsign?: string | null, stops?: Array<{ __typename?: 'Stop', name: string, gtfsId: string, direction?: string | null }> | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null, stoptimes?: Array<{ __typename?: 'Stoptime', realtime?: boolean | null, pickupType?: PickupDropoffType | null, serviceDay?: any | null, scheduledDeparture?: number | null, realtimeDeparture?: number | null, realtimeState?: RealtimeState | null, headsign?: string | null, headsignfi?: string | null, headsignsv?: string | null, headsignen?: string | null, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null, platformCode?: string | null, parentStation?: { __typename?: 'Stop', gtfsId: string } | null } | null, trip?: { __typename?: 'Trip', tripHeadsign?: string | null, directionId?: string | null, gtfsId: string, id: string, tripHeadsignfi?: string | null, tripHeadsignsv?: string | null, tripHeadsignen?: string | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null } | null> | null } | null> | null } | null> | null }; export type GetDeparturesForStopsQueryVariables = Exact<{ ids: Array | Scalars['String']; @@ -2778,7 +3173,7 @@ export type GetDeparturesForStopsQueryVariables = Exact<{ }>; -export type GetDeparturesForStopsQuery = { __typename?: 'QueryType', stops?: Array<{ __typename?: 'Stop', name: string, code?: string | null, gtfsId: string, lat?: number | null, lon?: number | null, patterns?: Array<{ __typename?: 'Pattern', headsign?: string | null } | null> | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null, routes?: Array<{ __typename?: 'Route', longName?: string | null, id: string, longNamefi?: string | null, longNamesv?: string | null, longNameen?: string | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null }> | null, stoptimesForPatterns?: Array<{ __typename?: 'StoptimesInPattern', pattern?: { __typename?: 'Pattern', code: string, directionId?: number | null, headsign?: string | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null, stoptimes?: Array<{ __typename?: 'Stoptime', realtime?: boolean | null, pickupType?: PickupDropoffType | null, serviceDay?: any | null, scheduledDeparture?: number | null, realtimeDeparture?: number | null, realtimeState?: RealtimeState | null, headsign?: string | null, headsignfi?: string | null, headsignsv?: string | null, headsignen?: string | null, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null, platformCode?: string | null, parentStation?: { __typename?: 'Stop', gtfsId: string } | null } | null, trip?: { __typename?: 'Trip', tripHeadsign?: string | null, directionId?: string | null, id: string, gtfsId: string, tripHeadsignfi?: string | null, tripHeadsignsv?: string | null, tripHeadsignen?: string | null, route: { __typename?: 'Route', shortName?: string | null, gtfsId: string } } | null } | null> | null } | null> | null } | null> | null }; +export type GetDeparturesForStopsQuery = { __typename?: 'QueryType', stops?: Array<{ __typename?: 'Stop', name: string, code?: string | null, gtfsId: string, lat?: number | null, lon?: number | null, patterns?: Array<{ __typename?: 'Pattern', headsign?: string | null } | null> | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null, routes?: Array<{ __typename?: 'Route', longName?: string | null, id: string, longNamefi?: string | null, longNamesv?: string | null, longNameen?: string | null, alerts?: Array<{ __typename?: 'Alert', alertSeverityLevel?: AlertSeverityLevelType | null, alertHeaderText?: string | null, effectiveEndDate?: any | null, effectiveStartDate?: any | null, alertHeaderTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, alertDescriptionTextTranslations: Array<{ __typename?: 'TranslatedString', text?: string | null, language?: string | null }>, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null } | null } | null> | null }> | null, stoptimesForPatterns?: Array<{ __typename?: 'StoptimesInPattern', pattern?: { __typename?: 'Pattern', code: string, directionId?: number | null, headsign?: string | null, stops?: Array<{ __typename?: 'Stop', name: string, gtfsId: string, direction?: string | null }> | null, route: { __typename?: 'Route', gtfsId: string, shortName?: string | null } } | null, stoptimes?: Array<{ __typename?: 'Stoptime', realtime?: boolean | null, pickupType?: PickupDropoffType | null, serviceDay?: any | null, scheduledDeparture?: number | null, realtimeDeparture?: number | null, realtimeState?: RealtimeState | null, headsign?: string | null, headsignfi?: string | null, headsignsv?: string | null, headsignen?: string | null, stop?: { __typename?: 'Stop', gtfsId: string, code?: string | null, platformCode?: string | null, parentStation?: { __typename?: 'Stop', gtfsId: string } | null } | null, trip?: { __typename?: 'Trip', tripHeadsign?: string | null, directionId?: string | null, id: string, gtfsId: string, tripHeadsignfi?: string | null, tripHeadsignsv?: string | null, tripHeadsignen?: string | null, route: { __typename?: 'Route', shortName?: string | null, gtfsId: string } } | null } | null> | null } | null> | null } | null> | null }; export type GetLineIdsQueryVariables = Exact<{ stations: Array> | InputMaybe; @@ -2828,8 +3223,8 @@ export type StopQueryQuery = { __typename?: 'QueryType', stop?: Array<{ __typena export const GetAlertsForStationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAlertsForStations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stations"},"name":{"kind":"Name","value":"stations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetAlertsForStopsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAlertsForStops"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stops"},"name":{"kind":"Name","value":"stops"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetDeparturesForStationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDeparturesForStations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stations"},"name":{"kind":"Name","value":"stations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"headsign"}}]}},{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"longName"}},{"kind":"Field","alias":{"kind":"Name","value":"longNamefi"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNamesv"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNameen"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"numberOfDepartures"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}}},{"kind":"Argument","name":{"kind":"Name","value":"omitCanceled"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"platformCode"}},{"kind":"Field","name":{"kind":"Name","value":"parentStation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"realtime"}},{"kind":"Field","name":{"kind":"Name","value":"pickupType"}},{"kind":"Field","name":{"kind":"Name","value":"serviceDay"}},{"kind":"Field","name":{"kind":"Name","value":"scheduledDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeState"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","alias":{"kind":"Name","value":"headsignfi"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignsv"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignen"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"trip"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tripHeadsign"}},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignfi"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignsv"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignen"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const GetDeparturesForStopsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDeparturesForStops"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stops"},"name":{"kind":"Name","value":"stops"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"patterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"headsign"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"longName"}},{"kind":"Field","alias":{"kind":"Name","value":"longNamefi"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNamesv"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNameen"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"numberOfDepartures"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}}},{"kind":"Argument","name":{"kind":"Name","value":"omitCanceled"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"platformCode"}},{"kind":"Field","name":{"kind":"Name","value":"parentStation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"realtime"}},{"kind":"Field","name":{"kind":"Name","value":"pickupType"}},{"kind":"Field","name":{"kind":"Name","value":"serviceDay"}},{"kind":"Field","name":{"kind":"Name","value":"scheduledDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeState"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","alias":{"kind":"Name","value":"headsignfi"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignsv"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignen"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"trip"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tripHeadsign"}},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignfi"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignsv"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignen"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortName"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetDeparturesForStationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDeparturesForStations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stations"},"name":{"kind":"Name","value":"stations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"patterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"headsign"}}]}},{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"longName"}},{"kind":"Field","alias":{"kind":"Name","value":"longNamefi"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNamesv"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNameen"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"numberOfDepartures"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}}},{"kind":"Argument","name":{"kind":"Name","value":"omitCanceled"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}}]}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"platformCode"}},{"kind":"Field","name":{"kind":"Name","value":"parentStation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"realtime"}},{"kind":"Field","name":{"kind":"Name","value":"pickupType"}},{"kind":"Field","name":{"kind":"Name","value":"serviceDay"}},{"kind":"Field","name":{"kind":"Name","value":"scheduledDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeState"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","alias":{"kind":"Name","value":"headsignfi"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignsv"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignen"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"trip"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tripHeadsign"}},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignfi"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignsv"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignen"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const GetDeparturesForStopsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDeparturesForStops"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stops"},"name":{"kind":"Name","value":"stops"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"patterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"headsign"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"routes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alerts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"alertSeverityLevel"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderText"}},{"kind":"Field","name":{"kind":"Name","value":"alertHeaderTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"alertDescriptionTextTranslations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"text"}},{"kind":"Field","name":{"kind":"Name","value":"language"}}]}},{"kind":"Field","name":{"kind":"Name","value":"effectiveEndDate"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveStartDate"}},{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"longName"}},{"kind":"Field","alias":{"kind":"Name","value":"longNamefi"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNamesv"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"longNameen"},"name":{"kind":"Name","value":"longName"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"numberOfDepartures"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numberOfDepartures"}}},{"kind":"Argument","name":{"kind":"Name","value":"omitCanceled"},"value":{"kind":"BooleanValue","value":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}}]}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stop"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"platformCode"}},{"kind":"Field","name":{"kind":"Name","value":"parentStation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"realtime"}},{"kind":"Field","name":{"kind":"Name","value":"pickupType"}},{"kind":"Field","name":{"kind":"Name","value":"serviceDay"}},{"kind":"Field","name":{"kind":"Name","value":"scheduledDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeDeparture"}},{"kind":"Field","name":{"kind":"Name","value":"realtimeState"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","alias":{"kind":"Name","value":"headsignfi"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignsv"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"headsignen"},"name":{"kind":"Name","value":"headsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"trip"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"tripHeadsign"}},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignfi"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"fi","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignsv"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"sv","block":false}}]},{"kind":"Field","alias":{"kind":"Name","value":"tripHeadsignen"},"name":{"kind":"Name","value":"tripHeadsign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"language"},"value":{"kind":"StringValue","value":"en","block":false}}]},{"kind":"Field","name":{"kind":"Name","value":"directionId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortName"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetLineIdsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"getLineIds"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"stations"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"stops"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stations"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"stops"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stops"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"parentStation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"stoptimesForPatterns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pattern"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"headsign"}},{"kind":"Field","name":{"kind":"Name","value":"route"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"shortName"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const GetStationsForStationMonitorDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetStationsForStationMonitor"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stops"},"name":{"kind":"Name","value":"stations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"locationType"}},{"kind":"Field","name":{"kind":"Name","value":"vehicleMode"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}}]}}]}}]} as unknown as DocumentNode; export const GetStopsForOldMonitorsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetStopsForOldMonitors"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"ids"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"api"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"contextKey"},"value":{"kind":"StringValue","value":"clientName","block":false}}]}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stops"},"name":{"kind":"Name","value":"stops"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"ids"},"value":{"kind":"Variable","name":{"kind":"Name","value":"ids"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"gtfsId"}},{"kind":"Field","name":{"kind":"Name","value":"locationType"}},{"kind":"Field","name":{"kind":"Name","value":"lat"}},{"kind":"Field","name":{"kind":"Name","value":"lon"}}]}}]}}]} as unknown as DocumentNode; diff --git a/src/queries/GetDeparturesForStations.graphql b/src/queries/GetDeparturesForStations.graphql index a926f956..99fef97a 100644 --- a/src/queries/GetDeparturesForStations.graphql +++ b/src/queries/GetDeparturesForStations.graphql @@ -63,6 +63,11 @@ query GetDeparturesForStations($ids: [String!]!, $numberOfDepartures: Int!) code directionId headsign + stops { + name + gtfsId + direction + } route { gtfsId shortName diff --git a/src/queries/GetDeparturesForStops.graphql b/src/queries/GetDeparturesForStops.graphql index 79010b04..df18c378 100644 --- a/src/queries/GetDeparturesForStops.graphql +++ b/src/queries/GetDeparturesForStops.graphql @@ -60,6 +60,11 @@ query GetDeparturesForStops($ids: [String!]!, $numberOfDepartures: Int!) code directionId headsign + stops { + name + gtfsId + direction + } route { gtfsId shortName diff --git a/src/ui/CarouselContainer.tsx b/src/ui/CarouselContainer.tsx index 858b5a4d..860eb6bc 100644 --- a/src/ui/CarouselContainer.tsx +++ b/src/ui/CarouselContainer.tsx @@ -113,7 +113,7 @@ const CarouselContainer: FC = ({ trainsWithTrack, ), ]; - let topics = []; + let initialTopics = []; if (mapSettings?.showMap) { // Todo. This is a hacky solution to easiest way of figuring out all the departures. // Map keeps record of all it's stops, so it has all their departures. This should be done @@ -137,19 +137,39 @@ const CarouselContainer: FC = ({ const mapDepartures = allDep .map(o => o.flatMap(a => a)) .reduce((a, b) => (a.length > b.length ? a : b)); - topics = mapDepartures + initialTopics = mapDepartures .filter(t => t.realtime) .map(dep => { - return { - feedId: dep.trip.gtfsId.split(':')[0], + const feedId = dep.trip.gtfsId.split(':')[0]; + const topic = { + feedId: feedId, route: dep.trip.route?.gtfsId?.split(':')[1], tripId: dep.trip.gtfsId.split(':')[1], shortName: dep.trip.route.shortName, type: 3, ...dep, }; + if (feedId.toLowerCase() === 'hsl') { + const i = dep.stops.findIndex(d => dep.stop.gtfsId === d.gtfsId); + if (i !== dep.stops.length - 1) { + const additionalStop = dep.stops[i + 1]; + topic.additionalStop = additionalStop; + } + } + return topic; }); } + const topics = initialTopics; + initialTopics.forEach(t => { + if (t.additionalStop) { + const additionalTopic = { + ...t, + stop: t.additionalStop, + additionalStop: null, + }; + topics.push(additionalTopic); + } + }); const lan = languages[language] === 'en' ? 'fi' : languages[language]; // for easy testing of different layouts const newView = { diff --git a/src/ui/Monitor.tsx b/src/ui/Monitor.tsx index 118f267d..024b44ff 100644 --- a/src/ui/Monitor.tsx +++ b/src/ui/Monitor.tsx @@ -149,6 +149,7 @@ const Monitor: FC = ({ preview={isPreview} mapSettings={mapSettings} topics={topics} + departures={departures} /> ) : ( void; messages?: Array; clientRef: any; - newTopics?: string[]; + newTopics?: any; topicRef: any; + departures?: any; } -const EXPIRE_TIME_SEC = 120; const getVehicleIcon = message => { const { heading, shortName, color } = message; return L.divIcon({ @@ -46,6 +46,38 @@ function updateVehiclePosition(vehicle, icon, lat, long, timeStamp) { vehicle.lastUpdatedAt = timeStamp; } +function shouldShowVehicle(message, direction, tripStart, pattern, headsign) { + return ( + !Number.isNaN(parseFloat(message.lat)) && + !Number.isNaN(parseFloat(message.long)) && + (pattern === undefined || + pattern.substr(0, message.route.length) === message.route) && + (headsign === undefined || + message.headsign === undefined || + headsign === message.headsign) && + (direction === undefined || + message.direction === undefined || + message.direction === +direction) && + (tripStart === undefined || + message.tripStartTime === undefined || + message.tripStartTime === tripStart) + ); +} + +function getVehicle(departures, id) { + const flatDeps = departures.flat(); + const veh = flatDeps.find(d => d.trip.route.gtfsId === id); + if (veh) { + const vehicleProps = { + direction: veh.trip.directionId, + tripStart: undefined, + pattern: veh.trip.gtfsId, + headsign: veh.headsign, + }; + return vehicleProps; + } + return null; +} const MonitorMap: FC = ({ preview, mapSettings, @@ -55,10 +87,13 @@ const MonitorMap: FC = ({ clientRef, newTopics, topicRef, + departures, }) => { const config = useContext(ConfigContext); const [map, setMap] = useState(); const [vehicleMarkers, setVehicleMarkers] = useState([]); + const feed = newTopics[0]?.feedId.toLowerCase(); + const EXPIRE_TIME_SEC = feed === 'hsl' ? 10 : 120; // HSL Uses different broker and we need to handle HSL messages differently const icons = mapSettings.stops.map(stop => { const color = config.modeIcons.colors[ @@ -134,14 +169,24 @@ const MonitorMap: FC = ({ const stopIDs = mapSettings.stops.map(stop => stop.gtfsId); const now = DateTime.now().toSeconds(); messages.forEach(m => { - const { id, lat, long, next_stop } = m; + const { id, lat, long, next_stop, route } = m; const nextStop = stopIDs.includes(next_stop); - + const vehicle = getVehicle(departures, route); const exists = markers.find(marker => { return marker.id === id; }); let marker; - if (exists) { + const showVehicle = + route.split(':')[0] === 'HSL' + ? shouldShowVehicle( + m, + vehicle.direction, + vehicle.tripStart, + vehicle.pattern, + vehicle.headsign, + ) + : true; + if (exists && showVehicle) { updateVehiclePosition(exists, getVehicleIcon(m), lat, long, now); if (exists.nextStop) { exists.passed = nextStop ? false : true; @@ -149,7 +194,7 @@ const MonitorMap: FC = ({ exists.nextStop = true; } // exists.passed = nextStop ? false : undefined; - } else { + } else if (showVehicle && !exists) { marker = { id: id, marker: L.marker([lat, long], { diff --git a/src/util/monitorUtils.ts b/src/util/monitorUtils.ts index 996665cb..0af69a7a 100644 --- a/src/util/monitorUtils.ts +++ b/src/util/monitorUtils.ts @@ -91,6 +91,7 @@ export const filterDepartures = ( const currentSeconds = getCurrentSeconds(); stop.stoptimesForPatterns.forEach(stoptimeList => { + const stopList = stoptimeList.pattern.stops; const combinedPattern = stringifyPattern(stoptimeList.pattern); if (!hiddenRoutes.includes(combinedPattern)) { let stoptimes = []; @@ -108,6 +109,7 @@ export const filterDepartures = ( showVia: showVia, vehicleMode: stop.vehicleMode?.toLowerCase(), renameID: renameID, + stops: stopList, }); } }); diff --git a/src/util/mqttUtils.ts b/src/util/mqttUtils.ts index 991503e1..35ff541c 100644 --- a/src/util/mqttUtils.ts +++ b/src/util/mqttUtils.ts @@ -1,5 +1,6 @@ import mqtt from 'mqtt/dist/mqtt'; import settings from './realTimeUtils'; +import { DateTime } from 'luxon'; export const startMqtt = (routes, setState, setClient, topicRef) => { if (routes?.length === 0) { @@ -23,11 +24,7 @@ export const startMqtt = (routes, setState, setClient, topicRef) => { } const feed = routes[0]?.feedId; - if (feed.toLowerCase() === 'hsl') { - //Unsupported at the moment - return; - } - const client = mqtt.connect('wss://mqtt.digitransit.fi'); + const client = mqtt.connect(settings[feed].mqtt); setState({ client: client, }); @@ -44,8 +41,20 @@ export const startMqtt = (routes, setState, setClient, topicRef) => { }); client.on('message', (topic, messages) => { - const parsedMessages = parseFeedMQTT(feedReader, messages, topic, feed); - enqueueMessage(parsedMessages); + let parsedMessages; + if (settings[feed].gtfsrt) { + parsedMessages = parseFeedMQTT(feedReader, messages, topic, feed); + } else { + const msgs = []; + const msg = parseMessage(topic, messages, feed); + if (msg) { + msgs.push(msg); + parsedMessages = msgs; + } + } + if (parsedMessages) { + enqueueMessage(parsedMessages); + } }); setInterval(processBatch, batchDelay); }); @@ -70,7 +79,8 @@ function getTopic(option) { const direction = '+'; const geoHash = ['+', '+', '+', '+']; const tripId = option.tripId ? option.tripId : '+'; - + const stop = + feed.toLowerCase() === 'hsl' ? option.stop.gtfsId.split(':')[1] : '+'; // headsigns with / cause problems const headsign = '+'; const tripStartTime = '+'; @@ -82,10 +92,27 @@ function getTopic(option) { feed, tripId, geoHash, + stop, ); return topic; } +const standardModes = ['bus', 'tram', 'ferry']; + +const getMode = mode => { + if (standardModes.includes(mode)) { + return mode; + } + if (mode === 'train') { + return 'rail'; + } + if (mode === 'metro') { + return 'subway'; + } + // bus mode should be used as fallback if mode is not one of the standard modes + return 'bus'; +}; + import ceil from 'lodash/ceil'; import Pbf from 'pbf'; export const parseFeedMQTT = (feedParser, data, topic, agency) => { @@ -149,9 +176,80 @@ export const parseFeedMQTT = (feedParser, data, topic, agency) => { return messages.length > 0 ? messages : null; }; +interface IParseMsg { + VP: any; + lat: number; + long: number; + seq: number; + oday: string; + tsi: any; + desi: string; + hdg: any; +} +export function parseMessage(topic, message: any, agency) { + let parsedMessage: IParseMsg; + const [ + , + , + , + , + , + , + mode, + , + id, + line, + dir, + headsign, // eslint-disable-line no-unused-vars + startTime, + nextStop, + ...rest // eslint-disable-line no-unused-vars + ] = topic.split('/'); + const vehid = `${agency}_${id}`; + if (message instanceof Uint8Array) { + parsedMessage = JSON.parse(message.toString()).VP; + } else { + parsedMessage = message.VP; + } + if ( + parsedMessage && + parsedMessage.lat && + parsedMessage.long && + (parsedMessage.seq === undefined || parsedMessage.seq === 1) // seq is used for hsl metro carriage sequence + ) { + // change times from 24 hour system to 29 hour system, and removes ':' + const tripStartTime = + startTime && + startTime.length > 4 && + parseInt(startTime.substring(0, 2), 10) < 5 + ? `${parseInt(startTime.substring(0, 2), 10) + 24}${startTime.substring( + 3, + )}` + : startTime.replace(/:/g, ''); + return { + id: vehid, + route: `${agency}:${line}`, + direction: parseInt(dir, 10) - 1, + tripStartTime, + operatingDay: + parsedMessage.oday && parsedMessage.oday !== 'XXX' + ? parsedMessage.oday + : DateTime.now().toLocaleString(DateTime.DATE_SHORT), + mode: getMode(mode), + next_stop: `${agency}:${nextStop}`, + timestamp: parsedMessage.tsi, + lat: ceil(parsedMessage.lat, 5), + long: ceil(parsedMessage.long, 5), + shortName: parsedMessage.desi, + heading: parsedMessage.hdg, + headsign: undefined, // in HSL data headsign from realtime data does not always match gtfs data + }; + } + return undefined; +} + export function changeTopics(settings, topicRef) { const { client, oldTopics, options } = settings; - let topicsByRoute; const topics = []; options.forEach(option => { diff --git a/src/util/realTimeUtils.ts b/src/util/realTimeUtils.ts index 5538f2d2..2bedcdec 100644 --- a/src/util/realTimeUtils.ts +++ b/src/util/realTimeUtils.ts @@ -11,6 +11,7 @@ function walttiTopicResolver( feedId, tripId, geoHash, + stop, // eslint-disable-line no-unused-vars ) { return ( '/gtfsrt/vp/' + @@ -47,6 +48,7 @@ export default { feedId, // eslint-disable-line no-unused-vars tripId, // eslint-disable-line no-unused-vars geoHash, // eslint-disable-line no-unused-vars + stop, ) { let direction = hslDirection; if (Number.isInteger(direction)) { @@ -59,6 +61,8 @@ export default { direction + '/+/' + tripStartTime + + '/' + + stop + '/#' ); }, @@ -76,7 +80,7 @@ export default { tampere: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -87,7 +91,7 @@ export default { LINKKI: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -98,7 +102,7 @@ export default { Lappeenranta: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -109,7 +113,7 @@ export default { Joensuu: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -120,7 +124,7 @@ export default { Kuopio: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -161,7 +165,7 @@ export default { ); }, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -172,7 +176,7 @@ export default { OULU: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -183,7 +187,7 @@ export default { Hameenlinna: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -194,7 +198,7 @@ export default { Lahti: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -205,7 +209,7 @@ export default { Vaasa: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -216,7 +220,7 @@ export default { Mikkeli: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -227,7 +231,7 @@ export default { Salo: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -238,7 +242,7 @@ export default { Kouvola: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -249,7 +253,7 @@ export default { Kotka: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -260,7 +264,7 @@ export default { Rovaniemi: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -271,7 +275,7 @@ export default { Kajaani: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, @@ -282,7 +286,7 @@ export default { digitraffic: { mqttTopicResolver: walttiTopicResolver, - mqtt: 'wss://mqtt.waltti.fi/mqtt', + mqtt: 'wss://mqtt.digitransit.fi', gtfsrt: true, From 06528247f7d664940e2d7acebb438bc1752dca85 Mon Sep 17 00:00:00 2001 From: Janne Antikainen Date: Thu, 7 Dec 2023 10:18:30 +0200 Subject: [PATCH 3/6] lang support for map --- server/app.js | 14 +++++++++++--- src/MonitorMapContainer.tsx | 3 +++ src/api.tsx | 4 ++-- src/ui/CarouselContainer.tsx | 2 ++ src/ui/MapModal.tsx | 3 +++ src/ui/Monitor.tsx | 3 +++ src/ui/StopCardListContainer.tsx | 2 ++ src/ui/monitorMap.tsx | 6 ++++-- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/server/app.js b/server/app.js index cc1c66ca..874ca70a 100644 --- a/server/app.js +++ b/server/app.js @@ -33,7 +33,7 @@ const apiSubscriptionParameter = process.env.API_SUBSCRIPTION_QUERY_PARAMETER_NA const MAP_URL = process.env.MAP_URL ? process.env.MAP_URL - : 'https://cdn.digitransit.fi/map/v2/hsl-map/{z}/{x}/{y}.png'; + : 'https://cdn.digitransit.fi/map/v2'; const __dirname = fileURLToPath(import.meta.url); const port = process.env.PORT || 3001; @@ -83,8 +83,16 @@ app.get('/api/geocoding/:endpoint', (req, res, next) => { .catch(e => next(e)); }); -app.get('/api/map', (req, res) => { - const url = `${MAP_URL}?${apiSubscriptionParameter}`; +app.get('/api/map/:lang', (req, res) => { + const { lang } = req.params + let url; + const hasLang = lang !== 'null' || lang !== 'undefined' + if(hasLang || lang === 'fi') { + url = `${MAP_URL}/hsl-map/{z}/\{x}/{y}.png?${apiSubscriptionParameter}` + } else { + url = url = `${MAP_URL}/hsl-map-${lang}/{z}/\{x}/{y}.png?${apiSubscriptionParameter}` + + } return res.status(200).json(url); }); diff --git a/src/MonitorMapContainer.tsx b/src/MonitorMapContainer.tsx index 7424c37c..d654a156 100644 --- a/src/MonitorMapContainer.tsx +++ b/src/MonitorMapContainer.tsx @@ -11,6 +11,7 @@ interface IProps { updateMap?: (settings: IMapSettings) => void; topics?: string[]; departures?: any; + lang: string; } const MonitorMapContainer: FC = ({ preview, @@ -19,6 +20,7 @@ const MonitorMapContainer: FC = ({ updateMap, topics, departures, + lang, }) => { const [state, setState] = useMergeState({ client: undefined, @@ -71,6 +73,7 @@ const MonitorMapContainer: FC = ({ newTopics={topics} topicRef={topicRef} departures={departures} + lang={lang} /> ); diff --git a/src/api.tsx b/src/api.tsx index 204f2bb2..bea8dbe2 100644 --- a/src/api.tsx +++ b/src/api.tsx @@ -28,8 +28,8 @@ const fetchData = (path, options, signal = undefined) => { }; const monitorAPI = { - getMapSettings(signal = undefined) { - return fetchData('map', {}, signal); + getMapSettings(lang, signal = undefined) { + return fetchData(`map/${lang}`, {}, signal); }, getPing(signal = undefined) { const options = { diff --git a/src/ui/CarouselContainer.tsx b/src/ui/CarouselContainer.tsx index 860eb6bc..12fc3c2f 100644 --- a/src/ui/CarouselContainer.tsx +++ b/src/ui/CarouselContainer.tsx @@ -69,6 +69,7 @@ const CarouselContainer: FC = ({ trainsWithTrack, }) => { const { cards: views, languages, mapSettings } = useContext(MonitorContext); + const mapLanguage = languages.length === 1 ? languages[0] : 'fi'; const hideTimeTable = mapSettings?.hideTimeTable; const finalViews = hideTimeTable ? views.filter(view => view.type === 'map') @@ -247,6 +248,7 @@ const CarouselContainer: FC = ({ closedStopViews={closedStopViews} mapSettings={mapSettings} topics={topics} + mapLanguage={mapLanguage} /> ); }; diff --git a/src/ui/MapModal.tsx b/src/ui/MapModal.tsx index 760e7c9d..7bf8f63a 100644 --- a/src/ui/MapModal.tsx +++ b/src/ui/MapModal.tsx @@ -15,6 +15,7 @@ interface Props { isLandscape: boolean; mapSettings?: IMapSettings; updateMapSettings: (settings: IMapSettings) => void; + lang?: string; } const MapModal: FC = ({ isOpen, @@ -22,6 +23,7 @@ const MapModal: FC = ({ isLandscape, mapSettings, updateMapSettings, + lang, }) => { const [t] = useTranslation(); const config = useContext(ConfigContext); @@ -71,6 +73,7 @@ const MapModal: FC = ({ mapSettings={mapSettings} updateMap={setState} modal + lang={lang} >