@golemio/ndic 1.0.4 → 1.0.5-dev.418425980
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/CHANGELOG.md +11 -0
- package/db/example/sql_dump.sql +3 -3
- package/dist/integration-engine/models/RsdTmcPointsModel.js.map +1 -1
- package/dist/integration-engine/transformations/TrafficInfoTransformation.js +14 -6
- package/dist/integration-engine/transformations/TrafficInfoTransformation.js.map +1 -1
- package/dist/integration-engine/transformations/TrafficRestrictionsInterface.d.ts +5 -3
- package/dist/integration-engine/transformations/TrafficRestrictionsTransformation.js +14 -6
- package/dist/integration-engine/transformations/TrafficRestrictionsTransformation.js.map +1 -1
- package/dist/output-gateway/TrafficRouter.js +3 -3
- package/dist/output-gateway/TrafficRouter.js.map +1 -1
- package/dist/output-gateway/models/TrafficRestrictionsModel.d.ts +4 -4
- package/dist/output-gateway/models/TrafficRestrictionsModel.js +19 -17
- package/dist/output-gateway/models/TrafficRestrictionsModel.js.map +1 -1
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.d.ts +2 -3
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js +76 -61
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js.map +1 -1
- package/docs/openapi.yaml +221 -0
- package/package.json +75 -72
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.5] - 2021-11-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- FGeneralPublicComment parsing error ([ndic#4](https://gitlab.com/operator-ict/golemio/code/modules/ndic/-/issues/4))
|
|
10
|
+
|
|
11
|
+
- In output API do not show records that do not contain ALERTS data in the OUTPUT API ([d0092-jsdi-ndic#13](https://gitlab.com/operator-ict/golemio/projekty/rsd/d0092-jsdi-ndic/-/issues/13#note_741387901))
|
package/db/example/sql_dump.sql
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
INSERT INTO public.ndic_traffic_restrictions
|
|
4
4
|
(exchange, publication_time, publication_creator, situation_id, situation_version, situation_version_time, situation_confidentiality, situation_information_status, situation_urgency, situation_record_version, situation_record_type, situation_record_id, situation_record_creation_time, situation_record_version_time, probability_of_occurrence, "source", validity_status, validity_overall_start_time, validity_overall_end_time, impact_capacity_remaining, impact_number_of_lanes_restricted, impact_number_of_operational_lanes, impact_original_number_of_lanes, impact_traffic_constriction_type, impact_delays_type, impact_delay_time_value, cause, general_public_comment, group_of_locations_type, supplementary_positional_description, destination, alert_c_linear, linear_within_linear_element, global_network_linear, linear_extension, geom_gn_line, geom_openlr_line, situation_record_extension, number_of_obstructions, mobility_of_obstruction, compliance_option, applicable_for_traffic_direction, applicable_for_traffic_type, places_at_which_applicable, for_vehicles_with_characteristics_of, roadworks_duration, roadworks_scale, under_traffic, urgent_roadworks, mobility, subjects, maintenance_vehicles, abnormal_traffic_type, accident_type, group_of_vehicles_involved, car_park_identity, car_park_occupancy, number_of_vacant_parking_spaces, driving_condition_type, construction_work_type, disturbance_activity_type, environmental_obstruction_type, general_instruction_to_road_users_type, general_message_to_road_users, general_network_management_type, traffic_manually_directed_by, infrastructure_damage_type, road_maintenance_type, non_weather_related_road_condition_type, poor_environment_type, public_event_type, rerouting_management_type, rerouting_itinerary_description, signed_rerouting, entry, "exit", road_or_junction_number, road_or_carriageway_or_lane_management_type, minimum_car_occupancy, roadside_assistance_type, speed_management_type, temporary_speed_limit, vehicle_obstruction_type, obstructing_vehicle, winter_equipment_management_type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, geom_alert_c_line, alert_c_direction)
|
|
5
|
-
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:28:36.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'dc4e500c-6853-4232-a439-26889485f0bf', '10', '2021-06-21 09:26:35.000', 'noRestriction', 'real', 'urgent', '10', 'RoadOrCarriagewayOrLaneManagement', 'dc4e500c-6853-4232-a439-26889485f0bf_RoadOrCarriagewayOrLaneManagement', '2021-06-21 09:27:36.000', '2021-06-21 09:26:35.000', 'certain', '{"sourceIdentification":"SSU","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:45:00.000', '
|
|
5
|
+
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:28:36.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'dc4e500c-6853-4232-a439-26889485f0bf', '10', '2021-06-21 09:26:35.000', 'noRestriction', 'real', 'urgent', '10', 'RoadOrCarriagewayOrLaneManagement', 'dc4e500c-6853-4232-a439-26889485f0bf_RoadOrCarriagewayOrLaneManagement', '2021-06-21 09:27:36.000', '2021-06-21 09:26:35.000', 'certain', '{"sourceIdentification":"SSU","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:45:00.000', '2024-06-21 09:35:00.000', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, '{"comment":{"values":{"value":{"_":"D11 ve směru Hradec Králové, mezi 57.8 a 59.5 km, v termínu od 21. 06. 2021 07:45 do 21. 06. 2021 09:35, sekání trávy a údržba travních porostů, rozsah: zpevněná krajnice (1), počet průjezdných pruhů: 2","$":{"lang":"cs"}}}}}', 'Linear', '{"affectedCarriagewayAndLanes":{"carriageway":"mainCarriageway","lane":["hardShoulder","hardShoulder"]}}'::json, NULL, '{"$":{"xsi:type":"AlertCMethod2Linear"},"alertCLocationCountryCode":"CZ","alertCLocationTableNumber":"25","alertCLocationTableVersion":"8.0","alertCDirection":{"alertCDirectionCoded":"positive"},"alertCMethod2PrimaryPointLocation":{"alertCLocation":{"specificLocation":"25631"}},"alertCMethod2SecondaryPointLocation":{"alertCLocation":{"specificLocation":"25632"}}}'::json, '{"directionRelativeOnLinearSection":"aligned","linearElement":{"roadNumber":"D11"},"fromPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"57800"},"toPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"59500"}}'::json, '{"networkVersion":{"values":{"value":{"_":"20.12","$":{"lang":"cs"}}}},"linearGeometryType":"continuous","startPoint":{"sjtskPointCoordinates":{"sjtskX":"-673953","sjtskY":"-1047752"}},"endPoint":{"sjtskPointCoordinates":{"sjtskX":"-672281","sjtskY":"-1047729"}},"linearWithinLinearGNElement":[{"sectionId":"3667990","directionRelativeOnLinearSection":"aligned","orderOfSection":"0","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.609467455621352"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3718219","directionRelativeOnLinearSection":"aligned","orderOfSection":"1","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3718220","directionRelativeOnLinearSection":"aligned","orderOfSection":"2","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3668339","directionRelativeOnLinearSection":"aligned","orderOfSection":"3","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3718215","directionRelativeOnLinearSection":"aligned","orderOfSection":"4","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3718216","directionRelativeOnLinearSection":"aligned","orderOfSection":"5","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3668310","directionRelativeOnLinearSection":"aligned","orderOfSection":"6","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709873","directionRelativeOnLinearSection":"aligned","orderOfSection":"7","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709872","directionRelativeOnLinearSection":"aligned","orderOfSection":"8","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"770633","directionRelativeOnLinearSection":"aligned","orderOfSection":"9","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.333333333333481"}}]}'::json, '{"openlrExtendedLinear":{"firstDirection":{"openlrLocationReferencePoint":{"openlrCoordinate":{"latitude":"50.121507278665177","longitude":"15.286050548849159"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"96"},"openlrPathAttributes":{"openlrLowestFRCToNextLRPoint":"FRC0","openlrDistanceToNextLRPoint":"11146"}},"openlrLastLocationReferencePoint":{"openlrCoordinate":{"latitude":"50.130281776902336","longitude":"15.436223886461383"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"282"}},"openlrOffsets":{"openlrPositiveOffset":"7337","openlrNegativeOffset":"2109"}}}}'::json, NULL, NULL, NULL, NULL, NULL, 'mandatory', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'laneClosures', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-06-21 09:28:36.181', NULL, NULL, '2021-06-21 09:28:36.181', NULL, NULL, NULL);
|
|
6
6
|
INSERT INTO public.ndic_traffic_restrictions
|
|
7
7
|
(exchange, publication_time, publication_creator, situation_id, situation_version, situation_version_time, situation_confidentiality, situation_information_status, situation_urgency, situation_record_version, situation_record_type, situation_record_id, situation_record_creation_time, situation_record_version_time, probability_of_occurrence, "source", validity_status, validity_overall_start_time, validity_overall_end_time, impact_capacity_remaining, impact_number_of_lanes_restricted, impact_number_of_operational_lanes, impact_original_number_of_lanes, impact_traffic_constriction_type, impact_delays_type, impact_delay_time_value, cause, general_public_comment, group_of_locations_type, supplementary_positional_description, destination, alert_c_linear, linear_within_linear_element, global_network_linear, linear_extension, geom_gn_line, geom_openlr_line, situation_record_extension, number_of_obstructions, mobility_of_obstruction, compliance_option, applicable_for_traffic_direction, applicable_for_traffic_type, places_at_which_applicable, for_vehicles_with_characteristics_of, roadworks_duration, roadworks_scale, under_traffic, urgent_roadworks, mobility, subjects, maintenance_vehicles, abnormal_traffic_type, accident_type, group_of_vehicles_involved, car_park_identity, car_park_occupancy, number_of_vacant_parking_spaces, driving_condition_type, construction_work_type, disturbance_activity_type, environmental_obstruction_type, general_instruction_to_road_users_type, general_message_to_road_users, general_network_management_type, traffic_manually_directed_by, infrastructure_damage_type, road_maintenance_type, non_weather_related_road_condition_type, poor_environment_type, public_event_type, rerouting_management_type, rerouting_itinerary_description, signed_rerouting, entry, "exit", road_or_junction_number, road_or_carriageway_or_lane_management_type, minimum_car_occupancy, roadside_assistance_type, speed_management_type, temporary_speed_limit, vehicle_obstruction_type, obstructing_vehicle, winter_equipment_management_type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, geom_alert_c_line, alert_c_direction)
|
|
8
|
-
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'RoadOrCarriagewayOrLaneManagement', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_RoadOrCarriagewayOrLaneManagement', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"SSU","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '
|
|
8
|
+
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'RoadOrCarriagewayOrLaneManagement', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_RoadOrCarriagewayOrLaneManagement', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"SSU","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '2024-06-21 10:00:00.000', NULL, NULL, 2, 2, NULL, NULL, NULL, NULL, '{"comment":{"values":{"value":{"_":"D1 ve směru Praha, mezi 52 a 49 km, v termínu od 21. 06. 2021 07:15 do 21. 06. 2021 10:00, sekání trávy a údržba travních porostů, rozsah: zpevněná krajnice (1),přídatný pruh (2) - pro pomalá vozidla, připojovací, odbočovací, počet průjezdných pruhů: 2","$":{"lang":"cs"}}}}}', 'Linear', NULL, NULL, '{"$":{"xsi:type":"AlertCMethod2Linear"},"alertCLocationCountryCode":"CZ","alertCLocationTableNumber":"25","alertCLocationTableVersion":"8.0","alertCDirection":{"alertCDirectionCoded":"negative"},"alertCMethod2PrimaryPointLocation":{"alertCLocation":{"specificLocation":"1279"}},"alertCMethod2SecondaryPointLocation":{"alertCLocation":{"specificLocation":"25540"}}}'::json, '{"directionRelativeOnLinearSection":"opposite","linearElement":{"roadNumber":"D1"},"fromPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"52000"},"toPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"48999"}}'::json, '{"networkVersion":{"values":{"value":{"_":"20.12","$":{"lang":"cs"}}}},"linearGeometryType":"continuous","startPoint":{"sjtskPointCoordinates":{"sjtskX":"-705368","sjtskY":"-1085484"}},"endPoint":{"sjtskPointCoordinates":{"sjtskX":"-708220","sjtskY":"-1085241"}},"linearWithinLinearGNElement":[{"sectionId":"716168","directionRelativeOnLinearSection":"aligned","orderOfSection":"0","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.25"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731284","directionRelativeOnLinearSection":"aligned","orderOfSection":"1","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731283","directionRelativeOnLinearSection":"aligned","orderOfSection":"2","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3776298","directionRelativeOnLinearSection":"aligned","orderOfSection":"3","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3737940","directionRelativeOnLinearSection":"aligned","orderOfSection":"4","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709908","directionRelativeOnLinearSection":"aligned","orderOfSection":"5","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709909","directionRelativeOnLinearSection":"aligned","orderOfSection":"6","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663080","directionRelativeOnLinearSection":"aligned","orderOfSection":"7","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"1358023","directionRelativeOnLinearSection":"aligned","orderOfSection":"8","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663072","directionRelativeOnLinearSection":"aligned","orderOfSection":"9","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721196","directionRelativeOnLinearSection":"aligned","orderOfSection":"10","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721193","directionRelativeOnLinearSection":"aligned","orderOfSection":"11","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3513651","directionRelativeOnLinearSection":"aligned","orderOfSection":"12","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.801408450704281"}}]}'::json, '{"openlrExtendedLinear":{"firstDirection":{"openlrLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.751823499059107","longitude":"15.024250722599788"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"304"},"openlrPathAttributes":{"openlrLowestFRCToNextLRPoint":"FRC0","openlrDistanceToNextLRPoint":"3918"}},"openlrLastLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.754080738289225","longitude":"14.973070308369639"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"128"}},"openlrOffsets":{"openlrPositiveOffset":"606","openlrNegativeOffset":"321"}}}}'::json, NULL, NULL, NULL, NULL, NULL, 'mandatory', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'laneClosures', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, NULL);
|
|
9
9
|
INSERT INTO public.ndic_traffic_restrictions
|
|
10
10
|
(exchange, publication_time, publication_creator, situation_id, situation_version, situation_version_time, situation_confidentiality, situation_information_status, situation_urgency, situation_record_version, situation_record_type, situation_record_id, situation_record_creation_time, situation_record_version_time, probability_of_occurrence, "source", validity_status, validity_overall_start_time, validity_overall_end_time, impact_capacity_remaining, impact_number_of_lanes_restricted, impact_number_of_operational_lanes, impact_original_number_of_lanes, impact_traffic_constriction_type, impact_delays_type, impact_delay_time_value, cause, general_public_comment, group_of_locations_type, supplementary_positional_description, destination, alert_c_linear, linear_within_linear_element, global_network_linear, linear_extension, geom_gn_line, geom_openlr_line, situation_record_extension, number_of_obstructions, mobility_of_obstruction, compliance_option, applicable_for_traffic_direction, applicable_for_traffic_type, places_at_which_applicable, for_vehicles_with_characteristics_of, roadworks_duration, roadworks_scale, under_traffic, urgent_roadworks, mobility, subjects, maintenance_vehicles, abnormal_traffic_type, accident_type, group_of_vehicles_involved, car_park_identity, car_park_occupancy, number_of_vacant_parking_spaces, driving_condition_type, construction_work_type, disturbance_activity_type, environmental_obstruction_type, general_instruction_to_road_users_type, general_message_to_road_users, general_network_management_type, traffic_manually_directed_by, infrastructure_damage_type, road_maintenance_type, non_weather_related_road_condition_type, poor_environment_type, public_event_type, rerouting_management_type, rerouting_itinerary_description, signed_rerouting, entry, "exit", road_or_junction_number, road_or_carriageway_or_lane_management_type, minimum_car_occupancy, roadside_assistance_type, speed_management_type, temporary_speed_limit, vehicle_obstruction_type, obstructing_vehicle, winter_equipment_management_type, create_batch_id, created_at, created_by, update_batch_id, updated_at, updated_by, geom_alert_c_line, alert_c_direction)
|
|
11
|
-
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'MaintenanceWorks', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_MaintenanceWorks', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"RSD","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '2021-06-
|
|
11
|
+
VALUES('{"supplierIdentification":{"country":"cz","nationalIdentifier":"DIC"}}'::json, '2021-06-21 09:53:37.000', '{"country":"cz","nationalIdentifier":"NDIC"}'::json, 'd5321261-0cf1-47ae-a1d6-39cb8aab3874', '6', '2021-06-21 09:52:49.000', 'noRestriction', 'real', 'urgent', '6', 'MaintenanceWorks', 'd5321261-0cf1-47ae-a1d6-39cb8aab3874_MaintenanceWorks', '2021-06-21 09:53:27.000', '2021-06-21 09:52:49.000', 'certain', '{"sourceIdentification":"RSD","sourceName":{"values":{"value":{"$":{"lang":"cs"}}}}}', 'definedByValidityTimeSpec', '2021-06-21 07:15:00.000', '2021-06-24 09:53:27.000', NULL, 1, 2, 2, NULL, NULL, NULL, NULL, '{"comment":{"values":{"value":{"_":"D1, mezi km 52 a 49, ve směru Praha, práce na silnici, zpevněná krajnice uzavřena, Od 21.06.2021 07:15 Do 21.06.2021 17:00, Sečení trávy strojně., sekání trávy a údržba travních porostů, pracovní místo DM - Krátkodobé pohyblivé (mobilní), zdroj: ŘSD","$":{"lang":"cs"}}}}}', 'Linear', '{"affectedCarriagewayAndLanes":{"carriageway":"mainCarriageway","lane":["hardShoulder","hardShoulder"]}}'::json, NULL, '{"$":{"xsi:type":"AlertCMethod2Linear"},"alertCLocationCountryCode":"CZ","alertCLocationTableNumber":"25","alertCLocationTableVersion":"8.0","alertCDirection":{"alertCDirectionCoded":"negative"},"alertCMethod2PrimaryPointLocation":{"alertCLocation":{"specificLocation":"1279"}},"alertCMethod2SecondaryPointLocation":{"alertCLocation":{"specificLocation":"25540"}}}'::json, '{"directionRelativeOnLinearSection":"opposite","linearElement":{"roadNumber":"D1"},"fromPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"52000"},"toPoint":{"$":{"xsi:type":"DistanceFromLinearElementStart"},"distanceAlong":"48999"}}'::json, '{"networkVersion":{"values":{"value":{"_":"20.12","$":{"lang":"cs"}}}},"linearGeometryType":"continuous","startPoint":{"sjtskPointCoordinates":{"sjtskX":"-705367.665475001","sjtskY":"-1085484.320675"}},"endPoint":{"sjtskPointCoordinates":{"sjtskX":"-708220.292120583","sjtskY":"-1085240.94330743"}},"linearWithinLinearGNElement":[{"sectionId":"716168","directionRelativeOnLinearSection":"aligned","orderOfSection":"0","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.25"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731284","directionRelativeOnLinearSection":"aligned","orderOfSection":"1","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3731283","directionRelativeOnLinearSection":"aligned","orderOfSection":"2","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3776298","directionRelativeOnLinearSection":"aligned","orderOfSection":"3","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3737940","directionRelativeOnLinearSection":"aligned","orderOfSection":"4","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709908","directionRelativeOnLinearSection":"aligned","orderOfSection":"5","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3709909","directionRelativeOnLinearSection":"aligned","orderOfSection":"6","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663080","directionRelativeOnLinearSection":"aligned","orderOfSection":"7","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"1358023","directionRelativeOnLinearSection":"aligned","orderOfSection":"8","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3663072","directionRelativeOnLinearSection":"aligned","orderOfSection":"9","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721196","directionRelativeOnLinearSection":"aligned","orderOfSection":"10","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3721193","directionRelativeOnLinearSection":"aligned","orderOfSection":"11","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"1"}},{"sectionId":"3513651","directionRelativeOnLinearSection":"aligned","orderOfSection":"12","fromPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0"},"toPoint":{"$":{"xsi:type":"PercentageDistanceAlongLinearElement"},"percentageDistanceAlong":"0.801408450704281"}}]}'::json, '{"openlrExtendedLinear":{"firstDirection":{"openlrLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.751823499059107","longitude":"15.024250722599788"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"304"},"openlrPathAttributes":{"openlrLowestFRCToNextLRPoint":"FRC0","openlrDistanceToNextLRPoint":"3918"}},"openlrLastLocationReferencePoint":{"openlrCoordinate":{"latitude":"49.754080738289225","longitude":"14.973070308369639"},"openlrLineAttributes":{"openlrFunctionalRoadClass":"FRC0","openlrFormOfWay":"motorway","openlrBearing":"128"}},"openlrOffsets":{"openlrPositiveOffset":"606","openlrNegativeOffset":"321"}}}}'::json, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'roadworks', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, '2021-06-21 09:53:37.380', NULL, NULL, NULL);
|
|
12
12
|
|
|
13
13
|
-- TO DO Add data for rsd_tmc_osm_mapping
|
|
14
14
|
INSERT INTO public.rsd_tmc_osm_mapping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RsdTmcPointsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/models/RsdTmcPointsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RsdTmcPointsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/models/RsdTmcPointsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qEAA0E;AAC1E,mDAA4B;AAE5B,MAAa,iBAAkB,SAAQ,uBAAc;IACjD;QACI,KAAK,CAAC,WAAI,CAAC,cAAc,CAAC,IAAI,GAAG,OAAO,EAAE,WAAI,CAAC,cAAc,CAAC,WAAW,EAAE,WAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;QAG9H;;;WAGG;QAEI,WAAM,GAAG,CAAO,QAAgB,EAAgB,EAAE;YACrD,IAAI;gBACA,MAAM,kBAAkB,GAAU,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBAChE,GAAG,EAAE,IAAI;oBACT,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;iBAC3B,CAAC,CAAC;gBAEH,OAAO,kBAAkB,CAAC;aAC7B;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,4BAAW,CAAC,gBAAgB,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAChF;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,CAAO,QAAgB,EAAuB,EAAE;YAC5D,MAAM,SAAS,GAAU,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACrD,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,CAAA,CAAC;IAvBF,CAAC;CAwBJ;AA3BD,8CA2BC"}
|
|
@@ -50,13 +50,21 @@ class TrafficInfoTransformation extends integration_engine_1.BaseTransformation
|
|
|
50
50
|
}
|
|
51
51
|
return result;
|
|
52
52
|
});
|
|
53
|
-
this.parseGeneralPublicComment = (
|
|
54
|
-
if (!
|
|
53
|
+
this.parseGeneralPublicComment = (generalPublicComment) => {
|
|
54
|
+
if (!generalPublicComment)
|
|
55
55
|
return undefined;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
const generalPublicCommentArr = !Array.isArray(generalPublicComment) ? [generalPublicComment] : generalPublicComment;
|
|
57
|
+
let resultCommentsString = "";
|
|
58
|
+
for (const generalPublicCommentObj of generalPublicCommentArr) {
|
|
59
|
+
const values = !Array.isArray(generalPublicCommentObj.comment.values)
|
|
60
|
+
? [generalPublicCommentObj.comment.values]
|
|
61
|
+
: generalPublicCommentObj.comment.values;
|
|
62
|
+
if (resultCommentsString.length) {
|
|
63
|
+
resultCommentsString += "|";
|
|
64
|
+
}
|
|
65
|
+
resultCommentsString += values.map((element) => element.value._).join("|");
|
|
66
|
+
}
|
|
67
|
+
return resultCommentsString;
|
|
60
68
|
};
|
|
61
69
|
this.parseAlertCDirection = (alertCDirectionObj) => {
|
|
62
70
|
return alertCDirectionObj === null || alertCDirectionObj === void 0 ? void 0 : alertCDirectionObj.alertCDirection.alertCDirectionCoded;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficInfoTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TrafficInfoTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA4F;AAC5F,mDAA4B;AAa5B,MAAa,yBAA0B,SAAQ,uCAAkB;IAG7D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,IAAkB,EAAgC,EAAE;YAC1E,MAAM,gBAAgB,GAAG;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;gBACzD,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,kBAAkB;aAClE,CAAC;YAEF,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC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A0C,CAAC,CAAC;gBACxG,MAAM,CAAC,IAAI,iCACJ,aAAa,GACb,qBAAqB,EAC1B,CAAC;aACN;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAA,CAAC;QAEM,8BAAyB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"TrafficInfoTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TrafficInfoTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA4F;AAC5F,mDAA4B;AAa5B,MAAa,yBAA0B,SAAQ,uCAAkB;IAG7D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,IAAkB,EAAgC,EAAE;YAC1E,MAAM,gBAAgB,GAAG;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;gBACzD,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,kBAAkB;aAClE,CAAC;YAEF,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;gBAClE,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;gBACrC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;YAExC,MAAM,MAAM,GAAwB,EAAE,CAAC;YACvC,KAAK,MAAM,SAAS,IAAI,YAAY,EAAE;gBAClC,MAAM,oBAAoB,GAAsB,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;gBACvF,MAAM,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,iCAAM,gBAAgB,GAAK,EAAE,EAAG,CAAC,CAAC,CAAC;aACtF;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,CAAO,SAAqB,EAA8B,EAAE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
endTime: string;
|
|
109
109
|
type: string;
|
|
110
110
|
version: string;
|
|
111
|
-
generalPublicComment:
|
|
112
|
-
|
|
111
|
+
generalPublicComment: {
|
|
112
|
+
cs: string;
|
|
113
|
+
} | null;
|
|
114
|
+
sourceName?: string;
|
|
113
115
|
impact: Record<string, any>;
|
|
114
116
|
alertCLinear: {
|
|
115
117
|
type: string;
|
|
@@ -146,8 +148,8 @@ export interface IOutputApiRestrictions {
|
|
|
146
148
|
country: string;
|
|
147
149
|
nationalIdentifier: string;
|
|
148
150
|
};
|
|
151
|
+
situation: IOutputApiSituation[];
|
|
149
152
|
};
|
|
150
|
-
situation: IOutputApiSituation[];
|
|
151
153
|
}
|
|
152
154
|
interface IGroupOfLocations {
|
|
153
155
|
$: {
|
|
@@ -50,13 +50,21 @@ class TrafficRestrictionsTransformation extends integration_engine_1.BaseTransfo
|
|
|
50
50
|
}
|
|
51
51
|
return result;
|
|
52
52
|
});
|
|
53
|
-
this.parseGeneralPublicComment = (
|
|
54
|
-
if (!
|
|
53
|
+
this.parseGeneralPublicComment = (generalPublicComment) => {
|
|
54
|
+
if (!generalPublicComment)
|
|
55
55
|
return undefined;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
const generalPublicCommentArr = !Array.isArray(generalPublicComment) ? [generalPublicComment] : generalPublicComment;
|
|
57
|
+
let resultCommentsString = "";
|
|
58
|
+
for (const generalPublicCommentObj of generalPublicCommentArr) {
|
|
59
|
+
const values = !Array.isArray(generalPublicCommentObj.comment.values)
|
|
60
|
+
? [generalPublicCommentObj.comment.values]
|
|
61
|
+
: generalPublicCommentObj.comment.values;
|
|
62
|
+
if (resultCommentsString.length) {
|
|
63
|
+
resultCommentsString += "|";
|
|
64
|
+
}
|
|
65
|
+
resultCommentsString += values.map((element) => element.value._).join("|");
|
|
66
|
+
}
|
|
67
|
+
return resultCommentsString;
|
|
60
68
|
};
|
|
61
69
|
this.parseAlertCDirection = (alertCDirectionObj) => {
|
|
62
70
|
return alertCDirectionObj === null || alertCDirectionObj === void 0 ? void 0 : alertCDirectionObj.alertCDirection.alertCDirectionCoded;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA4F;AAC5F,mDAA4B;AAa5B,MAAa,iCAAkC,SAAQ,uCAAkB;IAGrE;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,IAA0B,EAAwC,EAAE;YAC1F,MAAM,gBAAgB,GAAG;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;gBACzD,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,kBAAkB;aAClE,CAAC;YAEF,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;gBAClE,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;gBACrC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;YAExC,MAAM,MAAM,GAAgC,EAAE,CAAC;YAC/C,KAAK,MAAM,SAAS,IAAI,YAAY,EAAE;gBAClC,MAAM,oBAAoB,GAAsB,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;gBACvF,MAAM,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,iCAAM,gBAAgB,GAAK,EAAE,EAAG,CAAC,CAAC,CAAC;aACtF;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,CAAO,SAAqB,EAA8B,EAAE;YACrF,MAAM,aAAa,GAAG;gBAClB,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE;gBAC5B,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO;gBACtC,sBAAsB,EAAE,SAAS,CAAC,oBAAoB;gBACtD,yBAAyB,EAAE,SAAS,CAAC,iBAAiB,CAAC,eAAe;gBACtE,4BAA4B,EAAE,SAAS,CAAC,iBAAiB,CAAC,iBAAiB;gBAC3E,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAC,OAAO;aACzD,CAAC;YAEF,MAAM,kBAAkB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC;gBAChE,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;gBAC7B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;YAEhC,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,KAAK,MAAM,eAAe,IAAI,kBAAkB,EAAE;gBAC9C,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAA0C,CAAC,CAAC;gBACxG,MAAM,CAAC,IAAI,iCACJ,aAAa,GACb,qBAAqB,EAC1B,CAAC;aACN;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAA,CAAC;QAEM,8BAAyB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"TrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA4F;AAC5F,mDAA4B;AAa5B,MAAa,iCAAkC,SAAQ,uCAAkB;IAGrE;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,IAA0B,EAAwC,EAAE;YAC1F,MAAM,gBAAgB,GAAG;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;gBACzD,mBAAmB,EAAE,IAAI,CAAC,kBAAkB,CAAC,kBAA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,eAAe,CAAC,yBAAyB;gBACxE,4BAA4B,EAAE,eAAe,CAAC,yBAAyB;gBACvE,yBAAyB,EAAE,MAAA,eAAe,CAAC,uBAAuB,0CAAE,QAAQ,EAAE;gBAC9E,+BAA+B,EAAE,eAAe,CAAC,6BAA6B;gBAC9E,gBAAgB,EAAE,eAAe,CAAC,eAAe;gBACjD,KAAK,EAAE,eAAe,CAAC,KAAK;gBAC5B,IAAI,EAAE,eAAe,CAAC,IAAI;gBAC1B,uBAAuB,EAAE,eAAe,CAAC,oBAAoB;gBAC7D,qBAAqB,EAAE,eAAe,CAAC,mBAAmB;gBAC1D,wBAAwB,EAAE,eAAe,CAAC,sBAAsB;gBAChE,qBAAqB,EAAE,eAAe,CAAC,mBAAmB;gBAC1D,qBAAqB,EAAE,eAAe,CAAC,mBAAmB;gBAC1D,gCAAgC,EAAE,eAAe,CAAC,6BAA6B;aAClF,CAAC;QACN,CAAC,CAAA,CAAC;QA1ME,IAAI,CAAC,IAAI,GAAG,WAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;IAC/C,CAAC;CA0MJ;AAhND,8EAgNC"}
|
|
@@ -25,8 +25,8 @@ class TrafficRouter extends BaseRouter_1.BaseRouter {
|
|
|
25
25
|
const dataFromDb = yield this.trafficRestrictionsModel.GetAll({
|
|
26
26
|
limit: req.query.limit ? +req.query.limit : undefined,
|
|
27
27
|
offset: req.query.offset ? +req.query.offset : undefined,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
moment: req.query.moment,
|
|
29
|
+
situationRecordType: req.query.situationRecordType,
|
|
30
30
|
});
|
|
31
31
|
if (!(dataFromDb === null || dataFromDb === void 0 ? void 0 : dataFromDb.length)) {
|
|
32
32
|
throw new golemio_errors_1.CustomError("No data found", true, "TrafficRouter", 404);
|
|
@@ -40,7 +40,7 @@ class TrafficRouter extends BaseRouter_1.BaseRouter {
|
|
|
40
40
|
});
|
|
41
41
|
this.trafficRestrictionsModel = new models_1.TrafficRestrictionsModel();
|
|
42
42
|
this.outputTrafficRestrictionsTransformation = new OutputTrafficRestrictionsTransformation_1.OutputTrafficRestrictionsTransformation();
|
|
43
|
-
this.router.get("/restrictions", [express_validator_1.query("
|
|
43
|
+
this.router.get("/restrictions", [express_validator_1.query("moment").optional().isISO8601(), express_validator_1.query("situationRecordType").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, Validation_1.paginationLimitMiddleware("TrafficRouter"), redis_1.useCacheMiddleware(), this.GetTrafficRestrictions);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.TrafficRouter = TrafficRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAoD;AACpD,uHAAsH;AAEtH,MAAa,aAAc,SAAQ,uBAAU;IAIzC;QACI,KAAK,EAAE,CAAC;QAeL,2BAAsB,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACtF,IAAI;gBACA,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC;oBAC1D,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;oBACrD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;oBACxD,
|
|
1
|
+
{"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACj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AAe,EACf,CAAC,yBAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,yBAAK,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAC5F,uBAAU,EACV,wBAAW,EACX,sCAAyB,CAAC,eAAe,CAAC,EAC1C,0BAAkB,EAAE,EACpB,IAAI,CAAC,sBAAsB,CAC9B,CAAC;IACN,CAAC;CAmBJ;AArCD,sCAqCC;AAED,MAAM,aAAa,GAAW,IAAI,aAAa,EAAE,CAAC,MAAM,CAAC;AAEhD,sCAAa"}
|
|
@@ -5,15 +5,15 @@ export declare class TrafficRestrictionsModel extends SequelizeModel {
|
|
|
5
5
|
* @param {object} [options] Options object with params
|
|
6
6
|
* @param {number} [options.limit] Limit
|
|
7
7
|
* @param {number} [options.offset] Offset
|
|
8
|
-
* @param {string} [options.
|
|
9
|
-
* @param {string} [options.
|
|
8
|
+
* @param {string} [options.moment] ISO date
|
|
9
|
+
* @param {string} [options.situationRecordType] Situation Record Type
|
|
10
10
|
* @returns Array of the retrieved records
|
|
11
11
|
*/
|
|
12
12
|
GetAll: (options?: {
|
|
13
13
|
limit?: number;
|
|
14
14
|
offset?: number;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
moment?: string;
|
|
16
|
+
situationRecordType?: string;
|
|
17
17
|
}) => Promise<any>;
|
|
18
18
|
GetOne: (id: number) => Promise<object | null>;
|
|
19
19
|
}
|
|
@@ -24,30 +24,32 @@ class TrafficRestrictionsModel extends models_1.SequelizeModel {
|
|
|
24
24
|
* @param {object} [options] Options object with params
|
|
25
25
|
* @param {number} [options.limit] Limit
|
|
26
26
|
* @param {number} [options.offset] Offset
|
|
27
|
-
* @param {string} [options.
|
|
28
|
-
* @param {string} [options.
|
|
27
|
+
* @param {string} [options.moment] ISO date
|
|
28
|
+
* @param {string} [options.situationRecordType] Situation Record Type
|
|
29
29
|
* @returns Array of the retrieved records
|
|
30
30
|
*/
|
|
31
31
|
this.GetAll = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const { limit, offset,
|
|
32
|
+
const { limit, offset, moment, situationRecordType } = options;
|
|
33
33
|
try {
|
|
34
34
|
const and = sequelize_1.default.Op.and;
|
|
35
35
|
const where = {
|
|
36
36
|
[and]: [],
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
let reqMoment = moment ? moment : Date.now();
|
|
39
|
+
// (reqMoment < endTime && reqMoment > startTime)
|
|
40
|
+
where[and].push({
|
|
41
|
+
validity_overall_end_time: {
|
|
42
|
+
[sequelize_1.default.Op.gte]: reqMoment,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
where[and].push({
|
|
46
|
+
validity_overall_start_time: {
|
|
47
|
+
[sequelize_1.default.Op.lte]: reqMoment,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
if (situationRecordType) {
|
|
47
51
|
where[and].push({
|
|
48
|
-
|
|
49
|
-
[sequelize_1.default.Op.lte]: to,
|
|
50
|
-
},
|
|
52
|
+
situation_record_type: situationRecordType,
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
const trafficRestrictionsFromDB = yield this.sequelizeModel.findAll({
|
|
@@ -59,11 +61,11 @@ class TrafficRestrictionsModel extends models_1.SequelizeModel {
|
|
|
59
61
|
return trafficRestrictionsFromDB;
|
|
60
62
|
}
|
|
61
63
|
catch (err) {
|
|
62
|
-
throw new golemio_errors_1.CustomError("Database error", true, "
|
|
64
|
+
throw new golemio_errors_1.CustomError("Database error", true, "TrafficRestrictionsModel", 500, err);
|
|
63
65
|
}
|
|
64
66
|
});
|
|
65
67
|
this.GetOne = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
|
|
68
|
+
throw new golemio_errors_1.CustomError("Not implemented", true, "TrafficRestrictionsModel");
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficRestrictionsModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/TrafficRestrictionsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,0DAAkC;AAElC,MAAa,wBAAyB,SAAQ,uBAAc;IACxD;QACI,KAAK,CACD,YAAI,CAAC,oBAAoB,CAAC,IAAI,EAC9B,YAAI,CAAC,oBAAoB,CAAC,WAAW,EACrC,YAAI,CAAC,oBAAoB,CAAC,yBAAyB,CACtD,CAAC;QAGN;;;;;;;WAOG;QAEI,WAAM,GAAG,CACZ,UAKI,EAAE,EACM,EAAE;YACd,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"TrafficRestrictionsModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/TrafficRestrictionsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,0DAAkC;AAElC,MAAa,wBAAyB,SAAQ,uBAAc;IACxD;QACI,KAAK,CACD,YAAI,CAAC,oBAAoB,CAAC,IAAI,EAC9B,YAAI,CAAC,oBAAoB,CAAC,WAAW,EACrC,YAAI,CAAC,oBAAoB,CAAC,yBAAyB,CACtD,CAAC;QAGN;;;;;;;WAOG;QAEI,WAAM,GAAG,CACZ,UAKI,EAAE,EACM,EAAE;YACd,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;YAC/D,IAAI;gBACA,MAAM,GAAG,GAAG,mBAAS,CAAC,EAAE,CAAC,GAAG,CAAC;gBAC7B,MAAM,KAAK,GAAQ;oBACf,CAAC,GAAG,CAAC,EAAE,EAAE;iBACZ,CAAC;gBAEF,IAAI,SA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-
transform: (data: ITrafficRestrictionsModel[]) => Promise<IOutputApiRestrictions
|
|
7
|
+
transform: (data: ITrafficRestrictionsModel[]) => Promise<IOutputApiRestrictions>;
|
|
8
8
|
private transformSituationsArr;
|
|
9
9
|
private transformRecordsArr;
|
|
10
|
-
private sourceNameParsing;
|
|
11
10
|
private generalPublicCommentParsing;
|
|
11
|
+
private sourceNameParsing;
|
|
12
12
|
private groupByOneProperty;
|
|
13
|
-
private groupByProperties;
|
|
14
13
|
}
|
|
@@ -15,24 +15,19 @@ const models_1 = require("../models");
|
|
|
15
15
|
class OutputTrafficRestrictionsTransformation {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.transform = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
publicationTime: onePublicationArr[0].publication_time,
|
|
28
|
-
publicationCreator: {
|
|
29
|
-
country: onePublicationArr[0].publication_creator.country,
|
|
30
|
-
nationalIdentifier: onePublicationArr[0].publication_creator.nationalIdentifier,
|
|
31
|
-
},
|
|
18
|
+
const result = {
|
|
19
|
+
modelBaseVersion: "2",
|
|
20
|
+
situationPublicationLight: {
|
|
21
|
+
lang: "cs",
|
|
22
|
+
publicationTime: data.reduce((acc, curr) => (acc.publication_time > curr.publication_time ? acc : curr))
|
|
23
|
+
.publication_time,
|
|
24
|
+
publicationCreator: {
|
|
25
|
+
country: "cz",
|
|
26
|
+
nationalIdentifier: "NDIC",
|
|
32
27
|
},
|
|
33
|
-
situation: yield this.transformSituationsArr(
|
|
34
|
-
}
|
|
35
|
-
}
|
|
28
|
+
situation: yield this.transformSituationsArr(data),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
36
31
|
return result;
|
|
37
32
|
});
|
|
38
33
|
this.groupByOneProperty = (list, getKey) => list.reduce((previous, currentItem) => {
|
|
@@ -42,39 +37,47 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
42
37
|
previous[group].push(currentItem);
|
|
43
38
|
return previous;
|
|
44
39
|
}, {});
|
|
45
|
-
this.groupByProperties = (onePublArr, f) => {
|
|
46
|
-
let groups = {};
|
|
47
|
-
onePublArr.forEach((o) => {
|
|
48
|
-
let group = JSON.stringify(f(o));
|
|
49
|
-
groups[group] = groups[group] || [];
|
|
50
|
-
groups[group].push(o);
|
|
51
|
-
});
|
|
52
|
-
return Object.keys(groups).map((group) => {
|
|
53
|
-
return groups[group];
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
40
|
this.name = _sch_1.Ndic.traffic_restrictions.name;
|
|
57
41
|
this.rsdTmcOsmMappingModel = new models_1.RsdTmcOsmMappingModel();
|
|
58
42
|
this.rsdTmcOsmMappingModel.sequelizeModel.removeAttribute("id");
|
|
59
43
|
}
|
|
60
|
-
transformSituationsArr(
|
|
44
|
+
transformSituationsArr(dataFromDbArr) {
|
|
61
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
46
|
const resultSituationsArr = [];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
// group by situation_id
|
|
48
|
+
const recorsdsBySituationIdObj = this.groupByOneProperty(dataFromDbArr, (i) => i.situation_id);
|
|
49
|
+
// Select only records with the latest version
|
|
50
|
+
// situation_record_version = situation_version
|
|
51
|
+
for (const key in recorsdsBySituationIdObj) {
|
|
52
|
+
let recordsArr = [];
|
|
53
|
+
for (const record of recorsdsBySituationIdObj[key]) {
|
|
54
|
+
if (!recordsArr.length) {
|
|
55
|
+
recordsArr.push(record);
|
|
56
|
+
}
|
|
57
|
+
else if (record.situation_record_version == recordsArr[0].situation_record_version) {
|
|
58
|
+
recordsArr.push(record);
|
|
59
|
+
}
|
|
60
|
+
else if (record.situation_record_version > recordsArr[0].situation_record_version) {
|
|
61
|
+
recordsArr = [];
|
|
62
|
+
recordsArr.push(record);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const situationRecord = yield this.transformRecordsArr(recordsArr);
|
|
66
|
+
// if situation has no records => do not show the situation
|
|
67
|
+
if (!situationRecord.length) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
67
70
|
resultSituationsArr.push({
|
|
68
|
-
id:
|
|
69
|
-
version: +
|
|
70
|
-
situationRecord
|
|
71
|
+
id: key,
|
|
72
|
+
version: +recordsArr[0].situation_version,
|
|
73
|
+
situationRecord,
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
76
|
return resultSituationsArr;
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
79
|
transformRecordsArr(oneSituationArr) {
|
|
77
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
82
|
const resultRecordsArr = [];
|
|
80
83
|
for (const record of oneSituationArr) {
|
|
@@ -86,6 +89,10 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
86
89
|
ltEnd,
|
|
87
90
|
ltDirection,
|
|
88
91
|
};
|
|
92
|
+
// Do not show records with empty alert_c_linear
|
|
93
|
+
if (!((_d = record.alert_c_linear) === null || _d === void 0 ? void 0 : _d.$["xsi:type"])) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
89
96
|
resultRecordsArr.push({
|
|
90
97
|
situationRecordCreationTime: record.situation_record_creation_time,
|
|
91
98
|
situationRecordVersionTime: record.situation_record_version_time,
|
|
@@ -105,12 +112,12 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
105
112
|
trafficConstrictionType: record.impact_traffic_constriction_type,
|
|
106
113
|
},
|
|
107
114
|
alertCLinear: {
|
|
108
|
-
type: ((
|
|
109
|
-
alertCLocationCountryCode: ((
|
|
110
|
-
alertCLocationTableNumber: ((
|
|
111
|
-
alertCLocationTableVersion: ((
|
|
115
|
+
type: ((_e = record.alert_c_linear) === null || _e === void 0 ? void 0 : _e.$["xsi:type"]) || null,
|
|
116
|
+
alertCLocationCountryCode: ((_f = record.alert_c_linear) === null || _f === void 0 ? void 0 : _f.alertCLocationCountryCode) || null,
|
|
117
|
+
alertCLocationTableNumber: ((_g = record.alert_c_linear) === null || _g === void 0 ? void 0 : _g.alertCLocationTableNumber) || null,
|
|
118
|
+
alertCLocationTableVersion: ((_h = record.alert_c_linear) === null || _h === void 0 ? void 0 : _h.alertCLocationTableVersion) || null,
|
|
112
119
|
alertCDirection: {
|
|
113
|
-
alertCDirectionCoded: ((
|
|
120
|
+
alertCDirectionCoded: ((_j = record.alert_c_linear) === null || _j === void 0 ? void 0 : _j.alertCDirection.alertCDirectionCoded) || null,
|
|
114
121
|
},
|
|
115
122
|
alertCMethod2PrimaryPointLocation: {
|
|
116
123
|
alertCLocation: {
|
|
@@ -129,32 +136,40 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
129
136
|
return resultRecordsArr;
|
|
130
137
|
});
|
|
131
138
|
}
|
|
132
|
-
sourceNameParsing(source) {
|
|
133
|
-
if (!source)
|
|
134
|
-
return null;
|
|
135
|
-
try {
|
|
136
|
-
const sourceObj = JSON.parse(source);
|
|
137
|
-
return sourceObj.sourceIdentification;
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
139
|
generalPublicCommentParsing(comment) {
|
|
144
140
|
if (!comment)
|
|
145
141
|
return null;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
142
|
+
if (comment[0] === "{") {
|
|
143
|
+
try {
|
|
144
|
+
const commentsStrArr = comment.split("|");
|
|
145
|
+
const resultObj = {};
|
|
146
|
+
for (const oneLanguageCommentStr of commentsStrArr) {
|
|
147
|
+
const commentObj = JSON.parse(oneLanguageCommentStr);
|
|
148
|
+
resultObj[commentObj.comment.values.value["$"].lang] = commentObj.comment.values.value["_"];
|
|
149
|
+
}
|
|
150
|
+
return resultObj;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
return null;
|
|
152
154
|
}
|
|
153
|
-
return resultObj;
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
+
return {
|
|
157
|
+
cs: comment,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
sourceNameParsing(source) {
|
|
161
|
+
if (!source)
|
|
156
162
|
return null;
|
|
163
|
+
if (source[0] === "{") {
|
|
164
|
+
try {
|
|
165
|
+
const sourceObj = JSON.parse(source);
|
|
166
|
+
return sourceObj.sourceIdentification;
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
157
171
|
}
|
|
172
|
+
return source;
|
|
158
173
|
}
|
|
159
174
|
}
|
|
160
175
|
exports.OutputTrafficRestrictionsTransformation = OutputTrafficRestrictionsTransformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputTrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputTrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA4B;AAQ5B,sCAAmD;AAEnD,MAAa,uCAAuC;IAIhD;QAMO,cAAS,GAAG,CAAO,IAAiC,EAAE,EAAE;YAC3D,
|
|
1
|
+
{"version":3,"file":"OutputTrafficRestrictionsTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputTrafficRestrictionsTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAA4B;AAQ5B,sCAAmD;AAEnD,MAAa,uCAAuC;IAIhD;QAMO,cAAS,GAAG,CAAO,IAAiC,EAAE,EAAE;YAC3D,MAAM,MAAM,GAA2B;gBACnC,gBAAgB,EAAE,GAAG;gBACrB,yBAAyB,EAAE;oBACvB,IAAI,EAAE,IAAI;oBACV,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAA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iB,CAAC,MAA0B;QAChD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACnB,IAAI;gBACA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACrC,OAAO,SAAS,CAAC,oBAAoB,CAAC;aACzC;YAAC,OAAO,KAAK,EAAE;gBACZ,OAAO,IAAI,CAAC;aACf;SACJ;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CASJ;AAxKD,0FAwKC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
title: 🚧 NDIC
|
|
4
|
+
description: >-
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
contact:
|
|
7
|
+
name: Golemio Prague Data Plaform
|
|
8
|
+
email: golemio@operatorict.cz
|
|
9
|
+
url: https://golemio.cz
|
|
10
|
+
|
|
11
|
+
servers:
|
|
12
|
+
- url: https://rabin.golemio.cz/v2
|
|
13
|
+
description: Test (development) server
|
|
14
|
+
- url: https://api.golemio.cz/v2
|
|
15
|
+
description: Main (production) server
|
|
16
|
+
|
|
17
|
+
tags:
|
|
18
|
+
- name: 🚧 Traffic Restrictions
|
|
19
|
+
description: >-
|
|
20
|
+
💡 NDIC Traffic Restrictions API for Intermodal Route Planner
|
|
21
|
+
|
|
22
|
+
paths:
|
|
23
|
+
/traffic/restrictions:
|
|
24
|
+
get:
|
|
25
|
+
summary: GET All Traffic Restrictions for a specific moment
|
|
26
|
+
description: ""
|
|
27
|
+
tags:
|
|
28
|
+
- 🚧 Traffic Restrictions
|
|
29
|
+
operationId: getTrafficRestrictions
|
|
30
|
+
parameters:
|
|
31
|
+
- name: moment
|
|
32
|
+
in: query
|
|
33
|
+
description: >-
|
|
34
|
+
The traffic situation moment
|
|
35
|
+
required: false
|
|
36
|
+
schema:
|
|
37
|
+
type: string
|
|
38
|
+
example: 2021-06-21 10:00
|
|
39
|
+
- name: situationRecordType
|
|
40
|
+
in: query
|
|
41
|
+
description: >-
|
|
42
|
+
Situation Record Type
|
|
43
|
+
required: false
|
|
44
|
+
schema:
|
|
45
|
+
type: string
|
|
46
|
+
example: "MaintenanceWorks"
|
|
47
|
+
- name: limit
|
|
48
|
+
in: query
|
|
49
|
+
description: >-
|
|
50
|
+
Limits number of retrieved items. The maximum is 10000 (default
|
|
51
|
+
value)
|
|
52
|
+
required: false
|
|
53
|
+
schema:
|
|
54
|
+
type: integer
|
|
55
|
+
format: int64
|
|
56
|
+
example: 10
|
|
57
|
+
responses:
|
|
58
|
+
"200":
|
|
59
|
+
description: successful operation
|
|
60
|
+
content:
|
|
61
|
+
application/json:
|
|
62
|
+
schema:
|
|
63
|
+
$ref: "#/components/schemas/TrafficRestrictionsPublication"
|
|
64
|
+
"401":
|
|
65
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
66
|
+
"404":
|
|
67
|
+
description: Not found
|
|
68
|
+
|
|
69
|
+
components:
|
|
70
|
+
responses:
|
|
71
|
+
UnauthorizedError:
|
|
72
|
+
description: API key is missing or invalid
|
|
73
|
+
headers:
|
|
74
|
+
WWW_Authenticate:
|
|
75
|
+
schema:
|
|
76
|
+
type: string
|
|
77
|
+
|
|
78
|
+
schemas:
|
|
79
|
+
TrafficRestrictionsPublication:
|
|
80
|
+
type: object
|
|
81
|
+
properties:
|
|
82
|
+
modelBaseVersion:
|
|
83
|
+
type: string
|
|
84
|
+
example: 2
|
|
85
|
+
situationPublicationLight:
|
|
86
|
+
type: object
|
|
87
|
+
properties:
|
|
88
|
+
lang:
|
|
89
|
+
type: string
|
|
90
|
+
example: cs
|
|
91
|
+
publicationTime:
|
|
92
|
+
type: string
|
|
93
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
94
|
+
publicationCreator:
|
|
95
|
+
type: object
|
|
96
|
+
properties:
|
|
97
|
+
country:
|
|
98
|
+
type: string
|
|
99
|
+
example: cz
|
|
100
|
+
nationalIdentifier:
|
|
101
|
+
type: string
|
|
102
|
+
example: DIC
|
|
103
|
+
situation:
|
|
104
|
+
type: array
|
|
105
|
+
items:
|
|
106
|
+
$ref: "#/components/schemas/TrafficRestrictionsSituation"
|
|
107
|
+
|
|
108
|
+
TrafficRestrictionsSituation:
|
|
109
|
+
type: object
|
|
110
|
+
properties:
|
|
111
|
+
id:
|
|
112
|
+
type: string
|
|
113
|
+
example: d5321261-0cf1-47ae-a1d6-39cb8aab3874
|
|
114
|
+
version:
|
|
115
|
+
type: integer
|
|
116
|
+
format: int64
|
|
117
|
+
example: 10
|
|
118
|
+
situationRecord:
|
|
119
|
+
type: array
|
|
120
|
+
items:
|
|
121
|
+
$ref: "#/components/schemas/TrafficRestrictionsSituationRecord"
|
|
122
|
+
|
|
123
|
+
TrafficRestrictionsSituationRecord:
|
|
124
|
+
type: object
|
|
125
|
+
properties:
|
|
126
|
+
situationRecordCreationTime:
|
|
127
|
+
type: string
|
|
128
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
129
|
+
situationRecordVersionTime:
|
|
130
|
+
type: string
|
|
131
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
132
|
+
startTime:
|
|
133
|
+
type: string
|
|
134
|
+
example: "2021-06-21T10:00:37.000Z"
|
|
135
|
+
endTime:
|
|
136
|
+
type: string
|
|
137
|
+
example: "2021-06-28T10:00:37.000Z"
|
|
138
|
+
type:
|
|
139
|
+
type: string
|
|
140
|
+
example: GeneralObstruction
|
|
141
|
+
version:
|
|
142
|
+
type: string
|
|
143
|
+
example: 1
|
|
144
|
+
generalPublicComment:
|
|
145
|
+
type: object
|
|
146
|
+
properties:
|
|
147
|
+
cs:
|
|
148
|
+
type: string
|
|
149
|
+
example: Od 27.7.2021 10:50 do 11:55; v ulici K Barrandovu v obci Praha; porouchané vozidlo
|
|
150
|
+
sourceName:
|
|
151
|
+
type: string
|
|
152
|
+
example: PCR
|
|
153
|
+
impact:
|
|
154
|
+
type: object
|
|
155
|
+
properties:
|
|
156
|
+
delays:
|
|
157
|
+
type: object
|
|
158
|
+
properties:
|
|
159
|
+
type:
|
|
160
|
+
type: string
|
|
161
|
+
nullable: true
|
|
162
|
+
example: delays
|
|
163
|
+
timeValue:
|
|
164
|
+
type: integer
|
|
165
|
+
format: int64
|
|
166
|
+
nullable: true
|
|
167
|
+
example: 3600
|
|
168
|
+
numberOfLanesRestricted:
|
|
169
|
+
type: integer
|
|
170
|
+
format: int64
|
|
171
|
+
example: 1
|
|
172
|
+
numberOfOperationalLanes:
|
|
173
|
+
type: integer
|
|
174
|
+
format: int64
|
|
175
|
+
example: 1
|
|
176
|
+
trafficConstructionType:
|
|
177
|
+
type: string
|
|
178
|
+
example: lanesBlocked
|
|
179
|
+
alertCLinear:
|
|
180
|
+
type: object
|
|
181
|
+
properties:
|
|
182
|
+
type:
|
|
183
|
+
type: string
|
|
184
|
+
example: AlertCMethod2Linear
|
|
185
|
+
alertCLocationCountryCode:
|
|
186
|
+
type: string
|
|
187
|
+
example: CZ
|
|
188
|
+
alertCLocationTableNumber:
|
|
189
|
+
type: string
|
|
190
|
+
example: 25
|
|
191
|
+
alertCLocationTableVersion:
|
|
192
|
+
type: string
|
|
193
|
+
example: "8.0"
|
|
194
|
+
alertCDirection:
|
|
195
|
+
type: object
|
|
196
|
+
properties:
|
|
197
|
+
alertCDirectionCoded:
|
|
198
|
+
type: string
|
|
199
|
+
example: negative
|
|
200
|
+
alertCMethod2PrimaryPointLocation:
|
|
201
|
+
type: object
|
|
202
|
+
properties:
|
|
203
|
+
alertCLocation:
|
|
204
|
+
type: object
|
|
205
|
+
properties:
|
|
206
|
+
specificLocation:
|
|
207
|
+
type: string
|
|
208
|
+
example: 1406
|
|
209
|
+
alertCMethod2SecondaryPointLocation:
|
|
210
|
+
type: object
|
|
211
|
+
properties:
|
|
212
|
+
alertCLocation:
|
|
213
|
+
type: object
|
|
214
|
+
properties:
|
|
215
|
+
specificLocation:
|
|
216
|
+
type: string
|
|
217
|
+
example: 1406
|
|
218
|
+
osmPath:
|
|
219
|
+
type: string
|
|
220
|
+
nullable: true
|
|
221
|
+
example: "[30372268, 1945960089, 1663150068, 30372270, 1945960092, 30372272, 1945960105]"
|
package/package.json
CHANGED
|
@@ -1,74 +1,77 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
2
|
+
"name": "@golemio/ndic",
|
|
3
|
+
"version": "1.0.5-dev.418425980",
|
|
4
|
+
"description": "Golemio NDIC Module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
9
|
+
"build-minimal": "run-s 'build --sourceMap false --declaration false'",
|
|
10
|
+
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
11
|
+
"pretest": "golemio-import-test-data",
|
|
12
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
|
|
13
|
+
"apidocs-test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' ts-node -r dotenv/config test/api-docs/index.ts",
|
|
14
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
15
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
16
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
17
|
+
"lint": "eslint '{src,test}/**/*.ts'"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"golemio"
|
|
21
|
+
],
|
|
22
|
+
"author": "Operator ICT, a.s.",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/ndic"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@commitlint/cli": "^11.0.0",
|
|
30
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
31
|
+
"@golemio/core": "1.1.6",
|
|
32
|
+
"@golemio/eslint-config": "^1.0.2",
|
|
33
|
+
"@golemio/schema-definitions": "2.0.19",
|
|
34
|
+
"@types/body-parser-xml": "^1.1.0",
|
|
35
|
+
"@types/chai": "4.2.3",
|
|
36
|
+
"@types/chai-as-promised": "7.1.2",
|
|
37
|
+
"@types/mocha": "^8.2.0",
|
|
38
|
+
"@types/node": "^14.14.20",
|
|
39
|
+
"@types/sinon": "^9.0.10",
|
|
40
|
+
"@types/supertest": "^2.0.10",
|
|
41
|
+
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
42
|
+
"body-parser": "^1.19.0",
|
|
43
|
+
"body-parser-xml": "^2.0.0",
|
|
44
|
+
"chai": "4.2.0",
|
|
45
|
+
"chai-as-promised": "7.1.1",
|
|
46
|
+
"cross-env": "^7.0.3",
|
|
47
|
+
"dotenv": "^8.2.0",
|
|
48
|
+
"eslint": "^7.17.0",
|
|
49
|
+
"husky": "^4.3.7",
|
|
50
|
+
"mocha": "^8.2.1",
|
|
51
|
+
"npm-run-all": "^4.1.5",
|
|
52
|
+
"nyc": "^15.1.0",
|
|
53
|
+
"prettier": "^2.2.1",
|
|
54
|
+
"pretty-quick": "^3.1.0",
|
|
55
|
+
"rimraf": "^3.0.2",
|
|
56
|
+
"sinon": "^9.2.3",
|
|
57
|
+
"source-map-support": "0.5.19",
|
|
58
|
+
"supertest": "^6.0.1",
|
|
59
|
+
"ts-node": "^9.1.1",
|
|
60
|
+
"ttypescript": "^1.5.12",
|
|
61
|
+
"typedoc": "^0.21.4",
|
|
62
|
+
"typescript": "^4.1.3"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@golemio/core": "^1.0.5"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@apideck/portman": "^1.8.1",
|
|
69
|
+
"ajv": "^8.2.0",
|
|
70
|
+
"xsd2jsonschema": "^0.3.7"
|
|
71
|
+
},
|
|
72
|
+
"resolutions": {
|
|
73
|
+
"xmldom": "github:xmldom/xmldom#0.7.0",
|
|
74
|
+
"mpath": "^0.8.4",
|
|
75
|
+
"apicache": "1.6.3"
|
|
76
|
+
}
|
|
74
77
|
}
|