minotor 8.0.0 → 9.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/CHANGELOG.md +4 -4
- package/README.md +1 -1
- package/dist/cli.mjs +835 -816
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/transfers.d.ts +21 -6
- package/dist/gtfs/trips.d.ts +2 -2
- package/dist/parser.cjs.js +666 -642
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +666 -642
- package/dist/parser.esm.js.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/dist/routing/router.d.ts +4 -4
- package/dist/timetable/io.d.ts +3 -3
- package/dist/timetable/proto/timetable.d.ts +6 -4
- package/dist/timetable/route.d.ts +13 -21
- package/dist/timetable/timetable.d.ts +13 -11
- package/dist/timetable/tripBoardingId.d.ts +34 -0
- package/package.json +1 -1
- package/src/__e2e__/timetable/timetable.bin +2 -2
- package/src/cli/repl.ts +53 -67
- package/src/gtfs/__tests__/parser.test.ts +19 -4
- package/src/gtfs/__tests__/transfers.test.ts +598 -318
- package/src/gtfs/__tests__/trips.test.ts +3 -44
- package/src/gtfs/parser.ts +26 -8
- package/src/gtfs/transfers.ts +151 -20
- package/src/gtfs/trips.ts +1 -39
- package/src/routing/__tests__/result.test.ts +10 -10
- package/src/routing/__tests__/router.test.ts +11 -9
- package/src/routing/result.ts +2 -2
- package/src/routing/router.ts +34 -22
- package/src/timetable/__tests__/io.test.ts +8 -7
- package/src/timetable/__tests__/route.test.ts +66 -80
- package/src/timetable/__tests__/timetable.test.ts +32 -29
- package/src/timetable/__tests__/tripBoardingId.test.ts +57 -0
- package/src/timetable/io.ts +21 -20
- package/src/timetable/proto/timetable.proto +6 -4
- package/src/timetable/proto/timetable.ts +84 -48
- package/src/timetable/route.ts +39 -56
- package/src/timetable/timetable.ts +37 -26
- package/src/timetable/tripBoardingId.ts +94 -0
- package/tsconfig.json +2 -2
- package/dist/timetable/tripId.d.ts +0 -15
- package/src/timetable/__tests__/tripId.test.ts +0 -27
- package/src/timetable/tripId.ts +0 -29
- /package/dist/timetable/__tests__/{tripId.test.d.ts → tripBoardingId.test.d.ts} +0 -0
package/dist/gtfs/transfers.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { SourceStopId, StopId } from '../stops/stops.js';
|
|
2
|
-
import { ServiceRouteId, Transfer } from '../timetable/timetable.js';
|
|
2
|
+
import { ServiceRouteId, Timetable, Transfer, TripContinuations } from '../timetable/timetable.js';
|
|
3
3
|
import { GtfsStopsMap } from './stops.js';
|
|
4
|
-
import { GtfsTripId } from './trips.js';
|
|
4
|
+
import { GtfsTripId, TripsMapping } from './trips.js';
|
|
5
5
|
export type GtfsTransferType = 0 | 1 | 2 | 3 | 4 | 5;
|
|
6
6
|
export type TransfersMap = Map<StopId, Transfer[]>;
|
|
7
|
-
export type
|
|
7
|
+
export type GtfsTripContinuation = {
|
|
8
|
+
fromStop: StopId;
|
|
8
9
|
fromTrip: GtfsTripId;
|
|
10
|
+
toStop: StopId;
|
|
9
11
|
toTrip: GtfsTripId;
|
|
10
|
-
hopOnStop: StopId;
|
|
11
12
|
};
|
|
12
|
-
export type TripContinuationsMap = Map<StopId, GtfsTripBoarding[]>;
|
|
13
13
|
export type TransferEntry = {
|
|
14
14
|
from_stop_id?: SourceStopId;
|
|
15
15
|
to_stop_id?: SourceStopId;
|
|
@@ -28,5 +28,20 @@ export type TransferEntry = {
|
|
|
28
28
|
*/
|
|
29
29
|
export declare const parseTransfers: (transfersStream: NodeJS.ReadableStream, stopsMap: GtfsStopsMap) => Promise<{
|
|
30
30
|
transfers: TransfersMap;
|
|
31
|
-
tripContinuations:
|
|
31
|
+
tripContinuations: GtfsTripContinuation[];
|
|
32
32
|
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Builds trip continuations map from GTFS trip continuation data.
|
|
35
|
+
*
|
|
36
|
+
* This function processes GTFS in-seat transfer data and creates a mapping
|
|
37
|
+
* from trip boarding IDs to continuation boarding information. It disambiguates
|
|
38
|
+
* stop indices when routes have multiple stops with the same ID by finding
|
|
39
|
+
* the most coherent transfer timing.
|
|
40
|
+
*
|
|
41
|
+
* @param tripsMapping Mapping from GTFS trip IDs to internal trip representations
|
|
42
|
+
* @param tripContinuations Array of GTFS trip continuation data from transfers.txt
|
|
43
|
+
* @param timetable The timetable containing route and timing information
|
|
44
|
+
* @param activeStopIds Set of stop IDs that are active/enabled in the system
|
|
45
|
+
* @returns A map from trip boarding IDs to arrays of continuation boarding options
|
|
46
|
+
*/
|
|
47
|
+
export declare const buildTripContinuations: (tripsMapping: TripsMapping, tripContinuations: GtfsTripContinuation[], timetable: Timetable, activeStopIds: Set<StopId>) => TripContinuations;
|
package/dist/gtfs/trips.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ServiceRoute, ServiceRouteId, StopAdjacency } from '../timetable/timeta
|
|
|
4
4
|
import { GtfsRouteId, GtfsRoutesMap } from './routes.js';
|
|
5
5
|
import { ServiceIds } from './services.js';
|
|
6
6
|
import { GtfsStopsMap } from './stops.js';
|
|
7
|
-
import { TransfersMap
|
|
7
|
+
import { TransfersMap } from './transfers.js';
|
|
8
8
|
export type GtfsTripId = string;
|
|
9
9
|
export type GtfsTripIdsMap = Map<GtfsTripId, GtfsRouteId>;
|
|
10
10
|
export type TripsMapping = Map<GtfsTripId, {
|
|
@@ -27,7 +27,7 @@ export declare const encodePickUpDropOffTypes: (pickUpTypes: SerializedPickUpDro
|
|
|
27
27
|
* @returns A mapping of trip IDs to corresponding route IDs.
|
|
28
28
|
*/
|
|
29
29
|
export declare const parseTrips: (tripsStream: NodeJS.ReadableStream, serviceIds: ServiceIds, validGtfsRoutes: GtfsRoutesMap) => Promise<GtfsTripIdsMap>;
|
|
30
|
-
export declare const buildStopsAdjacencyStructure: (
|
|
30
|
+
export declare const buildStopsAdjacencyStructure: (serviceRoutes: ServiceRoute[], routes: Route[], transfersMap: TransfersMap, nbStops: number, activeStops: Set<StopId>) => StopAdjacency[];
|
|
31
31
|
/**
|
|
32
32
|
* Parses the stop_times.txt data from a GTFS feed.
|
|
33
33
|
*
|