@opentripplanner/core-utils 12.0.0-alpha.8 → 12.0.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/esm/__tests__/__mocks__/bike-rental-itinerary.json +863 -0
- package/esm/__tests__/__mocks__/config.json +54 -0
- package/esm/__tests__/__mocks__/fare-products-itinerary.json +1299 -0
- package/esm/__tests__/__mocks__/routes.json +107 -0
- package/esm/__tests__/__mocks__/tnc-itinerary.json +1726 -0
- package/esm/bike-rental-itinerary.json +863 -0
- package/esm/config.json +54 -0
- package/esm/fare-products-itinerary.json +1299 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/itinerary.js +46 -21
- package/esm/itinerary.js.map +1 -1
- package/esm/otpSchema.json +13373 -0
- package/esm/planQuery.graphql +281 -0
- package/esm/profile.js +1 -1
- package/esm/profile.js.map +1 -1
- package/esm/query-gen.js +8 -5
- package/esm/query-gen.js.map +1 -1
- package/esm/query.js +1 -5
- package/esm/query.js.map +1 -1
- package/esm/routes.json +107 -0
- package/esm/storage.js +2 -6
- package/esm/storage.js.map +1 -1
- package/esm/suspense.js +13 -0
- package/esm/suspense.js.map +1 -0
- package/esm/tnc-itinerary.json +1726 -0
- package/lib/__tests__/__mocks__/bike-rental-itinerary.json +863 -0
- package/lib/__tests__/__mocks__/config.json +54 -0
- package/lib/__tests__/__mocks__/fare-products-itinerary.json +1299 -0
- package/lib/__tests__/__mocks__/routes.json +107 -0
- package/lib/__tests__/__mocks__/tnc-itinerary.json +1726 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/lib/itinerary.d.ts +13 -4
- package/lib/itinerary.d.ts.map +1 -1
- package/lib/itinerary.js +59 -22
- package/lib/itinerary.js.map +1 -1
- package/lib/otpSchema.json +13373 -0
- package/lib/planQuery.graphql +281 -0
- package/lib/profile.js +1 -1
- package/lib/profile.js.map +1 -1
- package/lib/query-gen.d.ts +3 -1
- package/lib/query-gen.d.ts.map +1 -1
- package/lib/query-gen.js +8 -5
- package/lib/query-gen.js.map +1 -1
- package/lib/query.js +1 -5
- package/lib/query.js.map +1 -1
- package/lib/storage.d.ts.map +1 -1
- package/lib/storage.js +2 -6
- package/lib/storage.js.map +1 -1
- package/lib/suspense.d.ts +8 -0
- package/lib/suspense.d.ts.map +1 -0
- package/lib/suspense.js +26 -0
- package/lib/suspense.js.map +1 -0
- package/package.json +3 -3
- package/src/__tests__/itinerary.ts +36 -1
- package/src/core-utils.story.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/itinerary.ts +68 -26
- package/src/otpSchema.json +0 -12
- package/src/planQuery.graphql +27 -0
- package/src/profile.js +1 -1
- package/src/query-gen.ts +8 -4
- package/src/query.js +1 -4
- package/src/storage.ts +5 -9
- package/src/suspense.tsx +19 -0
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/core-utils.story.d.ts +0 -22
- package/lib/core-utils.story.d.ts.map +0 -1
- package/lib/core-utils.story.js +0 -69
- package/lib/core-utils.story.js.map +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
query Plan(
|
|
2
|
+
$arriveBy: Boolean
|
|
3
|
+
$banned: InputBanned
|
|
4
|
+
$bikeReluctance: Float
|
|
5
|
+
$carReluctance: Float
|
|
6
|
+
$date: String
|
|
7
|
+
$fromPlace: String!
|
|
8
|
+
$modes: [TransportMode]
|
|
9
|
+
$numItineraries: Int
|
|
10
|
+
$preferred: InputPreferred
|
|
11
|
+
$time: String
|
|
12
|
+
$toPlace: String!
|
|
13
|
+
$unpreferred: InputUnpreferred
|
|
14
|
+
$walkReluctance: Float
|
|
15
|
+
$walkSpeed: Float
|
|
16
|
+
$wheelchair: Boolean
|
|
17
|
+
) {
|
|
18
|
+
plan(
|
|
19
|
+
arriveBy: $arriveBy
|
|
20
|
+
banned: $banned
|
|
21
|
+
bikeReluctance: $bikeReluctance
|
|
22
|
+
carReluctance: $carReluctance
|
|
23
|
+
date: $date
|
|
24
|
+
fromPlace: $fromPlace
|
|
25
|
+
# Currently only supporting EN locale, used for times and text
|
|
26
|
+
locale: "en"
|
|
27
|
+
numItineraries: $numItineraries
|
|
28
|
+
preferred: $preferred
|
|
29
|
+
time: $time
|
|
30
|
+
toPlace: $toPlace
|
|
31
|
+
transportModes: $modes
|
|
32
|
+
unpreferred: $unpreferred
|
|
33
|
+
walkReluctance: $walkReluctance
|
|
34
|
+
walkSpeed: $walkSpeed
|
|
35
|
+
wheelchair: $wheelchair
|
|
36
|
+
) {
|
|
37
|
+
itineraries {
|
|
38
|
+
accessibilityScore
|
|
39
|
+
duration
|
|
40
|
+
endTime
|
|
41
|
+
legs {
|
|
42
|
+
accessibilityScore
|
|
43
|
+
agency {
|
|
44
|
+
alerts {
|
|
45
|
+
alertDescriptionText
|
|
46
|
+
alertHeaderText
|
|
47
|
+
alertUrl
|
|
48
|
+
effectiveStartDate
|
|
49
|
+
id
|
|
50
|
+
}
|
|
51
|
+
gtfsId
|
|
52
|
+
id: gtfsId
|
|
53
|
+
name
|
|
54
|
+
timezone
|
|
55
|
+
url
|
|
56
|
+
}
|
|
57
|
+
alerts {
|
|
58
|
+
alertDescriptionText
|
|
59
|
+
alertHeaderText
|
|
60
|
+
alertUrl
|
|
61
|
+
effectiveStartDate
|
|
62
|
+
id
|
|
63
|
+
}
|
|
64
|
+
arrivalDelay
|
|
65
|
+
departureDelay
|
|
66
|
+
distance
|
|
67
|
+
dropOffBookingInfo {
|
|
68
|
+
contactInfo {
|
|
69
|
+
bookingUrl
|
|
70
|
+
infoUrl
|
|
71
|
+
phoneNumber
|
|
72
|
+
}
|
|
73
|
+
earliestBookingTime {
|
|
74
|
+
daysPrior
|
|
75
|
+
time
|
|
76
|
+
}
|
|
77
|
+
latestBookingTime {
|
|
78
|
+
daysPrior
|
|
79
|
+
time
|
|
80
|
+
}
|
|
81
|
+
message
|
|
82
|
+
}
|
|
83
|
+
dropoffType
|
|
84
|
+
duration
|
|
85
|
+
endTime
|
|
86
|
+
fareProducts {
|
|
87
|
+
id
|
|
88
|
+
product {
|
|
89
|
+
__typename
|
|
90
|
+
id
|
|
91
|
+
medium {
|
|
92
|
+
id
|
|
93
|
+
name
|
|
94
|
+
}
|
|
95
|
+
name
|
|
96
|
+
riderCategory {
|
|
97
|
+
id
|
|
98
|
+
name
|
|
99
|
+
}
|
|
100
|
+
... on DefaultFareProduct {
|
|
101
|
+
price {
|
|
102
|
+
amount
|
|
103
|
+
currency {
|
|
104
|
+
code
|
|
105
|
+
digits
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
from {
|
|
112
|
+
lat
|
|
113
|
+
lon
|
|
114
|
+
name
|
|
115
|
+
rentalVehicle {
|
|
116
|
+
id
|
|
117
|
+
network
|
|
118
|
+
}
|
|
119
|
+
stop {
|
|
120
|
+
alerts {
|
|
121
|
+
alertDescriptionText
|
|
122
|
+
alertHeaderText
|
|
123
|
+
alertUrl
|
|
124
|
+
effectiveStartDate
|
|
125
|
+
id
|
|
126
|
+
}
|
|
127
|
+
code
|
|
128
|
+
gtfsId
|
|
129
|
+
id
|
|
130
|
+
lat
|
|
131
|
+
lon
|
|
132
|
+
}
|
|
133
|
+
vertexType
|
|
134
|
+
}
|
|
135
|
+
headsign
|
|
136
|
+
interlineWithPreviousLeg
|
|
137
|
+
intermediateStops {
|
|
138
|
+
lat
|
|
139
|
+
locationType
|
|
140
|
+
lon
|
|
141
|
+
name
|
|
142
|
+
stopCode: code
|
|
143
|
+
stopId: id
|
|
144
|
+
}
|
|
145
|
+
legGeometry {
|
|
146
|
+
length
|
|
147
|
+
points
|
|
148
|
+
}
|
|
149
|
+
mode
|
|
150
|
+
pickupBookingInfo {
|
|
151
|
+
contactInfo {
|
|
152
|
+
bookingUrl
|
|
153
|
+
infoUrl
|
|
154
|
+
phoneNumber
|
|
155
|
+
}
|
|
156
|
+
earliestBookingTime {
|
|
157
|
+
daysPrior
|
|
158
|
+
time
|
|
159
|
+
}
|
|
160
|
+
latestBookingTime {
|
|
161
|
+
daysPrior
|
|
162
|
+
time
|
|
163
|
+
}
|
|
164
|
+
message
|
|
165
|
+
}
|
|
166
|
+
pickupType
|
|
167
|
+
realTime
|
|
168
|
+
realtimeState
|
|
169
|
+
rentedBike
|
|
170
|
+
rideHailingEstimate {
|
|
171
|
+
arrival
|
|
172
|
+
maxPrice {
|
|
173
|
+
amount
|
|
174
|
+
currency {
|
|
175
|
+
code
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
minPrice {
|
|
179
|
+
amount
|
|
180
|
+
currency {
|
|
181
|
+
code
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
provider {
|
|
185
|
+
id
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
route {
|
|
189
|
+
alerts {
|
|
190
|
+
alertDescriptionText
|
|
191
|
+
alertHeaderText
|
|
192
|
+
alertUrl
|
|
193
|
+
effectiveStartDate
|
|
194
|
+
id
|
|
195
|
+
}
|
|
196
|
+
color
|
|
197
|
+
gtfsId
|
|
198
|
+
id: gtfsId
|
|
199
|
+
longName
|
|
200
|
+
shortName
|
|
201
|
+
textColor
|
|
202
|
+
type
|
|
203
|
+
}
|
|
204
|
+
startTime
|
|
205
|
+
steps {
|
|
206
|
+
absoluteDirection
|
|
207
|
+
alerts {
|
|
208
|
+
alertDescriptionText
|
|
209
|
+
alertHeaderText
|
|
210
|
+
alertUrl
|
|
211
|
+
effectiveStartDate
|
|
212
|
+
id
|
|
213
|
+
}
|
|
214
|
+
area
|
|
215
|
+
distance
|
|
216
|
+
elevationProfile {
|
|
217
|
+
distance
|
|
218
|
+
elevation
|
|
219
|
+
}
|
|
220
|
+
lat
|
|
221
|
+
lon
|
|
222
|
+
relativeDirection
|
|
223
|
+
stayOn
|
|
224
|
+
streetName
|
|
225
|
+
}
|
|
226
|
+
to {
|
|
227
|
+
lat
|
|
228
|
+
lon
|
|
229
|
+
name
|
|
230
|
+
rentalVehicle {
|
|
231
|
+
id
|
|
232
|
+
network
|
|
233
|
+
}
|
|
234
|
+
stop {
|
|
235
|
+
alerts {
|
|
236
|
+
alertDescriptionText
|
|
237
|
+
alertHeaderText
|
|
238
|
+
alertUrl
|
|
239
|
+
effectiveStartDate
|
|
240
|
+
id
|
|
241
|
+
}
|
|
242
|
+
code
|
|
243
|
+
gtfsId
|
|
244
|
+
id
|
|
245
|
+
lat
|
|
246
|
+
lon
|
|
247
|
+
}
|
|
248
|
+
vertexType
|
|
249
|
+
}
|
|
250
|
+
transitLeg
|
|
251
|
+
trip {
|
|
252
|
+
arrivalStoptime {
|
|
253
|
+
stop {
|
|
254
|
+
gtfsId
|
|
255
|
+
id
|
|
256
|
+
}
|
|
257
|
+
stopPosition
|
|
258
|
+
}
|
|
259
|
+
departureStoptime {
|
|
260
|
+
stop {
|
|
261
|
+
gtfsId
|
|
262
|
+
id
|
|
263
|
+
}
|
|
264
|
+
stopPosition
|
|
265
|
+
}
|
|
266
|
+
gtfsId
|
|
267
|
+
id
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
startTime
|
|
271
|
+
transfers: numberOfTransfers
|
|
272
|
+
waitingTime
|
|
273
|
+
walkTime
|
|
274
|
+
}
|
|
275
|
+
routingErrors {
|
|
276
|
+
code
|
|
277
|
+
description
|
|
278
|
+
inputField
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
package/esm/profile.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function filterProfileOptions(response) {
|
|
2
|
-
// Filter out similar options. TODO: handle on server
|
|
2
|
+
// Filter out similar options. TODO: handle on server?
|
|
3
3
|
var optStrs = [];
|
|
4
4
|
var filteredIndices = [];
|
|
5
5
|
var filteredProfile = response.otp.profile.filter(function (option, i) {
|
package/esm/profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/profile.js"],"names":["filterProfileOptions","response","optStrs","filteredIndices","filteredProfile","otp","profile","filter","option","i","optStr","access","map","a","mode","join","transit","routes","route","id","indexOf","push","filteredJourneys","journeys","journey","locationString","str","split","accessToLeg","origin","destination","duration","time","transitLeg","from","name","to","optionToItinerary","query","itin","legs","walkTime","waitingTime","length","status","walkOnEdges","bikeEdges","walkOffEdges","onStationName","walkOnTime","offStationName","walkOffTime","streetEdges","forEach","edge","bikeRentalOffStation","distance","bikeRentalOnStation","fromName","toName","rideStats","avg","averageWait","waitStats","egress","profileOptionsToItineraries","options"],"mappings":"AAAA,OAAO,SAASA,oBAAT,CAA8BC,QAA9B,EAAwC;AAC7C;AACA,MAAMC,OAAO,GAAG,EAAhB;AACA,MAAMC,eAAe,GAAG,EAAxB;AAEA,MAAMC,eAAe,GAAGH,QAAQ,CAACI,GAAT,CAAaC,OAAb,CAAqBC,MAArB,CAA4B,UAACC,MAAD,EAASC,CAAT,EAAe;AACjE,QAAIC,MAAM,GAAGF,MAAM,CAACG,MAAP,CAAcC,GAAd,CAAkB,UAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,IAAN;AAAA,KAAnB,EAA+BC,IAA/B,CAAoC,GAApC,CAAb;;AACA,QAAIP,MAAM,CAACQ,OAAX,EAAoB;AAClBN,MAAAA,MAAM,kBAAWF,MAAM,CAACQ,OAAP,CACdJ,GADc,CACV,UAAAI,OAAO,EAAI;AACd,eAAOA,OAAO,CAACC,MAAR,CAAeL,GAAf,CAAmB,UAAAM,KAAK;AAAA,iBAAIA,KAAK,CAACC,EAAV;AAAA,SAAxB,EAAsCJ,IAAtC,CAA2C,GAA3C,CAAP;AACD,OAHc,EAIdA,IAJc,CAIT,GAJS,CAAX,CAAN;AAKD;;AACD,QAAIb,OAAO,CAACkB,OAAR,CAAgBV,MAAhB,MAA4B,CAAC,CAAjC,EAAoC,OAAO,KAAP;AACpCR,IAAAA,OAAO,CAACmB,IAAR,CAAaX,MAAb;AACAP,IAAAA,eAAe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AAwB,CAAvC,EAA0CgB,MAD/B,GAEX,IAFJ;AAIApB,IAAAA,IAAI,CAACC,IAAL,CAAUnB,IAAV,CACEO,WAAW,CAACpB,MAAM,CAACwD,MAAP,CAAc,CAAd,CAAD,EAAmBnC,MAAnB,EAA2BS,KAAK,IAAIA,KAAK,CAACF,EAAN,CAASD,IAA7C,CADb;AAGA,QAAI3B,MAAM,CAACwD,MAAP,CAAc,CAAd,EAAiBlD,IAAjB,KAA0B,MAA9B,EACEyB,IAAI,CAACE,QAAL,IAAiBjC,MAAM,CAACwD,MAAP,CAAc,CAAd,EAAiBhC,IAAlC;AACH;;AAED,SAAOO,IAAP;AACD;AAED;;;AAEA,OAAO,SAAS0B,2BAAT,CAAqCC,OAArC,EAA8C5B,KAA9C,EAAqD;AAC1D,SAAO4B,OAAO,CAACtD,GAAR,CAAY,UAAAJ,MAAM;AAAA,WAAI6B,iBAAiB,CAAC7B,MAAD,EAAS8B,KAAT,CAArB;AAAA,GAAlB,CAAP;AACD","sourcesContent":["export function filterProfileOptions(response) {\n // Filter out similar options. TODO: handle on server??\n const optStrs = [];\n const filteredIndices = [];\n\n const filteredProfile = response.otp.profile.filter((option, i) => {\n let optStr = option.access.map(a => a.mode).join(\"/\");\n if (option.transit) {\n optStr += ` to ${option.transit\n .map(transit => {\n return transit.routes.map(route => route.id).join(\"/\");\n })\n .join(\",\")}`;\n }\n if (optStrs.indexOf(optStr) !== -1) return false;\n optStrs.push(optStr);\n filteredIndices.push(i);\n return true;\n });\n\n const filteredJourneys = response.otp.journeys.filter(\n (journey, i) => filteredIndices.indexOf(i) !== -1\n );\n\n response.otp.profile = filteredProfile;\n response.otp.journeys = filteredJourneys;\n return response;\n}\n\nfunction locationString(str) {\n return str?.split(\",\")[0];\n}\n\nfunction accessToLeg(access, origin, destination) {\n return {\n mode: access.mode,\n duration: access.time,\n transitLeg: false,\n from: {\n name: locationString(origin)\n },\n to: {\n name: locationString(destination)\n }\n };\n}\n\n// helper functions for profileOptionsToItineraries:\n\nfunction optionToItinerary(option, query) {\n const itin = {\n duration: option.time,\n legs: [],\n walkTime: 0,\n waitingTime: 0\n };\n\n // access leg\n if (option.access && option.access.length > 0) {\n if (option.access[0].mode === \"BICYCLE_RENT\") {\n let status = \"WALK_ON\";\n const walkOnEdges = [];\n const bikeEdges = [];\n const walkOffEdges = [];\n let onStationName;\n let walkOnTime = 0;\n let offStationName;\n let walkOffTime = 0;\n option.access[0].streetEdges.forEach(edge => {\n // check if we're returning the bike\n if (edge.bikeRentalOffStation) {\n status = \"WALK_OFF\";\n offStationName = edge.bikeRentalOffStation.name;\n }\n\n if (status === \"WALK_ON\") {\n walkOnEdges.push(edge);\n walkOnTime += edge.distance;\n } else if (status === \"BIKE\") {\n bikeEdges.push(edge);\n } else if (status === \"WALK_OFF\") {\n walkOffEdges.push(edge);\n walkOffTime += edge.distance;\n }\n\n // check if we're picking up the bike\n if (edge.bikeRentalOnStation) {\n status = \"BIKE\";\n onStationName = edge.bikeRentalOnStation.name;\n }\n });\n\n itin.walkTime += walkOnTime + walkOffTime;\n\n // create the 'on' walk leg\n itin.legs.push({\n mode: \"WALK\",\n duration: walkOnTime,\n transitLeg: false,\n from: {\n name: locationString(query && query.from.name)\n },\n to: {\n name: onStationName\n }\n });\n\n // create the bike leg\n itin.legs.push({\n mode: \"BICYCLE_RENT\",\n duration: option.time - walkOnTime - walkOffTime,\n transitLeg: false,\n from: {\n name: onStationName\n },\n to: {\n name: offStationName\n }\n });\n\n // create the 'off' walk leg\n itin.legs.push({\n mode: \"WALK\",\n duration: walkOffTime,\n transitLeg: false,\n from: {\n name: offStationName\n },\n to: {\n name: locationString(query && query.to.name)\n }\n });\n } else {\n itin.legs.push(\n accessToLeg(\n option.access[0],\n query && query.from.name,\n option.transit ? null : query && query.to.name\n )\n );\n if (option.access[0].mode === \"WALK\")\n itin.walkTime += option.access[0].time;\n }\n }\n\n // transit legs\n if (option.transit) {\n option.transit.forEach(transit => {\n itin.legs.push({\n transitLeg: true,\n mode: transit.mode,\n from: {\n name: transit.fromName\n },\n to: {\n name: transit.toName\n },\n routes: transit.routes,\n duration: transit.rideStats.avg,\n averageWait: transit.waitStats.avg\n });\n itin.waitingTime += transit.waitStats.avg;\n });\n }\n\n // egress leg\n if (option.egress && option.egress.length > 0) {\n // find the origin name, for transit trips\n const origin = option.transit\n ? option.transit[option.transit.length - 1].toName\n : null;\n\n itin.legs.push(\n accessToLeg(option.egress[0], origin, query && query.to.name)\n );\n if (option.egress[0].mode === \"WALK\")\n itin.walkTime += option.egress[0].time;\n }\n\n return itin;\n}\n\n/** profileOptionsToItineraries * */\n\nexport function profileOptionsToItineraries(options, query) {\n return options.map(option => optionToItinerary(option, query));\n}\n"],"file":"profile.js"}
|
|
1
|
+
{"version":3,"sources":["../src/profile.js"],"names":["filterProfileOptions","response","optStrs","filteredIndices","filteredProfile","otp","profile","filter","option","i","optStr","access","map","a","mode","join","transit","routes","route","id","indexOf","push","filteredJourneys","journeys","journey","locationString","str","split","accessToLeg","origin","destination","duration","time","transitLeg","from","name","to","optionToItinerary","query","itin","legs","walkTime","waitingTime","length","status","walkOnEdges","bikeEdges","walkOffEdges","onStationName","walkOnTime","offStationName","walkOffTime","streetEdges","forEach","edge","bikeRentalOffStation","distance","bikeRentalOnStation","fromName","toName","rideStats","avg","averageWait","waitStats","egress","profileOptionsToItineraries","options"],"mappings":"AAAA,OAAO,SAASA,oBAAT,CAA8BC,QAA9B,EAAwC;AAC7C;AACA,MAAMC,OAAO,GAAG,EAAhB;AACA,MAAMC,eAAe,GAAG,EAAxB;AAEA,MAAMC,eAAe,GAAGH,QAAQ,CAACI,GAAT,CAAaC,OAAb,CAAqBC,MAArB,CAA4B,UAACC,MAAD,EAASC,CAAT,EAAe;AACjE,QAAIC,MAAM,GAAGF,MAAM,CAACG,MAAP,CAAcC,GAAd,CAAkB,UAAAC,CAAC;AAAA,aAAIA,CAAC,CAACC,IAAN;AAAA,KAAnB,EAA+BC,IAA/B,CAAoC,GAApC,CAAb;;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C,MATH;AAUbc,QAAAA,QAAQ,EAAEf,OAAO,CAAC4C,SAAR,CAAkBC,GAVf;AAWbC,QAAAA,WAAW,EAAE9C,OAAO,CAAC+C,SAAR,CAAkBF;AAXlB,OAAf;AAaAtB,MAAAA,IAAI,CAACG,WAAL,IAAoB1B,OAAO,CAAC+C,SAAR,CAAkBF,GAAtC;AACD,KAfD;AAgBD,GAlHuC,CAoHxC;;;AACA,MAAIrD,MAAM,CAACwD,MAAP,IAAiBxD,MAAM,CAACwD,MAAP,CAAcrB,MAAd,GAAuB,CAA5C,EAA+C;AAC7C;AACA,QAAMd,MAAM,GAAGrB,MAAM,CAACQ,OAAP,GACXR,MAAM,CAACQ,OAAP,CAAeR,MAAM,CAACQ,OAAP,CAAe2B,MAAf,GAAwB,CAAvC,EAA0CgB,MAD/B,GAEX,IAFJ;AAIApB,IAAAA,IAAI,CAACC,IAAL,CAAUnB,IAAV,CACEO,WAAW,CAACpB,MAAM,CAACwD,MAAP,CAAc,CAAd,CAAD,EAAmBnC,MAAnB,EAA2BS,KAAK,IAAIA,KAAK,CAACF,EAAN,CAASD,IAA7C,CADb;AAGA,QAAI3B,MAAM,CAACwD,MAAP,CAAc,CAAd,EAAiBlD,IAAjB,KAA0B,MAA9B,EACEyB,IAAI,CAACE,QAAL,IAAiBjC,MAAM,CAACwD,MAAP,CAAc,CAAd,EAAiBhC,IAAlC;AACH;;AAED,SAAOO,IAAP;AACD;AAED;;;AAEA,OAAO,SAAS0B,2BAAT,CAAqCC,OAArC,EAA8C5B,KAA9C,EAAqD;AAC1D,SAAO4B,OAAO,CAACtD,GAAR,CAAY,UAAAJ,MAAM;AAAA,WAAI6B,iBAAiB,CAAC7B,MAAD,EAAS8B,KAAT,CAArB;AAAA,GAAlB,CAAP;AACD","sourcesContent":["export function filterProfileOptions(response) {\n // Filter out similar options. TODO: handle on server?\n const optStrs = [];\n const filteredIndices = [];\n\n const filteredProfile = response.otp.profile.filter((option, i) => {\n let optStr = option.access.map(a => a.mode).join(\"/\");\n if (option.transit) {\n optStr += ` to ${option.transit\n .map(transit => {\n return transit.routes.map(route => route.id).join(\"/\");\n })\n .join(\",\")}`;\n }\n if (optStrs.indexOf(optStr) !== -1) return false;\n optStrs.push(optStr);\n filteredIndices.push(i);\n return true;\n });\n\n const filteredJourneys = response.otp.journeys.filter(\n (journey, i) => filteredIndices.indexOf(i) !== -1\n );\n\n response.otp.profile = filteredProfile;\n response.otp.journeys = filteredJourneys;\n return response;\n}\n\nfunction locationString(str) {\n return str?.split(\",\")[0];\n}\n\nfunction accessToLeg(access, origin, destination) {\n return {\n mode: access.mode,\n duration: access.time,\n transitLeg: false,\n from: {\n name: locationString(origin)\n },\n to: {\n name: locationString(destination)\n }\n };\n}\n\n// helper functions for profileOptionsToItineraries:\n\nfunction optionToItinerary(option, query) {\n const itin = {\n duration: option.time,\n legs: [],\n walkTime: 0,\n waitingTime: 0\n };\n\n // access leg\n if (option.access && option.access.length > 0) {\n if (option.access[0].mode === \"BICYCLE_RENT\") {\n let status = \"WALK_ON\";\n const walkOnEdges = [];\n const bikeEdges = [];\n const walkOffEdges = [];\n let onStationName;\n let walkOnTime = 0;\n let offStationName;\n let walkOffTime = 0;\n option.access[0].streetEdges.forEach(edge => {\n // check if we're returning the bike\n if (edge.bikeRentalOffStation) {\n status = \"WALK_OFF\";\n offStationName = edge.bikeRentalOffStation.name;\n }\n\n if (status === \"WALK_ON\") {\n walkOnEdges.push(edge);\n walkOnTime += edge.distance;\n } else if (status === \"BIKE\") {\n bikeEdges.push(edge);\n } else if (status === \"WALK_OFF\") {\n walkOffEdges.push(edge);\n walkOffTime += edge.distance;\n }\n\n // check if we're picking up the bike\n if (edge.bikeRentalOnStation) {\n status = \"BIKE\";\n onStationName = edge.bikeRentalOnStation.name;\n }\n });\n\n itin.walkTime += walkOnTime + walkOffTime;\n\n // create the 'on' walk leg\n itin.legs.push({\n mode: \"WALK\",\n duration: walkOnTime,\n transitLeg: false,\n from: {\n name: locationString(query && query.from.name)\n },\n to: {\n name: onStationName\n }\n });\n\n // create the bike leg\n itin.legs.push({\n mode: \"BICYCLE_RENT\",\n duration: option.time - walkOnTime - walkOffTime,\n transitLeg: false,\n from: {\n name: onStationName\n },\n to: {\n name: offStationName\n }\n });\n\n // create the 'off' walk leg\n itin.legs.push({\n mode: \"WALK\",\n duration: walkOffTime,\n transitLeg: false,\n from: {\n name: offStationName\n },\n to: {\n name: locationString(query && query.to.name)\n }\n });\n } else {\n itin.legs.push(\n accessToLeg(\n option.access[0],\n query && query.from.name,\n option.transit ? null : query && query.to.name\n )\n );\n if (option.access[0].mode === \"WALK\")\n itin.walkTime += option.access[0].time;\n }\n }\n\n // transit legs\n if (option.transit) {\n option.transit.forEach(transit => {\n itin.legs.push({\n transitLeg: true,\n mode: transit.mode,\n from: {\n name: transit.fromName\n },\n to: {\n name: transit.toName\n },\n routes: transit.routes,\n duration: transit.rideStats.avg,\n averageWait: transit.waitStats.avg\n });\n itin.waitingTime += transit.waitStats.avg;\n });\n }\n\n // egress leg\n if (option.egress && option.egress.length > 0) {\n // find the origin name, for transit trips\n const origin = option.transit\n ? option.transit[option.transit.length - 1].toName\n : null;\n\n itin.legs.push(\n accessToLeg(option.egress[0], origin, query && query.to.name)\n );\n if (option.egress[0].mode === \"WALK\")\n itin.walkTime += option.egress[0].time;\n }\n\n return itin;\n}\n\n/** profileOptionsToItineraries * */\n\nexport function profileOptionsToItineraries(options, query) {\n return options.map(option => optionToItinerary(option, query));\n}\n"],"file":"profile.js"}
|
package/esm/query-gen.js
CHANGED
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
7
7
|
|
|
8
8
|
import { print } from "graphql";
|
|
9
|
-
var DefaultPlanQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "Plan" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "arriveBy" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "banned" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputBanned" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "bikeReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "carReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "date" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "fromPlace" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "modes" } }, type: { kind: "ListType", type: { kind: "NamedType", name: { kind: "Name", value: "TransportMode" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "numItineraries" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "preferred" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputPreferred" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "time" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "toPlace" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "unpreferred" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputUnpreferred" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "walkReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "walkSpeed" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "wheelchair" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "plan" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "arriveBy" }, value: { kind: "Variable", name: { kind: "Name", value: "arriveBy" } } }, { kind: "Argument", name: { kind: "Name", value: "banned" }, value: { kind: "Variable", name: { kind: "Name", value: "banned" } } }, { kind: "Argument", name: { kind: "Name", value: "bikeReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "bikeReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "carReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "carReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "date" }, value: { kind: "Variable", name: { kind: "Name", value: "date" } } }, { kind: "Argument", name: { kind: "Name", value: "fromPlace" }, value: { kind: "Variable", name: { kind: "Name", value: "fromPlace" } } }, { kind: "Argument", name: { kind: "Name", value: "locale" }, value: { kind: "StringValue", value: "en", block: false } }, { kind: "Argument", name: { kind: "Name", value: "numItineraries" }, value: { kind: "Variable", name: { kind: "Name", value: "numItineraries" } } }, { kind: "Argument", name: { kind: "Name", value: "preferred" }, value: { kind: "Variable", name: { kind: "Name", value: "preferred" } } }, { kind: "Argument", name: { kind: "Name", value: "time" }, value: { kind: "Variable", name: { kind: "Name", value: "time" } } }, { kind: "Argument", name: { kind: "Name", value: "toPlace" }, value: { kind: "Variable", name: { kind: "Name", value: "toPlace" } } }, { kind: "Argument", name: { kind: "Name", value: "transportModes" }, value: { kind: "Variable", name: { kind: "Name", value: "modes" } } }, { kind: "Argument", name: { kind: "Name", value: "unpreferred" }, value: { kind: "Variable", name: { kind: "Name", value: "unpreferred" } } }, { kind: "Argument", name: { kind: "Name", value: "walkReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "walkReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "walkSpeed" }, value: { kind: "Variable", name: { kind: "Name", value: "walkSpeed" } } }, { kind: "Argument", name: { kind: "Name", value: "wheelchair" }, value: { kind: "Variable", name: { kind: "Name", value: "wheelchair" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "itineraries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "accessibilityScore" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "duration" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "endTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "legs" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "accessibilityScore" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "agency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "id" }, name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "timezone" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "arrivalDelay" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "departureDelay" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "dropoffType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "duration" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "endTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "fareProducts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "product" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "medium" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "riderCategory" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DefaultFareProduct" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "price" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "digits" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "from" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentalVehicle" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "network" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "vertexType" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "headsign" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "interlineWithPreviousLeg" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "intermediateStops" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locationType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "stopCode" }, name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "stopId" }, name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "legGeometry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "length" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "points" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "pickupBookingInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "earliestBookingTime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "daysPrior" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "pickupType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "realTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "realtimeState" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentedBike" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rideHailingEstimate" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "arrival" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "maxPrice" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "minPrice" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "provider" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "route" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "color" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "id" }, name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "longName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "shortName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "textColor" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "startTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "steps" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "absoluteDirection" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "area" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "elevationProfile" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "elevation" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "relativeDirection" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "stayOn" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "streetName" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "to" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentalVehicle" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "network" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "vertexType" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "transitLeg" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "trip" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "arrivalStoptime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stopPosition" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "departureStoptime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stopPosition" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "startTime" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "transfers" }, name: { kind: "Name", value: "numberOfTransfers" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "waitingTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "walkTime" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "routingErrors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "description" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputField" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 4950, source: { body: "query Plan(\n $arriveBy: Boolean\n $banned: InputBanned\n $bikeReluctance: Float\n $carReluctance: Float\n $date: String\n $fromPlace: String!\n $modes: [TransportMode]\n $numItineraries: Int\n $preferred: InputPreferred\n $time: String\n $toPlace: String!\n $unpreferred: InputUnpreferred\n $walkReluctance: Float\n $walkSpeed: Float\n $wheelchair: Boolean\n) {\n plan(\n arriveBy: $arriveBy\n banned: $banned\n bikeReluctance: $bikeReluctance\n carReluctance: $carReluctance\n date: $date\n fromPlace: $fromPlace\n # Currently only supporting EN locale, used for times and text\n locale: \"en\"\n numItineraries: $numItineraries\n preferred: $preferred\n time: $time\n toPlace: $toPlace\n transportModes: $modes\n unpreferred: $unpreferred\n walkReluctance: $walkReluctance\n walkSpeed: $walkSpeed\n wheelchair: $wheelchair\n ) {\n itineraries {\n accessibilityScore\n duration\n endTime\n legs {\n accessibilityScore\n agency {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n gtfsId\n id: gtfsId\n name\n timezone\n url\n }\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n arrivalDelay\n departureDelay\n distance\n dropoffType\n duration\n endTime\n fareProducts {\n id\n product {\n __typename\n id\n medium {\n id\n name\n }\n name\n riderCategory {\n id\n name\n }\n ... on DefaultFareProduct {\n price {\n amount\n currency {\n code\n digits\n }\n }\n }\n }\n }\n from {\n lat\n lon\n name\n rentalVehicle {\n id\n network\n }\n stop {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n code\n gtfsId\n id\n lat\n lon\n }\n vertexType\n }\n headsign\n interlineWithPreviousLeg\n intermediateStops {\n lat\n locationType\n lon\n name\n stopCode: code\n stopId: id\n }\n legGeometry {\n length\n points\n }\n mode\n pickupBookingInfo {\n earliestBookingTime {\n daysPrior\n }\n }\n pickupType\n realTime\n realtimeState\n rentedBike\n rideHailingEstimate {\n arrival\n maxPrice {\n amount\n currency {\n code\n }\n }\n minPrice {\n amount\n currency {\n code\n }\n }\n provider {\n id\n }\n }\n route {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n color\n gtfsId\n id: gtfsId\n longName\n shortName\n textColor\n type\n }\n startTime\n steps {\n absoluteDirection\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n area\n distance\n elevationProfile {\n distance\n elevation\n }\n lat\n lon\n relativeDirection\n stayOn\n streetName\n }\n to {\n lat\n lon\n name\n rentalVehicle {\n id\n network\n }\n stop {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n code\n gtfsId\n id\n lat\n lon\n }\n vertexType\n }\n transitLeg\n trip {\n arrivalStoptime {\n stop {\n gtfsId\n id\n }\n stopPosition\n }\n departureStoptime {\n stop {\n gtfsId\n id\n }\n stopPosition\n }\n gtfsId\n id\n }\n }\n startTime\n transfers: numberOfTransfers\n waitingTime\n walkTime\n }\n routingErrors {\n code\n description\n inputField\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9
|
+
var DefaultPlanQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "Plan" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "arriveBy" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "banned" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputBanned" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "bikeReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "carReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "date" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "fromPlace" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "modes" } }, type: { kind: "ListType", type: { kind: "NamedType", name: { kind: "Name", value: "TransportMode" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "numItineraries" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "preferred" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputPreferred" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "time" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "toPlace" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "unpreferred" } }, type: { kind: "NamedType", name: { kind: "Name", value: "InputUnpreferred" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "walkReluctance" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "walkSpeed" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Float" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "wheelchair" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "plan" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "arriveBy" }, value: { kind: "Variable", name: { kind: "Name", value: "arriveBy" } } }, { kind: "Argument", name: { kind: "Name", value: "banned" }, value: { kind: "Variable", name: { kind: "Name", value: "banned" } } }, { kind: "Argument", name: { kind: "Name", value: "bikeReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "bikeReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "carReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "carReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "date" }, value: { kind: "Variable", name: { kind: "Name", value: "date" } } }, { kind: "Argument", name: { kind: "Name", value: "fromPlace" }, value: { kind: "Variable", name: { kind: "Name", value: "fromPlace" } } }, { kind: "Argument", name: { kind: "Name", value: "locale" }, value: { kind: "StringValue", value: "en", block: false } }, { kind: "Argument", name: { kind: "Name", value: "numItineraries" }, value: { kind: "Variable", name: { kind: "Name", value: "numItineraries" } } }, { kind: "Argument", name: { kind: "Name", value: "preferred" }, value: { kind: "Variable", name: { kind: "Name", value: "preferred" } } }, { kind: "Argument", name: { kind: "Name", value: "time" }, value: { kind: "Variable", name: { kind: "Name", value: "time" } } }, { kind: "Argument", name: { kind: "Name", value: "toPlace" }, value: { kind: "Variable", name: { kind: "Name", value: "toPlace" } } }, { kind: "Argument", name: { kind: "Name", value: "transportModes" }, value: { kind: "Variable", name: { kind: "Name", value: "modes" } } }, { kind: "Argument", name: { kind: "Name", value: "unpreferred" }, value: { kind: "Variable", name: { kind: "Name", value: "unpreferred" } } }, { kind: "Argument", name: { kind: "Name", value: "walkReluctance" }, value: { kind: "Variable", name: { kind: "Name", value: "walkReluctance" } } }, { kind: "Argument", name: { kind: "Name", value: "walkSpeed" }, value: { kind: "Variable", name: { kind: "Name", value: "walkSpeed" } } }, { kind: "Argument", name: { kind: "Name", value: "wheelchair" }, value: { kind: "Variable", name: { kind: "Name", value: "wheelchair" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "itineraries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "accessibilityScore" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "duration" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "endTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "legs" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "accessibilityScore" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "agency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "id" }, name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "timezone" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "arrivalDelay" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "departureDelay" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "dropOffBookingInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "contactInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "bookingUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "infoUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "phoneNumber" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "earliestBookingTime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "daysPrior" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "time" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "latestBookingTime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "daysPrior" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "time" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "message" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dropoffType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "duration" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "endTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "fareProducts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "product" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "medium" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "riderCategory" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "DefaultFareProduct" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "price" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "digits" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "from" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentalVehicle" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "network" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "vertexType" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "headsign" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "interlineWithPreviousLeg" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "intermediateStops" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locationType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "stopCode" }, name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "stopId" }, name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "legGeometry" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "length" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "points" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "pickupBookingInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "contactInfo" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "bookingUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "infoUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "phoneNumber" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "earliestBookingTime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "daysPrior" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "time" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "latestBookingTime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "daysPrior" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "time" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "message" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "pickupType" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "realTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "realtimeState" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentedBike" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rideHailingEstimate" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "arrival" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "maxPrice" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "minPrice" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "amount" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "currency" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "provider" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "route" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "color" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "id" }, name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "longName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "shortName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "textColor" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "startTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "steps" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "absoluteDirection" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "area" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "elevationProfile" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "distance" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "elevation" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "relativeDirection" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "stayOn" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "streetName" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "to" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "rentalVehicle" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "network" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alerts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "alertDescriptionText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertHeaderText" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "alertUrl" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "effectiveStartDate" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lat" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lon" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "vertexType" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "transitLeg" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "trip" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "arrivalStoptime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stopPosition" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "departureStoptime" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stop" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "stopPosition" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "gtfsId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "startTime" }, arguments: [], directives: [] }, { kind: "Field", alias: { kind: "Name", value: "transfers" }, name: { kind: "Name", value: "numberOfTransfers" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "waitingTime" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "walkTime" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "routingErrors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "description" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputField" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 5493, source: { body: "query Plan(\n $arriveBy: Boolean\n $banned: InputBanned\n $bikeReluctance: Float\n $carReluctance: Float\n $date: String\n $fromPlace: String!\n $modes: [TransportMode]\n $numItineraries: Int\n $preferred: InputPreferred\n $time: String\n $toPlace: String!\n $unpreferred: InputUnpreferred\n $walkReluctance: Float\n $walkSpeed: Float\n $wheelchair: Boolean\n) {\n plan(\n arriveBy: $arriveBy\n banned: $banned\n bikeReluctance: $bikeReluctance\n carReluctance: $carReluctance\n date: $date\n fromPlace: $fromPlace\n # Currently only supporting EN locale, used for times and text\n locale: \"en\"\n numItineraries: $numItineraries\n preferred: $preferred\n time: $time\n toPlace: $toPlace\n transportModes: $modes\n unpreferred: $unpreferred\n walkReluctance: $walkReluctance\n walkSpeed: $walkSpeed\n wheelchair: $wheelchair\n ) {\n itineraries {\n accessibilityScore\n duration\n endTime\n legs {\n accessibilityScore\n agency {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n gtfsId\n id: gtfsId\n name\n timezone\n url\n }\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n arrivalDelay\n departureDelay\n distance\n dropOffBookingInfo {\n contactInfo {\n bookingUrl\n infoUrl\n phoneNumber\n }\n earliestBookingTime {\n daysPrior\n time\n }\n latestBookingTime {\n daysPrior\n time\n }\n message\n }\n dropoffType\n duration\n endTime\n fareProducts {\n id\n product {\n __typename\n id\n medium {\n id\n name\n }\n name\n riderCategory {\n id\n name\n }\n ... on DefaultFareProduct {\n price {\n amount\n currency {\n code\n digits\n }\n }\n }\n }\n }\n from {\n lat\n lon\n name\n rentalVehicle {\n id\n network\n }\n stop {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n code\n gtfsId\n id\n lat\n lon\n }\n vertexType\n }\n headsign\n interlineWithPreviousLeg\n intermediateStops {\n lat\n locationType\n lon\n name\n stopCode: code\n stopId: id\n }\n legGeometry {\n length\n points\n }\n mode\n pickupBookingInfo {\n contactInfo {\n bookingUrl\n infoUrl\n phoneNumber\n }\n earliestBookingTime {\n daysPrior\n time\n }\n latestBookingTime {\n daysPrior\n time\n }\n message\n }\n pickupType\n realTime\n realtimeState\n rentedBike\n rideHailingEstimate {\n arrival\n maxPrice {\n amount\n currency {\n code\n }\n }\n minPrice {\n amount\n currency {\n code\n }\n }\n provider {\n id\n }\n }\n route {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n color\n gtfsId\n id: gtfsId\n longName\n shortName\n textColor\n type\n }\n startTime\n steps {\n absoluteDirection\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n area\n distance\n elevationProfile {\n distance\n elevation\n }\n lat\n lon\n relativeDirection\n stayOn\n streetName\n }\n to {\n lat\n lon\n name\n rentalVehicle {\n id\n network\n }\n stop {\n alerts {\n alertDescriptionText\n alertHeaderText\n alertUrl\n effectiveStartDate\n id\n }\n code\n gtfsId\n id\n lat\n lon\n }\n vertexType\n }\n transitLeg\n trip {\n arrivalStoptime {\n stop {\n gtfsId\n id\n }\n stopPosition\n }\n departureStoptime {\n stop {\n gtfsId\n id\n }\n stopPosition\n }\n gtfsId\n id\n }\n }\n startTime\n transfers: numberOfTransfers\n waitingTime\n walkTime\n }\n routingErrors {\n code\n description\n inputField\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Mode Settings can contain additional modes to add to the query,
|
|
@@ -22,7 +22,7 @@ export function extractAdditionalModes(modeSettings, enabledModes) {
|
|
|
22
22
|
return m.mode;
|
|
23
23
|
}).includes(cur.applicableMode)) {
|
|
24
24
|
return prev;
|
|
25
|
-
} // In checkboxes
|
|
25
|
+
} // In checkboxes, mode must be enabled and have a transport mode in it
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
if ((cur.type === "CHECKBOX" || cur.type === "SUBMODE") && cur.addTransportMode && cur.value) {
|
|
@@ -82,6 +82,7 @@ export var SIMPLIFICATIONS = {
|
|
|
82
82
|
FUNICULAR: "TRANSIT",
|
|
83
83
|
GONDOLA: "TRANSIT",
|
|
84
84
|
RAIL: "TRANSIT",
|
|
85
|
+
MONORAIL: "TRANSIT",
|
|
85
86
|
SCOOTER: "PERSONAL",
|
|
86
87
|
SUBWAY: "TRANSIT",
|
|
87
88
|
TROLLEYBUS: "TRANSIT",
|
|
@@ -184,7 +185,8 @@ export function generateOtp2Query(_ref) {
|
|
|
184
185
|
numItineraries = _ref.numItineraries,
|
|
185
186
|
preferred = _ref.preferred,
|
|
186
187
|
time = _ref.time,
|
|
187
|
-
to = _ref.to
|
|
188
|
+
to = _ref.to,
|
|
189
|
+
unpreferred = _ref.unpreferred;
|
|
188
190
|
var planQuery = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DefaultPlanQuery;
|
|
189
191
|
// This extracts the values from the mode settings to key value pairs
|
|
190
192
|
var modeSettingValues = modeSettings.reduce(function (prev, cur) {
|
|
@@ -215,12 +217,13 @@ export function generateOtp2Query(_ref) {
|
|
|
215
217
|
bikeReluctance: bikeReluctance,
|
|
216
218
|
carReluctance: carReluctance,
|
|
217
219
|
date: date,
|
|
218
|
-
fromPlace: "".concat(from.name, "::").concat(from.lat, ",").concat(from.lon
|
|
220
|
+
fromPlace: "".concat(from.name, "::").concat(from.lat, ",").concat(from.lon),
|
|
219
221
|
modes: modes,
|
|
220
222
|
numItineraries: numItineraries,
|
|
221
223
|
preferred: preferred,
|
|
222
224
|
time: time,
|
|
223
|
-
toPlace: "".concat(to.name, "::").concat(to.lat, ",").concat(to.lon
|
|
225
|
+
toPlace: "".concat(to.name, "::").concat(to.lat, ",").concat(to.lon),
|
|
226
|
+
unpreferred: unpreferred,
|
|
224
227
|
walkReluctance: walkReluctance,
|
|
225
228
|
walkSpeed: walkSpeed,
|
|
226
229
|
wheelchair: wheelchair
|