gtfs 4.12.0 → 4.13.1

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.
Files changed (199) hide show
  1. package/README.md +27 -5
  2. package/dist/bin/gtfs-export.d.ts +1 -0
  3. package/dist/bin/gtfs-export.js +3645 -0
  4. package/dist/bin/gtfs-export.js.map +1 -0
  5. package/dist/bin/gtfs-import.d.ts +1 -0
  6. package/dist/bin/gtfs-import.js +4143 -0
  7. package/dist/bin/gtfs-import.js.map +1 -0
  8. package/dist/bin/gtfsrealtime-update.d.ts +1 -0
  9. package/dist/bin/gtfsrealtime-update.js +3800 -0
  10. package/dist/bin/gtfsrealtime-update.js.map +1 -0
  11. package/dist/index.d.ts +172 -0
  12. package/dist/index.js +5202 -0
  13. package/dist/index.js.map +1 -0
  14. package/package.json +26 -12
  15. package/.eslintrc.json +0 -28
  16. package/.github/workflows/nodejs.yml +0 -21
  17. package/.husky/pre-commit +0 -4
  18. package/@types/index.d.ts +0 -606
  19. package/@types/tests.ts +0 -31
  20. package/@types/tsconfig.json +0 -17
  21. package/CHANGELOG.md +0 -905
  22. package/bin/gtfs-export.js +0 -42
  23. package/bin/gtfs-import.js +0 -52
  24. package/bin/gtfsrealtime-update.js +0 -35
  25. package/config-sample-full.json +0 -20
  26. package/config-sample-rtupdates.json +0 -16
  27. package/config-sample.json +0 -8
  28. package/docs/images/node-gtfs-logo.svg +0 -18
  29. package/index.js +0 -1
  30. package/lib/advancedQuery.js +0 -36
  31. package/lib/db.js +0 -92
  32. package/lib/export.js +0 -141
  33. package/lib/file-utils.js +0 -103
  34. package/lib/geojson-utils.js +0 -138
  35. package/lib/gtfs/agencies.js +0 -32
  36. package/lib/gtfs/areas.js +0 -27
  37. package/lib/gtfs/attributions.js +0 -32
  38. package/lib/gtfs/booking-rules.js +0 -32
  39. package/lib/gtfs/calendar-dates.js +0 -32
  40. package/lib/gtfs/calendars.js +0 -32
  41. package/lib/gtfs/fare-attributes.js +0 -32
  42. package/lib/gtfs/fare-leg-rules.js +0 -32
  43. package/lib/gtfs/fare-media.js +0 -32
  44. package/lib/gtfs/fare-products.js +0 -32
  45. package/lib/gtfs/fare-rules.js +0 -32
  46. package/lib/gtfs/fare-transfer-rules.js +0 -32
  47. package/lib/gtfs/feed-info.js +0 -32
  48. package/lib/gtfs/frequencies.js +0 -32
  49. package/lib/gtfs/levels.js +0 -27
  50. package/lib/gtfs/location-group-stops.js +0 -32
  51. package/lib/gtfs/location-groups.js +0 -32
  52. package/lib/gtfs/locations.js +0 -32
  53. package/lib/gtfs/networks.js +0 -32
  54. package/lib/gtfs/pathways.js +0 -32
  55. package/lib/gtfs/route-networks.js +0 -32
  56. package/lib/gtfs/routes.js +0 -72
  57. package/lib/gtfs/shapes.js +0 -119
  58. package/lib/gtfs/stop-areas.js +0 -32
  59. package/lib/gtfs/stop-times.js +0 -32
  60. package/lib/gtfs/stops.js +0 -136
  61. package/lib/gtfs/timeframes.js +0 -32
  62. package/lib/gtfs/transfers.js +0 -32
  63. package/lib/gtfs/translations.js +0 -32
  64. package/lib/gtfs/trips.js +0 -27
  65. package/lib/gtfs-plus/calendar-attributes.js +0 -32
  66. package/lib/gtfs-plus/directions.js +0 -32
  67. package/lib/gtfs-plus/route-attributes.js +0 -32
  68. package/lib/gtfs-plus/stop-attributes.js +0 -32
  69. package/lib/gtfs-realtime/service-alerts.js +0 -34
  70. package/lib/gtfs-realtime/stop-time-updates.js +0 -32
  71. package/lib/gtfs-realtime/trip-updates.js +0 -32
  72. package/lib/gtfs-realtime/vehicle-positions.js +0 -32
  73. package/lib/gtfs-ride/board-alights.js +0 -32
  74. package/lib/gtfs-ride/ride-feed-infos.js +0 -32
  75. package/lib/gtfs-ride/rider-trips.js +0 -32
  76. package/lib/gtfs-ride/riderships.js +0 -32
  77. package/lib/gtfs-ride/trip-capacities.js +0 -32
  78. package/lib/gtfs.js +0 -261
  79. package/lib/import.js +0 -803
  80. package/lib/log-utils.js +0 -73
  81. package/lib/non-standard/timetable-notes-references.js +0 -32
  82. package/lib/non-standard/timetable-notes.js +0 -32
  83. package/lib/non-standard/timetable-pages.js +0 -32
  84. package/lib/non-standard/timetable-stop-order.js +0 -32
  85. package/lib/non-standard/timetables.js +0 -32
  86. package/lib/non-standard/trips-dated-vehicle-journey.js +0 -32
  87. package/lib/ods/deadhead-times.js +0 -32
  88. package/lib/ods/deadheads.js +0 -32
  89. package/lib/ods/ops-locations.js +0 -32
  90. package/lib/ods/run-events.js +0 -32
  91. package/lib/ods/runs-pieces.js +0 -32
  92. package/lib/utils.js +0 -178
  93. package/models/gtfs/agency.js +0 -49
  94. package/models/gtfs/areas.js +0 -19
  95. package/models/gtfs/attributions.js +0 -68
  96. package/models/gtfs/booking-rules.js +0 -92
  97. package/models/gtfs/calendar-dates.js +0 -34
  98. package/models/gtfs/calendar.js +0 -76
  99. package/models/gtfs/fare-attributes.js +0 -48
  100. package/models/gtfs/fare-leg-rules.js +0 -55
  101. package/models/gtfs/fare-media.js +0 -26
  102. package/models/gtfs/fare-products.js +0 -35
  103. package/models/gtfs/fare-rules.js +0 -34
  104. package/models/gtfs/fare-transfer-rules.js +0 -56
  105. package/models/gtfs/feed-info.js +0 -50
  106. package/models/gtfs/frequencies.js +0 -46
  107. package/models/gtfs/levels.js +0 -25
  108. package/models/gtfs/location-group-stops.js +0 -22
  109. package/models/gtfs/location-groups.js +0 -19
  110. package/models/gtfs/locations.js +0 -12
  111. package/models/gtfs/networks.js +0 -20
  112. package/models/gtfs/pathways.js +0 -74
  113. package/models/gtfs/route-networks.js +0 -21
  114. package/models/gtfs/routes.js +0 -79
  115. package/models/gtfs/shapes.js +0 -41
  116. package/models/gtfs/stop-areas.js +0 -20
  117. package/models/gtfs/stop-times.js +0 -120
  118. package/models/gtfs/stops.js +0 -85
  119. package/models/gtfs/timeframes.js +0 -29
  120. package/models/gtfs/transfers.js +0 -56
  121. package/models/gtfs/translations.js +0 -48
  122. package/models/gtfs/trips.js +0 -70
  123. package/models/gtfs-plus/calendar-attributes.js +0 -22
  124. package/models/gtfs-plus/directions.js +0 -29
  125. package/models/gtfs-plus/route-attributes.js +0 -34
  126. package/models/gtfs-plus/stop-attributes.js +0 -35
  127. package/models/gtfs-realtime/service-alert-targets.js +0 -37
  128. package/models/gtfs-realtime/service-alerts.js +0 -60
  129. package/models/gtfs-realtime/stop-time-updates.js +0 -85
  130. package/models/gtfs-realtime/trip-updates.js +0 -75
  131. package/models/gtfs-realtime/vehicle-positions.js +0 -135
  132. package/models/gtfs-ride/board-alight.js +0 -132
  133. package/models/gtfs-ride/ride-feed-info.js +0 -40
  134. package/models/gtfs-ride/rider-trip.js +0 -113
  135. package/models/gtfs-ride/ridership.js +0 -127
  136. package/models/gtfs-ride/trip-capacity.js +0 -51
  137. package/models/models.js +0 -120
  138. package/models/non-standard/timetable-notes-references.js +0 -50
  139. package/models/non-standard/timetable-notes.js +0 -24
  140. package/models/non-standard/timetable-pages.js +0 -23
  141. package/models/non-standard/timetable-stop-order.js +0 -32
  142. package/models/non-standard/timetables.js +0 -144
  143. package/models/non-standard/trips-dated-vehicle-journey.js +0 -34
  144. package/models/ods/deadhead-times.js +0 -65
  145. package/models/ods/deadheads.js +0 -60
  146. package/models/ods/ops-locations.js +0 -46
  147. package/models/ods/run-events.js +0 -70
  148. package/models/ods/runs-pieces.js +0 -59
  149. package/test/fixture/caltrain_20160406.zip +0 -0
  150. package/test/mocha/advanced-query.js +0 -74
  151. package/test/mocha/delete-db.js +0 -62
  152. package/test/mocha/export-gtfs.js +0 -147
  153. package/test/mocha/fare-transfer-rules.js +0 -32
  154. package/test/mocha/get-agencies.js +0 -90
  155. package/test/mocha/get-areas.js +0 -27
  156. package/test/mocha/get-attributions.js +0 -27
  157. package/test/mocha/get-board-alights.js +0 -28
  158. package/test/mocha/get-booking-rules.js +0 -28
  159. package/test/mocha/get-calendar-attributes.js +0 -33
  160. package/test/mocha/get-calendar-dates.js +0 -107
  161. package/test/mocha/get-calendars.js +0 -94
  162. package/test/mocha/get-directions.js +0 -28
  163. package/test/mocha/get-fare-attributes.js +0 -51
  164. package/test/mocha/get-fare-leg-rules.js +0 -27
  165. package/test/mocha/get-fare-media.js +0 -27
  166. package/test/mocha/get-fare-products.js +0 -27
  167. package/test/mocha/get-fare-rules.js +0 -50
  168. package/test/mocha/get-feed-info.js +0 -28
  169. package/test/mocha/get-frequencies.js +0 -28
  170. package/test/mocha/get-levels.js +0 -28
  171. package/test/mocha/get-location-group-stops.js +0 -33
  172. package/test/mocha/get-location-groups.js +0 -28
  173. package/test/mocha/get-locations.js +0 -69
  174. package/test/mocha/get-networks.js +0 -28
  175. package/test/mocha/get-pathways.js +0 -28
  176. package/test/mocha/get-ride-feed-infos.js +0 -24
  177. package/test/mocha/get-rider-trips.js +0 -28
  178. package/test/mocha/get-riderships.js +0 -28
  179. package/test/mocha/get-route-attributes.js +0 -33
  180. package/test/mocha/get-route-networks.js +0 -28
  181. package/test/mocha/get-routes.js +0 -143
  182. package/test/mocha/get-shapes-as-geojson.js +0 -92
  183. package/test/mocha/get-shapes.js +0 -240
  184. package/test/mocha/get-stop-attributes.js +0 -28
  185. package/test/mocha/get-stops-as-geojson.js +0 -87
  186. package/test/mocha/get-stops.js +0 -343
  187. package/test/mocha/get-stoptimes.js +0 -67
  188. package/test/mocha/get-timeframes.js +0 -28
  189. package/test/mocha/get-timetable-pages.js +0 -28
  190. package/test/mocha/get-timetable-stop-orders.js +0 -33
  191. package/test/mocha/get-timetables.js +0 -28
  192. package/test/mocha/get-transfers.js +0 -28
  193. package/test/mocha/get-translations.js +0 -28
  194. package/test/mocha/get-trip-capacities.js +0 -28
  195. package/test/mocha/get-trips.js +0 -53
  196. package/test/mocha/import-gtfs.js +0 -173
  197. package/test/mocha/open-db.js +0 -149
  198. package/test/mocha/raw-query.js +0 -34
  199. package/test/test-config.js +0 -12
