Skip to content

fix: add direction#7

Merged
gtokman merged 2 commits into
mainfrom
gary/api-improvements
May 27, 2026
Merged

fix: add direction#7
gtokman merged 2 commits into
mainfrom
gary/api-improvements

Conversation

@gtokman
Copy link
Copy Markdown
Contributor

@gtokman gtokman commented May 27, 2026

Added SDK support for the service contract:

mta.subway.direction({ route, fromStopId, destination })
new exported types: SubwayDirectionQuery, SubwayDirectionResolution, SubwayResolvedDirection
typed Stop.displayName, Stop.parentId
typed nearby servedRoutes[].headsigns, servedRoutes[].directionHeadsigns, routeHeadsigns, and top-level directionHeadsigns

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new hosted-API backed SDK endpoint for resolving rider-entered subway destinations into a concrete travel direction and related stop metadata, and extends existing response typings to include additional display/headsign fields.

Changes:

  • Add mta.subway.direction({ route, fromStopId, destination }) client method and related exported types (SubwayDirectionQuery, SubwayDirectionResolution, SubwayResolvedDirection).
  • Extend typings for Stop and NearbyStop to include additional display/parent/headsign-related fields.
  • Update docs and tests to cover the new direction endpoint; bump package version to 2.2.0.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Adds new direction-resolution types and expands stop/nearby-stop related typings.
index.ts Implements subway.direction(...) method calling hosted API endpoint.
index.test.ts Adds unit test for the new hosted direction call + response typing.
hosted-integration.test.ts Extends hosted integration test to exercise the new endpoint.
README.md Documents subway.direction(...) and updates example output formatting.
package.json Version bump to reflect new feature/types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gtokman gtokman merged commit 036ce2a into main May 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants