tfl-api-wrapper
Advanced tools
Comparing version 1.5.2 to 1.6.0
@@ -11,5 +11,5 @@ import AirQuality from './lib/airQuality'; | ||
import TrackerNet from './lib/trackerNet'; | ||
import TrackerNetLines from './lib/enums/trackerNet/lines'; | ||
import TrackerNetStations from './lib/enums/trackerNet/stations'; | ||
import Modes from './lib/enums/modes'; | ||
import TrackerNetLines from './lib/enums/lines'; | ||
import TrackerNetStations from './lib/enums/stationCodes'; | ||
export { AirQuality, BikePoint, Crowding, Disruptions, Line, Mode, Occupancy, Road, StopPoint, TrackerNet, TrackerNetLines, TrackerNetStations, Modes }; |
@@ -0,0 +0,0 @@ "use strict"; |
import TfLAPI from './tfl'; | ||
import TfL from './interfaces/tfl'; | ||
export default class Line extends TfLAPI { | ||
@@ -8,3 +9,3 @@ constructor(config: string); | ||
*/ | ||
getAll(year: number): Promise<any>; | ||
getAll(year: number): Promise<Array<TfL['AccidentStats.AccidentDetail']>>; | ||
} |
@@ -0,0 +0,0 @@ "use strict"; |
import TfLAPI from './tfl'; | ||
import { LondonAirForecast } from './interfaces/airQuality'; | ||
export default class AirQuality extends TfLAPI { | ||
constructor(config: string); | ||
/** Get all current and future air quality forecast */ | ||
getAirQuality(): Promise<any>; | ||
getAirQuality(): Promise<LondonAirForecast>; | ||
} |
@@ -0,0 +0,0 @@ "use strict"; |
import TfLAPI from './tfl'; | ||
import { IBikePoint } from './interfaces/bikepoint'; | ||
import TfL from './interfaces/tfl'; | ||
export default class BikePoint extends TfLAPI { | ||
constructor(config: string); | ||
getAll(): Promise<IBikePoint.Root[]>; | ||
getByID(id: string): Promise<IBikePoint.Root>; | ||
getByName(query: string): Promise<IBikePoint.Root>; | ||
getAll(): Promise<Array<TfL['Place']>>; | ||
getByID(id: string): Promise<TfL['Place']>; | ||
getByName(query: string): Promise<Array<TfL['Place']>>; | ||
} |
@@ -24,8 +24,11 @@ "use strict"; | ||
} | ||
/* Gets all bike point locations */ | ||
BikePoint.prototype.getAll = function () { | ||
return this.sendRequest("/BikePoint/", {}, 'GET'); | ||
}; | ||
/* Gets the bike point by the given id */ | ||
BikePoint.prototype.getByID = function (id) { | ||
return this.sendRequest("/BikePoint/" + id, {}, 'GET'); | ||
}; | ||
/* Search for bike points by their name */ | ||
BikePoint.prototype.getByName = function (query) { | ||
@@ -32,0 +35,0 @@ return this.sendRequest("/BikePoint/Search", { query: query }, 'GET'); |
import TfLAPI from './tfl'; | ||
import Crowding from './interfaces/crowding'; | ||
import ICrowding from './interfaces/crowding'; | ||
import DaysOfTheWeek from './enums/DaysOfTheWeek'; | ||
@@ -7,12 +7,12 @@ export default class Crowding extends TfLAPI { | ||
/** | ||
* Returns crowding information for Naptan | ||
* Get crowding information for Naptan | ||
* @param naptanID ID of the stop (eg. 940GZZLUASL) | ||
*/ | ||
getallByNaptan(naptanID: string): Promise<Crowding.Root>; | ||
getAllByNaptan(naptanID: string): Promise<ICrowding.Root>; | ||
/** | ||
* Returns crowding information for Naptan for a specified day of week | ||
* Get crowding information for Naptan for a specified day of week | ||
* @param naptanID ID of the stop (eg. 940GZZLUASL) | ||
* @param dayOfTheWeek The day of which you would like data to return (eg. MON, TUE) | ||
*/ | ||
getByNaptanDay(naptanID: string, dayOfTheWeek: DaysOfTheWeek): Promise<Crowding.Root>; | ||
getByNaptanDay(naptanID: string, dayOfTheWeek: DaysOfTheWeek): Promise<ICrowding.Root>; | ||
} |
@@ -25,10 +25,10 @@ "use strict"; | ||
/** | ||
* Returns crowding information for Naptan | ||
* Get crowding information for Naptan | ||
* @param naptanID ID of the stop (eg. 940GZZLUASL) | ||
*/ | ||
Crowding.prototype.getallByNaptan = function (naptanID) { | ||
Crowding.prototype.getAllByNaptan = function (naptanID) { | ||
return this.sendRequest("/Crowding/" + naptanID, {}, 'GET'); | ||
}; | ||
/** | ||
* Returns crowding information for Naptan for a specified day of week | ||
* Get crowding information for Naptan for a specified day of week | ||
* @param naptanID ID of the stop (eg. 940GZZLUASL) | ||
@@ -35,0 +35,0 @@ * @param dayOfTheWeek The day of which you would like data to return (eg. MON, TUE) |
import TfLAPI from './tfl'; | ||
import IDisruption from './interfaces/disruptions'; | ||
export default class Disruptions extends TfLAPI { | ||
constructor(config: string); | ||
/** | ||
* List of all currently disrupted lift routes, refreshed every 1 minute | ||
*/ | ||
getAllLifts(): Promise<getAllLifts.Root[]>; | ||
getAllLifts(): Promise<IDisruption.Root[]>; | ||
} |
@@ -24,5 +24,3 @@ "use strict"; | ||
} | ||
/** | ||
* List of all currently disrupted lift routes, refreshed every 1 minute | ||
*/ | ||
/* List of all currently disrupted lift routes, refreshed every 1 minute */ | ||
Disruptions.prototype.getAllLifts = function () { | ||
@@ -29,0 +27,0 @@ return this.sendRequest("/Disruptions/Lifts", {}, 'GET'); |
@@ -0,0 +0,0 @@ declare const enum DaysOfTheWeek { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare const enum TrackerNetLines { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare const enum modes { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare const enum TrackerNetStations { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare module IBikePoint { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -6,4 +6,3 @@ declare module Crowding { | ||
} | ||
interface Root { | ||
naptan: string; | ||
interface DaysOfWeek { | ||
dayOfWeek: string; | ||
@@ -13,5 +12,10 @@ amPeakTimeBand: string; | ||
timeBands: TimeBand[]; | ||
} | ||
interface Root { | ||
naptan: string; | ||
daysOfWeek?: DaysOfWeek[]; | ||
isFound: boolean; | ||
isAlwaysQuiet: boolean; | ||
} | ||
} | ||
export default Crowding; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
declare module getAllLifts { | ||
declare module Disruptions { | ||
interface Root { | ||
@@ -11,1 +11,2 @@ icsCode: string; | ||
} | ||
export default Disruptions; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare module GetArrivalPredictionsAllStops { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ declare module Occupancy { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -1,2 +0,2 @@ | ||
import TrackerNetLines from '../enums/lines'; | ||
import TrackerNetLines from '../enums/trackerNet/lines'; | ||
export declare module getPredictionSummary { | ||
@@ -3,0 +3,0 @@ interface Train { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
import TfL from './interfaces/tfl'; | ||
import TfLAPI from './tfl'; | ||
@@ -5,14 +6,17 @@ export default class Line extends TfLAPI { | ||
/** Get all valid modes */ | ||
getValidModes(): Promise<any>; | ||
getModes(): Promise<Array<TfL['Mode']>>; | ||
/** Gets a list of all severity codes */ | ||
getSeverityCodes(): Promise<any>; | ||
getSeverityCodes(): Promise<Array<TfL['StatusSeverity']>>; | ||
/** Gets a list of all disruption types */ | ||
getDisruptionCategories(): Promise<any>; | ||
getDisruptionCategories(): Promise<Array<TfL['Disruption']['category']>>; | ||
/** Gets a list of all service types */ | ||
getServiceTypes(): Promise<any>; | ||
getServiceTypes(): Promise<Array<'Regular' | 'Night'>>; | ||
/** Gets a list of the stations that serve the given line id */ | ||
getAllStopPoints(line: string): Promise<any>; | ||
/** Gets all lines that serve the given modes. */ | ||
getAllFromMode(modes: Array<string | number>): Promise<any>; | ||
getAllStopPoints(line: string): Promise<Array<TfL['StopPoint']>>; | ||
/** | ||
* Gets all lines that serve the given modes | ||
* @param modes An array of modes e.g. tube, tram | ||
*/ | ||
getAllByModes(modes: Array<string>): Promise<Array<TfL['Line']>>; | ||
/** | ||
* Gets the line status of for given line ids e.g Minor Delays | ||
@@ -24,3 +28,3 @@ * @param lines A list of line ids e.g. victoria, circle, N133 | ||
*/ | ||
getStatusByLine(lines: Array<string>, detail?: boolean, startDate?: Date, endDate?: Date): Promise<any>; | ||
getStatusByLine(lines: Array<string>, detail?: boolean, startDate?: Date, endDate?: Date): Promise<Array<TfL['Line']>>; | ||
/** | ||
@@ -30,11 +34,15 @@ * Gets the line status of for all lines for the given modes | ||
* @param detail Include details of the disruptions that are causing the line status including the affected stops and routes | ||
* @param severityLevel If specified, ensures that only those line status(es) are returned within the lines that have disruptions with the matching severity level. | ||
* @param severityLevel If specified, ensures that only those line status(es) are returned within the lines that have disruptions with the matching severity level | ||
*/ | ||
getStatusByModes(modes: Array<string>, detail?: boolean, severityLevel?: string): Promise<any>; | ||
getStatusByModes(modes: Array<string>, detail?: boolean, severityLevel?: string): Promise<Array<TfL['Line']>>; | ||
/** Gets the timetable for a specified station on the give line with specified destination */ | ||
getTimetableFromTo(line: string, from: string, to: string): Promise<any>; | ||
/** Gets the inbound timetable for a specified station on the give line */ | ||
getTimetableFromStationIn(line: string, NaPTANID: string): Promise<any>; | ||
/** Gets the outbound timetable for a specified station on the give line */ | ||
getTimetableFromStationOut(line: string, NaPTANID: string): Promise<any>; | ||
getTimetableFromTo(line: string, from: string, to: string): Promise<Array<TfL['TimetableResponse']>>; | ||
/** | ||
* Gets the inbound timetable for a specified station on the give line | ||
* | ||
* @param line Id of the line e.g. 'victoria' | ||
* @param NaptanID Id of the stop (station naptan code e.g. 940GZZLUASL) | ||
* @param direction What direction you want the timetable for. Leave blank for outbound or 'inbound' | ||
*/ | ||
getTimetableFromStation(line: string, NaPTANID: string, direction?: string): Promise<Array<TfL['TimetableResponse']>>; | ||
/** Get the list of arrival predictions for given line ids based at the given stop | ||
@@ -46,3 +54,3 @@ * @param ids list of line ids e.g. ['victoria','circle','N133'] | ||
*/ | ||
getArrivalsByNaptan(ids: Array<string>, NaptanID: string, direction?: string, destinationStationId?: string): Promise<any>; | ||
getArrivalsByNaptan(ids: Array<string>, NaptanID: string, direction?: string, destinationStationId?: string): Promise<Array<TfL['Prediction']>>; | ||
/** | ||
@@ -52,15 +60,8 @@ * Get disruptions for the given line ids | ||
*/ | ||
getDistruptionsByID(ids: Array<string>): Promise<any>; | ||
getDistruptionsByID(ids: Array<string>): Promise<Array<TfL['Disruption']>>; | ||
/** | ||
* Search for lines or routes matching the query string | ||
* @param query Search term e.g victoria | ||
* @param modes Optionally filter by the specified modes | ||
* @param serviceTypes A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified | ||
*/ | ||
searchByString(query: string, modes?: Array<string>, serviceTypes?: boolean): Promise<any>; | ||
/** | ||
* Get all valid routes for all lines, including the name and id of the originating and terminating stops for each route. | ||
* @param serviceTypes A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified | ||
*/ | ||
getAllValidRoutes(serviceTypes?: string): Promise<any>; | ||
getAllValidRoutes(serviceTypes?: string): Promise<Array<TfL['Line']>>; | ||
} |
@@ -25,3 +25,3 @@ "use strict"; | ||
/** Get all valid modes */ | ||
Line.prototype.getValidModes = function () { | ||
Line.prototype.getModes = function () { | ||
return this.sendRequest('/Line/Meta/Modes', {}, 'GET'); | ||
@@ -45,4 +45,7 @@ }; | ||
}; | ||
/** Gets all lines that serve the given modes. */ | ||
Line.prototype.getAllFromMode = function (modes) { | ||
/** | ||
* Gets all lines that serve the given modes | ||
* @param modes An array of modes e.g. tube, tram | ||
*/ | ||
Line.prototype.getAllByModes = function (modes) { | ||
return this.sendRequest("/Line/Mode/" + tfl_1.default.arrayToCSV(modes), {}, 'GET'); | ||
@@ -70,3 +73,3 @@ }; | ||
* @param detail Include details of the disruptions that are causing the line status including the affected stops and routes | ||
* @param severityLevel If specified, ensures that only those line status(es) are returned within the lines that have disruptions with the matching severity level. | ||
* @param severityLevel If specified, ensures that only those line status(es) are returned within the lines that have disruptions with the matching severity level | ||
*/ | ||
@@ -80,10 +83,12 @@ Line.prototype.getStatusByModes = function (modes, detail, severityLevel) { | ||
}; | ||
/** Gets the inbound timetable for a specified station on the give line */ | ||
Line.prototype.getTimetableFromStationIn = function (line, NaPTANID) { | ||
return this.sendRequest("/Line/" + line + "/Timetable/" + NaPTANID, { direction: 'inbound' }, 'GET'); | ||
/** | ||
* Gets the inbound timetable for a specified station on the give line | ||
* | ||
* @param line Id of the line e.g. 'victoria' | ||
* @param NaptanID Id of the stop (station naptan code e.g. 940GZZLUASL) | ||
* @param direction What direction you want the timetable for. Leave blank for outbound or 'inbound' | ||
*/ | ||
Line.prototype.getTimetableFromStation = function (line, NaPTANID, direction) { | ||
return this.sendRequest("/Line/" + line + "/Timetable/" + NaPTANID, { direction: direction }, 'GET'); | ||
}; | ||
/** Gets the outbound timetable for a specified station on the give line */ | ||
Line.prototype.getTimetableFromStationOut = function (line, NaPTANID) { | ||
return this.sendRequest("/Line/" + line + "/Timetable/" + NaPTANID, {}, 'GET'); | ||
}; | ||
/** Get the list of arrival predictions for given line ids based at the given stop | ||
@@ -107,11 +112,2 @@ * @param ids list of line ids e.g. ['victoria','circle','N133'] | ||
/** | ||
* Search for lines or routes matching the query string | ||
* @param query Search term e.g victoria | ||
* @param modes Optionally filter by the specified modes | ||
* @param serviceTypes A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified | ||
*/ | ||
Line.prototype.searchByString = function (query, modes, serviceTypes) { | ||
return this.sendRequest("/Line/" + query + "/Disruption", { modes: modes, serviceTypes: serviceTypes }, 'GET'); | ||
}; | ||
/** | ||
* Get all valid routes for all lines, including the name and id of the originating and terminating stops for each route. | ||
@@ -118,0 +114,0 @@ * @param serviceTypes A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified |
import TfLAPI from './tfl'; | ||
import { GetArrivalPredictionsAllStops, GetActiveServiceTypes } from './interfaces/mode'; | ||
import TfL from './interfaces/tfl'; | ||
export default class Mode extends TfLAPI { | ||
@@ -8,3 +8,3 @@ constructor(config: string); | ||
*/ | ||
getActiveServiceTypes(): Promise<GetActiveServiceTypes.Root[]>; | ||
getActiveServiceTypes(): Promise<Array<TfL['ActiveServiceType']>>; | ||
/** | ||
@@ -15,3 +15,3 @@ * | ||
*/ | ||
getArrivalPredictionsAllStops(mode: string, count?: number): Promise<GetArrivalPredictionsAllStops.Root[]>; | ||
getAllArrivalPredictions(mode: string, count?: number): Promise<Array<TfL['Prediction']>>; | ||
} |
@@ -35,3 +35,3 @@ "use strict"; | ||
*/ | ||
Mode.prototype.getArrivalPredictionsAllStops = function (mode, count) { | ||
Mode.prototype.getAllArrivalPredictions = function (mode, count) { | ||
if (count === void 0) { count = -1; } | ||
@@ -38,0 +38,0 @@ return this.sendRequest("/Mode/" + mode + "/Arrivals", { count: count }, 'GET'); |
@@ -0,3 +1,3 @@ | ||
import TfL from './interfaces/tfl'; | ||
import TfLAPI from './tfl'; | ||
import Occupancy from './interfaces/occupancy'; | ||
export default class Occupancy extends TfLAPI { | ||
@@ -9,3 +9,3 @@ constructor(config: string); | ||
*/ | ||
getBikePointByID(id: string): Promise<Occupancy.CarPark>; | ||
getBikePointByIDs(ids: string[]): Promise<Array<TfL['BikePointOccupancy']>>; | ||
/** | ||
@@ -15,16 +15,16 @@ * Gets the occupancy for a charge connectors with a given id | ||
*/ | ||
getCarkParkByID(id: string): Promise<Occupancy.CarPark>; | ||
getCarkParkByID(id: string): Promise<TfL['CarParkOccupancy']>; | ||
/** | ||
* Gets the occupancy for a charge connectors with a given id | ||
* @param id Charge Connector ID (Eg. ChargePointESB-UT06NW-1) | ||
* @param id Charge Connector ID (Eg. ChargePointCM-24119-49940) | ||
*/ | ||
getChargeConnectorByID(id: string): Promise<Occupancy.ChargeConnector>; | ||
getChargeConnectorByID(id: string): Promise<TfL['ChargeConnectorOccupancy']>; | ||
/** | ||
* Gets the occupancy for all car parks that have occupancy data | ||
*/ | ||
getAllCarParks(): Promise<Occupancy.CarPark>; | ||
getAllCarParks(): Promise<Array<TfL['CarParkOccupancy']>>; | ||
/** | ||
* Gets the occupancy for all charge connectors | ||
*/ | ||
getAllChargeConnectors(): Promise<Occupancy.ChargeConnector[]>; | ||
getAllChargeConnectors(): Promise<Array<TfL['ChargeConnectorOccupancy']>>; | ||
} |
@@ -28,4 +28,4 @@ "use strict"; | ||
*/ | ||
Occupancy.prototype.getBikePointByID = function (id) { | ||
return this.sendRequest("/Occupancy/BikePoints/" + id, {}, 'GET'); | ||
Occupancy.prototype.getBikePointByIDs = function (ids) { | ||
return this.sendRequest("/Occupancy/BikePoints/" + tfl_1.default.arrayToCSV(ids), {}, 'GET'); | ||
}; | ||
@@ -41,3 +41,3 @@ /** | ||
* Gets the occupancy for a charge connectors with a given id | ||
* @param id Charge Connector ID (Eg. ChargePointESB-UT06NW-1) | ||
* @param id Charge Connector ID (Eg. ChargePointCM-24119-49940) | ||
*/ | ||
@@ -44,0 +44,0 @@ Occupancy.prototype.getChargeConnectorByID = function (id) { |
@@ -0,1 +1,2 @@ | ||
import TfL from './interfaces/tfl'; | ||
import TfLAPI from './tfl'; | ||
@@ -7,3 +8,3 @@ export default class Road extends TfLAPI { | ||
*/ | ||
getAll(): Promise<any>; | ||
getAll(): Promise<Array<TfL['RoadCorridor']>>; | ||
/** | ||
@@ -13,3 +14,3 @@ * Get the road with the specified ID (Eg. A1) | ||
*/ | ||
getByID(ids: Array<string>): Promise<any>; | ||
getByID(ids: Array<string>): Promise<Array<TfL['RoadCorridor']>>; | ||
/** | ||
@@ -21,3 +22,3 @@ * Gets the specified roads with the status aggregated over the date range specified, or now until the end of today if no dates are passed | ||
*/ | ||
getStatusByID(ids: Array<string>, startDate?: Date, endDate?: Date): Promise<any>; | ||
getStatusByID(ids: Array<string>, startDate?: Date, endDate?: Date): Promise<Array<TfL['RoadCorridor']>>; | ||
/** | ||
@@ -28,3 +29,3 @@ * Gets a list of disrupted streets | ||
*/ | ||
getAllStreetDisruption(startDate: Date, endDate: Date): Promise<any>; | ||
getAllStreetDisruption(startDate: Date, endDate: Date): Promise<Array<TfL['RoadDisruption']>>; | ||
/** | ||
@@ -37,11 +38,11 @@ * Gets a list of active disruptions filtered by disruption Ids. | ||
*/ | ||
getAllDisruptionsByID(ids: Array<string>, stripContent?: boolean): Promise<any>; | ||
getAllDisruptionsByID(ids: Array<string>, stripContent?: boolean): Promise<Array<TfL['RoadDisruption']>>; | ||
/** | ||
* Gets a list of valid RoadDisruption categories | ||
*/ | ||
getCategories(): Promise<any>; | ||
getCategories(): Promise<Array<string>>; | ||
/** | ||
* Gets a list of valid RoadDisruption severity codes | ||
*/ | ||
getSeverities(): Promise<any>; | ||
getSeverities(): Promise<Array<TfL['StatusSeverity']>>; | ||
} |
@@ -0,0 +0,0 @@ "use strict"; |
import TfLAPI from './tfl'; | ||
import TfL from './interfaces/tfl'; | ||
export default class StopPoint extends TfLAPI { | ||
@@ -7,11 +8,11 @@ constructor(config: string); | ||
*/ | ||
getCategories(): Promise<any>; | ||
getCategories(): Promise<Array<TfL['StopPointCategory']>>; | ||
/** | ||
* Gets the list of available StopPoint types | ||
*/ | ||
getTypes(): Promise<any>; | ||
getTypes(): Promise<Array<string>>; | ||
/** | ||
* Gets the list of available StopPoint modes | ||
*/ | ||
getModes(): Promise<any>; | ||
getModes(): Promise<Array<TfL['Mode']>>; | ||
/** | ||
@@ -22,3 +23,3 @@ * Gets a list of StopPoints corresponding to the given list of stop ids | ||
*/ | ||
getByIDs(ids: Array<string>, includeCrowdingData: boolean): Promise<any>; | ||
getByIDs(ids: Array<string>, includeCrowdingData: boolean): Promise<Array<TfL['StopPoint']>>; | ||
/** | ||
@@ -28,3 +29,3 @@ * Gets all stop points of a given type | ||
*/ | ||
getAllByStopType(types: Array<string>): Promise<any>; | ||
getAllByStopType(types: Array<string>): Promise<Array<TfL['StopPoint']>>; | ||
/** | ||
@@ -36,3 +37,3 @@ * Gets the service types for a given Stop Point | ||
*/ | ||
getServiceTypesByID(id: string, lineIds?: Array<string>, modes?: Array<string>): Promise<any>; | ||
getServiceTypesByID(id: string, lineIds?: Array<string>, modes?: Array<string>): Promise<Array<TfL['LineServiceType']>>; | ||
/** | ||
@@ -43,3 +44,3 @@ * Search StopPoints by their common name. Will not return a valid NaPTAN for HUB | ||
*/ | ||
search(name: string, modes: string): Promise<any>; | ||
search(name: string, modes: string): Promise<TfL['SearchResponse']>; | ||
/** | ||
@@ -49,3 +50,3 @@ * Get all service arrivals | ||
*/ | ||
getStationArrivals(id: string): Promise<any>; | ||
getStationArrivals(id: string): Promise<Array<TfL['Prediction']>>; | ||
/** | ||
@@ -56,3 +57,2 @@ * | ||
*/ | ||
getArrivalDepartures(id: string, lineIds: Array<string>): Promise<any>; | ||
/** | ||
@@ -65,3 +65,3 @@ * Gets all disruptions for the specified StopPointId, plus disruptions for any child Naptan records it may have | ||
*/ | ||
getDisruptionsByID(ids: Array<string>, getFamily: boolean, includeRouteBlockedStops: boolean, flattenResponse: boolean): Promise<any>; | ||
getDisruptionsByID(ids: Array<string>, getFamily: boolean, includeRouteBlockedStops: boolean, flattenResponse: boolean): Promise<Array<TfL['DisruptedPoint']>>; | ||
/** | ||
@@ -72,3 +72,3 @@ * Gets a distinct list of disrupted stop points for the given modes | ||
*/ | ||
getDisruptionsByMode(modes: Array<string>, includeRouteBlockedStops: boolean): Promise<any>; | ||
getDisruptionsByMode(modes: Array<string>, includeRouteBlockedStops: boolean): Promise<Array<TfL['DisruptedPoint']>>; | ||
/** | ||
@@ -80,3 +80,3 @@ * Gets Stop points that are reachable from a station/line combination | ||
*/ | ||
getReachableStationsByID(id: string, lineID: string, serviceTypes?: Array<string>): Promise<any>; | ||
getReachableStationsByID(id: string, lineID: string, serviceTypes?: Array<string>): Promise<Array<TfL['Identifier']>>; | ||
/** | ||
@@ -87,3 +87,3 @@ * Get the route sections for all the lines that service the given stop point id | ||
*/ | ||
getRouteSectionByID(id: string, serviceTypes?: Array<string>): Promise<any>; | ||
getRouteSectionByID(id: string, serviceTypes?: Array<string>): Promise<Array<TfL['StopPointRouteSection']>>; | ||
/** | ||
@@ -100,3 +100,3 @@ * Gets a list of StopPoints within {radius} by the specified criteria | ||
*/ | ||
getInRadius(stopTypes: Array<string>, radius: number | undefined, useStopPointHierarchy: boolean, modes: Array<string>, categories: Array<string>, returnLines: boolean, latitude: number, longitude: number): Promise<any>; | ||
getInRadius(stopTypes: Array<string>, radius: number | undefined, useStopPointHierarchy: boolean, modes: Array<string>, categories: Array<string>, returnLines: boolean, latitude: number, longitude: number): Promise<Array<TfL['StopPointsResponse']>>; | ||
/** | ||
@@ -106,4 +106,5 @@ * Gets a StopPoint for a given sms code. | ||
* @param output If set to "web", a 302 redirect to relevant website bus stop page is returned. All other values are ignored. | ||
* @returns ENGLISH > FRENCH | ||
*/ | ||
getBySMSCode(smsID: number, output?: string): Promise<any>; | ||
getBySMSCode(smsID: number, output?: string): Promise<TfL['StopPoint']>; | ||
/** | ||
@@ -113,3 +114,3 @@ * Gets a list of taxi ranks corresponding to the given stop point id | ||
*/ | ||
getTaxiRanksByID(id: string): Promise<any>; | ||
getTaxiRanksByID(id: string): Promise<Array<TfL['Place']>>; | ||
/** | ||
@@ -119,3 +120,3 @@ * Get car parks corresponding to the given stop point id | ||
*/ | ||
getCarParksByID(id: string): Promise<any>; | ||
getCarParksByID(id: string): Promise<Array<TfL['Place']>>; | ||
} |
@@ -72,3 +72,3 @@ "use strict"; | ||
StopPoint.prototype.search = function (name, modes) { | ||
return this.sendRequest("/StopPoint/Search/" + name, {}, 'GET'); | ||
return this.sendRequest("/StopPoint/Search/" + name, { modes: modes }, 'GET'); | ||
}; | ||
@@ -87,5 +87,5 @@ /** | ||
*/ | ||
StopPoint.prototype.getArrivalDepartures = function (id, lineIds) { | ||
return this.sendRequest("/StopPoint/" + id + "/ArrivalsDepartures", {}, 'GET'); | ||
}; | ||
// getArrivalDepartures(id: string, lineIds: Array<string>) { | ||
// return this.sendRequest(`/StopPoint/${id}/ArrivalsDepartures`, { lineIds }, 'GET'); | ||
// } | ||
/** | ||
@@ -130,3 +130,3 @@ * Gets all disruptions for the specified StopPointId, plus disruptions for any child Naptan records it may have | ||
if (serviceTypes === void 0) { serviceTypes = ['Regular']; } | ||
return this.sendRequest("/StopPoint/" + id + "/Route", { serviceTypes: tfl_1.default.arrayToCSV(serviceTypes) }, 'GET'); | ||
return this.sendRequest("/StopPoint/" + id + "/ ", { serviceTypes: tfl_1.default.arrayToCSV(serviceTypes) }, 'GET'); | ||
}; | ||
@@ -152,2 +152,3 @@ /** | ||
* @param output If set to "web", a 302 redirect to relevant website bus stop page is returned. All other values are ignored. | ||
* @returns ENGLISH > FRENCH | ||
*/ | ||
@@ -154,0 +155,0 @@ StopPoint.prototype.getBySMSCode = function (smsID, output) { |
@@ -0,0 +0,0 @@ export default class TfLAPI { |
@@ -0,0 +0,0 @@ "use strict"; |
import TfLAPI from './tfl'; | ||
import * as ITrackerNet from './interfaces/trackerNet'; | ||
import TrackerNetLines from './enums/lines'; | ||
import TrackerNetStations from './enums/stationCodes'; | ||
import TrackerNetLines from './enums/trackerNet/lines'; | ||
import TrackerNetStations from './enums/trackerNet/stations'; | ||
export default class TrackerNet extends TfLAPI { | ||
constructor(config: string); | ||
/** | ||
* This will return train prediction information for a nominated line within 100 minute range | ||
* @param line A line to get predictions from e.g. "C" | ||
*/ | ||
getPredictionSummary(line: TrackerNetLines): Promise<ITrackerNet.getPredictionSummary.Root>; | ||
/** | ||
* Get detailed train prediction information for a nominated station on a nominated line within 100 minute range. | ||
* @param {TrackerNetLines} line | ||
* @param {TrackerNetStations} stationCode | ||
* @returns {<ITrackerNet.PredictionDetailed>} | ||
* @param line A line to get predictions from e.g. "C" | ||
* @param stationCode A line to get predictions from e.g. "BNK" | ||
*/ | ||
@@ -17,3 +20,3 @@ getPredictionDetailed(line: TrackerNetLines, stationCode: TrackerNetStations): Promise<ITrackerNet.getPredictionDetailed.Root>; | ||
* Get the status of all lines on the network indicating any delays, disruptions or suspensions on the lines. | ||
* @param {boolean} incidentsOnly An indication of whether only lines that have incidents should be returned. Default: false | ||
* @param incidentsOnly An indication of whether only lines that have incidents should be returned. Default: false | ||
*/ | ||
@@ -23,5 +26,5 @@ getAllLinesStatus(incidentsOnly?: boolean): Promise<ITrackerNet.getAllLinesStatus.Root>; | ||
* Get the status of all stations on the network indicating any disruptions or closures of stations. | ||
* @param {boolean} incidentsOnly Get station status information for stations with incidents only. Default: false | ||
* @param incidentsOnly Get station status information for stations with incidents only. Default: false | ||
*/ | ||
getAllStationStatus(incidentsOnly?: boolean): Promise<ITrackerNet.getAllStationStatus.Root>; | ||
} |
@@ -61,2 +61,6 @@ "use strict"; | ||
} | ||
/** | ||
* This will return train prediction information for a nominated line within 100 minute range | ||
* @param line A line to get predictions from e.g. "C" | ||
*/ | ||
TrackerNet.prototype.getPredictionSummary = function (line) { | ||
@@ -80,5 +84,4 @@ return __awaiter(this, void 0, void 0, function () { | ||
* Get detailed train prediction information for a nominated station on a nominated line within 100 minute range. | ||
* @param {TrackerNetLines} line | ||
* @param {TrackerNetStations} stationCode | ||
* @returns {<ITrackerNet.PredictionDetailed>} | ||
* @param line A line to get predictions from e.g. "C" | ||
* @param stationCode A line to get predictions from e.g. "BNK" | ||
*/ | ||
@@ -112,3 +115,3 @@ TrackerNet.prototype.getPredictionDetailed = function (line, stationCode) { | ||
* Get the status of all lines on the network indicating any delays, disruptions or suspensions on the lines. | ||
* @param {boolean} incidentsOnly An indication of whether only lines that have incidents should be returned. Default: false | ||
* @param incidentsOnly An indication of whether only lines that have incidents should be returned. Default: false | ||
*/ | ||
@@ -134,3 +137,3 @@ TrackerNet.prototype.getAllLinesStatus = function (incidentsOnly) { | ||
* Get the status of all stations on the network indicating any disruptions or closures of stations. | ||
* @param {boolean} incidentsOnly Get station status information for stations with incidents only. Default: false | ||
* @param incidentsOnly Get station status information for stations with incidents only. Default: false | ||
*/ | ||
@@ -137,0 +140,0 @@ TrackerNet.prototype.getAllStationStatus = function (incidentsOnly) { |
@@ -0,0 +0,0 @@ declare const _default: { |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
{ | ||
"name": "tfl-api-wrapper", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "A Node JS wrapper for the Transport for London API", | ||
@@ -13,3 +13,3 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"build-docs": "typedoc --options", | ||
"build-docs": "typedoc", | ||
"watch": "tsc-watch --onSuccess \"node dist/index.js\"", | ||
@@ -27,3 +27,3 @@ "prettier": "prettier --write ./**/*.ts" | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"axios": "^0.21.2", | ||
"fast-xml-parser": "^3.19.0", | ||
@@ -35,3 +35,2 @@ "humps": "^2.0.1", | ||
"devDependencies": { | ||
"@types/axios": "^0.14.0", | ||
"@types/humps": "^2.0.0", | ||
@@ -41,5 +40,6 @@ "@types/node": "^16.7.13", | ||
"tsc-watch": "^4.2.9", | ||
"typedoc": "^0.20.14", | ||
"typedoc-theme-dark": "0.0.5", | ||
"typescript": "^4.3.5" | ||
"typedoc": "^0.22.10", | ||
"typedoc-default-themes-dark": "^0.12.10", | ||
"typedoc-theme-dark": "^0.0.5", | ||
"typescript": "^4.4.2" | ||
}, | ||
@@ -46,0 +46,0 @@ "directories": { |
@@ -49,3 +49,3 @@ | ||
}; | ||
const line = new StopPoint(config) | ||
const stopPoint = new StopPoint(config) | ||
``` | ||
@@ -52,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
205775
93
5981
Updatedaxios@^0.21.2