package/@types/index.d.ts DELETED
@@ -1,606 +0,0 @@
1
- import CsvParse = require('csv-parse');
2
-
3
- import Database = require('better-sqlite3');
4
-
5
- import { FeatureCollection, Geometry } from '@turf/helpers';
6
-
7
- export {}; // disable implicit exporting of types
8
-
9
- export type SqlValue =
10
- | undefined
11
- | null
12
- | string
13
- | number
14
- | boolean
15
- | Date
16
- | SqlValue[];
17
-
18
- export type SqlWhere = Record<string, null | SqlValue | SqlValue[]>;
19
-
20
- export type SqlSelect = string[];
21
-
22
- export type SqlOrderBy = Array<[string, 'ASC' | 'DESC']>;
23
-
24
- export type JoinTables = JoinOptions[];
25
-
26
- export type SqlResults = Array<Record<string, any>>;
27
-
28
- export type SqlQueryString = string;
29
-
30
- export type SqlTableName = string;
31
-
32
- export type Config = ExportConfig & ImportConfig;
33
-
34
- export interface AdvancedQueryOptions {
35
- /**
36
- * Queries the database with support for table joins and custom tables and returns an array of data.
37
- */
38
- query?: SqlWhere;
39
- fields?: SqlSelect;
40
- orderBy?: SqlOrderBy;
41
- join?: JoinOptions[];
42
- options?: QueryOptions;
43
- }
44
-
45
- export interface JoinOptions {
46
- /**
47
- * Options for joining, type
48
- */
49
- type?: 'LEFT OUTER' | 'INNER';
50
- table: string;
51
- on: string;
52
- }
53
-
54
- interface VerboseConfig {
55
- /**
56
- * Whether or not to print output to the console. Defaults to true.
57
- */
58
- verbose?: boolean;
59
- }
60
-
61
- export interface DbConfig {
62
- /**
63
- * A path to a SQLite database. Defaults to using an in-memory database.
64
- */
65
- sqlitePath?: string;
66
-
67
- /**
68
- * A better-sqlite3 database object. If provided, sqlitePath will be ignored.
69
- */
70
- db?: Database.Database;
71
- }
72
-
73
- export interface ExportConfig extends DbConfig, VerboseConfig {
74
- /**
75
- * Path to a directory to store exported GTFS files. Defaults to `gtfs-export/<agency_name>`.
76
- */
77
- exportPath?: string;
78
- }
79
-
80
- export interface ImportConfig extends DbConfig, VerboseConfig {
81
- /**
82
- * An array of agencies with GTFS files to be imported.
83
- */
84
- agencies: Array<{
85
- /**
86
- * Exclude files - if you don't want all GTFS files to be imported,
87
- * you can specify an array of files to exclude.
88
- */
89
- exclude?: string[];
90
-
91
- /**
92
- * Specify custom headers for download URL.
93
- */
94
- headers?: Record<string, string>;
95
-
96
- /**
97
- * Specify custom headers for download URL.
98
- */
99
- realtimeHeaders?: Record<string, string>;
100
-
101
- /**
102
- * Specify a path to a zipped GTFS file or an unzipped GTFS directory.
103
- * One of `url` or `path` must be provided.
104
- */
105
- path?: string;
106
-
107
- /**
108
- * Specify a download URL. One of `url` or `path` must be provided.
109
- */
110
- url?: string;
111
-
112
- /**
113
- * Specify an array of download URLs for GTFS-Realtime data
114
- */
115
- realtimeUrls?: string[];
116
- }>;
117
-
118
- /**
119
- * Options passed to csv-parse for parsing GTFS CSV files.
120
- */
121
- csvOptions?: CsvParse.Options;
122
-
123
- /**
124
- * A timeout in milliseconds for downloading GTFS files. Defaults to no timeout.
125
- */
126
- downloadTimeout?: number;
127
-
128
- /**
129
- * Whether or not to ignore errors during import. Defaults to false.
130
- */
131
- ignoreErrors?: boolean;
132
- }
133
-
134
- export interface QueryOptions {
135
- db?: Database.Database;
136
- }
137
-
138
- /**
139
- * Use exportGtfs() in your code to run an export of a GTFS from SQLite specified in a config.json file.
140
- */
141
- export function exportGtfs(config: ExportConfig): Promise<void>;
142
-
143
- /**
144
- * Use importGtfs() in your code to run an import of a GTFS file specified in a config.json file.
145
- */
146
- export function importGtfs(config: ImportConfig): Promise<void>;
147
-
148
- /**
149
- * Use updateGtfsRealtime() in your code to run an update of a GTFS-Realtime data specified in a config.json file.
150
- */
151
- export function updateGtfsRealtime(config: ImportConfig): Promise<void>;
152
-
153
- /**
154
- * Opens the database specified in the config object.
155
- */
156
- export function openDb(config: DbConfig): Database.Database;
157
-
158
- /**
159
- * Closes the specified database.
160
- */
161
- export function closeDb(db?: Database.Database): void;
162
-
163
- /**
164
- * Deletes the specified database.
165
- */
166
- export function deleteDb(db?: Database.Database): void;
167
-
168
- /**
169
- * Returns an array of agencies that match query parameters.
170
- */
171
- export function getAgencies(
172
- query?: SqlWhere,
173
- fields?: SqlSelect,
174
- sortBy?: SqlOrderBy,
175
- options?: QueryOptions,
176
- ): SqlResults;
177
-
178
- /**
179
- * Returns an array of areas that match query parameters.
180
- */
181
- export function getAreas(
182
- query?: SqlWhere,
183
- fields?: SqlSelect,
184
- sortBy?: SqlOrderBy,
185
- options?: QueryOptions,
186
- ): SqlResults;
187
-
188
- /**
189
- * Returns an array of attributions that match query parameters.
190
- */
191
- export function getAttributions(
192
- query?: SqlWhere,
193
- fields?: SqlSelect,
194
- sortBy?: SqlOrderBy,
195
- options?: QueryOptions,
196
- ): SqlResults;
197
-
198
- /**
199
- * Returns an array of routes that match query parameters.
200
- */
201
- export function getRoutes(
202
- query?: SqlWhere,
203
- fields?: SqlSelect,
204
- sortBy?: SqlOrderBy,
205
- options?: QueryOptions,
206
- ): SqlResults;
207
-
208
- /**
209
- * Returns an array of stops that match query parameters.
210
- */
211
- export function getStops(
212
- query?: SqlWhere,
213
- fields?: SqlSelect,
214
- sortBy?: SqlOrderBy,
215
- options?: QueryOptions,
216
- ): SqlResults;
217
-
218
- /**
219
- * Returns geoJSON object of stops that match query parameters.
220
- * All valid queries for `getStops()` work for `getStopsAsGeoJSON()`.
221
- */
222
- export function getStopsAsGeoJSON(
223
- query?: SqlWhere,
224
- options?: QueryOptions,
225
- ): Promise<FeatureCollection<Geometry, { [name: string]: any }>>;
226
-
227
- /**
228
- * Returns an array of stop_times that match query parameters.
229
- */
230
- export function getStoptimes(
231
- query?: SqlWhere,
232
- fields?: SqlSelect,
233
- sortBy?: SqlOrderBy,
234
- options?: QueryOptions,
235
- ): SqlResults;
236
-
237
- /**
238
- * Returns an array of trips that match query parameters.
239
- */
240
- export function getTrips(
241
- query?: SqlWhere,
242
- fields?: SqlSelect,
243
- sortBy?: SqlOrderBy,
244
- options?: QueryOptions,
245
- ): SqlResults;
246
-
247
- /**
248
- * Returns an array of shapes that match query parameters.
249
- */
250
- export function getShapes(
251
- query?: SqlWhere,
252
- fields?: SqlSelect,
253
- sortBy?: SqlOrderBy,
254
- options?: QueryOptions,
255
- ): SqlResults;
256
-
257
- /**
258
- * Returns a geoJSON object of shapes that match query parameters.
259
- * All valid queries for `getShapes()` work for `getShapesAsGeoJSON()`.
260
- */
261
- export function getShapesAsGeoJSON(
262
- query?: SqlWhere,
263
- options?: QueryOptions,
264
- ): FeatureCollection<Geometry, { [name: string]: any }>;
265
-
266
- /**
267
- * Returns an array of calendars that match query parameters.
268
- */
269
- export function getCalendars(
270
- query?: SqlWhere,
271
- fields?: SqlSelect,
272
- sortBy?: SqlOrderBy,
273
- options?: QueryOptions,
274
- ): SqlResults;
275
-
276
- /**
277
- * Returns an array of calendar_dates that match query parameters.
278
- */
279
- export function getCalendarDates(
280
- query?: SqlWhere,
281
- fields?: SqlSelect,
282
- sortBy?: SqlOrderBy,
283
- options?: QueryOptions,
284
- ): SqlResults;
285
-
286
- /**
287
- * Returns an array of fare_attributes that match query parameters.
288
- */
289
- export function getFareAttributes(
290
- query?: SqlWhere,
291
- fields?: SqlSelect,
292
- sortBy?: SqlOrderBy,
293
- options?: QueryOptions,
294
- ): SqlResults;
295
-
296
- /**
297
- * Returns an array of fare_leg_rules that match query parameters.
298
- */
299
- export function getFareLegRules(
300
- query?: SqlWhere,
301
- fields?: SqlSelect,
302
- sortBy?: SqlOrderBy,
303
- options?: QueryOptions,
304
- ): SqlResults;
305
-
306
- /**
307
- * Returns an array of fare_media that match query parameters.
308
- */
309
- export function getFareMedia(
310
- query?: SqlWhere,
311
- fields?: SqlSelect,
312
- sortBy?: SqlOrderBy,
313
- options?: QueryOptions,
314
- ): SqlResults;
315
-
316
- /**
317
- * Returns an array of fare_products that match query parameters.
318
- */
319
- export function getFareProducts(
320
- query?: SqlWhere,
321
- fields?: SqlSelect,
322
- sortBy?: SqlOrderBy,
323
- options?: QueryOptions,
324
- ): SqlResults;
325
-
326
- /**
327
- * Returns an array of fare_rules that match query parameters.
328
- */
329
- export function getFareRules(
330
- query?: SqlWhere,
331
- fields?: SqlSelect,
332
- sortBy?: SqlOrderBy,
333
- options?: QueryOptions,
334
- ): SqlResults;
335
-
336
- /**
337
- * Returns an array of fare_transfer_rules that match query parameters.
338
- */
339
- export function getFareTransferRules(
340
- query?: SqlWhere,
341
- fields?: SqlSelect,
342
- sortBy?: SqlOrderBy,
343
- options?: QueryOptions,
344
- ): SqlResults;
345
-
346
- /**
347
- * Returns an array of feed_info that match query parameters.
348
- */
349
- export function getFeedInfo(
350
- query?: SqlWhere,
351
- fields?: SqlSelect,
352
- sortBy?: SqlOrderBy,
353
- options?: QueryOptions,
354
- ): SqlResults;
355
-
356
- /**
357
- * Returns an array of frequencies that match query parameters.
358
- */
359
- export function getFrequencies(
360
- query?: SqlWhere,
361
- fields?: SqlSelect,
362
- sortBy?: SqlOrderBy,
363
- options?: QueryOptions,
364
- ): SqlResults;
365
-
366
- /**
367
- * Returns an array of levels that match query parameters.
368
- */
369
- export function getLevels(
370
- query?: SqlWhere,
371
- fields?: SqlSelect,
372
- sortBy?: SqlOrderBy,
373
- options?: QueryOptions,
374
- ): SqlResults;
375
-
376
- /**
377
- * Returns an array of pathways that match query parameters.
378
- */
379
- export function getPathways(
380
- query?: SqlWhere,
381
- fields?: SqlSelect,
382
- sortBy?: SqlOrderBy,
383
- options?: QueryOptions,
384
- ): SqlResults;
385
-
386
- /**
387
- * Returns an array of timeframes that match query parameters.
388
- */
389
- export function getTimeframes(
390
- query?: SqlWhere,
391
- fields?: SqlSelect,
392
- sortBy?: SqlOrderBy,
393
- options?: QueryOptions,
394
- ): SqlResults;
395
-
396
- /**
397
- * Returns an array of transfers that match query parameters.
398
- */
399
- export function getTransfers(
400
- query?: SqlWhere,
401
- fields?: SqlSelect,
402
- sortBy?: SqlOrderBy,
403
- options?: QueryOptions,
404
- ): SqlResults;
405
-
406
- /**
407
- * Returns an array of translations that match query parameters.
408
- */
409
- export function getTranslations(
410
- query?: SqlWhere,
411
- fields?: SqlSelect,
412
- sortBy?: SqlOrderBy,
413
- options?: QueryOptions,
414
- ): SqlResults;
415
-
416
- /**
417
- * Returns an array of stop_areas that match query parameters.
418
- */
419
- export function getStopAreas(
420
- query?: SqlWhere,
421
- fields?: SqlSelect,
422
- sortBy?: SqlOrderBy,
423
- options?: QueryOptions,
424
- ): SqlResults;
425
-
426
- /**
427
- * Returns an array of networks that match query parameters.
428
- */
429
- export function getNetworks(
430
- query?: SqlWhere,
431
- fields?: SqlSelect,
432
- sortBy?: SqlOrderBy,
433
- options?: QueryOptions,
434
- ): SqlResults;
435
-
436
- /**
437
- * Returns an array of route_networks that match query parameters.
438
- */
439
- export function getRouteNetworks(
440
- query?: SqlWhere,
441
- fields?: SqlSelect,
442
- sortBy?: SqlOrderBy,
443
- options?: QueryOptions,
444
- ): SqlResults;
445
-
446
- /**
447
- * Returns an array of calendar_attributes that match query parameters.
448
- * This is for the non-standard `calendar_attributes.txt` file.
449
- */
450
- export function getCalendarAttributes(
451
- query?: SqlWhere,
452
- fields?: SqlSelect,
453
- sortBy?: SqlOrderBy,
454
- options?: QueryOptions,
455
- ): SqlResults;
456
-
457
- /**
458
- * Returns an array of directions that match query parameters.
459
- * This is for the non-standard `directions.txt` file.
460
- */
461
- export function getDirections(
462
- query?: SqlWhere,
463
- fields?: SqlSelect,
464
- sortBy?: SqlOrderBy,
465
- options?: QueryOptions,
466
- ): SqlResults;
467
-
468
- /**
469
- * Returns an array of route_attributes that match query parameters.
470
- * This is for the non-standard `route_attributes.txt` file.
471
- */
472
- export function getRouteAttributes(
473
- query?: SqlWhere,
474
- fields?: SqlSelect,
475
- sortBy?: SqlOrderBy,
476
- options?: QueryOptions,
477
- ): SqlResults;
478
-
479
- /**
480
- * Returns an array of stop_attributes that match query parameters.
481
- * This is for the non-standard `stop_attributes.txt` file.
482
- */
483
- export function getStopAttributes(
484
- query?: SqlWhere,
485
- fields?: SqlSelect,
486
- sortBy?: SqlOrderBy,
487
- options?: QueryOptions,
488
- ): SqlResults;
489
-
490
- /**
491
- * Returns an array of timetables that match query parameters.
492
- * This is for the non-standard `timetables.txt` file used in GTFS-to-HTML.
493
- */
494
- export function getTimetables(
495
- query?: SqlWhere,
496
- fields?: SqlSelect,
497
- sortBy?: SqlOrderBy,
498
- options?: QueryOptions,
499
- ): SqlResults;
500
-
501
- /**
502
- * Returns an array of timetable_stop_orders that match query parameters.
503
- * This is for the non-standard `timetable_stop_order.txt` file used in GTFS-to-HTML.
504
- */
505
- export function getTimetableStopOrders(
506
- query?: SqlWhere,
507
- fields?: SqlSelect,
508
- sortBy?: SqlOrderBy,
509
- options?: QueryOptions,
510
- ): SqlResults;
511
-
512
- /**
513
- * Returns an array of timetable_pages that match query parameters.
514
- * This is for the non-standard `timetable_pages.txt` file used in GTFS-to-HTML.
515
- */
516
- export function getTimetablePages(
517
- query?: SqlWhere,
518
- fields?: SqlSelect,
519
- sortBy?: SqlOrderBy,
520
- options?: QueryOptions,
521
- ): SqlResults;
522
-
523
- /**
524
- * Returns an array of timetable_notes that match query parameters.
525
- * This is for the non-standard `timetable_notes.txt` file used in GTFS-to-HTML.
526
- */
527
- export function getTimetableNotes(
528
- query?: SqlWhere,
529
- fields?: SqlSelect,
530
- sortBy?: SqlOrderBy,
531
- options?: QueryOptions,
532
- ): SqlResults;
533
-
534
- /**
535
- * Returns an array of timetable_notes_references that match query parameters.
536
- * This is for the non-standard `timetable_notes_references.txt` file used in GTFS-to-HTML.
537
- */
538
- export function getTimetableNotesReferences(
539
- query?: SqlWhere,
540
- fields?: SqlSelect,
541
- sortBy?: SqlOrderBy,
542
- options?: QueryOptions,
543
- ): SqlResults;
544
-
545
- /**
546
- * Returns an array of trips_dated_vehicle_journey that match query parameters.
547
- * This is for the non-standard `trips_dated_vehicle_journey.txt` file.
548
- */
549
- export function getTripsDatedVehicleJourneys(
550
- query?: SqlWhere,
551
- fields?: SqlSelect,
552
- sortBy?: SqlOrderBy,
553
- options?: QueryOptions,
554
- ): SqlResults;
555
-
556
- /**
557
- * Returns an array of GTFS Realtime service alerts that match query parameters.
558
- * This only works if you configure GTFS Realtime import in node-gtfs.
559
- */
560
- export function getServiceAlerts(
561
- query?: SqlWhere,
562
- fields?: SqlSelect,
563
- sortBy?: SqlOrderBy,
564
- options?: QueryOptions,
565
- ): SqlResults;
566
-
567
- /**
568
- * Returns an array of GTFS Realtime trip updates that match query parameters.
569
- * This only works if you configure GTFS Realtime import in node-gtfs.
570
- */
571
- export function getTripUpdates(
572
- query?: SqlWhere,
573
- fields?: SqlSelect,
574
- sortBy?: SqlOrderBy,
575
- options?: QueryOptions,
576
- ): SqlResults;
577
-
578
- /**
579
- * Returns an array of GTFS Realtime stop time updates that match query parameters.
580
- * This only works if you configure GTFS Realtime import in node-gtfs.
581
- */
582
- export function getStopTimeUpdates(
583
- query?: SqlWhere,
584
- fields?: SqlSelect,
585
- sortBy?: SqlOrderBy,
586
- options?: QueryOptions,
587
- ): SqlResults;
588
-
589
- /**
590
- * Returns an array of GTFS Realtime vehicle positions that match query parameters.
591
- * This only works if you configure GTFS Realtime import in node-gtfs.
592
- */
593
- export function getVehiclePositions(
594
- query?: SqlWhere,
595
- fields?: SqlSelect,
596
- sortBy?: SqlOrderBy,
597
- options?: QueryOptions,
598
- ): SqlResults;
599
-
600
- /**
601
- * Runs an advanced query.
602
- */
603
- export function advancedQuery(
604
- table?: SqlTableName,
605
- advancedQueryOptions?: AdvancedQueryOptions,
606
- ): SqlResults;
package/@types/tests.ts DELETED
@@ -1,31 +0,0 @@
1
- import {
2
- Config,
3
- exportGtfs,
4
- getAgencies,
5
- getShapesAsGeoJSON,
6
- importGtfs,
7
- openDb,
8
- } from 'gtfs';
9
-
10
- /**
11
- * This is type-checked (but not executed) by dtslint.
12
- * `npm run dtslint`
13
- */
14
-
15
- (async () => {
16
- const config: Config = {
17
- agencies: [{ path: 'example.zip' }],
18
- verbose: false,
19
- };
20
-
21
- await importGtfs(config); // $ExpectType void
22
-
23
- await exportGtfs(config); // $ExpectType void
24
-
25
- openDb(config); // $ExpectType Database
26
-
27
- const results = getAgencies();
28
- results[0]; // $ExpectType Record<string, any>
29
-
30
- getShapesAsGeoJSON(); // $ExpectType FeatureCollection<Geometry, { [name: string]: any; }>
31
- })();
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "lib": ["es6"],
5
- "noImplicitAny": true,
6
- "noImplicitThis": true,
7
- "strictFunctionTypes": true,
8
- "strictNullChecks": true,
9
- "types": [],
10
- "noEmit": true,
11
- "forceConsistentCasingInFileNames": true,
12
-
13
- // This allows test file to import "gtfs" instead of "./index".
14
- "baseUrl": ".",
15
- "paths": { "gtfs": ["."] }
16
- }
17
- }