Comparing version 3.0.2 to 3.0.3
{ | ||
"name": "amtrak", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "A simple and easy way to parse data from Amtrak's train tracking API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,19 +5,28 @@ import * as AmtrakerTypes from "./types"; | ||
const fetchTrain = async (trainId: string) => { | ||
return axios.get(`https://api-v3.amtraker.com/v3/trains/${trainId}`); | ||
const res = await axios.get( | ||
`https://api-v3.amtraker.com/v3/trains/${trainId}` | ||
); | ||
return res.data as AmtrakerTypes.TrainResponse; | ||
}; | ||
const fetchAllTrains = async () => { | ||
return axios.get("https://api-v3.amtraker.com/v3/trains"); | ||
const res = await axios.get("https://api-v3.amtraker.com/v3/trains"); | ||
return res.data as AmtrakerTypes.TrainResponse; | ||
}; | ||
const fetchStation = async (stationId: string) => { | ||
return axios.get(`https://api-v3.amtraker.com/v3/stations/${stationId}`); | ||
const res = await axios.get( | ||
`https://api-v3.amtraker.com/v3/stations/${stationId}` | ||
); | ||
return res.data as AmtrakerTypes.StationResponse; | ||
}; | ||
const fetchAllStations = async () => { | ||
return axios.get("https://api-v3.amtraker.com/v3/stations"); | ||
const res = await axios.get("https://api-v3.amtraker.com/v3/stations"); | ||
return res.data as AmtrakerTypes.StationResponse; | ||
}; | ||
const fetchStaleStatus = async () => { | ||
return axios.get("https://api-v3.amtraker.com/v3/stale"); | ||
const res = await axios.get("https://api-v3.amtraker.com/v3/stale"); | ||
return res.data as AmtrakerTypes.StaleData; | ||
}; | ||
@@ -24,0 +33,0 @@ |
70085
639