From e4d12d7f7b2ca39ada2f12504de2d3b1a6d23c23 Mon Sep 17 00:00:00 2001 From: Gary Tokman Date: Mon, 25 May 2026 20:23:26 -0400 Subject: [PATCH 1/4] Add hosted API smoke test --- hosted-api.integration.test.ts | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 hosted-api.integration.test.ts diff --git a/hosted-api.integration.test.ts b/hosted-api.integration.test.ts new file mode 100644 index 0000000..8b6a6e9 --- /dev/null +++ b/hosted-api.integration.test.ts @@ -0,0 +1,36 @@ +import { describe, expect, test } from "bun:test"; +import { MTA } from "./index"; + +const apiKey = process.env.MTA_API_KEY; + +describe.skipIf(!apiKey)("hosted API consumer smoke", () => { + test("runs the docs quickstart against the hosted API", async () => { + const mta = new MTA({ + apiKey, + }); + + const arrivals = await mta.subway.arrivals({ + stopId: "A27", + route: "A", + }); + + const stops = await mta.stops.near({ + lat: 40.7356, + lon: -73.9804, + modes: ["subway", "bus"], + route: "M23", + limit: 10, + }); + + const vehicles = await mta.bus.vehicles({ + route: "M23", + limit: 5, + }); + + expect(Array.isArray(arrivals)).toBe(true); + expect(Array.isArray(stops)).toBe(true); + expect(Array.isArray(vehicles)).toBe(true); + expect(stops.length).toBeGreaterThan(0); + expect(stops.every((stop) => stop.routeMatch)).toBe(true); + }, 30_000); +}); From c243f273199ab23a8a8e92018c09aacdc502e7f6 Mon Sep 17 00:00:00 2001 From: Gary Tokman Date: Mon, 25 May 2026 20:23:38 -0400 Subject: [PATCH 2/4] Add hosted API integration workflow --- .github/workflows/hosted-api-integration.yml | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/hosted-api-integration.yml diff --git a/.github/workflows/hosted-api-integration.yml b/.github/workflows/hosted-api-integration.yml new file mode 100644 index 0000000..7147bb7 --- /dev/null +++ b/.github/workflows/hosted-api-integration.yml @@ -0,0 +1,21 @@ +name: Hosted API integration + +on: + pull_request: + workflow_dispatch: + +jobs: + hosted-api-smoke: + runs-on: ubuntu-latest + env: + MTA_API_KEY: ${{ secrets.MTA_API_KEY }} + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - run: bun install --frozen-lockfile + + - run: bun test hosted-api.integration.test.ts From 5b4cfc806f75bb515d82e1ddb80e4eef76b06273 Mon Sep 17 00:00:00 2001 From: Gary Tokman Date: Mon, 25 May 2026 20:35:38 -0400 Subject: [PATCH 3/4] Add multi-agency roadmap --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0726f2a..5cb5faf 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,14 @@ mta.static.importSeed( ); ``` +## Roadmap + +- Expand the package beyond NYC MTA into a normalized US metro SDK while keeping the existing MTA API stable. +- Prioritize large systems with documented APIs and realtime data first: MBTA (Boston), WMATA (DC), CTA (Chicago), and BART (Bay Area). +- Add adapters for mid-tier systems that expose GTFS, GTFS Realtime, or partial APIs, including SEPTA, LA Metro, and MARTA. +- Model agency-specific quirks behind shared concepts like arrivals, vehicles, service alerts, route-aware nearby stops, static GTFS import, and hosted API access. +- Track smaller agencies separately because support quality varies: some only publish static GTFS, some have buried realtime feeds, and some have no public API surface. + ## Development ```sh From 04e10e12985cd3d4c2438d5025ea78846c7819ea Mon Sep 17 00:00:00 2001 From: Gary Tokman Date: Mon, 25 May 2026 21:14:06 -0400 Subject: [PATCH 4/4] fix: update name --- ...ted-api-integration.yml => hosted-integration-tests.yml} | 6 +++--- ...ed-api.integration.test.ts => hosted-integration.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{hosted-api-integration.yml => hosted-integration-tests.yml} (73%) rename hosted-api.integration.test.ts => hosted-integration.test.ts (93%) diff --git a/.github/workflows/hosted-api-integration.yml b/.github/workflows/hosted-integration-tests.yml similarity index 73% rename from .github/workflows/hosted-api-integration.yml rename to .github/workflows/hosted-integration-tests.yml index 7147bb7..8408ddf 100644 --- a/.github/workflows/hosted-api-integration.yml +++ b/.github/workflows/hosted-integration-tests.yml @@ -1,11 +1,11 @@ -name: Hosted API integration +name: Hosted integration tests on: pull_request: workflow_dispatch: jobs: - hosted-api-smoke: + hosted-integration-tests: runs-on: ubuntu-latest env: MTA_API_KEY: ${{ secrets.MTA_API_KEY }} @@ -18,4 +18,4 @@ jobs: - run: bun install --frozen-lockfile - - run: bun test hosted-api.integration.test.ts + - run: bun test hosted-integration.test.ts diff --git a/hosted-api.integration.test.ts b/hosted-integration.test.ts similarity index 93% rename from hosted-api.integration.test.ts rename to hosted-integration.test.ts index 8b6a6e9..8f8349f 100644 --- a/hosted-api.integration.test.ts +++ b/hosted-integration.test.ts @@ -3,7 +3,7 @@ import { MTA } from "./index"; const apiKey = process.env.MTA_API_KEY; -describe.skipIf(!apiKey)("hosted API consumer smoke", () => { +describe.skipIf(!apiKey)("hosted integration tests", () => { test("runs the docs quickstart against the hosted API", async () => { const mta = new MTA({ apiKey,