@tiducto/spider-sdk-typescript 1.10.0 → 1.12.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.
Files changed (51) hide show
  1. package/dist/contract/routing/DepartureBoard.d.ts +5 -2
  2. package/dist/contract/routing/DepartureBoard.d.ts.map +1 -1
  3. package/dist/contract/routing/DeparturesRequest.d.ts +5 -5
  4. package/dist/contract/routing/DeparturesRequest.d.ts.map +1 -1
  5. package/dist/contract/routing/DeparturesResponse.d.ts +1 -1
  6. package/dist/contract/routing/DeparturesResponse.d.ts.map +1 -1
  7. package/dist/contract/routing/Leg.d.ts +3 -0
  8. package/dist/contract/routing/Leg.d.ts.map +1 -1
  9. package/dist/contract/routing/ParentStation.d.ts +6 -0
  10. package/dist/contract/routing/ParentStation.d.ts.map +1 -0
  11. package/dist/contract/routing/ParentStation.js +2 -0
  12. package/dist/contract/routing/ParentStation.js.map +1 -0
  13. package/dist/contract/routing/PlanTransitModesInput.d.ts +4 -1
  14. package/dist/contract/routing/PlanTransitModesInput.d.ts.map +1 -1
  15. package/dist/contract/routing/RoutingError.d.ts +1 -1
  16. package/dist/contract/routing/RoutingError.d.ts.map +1 -1
  17. package/dist/contract/routing/Stop.d.ts +3 -0
  18. package/dist/contract/routing/Stop.d.ts.map +1 -1
  19. package/dist/contract/routing/StopDeparturesStoptime.d.ts +5 -2
  20. package/dist/contract/routing/StopDeparturesStoptime.d.ts.map +1 -1
  21. package/dist/contract/routing/TransitModeCostInput.d.ts +8 -0
  22. package/dist/contract/routing/TransitModeCostInput.d.ts.map +1 -0
  23. package/dist/contract/routing/TransitModeCostInput.js +2 -0
  24. package/dist/contract/routing/TransitModeCostInput.js.map +1 -0
  25. package/dist/contract/routing/TripStop.d.ts +3 -0
  26. package/dist/contract/routing/TripStop.d.ts.map +1 -1
  27. package/dist/contract/routing/TripTimetable.d.ts +3 -0
  28. package/dist/contract/routing/TripTimetable.d.ts.map +1 -1
  29. package/dist/contract/routing/TripVehicle.d.ts +17 -0
  30. package/dist/contract/routing/TripVehicle.d.ts.map +1 -0
  31. package/dist/contract/routing/TripVehicle.js +2 -0
  32. package/dist/contract/routing/TripVehicle.js.map +1 -0
  33. package/dist/contract/routing/index.d.ts +3 -0
  34. package/dist/contract/routing/index.d.ts.map +1 -1
  35. package/dist/contractVersion.d.ts +1 -1
  36. package/dist/contractVersion.js +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/realtime.d.ts +3 -1
  41. package/dist/realtime.d.ts.map +1 -1
  42. package/dist/realtime.js +11 -0
  43. package/dist/realtime.js.map +1 -1
  44. package/dist/routing.d.ts +131 -3
  45. package/dist/routing.d.ts.map +1 -1
  46. package/dist/routing.js +176 -22
  47. package/dist/routing.js.map +1 -1
  48. package/dist/sdk.d.ts +1 -1
  49. package/dist/sdkVersion.d.ts +1 -1
  50. package/dist/sdkVersion.js +1 -1
  51. package/package.json +1 -1
package/dist/routing.d.ts CHANGED
@@ -7,6 +7,33 @@ export interface LatLon {
7
7
  readonly lat: number;
8
8
  readonly lon: number;
9
9
  }
