fix: add direction#7
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
StopandNearbyStopto 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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