@opentripplanner/core-utils 9.0.0-alpha.27 → 9.0.0-alpha.29
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/esm/itinerary.js +6 -1
- package/esm/itinerary.js.map +1 -1
- package/esm/query-gen.js +7 -4
- package/esm/query-gen.js.map +1 -1
- package/lib/itinerary.d.ts.map +1 -1
- package/lib/itinerary.js +6 -1
- package/lib/itinerary.js.map +1 -1
- package/lib/query-gen.d.ts.map +1 -1
- package/lib/query-gen.js +6 -3
- package/lib/query-gen.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/query-params.ts +20 -0
- package/src/itinerary.ts +4 -0
- package/src/otpSchema.json +12940 -0
- package/src/planQuery.graphql +142 -113
- package/src/query-gen.ts +4 -2
- package/tsconfig.tsbuildinfo +1 -1
package/src/planQuery.graphql
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
query
|
|
1
|
+
query Plan(
|
|
2
2
|
$fromPlace: String!
|
|
3
3
|
$toPlace: String!
|
|
4
4
|
$modes: [TransportMode]
|
|
@@ -16,179 +16,208 @@ query PlanQuery(
|
|
|
16
16
|
$numItineraries: Int
|
|
17
17
|
) {
|
|
18
18
|
plan(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
transportModes: $modes
|
|
22
|
-
# Currently only supporting EN locale, used for times and text
|
|
23
|
-
locale: "en"
|
|
24
|
-
time: $time
|
|
25
|
-
date: $date
|
|
26
|
-
wheelchair: $wheelchair
|
|
19
|
+
arriveBy: $arriveBy
|
|
20
|
+
banned: $banned
|
|
27
21
|
bikeReluctance: $bikeReluctance
|
|
28
22
|
carReluctance: $carReluctance
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
date: $date
|
|
24
|
+
fromPlace: $fromPlace
|
|
31
25
|
intermediatePlaces: $intermediatePlaces
|
|
26
|
+
# Currently only supporting EN locale, used for times and text
|
|
27
|
+
locale: "en"
|
|
28
|
+
numItineraries: $numItineraries
|
|
32
29
|
preferred: $preferred
|
|
30
|
+
time: $time
|
|
31
|
+
toPlace: $toPlace
|
|
32
|
+
transportModes: $modes
|
|
33
33
|
unpreferred: $unpreferred
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
walkReluctance: $walkReluctance
|
|
35
|
+
wheelchair: $wheelchair
|
|
36
36
|
) {
|
|
37
|
-
routingErrors {
|
|
38
|
-
code
|
|
39
|
-
inputField
|
|
40
|
-
description
|
|
41
|
-
}
|
|
42
37
|
itineraries {
|
|
38
|
+
accessibilityScore
|
|
43
39
|
duration
|
|
44
40
|
endTime
|
|
45
|
-
startTime
|
|
46
|
-
waitingTime
|
|
47
|
-
walkTime
|
|
48
|
-
accessibilityScore
|
|
49
41
|
legs {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
accessibilityScore
|
|
43
|
+
agency {
|
|
44
|
+
alerts {
|
|
45
|
+
alertDescriptionText
|
|
46
|
+
alertHeaderText
|
|
47
|
+
alertUrl
|
|
48
|
+
effectiveStartDate
|
|
49
|
+
id
|
|
55
50
|
}
|
|
51
|
+
id
|
|
52
|
+
name
|
|
53
|
+
timezone
|
|
54
|
+
url
|
|
56
55
|
}
|
|
57
|
-
rentedBike
|
|
58
|
-
interlineWithPreviousLeg
|
|
59
|
-
departureDelay
|
|
60
56
|
arrivalDelay
|
|
57
|
+
departureDelay
|
|
61
58
|
distance
|
|
59
|
+
dropoffType
|
|
62
60
|
duration
|
|
63
61
|
endTime
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
fareProducts {
|
|
63
|
+
id
|
|
64
|
+
product {
|
|
65
|
+
id
|
|
66
|
+
medium {
|
|
67
|
+
id
|
|
68
|
+
name
|
|
69
|
+
}
|
|
70
|
+
name
|
|
71
|
+
price {
|
|
72
|
+
amount
|
|
73
|
+
currency {
|
|
74
|
+
code
|
|
75
|
+
digits
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
riderCategory {
|
|
79
|
+
id
|
|
80
|
+
name
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
from {
|
|
85
|
+
lat
|
|
86
|
+
lon
|
|
87
|
+
name
|
|
88
|
+
rentalVehicle {
|
|
89
|
+
id
|
|
90
|
+
network
|
|
91
|
+
}
|
|
92
|
+
stop {
|
|
93
|
+
alerts {
|
|
94
|
+
alertDescriptionText
|
|
95
|
+
alertHeaderText
|
|
96
|
+
alertUrl
|
|
97
|
+
effectiveStartDate
|
|
98
|
+
id
|
|
99
|
+
}
|
|
100
|
+
code
|
|
101
|
+
gtfsId
|
|
67
102
|
id
|
|
68
103
|
}
|
|
104
|
+
vertexType
|
|
105
|
+
}
|
|
106
|
+
interlineWithPreviousLeg
|
|
107
|
+
intermediateStops {
|
|
108
|
+
lat
|
|
109
|
+
locationType
|
|
110
|
+
lon
|
|
111
|
+
name
|
|
112
|
+
stopCode: code
|
|
113
|
+
stopId: id
|
|
114
|
+
}
|
|
115
|
+
legGeometry {
|
|
116
|
+
length
|
|
117
|
+
points
|
|
118
|
+
}
|
|
119
|
+
mode
|
|
120
|
+
pickupBookingInfo {
|
|
121
|
+
earliestBookingTime {
|
|
122
|
+
daysPrior
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
pickupType
|
|
126
|
+
realTime
|
|
127
|
+
realtimeState
|
|
128
|
+
rentedBike
|
|
129
|
+
rideHailingEstimate {
|
|
69
130
|
arrival
|
|
70
|
-
|
|
131
|
+
maxPrice {
|
|
132
|
+
amount
|
|
71
133
|
currency {
|
|
72
134
|
code
|
|
73
135
|
}
|
|
74
|
-
amount
|
|
75
136
|
}
|
|
76
|
-
|
|
137
|
+
minPrice {
|
|
138
|
+
amount
|
|
77
139
|
currency {
|
|
78
140
|
code
|
|
79
141
|
}
|
|
80
|
-
|
|
142
|
+
}
|
|
143
|
+
provider {
|
|
144
|
+
id
|
|
81
145
|
}
|
|
82
146
|
}
|
|
83
|
-
|
|
84
|
-
realtimeState
|
|
85
|
-
startTime
|
|
86
|
-
transitLeg
|
|
87
|
-
accessibilityScore
|
|
88
|
-
trip {
|
|
89
|
-
id
|
|
90
|
-
gtfsId
|
|
91
|
-
tripHeadsign
|
|
92
|
-
}
|
|
93
|
-
agency {
|
|
94
|
-
name
|
|
95
|
-
id
|
|
96
|
-
timezone
|
|
97
|
-
url
|
|
147
|
+
route {
|
|
98
148
|
alerts {
|
|
99
|
-
alertHeaderText
|
|
100
149
|
alertDescriptionText
|
|
150
|
+
alertHeaderText
|
|
101
151
|
alertUrl
|
|
102
152
|
effectiveStartDate
|
|
153
|
+
id
|
|
103
154
|
}
|
|
104
|
-
}
|
|
105
|
-
legGeometry {
|
|
106
|
-
length
|
|
107
|
-
points
|
|
108
|
-
}
|
|
109
|
-
intermediateStops {
|
|
110
|
-
lat
|
|
111
|
-
lon
|
|
112
|
-
name
|
|
113
|
-
stopCode: code
|
|
114
|
-
stopId: id
|
|
115
|
-
locationType
|
|
116
|
-
}
|
|
117
|
-
route {
|
|
118
|
-
shortName
|
|
119
|
-
longName
|
|
120
155
|
color
|
|
121
|
-
textColor
|
|
122
156
|
id
|
|
157
|
+
longName
|
|
158
|
+
shortName
|
|
159
|
+
textColor
|
|
123
160
|
type
|
|
161
|
+
}
|
|
162
|
+
startTime
|
|
163
|
+
steps {
|
|
164
|
+
absoluteDirection
|
|
124
165
|
alerts {
|
|
125
|
-
alertHeaderText
|
|
126
166
|
alertDescriptionText
|
|
167
|
+
alertHeaderText
|
|
127
168
|
alertUrl
|
|
128
169
|
effectiveStartDate
|
|
170
|
+
id
|
|
171
|
+
}
|
|
172
|
+
area
|
|
173
|
+
distance
|
|
174
|
+
elevationProfile {
|
|
175
|
+
distance
|
|
176
|
+
elevation
|
|
129
177
|
}
|
|
130
|
-
}
|
|
131
|
-
from {
|
|
132
178
|
lat
|
|
133
179
|
lon
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
network
|
|
138
|
-
}
|
|
139
|
-
stop {
|
|
140
|
-
id
|
|
141
|
-
code
|
|
142
|
-
gtfsId
|
|
143
|
-
alerts {
|
|
144
|
-
alertHeaderText
|
|
145
|
-
alertDescriptionText
|
|
146
|
-
alertUrl
|
|
147
|
-
effectiveStartDate
|
|
148
|
-
}
|
|
149
|
-
}
|
|
180
|
+
relativeDirection
|
|
181
|
+
stayOn
|
|
182
|
+
streetName
|
|
150
183
|
}
|
|
151
184
|
to {
|
|
152
185
|
lat
|
|
153
186
|
lon
|
|
154
187
|
name
|
|
155
|
-
vertexType
|
|
156
188
|
rentalVehicle {
|
|
189
|
+
id
|
|
157
190
|
network
|
|
158
191
|
}
|
|
159
192
|
stop {
|
|
160
|
-
id
|
|
161
|
-
code
|
|
162
|
-
gtfsId
|
|
163
193
|
alerts {
|
|
164
|
-
alertHeaderText
|
|
165
194
|
alertDescriptionText
|
|
195
|
+
alertHeaderText
|
|
166
196
|
alertUrl
|
|
167
197
|
effectiveStartDate
|
|
198
|
+
id
|
|
168
199
|
}
|
|
200
|
+
code
|
|
201
|
+
gtfsId
|
|
202
|
+
id
|
|
169
203
|
}
|
|
204
|
+
vertexType
|
|
170
205
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
absoluteDirection
|
|
177
|
-
stayOn
|
|
178
|
-
streetName
|
|
179
|
-
area
|
|
180
|
-
alerts {
|
|
181
|
-
alertHeaderText
|
|
182
|
-
alertDescriptionText
|
|
183
|
-
alertUrl
|
|
184
|
-
effectiveStartDate
|
|
185
|
-
}
|
|
186
|
-
elevationProfile {
|
|
187
|
-
distance
|
|
188
|
-
elevation
|
|
189
|
-
}
|
|
206
|
+
transitLeg
|
|
207
|
+
trip {
|
|
208
|
+
gtfsId
|
|
209
|
+
id
|
|
210
|
+
tripHeadsign
|
|
190
211
|
}
|
|
191
212
|
}
|
|
213
|
+
startTime
|
|
214
|
+
waitingTime
|
|
215
|
+
walkTime
|
|
216
|
+
}
|
|
217
|
+
routingErrors {
|
|
218
|
+
code
|
|
219
|
+
description
|
|
220
|
+
inputField
|
|
192
221
|
}
|
|
193
222
|
}
|
|
194
223
|
}
|
package/src/query-gen.ts
CHANGED
|
@@ -127,7 +127,7 @@ const VALID_COMBOS = [
|
|
|
127
127
|
["TRANSIT", "CAR"]
|
|
128
128
|
];
|
|
129
129
|
|
|
130
|
-
const BANNED_TOGETHER = ["SCOOTER", "BICYCLE"];
|
|
130
|
+
const BANNED_TOGETHER = ["SCOOTER", "BICYCLE", "CAR"];
|
|
131
131
|
|
|
132
132
|
export const TRANSIT_SUBMODES = Object.keys(SIMPLIFICATIONS).filter(
|
|
133
133
|
mode => SIMPLIFICATIONS[mode] === "TRANSIT" && mode !== "TRANSIT"
|
|
@@ -168,7 +168,9 @@ function isCombinationValid(
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// OTP doesn't support multiple non-walk modes
|
|
171
|
-
if (BANNED_TOGETHER.
|
|
171
|
+
if (BANNED_TOGETHER.filter(m => combo.find(c => c.mode === m)).length > 1) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
172
174
|
|
|
173
175
|
return !!VALID_COMBOS.find(
|
|
174
176
|
vc =>
|