diff --git a/README.md b/README.md index d101039..8a98436 100644 --- a/README.md +++ b/README.md @@ -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" }); @@ -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, diff --git a/index.test.ts b/index.test.ts index c7f0be4..a082fc5 100644 --- a/index.test.ts +++ b/index.test.ts @@ -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) { diff --git a/index.ts b/index.ts index 6c302e0..556a68a 100644 --- a/index.ts +++ b/index.ts @@ -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; @@ -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); diff --git a/package.json b/package.json index ce6fed0..95d64db 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/types.ts b/src/types.ts index f600ee1..1b42763 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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 {