minotor 10.0.1 → 10.1.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/.cspell.json CHANGED
@@ -2,58 +2,80 @@
2
2
  "version": "0.2",
3
3
  "language": "en",
4
4
  "words": [
5
- "Minotor",
6
- "gtfs",
7
- "minotor",
8
- "luxon",
9
- "Gtfs",
10
- "GTFS",
11
- "Tilleul",
12
- "Cathédrale",
13
- "tcrqn",
14
- "tcrqo",
15
- "lswfbh",
16
- "Neuveville",
17
- "Cathedrale",
5
+ "alightable",
6
+ "Ascenseur",
7
+ "Aufzug",
8
+ "bgcolor",
9
+ "boardable",
18
10
  "bufbuild",
19
- "protoc",
11
+ "Bulle",
12
+ "catchable",
13
+ "Cathedrale",
14
+ "Cathédrale",
15
+ "Davos",
16
+ "Delling",
17
+ "Dolderbahn",
18
+ "dolmuş",
19
+ "dropoff",
20
+ "Dymchurch",
21
+ "Engadin",
22
+ "Eurostar",
23
+ "fontname",
24
+ "Francey",
25
+ "funi",
26
+ "gare",
27
+ "Gatwick",
20
28
  "geokdbush",
21
- "kdbush",
22
- "slimsearch",
23
29
  "geospatial",
24
- "NeTEx",
30
+ "GNER",
31
+ "graphviz",
32
+ "Gruyères",
33
+ "GTFS",
34
+ "Gtfs",
35
+ "gtfs",
36
+ "Haut",
37
+ "Heathrow",
38
+ "Hythe",
39
+ "isochrone",
40
+ "kdbush",
41
+ "Klosters",
25
42
  "Ksfdp",
26
- "Tsvg",
27
43
  "Landquart",
28
- "Davos",
29
- "moleson",
30
- "Klosters",
31
- "Engadin",
32
- "isochrone",
33
- "Delling",
44
+ "lswfbh",
45
+ "luxon",
46
+ "Marshrutka",
47
+ "Métro",
48
+ "Minotor",
49
+ "minotor",
34
50
  "Moléson",
35
- "Bulle",
36
- "Gruyères",
37
- "gare",
38
- "funi",
39
- "Francey",
40
- "téléphérique",
51
+ "moleson",
52
+ "Montjuïc",
41
53
  "Moritz",
42
- "Haut",
43
- "Rhin",
54
+ "Naye",
55
+ "NeTEx",
56
+ "Neuveville",
57
+ "nodesep",
44
58
  "Olten",
45
- "graphviz",
59
+ "penwidth",
60
+ "protoc",
46
61
  "rankdir",
47
- "bgcolor",
48
- "nodesep",
49
62
  "ranksep",
50
- "fontname",
51
- "dropoff",
52
- "boardable",
53
- "alightable",
54
- "penwidth",
55
- "catchable",
56
- "Tpng"
63
+ "Regio",
64
+ "Regionalzug",
65
+ "Rhin",
66
+ "Rigiblick",
67
+ "Rochers",
68
+ "Roissy",
69
+ "slimsearch",
70
+ "tcrqn",
71
+ "tcrqo",
72
+ "Telecabin",
73
+ "Telefèric",
74
+ "téléphérique",
75
+ "Tilleul",
76
+ "Tpng",
77
+ "Tsvg",
78
+ "Wokingham"
57
79
  ],
58
80
  "flagWords": [],
