gtfs 4.13.4 → 4.14.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/README.md +36 -20
- package/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +90 -59
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +86 -195
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.d.ts +20 -9
- package/dist/index.js +94 -65
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -178,8 +178,9 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
178
178
|
| `headers` | object | An object of HTTP headers in key:value format to use when fetching GTFS from the `url` specified. Optional. |
|
|
179
179
|
| `prefix` | string | A prefix to be added to every ID field maintain uniqueness when importing multiple GTFS from multiple agencies. Optional. |
|
|
180
180
|
| `exclude` | array | An array of GTFS file names (without `.txt`) to exclude when importing. Optional. |
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
181
|
+
| `realtimeAlerts` | object | An object containing a `url` field for GTFS-Realtime alerts and a `headers` field in key:value format to use when fetching GTFS-Realtime data. Optional. |
|
|
182
|
+
| `realtimeTripUpdates` | object | An object containing a `url` field for GTFS-Realtime trip updates and a `headers` field in key:value format to use when fetching GTFS-Realtime data. Optional. |
|
|
183
|
+
| `realtimeVehiclePositions` | object | An object containing a `url` field for GTFS-Realtime vehicle positions and a `headers` field in key:value format to use when fetching GTFS-Realtime data. Optional. |
|
|
183
184
|
|
|
184
185
|
- Specify a `url` to download GTFS:
|
|
185
186
|
|
|
@@ -187,7 +188,7 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
187
188
|
{
|
|
188
189
|
"agencies": [
|
|
189
190
|
{
|
|
190
|
-
"url": "
|
|
191
|
+
"url": "https://opendata.somewhere.com/gtfs.zip"
|
|
191
192
|
}
|
|
192
193
|
]
|
|
193
194
|
}
|
|
@@ -199,7 +200,7 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
199
200
|
{
|
|
200
201
|
"agencies": [
|
|
201
202
|
{
|
|
202
|
-
"url": "
|
|
203
|
+
"url": "https://opendata.somewhere.com/gtfs.zip",
|
|
203
204
|
"headers": {
|
|
204
205
|
"Content-Type": "application/json",
|
|
205
206
|
"Authorization": "bearer 1234567890"
|
|
@@ -246,19 +247,30 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
246
247
|
}
|
|
247
248
|
```
|
|
248
249
|
|
|
249
|
-
- Specify urls for GTFS-Realtime updates. `
|
|
250
|
+
- Specify urls for GTFS-Realtime updates. `realtimeAlerts`, `realtimeTripUpdates` and `realtimeVehiclePositions` fields accept an object with a `url` and optional `headers` field to specify HTTP headers to include with the request, usually for authorization purposes.
|
|
250
251
|
|
|
251
252
|
```json
|
|
252
253
|
{
|
|
253
254
|
"agencies": [
|
|
254
255
|
{
|
|
255
|
-
"url": "
|
|
256
|
-
"
|
|
257
|
-
"https://opendata.somewhere.com/gtfs-rt/
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
"url": "https://opendata.somewhere.com/gtfs.zip",
|
|
257
|
+
"realtimeAlerts": {
|
|
258
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/alerts",
|
|
259
|
+
"headers": {
|
|
260
|
+
"Authorization": "bearer 123456789"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"realtimeTripUpdates": {
|
|
264
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/tripupdates",
|
|
265
|
+
"headers": {
|
|
266
|
+
"Authorization": "bearer 123456789"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"realtimeVehiclePositions": {
|
|
270
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/vehiclepositions",
|
|
271
|
+
"headers": {
|
|
272
|
+
"Authorization": "bearer 123456789"
|
|
273
|
+
}
|
|
262
274
|
}
|
|
263
275
|
}
|
|
264
276
|
]
|
|
@@ -389,11 +401,15 @@ importGtfs({
|
|
|
389
401
|
"agencies": [
|
|
390
402
|
{
|
|
391
403
|
"url": "https://agency.com/gtfs.zip",
|
|
392
|
-
"
|
|
393
|
-
"https://
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
"realtimeAlerts": {
|
|
405
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/alerts"
|
|
406
|
+
},
|
|
407
|
+
"realtimeTripUpdates": {
|
|
408
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/tripupdates"
|
|
409
|
+
},
|
|
410
|
+
"realtimeVehiclePositions": {
|
|
411
|
+
"url": "https://opendata.somewhere.com/gtfs-rt/vehiclepositions"
|
|
412
|
+
}
|
|
397
413
|
}
|
|
398
414
|
],
|
|
399
415
|
"gtfsRealtimeExpirationSeconds": false
|
|
@@ -462,7 +478,7 @@ import { importGtfs } from 'gtfs';
|
|
|
462
478
|
const config = {
|
|
463
479
|
agencies: [
|
|
464
480
|
{
|
|
465
|
-
url: '
|
|
481
|
+
url: 'https://opendata.somewhere.com/gtfs.zip',
|
|
466
482
|
exclude: ['shapes'],
|
|
467
483
|
},
|
|
468
484
|
],
|
|
@@ -512,7 +528,7 @@ const config = {
|
|
|
512
528
|
sqlitePath: '/dev/sqlite/gtfs',
|
|
513
529
|
agencies: [
|
|
514
530
|
{
|
|
515
|
-
url: '
|
|
531
|
+
url: 'https://opendata.somewhere.com/gtfs.zip',
|
|
516
532
|
exclude: ['shapes'],
|
|
517
533
|
},
|
|
518
534
|
],
|
|
@@ -592,7 +608,7 @@ const config = {
|
|
|
592
608
|
sqlitePath: '/dev/sqlite/gtfs',
|
|
593
609
|
agencies: [
|
|
594
610
|
{
|
|
595
|
-
url: '
|
|
611
|
+
url: 'https://opendata.somewhere.com/gtfs.zip',
|
|
596
612
|
exclude: ['shapes'],
|
|
597
613
|
},
|
|
598
614
|
],
|