10
+ /**
11
+ * The vehicle running a trip run, as the realtime trip update names it, with its features: the same vehicle on a
12
+ * {@link Leg}, a {@link Departure}, a {@link TripDetails} and a realtime `TripUpdate`. `id` is feed-prefixed
13
+ * (`<feedId>:<id>`), the same string as `LiveVehicle.vehicleId`.
14
+ */
15
+ export interface TripVehicle {
16
+ /** Null when the feed gives none. */
17
+ readonly id: string | null;
18
+ /** The vehicle's user-visible label; null when the feed gives none. */
19
+ readonly label: string | null;
20
+ /** Whether the vehicle takes a wheelchair, its realtime access rather than the timetable's; null when unknown. */
21
+ readonly wheelchairAccessible: WheelchairBoarding | null;
22
+ /** Whether the vehicle is air-conditioned; null when unknown. */
23
+ readonly airConditioning: boolean | null;
24
+ /** Whether the vehicle offers Wi-Fi; null when unknown. */
25
+ readonly wifi: boolean | null;
26
+ /** Whether the vehicle accepts card payment on board; null when unknown. */
27
+ readonly cardPayment: boolean | null;
28
+ }
29
+ /**
30
+ * The station a stop belongs to (GTFS `parent_station`). Its `gtfsId` is a station id that {@link Location.stop} and
31
+ * {@link SpiderRouting.departures} accept, for the whole station.
32
+ */
33
+ export interface ParentStation {
34
+ readonly gtfsId: string;
35
+ readonly name: string;
36
+ }
10
37
  export interface Leg {
11
38
  readonly mode: TransitMode;
12
39
  readonly startScheduled: string;
@@ -39,6 +66,10 @@ export interface Leg {
39
66
  readonly toPlatformCode: string | null;
40
67
  readonly fromZoneId: string | null;
41
68
  readonly toZoneId: string | null;
69
+ /** The station the leg's `from` stop belongs to; null when that stop has none or the leg starts at a coordinate. */
70
+ readonly fromParentStation: ParentStation | null;
71
+ /** The station the leg's `to` stop belongs to; null when that stop has none or the leg ends at a coordinate. */
72
+ readonly toParentStation: ParentStation | null;
42
73
  readonly routeGtfsId: string | null;
43
74
  readonly routeShortName: string | null;
44
75
  readonly routeLongName: string | null;
@@ -63,6 +94,8 @@ export interface Leg {
63
94
  readonly fromWheelchair: WheelchairBoarding | null;
64
95
  readonly toWheelchair: WheelchairBoarding | null;
65
96
  readonly geometry: readonly LatLon[];
97
+ /** The vehicle running the leg's trip run; null on a walk leg and until a vehicle is matched to the run. */
98
+ readonly vehicle: TripVehicle | null;
66
99
  }
67
100
  export interface Itinerary {
68
101
  readonly start: string;
@@ -158,6 +191,8 @@ export interface Departure {
158
191
  readonly pickupType: PickupDropoffType;
159
192
  /** How a rider alights here; `COORDINATE_WITH_DRIVER` is a stop on request. */
160
193
  readonly dropoffType: PickupDropoffType;
194
+ /** The vehicle running the departure's trip run; null until a vehicle is matched to the run. */
195
+ readonly vehicle: TripVehicle | null;
161
196
  }
162
197
  export interface TripStop {
163
198
  readonly gtfsId: string;
@@ -174,6 +209,8 @@ export interface TripStop {
174
209
  readonly wheelchairBoarding: WheelchairBoarding | null;
175
210
  readonly platformCode: string | null;
176
211
  readonly zoneId: string | null;
212
+ /** The station the stop belongs to; null when it has none. */
213
+ readonly parentStation: ParentStation | null;
177
214
  /** The stop's position in the trip: increasing along it, not necessarily from 0 or consecutive. A leg's `fromStopPosition` or `toStopPosition`, or a departure's `stopPosition`, equal to it names this stop, also on a trip that visits one stop twice. Realtime that adds or removes stops can change it. */
178
215
  readonly stopPosition: number | null;
179
216
  /** Index into {@link TripDetails.geometry} of where the stop sits on the trip's line; null when the trip has no geometry or the stop has no point on it. */
@@ -183,6 +220,21 @@ export interface TripStop {
183
220
  /** How a rider alights here; `COORDINATE_WITH_DRIVER` is a stop on request. Null when the stop is canceled. */
184
221
  readonly dropoffType: PickupDropoffType | null;
185
222
  }
223
+ /** Result of {@link SpiderRouting.stopDepartures}: the stop or station asked for, with its departures. */
224
+ export interface StopDepartures {
225
+ /** The id asked for: a stop's, or a station's for the departures of all its stops. */
226
+ readonly gtfsId: string;
227
+ readonly name: string;
228
+ /** Null for a station's departures. */
229
+ readonly wheelchairBoarding: WheelchairBoarding | null;
230
+ /**
231
+ * The station the stop belongs to; its `gtfsId` asks for the whole station's departures. Null for a station's
232
+ * departures and for a stop without one.
233
+ */
234
+ readonly parentStation: ParentStation | null;
235
+ /** The departures, as {@link SpiderRouting.departures} returns them. */
236
+ readonly departures: readonly Departure[];
237
+ }
186
238
  export interface TripDetails {
187
239
  readonly gtfsId: string;
188
240
  /** GTFS service date of this trip run (ISO `YYYY-MM-DD`): the date it was requested for. */
@@ -201,6 +253,8 @@ export interface TripDetails {
201
253
  readonly wheelchairAccessible: WheelchairBoarding | null;
202
254
  readonly stops: readonly TripStop[];
203
255
  readonly geometry: readonly LatLon[];
256
+ /** The vehicle running this trip run; null until a vehicle is matched to the run. */
257
+ readonly vehicle: TripVehicle | null;
204
258
  }
205
259
  /**
206
260
  * Result of {@link SpiderRouting.estimatedDelays}: one stop's delay history, in seconds, per {@link Reliability} level.
@@ -242,6 +296,56 @@ export interface PlanOptions {
242
296
  * `bad_request` on `modes.transit` before any request.
243
297
  */
244
298
  readonly excludedTransitModes?: readonly TransitMode[];
299
+ /** Tunes walking, transfers and boarding, and leaves out routes or agencies. Undefined = the environment's defaults. */
300
+ readonly preferences?: RoutePreferences;
301
+ /** Leave out every itinerary without a transit leg, such as walking the whole way. Default false. */
302
+ readonly transitOnly?: boolean;
303
+ /**
304
+ * The most itineraries the page holds, from 1 up to the environment's itinerary limit; the API rejects a value out
305
+ * of range, never clamps it. Undefined = that limit. {@link SpiderRouting.planNext} and
306
+ * {@link SpiderRouting.planPrevious} keep it unless they are given another.
307
+ */
308
+ readonly numberOfItineraries?: number;
309
+ }
310
+ /**
311
+ * Optional routing preferences for {@link SpiderRouting.plan} and {@link SpiderRouting.planStream}. Each member left
312
+ * undefined keeps the environment's default, so `{}` asks for nothing. A value outside its range fails as
313
+ * `bad_request` on the member's contract path (such as `preferences.street.walk.speed`) before any request; the API
314
+ * never clamps one. The API rounds the multipliers and the walking speed to its own steps.
315
+ */
316
+ export interface RoutePreferences {
317
+ /** Walking speed on flat ground in metres per second, at least 0.1. */
318
+ readonly walkSpeed?: number;
319
+ /** How much worse walking is than riding for the same time, a multiplier from 0.1 to 100000: above the default it walks less. */
320
+ readonly walkReluctance?: number;
321
+ /** Generalized cost added for each boarding, an integer from 0 to 1000000: higher favours fewer rides. */
322
+ readonly boardCost?: number;
323
+ /** Generalized cost added for each transfer, an integer from 0 to 1000000: higher favours fewer transfers. */
324
+ readonly transferCost?: number;
325
+ /** Least time in seconds between alighting one vehicle and boarding the next, on top of the walk between the stops: 0 to 3600. */
326
+ readonly transferSlackSeconds?: number;
327
+ /** How much worse waiting at a stop is than riding for the same time, from 0.1 to 100000: above the default it rather walks on than waits. */
328
+ readonly waitReluctance?: number;
329
+ /** Least time in seconds at the stop before boarding: 0 to 3600. */
330
+ readonly boardSlackSeconds?: number;
331
+ /** Least time in seconds needed to alight: 0 to 3600. */
332
+ readonly alightSlackSeconds?: number;
333
+ /**
334
+ * Leave out every trip of these feed-prefixed route ids (`<feedId>:<id>`, as {@link Leg.routeGtfsId} and
335
+ * {@link Departure.routeGtfsId} give them). An id the environment's feed doesn't know excludes nothing, and
336
+ * undefined/empty excludes nothing.
337
+ */
338
+ readonly excludedRoutes?: readonly string[];
339
+ /** Leave out every trip of these feed-prefixed agency ids (`<feedId>:<id>`), as for `excludedRoutes`. */
340
+ readonly excludedAgencies?: readonly string[];
341
+ /**
342
+ * How much worse riding a transit mode is than riding for the same time on another, per mode: a multiplier from
343
+ * 0.1 to 100000, above 1 avoiding the mode, below 1 favouring it. A mode not listed keeps 1. It restricts no mode,
344
+ * and a mode `excludedTransitModes` names stays excluded. With `allowedTransitModes`, each allowed mode carries its
345
+ * own reluctance and one for a mode not allowed is dropped. WALK/UNKNOWN and the other non-transit modes drop out.
346
+ * Undefined/empty changes no cost.
347
+ */
348
+ readonly modeReluctance?: Partial<Record<TransitMode, number>>;
245
349
  }
246
350
  /**
247
351
  * Options for {@link SpiderRouting.planStream} and its continuations — the server-push SSE stream that opens one
@@ -271,6 +375,10 @@ export interface PlanStreamRequestOptions {
271
375
  readonly maxWindowMinutes: number;
272
376
  /** As {@link PlanOptions.excludedTransitModes}. */
273
377
  readonly excludedTransitModes?: readonly TransitMode[];
378
+ /** As {@link PlanOptions.preferences}. A continuation must repeat it: its cursor carries only the time and the window. */
379
+ readonly preferences?: RoutePreferences;
380
+ /** As {@link PlanOptions.transitOnly}. A continuation must repeat it. */
381
+ readonly transitOnly?: boolean;
274
382
  }
275
383
  export interface DeparturesOptions {
276
384
  /** Departures from this time on (default now). */
@@ -289,6 +397,10 @@ export interface DeparturesOptions {
289
397
  export declare class SpiderRouting {
290
398
  private readonly transport;
291
399
  constructor(transport: Transport);
400
+ /**
401
+ * One page of itineraries. `preferences`, `transitOnly` and `numberOfItineraries` are kept with the route, so
402
+ * {@link planNext} and {@link planPrevious} resend them with the mode filters.
403
+ */
292
404
  plan(options: PlanOptions): Promise<SpiderResult<Route>>;
293
405
  /**
294
406
  * Streams itineraries over Server-Sent Events as the router sweeps the search window forward, emitting them
@@ -317,13 +429,29 @@ export declare class SpiderRouting {
317
429
  planStreamPrevious(options: PlanStreamRequestOptions, before: string): AsyncGenerator<PlanStreamEvent>;
318
430
  private streamBody;
319
431
  private openPlanStream;
320
- planNext(route: Route): Promise<SpiderResult<Route> | null>;
321
- planPrevious(route: Route): Promise<SpiderResult<Route> | null>;
432
+ /**
433
+ * Plans the next window of itineraries (later departures); null when the page has no next one.
434
+ * `numberOfItineraries` sizes this page as in {@link plan}: undefined keeps the size `route` was asked with, null
435
+ * asks for the environment's limit, and the pages after this one keep what this one used.
436
+ */
437
+ planNext(route: Route, numberOfItineraries?: number | null): Promise<SpiderResult<Route> | null>;
438
+ /**
439
+ * Plans the previous window of itineraries (earlier departures); null when the page has no previous one.
440
+ * `numberOfItineraries` sizes this page as in {@link planNext}.
441
+ */
442
+ planPrevious(route: Route, numberOfItineraries?: number | null): Promise<SpiderResult<Route> | null>;
322
443
  /**
323
444
  * Upcoming departures from a stop or station: `numberOfDepartures` (default 30, up to the environment's
324
- * limit) within `options.timeRangeSeconds` (default 24 h) from `options.startTime` (default now).
445
+ * limit) within `options.timeRangeSeconds` (default 24 h) from `options.startTime` (default now). The departures
446
+ * of {@link stopDepartures}, without the stop.
325
447
  */
326
448
  departures(stopId: string, numberOfDepartures?: number, options?: DeparturesOptions): Promise<SpiderResult<Departure[]>>;
449
+ /**
450
+ * The stop or station `stopId` names, with its upcoming departures: the same request as {@link departures}, which
451
+ * also gives the stop's name, wheelchair boarding and parent station. An id that resolves to no stop or station
452
+ * fails as {@link departures} does.
453
+ */
454
+ stopDepartures(stopId: string, numberOfDepartures?: number, options?: DeparturesOptions): Promise<SpiderResult<StopDepartures>>;
327
455
  /**
328
456
  * One trip run: the trip on one service date (ISO `YYYY-MM-DD`, a {@link Leg.serviceDate} or
329
457
  * {@link Departure.serviceDate}). `reliability` is the level {@link TripStop.typicalDelaySeconds} is given at;
@@ -1 +1 @@
1
- {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["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OW_MINUTES = 120;
17
17
  const MAX_VIA_STOP_IDS = 10;
18
18
  const MAX_VIA_WAIT_SECONDS = 60 * 60;
19
+ const WALK_PREFERENCES = 'preferences.street.walk';
20
+ const TRANSIT_PREFERENCES = 'preferences.transit';
21
+ const MIN_MULTIPLIER = 0.1;
22
+ const MAX_MULTIPLIER = 100_000;
23
+ const MAX_COST = 1_000_000;
24
+ const MAX_SLACK_SECONDS = 60 * 60;
25
+ const MODE_RELUCTANCE_COSTS = 'modes.transit.costs.reluctance';
26
+ const MODE_RELUCTANCE_ALLOWED = 'modes.transit.transit.cost.reluctance';
19
27
  // The OTP transit modes valid in a modes filter — the public TransitMode union also carries street/leg
20
28
  // values (WALK, BICYCLE, CAR, TRANSIT, UNKNOWN) that are not transit modes and must not reach the wire.
21
29
  const WIRE_TRANSIT_MODES = new Set([
@@ -28,6 +36,10 @@ export class SpiderRouting {
28
36
  constructor(transport) {
29
37
  this.transport = transport;
30
38
  }
39
+ /**
40
+ * One page of itineraries. `preferences`, `transitOnly` and `numberOfItineraries` are kept with the route, so
41
+ * {@link planNext} and {@link planPrevious} resend them with the mode filters.
42
+ */
31
43
  async plan(options) {
32
44
  const time = options.arriveBy != null
33
45
  ? { kind: 'arriveBy', epochMs: toEpochMs(options.arriveBy) }
@@ -43,8 +55,13 @@ export class SpiderRouting {
43
55
  wheelchairAccessible: options.wheelchairAccessible ?? false,
44
56
  reliability: options.reliability,
45
57
  excludedTransitModes: options.excludedTransitModes ?? [],
58
+ preferences: options.preferences,
59
+ transitOnly: options.transitOnly ?? false,
60
+ numberOfItineraries: options.numberOfItineraries,
46
61
  };
47
- const invalid = invalidModes(request.allowedTransitModes, request.excludedTransitModes) ?? invalidVia(request.via);
62
+ const invalid = invalidModes(request.allowedTransitModes, request.excludedTransitModes)
63
+ ?? invalidVia(request.via)
64
+ ?? invalidPreferences(request.preferences, request.allowedTransitModes);
48
65
  if (invalid != null)
49
66
  return failure(invalid);
50
67
  return this.page(request);
@@ -91,10 +108,11 @@ export class SpiderRouting {
91
108
  origin: locationToInput(options.origin),
92
109
  destination: locationToInput(options.destination),
93
110
  via: via.length > 0 ? via.map(viaToInput) : undefined,
94
- modes: modesInput(options.allowedTransitModes ?? [], options.excludedTransitModes ?? []),
111
+ modes: modesInput(options.allowedTransitModes ?? [], options.excludedTransitModes ?? [], options.transitOnly ?? false, options.preferences?.modeReluctance),
95
112
  preferences: preferencesInput({
96
113
  maxTransfers: options.maxTransfers,
97
114
  wheelchairAccessible: options.wheelchairAccessible ?? false,
115
+ preferences: options.preferences,
98
116
  }),
99
117
  targetResults: options.targetResults,
100
118
  maxWindow: `PT${Math.floor(options.maxWindowMinutes)}M`,
@@ -162,23 +180,40 @@ export class SpiderRouting {
162
180
  await reader.cancel().catch(() => { });
163
181
  }
164
182
  }
165
- async planNext(route) {
183
+ /**
184
+ * Plans the next window of itineraries (later departures); null when the page has no next one.
185
+ * `numberOfItineraries` sizes this page as in {@link plan}: undefined keeps the size `route` was asked with, null
186
+ * asks for the environment's limit, and the pages after this one keep what this one used.
187
+ */
188
+ async planNext(route, numberOfItineraries) {
166
189
  if (!route.pageInfo.hasNextPage)
167
190
  return null;
168
- // Forward paging = after (no count; the server returns a whole window per page).
169
- return this.page(requestOf(route), cursorOf('after', route.pageInfo.endCursor));
191
+ return this.page(resized(requestOf(route), numberOfItineraries), cursorOf('after', route.pageInfo.endCursor));
170
192
  }
171
- async planPrevious(route) {
193
+ /**
194
+ * Plans the previous window of itineraries (earlier departures); null when the page has no previous one.
195
+ * `numberOfItineraries` sizes this page as in {@link planNext}.
196
+ */
197
+ async planPrevious(route, numberOfItineraries) {
172
198
  if (!route.pageInfo.hasPreviousPage)
173
199
  return null;
174
- // Backward paging = before (no count; the server returns a whole window per page).
175
- return this.page(requestOf(route), cursorOf('before', route.pageInfo.startCursor));
200
+ return this.page(resized(requestOf(route), numberOfItineraries), cursorOf('before', route.pageInfo.startCursor));
176
201
  }
177
202
  /**
178
203
  * Upcoming departures from a stop or station: `numberOfDepartures` (default 30, up to the environment's
179
- * limit) within `options.timeRangeSeconds` (default 24 h) from `options.startTime` (default now).
204
+ * limit) within `options.timeRangeSeconds` (default 24 h) from `options.startTime` (default now). The departures
205
+ * of {@link stopDepartures}, without the stop.
180
206
  */
181
207
  async departures(stopId, numberOfDepartures = DEFAULT_NUMBER_OF_DEPARTURES, options) {
208
+ const result = await this.stopDepartures(stopId, numberOfDepartures, options);
209
+ return result.isSuccess ? success([...result.data.departures]) : result;
210
+ }
211
+ /**
212
+ * The stop or station `stopId` names, with its upcoming departures: the same request as {@link departures}, which
213
+ * also gives the stop's name, wheelchair boarding and parent station. An id that resolves to no stop or station
214
+ * fails as {@link departures} does.
215
+ */
216
+ async stopDepartures(stopId, numberOfDepartures = DEFAULT_NUMBER_OF_DEPARTURES, options) {
182
217
  const timeRange = Math.floor(options?.timeRangeSeconds ?? MAX_TIME_RANGE_SECONDS);
183
218
  if (!(timeRange > 0 && timeRange <= MAX_TIME_RANGE_SECONDS))
184
219
  return failure(badRequest('timeRange'));
@@ -195,7 +230,7 @@ export class SpiderRouting {
195
230
  if (stop == null) {
196
231
  throw new TransportError('no_data', `routing returned no stop or station for id=${stopId}`);
197
232
  }
198
- return success(mapDepartures(stop));
233
+ return success(mapStopDepartures(stop));
199
234
  }
200
235
  catch (e) {
201
236
  return failure(toSpiderError(e));
@@ -267,9 +302,11 @@ export class SpiderRouting {
267
302
  origin: locationToInput(request.origin),
268
303
  destination: locationToInput(request.destination),
269
304
  via: request.via.length > 0 ? request.via.map(viaToInput) : undefined,
270
- modes: modesInput(request.allowedTransitModes, request.excludedTransitModes),
305
+ modes: modesInput(request.allowedTransitModes, request.excludedTransitModes, request.transitOnly, request.preferences?.modeReluctance),
271
306
  preferences: preferencesInput(request),
272
307
  searchWindow: `PT${Math.floor(request.searchWindowMinutes)}M`,
308
+ first: cursor != null && 'before' in cursor ? undefined : request.numberOfItineraries,
309
+ last: cursor != null && 'before' in cursor ? request.numberOfItineraries : undefined,
273
310
  reliability: request.reliability,
274
311
  ...cursor,
275
312
  };
@@ -292,6 +329,9 @@ export class SpiderRouting {
292
329
  function requestOf(route) {
293
330
  return route[ROUTE_REQUEST];
294
331
  }
332
+ function resized(request, numberOfItineraries) {
333
+ return numberOfItineraries === undefined ? request : { ...request, numberOfItineraries: numberOfItineraries ?? undefined };
334
+ }
295
335
  function toEpochMs(value) {
296
336
  return typeof value === 'number' ? value : value.getTime();
297
337
  }
@@ -306,7 +346,9 @@ function invalidStreamOptions(options) {
306
346
  return badRequest('maxWindow', 'is required');
307
347
  if (!(Math.floor(options.maxWindowMinutes) >= MIN_STREAM_WINDOW_MINUTES))
308
348
  return badRequest('maxWindow');
309
- return invalidModes(options.allowedTransitModes ?? [], options.excludedTransitModes ?? []) ?? invalidVia(options.via ?? []);
349
+ return invalidModes(options.allowedTransitModes ?? [], options.excludedTransitModes ?? [])
350
+ ?? invalidVia(options.via ?? [])
351
+ ?? invalidPreferences(options.preferences, options.allowedTransitModes ?? []);
310
352
  }
311
353
  // The API takes an allow-list or an exclude-list, never both non-empty: the same field and wording as its own 400.
312
354
  function invalidModes(allowed, excluded) {
@@ -324,6 +366,39 @@ function invalidVia(via) {
324
366
  }
325
367
  return null;
326
368
  }
369
+ function invalidPreferences(preferences, allowed) {
370
+ if (preferences == null)
371
+ return null;
372
+ const reluctanceField = wireModes(allowed).length > 0 ? MODE_RELUCTANCE_ALLOWED : MODE_RELUCTANCE_COSTS;
373
+ for (const reluctance of Object.values(preferences.modeReluctance ?? {})) {
374
+ if (reluctance != null && !isMultiplier(reluctance))
375
+ return badRequest(reluctanceField);
376
+ }
377
+ const checks = [
378
+ [preferences.walkSpeed, `${WALK_PREFERENCES}.speed`, (v) => Number.isFinite(v) && v >= MIN_MULTIPLIER],
379
+ [preferences.walkReluctance, `${WALK_PREFERENCES}.reluctance`, isMultiplier],
380
+ [preferences.boardCost, `${WALK_PREFERENCES}.boardCost`, isCost],
381
+ [preferences.transferCost, `${TRANSIT_PREFERENCES}.transfer.cost`, isCost],
382
+ [preferences.transferSlackSeconds, `${TRANSIT_PREFERENCES}.transfer.slack`, isSlack],
383
+ [preferences.waitReluctance, `${TRANSIT_PREFERENCES}.board.waitReluctance`, isMultiplier],
384
+ [preferences.boardSlackSeconds, `${TRANSIT_PREFERENCES}.board.slack`, isSlack],
385
+ [preferences.alightSlackSeconds, `${TRANSIT_PREFERENCES}.alight.slack`, isSlack],
386
+ ];
387
+ for (const [value, field, valid] of checks) {
388
+ if (value != null && !valid(value))
389
+ return badRequest(field);
390
+ }
391
+ return null;
392
+ }
393
+ function isMultiplier(value) {
394
+ return Number.isFinite(value) && value >= MIN_MULTIPLIER && value <= MAX_MULTIPLIER;
395
+ }
396
+ function isCost(value) {
397
+ return Number.isInteger(value) && value >= 0 && value <= MAX_COST;
398
+ }
399
+ function isSlack(seconds) {
400
+ return seconds >= 0 && seconds <= MAX_SLACK_SECONDS;
401
+ }
327
402
  function locationToInput(location) {
328
403
  if (location.kind === 'stop') {
329
404
  return { location: { stopLocation: { stopLocationId: location.id } } };
@@ -341,10 +416,29 @@ function viaToInput(via) {
341
416
  }
342
417
  // Curated PlanRequest → OTP's nested modes/preferences inputs. Only the exposed fields are set; everything
343
418
  // else stays undefined so OTP applies its own defaults. Both return undefined when nothing is requested.
344
- function modesInput(allowed, excluded) {
345
- const transit = wireModesOrUndefined(allowed)?.map((mode) => ({ mode }));
419
+ // Per-mode reluctances ride the allowed list's own entries when there is one, and `costs` otherwise, in the
420
+ // TransitMode declaration order: the API rejects `costs` beside a non-empty `transit`.
421
+ function modesInput(allowed, excluded, transitOnly, modeReluctance) {
422
+ const reluctanceOf = (mode) => modeReluctance?.[mode] ?? undefined;
423
+ const transit = wireModesOrUndefined(allowed)?.map((mode) => {
424
+ const reluctance = reluctanceOf(mode);
425
+ return reluctance != null ? { mode, cost: { reluctance } } : { mode };
426
+ });
346
427
  const exclude = wireModesOrUndefined(excluded);
347
- return transit !== undefined || exclude !== undefined ? { transit: { transit, exclude } } : undefined;
428
+ const costs = transit == null ? costsInput(reluctanceOf) : undefined;
429
+ return compact({
430
+ transitOnly: transitOnly ? true : undefined,
431
+ transit: compact({ transit, exclude, costs }),
432
+ });
433
+ }
434
+ function costsInput(reluctanceOf) {
435
+ const costs = [];
436
+ for (const mode of WIRE_TRANSIT_MODES) {
437
+ const reluctance = reluctanceOf(mode);
438
+ if (reluctance != null)
439
+ costs.push({ mode, reluctance });
440
+ }
441
+ return costs.length > 0 ? costs : undefined;
348
442
  }
349
443
  function wireModes(modes) {
350
444
  return modes.filter((m) => WIRE_TRANSIT_MODES.has(m));
@@ -354,16 +448,46 @@ function wireModesOrUndefined(modes) {
354
448
  return wire.length > 0 ? wire : undefined;
355
449
  }
356
450
  function preferencesInput(request) {
451
+ const preferences = request.preferences ?? {};
357
452
  // The router indexes legs with leg 0 = the initial access (walk, or nothing), so its wire
358
453
  // `maximumTransfers` counts boardings = transfers + 1 (wire 0 = walk-only, not exposed here).
359
454
  // `maxTransfers` is a transfer count, so map it to boardings: 0 transfers = 1 boarding (direct).
360
- const transit = request.maxTransfers != null
361
- ? { transfer: { maximumTransfers: request.maxTransfers + 1 } }
362
- : undefined;
363
- const accessibility = request.wheelchairAccessible ? { wheelchair: { enabled: true } } : undefined;
364
- if (transit === undefined && accessibility === undefined)
365
- return undefined;
366
- return { transit, accessibility };
455
+ const transfer = compact({
456
+ cost: preferences.transferCost,
457
+ slack: slackToWire(preferences.transferSlackSeconds),
458
+ maximumTransfers: request.maxTransfers != null ? request.maxTransfers + 1 : undefined,
459
+ });
460
+ const board = compact({
461
+ waitReluctance: preferences.waitReluctance,
462
+ slack: slackToWire(preferences.boardSlackSeconds),
463
+ });
464
+ const alight = compact({ slack: slackToWire(preferences.alightSlackSeconds) });
465
+ const walk = compact({
466
+ speed: preferences.walkSpeed,
467
+ reluctance: preferences.walkReluctance,
468
+ boardCost: preferences.boardCost,
469
+ });
470
+ return compact({
471
+ street: compact({ walk }),
472
+ transit: compact({ transfer, board, alight, filters: filtersInput(preferences) }),
473
+ accessibility: request.wheelchairAccessible ? { wheelchair: { enabled: true } } : undefined,
474
+ });
475
+ }
476
+ function filtersInput(preferences) {
477
+ const exclude = [];
478
+ if (preferences.excludedRoutes != null && preferences.excludedRoutes.length > 0) {
479
+ exclude.push({ routes: [...preferences.excludedRoutes] });
480
+ }
481
+ if (preferences.excludedAgencies != null && preferences.excludedAgencies.length > 0) {
482
+ exclude.push({ agencies: [...preferences.excludedAgencies] });
483
+ }
484
+ return exclude.length > 0 ? [{ exclude }] : undefined;
485
+ }
486
+ function slackToWire(seconds) {
487
+ return seconds != null ? `PT${seconds}S` : undefined;
488
+ }
489
+ function compact(value) {
490
+ return Object.values(value).some((v) => v !== undefined) ? value : undefined;
367
491
  }
368
492
  // ISO-8601 time-only duration (e.g. "PT1M30S", "PT-90S") → seconds, with a plain-integer-seconds fallback;
369
493
  // mirrors the batch plan's realtime-delay handling. Returns null for absent or unparseable values.
@@ -493,6 +617,8 @@ function mapLeg(leg) {
493
617
  toPlatformCode: toStop?.platformCode ?? null,
494
618
  fromZoneId: fromStop?.zoneId ?? null,
495
619
  toZoneId: toStop?.zoneId ?? null,
620
+ fromParentStation: mapParentStation(fromStop?.parentStation),
621
+ toParentStation: mapParentStation(toStop?.parentStation),
496
622
  routeGtfsId: route?.gtfsId ?? null,
497
623
  routeShortName: route?.shortName ?? null,
498
624
  routeLongName: route?.longName ?? null,
@@ -510,6 +636,31 @@ function mapLeg(leg) {
510
636
  fromWheelchair: wheelchairFromWire(fromStop?.wheelchairBoarding),
511
637
  toWheelchair: wheelchairFromWire(toStop?.wheelchairBoarding),
512
638
  geometry: decodePolyline(leg.legGeometry.points),
639
+ vehicle: mapTripVehicle(leg.vehicle),
640
+ };
641
+ }
642
+ function mapTripVehicle(v) {
643
+ if (v == null)
644
+ return null;
645
+ return {
646
+ id: v.id ?? null,
647
+ label: v.label ?? null,
648
+ wheelchairAccessible: wheelchairFromWire(v.wheelchairAccessible),
649
+ airConditioning: v.airConditioning ?? null,
650
+ wifi: v.wifi ?? null,
651
+ cardPayment: v.cardPayment ?? null,
652
+ };
653
+ }
654
+ function mapParentStation(station) {
655
+ return station != null ? { gtfsId: station.gtfsId, name: station.name } : null;
656
+ }
657
+ function mapStopDepartures(stop) {
658
+ return {
659
+ gtfsId: stop.gtfsId,
660
+ name: stop.name,
661
+ wheelchairBoarding: wheelchairFromWire(stop.wheelchairBoarding),
662
+ parentStation: mapParentStation(stop.parentStation),
663
+ departures: mapDepartures(stop),
513
664
  };
514
665
  }
515
666
  function mapDepartures(stop) {
@@ -536,6 +687,7 @@ function mapDepartures(stop) {
536
687
  stopPosition: st.stopPosition ?? null,
537
688
  pickupType: pickupDropoffTypeFromWire(st.pickupType),
538
689
  dropoffType: pickupDropoffTypeFromWire(st.dropoffType),
690
+ vehicle: mapTripVehicle(st.vehicle),
539
691
  };
540
692
  });
541
693
  }
@@ -558,6 +710,7 @@ function mapTrip(trip, serviceDate) {
558
710
  wheelchairBoarding: wheelchairFromWire(s.wheelchairBoarding),
559
711
  platformCode: s.platformCode ?? null,
560
712
  zoneId: s.zoneId ?? null,
713
+ parentStation: mapParentStation(s.parentStation),
561
714
  stopPosition: st.stopPosition ?? null,
562
715
  geometryIndex: st.geometryIndex ?? null,
563
716
  pickupType: pickupDropoffTypeFromWire(st.pickupType),
@@ -579,6 +732,7 @@ function mapTrip(trip, serviceDate) {
579
732
  wheelchairAccessible: wheelchairFromWire(trip.wheelchairAccessible),
580
733
  stops,
581
734
  geometry: geometry != null ? decodePolyline(geometry.points) : [],
735
+ vehicle: mapTripVehicle(trip.vehicle),
582
736
  };
583
737
  }
584
738
  // Entries are keyed by their level, not their position; a missing level is a malformed body.