Comparing version 3.0.3 to 3.0.4
@@ -1,7 +0,8 @@ | ||
declare const fetchTrain: (trainId: string) => Promise<import("axios").AxiosResponse<any, any>>; | ||
declare const fetchAllTrains: () => Promise<import("axios").AxiosResponse<any, any>>; | ||
declare const fetchStation: (stationId: string) => Promise<import("axios").AxiosResponse<any, any>>; | ||
declare const fetchAllStations: () => Promise<import("axios").AxiosResponse<any, any>>; | ||
declare const fetchStaleStatus: () => Promise<import("axios").AxiosResponse<any, any>>; | ||
import * as AmtrakerTypes from "./types"; | ||
declare const fetchTrain: (trainId: string) => Promise<AmtrakerTypes.TrainResponse>; | ||
declare const fetchAllTrains: () => Promise<AmtrakerTypes.TrainResponse>; | ||
declare const fetchStation: (stationId: string) => Promise<AmtrakerTypes.StationResponse>; | ||
declare const fetchAllStations: () => Promise<AmtrakerTypes.StationResponse>; | ||
declare const fetchStaleStatus: () => Promise<AmtrakerTypes.StaleData>; | ||
export { fetchTrain, fetchAllTrains, fetchStation, fetchAllStations, fetchStaleStatus, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,21 +6,26 @@ "use strict"; | ||
const fetchTrain = async (trainId) => { | ||
return axios_1.default.get(`https://api-v3.amtraker.com/v3/trains/${trainId}`); | ||
const res = await axios_1.default.get(`https://api-v3.amtraker.com/v3/trains/${trainId}`); | ||
return res.data; | ||
}; | ||
exports.fetchTrain = fetchTrain; | ||
const fetchAllTrains = async () => { | ||
return axios_1.default.get("https://api-v3.amtraker.com/v3/trains"); | ||
const res = await axios_1.default.get("https://api-v3.amtraker.com/v3/trains"); | ||
return res.data; | ||
}; | ||
exports.fetchAllTrains = fetchAllTrains; | ||
const fetchStation = async (stationId) => { | ||
return axios_1.default.get(`https://api-v3.amtraker.com/v3/stations/${stationId}`); | ||
const res = await axios_1.default.get(`https://api-v3.amtraker.com/v3/stations/${stationId}`); | ||
return res.data; | ||
}; | ||
exports.fetchStation = fetchStation; | ||
const fetchAllStations = async () => { | ||
return axios_1.default.get("https://api-v3.amtraker.com/v3/stations"); | ||
const res = await axios_1.default.get("https://api-v3.amtraker.com/v3/stations"); | ||
return res.data; | ||
}; | ||
exports.fetchAllStations = fetchAllStations; | ||
const fetchStaleStatus = async () => { | ||
return axios_1.default.get("https://api-v3.amtraker.com/v3/stale"); | ||
const res = await axios_1.default.get("https://api-v3.amtraker.com/v3/stale"); | ||
return res.data; | ||
}; | ||
exports.fetchStaleStatus = fetchStaleStatus; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "amtrak", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "A simple and easy way to parse data from Amtrak's train tracking API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
2
56855
15
329