gtfs 4.0.3 → 4.1.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.
@@ -0,0 +1,65 @@
1
+ const model = {
2
+ filenameBase: 'run_event',
3
+ nonstandard: true,
4
+ extension: 'ods',
5
+ schema: [
6
+ {
7
+ name: 'run_event_id',
8
+ type: 'varchar(255)',
9
+ primary: true,
10
+ required: true,
11
+ },
12
+ {
13
+ name: 'piece_id',
14
+ type: 'varchar(255)',
15
+ required: true,
16
+ },
17
+ {
18
+ name: 'event_type',
19
+ type: 'integer',
20
+ required: true,
21
+ min: 0,
22
+ index: true,
23
+ },
24
+ {
25
+ name: 'event_name',
26
+ type: 'varchar(255)',
27
+ nocase: true,
28
+ },
29
+ {
30
+ name: 'event_time',
31
+ type: 'varchar(255)',
32
+ required: true,
33
+ },
34
+ {
35
+ name: 'event_duration',
36
+ type: 'integer',
37
+ required: true,
38
+ min: 0,
39
+ },
40
+ {
41
+ name: 'event_from_location_type',
42
+ type: 'integer',
43
+ min: 0,
44
+ max: 1,
45
+ index: true,
46
+ },
47
+ {
48
+ name: 'event_from_location_id',
49
+ type: 'varchar(255)',
50
+ },
51
+ {
52
+ name: 'event_to_location_type',
53
+ type: 'integer',
54
+ min: 0,
55
+ max: 1,
56
+ index: true,
57
+ },
58
+ {
59
+ name: 'event_to_location_id',
60
+ type: 'varchar(255)',
61
+ },
62
+ ],
63
+ };
64
+
65
+ export default model;
@@ -0,0 +1,58 @@
1
+ const model = {
2
+ filenameBase: 'runs_pieces',
3
+ nonstandard: true,
4
+ extension: 'ods',
5
+ schema: [
6
+ {
7
+ name: 'run_id',
8
+ type: 'varchar(255)',
9
+ required: true,
10
+ },
11
+ {
12
+ name: 'piece_id',
13
+ type: 'varchar(255)',
14
+ primary: true,
15
+ required: true,
16
+ },
17
+ {
18
+ name: 'start_type',
19
+ type: 'integer',
20
+ required: true,
21
+ min: 0,
22
+ max: 2,
23
+ index: true,
24
+ },
25
+ {
26
+ name: 'start_trip_id',
27
+ type: 'varchar(255)',
28
+ required: true,
29
+ index: true,
30
+ },
31
+ {
32
+ name: 'start_trip_position',
33
+ type: 'integer',
34
+ min: 0,
35
+ },
36
+ {
37
+ name: 'end_type',
38
+ type: 'integer',
39
+ required: true,
40
+ min: 0,
41
+ max: 2,
42
+ index: true,
43
+ },
44
+ {
45
+ name: 'end_trip_id',
46
+ type: 'varchar(255)',
47
+ required: true,
48
+ index: true,
49
+ },
50
+ {
51
+ name: 'end_trip_position',
52
+ type: 'integer',
53
+ min: 0,
54
+ },
55
+ ],
56
+ };
57
+
58
+ export default model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs",
3
- "version": "4.0.3",
3
+ "version": "4.1.1",
4
4
  "description": "Import GTFS transit data into SQLite and query routes, stops, times, fares and more",
5
5
  "keywords": [
6
6
  "transit",
@@ -74,13 +74,13 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@turf/helpers": "^6.5.0",
77
- "better-sqlite3": "^8.0.1",
78
- "csv-parse": "^5.3.4",
79
- "csv-stringify": "^6.2.3",
77
+ "better-sqlite3": "^8.3.0",
78
+ "csv-parse": "^5.3.6",
79
+ "csv-stringify": "^6.3.0",
80
80
  "gtfs-realtime-bindings": "^1.1.1",
81
81
  "lodash-es": "^4.17.21",
82
82
  "long": "^5.2.1",
83
- "node-fetch": "^3.3.0",
83
+ "node-fetch": "^3.3.1",
84
84
  "pluralize": "^8.0.0",
85
85
  "pretty-error": "^4.0.0",
86
86
  "promise-map-series": "^0.3.0",
@@ -91,18 +91,18 @@
91
91
  "tmp-promise": "^3.0.3",
92
92
  "untildify": "^4.0.0",
93
93
  "unzipper": "^0.10.11",
94
- "yargs": "^17.6.2",
94
+ "yargs": "^17.7.1",
95
95
  "yoctocolors": "^1.0.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@types/better-sqlite3": "^7.6.3",
98
+ "@types/better-sqlite3": "^7.6.4",
99
99
  "dtslint": "^4.2.1",
100
- "eslint": "^8.33.0",
101
- "eslint-config-prettier": "^8.6.0",
100
+ "eslint": "^8.38.0",
101
+ "eslint-config-prettier": "^8.8.0",
102
102
  "eslint-config-xo": "^0.43.1",
103
103
  "husky": "^8.0.3",
104
104
  "mocha": "^10.2.0",
105
- "prettier": "^2.8.3",
105
+ "prettier": "^2.8.7",
106
106
  "pretty-quick": "^3.1.3",
107
107
  "should": "^13.2.3"
108
108
  },
@@ -0,0 +1,33 @@
1
+ /* eslint-env mocha */
2
+
3
+ import should from 'should';
4
+
5
+ import config from '../test-config.js';
6
+ import {
7
+ openDb,
8
+ closeDb,
9
+ importGtfs,
10
+ getCalendarAttributes,
11
+ } from '../../index.js';
12
+
13
+ describe('getCalendarAttributes():', () => {
14
+ before(async () => {
15
+ openDb(config);
16
+ await importGtfs(config);
17
+ });
18
+
19
+ after(() => {
20
+ const db = openDb(config);
21
+ closeDb(db);
22
+ });
23
+
24
+ it('should return empty array if no calendar attributes', () => {
25
+ const serviceId = 'fake-service-id';
26
+
27
+ const results = getCalendarAttributes({
28
+ service_id: serviceId,
29
+ });
30
+ should.exists(results);
31
+ results.should.have.length(0);
32
+ });
33
+ });
@@ -0,0 +1,33 @@
1
+ /* eslint-env mocha */
2
+
3
+ import should from 'should';
4
+
5
+ import config from '../test-config.js';
6
+ import {
7
+ openDb,
8
+ closeDb,
9
+ importGtfs,
10
+ getRouteAttributes,
11
+ } from '../../index.js';
12
+
13
+ describe('getRouteAttributes():', () => {
14
+ before(async () => {
15
+ openDb(config);
16
+ await importGtfs(config);
17
+ });
18
+
19
+ after(() => {
20
+ const db = openDb(config);
21
+ closeDb(db);
22
+ });
23
+
24
+ it('should return empty array if no route attributes', () => {
25
+ const routeId = 'fake-route-id';
26
+
27
+ const results = getRouteAttributes({
28
+ route_id: routeId,
29
+ });
30
+ should.exists(results);
31
+ results.should.have.length(0);
32
+ });
33
+ });