@golemio/ndic 1.0.4-dev.380918836 → 1.0.5-dev.409436663
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/db/example/sql_dump.sql +3 -3
- package/dist/integration-engine/models/RsdTmcPointsModel.js.map +1 -1
- package/dist/integration-engine/transformations/TrafficRestrictionsInterface.d.ts +5 -3
- 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 +1 -3
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js +38 -60
- package/dist/output-gateway/transformations/OutputTrafficRestrictionsTransformation.js.map +1 -1
- package/docs/openapi.yaml +221 -0
- package/package.json +5 -3
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"}
|
|
@@ -108,8 +108,10 @@ export interface IOutputApiSituationRecord {
|
|
|
108
108
|
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
|
$: {
|
|
@@ -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,SAA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AAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACzC;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QA9BE,IAAI,CAAC,wBAAwB,GAAG,IAAI,iCAAwB,EAAE,CAAC;QAC/D,IAAI,CAAC,uCAAuC,GAAG,IAAI,iFAAuC,EAAE,CAAC;QAE7F,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,eAAe,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;;;;;;;W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A0B,EAAE;YACzD,MAAM,IAAI,4BAAW,CAAC,iBAAiB,EAAE,IAAI,EAAE,0BAA0B,CAAC,CAAC;QAC/E,CAAC,CAAA,CAAC;IA9DF,CAAC;CA+DJ;AAtED,4DAsEC"}
|
|
@@ -4,11 +4,9 @@ export declare class OutputTrafficRestrictionsTransformation {
|
|
|
4
4
|
name: string;
|
|
5
5
|
protected rsdTmcOsmMappingModel: RsdTmcOsmMappingModel;
|
|
6
6
|
constructor();
|
|
7
|
-
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;
|
|
12
11
|
private groupByOneProperty;
|
|
13
|
-
private groupByProperties;
|
|
14
12
|
}
|
|
@@ -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,32 +37,35 @@ 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
|
+
}
|
|
67
65
|
resultSituationsArr.push({
|
|
68
|
-
id:
|
|
69
|
-
version: +
|
|
70
|
-
situationRecord: yield this.transformRecordsArr(
|
|
66
|
+
id: key,
|
|
67
|
+
version: +recordsArr[0].situation_version,
|
|
68
|
+
situationRecord: yield this.transformRecordsArr(recordsArr),
|
|
71
69
|
});
|
|
72
70
|
}
|
|
73
71
|
return resultSituationsArr;
|
|
@@ -94,7 +92,7 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
94
92
|
type: record.situation_record_type,
|
|
95
93
|
version: record.situation_record_version,
|
|
96
94
|
generalPublicComment: this.generalPublicCommentParsing(record.general_public_comment),
|
|
97
|
-
sourceName:
|
|
95
|
+
sourceName: record.source,
|
|
98
96
|
impact: {
|
|
99
97
|
delays: {
|
|
100
98
|
type: record.impact_delays_type,
|
|
@@ -129,32 +127,12 @@ class OutputTrafficRestrictionsTransformation {
|
|
|
129
127
|
return resultRecordsArr;
|
|
130
128
|
});
|
|
131
129
|
}
|
|
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
130
|
generalPublicCommentParsing(comment) {
|
|
144
131
|
if (!comment)
|
|
145
132
|
return null;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
for (const oneLanguageCommentStr of commentsStrArr) {
|
|
150
|
-
const commentObj = JSON.parse(oneLanguageCommentStr);
|
|
151
|
-
resultObj[commentObj.comment.values.value["$"].lang] = commentObj.comment.values.value["_"];
|
|
152
|
-
}
|
|
153
|
-
return resultObj;
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
133
|
+
return {
|
|
134
|
+
cs: comment,
|
|
135
|
+
};
|
|
158
136
|
}
|
|
159
137
|
}
|
|
160
138
|
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,CAAC,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;yBACnG,gBAAgB;oBACrB,kBAAkB,EAAE;wBAChB,OAAO,EAAE,IAAI;wB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,MAAM,CAAC,4BAA4B,CAAC;iBACjF,CAAC,CAAC;aACN;YACD,OAAO,gBAAgB,CAAC;;KAC3B;IAEO,2BAA2B,CAAC,OAA2B;QAC3D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO;YACH,EAAE,EAAE,OAAO;SACd,CAAC;IACN,CAAC;CASJ;AAnID,0FAmIC"}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/ndic",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5-dev.409436663",
|
|
4
4
|
"description": "Golemio NDIC Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
11
11
|
"pretest": "golemio-import-test-data",
|
|
12
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",
|
|
13
14
|
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
14
15
|
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
15
16
|
"generate-docs": "typedoc --out docs/typedoc src",
|
|
@@ -27,9 +28,9 @@
|
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@commitlint/cli": "^11.0.0",
|
|
29
30
|
"@commitlint/config-conventional": "^11.0.0",
|
|
30
|
-
"@golemio/core": "1.1.
|
|
31
|
+
"@golemio/core": "1.1.6",
|
|
31
32
|
"@golemio/eslint-config": "^1.0.2",
|
|
32
|
-
"@golemio/schema-definitions": "2.0.19
|
|
33
|
+
"@golemio/schema-definitions": "2.0.19",
|
|
33
34
|
"@types/body-parser-xml": "^1.1.0",
|
|
34
35
|
"@types/chai": "4.2.3",
|
|
35
36
|
"@types/chai-as-promised": "7.1.2",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"@golemio/core": "^1.0.5"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
68
|
+
"@apideck/portman": "^1.8.1",
|
|
67
69
|
"ajv": "^8.2.0",
|
|
68
70
|
"xsd2jsonschema": "^0.3.7"
|
|
69
71
|
},
|