@golemio/pid 2.3.2-dev.660754464 → 2.3.2-dev.661128816

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.
@@ -39,7 +39,7 @@ INSERT INTO ropidgtfs_stop_times (arrival_time, arrival_time_seconds, departure_
39
39
 
40
40
  INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U953S1', '2', 'U953Z102P', 50.0684400000000025, 14.5071700000000003, 'Skalka', '', 1, 'P', NULL, '2019-05-27 03:20:19.912+00', NULL, NULL, '2019-05-27 03:20:19.912+00', NULL, NULL, NULL, NULL, NULL);
41
41
  INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U713S1', '2', 'U713Z102P', 50.0733400000000017, 14.4900900000000004, 'Strašnická', '', 1, 'P', NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, NULL, NULL, NULL);
42
- INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U921S1', '2', 'U921Z102P', 50.0785399999999967, 14.4748900000000003, 'Želivského', '', 2, 'P', NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, NULL, NULL, NULL);
42
+ INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone, asw_node_id, asw_stop_id) VALUES (0, 'U921S1', '2', 'U921Z102P', 50.0785399999999967, 14.4748900000000003, 'Želivského', '', 2, 'P', NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, '2019-05-27 03:20:18.808+00', NULL, NULL, NULL, NULL, NULL, 921, 102);
43
43
  INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U118S1', '2', 'U118Z102P', 50.0782900000000026, 14.4618900000000004, 'Flora', '', 2, 'P', NULL, '2019-05-27 03:20:16.491+00', NULL, NULL, '2019-05-27 03:20:16.491+00', NULL, NULL, NULL, NULL, NULL);
44
44
  INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U209S1', '2', 'U209Z102P', 50.0776400000000024, 14.4500399999999996, 'Jiřího z Poděbrad', '', 2, 'P', NULL, '2019-05-27 03:20:16.491+00', NULL, NULL, '2019-05-27 03:20:16.491+00', NULL, NULL, NULL, NULL, NULL);
45
45
  INSERT INTO ropidgtfs_stops (location_type, parent_station, platform_code, stop_id, stop_lat, stop_lon, stop_name, stop_url, wheelchair_boarding, zone_id, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, level_id, stop_code, stop_desc, stop_timezone) VALUES (0, 'U476S1', '2', 'U476Z102P', 50.0754000000000019, 14.4390800000000006, 'Náměstí Míru', '', 2, 'P', NULL, '2019-05-27 03:20:17.945+00', NULL, NULL, '2019-05-27 03:20:17.945+00', NULL, NULL, NULL, NULL, NULL);
Binary file
@@ -63,6 +63,7 @@ export declare class GTFSTripsModel extends SequelizeModel {
63
63
  * @returns A converted item of the result
64
64
  */
65
65
  protected ConvertItem: (trip: any, options: {
66
+ route?: boolean;
66
67
  stops?: boolean;
67
68
  shapes?: boolean;
68
69
  stopTimes?: boolean;
@@ -115,12 +115,12 @@ class GTFSTripsModel extends models_1.SequelizeModel {
115
115
  * @returns Object of the retrieved record or null
116
116
  */
117
117
  this.GetOne = (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
118
- const { stopTimes, stops, shapes } = options;
118
+ const { route, stopTimes, stops, shapes } = options;
119
119
  return this.sequelizeModel.findByPk(id, { include: this.GetInclusions(options) }).then((trip) => {
120
120
  if (!trip) {
121
121
  return null;
122
122
  }
123
- return this.ConvertItem(trip, { stops, shapes, stopTimes });
123
+ return this.ConvertItem(trip, { route, stops, shapes, stopTimes });
124
124
  });
125
125
  });
126
126
  /** Prepare ORM query with selected params
@@ -191,7 +191,9 @@ class GTFSTripsModel extends models_1.SequelizeModel {
191
191
  */
192
192
  this.ConvertItem = (trip, options) => {
193
193
  const _a = trip.toJSON(), { stop_times: stopTimesItems = [], stops: stopItems = [], shapes: shapeItems = [] } = _a, item = __rest(_a, ["stop_times", "stops", "shapes"]);
194
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, item), (options.stops &&
194
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, item), (options.route && {
195
+ route: Object.assign(Object.assign({}, item.route), { is_night: item.route.is_night === "1", is_regional: item.route.is_regional === "1", is_substitute_transport: item.route.is_substitute_transport === "1" }),
196
+ })), (options.stops &&
195
197
  options.stopTimes && {
196
198
  stop_times: stopTimesItems.map((stopTime) => {
197
199
  const convertedStopTime = stopTime;
@@ -1 +1 @@
1
- {"version":3,"file":"GTFSTripsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/ropid-gtfs/models/GTFSTripsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAA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;QACN,CAAC,CAAC;QAEF;;WAEG;QACO,kBAAa,GAAG,CAAC,cAAmB,EAAE,OAAe,EAAE,MAAc,EAAE,EAAE;YAC/E,OAAO,IAAA,yBAAmB,EAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;IA9OF,CAAC;CA+OJ;AApPD,wCAoPC"}
@@ -26,6 +26,13 @@ paths:
26
26
  description: ""
27
27
  tags:
28
28
  - 🛤 Vehicle Positions
29
+ parameters:
30
+ - in: header
31
+ name: Content-Type
32
+ schema:
33
+ type: string
34
+ example: "text/xml"
35
+ required: true
29
36
  requestBody:
30
37
  required: true
31
38
  content:
@@ -379,22 +379,20 @@ paths:
379
379
  content:
380
380
  application/json:
381
381
  schema:
382
- type: array
383
- items:
384
- type: object
385
- properties:
386
- type:
387
- type: string
388
- example: "FeatureCollection"
389
- features:
390
- type: array
391
- items:
392
- allOf:
393
- - $ref: "#/components/schemas/FeaturePoint"
394
- - type: object
395
- properties:
396
- properties:
397
- $ref: "#/components/schemas/GTFSStop"
382
+ type: object
383
+ properties:
384
+ type:
385
+ type: string
386
+ example: "FeatureCollection"
387
+ features:
388
+ type: array
389
+ items:
390
+ allOf:
391
+ - $ref: "#/components/schemas/FeaturePoint"
392
+ - type: object
393
+ properties:
394
+ properties:
395
+ $ref: "#/components/schemas/GTFSStop"
398
396
  "401":
399
397
  $ref: "#/components/responses/UnauthorizedError"
400
398
  "404":
@@ -579,28 +577,26 @@ paths:
579
577
  content:
580
578
  application/json:
581
579
  schema:
582
- type: array
583
- items:
584
- type: object
585
- properties:
586
- type:
587
- type: string
588
- example: "FeatureCollection"
589
- features:
590
- type: array
591
- items:
592
- allOf:
593
- - $ref: "#/components/schemas/FeaturePoint"
594
- - type: object
595
- properties:
596
- properties:
597
- $ref: "#/components/schemas/VehiclepositionCompound"
580
+ type: object
581
+ properties:
582
+ type:
583
+ type: string
584
+ example: "FeatureCollection"
585
+ features:
586
+ type: array
587
+ items:
588
+ allOf:
589
+ - $ref: "#/components/schemas/FeaturePoint"
590
+ - type: object
591
+ properties:
592
+ properties:
593
+ $ref: "#/components/schemas/VehiclepositionCompound"
598
594
  "401":
599
595
  $ref: "#/components/responses/UnauthorizedError"
600
596
  "404":
601
597
  description: Not found
602
598
 
603
- /gtfs/vehiclepositions/{gtfsTripId}:
599
+ /vehiclepositions/{gtfsTripId}:
604
600
  get:
605
601
  summary: GET Vehicle Position
606
602
  description: ""
@@ -690,6 +686,25 @@ paths:
690
686
  "404":
691
687
  description: Not found
692
688
 
689
+ /vehiclepositions/gtfsrt/alerts.pb:
690
+ get:
691
+ summary: GET GTFS RealTime Alerts Protocol Buffer
692
+ description: ""
693
+ tags:
694
+ - 🗺 GTFS RealTime Vehicle Positions
695
+ responses:
696
+ "200":
697
+ description: successful operation
698
+ content:
699
+ application/octet-stream:
700
+ schema:
701
+ type: string
702
+ format: binary
703
+ "401":
704
+ $ref: "#/components/responses/UnauthorizedError"
705
+ "404":
706
+ description: Not found
707
+
693
708
  /pid/departureboards:
694
709
  get:
695
710
  summary: GET Departure Board
@@ -839,7 +854,7 @@ paths:
839
854
  - 🚏 PID Departure Boards
840
855
  responses:
841
856
  "200":
842
- description: Can return empty data in departures property (empty array []) if no departures were found
857
+ description: List of all active infotexts
843
858
  content:
844
859
  application/json:
845
860
  schema:
@@ -849,6 +864,25 @@ paths:
849
864
  - $ref: "#/components/schemas/PIDDepartureBoardInfotext"
850
865
  - type: object
851
866
  properties:
867
+ related_stops:
868
+ type: array
869
+ description: ""
870
+ items:
871
+ type: object
872
+ properties:
873
+ id:
874
+ type: string
875
+ example: "U118S1"
876
+ description: GTFS station IDs for which the infotexts apply.
877
+ name:
878
+ type: string
879
+ example: "Flora"
880
+ description: GTFS station name.
881
+ platform_code:
882
+ type: string
883
+ nullable: true
884
+ example: null
885
+ description: GTFS station platform code.
852
886
  related_routes:
853
887
  type: array
854
888
  description: ""
@@ -857,12 +891,25 @@ paths:
857
891
  example: "L152"
858
892
  description: ""
859
893
  example: ["L152", "L177"]
894
+ vymi_id:
895
+ type: number
896
+ description: ROPID VYMI event identifier.
897
+ example: 83
898
+ vymi_id_dtb:
899
+ type: number
900
+ description: ROPID VYMI database identifier.
901
+ example: 3
860
902
  expiration_date:
861
903
  type: string
904
+ nullable: true
862
905
  example: "2021-01-07T12:48:06+01:00"
863
906
  last_updated:
864
907
  type: string
865
908
  example: "2021-01-07T12:48:06+01:00"
909
+ last_updated_user:
910
+ type: string
911
+ description: ROPID VYMI user.
912
+ example: "user"
866
913
  "401":
867
914
  $ref: "#/components/responses/UnauthorizedError"
868
915
  "404":
@@ -882,9 +929,6 @@ components:
882
929
  title: GTFS Service
883
930
  type: object
884
931
  properties:
885
- created_time:
886
- type: string
887
- example: "2018-09-09 12:32:45"
888
932
  end_date:
889
933
  type: string
890
934
  example: "20190311"
@@ -927,7 +971,6 @@ components:
927
971
  type: string
928
972
  example: "20190226"
929
973
  required:
930
- - created_time
931
974
  - end_date
932
975
  - monday
933
976
  - tuesday
@@ -951,10 +994,6 @@ components:
951
994
  block_id:
952
995
  type: string
953
996
  example: ""
954
- created_time:
955
- type: string
956
- example: "2018-09-09 12:32:45"
957
- nullable: true
958
997
  direction_id:
959
998
  type: number
960
999
  format: int64
@@ -1002,6 +1041,7 @@ components:
1002
1041
  example: 0
1003
1042
  parent_station:
1004
1043
  type: string
1044
+ nullable: true
1005
1045
  example: "U118S1"
1006
1046
  platform_code:
1007
1047
  type: string
@@ -1039,9 +1079,6 @@ components:
1039
1079
  type: number
1040
1080
  format: int64
1041
1081
  nullable: true
1042
- created_time:
1043
- type: string
1044
- example: "2018-09-09 12:32:45"
1045
1082
  departure_time:
1046
1083
  type: string
1047
1084
  example: "13:12:35"
@@ -1050,17 +1087,15 @@ components:
1050
1087
  format: int64
1051
1088
  nullable: true
1052
1089
  drop_off_type:
1053
- type: number
1054
- format: int64
1055
- example: 0
1090
+ type: string
1091
+ example: "0"
1056
1092
  last_modify:
1057
1093
  type: string
1058
1094
  example: "2018-09-09 12:32:45"
1059
1095
  nullable: true
1060
1096
  pickup_type:
1061
- type: number
1062
- format: int64
1063
- example: 0
1097
+ type: string
1098
+ example: "0"
1064
1099
  shape_dist_traveled:
1065
1100
  type: number
1066
1101
  format: float
@@ -1082,7 +1117,6 @@ components:
1082
1117
  $ref: "#/components/schemas/GTFSStop"
1083
1118
  required:
1084
1119
  - arrival_time
1085
- - created_time
1086
1120
  - departure_time
1087
1121
  - drop_off_type
1088
1122
  - pickup_type
@@ -1118,10 +1152,6 @@ components:
1118
1152
  agency_id:
1119
1153
  type: string
1120
1154
  example: "99"
1121
- created_time:
1122
- type: string
1123
- example: "2018-09-09 12:32:45"
1124
- nullable: true
1125
1155
  is_night:
1126
1156
  type: boolean
1127
1157
  example: false
@@ -1397,10 +1427,10 @@ components:
1397
1427
  description: GTFS Static identifier of the last stop passed on the route of the trip
1398
1428
  example: "331"
1399
1429
  sequence:
1400
- type: string
1430
+ type: number
1401
1431
  nullable: true
1402
1432
  description: Sequence number of the last stop passed on the route of the trip
1403
- example: "11"
1433
+ example: 11
1404
1434
  arrival_time:
1405
1435
  type: string
1406
1436
  nullable: true
@@ -1472,7 +1502,6 @@ components:
1472
1502
  - bearing
1473
1503
  - is_canceled
1474
1504
  - origin_timestamp
1475
- - tracking
1476
1505
 
1477
1506
  PIDDepartureBoard:
1478
1507
  title: PID Departure Board
@@ -1492,7 +1521,18 @@ components:
1492
1521
  type: array
1493
1522
  description: List of active infotexts for selected stops.
1494
1523
  items:
1495
- $ref: "#/components/schemas/PIDDepartureBoardInfotext"
1524
+ allOf:
1525
+ - $ref: "#/components/schemas/PIDDepartureBoardInfotext"
1526
+ - type: object
1527
+ properties:
1528
+ related_stops:
1529
+ type: array
1530
+ description: ""
1531
+ items:
1532
+ type: string
1533
+ example: "U118S1"
1534
+ description: GTFS station IDs for which the infotexts apply.
1535
+
1496
1536
 
1497
1537
  PIDDepartureBoardDeparture:
1498
1538
  title: PID Departure Board Departure
@@ -1540,13 +1580,7 @@ components:
1540
1580
  type: string
1541
1581
  description: Type of display on board by the intended form of presentation (where applicable). Enumerating `inline` (to be presented along with departures, usually in a marquee), `general` (to be displayed full screen instead of departures), `general-alternate` (full screen alternates with departures).
1542
1582
  example: "inline"
1543
- related_stops:
1544
- type: array
1545
- description: Type of display on board by the intended form of presentation (where applicable). Enumerating `inline` (to be presented along with departures, usually in a marquee), `general` (to be displayed full screen instead of departures), `general-alternate` (full screen alternates with departures).
1546
- items:
1547
- type: string
1548
- example: "U118S1"
1549
- description: GTFS station IDs for which the infotexts apply.
1583
+
1550
1584
  required:
1551
1585
  - valid_from
1552
1586
  - valid_to
@@ -1560,6 +1594,7 @@ components:
1560
1594
  properties:
1561
1595
  direction:
1562
1596
  type: string
1597
+ nullable: true
1563
1598
  description: >-
1564
1599
  The equivalent of arrows that are printed on stop signs. Indicates the direction the vehicle will continue at stops where routes split up relative to the direction of motion of the vehicle. Valid values: `null` (do not display the arrow), `top`, `top-right`, `right`, `bottom-right`, `bottom`, `bottom-left`, `left`, `top-left`.
1565
1600
  example: "top-left"
@@ -1585,6 +1620,7 @@ components:
1585
1620
  example: false
1586
1621
  short_name:
1587
1622
  type: string
1623
+ nullable: true
1588
1624
  description: The number of a particular train, otherwise `null`.
1589
1625
  example: "Os 9327"
1590
1626
  required:
@@ -1602,10 +1638,12 @@ components:
1602
1638
  properties:
1603
1639
  name:
1604
1640
  type: string
1641
+ nullable: true
1605
1642
  description: Name of the last stop the vehicle reported from.
1606
1643
  example: "Prosecká"
1607
1644
  id:
1608
1645
  type: string
1646
+ nullable: true
1609
1647
  description: GTFS ID of the stop.
1610
1648
  example: "U754Z1P"
1611
1649
  required:
@@ -1618,6 +1656,7 @@ components:
1618
1656
  properties:
1619
1657
  level_id:
1620
1658
  type: string
1659
+ nullable: true
1621
1660
  description: Level of metro stops.
1622
1661
  example: "U118L2"
1623
1662
  location_type:
@@ -1643,8 +1682,7 @@ components:
1643
1682
  description: Longitude of the stop marker or the center of metro or train station platform.
1644
1683
  example: 50.4
1645
1684
  asw_id:
1646
- allOf:
1647
- - $ref: "#/components/schemas/ASWid"
1685
+ $ref: "#/components/schemas/ASWid"
1648
1686
  description: ASW ID of the stop.
1649
1687
  nullable: true
1650
1688
  stop_id:
@@ -1717,13 +1755,15 @@ components:
1717
1755
  description: True if information about trip's delay is available.
1718
1756
  example: false
1719
1757
  minutes:
1720
- type: string
1758
+ type: number
1759
+ nullable: true
1721
1760
  description: Delay rounded down to minutes.
1722
- example: "3"
1761
+ example: 3
1723
1762
  seconds:
1724
- type: string
1763
+ type: number
1764
+ nullable: true
1725
1765
  description: Delay in seconds.
1726
- example: "176"
1766
+ example: 176
1727
1767
  required:
1728
1768
  - is_available
1729
1769
 
@@ -1756,9 +1796,9 @@ components:
1756
1796
  description: Route designation used by PID.
1757
1797
  example: "140"
1758
1798
  type:
1759
- type: string
1799
+ type: number
1760
1800
  description: GTFS route type. `0` – tram, `1` – metro, `2` – train, `3` – bus, `4` – ferry, `7` – funicular, `11` – trolleybus
1761
- example: "3"
1801
+ example: 3
1762
1802
  is_night:
1763
1803
  type: boolean
1764
1804
  description: True if route is a designated night route.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "2.3.2-dev.660754464",
3
+ "version": "2.3.2-dev.661128816",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,10 @@
11
11
  "pretest": "golemio import-db-data",
12
12
  "test": "cross-env NODE_ENV='test' TS_NODE_COMPILER='ttypescript' TZ='UTC' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
13
13
  "test-debug": "run-s 'test --inspect-brk=9230'",
14
+ "apidocs": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' ts-node -r dotenv/config test/api-docs/index.ts",
15
+ "apidocs-test": "run-s 'apidocs input,output'",
16
+ "apidocs-test-input": "run-s 'apidocs input'",
17
+ "apidocs-test-output": "run-s 'apidocs output'",
14
18
  "code-coverage": "nyc run-s 'test -r source-map-support/register'",
15
19
  "generate-docs": "typedoc --out docs/typedoc src",
16
20
  "lint": "eslint --cache \"{src,test}/**/*.ts\""
@@ -25,6 +29,7 @@
25
29
  "url": "https://gitlab.com/operator-ict/golemio/code/modules/pid"
26
30
  },
27
31
  "devDependencies": {
32
+ "@apideck/portman": "^1.16.1",
28
33
  "@commitlint/cli": "^11.0.0",
29
34
  "@commitlint/config-conventional": "^11.0.0",
30
35
  "@golemio/cli": "1.3.2",
Binary file