minotor 3.0.2 → 5.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 +9 -3
- package/README.md +1 -0
- package/dist/cli.mjs +294 -307
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/trips.d.ts +12 -6
- package/dist/parser.cjs.js +290 -302
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +290 -302
- 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.d.ts +2 -2
- 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/route.d.ts +3 -3
- package/dist/timetable/io.d.ts +5 -4
- package/dist/timetable/proto/timetable.d.ts +7 -16
- package/dist/timetable/route.d.ts +7 -5
- package/dist/timetable/timetable.d.ts +7 -5
- package/package.json +1 -1
- package/src/__e2e__/timetable/timetable.bin +2 -2
- package/src/cli/repl.ts +0 -1
- package/src/gtfs/__tests__/parser.test.ts +2 -2
- package/src/gtfs/__tests__/routes.test.ts +3 -0
- package/src/gtfs/__tests__/trips.test.ts +123 -166
- package/src/gtfs/parser.ts +50 -9
- package/src/gtfs/routes.ts +1 -0
- package/src/gtfs/trips.ts +195 -112
- package/src/router.ts +2 -2
- package/src/routing/__tests__/route.test.ts +3 -3
- package/src/routing/__tests__/router.test.ts +186 -203
- package/src/routing/route.ts +3 -3
- package/src/routing/router.ts +1 -1
- package/src/timetable/__tests__/io.test.ts +52 -64
- package/src/timetable/__tests__/route.test.ts +25 -17
- package/src/timetable/__tests__/timetable.test.ts +16 -24
- package/src/timetable/io.ts +20 -19
- package/src/timetable/proto/timetable.proto +7 -9
- package/src/timetable/proto/timetable.ts +80 -202
- package/src/timetable/route.ts +27 -13
- package/src/timetable/timetable.ts +20 -16
package/dist/gtfs/trips.d.ts
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { StopId } from '../stops/stops.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Route } from '../timetable/route.js';
|
|
3
|
+
import { ServiceRouteId, ServiceRoutesMap, StopsAdjacency } from '../timetable/timetable.js';
|
|
3
4
|
import { ServiceIds } from './services.js';
|
|
4
5
|
import { ParsedStopsMap } from './stops.js';
|
|
5
6
|
import { TransfersMap } from './transfers.js';
|
|
6
7
|
export type TripId = string;
|
|
7
8
|
export type TripIdsMap = Map<TripId, ServiceRouteId>;
|
|
8
|
-
export type GtfsPickupDropOffType = '' | 0 | 1 | 2 | 3;
|
|
9
|
+
export type GtfsPickupDropOffType = '' | '0' | '1' | '2' | '3';
|
|
9
10
|
export type SerializedPickUpDropOffType = 0 | 1 | 2 | 3;
|
|
11
|
+
/**
|
|
12
|
+
* Encodes pickup/drop-off types into a Uint8Array using 2 bits per value.
|
|
13
|
+
* Layout per byte: [drop_off_1][pickup_1][drop_off_0][pickup_0] for stops 0 and 1
|
|
14
|
+
*/
|
|
15
|
+
export declare const encodePickUpDropOffTypes: (pickUpTypes: SerializedPickUpDropOffType[], dropOffTypes: SerializedPickUpDropOffType[]) => Uint8Array;
|
|
10
16
|
/**
|
|
11
17
|
* Parses the trips.txt file from a GTFS feed
|
|
12
18
|
*
|
|
13
19
|
* @param tripsStream The readable stream containing the trips data.
|
|
14
20
|
* @param serviceIds A mapping of service IDs to corresponding route IDs.
|
|
15
|
-
* @param
|
|
21
|
+
* @param serviceRoutes A mapping of route IDs to route details.
|
|
16
22
|
* @returns A mapping of trip IDs to corresponding route IDs.
|
|
17
23
|
*/
|
|
18
|
-
export declare const parseTrips: (tripsStream: NodeJS.ReadableStream, serviceIds: ServiceIds,
|
|
19
|
-
export declare const buildStopsAdjacencyStructure: (validStops: Set<StopId>, routes:
|
|
24
|
+
export declare const parseTrips: (tripsStream: NodeJS.ReadableStream, serviceIds: ServiceIds, serviceRoutes: ServiceRoutesMap) => Promise<TripIdsMap>;
|
|
25
|
+
export declare const buildStopsAdjacencyStructure: (validStops: Set<StopId>, serviceRoutes: ServiceRoutesMap, routes: Route[], transfersMap: TransfersMap) => StopsAdjacency;
|
|
20
26
|
/**
|
|
21
27
|
* Parses the stop_times.txt data from a GTFS feed.
|
|
22
28
|
*
|
|
@@ -26,4 +32,4 @@ export declare const buildStopsAdjacencyStructure: (validStops: Set<StopId>, rou
|
|
|
26
32
|
* @param validStopIds A set of valid stop IDs.
|
|
27
33
|
* @returns A mapping of route IDs to route details. The routes returned correspond to the set of trips from GTFS that share the same stop list.
|
|
28
34
|
*/
|
|
29
|
-
export declare const parseStopTimes: (stopTimesStream: NodeJS.ReadableStream, stopsMap: ParsedStopsMap, validTripIds: TripIdsMap, validStopIds: Set<StopId>) => Promise<
|
|
35
|
+
export declare const parseStopTimes: (stopTimesStream: NodeJS.ReadableStream, stopsMap: ParsedStopsMap, validTripIds: TripIdsMap, validStopIds: Set<StopId>) => Promise<Route[]>;
|