@tiducto/spider-sdk-typescript 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/contract/routing/AccessibilityPreferencesInput.d.ts +1 -0
- package/dist/contract/routing/AccessibilityPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/AlightPreferencesInput.d.ts +2 -0
- package/dist/contract/routing/AlightPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/BoardPreferencesInput.d.ts +4 -1
- package/dist/contract/routing/BoardPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/{StopDeparturesStop2.d.ts → DepartureBoard.d.ts} +4 -2
- package/dist/contract/routing/DepartureBoard.d.ts.map +1 -0
- package/dist/contract/routing/DepartureBoard.js +2 -0
- package/dist/contract/routing/DepartureBoard.js.map +1 -0
- package/dist/contract/routing/DeparturesRequest.d.ts +12 -0
- package/dist/contract/routing/DeparturesRequest.d.ts.map +1 -0
- package/dist/contract/routing/DeparturesRequest.js +2 -0
- package/dist/contract/routing/DeparturesRequest.js.map +1 -0
- package/dist/contract/routing/DeparturesResponse.d.ts +6 -0
- package/dist/contract/routing/DeparturesResponse.d.ts.map +1 -0
- package/dist/contract/routing/DeparturesResponse.js +2 -0
- package/dist/contract/routing/DeparturesResponse.js.map +1 -0
- package/dist/contract/routing/ErrorResponse.d.ts +4 -1
- package/dist/contract/routing/ErrorResponse.d.ts.map +1 -1
- package/dist/contract/routing/Geometry.d.ts +1 -0
- package/dist/contract/routing/Geometry.d.ts.map +1 -1
- package/dist/contract/routing/Itinerary.d.ts +4 -1
- package/dist/contract/routing/Itinerary.d.ts.map +1 -1
- package/dist/contract/routing/Leg.d.ts +11 -1
- package/dist/contract/routing/Leg.d.ts.map +1 -1
- package/dist/contract/routing/LegTime.d.ts +1 -0
- package/dist/contract/routing/LegTime.d.ts.map +1 -1
- package/dist/contract/routing/Place.d.ts +1 -0
- package/dist/contract/routing/Place.d.ts.map +1 -1
- package/dist/contract/routing/PlanCoordinateInput.d.ts +3 -0
- package/dist/contract/routing/PlanCoordinateInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanDateTimeInput.d.ts +3 -0
- package/dist/contract/routing/PlanDateTimeInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanLabeledLocationInput.d.ts +1 -1
- package/dist/contract/routing/PlanLabeledLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanLocationInput.d.ts +3 -0
- package/dist/contract/routing/PlanLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanModesInput.d.ts +4 -3
- package/dist/contract/routing/PlanModesInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanPageInfo.d.ts +3 -0
- package/dist/contract/routing/PlanPageInfo.d.ts.map +1 -1
- package/dist/contract/routing/PlanPassThroughViaLocationInput.d.ts +2 -1
- package/dist/contract/routing/PlanPassThroughViaLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanPreferencesInput.d.ts +2 -1
- package/dist/contract/routing/PlanPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanStopLocationInput.d.ts +2 -0
- package/dist/contract/routing/PlanStopLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanStreamChunkEvent.d.ts +13 -0
- package/dist/contract/routing/PlanStreamChunkEvent.d.ts.map +1 -0
- package/dist/contract/routing/PlanStreamChunkEvent.js +2 -0
- package/dist/contract/routing/PlanStreamChunkEvent.js.map +1 -0
- package/dist/contract/routing/PlanStreamDoneEvent.d.ts +12 -0
- package/dist/contract/routing/PlanStreamDoneEvent.d.ts.map +1 -0
- package/dist/contract/routing/PlanStreamDoneEvent.js +2 -0
- package/dist/contract/routing/PlanStreamDoneEvent.js.map +1 -0
- package/dist/contract/routing/PlanStreamPageInfoEvent.d.ts +15 -0
- package/dist/contract/routing/PlanStreamPageInfoEvent.d.ts.map +1 -0
- package/dist/contract/routing/PlanStreamPageInfoEvent.js +2 -0
- package/dist/contract/routing/PlanStreamPageInfoEvent.js.map +1 -0
- package/dist/contract/routing/PlanStreamRequest.d.ts +29 -0
- package/dist/contract/routing/PlanStreamRequest.d.ts.map +1 -0
- package/dist/contract/routing/PlanStreamRequest.js +2 -0
- package/dist/contract/routing/PlanStreamRequest.js.map +1 -0
- package/dist/contract/routing/PlanStreetPreferencesInput.d.ts +1 -6
- package/dist/contract/routing/PlanStreetPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanTransitModePreferenceInput.d.ts +2 -1
- package/dist/contract/routing/PlanTransitModePreferenceInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanTransitModesInput.d.ts +2 -6
- package/dist/contract/routing/PlanTransitModesInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanTripRequest.d.ts +31 -0
- package/dist/contract/routing/PlanTripRequest.d.ts.map +1 -0
- package/dist/contract/routing/PlanTripRequest.js +2 -0
- package/dist/contract/routing/PlanTripRequest.js.map +1 -0
- package/dist/contract/routing/PlanTripResponse.d.ts +13 -0
- package/dist/contract/routing/PlanTripResponse.d.ts.map +1 -0
- package/dist/contract/routing/PlanTripResponse.js +2 -0
- package/dist/contract/routing/PlanTripResponse.js.map +1 -0
- package/dist/contract/routing/PlanViaLocationInput.d.ts +3 -0
- package/dist/contract/routing/PlanViaLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/PlanVisitViaLocationInput.d.ts +4 -4
- package/dist/contract/routing/PlanVisitViaLocationInput.d.ts.map +1 -1
- package/dist/contract/routing/RealTimeEstimate.d.ts +1 -0
- package/dist/contract/routing/RealTimeEstimate.d.ts.map +1 -1
- package/dist/contract/routing/Reliability.d.ts +3 -0
- package/dist/contract/routing/Reliability.d.ts.map +1 -0
- package/dist/contract/routing/Reliability.js +2 -0
- package/dist/contract/routing/Reliability.js.map +1 -0
- package/dist/contract/routing/Route.d.ts +2 -0
- package/dist/contract/routing/Route.d.ts.map +1 -1
- package/dist/contract/routing/RoutingError.d.ts +2 -0
- package/dist/contract/routing/RoutingError.d.ts.map +1 -1
- package/dist/contract/routing/Stop.d.ts +2 -0
- package/dist/contract/routing/Stop.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesRoute.d.ts +2 -0
- package/dist/contract/routing/StopDeparturesRoute.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesStop.d.ts +1 -0
- package/dist/contract/routing/StopDeparturesStop.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesStoptime.d.ts +7 -0
- package/dist/contract/routing/StopDeparturesStoptime.d.ts.map +1 -1
- package/dist/contract/routing/Stoptime.d.ts +8 -0
- package/dist/contract/routing/Stoptime.d.ts.map +1 -1
- package/dist/contract/routing/TransferPreferencesInput.d.ts +5 -2
- package/dist/contract/routing/TransferPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/TransitFilterInput.d.ts +2 -1
- package/dist/contract/routing/TransitFilterInput.d.ts.map +1 -1
- package/dist/contract/routing/TransitFilterSelectInput.d.ts +4 -1
- package/dist/contract/routing/TransitFilterSelectInput.d.ts.map +1 -1
- package/dist/contract/routing/TransitModePreferenceCostInput.d.ts +2 -0
- package/dist/contract/routing/TransitModePreferenceCostInput.d.ts.map +1 -1
- package/dist/contract/routing/TransitPreferencesInput.d.ts +4 -4
- package/dist/contract/routing/TransitPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/TripGeometry.d.ts +2 -0
- package/dist/contract/routing/TripGeometry.d.ts.map +1 -1
- package/dist/contract/routing/TripRequest.d.ts +8 -0
- package/dist/contract/routing/TripRequest.d.ts.map +1 -0
- package/dist/contract/routing/TripRequest.js +2 -0
- package/dist/contract/routing/TripRequest.js.map +1 -0
- package/dist/contract/routing/TripResponse.d.ts +3 -4
- package/dist/contract/routing/TripResponse.d.ts.map +1 -1
- package/dist/contract/routing/TripRoute.d.ts +2 -0
- package/dist/contract/routing/TripRoute.d.ts.map +1 -1
- package/dist/contract/routing/TripStop.d.ts +2 -0
- package/dist/contract/routing/TripStop.d.ts.map +1 -1
- package/dist/contract/routing/{TripTrip.d.ts → TripTimetable.d.ts} +4 -2
- package/dist/contract/routing/TripTimetable.d.ts.map +1 -0
- package/dist/contract/routing/TripTimetable.js +2 -0
- package/dist/contract/routing/TripTimetable.js.map +1 -0
- package/dist/contract/routing/WalkPreferencesInput.d.ts +6 -3
- package/dist/contract/routing/WalkPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/WheelchairPreferencesInput.d.ts +2 -0
- package/dist/contract/routing/WheelchairPreferencesInput.d.ts.map +1 -1
- package/dist/contract/routing/index.d.ts +12 -41
- package/dist/contract/routing/index.d.ts.map +1 -1
- package/dist/contractVersion.d.ts +1 -1
- package/dist/contractVersion.js +1 -1
- package/dist/enums.d.ts +2 -0
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js.map +1 -1
- package/dist/errors.d.ts +7 -16
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -17
- package/dist/errors.js.map +1 -1
- package/dist/http.d.ts +2 -29
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +5 -37
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/location.d.ts +4 -2
- package/dist/location.d.ts.map +1 -1
- package/dist/location.js +4 -2
- package/dist/location.js.map +1 -1
- package/dist/realtime.js +4 -4
- package/dist/realtime.js.map +1 -1
- package/dist/routing.d.ts +18 -3
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +61 -90
- package/dist/routing.js.map +1 -1
- package/dist/sdk.d.ts +1 -1
- package/dist/sdkVersion.d.ts +1 -1
- package/dist/sdkVersion.js +1 -1
- package/dist/stops.js +2 -2
- package/dist/stops.js.map +1 -1
- package/package.json +1 -1
- package/dist/contract/routing/BicycleParkingPreferencesInput.d.ts +0 -7
- package/dist/contract/routing/BicycleParkingPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/BicycleParkingPreferencesInput.js +0 -2
- package/dist/contract/routing/BicycleParkingPreferencesInput.js.map +0 -1
- package/dist/contract/routing/BicyclePreferencesInput.d.ts +0 -14
- package/dist/contract/routing/BicyclePreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/BicyclePreferencesInput.js +0 -2
- package/dist/contract/routing/BicyclePreferencesInput.js.map +0 -1
- package/dist/contract/routing/BicycleRentalPreferencesInput.d.ts +0 -7
- package/dist/contract/routing/BicycleRentalPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/BicycleRentalPreferencesInput.js +0 -2
- package/dist/contract/routing/BicycleRentalPreferencesInput.js.map +0 -1
- package/dist/contract/routing/BicycleWalkPreferencesCostInput.d.ts +0 -5
- package/dist/contract/routing/BicycleWalkPreferencesCostInput.d.ts.map +0 -1
- package/dist/contract/routing/BicycleWalkPreferencesCostInput.js +0 -2
- package/dist/contract/routing/BicycleWalkPreferencesCostInput.js.map +0 -1
- package/dist/contract/routing/BicycleWalkPreferencesInput.d.ts +0 -7
- package/dist/contract/routing/BicycleWalkPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/BicycleWalkPreferencesInput.js +0 -2
- package/dist/contract/routing/BicycleWalkPreferencesInput.js.map +0 -1
- package/dist/contract/routing/CarParkingPreferencesInput.d.ts +0 -7
- package/dist/contract/routing/CarParkingPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/CarParkingPreferencesInput.js +0 -2
- package/dist/contract/routing/CarParkingPreferencesInput.js.map +0 -1
- package/dist/contract/routing/CarPreferencesInput.d.ts +0 -9
- package/dist/contract/routing/CarPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/CarPreferencesInput.js +0 -2
- package/dist/contract/routing/CarPreferencesInput.js.map +0 -1
- package/dist/contract/routing/CarRentalPreferencesInput.d.ts +0 -6
- package/dist/contract/routing/CarRentalPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/CarRentalPreferencesInput.js +0 -2
- package/dist/contract/routing/CarRentalPreferencesInput.js.map +0 -1
- package/dist/contract/routing/CyclingOptimizationInput.d.ts +0 -7
- package/dist/contract/routing/CyclingOptimizationInput.d.ts.map +0 -1
- package/dist/contract/routing/CyclingOptimizationInput.js +0 -2
- package/dist/contract/routing/CyclingOptimizationInput.js.map +0 -1
- package/dist/contract/routing/CyclingOptimizationType.d.ts +0 -2
- package/dist/contract/routing/CyclingOptimizationType.d.ts.map +0 -1
- package/dist/contract/routing/CyclingOptimizationType.js +0 -2
- package/dist/contract/routing/CyclingOptimizationType.js.map +0 -1
- package/dist/contract/routing/DestinationBicyclePolicyInput.d.ts +0 -5
- package/dist/contract/routing/DestinationBicyclePolicyInput.d.ts.map +0 -1
- package/dist/contract/routing/DestinationBicyclePolicyInput.js +0 -2
- package/dist/contract/routing/DestinationBicyclePolicyInput.js.map +0 -1
- package/dist/contract/routing/DestinationScooterPolicyInput.d.ts +0 -5
- package/dist/contract/routing/DestinationScooterPolicyInput.d.ts.map +0 -1
- package/dist/contract/routing/DestinationScooterPolicyInput.js +0 -2
- package/dist/contract/routing/DestinationScooterPolicyInput.js.map +0 -1
- package/dist/contract/routing/GraphQLError.d.ts +0 -5
- package/dist/contract/routing/GraphQLError.d.ts.map +0 -1
- package/dist/contract/routing/GraphQLError.js +0 -2
- package/dist/contract/routing/GraphQLError.js.map +0 -1
- package/dist/contract/routing/ParkingFilter.d.ts +0 -6
- package/dist/contract/routing/ParkingFilter.d.ts.map +0 -1
- package/dist/contract/routing/ParkingFilter.js +0 -2
- package/dist/contract/routing/ParkingFilter.js.map +0 -1
- package/dist/contract/routing/ParkingFilterOperation.d.ts +0 -4
- package/dist/contract/routing/ParkingFilterOperation.d.ts.map +0 -1
- package/dist/contract/routing/ParkingFilterOperation.js +0 -2
- package/dist/contract/routing/ParkingFilterOperation.js.map +0 -1
- package/dist/contract/routing/PlanAccessMode.d.ts +0 -2
- package/dist/contract/routing/PlanAccessMode.d.ts.map +0 -1
- package/dist/contract/routing/PlanAccessMode.js +0 -2
- package/dist/contract/routing/PlanAccessMode.js.map +0 -1
- package/dist/contract/routing/PlanConnection.d.ts +0 -10
- package/dist/contract/routing/PlanConnection.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnection.js +0 -2
- package/dist/contract/routing/PlanConnection.js.map +0 -1
- package/dist/contract/routing/PlanConnectionData.d.ts +0 -5
- package/dist/contract/routing/PlanConnectionData.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionData.js +0 -2
- package/dist/contract/routing/PlanConnectionData.js.map +0 -1
- package/dist/contract/routing/PlanConnectionResponse.d.ts +0 -7
- package/dist/contract/routing/PlanConnectionResponse.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionResponse.js +0 -2
- package/dist/contract/routing/PlanConnectionResponse.js.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamData.d.ts +0 -5
- package/dist/contract/routing/PlanConnectionStreamData.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamData.js +0 -2
- package/dist/contract/routing/PlanConnectionStreamData.js.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamResponse.d.ts +0 -7
- package/dist/contract/routing/PlanConnectionStreamResponse.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamResponse.js +0 -2
- package/dist/contract/routing/PlanConnectionStreamResponse.js.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamVariables.d.ts +0 -18
- package/dist/contract/routing/PlanConnectionStreamVariables.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionStreamVariables.js +0 -2
- package/dist/contract/routing/PlanConnectionStreamVariables.js.map +0 -1
- package/dist/contract/routing/PlanConnectionVariables.d.ts +0 -17
- package/dist/contract/routing/PlanConnectionVariables.d.ts.map +0 -1
- package/dist/contract/routing/PlanConnectionVariables.js +0 -2
- package/dist/contract/routing/PlanConnectionVariables.js.map +0 -1
- package/dist/contract/routing/PlanDirectMode.d.ts +0 -2
- package/dist/contract/routing/PlanDirectMode.d.ts.map +0 -1
- package/dist/contract/routing/PlanDirectMode.js +0 -2
- package/dist/contract/routing/PlanDirectMode.js.map +0 -1
- package/dist/contract/routing/PlanEdge.d.ts +0 -6
- package/dist/contract/routing/PlanEdge.d.ts.map +0 -1
- package/dist/contract/routing/PlanEdge.js +0 -2
- package/dist/contract/routing/PlanEdge.js.map +0 -1
- package/dist/contract/routing/PlanEgressMode.d.ts +0 -2
- package/dist/contract/routing/PlanEgressMode.d.ts.map +0 -1
- package/dist/contract/routing/PlanEgressMode.js +0 -2
- package/dist/contract/routing/PlanEgressMode.js.map +0 -1
- package/dist/contract/routing/PlanTransferMode.d.ts +0 -2
- package/dist/contract/routing/PlanTransferMode.d.ts.map +0 -1
- package/dist/contract/routing/PlanTransferMode.js +0 -2
- package/dist/contract/routing/PlanTransferMode.js.map +0 -1
- package/dist/contract/routing/ScooterOptimizationInput.d.ts +0 -7
- package/dist/contract/routing/ScooterOptimizationInput.d.ts.map +0 -1
- package/dist/contract/routing/ScooterOptimizationInput.js +0 -2
- package/dist/contract/routing/ScooterOptimizationInput.js.map +0 -1
- package/dist/contract/routing/ScooterOptimizationType.d.ts +0 -2
- package/dist/contract/routing/ScooterOptimizationType.d.ts.map +0 -1
- package/dist/contract/routing/ScooterOptimizationType.js +0 -2
- package/dist/contract/routing/ScooterOptimizationType.js.map +0 -1
- package/dist/contract/routing/ScooterPreferencesInput.d.ts +0 -9
- package/dist/contract/routing/ScooterPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/ScooterPreferencesInput.js +0 -2
- package/dist/contract/routing/ScooterPreferencesInput.js.map +0 -1
- package/dist/contract/routing/ScooterRentalPreferencesInput.d.ts +0 -7
- package/dist/contract/routing/ScooterRentalPreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/ScooterRentalPreferencesInput.js +0 -2
- package/dist/contract/routing/ScooterRentalPreferencesInput.js.map +0 -1
- package/dist/contract/routing/StopDeparturesData.d.ts +0 -6
- package/dist/contract/routing/StopDeparturesData.d.ts.map +0 -1
- package/dist/contract/routing/StopDeparturesData.js +0 -2
- package/dist/contract/routing/StopDeparturesData.js.map +0 -1
- package/dist/contract/routing/StopDeparturesResponse.d.ts +0 -7
- package/dist/contract/routing/StopDeparturesResponse.d.ts.map +0 -1
- package/dist/contract/routing/StopDeparturesResponse.js +0 -2
- package/dist/contract/routing/StopDeparturesResponse.js.map +0 -1
- package/dist/contract/routing/StopDeparturesStop2.d.ts.map +0 -1
- package/dist/contract/routing/StopDeparturesStop2.js +0 -2
- package/dist/contract/routing/StopDeparturesStop2.js.map +0 -1
- package/dist/contract/routing/StopDeparturesVariables.d.ts +0 -7
- package/dist/contract/routing/StopDeparturesVariables.d.ts.map +0 -1
- package/dist/contract/routing/StopDeparturesVariables.js +0 -2
- package/dist/contract/routing/StopDeparturesVariables.js.map +0 -1
- package/dist/contract/routing/TimetablePreferencesInput.d.ts +0 -6
- package/dist/contract/routing/TimetablePreferencesInput.d.ts.map +0 -1
- package/dist/contract/routing/TimetablePreferencesInput.js +0 -2
- package/dist/contract/routing/TimetablePreferencesInput.js.map +0 -1
- package/dist/contract/routing/TriangleCyclingFactorsInput.d.ts +0 -6
- package/dist/contract/routing/TriangleCyclingFactorsInput.d.ts.map +0 -1
- package/dist/contract/routing/TriangleCyclingFactorsInput.js +0 -2
- package/dist/contract/routing/TriangleCyclingFactorsInput.js.map +0 -1
- package/dist/contract/routing/TriangleScooterFactorsInput.d.ts +0 -6
- package/dist/contract/routing/TriangleScooterFactorsInput.d.ts.map +0 -1
- package/dist/contract/routing/TriangleScooterFactorsInput.js +0 -2
- package/dist/contract/routing/TriangleScooterFactorsInput.js.map +0 -1
- package/dist/contract/routing/TripData.d.ts +0 -5
- package/dist/contract/routing/TripData.d.ts.map +0 -1
- package/dist/contract/routing/TripData.js +0 -2
- package/dist/contract/routing/TripData.js.map +0 -1
- package/dist/contract/routing/TripTrip.d.ts.map +0 -1
- package/dist/contract/routing/TripTrip.js +0 -2
- package/dist/contract/routing/TripTrip.js.map +0 -1
- package/dist/contract/routing/TripVariables.d.ts +0 -5
- package/dist/contract/routing/TripVariables.d.ts.map +0 -1
- package/dist/contract/routing/TripVariables.js +0 -2
- package/dist/contract/routing/TripVariables.js.map +0 -1
- package/dist/persistedQueries.d.ts +0 -9
- package/dist/persistedQueries.d.ts.map +0 -1
- package/dist/persistedQueries.js +0 -5
- package/dist/persistedQueries.js.map +0 -1
package/dist/realtime.js
CHANGED
|
@@ -24,7 +24,7 @@ export class SpiderRealtime {
|
|
|
24
24
|
if (tripIds.length > MAX_TRIP_IDS)
|
|
25
25
|
return failure(badRequest('tripIds'));
|
|
26
26
|
try {
|
|
27
|
-
const dto = await this.transport.getJson('/realtime/vehicles', {
|
|
27
|
+
const dto = await this.transport.getJson('/realtime/v1/vehicles', {
|
|
28
28
|
tripIds: tripIds.join(','),
|
|
29
29
|
});
|
|
30
30
|
return success({
|
|
@@ -38,7 +38,7 @@ export class SpiderRealtime {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
async vehicleForTrip(tripId) {
|
|
41
|
-
const path = `/realtime/vehicles/by-trip/${encodeURIComponent(tripId)}`;
|
|
41
|
+
const path = `/realtime/v1/vehicles/by-trip/${encodeURIComponent(tripId)}`;
|
|
42
42
|
try {
|
|
43
43
|
const raw = await this.transport.getRaw(path);
|
|
44
44
|
if (!raw.ok) {
|
|
@@ -76,7 +76,7 @@ export class SpiderRealtime {
|
|
|
76
76
|
return failure(badRequest('tripIds'));
|
|
77
77
|
try {
|
|
78
78
|
const request = { queries };
|
|
79
|
-
const dto = await this.transport.postJson('/realtime/delays', request);
|
|
79
|
+
const dto = await this.transport.postJson('/realtime/v1/delays', request);
|
|
80
80
|
return success({
|
|
81
81
|
groups: (dto.results ?? []).map(mapGroupResult),
|
|
82
82
|
freshness: mapFreshness(dto),
|
|
@@ -88,7 +88,7 @@ export class SpiderRealtime {
|
|
|
88
88
|
}
|
|
89
89
|
async alerts() {
|
|
90
90
|
try {
|
|
91
|
-
const dto = await this.transport.getJson('/realtime/alerts');
|
|
91
|
+
const dto = await this.transport.getJson('/realtime/v1/alerts');
|
|
92
92
|
return success({
|
|
93
93
|
alerts: (dto.alerts ?? []).map(mapAlert),
|
|
94
94
|
freshness: mapFreshness(dto),
|
package/dist/realtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkE/C,sGAAsG;AACtG,MAAM,UAAU,QAAQ,CAAC,MAAkB,EAAE,MAAc,EAAE,WAAmB;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC;IACvE,OAAO,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC;AAChE,CAAC;AA+BD,MAAM,eAAe,GAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAC1F,MAAM,eAAe,GAAqB,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AACpG,MAAM,YAAY,GAAe,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AAC5E,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,OAAO,cAAc;IACR,SAAS,CAAY;IAEtC,YAAY,SAAo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e,EAAE,CAAC,CAAC,eAAe,IAAI,IAAI;QAC1C,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,IAAI;QAClB,aAAa,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjD,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;YAClC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC;SAC/B,CAAC,CAAC;QACH,gBAAgB,EAAE,CAAC,CAAC,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACvD,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,IAAI;YAC5B,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,IAAI;YAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI;YACxB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI;SACzB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
package/dist/routing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Transport } from './http.ts';
|
|
2
2
|
import type { SpiderResult } from './result.ts';
|
|
3
3
|
import type { SpiderError } from './errors.ts';
|
|
4
|
-
import type { BikesAllowed, InputField, RealtimeState, RoutingErrorCode, TransitMode, WheelchairBoarding } from './enums.ts';
|
|
4
|
+
import type { BikesAllowed, InputField, RealtimeState, Reliability, RoutingErrorCode, TransitMode, WheelchairBoarding } from './enums.ts';
|
|
5
5
|
import type { Location, ViaLocation } from './location.ts';
|
|
6
6
|
export interface LatLon {
|
|
7
7
|
readonly lat: number;
|
|
@@ -19,6 +19,8 @@ export interface Leg {
|
|
|
19
19
|
readonly startDelaySeconds: number | null;
|
|
20
20
|
/** Arrival schedule deviation in seconds (positive = late), when known; otherwise null. */
|
|
21
21
|
readonly endDelaySeconds: number | null;
|
|
22
|
+
/** Typical delay in seconds planned onto this leg's arrival at the requested `reliability`; null when none was requested or there is no history. */
|
|
23
|
+
readonly typicalArrivalDelaySeconds: number | null;
|
|
22
24
|
readonly isRealtime: boolean;
|
|
23
25
|
readonly realtimeState: RealtimeState | null;
|
|
24
26
|
/** GTFS service date this leg's trip runs on (ISO `YYYY-MM-DD`) — pass to realtime `delays` lookups. */
|
|
@@ -43,7 +45,10 @@ export interface Leg {
|
|
|
43
45
|
readonly distanceMeters: number | null;
|
|
44
46
|
readonly durationSeconds: number | null;
|
|
45
47
|
readonly tripGtfsId: string | null;
|
|
48
|
+
/** True when the rider stays on board from the previous leg as the vehicle continues as another trip; not counted as a transfer. */
|
|
49
|
+
readonly interlineWithPreviousLeg: boolean;
|
|
46
50
|
readonly bikesAllowed: BikesAllowed | null;
|
|
51
|
+
/** @deprecated Always null. */
|
|
47
52
|
readonly accessibilityScore: number | null;
|
|
48
53
|
readonly fromWheelchair: WheelchairBoarding | null;
|
|
49
54
|
readonly toWheelchair: WheelchairBoarding | null;
|
|
@@ -55,10 +60,12 @@ export interface Itinerary {
|
|
|
55
60
|
readonly durationSeconds: number;
|
|
56
61
|
readonly waitingTimeSeconds: number | null;
|
|
57
62
|
readonly numberOfTransfers: number;
|
|
63
|
+
/** @deprecated Always null. */
|
|
58
64
|
readonly accessibilityScore: number | null;
|
|
59
65
|
readonly legs: readonly Leg[];
|
|
60
66
|
}
|
|
61
67
|
export interface RouteEdge {
|
|
68
|
+
/** @deprecated Always `'NoCursor'`; page with {@link Route.pageInfo}. */
|
|
62
69
|
readonly cursor: string;
|
|
63
70
|
readonly itinerary: Itinerary;
|
|
64
71
|
}
|
|
@@ -102,7 +109,7 @@ export type PlanStreamEvent = {
|
|
|
102
109
|
/** Why the sweep found nothing, mirroring {@link Route.routingErrors}; empty when there is nothing to report. */
|
|
103
110
|
readonly routingErrors: readonly RoutingError[];
|
|
104
111
|
} | {
|
|
105
|
-
/** Terminal
|
|
112
|
+
/** Terminal: invalid input, an HTTP or transport failure (a stream cut before `pageInfo` is `network`), or decoding. */
|
|
106
113
|
readonly type: 'failure';
|
|
107
114
|
readonly error: SpiderError;
|
|
108
115
|
};
|
|
@@ -111,6 +118,8 @@ export interface Departure {
|
|
|
111
118
|
readonly realtimeTimeEpochMs: number | null;
|
|
112
119
|
readonly isRealtime: boolean;
|
|
113
120
|
readonly realtimeState: RealtimeState | null;
|
|
121
|
+
/** Typical (median) delay in seconds at this stop for this trip on its service date's day type; null when there is no history. */
|
|
122
|
+
readonly typicalDelaySeconds: number | null;
|
|
114
123
|
readonly headsign: string | null;
|
|
115
124
|
readonly tripGtfsId: string | null;
|
|
116
125
|
/** GTFS service date the trip runs on (ISO `YYYY-MM-DD`) — pass it to {@link SpiderRouting.trip} and realtime `delays`. */
|
|
@@ -138,6 +147,8 @@ export interface TripStop {
|
|
|
138
147
|
readonly realtimeArrivalEpochMs: number | null;
|
|
139
148
|
readonly realtimeDepartureEpochMs: number | null;
|
|
140
149
|
readonly isRealtime: boolean;
|
|
150
|
+
/** Typical (median) delay in seconds at this stop for this trip on its service date's day type; null when there is no history. */
|
|
151
|
+
readonly typicalDelaySeconds: number | null;
|
|
141
152
|
readonly wheelchairBoarding: WheelchairBoarding | null;
|
|
142
153
|
readonly platformCode: string | null;
|
|
143
154
|
readonly zoneId: string | null;
|
|
@@ -178,6 +189,8 @@ export interface PlanOptions {
|
|
|
178
189
|
readonly searchWindowMinutes?: number;
|
|
179
190
|
/** Prefer wheelchair-accessible routing. */
|
|
180
191
|
readonly wheelchairAccessible?: boolean;
|
|
192
|
+
/** Plan arrivals with typical delays at this level. Undefined = plan on the timetable. */
|
|
193
|
+
readonly reliability?: Reliability;
|
|
181
194
|
}
|
|
182
195
|
/**
|
|
183
196
|
* Options for {@link SpiderRouting.planStream} and its continuations — the server-push SSE stream that opens one
|
|
@@ -193,6 +206,8 @@ export interface PlanStreamRequestOptions {
|
|
|
193
206
|
readonly allowedTransitModes?: readonly TransitMode[];
|
|
194
207
|
readonly maxTransfers?: number;
|
|
195
208
|
readonly wheelchairAccessible?: boolean;
|
|
209
|
+
/** Plan arrivals with typical delays at this level. Undefined = plan on the timetable. */
|
|
210
|
+
readonly reliability?: Reliability;
|
|
196
211
|
/**
|
|
197
212
|
* Soft floor: the sweep keeps going until at least this many itineraries are found. From 1 up to the
|
|
198
213
|
* environment's result count.
|
|
@@ -239,7 +254,7 @@ export declare class SpiderRouting {
|
|
|
239
254
|
* {@link planStream} plus the raw cursor. Call only when the prior `done.pageInfo.hasPreviousPage` was true.
|
|
240
255
|
*/
|
|
241
256
|
planStreamPrevious(options: PlanStreamRequestOptions, before: string): AsyncGenerator<PlanStreamEvent>;
|
|
242
|
-
private
|
|
257
|
+
private streamBody;
|
|
243
258
|
private openPlanStream;
|
|
244
259
|
planNext(route: Route): Promise<SpiderResult<Route> | null>;
|
|
245
260
|
planPrevious(route: Route): Promise<SpiderResult<Route> | null>;
|
package/dist/routing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../src/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM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C,UAAU;YAwBH,cAAc;IAmDvB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAM3D,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAMrE;;;OAGG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,kBAAkB,SAA+B,EACjD,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;IAoBrC,gHAAgH;IAC1G,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAetE,IAAI;YAQJ,SAAS;CA+BxB;AA4FD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAuBzF"}
|
package/dist/routing.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { failure, success } from "./result.js";
|
|
2
2
|
import { DecodingError, TransportError, badRequest, httpFailure, toSpiderError } from "./errors.js";
|
|
3
|
-
import { graphqlFailure } from "./http.js";
|
|
4
3
|
import { bikesAllowedFromWire, inputFieldFromWire, realtimeStateFromWire, routingErrorCodeFromWire, transitModeFromWire, wheelchairFromWire, } from "./enums.js";
|
|
5
4
|
import { decodePolyline } from "./polyline.js";
|
|
6
5
|
import { invalidServiceDate, serviceDateOf } from "./serviceDate.js";
|
|
7
|
-
|
|
6
|
+
const PLAN_PATH = '/routing/v1/plan';
|
|
7
|
+
const PLAN_STREAM_PATH = '/routing/v1/plan-stream';
|
|
8
|
+
const DEPARTURES_PATH = '/routing/v1/departures';
|
|
9
|
+
const TRIP_PATH = '/routing/v1/trip';
|
|
10
|
+
const NO_CURSOR = 'NoCursor';
|
|
8
11
|
const DEFAULT_SEARCH_WINDOW_MINUTES = 60;
|
|
9
12
|
const DEFAULT_NUMBER_OF_DEPARTURES = 30;
|
|
10
13
|
const MAX_TIME_RANGE_SECONDS = 24 * 60 * 60;
|
|
11
14
|
// Fixed platform limits; the env-set ones (search window, result count, via count) are the server's to check.
|
|
12
15
|
const MIN_STREAM_WINDOW_MINUTES = 120;
|
|
13
16
|
const MAX_VIA_STOP_IDS = 10;
|
|
14
|
-
const MAX_VIA_WAIT_SECONDS =
|
|
17
|
+
const MAX_VIA_WAIT_SECONDS = 60 * 60;
|
|
15
18
|
// The OTP transit modes valid in a modes filter — the public TransitMode union also carries street/leg
|
|
16
19
|
// values (WALK, BICYCLE, CAR, TRANSIT, UNKNOWN) that are not transit modes and must not reach the wire.
|
|
17
20
|
const WIRE_TRANSIT_MODES = new Set([
|
|
@@ -37,6 +40,7 @@ export class SpiderRouting {
|
|
|
37
40
|
maxTransfers: options.maxTransfers,
|
|
38
41
|
searchWindowMinutes: options.searchWindowMinutes ?? DEFAULT_SEARCH_WINDOW_MINUTES,
|
|
39
42
|
wheelchairAccessible: options.wheelchairAccessible ?? false,
|
|
43
|
+
reliability: options.reliability,
|
|
40
44
|
};
|
|
41
45
|
const invalid = invalidVia(request.via);
|
|
42
46
|
if (invalid != null)
|
|
@@ -74,9 +78,7 @@ export class SpiderRouting {
|
|
|
74
78
|
async *planStreamPrevious(options, before) {
|
|
75
79
|
yield* this.openPlanStream(options, { before });
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
// paging sets `after`, backward sets `before`; an initial stream sets neither.
|
|
79
|
-
streamVariables(options, cursor) {
|
|
81
|
+
streamBody(options, cursor) {
|
|
80
82
|
const time = options.arriveBy != null
|
|
81
83
|
? { kind: 'arriveBy', epochMs: toEpochMs(options.arriveBy) }
|
|
82
84
|
: { kind: 'departAt', epochMs: toEpochMs(options.departAt ?? Date.now()) };
|
|
@@ -94,14 +96,11 @@ export class SpiderRouting {
|
|
|
94
96
|
}),
|
|
95
97
|
targetResults: options.targetResults,
|
|
96
98
|
maxWindow: `PT${Math.floor(options.maxWindowMinutes)}M`,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
reliability: options.reliability,
|
|
100
|
+
...cursor,
|
|
99
101
|
};
|
|
100
102
|
}
|
|
101
|
-
//
|
|
102
|
-
// PlanStreamEvent stream. Invalid options, a non-2xx response, a transport error, or a decoding slip becomes a
|
|
103
|
-
// terminal `failure` event rather than a throw. Reading stops when the server closes the stream or the
|
|
104
|
-
// consumer stops iterating (which cancels the reader → aborts the request).
|
|
103
|
+
// Never throws: every failure, a stream cut before its `pageInfo` included, is one terminal `failure` event.
|
|
105
104
|
async *openPlanStream(options, cursor) {
|
|
106
105
|
const invalid = invalidStreamOptions(options);
|
|
107
106
|
if (invalid != null) {
|
|
@@ -110,14 +109,14 @@ export class SpiderRouting {
|
|
|
110
109
|
}
|
|
111
110
|
let response;
|
|
112
111
|
try {
|
|
113
|
-
response = await this.transport.stream(
|
|
112
|
+
response = await this.transport.stream(PLAN_STREAM_PATH, this.streamBody(options, cursor));
|
|
114
113
|
}
|
|
115
114
|
catch (e) {
|
|
116
115
|
yield { type: 'failure', error: toSpiderError(e) };
|
|
117
116
|
return;
|
|
118
117
|
}
|
|
119
118
|
if (!response.ok) {
|
|
120
|
-
yield { type: 'failure', error: toSpiderError(httpFailure(
|
|
119
|
+
yield { type: 'failure', error: toSpiderError(httpFailure(`POST ${PLAN_STREAM_PATH}`, response.status, await drainText(response))) };
|
|
121
120
|
return;
|
|
122
121
|
}
|
|
123
122
|
const body = response.body;
|
|
@@ -128,44 +127,34 @@ export class SpiderRouting {
|
|
|
128
127
|
const reader = body.getReader();
|
|
129
128
|
const decoder = new TextDecoder();
|
|
130
129
|
let buffer = '';
|
|
131
|
-
|
|
132
|
-
// before any event, so a body that opens with `{` is read whole and mapped like a batch response.
|
|
133
|
-
let json = (response.headers.get('content-type') ?? '').includes('json') ? true : undefined;
|
|
130
|
+
let sawPageInfo = false;
|
|
134
131
|
try {
|
|
135
132
|
for (;;) {
|
|
136
133
|
const { value, done } = await reader.read();
|
|
137
134
|
if (done)
|
|
138
135
|
break;
|
|
139
136
|
buffer = (buffer + decoder.decode(value, { stream: true })).replace(/\r\n/g, '\n');
|
|
140
|
-
|
|
141
|
-
const head = buffer.trimStart();
|
|
142
|
-
if (head !== '')
|
|
143
|
-
json = head.startsWith('{');
|
|
144
|
-
}
|
|
145
|
-
if (json !== false)
|
|
146
|
-
continue;
|
|
147
|
-
// SSE records are separated by a blank line; parse every complete one and keep the remainder buffered.
|
|
137
|
+
// A record still unterminated at close is discarded, per the SSE rules.
|
|
148
138
|
let boundary;
|
|
149
139
|
while ((boundary = buffer.indexOf('\n\n')) !== -1) {
|
|
150
140
|
const record = parseSseFrame(buffer.slice(0, boundary));
|
|
151
141
|
buffer = buffer.slice(boundary + 2);
|
|
152
142
|
const event = parsePlanStreamRecord(record.event, record.data);
|
|
153
|
-
if (event
|
|
154
|
-
|
|
143
|
+
if (event == null)
|
|
144
|
+
continue;
|
|
145
|
+
yield event;
|
|
146
|
+
if (event.type === 'failure')
|
|
147
|
+
return;
|
|
148
|
+
if (event.type === 'done')
|
|
149
|
+
sawPageInfo = true;
|
|
155
150
|
}
|
|
156
151
|
}
|
|
157
|
-
if (
|
|
158
|
-
yield { type: 'failure', error:
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// A trailing record the server didn't terminate with a blank line before closing.
|
|
162
|
-
const record = parseSseFrame(buffer);
|
|
163
|
-
const event = parsePlanStreamRecord(record.event, record.data);
|
|
164
|
-
if (event != null)
|
|
165
|
-
yield event;
|
|
152
|
+
if (!sawPageInfo)
|
|
153
|
+
yield { type: 'failure', error: { code: 'network', message: 'routing plan-stream ended before pageInfo' } };
|
|
166
154
|
}
|
|
167
155
|
catch (e) {
|
|
168
|
-
|
|
156
|
+
if (!sawPageInfo)
|
|
157
|
+
yield { type: 'failure', error: toSpiderError(e) };
|
|
169
158
|
}
|
|
170
159
|
finally {
|
|
171
160
|
await reader.cancel().catch(() => { });
|
|
@@ -175,13 +164,13 @@ export class SpiderRouting {
|
|
|
175
164
|
if (!route.pageInfo.hasNextPage)
|
|
176
165
|
return null;
|
|
177
166
|
// Forward paging = after (no count; the server returns a whole window per page).
|
|
178
|
-
return this.page(requestOf(route),
|
|
167
|
+
return this.page(requestOf(route), cursorOf('after', route.pageInfo.endCursor));
|
|
179
168
|
}
|
|
180
169
|
async planPrevious(route) {
|
|
181
170
|
if (!route.pageInfo.hasPreviousPage)
|
|
182
171
|
return null;
|
|
183
172
|
// Backward paging = before (no count; the server returns a whole window per page).
|
|
184
|
-
return this.page(requestOf(route), route.pageInfo.startCursor
|
|
173
|
+
return this.page(requestOf(route), cursorOf('before', route.pageInfo.startCursor));
|
|
185
174
|
}
|
|
186
175
|
/**
|
|
187
176
|
* Upcoming departures from a stop or station: `numberOfDepartures` (default 30, up to the environment's
|
|
@@ -192,14 +181,13 @@ export class SpiderRouting {
|
|
|
192
181
|
if (!(timeRange > 0 && timeRange <= MAX_TIME_RANGE_SECONDS))
|
|
193
182
|
return failure(badRequest('timeRange'));
|
|
194
183
|
try {
|
|
195
|
-
const
|
|
184
|
+
const body = {
|
|
196
185
|
id: stopId,
|
|
197
186
|
numberOfDepartures,
|
|
198
187
|
startTime: options?.startTime != null ? Math.floor(toEpochMs(options.startTime) / 1000) : undefined,
|
|
199
188
|
timeRange,
|
|
200
189
|
};
|
|
201
|
-
const
|
|
202
|
-
const stop = data.asStop ?? data.asStation;
|
|
190
|
+
const stop = (await this.transport.postJson(DEPARTURES_PATH, body)).stop;
|
|
203
191
|
if (stop == null) {
|
|
204
192
|
throw new TransportError('no_data', `routing returned no stop or station for id=${stopId}`);
|
|
205
193
|
}
|
|
@@ -215,9 +203,8 @@ export class SpiderRouting {
|
|
|
215
203
|
if (invalid != null)
|
|
216
204
|
return failure(invalid);
|
|
217
205
|
try {
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const trip = data.trip;
|
|
206
|
+
const body = { id: tripId, serviceDate };
|
|
207
|
+
const trip = (await this.transport.postJson(TRIP_PATH, body)).trip;
|
|
221
208
|
if (trip == null) {
|
|
222
209
|
throw new TransportError('no_data', `routing returned no trip for id=${tripId}`);
|
|
223
210
|
}
|
|
@@ -227,20 +214,20 @@ export class SpiderRouting {
|
|
|
227
214
|
return failure(toSpiderError(e));
|
|
228
215
|
}
|
|
229
216
|
}
|
|
230
|
-
async page(request,
|
|
217
|
+
async page(request, cursor) {
|
|
231
218
|
try {
|
|
232
|
-
return success(await this.fetchPlan(request,
|
|
219
|
+
return success(await this.fetchPlan(request, cursor));
|
|
233
220
|
}
|
|
234
221
|
catch (e) {
|
|
235
222
|
return failure(toSpiderError(e));
|
|
236
223
|
}
|
|
237
224
|
}
|
|
238
|
-
async fetchPlan(request,
|
|
225
|
+
async fetchPlan(request, cursor) {
|
|
239
226
|
const iso = new Date(request.time.epochMs).toISOString();
|
|
240
227
|
const dateTime = request.time.kind === 'departAt'
|
|
241
228
|
? { earliestDeparture: iso }
|
|
242
229
|
: { latestArrival: iso };
|
|
243
|
-
const
|
|
230
|
+
const body = {
|
|
244
231
|
dateTime,
|
|
245
232
|
origin: locationToInput(request.origin),
|
|
246
233
|
destination: locationToInput(request.destination),
|
|
@@ -248,16 +235,12 @@ export class SpiderRouting {
|
|
|
248
235
|
modes: modesInput(request.allowedTransitModes),
|
|
249
236
|
preferences: preferencesInput(request),
|
|
250
237
|
searchWindow: `PT${Math.floor(request.searchWindowMinutes)}M`,
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
reliability: request.reliability,
|
|
239
|
+
...cursor,
|
|
253
240
|
};
|
|
254
|
-
const
|
|
255
|
-
const plan = data.planConnection;
|
|
256
|
-
if (plan == null) {
|
|
257
|
-
throw new TransportError('no_data', 'routing returned no plan data');
|
|
258
|
-
}
|
|
241
|
+
const plan = await this.transport.postJson(PLAN_PATH, body);
|
|
259
242
|
const route = {
|
|
260
|
-
edges:
|
|
243
|
+
edges: plan.itineraries.map((itinerary) => ({ cursor: NO_CURSOR, itinerary: mapItinerary(itinerary) })),
|
|
261
244
|
pageInfo: {
|
|
262
245
|
startCursor: plan.pageInfo.startCursor ?? null,
|
|
263
246
|
endCursor: plan.pageInfo.endCursor ?? null,
|
|
@@ -277,6 +260,11 @@ function requestOf(route) {
|
|
|
277
260
|
function toEpochMs(value) {
|
|
278
261
|
return typeof value === 'number' ? value : value.getTime();
|
|
279
262
|
}
|
|
263
|
+
function cursorOf(kind, cursor) {
|
|
264
|
+
if (cursor == null)
|
|
265
|
+
return undefined;
|
|
266
|
+
return kind === 'after' ? { after: cursor } : { before: cursor };
|
|
267
|
+
}
|
|
280
268
|
function invalidStreamOptions(options) {
|
|
281
269
|
// Required by the type; a plain-JS caller can still omit it, and `PTNaNM` must never reach the wire.
|
|
282
270
|
if (options.maxWindowMinutes == null)
|
|
@@ -287,11 +275,13 @@ function invalidStreamOptions(options) {
|
|
|
287
275
|
}
|
|
288
276
|
function invalidVia(via) {
|
|
289
277
|
for (const v of via) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
278
|
+
if (v.kind === 'passThrough') {
|
|
279
|
+
if (!(v.stopIds.length >= 1 && v.stopIds.length <= MAX_VIA_STOP_IDS))
|
|
280
|
+
return badRequest('via');
|
|
281
|
+
}
|
|
282
|
+
else if (!(v.minimumWaitSeconds >= 0 && v.minimumWaitSeconds <= MAX_VIA_WAIT_SECONDS)) {
|
|
283
|
+
return badRequest('via.visit.minimumWaitTime');
|
|
284
|
+
}
|
|
295
285
|
}
|
|
296
286
|
return null;
|
|
297
287
|
}
|
|
@@ -305,16 +295,10 @@ function viaToInput(via) {
|
|
|
305
295
|
if (via.kind === 'passThrough') {
|
|
306
296
|
return { passThrough: { stopLocationIds: [...via.stopIds] } };
|
|
307
297
|
}
|
|
298
|
+
if (via.location.kind !== 'stop')
|
|
299
|
+
throw new TransportError('bad_request', 'via is invalid', undefined, undefined, 'via');
|
|
308
300
|
const minimumWaitTime = via.minimumWaitSeconds > 0 ? `PT${via.minimumWaitSeconds}S` : undefined;
|
|
309
|
-
|
|
310
|
-
return { visit: { stopLocationIds: [via.location.id], minimumWaitTime } };
|
|
311
|
-
}
|
|
312
|
-
return {
|
|
313
|
-
visit: {
|
|
314
|
-
coordinate: { latitude: via.location.latitude, longitude: via.location.longitude },
|
|
315
|
-
minimumWaitTime,
|
|
316
|
-
},
|
|
317
|
-
};
|
|
301
|
+
return { visit: { stopLocationIds: [via.location.id], minimumWaitTime } };
|
|
318
302
|
}
|
|
319
303
|
// Curated PlanRequest → OTP's nested modes/preferences inputs. Only the exposed fields are set; everything
|
|
320
304
|
// else stays undefined so OTP applies its own defaults. Both return undefined when nothing is requested.
|
|
@@ -376,8 +360,6 @@ export function parsePlanStreamRecord(event, data) {
|
|
|
376
360
|
},
|
|
377
361
|
routingErrors: (page.routingErrors ?? []).map(mapRoutingError),
|
|
378
362
|
}));
|
|
379
|
-
case 'error':
|
|
380
|
-
return { type: 'failure', error: streamErrorToSpiderError(data) };
|
|
381
363
|
default:
|
|
382
364
|
return null;
|
|
383
365
|
}
|
|
@@ -411,21 +393,6 @@ function parseSseFrame(record) {
|
|
|
411
393
|
}
|
|
412
394
|
return { event, data: data.join('\n') };
|
|
413
395
|
}
|
|
414
|
-
// A stream `error` record (or a 2xx JSON body in place of the stream) is the same GraphQL error envelope the
|
|
415
|
-
// batch path returns, so it maps through the same taxonomy: a BAD_REQUEST becomes bad_request with its field.
|
|
416
|
-
function streamErrorToSpiderError(data) {
|
|
417
|
-
let env;
|
|
418
|
-
try {
|
|
419
|
-
env = JSON.parse(data);
|
|
420
|
-
}
|
|
421
|
-
catch {
|
|
422
|
-
return toSpiderError(new TransportError('upstream', `routing plan-stream error: ${data.slice(0, 300)}`));
|
|
423
|
-
}
|
|
424
|
-
if (env.errors != null && env.errors.length > 0) {
|
|
425
|
-
return toSpiderError(graphqlFailure('routing plan-stream', env.errors));
|
|
426
|
-
}
|
|
427
|
-
return toSpiderError(new TransportError('upstream', `routing plan-stream error: ${env.message ?? data.slice(0, 300)}`));
|
|
428
|
-
}
|
|
429
396
|
async function drainText(response) {
|
|
430
397
|
try {
|
|
431
398
|
return await response.text();
|
|
@@ -444,7 +411,7 @@ function mapItinerary(node) {
|
|
|
444
411
|
durationSeconds: node.duration ?? 0,
|
|
445
412
|
waitingTimeSeconds: node.waitingTime ?? null,
|
|
446
413
|
numberOfTransfers: node.numberOfTransfers,
|
|
447
|
-
accessibilityScore:
|
|
414
|
+
accessibilityScore: null,
|
|
448
415
|
legs: node.legs.map(mapLeg),
|
|
449
416
|
};
|
|
450
417
|
}
|
|
@@ -457,6 +424,7 @@ function mapLeg(leg) {
|
|
|
457
424
|
endEstimated: leg.end.estimated?.time ?? null,
|
|
458
425
|
startDelaySeconds: durationSecondsFromWire(leg.start.estimated?.delay),
|
|
459
426
|
endDelaySeconds: durationSecondsFromWire(leg.end.estimated?.delay),
|
|
427
|
+
typicalArrivalDelaySeconds: leg.typicalArrivalDelay ?? null,
|
|
460
428
|
isRealtime: leg.realTime ?? false,
|
|
461
429
|
realtimeState: realtimeStateFromWire(leg.realtimeState),
|
|
462
430
|
serviceDate: leg.serviceDate ?? null,
|
|
@@ -477,8 +445,9 @@ function mapLeg(leg) {
|
|
|
477
445
|
distanceMeters: leg.distance ?? null,
|
|
478
446
|
durationSeconds: leg.duration ?? null,
|
|
479
447
|
tripGtfsId: leg.trip?.gtfsId ?? null,
|
|
448
|
+
interlineWithPreviousLeg: leg.interlineWithPreviousLeg ?? false,
|
|
480
449
|
bikesAllowed: bikesAllowedFromWire(leg.trip?.bikesAllowed),
|
|
481
|
-
accessibilityScore:
|
|
450
|
+
accessibilityScore: null,
|
|
482
451
|
fromWheelchair: wheelchairFromWire(leg.from.stop?.wheelchairBoarding),
|
|
483
452
|
toWheelchair: wheelchairFromWire(leg.to.stop?.wheelchairBoarding),
|
|
484
453
|
geometry: leg.legGeometry?.points ? decodePolyline(leg.legGeometry.points) : [],
|
|
@@ -497,6 +466,7 @@ function mapDepartures(stop) {
|
|
|
497
466
|
realtimeTimeEpochMs: st.realtimeDeparture != null ? (serviceDay + st.realtimeDeparture) * 1000 : null,
|
|
498
467
|
isRealtime: st.realtime ?? false,
|
|
499
468
|
realtimeState: realtimeStateFromWire(st.realtimeState),
|
|
469
|
+
typicalDelaySeconds: st.typicalDelay ?? null,
|
|
500
470
|
headsign: st.headsign ?? null,
|
|
501
471
|
tripGtfsId: st.trip?.gtfsId ?? null,
|
|
502
472
|
serviceDate: serviceDateOf(serviceDay),
|
|
@@ -532,6 +502,7 @@ function mapTrip(trip) {
|
|
|
532
502
|
realtimeArrivalEpochMs: at(st.realtimeArrival),
|
|
533
503
|
realtimeDepartureEpochMs: at(st.realtimeDeparture),
|
|
534
504
|
isRealtime: st.realtime ?? false,
|
|
505
|
+
typicalDelaySeconds: st.typicalDelay ?? null,
|
|
535
506
|
wheelchairBoarding: wheelchairFromWire(s.wheelchairBoarding),
|
|
536
507
|
platformCode: s.platformCode ?? null,
|
|
537
508
|
zoneId: s.zoneId ?? null,
|