4.0.1 • Published 9 days ago

@digitransit-search-util/digitransit-search-util-query-utils v4.0.1

Weekly downloads
46
License
(AGPL-3.0 OR EUPL...
Repository
github
Last release
9 days ago

@digitransit-search-util/digitransit-search-util-query-utils

verify

Verifies that the data for favourites is coherent and current and fixes errors

Parameters

  • stopStationMap
  • favourites

setRelayEnvironment

Set you Relay environment

Parameters

  • environment any Your Relay environment

getModesWithAlerts

Get alerts for modes

Parameters

  • currentTime Number Epoch time
  • feedIds Array Array of feedId Strings (optional, default null)

getStopAndStationsQuery

Returns Stop and station objects .

Parameters

  • favourites any

filterStopsAndStationsByMode

Returns Stop and station objects filtered by given mode based on mode information acquired from OTP by checking the modes of the departures on the given stops.

Parameters

  • stopsToFilter any
  • mode String

getFavouriteRoutesQuery

Returns Favourite Route objects depending on input

Parameters

  • favourites any
  • input String Search text, if empty no objects are returned
  • transportMode String If provided, all returned route objects are of this mode, e.g. 'BUS'
  • pathOpts an object containing two properties routesPrefix and stopsPrefix to override the URL paths returned by this method

getFavouriteVehicleRentalStationsQuery

Returns Favourite VehicleRentalStation objects depending on input

Parameters

  • favourites any
  • input String Search text, if empty no objects are returned

getRoutesQuery

Returns Route objects depending on input

Parameters

  • input String Search text, if empty no objects are returned
  • feedIds any
  • transportMode String Filter routes with a transport mode, e.g. route-BUS
  • pathOpts an object containing two properties routesPrefix and stopsPrefix to override the URL paths returned by this method

filterSearchResultsByMode

Can be used to filter stops and stations by a given mode

Parameters

  • results any search results from geocoding
  • mode any e.g 'BUS' or 'TRAM'
  • type any type of search results to filter, e.g 'Stops' or 'Routes'. This function only filters Stops because routes can be filtered with the query itself (optional, default 'Stops')

This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @digitransit-search-util/digitransit-search-util-query-utils

Or install the digitransit-search-util module that includes it as a function:

$ npm install @digitransit-search-util/digitransit-search-util
4.0.1

9 days ago

4.0.0

3 months ago

3.0.0

4 months ago

2.0.10

4 months ago

2.0.9

6 months ago

2.0.8

8 months ago

2.0.7

1 year ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.1.1

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.0

3 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.16

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago