gtfs 4.10.4 → 4.11.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/CHANGELOG.md +14 -0
- package/README.md +57 -9
- package/lib/advancedQuery.js +1 -1
- package/lib/geojson-utils.js +7 -7
- package/lib/gtfs/agencies.js +2 -2
- package/lib/gtfs/areas.js +1 -1
- package/lib/gtfs/attributions.js +2 -2
- package/lib/gtfs/booking-rules.js +32 -0
- package/lib/gtfs/calendar-dates.js +2 -2
- package/lib/gtfs/calendars.js +2 -2
- package/lib/gtfs/fare-attributes.js +2 -2
- package/lib/gtfs/fare-leg-rules.js +2 -2
- package/lib/gtfs/fare-products.js +2 -2
- package/lib/gtfs/fare-rules.js +2 -2
- package/lib/gtfs/fare-transfer-rules.js +2 -2
- package/lib/gtfs/feed-info.js +2 -2
- package/lib/gtfs/frequencies.js +2 -2
- package/lib/gtfs/levels.js +1 -1
- package/lib/gtfs/location-group-stops.js +32 -0
- package/lib/gtfs/location-groups.js +32 -0
- package/lib/gtfs/pathways.js +2 -2
- package/lib/gtfs/routes.js +3 -3
- package/lib/gtfs/shapes.js +5 -5
- package/lib/gtfs/stop-areas.js +2 -2
- package/lib/gtfs/stop-times.js +2 -2
- package/lib/gtfs/transfers.js +2 -2
- package/lib/gtfs/translations.js +2 -2
- package/lib/gtfs/trips.js +1 -1
- package/lib/gtfs-plus/calendar-attributes.js +2 -2
- package/lib/gtfs-plus/directions.js +2 -2
- package/lib/gtfs-plus/route-attributes.js +2 -2
- package/lib/gtfs-plus/stop-attributes.js +2 -2
- package/lib/gtfs-realtime/service-alerts.js +2 -2
- package/lib/gtfs-realtime/trip-updates.js +2 -2
- package/lib/gtfs-realtime/vehicle-positions.js +2 -2
- package/lib/gtfs-ride/board-alights.js +2 -2
- package/lib/gtfs-ride/ride-feed-infos.js +2 -2
- package/lib/gtfs-ride/rider-trips.js +2 -2
- package/lib/gtfs-ride/riderships.js +2 -2
- package/lib/gtfs-ride/trip-capacities.js +2 -2
- package/lib/gtfs.js +12 -0
- package/lib/import.js +15 -8
- package/lib/non-standard/timetable-notes-references.js +2 -2
- package/lib/non-standard/timetable-notes.js +2 -2
- package/lib/non-standard/timetable-pages.js +2 -2
- package/lib/non-standard/timetable-stop-order.js +2 -2
- package/lib/non-standard/timetables.js +2 -2
- package/lib/non-standard/trips-dated-vehicle-journey.js +2 -2
- package/lib/ods/deadhead-times.js +2 -2
- package/lib/ods/deadheads.js +2 -2
- package/lib/ods/ops-locations.js +2 -2
- package/lib/ods/run-events.js +2 -2
- package/lib/ods/runs-pieces.js +2 -2
- package/models/gtfs/attributions.js +2 -2
- package/models/gtfs/booking-rules.js +91 -0
- package/models/gtfs/fare-leg-rules.js +5 -0
- package/models/gtfs/location-group-stops.js +21 -0
- package/models/gtfs/location-groups.js +18 -0
- package/models/gtfs/stop-times.js +33 -0
- package/models/models.js +6 -0
- package/package.json +4 -4
- package/test/mocha/get-agencies.js +1 -1
- package/test/mocha/get-booking-rules.js +28 -0
- package/test/mocha/get-calendar-dates.js +1 -1
- package/test/mocha/get-fare-rules.js +1 -1
- package/test/mocha/get-location-group-stops.js +33 -0
- package/test/mocha/get-location-groups.js +28 -0
- package/test/mocha/get-routes.js +2 -2
- package/test/mocha/get-shapes.js +6 -6
- package/test/mocha/get-stoptimes.js +1 -1
package/lib/gtfs/translations.js
CHANGED
|
@@ -16,7 +16,7 @@ export function getTranslations(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(translations.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTranslations(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/gtfs/trips.js
CHANGED
|
@@ -21,7 +21,7 @@ export function getTrips(query = {}, fields = [], orderBy = [], options = {}) {
|
|
|
21
21
|
|
|
22
22
|
return db
|
|
23
23
|
.prepare(
|
|
24
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
24
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
25
25
|
)
|
|
26
26
|
.all();
|
|
27
27
|
}
|
|
@@ -16,7 +16,7 @@ export function getCalendarAttributes(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(calendarAttributes.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getCalendarAttributes(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getDirections(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(directions.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getDirections(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getRouteAttributes(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(routeAttributes.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRouteAttributes(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getStopAttributes(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(stopAttributes.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getStopAttributes(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -17,7 +17,7 @@ export function getServiceAlerts(
|
|
|
17
17
|
query = {},
|
|
18
18
|
fields = [],
|
|
19
19
|
orderBy = [],
|
|
20
|
-
options = {}
|
|
20
|
+
options = {},
|
|
21
21
|
) {
|
|
22
22
|
const db = options.db ?? openDb();
|
|
23
23
|
const tableName = sqlString.escapeId(serviceAlerts.filenameBase);
|
|
@@ -28,7 +28,7 @@ export function getServiceAlerts(
|
|
|
28
28
|
|
|
29
29
|
return db
|
|
30
30
|
.prepare(
|
|
31
|
-
`${selectClause} FROM ${tableName} INNER JOIN ${joinTable} ON ${tableName}.id=${joinTable}.alert_id ${whereClause} ${orderByClause}
|
|
31
|
+
`${selectClause} FROM ${tableName} INNER JOIN ${joinTable} ON ${tableName}.id=${joinTable}.alert_id ${whereClause} ${orderByClause};`,
|
|
32
32
|
)
|
|
33
33
|
.all();
|
|
34
34
|
}
|
|
@@ -16,7 +16,7 @@ export function getTripUpdates(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(tripUpdates.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTripUpdates(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getVehiclePositions(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(vehiclePositions.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getVehiclePositions(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getBoardAlights(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(boardAlights.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getBoardAlights(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getRideFeedInfos(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(rideFeedInfo.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRideFeedInfos(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getRiderTrips(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(riderTrip.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRiderTrips(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getRiderships(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(riderships.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRiderships(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTripCapacities(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(tripCapacity.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTripCapacities(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/gtfs.js
CHANGED
|
@@ -8,6 +8,7 @@ import exportGtfs from './export.js';
|
|
|
8
8
|
import { getAgencies } from './gtfs/agencies.js';
|
|
9
9
|
import { getAreas } from './gtfs/areas.js';
|
|
10
10
|
import { getAttributions } from './gtfs/attributions.js';
|
|
11
|
+
import { getBookingRules } from './gtfs/booking-rules.js';
|
|
11
12
|
import { getCalendarDates } from './gtfs/calendar-dates.js';
|
|
12
13
|
import { getCalendars } from './gtfs/calendars.js';
|
|
13
14
|
import { getFareAttributes } from './gtfs/fare-attributes.js';
|
|
@@ -19,6 +20,8 @@ import { getFareTransferRules } from './gtfs/fare-transfer-rules.js';
|
|
|
19
20
|
import { getFeedInfo } from './gtfs/feed-info.js';
|
|
20
21
|
import { getFrequencies } from './gtfs/frequencies.js';
|
|
21
22
|
import { getLevels } from './gtfs/levels.js';
|
|
23
|
+
import { getLocationGroups } from './gtfs/location-groups.js';
|
|
24
|
+
import { getLocationGroupStops } from './gtfs/location-group-stops.js';
|
|
22
25
|
import { getNetworks } from './gtfs/networks.js';
|
|
23
26
|
import { getPathways } from './gtfs/pathways.js';
|
|
24
27
|
import { getRouteNetworks } from './gtfs/route-networks.js';
|
|
@@ -86,6 +89,9 @@ export { _getAreas as getAreas };
|
|
|
86
89
|
const _getAttributions = getAttributions;
|
|
87
90
|
export { _getAttributions as getAttributions };
|
|
88
91
|
|
|
92
|
+
const _getBookingRules = getBookingRules;
|
|
93
|
+
export { _getBookingRules as getBookingRules };
|
|
94
|
+
|
|
89
95
|
const _getCalendarDates = getCalendarDates;
|
|
90
96
|
export { _getCalendarDates as getCalendarDates };
|
|
91
97
|
|
|
@@ -119,6 +125,12 @@ export { _getFrequencies as getFrequencies };
|
|
|
119
125
|
const _getLevels = getLevels;
|
|
120
126
|
export { _getLevels as getLevels };
|
|
121
127
|
|
|
128
|
+
const _getLocationGroups = getLocationGroups;
|
|
129
|
+
export { _getLocationGroups as getLocationGroups };
|
|
130
|
+
|
|
131
|
+
const _getLocationGroupStops = getLocationGroupStops;
|
|
132
|
+
export { _getLocationGroupStops as getLocationGroupStops };
|
|
133
|
+
|
|
122
134
|
const _getNetworks = getNetworks;
|
|
123
135
|
export { _getNetworks as getNetworks };
|
|
124
136
|
|
package/lib/import.js
CHANGED
|
@@ -469,22 +469,29 @@ const formatLine = (line, model, totalLineCount) => {
|
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
-
// Convert to midnight timestamp
|
|
473
|
-
const
|
|
472
|
+
// Convert to midnight timestamp and add timestamp columns as integer seconds from midnight
|
|
473
|
+
const timeColumnNames = [
|
|
474
474
|
'start_time',
|
|
475
475
|
'end_time',
|
|
476
476
|
'arrival_time',
|
|
477
477
|
'departure_time',
|
|
478
|
+
'prior_notice_last_time',
|
|
479
|
+
'prior_notice_start_time',
|
|
480
|
+
'start_pickup_drop_off_window',
|
|
478
481
|
];
|
|
479
482
|
|
|
480
|
-
for (const
|
|
481
|
-
if (formattedLine[
|
|
482
|
-
|
|
483
|
-
|
|
483
|
+
for (const timeColumnName of timeColumnNames) {
|
|
484
|
+
if (formattedLine[timeColumnName]) {
|
|
485
|
+
const timestampColumnName = timeColumnName.endsWith('time')
|
|
486
|
+
? `${timeColumnName}stamp`
|
|
487
|
+
: `${timeColumnName}_timestamp`;
|
|
488
|
+
formattedLine[timestampColumnName] = calculateSecondsFromMidnight(
|
|
489
|
+
formattedLine[timeColumnName],
|
|
490
|
+
);
|
|
484
491
|
|
|
485
492
|
// Ensure leading zeros for time columns
|
|
486
|
-
formattedLine[
|
|
487
|
-
formattedLine[
|
|
493
|
+
formattedLine[timeColumnName] = padLeadingZeros(
|
|
494
|
+
formattedLine[timeColumnName],
|
|
488
495
|
);
|
|
489
496
|
}
|
|
490
497
|
}
|
|
@@ -16,7 +16,7 @@ export function getTimetableNotesReferences(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(timetableNotesReferences.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTimetableNotesReferences(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTimetableNotes(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(timetableNotes.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTimetableNotes(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTimetablePages(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(timetablePages.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTimetablePages(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTimetableStopOrders(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(timetableStopOrder.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTimetableStopOrders(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTimetables(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(timetables.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTimetables(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getTripsDatedVehicleJourneys(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(directions.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getTripsDatedVehicleJourneys(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -16,7 +16,7 @@ export function getDeadheadTimes(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(deadheadTimes.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getDeadheadTimes(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/ods/deadheads.js
CHANGED
|
@@ -16,7 +16,7 @@ export function getDeadheads(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(deadheads.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getDeadheads(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/ods/ops-locations.js
CHANGED
|
@@ -16,7 +16,7 @@ export function getOpsLocations(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(opsLocations.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getOpsLocations(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/ods/run-events.js
CHANGED
|
@@ -16,7 +16,7 @@ export function getRunEvents(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(runEvents.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRunEvents(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
package/lib/ods/runs-pieces.js
CHANGED
|
@@ -16,7 +16,7 @@ export function getRunsPieces(
|
|
|
16
16
|
query = {},
|
|
17
17
|
fields = [],
|
|
18
18
|
orderBy = [],
|
|
19
|
-
options = {}
|
|
19
|
+
options = {},
|
|
20
20
|
) {
|
|
21
21
|
const db = options.db ?? openDb();
|
|
22
22
|
const tableName = sqlString.escapeId(runsPieces.filenameBase);
|
|
@@ -26,7 +26,7 @@ export function getRunsPieces(
|
|
|
26
26
|
|
|
27
27
|
return db
|
|
28
28
|
.prepare(
|
|
29
|
-
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause}
|
|
29
|
+
`${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
|
|
30
30
|
)
|
|
31
31
|
.all();
|
|
32
32
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const model = {
|
|
2
|
+
filenameBase: 'booking_rules',
|
|
3
|
+
schema: [
|
|
4
|
+
{
|
|
5
|
+
name: 'booking_rule_id',
|
|
6
|
+
type: 'varchar(255)',
|
|
7
|
+
primary: true,
|
|
8
|
+
prefix: true,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'booking_type',
|
|
12
|
+
type: 'integer',
|
|
13
|
+
required: true,
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 2,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'prior_notice_duration_min',
|
|
19
|
+
type: 'integer',
|
|
20
|
+
min: 0,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'prior_notice_duration_max',
|
|
24
|
+
type: 'integer',
|
|
25
|
+
min: 0,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'prior_notice_last_day',
|
|
29
|
+
type: 'integer',
|
|
30
|
+
min: 0,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'prior_notice_last_time',
|
|
34
|
+
type: 'varchar(255)',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'prior_notice_last_timestamp',
|
|
38
|
+
type: 'integer',
|
|
39
|
+
index: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'prior_notice_start_day',
|
|
43
|
+
type: 'integer',
|
|
44
|
+
min: 0,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'prior_notice_start_time',
|
|
48
|
+
type: 'varchar(255)',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'prior_notice_start_timestamp',
|
|
52
|
+
type: 'integer',
|
|
53
|
+
index: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'prior_notice_service_id',
|
|
57
|
+
type: 'varchar(255)',
|
|
58
|
+
prefix: true,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'message',
|
|
62
|
+
type: 'varchar(2047)',
|
|
63
|
+
nocase: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'pickup_message',
|
|
67
|
+
type: 'varchar(2047)',
|
|
68
|
+
nocase: true,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'drop_off_message',
|
|
72
|
+
type: 'varchar(2047)',
|
|
73
|
+
nocase: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'phone_number',
|
|
77
|
+
type: 'varchar(64)',
|
|
78
|
+
nocase: true,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'info_url',
|
|
82
|
+
type: 'varchar(2047)',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'booking_url',
|
|
86
|
+
type: 'varchar(2047)',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default model;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const model = {
|
|
2
|
+
filenameBase: 'location_group_stops',
|
|
3
|
+
schema: [
|
|
4
|
+
{
|
|
5
|
+
name: 'location_group_id',
|
|
6
|
+
type: 'varchar(255)',
|
|
7
|
+
prefix: true,
|
|
8
|
+
index: true,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'stop_id',
|
|
13
|
+
type: 'varchar(255)',
|
|
14
|
+
required: true,
|
|
15
|
+
prefix: true,
|
|
16
|
+
index: true,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default model;
|