gtfs 3.7.0 → 4.0.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/.github/workflows/nodejs.yml +13 -13
- package/@types/index.d.ts +35 -60
- package/@types/tests.ts +18 -13
- package/CHANGELOG.md +21 -0
- package/README.md +228 -208
- package/lib/advancedQuery.js +8 -17
- package/lib/db.js +29 -59
- package/lib/export.js +16 -10
- package/lib/gtfs/agencies.js +8 -6
- package/lib/gtfs/areas.js +8 -11
- package/lib/gtfs/attributions.js +8 -6
- package/lib/gtfs/calendar-dates.js +8 -6
- package/lib/gtfs/calendars.js +8 -6
- package/lib/gtfs/fare-attributes.js +8 -6
- package/lib/gtfs/fare-leg-rules.js +8 -6
- package/lib/gtfs/fare-products.js +8 -6
- package/lib/gtfs/fare-rules.js +8 -6
- package/lib/gtfs/fare-transfer-rules.js +8 -6
- package/lib/gtfs/feed-info.js +8 -6
- package/lib/gtfs/frequencies.js +8 -6
- package/lib/gtfs/levels.js +8 -11
- package/lib/gtfs/pathways.js +8 -6
- package/lib/gtfs/routes.js +8 -11
- package/lib/gtfs/shapes.js +34 -39
- package/lib/gtfs/stop-areas.js +8 -6
- package/lib/gtfs/stop-times.js +8 -6
- package/lib/gtfs/stops.js +27 -33
- package/lib/gtfs/transfers.js +8 -6
- package/lib/gtfs/translations.js +8 -6
- package/lib/gtfs/trips.js +8 -11
- package/lib/gtfs-realtime/service-alerts.js +9 -7
- package/lib/gtfs-realtime/stop-times-updates.js +9 -7
- package/lib/gtfs-realtime/trip-updates.js +9 -7
- package/lib/gtfs-realtime/vehicle-positions.js +9 -7
- package/lib/gtfs-ride/board-alights.js +8 -6
- package/lib/gtfs-ride/ride-feed-infos.js +8 -6
- package/lib/gtfs-ride/rider-trips.js +8 -6
- package/lib/gtfs-ride/riderships.js +8 -6
- package/lib/gtfs-ride/trip-capacities.js +8 -6
- package/lib/gtfs.js +3 -9
- package/lib/import.js +195 -202
- package/lib/non-standard/directions.js +8 -6
- package/lib/non-standard/stop-attributes.js +8 -6
- package/lib/non-standard/timetable-notes-references.js +8 -6
- package/lib/non-standard/timetable-notes.js +8 -6
- package/lib/non-standard/timetable-pages.js +8 -6
- package/lib/non-standard/timetable-stop-order.js +8 -6
- package/lib/non-standard/timetables.js +8 -6
- package/lib/non-standard/trips-dated-vehicle-journey.js +9 -7
- package/models/gtfs/transfers.js +2 -1
- package/package.json +9 -9
- package/test/mocha/advanced-query.js +9 -15
- package/test/mocha/export-gtfs.js +5 -6
- package/test/mocha/fare-transfer-rules.js +32 -0
- package/test/mocha/get-agencies.js +13 -19
- package/test/mocha/get-areas.js +27 -0
- package/test/mocha/get-attributions.js +7 -13
- package/test/mocha/get-board-alights.js +7 -13
- package/test/mocha/get-calendar-dates.js +11 -17
- package/test/mocha/get-calendars.js +11 -17
- package/test/mocha/get-directions.js +7 -13
- package/test/mocha/get-fare-attributes.js +9 -15
- package/test/mocha/get-fare-leg-rules.js +27 -0
- package/test/mocha/get-fare-products.js +27 -0
- package/test/mocha/get-fare-rules.js +9 -15
- package/test/mocha/get-feed-info.js +7 -13
- package/test/mocha/get-frequencies.js +7 -13
- package/test/mocha/get-levels.js +7 -7
- package/test/mocha/get-pathways.js +7 -13
- package/test/mocha/get-ride-feed-infos.js +7 -13
- package/test/mocha/get-rider-trips.js +7 -13
- package/test/mocha/get-riderships.js +7 -13
- package/test/mocha/get-routes.js +13 -13
- package/test/mocha/get-shapes-as-geojson.js +14 -15
- package/test/mocha/get-shapes.js +25 -25
- package/test/mocha/get-stop-attributes.js +7 -13
- package/test/mocha/get-stops-as-geojson.js +13 -19
- package/test/mocha/get-stops.js +19 -19
- package/test/mocha/get-stoptimes.js +11 -17
- package/test/mocha/get-timetable-pages.js +7 -13
- package/test/mocha/get-timetable-stop-orders.js +6 -7
- package/test/mocha/get-timetables.js +7 -13
- package/test/mocha/get-transfers.js +7 -13
- package/test/mocha/get-translations.js +7 -13
- package/test/mocha/get-trip-capacities.js +7 -13
- package/test/mocha/get-trips.js +9 -9
- package/test/mocha/import-gtfs.js +11 -11
- package/test/mocha/{get-db.js → open-db.js} +37 -29
- package/test/mocha/raw-query.js +34 -0
- package/test/mocha/exec-raw-query.js +0 -39
- package/test/mocha/run-raw-query.js +0 -54
|
@@ -4,22 +4,22 @@ on: [push, pull_request]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
|
-
|
|
8
7
|
runs-on: ubuntu-latest
|
|
9
8
|
|
|
10
9
|
strategy:
|
|
11
10
|
matrix:
|
|
12
|
-
node-version: [14.x, 16.x]
|
|
11
|
+
node-version: [14.x, 16.x, 18.x]
|
|
13
12
|
|
|
14
13
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
- uses: actions/checkout@v1
|
|
15
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
16
|
+
uses: actions/setup-node@v1
|
|
17
|
+
with:
|
|
18
|
+
node-version: ${{ matrix.node-version }}
|
|
19
|
+
- name: npm install and test
|
|
20
|
+
run: |
|
|
21
|
+
npm install -g npm@9
|
|
22
|
+
npm ci
|
|
23
|
+
npm test
|
|
24
|
+
env:
|
|
25
|
+
CI: true
|
package/@types/index.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import CsvParse = require('csv-parse');
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { FeatureCollection, Geometry } from '@turf/helpers';
|
|
4
4
|
|
|
5
5
|
export {}; // disable implicit exporting of types
|
|
6
6
|
|
|
7
|
-
type Unpromise<T> = T extends Promise<infer U> ? U : T;
|
|
8
|
-
|
|
9
|
-
export type SqlDatabase = Unpromise<ReturnType<typeof Sqlite3.open>>;
|
|
10
|
-
|
|
11
7
|
export type SqlValue =
|
|
12
8
|
| undefined
|
|
13
9
|
| null
|
|
@@ -146,11 +142,6 @@ export function openDb(config: DbConfig): Promise<SqlDatabase>;
|
|
|
146
142
|
*/
|
|
147
143
|
export function closeDb(db?: SqlDatabase): Promise<void>;
|
|
148
144
|
|
|
149
|
-
/**
|
|
150
|
-
* Get open database. Throws error if no database is open.
|
|
151
|
-
*/
|
|
152
|
-
export function getDb(config?: DbConfig): Promise<SqlDatabase>;
|
|
153
|
-
|
|
154
145
|
/**
|
|
155
146
|
* Queries agencies and returns a promise for an array of agencies.
|
|
156
147
|
*/
|
|
@@ -159,7 +150,7 @@ export function getAgencies(
|
|
|
159
150
|
fields?: SqlSelect,
|
|
160
151
|
sortBy?: SqlOrderBy,
|
|
161
152
|
options?: QueryOptions
|
|
162
|
-
):
|
|
153
|
+
): SqlResults;
|
|
163
154
|
|
|
164
155
|
/**
|
|
165
156
|
* Queries attributions and returns a promise for an array of attributions.
|
|
@@ -169,7 +160,7 @@ export function getAttributions(
|
|
|
169
160
|
fields?: SqlSelect,
|
|
170
161
|
sortBy?: SqlOrderBy,
|
|
171
162
|
options?: QueryOptions
|
|
172
|
-
):
|
|
163
|
+
): SqlResults;
|
|
173
164
|
|
|
174
165
|
/**
|
|
175
166
|
* Queries routes and returns a promise for an array of routes.
|
|
@@ -179,7 +170,7 @@ export function getRoutes(
|
|
|
179
170
|
fields?: SqlSelect,
|
|
180
171
|
sortBy?: SqlOrderBy,
|
|
181
172
|
options?: QueryOptions
|
|
182
|
-
):
|
|
173
|
+
): SqlResults;
|
|
183
174
|
|
|
184
175
|
/**
|
|
185
176
|
* Queries stops and returns a promise for an array of stops.
|
|
@@ -189,7 +180,7 @@ export function getStops(
|
|
|
189
180
|
fields?: SqlSelect,
|
|
190
181
|
sortBy?: SqlOrderBy,
|
|
191
182
|
options?: QueryOptions
|
|
192
|
-
):
|
|
183
|
+
): SqlResults;
|
|
193
184
|
|
|
194
185
|
/**
|
|
195
186
|
* Queries stops and returns a promise for an geoJSON object of stops.
|
|
@@ -208,7 +199,7 @@ export function getStoptimes(
|
|
|
208
199
|
fields?: SqlSelect,
|
|
209
200
|
sortBy?: SqlOrderBy,
|
|
210
201
|
options?: QueryOptions
|
|
211
|
-
):
|
|
202
|
+
): SqlResults;
|
|
212
203
|
|
|
213
204
|
/**
|
|
214
205
|
* Queries trips and returns a promise for an array of trips.
|
|
@@ -218,7 +209,7 @@ export function getTrips(
|
|
|
218
209
|
fields?: SqlSelect,
|
|
219
210
|
sortBy?: SqlOrderBy,
|
|
220
211
|
options?: QueryOptions
|
|
221
|
-
):
|
|
212
|
+
): SqlResults;
|
|
222
213
|
|
|
223
214
|
/**
|
|
224
215
|
* Queries shapes and returns a promise for an array of shapes.
|
|
@@ -228,7 +219,7 @@ export function getShapes(
|
|
|
228
219
|
fields?: SqlSelect,
|
|
229
220
|
sortBy?: SqlOrderBy,
|
|
230
221
|
options?: QueryOptions
|
|
231
|
-
):
|
|
222
|
+
): SqlResults;
|
|
232
223
|
|
|
233
224
|
/**
|
|
234
225
|
* Queries shapes and returns a promise for an geoJSON object of shapes.
|
|
@@ -247,7 +238,7 @@ export function getCalendars(
|
|
|
247
238
|
fields?: SqlSelect,
|
|
248
239
|
sortBy?: SqlOrderBy,
|
|
249
240
|
options?: QueryOptions
|
|
250
|
-
):
|
|
241
|
+
): SqlResults;
|
|
251
242
|
|
|
252
243
|
/**
|
|
253
244
|
* Queries calendar_dates and returns a promise for an array of calendar_dates.
|
|
@@ -257,7 +248,7 @@ export function getCalendarDates(
|
|
|
257
248
|
fields?: SqlSelect,
|
|
258
249
|
sortBy?: SqlOrderBy,
|
|
259
250
|
options?: QueryOptions
|
|
260
|
-
):
|
|
251
|
+
): SqlResults;
|
|
261
252
|
|
|
262
253
|
/**
|
|
263
254
|
* Queries fare_attributes and returns a promise for an array of fare_attributes.
|
|
@@ -267,7 +258,7 @@ export function getFareAttributes(
|
|
|
267
258
|
fields?: SqlSelect,
|
|
268
259
|
sortBy?: SqlOrderBy,
|
|
269
260
|
options?: QueryOptions
|
|
270
|
-
):
|
|
261
|
+
): SqlResults;
|
|
271
262
|
|
|
272
263
|
/**
|
|
273
264
|
* Queries fare_rules and returns a promise for an array of fare_rules.
|
|
@@ -277,7 +268,7 @@ export function getFareRules(
|
|
|
277
268
|
fields?: SqlSelect,
|
|
278
269
|
sortBy?: SqlOrderBy,
|
|
279
270
|
options?: QueryOptions
|
|
280
|
-
):
|
|
271
|
+
): SqlResults;
|
|
281
272
|
|
|
282
273
|
/**
|
|
283
274
|
* Queries feed_info and returns a promise for an array of feed_infos.
|
|
@@ -287,7 +278,7 @@ export function getFeedInfo(
|
|
|
287
278
|
fields?: SqlSelect,
|
|
288
279
|
sortBy?: SqlOrderBy,
|
|
289
280
|
options?: QueryOptions
|
|
290
|
-
):
|
|
281
|
+
): SqlResults;
|
|
291
282
|
|
|
292
283
|
/**
|
|
293
284
|
* Queries frequencies and returns a promise for an array of frequencies.
|
|
@@ -297,7 +288,7 @@ export function getFrequencies(
|
|
|
297
288
|
fields?: SqlSelect,
|
|
298
289
|
sortBy?: SqlOrderBy,
|
|
299
290
|
options?: QueryOptions
|
|
300
|
-
):
|
|
291
|
+
): SqlResults;
|
|
301
292
|
|
|
302
293
|
/**
|
|
303
294
|
* Queries levels and returns a promise for an array of levels.
|
|
@@ -307,7 +298,7 @@ export function getLevels(
|
|
|
307
298
|
fields?: SqlSelect,
|
|
308
299
|
sortBy?: SqlOrderBy,
|
|
309
300
|
options?: QueryOptions
|
|
310
|
-
):
|
|
301
|
+
): SqlResults;
|
|
311
302
|
|
|
312
303
|
/**
|
|
313
304
|
* Queries pathways and returns a promise for an array of pathways.
|
|
@@ -317,7 +308,7 @@ export function getPathways(
|
|
|
317
308
|
fields?: SqlSelect,
|
|
318
309
|
sortBy?: SqlOrderBy,
|
|
319
310
|
options?: QueryOptions
|
|
320
|
-
):
|
|
311
|
+
): SqlResults;
|
|
321
312
|
|
|
322
313
|
/**
|
|
323
314
|
* Queries transfers and returns a promise for an array of transfers.
|
|
@@ -327,7 +318,7 @@ export function getTransfers(
|
|
|
327
318
|
fields?: SqlSelect,
|
|
328
319
|
sortBy?: SqlOrderBy,
|
|
329
320
|
options?: QueryOptions
|
|
330
|
-
):
|
|
321
|
+
): SqlResults;
|
|
331
322
|
|
|
332
323
|
/**
|
|
333
324
|
* Queries translations and returns a promise for an array of translations.
|
|
@@ -337,7 +328,7 @@ export function getTranslations(
|
|
|
337
328
|
fields?: SqlSelect,
|
|
338
329
|
sortBy?: SqlOrderBy,
|
|
339
330
|
options?: QueryOptions
|
|
340
|
-
):
|
|
331
|
+
): SqlResults;
|
|
341
332
|
|
|
342
333
|
/**
|
|
343
334
|
* Queries directions and returns a promise for an array of directions.
|
|
@@ -348,7 +339,7 @@ export function getDirections(
|
|
|
348
339
|
fields?: SqlSelect,
|
|
349
340
|
sortBy?: SqlOrderBy,
|
|
350
341
|
options?: QueryOptions
|
|
351
|
-
):
|
|
342
|
+
): SqlResults;
|
|
352
343
|
|
|
353
344
|
/**
|
|
354
345
|
* Queries stop_attributes and returns a promise for an array of stop_attributes.
|
|
@@ -359,7 +350,7 @@ export function getStopAttributes(
|
|
|
359
350
|
fields?: SqlSelect,
|
|
360
351
|
sortBy?: SqlOrderBy,
|
|
361
352
|
options?: QueryOptions
|
|
362
|
-
):
|
|
353
|
+
): SqlResults;
|
|
363
354
|
|
|
364
355
|
/**
|
|
365
356
|
* Queries timetables and returns a promise for an array of timetables.
|
|
@@ -370,7 +361,7 @@ export function getTimetables(
|
|
|
370
361
|
fields?: SqlSelect,
|
|
371
362
|
sortBy?: SqlOrderBy,
|
|
372
363
|
options?: QueryOptions
|
|
373
|
-
):
|
|
364
|
+
): SqlResults;
|
|
374
365
|
|
|
375
366
|
/**
|
|
376
367
|
* Queries timetable_stop_orders and returns a promise for an array of timetable_stop_orders.
|
|
@@ -381,7 +372,7 @@ export function getTimetableStopOrders(
|
|
|
381
372
|
fields?: SqlSelect,
|
|
382
373
|
sortBy?: SqlOrderBy,
|
|
383
374
|
options?: QueryOptions
|
|
384
|
-
):
|
|
375
|
+
): SqlResults;
|
|
385
376
|
|
|
386
377
|
/**
|
|
387
378
|
* Queries timetable_pages and returns a promise for an array of timetable_pages.
|
|
@@ -392,7 +383,7 @@ export function getTimetablePages(
|
|
|
392
383
|
fields?: SqlSelect,
|
|
393
384
|
sortBy?: SqlOrderBy,
|
|
394
385
|
options?: QueryOptions
|
|
395
|
-
):
|
|
386
|
+
): SqlResults;
|
|
396
387
|
|
|
397
388
|
/**
|
|
398
389
|
* Queries timetable_notes and returns a promise for an array of timetable_notes.
|
|
@@ -403,7 +394,7 @@ export function getTimetableNotes(
|
|
|
403
394
|
fields?: SqlSelect,
|
|
404
395
|
sortBy?: SqlOrderBy,
|
|
405
396
|
options?: QueryOptions
|
|
406
|
-
):
|
|
397
|
+
): SqlResults;
|
|
407
398
|
|
|
408
399
|
/**
|
|
409
400
|
* Queries timetable_notes_references and returns a promise for an array of timetable_notes references.
|
|
@@ -414,7 +405,7 @@ export function getTimetableNotesReferences(
|
|
|
414
405
|
fields?: SqlSelect,
|
|
415
406
|
sortBy?: SqlOrderBy,
|
|
416
407
|
options?: QueryOptions
|
|
417
|
-
):
|
|
408
|
+
): SqlResults;
|
|
418
409
|
|
|
419
410
|
/**
|
|
420
411
|
* Queries board-alights and returns a promise for an array of board-alights.
|
|
@@ -424,7 +415,7 @@ export function getBoardAlights(
|
|
|
424
415
|
fields?: SqlSelect,
|
|
425
416
|
sortBy?: SqlOrderBy,
|
|
426
417
|
options?: QueryOptions
|
|
427
|
-
):
|
|
418
|
+
): SqlResults;
|
|
428
419
|
|
|
429
420
|
/**
|
|
430
421
|
* Queries ride-feed-info and returns a promise for an array of ride-feed-info.
|
|
@@ -434,7 +425,7 @@ export function getRideFeedInfos(
|
|
|
434
425
|
fields?: SqlSelect,
|
|
435
426
|
sortBy?: SqlOrderBy,
|
|
436
427
|
options?: QueryOptions
|
|
437
|
-
):
|
|
428
|
+
): SqlResults;
|
|
438
429
|
|
|
439
430
|
/**
|
|
440
431
|
* Queries rider trips and returns a promise for an array of rider trips.
|
|
@@ -444,7 +435,7 @@ export function getRiderTrips(
|
|
|
444
435
|
fields?: SqlSelect,
|
|
445
436
|
sortBy?: SqlOrderBy,
|
|
446
437
|
options?: QueryOptions
|
|
447
|
-
):
|
|
438
|
+
): SqlResults;
|
|
448
439
|
|
|
449
440
|
/**
|
|
450
441
|
* Queries riderships and returns a promise for an array of riderships.
|
|
@@ -454,7 +445,7 @@ export function getRiderships(
|
|
|
454
445
|
fields?: SqlSelect,
|
|
455
446
|
sortBy?: SqlOrderBy,
|
|
456
447
|
options?: QueryOptions
|
|
457
|
-
):
|
|
448
|
+
): SqlResults;
|
|
458
449
|
|
|
459
450
|
/**
|
|
460
451
|
* Queries trip-capacities and returns a promise for an array of trip-capacities.
|
|
@@ -464,7 +455,7 @@ export function getTripCapacities(
|
|
|
464
455
|
fields?: SqlSelect,
|
|
465
456
|
sortBy?: SqlOrderBy,
|
|
466
457
|
options?: QueryOptions
|
|
467
|
-
):
|
|
458
|
+
): SqlResults;
|
|
468
459
|
|
|
469
460
|
/**
|
|
470
461
|
* Queries trip-capacities and returns a promise for an array of service-alerts.
|
|
@@ -474,7 +465,7 @@ export function getServiceAlerts(
|
|
|
474
465
|
fields?: SqlSelect,
|
|
475
466
|
sortBy?: SqlOrderBy,
|
|
476
467
|
options?: QueryOptions
|
|
477
|
-
):
|
|
468
|
+
): SqlResults;
|
|
478
469
|
|
|
479
470
|
/**
|
|
480
471
|
* Queries trip-capacities and returns a promise for an array of trip-updates.
|
|
@@ -484,7 +475,7 @@ export function getTripUpdates(
|
|
|
484
475
|
fields?: SqlSelect,
|
|
485
476
|
sortBy?: SqlOrderBy,
|
|
486
477
|
options?: QueryOptions
|
|
487
|
-
):
|
|
478
|
+
): SqlResults;
|
|
488
479
|
|
|
489
480
|
/**
|
|
490
481
|
* Queries trip-capacities and returns a promise for an array of vehicle-positions.
|
|
@@ -494,7 +485,7 @@ export function getVehiclePositions(
|
|
|
494
485
|
fields?: SqlSelect,
|
|
495
486
|
sortBy?: SqlOrderBy,
|
|
496
487
|
options?: QueryOptions
|
|
497
|
-
):
|
|
488
|
+
): SqlResults;
|
|
498
489
|
|
|
499
490
|
/**
|
|
500
491
|
* Queries trip-capacities and returns a promise for an array of stop-times-updates.
|
|
@@ -504,7 +495,7 @@ export function getStopTimesUpdates(
|
|
|
504
495
|
fields?: SqlSelect,
|
|
505
496
|
sortBy?: SqlOrderBy,
|
|
506
497
|
options?: QueryOptions
|
|
507
|
-
):
|
|
498
|
+
): SqlResults;
|
|
508
499
|
|
|
509
500
|
/**
|
|
510
501
|
* Runs an advanced query.
|
|
@@ -512,20 +503,4 @@ export function getStopTimesUpdates(
|
|
|
512
503
|
export function advancedQuery(
|
|
513
504
|
table?: SqlTableName,
|
|
514
505
|
advancedQueryOptions?: AdvancedQueryOptions
|
|
515
|
-
):
|
|
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>;
|
|
506
|
+
): SqlResults;
|
package/@types/tests.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Config,
|
|
3
|
+
exportGtfs,
|
|
4
|
+
getAgencies,
|
|
5
|
+
getShapesAsGeoJSON,
|
|
6
|
+
importGtfs,
|
|
7
|
+
openDb,
|
|
8
|
+
} from 'gtfs';
|
|
2
9
|
|
|
3
10
|
/**
|
|
4
11
|
* This is type-checked (but not executed) by dtslint.
|
|
@@ -6,21 +13,19 @@ import { Config, exportGtfs, getAgencies, getDb, getShapesAsGeoJSON, importGtfs,
|
|
|
6
13
|
*/
|
|
7
14
|
|
|
8
15
|
(async () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
const config: Config = {
|
|
17
|
+
agencies: [{ path: 'example.zip' }],
|
|
18
|
+
verbose: false,
|
|
19
|
+
};
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
await importGtfs(config); // $ExpectType void
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
await exportGtfs(config); // $ExpectType void
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
openDb(config); // $ExpectType Database<Database, Statement>
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
const results = getAgencies();
|
|
28
|
+
results[0]; // $ExpectType Record<string, any>
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
results[0]; // $ExpectType Record<string, any>
|
|
24
|
-
|
|
25
|
-
await getShapesAsGeoJSON(); // $ExpectType FeatureCollection<Geometry, { [name: string]: any; }>
|
|
30
|
+
getShapesAsGeoJSON(); // $ExpectType FeatureCollection<Geometry, { [name: string]: any; }>
|
|
26
31
|
})();
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ 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
|
+
## [4.0.0] - 2022-12-30
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Use better-sqlite3 library
|
|
13
|
+
- Make all query methods synchronous
|
|
14
|
+
- Remove `runRawQuery` (use Raw SQLite query instead)
|
|
15
|
+
- Remove `execRawQuery` (use Raw SQLite query instead)
|
|
16
|
+
- Remove `getDb` (use `openDb` instead)
|
|
17
|
+
|
|
18
|
+
## [3.8.0] - 2022-12-22
|
|
19
|
+
|
|
20
|
+
### Updated
|
|
21
|
+
|
|
22
|
+
- Dependency updates
|
|
23
|
+
- Add Node 18 tests
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Make transfer_type not required in transfers.txt
|
|
28
|
+
|
|
8
29
|
## [3.7.0] - 2022-11-17
|
|
9
30
|
|
|
10
31
|
### Updated
|