Skip to content

Commit

Permalink
Updates to GTFS-Realtime functions
Browse files Browse the repository at this point in the history
  • Loading branch information
brendannee committed Jan 18, 2024
1 parent 8cc3da6 commit 3461714
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 89 deletions.
80 changes: 40 additions & 40 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function getAgencies(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -162,7 +162,7 @@ export function getAreas(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -172,7 +172,7 @@ export function getAttributions(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -182,7 +182,7 @@ export function getRoutes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -192,7 +192,7 @@ export function getStops(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -201,7 +201,7 @@ export function getStops(
*/
export function getStopsAsGeoJSON(
query?: SqlWhere,
options?: QueryOptions
options?: QueryOptions,
): Promise<FeatureCollection<Geometry, { [name: string]: any }>>;

/**
Expand All @@ -211,7 +211,7 @@ export function getStoptimes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -221,7 +221,7 @@ export function getTrips(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -231,7 +231,7 @@ export function getShapes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -240,7 +240,7 @@ export function getShapes(
*/
export function getShapesAsGeoJSON(
query?: SqlWhere,
options?: QueryOptions
options?: QueryOptions,
): FeatureCollection<Geometry, { [name: string]: any }>;

/**
Expand All @@ -250,7 +250,7 @@ export function getCalendars(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -260,7 +260,7 @@ export function getCalendarDates(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -270,7 +270,7 @@ export function getFareAttributes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -280,7 +280,7 @@ export function getFareLegRules(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -290,7 +290,7 @@ export function getFareProducts(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -300,7 +300,7 @@ export function getFareRules(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -310,7 +310,7 @@ export function getFareTransferRules(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -320,7 +320,7 @@ export function getFeedInfo(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -330,7 +330,7 @@ export function getFrequencies(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -340,7 +340,7 @@ export function getLevels(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -350,7 +350,7 @@ export function getPathways(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -360,7 +360,7 @@ export function getTransfers(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -370,7 +370,7 @@ export function getTranslations(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -380,7 +380,7 @@ export function getStopAreas(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -391,7 +391,7 @@ export function getCalendarAttributes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -402,7 +402,7 @@ export function getDirections(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -413,7 +413,7 @@ export function getRouteAttributes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -424,7 +424,7 @@ export function getStopAttributes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -435,7 +435,7 @@ export function getTimetables(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -446,7 +446,7 @@ export function getTimetableStopOrders(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -457,7 +457,7 @@ export function getTimetablePages(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -468,7 +468,7 @@ export function getTimetableNotes(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -479,7 +479,7 @@ export function getTimetableNotesReferences(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -490,7 +490,7 @@ export function getTripsDatedVehicleJourneys(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -501,7 +501,7 @@ export function getServiceAlerts(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -512,18 +512,18 @@ export function getTripUpdates(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
* Returns an array of GTFS Realtime stop time updates that match query parameters.
* This only works if you configure GTFS Realtime import in node-gtfs.
*/
export function getStopTimesUpdates(
export function getStopTimeUpdates(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
Expand All @@ -534,13 +534,13 @@ export function getVehiclePositions(
query?: SqlWhere,
fields?: SqlSelect,
sortBy?: SqlOrderBy,
options?: QueryOptions
options?: QueryOptions,
): SqlResults;

/**
* Runs an advanced query.
*/
export function advancedQuery(
table?: SqlTableName,
advancedQueryOptions?: AdvancedQueryOptions
advancedQueryOptions?: AdvancedQueryOptions,
): SqlResults;
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Renamed `getStopTimesUpdates` to `getStopTimeUpdates`.

### Added
- Added `schedule_relationship`, `trip_start_time`, `direction_id` and `route_id` fields to stop_time_updates and trip_updates tables.

## [4.5.1] - 2023-11-09

### Updated
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1189,15 +1189,15 @@ import { getTripUpdates } from 'gtfs';
const tripUpdates = getTripUpdates();
```
#### getStopTimesUpdates(query, fields, sortBy, options)
#### getStopTimeUpdates(query, fields, sortBy, options)
Returns an array of GTFS Realtime stop time updates that match query parameters. [Details on Stop Time Updates](https://gtfs.org/realtime/feed-entities/trip-updates/#stoptimeupdate)
```js
import { getStopTimesUpdates } from 'gtfs';
import { getStopTimeUpdates } from 'gtfs';
// Get all stop times updates
const stopTimesUpdates = getStopTimesUpdates();
// Get all stop time updates
const stopTimeUpdates = getStopTimeUpdates();
```
#### getVehiclePositions(query, fields, sortBy, options)
Expand Down
Loading

0 comments on commit 3461714

Please sign in to comment.