gtfs 4.17.0 → 4.17.2
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/dist/bin/gtfs-export.js +37 -22
- package/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +141 -130
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +135 -127
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.js +145 -133
- package/dist/index.js.map +1 -1
- package/dist/models/models.d.ts +43 -2
- package/dist/models/models.js +32 -17
- package/dist/models/models.js.map +1 -1
- package/package.json +6 -6
package/dist/bin/gtfs-export.js
CHANGED
|
@@ -1045,7 +1045,6 @@ var riderCategories = {
|
|
|
1045
1045
|
{
|
|
1046
1046
|
name: "is_default_fare_category",
|
|
1047
1047
|
type: "integer",
|
|
1048
|
-
required: true,
|
|
1049
1048
|
min: 0,
|
|
1050
1049
|
max: 1
|
|
1051
1050
|
},
|
|
@@ -1385,7 +1384,8 @@ var stops = {
|
|
|
1385
1384
|
{
|
|
1386
1385
|
name: "parent_station",
|
|
1387
1386
|
type: "text",
|
|
1388
|
-
index: true
|
|
1387
|
+
index: true,
|
|
1388
|
+
prefix: true
|
|
1389
1389
|
},
|
|
1390
1390
|
{
|
|
1391
1391
|
name: "stop_timezone",
|
|
@@ -2481,21 +2481,24 @@ var tripUpdates = {
|
|
|
2481
2481
|
required: true,
|
|
2482
2482
|
primary: true,
|
|
2483
2483
|
index: true,
|
|
2484
|
-
source: "id"
|
|
2484
|
+
source: "id",
|
|
2485
|
+
prefix: true
|
|
2485
2486
|
},
|
|
2486
2487
|
{
|
|
2487
2488
|
name: "vehicle_id",
|
|
2488
2489
|
type: "text",
|
|
2489
2490
|
index: true,
|
|
2490
2491
|
source: "tripUpdate.vehicle.id",
|
|
2491
|
-
default: null
|
|
2492
|
+
default: null,
|
|
2493
|
+
prefix: true
|
|
2492
2494
|
},
|
|
2493
2495
|
{
|
|
2494
2496
|
name: "trip_id",
|
|
2495
2497
|
type: "text",
|
|
2496
2498
|
index: true,
|
|
2497
2499
|
source: "tripUpdate.trip.tripId",
|
|
2498
|
-
default: null
|
|
2500
|
+
default: null,
|
|
2501
|
+
prefix: true
|
|
2499
2502
|
},
|
|
2500
2503
|
{
|
|
2501
2504
|
name: "trip_start_time",
|
|
@@ -2514,7 +2517,8 @@ var tripUpdates = {
|
|
|
2514
2517
|
type: "text",
|
|
2515
2518
|
index: true,
|
|
2516
2519
|
source: "tripUpdate.trip.routeId",
|
|
2517
|
-
default: null
|
|
2520
|
+
default: null,
|
|
2521
|
+
prefix: true
|
|
2518
2522
|
},
|
|
2519
2523
|
{
|
|
2520
2524
|
name: "start_date",
|
|
@@ -2557,7 +2561,8 @@ var stopTimeUpdates = {
|
|
|
2557
2561
|
type: "text",
|
|
2558
2562
|
index: true,
|
|
2559
2563
|
source: "parent.tripUpdate.trip.tripId",
|
|
2560
|
-
default: null
|
|
2564
|
+
default: null,
|
|
2565
|
+
prefix: true
|
|
2561
2566
|
},
|
|
2562
2567
|
{
|
|
2563
2568
|
name: "trip_start_time",
|
|
@@ -2576,14 +2581,16 @@ var stopTimeUpdates = {
|
|
|
2576
2581
|
type: "text",
|
|
2577
2582
|
index: true,
|
|
2578
2583
|
source: "parent.tripUpdate.trip.routeId",
|
|
2579
|
-
default: null
|
|
2584
|
+
default: null,
|
|
2585
|
+
prefix: true
|
|
2580
2586
|
},
|
|
2581
2587
|
{
|
|
2582
2588
|
name: "stop_id",
|
|
2583
2589
|
type: "text",
|
|
2584
2590
|
index: true,
|
|
2585
2591
|
source: "stopId",
|
|
2586
|
-
default: null
|
|
2592
|
+
default: null,
|
|
2593
|
+
prefix: true
|
|
2587
2594
|
},
|
|
2588
2595
|
{
|
|
2589
2596
|
name: "stop_sequence",
|
|
@@ -2645,7 +2652,8 @@ var vehiclePositions = {
|
|
|
2645
2652
|
required: true,
|
|
2646
2653
|
primary: true,
|
|
2647
2654
|
index: true,
|
|
2648
|
-
source: "id"
|
|
2655
|
+
source: "id",
|
|
2656
|
+
prefix: true
|
|
2649
2657
|
},
|
|
2650
2658
|
{
|
|
2651
2659
|
name: "bearing",
|
|
@@ -2687,7 +2695,8 @@ var vehiclePositions = {
|
|
|
2687
2695
|
type: "text",
|
|
2688
2696
|
index: true,
|
|
2689
2697
|
source: "vehicle.trip.tripId",
|
|
2690
|
-
default: null
|
|
2698
|
+
default: null,
|
|
2699
|
+
prefix: true
|
|
2691
2700
|
},
|
|
2692
2701
|
{
|
|
2693
2702
|
name: "trip_start_date",
|
|
@@ -2732,7 +2741,8 @@ var vehiclePositions = {
|
|
|
2732
2741
|
type: "text",
|
|
2733
2742
|
index: true,
|
|
2734
2743
|
source: "vehicle.vehicle.id",
|
|
2735
|
-
default: null
|
|
2744
|
+
default: null,
|
|
2745
|
+
prefix: true
|
|
2736
2746
|
},
|
|
2737
2747
|
{
|
|
2738
2748
|
name: "vehicle_label",
|
|
@@ -2782,7 +2792,8 @@ var serviceAlerts = {
|
|
|
2782
2792
|
required: true,
|
|
2783
2793
|
primary: true,
|
|
2784
2794
|
index: true,
|
|
2785
|
-
source: "id"
|
|
2795
|
+
source: "id",
|
|
2796
|
+
prefix: true
|
|
2786
2797
|
},
|
|
2787
2798
|
{
|
|
2788
2799
|
name: "active_period",
|
|
@@ -2871,21 +2882,24 @@ var serviceAlertInformedEntities = {
|
|
|
2871
2882
|
type: "text",
|
|
2872
2883
|
required: true,
|
|
2873
2884
|
primary: true,
|
|
2874
|
-
source: "parent.id"
|
|
2885
|
+
source: "parent.id",
|
|
2886
|
+
prefix: true
|
|
2875
2887
|
},
|
|
2876
2888
|
{
|
|
2877
2889
|
name: "stop_id",
|
|
2878
2890
|
type: "text",
|
|
2879
2891
|
index: true,
|
|
2880
2892
|
source: "stopId",
|
|
2881
|
-
default: null
|
|
2893
|
+
default: null,
|
|
2894
|
+
prefix: true
|
|
2882
2895
|
},
|
|
2883
2896
|
{
|
|
2884
2897
|
name: "route_id",
|
|
2885
2898
|
type: "text",
|
|
2886
2899
|
index: true,
|
|
2887
2900
|
source: "routeId",
|
|
2888
|
-
default: null
|
|
2901
|
+
default: null,
|
|
2902
|
+
prefix: true
|
|
2889
2903
|
},
|
|
2890
2904
|
{
|
|
2891
2905
|
name: "route_type",
|
|
@@ -2899,7 +2913,8 @@ var serviceAlertInformedEntities = {
|
|
|
2899
2913
|
type: "text",
|
|
2900
2914
|
index: true,
|
|
2901
2915
|
source: "trip.tripId",
|
|
2902
|
-
default: null
|
|
2916
|
+
default: null,
|
|
2917
|
+
prefix: true
|
|
2903
2918
|
},
|
|
2904
2919
|
{
|
|
2905
2920
|
name: "direction_id",
|
|
@@ -3261,8 +3276,8 @@ import { feature, featureCollection } from "@turf/helpers";
|
|
|
3261
3276
|
// src/lib/import-gtfs-realtime.ts
|
|
3262
3277
|
import pluralize from "pluralize";
|
|
3263
3278
|
import GtfsRealtimeBindings from "gtfs-realtime-bindings";
|
|
3264
|
-
import sqlString2 from "sqlstring-sqlite";
|
|
3265
3279
|
import mapSeries from "promise-map-series";
|
|
3280
|
+
import { get } from "lodash-es";
|
|
3266
3281
|
|
|
3267
3282
|
// src/lib/utils.ts
|
|
3268
3283
|
import sqlString from "sqlstring-sqlite";
|
|
@@ -3296,7 +3311,7 @@ import { writeFile } from "node:fs/promises";
|
|
|
3296
3311
|
import { without, compact as compact2 } from "lodash-es";
|
|
3297
3312
|
import pluralize3 from "pluralize";
|
|
3298
3313
|
import { stringify } from "csv-stringify";
|
|
3299
|
-
import
|
|
3314
|
+
import sqlString2 from "sqlstring-sqlite";
|
|
3300
3315
|
import mapSeries3 from "promise-map-series";
|
|
3301
3316
|
import untildify4 from "untildify";
|
|
3302
3317
|
var getAgencies = (db, config) => {
|
|
@@ -3348,7 +3363,7 @@ var exportGtfs = async (initialConfig) => {
|
|
|
3348
3363
|
exportPath,
|
|
3349
3364
|
`${model.filenameBase}.${model.filenameExtension}`
|
|
3350
3365
|
);
|
|
3351
|
-
const tableName =
|
|
3366
|
+
const tableName = sqlString2.escapeId(model.filenameBase);
|
|
3352
3367
|
const lines = db.prepare(`SELECT * FROM ${tableName};`).all();
|
|
3353
3368
|
if (!lines || lines.length === 0) {
|
|
3354
3369
|
if (!model.nonstandard) {
|
|
@@ -3410,7 +3425,7 @@ var exportGtfs = async (initialConfig) => {
|
|
|
3410
3425
|
};
|
|
3411
3426
|
|
|
3412
3427
|
// src/lib/advancedQuery.ts
|
|
3413
|
-
import
|
|
3428
|
+
import sqlString3 from "sqlstring-sqlite";
|
|
3414
3429
|
|
|
3415
3430
|
// src/lib/gtfs/routes.ts
|
|
3416
3431
|
import { omit as omit3, pick } from "lodash-es";
|
|
@@ -3424,7 +3439,7 @@ import { omit as omit5, orderBy, pick as pick3 } from "lodash-es";
|
|
|
3424
3439
|
|
|
3425
3440
|
// src/lib/gtfs/stop-times.ts
|
|
3426
3441
|
import { omit as omit6 } from "lodash-es";
|
|
3427
|
-
import
|
|
3442
|
+
import sqlString4 from "sqlstring-sqlite";
|
|
3428
3443
|
|
|
3429
3444
|
// src/bin/gtfs-export.ts
|
|
3430
3445
|
var pe = new PrettyError();
|