@opentripplanner/core-utils 9.0.0-alpha.15 → 9.0.0-alpha.17

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.
@@ -1,161 +1,169 @@
1
1
  query PlanQuery(
2
- $fromPlace: String!,
3
- $toPlace: String!,
4
- $modes: [TransportMode],
5
- $time: String,
6
- $date: String,
7
- $wheelchair: Boolean,
8
- $bikeReluctance: Float,
9
- $carReluctance: Float,
10
- $walkReluctance: Float,
11
- $arriveBy: Boolean,
12
- $intermediatePlaces: [InputCoordinates],
13
- $preferred: InputPreferred,
14
- $unpreferred: InputUnpreferred,
15
- $banned: InputBanned,
16
- $numItineraries: Int,
2
+ $fromPlace: String!
3
+ $toPlace: String!
4
+ $modes: [TransportMode]
5
+ $time: String
6
+ $date: String
7
+ $wheelchair: Boolean
8
+ $bikeReluctance: Float
9
+ $carReluctance: Float
10
+ $walkReluctance: Float
11
+ $arriveBy: Boolean
12
+ $intermediatePlaces: [InputCoordinates]
13
+ $preferred: InputPreferred
14
+ $unpreferred: InputUnpreferred
15
+ $banned: InputBanned
16
+ $numItineraries: Int
17
17
  ) {
18
- plan(
19
- fromPlace: $fromPlace
20
- toPlace: $toPlace
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,
27
- bikeReluctance: $bikeReluctance,
28
- carReluctance: $carReluctance,
29
- walkReluctance: $walkReluctance,
30
- arriveBy: $arriveBy,
31
- intermediatePlaces: $intermediatePlaces,
32
- preferred: $preferred,
33
- unpreferred: $unpreferred,
34
- banned: $banned,
35
- numItineraries: $numItineraries,
36
- ) {
37
- routingErrors {
18
+ plan(
19
+ fromPlace: $fromPlace
20
+ toPlace: $toPlace
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
27
+ bikeReluctance: $bikeReluctance
28
+ carReluctance: $carReluctance
29
+ walkReluctance: $walkReluctance
30
+ arriveBy: $arriveBy
31
+ intermediatePlaces: $intermediatePlaces
32
+ preferred: $preferred
33
+ unpreferred: $unpreferred
34
+ banned: $banned
35
+ numItineraries: $numItineraries
36
+ ) {
37
+ routingErrors {
38
38
  code
39
39
  inputField
40
40
  description
41
41
  }
42
- itineraries {
43
- duration
44
- endTime
45
- startTime
46
- waitingTime
47
- walkTime
48
- legs {
49
- rentedBike
42
+ itineraries {
43
+ duration
44
+ endTime
45
+ startTime
46
+ waitingTime
47
+ walkTime
48
+ legs {
49
+ rentedBike
50
50
  interlineWithPreviousLeg
51
- departureDelay
52
- arrivalDelay
53
- distance
54
- duration
55
- endTime
56
- mode
57
- realTime
58
- realtimeState
59
- startTime
60
- transitLeg
61
- trip {
62
- id
63
- gtfsId
64
- tripHeadsign
65
- }
66
- agency {
67
- name
68
- id
69
- timezone
70
- url
71
- alerts {
51
+ departureDelay
52
+ arrivalDelay
53
+ distance
54
+ duration
55
+ endTime
56
+ mode
57
+ realTime
58
+ realtimeState
59
+ startTime
60
+ transitLeg
61
+ trip {
62
+ id
63
+ gtfsId
64
+ tripHeadsign
65
+ }
66
+ agency {
67
+ name
68
+ id
69
+ timezone
70
+ url
71
+ alerts {
72
72
  alertHeaderText
73
73
  alertDescriptionText
74
74
  alertUrl
75
75
  effectiveStartDate
76
76
  }
77
- }
78
- legGeometry {
79
- length
80
- points
81
- }
82
- intermediateStops {
83
- lat
84
- lon
85
- name
86
- stopCode: code
87
- stopId: id
88
- locationType
89
- }
90
- route {
91
- shortName
92
- longName
93
- color
94
- textColor
95
- id
96
- type
97
- alerts {
77
+ }
78
+ legGeometry {
79
+ length
80
+ points
81
+ }
82
+ intermediateStops {
83
+ lat
84
+ lon
85
+ name
86
+ stopCode: code
87
+ stopId: id
88
+ locationType
89
+ }
90
+ route {
91
+ shortName
92
+ longName
93
+ color
94
+ textColor
95
+ id
96
+ type
97
+ alerts {
98
98
  alertHeaderText
99
99
  alertDescriptionText
100
100
  alertUrl
101
101
  effectiveStartDate
102
102
  }
103
- }
104
- from {
105
- lat
106
- lon
107
- name
108
- vertexType
109
- stop {
110
- id
111
- code
112
- gtfsId
113
- alerts {
114
- alertHeaderText
115
- alertDescriptionText
116
- alertUrl
117
- effectiveStartDate
118
- }
119
- }
120
- }
121
- to {
122
- lat
123
- lon
124
- name
125
- vertexType
126
- stop {
127
- id
128
- code
129
- gtfsId
130
- alerts {
131
- alertHeaderText
132
- alertDescriptionText
133
- alertUrl
134
- effectiveStartDate
135
- }
136
- }
137
- }
138
- steps {
139
- distance
140
- lat
141
- lon
103
+ }
104
+ from {
105
+ lat
106
+ lon
107
+ name
108
+ stopIndex
109
+ vertexType
110
+ rentalVehicle {
111
+ network
112
+ }
113
+ stop {
114
+ id
115
+ code
116
+ gtfsId
117
+ alerts {
118
+ alertHeaderText
119
+ alertDescriptionText
120
+ alertUrl
121
+ effectiveStartDate
122
+ }
123
+ }
124
+ }
125
+ to {
126
+ lat
127
+ lon
128
+ name
129
+ stopIndex
130
+ vertexType
131
+ rentalVehicle {
132
+ network
133
+ }
134
+ stop {
135
+ id
136
+ code
137
+ gtfsId
138
+ alerts {
139
+ alertHeaderText
140
+ alertDescriptionText
141
+ alertUrl
142
+ effectiveStartDate
143
+ }
144
+ }
145
+ }
146
+ steps {
147
+ distance
148
+ lat
149
+ lon
142
150
  relativeDirection
143
151
  absoluteDirection
144
152
  stayOn
145
153
  streetName
146
154
  area
147
- alerts{
155
+ alerts {
148
156
  alertHeaderText
149
157
  alertDescriptionText
150
158
  alertUrl
151
159
  effectiveStartDate
152
160
  }
153
- elevationProfile {
154
- distance
155
- elevation
156
- }
157
- }
158
- }
159
- }
160
- }
161
+ elevationProfile {
162
+ distance
163
+ elevation
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
161
169
  }
package/src/query-gen.ts CHANGED
@@ -8,6 +8,20 @@ import {
8
8
 
9
9
  import PlanQuery from "./planQuery.graphql";
10
10
 
11
+ type InputBanned = {
12
+ routes?: string;
13
+ agencies?: string;
14
+ trips?: string;
15
+ stops?: string;
16
+ stopsHard?: string;
17
+ };
18
+
19
+ type InputPreferred = {
20
+ routes?: string;
21
+ agencies?: string;
22
+ unpreferredCost?: string;
23
+ };
24
+
11
25
  type OTPQueryParams = {
12
26
  arriveBy: boolean;
13
27
  date?: string;
@@ -17,6 +31,8 @@ type OTPQueryParams = {
17
31
  time?: string;
18
32
  numItineraries?: number;
19
33
  to: LonLatOutput & { name?: string };
34
+ banned?: InputBanned;
35
+ preferred?: InputPreferred;
20
36
  };
21
37
 
22
38
  type GraphQLQuery = {
@@ -181,11 +197,13 @@ export function generateCombinations(params: OTPQueryParams): OTPQueryParams[] {
181
197
 
182
198
  export function generateOtp2Query({
183
199
  arriveBy,
200
+ banned,
184
201
  date,
185
202
  from,
186
203
  modes,
187
204
  modeSettings,
188
205
  numItineraries,
206
+ preferred,
189
207
  time,
190
208
  to
191
209
  }: OTPQueryParams): GraphQLQuery {
@@ -209,12 +227,14 @@ export function generateOtp2Query({
209
227
  query: print(PlanQuery),
210
228
  variables: {
211
229
  arriveBy,
230
+ banned,
212
231
  bikeReluctance,
213
232
  carReluctance,
214
233
  date,
215
234
  fromPlace: `${from.name}::${from.lat},${from.lon}}`,
216
235
  modes,
217
236
  numItineraries,
237
+ preferred,
218
238
  time,
219
239
  toPlace: `${to.name}::${to.lat},${to.lon}}`,
220
240
  walkReluctance,