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 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
- | `realtimeUrls` | array | An array of GTFS-Realtime urls to import. Optional. |
182
- | `realtimeHeaders` | array | An object of HTTP headers in key:value format to use when fetching GTFS-Realtime data from the `realtimeUrls` specified. Optional. |
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": "http://countyconnection.com/GTFS/google_transit.zip"
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": "http://countyconnection.com/GTFS/google_transit.zip",
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. `realtimeUrls` allows an array of GTFS-Realtime URLs. For example, a URL for trip updates, a URL for vehicle updates and a URL for service alerts. In addition, a `realtimeHeaders` parameter allows adding additional HTTP headers to the request.
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": "http://countyconnection.com/GTFS/google_transit.zip",
256
- "realtimeUrls": [
257
- "https://opendata.somewhere.com/gtfs-rt/VehicleUpdates.pb",
258
- "https://opendata.somewhere.com/gtfs-rt/TripUpdates.pb"
259
- ],
260
- "realtimeHeaders": {
261
- "Authorization": "bearer 1234567890"
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
- "realtimeUrls": [
393
- "https://agency.com/gtfs-rt/alerts",
394
- "https://agency.com/gtfs-rt/tripupdates",
395
- "https://agency.com/gtfs-rt/vehiclepositions"
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: 'http://countyconnection.com/GTFS/google_transit.zip',
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: 'http://countyconnection.com/GTFS/google_transit.zip',
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: 'http://countyconnection.com/GTFS/google_transit.zip',
611
+ url: 'https://opendata.somewhere.com/gtfs.zip',
596
612
  exclude: ['shapes'],
597
613
  },
598
614
  ],