Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ deployments.
The hosted API also provides regional methods for PATH, NJ Transit Rail, NYC
Ferry, Citi Bike, LIRR, Metro-North, MBTA, BART, King County Metro, CapMetro,
Pace, Tri-Rail, Brightline, Denver RTD, Metro Transit, Pittsburgh Regional
Transit, MARTA, VIA, GCRTA, CATS, SacRT, MARC, UTA, JTA, Bay Wheels, Divvy,
Bluebikes, Capital Bikeshare, Biketown, Indego, and Metro Bike Share:
Transit, MARTA, VIA, GCRTA, CATS, SacRT, MARC, UTA, JTA, Muni, Caltrain, Bay
Wheels, Divvy, Bluebikes, Capital Bikeshare, Biketown, Indego, and Metro Bike
Share:

```js
const pathArrivals = await mta.path.arrivals({ station: "JSQ", direction: "to-ny" });
Expand All @@ -116,6 +117,11 @@ const metroNorthDepartures = await mta.metroNorth.departures({
limit: 5,
});
const rtdRoutes = await mta.rtd.routes();
const muniRoutes = await mta.muni.routes();
const caltrainDepartures = await mta.caltrain.departures({
stop: "San Francisco Caltrain Station",
limit: 5,
});
const divvyStations = await mta.divvy.stations({
lat: 41.88,
lon: -87.63,
Expand Down
2 changes: 2 additions & 0 deletions index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ test("hosted new commuter rail clients use exact URLs", async () => {
[mta.marc, "marc"],
[mta.uta, "uta"],
[mta.jta, "jta"],
[mta.muni, "muni"],
[mta.caltrain, "caltrain"],
] as const;

for (const [client] of clients) {
Expand Down
4 changes: 4 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export class MTA {
readonly marc: CommuterRailClient;
readonly uta: CommuterRailClient;
readonly jta: CommuterRailClient;
readonly muni: CommuterRailClient;
readonly caltrain: CommuterRailClient;
readonly alerts: AlertsClient;
readonly stops: StopsClient;
readonly routes: RoutesClient;
Expand Down Expand Up @@ -173,6 +175,8 @@ export class MTA {
this.marc = new CommuterRailClient(this, "/api/v1/marc");
this.uta = new CommuterRailClient(this, "/api/v1/uta");
this.jta = new CommuterRailClient(this, "/api/v1/jta");
this.muni = new CommuterRailClient(this, "/api/v1/muni");
this.caltrain = new CommuterRailClient(this, "/api/v1/caltrain");
this.alerts = new AlertsClient(this);
this.stops = new StopsClient(this);
this.routes = new RoutesClient(this);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mta-js",
"version": "2.6.0",
"version": "2.7.0",
"description": "A TypeScript client for MTA realtime feeds and the hosted MTA API.",
"license": "MIT",
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ export type CommuterRailMode =
| "sacrt"
| "marc"
| "uta"
| "jta";
| "jta"
| "muni"
| "caltrain";
export type HostedArrivalDirection = "north" | "south" | "east" | "west" | "unknown" | "uptown" | "downtown";

export interface PathStation {
Expand Down
Loading