@tiducto/spider-sdk-typescript 1.1.0 → 1.3.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/DepartureBoard.d.ts +11 -0
- 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 +6 -2
- package/dist/contract/routing/ErrorResponse.d.ts.map +1 -1
- package/dist/contract/routing/Geometry.d.ts +2 -1
- package/dist/contract/routing/Geometry.d.ts.map +1 -1
- package/dist/contract/routing/Itinerary.d.ts +8 -5
- package/dist/contract/routing/Itinerary.d.ts.map +1 -1
- package/dist/contract/routing/Leg.d.ts +22 -14
- package/dist/contract/routing/Leg.d.ts.map +1 -1
- package/dist/contract/routing/LegTime.d.ts +2 -1
- package/dist/contract/routing/LegTime.d.ts.map +1 -1
- package/dist/contract/routing/Place.d.ts +4 -2
- 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 +8 -3
- 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 +17 -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 +1 -1
- package/dist/contract/routing/Reliability.d.ts.map +1 -1
- package/dist/contract/routing/Route.d.ts +8 -4
- package/dist/contract/routing/Route.d.ts.map +1 -1
- package/dist/contract/routing/RoutingError.d.ts +3 -1
- package/dist/contract/routing/RoutingError.d.ts.map +1 -1
- package/dist/contract/routing/RoutingErrorCode.d.ts +1 -1
- package/dist/contract/routing/RoutingErrorCode.d.ts.map +1 -1
- package/dist/contract/routing/Stop.d.ts +5 -3
- package/dist/contract/routing/Stop.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesRoute.d.ts +9 -5
- package/dist/contract/routing/StopDeparturesRoute.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesStop.d.ts +2 -1
- package/dist/contract/routing/StopDeparturesStop.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesStoptime.d.ts +16 -10
- package/dist/contract/routing/StopDeparturesStoptime.d.ts.map +1 -1
- package/dist/contract/routing/StopDeparturesTrip.d.ts +2 -2
- package/dist/contract/routing/StopDeparturesTrip.d.ts.map +1 -1
- package/dist/contract/routing/Stoptime.d.ts +16 -10
- 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/Trip.d.ts +1 -1
- package/dist/contract/routing/Trip.d.ts.map +1 -1
- package/dist/contract/routing/TripGeometry.d.ts +4 -2
- 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 +9 -5
- package/dist/contract/routing/TripRoute.d.ts.map +1 -1
- package/dist/contract/routing/TripStop.d.ts +7 -5
- package/dist/contract/routing/TripStop.d.ts.map +1 -1
- package/dist/contract/routing/TripTimetable.d.ts +20 -0
- 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 +11 -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 +3 -1
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +1 -2
- package/dist/enums.js.map +1 -1
- package/dist/errors.d.ts +7 -17
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +9 -20
- 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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +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/polling.d.ts +1 -2
- package/dist/polling.d.ts.map +1 -1
- package/dist/polling.js +2 -5
- package/dist/polling.js.map +1 -1
- package/dist/realtime.d.ts +18 -24
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +43 -46
- package/dist/realtime.js.map +1 -1
- package/dist/routing.d.ts +33 -27
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +132 -167
- 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.d.ts +2 -2
- package/dist/stops.d.ts.map +1 -1
- package/dist/stops.js +4 -4
- 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 -21
- 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 -20
- 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 +0 -9
- 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 +0 -16
- 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
|
@@ -2,10 +2,12 @@ import type { WheelchairBoarding } from './WheelchairBoarding.ts';
|
|
|
2
2
|
export interface TripStop {
|
|
3
3
|
gtfsId: string;
|
|
4
4
|
name: string;
|
|
5
|
-
lat
|
|
6
|
-
lon
|
|
7
|
-
wheelchairBoarding
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
lat: number;
|
|
6
|
+
lon: number;
|
|
7
|
+
wheelchairBoarding: WheelchairBoarding;
|
|
8
|
+
/** Null when the feed has none. */
|
|
9
|
+
platformCode: string | null;
|
|
10
|
+
/** Null when the feed has none. */
|
|
11
|
+
zoneId: string | null;
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=TripStop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TripStop.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/TripStop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,
|
|
1
|
+
{"version":3,"file":"TripStop.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/TripStop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mCAAmC;IACnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mCAAmC;IACnC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BikesAllowed } from './BikesAllowed.ts';
|
|
2
|
+
import type { Stoptime } from './Stoptime.ts';
|
|
3
|
+
import type { TripGeometry } from './TripGeometry.ts';
|
|
4
|
+
import type { TripRoute } from './TripRoute.ts';
|
|
5
|
+
import type { WheelchairBoarding } from './WheelchairBoarding.ts';
|
|
6
|
+
/** One trip on one service date: its stops and times, realtime merged in. On a date without realtime the rows carry the schedule alone, and on a date the trip does not run they carry its schedule on that date. */
|
|
7
|
+
export interface TripTimetable {
|
|
8
|
+
gtfsId: string;
|
|
9
|
+
/** `0` or `1`, as the feed gives it; null when it gives none. */
|
|
10
|
+
directionId: string | null;
|
|
11
|
+
/** Null when the feed has none. */
|
|
12
|
+
tripHeadsign: string | null;
|
|
13
|
+
bikesAllowed: BikesAllowed;
|
|
14
|
+
wheelchairAccessible: WheelchairBoarding;
|
|
15
|
+
route: TripRoute;
|
|
16
|
+
stoptimesForDate: Stoptime[];
|
|
17
|
+
/** The trip's path; null when the feed has no shapes. */
|
|
18
|
+
tripGeometry: TripGeometry | null;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=TripTimetable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TripTimetable.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/TripTimetable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,qNAAqN;AACrN,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mCAAmC;IACnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,KAAK,EAAE,SAAS,CAAC;IACjB,gBAAgB,EAAE,QAAQ,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TripTimetable.js","sourceRoot":"","sources":["../../../src/contract/routing/TripTimetable.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/** Walking preferences. */
|
|
1
2
|
export interface WalkPreferencesInput {
|
|
2
|
-
|
|
3
|
-
reluctance?: number;
|
|
4
|
-
safetyFactor?: number;
|
|
3
|
+
/** Walking speed on flat ground in metres per second, at least 0.1 (0.1 included); rejected, never clamped. */
|
|
5
4
|
speed?: number;
|
|
5
|
+
/** How much worse walking is than riding for the same time, a multiplier from 0.1 to 100000; rejected, never clamped. */
|
|
6
|
+
reluctance?: number;
|
|
7
|
+
/** Generalized cost added for each boarding, an integer from 0 to 1000000; rejected, never clamped. */
|
|
8
|
+
boardCost?: number;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=WalkPreferencesInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalkPreferencesInput.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/WalkPreferencesInput.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,
|
|
1
|
+
{"version":3,"file":"WalkPreferencesInput.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/WalkPreferencesInput.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,WAAW,oBAAoB;IACnC,+GAA+G;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yHAAyH;IACzH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uGAAuG;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** Wheelchair preferences. */
|
|
1
2
|
export interface WheelchairPreferencesInput {
|
|
3
|
+
/** Consider wheelchair accessibility in routing. The feed's accessibility data limits what this guarantees. */
|
|
2
4
|
enabled?: boolean;
|
|
3
5
|
}
|
|
4
6
|
//# sourceMappingURL=WheelchairPreferencesInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WheelchairPreferencesInput.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/WheelchairPreferencesInput.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"WheelchairPreferencesInput.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/WheelchairPreferencesInput.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,MAAM,WAAW,0BAA0B;IACzC,+GAA+G;IAC/G,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
export type { AccessibilityPreferencesInput } from './AccessibilityPreferencesInput.ts';
|
|
2
2
|
export type { AlightPreferencesInput } from './AlightPreferencesInput.ts';
|
|
3
|
-
export type { BicycleParkingPreferencesInput } from './BicycleParkingPreferencesInput.ts';
|
|
4
|
-
export type { BicyclePreferencesInput } from './BicyclePreferencesInput.ts';
|
|
5
|
-
export type { BicycleRentalPreferencesInput } from './BicycleRentalPreferencesInput.ts';
|
|
6
|
-
export type { BicycleWalkPreferencesCostInput } from './BicycleWalkPreferencesCostInput.ts';
|
|
7
|
-
export type { BicycleWalkPreferencesInput } from './BicycleWalkPreferencesInput.ts';
|
|
8
3
|
export type { BikesAllowed } from './BikesAllowed.ts';
|
|
9
4
|
export type { BoardPreferencesInput } from './BoardPreferencesInput.ts';
|
|
10
|
-
export type {
|
|
11
|
-
export type {
|
|
12
|
-
export type {
|
|
13
|
-
export type { CyclingOptimizationInput } from './CyclingOptimizationInput.ts';
|
|
14
|
-
export type { CyclingOptimizationType } from './CyclingOptimizationType.ts';
|
|
15
|
-
export type { DestinationBicyclePolicyInput } from './DestinationBicyclePolicyInput.ts';
|
|
16
|
-
export type { DestinationScooterPolicyInput } from './DestinationScooterPolicyInput.ts';
|
|
5
|
+
export type { DepartureBoard } from './DepartureBoard.ts';
|
|
6
|
+
export type { DeparturesRequest } from './DeparturesRequest.ts';
|
|
7
|
+
export type { DeparturesResponse } from './DeparturesResponse.ts';
|
|
17
8
|
export type { ErrorResponse } from './ErrorResponse.ts';
|
|
18
9
|
export type { Geometry } from './Geometry.ts';
|
|
19
|
-
export type { GraphQLError } from './GraphQLError.ts';
|
|
20
10
|
export type { InputField } from './InputField.ts';
|
|
21
11
|
export type { Itinerary } from './Itinerary.ts';
|
|
22
12
|
export type { Leg } from './Leg.ts';
|
|
23
13
|
export type { LegTime } from './LegTime.ts';
|
|
24
14
|
export type { Mode } from './Mode.ts';
|
|
25
|
-
export type { ParkingFilter } from './ParkingFilter.ts';
|
|
26
|
-
export type { ParkingFilterOperation } from './ParkingFilterOperation.ts';
|
|
27
15
|
export type { Place } from './Place.ts';
|
|
28
|
-
export type { PlanAccessMode } from './PlanAccessMode.ts';
|
|
29
|
-
export type { PlanConnection } from './PlanConnection.ts';
|
|
30
|
-
export type { PlanConnectionData } from './PlanConnectionData.ts';
|
|
31
|
-
export type { PlanConnectionResponse } from './PlanConnectionResponse.ts';
|
|
32
|
-
export type { PlanConnectionStreamData } from './PlanConnectionStreamData.ts';
|
|
33
|
-
export type { PlanConnectionStreamResponse } from './PlanConnectionStreamResponse.ts';
|
|
34
|
-
export type { PlanConnectionStreamVariables } from './PlanConnectionStreamVariables.ts';
|
|
35
|
-
export type { PlanConnectionVariables } from './PlanConnectionVariables.ts';
|
|
36
16
|
export type { PlanCoordinateInput } from './PlanCoordinateInput.ts';
|
|
37
17
|
export type { PlanDateTimeInput } from './PlanDateTimeInput.ts';
|
|
38
|
-
export type { PlanDirectMode } from './PlanDirectMode.ts';
|
|
39
|
-
export type { PlanEdge } from './PlanEdge.ts';
|
|
40
|
-
export type { PlanEgressMode } from './PlanEgressMode.ts';
|
|
41
18
|
export type { PlanLabeledLocationInput } from './PlanLabeledLocationInput.ts';
|
|
42
19
|
export type { PlanLocationInput } from './PlanLocationInput.ts';
|
|
43
20
|
export type { PlanModesInput } from './PlanModesInput.ts';
|
|
@@ -45,10 +22,15 @@ export type { PlanPageInfo } from './PlanPageInfo.ts';
|
|
|
45
22
|
export type { PlanPassThroughViaLocationInput } from './PlanPassThroughViaLocationInput.ts';
|
|
46
23
|
export type { PlanPreferencesInput } from './PlanPreferencesInput.ts';
|
|
47
24
|
export type { PlanStopLocationInput } from './PlanStopLocationInput.ts';
|
|
25
|
+
export type { PlanStreamChunkEvent } from './PlanStreamChunkEvent.ts';
|
|
26
|
+
export type { PlanStreamDoneEvent } from './PlanStreamDoneEvent.ts';
|
|
27
|
+
export type { PlanStreamPageInfoEvent } from './PlanStreamPageInfoEvent.ts';
|
|
28
|
+
export type { PlanStreamRequest } from './PlanStreamRequest.ts';
|
|
48
29
|
export type { PlanStreetPreferencesInput } from './PlanStreetPreferencesInput.ts';
|
|
49
|
-
export type { PlanTransferMode } from './PlanTransferMode.ts';
|
|
50
30
|
export type { PlanTransitModePreferenceInput } from './PlanTransitModePreferenceInput.ts';
|
|
51
31
|
export type { PlanTransitModesInput } from './PlanTransitModesInput.ts';
|
|
32
|
+
export type { PlanTripRequest } from './PlanTripRequest.ts';
|
|
33
|
+
export type { PlanTripResponse } from './PlanTripResponse.ts';
|
|
52
34
|
export type { PlanViaLocationInput } from './PlanViaLocationInput.ts';
|
|
53
35
|
export type { PlanVisitViaLocationInput } from './PlanVisitViaLocationInput.ts';
|
|
54
36
|
export type { RealTimeEstimate } from './RealTimeEstimate.ts';
|
|
@@ -57,37 +39,25 @@ export type { Reliability } from './Reliability.ts';
|
|
|
57
39
|
export type { Route } from './Route.ts';
|
|
58
40
|
export type { RoutingError } from './RoutingError.ts';
|
|
59
41
|
export type { RoutingErrorCode } from './RoutingErrorCode.ts';
|
|
60
|
-
export type { ScooterOptimizationInput } from './ScooterOptimizationInput.ts';
|
|
61
|
-
export type { ScooterOptimizationType } from './ScooterOptimizationType.ts';
|
|
62
|
-
export type { ScooterPreferencesInput } from './ScooterPreferencesInput.ts';
|
|
63
|
-
export type { ScooterRentalPreferencesInput } from './ScooterRentalPreferencesInput.ts';
|
|
64
42
|
export type { Stop } from './Stop.ts';
|
|
65
|
-
export type { StopDeparturesData } from './StopDeparturesData.ts';
|
|
66
|
-
export type { StopDeparturesResponse } from './StopDeparturesResponse.ts';
|
|
67
43
|
export type { StopDeparturesRoute } from './StopDeparturesRoute.ts';
|
|
68
44
|
export type { StopDeparturesStop } from './StopDeparturesStop.ts';
|
|
69
|
-
export type { StopDeparturesStop2 } from './StopDeparturesStop2.ts';
|
|
70
45
|
export type { StopDeparturesStoptime } from './StopDeparturesStoptime.ts';
|
|
71
46
|
export type { StopDeparturesTrip } from './StopDeparturesTrip.ts';
|
|
72
|
-
export type { StopDeparturesVariables } from './StopDeparturesVariables.ts';
|
|
73
47
|
export type { Stoptime } from './Stoptime.ts';
|
|
74
|
-
export type { TimetablePreferencesInput } from './TimetablePreferencesInput.ts';
|
|
75
48
|
export type { TransferPreferencesInput } from './TransferPreferencesInput.ts';
|
|
76
49
|
export type { TransitFilterInput } from './TransitFilterInput.ts';
|
|
77
50
|
export type { TransitFilterSelectInput } from './TransitFilterSelectInput.ts';
|
|
78
51
|
export type { TransitMode } from './TransitMode.ts';
|
|
79
52
|
export type { TransitModePreferenceCostInput } from './TransitModePreferenceCostInput.ts';
|
|
80
53
|
export type { TransitPreferencesInput } from './TransitPreferencesInput.ts';
|
|
81
|
-
export type { TriangleCyclingFactorsInput } from './TriangleCyclingFactorsInput.ts';
|
|
82
|
-
export type { TriangleScooterFactorsInput } from './TriangleScooterFactorsInput.ts';
|
|
83
54
|
export type { Trip } from './Trip.ts';
|
|
84
|
-
export type { TripData } from './TripData.ts';
|
|
85
55
|
export type { TripGeometry } from './TripGeometry.ts';
|
|
56
|
+
export type { TripRequest } from './TripRequest.ts';
|
|
86
57
|
export type { TripResponse } from './TripResponse.ts';
|
|
87
58
|
export type { TripRoute } from './TripRoute.ts';
|
|
88
59
|
export type { TripStop } from './TripStop.ts';
|
|
89
|
-
export type {
|
|
90
|
-
export type { TripVariables } from './TripVariables.ts';
|
|
60
|
+
export type { TripTimetable } from './TripTimetable.ts';
|
|
91
61
|
export type { WalkPreferencesInput } from './WalkPreferencesInput.ts';
|
|
92
62
|
export type { WheelchairBoarding } from './WheelchairBoarding.ts';
|
|
93
63
|
export type { WheelchairPreferencesInput } from './WheelchairPreferencesInput.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contract/routing/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,6BAA6B,EAAE,MAAM,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AY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CONTRACT_VERSION = "1.
|
|
1
|
+
export declare const CONTRACT_VERSION = "1.3";
|
|
2
2
|
//# sourceMappingURL=contractVersion.d.ts.map
|
package/dist/contractVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CONTRACT_VERSION = '1.
|
|
1
|
+
export const CONTRACT_VERSION = '1.3';
|
|
2
2
|
//# sourceMappingURL=contractVersion.js.map
|
package/dist/enums.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ export type WheelchairBoarding = 'POSSIBLE' | 'NOT_POSSIBLE' | 'UNKNOWN';
|
|
|
3
3
|
export type BikesAllowed = 'ALLOWED' | 'NOT_ALLOWED' | 'UNKNOWN';
|
|
4
4
|
export type OccupancyStatus = 'EMPTY' | 'MANY_SEATS_AVAILABLE' | 'FEW_SEATS_AVAILABLE' | 'STANDING_ROOM_ONLY' | 'CRUSHED_STANDING_ROOM_ONLY' | 'FULL' | 'NOT_ACCEPTING_PASSENGERS' | 'NOT_BOARDABLE' | 'UNKNOWN';
|
|
5
5
|
export type RealtimeState = 'ADDED' | 'CANCELED' | 'MODIFIED' | 'SCHEDULED' | 'UPDATED' | 'UNKNOWN';
|
|
6
|
-
export type RoutingErrorCode = 'LOCATION_NOT_FOUND' | 'NO_STOPS_IN_RANGE' | 'NO_TRANSIT_CONNECTION' | '
|
|
6
|
+
export type RoutingErrorCode = 'LOCATION_NOT_FOUND' | 'NO_STOPS_IN_RANGE' | 'NO_TRANSIT_CONNECTION' | 'OUTSIDE_SERVICE_PERIOD' | 'WALKING_BETTER_THAN_TRANSIT' | 'UNKNOWN';
|
|
7
7
|
export type InputField = 'DATE_TIME' | 'FROM' | 'TO' | 'VIA' | 'UNKNOWN';
|
|
8
8
|
/** Delay-aware planning level: arrivals are planned with the typical delay at the median (`STANDARD`), 70th (`SAFE`) or 90th (`VERY_SAFE`) percentile. */
|
|
9
9
|
export type Reliability = 'STANDARD' | 'SAFE' | 'VERY_SAFE';
|
|
10
|
+
export declare function transitModeFromWire(raw: string): TransitMode;
|
|
10
11
|
export declare function transitModeFromWire(raw: string | null | undefined): TransitMode | null;
|
|
12
|
+
export declare function realtimeStateFromWire(raw: string): RealtimeState;
|
|
11
13
|
export declare function realtimeStateFromWire(raw: string | null | undefined): RealtimeState | null;
|
|
12
14
|
export declare function routingErrorCodeFromWire(raw: string | null | undefined): RoutingErrorCode;
|
|
13
15
|
export declare function inputFieldFromWire(raw: string | null | undefined): InputField | null;
|
package/dist/enums.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,SAAS,GACT,KAAK,GACL,WAAW,GACX,KAAK,GACL,SAAS,GACT,OAAO,GACP,OAAO,GACP,MAAM,GACN,UAAU,GACV,WAAW,GACX,SAAS,GACT,YAAY,GACZ,UAAU,GACV,MAAM,GACN,SAAS,GACT,cAAc,GACd,QAAQ,GACR,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;AAEjE,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,sBAAsB,GACtB,qBAAqB,GACrB,oBAAoB,GACpB,4BAA4B,GAC5B,MAAM,GACN,0BAA0B,GAC1B,eAAe,GACf,SAAS,CAAC;AAEd,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpG,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB,mBAAmB,GACnB,uBAAuB,GACvB,
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,SAAS,GACT,KAAK,GACL,WAAW,GACX,KAAK,GACL,SAAS,GACT,OAAO,GACP,OAAO,GACP,MAAM,GACN,UAAU,GACV,WAAW,GACX,SAAS,GACT,YAAY,GACZ,UAAU,GACV,MAAM,GACN,SAAS,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C,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAEpF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CAE5F;AAED,oHAAoH;AACpH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CAG5F;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,IAAI,CAExF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,GAAG,IAAI,CAGxF"}
|
package/dist/enums.js
CHANGED
|
@@ -13,8 +13,7 @@ const WHEELCHAIR_BOARDING = { POSSIBLE: true, NOT_POSSIBLE: true };
|
|
|
13
13
|
const BIKES_ALLOWED = { ALLOWED: true, NOT_ALLOWED: true };
|
|
14
14
|
const REALTIME_STATES = { ADDED: true, CANCELED: true, MODIFIED: true, SCHEDULED: true, UPDATED: true };
|
|
15
15
|
const ROUTING_ERROR_CODES = {
|
|
16
|
-
LOCATION_NOT_FOUND: true, NO_STOPS_IN_RANGE: true, NO_TRANSIT_CONNECTION: true,
|
|
17
|
-
NO_TRANSIT_CONNECTION_IN_SEARCH_WINDOW: true, OUTSIDE_BOUNDS: true, OUTSIDE_SERVICE_PERIOD: true,
|
|
16
|
+
LOCATION_NOT_FOUND: true, NO_STOPS_IN_RANGE: true, NO_TRANSIT_CONNECTION: true, OUTSIDE_SERVICE_PERIOD: true,
|
|
18
17
|
WALKING_BETTER_THAN_TRANSIT: true,
|
|
19
18
|
};
|
|
20
19
|
const INPUT_FIELDS = { DATE_TIME: true, FROM: true, TO: true, VIA: true };
|
package/dist/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAA8B;IAC/D,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;AAC3F,CAAC;AAED,oHAAoH;AACpH,MAAM,UAAU,kBAAkB,CAAC,GAA8B;IAC/D,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAA8B;IACjE,OAAO,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACrF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAA8B;IAC9D,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,mBAAmB;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO,MAAM,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What went wrong. `bad_request` is an invalid or missing input, caught by the SDK before sending or
|
|
3
|
-
* rejected by the server; `field` names it. `
|
|
4
|
-
* query behind the call (HTTP 410 Gone). `planning_limit_reached` means the project has reached the trip
|
|
3
|
+
* rejected by the server; `field` names it. `planning_limit_reached` means the project has reached the trip
|
|
5
4
|
* planning limit its plan includes; it applies to trip planning only. `agreement_inactive` means the project has
|
|
6
5
|
* no active agreement; it applies to every call made with a client key.
|
|
7
6
|
*/
|
|
8
|
-
export type SpiderErrorCode = 'network' | 'timeout' | 'unauthorized' | 'bad_request' | 'not_found' | '
|
|
7
|
+
export type SpiderErrorCode = 'network' | 'timeout' | 'unauthorized' | 'bad_request' | 'not_found' | 'planning_limit_reached' | 'agreement_inactive' | 'server' | 'rate_limited' | 'decoding' | 'unknown';
|
|
9
8
|
export interface SpiderError {
|
|
10
9
|
readonly code: SpiderErrorCode;
|
|
11
10
|
readonly message: string;
|
|
12
11
|
readonly httpStatus?: number;
|
|
13
|
-
/**
|
|
14
|
-
* The server's machine-readable error code, when it sends one: e.g. `persisted_query_rejected` on an
|
|
15
|
-
* `unauthorized` when the environment doesn't recognise the query id, or `query_retired`.
|
|
16
|
-
*/
|
|
12
|
+
/** The server's machine-readable error code, when it sends one: e.g. `bad_request` or `rate_limited`. */
|
|
17
13
|
readonly serverCode?: string;
|
|
18
|
-
/** For a `bad_request`, the
|
|
14
|
+
/** For a `bad_request`, the request member it names as a dot path, e.g. `preferences.transit.transfer.maximumTransfers`. */
|
|
19
15
|
readonly field?: string;
|
|
20
16
|
readonly cause?: unknown;
|
|
21
17
|
}
|
|
@@ -29,24 +25,18 @@ export declare class TransportError extends Error {
|
|
|
29
25
|
readonly field: string | undefined;
|
|
30
26
|
/** The response body's own `message`, when it has one. */
|
|
31
27
|
readonly serverMessage: string | undefined;
|
|
32
|
-
/** The code-shaped `error` field of the response body, where the gateway puts its own refusal codes. */
|
|
33
|
-
readonly gatewayCode: string | undefined;
|
|
34
28
|
constructor(kind: TransportErrorKind, message: string, httpStatus?: number, serverCode?: string, field?: string, body?: {
|
|
35
29
|
readonly message?: string;
|
|
36
|
-
readonly gatewayCode?: string;
|
|
37
30
|
});
|
|
38
31
|
}
|
|
39
32
|
export declare function parseErrorEnvelope(text: string): {
|
|
40
33
|
code?: string;
|
|
41
34
|
message?: string;
|
|
42
|
-
|
|
35
|
+
field?: string;
|
|
43
36
|
};
|
|
44
|
-
/** A non-2xx response → an `http` TransportError
|
|
37
|
+
/** A non-2xx response → an `http` TransportError; a 400's field is the body's `field`, else the one its message names. */
|
|
45
38
|
export declare function httpFailure(where: string, status: number, text: string, detail?: string): TransportError;
|
|
46
|
-
/**
|
|
47
|
-
* The plan-limit error an `http` failure's body `error` field names (`planning_limit_reached`,
|
|
48
|
-
* `agreement_inactive`), whatever its status, or `undefined` when it names neither. A `code` field is not read.
|
|
49
|
-
*/
|
|
39
|
+
/** The plan-limit error the body code (`code`, else `error`) names, whatever the status; else `undefined`. */
|
|
50
40
|
export declare function limitRefusal(e: TransportError): SpiderError | undefined;
|
|
51
41
|
export declare class DecodingError extends Error {
|
|
52
42
|
readonly cause: unknown;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,SAAS,GACT,cAAc,GACd,aAAa,GACb,WAAW,GACX,wBAAwB,GACxB,oBAAoB,GACpB,QAAQ,GACR,cAAc,GACd,UAAU,GACV,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,yGAAyG;IACzG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,4HAA4H;IAC5H,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AASD,0FAA0F;AAC1F,wBAAgB,UAAU,CACx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AE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAYD,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,WAAW,CAyBrD"}
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const QUERY_RETIRED = 'query_retired';
|
|
2
1
|
// Plan-limit refusals: the body code names the state, and the fixed wording stands in for a body without a message.
|
|
3
2
|
const LIMIT_MESSAGES = {
|
|
4
3
|
planning_limit_reached: 'trip planning limit reached',
|
|
@@ -15,8 +14,6 @@ export class TransportError extends Error {
|
|
|
15
14
|
field;
|
|
16
15
|
/** The response body's own `message`, when it has one. */
|
|
17
16
|
serverMessage;
|
|
18
|
-
/** The code-shaped `error` field of the response body, where the gateway puts its own refusal codes. */
|
|
19
|
-
gatewayCode;
|
|
20
17
|
constructor(kind, message, httpStatus, serverCode, field, body) {
|
|
21
18
|
super(message);
|
|
22
19
|
this.name = 'TransportError';
|
|
@@ -25,7 +22,6 @@ export class TransportError extends Error {
|
|
|
25
22
|
this.serverCode = serverCode;
|
|
26
23
|
this.field = field;
|
|
27
24
|
this.serverMessage = body?.message;
|
|
28
|
-
this.gatewayCode = body?.gatewayCode;
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
27
|
export function parseErrorEnvelope(text) {
|
|
@@ -38,34 +34,30 @@ export function parseErrorEnvelope(text) {
|
|
|
38
34
|
}
|
|
39
35
|
if (typeof body === 'object' && body !== null) {
|
|
40
36
|
const b = body;
|
|
41
|
-
//
|
|
42
|
-
// services put a human sentence there, so only a code-shaped value counts.
|
|
37
|
+
// Only a code-shaped `error` counts: the gateway puts its refusal codes there, other services a sentence.
|
|
43
38
|
const gatewayCode = typeof b.error === 'string' && /^[a-z][a-z0-9_]*$/.test(b.error) ? b.error : undefined;
|
|
44
39
|
return {
|
|
45
40
|
code: typeof b.code === 'string' ? b.code : gatewayCode,
|
|
46
41
|
message: typeof b.message === 'string' ? b.message : undefined,
|
|
47
|
-
|
|
42
|
+
field: typeof b.field === 'string' ? b.field : undefined,
|
|
48
43
|
};
|
|
49
44
|
}
|
|
50
45
|
return {};
|
|
51
46
|
}
|
|
52
|
-
// The
|
|
53
|
-
const FIELD_PROBLEM = /^([A-Za-z_]
|
|
54
|
-
/** A non-2xx response → an `http` TransportError
|
|
47
|
+
// The platform's own 400 wording, e.g. "preferences.street.bicycle is not allowed".
|
|
48
|
+
const FIELD_PROBLEM = /^([A-Za-z_][A-Za-z0-9_.]*) is (?:out of range|required|invalid|not allowed)$/;
|
|
49
|
+
/** A non-2xx response → an `http` TransportError; a 400's field is the body's `field`, else the one its message names. */
|
|
55
50
|
export function httpFailure(where, status, text, detail) {
|
|
56
51
|
const env = parseErrorEnvelope(text);
|
|
57
52
|
const message = (detail ?? env.message ?? text.slice(0, 300)).trim();
|
|
58
|
-
const field = status === 400 ? FIELD_PROBLEM.exec(message)?.[1] : undefined;
|
|
53
|
+
const field = status === 400 ? env.field ?? FIELD_PROBLEM.exec(message)?.[1] : undefined;
|
|
59
54
|
return new TransportError('http', `${where} -> ${status}: ${message}`, status, env.code, field, env);
|
|
60
55
|
}
|
|
61
|
-
/**
|
|
62
|
-
* The plan-limit error an `http` failure's body `error` field names (`planning_limit_reached`,
|
|
63
|
-
* `agreement_inactive`), whatever its status, or `undefined` when it names neither. A `code` field is not read.
|
|
64
|
-
*/
|
|
56
|
+
/** The plan-limit error the body code (`code`, else `error`) names, whatever the status; else `undefined`. */
|
|
65
57
|
export function limitRefusal(e) {
|
|
66
|
-
if (e.kind !== 'http' || e.
|
|
58
|
+
if (e.kind !== 'http' || e.serverCode == null || !Object.hasOwn(LIMIT_MESSAGES, e.serverCode))
|
|
67
59
|
return undefined;
|
|
68
|
-
const code = e.
|
|
60
|
+
const code = e.serverCode;
|
|
69
61
|
return { code, message: e.serverMessage?.trim() || LIMIT_MESSAGES[code], httpStatus: e.httpStatus, serverCode: code };
|
|
70
62
|
}
|
|
71
63
|
export class DecodingError extends Error {
|
|
@@ -93,9 +85,6 @@ export function toSpiderError(e) {
|
|
|
93
85
|
if (refusal != null)
|
|
94
86
|
return refusal;
|
|
95
87
|
const status = e.httpStatus ?? 0;
|
|
96
|
-
if (e.serverCode === QUERY_RETIRED || status === 410) {
|
|
97
|
-
return { code: 'query_retired', message: 'persisted query is retired', httpStatus: status, serverCode: e.serverCode };
|
|
98
|
-
}
|
|
99
88
|
const code = status === 400 ? 'bad_request'
|
|
100
89
|
: status === 401 || status === 403 ? 'unauthorized'
|
|
101
90
|
: status === 404 ? 'not_found'
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AA8BA,oHAAoH;AACpH,MAAM,cAAc,GAAG;IACrB,sBAAsB,EAAE,6BAA6B;IACrD,kBAAkB,EAAE,yBAAyB;CACc,CAAC;AAG9D,0FAA0F;AAC1F,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,UAA4D,iBAAiB;IAE7E,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC;AACxE,CAAC;AAID,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAqB;IACzB,UAAU,CAAqB;IAC/B,UAAU,CAAqB;IAC/B,KAAK,CAAqB;IACnC,0DAA0D;IACjD,aAAa,CAAqB;IAE3C,YACE,IAAwB,EACxB,OAAe,EACf,UAAmB,EACnB,UAAmB,EACnB,KAAc,EACd,IAAoC;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,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EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QACpG,CAAC;QACD,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC3E,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa;YAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QACjG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IACD,IAAI,CAAC,YAAY,aAAa;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAChG,IAAI,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC5E,IAAI,CAAC,YAAY,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACxF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/http.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TransportError } from './errors.ts';
|
|
2
1
|
export type FetchLike = typeof fetch;
|
|
3
2
|
export interface AutoRetryOptions {
|
|
4
3
|
readonly maxAttempts?: number;
|
|
@@ -25,19 +24,6 @@ export interface RawResponse {
|
|
|
25
24
|
readonly status: number;
|
|
26
25
|
readonly text: string;
|
|
27
26
|
}
|
|
28
|
-
export interface GraphQLError {
|
|
29
|
-
message: string;
|
|
30
|
-
extensions?: {
|
|
31
|
-
code?: string;
|
|
32
|
-
field?: string;
|
|
33
|
-
} | null;
|
|
34
|
-
}
|
|
35
|
-
export interface GraphQLEnvelope<D> {
|
|
36
|
-
data?: D | null;
|
|
37
|
-
errors?: ReadonlyArray<GraphQLError> | null;
|
|
38
|
-
}
|
|
39
|
-
/** A GraphQL `errors` array → a typed bad_request for a BAD_REQUEST extension (with its field), else upstream. */
|
|
40
|
-
export declare function graphqlFailure(where: string, errors: ReadonlyArray<GraphQLError>): TransportError;
|
|
41
27
|
export declare function parseJson<T>(text: string, where: string): T;
|
|
42
28
|
export declare class Transport {
|
|
43
29
|
private readonly baseUrl;
|
|
@@ -46,22 +32,9 @@ export declare class Transport {
|
|
|
46
32
|
private readonly timeoutMs;
|
|
47
33
|
private readonly retry?;
|
|
48
34
|
constructor(baseUrl: string, apiKey: string, options?: TransportOptions);
|
|
49
|
-
graphql<D>(op: {
|
|
50
|
-
id: string;
|
|
51
|
-
path: string;
|
|
52
|
-
}, variables: unknown): Promise<D>;
|
|
53
35
|
postJson<D>(path: string, body: unknown, errorMessage?: (raw: string) => string): Promise<D>;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
* streaming {@link Response} for the caller to read frame-by-frame. Unlike {@link send}, it does not
|
|
57
|
-
* auto-retry — a streamed response is consumed over time, so retrying (or aborting once the body is
|
|
58
|
-
* flowing) makes no sense; the connect timeout guards only the initial handshake and is cleared the moment
|
|
59
|
-
* the response headers arrive, leaving the body to stream uninterrupted.
|
|
60
|
-
*/
|
|
61
|
-
stream(op: {
|
|
62
|
-
id: string;
|
|
63
|
-
path: string;
|
|
64
|
-
}, variables: unknown): Promise<Response>;
|
|
36
|
+
/** POSTs `body` to `path` for an SSE stream, never auto-retried; the connect timeout covers only the handshake. */
|
|
37
|
+
stream(path: string, body: unknown): Promise<Response>;
|
|
65
38
|
getJson<D>(path: string, query?: Record<string, string>): Promise<D>;
|
|
66
39
|
getRaw(path: string, query?: Record<string, string>): Promise<RawResponse>;
|
|
67
40
|
/**
|
package/dist/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACpC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CA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k.js";
|
|
3
|
-
import { DecodingError,
|
|
4
|
-
/** A GraphQL `errors` array → a typed bad_request for a BAD_REQUEST extension (with its field), else upstream. */
|
|
5
|
-
export function graphqlFailure(where, errors) {
|
|
6
|
-
const bad = errors.find((e) => e.extensions?.code === 'BAD_REQUEST');
|
|
7
|
-
if (bad != null) {
|
|
8
|
-
return new TransportError('bad_request', bad.message, undefined, undefined, bad.extensions?.field);
|
|
9
|
-
}
|
|
10
|
-
return new TransportError('upstream', `${where} errors: ${errors.map((e) => e.message).join(', ')}`);
|
|
11
|
-
}
|
|
3
|
+
import { DecodingError, httpFailure } from "./errors.js";
|
|
12
4
|
export function parseJson(text, where) {
|
|
13
5
|
try {
|
|
14
6
|
return JSON.parse(text);
|
|
@@ -33,24 +25,6 @@ export class Transport {
|
|
|
33
25
|
this.timeoutMs = options?.timeoutMs ?? 30_000;
|
|
34
26
|
this.retry = options?.retry;
|
|
35
27
|
}
|
|
36
|
-
async graphql(op, variables) {
|
|
37
|
-
const res = await this.send(`${this.baseUrl}/routing/${op.path}`, {
|
|
38
|
-
method: 'POST',
|
|
39
|
-
headers: this.contractHeaders({ 'content-type': 'application/json' }),
|
|
40
|
-
body: JSON.stringify({ id: op.id, variables }),
|
|
41
|
-
});
|
|
42
|
-
const text = await res.text();
|
|
43
|
-
if (!res.ok)
|
|
44
|
-
throw httpFailure(`routing ${op.path}`, res.status, text);
|
|
45
|
-
const envelope = parseJson(text, `routing ${op.path}`);
|
|
46
|
-
if (envelope.errors != null && envelope.errors.length > 0) {
|
|
47
|
-
throw graphqlFailure(`routing ${op.path}`, envelope.errors);
|
|
48
|
-
}
|
|
49
|
-
if (envelope.data == null) {
|
|
50
|
-
throw new TransportError('no_data', `routing ${op.path} returned no data`);
|
|
51
|
-
}
|
|
52
|
-
return envelope.data;
|
|
53
|
-
}
|
|
54
28
|
async postJson(path, body, errorMessage) {
|
|
55
29
|
const res = await this.send(`${this.baseUrl}${path}`, {
|
|
56
30
|
method: 'POST',
|
|
@@ -62,23 +36,17 @@ export class Transport {
|
|
|
62
36
|
throw httpFailure(`POST ${path}`, res.status, text, errorMessage?.(text));
|
|
63
37
|
return parseJson(text, `POST ${path}`);
|
|
64
38
|
}
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
* streaming {@link Response} for the caller to read frame-by-frame. Unlike {@link send}, it does not
|
|
68
|
-
* auto-retry — a streamed response is consumed over time, so retrying (or aborting once the body is
|
|
69
|
-
* flowing) makes no sense; the connect timeout guards only the initial handshake and is cleared the moment
|
|
70
|
-
* the response headers arrive, leaving the body to stream uninterrupted.
|
|
71
|
-
*/
|
|
72
|
-
async stream(op, variables) {
|
|
39
|
+
/** POSTs `body` to `path` for an SSE stream, never auto-retried; the connect timeout covers only the handshake. */
|
|
40
|
+
async stream(path, body) {
|
|
73
41
|
const headers = this.contractHeaders({ 'content-type': 'application/json', accept: 'text/event-stream' });
|
|
74
42
|
headers.set('apikey', this.apiKey);
|
|
75
43
|
const controller = new AbortController();
|
|
76
44
|
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
77
45
|
try {
|
|
78
|
-
return await this.doFetch(`${this.baseUrl}
|
|
46
|
+
return await this.doFetch(`${this.baseUrl}${path}`, {
|
|
79
47
|
method: 'POST',
|
|
80
48
|
headers,
|
|
81
|
-
body: JSON.stringify(
|
|
49
|
+
body: JSON.stringify(body),
|
|
82
50
|
signal: controller.signal,
|
|
83
51
|
});
|
|
84
52
|
}
|