gtfs 4.13.0 → 4.13.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 +34 -35
- package/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +78 -71
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +52 -54
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +148 -141
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/bin/gtfs-export.js
CHANGED
|
@@ -210,8 +210,6 @@ var model3 = {
|
|
|
210
210
|
{
|
|
211
211
|
name: "attribution_id",
|
|
212
212
|
type: "text",
|
|
213
|
-
primary: true,
|
|
214
|
-
required: true,
|
|
215
213
|
prefix: true
|
|
216
214
|
},
|
|
217
215
|
{
|
|
@@ -378,7 +376,7 @@ var model5 = {
|
|
|
378
376
|
},
|
|
379
377
|
{
|
|
380
378
|
name: "date",
|
|
381
|
-
type: "
|
|
379
|
+
type: "date",
|
|
382
380
|
required: true,
|
|
383
381
|
primary: true
|
|
384
382
|
},
|
|
@@ -462,13 +460,13 @@ var model6 = {
|
|
|
462
460
|
},
|
|
463
461
|
{
|
|
464
462
|
name: "start_date",
|
|
465
|
-
type: "
|
|
463
|
+
type: "date",
|
|
466
464
|
required: true,
|
|
467
465
|
index: true
|
|
468
466
|
},
|
|
469
467
|
{
|
|
470
468
|
name: "end_date",
|
|
471
|
-
type: "
|
|
469
|
+
type: "date",
|
|
472
470
|
required: true,
|
|
473
471
|
index: true
|
|
474
472
|
}
|
|
@@ -764,11 +762,11 @@ var model13 = {
|
|
|
764
762
|
},
|
|
765
763
|
{
|
|
766
764
|
name: "feed_start_date",
|
|
767
|
-
type: "
|
|
765
|
+
type: "date"
|
|
768
766
|
},
|
|
769
767
|
{
|
|
770
768
|
name: "feed_end_date",
|
|
771
|
-
type: "
|
|
769
|
+
type: "date"
|
|
772
770
|
},
|
|
773
771
|
{
|
|
774
772
|
name: "feed_version",
|
|
@@ -1621,11 +1619,11 @@ var model31 = {
|
|
|
1621
1619
|
},
|
|
1622
1620
|
{
|
|
1623
1621
|
name: "start_date",
|
|
1624
|
-
type: "
|
|
1622
|
+
type: "date"
|
|
1625
1623
|
},
|
|
1626
1624
|
{
|
|
1627
1625
|
name: "end_date",
|
|
1628
|
-
type: "
|
|
1626
|
+
type: "date"
|
|
1629
1627
|
},
|
|
1630
1628
|
{
|
|
1631
1629
|
name: "monday",
|
|
@@ -2130,7 +2128,7 @@ var model41 = {
|
|
|
2130
2128
|
},
|
|
2131
2129
|
{
|
|
2132
2130
|
name: "service_date",
|
|
2133
|
-
type: "
|
|
2131
|
+
type: "date",
|
|
2134
2132
|
index: true
|
|
2135
2133
|
},
|
|
2136
2134
|
{
|
|
@@ -2212,7 +2210,7 @@ var model42 = {
|
|
|
2212
2210
|
},
|
|
2213
2211
|
{
|
|
2214
2212
|
name: "service_date",
|
|
2215
|
-
type: "
|
|
2213
|
+
type: "date",
|
|
2216
2214
|
index: true
|
|
2217
2215
|
},
|
|
2218
2216
|
{
|
|
@@ -2296,12 +2294,12 @@ var model43 = {
|
|
|
2296
2294
|
},
|
|
2297
2295
|
{
|
|
2298
2296
|
name: "ridership_start_date",
|
|
2299
|
-
type: "
|
|
2297
|
+
type: "date",
|
|
2300
2298
|
index: true
|
|
2301
2299
|
},
|
|
2302
2300
|
{
|
|
2303
2301
|
name: "ridership_end_date",
|
|
2304
|
-
type: "
|
|
2302
|
+
type: "date",
|
|
2305
2303
|
index: true
|
|
2306
2304
|
},
|
|
2307
2305
|
{
|
|
@@ -2424,7 +2422,7 @@ var model44 = {
|
|
|
2424
2422
|
},
|
|
2425
2423
|
{
|
|
2426
2424
|
name: "service_date",
|
|
2427
|
-
type: "
|
|
2425
|
+
type: "date",
|
|
2428
2426
|
index: true
|
|
2429
2427
|
},
|
|
2430
2428
|
{
|
|
@@ -2471,17 +2469,17 @@ var model45 = {
|
|
|
2471
2469
|
},
|
|
2472
2470
|
{
|
|
2473
2471
|
name: "ride_start_date",
|
|
2474
|
-
type: "
|
|
2472
|
+
type: "date",
|
|
2475
2473
|
index: true
|
|
2476
2474
|
},
|
|
2477
2475
|
{
|
|
2478
2476
|
name: "ride_end_date",
|
|
2479
|
-
type: "
|
|
2477
|
+
type: "date",
|
|
2480
2478
|
index: true
|
|
2481
2479
|
},
|
|
2482
2480
|
{
|
|
2483
2481
|
name: "gtfs_feed_date",
|
|
2484
|
-
type: "
|
|
2482
|
+
type: "date",
|
|
2485
2483
|
index: true
|
|
2486
2484
|
},
|
|
2487
2485
|
{
|
|
@@ -3271,23 +3269,6 @@ var models_default = models;
|
|
|
3271
3269
|
// src/lib/db.ts
|
|
3272
3270
|
import Database from "better-sqlite3";
|
|
3273
3271
|
import untildify2 from "untildify";
|
|
3274
|
-
|
|
3275
|
-
// src/lib/utils.ts
|
|
3276
|
-
import sqlString from "sqlstring-sqlite";
|
|
3277
|
-
import Long from "long";
|
|
3278
|
-
function setDefaultConfig(initialConfig) {
|
|
3279
|
-
const defaults = {
|
|
3280
|
-
sqlitePath: ":memory:",
|
|
3281
|
-
ignoreDuplicates: false,
|
|
3282
|
-
gtfsRealtimeExpirationSeconds: 0
|
|
3283
|
-
};
|
|
3284
|
-
return {
|
|
3285
|
-
...defaults,
|
|
3286
|
-
...initialConfig
|
|
3287
|
-
};
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
// src/lib/db.ts
|
|
3291
3272
|
var dbs = {};
|
|
3292
3273
|
function setupDb(sqlitePath) {
|
|
3293
3274
|
const db = new Database(untildify2(sqlitePath));
|
|
@@ -3299,7 +3280,7 @@ function setupDb(sqlitePath) {
|
|
|
3299
3280
|
}
|
|
3300
3281
|
function openDb(config = null) {
|
|
3301
3282
|
if (config) {
|
|
3302
|
-
const { sqlitePath, db } =
|
|
3283
|
+
const { sqlitePath = ":memory:", db } = config;
|
|
3303
3284
|
if (db) {
|
|
3304
3285
|
return db;
|
|
3305
3286
|
}
|
|
@@ -3308,6 +3289,9 @@ function openDb(config = null) {
|
|
|
3308
3289
|
}
|
|
3309
3290
|
return setupDb(sqlitePath);
|
|
3310
3291
|
}
|
|
3292
|
+
if (Object.keys(dbs).length === 0) {
|
|
3293
|
+
return setupDb(":memory:");
|
|
3294
|
+
}
|
|
3311
3295
|
if (Object.keys(dbs).length === 1) {
|
|
3312
3296
|
const filename = Object.keys(dbs)[0];
|
|
3313
3297
|
return dbs[filename];
|
|
@@ -3332,6 +3316,21 @@ import {
|
|
|
3332
3316
|
} from "lodash-es";
|
|
3333
3317
|
import { feature, featureCollection } from "@turf/helpers";
|
|
3334
3318
|
|
|
3319
|
+
// src/lib/utils.ts
|
|
3320
|
+
import sqlString from "sqlstring-sqlite";
|
|
3321
|
+
import Long from "long";
|
|
3322
|
+
function setDefaultConfig(initialConfig) {
|
|
3323
|
+
const defaults = {
|
|
3324
|
+
sqlitePath: ":memory:",
|
|
3325
|
+
ignoreDuplicates: false,
|
|
3326
|
+
gtfsRealtimeExpirationSeconds: 0
|
|
3327
|
+
};
|
|
3328
|
+
return {
|
|
3329
|
+
...defaults,
|
|
3330
|
+
...initialConfig
|
|
3331
|
+
};
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3335
3334
|
// src/lib/export.ts
|
|
3336
3335
|
import path2 from "node:path";
|
|
3337
3336
|
import { writeFile } from "node:fs/promises";
|