gtfs 3.3.0 → 3.5.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/@types/index.d.ts +337 -75
- package/CHANGELOG.md +35 -0
- package/README.md +191 -13
- package/bin/gtfsrealtime-update.js +32 -0
- package/config-sample-rtupdates.json +28 -0
- package/lib/advancedQuery.js +45 -0
- package/lib/db.js +2 -1
- package/lib/gtfs/shapes.js +3 -2
- package/lib/gtfs/stops.js +2 -0
- package/lib/gtfs-realtime/service-alerts.js +32 -0
- package/lib/gtfs-realtime/stop-times-updates.js +30 -0
- package/lib/gtfs-realtime/trip-updates.js +30 -0
- package/lib/gtfs-realtime/vehicle-positions.js +30 -0
- package/lib/gtfs.js +36 -1
- package/lib/import.js +320 -7
- package/lib/log-utils.js +8 -7
- package/lib/non-standard/trips-dated-vehicle-journey.js +30 -0
- package/lib/utils.js +29 -4
- package/models/gtfs-realtime/service-alert-targets.js +38 -0
- package/models/gtfs-realtime/service-alerts.js +60 -0
- package/models/gtfs-realtime/stop-times-updates.js +67 -0
- package/models/gtfs-realtime/trip-updates.js +50 -0
- package/models/gtfs-realtime/vehicle-positions.js +73 -0
- package/models/models.js +13 -0
- package/models/non-standard/timetable-pages.js +0 -1
- package/models/non-standard/trips-dated-vehicle-journey.js +32 -0
- package/package.json +17 -14
- package/test/mocha/advanced-query.js +80 -0
- package/test/mocha/exec-raw-query.js +39 -0
- package/test/mocha/get-shapes-as-geojson.js +15 -0
- package/test/mocha/get-shapes.js +28 -0
- package/test/mocha/get-stops-as-geojson.js +14 -0
- package/test/mocha/get-stops.js +49 -0
- package/test/mocha/run-raw-query.js +54 -0
package/@types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import CsvParse = require(
|
|
2
|
-
import * as Sqlite3 from
|
|
3
|
-
import { FeatureCollection, Geometry } from
|
|
1
|
+
import CsvParse = require('csv-parse');
|
|
2
|
+
import * as Sqlite3 from 'sqlite';
|
|
3
|
+
import { FeatureCollection, Geometry } from '@turf/helpers';
|
|
4
4
|
|
|
5
5
|
export {}; // disable implicit exporting of types
|
|
6
6
|
|
|
@@ -8,75 +8,117 @@ type Unpromise<T> = T extends Promise<infer U> ? U : T;
|
|
|
8
8
|
|
|
9
9
|
export type SqlDatabase = Unpromise<ReturnType<typeof Sqlite3.open>>;
|
|
10
10
|
|
|
11
|
-
export type SqlValue =
|
|
11
|
+
export type SqlValue =
|
|
12
|
+
| undefined
|
|
13
|
+
| null
|
|
14
|
+
| string
|
|
15
|
+
| number
|
|
16
|
+
| boolean
|
|
17
|
+
| Date
|
|
18
|
+
| SqlValue[];
|
|
12
19
|
|
|
13
20
|
export type SqlWhere = Record<string, null | SqlValue | SqlValue[]>;
|
|
14
21
|
|
|
15
22
|
export type SqlSelect = string[];
|
|
16
23
|
|
|
17
|
-
export type SqlOrderBy = Array<[string,
|
|
24
|
+
export type SqlOrderBy = Array<[string, 'ASC' | 'DESC']>;
|
|
25
|
+
|
|
26
|
+
export type JoinTables = Array<JoinOptions>;
|
|
18
27
|
|
|
19
28
|
export type SqlResults = Array<Record<string, any>>;
|
|
20
29
|
|
|
30
|
+
export type SqlQueryString = string;
|
|
31
|
+
|
|
32
|
+
export type SqlTableName = string;
|
|
33
|
+
|
|
21
34
|
export type Config = ExportConfig & ImportConfig;
|
|
22
35
|
|
|
36
|
+
export type AdvancedQueryOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* An advanced query
|
|
39
|
+
*/
|
|
40
|
+
query?: SqlWhere;
|
|
41
|
+
fields?: SqlSelect;
|
|
42
|
+
orderBy?: SqlOrderBy;
|
|
43
|
+
join?: Array<JoinOptions>;
|
|
44
|
+
options?: QueryOptions;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type JoinOptions = {
|
|
48
|
+
/**
|
|
49
|
+
* Options for joining, type
|
|
50
|
+
*/
|
|
51
|
+
type?: 'LEFT OUTER' | 'INNER';
|
|
52
|
+
table: string;
|
|
53
|
+
on: string;
|
|
54
|
+
};
|
|
23
55
|
interface VerboseConfig {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Whether or not to print output to the console. Defaults to true.
|
|
58
|
+
*/
|
|
59
|
+
verbose?: boolean;
|
|
28
60
|
}
|
|
29
61
|
|
|
30
62
|
export interface DbConfig {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
63
|
+
/**
|
|
64
|
+
* A path to an SQLite database. Defaults to using an in-memory database.
|
|
65
|
+
*/
|
|
66
|
+
sqlitePath?: string;
|
|
35
67
|
}
|
|
36
68
|
|
|
37
69
|
export interface ExportConfig extends DbConfig, VerboseConfig {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Path to a directory to store exported GTFS files. Defaults to `gtfs-export/<agency_name>`.
|
|
72
|
+
*/
|
|
73
|
+
exportPath?: string;
|
|
42
74
|
}
|
|
43
75
|
|
|
44
76
|
export interface ImportConfig extends DbConfig, VerboseConfig {
|
|
77
|
+
/**
|
|
78
|
+
* An array of GTFS files to be imported.
|
|
79
|
+
*/
|
|
80
|
+
agencies: Array<{
|
|
81
|
+
/**
|
|
82
|
+
* Exclude files - if you don't want all GTFS files to be imported,
|
|
83
|
+
* you can specify an array of files to exclude.
|
|
84
|
+
*/
|
|
85
|
+
exclude?: string[];
|
|
86
|
+
|
|
45
87
|
/**
|
|
46
|
-
*
|
|
88
|
+
* Specify custom headers for download URL.
|
|
47
89
|
*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Exclude files - if you don't want all GTFS files to be imported,
|
|
51
|
-
* you can specify an array of files to exclude.
|
|
52
|
-
*/
|
|
53
|
-
exclude?: string[];
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Specify custom headers for download URL.
|
|
57
|
-
*/
|
|
58
|
-
headers?: Record<string, string>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Specify a path to a zipped GTFS file or an unzipped GTFS directory.
|
|
62
|
-
* One of `url` or `path` must be provided.
|
|
63
|
-
*/
|
|
64
|
-
path?: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Specify a download URL. One of `url` or `path` must be provided.
|
|
68
|
-
*/
|
|
69
|
-
url?: string;
|
|
70
|
-
}>;
|
|
90
|
+
headers?: Record<string, string>;
|
|
71
91
|
|
|
72
92
|
/**
|
|
73
|
-
*
|
|
93
|
+
* Specify custom headers for download URL.
|
|
74
94
|
*/
|
|
75
|
-
|
|
95
|
+
realtimeHeaders?: Record<string, string>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Specify a path to a zipped GTFS file or an unzipped GTFS directory.
|
|
99
|
+
* One of `url` or `path` must be provided.
|
|
100
|
+
*/
|
|
101
|
+
path?: string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Specify a download URL. One of `url` or `path` must be provided.
|
|
105
|
+
*/
|
|
106
|
+
url?: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Specify an array of download URLs for GTFS-Realtime data
|
|
110
|
+
*/
|
|
111
|
+
realtimeUrls?: string[];
|
|
112
|
+
}>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Options passed to csv-parse for parsing GTFS CSV files.
|
|
116
|
+
*/
|
|
117
|
+
csvOptions?: CsvParse.Options;
|
|
76
118
|
}
|
|
77
119
|
|
|
78
120
|
export interface QueryOptions {
|
|
79
|
-
|
|
121
|
+
db?: SqlDatabase;
|
|
80
122
|
}
|
|
81
123
|
|
|
82
124
|
/**
|
|
@@ -89,6 +131,11 @@ export function exportGtfs(config: ExportConfig): Promise<void>;
|
|
|
89
131
|
*/
|
|
90
132
|
export function importGtfs(config: ImportConfig): Promise<void>;
|
|
91
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Use updateGtfsRealtime() in your code to run an update of a GTFS-Realtime data specified in a config.json file.
|
|
136
|
+
*/
|
|
137
|
+
export function updateGtfsRealtime(config: ImportConfig): Promise<void>;
|
|
138
|
+
|
|
92
139
|
/**
|
|
93
140
|
* Open database before making any queries.
|
|
94
141
|
*/
|
|
@@ -107,163 +154,378 @@ export function getDb(config?: DbConfig): Promise<SqlDatabase>;
|
|
|
107
154
|
/**
|
|
108
155
|
* Queries agencies and returns a promise for an array of agencies.
|
|
109
156
|
*/
|
|
110
|
-
export function getAgencies(
|
|
157
|
+
export function getAgencies(
|
|
158
|
+
query?: SqlWhere,
|
|
159
|
+
fields?: SqlSelect,
|
|
160
|
+
sortBy?: SqlOrderBy,
|
|
161
|
+
options?: QueryOptions
|
|
162
|
+
): Promise<SqlResults>;
|
|
111
163
|
|
|
112
164
|
/**
|
|
113
165
|
* Queries attributions and returns a promise for an array of attributions.
|
|
114
166
|
*/
|
|
115
|
-
export function getAttributions(
|
|
167
|
+
export function getAttributions(
|
|
168
|
+
query?: SqlWhere,
|
|
169
|
+
fields?: SqlSelect,
|
|
170
|
+
sortBy?: SqlOrderBy,
|
|
171
|
+
options?: QueryOptions
|
|
172
|
+
): Promise<SqlResults>;
|
|
116
173
|
|
|
117
174
|
/**
|
|
118
175
|
* Queries routes and returns a promise for an array of routes.
|
|
119
176
|
*/
|
|
120
|
-
export function getRoutes(
|
|
177
|
+
export function getRoutes(
|
|
178
|
+
query?: SqlWhere,
|
|
179
|
+
fields?: SqlSelect,
|
|
180
|
+
sortBy?: SqlOrderBy,
|
|
181
|
+
options?: QueryOptions
|
|
182
|
+
): Promise<SqlResults>;
|
|
121
183
|
|
|
122
184
|
/**
|
|
123
185
|
* Queries stops and returns a promise for an array of stops.
|
|
124
186
|
*/
|
|
125
|
-
export function getStops(
|
|
187
|
+
export function getStops(
|
|
188
|
+
query?: SqlWhere,
|
|
189
|
+
fields?: SqlSelect,
|
|
190
|
+
sortBy?: SqlOrderBy,
|
|
191
|
+
options?: QueryOptions
|
|
192
|
+
): Promise<SqlResults>;
|
|
126
193
|
|
|
127
194
|
/**
|
|
128
195
|
* Queries stops and returns a promise for an geoJSON object of stops.
|
|
129
196
|
* All valid queries for `getStops()` work for `getStopsAsGeoJSON()`.
|
|
130
197
|
*/
|
|
131
|
-
export function getStopsAsGeoJSON(
|
|
198
|
+
export function getStopsAsGeoJSON(
|
|
199
|
+
query?: SqlWhere,
|
|
200
|
+
options?: QueryOptions
|
|
201
|
+
): Promise<FeatureCollection<Geometry, { [name: string]: any }>>;
|
|
132
202
|
|
|
133
203
|
/**
|
|
134
204
|
* Queries `stop_times` and returns a promise for an array of stop_times.
|
|
135
205
|
*/
|
|
136
|
-
export function getStoptimes(
|
|
206
|
+
export function getStoptimes(
|
|
207
|
+
query?: SqlWhere,
|
|
208
|
+
fields?: SqlSelect,
|
|
209
|
+
sortBy?: SqlOrderBy,
|
|
210
|
+
options?: QueryOptions
|
|
211
|
+
): Promise<SqlResults>;
|
|
137
212
|
|
|
138
213
|
/**
|
|
139
214
|
* Queries trips and returns a promise for an array of trips.
|
|
140
215
|
*/
|
|
141
|
-
export function getTrips(
|
|
216
|
+
export function getTrips(
|
|
217
|
+
query?: SqlWhere,
|
|
218
|
+
fields?: SqlSelect,
|
|
219
|
+
sortBy?: SqlOrderBy,
|
|
220
|
+
options?: QueryOptions
|
|
221
|
+
): Promise<SqlResults>;
|
|
142
222
|
|
|
143
223
|
/**
|
|
144
224
|
* Queries shapes and returns a promise for an array of shapes.
|
|
145
225
|
*/
|
|
146
|
-
export function getShapes(
|
|
226
|
+
export function getShapes(
|
|
227
|
+
query?: SqlWhere,
|
|
228
|
+
fields?: SqlSelect,
|
|
229
|
+
sortBy?: SqlOrderBy,
|
|
230
|
+
options?: QueryOptions
|
|
231
|
+
): Promise<SqlResults>;
|
|
147
232
|
|
|
148
233
|
/**
|
|
149
234
|
* Queries shapes and returns a promise for an geoJSON object of shapes.
|
|
150
235
|
* All valid queries for `getShapes()` work for `getShapesAsGeoJSON()`.
|
|
151
236
|
*/
|
|
152
|
-
export function getShapesAsGeoJSON(
|
|
237
|
+
export function getShapesAsGeoJSON(
|
|
238
|
+
query?: SqlWhere,
|
|
239
|
+
options?: QueryOptions
|
|
240
|
+
): Promise<FeatureCollection<Geometry, { [name: string]: any }>>;
|
|
153
241
|
|
|
154
242
|
/**
|
|
155
243
|
* Queries calendars and returns a promise for an array of calendars.
|
|
156
244
|
*/
|
|
157
|
-
export function getCalendars(
|
|
245
|
+
export function getCalendars(
|
|
246
|
+
query?: SqlWhere,
|
|
247
|
+
fields?: SqlSelect,
|
|
248
|
+
sortBy?: SqlOrderBy,
|
|
249
|
+
options?: QueryOptions
|
|
250
|
+
): Promise<SqlResults>;
|
|
158
251
|
|
|
159
252
|
/**
|
|
160
253
|
* Queries calendar_dates and returns a promise for an array of calendar_dates.
|
|
161
254
|
*/
|
|
162
|
-
export function getCalendarDates(
|
|
255
|
+
export function getCalendarDates(
|
|
256
|
+
query?: SqlWhere,
|
|
257
|
+
fields?: SqlSelect,
|
|
258
|
+
sortBy?: SqlOrderBy,
|
|
259
|
+
options?: QueryOptions
|
|
260
|
+
): Promise<SqlResults>;
|
|
163
261
|
|
|
164
262
|
/**
|
|
165
263
|
* Queries fare_attributes and returns a promise for an array of fare_attributes.
|
|
166
264
|
*/
|
|
167
|
-
export function getFareAttributes(
|
|
265
|
+
export function getFareAttributes(
|
|
266
|
+
query?: SqlWhere,
|
|
267
|
+
fields?: SqlSelect,
|
|
268
|
+
sortBy?: SqlOrderBy,
|
|
269
|
+
options?: QueryOptions
|
|
270
|
+
): Promise<SqlResults>;
|
|
168
271
|
|
|
169
272
|
/**
|
|
170
273
|
* Queries fare_rules and returns a promise for an array of fare_rules.
|
|
171
274
|
*/
|
|
172
|
-
export function getFareRules(
|
|
275
|
+
export function getFareRules(
|
|
276
|
+
query?: SqlWhere,
|
|
277
|
+
fields?: SqlSelect,
|
|
278
|
+
sortBy?: SqlOrderBy,
|
|
279
|
+
options?: QueryOptions
|
|
280
|
+
): Promise<SqlResults>;
|
|
173
281
|
|
|
174
282
|
/**
|
|
175
283
|
* Queries feed_info and returns a promise for an array of feed_infos.
|
|
176
284
|
*/
|
|
177
|
-
export function getFeedInfo(
|
|
285
|
+
export function getFeedInfo(
|
|
286
|
+
query?: SqlWhere,
|
|
287
|
+
fields?: SqlSelect,
|
|
288
|
+
sortBy?: SqlOrderBy,
|
|
289
|
+
options?: QueryOptions
|
|
290
|
+
): Promise<SqlResults>;
|
|
178
291
|
|
|
179
292
|
/**
|
|
180
293
|
* Queries frequencies and returns a promise for an array of frequencies.
|
|
181
294
|
*/
|
|
182
|
-
export function getFrequencies(
|
|
295
|
+
export function getFrequencies(
|
|
296
|
+
query?: SqlWhere,
|
|
297
|
+
fields?: SqlSelect,
|
|
298
|
+
sortBy?: SqlOrderBy,
|
|
299
|
+
options?: QueryOptions
|
|
300
|
+
): Promise<SqlResults>;
|
|
183
301
|
|
|
184
302
|
/**
|
|
185
303
|
* Queries levels and returns a promise for an array of levels.
|
|
186
304
|
*/
|
|
187
|
-
export function getLevels(
|
|
305
|
+
export function getLevels(
|
|
306
|
+
query?: SqlWhere,
|
|
307
|
+
fields?: SqlSelect,
|
|
308
|
+
sortBy?: SqlOrderBy,
|
|
309
|
+
options?: QueryOptions
|
|
310
|
+
): Promise<SqlResults>;
|
|
188
311
|
|
|
189
312
|
/**
|
|
190
313
|
* Queries pathways and returns a promise for an array of pathways.
|
|
191
314
|
*/
|
|
192
|
-
export function getPathways(
|
|
315
|
+
export function getPathways(
|
|
316
|
+
query?: SqlWhere,
|
|
317
|
+
fields?: SqlSelect,
|
|
318
|
+
sortBy?: SqlOrderBy,
|
|
319
|
+
options?: QueryOptions
|
|
320
|
+
): Promise<SqlResults>;
|
|
193
321
|
|
|
194
322
|
/**
|
|
195
323
|
* Queries transfers and returns a promise for an array of transfers.
|
|
196
324
|
*/
|
|
197
|
-
export function getTransfers(
|
|
325
|
+
export function getTransfers(
|
|
326
|
+
query?: SqlWhere,
|
|
327
|
+
fields?: SqlSelect,
|
|
328
|
+
sortBy?: SqlOrderBy,
|
|
329
|
+
options?: QueryOptions
|
|
330
|
+
): Promise<SqlResults>;
|
|
198
331
|
|
|
199
332
|
/**
|
|
200
333
|
* Queries translations and returns a promise for an array of translations.
|
|
201
334
|
*/
|
|
202
|
-
export function getTranslations(
|
|
335
|
+
export function getTranslations(
|
|
336
|
+
query?: SqlWhere,
|
|
337
|
+
fields?: SqlSelect,
|
|
338
|
+
sortBy?: SqlOrderBy,
|
|
339
|
+
options?: QueryOptions
|
|
340
|
+
): Promise<SqlResults>;
|
|
203
341
|
|
|
204
342
|
/**
|
|
205
343
|
* Queries directions and returns a promise for an array of directions.
|
|
206
344
|
* These are from the non-standard `directions.txt` file.
|
|
207
345
|
*/
|
|
208
|
-
export function getDirections(
|
|
346
|
+
export function getDirections(
|
|
347
|
+
query?: SqlWhere,
|
|
348
|
+
fields?: SqlSelect,
|
|
349
|
+
sortBy?: SqlOrderBy,
|
|
350
|
+
options?: QueryOptions
|
|
351
|
+
): Promise<SqlResults>;
|
|
209
352
|
|
|
210
353
|
/**
|
|
211
354
|
* Queries stop_attributes and returns a promise for an array of stop_attributes.
|
|
212
355
|
* These are from the non-standard `stop_attributes.txt` file.
|
|
213
356
|
*/
|
|
214
|
-
export function getStopAttributes(
|
|
357
|
+
export function getStopAttributes(
|
|
358
|
+
query?: SqlWhere,
|
|
359
|
+
fields?: SqlSelect,
|
|
360
|
+
sortBy?: SqlOrderBy,
|
|
361
|
+
options?: QueryOptions
|
|
362
|
+
): Promise<SqlResults>;
|
|
215
363
|
|
|
216
364
|
/**
|
|
217
365
|
* Queries timetables and returns a promise for an array of timetables.
|
|
218
366
|
* These are from the non-standard `timetables.txt` file.
|
|
219
367
|
*/
|
|
220
|
-
export function getTimetables(
|
|
368
|
+
export function getTimetables(
|
|
369
|
+
query?: SqlWhere,
|
|
370
|
+
fields?: SqlSelect,
|
|
371
|
+
sortBy?: SqlOrderBy,
|
|
372
|
+
options?: QueryOptions
|
|
373
|
+
): Promise<SqlResults>;
|
|
221
374
|
|
|
222
375
|
/**
|
|
223
376
|
* Queries timetable_stop_orders and returns a promise for an array of timetable_stop_orders.
|
|
224
377
|
* These are from the non-standard `timetable_stop_order.txt` file.
|
|
225
378
|
*/
|
|
226
|
-
export function getTimetableStopOrders(
|
|
379
|
+
export function getTimetableStopOrders(
|
|
380
|
+
query?: SqlWhere,
|
|
381
|
+
fields?: SqlSelect,
|
|
382
|
+
sortBy?: SqlOrderBy,
|
|
383
|
+
options?: QueryOptions
|
|
384
|
+
): Promise<SqlResults>;
|
|
227
385
|
|
|
228
386
|
/**
|
|
229
387
|
* Queries timetable_pages and returns a promise for an array of timetable_pages.
|
|
230
388
|
* These are from the non-standard `timetable_pages.txt` file.
|
|
231
389
|
*/
|
|
232
|
-
export function getTimetablePages(
|
|
390
|
+
export function getTimetablePages(
|
|
391
|
+
query?: SqlWhere,
|
|
392
|
+
fields?: SqlSelect,
|
|
393
|
+
sortBy?: SqlOrderBy,
|
|
394
|
+
options?: QueryOptions
|
|
395
|
+
): Promise<SqlResults>;
|
|
233
396
|
|
|
234
397
|
/**
|
|
235
398
|
* Queries timetable_notes and returns a promise for an array of timetable_notes.
|
|
236
399
|
* These are from the non-standard `timetable_notes.txt` file.
|
|
237
400
|
*/
|
|
238
|
-
export function getTimetableNotes(
|
|
401
|
+
export function getTimetableNotes(
|
|
402
|
+
query?: SqlWhere,
|
|
403
|
+
fields?: SqlSelect,
|
|
404
|
+
sortBy?: SqlOrderBy,
|
|
405
|
+
options?: QueryOptions
|
|
406
|
+
): Promise<SqlResults>;
|
|
239
407
|
|
|
240
408
|
/**
|
|
241
409
|
* Queries timetable_notes_references and returns a promise for an array of timetable_notes references.
|
|
242
410
|
* These are from the non-standard `timetable_notes_references.txt` file.
|
|
243
411
|
*/
|
|
244
|
-
export function getTimetableNotesReferences(
|
|
412
|
+
export function getTimetableNotesReferences(
|
|
413
|
+
query?: SqlWhere,
|
|
414
|
+
fields?: SqlSelect,
|
|
415
|
+
sortBy?: SqlOrderBy,
|
|
416
|
+
options?: QueryOptions
|
|
417
|
+
): Promise<SqlResults>;
|
|
245
418
|
|
|
246
419
|
/**
|
|
247
420
|
* Queries board-alights and returns a promise for an array of board-alights.
|
|
248
421
|
*/
|
|
249
|
-
export function getBoardAlights(
|
|
422
|
+
export function getBoardAlights(
|
|
423
|
+
query?: SqlWhere,
|
|
424
|
+
fields?: SqlSelect,
|
|
425
|
+
sortBy?: SqlOrderBy,
|
|
426
|
+
options?: QueryOptions
|
|
427
|
+
): Promise<SqlResults>;
|
|
250
428
|
|
|
251
429
|
/**
|
|
252
430
|
* Queries ride-feed-info and returns a promise for an array of ride-feed-info.
|
|
253
431
|
*/
|
|
254
|
-
export function getRideFeedInfos(
|
|
432
|
+
export function getRideFeedInfos(
|
|
433
|
+
query?: SqlWhere,
|
|
434
|
+
fields?: SqlSelect,
|
|
435
|
+
sortBy?: SqlOrderBy,
|
|
436
|
+
options?: QueryOptions
|
|
437
|
+
): Promise<SqlResults>;
|
|
255
438
|
|
|
256
439
|
/**
|
|
257
440
|
* Queries rider trips and returns a promise for an array of rider trips.
|
|
258
441
|
*/
|
|
259
|
-
export function getRiderTrips(
|
|
442
|
+
export function getRiderTrips(
|
|
443
|
+
query?: SqlWhere,
|
|
444
|
+
fields?: SqlSelect,
|
|
445
|
+
sortBy?: SqlOrderBy,
|
|
446
|
+
options?: QueryOptions
|
|
447
|
+
): Promise<SqlResults>;
|
|
260
448
|
|
|
261
449
|
/**
|
|
262
450
|
* Queries riderships and returns a promise for an array of riderships.
|
|
263
451
|
*/
|
|
264
|
-
export function getRiderships(
|
|
452
|
+
export function getRiderships(
|
|
453
|
+
query?: SqlWhere,
|
|
454
|
+
fields?: SqlSelect,
|
|
455
|
+
sortBy?: SqlOrderBy,
|
|
456
|
+
options?: QueryOptions
|
|
457
|
+
): Promise<SqlResults>;
|
|
265
458
|
|
|
266
459
|
/**
|
|
267
460
|
* Queries trip-capacities and returns a promise for an array of trip-capacities.
|
|
268
461
|
*/
|
|
269
|
-
export function getTripCapacities(
|
|
462
|
+
export function getTripCapacities(
|
|
463
|
+
query?: SqlWhere,
|
|
464
|
+
fields?: SqlSelect,
|
|
465
|
+
sortBy?: SqlOrderBy,
|
|
466
|
+
options?: QueryOptions
|
|
467
|
+
): Promise<SqlResults>;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Queries trip-capacities and returns a promise for an array of service-alerts.
|
|
471
|
+
*/
|
|
472
|
+
export function getServiceAlerts(
|
|
473
|
+
query?: SqlWhere,
|
|
474
|
+
fields?: SqlSelect,
|
|
475
|
+
sortBy?: SqlOrderBy,
|
|
476
|
+
options?: QueryOptions
|
|
477
|
+
): Promise<SqlResults>;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Queries trip-capacities and returns a promise for an array of trip-updates.
|
|
481
|
+
*/
|
|
482
|
+
export function getTripUpdates(
|
|
483
|
+
query?: SqlWhere,
|
|
484
|
+
fields?: SqlSelect,
|
|
485
|
+
sortBy?: SqlOrderBy,
|
|
486
|
+
options?: QueryOptions
|
|
487
|
+
): Promise<SqlResults>;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Queries trip-capacities and returns a promise for an array of vehicle-positions.
|
|
491
|
+
*/
|
|
492
|
+
export function getVehiclePositions(
|
|
493
|
+
query?: SqlWhere,
|
|
494
|
+
fields?: SqlSelect,
|
|
495
|
+
sortBy?: SqlOrderBy,
|
|
496
|
+
options?: QueryOptions
|
|
497
|
+
): Promise<SqlResults>;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Queries trip-capacities and returns a promise for an array of stop-times-updates.
|
|
501
|
+
*/
|
|
502
|
+
export function getStopTimesUpdates(
|
|
503
|
+
query?: SqlWhere,
|
|
504
|
+
fields?: SqlSelect,
|
|
505
|
+
sortBy?: SqlOrderBy,
|
|
506
|
+
options?: QueryOptions
|
|
507
|
+
): Promise<SqlResults>;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Runs an advanced query.
|
|
511
|
+
*/
|
|
512
|
+
export function advancedQuery(
|
|
513
|
+
table?: SqlTableName,
|
|
514
|
+
advancedQueryOptions?: AdvancedQueryOptions
|
|
515
|
+
): Promise<SqlResults>;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Runs an raw query retuning all rows.
|
|
519
|
+
*/
|
|
520
|
+
export function runRawQuery(
|
|
521
|
+
sql?: SqlQueryString,
|
|
522
|
+
options?: QueryOptions
|
|
523
|
+
): Promise<SqlResults>;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Executing an raw query.
|
|
527
|
+
*/
|
|
528
|
+
export function execRawQuery(
|
|
529
|
+
sql?: SqlQueryString,
|
|
530
|
+
options?: QueryOptions
|
|
531
|
+
): Promise<any>;
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.5.0] - 2022-07-10
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Use yoctocolors instead of chalk
|
|
13
|
+
- Dependency updates
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Support untildify in sqlitePath config variable
|
|
18
|
+
|
|
19
|
+
## [3.4.0] - 2022-06-12
|
|
20
|
+
|
|
21
|
+
### Updated
|
|
22
|
+
|
|
23
|
+
- Dependency updates
|
|
24
|
+
- Documentation updates
|
|
25
|
+
- Added default:, and source: keywords in the models to describe a default value and a source to transform from for GTFS-Realtime
|
|
26
|
+
- Filtering all models belonging to GTFS-Realtime from import (but not export) in GTFS
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Added trips-dates-vehicle-journey.txt model
|
|
31
|
+
- GTFS-Realtime Support for VehiclePositions, TripUpdates and ServiceAlerts
|
|
32
|
+
- gtfsrealtime-update script - does selective refresh of only GTFS-Realtime data without deleting the database
|
|
33
|
+
- updateGtfsRealtime() method - does selective refresh of only GTFS-Realtime data without deleting the database
|
|
34
|
+
- getServiceAlerts(..), getStopTimesUpdates(..), getTripUpdates(..), and getVehicleLocations(..) added methods
|
|
35
|
+
- advancedQuery, runRawQuery and execRawQuery methods to perform direct database queries
|
|
36
|
+
|
|
37
|
+
## [3.3.1] - 2022-04-29
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- Add support for querying by shape_id
|
|
42
|
+
|
|
8
43
|
## [3.3.0] - 2022-04-26
|
|
9
44
|
|
|
10
45
|
### Changed
|