59
81
  "ignorePaths": [
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [10.0.1](https://github.com/aubryio/minotor/compare/v10.0.0...v10.0.1) (2026-01-25)
1
+ # [10.1.0](https://github.com/aubryio/minotor/compare/v10.0.1...v10.1.0) (2026-01-26)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * update dependencies to fix vulnerability ([b001ace](https://github.com/aubryio/minotor/commit/b001ace5b7d7c17f28308d71a1174b165cad63a7))
6
+ * improved extended gtfs support ([#60](https://github.com/aubryio/minotor/issues/60)) ([5fe7d6f](https://github.com/aubryio/minotor/commit/5fe7d6f91cff2aa98b8304d11ba18ea77bdd5444))
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2025 Aubry Cholleton
3
+ Copyright (c) 2024-2026 Aubry Cholleton
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -42,7 +42,7 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
42
42
 
43
43
  | Feed | Parsing time | Timetable Size for a Day (Compressed) |
44
44
  | ------------------------------------------------------------------------------------------ | ------------ | ------------------------------------- |
45
- | [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2025-gtfs2020) | ~2 minutes | 20 MB (5MB) |
45
+ | [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2026-gtfs2020) | ~2 minutes | 20 MB (5MB) |
46
46
 
47
47
  ## Get started
48
48
 
@@ -55,10 +55,11 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
55
55
  #### GTFS Feed parsing (Node.js only)
56
56
 
57
57
  ```
58
- import { GtfsParser, chGtfsProfile } from 'minotor/parser';
58
+ import { GtfsParser, extendedGtfsProfile } from 'minotor/parser';
59
59
 
60
- const parser = new GtfsParser('gtfs-feed.zip', chGtfsProfile);
61
- const { timetable, stopsIndex } = await parser.parse(new Date());
60
+ const parser = new GtfsParser('gtfs-feed.zip', extendedGtfsProfile);
61
+ const timetable = await parser.parseTimetable(new Date());
62
+ const stopsIndex = await parser.parseStops();
62
63
  ```
63
64
 
64
65
  Note that times are only represented at the minute level so they can fit on 16 bits.
package/dist/cli.mjs CHANGED
@@ -18153,7 +18153,7 @@ class Timetable {
18153
18153
  }
18154
18154
  }
18155
18155
 
18156
- const standardProfile = {
18156
+ const standardGtfsProfile = {
18157
18157
  routeTypeParser: (routeType) => {
18158
18158
  switch (routeType) {
18159
18159
  case 0:
@@ -20121,7 +20121,7 @@ const parseCsv = (stream, numericColumns = []) => {
20121
20121
  * @param profile A configuration object defining the specificities of the GTFS feed.
20122
20122
  * @returns A map of all the valid routes.
20123
20123
  */
20124
- const parseRoutes = (routesStream_1, ...args_1) => __awaiter(void 0, [routesStream_1, ...args_1], void 0, function* (routesStream, profile = standardProfile) {
20124
+ const parseRoutes = (routesStream_1, ...args_1) => __awaiter(void 0, [routesStream_1, ...args_1], void 0, function* (routesStream, profile = standardGtfsProfile) {
20125
20125
  var _a, e_1, _b, _c;
20126
20126
  const routes = new Map();
20127
20127
  try {
@@ -20937,7 +20937,7 @@ const STOP_TIMES_FILE = 'stop_times.txt';
20937
20937
  const STOPS_FILE = 'stops.txt';
20938
20938
  const TRANSFERS_FILE = 'transfers.txt';
20939
20939
  class GtfsParser {
20940
- constructor(path, profile = standardProfile) {
20940
+ constructor(path, profile = standardGtfsProfile) {
20941
20941
  // TODO: support input from multiple sources
20942
20942
  this.path = path;
20943
20943
  this.profile = profile;
@@ -21056,51 +21056,128 @@ class GtfsParser {
21056
21056
  }
21057
21057
 
21058
21058
  /**
21059
- * Parses the SBB extended route type and returns the corresponding basic GTFS route type.
21060
- * @param routeType The SBB route type to parse.
21059
+ * Parses the extended GTFS route type and returns the corresponding basic GTFS route type.
21060
+ * Based on the GTFS Extended Route Types specification.
21061
+ * @see https://developers.google.com/transit/gtfs/reference/extended-route-types
21062
+ * @param routeType The extended route type to parse.
21061
21063
  * @returns The corresponding GTFS route type, or undefined if the route type is not recognized.
21062
21064
  */
21063
21065
  const routeTypeParser = (routeType) => {
21064
21066
  switch (routeType) {
21065
- case 1700: // Lift
21066
- case 1400: // Cogwheel train, funicular
21067
- return 'FUNICULAR'; // Funicular
21068
- case 700: // Bus
21069
- case 705: // Night bus
21070
- case 710: // Panorama bus
21071
- case 202: // National long-distance bus
21072
- case 201: // International long-distance bus
21073
- case 702: // Express bus
21074
- case 715: // On-demand bus
21075
- return 'BUS'; // Bus
21076
- case 1300: // Chairlift, Gondola
21077
- return 'AERIAL_LIFT'; // Aerial lift
21078
- case 401: // Metro
21079
- return 'SUBWAY'; // Subway
21080
- case 1000: // Boat / Ship
21081
- return 'FERRY'; // Boat
21082
- case 900: // Tram
21083
- return 'TRAM'; // Tram
21084
- case 116: // ??? train TODO figure out what this means
21085
- case 117: // Special train
21086
- case 102: // International train
21087
- case 104: // Car train
21088
- case 101: // International train
21089
- case 111: // Airport train
21090
- case 105: // Night train
21091
- case 103: // Fast train
21092
- case 107: // Mountain train
21093
- case 100: // No guaranteed train
21094
- case 106: // Regional train
21095
- case 109: // Urban train
21096
- return 'RAIL'; // Train
21097
- case 1100: // Aircraft
21098
- case 1500: // Taxi
21067
+ // Railway Service (100-199)
21068
+ case 100: // Railway Service
21069
+ case 101: // High Speed Rail Service (TGV, ICE, Eurostar)
21070
+ case 102: // Long Distance Trains (InterCity/EuroCity)
21071
+ case 103: // Inter Regional Rail Service (InterRegio, Cross County Rail)
21072
+ case 104: // Car Transport Rail Service
21073
+ case 105: // Sleeper Rail Service (GNER Sleeper)
21074
+ case 106: // Regional Rail Service (TER, Regionalzug)
21075
+ case 107: // Tourist Railway Service (Romney, Hythe & Dymchurch)
21076
+ case 108: // Rail Shuttle (Within Complex) (Gatwick Shuttle, Sky Line)
21077
+ case 109: // Suburban Railway (S-Bahn, RER, S-tog)
21078
+ case 110: // Replacement Rail Service
21079
+ case 111: // Special Rail Service
21080
+ case 112: // Lorry Transport Rail Service
21081
+ case 113: // All Rail Services
21082
+ case 114: // Cross-Country Rail Service
21083
+ case 115: // Vehicle Transport Rail Service
21084
+ case 116: // Rack and Pinion Railway (Rochers de Naye, Dolderbahn)
21085
+ case 117: // Additional Rail Service
21086
+ return 'RAIL';
21087
+ // Coach Service (200-299)
21088
+ case 200: // Coach Service
21089
+ case 201: // International Coach Service (EuroLine, Touring)
21090
+ case 202: // National Coach Service (National Express)
21091
+ case 203: // Shuttle Coach Service (Roissy Bus)
21092
+ case 204: // Regional Coach Service
21093
+ case 205: // Special Coach Service
21094
+ case 206: // Sightseeing Coach Service
21095
+ case 207: // Tourist Coach Service
21096
+ case 208: // Commuter Coach Service
21097
+ case 209: // All Coach Services
21098
+ return 'BUS';
21099
+ // Urban Railway Service (400-499)
21100
+ case 400: // Urban Railway Service
21101
+ case 401: // Metro Service (Métro de Paris)
21102
+ case 402: // Underground Service (London Underground, U-Bahn)
21103
+ case 403: // Urban Railway Service
21104
+ case 404: // All Urban Railway Services
21105
+ return 'SUBWAY';
21106
+ case 405: // Monorail
21107
+ return 'MONORAIL';
21108
+ // Bus Service (700-799)
21109
+ case 700: // Bus Service
21110
+ case 701: // Regional Bus Service (Eastbourne-Maidstone)
21111
+ case 702: // Express Bus Service (X19 Wokingham-Heathrow)
21112
+ case 703: // Stopping Bus Service
21113
+ case 704: // Local Bus Service
21114
+ case 705: // Night Bus Service
21115
+ case 706: // Post Bus Service
21116
+ case 707: // Special Needs Bus
21117
+ case 708: // Mobility Bus Service
21118
+ case 709: // Mobility Bus for Registered Disabled
21119
+ case 710: // Sightseeing Bus
21120
+ case 711: // Shuttle Bus (747 Heathrow-Gatwick)
21121
+ case 712: // School Bus
21122
+ case 713: // School and Public Service Bus
21123
+ case 714: // Rail Replacement Bus Service
21124
+ case 715: // Demand and Response Bus Service
21125
+ case 716: // All Bus Services
21126
+ return 'BUS';
21127
+ // Trolleybus Service (800-899)
21128
+ case 800: // Trolleybus Service
21129
+ return 'TROLLEYBUS';
21130
+ // Tram Service (900-999)
21131
+ case 900: // Tram Service
21132
+ case 901: // City Tram Service
21133
+ case 902: // Local Tram Service (Munich, Brussels, Croydon)
21134
+ case 903: // Regional Tram Service
21135
+ case 904: // Sightseeing Tram Service (Blackpool Seafront)
21136
+ case 905: // Shuttle Tram Service
21137
+ case 906: // All Tram Services
21138
+ return 'TRAM';
21139
+ // Water Transport Service (1000-1099)
21140
+ case 1000: // Water Transport Service
21141
+ return 'FERRY';
21142
+ // Air Service (1100-1199)
21143
+ case 1100: // Air Service
21144
+ return undefined;
21145
+ // Ferry Service (1200-1299)
21146
+ case 1200: // Ferry Service
21147
+ return 'FERRY';
21148
+ // Aerial Lift Service (1300-1399)
21149
+ case 1300: // Aerial Lift Service (Telefèric de Montjuïc, Roosevelt Island Tramway)
21150
+ case 1301: // Telecabin Service
21151
+ case 1302: // Cable Car Service
21152
+ case 1304: // Chair Lift Service
21153
+ case 1305: // Drag Lift Service
21154
+ case 1306: // Small Telecabin Service
21155
+ case 1307: // All Telecabin Services
21156
+ return 'AERIAL_LIFT';
21157
+ case 1303: // Elevator Service (Ascenseur, Aufzug)
21158
+ case 1400: // Funicular Service (Rigiblick)
21159
+ return 'FUNICULAR';
21160
+ // Taxi Service (1500-1599)
21161
+ case 1500: // Taxi Service
21162
+ case 1502: // Water Taxi Service
21163
+ case 1503: // Rail Taxi Service
21164
+ case 1504: // Bike Taxi Service
21165
+ case 1505: // Licensed Taxi Service
21166
+ case 1506: // Private Hire Service Vehicle
21167
+ case 1507: // All Taxi Services
21168
+ return undefined;
21169
+ case 1501: // Communal Taxi Service (Marshrutka, dolmuş)
21170
+ return 'BUS';
21171
+ // Miscellaneous Service (1700-1799)
21172
+ case 1700: // Miscellaneous Service / Unknown mode
21173
+ return undefined;
21174
+ case 1702: // Horse-drawn Carriage
21175
+ return 'BUS';
21099
21176
  default:
21100
21177
  return undefined;
21101
21178
  }
21102
21179
  };
21103
- const chGtfsProfile = {
21180
+ const extendedGtfsProfile = {
21104
21181
  routeTypeParser,
21105
21182
  };
21106
21183
 
@@ -22744,7 +22821,8 @@ const startRepl = (stopsPath, timetablePath) => {
22744
22821
 
22745
22822
  const program = new Command();
22746
22823
  const profiles = {
22747
- CH: chGtfsProfile,
22824
+ extended: extendedGtfsProfile,
22825
+ standard: standardGtfsProfile,
22748
22826
  };
22749
22827
  program
22750
22828
  .name('minotor')
@@ -22757,7 +22835,7 @@ program
22757
22835
  .option('-d, --date <date>', 'Date of the day to parse in yyyy-MM-dd format', DateTime.now().toFormat('yyyy-MM-dd'))
22758
22836
  .option('-t, --timetableOutputPath <path>', 'Path to output timetable file', '/tmp/timetable')
22759
22837
  .option('-s, --stopsOutputPath <path>', 'Path to output stops file', '/tmp/stops')
22760
- .option('-p, --profileName <name>', 'Profile name for GTFS config', 'CH')
22838
+ .option('-p, --profileName <name>', 'Profile name for GTFS config', 'extended')
22761
22839
  .option('-v, --verbose', 'Verbose mode', false)
22762
22840
  .action((gtfsPath, options) => __awaiter(void 0, void 0, void 0, function* () {
22763
22841
  if (options.verbose) {