Skip to content

Update mta-js methods and types for hosted endpoint expansion #9

@gtokman

Description

@gtokman

Goal

Update mta-js after the hosted endpoint expansion lands in HumanInterfaceDesign/mta-api, so SDK users get typed methods and response shapes for every new endpoint.

Proposed SDK surface

await mta.subway.arrivalBoard({ lat, lon, limitStations: 5, limitArrivals: 3 })
await mta.bus.arrivalBoard({ lat, lon, route: "M23", limitStops: 8, limitArrivals: 3 })

await mta.stops.byIds({ ids: ["A27", "L06", "308214"], includeRoutes: true })
await mta.routes.list({ modes: ["subway", "bus"] })

await mta.subway.routeStations({
  route: "L",
  direction: "uptown",
  includeArrivals: false,
})
await mta.bus.routeStops({
  route: "M23",
  direction: 0,
  includeArrivals: false,
})

Type work

  • Add request types for arrival boards, stop batch lookup, route catalog, subway route stations, and bus route stops.
  • Add response types matching the hosted API OpenAPI contract.
  • Include limitStops on route-stops/stations hydration calls.
  • Keep subway station terminology and bus stop terminology distinct.

Acceptance criteria

  • Add methods to the relevant SDK clients.
  • Add request/response types in src/types.ts.
  • Add hosted API tests using mocked fetch responses.
  • Update README endpoint list and examples.

Depends on HumanInterfaceDesign/mta-api PR #23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions