tfl-api-wrapper
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -16,2 +16,3 @@ import AirQuality from './lib/airQuality'; | ||
import Modes from './lib/enums/modes'; | ||
import './lib/trackerNet'; | ||
export { AirQuality, AccidentStats, BikePoint, Crowding, Disruptions, Journey, Line, Mode, Occupancy, Road, StopPoint, TrackerNet, TrackerNetLines, TrackerNetStations, Modes }; |
@@ -28,1 +28,2 @@ "use strict"; | ||
exports.TrackerNet = trackerNet_1.default; | ||
require("./lib/trackerNet"); |
@@ -42,4 +42,3 @@ "use strict"; | ||
var xmlparser = require("fast-xml-parser"); | ||
// @ts-ignore | ||
var trackernet_xml_retag_1 = require("trackernet-xml-retag"); | ||
var trackerNetRetag_1 = require("./utilities/trackerNetRetag"); | ||
var TfLAPI = /** @class */ (function () { | ||
@@ -95,4 +94,5 @@ function TfLAPI(appKey) { | ||
xmlData = fetch.data; | ||
// console.log(xmlData); | ||
if (reTag) | ||
xmlData = trackernet_xml_retag_1.retag.trackerNetRetag(xmlData); | ||
xmlData = (0, trackerNetRetag_1.trackerNetRetag)(xmlData); | ||
jsonObj = xmlparser.parse(xmlData, { | ||
@@ -99,0 +99,0 @@ attributeNamePrefix: '', |
@@ -5,2 +5,3 @@ import TfLAPI from './tfl'; | ||
import TrackerNetStations from './enums/trackerNet/stations'; | ||
declare type ValueOf<T> = T[keyof T]; | ||
export default class TrackerNet extends TfLAPI { | ||
@@ -12,3 +13,3 @@ constructor(config: string); | ||
*/ | ||
getPredictionSummary(line: TrackerNetLines): Promise<ITrackerNet.getPredictionSummary.Root>; | ||
getPredictionSummary(line: TrackerNetLines | ValueOf<TrackerNetLines>): Promise<ITrackerNet.getPredictionSummary.Root>; | ||
/** | ||
@@ -19,3 +20,3 @@ * Get detailed train prediction information for a nominated station on a nominated line within 100 minute range. | ||
*/ | ||
getPredictionDetailed(line: TrackerNetLines, stationCode: TrackerNetStations): Promise<ITrackerNet.getPredictionDetailed.Root>; | ||
getPredictionDetailed(line: TrackerNetLines | ValueOf<TrackerNetLines>, stationCode: TrackerNetStations | ValueOf<TrackerNetStations>): Promise<ITrackerNet.getPredictionDetailed.Root>; | ||
/** | ||
@@ -32,1 +33,2 @@ * Get the status of all lines on the network indicating any delays, disruptions or suspensions on the lines. | ||
} | ||
export {}; |
@@ -156,1 +156,7 @@ "use strict"; | ||
exports.default = TrackerNet; | ||
var x = new TrackerNet(''); | ||
x.getPredictionDetailed('C', 'BNK').then(function (res) { | ||
// console.log(res.station.platform[0]); | ||
console.log(JSON.stringify(res)); | ||
console.log('Complete'); | ||
}); |
{ | ||
"name": "tfl-api-wrapper", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "A Node JS wrapper for the Transport for London API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
170694
63
4382